From ef256c958066c19bb10cbe9745bdf96b6514762d Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Tue, 6 Feb 2007 03:23:52 +0000 Subject: r21167: - Upgrade to latest released qooxdoo. This is step 1 of the upgrade process, which involves adding the latest SDK. This new version has not 2, but 4 icon themes. In order to quiet Andrew B. who thinks that 9000+ files in a gui api is too many (come on, disk space is free these days :-), I have removed 3 of the 4 icon themes, leaving only the default, Nuvola. That lowers the file count by 1/3. I'm sure Andrew still isn't happy, but I hope he's a bit happier... Step 2 will make him happier yet. (This used to be commit d161c1382c36238105b85d0499d5a1011f580f52) --- .../frontend/framework/tool/generator.py | 1083 ++++++++ .../framework/tool/icon/data/freedesktop_spec.dat | 273 ++ .../framework/tool/icon/data/kde_freedesktop.dat | 355 +++ .../framework/tool/icon/data/kde_normalize.dat | 62 + .../tool/icon/data/qooxdoo_freedesktop.dat | 191 ++ .../framework/tool/icon/data/qooxdoo_whitelist.dat | 816 ++++++ .../framework/tool/icon/freedesktop-to-qooxdoo.sh | 53 + .../framework/tool/icon/generate-whitelist.sh | 38 + .../framework/tool/icon/kde-to-freedesktop.sh | 33 + .../framework/tool/icon/modules/fix-names.py | 184 ++ .../tool/icon/modules/kde-to-freedesktop.py | 126 + .../framework/tool/icon/normalize-kde-themes.sh | 62 + .../framework/tool/icon/prepare-kde-themes.sh | 62 + .../framework/tool/icon/scalable-to-png.sh | 61 + .../frontend/framework/tool/make/apiviewer.mk | 28 + .../frontend/framework/tool/make/application.mk | 385 +++ .../frontend/framework/tool/make/framework.mk | 98 + .../frontend/framework/tool/make/impl.mk | 431 +++ .../frontend/framework/tool/make/project.mk | 40 + .../frontend/framework/tool/make/targets.mk | 49 + .../tool/migration/0.5.2/info/01-changes.dat | 2 + .../tool/migration/0.6.1/info/01-windowevents.dat | 6 + .../tool/migration/0.6.1/patches/01-xml.dat | 1 + .../migration/0.6.1/patches/02-application.dat | 1 + .../tool/migration/0.6.2/info/01-nativewindow.dat | 2 + .../migration/0.6.2/info/02-functionextension.dat | 1 + .../tool/migration/0.6.2/patches/01-parent.dat | 2 + .../tool/migration/0.6.3/patches/01-constants.dat | 293 ++ .../tool/migration/0.6.3/patches/02-oo.dat | 54 + .../tool/migration/0.6.3/patches/03-widget.dat | 68 + .../migration/0.6.3/patches/04-nativewindow.dat | 12 + .../tool/migration/0.6.3/patches/05-font.dat | 10 + .../tool/migration/0.6.3/patches/06-border.dat | 17 + .../tool/migration/0.6.3/patches/07-color.dat | 2 + .../tool/migration/0.6.3/patches/08-image.dat | 7 + .../tool/migration/0.6.3/patches/09-tree.dat | 8 + .../tool/migration/0.6.3/patches/10-table.dat | 25 + .../tool/migration/0.6.3/patches/11-embed.dat | 8 + .../tool/migration/0.6.3/patches/12-label.dat | 21 + .../tool/migration/0.6.3/patches/13-window.dat | 8 + .../migration/0.6.3/patches/14-colorselector.dat | 11 + .../migration/0.6.3/patches/15-datechooser.dat | 5 + .../tool/migration/0.6.3/patches/16-button.dat | 3 + .../tool/migration/0.6.3/patches/17-selection.dat | 3 + .../tool/migration/0.6.3/patches/40-classnames.dat | 74 + .../tool/migration/0.6.4/info/01-locale.dat | 23 + .../tool/migration/0.6.4/info/02-deprecated.dat | 11 + .../tool/migration/0.6.5/info/01-mime.dat | 1 + .../tool/migration/0.6.5/info/02-iconcleanup.dat | 171 ++ .../tool/migration/0.6.5/info/03-icons.dat | 73 + .../tool/migration/0.6.5/patches/01-locale.dat | 2 + .../tool/migration/0.6.5/patches/02-spinner.dat | 8 + .../tool/migration/0.6.5/patches/03-api.dat | 22 + .../tool/migration/0.6.5/patches/04-string.dat | 14 + .../tool/migration/0.6.5/patches/05-xml.dat | 139 + .../tool/migration/0.6.5/patches/06-mime.dat | 8 + .../tool/migration/0.6.5/patches/07-icons.dat | 114 + .../tool/migration/0.6.5/patches/08-genvar.dat | 1 + .../tool/migration/0.6/info/01-prototypes.dat | 32 + .../tool/migration/0.6/info/02-obsolete.dat | 3 + .../tool/migration/0.6/patches/01-classnames.dat | 209 ++ .../tool/migration/0.6/patches/02-domapi.dat | 38 + .../tool/migration/0.6/patches/03-const.dat | 55 + .../tool/migration/0.6/patches/04-events.dat | 56 + .../tool/migration/0.6/patches/05-util.dat | 47 + .../tool/migration/0.6/patches/06-main.dat | 7 + .../frontend/framework/tool/migration/0.7/patch.py | 381 +++ .../frontend/framework/tool/modules/ElementPath.py | 196 ++ .../frontend/framework/tool/modules/ElementTree.py | 1254 +++++++++ .../frontend/framework/tool/modules/api.py | 987 +++++++ .../framework/tool/modules/checklocales.py | 52 + .../frontend/framework/tool/modules/cldr.py | 230 ++ .../frontend/framework/tool/modules/comment.py | 942 +++++++ .../frontend/framework/tool/modules/compiler.py | 1495 ++++++++++ .../frontend/framework/tool/modules/config.py | 187 ++ .../frontend/framework/tool/modules/filetool.py | 114 + .../frontend/framework/tool/modules/graph.py | 73 + .../frontend/framework/tool/modules/loader.py | 827 ++++++ .../frontend/framework/tool/modules/mapper.py | 37 + .../frontend/framework/tool/modules/migrator.py | 326 +++ .../frontend/framework/tool/modules/msgfmt.py | 273 ++ .../frontend/framework/tool/modules/obfuscator.py | 456 +++ .../frontend/framework/tool/modules/optparseext.py | 35 + .../frontend/framework/tool/modules/resources.py | 158 ++ .../frontend/framework/tool/modules/settings.py | 115 + .../framework/tool/modules/stringoptimizer.py | 198 ++ .../frontend/framework/tool/modules/svninfo.py | 70 + .../frontend/framework/tool/modules/textile.py | 2910 ++++++++++++++++++++ .../frontend/framework/tool/modules/textutil.py | 162 ++ .../frontend/framework/tool/modules/tokenizer.py | 372 +++ .../frontend/framework/tool/modules/tree.py | 582 ++++ .../framework/tool/modules/treegenerator.py | 1039 +++++++ .../framework/tool/modules/variableoptimizer.py | 144 + .../frontend/framework/tool/presets/core.dat | 12 + .../frontend/framework/tool/presets/io.dat | 12 + .../frontend/framework/tool/presets/packages.dat | 25 + 96 files changed, 19772 insertions(+) create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/generator.py create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/freedesktop_spec.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/kde_freedesktop.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/kde_normalize.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/qooxdoo_freedesktop.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/qooxdoo_whitelist.dat create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/freedesktop-to-qooxdoo.sh create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/generate-whitelist.sh create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/kde-to-freedesktop.sh create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/modules/fix-names.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/modules/kde-to-freedesktop.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/normalize-kde-themes.sh create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/prepare-kde-themes.sh create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/scalable-to-png.sh create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/apiviewer.mk create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/application.mk create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/framework.mk create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/impl.mk create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/project.mk create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/targets.mk create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.5.2/info/01-changes.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/info/01-windowevents.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/patches/01-xml.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/patches/02-application.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/info/01-nativewindow.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/info/02-functionextension.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/patches/01-parent.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/01-constants.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/02-oo.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/03-widget.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/04-nativewindow.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/05-font.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/06-border.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/07-color.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/08-image.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/09-tree.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/10-table.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/11-embed.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/12-label.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/13-window.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/14-colorselector.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/15-datechooser.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/16-button.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/17-selection.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/40-classnames.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.4/info/01-locale.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.4/info/02-deprecated.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/01-mime.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/02-iconcleanup.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/03-icons.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/01-locale.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/02-spinner.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/03-api.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/04-string.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/05-xml.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/06-mime.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/07-icons.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/08-genvar.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/info/01-prototypes.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/info/02-obsolete.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/01-classnames.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/02-domapi.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/03-const.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/04-events.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/05-util.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/06-main.dat create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.7/patch.py create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/ElementPath.py create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/ElementTree.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/api.py create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/checklocales.py create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/cldr.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/comment.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/compiler.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/config.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/filetool.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/graph.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/loader.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/mapper.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/migrator.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/msgfmt.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/obfuscator.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/optparseext.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/resources.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/settings.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/stringoptimizer.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/svninfo.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/textile.py create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/textutil.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/tokenizer.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/tree.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/treegenerator.py create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/variableoptimizer.py create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/core.dat create mode 100644 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/io.dat create mode 100755 webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/packages.dat (limited to 'webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool') diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/generator.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/generator.py new file mode 100755 index 0000000000..76df2d923b --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/generator.py @@ -0,0 +1,1083 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Andreas Ecker (ecker) +# * Fabian Jakobs (fjakobs) +# * Alessandro Sala (asala) +# +################################################################################ + +import sys, re, os, optparse, math + +# reconfigure path to import own modules from modules subfolder +sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), "modules")) + +import config, tokenizer, loader, api, tree, treegenerator, settings, resources +import filetool, stringoptimizer, optparseext, variableoptimizer, obfuscator, compiler +import migrator, textutil, graph + + + + + + +def getparser(): + parser = optparse.OptionParser("usage: %prog [options]", option_class=optparseext.ExtendAction) + + + ################################################################################# + # GENERAL + ################################################################################# + + # From/To File + parser.add_option("--from-file", dest="fromFile", metavar="FILENAME", help="Read options from FILENAME.") + parser.add_option("--export-to-file", dest="exportToFile", metavar="FILENAME", help="Store options to FILENAME.") + + # Directories (Lists, Match using index) + parser.add_option("--class-path", action="extend", dest="classPath", metavar="DIRECTORY", type="string", default=[], help="Define a script input directory.") + parser.add_option("--class-uri", action="extend", dest="classUri", metavar="PATH", type="string", default=[], help="Define a script path for the source version.") + parser.add_option("--class-encoding", action="extend", dest="classEncoding", metavar="ENCODING", type="string", default=[], help="Define the encoding for a script input directory.") + parser.add_option("--resource-input", action="extend", dest="resourceInput", metavar="DIRECTORY", type="string", default=[], help="Define a resource input directory.") + parser.add_option("--resource-output", action="extend", dest="resourceOutput", metavar="DIRECTORY", type="string", default=[], help="Define a resource output directory.") + + # Available Actions + parser.add_option("--generate-compiled-script", action="store_true", dest="generateCompiledScript", default=False, help="Compile source files.") + parser.add_option("--generate-source-script", action="store_true", dest="generateSourceScript", default=False, help="Generate source version.") + parser.add_option("--generate-api-documentation", action="store_true", dest="generateApiDocumentation", default=False, help="Generate API documentation.") + parser.add_option("--copy-resources", action="store_true", dest="copyResources", default=False, help="Copy resource files.") + parser.add_option("--fix-source", action="store_true", dest="fixSource", default=False, help="Fix source files") + parser.add_option("--pretty-print", action="store_true", dest="prettyPrint", default=False, help="Pretty print source code.") + parser.add_option("--migrate-source", action="store_true", dest="migrateSource", default=False, help="Migrate existing code to new version.") + + # Debug Actions + parser.add_option("--store-tokens", action="store_true", dest="storeTokens", default=False, help="Store tokenized content of source files. (Debugging)") + parser.add_option("--store-tree", action="store_true", dest="storeTree", default=False, help="Store tree content of source files. (Debugging)") + parser.add_option("--print-files", action="store_true", dest="printFiles", default=False, help="Output known files. (Debugging)") + parser.add_option("--print-modules", action="store_true", dest="printModules", default=False, help="Output known modules. (Debugging)") + parser.add_option("--print-files-without-modules", action="store_true", dest="printFilesWithoutModules", default=False, help="Output files which have no module connection. (Debugging)") + parser.add_option("--print-includes", action="store_true", dest="printIncludes", default=False, help="Output sorted file list. (Debugging)") + parser.add_option("--print-dependencies", action="store_true", dest="printDeps", default=False, help="Output dependencies of files. (Debugging)") + parser.add_option("--dependencies-graphviz-file", dest="depDotFile", metavar="FILENAME", help="Save dependencies as graphviz dot file. (Debugging)") + + # Output files + parser.add_option("--source-script-file", dest="sourceScriptFile", metavar="FILENAME", help="Name of output file from source build process.") + parser.add_option("--source-template-input-file", dest="sourceTemplateInputFile", metavar="FILENAME", help="Name of a template file to patch") + parser.add_option("--source-template-output-file", dest="sourceTemplateOutputFile", metavar="FILENAME", help="Name of the resulting file to store the modified template to.") + parser.add_option("--source-template-replace", dest="sourceTemplateReplace", default="", metavar="CODE", help="Content of the template which should be replaced with the script block.") + parser.add_option("--compiled-script-file", dest="compiledScriptFile", metavar="FILENAME", help="Name of output file from compiler.") + parser.add_option("--api-documentation-json-file", dest="apiDocumentationJsonFile", metavar="FILENAME", help="Name of JSON API file.") + parser.add_option("--api-documentation-xml-file", dest="apiDocumentationXmlFile", metavar="FILENAME", help="Name of XML API file.") + parser.add_option("--settings-script-file", dest="settingsScriptFile", metavar="FILENAME", help="Name of settings script file.") + + # Encoding + parser.add_option("--script-output-encoding", dest="scriptOutputEncoding", default="utf-8", metavar="ENCODING", help="Defines the encoding used for script output files.") + parser.add_option("--xml-output-encoding", dest="xmlOutputEncoding", default="utf-8", metavar="ENCODING", help="Defines the encoding used for XML output files.") + + + + ################################################################################# + # OPTIONS + ################################################################################# + + # General options + parser.add_option("-q", "--quiet", action="store_false", dest="verbose", default=False, help="Quiet output mode.") + parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="Verbose output mode.") + parser.add_option("-d", "--debug", action="store_true", dest="enableDebug", help="Enable debug mode.") + parser.add_option("--version", dest="version", default="0.0", metavar="VERSION", help="Version number of qooxdoo") + parser.add_option("--package-id", dest="packageId", default="", metavar="ID", help="Defines a package ID (required for string optimization etc.)") + parser.add_option("--disable-internal-check", action="store_true", dest="disableInternalCheck", default=False, help="Disable check of modifications to internal files.") + + # Options for source and compiled version + parser.add_option("--define-runtime-setting", action="append", dest="defineRuntimeSetting", metavar="NAMESPACE.KEY:VALUE", default=[], help="Define a setting.") + parser.add_option("--add-new-lines", action="store_true", dest="addNewLines", default=False, help="Keep newlines in compiled files.") + + # Options for compiled version + parser.add_option("--add-file-ids", action="store_true", dest="addFileIds", default=False, help="Add file IDs to compiled output.") + parser.add_option("--optimize-strings", action="store_true", dest="optimizeStrings", default=False, help="Optimize strings. Increase mshtml performance.") + parser.add_option("--optimize-variables", action="store_true", dest="optimizeVariables", default=False, help="Optimize variables. Reducing size.") + parser.add_option("--optimize-variables-skip-prefix", action="store", dest="optimizeVariablesSkipPrefix", metavar="PREFIX", default="", help="Skip optimization of variables beginning with PREFIX [default: optimize all variables].") + parser.add_option("--obfuscate-identifiers", action="store_true", dest="obfuscateIdentifiers", default=False, help="Obfuscate public names like function names. (ALPHA!)") + + # Options for resource copying + parser.add_option("--enable-resource-filter", action="store_true", dest="enableResourceFilter", default=False, help="Enable filtering of resource files used by classes (based on #embed).") + + # Options for token/tree storage + parser.add_option("--token-output-directory", dest="tokenOutputDirectory", metavar="DIRECTORY", help="Define output directory for tokenizer result of the incoming JavaScript files. (Debugging)") + parser.add_option("--tree-output-directory", dest="treeOutputDirectory", metavar="DIRECTORY", help="Define output directory for generated tree of the incoming JavaScript files. (Debugging)") + + # Cache Directory + parser.add_option("--cache-directory", dest="cacheDirectory", metavar="DIRECTORY", help="If this is defined the loader trys to use cache to optimize the performance.") + + # Options for migration support + parser.add_option("--migration-target", dest="migrationTarget", metavar="VERSION", help="Define the target for migration of source code.") + parser.add_option("--migration-input", action="extend", dest="migrationInput", metavar="DIRECTORY", type="string", default=[], help="Define additional directories for to directories to migrate e.g. HTML files, ...") + + + + + ################################################################################# + # INCLUDE/EXCLUDE + ################################################################################# + + # Include/Exclude + parser.add_option("-i", "--include", action="extend", dest="includeWithDeps", metavar="ID", type="string", default=[], help="Include ID") + parser.add_option("-e", "--exclude", action="extend", dest="excludeWithDeps", metavar="ID", type="string", default=[], help="Exclude ID") + parser.add_option("--include-without-dependencies", action="extend", dest="includeWithoutDeps", metavar="ID", type="string", default=[], help="Include ID") + parser.add_option("--exclude-without-dependencies", action="extend", dest="excludeWithoutDeps", metavar="ID", type="string", default=[], help="Exclude ID") + + # Include/Exclude options + parser.add_option("--disable-auto-dependencies", action="store_false", dest="enableAutoDependencies", default=True, help="Disable detection of dependencies.") + + return parser + + + + + + +def argparser(cmdlineargs): + + # Parse arguments + (options, args) = getparser().parse_args(cmdlineargs) + + # Export to file + if options.exportToFile != None: + print + print " EXPORTING:" + print "----------------------------------------------------------------------------" + + print " * Translating options..." + + optionString = "# Exported configuration from build.py\n\n" + ignoreValue = True + lastWasKey = False + + for arg in cmdlineargs: + if arg == "--export-to-file": + ignoreValue = True + + elif arg.startswith("--"): + if lastWasKey: + optionString += "\n" + + optionString += arg[2:] + ignoreValue = False + lastWasKey = True + + elif arg.startswith("-"): + print " - Could not export short argument: %s" % arg + optionString += "\n# Ignored short argument %s\n" % arg + ignoreValue = True + + elif not ignoreValue: + optionString += " = %s\n" % arg + ignoreValue = True + lastWasKey = False + + + + print " * Export to file: %s" % options.exportToFile + filetool.save(options.exportToFile, optionString) + + sys.exit(0) + + # Read from file + elif options.fromFile != None: + + print + print " INITIALIZATION:" + print "----------------------------------------------------------------------------" + + print " * Reading configuration..." + + # Convert file content into arguments + fileargs = {} + fileargpos = 0 + fileargid = "default" + currentfileargs = [] + fileargs[fileargid] = currentfileargs + + alternativeFormatBegin = re.compile("\s*\[\s*") + alternativeFormatEnd = re.compile("\s*\]\s*=\s*") + emptyLine = re.compile("^\s*$") + + for line in file(options.fromFile).read().split("\n"): + line = line.strip() + + if emptyLine.match(line) or line.startswith("#") or line.startswith("//"): + continue + + # Translating... + line = alternativeFormatBegin.sub(" = ", line) + line = alternativeFormatEnd.sub(":", line) + + # Splitting line + line = line.split("=") + + # Extract key element + key = line.pop(0).strip() + + # Separate packages + if key == "package": + fileargpos += 1 + fileargid = line[0].strip() + + print " - Found package: %s" % fileargid + + currentfileargs = [] + fileargs[fileargid] = currentfileargs + continue + + currentfileargs.append("--%s" % key) + + if len(line) > 0: + value = line[0].strip() + currentfileargs.append(value) + + # Parse + defaultargs = fileargs["default"] + + if len(fileargs) > 1: + (fileDb, moduleDb) = load(getparser().parse_args(defaultargs)[0]) + + if options.obfuscateIdentifiers: + sharednames = {} + + for filearg in fileargs: + if filearg == "default": + continue + + combinedargs = [] + combinedargs.extend(defaultargs) + combinedargs.extend(fileargs[filearg]) + + options = getparser().parse_args(defaultargs)[0] + findnames(fileDb, moduleDb, options, sharednames) + + names = obfuscator.sort(sharednames) + + for filearg in fileargs: + if filearg == "default": + continue + + print + print + print + print + print " PACKAGE: %s" % filearg + print "----------------------------------------------------------------------------" + + combinedargs = [] + combinedargs.extend(defaultargs) + combinedargs.extend(fileargs[filearg]) + + options = getparser().parse_args(combinedargs)[0] + + if options.obfuscateIdentifiers: + execute(fileDb, moduleDb, options, filearg, names) + else: + execute(fileDb, moduleDb, options, filearg) + + else: + options = getparser().parse_args(defaultargs)[0] + (fileDb, moduleDb) = load(options) + + if options.obfuscateIdentifiers: + execute(fileDb, moduleDb, options, "", obfuscator.sort(findnames(fileDb, moduleDb, options))) + else: + execute(fileDb, moduleDb, options, "") + + else: + print + print " INITIALIZATION:" + print "----------------------------------------------------------------------------" + + print " * Processing arguments..." + + (fileDb, moduleDb) = load(options) + + if options.obfuscateIdentifiers: + execute(fileDb, moduleDb, options, options.packageId, obfuscator.sort(findnames(fileDb, moduleDb, options))) + else: + execute(fileDb, moduleDb, options, options.packageId) + + + + + + + +def main(): + if len(sys.argv[1:]) == 0: + basename = os.path.basename(sys.argv[0]) + print "usage: %s [options]" % basename + print "Try '%s -h' or '%s --help' to show the help message." % (basename, basename) + sys.exit(1) + + argparser(sys.argv[1:]) + + + + + + +def load(options): + + ###################################################################### + # SOURCE LOADER + ###################################################################### + + print + print " SOURCE LOADER:" + print "----------------------------------------------------------------------------" + + if options.classPath == None or len(options.classPath) == 0: + if len(options.migrationInput) == 0: + basename = os.path.basename(sys.argv[0]) + print "You must define at least one script input directory!" + print "usage: %s [options]" % basename + print "Try '%s -h' or '%s --help' to show the help message." % (basename, basename) + sys.exit(1) + + (fileDb, moduleDb) = loader.indexScriptInput(options) + + + + + + ###################################################################### + # DEBUG OUTPUT JOBS + ###################################################################### + + if options.printFiles: + print + print " OUTPUT OF KNOWN FILES:" + print "----------------------------------------------------------------------------" + print " * These are all known files:" + for fileEntry in fileDb: + print " - %s (%s)" % (fileEntry, fileDb[fileEntry]["path"]) + + if options.printModules: + print + print " OUTPUT OF KNOWN MODULES:" + print "----------------------------------------------------------------------------" + print " * These are all known modules:" + for moduleEntry in moduleDb: + print " * %s" % moduleEntry + for fileEntry in moduleDb[moduleEntry]: + print " - %s" % fileEntry + + if options.printFilesWithoutModules: + print + print " OUTPUT OF FILES WHICH HAVE NO MODULE CONNECTION:" + print "----------------------------------------------------------------------------" + print " * These are all files without a module connection:" + for fileEntry in fileDb: + fileFound = False + + for moduleEntry in moduleDb: + for moduleFile in moduleDb[moduleEntry]: + if moduleFile == fileEntry: + fileFound = True + break + + if not fileFound: + print " - %s" % fileEntry + + + + return fileDb, moduleDb + + + + + +def findnames(fileDb, moduleDb, options, names={}): + + print + print " SEARCHING FOR IDENTIFIERS:" + print "----------------------------------------------------------------------------" + + if options.verbose: + print " * Searching..." + else: + print " * Searching: ", + + + sortedIncludeList = loader.getSortedList(options, fileDb, moduleDb) + + for fileId in sortedIncludeList: + if options.verbose: + print " - %s" % fileId + + else: + sys.stdout.write(".") + sys.stdout.flush() + + obfuscator.search(loader.getTree(fileDb, fileId, options), names) + + if not options.verbose: + print + + return names + + + + + + + + +def execute(fileDb, moduleDb, options, pkgid="", names=[]): + + additionalOutput = [] + + + ###################################################################### + # SORT OF INCLUDE LIST + ###################################################################### + + print + print " SORT OF INCLUDE LIST:" + print "----------------------------------------------------------------------------" + + if options.verbose: + print " * Include (with dependencies): %s" % options.includeWithDeps + print " * Include (without dependencies): %s" % options.includeWithoutDeps + print " * Exclude (with dependencies): %s" % options.excludeWithDeps + print " * Exclude (without dependencies): %s" % options.excludeWithoutDeps + + print " * Sorting %s classes..." % len(fileDb) + + sortedIncludeList = loader.getSortedList(options, fileDb, moduleDb) + + if len(sortedIncludeList) == 0: + print " - No class files to include. Exciting!" + sys.exit(1) + else: + print " - Including %s classes" % len(sortedIncludeList) + + if options.printIncludes: + print + print " PRINT OF INCLUDE ORDER:" + print "----------------------------------------------------------------------------" + print " * The files will be included in this order:" + for fileId in sortedIncludeList: + print " - %s" % fileId + + if options.printDeps: + print + print " OUTPUT OF DEPENDENCIES:" + print "----------------------------------------------------------------------------" + print " * These are all included files with their dependencies:" + for fileId in sortedIncludeList: + print " - %s" % fileId + if len(fileDb[fileId]["loadtimeDeps"]) > 0: + print " - Loadtime: " + for depEntry in fileDb[fileId]["loadtimeDeps"]: + print " - %s" % depEntry + + if len(fileDb[fileId]["afterDeps"]) > 0: + print " - After: " + for depEntry in fileDb[fileId]["afterDeps"]: + print " - %s" % depEntry + + if len(fileDb[fileId]["runtimeDeps"]) > 0: + print " - Runtime: " + for depEntry in fileDb[fileId]["runtimeDeps"]: + print " - %s" % depEntry + + if len(fileDb[fileId]["loadDeps"]) > 0: + print " - Load: " + for depEntry in fileDb[fileId]["loadDeps"]: + print " - %s" % depEntry + + if len(fileDb[fileId]["optionalDeps"]) > 0: + print " - Optional: " + for depEntry in fileDb[fileId]["optionalDeps"]: + print " - %s" % depEntry + + + + + + ###################################################################### + # GRAPHVIZ OUTPUT + ###################################################################### + + if options.depDotFile: + graph.store(fileDb, sortedIncludeList, options) + + + + + + + ###################################################################### + # SOURCE MIGRATION + ###################################################################### + + if options.migrateSource: + print + print " SOURCE MIGRATION:" + print "----------------------------------------------------------------------------" + + print " * Migrate Source Code..." + + migrator.handle(sortedIncludeList, fileDb, options) + + # Return after migration: Ignore other jobs + return + + + + + + ###################################################################### + # GENERATION OF PRETTY PRINTED CODE + ###################################################################### + + if options.fixSource: + print + print " FIX SOURCE CODE:" + print "----------------------------------------------------------------------------" + + if options.verbose: + print " * Fixing code..." + else: + print " * Fixing code: ", + + for fileId in sortedIncludeList: + if options.verbose: + print " - Reading %s" % fileId + + fileEntry = fileDb[fileId] + + filePath = fileEntry["path"] + fileEncoding = fileEntry["encoding"] + + fileContent = filetool.read(filePath, fileEncoding) + fixedContent = textutil.removeTrailingSpaces(textutil.tab2Space(textutil.any2Unix(fileContent), 2)) + + if fixedContent != fileContent: + if options.verbose: + print " - Storing modifications..." + else: + sys.stdout.write("!") + sys.stdout.flush() + + filetool.save(filePath, fixedContent, fileEncoding) + + elif not options.verbose: + sys.stdout.write(".") + sys.stdout.flush() + + if not options.verbose: + print + + # Return after fixing: Ignore other jobs + return + + + + + + + ###################################################################### + # GENERATION OF PRETTY PRINTED CODE + ###################################################################### + + if options.prettyPrint: + print + print " GENERATION OF PRETTY PRINTED CODE:" + print "----------------------------------------------------------------------------" + + if options.verbose: + print " * Pretty printing..." + else: + print " * Pretty printing: ", + + for fileId in sortedIncludeList: + if options.verbose: + print " - Compiling %s" % fileId + else: + sys.stdout.write(".") + sys.stdout.flush() + + prettyFileContent = compiler.compile(loader.getTree(fileDb, fileId, options), True) + + if not prettyFileContent.endswith("\n"): + prettyFileContent += "\n" + + filetool.save(fileDb[fileId]["path"], prettyFileContent) + + if not options.verbose: + print + + # Return after pretty print: Ignore other jobs + return + + + + ###################################################################### + # STRING OPTIMIZATION + ###################################################################### + + if options.optimizeStrings: + print + print " STRING OPTIMIZATION:" + print "----------------------------------------------------------------------------" + + if options.verbose: + print " * Searching strings..." + else: + print " * Searching strings: ", + + stringMap = {} + + for fileId in sortedIncludeList: + if options.verbose: + print " - %s" % fileId + else: + sys.stdout.write(".") + sys.stdout.flush() + + localMap = loader.getStrings(fileDb, fileId, options) + + for value in localMap: + if value in stringMap: + stringMap[value] += localMap[value] + else: + stringMap[value] = localMap[value] + + if not options.verbose: + print + + counter = 0 + for value in stringMap: + counter += stringMap[value] + + stringList = stringoptimizer.sort(stringMap) + + print " * Found %s strings (used %s times)" % (len(stringMap), counter) + + if options.verbose: + print " * Replacing strings..." + else: + print " * Replacing strings: ", + + for fileId in sortedIncludeList: + if options.verbose: + print " - %s" % fileId + else: + sys.stdout.write(".") + sys.stdout.flush() + + stringoptimizer.replace(loader.getTree(fileDb, fileId, options), stringList, "$" + pkgid, options.verbose) + + if not options.verbose: + print + + print " * Generating replacement..." + additionalOutput.append(stringoptimizer.replacement(stringList, "$" + pkgid)) + + + + + + + ###################################################################### + # LOCAL VARIABLE OPTIMIZATION + ###################################################################### + + if options.optimizeVariables: + print + print " LOCAL VARIABLE OPTIMIZATION:" + print "----------------------------------------------------------------------------" + + if options.verbose: + print " * Optimizing variables..." + else: + print " * Optimizing variables: ", + + for fileId in sortedIncludeList: + if options.verbose: + print " - %s" % fileId + else: + sys.stdout.write(".") + sys.stdout.flush() + + variableoptimizer.search(loader.getTree(fileDb, fileId, options), [], 0, "$", skipPrefix = options.optimizeVariablesSkipPrefix, debug = options.enableDebug) + + if not options.verbose: + print + + + + + + + ###################################################################### + # NAME OBFUSCATION + ###################################################################### + + if options.obfuscateIdentifiers: + print + print " OBFUSCATE IDENTIFIERS:" + print "----------------------------------------------------------------------------" + + if options.verbose: + print " * Obfuscating identifiers..." + else: + print " * Obfuscating identifiers: ", + + counter = 0 + + for fileId in sortedIncludeList: + if options.verbose: + print " - %s" % fileId + else: + sys.stdout.write(".") + sys.stdout.flush() + + counter += obfuscator.update(loader.getTree(fileDb, fileId, options), names, "$$") + + if not options.verbose: + print + + print " * Updated %s names" % counter + + + + + + + ###################################################################### + # TOKEN STORAGE + ###################################################################### + + if options.storeTokens: + print + print " TOKEN STORAGE:" + print "----------------------------------------------------------------------------" + + if options.tokenOutputDirectory == None: + print " * You must define the token output directory!" + sys.exit(1) + + if options.verbose: + print " * Storing tokens..." + else: + print " * Storing tokens: ", + + for fileId in sortedIncludeList: + tokenString = tokenizer.convertTokensToString(loader.getTokens(fileDb, fileId, options)) + + if options.verbose: + print " * writing tokens for %s (%s KB)..." % (fileIdm, len(tokenString) / 1000.0) + else: + sys.stdout.write(".") + sys.stdout.flush() + + filetool.save(os.path.join(filetool.normalize(options.tokenOutputDirectory), fileId + config.TOKENEXT), tokenString) + + if not options.verbose: + print + + + + + ###################################################################### + # TREE STORAGE + ###################################################################### + + if options.storeTree: + print + print " TREE STORAGE:" + print "----------------------------------------------------------------------------" + + if options.treeOutputDirectory == None: + print " * You must define the tree output directory!" + sys.exit(1) + + if options.verbose: + print " * Storing tree..." + else: + print " * Storing tree: ", + + for fileId in sortedIncludeList: + treeString = "\n" + tree.nodeToXmlString(loader.getTree(fileDb, fileId, options)) + + if options.verbose: + print " * writing tree for %s (%s KB)..." % (fileId, len(treeString) / 1000.0) + else: + sys.stdout.write(".") + sys.stdout.flush() + + filetool.save(os.path.join(filetool.normalize(options.treeOutputDirectory), fileId + config.XMLEXT), treeString) + + if not options.verbose: + print + + + + + + ###################################################################### + # GENERATION OF API + ###################################################################### + + if options.generateApiDocumentation: + print + print " GENERATION OF API:" + print "----------------------------------------------------------------------------" + + if options.apiDocumentationJsonFile == None and options.apiDocumentationXmlFile == None: + print " * You must define one of JSON or XML API documentation file!" + + docTree = None + + if options.verbose: + print " * Generating API tree..." + else: + print " * Generating API tree: ", + + for fileId in sortedIncludeList: + if options.verbose: + print " - %s" % fileId + else: + sys.stdout.write(".") + sys.stdout.flush() + + docTree = api.createDoc(loader.getTree(fileDb, fileId, options), docTree) + + if not options.verbose: + print + + if docTree: + print " * Finalizing tree..." + api.postWorkPackage(docTree, docTree) + + if options.apiDocumentationXmlFile != None: + print " * Writing XML API file to %s" % options.apiDocumentationXmlFile + + xmlContent = "\n" + + if options.addNewLines: + xmlContent += "\n" + tree.nodeToXmlString(docTree) + else: + xmlContent += tree.nodeToXmlString(docTree, "", "", "") + + filetool.save(options.apiDocumentationXmlFile, xmlContent, options.xmlOutputEncoding) + + if options.apiDocumentationJsonFile != None: + print " * Writing JSON API file to %s" % options.apiDocumentationJsonFile + + if options.addNewLines: + jsonContent = tree.nodeToJsonString(docTree) + else: + jsonContent = tree.nodeToJsonString(docTree, "", "", "") + + filetool.save(options.apiDocumentationJsonFile, jsonContent, options.scriptOutputEncoding) + + + + + + ###################################################################### + # CREATE COPY OF RESOURCES + ###################################################################### + + if options.copyResources: + + print + print " CREATE COPY OF RESOURCES:" + print "----------------------------------------------------------------------------" + + resources.copy(options, sortedIncludeList, fileDb) + + + + + + + ###################################################################### + # GENERATION OF SETTINGS + ###################################################################### + + if options.generateSourceScript or options.generateCompiledScript: + settingsStr = "" + + if len(options.defineRuntimeSetting) != 0: + print + print " GENERATION OF SETTINGS:" + print "----------------------------------------------------------------------------" + + print " * Processing input data..." + settingsStr = settings.generate(options) + + if options.settingsScriptFile: + print " * Storing result to %s" % options.settingsScriptFile + filetool.save(options.settingsScriptFile, settingsStr) + + # clear settings for build and source + settingsStr = "" + + + + + + ###################################################################### + # GENERATION OF SOURCE VERSION + ###################################################################### + + if options.generateSourceScript: + print + print " GENERATION OF SOURCE SCRIPT:" + print "----------------------------------------------------------------------------" + + if options.sourceScriptFile == None and (options.sourceTemplateInputFile == None or options.sourceTemplateOutputFile == None): + print " * You must define at least one source script file or template input/output." + sys.exit(1) + + if options.sourceScriptFile: + options.sourceScriptFile = os.path.normpath(options.sourceScriptFile) + + if options.sourceTemplateInputFile: + options.sourceTemplateInputFile = os.path.normpath(options.sourceTemplateInputFile) + + if options.sourceTemplateOutputFile: + options.sourceTemplateOutputFile = os.path.normpath(options.sourceTemplateOutputFile) + + + print " * Generating script block..." + + # Handling line feed setting + sourceLineFeed = ""; + if options.addNewLines: + sourceLineFeed = "\n"; + + + # Generating inline code... + inlineCode = "" + inlineCode += settingsStr + sourceLineFeed + inlineCode += "qx.IS_SOURCE=true;%s" % sourceLineFeed + inlineCode += "qx.VERSION=\"%s\";%s" % (options.version, sourceLineFeed) + inlineCode += "".join(additionalOutput) + + + # Generating script block + scriptBlocks = "" + scriptBlocks += '' % inlineCode + for fileId in sortedIncludeList: + if fileDb[fileId]["classUri"] == None: + print " * Missing class URI definition for class path %s." % fileDb[fileId]["classPath"] + sys.exit(1) + + scriptBlocks += '' % (os.path.join(fileDb[fileId]["classUri"], fileDb[fileId]["pathId"].replace(".", os.sep)), config.JSEXT) + scriptBlocks += sourceLineFeed + + + + if options.sourceScriptFile != None: + print " * Storing includer as %s..." % options.sourceScriptFile + sourceScript = "document.write('%s');" % scriptBlocks.replace("'", "\\'") + if options.addNewLines: + sourceScript = sourceScript.replace("\n", "\\\n") + filetool.save(options.sourceScriptFile, sourceScript, options.scriptOutputEncoding) + + if options.sourceTemplateInputFile != None and options.sourceTemplateOutputFile != None: + print " * Patching template: %s => %s" % (options.sourceTemplateInputFile, options.sourceTemplateOutputFile) + tmpl = filetool.read(options.sourceTemplateInputFile) + res = tmpl.replace(options.sourceTemplateReplace, scriptBlocks) + filetool.save(options.sourceTemplateOutputFile, res, options.scriptOutputEncoding) + + + + + + ###################################################################### + # GENERATION OF COMPILED VERSION + ###################################################################### + + if options.generateCompiledScript: + print + print " GENERATION OF COMPILED SCRIPT:" + print "----------------------------------------------------------------------------" + + buildLineFeed = ""; + if options.addNewLines: + buildLineFeed = "\n"; + + inlineCode = "" + inlineCode += settingsStr + buildLineFeed + inlineCode += "qx.IS_SOURCE=false;%s" % buildLineFeed + inlineCode += "qx.VERSION=\"%s\";%s" % (options.version, buildLineFeed) + inlineCode += "".join(additionalOutput) + + compiledOutput = inlineCode + + if options.compiledScriptFile == None: + print " * You must define the compiled script file!" + sys.exit(1) + + if options.verbose: + print " * Compiling..." + else: + print " * Compiling: ", + + for fileId in sortedIncludeList: + if options.verbose: + print " - Compiling %s" % fileId + else: + sys.stdout.write(".") + sys.stdout.flush() + + compiledFileContent = compiler.compile(loader.getTree(fileDb, fileId, options), False, options.addNewLines, options.enableDebug) + + if options.addFileIds: + compiledOutput += "\n\n\n/* ID: " + fileId + " */\n" + compiledFileContent + "\n" + else: + compiledOutput += compiledFileContent + + if not compiledOutput.endswith(";") and not compiledOutput.endswith("\n"): + compiledOutput += ";" + + if not options.verbose: + print + + print " * Storing output as %s..." % options.compiledScriptFile + filetool.save(options.compiledScriptFile, compiledOutput, options.scriptOutputEncoding) + + + + + + + +###################################################################### +# MAIN LOOP +###################################################################### + +if __name__ == '__main__': + try: + main() + + except KeyboardInterrupt: + print + print " * Keyboard Interrupt" + sys.exit(1) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/freedesktop_spec.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/freedesktop_spec.dat new file mode 100644 index 0000000000..28093bad91 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/freedesktop_spec.dat @@ -0,0 +1,273 @@ +################################################################################ +# +# Freedesktop Icon Naming Specification 0.8 +# http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html +# +################################################################################ + +actions/address-book-new +actions/application-exit +actions/appointment-new +actions/contact-new +actions/dialog-cancel +actions/dialog-close +actions/dialog-ok +actions/document-new +actions/document-open +actions/document-open-recent +actions/document-page-setup +actions/document-print +actions/document-print-preview +actions/document-properties +actions/document-revert +actions/document-save +actions/document-save-as +actions/edit-copy +actions/edit-cut +actions/edit-delete +actions/edit-find +actions/edit-find-replace +actions/edit-paste +actions/edit-redo +actions/edit-select-all +actions/edit-undo +actions/folder-new +actions/format-indent-less +actions/format-indent-more +actions/format-justify-center +actions/format-justify-fill +actions/format-justify-left +actions/format-justify-right +actions/format-text-direction-ltr +actions/format-text-direction-rtl +actions/format-text-bold +actions/format-text-italic +actions/format-text-underline +actions/format-text-strikethrough +actions/go-bottom +actions/go-down +actions/go-first +actions/go-home +actions/go-jump +actions/go-last +actions/go-next +actions/go-previous +actions/go-top +actions/go-up +actions/help-about +actions/help-contents +actions/help-faq +actions/insert-image +actions/insert-link +actions/insert-object +actions/insert-text +actions/list-add +actions/list-remove +actions/mail-forward +actions/mail-mark-important +actions/mail-mark-junk +actions/mail-mark-notjunk +actions/mail-mark-read +actions/mail-mark-unread +actions/mail-message-new +actions/mail-reply-all +actions/mail-reply-sender +actions/mail-send +actions/mail-send-receive +actions/media-eject +actions/media-playback-pause +actions/media-playback-start +actions/media-playback-stop +actions/media-record +actions/media-seek-backward +actions/media-seek-forward +actions/media-skip-backward +actions/media-skip-forward +actions/object-flip-horizontal +actions/object-flip-vertical +actions/object-rotate-left +actions/object-rotate-right +actions/system-lock-screen +actions/system-log-out +actions/system-run +actions/system-search +actions/tools-check-spelling +actions/view-fullscreen +actions/view-refresh +actions/view-restore +actions/view-sort-ascending +actions/view-sort-descending +actions/window-close +actions/window-new +actions/zoom-best-fit +actions/zoom-in +actions/zoom-original +actions/zoom-out +apps/accessories-calculator +apps/accessories-character-map +apps/accessories-dictionary +apps/accessories-text-editor +apps/help-browser +apps/multimedia-volume-control +apps/preferences-desktop-accessibility +apps/preferences-desktop-font +apps/preferences-desktop-keyboard +apps/preferences-desktop-locale +apps/preferences-desktop-multimedia +apps/preferences-desktop-screensaver +apps/preferences-desktop-theme +apps/preferences-desktop-wallpaper +apps/system-file-manager +apps/system-software-update +apps/utilities-system-monitor +apps/utilities-terminal +categories/applications-accessories +categories/applications-development +categories/applications-engineering +categories/applications-games +categories/applications-graphics +categories/applications-internet +categories/applications-multimedia +categories/applications-office +categories/applications-other +categories/applications-science +categories/applications-system +categories/applications-utilities +categories/preferences-desktop +categories/preferences-desktop-peripherals +categories/preferences-desktop-personal +categories/preferences-other +categories/preferences-system +categories/preferences-system-network +categories/system-help +devices/audio-card +devices/audio-input-microphone +devices/battery +devices/camera-photo +devices/camera-video +devices/computer +devices/drive-harddisk +devices/drive-optical +devices/drive-removable-media +devices/input-gaming +devices/input-keyboard +devices/input-mouse +devices/media-flash +devices/media-floppy +devices/media-optical +devices/media-tape +devices/modem +devices/multimedia-player +devices/network-wired +devices/network-wireless +devices/printer +devices/video-display +emblems/emblem-default +emblems/emblem-documents +emblems/emblem-downloads +emblems/emblem-favorite +emblems/emblem-important +emblems/emblem-mail +emblems/emblem-photos +emblems/emblem-readonly +emblems/emblem-shared +emblems/emblem-symbolic-link +emblems/emblem-synchronized +emblems/emblem-system +emblems/emblem-unreadable +emotes/face-angel +emotes/face-crying +emotes/face-devil-grin +emotes/face-devil-sad +emotes/face-glasses +emotes/face-kiss +emotes/face-monkey +emotes/face-plain +emotes/face-sad +emotes/face-smile +emotes/face-smile-big +emotes/face-smirk +emotes/face-surprise +emotes/face-wink +mimetypes/mimetypes/application-x-executable +mimetypes/audio-x-generic +mimetypes/font-x-generic +mimetypes/image-x-generic +mimetypes/package-x-generic +mimetypes/text-html +mimetypes/text-x-generic +mimetypes/text-x-generic-template +mimetypes/text-x-script +mimetypes/video-x-generic +mimetypes/x-office-address-book +mimetypes/x-office-calendar +mimetypes/x-office-document +mimetypes/x-office-presentation +mimetypes/x-office-spreadsheet +places/folder +places/folder-remote +places/network-server +places/network-workgroup +places/start-here +places/user-desktop +places/user-home +places/user-trash +status/appointment-missed +status/appointment-soon +status/audio-volume-high +status/audio-volume-low +status/audio-volume-medium +status/audio-volume-muted +status/battery-caution +status/battery-low +status/dialog-error +status/dialog-information +status/dialog-password +status/dialog-question +status/dialog-warning +status/folder-drag-accept +status/folder-open +status/folder-visiting +status/image-loading +status/image-missing +status/mail-attachment +status/mail-unread +status/mail-read +status/mail-replied +status/mail-signed +status/mail-signed-verified +status/media-playlist-repeat +status/media-playlist-shuffle +status/network-error +status/network-idle +status/network-offline +status/network-receive +status/network-transmit +status/network-transmit-receive +status/printer-error +status/printer-printing +status/security-high +status/security-medium +status/security-low +status/software-update-available +status/software-update-urgent +status/sync-error +status/sync-synchronizing +status/task-due +status/task-passed-due +status/user-away +status/user-idle +status/user-offline +status/user-online +status/user-trash-full +status/weather-clear +status/weather-clear-night +status/weather-few-clouds +status/weather-few-clouds-night +status/weather-fog +status/weather-overcast +status/weather-severe-alert +status/weather-showers +status/weather-showers-scattered +status/weather-snow +status/weather-storm diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/kde_freedesktop.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/kde_freedesktop.dat new file mode 100644 index 0000000000..79ce476750 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/kde_freedesktop.dat @@ -0,0 +1,355 @@ +################################################################################ +# +# ICON MAPPING Freedesktop<->KDE +# +################################################################################ + +-actions/address-book-new ++actions/application-exit=actions/exit +-actions/appointment-new +-actions/contact-new ++actions/dialog-cancel=actions/button_cancel +-actions/dialog-close ++actions/dialog-ok=actions/button_ok +*actions/dialog-apply=actions/apply +*actions/dialog-finish=actions/finish ++actions/dialog-no=actions/no ++actions/document-new=actions/filenew ++actions/document-open=actions/fileopen +-actions/document-open-recent +-actions/document-page-setup ++actions/document-print=actions/fileprint +-actions/document-print-preview +*actions/document-print-quick=actions/filequickprint +-actions/document-properties ++actions/document-revert=actions/revert ++actions/document-save=actions/filesave ++actions/document-save-as=actions/filesaveas +*actions/document-save-all=actions/save_all +*actions/document-close=actions/fileclose +*actions/document-export=actions/fileexport +*actions/document-import=actions/fileimport +*actions/edit=actions/edit +*actions/edit-add=actions/edit_add ++actions/edit-copy=actions/editcopy ++actions/edit-cut=actions/editcut ++actions/edit-delete=actions/editdelete ++actions/edit-find=actions/find +-actions/edit-find-replace ++actions/edit-paste=actions/editpaste ++actions/edit-redo=actions/redo +-actions/edit-select-all +*actions/edit-trash=actions/edittrash ++actions/edit-undo=actions/undo +*actions/execute=actions/exec +*actions/decrypt=actions/decrypted +*actions/encrypt=actions/encrypted +*actions/favorite-add=actions/bookmark_add ++actions/folder-new=actions/folder_new +-actions/format-indent-less +-actions/format-indent-more +-actions/format-justify-center +-actions/format-justify-fill +-actions/format-justify-left +-actions/format-justify-right +-actions/format-text-direction-ltr +-actions/format-text-direction-rtl +-actions/format-text-bold +-actions/format-text-italic +-actions/format-text-underline +-actions/format-text-strikethrough +*actions/format-color=actions/colorize ++actions/go-bottom=actions/bottom ++actions/go-down=actions/down +-actions/go-first ++actions/go-home=actions/gohome +-actions/go-jump +-actions/go-last ++actions/go-next=actions/forward ++actions/go-previous=actions/back ++actions/go-top=actions/top ++actions/go-up=actions/up +*actions/go-left=actions/1leftarrow +*actions/go-right=actions/1rightarrow ++actions/help-about=actions/help ++actions/help-contents=apps/help_index ++actions/help-faq=apps/khelpcenter +*actions/history=actions/history +*actions/history-clear=actions/history_clear +*actions/idea=actions/idea +*actions/identity=actions/identity +*actions/alarm=actions/kalarm +-actions/insert-image +-actions/insert-link +-actions/insert-object +-actions/insert-text +-actions/list-add +-actions/list-remove +*actions/mail=actions/mail_generic +-actions/mail-forward +-actions/mail-mark-important +-actions/mail-mark-junk +-actions/mail-mark-notjunk +-actions/mail-mark-read +-actions/mail-mark-unread +-actions/mail-message-new +-actions/mail-reply-all +-actions/mail-reply-sender +-actions/mail-send +-actions/mail-send-receive ++actions/media-eject=actions/player_eject ++actions/media-playback-pause=actions/player_pause ++actions/media-playback-start=actions/player_play ++actions/media-playback-stop=actions/player_stop +-actions/media-record ++actions/media-seek-backward=actions/player_rew ++actions/media-seek-forward=actions/player_fwd ++actions/media-skip-backward=actions/player_start ++actions/media-skip-forward=actions/player_end +-actions/object-flip-horizontal +-actions/object-flip-vertical +-actions/object-rotate-left +-actions/object-rotate-right ++actions/system-lock-screen=actions/lock +-actions/system-log-out ++actions/system-run=actions/run ++actions/system-search=actions/filefind +*actions/start=actions/start +*actions/stop=actions/stop ++actions/tools-check-spelling=actions/spellcheck +-actions/view-fullscreen ++actions/view-refresh=actions/reload +-actions/view-restore +-actions/view-sort-ascending +-actions/view-sort-descending +-actions/window-close ++actions/window-new=actions/window_new ++actions/zoom-best-fit=actions/viewmagfit ++actions/zoom-in=actions/viewmag+ ++actions/zoom-original=actions/viewmag1 ++actions/zoom-out=actions/viewmag- +*actions/zoom=actions/viewmag +*actions/view-pane-detailed=actions/view_detailed +*actions/view-pane-icon=actions/view_icon +*actions/view-pane-column=actions/view_multicolumn +*actions/view-pane-text=actions/view_text +*actions/view-pane-tree=actions/view_tree +*actions/view-pane-remove=actions/view_remove ++apps/accessories-calculator=apps/kcalc ++apps/accessories-character-map=apps/kcharselect ++apps/accessories-clipboard=apps/klipper ++apps/accessories-dictionary=apps/kdict ++apps/accessories-text-editor=apps/kedit +*apps/accessories-archiver=apps/ark +*apps/accessories-clock=apps/clock +*apps/accessories-date=apps/date +*apps/accessories-alarm=apps/kalarm +*apps/accessories-time-tracking=apps/karm +*apps/accessories-disk-usage=apps/kdf +*apps/accessories-floppy=apps/kfloppy +*apps/accessories-notes=apps/knotes +*apps/accessories-terminal=apps/konsole +*apps/accessories-timer=apps/ktimer +*apps/accessories-tip=apps/ktip +*apps/accessories-magnifier=apps/xmag ++apps/help-browser=apps/khelpcenter ++apps/multimedia-volume-control=apps/kmix +*apps/multimedia-movie-player=apps/aktion +*apps/preferences=actions/configure ++apps/preferences-desktop-accessibility=apps/access ++apps/preferences-desktop-font=apps/kcmfontinst +-apps/preferences-desktop-keyboard +-apps/preferences-desktop-locale ++apps/preferences-desktop-multimedia=apps/artscontrol +-apps/preferences-desktop-screensaver ++apps/preferences-desktop-theme=apps/kthememgr ++apps/preferences-desktop-wallpaper=apps/background +*apps/preferences-desktop-theme-icon=apps/iconthemes ++apps/system-file-manager=apps/file-manager ++apps/system-software-update=apps/kpackage ++apps/system-users=apps/kuser +-apps/utilities-system-monitor ++apps/utilities-terminal=apps/terminal +*apps/office-adobe-reader=apps/acroread +*apps/office-pim=apps/kontact +*apps/office-organizer=apps/korganizer +*apps/internet-general=apps/internet +*apps/internet-web-browser=apps/browser +*apps/internet-download-manager=apps/download_manager +*apps/internet-email-client=apps/email +*apps/graphics-snapshot=apps/ksnapshot +*apps/graphics-image-viewer=apps/kview +*categories/applications=apps/package_applications +-categories/applications-accessories ++categories/applications-development=apps/package_development +-categories/applications-engineering ++categories/applications-games=apps/package_games ++categories/applications-graphics=apps/package_graphics ++categories/applications-internet=apps/package_network ++categories/applications-multimedia=apps/package_multimedia ++categories/applications-office=apps/package_wordprocessing +-categories/applications-other +-categories/applications-science ++categories/applications-system=apps/package_system ++categories/applications-utilities=apps/package_utilities ++categories/applications-favorite=apps/package_favorite +*categories/preferences=apps/package_settings ++categories/preferences-desktop=apps/display +-categories/preferences-desktop-peripherals ++categories/preferences-desktop-personal=apps/looknfeel +-categories/preferences-other ++categories/preferences-system=apps/package_system ++categories/preferences-system-network=apps/network ++categories/system-help=apps/help_index +-devices/audio-card +-devices/audio-input-microphone +-devices/battery ++devices/camera-photo=devices/camera ++devices/camera-video=devices/camera ++devices/computer=apps/mycomputer ++devices/drive-harddisk=devices/hdd_unmount ++devices/drive-optical=devices/dvd_unmount ++devices/drive-removable-media=devices/usbpendrive_unmount +-devices/input-gaming=devices/joystick +-devices/input-keyboard ++devices/input-mouse=devices/mouse ++devices/media-flash=devices/usbpendrive_unmount ++devices/media-floppy=devices/3floppy_unmount ++devices/media-optical=devices/cdrom_unmount +-devices/media-tape +-devices/modem +*devices/scanner=devices/scanner +-devices/multimedia-player ++devices/network-wired=devices/nfs_unmount ++devices/network-wireless=devices/nfs_unmount ++devices/printer=devices/printer1 ++devices/video-display=devices/tv +*devices/usb=apps/usb +-emblems/emblem-default +-emblems/emblem-documents +-emblems/emblem-downloads +-emblems/emblem-favorite +-emblems/emblem-important +-emblems/emblem-mail +-emblems/emblem-photos +-emblems/emblem-readonly +-emblems/emblem-shared +-emblems/emblem-symbolic-link +-emblems/emblem-synchronized +-emblems/emblem-system +-emblems/emblem-unreadable +-emotes/face-angel +-emotes/face-crying +-emotes/face-devil-grin +-emotes/face-devil-sad +-emotes/face-glasses +-emotes/face-kiss +-emotes/face-monkey +-emotes/face-plain +-emotes/face-sad +-emotes/face-smile +-emotes/face-smile-big +-emotes/face-smirk +-emotes/face-surprise +-emotes/face-wink ++mimetypes/application-x-executable=mimetypes/binary ++mimetypes/audio-x-generic=mimetypes/sound ++mimetypes/font-x-generic=mimetypes/font ++mimetypes/image-x-generic=mimetypes/image ++mimetypes/package-x-generic=mimetypes/tgz ++mimetypes/text-html=mimetypes/html +*mimetypes/text-ascii=mimetypes/ascii ++mimetypes/text-x-generic=mimetypes/txt ++mimetypes/text-x-generic-template=mimetypes/txt ++mimetypes/text-x-script=mimetypes/shellscript ++mimetypes/video-x-generic=mimetypes/video +-mimetypes/x-office-address-book ++mimetypes/x-office-calendar=mimetypes/vcalendar +-mimetypes/x-office-document +-mimetypes/x-office-presentation ++mimetypes/x-office-spreadsheet=mimetypes/spreadsheet +*mimetypes/application-pdf=mimetypes/pdf +*mimetypes/application-quicktime=mimetypes/quicktime +*mimetypes/empty-x-generic=mimetypes/empty +*mimetypes/empty-x-encrypted=mimetypes/encrypted +*mimetypes/empty-x-locked=mimetypes/file_locked +*mimetypes/empty-x-temporary=mimetypes/file_temporary +*mimetypes/unknown-x-temporary=mimetypes/unknown +*mimetypes/misc-x-generic=mimetypes/misc ++places/folder=filesystems/folder ++places/folder-remote=filesystems/ftp ++places/network-server=filesystems/network ++places/network-workgroup=filesystems/network_local +-places/start-here ++places/user-desktop=filesystems/desktop ++places/user-home=filesystems/folder_home ++places/user-trash=filesystems/trashcan_empty +*places/user-trash-empty=filesystems/trashcan_empty +*places/user-trash-full=filesystems/trashcan_full +*places/favorite-folder=actions/bookmark_folder +*places/image-folder=filesystems/folder_image +*places/html-folder=filesystems/folder_html +*places/music-folder=filesystems/folder_music +*places/document-folder=filesystems/folder_txt +*places/archive-folder=filesystems/folder_tar +*places/www=filesystems/www +*places/services=filesystems/services +-status/appointment-missed +-status/appointment-soon +-status/audio-volume-high +-status/audio-volume-low +-status/audio-volume-medium +-status/audio-volume-muted +-status/battery-caution +-status/battery-low ++status/dialog-error=actions/messagebox_critical +*status/dialog-information=actions/messagebox_info ++status/dialog-password=apps/password +-status/dialog-question +*status/dialog-warning=actions/messagebox_warning +-status/folder-drag-accept ++status/folder-open=filesystems/folder_open +-status/folder-visiting +-status/image-loading +-status/image-missing +-status/mail-attachment +-status/mail-unread +-status/mail-read +-status/mail-replied +-status/mail-signed +-status/mail-signed-verified +-status/media-playlist-repeat +-status/media-playlist-shuffle +-status/network-error +-status/network-idle +-status/network-offline +-status/network-receive +-status/network-transmit +-status/network-transmit-receive +-status/printer-error +-status/printer-printing +-status/security-high +-status/security-medium +-status/security-low +-status/software-update-available +-status/software-update-urgent +-status/sync-error +-status/sync-synchronizing +-status/task-due +-status/task-passed-due +-status/user-away +-status/user-idle +-status/user-offline +-status/user-online +-status/user-trash-full +-status/weather-clear +-status/weather-clear-night +-status/weather-few-clouds +-status/weather-few-clouds-night +-status/weather-fog +-status/weather-overcast +-status/weather-severe-alert +-status/weather-showers +-status/weather-showers-scattered +-status/weather-snow +-status/weather-storm diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/kde_normalize.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/kde_normalize.dat new file mode 100644 index 0000000000..5d588d26c2 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/kde_normalize.dat @@ -0,0 +1,62 @@ +actions/messagebox_info=actions/info +actions/cancel=actions/button_cancel +actions/ok=actions/button_ok +filesystems/folder_images=filesystems/folder_image +filesystems/folder_music=filesystems/folder_sound +filesystems/folder_favorites=filesystems/folder_favorite +filesystems/folder_favourite=filesystems/folder_favorite +filesystems/folder_games=filesystems/folder_game +devices/printer2=devices/printer +devices/network_local=devices/nfs_unmount +mimetypes/mime_ascii=mimetypes/ascii +mimetypes/misc=mimetypes/mime +filesystems/folder_home2=filesystems/folder_home +apps/mail=apps/email +apps/mail=apps/kmail +apps/tux=apps/toys +filesystems/exec=actions/exec +actions/filefind=actions/kfind +actions/kfind=actions/find +actions/no +actions/filefind=actions/find +actions/fileimport=actions/compfile +actions/fonts=apps/fonts +actions/help=actions/idea +apps/back=actions/back +devices/camera=actions/camera +devices/camera=apps/camera +apps/harddrive=devices/hdd_unmount +apps/home=filesystems/folder_home +apps/internet=apps/network +mimetypes/mime-colorset=mimetypes/mime_colorset +apps/my_documents=apps/mydocuments +apps/miscellaneous=apps/miscellaneous2 +apps/calendars=apps/vcalendar +actions/mix_volume=actions/player_volume +actions/color_fill=actions/fill +apps/miscellaneous2=apps/miscellaneous +apps/miscellaneous=apps/miscellaneous +apps/Login=apps/login +apps/Logout=apps/logout +apps/Network=apps/network +apps/networksettings=apps/network_settings +apps/package_favourite=apps/package_favorite +apps/calc=apps/kcalc +apps/cal=apps/calendar +apps/cal=apps/calendars +apps/calendars=apps/calendar +apps/kpdf=apps/pdf +apps/mymac=apps/mycomputer +apps/help_index=apps/help +apps/help_index=apps/helpcenter +apps/kcalc=apps/calc +apps/kcalc=actions/calc +apps/kcmfontinst=actions/fonts +apps/knotes=apps/notes +apps/knotes=actions/notes +apps/korganizer=apps/organizer +apps/looknfeel=apps/iconthemes +apps/Session=apps/smserver +apps/toys=apps/tux +mimetypes/mime_empty=mimetypes/mime +apps/keyboard=devices/keyboard \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/qooxdoo_freedesktop.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/qooxdoo_freedesktop.dat new file mode 100644 index 0000000000..12c777c721 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/qooxdoo_freedesktop.dat @@ -0,0 +1,191 @@ +# +# Mapping of qooxdoo icon names to Tango icons +# + +accessibility = apps/preferences-desktop-accessibility +adobe-reader = apps/office-adobe-reader +alarm = apps/accessories-alarm +applications = categories/applications +apply = actions/dialog-ok +attach = actions/mail-message-attach +back = actions/go-previous +background = apps/preferences-desktop-wallpaper +bell +bitmapgraphics +bookmark-add = actions/favorite-add +bookmark-folder = actions/bookmark_folder +bookmark-toolbar +bookmark +bug +button-cancel = actions/dialog-cancel +button-ok = actions/dialog-ok +cache +calculator = apps/accessories-calculator +camera = devices/camera-photo +cancel = actions/dialog-cancel +cdrom = devices/media-optical +char-device +chart +clipboard = apps/accessories-clipboard +clock = apps/accessories-clock +color-fill +color-line +colors = actions/format-color +configure = apps/preferences +connect-creating +connect-established +connect-no = status/network-offline +control-center = apps/preferences-system +cookie +core +date = apps/accessories-date +decrypted = actions/decrypt +desktop = places/user-desktop +devices = devices/drive-harddisk +dictionary = apps/accessories-dictionary +display = devices/video-display +down = actions/go-down +edit-copy = actions/edit-copy +edit-cut = actions/edit-cut +edit-delete = actions/edit-delete +edit-paste = actions/edit-paste +edit = actions/edit +editor = apps/accessories-text-editor +email = apps/internet-mail +encrypted = actions/encrypt +energy +error = status/dialog-error +exec = actions/execute +exit = actions/application-exit +file-manager = apps/system-file-manager +file-new = actions/document-new +file-open = actions/document-open +file-print = actions/document-print +file-save-as = actions/document-save-as +file-save = actions/document-save +find = actions/edit-find +floppy = devices/media-floppy +flowchart +folder-favorite = status/folder-favorite +folder-important +folder-locked = places/folder-locked +folder-open = status/folder-open +folder = places/folder +fonts = apps/preferences-desktop-font +forward = actions/go-next +games = categories/applications-games +graphics = categories/applications-graphics +harddrive = devices/drive-harddisk +hardware-info +help-center = apps/help-browser +help = actions/help-about +history-clear = actions/history-clear +history = actions/history +home = actions/go-home +icons = apps/preferences-desktop-theme-icon +iconthemes = apps/preferences-desktop-theme-icon +important = emblems/emblem-important +info = status/dialog-information +joystick = devices/input-gaming +keyboard-layout = apps/preferences-desktop-keyboard +locale = apps/preferences-desktop-locale +look-and-feel = apps/preferences-desktop-theme +magnifier = actions/zoom +mail-delete = actions/mail-message-delete +mail-find = actions/mail-find +mail-forward = actions/mail-forward +mail-get = actions/mail-receive +mail-new = actions/mail-message-new +mail-reply-all = actions/mail-reply-all +mail-reply = actions/mail-reply-sender +mail-send = actions/mail-send +mail = apps/internet-email-client +memory = devices/memory +mime-archive = mimetypes/package-x-generic +mime-binary = mimetypes/application-x-executable +mime-calendar = mimetypes/x-office-calendar +mime-card = mimetypes/x-office-address-book +mime-color = actions/format-color +mime-document = mimetypes/x-office-document +mime-html = mimetypes/text-html +mime-image = mimetypes/image-x-generic +mime-manual +mime-multimedia = mimetypes/audio-x-generic +mime-pdf = mimetypes/application-pdf +mime-quicktime = mimetypes/application-quicktime +mime-rpm +mime-script = mimetypes/text-x-script +mime-shellscript = mimetypes/text-x-script +mime-sourcecode = mimetypes/empty-x-generic +mime-spreadsheet = mimetypes/x-office-spreadsheet +mime-text = mimetypes/text-x-generic +mime-video = mimetypes/video-x-generic +misc = actions/execute +mixer = apps/multimedia-volume-control +modem = devices/modem +mouse = devices/input-mouse +movieplayer = apps/multimedia-movie-player +multimedia = categories/applications-multimedia +mycomputer = devices/computer +netscape = mimetypes/text-html +network = categories/applications-internet +no +notes = apps/accessories-notes +notify +ok = actions/dialog-ok +opera = apps/internet-browser-opera +organizer = apps/office-organizer +paint +partitions +password = status/dialog-password +pda +pipe +presentation +printer = devices/printer +queue +redo = actions/edit-redo +reload = actions/view-refresh +rotate = actions/object-rotate-left +run = actions/system-run +scanner = devices/scanner +services = places/services +settings = categories/preferences +signature +spellcheck = actions/tools-check-spelling +stop = actions/stop +style +system = categories/applications-system +tab-duplicate +tab-new-raised +tab-new +tab-remove +tablet = devices/input-tablet +terminal = apps/utilities-terminal +themes = apps/preferences-desktop-theme +toys = categories/applications-toys +trashcan-empty = places/user-trash +trashcan-full = places/user-trash-full +tv = devices/video-display +undo = actions/edit-undo +up = actions/go-up +user = apps/system-users +utilities = categories/applications-utilities +view-bottom +view-choose +view-detailed = actions/view-pane-detailed +view-icon = actions/view-pane-icon +view-left-right +view-multicolumn = actions/view-pane-column +view-remove = actions/view-pane-remove +view-right +view-sidetree +view-text = actions/view-pane-text +view-top-bottom +view-tree = actions/view-pane-tree +viewmag-fit = actions/zoom-best-fit +viewmag-minus = actions/zoom-out +viewmag-original = actions/zoom-original +viewmag-plus = actions/zoom-in +viewmag = actions/zoom +wizard +wordprocessor diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/qooxdoo_whitelist.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/qooxdoo_whitelist.dat new file mode 100644 index 0000000000..891d9836c6 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/data/qooxdoo_whitelist.dat @@ -0,0 +1,816 @@ +128x128/actions/help-contents.png +128x128/actions/help-faq.png +128x128/apps/accessories-alarm.png +128x128/apps/accessories-archiver.png +128x128/apps/accessories-character-map.png +128x128/apps/accessories-clipboard.png +128x128/apps/accessories-clock.png +128x128/apps/accessories-date.png +128x128/apps/accessories-dictionary.png +128x128/apps/accessories-disk-usage.png +128x128/apps/accessories-floppy.png +128x128/apps/accessories-magnifier.png +128x128/apps/accessories-notes.png +128x128/apps/accessories-terminal.png +128x128/apps/accessories-text-editor.png +128x128/apps/accessories-timer.png +128x128/apps/accessories-time-tracking.png +128x128/apps/accessories-tip.png +128x128/apps/graphics-image-viewer.png +128x128/apps/graphics-snapshot.png +128x128/apps/help-browser.png +128x128/apps/internet-download-manager.png +128x128/apps/internet-email-client.png +128x128/apps/internet-web-browser.png +128x128/apps/multimedia-movie-player.png +128x128/apps/multimedia-volume-control.png +128x128/apps/office-adobe-reader.png +128x128/apps/office-organizer.png +128x128/apps/office-pim.png +128x128/apps/preferences-desktop-accessibility.png +128x128/apps/preferences-desktop-font.png +128x128/apps/preferences-desktop-multimedia.png +128x128/apps/preferences-desktop-theme.png +128x128/apps/preferences-desktop-wallpaper.png +128x128/apps/system-file-manager.png +128x128/apps/system-software-update.png +128x128/apps/system-users.png +128x128/apps/utilities-terminal.png +128x128/categories/applications-games.png +128x128/categories/applications-graphics.png +128x128/categories/applications-internet.png +128x128/categories/applications-multimedia.png +128x128/categories/applications-office.png +128x128/categories/applications.png +128x128/categories/applications-utilities.png +128x128/categories/preferences-desktop-personal.png +128x128/categories/preferences-desktop.png +128x128/categories/preferences.png +128x128/categories/preferences-system-network.png +128x128/categories/system-help.png +128x128/devices/camera-photo.png +128x128/devices/camera-video.png +128x128/devices/computer.png +128x128/devices/drive-harddisk.png +128x128/devices/drive-optical.png +128x128/devices/drive-removable-media.png +128x128/devices/input-mouse.png +128x128/devices/media-flash.png +128x128/devices/media-floppy.png +128x128/devices/media-optical.png +128x128/devices/network-wired.png +128x128/devices/network-wireless.png +128x128/devices/printer.png +128x128/devices/scanner.png +128x128/devices/usb.png +128x128/devices/video-display.png +128x128/mimetypes/application-pdf.png +128x128/mimetypes/application-quicktime.png +128x128/mimetypes/application-x-executable.png +128x128/mimetypes/audio-x-generic.png +128x128/mimetypes/empty-x-encrypted.png +128x128/mimetypes/empty-x-generic.png +128x128/mimetypes/empty-x-locked.png +128x128/mimetypes/empty-x-temporary.png +128x128/mimetypes/font-x-generic.png +128x128/mimetypes/image-x-generic.png +128x128/mimetypes/package-x-generic.png +128x128/mimetypes/text-ascii.png +128x128/mimetypes/text-html.png +128x128/mimetypes/text-x-generic.png +128x128/mimetypes/text-x-generic-template.png +128x128/mimetypes/text-x-script.png +128x128/mimetypes/unknown-x-temporary.png +128x128/mimetypes/video-x-generic.png +128x128/mimetypes/x-office-calendar.png +128x128/mimetypes/x-office-spreadsheet.png +128x128/places/archive-folder.png +128x128/places/document-folder.png +128x128/places/folder.png +128x128/places/folder-remote.png +128x128/places/html-folder.png +128x128/places/network-server.png +128x128/places/network-workgroup.png +128x128/places/services.png +128x128/places/user-desktop.png +128x128/places/user-home.png +128x128/places/user-trash-empty.png +128x128/places/user-trash-full.png +128x128/places/user-trash.png +128x128/places/www.png +128x128/status/dialog-password.png +16x16/actions/alarm.png +16x16/actions/application-exit.png +16x16/actions/decrypt.png +16x16/actions/dialog-apply.png +16x16/actions/dialog-cancel.png +16x16/actions/dialog-finish.png +16x16/actions/dialog-no.png +16x16/actions/dialog-ok.png +16x16/actions/document-close.png +16x16/actions/document-export.png +16x16/actions/document-new.png +16x16/actions/document-open.png +16x16/actions/document-print.png +16x16/actions/document-print-quick.png +16x16/actions/document-revert.png +16x16/actions/document-save-all.png +16x16/actions/document-save-as.png +16x16/actions/document-save.png +16x16/actions/edit-add.png +16x16/actions/edit-copy.png +16x16/actions/edit-cut.png +16x16/actions/edit-delete.png +16x16/actions/edit-find.png +16x16/actions/edit-paste.png +16x16/actions/edit.png +16x16/actions/edit-redo.png +16x16/actions/edit-trash.png +16x16/actions/edit-undo.png +16x16/actions/encrypt.png +16x16/actions/favorite-add.png +16x16/actions/folder-new.png +16x16/actions/format-color.png +16x16/actions/go-bottom.png +16x16/actions/go-down.png +16x16/actions/go-home.png +16x16/actions/go-left.png +16x16/actions/go-next.png +16x16/actions/go-previous.png +16x16/actions/go-right.png +16x16/actions/go-top.png +16x16/actions/go-up.png +16x16/actions/help-about.png +16x16/actions/help-contents.png +16x16/actions/help-faq.png +16x16/actions/history-clear.png +16x16/actions/history.png +16x16/actions/identity.png +16x16/actions/mail.png +16x16/actions/media-eject.png +16x16/actions/media-playback-pause.png +16x16/actions/media-playback-start.png +16x16/actions/media-playback-stop.png +16x16/actions/media-seek-backward.png +16x16/actions/media-seek-forward.png +16x16/actions/media-skip-backward.png +16x16/actions/media-skip-forward.png +16x16/actions/start.png +16x16/actions/stop.png +16x16/actions/system-lock-screen.png +16x16/actions/system-run.png +16x16/actions/tools-check-spelling.png +16x16/actions/view-pane-column.png +16x16/actions/view-pane-detailed.png +16x16/actions/view-pane-icon.png +16x16/actions/view-pane-remove.png +16x16/actions/view-pane-text.png +16x16/actions/view-pane-tree.png +16x16/actions/view-refresh.png +16x16/actions/window-new.png +16x16/actions/zoom-best-fit.png +16x16/actions/zoom-in.png +16x16/actions/zoom-original.png +16x16/actions/zoom-out.png +16x16/actions/zoom.png +16x16/apps/accessories-alarm.png +16x16/apps/accessories-archiver.png +16x16/apps/accessories-calculator.png +16x16/apps/accessories-character-map.png +16x16/apps/accessories-clipboard.png +16x16/apps/accessories-clock.png +16x16/apps/accessories-date.png +16x16/apps/accessories-dictionary.png +16x16/apps/accessories-disk-usage.png +16x16/apps/accessories-floppy.png +16x16/apps/accessories-magnifier.png +16x16/apps/accessories-notes.png +16x16/apps/accessories-terminal.png +16x16/apps/accessories-text-editor.png +16x16/apps/accessories-timer.png +16x16/apps/accessories-time-tracking.png +16x16/apps/accessories-tip.png +16x16/apps/graphics-image-viewer.png +16x16/apps/graphics-snapshot.png +16x16/apps/help-browser.png +16x16/apps/internet-download-manager.png +16x16/apps/internet-email-client.png +16x16/apps/internet-web-browser.png +16x16/apps/multimedia-movie-player.png +16x16/apps/multimedia-volume-control.png +16x16/apps/office-adobe-reader.png +16x16/apps/office-organizer.png +16x16/apps/office-pim.png +16x16/apps/preferences-desktop-accessibility.png +16x16/apps/preferences-desktop-font.png +16x16/apps/preferences-desktop-multimedia.png +16x16/apps/preferences-desktop-theme.png +16x16/apps/preferences-desktop-wallpaper.png +16x16/apps/preferences.png +16x16/apps/system-file-manager.png +16x16/apps/system-software-update.png +16x16/apps/system-users.png +16x16/apps/utilities-terminal.png +16x16/categories/applications-development.png +16x16/categories/applications-games.png +16x16/categories/applications-graphics.png +16x16/categories/applications-internet.png +16x16/categories/applications-multimedia.png +16x16/categories/applications-office.png +16x16/categories/applications.png +16x16/categories/applications-system.png +16x16/categories/applications-utilities.png +16x16/categories/preferences-desktop-personal.png +16x16/categories/preferences-desktop.png +16x16/categories/preferences.png +16x16/categories/preferences-system-network.png +16x16/categories/preferences-system.png +16x16/categories/system-help.png +16x16/devices/camera-photo.png +16x16/devices/camera-video.png +16x16/devices/computer.png +16x16/devices/drive-harddisk.png +16x16/devices/drive-optical.png +16x16/devices/drive-removable-media.png +16x16/devices/input-mouse.png +16x16/devices/media-flash.png +16x16/devices/media-floppy.png +16x16/devices/media-optical.png +16x16/devices/network-wired.png +16x16/devices/network-wireless.png +16x16/devices/printer.png +16x16/devices/scanner.png +16x16/devices/usb.png +16x16/devices/video-display.png +16x16/mimetypes/application-pdf.png +16x16/mimetypes/application-quicktime.png +16x16/mimetypes/application-x-executable.png +16x16/mimetypes/audio-x-generic.png +16x16/mimetypes/empty-x-encrypted.png +16x16/mimetypes/empty-x-generic.png +16x16/mimetypes/empty-x-locked.png +16x16/mimetypes/empty-x-temporary.png +16x16/mimetypes/font-x-generic.png +16x16/mimetypes/image-x-generic.png +16x16/mimetypes/package-x-generic.png +16x16/mimetypes/text-ascii.png +16x16/mimetypes/text-html.png +16x16/mimetypes/text-x-generic.png +16x16/mimetypes/text-x-generic-template.png +16x16/mimetypes/text-x-script.png +16x16/mimetypes/unknown-x-temporary.png +16x16/mimetypes/video-x-generic.png +16x16/mimetypes/x-office-calendar.png +16x16/mimetypes/x-office-spreadsheet.png +16x16/places/archive-folder.png +16x16/places/document-folder.png +16x16/places/favorite-folder.png +16x16/places/folder.png +16x16/places/folder-remote.png +16x16/places/html-folder.png +16x16/places/network-server.png +16x16/places/network-workgroup.png +16x16/places/services.png +16x16/places/user-desktop.png +16x16/places/user-home.png +16x16/places/user-trash-empty.png +16x16/places/user-trash-full.png +16x16/places/user-trash.png +16x16/places/www.png +16x16/status/dialog-password.png +16x16/status/folder-open.png +22x22/actions/alarm.png +22x22/actions/application-exit.png +22x22/actions/decrypt.png +22x22/actions/dialog-apply.png +22x22/actions/dialog-cancel.png +22x22/actions/dialog-finish.png +22x22/actions/dialog-ok.png +22x22/actions/document-close.png +22x22/actions/document-export.png +22x22/actions/document-new.png +22x22/actions/document-open.png +22x22/actions/document-print.png +22x22/actions/document-print-quick.png +22x22/actions/document-revert.png +22x22/actions/document-save-all.png +22x22/actions/document-save-as.png +22x22/actions/document-save.png +22x22/actions/edit-add.png +22x22/actions/edit-copy.png +22x22/actions/edit-cut.png +22x22/actions/edit-delete.png +22x22/actions/edit-find.png +22x22/actions/edit-paste.png +22x22/actions/edit.png +22x22/actions/edit-redo.png +22x22/actions/edit-trash.png +22x22/actions/edit-undo.png +22x22/actions/encrypt.png +22x22/actions/favorite-add.png +22x22/actions/folder-new.png +22x22/actions/format-color.png +22x22/actions/go-down.png +22x22/actions/go-home.png +22x22/actions/go-left.png +22x22/actions/go-next.png +22x22/actions/go-previous.png +22x22/actions/go-right.png +22x22/actions/go-up.png +22x22/actions/help-about.png +22x22/actions/help-faq.png +22x22/actions/history.png +22x22/actions/mail.png +22x22/actions/media-eject.png +22x22/actions/media-playback-pause.png +22x22/actions/media-playback-start.png +22x22/actions/media-playback-stop.png +22x22/actions/media-seek-backward.png +22x22/actions/media-seek-forward.png +22x22/actions/media-skip-backward.png +22x22/actions/media-skip-forward.png +22x22/actions/start.png +22x22/actions/stop.png +22x22/actions/system-lock-screen.png +22x22/actions/system-run.png +22x22/actions/tools-check-spelling.png +22x22/actions/view-pane-column.png +22x22/actions/view-pane-detailed.png +22x22/actions/view-pane-icon.png +22x22/actions/view-pane-remove.png +22x22/actions/view-pane-text.png +22x22/actions/view-pane-tree.png +22x22/actions/view-refresh.png +22x22/actions/window-new.png +22x22/actions/zoom-best-fit.png +22x22/actions/zoom-in.png +22x22/actions/zoom-original.png +22x22/actions/zoom-out.png +22x22/actions/zoom.png +22x22/apps/accessories-alarm.png +22x22/apps/accessories-archiver.png +22x22/apps/accessories-character-map.png +22x22/apps/accessories-clock.png +22x22/apps/accessories-date.png +22x22/apps/accessories-dictionary.png +22x22/apps/accessories-floppy.png +22x22/apps/accessories-terminal.png +22x22/apps/accessories-text-editor.png +22x22/apps/accessories-time-tracking.png +22x22/apps/accessories-tip.png +22x22/apps/graphics-image-viewer.png +22x22/apps/graphics-snapshot.png +22x22/apps/help-browser.png +22x22/apps/internet-download-manager.png +22x22/apps/internet-email-client.png +22x22/apps/internet-web-browser.png +22x22/apps/multimedia-volume-control.png +22x22/apps/office-adobe-reader.png +22x22/apps/office-pim.png +22x22/apps/preferences-desktop-accessibility.png +22x22/apps/preferences-desktop-multimedia.png +22x22/apps/preferences-desktop-theme.png +22x22/apps/preferences-desktop-wallpaper.png +22x22/apps/preferences.png +22x22/apps/system-file-manager.png +22x22/apps/system-users.png +22x22/apps/utilities-terminal.png +22x22/categories/applications-graphics.png +22x22/categories/applications-internet.png +22x22/categories/applications-multimedia.png +22x22/categories/applications-office.png +22x22/categories/applications-utilities.png +22x22/categories/preferences-desktop.png +22x22/categories/preferences.png +22x22/categories/preferences-system-network.png +22x22/devices/camera-photo.png +22x22/devices/camera-video.png +22x22/devices/computer.png +22x22/devices/drive-harddisk.png +22x22/devices/drive-optical.png +22x22/devices/drive-removable-media.png +22x22/devices/input-mouse.png +22x22/devices/media-flash.png +22x22/devices/media-floppy.png +22x22/devices/media-optical.png +22x22/devices/network-wired.png +22x22/devices/network-wireless.png +22x22/devices/scanner.png +22x22/devices/usb.png +22x22/devices/video-display.png +22x22/mimetypes/application-pdf.png +22x22/mimetypes/application-quicktime.png +22x22/mimetypes/application-x-executable.png +22x22/mimetypes/audio-x-generic.png +22x22/mimetypes/empty-x-encrypted.png +22x22/mimetypes/empty-x-generic.png +22x22/mimetypes/empty-x-temporary.png +22x22/mimetypes/font-x-generic.png +22x22/mimetypes/image-x-generic.png +22x22/mimetypes/package-x-generic.png +22x22/mimetypes/text-ascii.png +22x22/mimetypes/text-html.png +22x22/mimetypes/text-x-generic.png +22x22/mimetypes/text-x-generic-template.png +22x22/mimetypes/text-x-script.png +22x22/mimetypes/unknown-x-temporary.png +22x22/mimetypes/video-x-generic.png +22x22/mimetypes/x-office-calendar.png +22x22/mimetypes/x-office-spreadsheet.png +22x22/places/archive-folder.png +22x22/places/document-folder.png +22x22/places/favorite-folder.png +22x22/places/folder.png +22x22/places/folder-remote.png +22x22/places/html-folder.png +22x22/places/network-server.png +22x22/places/network-workgroup.png +22x22/places/services.png +22x22/places/user-desktop.png +22x22/places/user-home.png +22x22/places/user-trash-empty.png +22x22/places/user-trash-full.png +22x22/places/user-trash.png +22x22/places/www.png +22x22/status/dialog-password.png +32x32/actions/application-exit.png +32x32/actions/decrypt.png +32x32/actions/dialog-apply.png +32x32/actions/dialog-cancel.png +32x32/actions/dialog-ok.png +32x32/actions/document-close.png +32x32/actions/document-new.png +32x32/actions/document-open.png +32x32/actions/document-print.png +32x32/actions/document-print-quick.png +32x32/actions/document-revert.png +32x32/actions/document-save-all.png +32x32/actions/document-save-as.png +32x32/actions/document-save.png +32x32/actions/edit-add.png +32x32/actions/edit-copy.png +32x32/actions/edit-cut.png +32x32/actions/edit-delete.png +32x32/actions/edit-find.png +32x32/actions/edit-paste.png +32x32/actions/edit.png +32x32/actions/edit-redo.png +32x32/actions/edit-trash.png +32x32/actions/edit-undo.png +32x32/actions/encrypt.png +32x32/actions/favorite-add.png +32x32/actions/folder-new.png +32x32/actions/format-color.png +32x32/actions/go-down.png +32x32/actions/go-home.png +32x32/actions/go-left.png +32x32/actions/go-next.png +32x32/actions/go-previous.png +32x32/actions/go-right.png +32x32/actions/go-top.png +32x32/actions/go-up.png +32x32/actions/help-about.png +32x32/actions/help-contents.png +32x32/actions/help-faq.png +32x32/actions/history.png +32x32/actions/identity.png +32x32/actions/mail.png +32x32/actions/media-eject.png +32x32/actions/media-playback-pause.png +32x32/actions/media-playback-start.png +32x32/actions/media-seek-backward.png +32x32/actions/media-seek-forward.png +32x32/actions/media-skip-backward.png +32x32/actions/media-skip-forward.png +32x32/actions/start.png +32x32/actions/stop.png +32x32/actions/system-lock-screen.png +32x32/actions/system-run.png +32x32/actions/tools-check-spelling.png +32x32/actions/view-pane-column.png +32x32/actions/view-pane-detailed.png +32x32/actions/view-pane-icon.png +32x32/actions/view-pane-remove.png +32x32/actions/view-pane-text.png +32x32/actions/view-pane-tree.png +32x32/actions/view-refresh.png +32x32/actions/window-new.png +32x32/actions/zoom-best-fit.png +32x32/actions/zoom-in.png +32x32/actions/zoom-original.png +32x32/actions/zoom-out.png +32x32/actions/zoom.png +32x32/apps/accessories-alarm.png +32x32/apps/accessories-archiver.png +32x32/apps/accessories-calculator.png +32x32/apps/accessories-character-map.png +32x32/apps/accessories-clipboard.png +32x32/apps/accessories-clock.png +32x32/apps/accessories-date.png +32x32/apps/accessories-dictionary.png +32x32/apps/accessories-disk-usage.png +32x32/apps/accessories-floppy.png +32x32/apps/accessories-magnifier.png +32x32/apps/accessories-notes.png +32x32/apps/accessories-terminal.png +32x32/apps/accessories-text-editor.png +32x32/apps/accessories-timer.png +32x32/apps/accessories-time-tracking.png +32x32/apps/accessories-tip.png +32x32/apps/graphics-image-viewer.png +32x32/apps/graphics-snapshot.png +32x32/apps/help-browser.png +32x32/apps/internet-download-manager.png +32x32/apps/internet-email-client.png +32x32/apps/internet-web-browser.png +32x32/apps/multimedia-movie-player.png +32x32/apps/multimedia-volume-control.png +32x32/apps/office-adobe-reader.png +32x32/apps/office-organizer.png +32x32/apps/office-pim.png +32x32/apps/preferences-desktop-accessibility.png +32x32/apps/preferences-desktop-font.png +32x32/apps/preferences-desktop-multimedia.png +32x32/apps/preferences-desktop-theme.png +32x32/apps/preferences-desktop-wallpaper.png +32x32/apps/preferences.png +32x32/apps/system-file-manager.png +32x32/apps/system-software-update.png +32x32/apps/system-users.png +32x32/apps/utilities-terminal.png +32x32/categories/applications-games.png +32x32/categories/applications-graphics.png +32x32/categories/applications-internet.png +32x32/categories/applications-multimedia.png +32x32/categories/applications-office.png +32x32/categories/applications.png +32x32/categories/applications-system.png +32x32/categories/applications-utilities.png +32x32/categories/preferences-desktop-personal.png +32x32/categories/preferences-desktop.png +32x32/categories/preferences.png +32x32/categories/preferences-system-network.png +32x32/categories/preferences-system.png +32x32/categories/system-help.png +32x32/devices/camera-photo.png +32x32/devices/camera-video.png +32x32/devices/computer.png +32x32/devices/drive-harddisk.png +32x32/devices/drive-optical.png +32x32/devices/drive-removable-media.png +32x32/devices/input-mouse.png +32x32/devices/media-flash.png +32x32/devices/media-floppy.png +32x32/devices/media-optical.png +32x32/devices/network-wired.png +32x32/devices/network-wireless.png +32x32/devices/printer.png +32x32/devices/scanner.png +32x32/devices/usb.png +32x32/devices/video-display.png +32x32/mimetypes/application-pdf.png +32x32/mimetypes/application-quicktime.png +32x32/mimetypes/application-x-executable.png +32x32/mimetypes/audio-x-generic.png +32x32/mimetypes/empty-x-encrypted.png +32x32/mimetypes/empty-x-generic.png +32x32/mimetypes/empty-x-locked.png +32x32/mimetypes/empty-x-temporary.png +32x32/mimetypes/font-x-generic.png +32x32/mimetypes/image-x-generic.png +32x32/mimetypes/package-x-generic.png +32x32/mimetypes/text-ascii.png +32x32/mimetypes/text-html.png +32x32/mimetypes/text-x-generic.png +32x32/mimetypes/text-x-generic-template.png +32x32/mimetypes/text-x-script.png +32x32/mimetypes/unknown-x-temporary.png +32x32/mimetypes/video-x-generic.png +32x32/mimetypes/x-office-calendar.png +32x32/mimetypes/x-office-spreadsheet.png +32x32/places/archive-folder.png +32x32/places/document-folder.png +32x32/places/favorite-folder.png +32x32/places/folder.png +32x32/places/folder-remote.png +32x32/places/html-folder.png +32x32/places/network-server.png +32x32/places/network-workgroup.png +32x32/places/services.png +32x32/places/user-desktop.png +32x32/places/user-home.png +32x32/places/user-trash-empty.png +32x32/places/user-trash-full.png +32x32/places/user-trash.png +32x32/places/www.png +32x32/status/dialog-error.png +32x32/status/dialog-information.png +32x32/status/dialog-password.png +32x32/status/dialog-warning.png +48x48/actions/help-contents.png +48x48/actions/help-faq.png +48x48/apps/accessories-alarm.png +48x48/apps/accessories-archiver.png +48x48/apps/accessories-calculator.png +48x48/apps/accessories-character-map.png +48x48/apps/accessories-clipboard.png +48x48/apps/accessories-clock.png +48x48/apps/accessories-date.png +48x48/apps/accessories-dictionary.png +48x48/apps/accessories-disk-usage.png +48x48/apps/accessories-floppy.png +48x48/apps/accessories-magnifier.png +48x48/apps/accessories-notes.png +48x48/apps/accessories-terminal.png +48x48/apps/accessories-text-editor.png +48x48/apps/accessories-timer.png +48x48/apps/accessories-time-tracking.png +48x48/apps/accessories-tip.png +48x48/apps/graphics-image-viewer.png +48x48/apps/graphics-snapshot.png +48x48/apps/help-browser.png +48x48/apps/internet-download-manager.png +48x48/apps/internet-email-client.png +48x48/apps/internet-web-browser.png +48x48/apps/multimedia-movie-player.png +48x48/apps/multimedia-volume-control.png +48x48/apps/office-adobe-reader.png +48x48/apps/office-organizer.png +48x48/apps/office-pim.png +48x48/apps/preferences-desktop-accessibility.png +48x48/apps/preferences-desktop-font.png +48x48/apps/preferences-desktop-multimedia.png +48x48/apps/preferences-desktop-theme.png +48x48/apps/preferences-desktop-wallpaper.png +48x48/apps/system-file-manager.png +48x48/apps/system-software-update.png +48x48/apps/system-users.png +48x48/apps/utilities-terminal.png +48x48/categories/applications-games.png +48x48/categories/applications-graphics.png +48x48/categories/applications-internet.png +48x48/categories/applications-multimedia.png +48x48/categories/applications-office.png +48x48/categories/applications.png +48x48/categories/applications-system.png +48x48/categories/applications-utilities.png +48x48/categories/preferences-desktop-personal.png +48x48/categories/preferences-desktop.png +48x48/categories/preferences.png +48x48/categories/preferences-system-network.png +48x48/categories/preferences-system.png +48x48/categories/system-help.png +48x48/devices/camera-photo.png +48x48/devices/camera-video.png +48x48/devices/computer.png +48x48/devices/drive-harddisk.png +48x48/devices/drive-optical.png +48x48/devices/drive-removable-media.png +48x48/devices/input-mouse.png +48x48/devices/media-flash.png +48x48/devices/media-floppy.png +48x48/devices/media-optical.png +48x48/devices/network-wired.png +48x48/devices/network-wireless.png +48x48/devices/printer.png +48x48/devices/scanner.png +48x48/devices/usb.png +48x48/devices/video-display.png +48x48/mimetypes/application-pdf.png +48x48/mimetypes/application-quicktime.png +48x48/mimetypes/application-x-executable.png +48x48/mimetypes/audio-x-generic.png +48x48/mimetypes/empty-x-encrypted.png +48x48/mimetypes/empty-x-generic.png +48x48/mimetypes/empty-x-locked.png +48x48/mimetypes/empty-x-temporary.png +48x48/mimetypes/font-x-generic.png +48x48/mimetypes/image-x-generic.png +48x48/mimetypes/package-x-generic.png +48x48/mimetypes/text-ascii.png +48x48/mimetypes/text-html.png +48x48/mimetypes/text-x-generic.png +48x48/mimetypes/text-x-generic-template.png +48x48/mimetypes/text-x-script.png +48x48/mimetypes/unknown-x-temporary.png +48x48/mimetypes/video-x-generic.png +48x48/mimetypes/x-office-calendar.png +48x48/mimetypes/x-office-spreadsheet.png +48x48/places/archive-folder.png +48x48/places/document-folder.png +48x48/places/folder.png +48x48/places/folder-remote.png +48x48/places/html-folder.png +48x48/places/network-server.png +48x48/places/network-workgroup.png +48x48/places/services.png +48x48/places/user-desktop.png +48x48/places/user-home.png +48x48/places/user-trash-empty.png +48x48/places/user-trash-full.png +48x48/places/user-trash.png +48x48/places/www.png +48x48/status/dialog-password.png +64x64/actions/help-contents.png +64x64/actions/help-faq.png +64x64/apps/accessories-alarm.png +64x64/apps/accessories-archiver.png +64x64/apps/accessories-calculator.png +64x64/apps/accessories-character-map.png +64x64/apps/accessories-clipboard.png +64x64/apps/accessories-clock.png +64x64/apps/accessories-date.png +64x64/apps/accessories-dictionary.png +64x64/apps/accessories-disk-usage.png +64x64/apps/accessories-floppy.png +64x64/apps/accessories-magnifier.png +64x64/apps/accessories-notes.png +64x64/apps/accessories-terminal.png +64x64/apps/accessories-text-editor.png +64x64/apps/accessories-time-tracking.png +64x64/apps/accessories-tip.png +64x64/apps/graphics-image-viewer.png +64x64/apps/graphics-snapshot.png +64x64/apps/help-browser.png +64x64/apps/internet-download-manager.png +64x64/apps/internet-email-client.png +64x64/apps/internet-web-browser.png +64x64/apps/multimedia-movie-player.png +64x64/apps/multimedia-volume-control.png +64x64/apps/office-adobe-reader.png +64x64/apps/office-organizer.png +64x64/apps/office-pim.png +64x64/apps/preferences-desktop-accessibility.png +64x64/apps/preferences-desktop-font.png +64x64/apps/preferences-desktop-multimedia.png +64x64/apps/preferences-desktop-theme.png +64x64/apps/preferences-desktop-wallpaper.png +64x64/apps/system-file-manager.png +64x64/apps/system-software-update.png +64x64/apps/system-users.png +64x64/apps/utilities-terminal.png +64x64/categories/applications-games.png +64x64/categories/applications-graphics.png +64x64/categories/applications-internet.png +64x64/categories/applications-multimedia.png +64x64/categories/applications-office.png +64x64/categories/applications.png +64x64/categories/applications-system.png +64x64/categories/applications-utilities.png +64x64/categories/preferences-desktop-personal.png +64x64/categories/preferences-desktop.png +64x64/categories/preferences.png +64x64/categories/preferences-system-network.png +64x64/categories/preferences-system.png +64x64/categories/system-help.png +64x64/devices/camera-photo.png +64x64/devices/camera-video.png +64x64/devices/computer.png +64x64/devices/drive-harddisk.png +64x64/devices/drive-optical.png +64x64/devices/drive-removable-media.png +64x64/devices/input-mouse.png +64x64/devices/media-flash.png +64x64/devices/media-floppy.png +64x64/devices/media-optical.png +64x64/devices/network-wired.png +64x64/devices/network-wireless.png +64x64/devices/printer.png +64x64/devices/scanner.png +64x64/devices/usb.png +64x64/devices/video-display.png +64x64/mimetypes/application-pdf.png +64x64/mimetypes/application-quicktime.png +64x64/mimetypes/application-x-executable.png +64x64/mimetypes/audio-x-generic.png +64x64/mimetypes/empty-x-encrypted.png +64x64/mimetypes/empty-x-generic.png +64x64/mimetypes/empty-x-locked.png +64x64/mimetypes/empty-x-temporary.png +64x64/mimetypes/font-x-generic.png +64x64/mimetypes/image-x-generic.png +64x64/mimetypes/package-x-generic.png +64x64/mimetypes/text-ascii.png +64x64/mimetypes/text-html.png +64x64/mimetypes/text-x-generic.png +64x64/mimetypes/text-x-generic-template.png +64x64/mimetypes/text-x-script.png +64x64/mimetypes/unknown-x-temporary.png +64x64/mimetypes/video-x-generic.png +64x64/mimetypes/x-office-calendar.png +64x64/mimetypes/x-office-spreadsheet.png +64x64/places/archive-folder.png +64x64/places/document-folder.png +64x64/places/folder.png +64x64/places/folder-remote.png +64x64/places/html-folder.png +64x64/places/network-server.png +64x64/places/network-workgroup.png +64x64/places/services.png +64x64/places/user-desktop.png +64x64/places/user-home.png +64x64/places/user-trash-empty.png +64x64/places/user-trash-full.png +64x64/places/user-trash.png +64x64/places/www.png +64x64/status/dialog-password.png diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/freedesktop-to-qooxdoo.sh b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/freedesktop-to-qooxdoo.sh new file mode 100755 index 0000000000..2469874609 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/freedesktop-to-qooxdoo.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +INPUT=themes/freedesktop/use +OUTPUT=themes/qooxdoo/use + +echo ">>> Cleanup..." +rm -rf ${OUTPUT}/* + +echo ">>> Converting themes..." +for DIR in `find ${INPUT} -maxdepth 1 -mindepth 1 -type d ! -name .svn` +do + THEME=`basename $DIR` + echo " - $THEME" + + for ITEM in `cat data/qooxdoo_whitelist.dat` + do + SIZE=`echo $ITEM | cut -d"x" -f1` + SUBPATH=`echo $ITEM | cut -d"/" -f2-` + + SOURCE=${INPUT}/${THEME}/${ITEM} + TARGET=${OUTPUT}/${THEME}/${SIZE}/${SUBPATH} + TARGETDIR=`dirname $TARGET` + + if [ -r ${SOURCE} ] + then + if [ ! -r $TARGETDIR ]; then + mkdir -p $TARGETDIR + fi + cp -f ${SOURCE} ${TARGET} + else + echo " - Missing icon: $ITEM (Malformed whitelist!)" + fi + done +done diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/generate-whitelist.sh b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/generate-whitelist.sh new file mode 100755 index 0000000000..71ef709241 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/generate-whitelist.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +echo ">>> Indexing themes..." +mkdir -p temp +echo -n "" > temp/fd_content_all.txt +COUNT=0 +for DIR in `find themes/freedesktop/use -maxdepth 1 -mindepth 1 -type d ! -name .svn` +do + THEMENAME=`basename $DIR` + echo " - $THEMENAME" + find $DIR -name "*.png" | cut -d"/" -f5- >> temp/fd_content_all.txt + COUNT=$[$COUNT+1] +done + +echo ">>> Normalizing..." +cat temp/fd_content_all.txt | sort | uniq -c | grep "${COUNT} " | cut -d" " -f8 > data/qooxdoo_whitelist.dat + +echo ">>> Result..." +wc -l data/qooxdoo_whitelist.dat diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/kde-to-freedesktop.sh b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/kde-to-freedesktop.sh new file mode 100755 index 0000000000..95486c675b --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/kde-to-freedesktop.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +OUTPUT=themes/freedesktop/use +CONVERT=./modules/kde-to-freedesktop.py + +echo ">>> Converting themes..." +chmod +x $CONVERT +mkdir -p $OUTPUT +for DIR in `find themes/kde/use -maxdepth 1 -mindepth 1 -type d ! -name .svn` +do + THEMENAME=`basename $DIR` + echo " * $THEMENAME" + ${CONVERT} -i $DIR -o ${OUTPUT}/${THEMENAME} +done diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/modules/fix-names.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/modules/fix-names.py new file mode 100755 index 0000000000..f52d881e94 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/modules/fix-names.py @@ -0,0 +1,184 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +# encoding: utf-8 +""" +fix-names.py +""" + +import os +import sys +import getopt + + +help_message = ''' +The help message goes here. +''' + + +class Usage(Exception): + def __init__(self, msg): + self.msg = msg + +def get_migration_patch(qx_to_tango_map, qx_not_in_tango, qx_in_tango_without_image, qx_icon_path, tango_icon_path): + re = "" + for qx in qx_to_tango_map: + re += "(? + + %s + + + """ + qx_to_tango_table = """ +

qooxdoo to Tango mapping

+ + %s +
+ """ + rows = "" + for qx in qx_to_tango_map: + tango = qx_to_tango_map[qx] + rows += "%s%s\n" % (qx_icon_path, qx, qx, tango_icon_path, tango, tango) + qx_to_tango_table = qx_to_tango_table % rows + + no_tango_icon_table = """ +

qoxxdoo images tango equivalent but no tango icon

+ + %s +
+ """ + rows = "" + keys = qx_in_tango_without_image.keys() + keys.sort() + for qx in keys: + rows += "%s%s\n" % (qx_icon_path, qx, qx, qx_in_tango_without_image[qx]) + no_tango_icon_table = no_tango_icon_table % rows + + no_tango_list = "

qoxxdoo images without tango equivalent

" + for qx in qx_not_in_tango: + no_tango_list += "%s
\n" % (qx_icon_path, qx, qx) + + return html % (qx_to_tango_table + no_tango_icon_table + no_tango_list) + +def print_migration(qx_to_tango_map, qx_not_in_tango, qx_in_tango_without_image): + pass + +def search_tango(filename, path): + for dirpath, dirs, files in os.walk(path): + if filename + ".png" in files: return os.path.join(dirpath.split(os.sep)[-1], filename) + return "" + +def fix_names(qx_icon_path, tango_icon_path): + qx_to_tango_map = {} + qx_not_in_tango = [] + qx_in_tango_without_image = {} + + lines = open(os.path.join(os.path.dirname(sys.argv[0]), "..", "data", "qooxdoo_freedesktop.dat")).readlines() + for line in lines: + line = line.strip(); + if line == "" or line[0] == "#": continue + if not "=" in line: + qx_not_in_tango.append(line) + continue + #qx = line + #tango = line + + (qx, tango) = map(lambda x: x.strip(), line.split("=")) + + if os.path.exists(os.path.join(tango_icon_path, tango + ".png")): + qx_to_tango_map[qx] = tango + else: + qx_in_tango_without_image[qx] = tango + + return ( + qx_to_tango_map, + qx_not_in_tango, + qx_in_tango_without_image + ) + +def main(argv=None): + tool_path = os.path.join(os.path.dirname(sys.argv[0]), "..") + if argv is None: + argv = sys.argv + try: + try: + opts, args = getopt.getopt(argv[1:], "ho:t:q:v", ["help", "output=", "tango-icon-path=", "qooxdoo-icon-path="]) + except getopt.error, msg: + raise Usage(msg) + + # option processing + tango_icon_path = os.path.join(tool_path, "themes/qooxdoo/nuvola/16x16") + qx_icon_path = os.path.join(tool_path, "../../source/resource/icon/nuvola/16") + output = "" + for option, value in opts: + if option == "-v": + verbose = True + if option in ("-h", "--help"): + raise Usage(help_message) + if option in ("-o", "--output"): + output = value + if option in ("-t", "--tango-icon-path"): + tango_icon_path = value + if option in ("-q", "--qooxdoo-icon-path"): + qx_icon_path = value + + if not output in ["html", "patch", "info", "debug"]: + raise Usage("invalid parameter for output.") + + (qx_to_tango_map, qx_not_in_tango, qx_in_tango_without_image) = fix_names(qx_icon_path, tango_icon_path) + + if output == "html": + print get_html(qx_to_tango_map, qx_not_in_tango, qx_in_tango_without_image, qx_icon_path, tango_icon_path) + elif output == "info": + print get_migration_info(qx_to_tango_map, qx_not_in_tango, qx_in_tango_without_image, qx_icon_path, tango_icon_path) + elif output == "patch": + print get_migration_patch(qx_to_tango_map, qx_not_in_tango, qx_in_tango_without_image, qx_icon_path, tango_icon_path) + elif output == "debug": + print qx_not_in_tango + + except Usage, err: + print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg) + print >> sys.stderr, "\t for help use --help" + return 2 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/modules/kde-to-freedesktop.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/modules/kde-to-freedesktop.py new file mode 100755 index 0000000000..51310bd6f0 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/modules/kde-to-freedesktop.py @@ -0,0 +1,126 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# +################################################################################ + +import os +import sys +import shutil +import optparse + +def rmgeneric(path, __func__): + try: + __func__(path) + except OSError, (errno, strerror): + print ERROR_STR % {'path' : path, 'error': strerror } + + +def removeall(path): + if not os.path.isdir(path): + return + + files=os.listdir(path) + + for x in files: + fullpath=os.path.join(path, x) + if os.path.isfile(fullpath): + f=os.remove + rmgeneric(fullpath, f) + elif os.path.isdir(fullpath): + removeall(fullpath) + f=os.rmdir + rmgeneric(fullpath, f) + + + +def copy_file(kde, fd, options): + img_sizes = [16, 22, 32, 48, 64, 72, 96, 128] + found = [] + notfound = [] + + if options.verbose: + print " - Processing: %s -> %s" % (kde, fd) + + for size in img_sizes: + kde_file = "%s/%sx%s/%s.png" % (options.input, size, size, kde) + fd_file = "%s/%sx%s/%s.png" % (options.output, size, size, fd) + + if os.path.exists(kde_file): + fd_dir = os.path.dirname(fd_file) + if not os.path.exists(fd_dir): + os.makedirs(fd_dir) + + shutil.copyfile(kde_file, fd_file) + found.append(size) + + else: + notfound.append(size) + + if options.verbose: + dbg = " " + for size in img_sizes: + if size in found: + ret = "Y" + else: + ret = "N" + dbg += " [%s] %s" % (ret, size) + + print dbg + + + +def main(): + parser = optparse.OptionParser("usage: %prog [options]") + parser.add_option("-q", "--quiet", action="store_false", dest="verbose", default=False, help="Quiet output mode.") + parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="Verbose output mode.") + parser.add_option("--input", "-i", action="store", dest="input", metavar="DIRECTORY", help="Input directory") + parser.add_option("--output", "-o", action="store", dest="output", metavar="DIRECTORY", help="Output directory") + + (options, args) = parser.parse_args(sys.argv[1:]) + + if options.input == None or options.output == None: + basename = os.path.basename(sys.argv[0]) + print "You must define both, the input and output folders!" + print "usage: %s [options]" % basename + print "Try '%s -h' or '%s --help' to show the help message." % (basename, basename) + sys.exit(1) + + print " - Cleaning up..." + removeall(options.output) + + dat = open("%s/../data/kde_freedesktop.dat" % os.path.dirname(sys.argv[0])) + + print " - Copying files..." + for line in dat.readlines(): + line = line.strip(); + + if line == "" or line[0] == "#": + continue + + if not line[0] in ["+", "*"]: + continue + + line = line[1:] + + (fd, kde) = map(lambda x: x.strip(), line.split("=")) + copy_file(kde, fd, options) + + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/normalize-kde-themes.sh b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/normalize-kde-themes.sh new file mode 100755 index 0000000000..976c466111 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/normalize-kde-themes.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +SIZES="16 22 24 32 48 64 72 96 128" + +echo ">>> Cleaning up old symlinks" +find themes/kde/use -type l | xargs rm -f + +echo ">>> Symlinking identical images..." +for DIR in `find themes/kde/use -maxdepth 1 -mindepth 1 -type d ! -name .svn` +do + THEMENAME=`basename $DIR` + echo " * $THEMENAME" + + for SIZE in $SIZES + do + for ITEM in `cat data/kde_normalize.dat` + do + NAME1=`echo $ITEM | cut -d"=" -f1` + NAME2=`echo $ITEM | cut -d"=" -f2 | sed s:"=":"":g` + + FILE1=$DIR/${SIZE}x${SIZE}/$NAME1.png + FILE2=$DIR/${SIZE}x${SIZE}/$NAME2.png + + if [ -r ${FILE1} ] + then + if [ ! -r ${FILE2} -a ! -L ${FILE2} ]; then + echo " - Linking: $SIZE/$NAME1 -> $SIZE/$NAME2" + mkdir -p `dirname ${FILE2}` + ln -s ${FILE1} ${FILE2} + fi + fi + + if [ -r ${FILE2} ] + then + if [ ! -r ${FILE1} -a ! -L ${FILE1} ]; then + echo " - Linking: $SIZE/$NAME2 -> $SIZE/$NAME1" + mkdir -p `dirname ${FILE1}` + ln -s ${FILE2} ${FILE1} + fi + fi + done + done +done diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/prepare-kde-themes.sh b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/prepare-kde-themes.sh new file mode 100755 index 0000000000..62c8073429 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/prepare-kde-themes.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +BASESIZES="16 22 32" + +echo ">>> Indexing themes..." +mkdir -p temp +echo -n "" > temp/kde_content_all.txt +COUNT=0 +for DIR in `find themes/kde/use -maxdepth 1 -mindepth 1 -type d ! -name .svn` +do + THEMENAME=`basename $DIR` + echo " - $THEMENAME" + find $DIR -name "*.png" | cut -d"/" -f5- >> temp/kde_content_all.txt + COUNT=$[$COUNT+1] +done + +echo ">>> Building common list..." +cat temp/kde_content_all.txt | sort | uniq -c | sort > temp/kde_content_count.txt +cat temp/kde_content_count.txt | grep "$COUNT " | cut -d" " -f8 | cut -d"." -f1 > temp/kde_content_common.txt +cat temp/kde_content_count.txt | grep "$[$COUNT-1] " | cut -d" " -f8 | cut -d"." -f1 > temp/kde_content_common_less.txt + +echo ">>> Building list for base sizes..." +echo -n "" > temp/kde_content_common_base_temp.txt +for BASESIZE in $BASESIZES; do + echo " * $BASESIZE" + grep ${BASESIZE}x${BASESIZE} temp/kde_content_common.txt | cut -d"/" -f2- | sort | uniq > temp/kde_content_common_${BASESIZE}.txt + cat temp/kde_content_common_${BASESIZE}.txt >> temp/kde_content_common_base_temp.txt +done + +echo ">>> Normalizing list..." +cat temp/kde_content_common_base_temp.txt | sort | uniq > temp/kde_content_common_base.txt + +echo ">>> Preparing replacement map..." +cat data/kde_freedesktop.dat | cut -s -d"=" -f2 | sort | uniq > temp/kde_content_assigned.txt + +echo ">>> Finding differences..." +diff temp/kde_content_common_base.txt temp/kde_content_assigned.txt > temp/kde_content_assigned.diff + +echo ">>> Unassigned images..." +grep "^<" temp/kde_content_assigned.diff | cut -d" " -f2- + +echo ">>> Unavailable images (hopefully empty)..." +grep "^>" temp/kde_content_assigned.diff | cut -d" " -f2- diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/scalable-to-png.sh b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/scalable-to-png.sh new file mode 100755 index 0000000000..f0fd4200e1 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/scalable-to-png.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +which rsvg-convert > /dev/null || exit 1 + +SIZES="16 22 24 32 48 64 72 96 128" +FORMAT=png + +for TYPE in kde +do + INPUT=themes/${TYPE}/scalable + OUTPUT=themes/${TYPE}/use + + for THEME in `find $INPUT -maxdepth 1 -mindepth 1 -type d ! -name .svn` + do + THEMENAME=`basename $THEME` + echo ">>> Processing $THEMENAME ($TYPE)" + + mkdir -p $OUTPUT + + for DIR in `find ${THEME}/scalable -maxdepth 1 -mindepth 1 -type d ! -name .svn` + do + CAT=`basename $DIR` + echo " * Category ${CAT}" + + echo " - Creating directories..." + for SIZE in $SIZES; do + mkdir -p ${OUTPUT}/${THEMENAME}/${SIZE}x${SIZE}/${CAT} + done + + echo " - Rendering files..." + for SVG in `find $DIR -name "*.svg"` + do + SVGNAME=`basename $SVG` + RENNAME=`echo $SVGNAME | sed s:svg:$FORMAT:g` + + for SIZE in $SIZES; do + rsvg-convert $SVG -o ${OUTPUT}/${THEMENAME}/${SIZE}x${SIZE}/${CAT}/${RENNAME} -a -w $SIZE -h $SIZE -f $FORMAT + done + done + done + done +done diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/apiviewer.mk b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/apiviewer.mk new file mode 100644 index 0000000000..535770c18f --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/apiviewer.mk @@ -0,0 +1,28 @@ +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Andreas Ecker (ecker) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +# +# API Paths +# +APIVIEWER_NAMESPACE = apiviewer +APIVIEWER_PATH = $(QOOXDOO_PATH)/frontend/application/apiviewer +APIVIEWER_SOURCE_PATH = $(APIVIEWER_PATH)/source +APIVIEWER_FILES = index.html diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/application.mk b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/application.mk new file mode 100644 index 0000000000..94d1f9b614 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/application.mk @@ -0,0 +1,385 @@ +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Andreas Ecker (ecker) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +################################################################################### +# INCLUDE EXTERNAL MAKEFILES +################################################################################### + +include $(QOOXDOO_PATH)/frontend/framework/tool/make/framework.mk +include $(QOOXDOO_PATH)/frontend/framework/tool/make/apiviewer.mk + + + +#################################################################################### +# BASIC SETTINGS +#################################################################################### + +# +# Location of your qooxdoo distribution +# Could be relative from this location or absolute +# +ifndef QOOXDOO_PATH + QOOXDOO_PATH = PLEASE_DEFINE_QOOXDOO_PATH +endif + +# +# The same as above, but from the webserver point of view +# Starting point is the application HTML file of the source folder. +# In most cases just add a "/.." compared to above +# +ifndef QOOXDOO_URI + QOOXDOO_URI = $(QOOXDOO_PATH)/.. +endif + +# +# Namespace of your application e.g. custom +# +ifndef APPLICATION_NAMESPACE + APPLICATION_NAMESPACE = custom +endif + +# +# Titles used in your API viewer and during the build process +# +ifndef APPLICATION_MAKE_TITLE + APPLICATION_MAKE_TITLE = CUSTOM +endif + +ifndef APPLICATION_API_TITLE + APPLICATION_API_TITLE = Custom +endif + +# +# Files that will be copied into the build directory +# (space separated list) (no default) +# +# ifndef APPLICATION_FILES +# APPLICATION_FILES = index.html +# endif + +# +# Locales to use (space separated list) +# +ifndef APPLICATION_LOCALES + APPLICATION_LOCALES = C +else + APPLICATION_LOCALES += C +endif + + + + + + +#################################################################################### +# ADVANCED SETTINGS +#################################################################################### + +# +# Define folder path +# +ifndef APPLICATION_PATH + APPLICATION_PATH = . +endif + +# +# Define deep folder paths +# +ifndef APPLICATION_SOURCE_PATH + APPLICATION_SOURCE_PATH = $(APPLICATION_PATH)/source +endif + +ifndef APPLICATION_BUILD_PATH + APPLICATION_BUILD_PATH = $(APPLICATION_PATH)/build +endif + +ifndef APPLICATION_API_PATH + APPLICATION_API_PATH = $(APPLICATION_PATH)/api +endif + +# +# Define the publishing location +# Could be any rsync compatible url/path +# +ifndef APPLICATION_PUBLISH_PATH + APPLICATION_PUBLISH_PATH = $(APPLICATION_PATH)/publish +endif + +# +# Define the debug location +# Could be any rsync compatible url/path +# +ifndef APPLICATION_DEBUG_PATH + APPLICATION_DEBUG_PATH = $(APPLICATION_PATH)/debug +endif + +# +# Relation from HTML file to the top level directory (source or build). +# +ifndef APPLICATION_PAGE_TO_TOPLEVEL + APPLICATION_PAGE_TO_TOPLEVEL = . +endif + +# +# Configure resource handling +# +ifndef APPLICATION_RESOURCE_FILTER + APPLICATION_RESOURCE_FILTER = false +endif + +# +# Customize your build +# +ifndef APPLICATION_COMPLETE_BUILD + APPLICATION_COMPLETE_BUILD = false +endif + +ifndef APPLICATION_COMPLETE_SOURCE + APPLICATION_COMPLETE_SOURCE = true +endif + +ifndef APPLICATION_COMPLETE_API + APPLICATION_COMPLETE_API = true +endif + +# +# Customize your build +# +ifndef APPLICATION_LINEBREAKS_BUILD + APPLICATION_LINEBREAKS_BUILD = true +endif + +ifndef APPLICATION_LINEBREAKS_SOURCE + APPLICATION_LINEBREAKS_SOURCE = true +endif + +# +# Configure optimizer +# +ifndef APPLICATION_OPTIMIZE_STRINGS + APPLICATION_OPTIMIZE_STRINGS = true +endif + +ifndef APPLICATION_OPTIMIZE_VARIABLES + APPLICATION_OPTIMIZE_VARIABLES = true +endif + +# +# Include support for widgets +# +ifndef APPLICATION_ENABLE_GUI + APPLICATION_ENABLE_GUI = true +endif + +# +# Redefine folder names (inside build/source) +# It is not recommended to change these fundamental settings. +# +ifndef APPLICATION_SCRIPT_FOLDERNAME + APPLICATION_SCRIPT_FOLDERNAME = script +endif + +ifndef APPLICATION_CLASS_FOLDERNAME + APPLICATION_CLASS_FOLDERNAME = class +endif + +ifndef APPLICATION_TRANSLATION_FOLDERNAME + APPLICATION_TRANSLATION_FOLDERNAME = translation +endif + +# +# Name of the generated script +# +ifndef APPLICATION_SCRIPT_FILENAME + APPLICATION_SCRIPT_FILENAME = $(APPLICATION_NAMESPACE).js +endif + +# +# Full application classname +# +ifndef APPLICATION_CLASSNAME + APPLICATION_CLASSNAME = $(APPLICATION_NAMESPACE).Application +endif + +# +# Translation path +# +ifndef APPLICATION_TRANSLATION_PATH + APPLICATION_TRANSLATION_PATH = $(APPLICATION_SOURCE_PATH)/$(APPLICATION_TRANSLATION_FOLDERNAME) +endif + +# +# Namespace of translation classes +# +ifndef APPLICATION_TRANSLATION_CLASS_NAMESPACE + APPLICATION_TRANSLATION_CLASS_NAMESPACE = $(APPLICATION_NAMESPACE).$(APPLICATION_TRANSLATION_FOLDERNAME) +endif + +# +# Directory of translation classes +# +ifndef APPLICATION_TRANSLATION_CLASS_PATH + APPLICATION_TRANSLATION_CLASS_PATH = $(APPLICATION_SOURCE_PATH)/$(APPLICATION_CLASS_FOLDERNAME)/$(APPLICATION_NAMESPACE)/$(APPLICATION_TRANSLATION_FOLDERNAME) +endif + +# +# Settings for more advanced users +# +ifndef APPLICATION_ADDITIONAL_CLASS_PATH + APPLICATION_ADDITIONAL_CLASS_PATH = +endif + +ifndef APPLICATION_ADDITIONAL_CLASS_URI + APPLICATION_ADDITIONAL_CLASS_URI = +endif + +ifndef APPLICATION_ADDITIONAL_RESOURCE + APPLICATION_ADDITIONAL_RESOURCE = +endif + +# +# Template to patch (e.g. XHTML mode) +# + +# (no default) + +#ifndef APPLICATION_TEMPLATE_INPUT +# APPLICATION_TEMPLATE_INPUT = +#endif + +ifndef APPLICATION_TEMPLATE_OUTPUT + APPLICATION_TEMPLATE_OUTPUT = $(APPLICATION_TEMPLATE_INPUT).out +endif + +ifndef APPLICATION_TEMPLATE_REPLACE + APPLICATION_TEMPLATE_REPLACE = +endif + + + + + + +################################################################################### +# COMPUTED DEFAULTS +################################################################################### + +COMPUTED_COMMON_INIT = + +COMPUTED_SOURCE_INCLUDE = +COMPUTED_SOURCE_LINEBREAKS = + +COMPUTED_BUILD_INCLUDE = +COMPUTED_BUILD_OPTIMIZATIONS = +COMPUTED_BUILD_LINEBREAKS = + +COMPUTED_API_INCLUDE = + + + + + + +################################################################################### +# PROCESSING APPLICATION SETTINGS +################################################################################### + +COMPUTED_CLASS_PATH = --class-path $(FRAMEWORK_SOURCE_PATH)/class \ + --class-path $(APPLICATION_SOURCE_PATH)/$(APPLICATION_CLASS_FOLDERNAME) \ + $(APPLICATION_ADDITIONAL_CLASS_PATH) + +COMPUTED_CLASS_URI = --class-uri $(FRAMEWORK_SOURCE_URI)/class \ + --class-uri $(APPLICATION_PAGE_TO_TOPLEVEL)/$(APPLICATION_CLASS_FOLDERNAME) \ + $(APPLICATION_ADDITIONAL_CLASS_URI) + +COMPUTED_RESOURCE = --copy-resources \ + --resource-input $(FRAMEWORK_SOURCE_PATH)/resource \ + --resource-output $(APPLICATION_BUILD_PATH)/resource/qx \ + --define-runtime-setting qx.manager.object.AliasManager.resourceUri:$(APPLICATION_PAGE_TO_TOPLEVEL)/resource/qx \ + --resource-input $(APPLICATION_SOURCE_PATH)/resource \ + --resource-output $(APPLICATION_BUILD_PATH)/resource/$(APPLICATION_NAMESPACE) \ + --define-runtime-setting $(APPLICATION_CLASSNAME).resourceUri:$(APPLICATION_PAGE_TO_TOPLEVEL)/resource/$(APPLICATION_NAMESPACE) \ + $(APPLICATION_ADDITIONAL_RESOURCE) + + +COMPUTED_FRAMEWORK_LOCALE_INCLUDE := $(APPLICATION_LOCALES:%= --include qx.locale.data.% ) +COMPUTED_FRAMEWORK_TRANSLATION_INCLUDE := $(APPLICATION_LOCALES:%= --include $(FRAMEWORK_TRANSLATION_CLASS_NAMESPACE).% ) +COMPUTED_APPLICATION_TRANSLATION_INCLUDE := $(APPLICATION_LOCALES:%= --include $(APPLICATION_TRANSLATION_CLASS_NAMESPACE).% ) + + +ifeq ($(APPLICATION_COMPLETE_SOURCE),false) + COMPUTED_SOURCE_INCLUDE = --include $(APPLICATION_CLASSNAME) \ + $(COMPUTED_FRAMEWORK_LOCALE_INCLUDE) \ + $(COMPUTED_FRAMEWORK_TRANSLATION_INCLUDE) \ + $(COMPUTED_APPLICATION_TRANSLATION_INCLUDE) +endif + +ifneq ($(APPLICATION_COMPLETE_BUILD),true) + COMPUTED_BUILD_INCLUDE = --include $(APPLICATION_CLASSNAME) \ + $(COMPUTED_FRAMEWORK_LOCALE_INCLUDE) \ + $(COMPUTED_FRAMEWORK_TRANSLATION_INCLUDE) \ + $(COMPUTED_APPLICATION_TRANSLATION_INCLUDE) +endif + +ifeq ($(APPLICATION_COMPLETE_API),false) + COMPUTED_API_INCLUDE = --include $(APPLICATION_CLASSNAME) +endif + +ifeq ($(APPLICATION_OPTIMIZE_STRINGS),true) + COMPUTED_BUILD_OPTIMIZATIONS += --optimize-strings +endif + +ifeq ($(APPLICATION_OPTIMIZE_VARIABLES),true) + COMPUTED_BUILD_OPTIMIZATIONS += --optimize-variables +endif + +ifeq ($(APPLICATION_ENABLE_GUI),false) + COMPUTED_COMMON_INIT = --define-runtime-setting qx.core.Init.component:qx.component.init.BasicInitComponent +endif + +ifeq ($(APPLICATION_RESOURCE_FILTER),true) + COMPUTED_RESOURCE += --enable-resource-filter +endif + +ifeq ($(APPLICATION_LINEBREAKS_SOURCE),true) + COMPUTED_SOURCE_LINEBREAKS = --add-new-lines --add-file-ids +endif + +ifeq ($(APPLICATION_LINEBREAKS_BUILD),true) + COMPUTED_BUILD_LINEBREAKS = --add-new-lines --add-file-ids +endif + +ifneq ($(APPLICATION_TEMPLATE_INPUT),) + COMPUTED_TEMPLATE = --source-template-input-file $(APPLICATION_SOURCE_PATH)/$(APPLICATION_TEMPLATE_INPUT) --source-template-output-file $(APPLICATION_SOURCE_PATH)/$(APPLICATION_TEMPLATE_OUTPUT) + + ifneq ($(APPLICATION_TEMPLATE_REPLACE),) + COMPUTED_TEMPLATE += --source-template-replace "$(APPLICATION_TEMPLATE_REPLACE)" + endif +endif + + + + +################################################################################### +# INCLUDE EXTERNAL MAKEFILES +################################################################################### + +include $(QOOXDOO_PATH)/frontend/framework/tool/make/impl.mk diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/framework.mk b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/framework.mk new file mode 100644 index 0000000000..d38594f7dd --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/framework.mk @@ -0,0 +1,98 @@ +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Andreas Ecker (ecker) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +# +# Framework paths +# +FRAMEWORK_PATH = $(QOOXDOO_PATH)/frontend/framework +FRAMEWORK_NAMESPACE = qx +FRAMEWORK_SOURCE_PATH = $(FRAMEWORK_PATH)/source +FRAMEWORK_CACHE_PATH = $(FRAMEWORK_PATH)/.cache +FRAMEWORK_CLASS_FOLDERNAME = class + +FRAMEWORK_LOCALE_PATH = $(FRAMEWORK_SOURCE_PATH)/locale +FRAMEWORK_LOCALE_CLASS_PATH = $(FRAMEWORK_SOURCE_PATH)/$(FRAMEWORK_CLASS_FOLDERNAME)/$(FRAMEWORK_NAMESPACE)/locale/data + +FRAMEWORK_TRANSLATION_PATH = $(FRAMEWORK_SOURCE_PATH)/translation +FRAMEWORK_TRANSLATION_CLASS_NAMESPACE = $(FRAMEWORK_NAMESPACE).locale.translation +FRAMEWORK_TRANSLATION_CLASS_PATH = $(FRAMEWORK_SOURCE_PATH)/$(FRAMEWORK_CLASS_FOLDERNAME)/$(FRAMEWORK_NAMESPACE)/locale/translation + +FRAMEWORK_TOOL_PATH = $(FRAMEWORK_PATH)/tool + + +# +# Framework config +# +FRAMEWORK_VERSION := $(shell cat $(QOOXDOO_PATH)/VERSION) +FRAMEWORK_SVNINFO := $(shell python $(FRAMEWORK_TOOL_PATH)/modules/svninfo.py `dirname $(QOOXDOO_PATH)`) + +ifneq ($(FRAMEWORK_SVNINFO),"") + FRAMEWORK_FULL_VERSION = $(FRAMEWORK_VERSION) $(FRAMEWORK_SVNINFO) +else + FRAMEWORK_FULL_VERSION = $(FRAMEWORK_VERSION) +endif + + + +# +# Framework URIs +# +FRAMEWORK_URI = $(QOOXDOO_URI)/frontend/framework +FRAMEWORK_SOURCE_URI = $(FRAMEWORK_URI)/source +FRAMEWORK_CLDR_DOWNLOAD_URI = http://unicode.org/cldr/data/common/main + + +# +# Configure commands +# +CMD_LINE = echo "----------------------------------------------------------------------------" +CMD_NICE = nice -n 10 +CMD_PYTHON = $(CMD_NICE) python +CMD_GENERATOR = $(CMD_PYTHON) $(FRAMEWORK_TOOL_PATH)/generator.py --cache-directory $(FRAMEWORK_CACHE_PATH) --version "$(FRAMEWORK_FULL_VERSION)" +CMD_CLDR = $(CMD_PYTHON) $(FRAMEWORK_TOOL_PATH)/modules/cldr.py +CMD_MSGFMT = $(CMD_PYTHON) $(FRAMEWORK_TOOL_PATH)/modules/msgfmt.py +CMD_CHECKLOCALES = $(CMD_PYTHON) $(FRAMEWORK_TOOL_PATH)/modules/checklocales.py +CMD_REMOVE = $(CMD_NICE) rm -rf +CMD_FIND = $(CMD_NICE) find +CMD_ZIP = $(CMD_NICE) zip +CMD_TAR = $(CMD_NICE) tar +CMD_ZIP_CREATE = $(CMD_ZIP) -rq +CMD_TAR_CREATE = $(CMD_TAR) cfzp +CMD_DIR = $(CMD_NICE) mkdir -p +CMD_ANY2DOS = | xargs $(CMD_PYTHON) $(FRAMEWORK_TOOL_PATH)/modules/textutil.py --command any2Dos +CMD_ANY2UNIX = | xargs $(CMD_PYTHON) $(FRAMEWORK_TOOL_PATH)/modules/textutil.py --command any2Unix +CMD_MKEXEC = $(CMD_NICE) chmod a+rx + +# Optimized for remote sync (ssh etc.) +CMD_SYNC_ONLINE = $(CMD_NICE) rsync --checksum --compress --recursive --delete --inplace --links --safe-links --exclude .svn + +# Optimized for local sync (same computer, filesystem) +CMD_SYNC_OFFLINE = $(CMD_NICE) rsync --recursive --delete --inplace --links --safe-links --exclude .svn + + + + +# +# Configure files +# +FILES_TEXT = \( -name "*.py" -o -name "*.sh" -o -name "*.js" -o -name "*.html" -o -name "*.css" -o -name "*.xml" -o -name Makefile -o -name AUTHORS -o -name LICENSE -o -name README -o -name RELEASENOTES -o -name TODO \) +FILES_TEMP = \( -name "*.pyc" -o -name "*.bak" -o -name "*.old" -o -name "*~" -o -name "messages.pot" \) +FILES_EXEC = \( -name "*.py" -o -name "*.sh" \) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/impl.mk b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/impl.mk new file mode 100644 index 0000000000..1b5179230b --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/impl.mk @@ -0,0 +1,431 @@ +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Andreas Ecker (ecker) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +################################################################################### +# EXEC TARGETS +################################################################################### + +# +# Cleanup targets +# + + +exec-clean: + @echo " * Cleaning up..." + @$(CMD_REMOVE) $(APPLICATION_SOURCE_PATH)/$(APPLICATION_SCRIPT_FOLDERNAME)/$(APPLICATION_SCRIPT_FILENAME) + @$(CMD_REMOVE) $(APPLICATION_BUILD_PATH)/$(APPLICATION_SCRIPT_FOLDERNAME)/$(APPLICATION_SCRIPT_FILENAME) + @$(CMD_REMOVE) $(APPLICATION_TRANSLATION_PATH)/messages.pot + @$(CMD_REMOVE) $(FRAMEWORK_TRANSLATION_PATH)/messages.pot + +exec-distclean: + @echo " * Cleaning up..." + @$(CMD_FIND) . $(FILES_TEMP) -exec $(CMD_REMOVE) {} \; + @$(CMD_REMOVE) $(APPLICATION_SOURCE_PATH)/$(APPLICATION_SCRIPT_FOLDERNAME) + @$(CMD_REMOVE) $(APPLICATION_BUILD_PATH) + @$(CMD_REMOVE) $(APPLICATION_API_PATH) + @$(CMD_REMOVE) $(APPLICATION_DEBUG_PATH) + @$(CMD_REMOVE) $(APPLICATION_TRANSLATION_CLASS_PATH) + @$(CMD_REMOVE) $(APPLICATION_TRANSLATION_PATH)/messages.pot + @$(CMD_REMOVE) $(FRAMEWORK_TRANSLATION_PATH)/messages.pot + @$(CMD_REMOVE) $(FRAMEWORK_CACHE_PATH) + @$(CMD_REMOVE) $(FRAMEWORK_LOCALE_CLASS_PATH) + @$(CMD_REMOVE) $(FRAMEWORK_TRANSLATION_CLASS_PATH) + + + + + +# +# Generator targets +# + +exec-script-source: + @$(CMD_GENERATOR) \ + $(COMPUTED_COMMON_INIT) \ + $(COMPUTED_CLASS_PATH) \ + $(COMPUTED_CLASS_URI) \ + --generate-source-script \ + $(COMPUTED_TEMPLATE) \ + --source-script-file $(APPLICATION_SOURCE_PATH)/$(APPLICATION_SCRIPT_FOLDERNAME)/$(APPLICATION_SCRIPT_FILENAME) \ + --define-runtime-setting $(FRAMEWORK_NAMESPACE).manager.object.AliasManager.resourceUri:$(FRAMEWORK_SOURCE_URI)/resource \ + $(COMPUTED_SOURCE_INCLUDE) \ + $(COMPUTED_SOURCE_LINEBREAKS) + +exec-script-build: + @$(CMD_GENERATOR) \ + $(COMPUTED_COMMON_INIT) \ + $(COMPUTED_CLASS_PATH) \ + $(COMPUTED_RESOURCE) \ + --generate-compiled-script \ + --compiled-script-file $(APPLICATION_BUILD_PATH)/$(APPLICATION_SCRIPT_FOLDERNAME)/$(APPLICATION_SCRIPT_FILENAME) \ + $(COMPUTED_BUILD_INCLUDE) \ + $(COMPUTED_BUILD_OPTIMIZATIONS) \ + $(COMPUTED_BUILD_LINEBREAKS) + +exec-resources-build: + @$(CMD_GENERATOR) \ + $(COMPUTED_COMMON_INIT) \ + $(COMPUTED_CLASS_PATH) \ + $(COMPUTED_RESOURCE) \ + $(COMPUTED_BUILD_INCLUDE) + + + + +# +# Utility targets +# +exec-pretty: + @$(CMD_GENERATOR) \ + --include-without-dependencies $(APPLICATION_NAMESPACE).* \ + --pretty-print \ + $(COMPUTED_CLASS_PATH) + +exec-fix: + @$(CMD_GENERATOR) \ + --include-without-dependencies $(APPLICATION_NAMESPACE).* \ + --fix-source \ + $(COMPUTED_CLASS_PATH) + + + + + + + +# +# Debug targets +# +exec-tokenizer: + @$(CMD_GENERATOR) \ + --include-without-dependencies $(APPLICATION_NAMESPACE).* \ + --store-tokens \ + --token-output-directory $(APPLICATION_DEBUG_PATH)/tokens \ + $(COMPUTED_CLASS_PATH) + +exec-treegenerator: + @$(CMD_GENERATOR) \ + --include-without-dependencies $(APPLICATION_NAMESPACE).* \ + --store-tree \ + --tree-output-directory $(APPLICATION_DEBUG_PATH)/tree \ + $(COMPUTED_CLASS_PATH) + + + + + + + +check-locales: + @echo $(APPLICATION_LOCALES) | $(CMD_CHECKLOCALES) + +ifdef APPLICATION_LOCALES + +exec-localization: check-locales exec-framework-localization +exec-translation: check-locales exec-framework-translation exec-application-translation + +else + +exec-localization: exec-none +exec-translation: exec-none + +endif + + + + + +exec-framework-localization: + @echo + @echo " PREPARING LOCALIZATION" + @$(CMD_LINE) + @mkdir -p $(FRAMEWORK_CACHE_PATH) + @mkdir -p $(FRAMEWORK_LOCALE_CLASS_PATH) + @echo " * Processing locales..." + @for LOC in $(APPLICATION_LOCALES); do \ + echo " - Locale: $$LOC"; \ + mod=0; \ + if [ ! -r $(FRAMEWORK_CACHE_PATH)/$$LOC.xml -a -r $(FRAMEWORK_LOCALE_PATH)/$$LOC.xml ]; then \ + echo " - Copying $$LOC.xml..."; \ + cp -f $(FRAMEWORK_LOCALE_PATH)/$$LOC.xml $(FRAMEWORK_CACHE_PATH)/$$LOC.xml; \ + mod=1; \ + fi; \ + if [ ! -r $(FRAMEWORK_CACHE_PATH)/$$LOC.xml ]; then \ + echo " - Downloading $$LOC.xml..."; \ + (which wget > /dev/null 2>&1 && wget $(FRAMEWORK_CLDR_DOWNLOAD_URI)/$$LOC.xml -q -P $(FRAMEWORK_CACHE_PATH)) || \ + (which curl > /dev/null 2>&1 && curl $(FRAMEWORK_CLDR_DOWNLOAD_URI)/$$LOC.xml -s -o $(FRAMEWORK_CACHE_PATH)/$$LOC.xml); \ + mod=1; \ + if [ ! -r $(FRAMEWORK_CACHE_PATH)/$$LOC.xml ]; then \ + echo " - Download failed! Please install wget (preferred) or curl."; \ + exit 1; \ + fi; \ + fi; \ + if [ ! -r $(FRAMEWORK_LOCALE_CLASS_PATH)/$$LOC.js -o $$mod -eq 1 ]; then \ + echo " - Generating $$LOC.js..."; \ + $(CMD_CLDR) -o $(FRAMEWORK_LOCALE_CLASS_PATH) $(FRAMEWORK_CACHE_PATH)/$$LOC.xml; \ + fi; \ + done + +exec-framework-translation: + @echo + @echo " PREPARING FRAMEWORK TRANSLATION" + @$(CMD_LINE) + @echo " * Processing source code..." + @which xgettext > /dev/null 2>&1 || (echo " - Please install gettext tools (xgettext)" && exit 1) + @which msginit > /dev/null 2>&1 || (echo " - Please install gettext tools (msginit)" && exit 1) + @which msgmerge > /dev/null 2>&1 || (echo " - Please install gettext tools (msgmerge)" && exit 1) + + @mkdir -p $(FRAMEWORK_TRANSLATION_PATH) + @mkdir -p $(FRAMEWORK_TRANSLATION_CLASS_PATH) + + @rm -f $(FRAMEWORK_TRANSLATION_PATH)/messages.pot + @touch $(FRAMEWORK_TRANSLATION_PATH)/messages.pot + @for file in `find $(FRAMEWORK_SOURCE_PATH)/$(FRAMEWORK_CLASS_FOLDERNAME) -name "*.js"`; do \ + LC_ALL=C xgettext --language=Java --from-code=UTF-8 \ + -kthis.trc -kthis.tr -kthis.marktr -kthis.trn:1,2 \ + -kManager.trc -kManager.tr -kManager.marktr -kManager.trn:1,2 \ + --sort-by-file --add-comments=TRANSLATION \ + -o $(FRAMEWORK_TRANSLATION_PATH)/messages.pot \ + `find $(FRAMEWORK_SOURCE_PATH)/$(FRAMEWORK_CLASS_FOLDERNAME) -name "*.js"` 2>&1 | grep -v warning; \ + break; done + + @echo " * Processing translations..." + @for LOC in $(APPLICATION_LOCALES); do \ + echo " - Translation: $$LOC"; \ + if [ ! -r $(FRAMEWORK_TRANSLATION_PATH)/$$LOC.po ]; then \ + echo " - Generating initial translation file..."; \ + msginit --locale $$LOC --no-translator -i $(FRAMEWORK_TRANSLATION_PATH)/messages.pot -o $(FRAMEWORK_TRANSLATION_PATH)/$$LOC.po > /dev/null 2>&1; \ + else \ + echo " - Merging translation file..."; \ + msgmerge --update -q $(FRAMEWORK_TRANSLATION_PATH)/$$LOC.po $(FRAMEWORK_TRANSLATION_PATH)/messages.pot; \ + fi; \ + echo " - Generating catalog..."; \ + mkdir -p $(FRAMEWORK_TRANSLATION_PATH); \ + $(CMD_MSGFMT) \ + -n $(FRAMEWORK_TRANSLATION_CLASS_NAMESPACE) \ + -d $(FRAMEWORK_TRANSLATION_CLASS_PATH) \ + $(FRAMEWORK_TRANSLATION_PATH)/$$LOC.po; \ + done + @rm -rf $(FRAMEWORK_TRANSLATION_PATH)/*~ + +exec-application-translation: + @echo + @echo " PREPARING APPLICATION TRANSLATION" + @$(CMD_LINE) + @echo " * Processing source code..." + + @which xgettext > /dev/null 2>&1 || (echo " - Please install gettext tools (xgettext)" && exit 1) + @which msginit > /dev/null 2>&1 || (echo " - Please install gettext tools (msginit)" && exit 1) + @which msgmerge > /dev/null 2>&1 || (echo " - Please install gettext tools (msgmerge)" && exit 1) + + @mkdir -p $(APPLICATION_TRANSLATION_PATH) + @mkdir -p $(APPLICATION_TRANSLATION_CLASS_PATH) + + @rm -f $(APPLICATION_TRANSLATION_PATH)/messages.pot + @touch $(APPLICATION_TRANSLATION_PATH)/messages.pot + @for file in `find $(APPLICATION_SOURCE_PATH)/$(APPLICATION_CLASS_FOLDERNAME) -name "*.js"`; do \ + LC_ALL=C xgettext --language=Java --from-code=UTF-8 \ + -kthis.trc -kthis.tr -kthis.marktr -kthis.trn:1,2 \ + -kManager.trc -kManager.tr -kManager.marktr -kManager.trn:1,2 \ + --sort-by-file --add-comments=TRANSLATION \ + -o $(APPLICATION_TRANSLATION_PATH)/messages.pot \ + `find $(APPLICATION_SOURCE_PATH)/$(APPLICATION_CLASS_FOLDERNAME) -name "*.js"` 2>&1 | grep -v warning; \ + break; done + + @echo " * Processing translations..." + @for LOC in $(APPLICATION_LOCALES); do \ + echo " - Translation: $$LOC"; \ + if [ ! -r $(APPLICATION_TRANSLATION_PATH)/$$LOC.po ]; then \ + echo " - Generating initial translation file..."; \ + msginit --locale $$LOC --no-translator -i $(APPLICATION_TRANSLATION_PATH)/messages.pot -o $(APPLICATION_TRANSLATION_PATH)/$$LOC.po > /dev/null 2>&1; \ + else \ + echo " - Merging translation file..."; \ + msgmerge --update -q $(APPLICATION_TRANSLATION_PATH)/$$LOC.po $(APPLICATION_TRANSLATION_PATH)/messages.pot; \ + fi; \ + echo " - Generating catalog..."; \ + mkdir -p $(APPLICATION_TRANSLATION_PATH); \ + $(CMD_MSGFMT) \ + -n $(APPLICATION_TRANSLATION_CLASS_NAMESPACE) \ + -d $(APPLICATION_TRANSLATION_CLASS_PATH) \ + $(APPLICATION_TRANSLATION_PATH)/$$LOC.po; \ + done + @rm -rf $(APPLICATION_TRANSLATION_PATH)/*~ + + + + + + + +# +# File copy targets +# + +exec-files-build: + @echo + @echo " COPYING OF FILES" + @$(CMD_LINE) + @echo " * Copying files..." + @mkdir -p $(APPLICATION_BUILD_PATH) + @for file in $(APPLICATION_FILES); do \ + echo " - Processing $$file"; \ + cp -Rf $(APPLICATION_SOURCE_PATH)/$$file $(APPLICATION_BUILD_PATH)/$$file; \ + done + +exec-files-api: + @echo + @echo " COPYING OF FILES" + @$(CMD_LINE) + @echo " * Copying files..." + @mkdir -p $(APPLICATION_API_PATH) + @for file in $(APIVIEWER_FILES); do \ + echo " - Processing $$file"; \ + cp -Rf $(APIVIEWER_SOURCE_PATH)/$$file $(APPLICATION_API_PATH)/$$file; \ + done + + + + + + + +# +# API targets +# + +exec-api-data: + @$(CMD_GENERATOR) \ + --generate-api-documentation \ + --api-documentation-json-file $(APPLICATION_API_PATH)/script/apidata.js \ + $(COMPUTED_CLASS_PATH) \ + $(COMPUTED_API_INCLUDE) + +exec-api-build: + @$(CMD_GENERATOR) \ + --class-path $(FRAMEWORK_SOURCE_PATH)/class \ + --class-path $(APIVIEWER_SOURCE_PATH)/class \ + --include apiviewer \ + --generate-compiled-script \ + --compiled-script-file $(APPLICATION_API_PATH)/script/$(APIVIEWER_NAMESPACE).js \ + --optimize-strings --optimize-variables \ + --copy-resources \ + --resource-input $(FRAMEWORK_SOURCE_PATH)/resource \ + --resource-output $(APPLICATION_API_PATH)/resource/$(FRAMEWORK_NAMESPACE) \ + --resource-input $(APIVIEWER_SOURCE_PATH)/resource \ + --resource-output $(APPLICATION_API_PATH)/resource/$(APIVIEWER_NAMESPACE) \ + --enable-resource-filter \ + --define-runtime-setting $(FRAMEWORK_NAMESPACE).manager.object.AliasManager.resourceUri:resource/$(FRAMEWORK_NAMESPACE) \ + --define-runtime-setting $(APIVIEWER_NAMESPACE).Application.resourceUri:resource/$(APIVIEWER_NAMESPACE) \ + --define-runtime-setting $(APIVIEWER_NAMESPACE).Viewer.title:$(APPLICATION_API_TITLE) + + + + + + + +# +# Publish targets +# +exec-publish: + @echo " * Syncing files..." + @$(CMD_SYNC_ONLINE) $(APPLICATION_BUILD_PATH)/* $(APPLICATION_PUBLISH_PATH) + + + + + + + +# +# None helper target +# +exec-none: + @true + + + + + + +################################################################################### +# INFO TARGETS +################################################################################### + +info-build: + @echo + @echo "****************************************************************************" + @echo " GENERATING BUILD VERSION OF $(APPLICATION_MAKE_TITLE)" + @echo "****************************************************************************" + +info-source: + @echo + @echo "****************************************************************************" + @echo " GENERATING SOURCE VERSION OF $(APPLICATION_MAKE_TITLE)" + @echo "****************************************************************************" + +info-api: + @echo + @echo "****************************************************************************" + @echo " GENERATING API VIEWER FOR $(APPLICATION_MAKE_TITLE)" + @echo "****************************************************************************" + +info-pretty: + @echo + @echo "****************************************************************************" + @echo " PRETTIFYING $(APPLICATION_MAKE_TITLE) CLASSES" + @echo "****************************************************************************" + +info-fix: + @echo + @echo "****************************************************************************" + @echo " FIXING $(APPLICATION_MAKE_TITLE) CLASSES" + @echo "****************************************************************************" + +info-help: + @echo + @echo "****************************************************************************" + @echo " HELP FOR $(APPLICATION_MAKE_TITLE)" + @echo "****************************************************************************" + +info-clean: + @echo + @echo "****************************************************************************" + @echo " CLEANING UP $(APPLICATION_MAKE_TITLE)" + @echo "****************************************************************************" + +info-distclean: + @echo + @echo "****************************************************************************" + @echo " CLEANING UP $(APPLICATION_MAKE_TITLE)" COMPLETELY + @echo "****************************************************************************" + +info-publish: + @echo + @echo "****************************************************************************" + @echo " PUBLISHING $(APPLICATION_MAKE_TITLE)" + @echo "****************************************************************************" + +info-debug: + @echo + @echo "****************************************************************************" + @echo " CREATING DEBUG DATA FOR $(APPLICATION_MAKE_TITLE)" + @echo "****************************************************************************" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/project.mk b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/project.mk new file mode 100644 index 0000000000..6e850cdb78 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/project.mk @@ -0,0 +1,40 @@ +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Andreas Ecker (ecker) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +warning: + @echo + @echo "****************************************************************************" + @echo " WARNING" + @echo "----------------------------------------------------------------------------" + @echo " This file 'project.mk' has been renamed to 'application.mk'." + @echo " between release 0.6.4 and 0.6.5. You have to migrate manually:" + @echo " Please replace all occurrences of 'project.mk' in your Makefiles with" + @echo " 'application.mk'." + @echo "****************************************************************************" + + + +source: warning +build: warning +api: warning +all: warning + +include $(QOOXDOO_PATH)/frontend/framework/tool/make/application.mk diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/targets.mk b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/targets.mk new file mode 100644 index 0000000000..d785d8614e --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/make/targets.mk @@ -0,0 +1,49 @@ +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Andreas Ecker (ecker) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +################################################################################### +# TARGETS +################################################################################### + +# +# Target definitions +# + +.PHONY: source build api all locales pretty fix help clean distclean publish debug + +source: info-source exec-localization exec-translation exec-script-source +build: info-build exec-localization exec-translation exec-script-build exec-files-build +api: info-api exec-localization exec-translation exec-api-build exec-api-data exec-files-api +all: source build api + +locales: exec-localization exec-translation + +pretty: info-pretty exec-pretty +fix: info-fix exec-fix + +help: info-help + +clean: info-clean exec-clean +distclean: info-distclean exec-distclean + +publish: build info-publish exec-publish + +debug: info-debug exec-tokenizer exec-treegenerator diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.5.2/info/01-changes.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.5.2/info/01-changes.dat new file mode 100644 index 0000000000..5d3870e9f7 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.5.2/info/01-changes.dat @@ -0,0 +1,2 @@ +QxWindowManager=QxWindowManager was converted from a singleton to a normal class to allow multiple usage. This is useful for example to implement something like virtual desktops. +QxAtom=Was renamed to QxFooBar (Only a test) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/info/01-windowevents.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/info/01-windowevents.dat new file mode 100644 index 0000000000..2555ce0d46 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/info/01-windowevents.dat @@ -0,0 +1,6 @@ +\.addEventListener\(\s*"resize"=Possible use of old resize event. When used to detect a window resize it must be renamed to "windowresize". +\.addEventListener\(\s*"focus"=Possible use of old focus event. When used to detect a window resize it must be renamed to "windowfocus". +\.addEventListener\(\s*"blur"=Possible use of old blur event. When used to detect a window resize it must be renamed to "windowblur". +\.removeEventListener\(\s*"resize"=Possible use of old resize event. When used to detect a window resize it must be renamed to "windowresize". +\.removeEventListener\(\s*"focus"=Possible use of old focus event. When used to detect a window resize it must be renamed to "windowfocus". +\.removeEventListener\(\s*"blur"=Possible use of old blur event. When used to detect a window resize it must be renamed to "windowblur". diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/patches/01-xml.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/patches/01-xml.dat new file mode 100644 index 0000000000..9bdd530e05 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/patches/01-xml.dat @@ -0,0 +1 @@ +\bqx\.lang\.XmlEmu\.createXmlDom\b=qx.lang.Xml.createXmlDom diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/patches/02-application.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/patches/02-application.dat new file mode 100644 index 0000000000..5f71764537 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.1/patches/02-application.dat @@ -0,0 +1 @@ +\bqx\.core\.Init\.getInstance\(\)\.setApplication\(\s*new\s+=qx.core.Init.getInstance().setApplication( diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/info/01-nativewindow.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/info/01-nativewindow.dat new file mode 100644 index 0000000000..e7d408a5db --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/info/01-nativewindow.dat @@ -0,0 +1,2 @@ +\bqx\.client\.NativeWindow\b=NativeWindow now also supports "load" and "close" events. + diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/info/02-functionextension.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/info/02-functionextension.dat new file mode 100644 index 0000000000..8e901f6933 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/info/02-functionextension.dat @@ -0,0 +1 @@ +\.closure\s*\(=Extension Function.prototype.closure has been removed. diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/patches/01-parent.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/patches/01-parent.dat new file mode 100644 index 0000000000..e5d5aec288 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.2/patches/01-parent.dat @@ -0,0 +1,2 @@ +\.getFocusManager\s*\(=.getFocusHandler( +\.setFocusManager\s*\(=.setFocusHandler( diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/01-constants.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/01-constants.dat new file mode 100644 index 0000000000..763a7b99e7 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/01-constants.dat @@ -0,0 +1,293 @@ +\bqx\.constant\.Core\.EMPTY\b="" +\bqx\.constant\.Core\.SPACE\b=" " +\bqx\.constant\.Core\.SLASH\b="/" +\bqx\.constant\.Core\.DOT\b="." +\bqx\.constant\.Core\.ZERO\b="0" +\bqx\.constant\.Core\.QUOTE='"' +\bqx\.constant\.Core\.NEWLINE\b="\\n" +\bqx\.constant\.Core\.SINGLEQUOTE\b="'" +\bqx\.constant\.Core\.STAR\b="*" +\bqx\.constant\.Core\.PLUS\b="+" +\bqx\.constant\.Core\.MINUS\b="-" +\bqx\.constant\.Core\.COMMA\b="," +\bqx\.constant\.Core\.DASH\b="-" +\bqx\.constant\.Core\.UNDERLINE\b="_" +\bqx\.constant\.Core\.SEMICOLON\b=";" +\bqx\.constant\.Core\.COLON\b=":" +\bqx\.constant\.Core\.EQUAL\b="\=" +\bqx\.constant\.Core\.AMPERSAND\b="&" +\bqx\.constant\.Core\.QUESTIONMARK\b="?" +\bqx\.constant\.Core\.HASH\b="#" +\bqx\.constant\.Core\.SMALLER\b="<" +\bqx\.constant\.Core\.BIGGER\b=">" +\bqx\.constant\.Core\.PERCENT\b="%" +\bqx\.constant\.Core\.PIXEL\b="px" +\bqx\.constant\.Core\.MILLISECONDS\b="ms" +\bqx\.constant\.Core\.FLEX\b="1*" +\bqx\.constant\.Core\.ZEROPIXEL\b="0px" +\bqx\.constant\.Core\.HUNDREDPERCENT\b="100%" +\bqx\.constant\.Core\.YES\b="yes" +\bqx\.constant\.Core\.NO\b="no" +\bqx\.constant\.Core\.ON\b="on" +\bqx\.constant\.Core\.OFF\b="off" +\bqx\.constant\.Core\.SET\b="set" +\bqx\.constant\.Core\.GET\b="get" +\bqx\.constant\.Core\.DEFAULT\b="default" +\bqx\.constant\.Core\.AUTO\b="auto" +\bqx\.constant\.Core\.NONE\b="none" +\bqx\.constant\.Core\.DISABLED\b="disabled" +\bqx\.constant\.Core\.HIDDEN\b="hidden" + + + +\bqx\.constant\.Event\.MOUSEOVER\b="mouseover" +\bqx\.constant\.Event\.MOUSEMOVE\b="mousemove" +\bqx\.constant\.Event\.MOUSEOUT\b="mouseout" +\bqx\.constant\.Event\.MOUSEDOWN\b="mousedown" +\bqx\.constant\.Event\.MOUSEUP\b="mouseup" +\bqx\.constant\.Event\.MOUSEWHEEL\b="mousewheel" +\bqx\.constant\.Event\.CLICK\b="click" +\bqx\.constant\.Event\.DBLCLICK\b="dblclick" +\bqx\.constant\.Event\.CONTEXTMENU\b="contextmenu" +\bqx\.constant\.Event\.KEYDOWN\b="keydown" +\bqx\.constant\.Event\.KEYPRESS\b="keypress" +\bqx\.constant\.Event\.KEYINPUT\b="keyinput" +\bqx\.constant\.Event\.KEYUP\b="keyup" +\bqx\.constant\.Event\.BLUR\b="blur" +\bqx\.constant\.Event\.FOCUS\b="focus" +\bqx\.constant\.Event\.FOCUSIN\b="focusin" +\bqx\.constant\.Event\.FOCUSOUT\b="focusout" +\bqx\.constant\.Event\.SELECT\b="select" +\bqx\.constant\.Event\.SCROLL\b="scroll" +\bqx\.constant\.Event\.INPUT\b="input" +\bqx\.constant\.Event\.CHANGE\b="change" +\bqx\.constant\.Event\.RESIZE\b="resize" +\bqx\.constant\.Event\.CHANGESELECTION\b="changeSelection" +\bqx\.constant\.Event\.INTERVAL\b="interval" +\bqx\.constant\.Event\.EXECUTE\b="execute" +\bqx\.constant\.Event\.CREATE\b="create" +\bqx\.constant\.Event\.LOAD\b="load" +\bqx\.constant\.Event\.ERROR\b="error" +\bqx\.constant\.Event\.SUBMIT\b="submit" +\bqx\.constant\.Event\.UNLOAD\b="unload" +\bqx\.constant\.Event\.BEFOREUNLOAD\b="beforeunload" +\bqx\.constant\.Event\.TREEOPENWITHCONTENT\b="treeOpenWithContent" +\bqx\.constant\.Event\.TREEOPENWHILEEMPTY\b="treeOpenWhileEmpty" +\bqx\.constant\.Event\.TREECLOSE\b="treeClose" +\bqx\.constant\.Event\.BEFOREAPPEAR\b="beforeAppear" +\bqx\.constant\.Event\.APPEAR\b="appear" +\bqx\.constant\.Event\.BEFOREDISAPPEAR\b="beforeDisappear" +\bqx\.constant\.Event\.DISAPPEAR\b="disappear" +\bqx\.constant\.Event\.BEFOREINSERTDOM\b="beforeInsertDom" +\bqx\.constant\.Event\.INSERTDOM\b="insertDom" +\bqx\.constant\.Event\.BEFOREREMOVEDOM\b="beforeRemoveDom" +\bqx\.constant\.Event\.REMOVEDOM\b="removeDom" +\bqx\.constant\.Event\.DRAGDROP\b="dragdrop" +\bqx\.constant\.Event\.DRAGOVER\b="dragover" +\bqx\.constant\.Event\.DRAGOUT\b="dragout" +\bqx\.constant\.Event\.DRAGMOVE\b="dragmove" +\bqx\.constant\.Event\.DRAGSTART\b="dragstart" +\bqx\.constant\.Event\.DRAGEND\b="dragend" +\bqx\.constant\.Event\.CREATED\b="created" +\bqx\.constant\.Event\.CONFIGURED\b="configured" +\bqx\.constant\.Event\.QUEUED\b="queued" +\bqx\.constant\.Event\.SENDING\b="sending" +\bqx\.constant\.Event\.RECEIVING\b="receiving" +\bqx\.constant\.Event\.COMPLETED\b="completed" +\bqx\.constant\.Event\.ABORTED\b="aborted" +\bqx\.constant\.Event\.FAILED\b="failed" +\bqx\.constant\.Event\.TIMEOUT\b="timeout" +\bqx\.constant\.Event\.DIALOGOK\b="dialogok" +\bqx\.constant\.Event\.DIALOGCANCEL\b="dialogcancel" +\bqx\.constant\.Event\.DIALOGCLOSE\b="dialogclose" +\bqx\.constant\.Event\.DIALOGPREVIOUS\b="dialogprevious" +\bqx\.constant\.Event\.DIALOGNEXT\b="dialognext" +\bqx\.constant\.Event\.DIALOGFIRST\b="dialogfirst" +\bqx\.constant\.Event\.DIALOGLAST\b="dialoglast" + + + +\bqx\.constant\.Html\.AMPERSAND\b="&" +\bqx\.constant\.Html\.SMALLER\b="<" +\bqx\.constant\.Html\.BIGGER\b=">" +\bqx\.constant\.Html\.QUOTE\b=""" +\bqx\.constant\.Html\.SPACE\b=" " + + + +\bqx\.constant\.Layout\.ORIENTATION_HORIZONTAL\b="horizontal" +\bqx\.constant\.Layout\.ORIENTATION_VERTICAL\b="vertical" +\bqx\.constant\.Layout\.ALIGN_LEFT\b="left" +\bqx\.constant\.Layout\.ALIGN_LEFT_REVERSED\b="left-reversed" +\bqx\.constant\.Layout\.ALIGN_CENTER\b="center" +\bqx\.constant\.Layout\.ALIGN_CENTER_REVERSED\b="center-reversed" +\bqx\.constant\.Layout\.ALIGN_RIGHT\b="right" +\bqx\.constant\.Layout\.ALIGN_RIGHT_REVERSED\b="right-reversed" +\bqx\.constant\.Layout\.ALIGN_TOP\b="top" +\bqx\.constant\.Layout\.ALIGN_TOP_REVERSED\b="top-reversed" +\bqx\.constant\.Layout\.ALIGN_MIDDLE\b="middle" +\bqx\.constant\.Layout\.ALIGN_MIDDLE_REVERSED\b="middle-reversed" +\bqx\.constant\.Layout\.ALIGN_BOTTOM\b="bottom" +\bqx\.constant\.Layout\.ALIGN_BOTTOM_REVERSED\b="bottom-reversed" + + + +\bqx\.constant\.Mime\.JAVASCRIPT\b="text/javascript" +\bqx\.constant\.Mime\.JSON\b="text/json" +\bqx\.constant\.Mime\.XML\b="application/xml" +\bqx\.constant\.Mime\.TEXT\b="text/plain" +\bqx\.constant\.Mime\.HTML\b="text/html" + + + +\bqx\.constant\.Net\.NAMESPACE_SVG\b=qx.xml.Namespace.SVG +\bqx\.constant\.Net\.NAMESPACE_SMIL\b=qx.xml.Namespace.SMIL +\bqx\.constant\.Net\.NAMESPACE_MML\b=qx.xml.Namespace.MML +\bqx\.constant\.Net\.NAMESPACE_CML\b=qx.xml.Namespace.CML +\bqx\.constant\.Net\.NAMESPACE_XLINK\b=qx.xml.Namespace.XLINK +\bqx\.constant\.Net\.NAMESPACE_XHTML\b=qx.xml.Namespace.XHTML +\bqx\.constant\.Net\.NAMESPACE_XUL\b=qx.xml.Namespace.XUL +\bqx\.constant\.Net\.NAMESPACE_XBL\b=qx.xml.Namespace.XBL +\bqx\.constant\.Net\.NAMESPACE_FO\b=qx.xml.Namespace.FO +\bqx\.constant\.Net\.NAMESPACE_XSL\b=qx.xml.Namespace.XSL +\bqx\.constant\.Net\.NAMESPACE_XSLT\b=qx.xml.Namespace.XSLT +\bqx\.constant\.Net\.NAMESPACE_XI\b=qx.xml.Namespace.XI +\bqx\.constant\.Net\.NAMESPACE_XFORMS\b=qx.xml.Namespace.XFORMS +\bqx\.constant\.Net\.NAMESPACE_SAXON\b=qx.xml.Namespace.SAXON +\bqx\.constant\.Net\.NAMESPACE_XALAN\b=qx.xml.Namespace.XALAN +\bqx\.constant\.Net\.NAMESPACE_XSD\b=qx.xml.Namespace.XSD +\bqx\.constant\.Net\.NAMESPACE_DT\b=qx.xml.Namespace.DT +\bqx\.constant\.Net\.NAMESPACE_XSI\b=qx.xml.Namespace.XSI +\bqx\.constant\.Net\.NAMESPACE_RDF\b=qx.xml.Namespace.RDF +\bqx\.constant\.Net\.NAMESPACE_RDFS\b=qx.xml.Namespace.RDFS +\bqx\.constant\.Net\.NAMESPACE_DC\b=qx.xml.Namespace.DC +\bqx\.constant\.Net\.NAMESPACE_DCQ\b=qx.xml.Namespace.DCQ +\bqx\.constant\.Net\.NAMESPACE_SOAPENV\b=qx.xml.Namespace.SOAPENV +\bqx\.constant\.Net\.NAMESPACE_WSDL\b=qx.xml.Namespace.WSDL +\bqx\.constant\.Net\.NAMESPACE_ADOBESVGEXTENSIONS\b=qx.xml.Namespace.ADOBESVGEXTENSIONS +\bqx\.constant\.Net\b=qx.xml.Namespace +\bqx\.constant\.Net\.STATE_CREATED\b="created" +\bqx\.constant\.Net\.STATE_CONFIGURED\b="configured" +\bqx\.constant\.Net\.STATE_QUEUED\b="queued" +\bqx\.constant\.Net\.STATE_SENDING\b="sending" +\bqx\.constant\.Net\.STATE_RECEIVING\b="receiving" +\bqx\.constant\.Net\.STATE_COMPLETED\b="completed" +\bqx\.constant\.Net\.STATE_ABORTED\b="aborted" +\bqx\.constant\.Net\.STATE_FAILED\b="failed" +\bqx\.constant\.Net\.STATE_TIMEOUT\b="timeout" +\bqx\.constant\.Net\.PROTOCOL_HTTP\b=qx.net.Protocol.HTTP +\bqx\.constant\.Net\.PROTOCOL_HTTPS\b=qx.net.Protocol.HTTPS +\bqx\.constant\.Net\.PROTOCOL_FTP\b=qx.net.Protocol.FTP +\bqx\.constant\.Net\.PROTOCOL_FILE\b=qx.net.Protocol.FILE +\bqx\.constant\.Net\.URI_HTTP\b=qx.net.Protocol.URI_HTTP +\bqx\.constant\.Net\.URI_HTTPS\b=qx.net.Protocol.URI_HTTPS +\bqx\.constant\.Net\.URI_FTP\b=qx.net.Protocol.URI_FTP +\bqx\.constant\.Net\.URI_FILE\b=qx.net.Protocol.URI_FILE +\bqx\.constant\.Net\.METHOD_GET\b=qx.net.Http.METHOD_GET +\bqx\.constant\.Net\.METHOD_POST\b=qx.net.Http.METHOD_POST +\bqx\.constant\.Net\.METHOD_PUT\b=qx.net.Http.METHOD_PUT +\bqx\.constant\.Net\.METHOD_HEAD\b=qx.net.Http.METHOD_HEAD +\bqx\.constant\.Net\.METHOD_DELETE\b=qx.net.Http.METHOD_DELETE +\bqx\.constant\.Net\b=qx.net.Protocol + + + +\bqx\.constant\.Style\.PROPERTY_FILTER\b="filter" +\bqx\.constant\.Style\.PROPERTY_ZINDEX\b="zIndex" +\bqx\.constant\.Style\.PROPERTY_DISPLAY\b="display" +\bqx\.constant\.Style\.PROPERTY_POSITION\b="position" +\bqx\.constant\.Style\.PROPERTY_VISIBILITY\b="visibility" +\bqx\.constant\.Style\.PROPERTY_DISABLED\b="disabled" +\bqx\.constant\.Style\.PROPERTY_LINEHEIGHT\b="lineHeight" +\bqx\.constant\.Style\.PROPERTY_TEXTALIGN\b="textAlign" +\bqx\.constant\.Style\.PROPERTY_WHITESPACE\b="whiteSpace" +\bqx\.constant\.Style\.PROPERTY_COLOR\b="color" +\bqx\.constant\.Style\.PROPERTY_BACKGROUNDCOLOR\b="backgroundColor" +\bqx\.constant\.Style\.PROPERTY_HEIGHT\b="height" +\bqx\.constant\.Style\.PROPERTY_WIDTH\b="width" +\bqx\.constant\.Style\.PROPERTY_TOP\b="top" +\bqx\.constant\.Style\.PROPERTY_BOTTOM\b="bottom" +\bqx\.constant\.Style\.PROPERTY_LEFT\b="left" +\bqx\.constant\.Style\.PROPERTY_RIGHT\b="right" +\bqx\.constant\.Style\.PROPERTY_PADDING\b="padding" +\bqx\.constant\.Style\.PROPERTY_PADDINGTOP\b="paddingTop" +\bqx\.constant\.Style\.PROPERTY_PADDINGRIGHT\b="paddingRight" +\bqx\.constant\.Style\.PROPERTY_PADDINGBOTTOM\b="paddingBottom" +\bqx\.constant\.Style\.PROPERTY_PADDINGLEFT\b="paddingLeft" +\bqx\.constant\.Style\.PROPERTY_MARGIN\b="margin" +\bqx\.constant\.Style\.PROPERTY_MARGINTOP\b="marginTop" +\bqx\.constant\.Style\.PROPERTY_MARGINRIGHT\b="marginRight" +\bqx\.constant\.Style\.PROPERTY_MARGINBOTTOM\b="marginBottom" +\bqx\.constant\.Style\.PROPERTY_MARGINLEFT\b="marginLeft" +\bqx\.constant\.Style\.PROPERTY_OVERFLOW_BOTH\b="overflow" +\bqx\.constant\.Style\.PROPERTY_OVERFLOW_TEXT\b="textOverflow" +\bqx\.constant\.Style\.PROPERTY_OVERFLOW_HORIZONTAL\b="overflowX" +\bqx\.constant\.Style\.PROPERTY_OVERFLOW_VERTICAL\b="overflowY" +\bqx\.constant\.Style\.POSITION_ABSOLUTE\b="absolute" +\bqx\.constant\.Style\.POSITION_RELATIVE\b="relative" +\bqx\.constant\.Style\.POSITION_STATIC\b="static" +\bqx\.constant\.Style\.POSITION_FIXED\b="fixed" +\bqx\.constant\.Style\.CURSOR_WAIT\b="wait" +\bqx\.constant\.Style\.CURSOR_PROGRESS\b="progress" +\bqx\.constant\.Style\.CURSOR_DEFAULT\b="default" +\bqx\.constant\.Style\.OVERFLOW_AUTO\b="auto" +\bqx\.constant\.Style\.OVERFLOW_HIDDEN\b="hidden" +\bqx\.constant\.Style\.OVERFLOW_BOTH\b="scroll" +\bqx\.constant\.Style\.OVERFLOW_HORIZONTAL\b="scrollX" +\bqx\.constant\.Style\.OVERFLOW_VERTICAL\b="scrollY" +\bqx\.constant\.Style\.OVERFLOW_ELLIPSIS\b="ellipsis" +\bqx\.constant\.Style\.OVERFLOW_MOZ_NONE\b="-moz-scrollbars-none" +\bqx\.constant\.Style\.OVERFLOW_MOZ_HORIZONTAL\b="-moz-scrollbars-horizontal" +\bqx\.constant\.Style\.OVERFLOW_MOZ_VERTICAL\b="-moz-scrollbars-vertical" +\bqx\.constant\.Style\.FOCUS_OUTLINE\b="1px dotted invert" + + + +\bqx\.constant\.Tags\.H1\b="h1" +\bqx\.constant\.Tags\.H2\b="h2" +\bqx\.constant\.Tags\.H3\b="h3" +\bqx\.constant\.Tags\.H4\b="h4" +\bqx\.constant\.Tags\.H5\b="h5" +\bqx\.constant\.Tags\.H6\b="h6" +\bqx\.constant\.Tags\.P\b="p" +\bqx\.constant\.Tags\.DIV\b="div" +\bqx\.constant\.Tags\.SPAN\b="span" +\bqx\.constant\.Tags\.BODY\b="body" +\bqx\.constant\.Tags\.EM\b="em" +\bqx\.constant\.Tags\.I\b="i" +\bqx\.constant\.Tags\.STRONG\b="strong" +\bqx\.constant\.Tags\.B\b="b" +\bqx\.constant\.Tags\.UL\b="ul" +\bqx\.constant\.Tags\.OL\b="ol" +\bqx\.constant\.Tags\.LI\b="li" +\bqx\.constant\.Tags\.TABLE\b="table" +\bqx\.constant\.Tags\.TD\b="td" +\bqx\.constant\.Tags\.TR\b="tr" +\bqx\.constant\.Tags\.THEAD\b="thead" +\bqx\.constant\.Tags\.TBODY\b="tbody" +\bqx\.constant\.Tags\.TFOOT\b="tfoot" + + + +\bqx\.constant\.Type\.UNDEFINED\b="undefined" +\bqx\.constant\.Type\.NUMBER\b="number" +\bqx\.constant\.Type\.STRING\b="string" +\bqx\.constant\.Type\.BOOLEAN\b="boolean" +\bqx\.constant\.Type\.FUNCTION\b="function" +\bqx\.constant\.Type\.OBJECT\b="object" + + + +\bqx\.constant\.Node\.ELEMENT=qx.dom.DomNode.ELEMENT +\bqx\.constant\.Node\.ATTRIBUTE=qx.dom.DomNode.ATTRIBUTE +\bqx\.constant\.Node\.TEXT=qx.dom.DomNode.TEXT +\bqx\.constant\.Node\.CDATA_SECTION=qx.dom.DomNode.CDATA_SECTION +\bqx\.constant\.Node\.ENTITY_REFERENCE=qx.dom.DomNode.ENTITY_REFERENCE +\bqx\.constant\.Node\.ENTITY=qx.dom.DomNode.ENTITY +\bqx\.constant\.Node\.PROCESSING_INSTRUCTION=qx.dom.DomNode.PROCESSING_INSTRUCTION +\bqx\.constant\.Node\.COMMENT=qx.dom.DomNode.COMMENT +\bqx\.constant\.Node\.DOCUMENT=qx.dom.DomNode.DOCUMENT +\bqx\.constant\.Node\.DOCUMENT_TYPE=qx.dom.DomNode.DOCUMENT_TYPE +\bqx\.constant\.Node\.DOCUMENT_FRAGMENT=qx.dom.DomNode.DOCUMENT_FRAGMENT +\bqx\.constant\.Node\.NOTATION=qx.dom.DomNode.NOTATION + \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/02-oo.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/02-oo.dat new file mode 100644 index 0000000000..5b5b92efa2 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/02-oo.dat @@ -0,0 +1,54 @@ +\bqx\.OO\.PROPERTY_WIDTH\b="width" +\bqx\.OO\.PROPERTY_HEIGHT\b="height" +\bqx\.OO\.PROPERTY_MINWIDTH\b="minWidth" +\bqx\.OO\.PROPERTY_MINHEIGHT\b="minHeight" +\bqx\.OO\.PROPERTY_MAXWIDTH\b="maxWidth" +\bqx\.OO\.PROPERTY_MAXHEIGHT\b="maxHeight" +\bqx\.OO\.PROPERTY_LEFT\b="left" +\bqx\.OO\.PROPERTY_RIGHT\b="right" +\bqx\.OO\.PROPERTY_TOP\b="top" +\bqx\.OO\.PROPERTY_BOTTOM\b="bottom" +\bqx\.OO\.PROPERTY_VISIBILITY\b="visibility" +\bqx\.OO\.PROPERTY_DISPLAY\b="display" +\bqx\.OO\.PROPERTY_PARENT\b="parent" +\bqx\.OO\.PROPERTY_ZINDEX\b="zIndex" + +\bqx\.OO\.C_SET\b="set" +\bqx\.OO\.C_GET\b="get" +\bqx\.OO\.C_APPLY\b="apply" +\bqx\.OO\.C_RESET\b="reset" +\bqx\.OO\.C_FORCE\b="force" +\bqx\.OO\.C_TOGGLE\b="toggle" +\bqx\.OO\.C_CHANGE\b="change" +\bqx\.OO\.C_STORE\b="store" +\bqx\.OO\.C_RETRIEVE\b="retrieve" +\bqx\.OO\.C_PRIVATECHANGE\b="_change" +\bqx\.OO\.C_INVALIDATE\b="_invalidate" +\bqx\.OO\.C_INVALIDATED\b="_invalidated" +\bqx\.OO\.C_RECOMPUTE\b="_recompute" +\bqx\.OO\.C_CACHED\b="_cached" +\bqx\.OO\.C_COMPUTE\b="_compute" +\bqx\.OO\.C_COMPUTED\b="_computed" +\bqx\.OO\.C_UNITDETECTION\b="_unitDetection" + +\bqx\.OO\.C_GLOBALPROPERTYREF\b="PROPERTY_" + +\bqx\.OO\.C_UNIT_VALUE\b="Value" +\bqx\.OO\.C_UNIT_PARSED\b="Parsed" +\bqx\.OO\.C_UNIT_TYPE\b="Type" +\bqx\.OO\.C_UNIT_TYPE_NULL\b="TypeNull" +\bqx\.OO\.C_UNIT_TYPE_PIXEL\b="TypePixel" +\bqx\.OO\.C_UNIT_TYPE_PERCENT\b="TypePercent" +\bqx\.OO\.C_UNIT_TYPE_AUTO\b="TypeAuto" +\bqx\.OO\.C_UNIT_TYPE_FLEX\b="TypeFlex" + +\bqx\.OO\.C_GETDEFAULT\b="getDefault" +\bqx\.OO\.C_SETDEFAULT\b="setDefault" +\bqx\.OO\.C_RETRIEVEDEFAULT\b="retrieveDefault" +\bqx\.OO\.C_STOREDEFAULT\b="storeDefault" + +\bqx\.OO\.C_VALUE\b="_value" +\bqx\.OO\.C_NULL\b="_null" +\bqx\.OO\.C_EVAL\b="_eval" +\bqx\.OO\.C_CHECK\b="_check" +\bqx\.OO\.C_MODIFY\b="_modify" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/03-widget.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/03-widget.dat new file mode 100644 index 0000000000..763f17b557 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/03-widget.dat @@ -0,0 +1,68 @@ +\bqx\.ui\.core\.Widget\.JOB_INITIAL\b="initial" +\bqx\.ui\.core\.Widget\.JOB_VISIBLE\b="visible" +\bqx\.ui\.core\.Widget\.JOB_LOCATION\b="location" +\bqx\.ui\.core\.Widget\.JOB_LOCATIONX\b="locationX" +\bqx\.ui\.core\.Widget\.JOB_LOCATIONY\b="locationY" +\bqx\.ui\.core\.Widget\.JOB_ADDCHILD\b="addChild" +\bqx\.ui\.core\.Widget\.JOB_REMOVECHILD\b="removeChild" +\bqx\.ui\.core\.Widget\.JOB_FRAMEWIDTH\b="frameWidth" +\bqx\.ui\.core\.Widget\.JOB_FRAMEHEIGHT\b="frameHeight" +\bqx\.ui\.core\.Widget\.JOB_PREFERREDINNERWIDTH\b="preferredInnerWidth" +\bqx\.ui\.core\.Widget\.JOB_PREFERREDINNERHEIGHT\b="preferredInnerHeight" +\bqx\.ui\.core\.Widget\.PROPERTY_CLASSNAME\b="className" +\bqx\.ui\.core\.Widget\.PROPERTY_BORDERX\b="borderX" +\bqx\.ui\.core\.Widget\.PROPERTY_BORDERWIDTHX\b="borderWidthX" +\bqx\.ui\.core\.Widget\.PROPERTY_BORDERY\b="borderY" +\bqx\.ui\.core\.Widget\.PROPERTY_BORDERWIDTHY\b="borderWidthY" +\bqx\.ui\.core\.Widget\.PROPERTY_PARENT_PADDINGLEFT\b="parentPaddingLeft" +\bqx\.ui\.core\.Widget\.PROPERTY_PARENT_PADDINGRIGHT\b="parentPaddingRight" +\bqx\.ui\.core\.Widget\.PROPERTY_PARENT_PADDINGTOP\b="parentPaddingTop" +\bqx\.ui\.core\.Widget\.PROPERTY_PARENT_PADDINGBOTTOM\b="parentPaddingBottom" +\bqx\.ui\.core\.Widget\.STATE_OVER\b="over" +\bqx\.ui\.core\.Widget\.STATE_FOCUSED\b="focused" +\bqx\.ui\.core\.Widget\.STATE_DISABLED\b="disabled" +\bqx\.ui\.core\.Widget\.FOCUS_OUTLINE\b="1px dotted invert" +\bqx\.ui\.core\.Widget\.FOCUS_NONE\b="0px none" +\bqx\.ui\.core\.Widget\.TAB_PROPERTY_UNSELECTABLE\b="unselectable" +\bqx\.ui\.core\.Widget\.TAB_PROPERTY_TABINDEX\b="tabIndex" +\bqx\.ui\.core\.Widget\.TAB_PROPERTY_USERFOCUS\b="userFocus" +\bqx\.ui\.core\.Widget\.TAB_PROPERTY_MOZUSERFOCUS\b="MozUserFocus" +\bqx\.ui\.core\.Widget\.TAB_VALUE_IGNORE\b="ignore" +\bqx\.ui\.core\.Widget\.TAB_VALUE_NORMAL\b="normal" +\bqx\.ui\.core\.Widget\.TAB_VALUE_ON\b="on" +\bqx\.ui\.core\.Widget\.SEL_VALUE_ON\b="on" +\bqx\.ui\.core\.Widget\.SEL_PROPERTY_UNSELECTABLE\b="unselectable" +\bqx\.ui\.core\.Widget\.SEL_PROPERTY_USERSELECT\b="userSelect" +\bqx\.ui\.core\.Widget\.SEL_PROPERTY_MOZUSERSELECT\b="MozUserSelect" +\bqx\.ui\.core\.Widget\.SEL_PROPERTY_KHTMLUSERSELECT\b="KhtmlUserSelect" +\bqx\.ui\.core\.Widget\.OPACITY_FILTER_START\b="Alpha(Opacity\=" +\bqx\.ui\.core\.Widget\.OPACITY_FILTER_STOP\b=")" +\bqx\.ui\.core\.Widget\.OPACITY_FILTER_REGEXP = /Alpha\(Opacity\=([0-9]{1,3})\)/ +\bqx\.ui\.core\.Widget\.OPACITY_PROPERTY_CSS3\b="opacity" +\bqx\.ui\.core\.Widget\.OPACTIY_PROPERTY_MOZ\b="MozOpacity" +\bqx\.ui\.core\.Widget\.OPACITY_PROPERTY_MOZ\b="MozOpacity" +\bqx\.ui\.core\.Widget\.OPACITY_PROPERTY_KHTML\b="KhtmlOpacity" +\bqx\.ui\.core\.Widget\.CURSOR_PROPERTY\b="cursor" +\bqx\.ui\.core\.Widget\.CURSOR_VALUE_POINTER\b="pointer" +\bqx\.ui\.core\.Widget\.CURSOR_VALUE_HAND\b="hand" +\bqx\.ui\.core\.Widget\.BACKGROUNDIMG_PROPERTY\b="backgroundImage" +\bqx\.ui\.core\.Widget\.BACKGROUNDIMG_VALUE_START\b="url(" +\bqx\.ui\.core\.Widget\.BACKGROUNDIMG_VALUE_STOP\b=")" +\bqx\.ui\.core\.Widget\.BACKGROUNDIMG_REGEXP1 = /^url\(/i +\bqx\.ui\.core\.Widget\.BACKGROUNDIMG_REGEXP2 = /\)$/ +\bqx\.ui\.core\.Widget\.CLIP_PROPERTY\b="clip" +\bqx\.ui\.core\.Widget\.CLIP_VALUE_START\b="rect(" +\bqx\.ui\.core\.Widget\.CLIP_VALUE_STOP\b=")" +\bqx\.ui\.core\.Widget\.SCROLL_PROPERTY\b="overflow" +\bqx\.ui\.core\.Widget\.SCROLL_PROPERTYX\b="overflowX" +\bqx\.ui\.core\.Widget\.SCROLL_PROPERTYY\b="overflowY" +\bqx\.ui\.core\.Widget\.SCROLL_VALUE_AUTO\b="auto" +\bqx\.ui\.core\.Widget\.SCROLL_VALUE_HIDDEN\b="hidden" +\bqx\.ui\.core\.Widget\.SCROLL_VALUE_SCROLL\b="scroll" +\bqx\.ui\.core\.Widget\.SCROLL_VALUE_SCROLLX\b="scrollX" +\bqx\.ui\.core\.Widget\.SCROLL_VALUE_SCROLLY\b="scrollY" +\bqx\.ui\.core\.Widget\.SCROLL_VALUE_MOZNONE\b="-moz-scrollbars-none" +\bqx\.ui\.core\.Widget\.SCROLL_VALUE_MOZSCROLLX\b="-moz-scrollbars-horizontal" +\bqx\.ui\.core\.Widget\.SCROLL_VALUE_MOZSCROLLY\b="-moz-scrollbars-vertical" +\bqx\.ui\.core\.Widget\.INLINE_EVENTTYPE\b="propertychange" +\bqx\.ui\.core\.Widget\.INLINE_EVENTTYPE_PROPERTY\b="value" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/04-nativewindow.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/04-nativewindow.dat new file mode 100644 index 0000000000..6d3a136a57 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/04-nativewindow.dat @@ -0,0 +1,12 @@ +\bqx\.client\.NativeWindow\.PROPERTY_DEPENDENT\b="dependent" +\bqx\.client\.NativeWindow\.PROPERTY_WIDTH\b="width" +\bqx\.client\.NativeWindow\.PROPERTY_HEIGHT\b="height" +\bqx\.client\.NativeWindow\.PROPERTY_LEFT\b="left" +\bqx\.client\.NativeWindow\.PROPERTY_TOP\b="top" +\bqx\.client\.NativeWindow\.PROPERTY_RESIZABLE\b="resizable" +\bqx\.client\.NativeWindow\.PROPERTY_STATUS\b="status" +\bqx\.client\.NativeWindow\.PROPERTY_LOCATION\b="location" +\bqx\.client\.NativeWindow\.PROPERTY_MENUBAR\b="menubar" +\bqx\.client\.NativeWindow\.PROPERTY_TOOLBAR\b="toolbar" +\bqx\.client\.NativeWindow\.PROPERTY_SCROLLBARS\b="scrollbars" +\bqx\.client\.NativeWindow\.PROPERTY_MODAL\b="modal" \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/05-font.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/05-font.dat new file mode 100644 index 0000000000..63cefbabaa --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/05-font.dat @@ -0,0 +1,10 @@ +\bqx\.renderer\.font\.Font\.STYLE_BOLD\b="bold" +\bqx\.renderer\.font\.Font\.STYLE_NORMAL\b="normal" +\bqx\.renderer\.font\.Font\.STYLE_ITALIC\b="italic" +\bqx\.renderer\.font\.Font\.STYLE_UNDERLINE\b="underline" +\bqx\.renderer\.font\.Font\.STYLE_STRIKEOUT\b="strikeout" +\bqx\.renderer\.font\.Font\.PROPERTY_FAMILY\b="fontFamily" +\bqx\.renderer\.font\.Font\.PROPERTY_SIZE\b="fontSize" +\bqx\.renderer\.font\.Font\.PROPERTY_WEIGHT\b="fontWeight" +\bqx\.renderer\.font\.Font\.PROPERTY_STYLE\b="fontStyle" +\bqx\.renderer\.font\.Font\.PROPERTY_DECORATION\b="textDecoration" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/06-border.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/06-border.dat new file mode 100644 index 0000000000..58ed0f27dd --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/06-border.dat @@ -0,0 +1,17 @@ +\bqx\.renderer\.border\.Border\.STYLE_GROOVE\b="groove" +\bqx\.renderer\.border\.Border\.STYLE_RIDGE\b="ridge" +\bqx\.renderer\.border\.Border\.STYLE_INSET\b="inset" +\bqx\.renderer\.border\.Border\.STYLE_OUTSET\b="outset" +\bqx\.renderer\.border\.Border\.STYLE_SOLID\b="solid" +\bqx\.renderer\.border\.Border\.STYLE_DOTTED\b="dotted" +\bqx\.renderer\.border\.Border\.STYLE_DASHED\b="dashed" +\bqx\.renderer\.border\.Border\.STYLE_DOUBLE\b="double" +\bqx\.renderer\.border\.Border\.STYLE_NONE\b="none" +\bqx\.renderer\.border\.Border\.POSITION_TOP\b="top" +\bqx\.renderer\.border\.Border\.POSITION_RIGHT\b="right" +\bqx\.renderer\.border\.Border\.POSITION_BOTTOM\b="bottom" +\bqx\.renderer\.border\.Border\.POSITION_LEFT\b="left" +\bqx\.renderer\.border\.Border\.BORDER_NONE\b="0px none" +\bqx\.renderer\.border\.Border\.baseColor\b="threedlightshadow" +\bqx\.renderer\.border\.Border\.stylePart\b="Style" +\bqx\.renderer\.border\.Border\.colorPart\b="Color" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/07-color.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/07-color.dat new file mode 100644 index 0000000000..30003e9577 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/07-color.dat @@ -0,0 +1,2 @@ +\bqx\.renderer\.color\.Color\.RGBCSS_START\b="rgb(" +\bqx\.renderer\.color\.Color\.RGBCSS_STOP\b=")" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/08-image.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/08-image.dat new file mode 100644 index 0000000000..5bf6e48390 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/08-image.dat @@ -0,0 +1,7 @@ +qx\.ui\.basic\.Image\.ATTR_ALT\b="alt" +qx\.ui\.basic\.Image\.ATTR_TITLE\b="title" +qx\.ui\.basic\.Image\.BORDER_NONE\b="0 none" +qx\.ui\.basic\.Image\.RESET_VALIGN\b="top" +qx\.ui\.basic\.Image\.IMGLOADER_START\b="progid:DXImageTransform.Microsoft.AlphaImageLoader(src\='" +qx\.ui\.basic\.Image\.IMGLOADER_STOP\b="',sizingMethod\='scale')" +qx\.ui\.basic\.Image\.FILTER_GRAY\b="Gray() Alpha(Opacity\=30)" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/09-tree.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/09-tree.dat new file mode 100644 index 0000000000..6b8e84ba75 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/09-tree.dat @@ -0,0 +1,8 @@ +\bqx\.ui\.tree\.AbstractTreeElement\.INDENT_CODE_1\b="" +\bqx\.ui\.tree\.AbstractTreeElement\.IMG_EXTENSION\b="gif" +\bqx\.ui\.treefullcontrol\.AbstractTreeElement\.INDENT_CODE_1\b="" +\bqx\.ui\.treefullcontrol\.AbstractTreeElement\.IMG_EXTENSION\b="gif" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/10-table.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/10-table.dat new file mode 100644 index 0000000000..ed63f48058 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/10-table.dat @@ -0,0 +1,25 @@ +\bqx\.ui\.table\.DefaultDataCellRenderer\.INTERNAL_STYLE_ALIGN_RIGHT=";text-align:right" +\bqx\.ui\.table\.DefaultDataCellRenderer\.INTERNAL_STYLE_BOLD=";font-weight:bold" +\bqx\.ui\.table\.DefaultDataCellRenderer\.INTERNAL_STYLE_ITALIC=";font-style:italic" + +\bqx\.ui\.table\.TablePane\.ARRAY_JOIN_ROW_DIV_START\b='
' +\bqx\.ui\.table\.TablePane\.ARRAY_JOIN_ROW_DIV_END\b='
' + +\bqx\.ui\.table\.TablePane\.CONTENT_CELL_STYLE_LEFT\b='position:absolute;left:' +\bqx\.ui\.table\.TablePane\.CONTENT_CELL_STYLE_WIDTH\b='px;top:0px;width:' +\bqx\.ui\.table\.TablePane\.CONTENT_CELL_STYLE_HEIGHT\b='px; height:' + +\bqx\.ui\.table\.TablePane\.TABLE_START\b='' +\bqx\.ui\.table\.TablePane\.TABLE_COL\b='' +\bqx\.ui\.table\.TablePane\.TABLE_TBODY\b='' +\bqx\.ui\.table\.TablePane\.TABLE_TR\b='" \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/12-label.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/12-label.dat new file mode 100644 index 0000000000..32cb319a21 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/12-label.dat @@ -0,0 +1,21 @@ +\bqx\.ui\.basic\.Label\.COPY_STYLEPROPERTY\b="styleproperty" +\bqx\.ui\.basic\.Label\.COPY_COMPUTEDELEMENT\b="computedelement" +\bqx\.ui\.basic\.Label\.COPY_LOCALELEMENT\b="localelement" +\bqx\.ui\.basic\.Label\.OVERFLOW_HIDDEN\b="hidden" +\bqx\.ui\.basic\.Label\.OVERFLOW_ELLIPSIS\b="ellipsis" +\bqx\.ui\.basic\.Label\.INNER_TEXT\b="innerText" +\bqx\.ui\.basic\.Label\.INNER_HTML\b="innerHTML" +\bqx\.ui\.basic\.Label\.MNEMONIC_OUT_START\b="(" +\bqx\.ui\.basic\.Label\.MNEMONIC_OUT_STOP\b=")" +\bqx\.ui\.basic\.Label\.MNEMONIC_IN_START\b="" +\bqx\.ui\.basic\.Label\.MNEMONIC_IN_STOP\b="" +\bqx\.ui\.basic\.Label\.MNEMONIC_TEST1\b="^(((<([^>]|" +\bqx\.ui\.basic\.Label\.MNEMONIC_TEST2\b=")+>)|(&([^;]|" +\bqx\.ui\.basic\.Label\.MNEMONIC_TEST3\b=")+;)|[^&" +\bqx\.ui\.basic\.Label\.MNEMONIC_TEST4\b="])*)(" +\bqx\.ui\.basic\.Label\.MNEMONIC_TEST5\b=")" +\bqx\.ui\.basic\.Label\.MNEMONIC_REGMODE\b="i" +\bqx\.ui\.basic\.Label\.BR\b="
" +\bqx\.ui\.basic\.Label\.CODE1\b="&#x" +\bqx\.ui\.basic\.Label\.CODE2\b="&#" +\bqx\.ui\.basic\.Label\.TOSTRHELPER\b="0x" \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/13-window.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/13-window.dat new file mode 100644 index 0000000000..99c71f2d20 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/13-window.dat @@ -0,0 +1,8 @@ +\bqx\.ui\.window\.Window\.MODE_OPAQUE\b="opaque" +\bqx\.ui\.window\.Window\.MODE_LAZYOPAQUE\b="lazyopaque" +\bqx\.ui\.window\.Window\.MODE_FRAME\b="frame" +\bqx\.ui\.window\.Window\.MODE_TRANSLUCENT\b="translucent" +\bqx\.ui\.window\.Window\.MODE_MINIMIZED\b="minimized" +\bqx\.ui\.window\.Window\.MODE_MAXIMIZED\b="maximized" +\bqx\.ui\.window\.Window\.STATE_ACTIVE\b="active" +\bqx\.ui\.window\.Window\.STATE_MAXIMIZED\b="maximized" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/14-colorselector.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/14-colorselector.dat new file mode 100644 index 0000000000..1741cebc20 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/14-colorselector.dat @@ -0,0 +1,11 @@ +\bqx\.ui\.component\.ColorSelector\.CONTEXT_RED_MODIFIER\b="redModifier" +\bqx\.ui\.component\.ColorSelector\.CONTEXT_GREEN_MODIFIER\b="greenModifier" +\bqx\.ui\.component\.ColorSelector\.CONTEXT_BLUE_MODIFIER\b="blueModifier" +\bqx\.ui\.component\.ColorSelector\.CONTEXT_HUE_MODIFIER\b="hueModifier" +\bqx\.ui\.component\.ColorSelector\.CONTEXT_SATURATION_MODIFIER\b="saturationModifier" +\bqx\.ui\.component\.ColorSelector\.CONTEXT_BRIGHTNESS_MODIFIER\b="brightnessModifier" +\bqx\.ui\.component\.ColorSelector\.CONTEXT_HSB_SPINNER\b="hsbSpinner" +\bqx\.ui\.component\.ColorSelector\.CONTEXT_RGB_SPINNER\b="rgbSpinner" +\bqx\.ui\.component\.ColorSelector\.CONTEXT_HEX_FIELD\b="hexField" +\bqx\.ui\.component\.ColorSelector\.CONTEXT_HUE_SATURATION_FIELD\b="hueSaturationField" +\bqx\.ui\.component\.ColorSelector\.CONTEXT_BRIGHTNESS_FIELD\b="brightnessField" \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/15-datechooser.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/15-datechooser.dat new file mode 100644 index 0000000000..cd78f336d5 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/15-datechooser.dat @@ -0,0 +1,5 @@ +\bqx\.ui\.component\.DateChooser\.STATE_HEADER\b="header" +\bqx\.ui\.component\.DateChooser\.STATE_WEEKEND\b="weekend" +\bqx\.ui\.component\.DateChooser\.STATE_OTHER_MONTH\b="otherMonth" +\bqx\.ui\.component\.DateChooser\.STATE_SELECTED\b="selected" +\bqx\.ui\.component\.DateChooser\.STATE_TODAY\b="today" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/16-button.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/16-button.dat new file mode 100644 index 0000000000..953137b8dc --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/16-button.dat @@ -0,0 +1,3 @@ +\bqx\.ui\.form\.Button\.STATE_CHECKED\b="checked" +\bqx\.ui\.form\.Button\.STATE_PRESSED\b="pressed" +\bqx\.ui\.form\.Button\.STATE_ABANDONED\b="abandoned" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/17-selection.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/17-selection.dat new file mode 100644 index 0000000000..5dcc3754d7 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/17-selection.dat @@ -0,0 +1,3 @@ +\bqx\.manager\.selection\.SelectionManager\.STATE_SELECTED\b="selected" +\bqx\.manager\.selection\.SelectionManager\.STATE_ANCHOR\b="anchor" +\bqx\.manager\.selection\.SelectionManager\.STATE_LEAD\b="lead" diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/40-classnames.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/40-classnames.dat new file mode 100644 index 0000000000..5b43fdb3ab --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/40-classnames.dat @@ -0,0 +1,74 @@ +\bqx\.dom\.DomDimension\b=qx.dom.Dimension +\bqx\.dom\.DomElement\b=qx.dom.Element +\bqx\.dom\.DomElementFromPoint\b=qx.dom.ElementFromPoint +\bqx\.dom\.DomEventRegistration\b=qx.dom.EventRegistration +\bqx\.dom\.DomIframe\b=qx.dom.Iframe +\bqx\.dom\.DomLocation\b=qx.dom.Location +\bqx\.dom\.DomNode\b=qx.dom.Node +\bqx\.dom\.DomOffset\b=qx.dom.Offset +\bqx\.dom\.DomScroll\b=qx.dom.Scroll +\bqx\.dom\.DomScrollIntoView\b=qx.dom.ScrollIntoView +\bqx\.dom\.DomStyle\b=qx.dom.Style +\bqx\.dom\.DomStyleSheet\b=qx.dom.StyleSheet +\bqx\.dom\.DomWindow\b=qx.dom.Window + +\bqx\.io\.image\.ImagePreloaderSystem\b=qx.io.image.PreloaderSystem +\bqx\.io\.image\.ImagePreloader\b=qx.io.image.Preloader + +\bqx\.io\.remote\.RemoteExchange\b=qx.io.remote.Exchange +\bqx\.io\.remote\.RemoteRequest\b=qx.io.remote.Request +\bqx\.io\.remote\.RemoteRequestQueue\b=qx.io.remote.RequestQueue +\bqx\.io\.remote\.RemoteResponse\b=qx.io.remote.Response + +\bqx\.lang\.Xml\b=qx.xml.Core + +\bqx\.theme\.appearance\.DefaultAppearanceTheme\b=qx.theme.appearance.Classic +\bqx\.theme\.color\.SystemColorTheme\b=qx.theme.color.System +\bqx\.theme\.color\.WindowsClassicColorTheme\b=qx.theme.color.WindowsClassic +\bqx\.theme\.color\.WindowsLunaBlueColorTheme\b=qx.theme.color.WindowsLunaBlue +\bqx\.theme\.color\.WindowsLunaGreenColorTheme\b=qx.theme.color.WindowsLunaGreen +\bqx\.theme\.color\.WindowsLunaSilverColorTheme\b=qx.theme.color.WindowsLunaSilver +\bqx\.theme\.color\.WindowsRoyaleColorTheme\b=qx.theme.color.WindowsRoyale +\bqx\.theme\.icon\.NuvolaIconTheme\b=qx.theme.icon.Nuvola +\bqx\.theme\.icon\.CrystalSvgIconTheme\b=qx.theme.icon.CrystalSvg +\bqx\.theme\.widget\.WindowsWidgetTheme\b=qx.theme.widget.Windows + +\bqx\.ui\.listview\.ListViewHeaderSeparator\b=qx.ui.listview.HeaderSeparator +\bqx\.ui\.listview\.ListViewHeaderCell\b=qx.ui.listview.HeaderCell +\bqx\.ui\.listview\.ListViewHeader\b=qx.ui.listview.Header +\bqx\.ui\.listview\.ListViewContentCellText\b=qx.ui.listview.ContentCellText +\bqx\.ui\.listview\.ListViewContentCellLink\b=qx.ui.listview.ContentCellLink +\bqx\.ui\.listview\.ListViewContentCellImage\b=qx.ui.listview.ContentCellImage +\bqx\.ui\.listview\.ListViewContentCellIconHtml\b=qx.ui.listview.ContentCellIconHtml +\bqx\.ui\.listview\.ListViewContentCellHtml\b=qx.ui.listview.ContentCellHtml + +\bqx\.ui\.menu\.MenuRadioButton\b=qx.ui.menu.RadioButton +\bqx\.ui\.menu\.MenuLayout\b=qx.ui.menu.Layout +\bqx\.ui\.menu\.MenuCheckBox\b=qx.ui.menu.CheckBox +\bqx\.ui\.menu\.MenuButton\b=qx.ui.menu.Button +\bqx\.ui\.menu\.MenuSeparator\b=qx.ui.menu.Separator +\bqx\.ui\.menu\.MenuBar\b=qx.ui.menubar.MenuBar +\bqx\.ui\.menu\.MenuBarButton\b=qx.ui.menubar.Button + +\bqx\.ui\.pageview\.buttonview\.ButtonViewPage\b=qx.ui.pageview.buttonview.Page +\bqx\.ui\.pageview\.buttonview\.ButtonViewPane\b=qx.ui.pageview.buttonview.Pane +\bqx\.ui\.pageview\.buttonview\.ButtonViewBar\b=qx.ui.pageview.buttonview.Bar +\bqx\.ui\.pageview\.buttonview\.ButtonViewButton\b=qx.ui.pageview.buttonview.Button + +\bqx\.ui\.pageview\.tabview\.TabViewBar\b=qx.ui.pageview.tabview.Bar +\bqx\.ui\.pageview\.tabview\.TabViewButton\b=qx.ui.pageview.tabview.Button +\bqx\.ui\.pageview\.tabview\.TabViewPage\b=qx.ui.pageview.tabview.Page +\bqx\.ui\.pageview\.tabview\.TabViewPane\b=qx.ui.pageview.tabview.Pane + +\bqx\.ui\.toolbar\.ToolBarButton\b=qx.ui.toolbar.Button +\bqx\.ui\.toolbar\.ToolBarCheckBox\b=qx.ui.toolbar.CheckBox +\bqx\.ui\.toolbar\.ToolBarMenuButton\b=qx.ui.toolbar.MenuButton +\bqx\.ui\.toolbar\.ToolBarPart\b=qx.ui.toolbar.Part +\bqx\.ui\.toolbar\.ToolBarPartHandle\b=qx.ui.toolbar.PartHandle +\bqx\.ui\.toolbar\.ToolBarRadioButton\b=qx.ui.toolbar.RadioButton +\bqx\.ui\.toolbar\.ToolBarSeparator\b=qx.ui.toolbar.Separator + +\bqx\.ui\.pageview\.AbstractPageViewBar\b=qx.ui.pageview.AbstractBar +\bqx\.ui\.pageview\.AbstractPageViewButton\b=qx.ui.pageview.AbstractButton +\bqx\.ui\.pageview\.AbstractPageViewPage\b=qx.ui.pageview.AbstractPage +\bqx\.ui\.pageview\.AbstractPageViewPane\b=qx.ui.pageview.AbstractPane diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.4/info/01-locale.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.4/info/01-locale.dat new file mode 100644 index 0000000000..47259359e1 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.4/info/01-locale.dat @@ -0,0 +1,23 @@ +\bqx\.ui\.component\.DateChooser\.getStartOfWeek\b=Property startOfWeek has been removed. Please use the new localization features instead. +\bqx\.ui\.component\.DateChooser\.setStartOfWeek\b=Property startOfWeek has been removed. Please use the new localization features instead. + +\bqx\.util\.format\.NumberFormat\.GROUPING_SEPARATOR\b=The static field GROUPING_SEPARATOR has been removed. Use qx.locale.Number.getGroupSeperator() instead. + +\bqx\.util\.format\.NumberFormat\.SHORT_DATE_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDateFormat(”short”) instead. +\bqx\.util\.format\.NumberFormat\.SHORT_DATE_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDateFormat(”short”) instead. +\bqx\.util\.format\.NumberFormat\.MEDIUM_DATE_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDateFormat(”medium”) instead. +\bqx\.util\.format\.NumberFormat\.LONG_DATE_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDateFormat(”long”) instead. +\bqx\.util\.format\.NumberFormat\.FULL_DATE_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDateFormat(”full”) instead. +\bqx\.util\.format\.NumberFormat\.SHORT_TIME_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDateTimeFormat(”HHmm”, “HH:mm”) instead. +\bqx\.util\.format\.NumberFormat\.MEDIUM_TIME_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDateTimeFormat(”HHmm”, “HH:mm”) instead. +\bqx\.util\.format\.NumberFormat\.LONG_TIME_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDateTimeFormat(”HHmmss”, “HH:mm:ss”) instead. +\bqx\.util\.format\.NumberFormat\.FULL_TIME_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDateTimeFormat(”HHmmsszz”, “HH:mm:ss zz”) instead. +\bqx\.util\.format\.NumberFormat\.SHORT_DATE_TIME_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized qx.locale.Date.getDateFormat(”short”) + " " + qx.locale.Date.getDateTimeFormat(”HHmm”, “HH:mm”) instead. +\bqx\.util\.format\.NumberFormat\.MEDIUM_DATE_TIME_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized qx.locale.Date.getDateFormat(”medium”) + " " + qx.locale.Date.getDateTimeFormat(”HHmm”, “HH:mm”) instead. +\bqx\.util\.format\.NumberFormat\.LONG_DATE_TIME_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized qx.locale.Date.getDateFormat(”long”) + " " + qx.locale.Date.getDateTimeFormat(”HHmmss”, “HH:mm:ss”) instead. +\bqx\.util\.format\.NumberFormat\.FULL_DATE_TIME_FORMAT\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDateFormat(”full”) + " " + qx.locale.Date.getDateTimeFormat(”HHmmsszz”, “HH:mm:ss zz”) instead. +\bqx\.util\.format\.NumberFormat\.FULL_MONTH_NAMES\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getMonthNames(”wide”) instead. +\bqx\.util\.format\.NumberFormat\.SHORT_MONTH_NAMES\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getMonthNames(”abbreviated”) instead. +\bqx\.util\.format\.NumberFormat\.SHORT_DAY_OF_WEEK_NAMES\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDayNames(”narrow”) instead. +\bqx\.util\.format\.NumberFormat\.MEDIUM_DAY_OF_WEEK_NAMES\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDayNames(”abbreviated”) instead. +\bqx\.util\.format\.NumberFormat\.FULL_DAY_OF_WEEK_NAMES\b=The static fields of NumberFormat have been removed. Please use the localized method qx.locale.Date.getDayNames(”wide”) instead. diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.4/info/02-deprecated.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.4/info/02-deprecated.dat new file mode 100644 index 0000000000..f67b0d6f58 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.4/info/02-deprecated.dat @@ -0,0 +1,11 @@ +\b\.getKeyCode\b=The use of the keyCode property of qx.client.Command and qx.event.type.KeyEvent is deprecated. Use keyIdentifier instead! +\b\.setKeyCode\b=The use of the keyCode property of qx.client.Command and qx.event.type.KeyEvent is deprecated. Use keyIdentifier instead! + +\b\.getCtrlKey\b=The use of the getCtrlKey method of qx.event.type.DomEvent is deprecated. Use isCtrlPressed instead! +\b\.getAltKey\b=The use of the getAltKey method of qx.event.type.DomEvent is deprecated. Use isAltPressed instead! +\b\.getShiftKey\b=The use of the getShiftKey method of qx.event.type.DomEvent is deprecated. Use isShiftPressed instead! + +\bqx\.event\.type\.KeyEvent\.keys\b=Deprecated. Convert Your code to use keyIdentifier if possible. +\b\.getMaxTotalRequests\b=The use of the maxTotalRequests property of qx.io.remote.RequestQueue is deprecated. It will be removed in release 0.7! + +\bqx\.util\.Textile"\b=Deprecated module. Will be removed with qooxdoo 0.7. \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/01-mime.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/01-mime.dat new file mode 100644 index 0000000000..681428b20d --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/01-mime.dat @@ -0,0 +1 @@ +(? tags) \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/02-iconcleanup.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/02-iconcleanup.dat new file mode 100644 index 0000000000..6c52cd31b1 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/02-iconcleanup.dat @@ -0,0 +1,171 @@ +128/3d.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/antivirus.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/babelfish.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/back.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/block-device.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/down.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/favourite.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/file-print.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/forward.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/home.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/mac.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/penguin.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/reload.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/tux.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/up.png[\"\']=This icon was deprecated because of theme compatibility considerations +128/vectorgraphics.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/3d.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/antivirus.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/appearance.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/appointment.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/babelfish.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/block-device.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/cam.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/comment.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/contents.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/context-help.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/database.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/delete-table-cell.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/delete-table-col.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/delete-table.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/delete-table-row.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/documentinfo.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/emoticon.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/favorites.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/favourite.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/file-find.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/fileshare.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/flag.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/font-size-down.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/font-size-up.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/format-decrease-indent.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/format-increase-indent.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/funct.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/goto.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/group-event.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/hardware.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/idea.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/inbox.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/insert-table-col.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/insert-table.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/insert-table-row.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/instant-available.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/instant-away.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/launch.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/mac.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/mousecursor.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/outbox.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/penguin.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/remove-comment.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/search.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/server.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/sound.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/text-bottom.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/text-color.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/text-strike.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/text-sub.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/text-super.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/text-top.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/trash.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/tux.png[\"\']=This icon was deprecated because of theme compatibility considerations +16/vectorgraphics.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/antivirus.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/appearance.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/appointment.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/babelfish.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/block-device.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/contents.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/delete-table-col.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/delete-table-row.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/effect.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/favourite.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/file-find.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/flowchart.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/font-size-down.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/font-size-up.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/format-decrease-indent.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/format-increase-indent.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/funct.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/idea.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/inbox.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/insert-table-col.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/insert-table-row.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/instant-available.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/instant-away.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/launch.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/look-and-feel.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/mac.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/movieplayer.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/outbox.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/penguin.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/search.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/server.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/services.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/text-strike.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/tux.png[\"\']=This icon was deprecated because of theme compatibility considerations +22/vectorgraphics.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/3d.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/antivirus.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/appearance.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/appointment.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/babelfish.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/block-device.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/cam.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/delete-table-col.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/delete-table-row.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/favorites.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/favourite.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/file-find.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/fileshare.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/funct.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/goto.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/hardware.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/inbox.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/insert-table-col.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/insert-table-row.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/instant-available.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/instant-away.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/launch.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/mac.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/outbox.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/penguin.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/search.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/server.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/sound.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/tux.png[\"\']=This icon was deprecated because of theme compatibility considerations +32/vectorgraphics.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/3d.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/antivirus.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/babelfish.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/block-device.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/favorites.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/favourite.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/fileshare.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/hardware.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/inbox.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/instant-available.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/instant-away.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/mac.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/outbox.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/penguin.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/server.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/tux.png[\"\']=This icon was deprecated because of theme compatibility considerations +48/vectorgraphics.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/3d.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/antivirus.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/babelfish.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/back.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/block-device.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/down.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/favourite.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/file-print.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/fileshare.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/forward.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/hardware.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/home.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/mac.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/penguin.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/reload.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/tux.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/up.png[\"\']=This icon was deprecated because of theme compatibility considerations +64/vectorgraphics.png[\"\']=This icon was deprecated because of theme compatibility considerations diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/03-icons.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/03-icons.dat new file mode 100644 index 0000000000..3e427c0147 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/info/03-icons.dat @@ -0,0 +1,73 @@ +(? qx.html +##################### + +\bqx\.dom\.Dimension\b=qx.html.Dimension +\bqx\.dom\.ElementFromPoint\b=qx.html.ElementFromPoint +\bqx\.dom\.EventRegistration\b=qx.html.EventRegistration +\bqx\.dom\.Iframe\b=qx.html.Iframe +\bqx\.dom\.Location\b=qx.html.Location +\bqx\.dom\.Offset\b=qx.html.Offset +\bqx\.dom\.ScrollIntoView\b=qx.html.ScrollIntoView +\bqx\.dom\.Scroll\b=qx.html.Scroll +\bqx\.dom\.Style\b=qx.html.Style +\bqx\.dom\.StyleSheet\b=qx.html.StyleSheet +\bqx\.dom\.Window\b=qx.html.Window + + +############### +# xml.Document +############### + +\bqx\.xml\.Core\.createXmlDocument\b=qx.xml.Document.create +\bqx\.xml\.Core\.isDocument\b=qx.xml.Document.isDocument +\bqx\.xml\.Core\.parse\b=qx.xml.Document.fromString + + +############## +# xml.Element +############## + +\bqx\.xml\.Core\.serialize\b=qx.xml.Element.serialize +\bqx\.xml\.Core\.selectSingleNode\b=qx.xml.Element.selectSingleNode +\bqx\.xml\.Core\.selectNodes\b=qx.xml.Element.selectNodes +\bqx\.xml\.Core\.getElementsByTagNameNS\b=qx.xml.Element.getElementsByTagNameNS + +############## +# xml.Element +############## + +\bqx\.xml\.Core\.getTextContent\b=qx.dom.Element.getTextContent + + +################## +# net.HttpRequest +################## + +\bqx\.xml\.Core\.createXmlHttpRequest\b=qx.net.HttpRequest.create + + +############# +# html.Form +############# + +\bqx\.util\.FormUtil\b=qx.html.Form + + +############### +# html.Textile +############### + +\bqx\.util\.Textile\b=qx.html.Textile + + +################ +# lang.Function +################ + +\bqx\.util\.Return\b=qx.lang.Function + + +##################### +# util.StringBuilder +##################### + +\bqx\.type\.StringBuilder\b=qx.util.StringBuilder + + +############## +# core.Client +############## + +\bqx\.sys\.Client\b=qx.core.Client + + +################## +# util.GuiBuilder +################## + +\bqx\.client\.Builder\b=qx.util.GuiBuilder + + +###### +# log +###### + +\bqx\.dev\.log\b=qx.log + diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/06-mime.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/06-mime.dat new file mode 100644 index 0000000000..fd394282eb --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/06-mime.dat @@ -0,0 +1,8 @@ +(? = }); + +#this\.getClientWindow\(\)\.getClientDocument\(\) = qx.ui.core.ClientDocument.getInstance() + +#this\.add = qx.ui.core.ClientDocument.getInstance().add \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.7/patch.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.7/patch.py new file mode 100755 index 0000000000..885cafda8d --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.7/patch.py @@ -0,0 +1,381 @@ +#!/usr/bin/env python + +import sys, os + +# reconfigure path to import modules from modules subfolder +sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), "../../modules")) + +import tree, compiler, comment + + + + + + +def getAssignment(elem): + if elem.parent.type == "right" and elem.parent.parent.type == "assignment": + return elem.parent.parent + + return None + + +def getName(elem): + # find last identifier + last = elem.getLastChild(False, True) + + if last.type == "identifier": + return last.get("name") + + +def getMode(var, classname): + # find last identifier + last = var.getLastChild(False, True) + prev = last.getPreviousSibling(False, True) + + if prev.type == "identifier": + mode = prev.get("name") + + if mode == "Proto": + return "members" + elif mode == "Class": + return "statics" + + combined = [] + length = var.getChildrenLength(True) + pos = length - 1 + for iden in var.children: + if iden.type == "identifier": + combined.append(iden.get("name")) + + # if variable starts with the classname and has one unique identifier afterwards + if ".".join(combined) == classname and pos == 1: + return "statics" + + pos -= 1 + + return None + + +def getNameOfAssignment(elem): + name = None + + if elem.hasChild("left"): + left = elem.getChild("left") + + if left.hasChild("variable"): + name = getName(left.getChild("variable")) + + return name + + +def getModeOfAssignment(elem, classname): + mode = None + + if elem.hasChild("left"): + left = elem.getChild("left") + + if left.hasChild("variable"): + var = left.getChild("variable") + mode = getMode(var, classname) + + return mode + + +def getAndRemovePropertyName(definition): + for keyValue in definition.children: + if keyValue.type == "keyvalue" and keyValue.get("key") == "name": + name = keyValue.getChild("value").getChild("constant").get("value") + keyValue.parent.removeChild(keyValue) + return name + + print " * Could not extract property name!" + return None + + +def createPair(key, value, commentParent=None): + par = tree.Node("keyvalue") + sub = tree.Node("value") + + par.set("key", key) + par.addChild(sub) + sub.addChild(value) + + if commentParent and commentParent.hasChild("commentsBefore"): + par.addChild(commentParent.getChild("commentsBefore")) + + return par + + +def patch(id, node): + if not node.hasChildren(): + return False + + classDefine, className, classMap, settingsMap, propertiesMap, membersMap, staticsMap = createClassDefine(id) + errorCounter = 0 + pos = 0 + + while node.hasChildren() and pos < len(node.children): + child = node.children[pos] + breakBefore = child.get("breakBefore") + pos += 1 + + # Add instance and static methods + if child.type == "assignment": + if child.hasChild("right"): + right = child.getChild("right") + elem = right.getFirstChild(True, True) + + name = getNameOfAssignment(child) + mode = getModeOfAssignment(child, id) + + if mode in [ "members", "statics" ]: + if mode == "members": + pair = createPair(name, elem, child) + + if breakBefore: + pair.set("breakBefore", True) + + membersMap.addChild(pair) + + elif mode == "statics": + # Special Handling of old singleton definition + if name == "getInstance": + pair = createPair("singleton", createConstant("boolean", "true")) + pair.addChild(createBlockComment("singleton")) + + if breakBefore: + pair.set("breakBefore", True) + + classMap.addChild(pair, 1) + + else: + pair = createPair(name, elem, child) + + if breakBefore: + pair.set("breakBefore", True) + + staticsMap.addChild(pair) + + node.removeChild(child) + pos -= 1 + + elif child.type == "call": + oper = child.getChild("operand") + var = oper.getChild("variable") + + if var: + lastIdentifier = var.getLastChild(False, True) + if lastIdentifier.type == "identifier": + name = lastIdentifier.get("name") + params = child.getChild("params") + + if name in [ "addProperty", "changeProperty", "addCachedProperty", "addFastProperty" ]: + definition = params.getFirstChild(False, True) + + if definition.type == "map": + if lastIdentifier.get("name") == "addFastProperty": + definition.addChild(createPair("fast", createConstant("boolean", "true"))) + elif lastIdentifier.get("name") == "addCachedProperty": + definition.addChild(createPair("cached", createConstant("boolean", "true"))) + + name = getAndRemovePropertyName(definition) + pair = createPair(name, definition, child) + + if breakBefore: + pair.set("breakBefore", True) + + propertiesMap.addChild(pair) + + node.removeChild(child) + pos -= 1 + + elif name == "setDefault": + nameNode = params.getChildByPosition(0, True) + valueNode = params.getChildByPosition(1, True) + + name = nameNode.get("value") + + pair = createPair(name, valueNode, child) + + if breakBefore: + pair.set("breakBefore", True) + + settingsMap.addChild(pair) + + node.removeChild(child) + pos -= 1 + + elif name == "defineClass": + if params.getFirstChild(False, True).get("value") != id: + print " - The class seems to have a wrong definition!" + + # 3 params = name, superclass, constructor + # 2 params = name, map + # 1 param = name + + # Move class comment + if child.hasChild("commentsBefore"): + classDefine.addChild(child.getChild("commentsBefore")) + + childrenLength = params.getChildrenLength(True) + + if childrenLength == 2: + statics_new = params.getChildByPosition(1, True, True) + + while statics_new.hasChildren(): + staticsMap.addChild(statics_new.getFirstChild()) + + node.removeChild(child) + pos -= 1 + + elif childrenLength == 3: + ext = params.getChildByPosition(1, True, True) + construct = params.getChildByPosition(2, True, True) + + extendPair = createPair("extend", ext) + constructPair = createPair("construct", construct) + + extendPair.addChild(createBlockComment("superclass")) + constructPair.addChild(createBlockComment("constructor")) + + classMap.addChild(extendPair, 0) + classMap.addChild(constructPair, 1) + + node.removeChild(child) + pos -= 1 + + elif name == "define": + print " - Class is already up-to-date." + return False + + # Post-Check + if child.parent == node: + # print " - Could not move element %s at line %s" % (child.type, child.get("line")) + errorCounter += 1 + + + # Remove empty maps + if settingsMap.getChildrenLength() == 0: + keyvalue = settingsMap.parent.parent + classMap.removeChild(keyvalue) + + if propertiesMap.getChildrenLength() == 0: + keyvalue = propertiesMap.parent.parent + classMap.removeChild(keyvalue) + + if membersMap.getChildrenLength() == 0: + keyvalue = membersMap.parent.parent + classMap.removeChild(keyvalue) + + if staticsMap.getChildrenLength() == 0: + keyvalue = staticsMap.parent.parent + classMap.removeChild(keyvalue) + + # Add new class definition + node.addChild(classDefine, 0) + + + + + if errorCounter > 0: + print " - Could not convert %s elements." % errorCounter + + # Debug + # print compiler.compile(node) + # print tree.nodeToXmlString(node) + + # Return Modification + return True + + +def createConstant(type, value): + constant = tree.Node("constant") + constant.set("constantType", type) + constant.set("value", value) + + if type == "string": + constant.set("detail", "doublequotes") + + return constant + + + +def createVariable(l): + var = tree.Node("variable") + + for name in l: + iden = tree.Node("identifier") + iden.set("name", name) + var.addChild(iden) + + return var + +def createClassDefineCore(id): + call = tree.Node("call") + oper = tree.Node("operand") + para = tree.Node("params") + con = createConstant("string", id) + args = tree.Node("map") + + call.addChild(oper) + call.addChild(para) + + oper.addChild(createVariable(["qx", "Clazz", "define"])) + + para.addChild(con) + para.addChild(args) + + return call, con, args + + +def createClassDefine(id): + classDefine, className, classMap = createClassDefineCore(id) + + settingsMap = tree.Node("map") + settingsPair = createPair("settings", settingsMap) + + propertiesMap = tree.Node("map") + propertiesPair = createPair("properties", propertiesMap) + + membersMap = tree.Node("map") + membersPair = createPair("members", membersMap) + + staticsMap = tree.Node("map") + staticsPair = createPair("statics", staticsMap) + + settingsPair.addChild(createBlockComment("settings")) + propertiesPair.addChild(createBlockComment("properties")) + membersPair.addChild(createBlockComment("members")) + staticsPair.addChild(createBlockComment("statics")) + + classMap.addChild(settingsPair) + classMap.addChild(propertiesPair) + classMap.addChild(membersPair) + classMap.addChild(staticsPair) + + return classDefine, className, classMap, settingsMap, propertiesMap, membersMap, staticsMap + + +def createBlockComment(txt): + l = "*****************************************************************************" + + s = "" + s += "/*\n" + s += "%s\n" % l + s += "**** %s %s\n" % (txt.upper(), "*" * (len(l) - len(txt) - 6)) + s += "%s\n" % l + s += "*/" + + bef = tree.Node("commentsBefore") + com = tree.Node("comment") + + bef.addChild(com) + + com.set("multiline", True) + com.set("connection", "before") + com.set("text", s) + com.set("detail", comment.getFormat(s)) + + return bef + + diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/ElementPath.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/ElementPath.py new file mode 100644 index 0000000000..558b560aff --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/ElementPath.py @@ -0,0 +1,196 @@ +# +# ElementTree +# $Id: ElementPath.py 1858 2004-06-17 21:31:41Z Fredrik $ +# +# limited xpath support for element trees +# +# history: +# 2003-05-23 fl created +# 2003-05-28 fl added support for // etc +# 2003-08-27 fl fixed parsing of periods in element names +# +# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved. +# +# fredrik@pythonware.com +# http://www.pythonware.com +# +# -------------------------------------------------------------------- +# The ElementTree toolkit is +# +# Copyright (c) 1999-2004 by Fredrik Lundh +# +# By obtaining, using, and/or copying this software and/or its +# associated documentation, you agree that you have read, understood, +# and will comply with the following terms and conditions: +# +# Permission to use, copy, modify, and distribute this software and +# its associated documentation for any purpose and without fee is +# hereby granted, provided that the above copyright notice appears in +# all copies, and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name of +# Secret Labs AB or the author not be used in advertising or publicity +# pertaining to distribution of the software without specific, written +# prior permission. +# +# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- +# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR +# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY +# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# -------------------------------------------------------------------- + +## +# Implementation module for XPath support. There's usually no reason +# to import this module directly; the ElementTree does this for +# you, if needed. +## + +import re + +xpath_tokenizer = re.compile( + "(::|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/:\[\]\(\)@=\s]+)|\s+" + ).findall + +class xpath_descendant_or_self: + pass + +## +# Wrapper for a compiled XPath. + +class Path: + + ## + # Create an Path instance from an XPath expression. + + def __init__(self, path): + tokens = xpath_tokenizer(path) + # the current version supports 'path/path'-style expressions only + self.path = [] + self.tag = None + if tokens and tokens[0][0] == "/": + raise SyntaxError("cannot use absolute path on element") + while tokens: + op, tag = tokens.pop(0) + if tag or op == "*": + self.path.append(tag or op) + elif op == ".": + pass + elif op == "/": + self.path.append(xpath_descendant_or_self()) + continue + else: + raise SyntaxError("unsupported path syntax (%s)" % op) + if tokens: + op, tag = tokens.pop(0) + if op != "/": + raise SyntaxError( + "expected path separator (%s)" % (op or tag) + ) + if self.path and isinstance(self.path[-1], xpath_descendant_or_self): + raise SyntaxError("path cannot end with //") + if len(self.path) == 1 and isinstance(self.path[0], type("")): + self.tag = self.path[0] + + ## + # Find first matching object. + + def find(self, element): + tag = self.tag + if tag is None: + nodeset = self.findall(element) + if not nodeset: + return None + return nodeset[0] + for elem in element: + if elem.tag == tag: + return elem + return None + + ## + # Find text for first matching object. + + def findtext(self, element, default=None): + tag = self.tag + if tag is None: + nodeset = self.findall(element) + if not nodeset: + return default + return nodeset[0].text or "" + for elem in element: + if elem.tag == tag: + return elem.text or "" + return default + + ## + # Find all matching objects. + + def findall(self, element): + nodeset = [element] + index = 0 + while 1: + try: + path = self.path[index] + index = index + 1 + except IndexError: + return nodeset + set = [] + if isinstance(path, xpath_descendant_or_self): + try: + tag = self.path[index] + if not isinstance(tag, type("")): + tag = None + else: + index = index + 1 + except IndexError: + tag = None # invalid path + for node in nodeset: + new = list(node.getiterator(tag)) + if new and new[0] is node: + set.extend(new[1:]) + else: + set.extend(new) + else: + for node in nodeset: + for node in node: + if path == "*" or node.tag == path: + set.append(node) + if not set: + return [] + nodeset = set + +_cache = {} + +## +# (Internal) Compile path. + +def _compile(path): + p = _cache.get(path) + if p is not None: + return p + p = Path(path) + if len(_cache) >= 100: + _cache.clear() + _cache[path] = p + return p + +## +# Find first matching object. + +def find(element, path): + return _compile(path).find(element) + +## +# Find text for first matching object. + +def findtext(element, path, default=None): + return _compile(path).findtext(element, default) + +## +# Find all matching objects. + +def findall(element, path): + return _compile(path).findall(element) + diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/ElementTree.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/ElementTree.py new file mode 100644 index 0000000000..98d0208792 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/ElementTree.py @@ -0,0 +1,1254 @@ +# +# ElementTree +# $Id: ElementTree.py 2326 2005-03-17 07:45:21Z fredrik $ +# +# light-weight XML support for Python 1.5.2 and later. +# +# history: +# 2001-10-20 fl created (from various sources) +# 2001-11-01 fl return root from parse method +# 2002-02-16 fl sort attributes in lexical order +# 2002-04-06 fl TreeBuilder refactoring, added PythonDoc markup +# 2002-05-01 fl finished TreeBuilder refactoring +# 2002-07-14 fl added basic namespace support to ElementTree.write +# 2002-07-25 fl added QName attribute support +# 2002-10-20 fl fixed encoding in write +# 2002-11-24 fl changed default encoding to ascii; fixed attribute encoding +# 2002-11-27 fl accept file objects or file names for parse/write +# 2002-12-04 fl moved XMLTreeBuilder back to this module +# 2003-01-11 fl fixed entity encoding glitch for us-ascii +# 2003-02-13 fl added XML literal factory +# 2003-02-21 fl added ProcessingInstruction/PI factory +# 2003-05-11 fl added tostring/fromstring helpers +# 2003-05-26 fl added ElementPath support +# 2003-07-05 fl added makeelement factory method +# 2003-07-28 fl added more well-known namespace prefixes +# 2003-08-15 fl fixed typo in ElementTree.findtext (Thomas Dartsch) +# 2003-09-04 fl fall back on emulator if ElementPath is not installed +# 2003-10-31 fl markup updates +# 2003-11-15 fl fixed nested namespace bug +# 2004-03-28 fl added XMLID helper +# 2004-06-02 fl added default support to findtext +# 2004-06-08 fl fixed encoding of non-ascii element/attribute names +# 2004-08-23 fl take advantage of post-2.1 expat features +# 2005-02-01 fl added iterparse implementation +# 2005-03-02 fl fixed iterparse support for pre-2.2 versions +# +# Copyright (c) 1999-2005 by Fredrik Lundh. All rights reserved. +# +# fredrik@pythonware.com +# http://www.pythonware.com +# +# -------------------------------------------------------------------- +# The ElementTree toolkit is +# +# Copyright (c) 1999-2005 by Fredrik Lundh +# +# By obtaining, using, and/or copying this software and/or its +# associated documentation, you agree that you have read, understood, +# and will comply with the following terms and conditions: +# +# Permission to use, copy, modify, and distribute this software and +# its associated documentation for any purpose and without fee is +# hereby granted, provided that the above copyright notice appears in +# all copies, and that both that copyright notice and this permission +# notice appear in supporting documentation, and that the name of +# Secret Labs AB or the author not be used in advertising or publicity +# pertaining to distribution of the software without specific, written +# prior permission. +# +# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD +# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- +# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR +# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY +# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +# OF THIS SOFTWARE. +# -------------------------------------------------------------------- + +__all__ = [ + # public symbols + "Comment", + "dump", + "Element", "ElementTree", + "fromstring", + "iselement", "iterparse", + "parse", + "PI", "ProcessingInstruction", + "QName", + "SubElement", + "tostring", + "TreeBuilder", + "VERSION", "XML", + "XMLTreeBuilder", + ] + +## +# The Element type is a flexible container object, designed to +# store hierarchical data structures in memory. The type can be +# described as a cross between a list and a dictionary. +#

+# Each element has a number of properties associated with it: +#

+# +# To create an element instance, use the {@link #Element} or {@link +# #SubElement} factory functions. +#

+# The {@link #ElementTree} class can be used to wrap an element +# structure, and convert it from and to XML. +## + +import string, sys, re + +class _SimpleElementPath: + # emulate pre-1.2 find/findtext/findall behaviour + def find(self, element, tag): + for elem in element: + if elem.tag == tag: + return elem + return None + def findtext(self, element, tag, default=None): + for elem in element: + if elem.tag == tag: + return elem.text or "" + return default + def findall(self, element, tag): + if tag[:3] == ".//": + return element.getiterator(tag[3:]) + result = [] + for elem in element: + if elem.tag == tag: + result.append(elem) + return result + +try: + import ElementPath +except ImportError: + # FIXME: issue warning in this case? + ElementPath = _SimpleElementPath() + +# TODO: add support for custom namespace resolvers/default namespaces +# TODO: add improved support for incremental parsing + +VERSION = "1.2.6" + +## +# Internal element class. This class defines the Element interface, +# and provides a reference implementation of this interface. +#

+# You should not create instances of this class directly. Use the +# appropriate factory functions instead, such as {@link #Element} +# and {@link #SubElement}. +# +# @see Element +# @see SubElement +# @see Comment +# @see ProcessingInstruction + +class _ElementInterface: + # text...tail + + ## + # (Attribute) Element tag. + + tag = None + + ## + # (Attribute) Element attribute dictionary. Where possible, use + # {@link #_ElementInterface.get}, + # {@link #_ElementInterface.set}, + # {@link #_ElementInterface.keys}, and + # {@link #_ElementInterface.items} to access + # element attributes. + + attrib = None + + ## + # (Attribute) Text before first subelement. This is either a + # string or the value None, if there was no text. + + text = None + + ## + # (Attribute) Text after this element's end tag, but before the + # next sibling element's start tag. This is either a string or + # the value None, if there was no text. + + tail = None # text after end tag, if any + + def __init__(self, tag, attrib): + self.tag = tag + self.attrib = attrib + self._children = [] + + def __repr__(self): + return "" % (self.tag, id(self)) + + ## + # Creates a new element object of the same type as this element. + # + # @param tag Element tag. + # @param attrib Element attributes, given as a dictionary. + # @return A new element instance. + + def makeelement(self, tag, attrib): + return Element(tag, attrib) + + ## + # Returns the number of subelements. + # + # @return The number of subelements. + + def __len__(self): + return len(self._children) + + ## + # Returns the given subelement. + # + # @param index What subelement to return. + # @return The given subelement. + # @exception IndexError If the given element does not exist. + + def __getitem__(self, index): + return self._children[index] + + ## + # Replaces the given subelement. + # + # @param index What subelement to replace. + # @param element The new element value. + # @exception IndexError If the given element does not exist. + # @exception AssertionError If element is not a valid object. + + def __setitem__(self, index, element): + assert iselement(element) + self._children[index] = element + + ## + # Deletes the given subelement. + # + # @param index What subelement to delete. + # @exception IndexError If the given element does not exist. + + def __delitem__(self, index): + del self._children[index] + + ## + # Returns a list containing subelements in the given range. + # + # @param start The first subelement to return. + # @param stop The first subelement that shouldn't be returned. + # @return A sequence object containing subelements. + + def __getslice__(self, start, stop): + return self._children[start:stop] + + ## + # Replaces a number of subelements with elements from a sequence. + # + # @param start The first subelement to replace. + # @param stop The first subelement that shouldn't be replaced. + # @param elements A sequence object with zero or more elements. + # @exception AssertionError If a sequence member is not a valid object. + + def __setslice__(self, start, stop, elements): + for element in elements: + assert iselement(element) + self._children[start:stop] = list(elements) + + ## + # Deletes a number of subelements. + # + # @param start The first subelement to delete. + # @param stop The first subelement to leave in there. + + def __delslice__(self, start, stop): + del self._children[start:stop] + + ## + # Adds a subelement to the end of this element. + # + # @param element The element to add. + # @exception AssertionError If a sequence member is not a valid object. + + def append(self, element): + assert iselement(element) + self._children.append(element) + + ## + # Inserts a subelement at the given position in this element. + # + # @param index Where to insert the new subelement. + # @exception AssertionError If the element is not a valid object. + + def insert(self, index, element): + assert iselement(element) + self._children.insert(index, element) + + ## + # Removes a matching subelement. Unlike the find methods, + # this method compares elements based on identity, not on tag + # value or contents. + # + # @param element What element to remove. + # @exception ValueError If a matching element could not be found. + # @exception AssertionError If the element is not a valid object. + + def remove(self, element): + assert iselement(element) + self._children.remove(element) + + ## + # Returns all subelements. The elements are returned in document + # order. + # + # @return A list of subelements. + # @defreturn list of Element instances + + def getchildren(self): + return self._children + + ## + # Finds the first matching subelement, by tag name or path. + # + # @param path What element to look for. + # @return The first matching element, or None if no element was found. + # @defreturn Element or None + + def find(self, path): + return ElementPath.find(self, path) + + ## + # Finds text for the first matching subelement, by tag name or path. + # + # @param path What element to look for. + # @param default What to return if the element was not found. + # @return The text content of the first matching element, or the + # default value no element was found. Note that if the element + # has is found, but has no text content, this method returns an + # empty string. + # @defreturn string + + def findtext(self, path, default=None): + return ElementPath.findtext(self, path, default) + + ## + # Finds all matching subelements, by tag name or path. + # + # @param path What element to look for. + # @return A list or iterator containing all matching elements, + # in document order. + # @defreturn list of Element instances + + def findall(self, path): + return ElementPath.findall(self, path) + + ## + # Resets an element. This function removes all subelements, clears + # all attributes, and sets the text and tail attributes to None. + + def clear(self): + self.attrib.clear() + self._children = [] + self.text = self.tail = None + + ## + # Gets an element attribute. + # + # @param key What attribute to look for. + # @param default What to return if the attribute was not found. + # @return The attribute value, or the default value, if the + # attribute was not found. + # @defreturn string or None + + def get(self, key, default=None): + return self.attrib.get(key, default) + + ## + # Sets an element attribute. + # + # @param key What attribute to set. + # @param value The attribute value. + + def set(self, key, value): + self.attrib[key] = value + + ## + # Gets a list of attribute names. The names are returned in an + # arbitrary order (just like for an ordinary Python dictionary). + # + # @return A list of element attribute names. + # @defreturn list of strings + + def keys(self): + return self.attrib.keys() + + ## + # Gets element attributes, as a sequence. The attributes are + # returned in an arbitrary order. + # + # @return A list of (name, value) tuples for all attributes. + # @defreturn list of (string, string) tuples + + def items(self): + return self.attrib.items() + + ## + # Creates a tree iterator. The iterator loops over this element + # and all subelements, in document order, and returns all elements + # with a matching tag. + #

+ # If the tree structure is modified during iteration, the result + # is undefined. + # + # @param tag What tags to look for (default is to return all elements). + # @return A list or iterator containing all the matching elements. + # @defreturn list or iterator + + def getiterator(self, tag=None): + nodes = [] + if tag == "*": + tag = None + if tag is None or self.tag == tag: + nodes.append(self) + for node in self._children: + nodes.extend(node.getiterator(tag)) + return nodes + +# compatibility +_Element = _ElementInterface + +## +# Element factory. This function returns an object implementing the +# standard Element interface. The exact class or type of that object +# is implementation dependent, but it will always be compatible with +# the {@link #_ElementInterface} class in this module. +#

+# The element name, attribute names, and attribute values can be +# either 8-bit ASCII strings or Unicode strings. +# +# @param tag The element name. +# @param attrib An optional dictionary, containing element attributes. +# @param **extra Additional attributes, given as keyword arguments. +# @return An element instance. +# @defreturn Element + +def Element(tag, attrib={}, **extra): + attrib = attrib.copy() + attrib.update(extra) + return _ElementInterface(tag, attrib) + +## +# Subelement factory. This function creates an element instance, and +# appends it to an existing element. +#

+# The element name, attribute names, and attribute values can be +# either 8-bit ASCII strings or Unicode strings. +# +# @param parent The parent element. +# @param tag The subelement name. +# @param attrib An optional dictionary, containing element attributes. +# @param **extra Additional attributes, given as keyword arguments. +# @return An element instance. +# @defreturn Element + +def SubElement(parent, tag, attrib={}, **extra): + attrib = attrib.copy() + attrib.update(extra) + element = parent.makeelement(tag, attrib) + parent.append(element) + return element + +## +# Comment element factory. This factory function creates a special +# element that will be serialized as an XML comment. +#

+# The comment string can be either an 8-bit ASCII string or a Unicode +# string. +# +# @param text A string containing the comment string. +# @return An element instance, representing a comment. +# @defreturn Element + +def Comment(text=None): + element = Element(Comment) + element.text = text + return element + +## +# PI element factory. This factory function creates a special element +# that will be serialized as an XML processing instruction. +# +# @param target A string containing the PI target. +# @param text A string containing the PI contents, if any. +# @return An element instance, representing a PI. +# @defreturn Element + +def ProcessingInstruction(target, text=None): + element = Element(ProcessingInstruction) + element.text = target + if text: + element.text = element.text + " " + text + return element + +PI = ProcessingInstruction + +## +# QName wrapper. This can be used to wrap a QName attribute value, in +# order to get proper namespace handling on output. +# +# @param text A string containing the QName value, in the form {uri}local, +# or, if the tag argument is given, the URI part of a QName. +# @param tag Optional tag. If given, the first argument is interpreted as +# an URI, and this argument is interpreted as a local name. +# @return An opaque object, representing the QName. + +class QName: + def __init__(self, text_or_uri, tag=None): + if tag: + text_or_uri = "{%s}%s" % (text_or_uri, tag) + self.text = text_or_uri + def __str__(self): + return self.text + def __hash__(self): + return hash(self.text) + def __cmp__(self, other): + if isinstance(other, QName): + return cmp(self.text, other.text) + return cmp(self.text, other) + +## +# ElementTree wrapper class. This class represents an entire element +# hierarchy, and adds some extra support for serialization to and from +# standard XML. +# +# @param element Optional root element. +# @keyparam file Optional file handle or name. If given, the +# tree is initialized with the contents of this XML file. + +class ElementTree: + + def __init__(self, element=None, file=None): + assert element is None or iselement(element) + self._root = element # first node + if file: + self.parse(file) + + ## + # Gets the root element for this tree. + # + # @return An element instance. + # @defreturn Element + + def getroot(self): + return self._root + + ## + # Replaces the root element for this tree. This discards the + # current contents of the tree, and replaces it with the given + # element. Use with care. + # + # @param element An element instance. + + def _setroot(self, element): + assert iselement(element) + self._root = element + + ## + # Loads an external XML document into this element tree. + # + # @param source A file name or file object. + # @param parser An optional parser instance. If not given, the + # standard {@link XMLTreeBuilder} parser is used. + # @return The document root element. + # @defreturn Element + + def parse(self, source, parser=None): + if not hasattr(source, "read"): + source = open(source, "rb") + if not parser: + parser = XMLTreeBuilder() + while 1: + data = source.read(32768) + if not data: + break + parser.feed(data) + self._root = parser.close() + return self._root + + ## + # Creates a tree iterator for the root element. The iterator loops + # over all elements in this tree, in document order. + # + # @param tag What tags to look for (default is to return all elements) + # @return An iterator. + # @defreturn iterator + + def getiterator(self, tag=None): + assert self._root is not None + return self._root.getiterator(tag) + + ## + # Finds the first toplevel element with given tag. + # Same as getroot().find(path). + # + # @param path What element to look for. + # @return The first matching element, or None if no element was found. + # @defreturn Element or None + + def find(self, path): + assert self._root is not None + if path[:1] == "/": + path = "." + path + return self._root.find(path) + + ## + # Finds the element text for the first toplevel element with given + # tag. Same as getroot().findtext(path). + # + # @param path What toplevel element to look for. + # @param default What to return if the element was not found. + # @return The text content of the first matching element, or the + # default value no element was found. Note that if the element + # has is found, but has no text content, this method returns an + # empty string. + # @defreturn string + + def findtext(self, path, default=None): + assert self._root is not None + if path[:1] == "/": + path = "." + path + return self._root.findtext(path, default) + + ## + # Finds all toplevel elements with the given tag. + # Same as getroot().findall(path). + # + # @param path What element to look for. + # @return A list or iterator containing all matching elements, + # in document order. + # @defreturn list of Element instances + + def findall(self, path): + assert self._root is not None + if path[:1] == "/": + path = "." + path + return self._root.findall(path) + + ## + # Writes the element tree to a file, as XML. + # + # @param file A file name, or a file object opened for writing. + # @param encoding Optional output encoding (default is US-ASCII). + + def write(self, file, encoding="us-ascii"): + assert self._root is not None + if not hasattr(file, "write"): + file = open(file, "wb") + if not encoding: + encoding = "us-ascii" + elif encoding != "utf-8" and encoding != "us-ascii": + file.write("\n" % encoding) + self._write(file, self._root, encoding, {}) + + def _write(self, file, node, encoding, namespaces): + # write XML to file + tag = node.tag + if tag is Comment: + file.write("" % _escape_cdata(node.text, encoding)) + elif tag is ProcessingInstruction: + file.write("" % _escape_cdata(node.text, encoding)) + else: + items = node.items() + xmlns_items = [] # new namespaces in this scope + try: + if isinstance(tag, QName) or tag[:1] == "{": + tag, xmlns = fixtag(tag, namespaces) + if xmlns: xmlns_items.append(xmlns) + except TypeError: + _raise_serialization_error(tag) + file.write("<" + _encode(tag, encoding)) + if items or xmlns_items: + items.sort() # lexical order + for k, v in items: + try: + if isinstance(k, QName) or k[:1] == "{": + k, xmlns = fixtag(k, namespaces) + if xmlns: xmlns_items.append(xmlns) + except TypeError: + _raise_serialization_error(k) + try: + if isinstance(v, QName): + v, xmlns = fixtag(v, namespaces) + if xmlns: xmlns_items.append(xmlns) + except TypeError: + _raise_serialization_error(v) + file.write(" %s=\"%s\"" % (_encode(k, encoding), + _escape_attrib(v, encoding))) + for k, v in xmlns_items: + file.write(" %s=\"%s\"" % (_encode(k, encoding), + _escape_attrib(v, encoding))) + if node.text or len(node): + file.write(">") + if node.text: + file.write(_escape_cdata(node.text, encoding)) + for n in node: + self._write(file, n, encoding, namespaces) + file.write("") + else: + file.write(" />") + for k, v in xmlns_items: + del namespaces[v] + if node.tail: + file.write(_escape_cdata(node.tail, encoding)) + +# -------------------------------------------------------------------- +# helpers + +## +# Checks if an object appears to be a valid element object. +# +# @param An element instance. +# @return A true value if this is an element object. +# @defreturn flag + +def iselement(element): + # FIXME: not sure about this; might be a better idea to look + # for tag/attrib/text attributes + return isinstance(element, _ElementInterface) or hasattr(element, "tag") + +## +# Writes an element tree or element structure to sys.stdout. This +# function should be used for debugging only. +#

+# The exact output format is implementation dependent. In this +# version, it's written as an ordinary XML file. +# +# @param elem An element tree or an individual element. + +def dump(elem): + # debugging + if not isinstance(elem, ElementTree): + elem = ElementTree(elem) + elem.write(sys.stdout) + tail = elem.getroot().tail + if not tail or tail[-1] != "\n": + sys.stdout.write("\n") + +def _encode(s, encoding): + try: + return s.encode(encoding) + except AttributeError: + return s # 1.5.2: assume the string uses the right encoding + +if sys.version[:3] == "1.5": + _escape = re.compile(r"[&<>\"\x80-\xff]+") # 1.5.2 +else: + _escape = re.compile(eval(r'u"[&<>\"\u0080-\uffff]+"')) + +_escape_map = { + "&": "&", + "<": "<", + ">": ">", + '"': """, +} + +_namespace_map = { + # "well-known" namespace prefixes + "http://www.w3.org/XML/1998/namespace": "xml", + "http://www.w3.org/1999/xhtml": "html", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf", + "http://schemas.xmlsoap.org/wsdl/": "wsdl", +} + +def _raise_serialization_error(text): + raise TypeError( + "cannot serialize %r (type %s)" % (text, type(text).__name__) + ) + +def _encode_entity(text, pattern=_escape): + # map reserved and non-ascii characters to numerical entities + def escape_entities(m, map=_escape_map): + out = [] + append = out.append + for char in m.group(): + text = map.get(char) + if text is None: + text = "&#%d;" % ord(char) + append(text) + return string.join(out, "") + try: + return _encode(pattern.sub(escape_entities, text), "ascii") + except TypeError: + _raise_serialization_error(text) + +# +# the following functions assume an ascii-compatible encoding +# (or "utf-16") + +def _escape_cdata(text, encoding=None, replace=string.replace): + # escape character data + try: + if encoding: + try: + text = _encode(text, encoding) + except UnicodeError: + return _encode_entity(text) + text = replace(text, "&", "&") + text = replace(text, "<", "<") + text = replace(text, ">", ">") + return text + except (TypeError, AttributeError): + _raise_serialization_error(text) + +def _escape_attrib(text, encoding=None, replace=string.replace): + # escape attribute value + try: + if encoding: + try: + text = _encode(text, encoding) + except UnicodeError: + return _encode_entity(text) + text = replace(text, "&", "&") + text = replace(text, "'", "'") # FIXME: overkill + text = replace(text, "\"", """) + text = replace(text, "<", "<") + text = replace(text, ">", ">") + return text + except (TypeError, AttributeError): + _raise_serialization_error(text) + +def fixtag(tag, namespaces): + # given a decorated tag (of the form {uri}tag), return prefixed + # tag and namespace declaration, if any + if isinstance(tag, QName): + tag = tag.text + namespace_uri, tag = string.split(tag[1:], "}", 1) + prefix = namespaces.get(namespace_uri) + if prefix is None: + prefix = _namespace_map.get(namespace_uri) + if prefix is None: + prefix = "ns%d" % len(namespaces) + namespaces[namespace_uri] = prefix + if prefix == "xml": + xmlns = None + else: + xmlns = ("xmlns:%s" % prefix, namespace_uri) + else: + xmlns = None + return "%s:%s" % (prefix, tag), xmlns + +## +# Parses an XML document into an element tree. +# +# @param source A filename or file object containing XML data. +# @param parser An optional parser instance. If not given, the +# standard {@link XMLTreeBuilder} parser is used. +# @return An ElementTree instance + +def parse(source, parser=None): + tree = ElementTree() + tree.parse(source, parser) + return tree + +## +# Parses an XML document into an element tree incrementally, and reports +# what's going on to the user. +# +# @param source A filename or file object containing XML data. +# @param events A list of events to report back. If omitted, only "end" +# events are reported. +# @return A (event, elem) iterator. + +class iterparse: + + def __init__(self, source, events=None): + if not hasattr(source, "read"): + source = open(source, "rb") + self._file = source + self._events = [] + self._index = 0 + self.root = self._root = None + self._parser = XMLTreeBuilder() + # wire up the parser for event reporting + parser = self._parser._parser + append = self._events.append + if events is None: + events = ["end"] + for event in events: + if event == "start": + try: + parser.ordered_attributes = 1 + parser.specified_attributes = 1 + def handler(tag, attrib_in, event=event, append=append, + start=self._parser._start_list): + append((event, start(tag, attrib_in))) + parser.StartElementHandler = handler + except AttributeError: + def handler(tag, attrib_in, event=event, append=append, + start=self._parser._start): + append((event, start(tag, attrib_in))) + parser.StartElementHandler = handler + elif event == "end": + def handler(tag, event=event, append=append, + end=self._parser._end): + append((event, end(tag))) + parser.EndElementHandler = handler + elif event == "start-ns": + def handler(prefix, uri, event=event, append=append): + try: + uri = _encode(uri, "ascii") + except UnicodeError: + pass + append((event, (prefix or "", uri))) + parser.StartNamespaceDeclHandler = handler + elif event == "end-ns": + def handler(prefix, event=event, append=append): + append((event, None)) + parser.EndNamespaceDeclHandler = handler + + def next(self): + while 1: + try: + item = self._events[self._index] + except IndexError: + if self._parser is None: + self.root = self._root + try: + raise StopIteration + except NameError: + raise IndexError + # load event buffer + del self._events[:] + self._index = 0 + data = self._file.read(16384) + if data: + self._parser.feed(data) + else: + self._root = self._parser.close() + self._parser = None + else: + self._index = self._index + 1 + return item + + try: + iter + def __iter__(self): + return self + except NameError: + def __getitem__(self, index): + return self.next() + +## +# Parses an XML document from a string constant. This function can +# be used to embed "XML literals" in Python code. +# +# @param source A string containing XML data. +# @return An Element instance. +# @defreturn Element + +def XML(text): + parser = XMLTreeBuilder() + parser.feed(text) + return parser.close() + +## +# Parses an XML document from a string constant, and also returns +# a dictionary which maps from element id:s to elements. +# +# @param source A string containing XML data. +# @return A tuple containing an Element instance and a dictionary. +# @defreturn (Element, dictionary) + +def XMLID(text): + parser = XMLTreeBuilder() + parser.feed(text) + tree = parser.close() + ids = {} + for elem in tree.getiterator(): + id = elem.get("id") + if id: + ids[id] = elem + return tree, ids + +## +# Parses an XML document from a string constant. Same as {@link #XML}. +# +# @def fromstring(text) +# @param source A string containing XML data. +# @return An Element instance. +# @defreturn Element + +fromstring = XML + +## +# Generates a string representation of an XML element, including all +# subelements. +# +# @param element An Element instance. +# @return An encoded string containing the XML data. +# @defreturn string + +def tostring(element, encoding=None): + class dummy: + pass + data = [] + file = dummy() + file.write = data.append + ElementTree(element).write(file, encoding) + return string.join(data, "") + +## +# Generic element structure builder. This builder converts a sequence +# of {@link #TreeBuilder.start}, {@link #TreeBuilder.data}, and {@link +# #TreeBuilder.end} method calls to a well-formed element structure. +#

+# You can use this class to build an element structure using a custom XML +# parser, or a parser for some other XML-like format. +# +# @param element_factory Optional element factory. This factory +# is called to create new Element instances, as necessary. + +class TreeBuilder: + + def __init__(self, element_factory=None): + self._data = [] # data collector + self._elem = [] # element stack + self._last = None # last element + self._tail = None # true if we're after an end tag + if element_factory is None: + element_factory = _ElementInterface + self._factory = element_factory + + ## + # Flushes the parser buffers, and returns the toplevel documen + # element. + # + # @return An Element instance. + # @defreturn Element + + def close(self): + assert len(self._elem) == 0, "missing end tags" + assert self._last != None, "missing toplevel element" + return self._last + + def _flush(self): + if self._data: + if self._last is not None: + text = string.join(self._data, "") + if self._tail: + assert self._last.tail is None, "internal error (tail)" + self._last.tail = text + else: + assert self._last.text is None, "internal error (text)" + self._last.text = text + self._data = [] + + ## + # Adds text to the current element. + # + # @param data A string. This should be either an 8-bit string + # containing ASCII text, or a Unicode string. + + def data(self, data): + self._data.append(data) + + ## + # Opens a new element. + # + # @param tag The element name. + # @param attrib A dictionary containing element attributes. + # @return The opened element. + # @defreturn Element + + def start(self, tag, attrs): + self._flush() + self._last = elem = self._factory(tag, attrs) + if self._elem: + self._elem[-1].append(elem) + self._elem.append(elem) + self._tail = 0 + return elem + + ## + # Closes the current element. + # + # @param tag The element name. + # @return The closed element. + # @defreturn Element + + def end(self, tag): + self._flush() + self._last = self._elem.pop() + assert self._last.tag == tag,\ + "end tag mismatch (expected %s, got %s)" % ( + self._last.tag, tag) + self._tail = 1 + return self._last + +## +# Element structure builder for XML source data, based on the +# expat parser. +# +# @keyparam target Target object. If omitted, the builder uses an +# instance of the standard {@link #TreeBuilder} class. +# @keyparam html Predefine HTML entities. This flag is not supported +# by the current implementation. +# @see #ElementTree +# @see #TreeBuilder + +class XMLTreeBuilder: + + def __init__(self, html=0, target=None): + try: + from xml.parsers import expat + except ImportError: + raise ImportError( + "No module named expat; use SimpleXMLTreeBuilder instead" + ) + self._parser = parser = expat.ParserCreate(None, "}") + if target is None: + target = TreeBuilder() + self._target = target + self._names = {} # name memo cache + # callbacks + parser.DefaultHandlerExpand = self._default + parser.StartElementHandler = self._start + parser.EndElementHandler = self._end + parser.CharacterDataHandler = self._data + # let expat do the buffering, if supported + try: + self._parser.buffer_text = 1 + except AttributeError: + pass + # use new-style attribute handling, if supported + try: + self._parser.ordered_attributes = 1 + self._parser.specified_attributes = 1 + parser.StartElementHandler = self._start_list + except AttributeError: + pass + encoding = None + if not parser.returns_unicode: + encoding = "utf-8" + # target.xml(encoding, None) + self._doctype = None + self.entity = {} + + def _fixtext(self, text): + # convert text string to ascii, if possible + try: + return _encode(text, "ascii") + except UnicodeError: + return text + + def _fixname(self, key): + # expand qname, and convert name string to ascii, if possible + try: + name = self._names[key] + except KeyError: + name = key + if "}" in name: + name = "{" + name + self._names[key] = name = self._fixtext(name) + return name + + def _start(self, tag, attrib_in): + fixname = self._fixname + tag = fixname(tag) + attrib = {} + for key, value in attrib_in.items(): + attrib[fixname(key)] = self._fixtext(value) + return self._target.start(tag, attrib) + + def _start_list(self, tag, attrib_in): + fixname = self._fixname + tag = fixname(tag) + attrib = {} + if attrib_in: + for i in range(0, len(attrib_in), 2): + attrib[fixname(attrib_in[i])] = self._fixtext(attrib_in[i+1]) + return self._target.start(tag, attrib) + + def _data(self, text): + return self._target.data(self._fixtext(text)) + + def _end(self, tag): + return self._target.end(self._fixname(tag)) + + def _default(self, text): + prefix = text[:1] + if prefix == "&": + # deal with undefined entities + try: + self._target.data(self.entity[text[1:-1]]) + except KeyError: + from xml.parsers import expat + raise expat.error( + "undefined entity %s: line %d, column %d" % + (text, self._parser.ErrorLineNumber, + self._parser.ErrorColumnNumber) + ) + elif prefix == "<" and text[:9] == "": + self._doctype = None + return + text = string.strip(text) + if not text: + return + self._doctype.append(text) + n = len(self._doctype) + if n > 2: + type = self._doctype[1] + if type == "PUBLIC" and n == 4: + name, type, pubid, system = self._doctype + elif type == "SYSTEM" and n == 3: + name, type, system = self._doctype + pubid = None + else: + return + if pubid: + pubid = pubid[1:-1] + self.doctype(name, pubid, system[1:-1]) + self._doctype = None + + ## + # Handles a doctype declaration. + # + # @param name Doctype name. + # @param pubid Public identifier. + # @param system System identifier. + + def doctype(self, name, pubid, system): + pass + + ## + # Feeds data to the parser. + # + # @param data Encoded data. + + def feed(self, data): + self._parser.Parse(data, 0) + + ## + # Finishes feeding data to the parser. + # + # @return An element structure. + # @defreturn Element + + def close(self): + self._parser.Parse("", 1) # end of data + tree = self._target.close() + del self._target, self._parser # get rid of circular references + return tree diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/api.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/api.py new file mode 100755 index 0000000000..d636205dba --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/api.py @@ -0,0 +1,987 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Andreas Ecker (ecker) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +import sys, os, re, optparse +import tree, treegenerator, tokenizer, comment + + + +######################################################################################## +# +# MAIN +# +######################################################################################## + +class DocException (Exception): + def __init__ (self, msg, syntaxItem): + Exception.__init__(self, msg) + self.node = syntaxItem + + + +def createDoc(syntaxTree, docTree = None): + if not docTree: + docTree = tree.Node("doctree") + + try: + currClassNode = None + if not syntaxTree.hasChildren(): + return docTree + + for item in syntaxTree.children: + if item.type == "assignment": + leftItem = item.getFirstListChild("left") + rightItem = item.getFirstListChild("right") + if leftItem.type == "variable": + if currClassNode and len(leftItem.children) == 3 and leftItem.children[0].get("name") == "qx": + + if leftItem.children[1].get("name") == "Proto" and rightItem.type == "function": + # It's a method definition + handleMethodDefinitionOld(item, False, currClassNode) + + elif leftItem.children[1].get("name") == "Class": + if rightItem.type == "function": + handleMethodDefinitionOld(item, True, currClassNode) + + elif leftItem.children[2].get("name").isupper(): + handleConstantDefinition(item, currClassNode) + + elif currClassNode and assembleVariable(leftItem).startswith(currClassNode.get("fullName")): + # This is definition of the type "mypackage.MyClass.bla = ..." + if rightItem.type == "function": + handleMethodDefinitionOld(item, True, currClassNode) + + elif leftItem.children[len(leftItem.children) - 1].get("name").isupper(): + handleConstantDefinition(item, currClassNode) + + elif item.type == "call": + operand = item.getChild("operand", False) + if operand: + var = operand.getChild("variable", False) + + # qooxdoo < 0.7 (DEPRECATED) + if var and len(var.children) == 3 and var.children[0].get("name") == "qx" and var.children[1].get("name") == "OO": + methodName = var.children[2].get("name") + + if methodName == "defineClass": + currClassNode = handleClassDefinitionOld(docTree, item) + + elif methodName in [ "addProperty", "addFastProperty" ]: + # these are private and should be marked if listed, otherwise just hide them (wpbasti) + #or methodName == "addCachedProperty" or methodName == "changeProperty": + handlePropertyDefinitionOld(item, currClassNode) + + # qooxdoo >= 0.7 + elif var and len(var.children) == 3 and var.children[0].get("name") == "qx" and var.children[1].get("name") in [ "Class", "Clazz", "Locale", "Interface", "Mixin" ] and var.children[2].get("name") == "define": + currClassNode = handleClassDefinition(docTree, item, var.children[1].get("name").lower()) + + + except Exception: + exc = sys.exc_info()[1] + msg = "" + + if hasattr(exc, "node"): + (line, column) = getLineAndColumnFromSyntaxItem(exc.node) + file = getFileFromSyntaxItem(exc.node) + if line != None or file != None: + msg = str(exc) + "\n " + str(file) + ", Line: " + str(line) + ", Column: " + str(column) + + if msg == "": + raise exc + + else: + print + print " - Failed: %s" % msg + sys.exit(1) + + return docTree + + + + + + + + + + +######################################################################################## +# +# COMPATIBLE TO 0.7 STYLE ONLY! +# +######################################################################################## + +def handleClassDefinition(docTree, item, variant): + params = item.getChild("params") + + className = params.children[0].get("value") + classMap = params.children[1] + classNode = getClassNode(docTree, className) + + #print className + + try: + children = classMap.children + except AttributeError: + return + + for keyvalueItem in children: + key = keyvalueItem.get("key") + valueItem = keyvalueItem.getChild("value").getFirstChild() + + # print "KEY: %s = %s" % (key, valueItem.type) + + if key == "extend": + if variant in [ "class", "clazz" ]: + superClassName = assembleVariable(valueItem) + superClassNode = getClassNode(docTree, superClassName) + childClasses = superClassNode.get("childClasses", False) + + if childClasses: + childClasses += "," + className + else: + childClasses = className + + superClassNode.set("childClasses", childClasses) + + classNode.set("superClass", superClassName) + + elif variant == "interface": + pass + + elif variant == "mixin": + pass + + elif key == "include": + handleMixins(valueItem, classNode) + + elif key == "implement": + handleInterfaces(valueItem, classNode) + + elif key == "init": + handleConstructor(valueItem, classNode) + + elif key == "statics": + handleStatics(valueItem, classNode) + + elif key == "properties": + handleProperties(valueItem, classNode) + + elif key == "members": + handleMembers(valueItem, classNode) + +def handleMixins(item, classNode): + #print " - Found Mixin" + pass + +def handleInterfaces(item, classNode): + #print " - Found Interface" + pass + +def handleConstructor(item, classNode): + #print " - Found Constructor" + pass + +def handleStatics(item, classNode): + if item.hasChildren(): + for keyvalue in item.children: + key = keyvalue.get("key") + value = keyvalue.getFirstChild(True, True).getFirstChild(True, True) + commentAttributes = comment.parseNode(keyvalue) + + # print " - Found Static: %s = %s" % (key, value.type) + + # Function + if value.type == "function": + node = handleFunction(value, commentAttributes, classNode) + node.set("name", key) + node.set("isStatic", True) + + classNode.addListChild("methods-static", node) + + # Constant + elif key.isupper(): + handleConstantDefinition(keyvalue, classNode) + +def handleProperties(item, classNode): + if item.hasChildren(): + for keyvalue in item.children: + key = keyvalue.get("key") + value = keyvalue.getFirstChild(True, True).getFirstChild(True, True) + # print " - Found Property: %s" % key + + # TODO: New handling for new properties needed + handlePropertyDefinitionOldCommon(keyvalue, classNode, key, value) + +def handleMembers(item, classNode): + if item.hasChildren(): + for keyvalue in item.children: + key = keyvalue.get("key") + value = keyvalue.getFirstChild(True, True).getFirstChild(True, True) + commentAttributes = comment.parseNode(keyvalue) + + # print " - Found Member: %s = %s" % (key, value.type) + + # Function + if value.type == "function": + + node = handleFunction(value, commentAttributes, classNode) + node.set("name", key) + + classNode.addListChild("methods", node) + + + + + + +######################################################################################## +# +# COMPATIBLE TO 0.6 STYLE ONLY! +# +######################################################################################## + +def handleClassDefinitionOld(docTree, item): + params = item.getChild("params") + + paramsLen = len(params.children); + if paramsLen == 1: + superClassName = "Object" + ctorItem = None + elif paramsLen == 2: + superClassName = "Object" + ctorItem = params.children[1] + elif paramsLen == 3: + superClassName = assembleVariable(params.children[1]) + ctorItem = params.children[2] + else: + raise DocException("defineClass call has more than three parameters: " + str(len(params.children)), item) + + className = params.children[0].get("value") + classNode = getClassNode(docTree, className) + + if superClassName != "Object": + superClassNode = getClassNode(docTree, superClassName) + childClasses = superClassNode.get("childClasses", False) + if childClasses: + childClasses += "," + className + else: + childClasses = className + superClassNode.set("childClasses", childClasses) + + classNode.set("superClass", superClassName) + + commentAttributes = comment.parseNode(item) + + for attrib in commentAttributes: + if attrib["category"] == "event": + # Add the event + if comment.attribHas(attrib, "name") and comment.attribHas(attrib, "type"): + addEventNode(classNode, item, attrib); + else: + addError(classNode, "Documentation contains malformed event attribute.", item) + elif attrib["category"] == "description": + if attrib.has_key("text"): + descNode = tree.Node("desc").set("text", attrib["text"]) + classNode.addChild(descNode) + + # Add the constructor + if ctorItem and ctorItem.type == "function": + ctor = handleFunction(ctorItem, commentAttributes, classNode) + ctor.set("isCtor", True) + classNode.addListChild("constructor", ctor) + + # Check for methods defined in the constructor + # (for method definition style that supports real private methods) + ctorBlock = ctorItem.getChild("body").getChild("block") + + if ctorBlock.hasChildren(): + for item in ctorBlock.children: + if item.type == "assignment": + leftItem = item.getFirstListChild("left") + rightItem = item.getFirstListChild("right") + + # It's a method definition + if leftItem.type == "variable" and len(leftItem.children) == 2 and (leftItem.children[0].get("name") == "this" or leftItem.children[0].get("name") == "self") and rightItem.type == "function": + handleMethodDefinitionOld(item, False, classNode) + + elif ctorItem and ctorItem.type == "map": + for keyvalueItem in ctorItem.children: + if keyvalueItem.type == "keyvalue": + valueItem = keyvalueItem.getChild("value").getFirstChild() + if (valueItem.type == "function"): + handleMethodDefinitionOld(keyvalueItem, True, classNode) + else: + handleConstantDefinition(keyvalueItem, classNode) + + return classNode + +def handlePropertyDefinitionOld(item, classNode): + paramsMap = item.getChild("params").getChild("map") + propertyName = paramsMap.getChildByAttribute("key", "name").getChild("value").getChild("constant").get("value") + + handlePropertyDefinitionOldCommon(item, classNode, propertyName, paramsMap) + +def handlePropertyDefinitionOldCommon(item, classNode, propertyName, paramsMap): + node = tree.Node("property") + node.set("name", propertyName) + + propType = paramsMap.getChildByAttribute("key", "type", False) + if propType: + node.set("type", getType(propType.getChild("value").getFirstChild())) + + allowNull = paramsMap.getChildByAttribute("key", "allowNull", False) + if allowNull: + node.set("allowNull", allowNull.getChild("value").getChild("constant").get("value")) + + defaultValue = paramsMap.getChildByAttribute("key", "defaultValue", False) + if defaultValue: + node.set("defaultValue", getValue(defaultValue.getFirstListChild("value"))) + + getAlias = paramsMap.getChildByAttribute("key", "getAlias", False) + if getAlias: + node.set("getAlias", getAlias.getChild("value").getChild("constant").get("value")) + + setAlias = paramsMap.getChildByAttribute("key", "setAlias", False) + if setAlias: + node.set("setAlias", setAlias.getChild("value").getChild("constant").get("value")) + + unitDetection = paramsMap.getChildByAttribute("key", "unitDetection", False) + if unitDetection: + node.set("unitDetection", unitDetection.getChild("value").getChild("constant").get("value")) + + instance = paramsMap.getChildByAttribute("key", "instance", False) + if instance: + node.set("instance", instance.getChild("value").getChild("constant").get("value")) + + classname = paramsMap.getChildByAttribute("key", "classname", False) + if classname: + node.set("classname", classname.getChild("value").getChild("constant").get("value")) + + possibleValues = paramsMap.getChildByAttribute("key", "possibleValues", False) + if possibleValues: + array = possibleValues.getChild("value").getChild("array") + values = "" + for arrayItem in array.children: + if len(values) != 0: + values += ", " + values += getValue(arrayItem) + node.set("possibleValues", values) + + # If the description has a type specified then take this type + # (and not the one extracted from the paramsMap) + commentAttributes = comment.parseNode(item) + addTypeInfo(node, comment.getAttrib(commentAttributes, "description"), item) + + classNode.addListChild("properties", node) + +def handleMethodDefinitionOld(item, isStatic, classNode): + if item.type == "assignment": + # This is a "normal" method definition + leftItem = item.getFirstListChild("left") + name = leftItem.children[len(leftItem.children) - 1].get("name") + functionItem = item.getFirstListChild("right") + elif item.type == "keyvalue": + # This is a method definition of a map-style class (like qx.Const) + name = item.get("key") + functionItem = item.getFirstListChild("value") + + commentAttributes = comment.parseNode(item) + + node = handleFunction(functionItem, commentAttributes, classNode) + node.set("name", name) + + isPublic = name[0] != "_" + listName = "methods" + if isStatic: + node.set("isStatic", True) + listName += "-static" + + classNode.addListChild(listName, node) + + + + + + + + +######################################################################################## +# +# COMPATIBLE TO BOTH, 0.6 and 0.7 style +# +######################################################################################## + +def handleConstantDefinition(item, classNode): + if (item.type == "assignment"): + # This is a "normal" constant definition + leftItem = item.getFirstListChild("left") + name = leftItem.children[len(leftItem.children) - 1].get("name") + valueNode = item.getChild("right") + elif (item.type == "keyvalue"): + # This is a constant definition of a map-style class (like qx.Const) + name = item.get("key") + valueNode = item.getChild("value") + + if not name.isupper(): + return + + node = tree.Node("constant") + node.set("name", name) + + value = None + if valueNode.hasChild("constant"): + node.set("value", valueNode.getChild("constant").get("value")) + node.set("type", valueNode.getChild("constant").get("constantType").capitalize()) + + commentAttributes = comment.parseNode(item) + description = comment.getAttrib(commentAttributes, "description") + addTypeInfo(node, description, item) + + classNode.addListChild("constants", node) + +def handleFunction(funcItem, commentAttributes, classNode): + if funcItem.type != "function": + raise DocException("'funcItem' is no function", funcItem) + + node = tree.Node("method") + + # Read the parameters + params = funcItem.getChild("params", False) + if params and params.hasChildren(): + for param in params.children: + paramNode = tree.Node("param") + paramNode.set("name", param.getFirstChild().get("name")) + node.addListChild("params", paramNode) + + # Check whether the function is abstract + bodyBlockItem = funcItem.getChild("body").getFirstChild(); + if bodyBlockItem.type == "block" and bodyBlockItem.hasChildren(): + firstStatement = bodyBlockItem.children[0]; + if firstStatement.type == "throw": + # The first statement of the function is a throw statement + # -> The function is abstract + node.set("isAbstract", True) + + if len(commentAttributes) == 0: + addError(node, "Documentation is missing.", funcItem) + return node + + # Read all description, param and return attributes + for attrib in commentAttributes: + # Add description + if attrib["category"] == "description": + if attrib.has_key("text"): + descNode = tree.Node("desc").set("text", attrib["text"]) + node.addChild(descNode) + + elif attrib["category"] == "see": + if not attrib.has_key("name"): + raise DocException("Missing target for see.", funcItem) + + seeNode = tree.Node("see").set("name", attrib["name"]) + node.addChild(seeNode) + + elif attrib["category"] == "param": + if not attrib.has_key("name"): + raise DocException("Missing name of parameter.", funcItem) + + # Find the matching param node + paramName = attrib["name"] + paramNode = node.getListChildByAttribute("params", "name", paramName, False) + + if not paramNode: + addError(node, "Contains information for a non-existing parameter %s." % paramName, funcItem) + continue + + addTypeInfo(paramNode, attrib, funcItem) + + elif attrib["category"] == "return": + returnNode = tree.Node("return") + node.addChild(returnNode) + + addTypeInfo(returnNode, attrib, funcItem) + + # Check for documentation errors + # Check whether all parameters have been documented + if node.hasChild("params"): + paramsListNode = node.getChild("params"); + for paramNode in paramsListNode.children: + if not paramNode.getChild("desc", False): + addError(node, "Parameter %s is not documented." % paramNode.get("name"), funcItem) + + return node + + + + + + + + + + +######################################################################################## +# +# COMMON STUFF +# +####################################################################################### + + +def variableIsClassName(varItem): + length = len(varItem.children) + for i in range(length): + varChild = varItem.children[i] + if not varChild.type == "identifier": + return False + if i < length - 1: + # This is not the last identifier -> It must a package (= lowercase) + if not varChild.get("name").islower(): + return False + else: + # This is the last identifier -> It must the class name (= first letter uppercase) + if not varChild.get("name")[0].isupper(): + return False + return True + + + +def assembleVariable(variableItem): + if variableItem.type != "variable": + raise DocException("'variableItem' is no variable", variableItem) + + assembled = "" + for child in variableItem.children: + if len(assembled) != 0: + assembled += "." + assembled += child.get("name") + + return assembled + + + +def getValue(item): + value = None + if item.type == "constant": + if item.get("constantType") == "string": + value = '"' + item.get("value") + '"' + else: + value = item.get("value") + elif item.type == "variable": + value = assembleVariable(item) + elif item.type == "operation" and item.get("operator") == "SUB": + # E.g. "-1" or "-Infinity" + value = "-" + getValue(item.getChild("first").getFirstChild()) + if value == None: + value = "[Unsupported item type: " + item.type + "]" + + return value + + + +def addTypeInfo(node, commentAttrib=None, item=None): + if commentAttrib == None: + if node.type == "constant" and node.get("value", False): + pass + + elif node.type == "param": + addError(node, "Parameter %s in not documented." % commentAttrib.get("name"), item) + + elif node.type == "return": + addError(node, "Return value is not documented.", item) + + else: + addError(node, "Documentation is missing.", item) + + return + + # add description + if commentAttrib.has_key("text"): + node.addChild(tree.Node("desc").set("text", commentAttrib["text"])) + + # add types + if commentAttrib.has_key("type"): + typesNode = tree.Node("types") + node.addChild(typesNode) + + for item in commentAttrib["type"]: + itemNode = tree.Node("entry") + typesNode.addChild(itemNode) + + itemNode.set("type", item["type"]) + + if item["dimensions"] != 0: + itemNode.set("dimensions", item["dimensions"]) + + # add default value + if commentAttrib.has_key("default"): + defaultValue = commentAttrib["default"] + if defaultValue != None: + # print "defaultValue: %s" % defaultValue + node.set("defaultValue", defaultValue) + + + +def addEventNode(classNode, classItem, commentAttrib): + node = tree.Node("event") + + node.set("name", commentAttrib["name"]) + + if commentAttrib.has_key("text"): + node.addChild(tree.Node("desc").set("text", commentAttrib["text"])) + + # add types + if commentAttrib.has_key("type"): + typesNode = tree.Node("types") + node.addChild(typesNode) + + for item in commentAttrib["type"]: + itemNode = tree.Node("entry") + typesNode.addChild(itemNode) + + itemNode.set("type", item["type"]) + + if item["dimensions"] != 0: + itemNode.set("dimensions", item["dimensions"]) + + classNode.addListChild("events", node) + + + +def addError(node, msg, syntaxItem): + # print ">>> %s" % msg + + errorNode = tree.Node("error") + errorNode.set("msg", msg) + + (line, column) = getLineAndColumnFromSyntaxItem(syntaxItem) + if line: + errorNode.set("line", line) + + if column: + errorNode.set("column", column) + + node.addListChild("errors", errorNode) + node.set("hasError", True) + + + +def getLineAndColumnFromSyntaxItem(syntaxItem): + line = None + column = None + + while line == None and column == None and syntaxItem: + line = syntaxItem.get("line", False) + column = syntaxItem.get("column", False) + + if syntaxItem.hasParent(): + syntaxItem = syntaxItem.parent + else: + syntaxItem = None + + return line, column + + +def getFileFromSyntaxItem(syntaxItem): + file = None + while file == None and syntaxItem: + file = syntaxItem.get("file", False) + if hasattr(syntaxItem, "parent"): + syntaxItem = syntaxItem.parent + else: + syntaxItem = None + return file + + +def getType(item): + if item.type == "constant" and item.get("constantType") == "string": + val = item.get("value").capitalize() + return val + + else: + raise DocException("Can't gess type. type is neither string nor variable: " + item.type, item) + + +def getClassNode(docTree, className): + splits = className.split(".") + + currPackage = docTree + length = len(splits) + for i in range(length): + split = splits[i] + + if (i < length - 1): + # This is a package name -> Get the right package + childPackage = currPackage.getListChildByAttribute("packages", "name", split, False) + if not childPackage: + childPackageName = ".".join(splits[:-(length-i-1)]) + + # The package does not exist -> Create it + childPackage = tree.Node("package") + childPackage.set("name", split) + childPackage.set("fullName", childPackageName) + childPackage.set("packageName", childPackageName.replace("." + split, "")) + + currPackage.addListChild("packages", childPackage) + + # Update current package + currPackage = childPackage + + else: + # This is a class name -> Get the right class + classNode = currPackage.getListChildByAttribute("classes", "name", split, False) + if not classNode: + # The class does not exist -> Create it + classNode = tree.Node("class") + classNode.set("name", split) + classNode.set("fullName", className) + classNode.set("packageName", className.replace("." + split, "")) + currPackage.addListChild("classes", classNode) + + return classNode + + + +def postWorkPackage(docTree, packageNode): + childHasError = False + + packages = packageNode.getChild("packages", False) + if packages: + packages.children.sort(nameComparator) + for node in packages.children: + hasError = postWorkPackage(docTree, node) + if hasError: + childHasError = True + + classes = packageNode.getChild("classes", False) + if classes: + classes.children.sort(nameComparator) + for node in classes.children: + hasError = postWorkClass(docTree, node) + if hasError: + childHasError = True + + if childHasError: + packageNode.set("hasWarning", True) + + return childHasError + + + +def postWorkClass(docTree, classNode): + # Sort child classes + childClasses = classNode.get("childClasses", False) + if childClasses: + classArr = childClasses.split(",") + classArr.sort() + childClasses = ",".join(classArr) + classNode.set("childClasses", childClasses) + + # Remove the property-modifier-methods + removePropertyModifiers(classNode) + + # Mark overridden items + postWorkItemList(docTree, classNode, "properties", True) + postWorkItemList(docTree, classNode, "events", False) + postWorkItemList(docTree, classNode, "methods", True) + postWorkItemList(docTree, classNode, "methods-static", False) + + # Check whether the class is static + superClassName = classNode.get("superClass", False) + if (superClassName == None or superClassName == "qx.core.Object") \ + and classNode.getChild("properties", False) == None \ + and classNode.getChild("methods", False) == None: + # This class is static + classNode.set("isStatic", True) + + # Check whether the class is abstract + if isClassAbstract(docTree, classNode, {}): + classNode.set("isAbstract", True) + + # Check for errors + childHasError = listHasError(classNode, "constructor") or listHasError(classNode, "properties") \ + or listHasError(classNode, "methods") or listHasError(classNode, "methods-static") \ + or listHasError(classNode, "constants") + + if childHasError: + classNode.set("hasWarning", True) + + return childHasError + + + +def isClassAbstract(docTree, classNode, visitedMethodNames): + if containsAbstractMethods(classNode.getChild("methods", False), visitedMethodNames): + # One of the methods is abstract + return True + + # No abstract methods found -> Check whether the super class has abstract + # methods that haven't been overridden + superClassName = classNode.get("superClass", False) + if superClassName: + superClassNode = getClassNode(docTree, superClassName) + return isClassAbstract(docTree, superClassNode, visitedMethodNames) + + + +def containsAbstractMethods(methodListNode, visitedMethodNames): + if methodListNode: + for methodNode in methodListNode.children: + name = methodNode.get("name") + if not name in visitedMethodNames: + visitedMethodNames[name] = True + if methodNode.get("isAbstract", False): + return True + + return False + + + +def removePropertyModifiers(classNode): + propertiesList = classNode.getChild("properties", False) + methodsList = classNode.getChild("methods", False) + if propertiesList and methodsList: + for propNode in propertiesList.children: + name = propNode.get("name") + upperName = name[0].upper() + name[1:] + + modifyNode = methodsList.getChildByAttribute("name", "_modify" + upperName, False) + if modifyNode: + methodsList.removeChild(modifyNode); + + changeNode = methodsList.getChildByAttribute("name", "_change" + upperName, False) + if changeNode: + methodsList.removeChild(changeNode); + + checkNode = methodsList.getChildByAttribute("name", "_check" + upperName, False) + if checkNode: + methodsList.removeChild(checkNode); + + if not methodsList.hasChildren(): + classNode.removeChild(methodsList) + + + +def postWorkItemList(docTree, classNode, listName, overridable): + """Does the post work for a list of properties or methods.""" + + # Sort the list + sortByName(classNode, listName) + + # Post work all items + listNode = classNode.getChild(listName, False) + if listNode: + for itemNode in listNode.children: + name = itemNode.get("name") + + # Check whether this item is overridden and try to inherit the + # documentation from the next matching super class + if overridable: + superClassName = classNode.get("superClass", False) + overriddenFound = False + docFound = (itemNode.getChild("desc", False) != None) + while superClassName and (not overriddenFound or not docFound): + superClassNode = getClassNode(docTree, superClassName) + superItemNode = superClassNode.getListChildByAttribute(listName, "name", name, False) + + if superItemNode: + if not docFound: + # This super item has a description + # -> Check whether the parameters match + # NOTE: paramsMatch works for properties, too + # (Because both compared properties always have no params) + if paramsMatch(itemNode, superItemNode): + # The parameters match -> We can use the documentation of the super class + itemNode.set("docFrom", superClassName) + docFound = (superItemNode.getChild("desc", False) != None) + + # Remove previously recorded documentation errors from the item + # (Any documentation errors will be recorded in the super class) + removeErrors(itemNode) + if not overriddenFound: + # This super class has the item defined -> Add a overridden attribute + itemNode.set("overriddenFrom", superClassName) + overriddenFound = True + + # Check the next superclass + superClassName = superClassNode.get("superClass", False) + + if not docFound and itemNode.get("overriddenFrom", False): + # This item is overridden, but we didn't find any documentation in the + # super classes -> Add a warning + itemNode.set("hasWarning", True) + + + +def paramsMatch(methodNode1, methodNode2): + params1 = methodNode1.getChild("params1", False) + params2 = methodNode1.getChild("params2", False) + + if params1 == None or params2 == None: + # One method has no parameters -> The params match if both are None + return params1 == params2 + elif len(params1.children) != len(params2.children): + # The param count is different -> The params don't match + return False + else: + for i in range(len(params1.children)): + par1 = params1.children[i] + par2 = params2.children[i] + if (par1.get("name") != par2.get("name")): + # These parameters don't match + return False + + # All tests passed + return True + + + +def removeErrors(node): + errors = node.getChild("errors", False) + if errors: + node.removeChild(errors) + node.remove("hasError") + + + +def sortByName(node, listName): + listNode = node.getChild(listName, False) + if listNode: + listNode.children.sort(nameComparator) + + + +def nameComparator(node1, node2): + name1 = node1.get("name").lower() + name2 = node2.get("name").lower() + return cmp(name1, name2) + + + +def listHasError(node, listName): + listNode = node.getChild(listName, False) + if listNode: + for childNode in listNode.children: + if childNode.get("hasError", False): + return True + + return False diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/checklocales.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/checklocales.py new file mode 100644 index 0000000000..81254c26f3 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/checklocales.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +import sys + +""" +checks whether the locale string is correct. +""" + +errormsg = """ +**************************************************************************** + ERROR +---------------------------------------------------------------------------- + The locale '%(locale)s' is defined in APPLICATION_LOCALES, but not '%(lang)s'! + + If a locale with a territory code is set ('%(locale)s'), the corresponding + locale without territory code must be included as well ('%(lang)s'). + + Please add '%(lang)s' to APPLICATION_LOCALES in your Makefile. +**************************************************************************** +""" + +def main(): + line = sys.stdin.read() + locales = line.split() + for locale in locales: + if locale.find("_") >= 0: + lang = locale.split("_")[0] + if not lang in locales: + print errormsg % {"lang": lang, "locale": locale} + sys.exit(1) + sys.exit(0) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/cldr.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/cldr.py new file mode 100644 index 0000000000..2614f08070 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/cldr.py @@ -0,0 +1,230 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Fabian Jakobs (fjakobs) +# +################################################################################ +# encoding: utf-8 +""" +extract_cldr.py +""" + +import os +import sys +import getopt +import ElementTree + +help_message = ''' +The help message goes here. +''' + + +class Usage(Exception): + def __init__(self, msg): + self.msg = msg + + +def getJavaScript(data, locale, language, territory="", namespace="qx.locale.data"): + str = "/*\n" + if territory != "": + str += "#load(%s.%s)\n" % (namespace, language) + str += '''#require(qx.Locale) +*/ +qx.Locale.define("%s.%s", { +''' % (namespace, locale) + lines = [] + keys = data.keys() + keys.sort() + for key in keys: + lines.append(' cldr_%s: "%s"' % (key.replace("-", "_"), data[key].encode("UTF-8").replace("\n", "\n" + 4 * " ").replace('"', '\\"')) ) + + body = ",\n".join(lines) + str += "%s\n});" % body + return str + + +def getLocale(calendarElement): + locale = calendarElement.find("identity/language").attrib["type"] + territoryNode = calendarElement.find("identity/territory") + territory = "" + if territoryNode != None: + territory = territoryNode.attrib["type"] + return (locale, territory) + + +def extractMonth(calendarElement): + data = {} + for monthContext in calendarElement.findall(".//monthContext"): + for monthWidth in monthContext.findall("monthWidth"): + monthType = monthWidth.attrib["type"] + for month in monthWidth.findall("month"): + if month.attrib.has_key("alt"): continue + data["month_%s_%s" % (monthType, month.attrib["type"])] = month.text + return data + + +def extractDay(calendarElement): + data = {} + for dayWidth in calendarElement.findall(".//dayWidth"): + dayType = dayWidth.attrib["type"] + for day in dayWidth.findall("day"): + if day.attrib.has_key("alt"): continue + data['day_%s_%s' % (dayType, day.attrib["type"])] = day.text + return data + +def extractQuarter(calendarElement): + return {'': ''} + + +def extractAmPm(calendarElement): + data = {} + + amNode = calendarElement.find(".//am") + if amNode != None: + data['am'] = amNode.text + + pmNode = calendarElement.find(".//pm") + if pmNode != None: + data["pm"] = pmNode.text + + return data + + +def extractDateFormat(calendarElement): + data = {} + for dateFormatLength in calendarElement.findall(".//dateFormatLength"): + dateType = dateFormatLength.attrib["type"] + for dateFormat in dateFormatLength.findall("dateFormat/pattern"): + if dateFormat.attrib.has_key("alt"): continue + data['date_format_%s'% dateType] = dateFormat.text + return data + + +def extractTimeFormat(calendarElement): + data = {} + for timeFormatLength in calendarElement.findall(".//timeFormatLength"): + timeType = timeFormatLength.attrib["type"] + for timeFormat in timeFormatLength.findall("timeFormat/pattern"): + if timeFormat.attrib.has_key("alt"): continue + data['time_format_%s' % timeType] = timeFormat.text + return data + + +def extractDateTimeFormat(calendarElement): + data = {} + for dateTimeFormat in calendarElement.findall(".//dateFormatItem"): + data["date_time_format_%s" % dateTimeFormat.attrib["id"]] = dateTimeFormat.text + return data + + +def extractFields(calendarElement): + fields = {} + for field in calendarElement.findall(".//fields/field"): + if not field.find("displayName"): break + fields[field.attrib["type"]] = field.find("displayName").text + + return fields + + +def extractDelimiter(tree): + delimiters = {} + for delimiter in tree.findall("delimiters/*"): + delimiters[delimiter.tag] = delimiter.text + + return delimiters + + +def extractNumber(tree): + data = {} + + decimalSeparatorNode = tree.find("numbers/symbols/decimal") + if decimalSeparatorNode != None: + data['number_decimal_separator'] = decimalSeparatorNode.text + + groupSeparator = "," + groupSeparatorNode = tree.find("numbers/symbols/group") + if groupSeparatorNode != None: + data['number_group_separator'] = groupSeparatorNode.text + + percentFormatNode = tree.find("numbers/percentFormats/percentFormatLength/percentFormat/pattern") + if percentFormatNode != None: + data['number_percent_format'] = percentFormatNode.text + + return data + + +def parseCldrFile(filename, outputDirectory=None): + tree = ElementTree.parse(filename) + + language, territory = getLocale(tree) + data = {} + + for cal in tree.findall('dates/calendars/calendar'): + if not cal.attrib.has_key("type"): continue + if cal.attrib["type"] != "gregorian": continue + data.update(extractMonth(cal)) + data.update(extractDay(cal)) + #data.update(extractQuarter(cal)) + data.update(extractAmPm(cal)) + data.update(extractDateFormat(cal)) + data.update(extractTimeFormat(cal)) + data.update(extractDateTimeFormat(cal)) + data.update(extractFields(cal)) + + data.update(extractDelimiter(tree)) + data.update(extractNumber(tree)) + + locale = language + if territory != "": + locale += "_" + territory + + code = getJavaScript(data, locale, language, territory) + if outputDirectory != None: + outfile = os.path.join(outputDirectory, locale + ".js"); + open(outfile, "w").write(code) + else: + print code + + +def main(argv=None): + if argv is None: + argv = sys.argv + try: + try: + opts, args = getopt.getopt(argv[1:], "ho:v", ["help", "output="]) + except getopt.error, msg: + raise Usage(msg) + + output = None + for option, value in opts: + if option == "-v": + verbose = True + if option in ("-h", "--help"): + raise Usage(help_message) + if option in ("-o", "--output"): + output = value + + for arg in args: + parseCldrFile(arg, output) + + except Usage, err: + print >> sys.stderr, sys.argv[0].split("/")[-1] + ": " + str(err.msg) + print >> sys.stderr, "\t for help use --help" + return 2 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/comment.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/comment.py new file mode 100755 index 0000000000..a5e1d02346 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/comment.py @@ -0,0 +1,942 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +import sys, string, re +import config, tree, textile + + + +S_INLINE_COMMENT = "//.*" +R_INLINE_COMMENT = re.compile("^" + S_INLINE_COMMENT + "$") + +R_INLINE_COMMENT_TIGHT = re.compile("^//\S+") +R_INLINE_COMMENT_PURE = re.compile("^//") + + + +S_BLOCK_COMMENT = "/\*([^*]|[\n]|(\*+([^*/]|[\n])))*\*+/" +R_BLOCK_COMMENT = re.compile("^" + S_BLOCK_COMMENT + "$") + +R_BLOCK_COMMENT_JAVADOC = re.compile("^/\*\*") +R_BLOCK_COMMENT_QTDOC = re.compile("^/\*!") +R_BLOCK_COMMENT_AREA = re.compile("^/\*\n\s*\*\*\*\*\*") +R_BLOCK_COMMENT_DIVIDER = re.compile("^/\*\n\s*----") +R_BLOCK_COMMENT_HEADER = re.compile("^/\* \*\*\*\*") + +R_BLOCK_COMMENT_TIGHT_START = re.compile("^/\*\S+") +R_BLOCK_COMMENT_TIGHT_END = re.compile("\S+\*/$") +R_BLOCK_COMMENT_PURE_START = re.compile("^/\*") +R_BLOCK_COMMENT_PURE_END = re.compile("\*/$") + +R_ATTRIBUTE = re.compile(r'[^{]@(\w+)\s*') +R_JAVADOC_STARS = re.compile(r'^\s*\*') + + + +R_NAMED_TYPE = re.compile(r'^\s*([a-zA-Z0-9_\.#]+)\s*({([^}]+)})?') +R_SIMPLE_TYPE = re.compile(r'^\s*({([^}]+)})?') + + + + +VARPREFIXES = { + "a" : "Array", + "b" : "Boolean", + "d" : "Date", + "f" : "Function", + "i" : "Integer", + "h" : "Map", + "m" : "Map", + "n" : "Number", + "o" : "Object", + "r" : "RegExp", + "s" : "String", + "v" : "var", + "w" : "Widget" +} + +VARNAMES = { + "a" : "Array", + "arr" : "Array", + + "doc" : "Document", + + "e" : "Event", + "ev" : "Event", + "evt" : "Event", + + "el" : "Element", + "elem" : "Element", + "elm" : "Element", + + "ex" : "Exception", + "exc" : "Exception", + + "flag" : "Boolean", + "force" : "Boolean", + + "f" : "Function", + "func" : "Function", + + "h" : "Map", + "hash" : "Map", + "map" : "Map", + + "node" : "Node", + + "n" : "Number", + "num" : "Number", + + "o" : "Object", + "obj" : "Object", + + "reg" : "RegExp", + + "s" : "String", + "str" : "String", + + "win" : "Window" +} + +VARDESC = { + "propValue" : "Current value", + "propOldValue" : "Previous value", + "propData" : "Property configuration map" +} + + + + +def outdent(source, indent): + return re.compile("\n\s{%s}" % indent).sub("\n", source) + + + +def indent(source, indent): + return re.compile("\n").sub("\n" + (" " * indent), source) + + + +def correctInline(source): + if R_INLINE_COMMENT_TIGHT.match(source): + return R_INLINE_COMMENT_PURE.sub("// ", source) + + return source + + + +def correctBlock(source): + if not getFormat(source) in [ "javadoc", "qtdoc" ]: + if R_BLOCK_COMMENT_TIGHT_START.search(source): + source = R_BLOCK_COMMENT_PURE_START.sub("/* ", source) + + if R_BLOCK_COMMENT_TIGHT_END.search(source): + source = R_BLOCK_COMMENT_PURE_END.sub(" */", source) + + return source + + + +def correct(source): + if source.startswith("//"): + return correctInline(source) + else: + return correctBlock(source) + + + +def isMultiLine(source): + return source.find("\n") != -1 + + + +def getFormat(source): + if R_BLOCK_COMMENT_JAVADOC.search(source): + return "javadoc" + elif R_BLOCK_COMMENT_QTDOC.search(source): + return "qtdoc" + elif R_BLOCK_COMMENT_AREA.search(source): + return "area" + elif R_BLOCK_COMMENT_DIVIDER.search(source): + return "divider" + elif R_BLOCK_COMMENT_HEADER.search(source): + return "header" + + return "block" + + + + + + + + +def hasThrows(node): + if node.type == "throw": + return True + + if node.hasChildren(): + for child in node.children: + if hasThrows(child): + return True + + return False + + + + +def getReturns(node, found): + if node.type == "function": + pass + + elif node.type == "return": + if node.getChildrenLength(True) > 0: + val = "var" + else: + val = "void" + + if node.hasChild("expression"): + expr = node.getChild("expression") + if expr.hasChild("variable"): + var = expr.getChild("variable") + if var.getChildrenLength(True) == 1 and var.hasChild("identifier"): + val = nameToType(var.getChild("identifier").get("name")) + else: + val = "var" + + elif expr.hasChild("constant"): + val = expr.getChild("constant").get("constantType") + + if val == "number": + val = expr.getChild("constant").get("detail") + + elif expr.hasChild("array"): + val = "Array" + + elif expr.hasChild("map"): + val = "Map" + + elif expr.hasChild("function"): + val = "Function" + + elif expr.hasChild("call"): + val = "call" + + if not val in found: + found.append(val) + + elif node.hasChildren(): + for child in node.children: + getReturns(child, found) + + return found + + + +def nameToType(name): + typ = "var" + + # Evaluate type from name + if name in VARNAMES: + typ = VARNAMES[name] + + elif len(name) > 1: + if name[1].isupper(): + if name[0] in VARPREFIXES: + typ = VARPREFIXES[name[0]] + + return typ + + + +def nameToDescription(name): + desc = "TODOC" + + if name in VARDESC: + desc = VARDESC[name] + + return desc + + + + +def qt2javadoc(text): + attribList = parseText(text, False) + res = "/**" + + desc = getAttrib(attribList, "description")["text"] + + if "\n" in desc: + res += "\n" + + for line in desc.split("\n"): + res += " * %s\n" % line + + res += " " + + else: + res += " %s " % desc + + res += "*/" + + return res + + +def parseNode(node): + """Takes the last doc comment from the commentsBefore child, parses it and + returns a Node representing the doc comment""" + + # Find the last doc comment + commentsBefore = node.getChild("commentsBefore", False) + if commentsBefore and commentsBefore.hasChildren(): + for child in commentsBefore.children: + if child.type == "comment" and child.get("detail") in [ "javadoc", "qtdoc" ]: + return parseText(child.get("text")) + + return [] + + + +def parseText(intext, format=True): + # print "Parse: " + intext + + # Strip "/**", "/*!" and "*/" + intext = intext[3:-2] + + # Strip leading stars in every line + text = "" + for line in intext.split("\n"): + text += R_JAVADOC_STARS.sub("", line) + "\n" + + # Autodent + text = autoOutdent(text) + + # Search for attributes + desc = { "category" : "description", "text" : "" } + attribs = [ desc ] + pos = 0 + + while True: + mtch = R_ATTRIBUTE.search(text, pos) + + if mtch == None: + prevText = text[pos:].rstrip() + + if len(attribs) == 0: + desc["text"] = prevText + else: + attribs[-1]["text"] = prevText + + break + + prevText = text[pos:mtch.start(0)].rstrip() + pos = mtch.end(0) + + if len(attribs) == 0: + desc["text"] = prevText + else: + attribs[-1]["text"] = prevText + + attribs.append({ "category" : mtch.group(1), "text" : "" }) + + # parse details + for attrib in attribs: + parseDetail(attrib, format) + + return attribs + + + +def parseDetail(attrib, format=True): + text = attrib["text"] + + if attrib["category"] in [ "param", "event", "see" ]: + mtch = R_NAMED_TYPE.search(text) + else: + mtch = R_SIMPLE_TYPE.search(text) + + if mtch: + text = text[mtch.end(0):] + + if attrib["category"] in [ "param", "event", "see" ]: + attrib["name"] = mtch.group(1) + # print ">>> NAME: %s" % mtch.group(1) + remain = mtch.group(3) + else: + remain = mtch.group(2) + + if remain != None: + defIndex = remain.rfind("?") + if defIndex != -1: + attrib["default"] = remain[defIndex+1:].strip() + remain = remain[0:defIndex].strip() + # print ">>> DEFAULT: %s" % attrib["default"] + + typValues = [] + for typ in remain.split("|"): + typValue = typ.strip() + arrayIndex = typValue.find("[") + + if arrayIndex != -1: + arrayValue = (len(typValue) - arrayIndex) / 2 + typValue = typValue[0:arrayIndex] + else: + arrayValue = 0 + + typValues.append({ "type" : typValue, "dimensions" : arrayValue }) + + if len(typValues) > 0: + attrib["type"] = typValues + # print ">>> TYPE: %s" % attrib["type"] + + if format: + attrib["text"] = formatText(text) + else: + attrib["text"] = cleanupText(text) + + if attrib["text"] == "": + del attrib["text"] + + + + +def autoOutdent(text): + lines = text.split("\n") + + if len(lines) <= 1: + return text.strip() + + for line in lines: + if len(line) > 0 and line[0] != " ": + return text + + result = "" + for line in lines: + if len(line) >= 0: + result += line[1:] + + result += "\n" + + return result + + + +def cleanupText(text): + #print "============= INTEXT =========================" + #print text + + text = text.replace("

", "\n") + text = text.replace("
", "\n") + text = text.replace("
", "\n") + text = text.replace("

", " ") + + newline = False + lines = text.split("\n") + text = u"" + + for line in lines: + if line == "": + if not newline: + newline = True + + else: + if text != "": + text += "\n" + + if newline: + text += "\n" + newline = False + + text += line + + #print "============= OUTTEXT =========================" + #print text + + return text + + + +def formatText(text): + text = cleanupText(text) + + #if "\n" in text: + # print + # print "------------- ORIGINAL ----------------" + # print text + + text = text.replace("", "\n\n") + + # encode to ascii leads into a translation of umlauts to their XML code. + text = unicode(textile.textile(text.encode("utf-8"), output="ascii")) + + #if "\n" in text: + # print "------------- TEXTILED ----------------" + # print text + + return text + + + + + + + + +def getAttrib(attribList, category): + for attrib in attribList: + if attrib["category"] == category: + return attrib + + + +def getParam(attribList, name): + for attrib in attribList: + if attrib["category"] == "param": + if attrib.has_key("name") and attrib["name"] == name: + return attrib + + + +def attribHas(attrib, key): + if attrib != None and attrib.has_key(key) and not attrib[key] in [ "", None ]: + return True + + return False + + + +def splitText(orig, attrib=True): + res = "" + first = True + + for line in orig.split("\n"): + if attrib: + if first: + res += " %s\n" % line + else: + res += " * %s\n" % line + + else: + res += " * %s\n" % line + + first = False + + if not res.endswith("\n"): + res += "\n" + + return res + + + +def parseType(vtype): + typeText = "" + + firstType = True + for entry in vtype: + if not firstType: + typeText += " | " + + typeText += entry["type"] + + if entry.has_key("dimensions") and entry["dimensions"] > 0: + typeText += "[]" * entry["dimensions"] + + firstType = False + + return typeText + + + + +def fromNode(node, assignType, name, alternative, old=[]): + # + # description + ############################################################## + oldDesc = getAttrib(old, "description") + + if attribHas(oldDesc, "text"): + newText = oldDesc["text"] + else: + newText = "{var} TODOC" + + if "\n" in newText: + s = "/**\n%s\n-*/" % splitText(newText, False) + else: + s = "/** %s */" % newText + + + # + # other @attributes + ############################################################## + + for attrib in old: + cat = attrib["category"] + + if cat != "description": + print " * Found unallowed attribute %s in comment for %s (node)" % (cat, name) + + return s + + + + +def fromFunction(func, assignType, name, alternative, old=[]): + # + # open comment + ############################################################## + s = "/**\n" + + + # + # description + ############################################################## + oldDesc = getAttrib(old, "description") + + if attribHas(oldDesc, "text"): + newText = oldDesc["text"] + else: + newText = "TODOC" + + s += splitText(newText, False) + s += " *\n" + + + + + # + # add @type + ############################################################## + if assignType != None: + s += " * @type %s\n" % assignType + else: + s += " * @type unknown TODOC\n" + + + + + # + # add @name and @access + ############################################################## + if name != None and name != "construct": + s += " * @name %s\n" % name + + if name.startswith("__"): + s += " * @access private\n" + elif name.startswith("_"): + s += " * @access protected\n" + else: + s += " * @access public\n" + + + + # + # add @alternative + ############################################################## + oldAlternative = getAttrib(old, "alternative") + + if alternative: + if attribHas(oldAlternative, "text"): + newText = oldDesc["text"] + else: + newText = "TODOC" + + s += " * @alternative%s" % splitText(newText) + + if not s.endswith("\n"): + s += "\n" + + elif oldAlternative: + print " * Removing old @alternative for %s" % name + + + + + # + # add @abstract + ############################################################## + oldAbstract = getAttrib(old, "abstract") + + first = func.getChild("body").getChild("block").getFirstChild(False, True) + abstract = first and first.type == "throw" + + if abstract: + if attribHas(oldAbstract, "text"): + newText = oldDesc["text"] + else: + newText = "" + + s += " * @abstract%s" % splitText(newText) + + if not s.endswith("\n"): + s += "\n" + + elif oldAbstract: + print " * Removing old @abstract for %s" % name + + + + + + + # + # add @param + ############################################################## + params = func.getChild("params") + if params.hasChildren(): + for child in params.children: + if child.type == "variable": + newName = child.getChild("identifier").get("name") + newType = newTypeText = nameToType(newName) + newDefault = "" + newText = nameToDescription(newName) + + oldParam = getParam(old, newName) + + # Get type and text from old content + if oldParam: + if attribHas(oldParam, "type"): + newTypeText = parseType(oldParam["type"]) + + if attribHas(oldParam, "defaultValue"): + newDefault = oldParam["defaultValue"] + + if attribHas(oldParam, "text"): + newText = oldParam["text"].strip() + + s += " * @param %s {%s%s}%s" % (newName, newTypeText, newDefault, splitText(newText)) + + if not s.endswith("\n"): + s += "\n" + + + + + + # + # add @return + ############################################################## + if name != "construct": + oldReturn = getAttrib(old, "return") + + newType = "void" + newText = "" + + # Get type and text from old content + if oldReturn: + if attribHas(oldReturn, "type"): + newType = parseType(oldReturn["type"]) + + if attribHas(oldReturn, "text"): + newText = oldReturn["text"].strip() + + # Try to autodetect the type + if newType == "void": + returns = getReturns(func.getChild("body"), []) + + if len(returns) > 0: + newType = " | ".join(returns) + elif name != None and name.startswith("is") and name[3].isupper(): + newType = "boolean" + + # Add documentation hint in non void cases + if newType != "void" and newText == "": + newText = "TODOC" + + s += " * @return {%s}%s" % (newType, splitText(newText)) + + if not s.endswith("\n"): + s += "\n" + + + + + + + # + # add @throws + ############################################################## + oldThrows = getAttrib(old, "throws") + + if hasThrows(func): + if oldThrows and attribHas(oldThrows, "text"): + newText = oldThrows["text"] + elif abstract: + newText = "the abstract function warning." + else: + newText = "TODOC" + + s += " * @throws%s" % splitText(newText) + + if not s.endswith("\n"): + s += "\n" + + elif oldThrows: + print " * Removing old @throw attribute in comment for %s" % name + + + + + # + # other @attributes + ############################################################## + + for attrib in old: + cat = attrib["category"] + + if cat in [ "see", "author", "deprecated", "exception", "since", "version", "abstract", "overridden" ]: + s += " * @%s" % cat + + if attribHas(attrib, "text"): + s += splitText(attrib["text"]) + + if not s.endswith("\n"): + s += "\n" + + elif not cat in [ "description", "type", "name", "access", "alternative", "abstract", "param", "return", "throws" ]: + print " * Found unallowed attribute %s in comment for %s (function)" % (cat, name) + + + + + + # + # close comment + ############################################################## + s += " */" + + return s + + + +def fill(node): + if node.type in [ "comment", "commentsBefore", "commentsAfter" ]: + return + + if node.hasParent(): + target = node + + if node.type == "function": + name = node.get("name", False) + else: + name = "" + + alternative = False + assignType = None + + if name != None: + assignType = "function" + + # move to hook operation + while target.parent.type in [ "first", "second", "third" ] and target.parent.parent.type == "operation" and target.parent.parent.get("operator") == "HOOK": + alternative = True + target = target.parent.parent + + # move comment to assignment + while target.parent.type == "right" and target.parent.parent.type == "assignment": + target = target.parent.parent + if target.hasChild("left"): + left = target.getChild("left") + if left and left.hasChild("variable"): + var = left.getChild("variable") + last = var.getLastChild(False, True) + if last and last.type == "identifier": + name = last.get("name") + assignType = "object" + + for child in var.children: + if child.type == "identifier": + if child.get("name") in [ "prototype", "Proto" ]: + assignType = "member" + elif child.get("name") in [ "class", "base", "Class" ]: + assignType = "static" + + elif target.parent.type == "definition": + name = target.parent.get("identifier") + assignType = "definition" + + # move to definition + if target.parent.type == "assignment" and target.parent.parent.type == "definition" and target.parent.parent.parent.getChildrenLength(True) == 1: + target = target.parent.parent.parent + assignType = "function" + + + # move comment to keyvalue + if target.parent.type == "value" and target.parent.parent.type == "keyvalue": + target = target.parent.parent + name = target.get("key") + assignType = "map" + + if name == "construct": + assignType = "constructor" + + if target.parent.type == "map" and target.parent.parent.type == "value" and target.parent.parent.parent.type == "keyvalue": + paname = target.parent.parent.parent.get("key") + + if paname == "members": + assignType = "member" + + elif paname == "statics": + assignType = "static" + + # filter stuff, only add comments to member and static values and to all functions + if assignType in [ "member", "static" ] or node.type == "function": + + if not hasattr(target, "documentationAdded") and target.parent.type != "params": + old = [] + + # create commentsBefore + if target.hasChild("commentsBefore"): + commentsBefore = target.getChild("commentsBefore") + + if commentsBefore.hasChild("comment"): + for child in commentsBefore.children: + if child.get("detail") in [ "javadoc", "qtdoc" ]: + old = parseText(child.get("text"), False) + commentsBefore.removeChild(child) + break + + else: + commentsBefore = tree.Node("commentsBefore") + target.addChild(commentsBefore) + + # create comment node + commentNode = tree.Node("comment") + + if node.type == "function": + commentNode.set("text", fromFunction(node, assignType, name, alternative, old)) + else: + commentNode.set("text", fromNode(node, assignType, name, alternative, old)) + + commentNode.set("detail", "javadoc") + commentNode.set("multiline", True) + + commentsBefore.addChild(commentNode) + + # in case of alternative methods, use the first one, ignore the others + target.documentationAdded = True + + + + + + if node.hasChildren(): + for child in node.children: + fill(child) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/compiler.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/compiler.py new file mode 100755 index 0000000000..9f697e0931 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/compiler.py @@ -0,0 +1,1495 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Alessandro Sala (asala) +# +################################################################################ + +import sys, string, re, optparse +import config, tokenizer, filetool, treegenerator, variableoptimizer, comment, tree + +KEY = re.compile("^[A-Za-z0-9_]+$") +INDENTSPACES = 2 + + + +def compileToken(name, compact=False): + global pretty + + + if name in [ "INC", "DEC", "TYPEOF" ]: + pass + + elif name in [ "INSTANCEOF", "IN" ]: + space() + + elif not compact and pretty: + space() + + + + if name == None: + write("=") + + elif name in [ "TYPEOF", "INSTANCEOF", "IN" ]: + write(name.lower()) + + else: + for key in config.JSTOKENS: + if config.JSTOKENS[key] == name: + write(key) + + + + if name in [ "INC", "DEC" ]: + pass + + elif name in [ "TYPEOF", "INSTANCEOF", "IN" ]: + space() + + elif not compact and pretty: + space() + + +def space(force=True): + global indent + global result + global pretty + global afterLine + global afterBreak + + if not force and not pretty: + return + + if afterBreak or afterLine or result.endswith(" ") or result.endswith("\n"): + return + + result += " " + + +def write(txt=""): + global indent + global result + global pretty + global breaks + global afterLine + global afterBreak + global afterDivider + global afterArea + + # strip remaining whitespaces + if (afterLine or afterBreak or afterDivider or afterArea) and result.endswith(" "): + result = result.rstrip() + + if pretty: + # handle new line wishes + if afterArea: + nr = 9 + elif afterDivider: + nr = 5 + elif afterBreak: + nr = 2 + elif afterLine: + nr = 1 + else: + nr = 0 + + while not result.endswith("\n" * nr): + result += "\n" + + elif breaks and not result.endswith("\n"): + if afterArea or afterDivider or afterBreak or afterLine: + result += "\n" + + # reset + afterLine = False + afterBreak = False + afterDivider = False + afterArea = False + + # add indent (if needed) + if pretty and result.endswith("\n"): + result += (" " * (INDENTSPACES * indent)) + + # append given text + result += txt + + +def area(): + global afterArea + afterArea = True + + +def divide(): + global afterDivider + afterDivider = True + + +def sep(): + global afterBreak + afterBreak = True + + +def nosep(): + global afterBreak + afterBreak = False + + +def line(): + global afterLine + afterLine = True + + +def noline(): + global afterLine + global afterBreak + global afterDivider + global afterArea + + afterLine = False + afterBreak = False + afterDivider = False + afterArea = False + + +def plus(): + global indent + indent += 1 + + +def minus(): + global indent + indent -= 1 + + +def semicolon(): + global result + global breaks + + noline() + + if not (result.endswith("\n") or result.endswith(";")): + write(";") + + if breaks: + result += "\n" + + +def commentNode(node): + global pretty + + if not pretty: + return + + commentText = "" + commentIsInline = False + + comment = node.getChild("commentsAfter", False) + + if comment and not comment.get("inserted", False): + for child in comment.children: + if not child.isFirstChild(): + commentText += " " + + commentText += child.get("text") + + if child.get("detail") == "inline": + commentIsInline = True + + if commentText != "": + space() + write(commentText) + + if commentIsInline: + line() + else: + space() + + comment.set("inserted", True) + + + +def postProcessMap(m): + if m.get("maxKeyLength", False) != None: + return + + maxKeyLength = 0 + alignValues = True + + if m.hasChildren(): + for keyvalue in m.children: + if keyvalue.type != "keyvalue": + continue + + currKeyLength = len(keyvalue.get("key")) + + if keyvalue.get("quote", False) != None: + currKeyLength += 2 + + if currKeyLength > maxKeyLength: + maxKeyLength = currKeyLength + + if alignValues and keyvalue.getChild("value").isComplex(): + alignValues = False + + m.set("maxKeyLength", maxKeyLength) + m.set("alignValues", alignValues) + + + + + +def compile(node, enablePretty=True, enableBreaks=False, enableDebug=False): + global indent + global result + global pretty + global debug + global breaks + global afterLine + global afterBreak + global afterDivider + global afterArea + + indent = 0 + result = u"" + pretty = enablePretty + debug = enableDebug + breaks = enableBreaks + afterLine = False + afterBreak = False + afterDivider = False + afterArea = False + + if enablePretty: + comment.fill(node) + + compileNode(node) + + return result + + + + + + + + + + +def compileNode(node): + + global pretty + global indent + + + + + ##################################################################################################################### + # Recover styling + ##################################################################################################################### + + if pretty: + # Recover exclicit breaks + if node.get("breakBefore", False) and not node.isFirstChild(True): + sep() + + # Additional explicit break before complex blocks + if node.hasParent() and not node.isFirstChild(True) and node.parent.type in [ "block", "file"] and node.isComplex(): + sep() + + + + ##################################################################################################################### + # Insert comments before + ##################################################################################################################### + + if pretty: + if node.getChild("commentsBefore", False) != None: + commentCounter = 0 + commentsBefore = node.getChild("commentsBefore") + isFirst = node.isFirstChild() + previous = node.getPreviousSibling(False, True) + + if previous and previous.type in [ "case", "default" ]: + inCase = True + else: + inCase = False + + inOperation = node.parent.type in [ "first", "second", "third" ] and node.parent.parent.type == "operation" + + for child in commentsBefore.children: + docComment = child.get("detail") in [ "javadoc", "qtdoc" ] + headComment = child.get("detail") == "header" + areaComment = child.get("detail") == "area" + divComment = child.get("detail") == "divider" + blockComment = child.get("detail") == "block" + singleLineBlock = child.get("detail") != "inline" and child.get("multiline") == False + + if not child.isFirstChild(): + pass + + elif inCase: + pass + + elif singleLineBlock: + if child.get("begin"): + sep() + else: + space() + + elif areaComment and not isFirst: + area() + + elif divComment and not isFirst: + divide() + + elif not isFirst: + sep() + + elif inOperation: + sep() + + elif not headComment: + line() + + # reindenting first + text = child.get("text") + + if child.get("detail") == "qtdoc": + text = comment.qt2javadoc(text) + + write(comment.indent(text, INDENTSPACES * indent)) + + if singleLineBlock: + if child.get("detail") in [ "javadoc", "qtdoc" ]: + line() + elif child.get("end"): + sep() + else: + space() + + # separator after divider/head comments and after block comments which are not for documentation + elif headComment or areaComment or divComment or blockComment: + sep() + + else: + line() + + + + + + + ##################################################################################################################### + # Opening... + ##################################################################################################################### + + # + # OPEN: FINALLY + ################################## + + if node.type == "finally": + write("finally") + + + # + # OPEN: DELETE + ################################## + + elif node.type == "delete": + write("delete") + space() + + + # + # OPEN: THROW + ################################## + + elif node.type == "throw": + write("throw") + space() + + + # + # OPEN: NEW + ################################## + + elif node.type == "instantiation": + write("new") + space() + + + # + # OPEN: RETURN + ################################## + + elif node.type == "return": + write("return") + + if node.hasChildren(): + space() + + + # + # OPEN: DEFINITION LIST + ################################## + + elif node.type == "definitionList": + write("var") + space() + + + # + # OPEN: BREAK + ################################## + + elif node.type == "break": + write("break") + + if node.get("label", False): + space() + write(node.get("label", False)) + + + # + # OPEN: CONTINUE + ################################## + + elif node.type == "continue": + write("continue") + + if node.get("label", False): + space() + write(node.get("label", False)) + + + # + # OPEN: FUNCTION + ################################## + + elif node.type == "function": + write("function") + + functionName = node.get("name", False) + if functionName != None: + space() + write(functionName) + + + # + # OPEN: IDENTIFIER + ################################## + + elif node.type == "identifier": + name = node.get("name", False) + if name != None: + write(name) + + + # + # OPEN: DEFINITION + ################################## + + elif node.type == "definition": + if node.parent.type != "definitionList": + write("var") + space() + + write(node.get("identifier")) + + + # + # OPEN: CONSTANT + ################################## + + elif node.type == "constant": + if node.get("constantType") == "string": + if node.get("detail") == "singlequotes": + write("'") + else: + write('"') + + write(node.get("value")) + + if node.get("detail") == "singlequotes": + write("'") + else: + write('"') + + else: + write(node.get("value")) + + + # + # OPEN: COMMENT + ################################## + + elif node.type == "comment": + if pretty: + # insert a space before and no newline in the case of after comments + if node.get("connection") == "after": + noline() + space() + + write(node.get("text")) + + # new line after inline comment (for example for syntactical reasons) + if node.get("detail") == "inline": + line() + + else: + space() + + + # + # OPEN: RIGHT + ################################## + + elif node.type == "right": + if node.parent.type == "accessor": + write(".") + + + + + + + # + # OPEN: ASSIGNMENT + ################################## + + elif node.type == "assignment": + if node.parent.type == "definition": + oper = node.get("operator", False) + + realNode = node.parent.parent + + # be compact in for-loops + compact = realNode.hasParent() and realNode.parent.type in [ "first", "second", "third" ] and realNode.parent.parent.type == "loop" and realNode.parent.parent.get("loopType") == "FOR" + compileToken(oper, compact) + + + + + + # + # OPEN: KEY + ################################## + + elif node.type == "key": + if node.parent.type == "accessor": + write("[") + + + # + # OPEN: GROUP + ################################## + + elif node.type == "group": + write("(") + + + # + # OPEN: VOID + ################################## + + elif node.type == "void": + write("void") + write("(") + + + # + # OPEN: ARRAY + ################################## + + elif node.type == "array": + write("[") + + if node.hasChildren(True): + space(False) + + + # + # OPEN: PARAMS + ################################## + + elif node.type == "params": + noline() + write("(") + + + + + + + + + # + # OPEN: CASE + ################################## + + elif node.type == "case": + if pretty: + # force double new lines + if not node.isFirstChild() and not node.getPreviousSibling(True).type == "case": + sep() + + minus() + line() + + write("case") + space() + + + # + # OPEN: DEFAULT + ################################## + + elif node.type == "default": + if pretty: + minus() + + # force double new lines + if not node.getPreviousSibling(True).type == "case": + sep() + + write("default") + write(":") + + if pretty: + plus() + line() + + + + + + + # + # OPEN: TRY + ################################## + + elif node.type == "switch": + # Additional new line before each switch/try + if not node.isFirstChild(True) and not node.getChild("commentsBefore", False): + prev = node.getPreviousSibling(False, True) + + # No separation after case statements + if prev != None and prev.type in [ "case", "default" ]: + pass + else: + sep() + + if node.get("switchType") == "catch": + write("try") + elif node.get("switchType") == "case": + write("switch") + + + # + # OPEN: CATCH + ################################## + + elif node.type == "catch": + if pretty: + # If this statement block or the previous try were not complex, be not complex here, too + if not node.getChild("statement").getChild("block").isComplex() and not node.parent.getChild("statement").getChild("block").isComplex(): + noline() + space() + + write("catch") + + + + + + + + # + # OPEN: MAP + ################################## + + elif node.type == "map": + par = node.parent + + if pretty: + postProcessMap(node) + + if pretty: + # No break before return statement + if node.hasParent() and node.parent.type == "expression" and node.parent.parent.type == "return": + pass + + elif node.isComplex(): + line() + + write("{") + + if pretty: + if node.isComplex(): + line() + plus() + + elif node.hasChildren(True): + space() + + + # + # OPEN: KEYVALUE + ################################## + + elif node.type == "keyvalue": + keyString = node.get("key") + keyQuote = node.get("quote", False) + + if keyQuote != None: + # print "USE QUOTATION" + if keyQuote == "doublequotes": + keyString = '"' + keyString + '"' + else: + keyString = "'" + keyString + "'" + + elif keyString in config.JSPROTECTED or not KEY.match(keyString): + print "Warning: Auto protect key: %s" % keyString + keyString = "\"" + keyString + "\"" + + if pretty and not node.isFirstChild(True) and not node.hasChild("commentsBefore") and node.getChild("value").isComplex(): + sep() + + write(keyString) + space(False) + + # Fill with spaces + # Do this only if the parent is complex (many entries) + # But not if the value itself is complex + if pretty and node.parent.isComplex() and node.parent.get("alignValues"): + write(" " * (node.parent.get("maxKeyLength") - len(keyString))) + + write(":") + space(False) + + + + + + + + # + # OPEN: BLOCK + ################################## + + elif node.type == "block": + if pretty: + if node.isComplex(): + line() + else: + space() + + write("{") + + if pretty: + if node.hasChildren(): + plus() + line() + + + # + # OPEN: LOOP + ################################## + + elif node.type == "loop": + # Additional new line before each loop + if not node.isFirstChild(True) and not node.getChild("commentsBefore", False): + prev = node.getPreviousSibling(False, True) + + # No separation after case statements + if prev != None and prev.type in [ "case", "default" ]: + pass + elif node.hasChild("elseStatement") or node.getChild("statement").hasBlockChildren(): + sep() + else: + line() + + loopType = node.get("loopType") + + if loopType == "IF": + write("if") + space(False) + + elif loopType == "WHILE": + write("while") + space(False) + + elif loopType == "FOR": + write("for") + space(False) + + elif loopType == "DO": + write("do") + space(False) + + elif loopType == "WITH": + write("with") + space(False) + + else: + print "Warning: Unknown loop type: %s" % loopType + + + + # + # OPEN: ELSE + ################################## + + elif node.type == "elseStatement": + if node.hasChild("commentsBefore"): + pass + + elif pretty: + if not node.hasChild("block") and not node.hasChild("loop"): + pass + + elif not node.isComplex(): + noline() + space() + + write("else") + + # This is a elseStatement without a block around (a set of {}) + if not node.hasChild("block"): + space() + + + # + # OPEN: EXPRESSION + ################################## + + elif node.type == "expression": + if node.parent.type == "loop": + loopType = node.parent.get("loopType") + + # only do-while loops + if loopType == "DO": + if pretty: + stmnt = node.parent.getChild("statement") + compact = stmnt.hasChild("block") and not stmnt.getChild("block").isComplex() + + if compact: + noline() + space() + + write("while") + + if pretty: + space() + + # open expression block of IF/WHILE/DO-WHILE/FOR statements + write("(") + + elif node.parent.type == "catch": + # open expression block of CATCH statement + write("(") + + elif node.parent.type == "switch" and node.parent.get("switchType") == "case": + # open expression block of SWITCH statement + write("(") + + + # + # OPEN: FIRST + ################################## + + elif node.type == "first": + # for loop + if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": + write("(") + + # operation + elif node.parent.type == "operation": + # operation (var a = -1) + if node.parent.get("left", False) == True: + compileToken(node.parent.get("operator"), True) + + + + # + # OPEN: SECOND + ################################## + + elif node.type == "second": + # for loop + if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": + if not node.parent.hasChild("first"): + write("(;") + + # operation + elif node.parent.type == "operation": + if node.isComplex(): + # (?: hook operation) + if node.parent.get("operator") == "HOOK": + sep() + else: + line() + + + + + + # + # OPEN: THIRD + ################################## + + elif node.type == "third": + # for loop + if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": + if not node.parent.hasChild("second"): + if node.parent.hasChild("first"): + write(";") + space(False) + else: + write("(;;") + + # operation + elif node.parent.type == "operation": + # (?: hook operation) + if node.parent.get("operator") == "HOOK": + if node.isComplex(): + sep() + + + # + # OPEN: STATEMENT + ################################## + + elif node.type == "statement": + # for loop + if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": + if node.parent.get("forVariant") == "iter": + if not node.parent.hasChild("first") and not node.parent.hasChild("second") and not node.parent.hasChild("third"): + write("(;;"); + + elif not node.parent.hasChild("second") and not node.parent.hasChild("third"): + write(";") + + write(")") + + if not node.hasChild("block"): + space(False) + + + + + + + + + + + + + + ##################################################################################################################### + # Children content + ##################################################################################################################### + + if node.hasChildren(): + for child in node.children: + if not node.type in [ "commentsBefore", "commentsAfter" ]: + compileNode(child) + + + + + + + + + + ##################################################################################################################### + # Closing node + ##################################################################################################################### + + # + # CLOSE: IDENTIFIER + ################################## + + if node.type == "identifier": + if node.hasParent() and node.parent.type == "variable" and not node.isLastChild(True): + write(".") + elif node.hasParent() and node.parent.type == "label": + write(":") + + + # + # CLOSE: ACCESSOR + ################################## + + elif node.type == "accessor": + if node.hasParent() and node.parent.type == "variable" and not node.isLastChild(True): + write(".") + + + # + # CLOSE: KEYVALUE + ################################## + + elif node.type == "keyvalue": + if node.hasParent() and node.parent.type == "map" and not node.isLastChild(True): + noline() + write(",") + + if pretty: + commentNode(node) + + if node.getChild("value").isComplex(): + sep() + elif node.parent.isComplex(): + line() + else: + space() + + + # + # CLOSE: DEFINITION + ################################## + + elif node.type == "definition": + if node.hasParent() and node.parent.type == "definitionList" and not node.isLastChild(True): + write(",") + + if pretty: + commentNode(node) + + if node.hasComplexChildren(): + line() + else: + space() + + + # + # CLOSE: LEFT + ################################## + + elif node.type == "left": + if node.hasParent() and node.parent.type == "assignment": + oper = node.parent.get("operator", False) + + if node.parent.parent.type == "statementList": + realNode = node.parent.parent + else: + realNode = node.parent + + # be compact in for-loops + compact = realNode.hasParent() and realNode.parent.type in [ "first", "second", "third" ] and realNode.parent.parent.type == "loop" and realNode.parent.parent.get("loopType") == "FOR" + compileToken(oper, compact) + + + + + + + # + # CLOSE: KEY + ################################## + + elif node.type == "key": + if node.hasParent() and node.parent.type == "accessor": + write("]") + + + # + # CLOSE: GROUP + ################################## + + elif node.type == "group": + if node.getChildrenLength(True) == 1: + noline() + + write(")") + + + # + # CLOSE: VOID + ################################## + + elif node.type == "void": + if node.getChildrenLength(True) == 1: + noline() + + write(")") + + + # + # CLOSE: ARRAY + ################################## + + elif node.type == "array": + if node.hasChildren(True): + space(False) + + write("]") + + + # + # CLOSE: PARAMS + ################################## + + elif node.type == "params": + write(")") + + + # + # CLOSE: MAP + ################################## + + elif node.type == "map": + if pretty: + if node.isComplex(): + line() + minus() + + elif node.hasChildren(True): + space() + + write("}") + + + + + + + # + # CLOSE: SWITCH + ################################## + + elif node.type == "switch": + if node.get("switchType") == "case": + if pretty: + minus() + minus() + line() + + write("}") + + if pretty: + commentNode(node) + line() + + # Force a additinal line feed after each switch/try + if pretty and not node.isLastChild(): + sep() + + + # + # CLOSE: CASE + ################################## + + elif node.type == "case": + write(":") + + if pretty: + commentNode(node) + plus() + line() + + + + + + + + + # + # CLOSE: BLOCK + ################################## + + elif node.type == "block": + if pretty and node.hasChildren(): + minus() + line() + + write("}") + + if pretty: + commentNode(node) + + if node.hasChildren(): + # Newline afterwards + if node.parent.type == "body" and node.parent.parent.type == "function": + + # But only when this isn't a function block inside a assignment + if node.parent.parent.parent.type in [ "right", "params" ]: + pass + + elif node.parent.parent.parent.type == "value" and node.parent.parent.parent.parent.type == "keyvalue": + pass + + else: + line() + + else: + line() + + + # + # CLOSE: LOOP + ################################## + + elif node.type == "loop": + if node.get("loopType") == "DO": + semicolon() + + if pretty: + commentNode(node) + + # Force a additinal line feed after each loop + if not node.isLastChild(): + if node.hasChild("elseStatement"): + sep() + elif node.getChild("statement").hasBlockChildren(): + sep() + else: + line() + + + # + # CLOSE: FUNCTION + ################################## + + elif node.type == "function": + if pretty: + commentNode(node) + + if not node.isLastChild() and node.hasParent() and node.parent.type in [ "block", "file" ]: + sep() + + + # + # CLOSE: EXPRESSION + ################################## + + elif node.type == "expression": + if node.parent.type == "loop": + write(")") + + # e.g. a if-construct without a block {} + if node.parent.getChild("statement").hasChild("block"): + pass + + elif node.parent.type == "loop" and node.parent.get("loopType") == "DO": + pass + + else: + space(False) + + elif node.parent.type == "catch": + write(")") + + elif node.parent.type == "switch" and node.parent.get("switchType") == "case": + write(")") + + if pretty: + commentNode(node) + line() + + write("{") + + if pretty: + plus() + plus() + + + # + # CLOSE: FIRST + ################################## + + elif node.type == "first": + # for loop + if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": + if node.parent.get("forVariant") == "iter": + write(";") + + if node.parent.hasChild("second"): + space(False) + + # operation + elif node.parent.type == "operation" and node.parent.get("left", False) != True: + oper = node.parent.get("operator") + + if node.parent.parent.type == "statementList": + realNode = node.parent.parent + else: + realNode = node.parent + + compact = realNode.hasParent() and realNode.parent.type in [ "first", "second", "third" ] and realNode.parent.parent.type == "loop" and realNode.parent.parent.get("loopType") == "FOR" + compileToken(oper, compact) + + + # + # CLOSE: SECOND + ################################## + + elif node.type == "second": + # for loop + if node.parent.type == "loop" and node.parent.get("loopType") == "FOR": + write(";") + + if node.parent.hasChild("third"): + space(False) + + # operation + elif node.parent.type == "operation": + # (?: hook operation) + if node.parent.get("operator") == "HOOK": + noline() + space(False) + write(":") + space(False) + + + + + + + + + + # + # CLOSE: OTHER + ################################## + + if node.hasParent() and not node.type in [ "comment", "commentsBefore", "commentsAfter" ]: + + # Add comma dividers between statements in these parents + if node.parent.type in [ "array", "params", "statementList" ]: + if not node.isLastChild(True): + write(",") + + if pretty: + commentNode(node) + + if node.isComplex(): + line() + else: + space() + + # Semicolon handling + elif node.type in [ "group", "block", "assignment", "call", "operation", "definitionList", "return", "break", "continue", "delete", "accessor", "instantiation", "throw", "variable" ]: + + # Default semicolon handling + if node.parent.type in [ "block", "file" ]: + semicolon() + + if pretty: + commentNode(node) + line() + + if node.isComplex() and not node.isLastChild(): + sep() + + # Special handling for switch statements + elif node.parent.type == "statement" and node.parent.parent.type == "switch" and node.parent.parent.get("switchType") == "case": + semicolon() + + if pretty: + commentNode(node) + line() + + if node.isComplex() and not node.isLastChild(): + sep() + + # Special handling for loops (e.g. if) without blocks {} + elif node.parent.type in [ "statement", "elseStatement" ] and not node.parent.hasChild("block") and node.parent.parent.type == "loop": + semicolon() + + if pretty: + commentNode(node) + line() + + if node.isComplex() and not node.isLastChild(): + sep() + + + # + # CLOSE: OTHER + ################################## + + if pretty: + # Rest of the after comments (not inserted previously) + commentNode(node) + + + + + + + + + + + +def main(): + parser = optparse.OptionParser() + + parser.add_option("-w", "--write", action="store_true", dest="write", default=False, help="Writes file to incoming fileName + EXTENSION.") + parser.add_option("-e", "--extension", dest="extension", metavar="EXTENSION", help="The EXTENSION to use", default="") + parser.add_option("-c", "--compress", action="store_true", dest="compress", help="Enable compression", default=False) + parser.add_option("--optimize-variables", action="store_true", dest="optimizeVariables", default=False, help="Optimize variables. Reducing size.") + parser.add_option("--encoding", dest="encoding", default="utf-8", metavar="ENCODING", help="Defines the encoding expected for input files.") + + (options, args) = parser.parse_args() + + if len(args) == 0: + print "Needs one or more arguments (files) to compile!" + sys.exit(1) + + for fileName in args: + if options.write: + print "Compiling %s => %s%s" % (fileName, fileName, options.extension) + else: + print "Compiling %s => stdout" % fileName + + restree = treegenerator.createSyntaxTree(tokenizer.parseFile(fileName, "", options.encoding)) + + if options.optimizeVariables: + variableoptimizer.search(restree, [], 0, "$") + + compiledString = compile(restree, not options.compress) + if options.write: + if compiledString != "" and not compiledString.endswith("\n"): + compiledString += "\n" + + filetool.save(fileName + options.extension, compiledString) + + else: + try: + print compiledString + + except UnicodeEncodeError: + print " * Could not encode result to ascii. Use '-w' instead." + sys.exit(1) + + + +if __name__ == '__main__': + try: + main() + + except KeyboardInterrupt: + print + print " * Keyboard Interrupt" + sys.exit(1) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/config.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/config.py new file mode 100755 index 0000000000..19c30770f7 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/config.py @@ -0,0 +1,187 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# +################################################################################ + +import re + + + + +# +# FILE EXTENSIONS +# + +JSEXT = ".js" +PYEXT = ".py" +XMLEXT = ".xml" +TOKENEXT = ".txt" +DIRIGNORE = [ ".svn", "CVS" ] + + + + +# +# QOOXDOO HEADER SUPPORT +# + +QXHEAD = { + # TODO: Obsolete since 0.7 + "defineClass" : re.compile('qx.OO.defineClass\(\s*["\']([\.a-zA-Z0-9_-]+)["\'](\s*\,\s*([\.a-zA-Z0-9_-]+))?', re.M), + + # 0.7 API + "classDefine" : re.compile('qx.(Clazz|Locale|Mixin|Interface).define\(\s*["\']([\.a-zA-Z0-9_-]+)["\']?', re.M), + "superClass" : re.compile('extend\s*:\s*([\.a-zA-Z0-9_-]+)', re.M), + + "id" : re.compile("#id\(\s*([\.a-zA-Z0-9_-]+?)\s*\)", re.M), + "module" : re.compile("#module\(\s*([\.a-zA-Z0-9_-]+?)\s*\)", re.M), + "require" : re.compile("#require\(\s*([\.a-zA-Z0-9_-]+?)\s*\)", re.M), + "use" : re.compile("#use\(\s*([\.a-zA-Z0-9_-]+?)\s*\)", re.M), + "after" : re.compile("#after\(\s*([\.a-zA-Z0-9_-]+?)\s*\)", re.M), + "load" : re.compile("#load\(\s*([\.a-zA-Z0-9_-]+?)\s*\)", re.M), + "optional" : re.compile("#optional\(\s*([\.a-zA-Z0-9_-]+?)\s*\)", re.M), + "resource" : re.compile("#resource\(\s*(.*?):(.*?)\s*\)", re.M), + "embed" : re.compile("#embed\(\s*([a-zA-Z0-9]+?)\.([a-zA-Z0-9]+?)/(.+?)\s*\)", re.M) +} + + + + + +# +# JAVASCRIPT SUPPORT +# + +JSBUILTIN = [ "Object", "Array", "RegExp", "Math", "String", "Number", "Error" ] + +JSTOKENS = { + "." : "DOT", + "," : "COMMA", + ":" : "COLON", + "?" : "HOOK", + ";" : "SEMICOLON", + "!" : "NOT", + "~" : "BITNOT", + "\\" : "BACKSLASH", + + "+" : "ADD", + "-" : "SUB", + "*" : "MUL", + "/" : "DIV", + "%" : "MOD", + + "{" : "LC", + "}" : "RC", + "(" : "LP", + ")" : "RP", + "[" : "LB", + "]" : "RB", + + "<" : "LT", + "<=" : "LE", + ">" : "GT", + ">=" : "GE", + "==" : "EQ", + "!=" : "NE", + "===" : "SHEQ", + "!==" : "SHNE", + + "=" : "ASSIGN", + + "+=" : "ASSIGN_ADD", + "-=" : "ASSIGN_SUB", + "*=" : "ASSIGN_MUL", + "/=" : "ASSIGN_DIV", + "%=" : "ASSIGN_MOD", + + "|=" : "ASSIGN_BITOR", + "^=" : "ASSIGN_BITXOR", + "&=" : "ASSIGN_BITAND", + "<<=" : "ASSIGN_LSH", + ">>=" : "ASSIGN_RSH", + ">>>=" : "ASSIGN_URSH", + + "&&" : "AND", + "||" : "OR", + + "|" : "BITOR", + "^|" : "BITXOR", + "&" : "BITAND", + + "^" : "POWEROF", + + "<<" : "LSH", + ">>" : "RSH", + ">>>" : "URSH", + + "++" : "INC", + "--" : "DEC", + + "::" : "COLONCOLON", + ".." : "DOTDOT", + + "@" : "XMLATTR", + + "//" : "SINGLE_COMMENT", + "/*" : "COMMENT_START", + "*/" : "COMMENT_STOP", + "/*!" : "DOC_START" +} + +JSPROTECTED = { + "null" : "NULL", + "Infinity" : "INFINITY", + "true" : "TRUE", + "false" : "FALSE", + + "this" : "THIS", + "var" : "VAR", + "new" : "NEW", + "prototype" : "PROTOTYPE", + "return" : "RETURN", + "function" : "FUNCTION", + + "while" : "WHILE", + "if" : "IF", + "else" : "ELSE", + "switch" : "SWITCH", + "case" : "CASE", + "default" : "DEFAULT", + "break" : "BREAK", + "continue" : "CONTINUE", + "goto" : "GOTO", + "do" : "DO", + "delete" : "DELETE", + "for" : "FOR", + "in" : "IN", + "with" : "WITH", + "try" : "TRY", + "catch" : "CATCH", + "finally" : "FINALLY", + "throw" : "THROW", + "instanceof" : "INSTANCEOF", + "typeof" : "TYPEOF", + "void" : "VOID", + "call" : "CALL", + "apply" : "APPLY" +} + +JSSPACE_BEFORE = [ "INSTANCEOF", "IN" ] +JSSPACE_AFTER = [ "VAR", "NEW", "GOTO", "INSTANCEOF", "TYPEOF", "DELETE", "IN", "THROW", "CASE" ] +JSSPACE_AFTER_USAGE = [ "RETURN", "FUNCTION" ] +JSPARANTHESIS_BEFORE = [ "ELSE", "FINALLY", "CATCH", "WHILE" ] diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/filetool.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/filetool.py new file mode 100755 index 0000000000..0cf23612b2 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/filetool.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# +################################################################################ + +import os, codecs, cPickle, sys +import textutil + +def save(filePath, content="", encoding="utf-8"): + # Normalize + filePath = normalize(filePath) + + # Create directory + directory(os.path.dirname(filePath)) + + # Writing file + try: + outputFile = codecs.open(filePath, encoding=encoding, mode="w", errors="replace") + outputFile.write(content) + except IOError, (errno, strerror): + print " * I/O error(%s): %s" % (errno, strerror) + sys.exit(1) + except UnicodeDecodeError: + print " * Could not decode result to %s" % encoding + sys.exit(1) + except: + print " * Unexpected error:", sys.exc_info()[0] + sys.exit(1) + + outputFile.flush() + outputFile.close() + + +def directory(dirname): + # Normalize + dirname = normalize(dirname) + + # Check/Create directory + if dirname != "" and not os.path.exists(dirname): + os.makedirs(dirname) + + +def normalize(filename): + return os.path.normcase(os.path.normpath(filename)) + + +def read(filePath, encoding="utf_8"): + try: + ref = codecs.open(filePath, encoding=encoding, mode="r") + content = ref.read() + ref.close() + + return textutil.any2Unix(unicode(content)) + + except IOError, (errno, strerror): + print " * I/O error(%s): %s" % (errno, strerror) + sys.exit(1) + + except ValueError: + print " * Invalid Encoding. Required encoding %s in %s" % (encoding, filePath) + sys.exit(1) + + except: + print " * Unexpected error:", sys.exc_info()[0] + sys.exit(1) + + +def storeCache(cachePath, data): + try: + cPickle.dump(data, open(cachePath, 'wb'), 2) + + except EOFError or PickleError or PicklingError: + print " * Could not store cache to %s" % cachePath + sys.exit(1) + + +def readCache(cachePath): + try: + return cPickle.load(open(cachePath, 'rb')) + + except EOFError or PickleError or UnpicklingError: + print " * Could not read cache from %s" % cachePath + sys.exit(1) + + +def checkCache(filePath, cachePath, internalModTime): + fileModTime = os.stat(filePath).st_mtime + + try: + cacheModTime = os.stat(cachePath).st_mtime + except OSError: + cacheModTime = 0 + + if internalModTime > cacheModTime: + # print "Invalid cache: %s" % filePath + # print "%s > %s" % (internalModTime, cacheModTime) + return True + + return fileModTime > cacheModTime diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/graph.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/graph.py new file mode 100755 index 0000000000..b5bac4c94e --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/graph.py @@ -0,0 +1,73 @@ +import os +import math +import filetool +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +# Write dependencies to a Graphviz compatible file (http://www.graphviz.org/) + +def dotLine(fileDb, fileId, depEntry, largetFileSize): + file = fileId.split(".") + dep = depEntry.split(".") + weight = 1 + + for i in range(len(file)): + if file[i] == dep[i]: + weight += 1 + else: + break + + size = os.path.getsize(fileDb[fileId]["path"]) + + content = ' "%s" [color="%s %s 1.000"];\n' % (fileId, math.log(size)/math.log(largetFileSize), math.log(size)/math.log(largetFileSize)) + content += ' "%s" -> "%s" [weight=%s];\n' % (fileId, depEntry, weight) + + return content + + +def store(fileDb, sortedIncludeList, options): + content = '''digraph "qooxdoo" { +node [style=filled]; +''' + + largest = 0 + for fileId in sortedIncludeList: + size = os.path.getsize(fileDb[fileId]["path"]) + if size > largest: + largest = size + + for fileId in sortedIncludeList: + if len(fileDb[fileId]["loadtimeDeps"]) > 0: + for depEntry in fileDb[fileId]["loadtimeDeps"]: + content += dotLine(fileDb, fileId, depEntry, largest) + + if len(fileDb[fileId]["afterDeps"]) > 0: + for depEntry in fileDb[fileId]["afterDeps"]: + content += dotLine(fileDb, fileId, depEntry, largest) + + if len(fileDb[fileId]["runtimeDeps"]) > 0: + for depEntry in fileDb[fileId]["runtimeDeps"]: + content += dotLine(fileDb, fileId, depEntry, largest) + + if len(fileDb[fileId]["loadDeps"]) > 0: + for depEntry in fileDb[fileId]["loadDeps"]: + content += dotLine(fileDb, fileId, depEntry, largest) + + content += '}' + filetool.save(options.depDotFile, content) \ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/loader.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/loader.py new file mode 100755 index 0000000000..309a5586fa --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/loader.py @@ -0,0 +1,827 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# +################################################################################ + +import sys, string, re, os, random, cPickle, codecs +import config, tokenizer, treegenerator, filetool, stringoptimizer, textutil + +internalModTime = 0 + + +def validateFiles(): + + global internalModTime + + base = os.path.dirname(os.path.abspath(sys.argv[0])) + if base.endswith("modules"): + path = base + else: + path = os.path.join(base, "modules") + + maxFileModTime = os.stat(os.path.join(path, ".." + os.path.sep + "generator.py")).st_mtime + + for root, dirs, files in os.walk(path): + + # Filter ignored directories + for ignoredDir in config.DIRIGNORE: + if ignoredDir in dirs: + dirs.remove(ignoredDir) + + # Searching for files + for fileName in files: + if os.path.splitext(fileName)[1] != config.PYEXT: + continue + + filePath = os.path.join(root, fileName) + fileModTime = os.stat(filePath).st_mtime + + if fileModTime > maxFileModTime: + maxFileModTime = fileModTime + + + internalModTime = maxFileModTime + + + +def getInternalModTime(options): + + global internalModTime + + if internalModTime == 0 and not options.disableInternalCheck: + validateFiles() + + return internalModTime + + + +def extractFileContentId(data): + # TODO: Obsolete with 0.7 + for item in config.QXHEAD["defineClass"].findall(data): + return item[0] + + for item in config.QXHEAD["id"].findall(data): + return item + + for item in config.QXHEAD["classDefine"].findall(data): + return item[1] + + return None + + +def extractSuperClass(data): + # TODO: Obsolete with 0.7 + for item in config.QXHEAD["defineClass"].findall(data): + return item[2] + + for item in config.QXHEAD["superClass"].findall(data): + return item + + return None + + +def extractLoadtimeDeps(data, fileId=""): + deps = [] + + # qooxdoo specific: + # store inheritance deps + superClass = extractSuperClass(data) + if superClass != None and superClass != "" and not superClass in config.JSBUILTIN: + deps.append("qx.OO") + deps.append(superClass) + elif "qx.OO.defineClass(" in data: + deps.append("qx.OO") + + + # Adding explicit requirements + for item in config.QXHEAD["require"].findall(data): + if item == fileId: + print " - Self-referring load dependency: %s" % item + elif item in deps: + print " - Double definition of load dependency: %s" % item + else: + deps.append(item) + + return deps + + +def extractAfterDeps(data, fileId=""): + deps = [] + + # Adding explicit after requirements + for item in config.QXHEAD["after"].findall(data): + if item == fileId: + print " - Self-referring load dependency: %s" % item + elif item in deps: + print " - Double definition of load dependency: %s" % item + else: + deps.append(item) + + return deps + + +def extractRuntimeDeps(data, fileId=""): + deps = [] + + # Adding explicit runtime requirements + for item in config.QXHEAD["use"].findall(data): + if item == fileId: + print " - Self-referring runtime dependency: %s" % item + elif item in deps: + print " - Double definition of runtime dependency: %s" % item + else: + deps.append(item) + + return deps + + +def extractLoadDeps(data, fileId=""): + deps = [] + + # Adding before requirements + for item in config.QXHEAD["load"].findall(data): + if item == fileId: + print " - Self-referring runtime dependency: %s" % item + elif item in deps: + print " - Double definition of runtime dependency: %s" % item + else: + deps.append(item) + + return deps + + +def extractOptional(data): + deps = [] + + # Adding explicit requirements + for item in config.QXHEAD["optional"].findall(data): + if not item in deps: + deps.append(item) + + return deps + + +def extractModules(data): + mods = [] + + for item in config.QXHEAD["module"].findall(data): + if not item in mods: + mods.append(item) + + return mods + + +def extractResources(data, fileId): + res = [] + + for item in config.QXHEAD["resource"].findall(data): + res.append({ "namespace" : fileId[0:fileId.find(".")], "id" : item[0], "entry" : item[1] }) + + return res + + +def extractEmbeds(data): + emb = [] + + for item in config.QXHEAD["embed"].findall(data): + emb.append({ "namespace" : item[0], "id" : item[1], "entry" : item[2] }) + + return emb + + + +def getTokens(fileDb, fileId, options): + if not fileDb[fileId].has_key("tokens"): + if options.verbose: + print " - Generating tokens for %s..." % fileId + + useCache = False + loadCache = False + + fileEntry = fileDb[fileId] + + filePath = fileEntry["path"] + fileEncoding = fileEntry["encoding"] + + if options.cacheDirectory != None: + cachePath = os.path.join(filetool.normalize(options.cacheDirectory), fileId + "-tokens.pcl") + useCache = True + + if not filetool.checkCache(filePath, cachePath, getInternalModTime(options)): + loadCache = True + + if loadCache: + tokens = filetool.readCache(cachePath) + else: + fileContent = filetool.read(filePath, fileEncoding) + tokens = tokenizer.parseStream(fileContent, fileId) + + if useCache: + if options.verbose: + print " - Caching tokens for %s..." % fileId + + filetool.storeCache(cachePath, tokens) + + fileDb[fileId]["tokens"] = tokens + + return fileDb[fileId]["tokens"] + + + + +def getTree(fileDb, fileId, options): + if not fileDb[fileId].has_key("tree"): + if options.verbose: + print " - Generating tree for %s..." % fileId + + useCache = False + loadCache = False + + fileEntry = fileDb[fileId] + filePath = fileEntry["path"] + + if options.cacheDirectory != None: + cachePath = os.path.join(filetool.normalize(options.cacheDirectory), fileId + "-tree.pcl") + useCache = True + + if not filetool.checkCache(filePath, cachePath, getInternalModTime(options)): + loadCache = True + + if loadCache: + tree = filetool.readCache(cachePath) + else: + tree = treegenerator.createSyntaxTree(getTokens(fileDb, fileId, options)) + + if useCache: + if options.verbose: + print " - Caching tree for %s..." % fileId + + filetool.storeCache(cachePath, tree) + + fileDb[fileId]["tree"] = tree + + return fileDb[fileId]["tree"] + + + + + +def getStrings(fileDb, fileId, options): + if not fileDb[fileId].has_key("strings"): + if options.verbose: + print " - Searching for strings in %s..." % fileId + + useCache = False + loadCache = False + + fileEntry = fileDb[fileId] + filePath = fileEntry["path"] + + if options.cacheDirectory != None: + cachePath = os.path.join(filetool.normalize(options.cacheDirectory), fileId + "-strings.pcl") + useCache = True + + if not filetool.checkCache(filePath, cachePath, getInternalModTime(options)): + loadCache = True + + if loadCache: + strings = filetool.readCache(cachePath) + else: + strings = stringoptimizer.search(getTree(fileDb, fileId, options), options.verbose) + + if useCache: + if options.verbose: + print " - Caching strings for %s..." % fileId + + filetool.storeCache(cachePath, strings) + + fileDb[fileId]["strings"] = strings + + return fileDb[fileId]["strings"] + + + + + +def resolveAutoDeps(fileDb, options): + ###################################################################### + # DETECTION OF AUTO DEPENDENCIES + ###################################################################### + + if options.verbose: + print " * Resolving dependencies..." + else: + print " * Resolving dependencies: ", + + knownIds = [] + depCounter = 0 + hasMessage = False + + for fileId in fileDb: + knownIds.append(fileId) + + for fileId in fileDb: + fileEntry = fileDb[fileId] + + if fileEntry["autoDeps"] == True: + continue + + if not options.verbose: + sys.stdout.write(".") + sys.stdout.flush() + + hasMessage = False + + fileTokens = getTokens(fileDb, fileId, options) + fileDeps = [] + + assembledName = "" + + for token in fileTokens: + if token["type"] == "name" or token["type"] == "builtin": + if assembledName == "": + assembledName = token["source"] + else: + assembledName += ".%s" % token["source"] + + if assembledName in knownIds: + if assembledName != fileId and not assembledName in fileDeps: + fileDeps.append(assembledName) + + assembledName = "" + + elif not (token["type"] == "token" and token["source"] == "."): + if assembledName != "": + assembledName = "" + + if token["type"] == "string" and token["source"] in knownIds and token["source"] != fileId and not token["source"] in fileDeps: + fileDeps.append(token["source"]) + + + if options.verbose: + print " - Analysing %s..." % fileId + + # Updating lists... + optionalDeps = fileEntry["optionalDeps"] + loadtimeDeps = fileEntry["loadtimeDeps"] + runtimeDeps = fileEntry["runtimeDeps"] + + # Removing optional deps from list + for dep in optionalDeps: + if dep in fileDeps: + fileDeps.remove(dep) + + if options.verbose: + + # Checking loadtime dependencies + for dep in loadtimeDeps: + if not dep in fileDeps: + print " - Could not confirm #require(%s) in %s!" % (dep, fileId) + + # Checking runtime dependencies + for dep in runtimeDeps: + if not dep in fileDeps: + print " - Could not confirm #use(%s) in %s!" % (dep, fileId) + + # Adding new content to runtime dependencies + for dep in fileDeps: + if not dep in runtimeDeps and not dep in loadtimeDeps: + if options.verbose: + print " - Adding dependency: %s" % dep + + runtimeDeps.append(dep) + depCounter += 1 + + # store flag to omit it the next run + fileEntry["autoDeps"] = True + + if not hasMessage and not options.verbose: + print + + # print " * Added %s dependencies" % depCounter + + + + +def storeEntryCache(fileDb, options): + cacheCounter = 0 + ignoreDbEntries = [ "tokens", "tree", "path", "pathId", "encoding", "resourceInput", "resourceOutput", "listIndex", "classPath", "classUri" ] + + for fileId in fileDb: + fileEntry = fileDb[fileId] + + if fileEntry["cached"] == True: + continue + + # Store flag + fileEntry["cached"] = True + + # Copy entries + fileEntryCopy = {} + for key in fileEntry: + if not key in ignoreDbEntries: + fileEntryCopy[key] = fileEntry[key] + + filetool.storeCache(fileEntry["cachePath"], fileEntryCopy) + cacheCounter += 1 + + if cacheCounter == 0: + print " * No classes were modified" + else: + print " * %s classes were modified" % cacheCounter + + + + +def indexFile(filePath, filePathId, classPath, listIndex, classEncoding, classUri, resourceInput, resourceOutput, options, fileDb={}, moduleDb={}): + + ######################################## + # Checking cache + ######################################## + + useCache = False + loadCache = False + cachePath = None + + if options.cacheDirectory != None: + cachePath = os.path.join(filetool.normalize(options.cacheDirectory), filePathId + "-entry.pcl") + useCache = True + + if not filetool.checkCache(filePath, cachePath, getInternalModTime(options)): + loadCache = True + + + + ######################################## + # Loading file content / cache + ######################################## + + if loadCache: + fileEntry = filetool.readCache(cachePath) + fileId = filePathId + + else: + fileContent = filetool.read(filePath, classEncoding) + + # Extract ID + fileContentId = extractFileContentId(fileContent) + + # Search for valid ID + if fileContentId == None: + print " - Could not extract ID from file: %s. Fallback to path %s!" % (filePath, filePathId) + fileId = filePathId + + else: + fileId = fileContentId + + if fileId != filePathId: + print " - ID mismatch: CONTENT=%s != PATH=%s" % (fileContentId, filePathId) + sys.exit(1) + + fileEntry = { + "autoDeps" : False, + "cached" : False, + "cachePath" : cachePath, + "optionalDeps" : extractOptional(fileContent), + "loadtimeDeps" : extractLoadtimeDeps(fileContent, fileId), + "runtimeDeps" : extractRuntimeDeps(fileContent, fileId), + "afterDeps" : extractAfterDeps(fileContent, fileId), + "loadDeps" : extractLoadDeps(fileContent, fileId), + "resources" : extractResources(fileContent, fileId), + "embeds" : extractEmbeds(fileContent), + "modules" : extractModules(fileContent) + } + + + + ######################################## + # Additional data + ######################################## + + # We don't want to cache these items + fileEntry["path"] = filePath + fileEntry["pathId"] = filePathId + fileEntry["encoding"] = classEncoding + fileEntry["resourceInput"] = resourceInput + fileEntry["resourceOutput"] = resourceOutput + fileEntry["classUri"] = classUri + fileEntry["listIndex"] = listIndex + fileEntry["classPath"] = classPath + + + ######################################## + # Registering file + ######################################## + + # Register to file database + fileDb[fileId] = fileEntry + + # Register to module database + for moduleId in fileEntry["modules"]: + if moduleDb.has_key(moduleId): + moduleDb[moduleId].append(fileId) + else: + moduleDb[moduleId] = [ fileId ] + + + + + +def indexSingleScriptInput(classPath, listIndex, options, fileDb={}, moduleDb={}): + classPath = filetool.normalize(classPath) + counter = 0 + + # Search for other indexed lists + if len(options.classEncoding) > listIndex: + classEncoding = options.classEncoding[listIndex] + else: + classEncoding = "utf-8" + + if len(options.classUri) > listIndex: + classUri = options.classUri[listIndex] + else: + classUri = None + + if len(options.resourceInput) > listIndex: + resourceInput = options.resourceInput[listIndex] + else: + resourceInput = None + + if len(options.resourceOutput) > listIndex: + resourceOutput = options.resourceOutput[listIndex] + else: + resourceOutput = None + + for root, dirs, files in os.walk(classPath): + + # Filter ignored directories + for ignoredDir in config.DIRIGNORE: + if ignoredDir in dirs: + dirs.remove(ignoredDir) + + # Searching for files + for fileName in files: + if os.path.splitext(fileName)[1] == config.JSEXT: + filePath = os.path.join(root, fileName) + filePathId = filePath.replace(classPath + os.sep, "").replace(config.JSEXT, "").replace(os.sep, ".") + + indexFile(filePath, filePathId, classPath, listIndex, classEncoding, classUri, resourceInput, resourceOutput, options, fileDb, moduleDb) + counter += 1 + + return counter + + +def indexScriptInput(options): + if options.cacheDirectory != None: + filetool.directory(options.cacheDirectory) + + print " * Indexing class paths... " + + fileDb = {} + moduleDb = {} + listIndex = 0 + + for classPath in options.classPath: + print " - Indexing: %s" % classPath + counter = indexSingleScriptInput(classPath, listIndex, options, fileDb, moduleDb) + print " - %s classes were found" % counter + listIndex += 1 + + if options.enableAutoDependencies: + resolveAutoDeps(fileDb, options) + + if options.cacheDirectory != None: + storeEntryCache(fileDb, options) + + return fileDb, moduleDb + + + + + +""" +Simple resolver, just try to add items and put missing stuff around +the new one. +""" +def addIdWithDepsToSortedList(sortedList, fileDb, fileId): + if not fileDb.has_key(fileId): + print " * Error: Couldn't find required file: %s" % fileId + return False + + # Test if already in + if not fileId in sortedList: + + # Including loadtime dependencies + for loadtimeDepId in fileDb[fileId]["loadtimeDeps"]: + if loadtimeDepId == fileId: break; + addIdWithDepsToSortedList(sortedList, fileDb, loadtimeDepId) + + # Including after dependencies + for afterDepId in fileDb[fileId]["afterDeps"]: + if afterDepId == fileId: break; + addIdWithDepsToSortedList(sortedList, fileDb, afterDepId) + + # Add myself + if not fileId in sortedList: + sortedList.append(fileId) + + # Include runtime dependencies + for runtimeDepId in fileDb[fileId]["runtimeDeps"]: + addIdWithDepsToSortedList(sortedList, fileDb, runtimeDepId) + + # Include load dependencies + for loadDepId in fileDb[fileId]["loadDeps"]: + addIdWithDepsToSortedList(sortedList, fileDb, loadDepId) + + + + + +""" +Search for dependencies, but don't add them. Just use them to put +the new class after the stuff which is required (if it's included, too) +""" +def addIdWithoutDepsToSortedList(sortedList, fileDb, fileId): + if not fileDb.has_key(fileId): + print " * Error: Couldn't find required file: %s" % fileId + return False + + # Test if already in + if not fileId in sortedList: + + # Search sortedList for files which needs this one and are already included + lowestIndex = None + currentIndex = 0 + for lowId in sortedList: + for lowDepId in getResursiveLoadDeps([], fileDb, lowId, lowId): + if lowDepId == fileId and (lowestIndex == None or currentIndex < lowestIndex): + lowestIndex = currentIndex + + currentIndex += 1 + + # Insert at defined index or just append new entry + if lowestIndex != None: + sortedList.insert(lowestIndex, fileId) + else: + sortedList.append(fileId) + + + + +def getResursiveLoadDeps(deps, fileDb, fileId, ignoreId=None): + if fileId in deps: + return + + if fileId != ignoreId: + deps.append(fileId) + + # Including loadtime dependencies + for loadtimeDepId in fileDb[fileId]["loadtimeDeps"]: + getResursiveLoadDeps(deps, fileDb, loadtimeDepId) + + # Including after dependencies + for afterDepId in fileDb[fileId]["afterDeps"]: + getResursiveLoadDeps(deps, fileDb, afterDepId) + + return deps + + + + + +def getSortedList(options, fileDb, moduleDb): + includeWithDeps = [] + excludeWithDeps = [] + includeWithoutDeps = [] + excludeWithoutDeps = [] + + sortedIncludeList = [] + sortedExcludeList = [] + + + + # INCLUDE + + # Add Modules and Files (with deps) + if options.includeWithDeps: + for include in options.includeWithDeps: + if include in moduleDb: + includeWithDeps.extend(moduleDb[include]) + + else: + regexp = textutil.toRegExp(include) + + for fileId in fileDb: + if regexp.search(fileId): + if not fileId in includeWithDeps: + includeWithDeps.append(fileId) + + + # Add Modules and Files (without deps) + if options.includeWithoutDeps: + for include in options.includeWithoutDeps: + if include in moduleDb: + includeWithoutDeps.extend(moduleDb[include]) + + else: + regexp = textutil.toRegExp(include) + + for fileId in fileDb: + if regexp.search(fileId): + if not fileId in includeWithoutDeps: + includeWithoutDeps.append(fileId) + + + + + + + # Add all if both lists are empty + if len(options.includeWithDeps) == 0 and len(options.includeWithoutDeps) == 0: + for fileId in fileDb: + includeWithDeps.append(fileId) + + # Sorting include (with deps) + for fileId in includeWithDeps: + addIdWithDepsToSortedList(sortedIncludeList, fileDb, fileId) + + # Sorting include (without deps) + for fileId in includeWithoutDeps: + addIdWithoutDepsToSortedList(sortedIncludeList, fileDb, fileId) + + + + # EXCLUDE + + # Add Modules and Files (with deps) + if options.excludeWithDeps: + for exclude in options.excludeWithDeps: + if exclude in moduleDb: + excludeWithDeps.extend(moduleDb[exclude]) + + else: + regexp = textutil.toRegExp(exclude) + + for fileId in fileDb: + if regexp.search(fileId): + if not fileId in excludeWithDeps: + excludeWithDeps.append(fileId) + + + # Add Modules and Files (without deps) + if options.excludeWithoutDeps: + for exclude in options.excludeWithoutDeps: + if exclude in moduleDb: + excludeWithoutDeps.extend(moduleDb[exclude]) + + else: + regexp = textutil.toRegExp(exclude) + + for fileId in fileDb: + if regexp.search(fileId): + if not fileId in excludeWithDeps: + excludeWithoutDeps.append(fileId) + + + + + + + # Sorting exclude (with deps) + for fileId in excludeWithDeps: + addIdWithDepsToSortedList(sortedExcludeList, fileDb, fileId) + + # Sorting exclude (without deps) + for fileId in excludeWithoutDeps: + addIdWithoutDepsToSortedList(sortedExcludeList, fileDb, fileId) + + + + + # MERGE + + # Remove excluded files from included files list + for fileId in sortedExcludeList: + if fileId in sortedIncludeList: + sortedIncludeList.remove(fileId) + + + + # RETURN + + return sortedIncludeList diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/mapper.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/mapper.py new file mode 100755 index 0000000000..58fb4f442f --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/mapper.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# +################################################################################ + +table = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" + +def convert(current): + # Possibilities with each character + # 1: 36 = 36 + # 2: 36*36 = 1296 + # 3: 36*36*36 = 46656 + + res = "" + length = len(table) - 1 + + if current / length > 0: + res += convert(current / length) + + res += table[current % length] + + return res diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/migrator.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/migrator.py new file mode 100755 index 0000000000..26bd14521b --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/migrator.py @@ -0,0 +1,326 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Andreas Ecker (ecker) +# +################################################################################ + +import sys, re, os +import config, filetool, treegenerator, tokenizer, compiler, textutil + +def entryCompiler(line): + # protect escaped equal symbols + line = line.replace("\=", "----EQUAL----") + + splitLine = line.split("=") + + if len(splitLine) != 2: + print " - Malformed entry: %s" % line + return + + orig = splitLine[0].strip() + repl = splitLine[1].strip() + + #print "%s :: %s" % (orig, value) + + # recover protected equal symbols + orig = orig.replace("----EQUAL----", "=") + repl = repl.replace("----EQUAL----", "=") + + return {"expr":re.compile(orig), "orig":orig, "repl":repl} + + + + +def regtool(content, regs, patch, options): + for patchEntry in regs: + matches = patchEntry["expr"].findall(content) + itercontent = content + line = 1 + + for fragment in matches: + + # Replacing + if patch: + content = patchEntry["expr"].sub(patchEntry["repl"], content, 1) + # Debug + if options.verbose: + print " - Replacing pattern '%s' to '%s'" % (patchEntry["orig"], patchEntry["repl"]) + + else: + # Search for first match position + pos = itercontent.find(fragment) + pos = patchEntry["expr"].search(itercontent).start() + + # Update current line + line += len((itercontent[:pos] + fragment).split("\n")) - 1 + + # Removing leading part til matching part + itercontent = itercontent[pos+len(fragment):] + + # Debug + if options.verbose: + print " - Matches %s in %s" % (patchEntry["orig"], line) + + print " - line %s : (%s)" % (line, patchEntry["orig"]) + print " %s" % patchEntry["repl"] + + return content + + + + +def getHtmlList(options): + htmlList = [] + + for htmlDir in options.migrationInput: + for root, dirs, files in os.walk(htmlDir): + + # Filter ignored directories + for ignoredDir in config.DIRIGNORE: + if ignoredDir in dirs: + dirs.remove(ignoredDir) + + # Searching for files + for fileName in files: + if os.path.splitext(fileName)[1] in [ ".js", ".html", ".htm", ".php", ".asp", ".jsp" ]: + htmlList.append(os.path.join(root, fileName)) + + return htmlList + + + +def handle(fileList, fileDb, options): + confPath = os.path.join(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), "migration"), options.migrationTarget) + + infoPath = os.path.join(confPath, "info") + patchPath = os.path.join(confPath, "patches") + + importedModule = False + infoList = [] + patchList = [] + htmlList = getHtmlList(options) + + + + + print " * Number of script input files: %s" % len(fileList) + print " * Number of HTML input files: %s" % len(htmlList) + print " * Update to version: %s" % options.migrationTarget + + + + print " * Searching for patch module..." + + for root, dirs, files in os.walk(confPath): + + # Filter ignored directories + for ignoredDir in config.DIRIGNORE: + if ignoredDir in dirs: + dirs.remove(ignoredDir) + + # Searching for files + for fileName in files: + filePath = os.path.join(root, fileName) + + if os.path.splitext(fileName)[1] != config.PYEXT: + continue + + if fileName == "patch.py": + print " - Importing..." + + if not root in sys.path: + sys.path.insert(0, root) + + import patch + importedModule = True + + + + + + + + emptyLine = re.compile("^\s*$") + + + + print " * Searching for info expression data..." + + for root, dirs, files in os.walk(infoPath): + + # Filter ignored directories + for ignoredDir in config.DIRIGNORE: + if ignoredDir in dirs: + dirs.remove(ignoredDir) + + # Searching for files + for fileName in files: + filePath = os.path.join(root, fileName) + + fileContent = textutil.any2Unix(filetool.read(filePath, "utf-8")) + infoList.append({"path":filePath, "content":fileContent.split("\n")}) + + if options.verbose: + print " - %s" % filePath + + print " - Number of info files: %s" % len(infoList) + + print " - Compiling expressions..." + + compiledInfos = [] + + for infoFile in infoList: + print " - %s" % os.path.basename(infoFile["path"]) + for line in infoFile["content"]: + if emptyLine.match(line) or line.startswith("#") or line.startswith("//"): + continue + + compiled = entryCompiler(line) + if compiled != None: + compiledInfos.append(compiled) + + print " - Number of infos: %s" % len(compiledInfos) + + + + + print " * Searching for patch expression data..." + + for root, dirs, files in os.walk(patchPath): + + # Filter ignored directories + for ignoredDir in config.DIRIGNORE: + if ignoredDir in dirs: + dirs.remove(ignoredDir) + + # Searching for files + for fileName in files: + filePath = os.path.join(root, fileName) + + fileContent = textutil.any2Unix(filetool.read(filePath, "utf-8")) + patchList.append({"path":filePath, "content":fileContent.split("\n")}) + + if options.verbose: + print " - %s" % filePath + + print " - Number of patch files: %s" % len(patchList) + + print " - Compiling expressions..." + + compiledPatches = [] + + for patchFile in patchList: + print " - %s" % os.path.basename(patchFile["path"]) + for line in patchFile["content"]: + if emptyLine.match(line) or line.startswith("#") or line.startswith("//"): + continue + + compiled = entryCompiler(line) + if compiled != None: + compiledPatches.append(compiled) + + print " - Number of patches: %s" % len(compiledPatches) + + + + + + + + + print + print " FILE PROCESSING:" + print "----------------------------------------------------------------------------" + + if len(fileList) > 0: + print " * Processing script files:" + + for fileId in fileList: + fileEntry = fileDb[fileId] + + filePath = fileEntry["path"] + fileEncoding = fileEntry["encoding"] + + print " - %s" % fileId + + # Read in original content + fileContent = filetool.read(filePath, fileEncoding) + patchedContent = fileContent + + # Apply patches + if importedModule: + tree = treegenerator.createSyntaxTree(tokenizer.parseStream(patchedContent)) + + # If there were any changes, compile the result + if patch.patch(fileId, tree): + patchedContent = compiler.compile(tree, True) + + patchedContent = regtool(patchedContent, compiledPatches, True, options) + patchedContent = regtool(patchedContent, compiledInfos, False, options) + + # Write file + if patchedContent != fileContent: + print " - Store modifications..." + filetool.save(filePath, patchedContent, fileEncoding) + + print " * Done" + + + + if len(htmlList) > 0: + print " * Processing HTML files:" + + for filePath in htmlList: + print " - %s" % filePath + + # Read in original content + fileContent = filetool.read(filePath) + + patchedContent = fileContent + patchedContent = regtool(patchedContent, compiledPatches, True, options) + patchedContent = regtool(patchedContent, compiledInfos, False, options) + + # Write file + if patchedContent != fileContent: + print " - Store modifications..." + filetool.save(filePath, patchedContent) + + print " * Done" + + + + + + + + + + + +###################################################################### +# MAIN LOOP +###################################################################### + +if __name__ == '__main__': + try: + main() + + except KeyboardInterrupt: + print + print " * Keyboard Interrupt" + sys.exit(1) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/msgfmt.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/msgfmt.py new file mode 100755 index 0000000000..2503357c84 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/msgfmt.py @@ -0,0 +1,273 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +# -*- coding: iso-8859-1 -*- +# Written by Martin v. Lwis +# Plural forms support added by alexander smishlajev + +""" +Generate qooxdoo message catalog from textual translation description. + +This program converts a textual Uniforum-style message catalog (.po file) into +a qooxdoo JavaScript catalog (.js file). This is essentially the same function as the +GNU msgfmt program, however, it is a simpler implementation. + +Usage: msgfmt.py [OPTIONS] filename.po + +Options: + -d directory + --output-directory=directory + Specify the output directory to write to. If omitted, output will the current directory + + -n namespace + --namespace=namespace + JavaScript target namespace + + -h + --help + Print this message and exit. + + -V + --version + Display version information and exit. +""" + +import sys +import os +import getopt +import struct +import array + +__version__ = "1.1" + +MESSAGES = {} + + +def usage (ecode, msg=''): + """ + Print usage and msg and exit with given code. + """ + print >> sys.stderr, __doc__ + if msg: + print >> sys.stderr, msg + sys.exit(ecode) + + +def add (msgid, transtr, fuzzy): + """ + Add a non-fuzzy translation to the dictionary. + """ + global MESSAGES + if not fuzzy and transtr and not transtr.startswith('\0'): + MESSAGES[msgid] = transtr + + +def escapeJS(str): + str = str.replace('"', '\\"') + str = str.replace("'", "\\'") + return str + + +def generate(infile, languageCode, namespace): + global MESSAGES + if namespace != "": namespace += "." + if len(languageCode.split("_")) > 1: + requireString = "#require(%s%s)" % (namespace, languageCode.split("_")[0]) + else: + requireString = "" + + output = '''/* ************************************************************************ + + qooxdoo - the new era of web development + + http://qooxdoo.org + + Copyright: + 2004-2007 by 1&1 Internet AG, Germany, http://www.1and1.org + + License: + LGPL: http://www.gnu.org/licenses/lgpl.html + EPL 1.0: http://www.eclipse.org/org/documents/epl-v10.php + + Authors: + * Sebastian Werner (wpbasti) + * Andreas Ecker (ecker) + * Fabian Jakobs (fjakobs) + +************************************************************************ */ + +/* ************************************************************************ + +#require(qx.Locale) +%s +************************************************************************ */ + +/* +WARNING: This file is generated by the gettext tools from %s. Do not edit it by hand. +*/ + +qx.Locale.define("%s%s", +{ +''' % (requireString, infile, namespace, languageCode) + + translations = [] + normalizedMessages = {} + for msg in MESSAGES: + keys = msg.split("\0"); + if len(keys) <= 1: + normalizedMessages[msg] = MESSAGES[msg] + continue + values = MESSAGES[msg].split("\0"); + for i in range(len(keys)): + normalizedMessages[keys[i]] = values[i] + + for msg in normalizedMessages: + if msg == "": continue + translations.append(' "%s": "%s"' % (msg, escapeJS(normalizedMessages[msg]))) + output += (",\n").join(translations) + output += "\n});" + #print output + return output + + +def make (filename, outdir, namespace): + ID = 1 + STR = 2 + global MESSAGES + MESSAGES = {} + + # Compute .mo name from .po name and arguments + if filename.endswith('.po'): + infile = filename + else: + infile = filename + '.po' + + basename = os.path.splitext(os.path.basename(infile))[0] + outfile = os.path.join(outdir, basename + '.js') + + try: + lines = open(infile).readlines() + except IOError, msg: + print >> sys.stderr, msg + sys.exit(1) + + section = None + fuzzy = 0 + + # Parse the catalog + msgid = msgstr = '' + lno = 0 + for l in lines: + lno += 1 + # If we get a comment line after a msgstr, this is a new entry + if l[0] == '#' and section == STR: + add(msgid, msgstr, fuzzy) + section = None + fuzzy = 0 + # Record a fuzzy mark + if l[:2] == '#,' and (l.find('fuzzy') >= 0): + fuzzy = 1 + # Skip comments + if l[0] == '#': + continue + # Start of msgid_plural section, separate from singular form with \0 + if l.startswith('msgid_plural'): + msgid += '\0' + l = l[12:] + # Now we are in a msgid section, output previous section + elif l.startswith('msgid'): + if section == STR: + add(msgid, msgstr, fuzzy) + section = ID + l = l[5:] + msgid = msgstr = '' + # Now we are in a msgstr section + elif l.startswith('msgstr'): + section = STR + l = l[6:] + # Check for plural forms + if l.startswith('['): + # Separate plural forms with \0 + if not l.startswith('[0]'): + msgstr += '\0' + # Ignore the index - must come in sequence + l = l[l.index(']') + 1:] + # Skip empty lines + l = l.strip() + if not l: + continue + # XXX: Does this always follow Python escape semantics? + l = eval(l) + if section == ID: + msgid += l + elif section == STR: + msgstr += l + else: + print >> sys.stderr, 'Syntax error on %s:%d' % (infile, lno), \ + 'before:' + print >> sys.stderr, l + sys.exit(1) + # Add last entry + if section == STR: + add(msgid, msgstr, fuzzy) + + # Compute output + output = generate(infile, basename, namespace) + + + try: + open(outfile,"w").write(output) + except IOError,msg: + print >> sys.stderr, msg + + + +def main (): + try: + opts, args = getopt.getopt(sys.argv[1:], 'hVd:n:', + ['help', 'version', 'output-directory=', 'namespace=']) + except getopt.error, msg: + usage(1, msg) + + outdir = "." + ns = "" + # parse options + for opt, arg in opts: + if opt in ('-h', '--help'): + usage(0) + elif opt in ('-V', '--version'): + print >> sys.stderr, "msgfmt.py", __version__ + sys.exit(0) + elif opt in ('-d', '--output-directory'): + outdir = arg + elif opt in ('-n', '--namespace'): + ns = arg + # do it + if not args: + print >> sys.stderr, 'No input file given' + print >> sys.stderr, "Try `msgfmt --help' for more information." + return + + for filename in args: + make(filename, outdir, ns) + + +if __name__ == '__main__': + main() diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/obfuscator.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/obfuscator.py new file mode 100755 index 0000000000..dd69f45f4b --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/obfuscator.py @@ -0,0 +1,456 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# +################################################################################ + +import tree, mapper + +qooxdooStart = [ + # Properties + "_modify", "_check", "_unitDetection", + + # Layout + "_applyRuntime", + + # Cache Properties + "_resetRuntime", "_compute", "_change", "_invalidate", "_recompute", + + # Property Methods + "set", "get", "force", "reset" +] + +qooxdooNames = [ + # Demos + "ROOT_LOGGER", "removeAllAppenders", "addAppender", "DivAppender", + + # qx.ui.core.Widget.initApplyMethods + "_style", + "setStyleProperty", "removeStyleProperty", + "constant", "Core", + + # Inheritance + "qx", "Proto", "Class" +] + +systemNames = [ + # Statement + "break","catch","continue","do","for","in","finally","function","if","else","return","switch","case","default", + "this","throw","try","var","while","with", + + # Operator + "delete","false","instanceof","new","null","true","typeof","void", + + # Function + "GetObject","ScriptEngine","ScriptEngineBuildVersion","ScriptEngineMajorVersion","ScriptEngineMinorVersion", + + # Objects + "ActiveXObject","Arguments","Array","Boolean","Date","Dictionary","Enumerator","Error","FileSystemObject", + "Function","Global","Image","Math","Number","Object","RegExp","String","VBArray", + + # Property + "$1","$2","$3","$4","$5", + "$6","$7","$8","$9","arguments","arity","callee","caller","constructor","description","E","global","ignoreCase", + "index","Infinity","input","lastIndex","leftContext","length","LN2","LN10","LOG2E","LOG10E","MAX_VALUE", + "MIN_VALUE","message","multiline","name","NaN","NEGATIVE_INFINITY","number","PI","POSITIVE_INFINITY", + "prototype","rightContext","source","SQRT1_2","SQRT2","undefined", + + # Methods + "abs","acos","anchor","apply","asin", + "atan","atan2","atEnd","big","blink","bold","call","ceil","charAt","charCodeAt","compile","concat","cos", + "decodeURI","decodeURIComponent","dimensions","encodeURI","encodeURIComponent","escape","eval","exec", + "exp","fixed","floor","fontcolor","fontsize","fromCharCode","getDate","getDay","getFullYear","getHours", + "getItem","getMilliseconds","getMinutes","getMonth","getSeconds","getTime","getTimezoneOffset","getUTCDate", + "getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds", + "getVarDate","getYear","hasOwnProperty","indexOf","isFinite","isNaN","isPrototypeOf","italics","item","join", + "lastIndexOf","lastMatch","lastParen","lbound","link","localeCompare","log","match","max","min","moveFirst", + "moveNext","parse","parseFloat","parseInt","pop","pow","propertyIsEnumerable","push","random","replace", + "reverse","round","search","setDate","setFullYear","setHours","setMilliseconds","setMinutes","setMonth", + "setSeconds","setTime","setUTCDate","setUTCFullYear","setUTCHours","setUTCMilliseconds","setUTCMinutes", + "setUTCMonth","setUTCSeconds","setYear","shift","sin","slice","small","sort","splice","split","sqrt","strike", + "sub","substr","substring","sup","tan","test","toArray","toDateString","toExponential","toFixed","toGMTString", + "toLocaleDateString","toLocaleLowerCase","toLocaleString","toLocaleTimeString","toLocaleUpperCase","toLowerCase", + "toPrecision","toString","toTimeString","toUpperCase","toUTCString","ubound","unescape","unshift","unwatch","UTC", + "valueOf","watch", + + # HTML Entity + "nbsp","lt","gt","amp","apos","quot","cent","pound","yen","sect","copy","reg","times","divide", + + # DHTML Constant + "ATTRIBUTE_NODE","CDATA_SECTION_NODE","COMMENT_NODE","DOCUMENT_FRAGMENT_NODE","DOCUMENT_NODE","DOCUMENT_TYPE_NODE", + "ELEMENT_NODE","ENTITY_NODE","ENTITY_REFERENCE_NODE","NOTATION_NODE","PROCESSING_INSTRUCTION_NODE","TEXT_NODE", + "NOTATION_FRAGMENT_NODE","DOMSTRING_SIZE_ERR","HIERARCHY_REQUEST_ERR","INDEX_SIZE_ERR","INUSE_ATTRIBUTE_ERR", + "INVALID_ACCESS_ERR","INVALID_CHARACTER_ERR","INVALID_MODIFICATION_ERR","INVALID_STATE_ERR","NAMESPACE_ERR", + "NOT_FOUND_ERR","NOT_SUPPORTED_ERR","NO_DATA_ALLOWED_ERR","NO_MODIFICATION_ALLOWED_ERR","SYNTAX_ERR", + "WRONG_DOCUMENT_ERR","ABORT","BLUR","CLICK","CHANGE","DBLCLICK","DRAGDROP","ERROR","FOCUS","KEYDOWN","KEYPRESS", + "KEYUP","LOAD","MOUSEDOWN","MOUSEMOVE","MOUSEOUT","MOUSEOVER","MOUSEUP","MOVE","RESET","RESIZE","SELECT","SUBMIT", + "UNLOAD","NODE_BEFORE","NODE_AFTER","NODE_BEFORE_AND_AFTER","NODE_INSIDE","START_TO_START","START_TO_END", + "END_TO_END","END_TO_START","BAD_BOUNDARYPOINTS_ERR","INVALID_NODE_TYPE_ERR","UNKNOWN_RULE","STYLE_RULE", + "CHARSET_RULE","IMPORT_RULE","MEDIA_RULE","FONT_FACE_RULE","PAGE_RULE","CSS_UNKNOWN","CSS_NUMBER","CSS_PERCENTAGE", + "CSS_EMS","CSS_EXS","CSS_PX","CSS_CM","CSS_MM","CSS_IN","CSS_PT","CSS_PC","CSS_DEG","CSS_RAD","CSS_GRAD","CSS_MS", + "CSS_S","CSS_HZ","CSS_KHZ","CSS_DIMENSION","CSS_STRING","CSS_URI","CSS_IDENT","CSS_ATTR","CSS_COUNTER","CSS_RECT", + "CSS_RGBCOLOR","CSS_INHERIT","CSS_PRIMITIVE_VALUE","CSS_VALUE_LIST","CSS_CUSTOM","STATE_MAXIMIZED","STATE_MINIMIZED", + "STATE_NORMAL","DOCUMENT_POSITION_DISCONNECTED","DOCUMENT_POSITION_PRECEDING","DOCUMENT_POSITION_FOLLOWING", + "DOCUMENT_POSITION_CONTAINS","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC", + "CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","MOUSEDOWN","MOUSEUP","MOUSEOVER","MOUSEOUT","MOUSEMOVE", + "MOUSEDRAG","CLICK","DBLCLICK","KEYDOWN","KEYUP","KEYPRESS","DRAGDROP","FOCUS","BLUR","SELECT","CHANGE", + "RESET","SUBMIT","SCROLL","LOAD","UNLOAD","XFER_DONE","ABORT","ERROR","LOCATE","MOVE","RESIZE","FORWARD", + "HELP","BACK","TEXT","ALT_MASK","CONTROL_MASK","SHIFT_MASK","META_MASK","SCROLL_PAGE_UP","SCROLL_PAGE_DOWN", + "DOM_VK_CANCEL","DOM_VK_HELP","DOM_VK_BACK_SPACE","DOM_VK_TAB","DOM_VK_CLEAR","DOM_VK_RETURN","DOM_VK_ENTER", + "DOM_VK_SHIFT","DOM_VK_CONTROL","DOM_VK_ALT","DOM_VK_PAUSE","DOM_VK_CAPS_LOCK","DOM_VK_ESCAPE","DOM_VK_SPACE", + "DOM_VK_PAGE_UP","DOM_VK_PAGE_DOWN","DOM_VK_END","DOM_VK_HOME","DOM_VK_LEFT","DOM_VK_UP","DOM_VK_RIGHT","DOM_VK_DOWN", + "DOM_VK_PRINTSCREEN","DOM_VK_INSERT","DOM_VK_DELETE","DOM_VK_0","DOM_VK_1","DOM_VK_2","DOM_VK_3","DOM_VK_4","DOM_VK_5", + "DOM_VK_6","DOM_VK_7","DOM_VK_8","DOM_VK_9","DOM_VK_SEMICOLON","DOM_VK_EQUALS","DOM_VK_A","DOM_VK_B","DOM_VK_C", + "DOM_VK_D","DOM_VK_E","DOM_VK_F","DOM_VK_G","DOM_VK_H","DOM_VK_I","DOM_VK_J","DOM_VK_K","DOM_VK_L","DOM_VK_M", + "DOM_VK_N","DOM_VK_O","DOM_VK_P","DOM_VK_Q","DOM_VK_R","DOM_VK_S","DOM_VK_T","DOM_VK_U","DOM_VK_V","DOM_VK_W", + "DOM_VK_X","DOM_VK_Y","DOM_VK_Z","DOM_VK_CONTEXT_MENU","DOM_VK_NUMPAD0","DOM_VK_NUMPAD1","DOM_VK_NUMPAD2", + "DOM_VK_NUMPAD3","DOM_VK_NUMPAD4","DOM_VK_NUMPAD5","DOM_VK_NUMPAD6","DOM_VK_NUMPAD7","DOM_VK_NUMPAD8","DOM_VK_NUMPAD9", + "DOM_VK_MULTIPLY","DOM_VK_ADD","DOM_VK_SEPARATOR","DOM_VK_SUBTRACT","DOM_VK_DECIMAL","DOM_VK_DIVIDE","DOM_VK_F1", + "DOM_VK_F2","DOM_VK_F3","DOM_VK_F4","DOM_VK_F5","DOM_VK_F6","DOM_VK_F7","DOM_VK_F8","DOM_VK_F9","DOM_VK_F10", + "DOM_VK_F11","DOM_VK_F12","DOM_VK_F13","DOM_VK_F14","DOM_VK_F15","DOM_VK_F16","DOM_VK_F17","DOM_VK_F18","DOM_VK_F19", + "DOM_VK_F20","DOM_VK_F21","DOM_VK_F22","DOM_VK_F23","DOM_VK_F24","DOM_VK_NUM_LOCK","DOM_VK_SCROLL_LOCK","DOM_VK_COMMA", + "DOM_VK_PERIOD","DOM_VK_SLASH","DOM_VK_BACK_QUOTE","DOM_VK_OPEN_BRACKET","DOM_VK_BACK_SLASH","DOM_VK_CLOSE_BRACKET", + "DOM_VK_QUOTE","DOM_VK_META","MODIFICATION","ADDITION","REMOVAL","INVALID_EXPRESSION_ERR","TYPE_ERR","ANY_TYPE", + "NUMBER_TYPE","STRING_TYPE","BOOLEAN_TYPE","UNORDERED_NODE_ITERATOR_TYPE","ORDERED_NODE_ITERATOR_TYPE", + "UNORDERED_NODE_SNAPSHOT_TYPE","ORDERED_NODE_SNAPSHOT_TYPE","ANY_UNORDERED_NODE_TYPE","FIRST_ORDERED_NODE_TYPE", + "UNSPECIFIED_EVENT_TYPE_ERR", + + # DHTML Object + "a","AbstractView","acronym","address","applet","area","Attr","attribute","b", + "BarProp","base","baseFont","bdo","BeforeUnloadEvent","bgSound","big","blockQuote","body","br","button", + "CanvasGradient","CanvasPattern","CanvasRenderingContext2D","caption","CDATASection","center","CharacterData", + "ChromeWindow","cite","clientInformation","clipboardData","code","col","colGroup","comment","Comment","Counter", + "CSS2Properties","CSSCharsetRule","CSSFontFaceRule","CSSImportRule","CSSMediaRule","CSSPageRule","CSSPrimitiveValue", + "CSSRGBColor","CSSRule","CSSRuleList","CSSStyleDeclaration","CSSStyleRule","CSSStyleSheet","CSSUnknownRule", + "CSSValue","CSSValueList","currentStyle","custom","dataTransfer","dd","defaults","del","dfn","dir","div","dl", + "document","Document","DocumentCSS","DocumentEvent","DocumentFragment","DocumentRange","DocumentStyle", + "DocumentType","DocumentView","DOMException","DOMImplementation","DOMImplementationCSS","DOMParser", + "DOMStringList","dt","Element","ElementCSSInlineStyle","em","embed","Entity","EntityReference","event", + "Event","EventException","EventListener","EventTarget","external","fieldSet","font","form","frame","frameSet", + "h","head","history","History","hr","html","HTMLAnchorElement","HTMLAppletElement","HTMLAreaElement", + "HTMLBRElement","HTMLBaseElement","HTMLBaseFontElement","HTMLBodyElement","HTMLButtonElement","HTMLCanvasElement", + "HTMLCollection","HTMLDListElement","HTMLDirectoryElement","HTMLDivElement","HTMLDocument","HTMLDOMImplementation", + "HTMLElement","HTMLEmbedElement","HTMLFieldSetElement","HTMLFontElement","HTMLFormElement","HTMLFrameElement", + "HTMLFrameSetElement","HTMLHRElement","HTMLHeadElement","HTMLHeadingElement","HTMLHtmlElement","HTMLIFrameElement", + "HTMLImageElement","HTMLInputElement","HTMLIsIndexElement","HTMLLIElement","HTMLLabelElement","HTMLLegendElement", + "HTMLLinkElement","HTMLMapElement","HTMLMenuElement","HTMLMetaElement","HTMLModElement","HTMLOListElement", + "HTMLObjectElement","HTMLOptGroupElement","HTMLOptionElement","HTMLOptionsCollection","HTMLParagraphElement", + "HTMLParamElement","HTMLPreElement","HTMLQuoteElement","HTMLScriptElement","HTMLSelectElement","HTMLStyleElement", + "HTMLTableCaptionElement","HTMLTableCellElement","HTMLTableColElement","HTMLTableElement","HTMLTableRowElement", + "HTMLTableSectionElement","HTMLTextAreaElement","HTMLTitleElement","HTMLUListElement","i","iframe","ImageDocument", + "img","implementation","IMPORT","input","ins","isIndex","kbd","KeyboardEvent","KeyEvent","label","legend","li", + "link","LinkStyle","listing","location","Location","map","marquee","MediaList","menu","meta","MimeType", + "MimeTypeArray","MouseEvent","MutationEvent","NamedNodeMap","NameList","namespace","navigator","Navigator", + "nextID","noBR","Node","NodeList","noFrames","noScript","Notation","NSDocument","NSEvent","NSHTMLAnchorElement", + "NSHTMLAreaElement","NSHTMLButtonElement","NSHTMLDocument","NSHTMLElement","NSHTMLFormElement","NSHTMLFrameElement", + "NSHTMLHRElement","NSHTMLImageElement","NSHTMLInputElement","NSHTMLOptionElement","NSHTMLSelectElement", + "NSHTMLTextAreaElement","NSRange","NSUIEvent","object","ol","optGroup","option","p","page","PageTransitionEvent", + "param","plainText","Plugin","PluginArray","popup","PopupBlockedEvent","pre","ProcessingInstruction","q","Range", + "RangeException","Rect","RGBColor","rt","ruby","rule","runtimeStyle","s","samp","SchemaLoader","screen","Screen", + "script","select","selection","Selection","small","SmartCardEvent","span","strike","strong","style","styleSheet", + "StyleSheet","StyleSheetList","sub","sup","Supports","table","TableSectionElement","tBody","td","Text","textArea", + "TextNode","TextRange","TextRectangle","tFoot","th","tHead","title","tr","TreeWalker","tt","u","UIEvent","ul", + "userProfile","URI","var","ViewCSS","wbr","WebBrowser","WebNavigation","window","Window","Window2","WindowCollection", + "WindowInternal","xml","XMLDocument","XMLHttpRequest","XMLSerializer","xmp","XPathEvaluator","XPathException", + "XPathExpression","XPathNSResolver","XPathResult","XPointerResult","XSLTProcessor", + + # DHTML Property + "_content","abbr","accelerator", + "accept","acceptCharset","accessKey","action","activeElement","additive","align","aLink","alinkColor","allowTransparency", + "alt","altHTML","altKey","altLeft","anchorNode","anchorOffset","appCodeName","APPLICATION","appMinorVersion","appName", + "appVersion","archive","async","ATOMICSELECTION","attrChange","attrName","autocomplete","availHeight","availLeft", + "availTop","availWidth","azimuth","axis","background","backgroundAttachment","backgroundColor","backgroundImage", + "backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","balance","Banner", + "BannerAbstract","BaseHref","baseURI","behavior","bgColor","BGCOLOR","bgProperties","blockDirection","blue", + "booleanValue","border","borderBottom","borderBottomColor","borderBottomStyle","borderBottomWidth","borderCollapse", + "borderColor","borderColorDark","borderColorLight","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth", + "borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStyle","borderTop", + "borderTopColor","borderTopStyle","borderTopWidth","borderWidth","borderWidths","bottom","bottomMargin","boundingHeight", + "boundingLeft","boundingTop","boundingWidth","browserDOMWindow","browserLanguage","bubbles","bufferDepth","button", + "cancelable","cancelBubble","canHaveChildren","canHaveHTML","canvas","caption","captionSide","cellIndex","cellPadding", + "cellSpacing","ch","channel","charCode","charset","checked","characterSet","chOff","cite","classid","className", + "clear","clientHeight","clientLeft","clientTop","clientWidth","clientX","clientY","clip","clipBottom","clipLeft", + "clipRight","clipTop","cloneContents","closed","code","codeBase","codeType","collapsed","color","colorDepth","cols", + "colSpan","columnNumber","commonAncestorContainer","compact","compatMode","complete","content","contentDocument", + "contentEditable","contentOverflow","contentType","contentWindow","cookie","cookieEnabled","coords","Count", + "counterIncrement","counterReset","cpuClass","crypto","cssFloat","cssRules","cssText","cssValueType","ctrlKey", + "ctrlLeft","cue","cueAfter","cueBefore","current","currentNode","currentTarget","cursor","data","dataFld","DATAFLD", + "dataFormatAs","DATAFORMATAS","dataPageSize","dataSrc","DATASRC","dateTime","declare","defaultCharset", + "defaultChecked","defaultSelected","defaultStatus","defaultValue","defaultView","defer","description","designMode", + "detail","deviceXDPI","deviceYDPI","dialogArguments","dialogHeight","dialogLeft","dialogTop","dialogWidth","dir", + "direction","directories","disabled","display","displays","doctype","document","documentElement","documentURI", + "domain","domConfig","dropEffect","dynsrc","effectAllowed","elevation","emptyCells","enabledPlugin","encoding", + "enctype","endContainer","endOffset","entities","event","eventPhase","expandEntityReferences","expando", + "explicitOriginalTarget","face","fgColor","FieldDelim","fileCreatedDate","fileModifiedDate","filename","fileSize", + "fileUpdatedDate","fillStyle","filter","firstChild","focusNode","focusOffset","font","fontFamily","fontSize", + "fontSizeAdjust","fontSmoothingEnabled","fontStretch","fontStyle","fontVariant","fontWeight","form","formName", + "frame","frameBorder","frameElement","frameSpacing","fromElement","fullScreen","galleryImg","globalAlpha", + "globalCompositeOperation","green","hash","hasLayout","headers","height","hidden","hideFocus","history","host", + "hostname","href","hreflang","hspace","htmlFor","htmlText","httpEquiv","id","identifier","imageIsOverflowing", + "imageIsResized","imageRequest","imageResizingEnabled","imeMode","implementation","indeterminate","index","inner", + "innerHeight","innerHTML","innerText","innerWidth","inputEncoding","internalSubset","invalidIteratorState","isChar", + "isCollapsed","isContentEditable","isDisabled","isMap","isMultiLine","isOpen","isTextEdit","isTrusted","keyCode", + "label","lang","language","lastChild","lastModified","layerX","layerY","layoutFlow","layoutGrid","layoutGridChar", + "layoutGridLine","layoutGridMode","layoutGridType","left","leftMargin","length","letterSpacing","lineBreak","lineCap", + "lineHeight","lineJoin","lineNumber","lineWidth","link","linkColor","listStyle","listStyleImage","listStylePosition", + "listStyleType","localName","location","locationbar","logicalXDPI","logicalYDPI","longDesc","loop","loop","lowsrc", + "lowSrc","margin","marginBottom","marginHeight","marginLeft","marginRight","margins","marginTop","marginWidth", + "markerOffset","marks","maxHeight","maxLength","maxWidth","media","mediaText","menuArguments","menubar","message", + "metaKey","method","Methods","minHeight","minWidth","miterLimit","MozAppearance","MozBackgroundClip", + "MozBackgroundInlinePolicy","MozBackgroundOrigin","MozBinding","MozBorderBottomColors","MozBorderLeftColors", + "MozBorderRadius","MozBorderRadiusBottomleft","MozBorderRadiusBottomright","MozBorderRadiusTopleft", + "MozBorderRadiusTopright","MozBorderRightColors","MozBorderTopColors","MozBoxAlign","MozBoxDirection","MozBoxFlex", + "MozBoxOrdinalGroup","MozBoxOrient","MozBoxPack","MozBoxSizing","MozColumnCount","MozColumnGap","MozColumnWidth", + "MozFloatEdge","MozForceBrokenImageIcon","MozImageRegion","MozMarginEnd","MozMarginStart","MozOpacity","MozOutline", + "MozOutlineColor","MozOutlineOffset","MozOutlineRadius","MozOutlineRadiusBottomleft","MozOutlineRadiusBottomright", + "MozOutlineRadiusTopleft","MozOutlineRadiusTopright","MozOutlineStyle","MozOutlineWidth","MozPaddingEnd", + "MozPaddingStart","MozUserFocus","MozUserInput","MozUserModify","MozUserSelect","multipart","multiple","name", + "nameProp","namespaceURI","naturalHeight","naturalWidth","navigator","newValue","next","nextPage","nextSibling", + "nodeName","nodeType","nodeValue","noHref","noResize","noShade","notationName","notations","noWrap","numberValue", + "object","offscreenBuffering","offsetHeight","offsetLeft","offsetParent","offsetTop","offsetWidth","offsetX", + "offsetY","onBefore","onLine","opacity","opener","originalTarget","orphans","oscpu","outerHeight","outerHTML", + "outerText","outerWidth","outline","outlineColor","outlineOffset","outlineStyle","outlineWidth","overflow","overflowX", + "overflowY","ownerDocument","ownerElement","ownerNode","ownerRule","owningElement","padding","paddingBottom", + "paddingLeft","paddingRight","paddings","paddingTop","page","pageBreakAfter","pageBreakBefore","pageBreakInside", + "pageX","pageXOffset","pageY","pageYOffset","palette","parent","parentElement","parentNode","parentRule", + "parentStyleSheet","parentTextEdit","parentWindow","pathname","pause","pauseAfter","pauseBefore","persisted", + "personalbar","pitch","pitchRange","pixelBottom","pixelDepth","pixelHeight","pixelLeft","pixelRight","pixelTop", + "pixelWidth","pkcs11","platform","playDuring","pluginspage","popupWindowFeatures","popupWindowURI","port","posBottom", + "posHeight","position","posLeft","posRight","posTop","posWidth","preferredStylesheetSet","prefix","previous", + "previousSibling","prevValue","primitiveType","product","productSub","profile","prompt","prompter","propertyName", + "protocol","pseudoClass","publicId","qualifier","quotes","rangeCount","rangeOffset","rangeParent","readOnly", + "readyState","reason","recordNumber","recordset","red","referrer","rel","relatedNode","relatedTarget","repeat", + "requestingWindowURI","responseText","responseXML","result","resultType","returnValue","rev","richness","right", + "rightMargin","root","rowIndex","rows","rowSpan","rubyAlign","rubyOverhang","rubyPosition","rules","saveType", + "scheme","scope","scopeName","screen","screenLeft","screenTop","screenX","screenY","scroll","scrollAmount", + "scrollbar3dLightColor","scrollbarArrowColor","scrollbarBaseColor","scrollbarDarkShadowColor","scrollbarFaceColor", + "scrollbarHighlightColor","scrollbars","scrollbarShadowColor","scrollbarTrackColor","scrollDelay","scrollHeight", + "scrolling","scrollLeft","scrollMaxX","scrollMaxY","scrollTop","scrollX","scrollY","scrollWidth","search", + "sectionRowIndex","SECURITY","securityPolicy","selected","selectedIndex","selectionEnd","selectionStart","selector", + "selectorText","self","separator","shape","sheet","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY", + "shiftKey","shiftLeft","sidebar","singleNodeValue","size","snapshotLength","sourceIndex","span","speak","speakHeader", + "speakNumeral","speakPunctuation","specified","speechRate","src","srcElement","srcFilter","srcUrn","standby","start", + "startContainer","startOffset","status","statusbar","statusText","stress","strictErrorChecking","stringValue", + "strokeStyle","style","STYLE","styleFloat","styleSheet","suffixes","summary","systemId","systemLanguage","tabIndex", + "tableLayout","tabStop","tagName","tagUrn","target","text","textAlign","textAlignLast","textAutospace","textContent", + "textDecoration","textDecorationBlink","textDecorationLineThrough","textDecorationNone","textDecorationOverline", + "textDecorationUnderline","textIndent","textJustify","textKashidaSpace","textLength","textOverflow","textShadow", + "textTransform","textUnderlinePosition","textZoom","tFoot","tHead","timeStamp","title","tmpRealOriginalTarget", + "toElement","tokenName","toolbar","top","topMargin","trueSpeed","type","typeDetail","unicodeBidi","uniqueID","units", + "unselectable","UNSELECTABLE","updateInterval","URL","URLUnencoded","urn","useMap","userAgent","userLanguage","vAlign", + "value","valueType","vcard_name","vendor","vendorSub","version","verticalAlign","view","viewInheritStyle","viewLink", + "viewMasterTab","visibility","visible","vLink","vlinkColor","voiceFamily","volume","vspace","whatToShow","wheelDelta", + "which","whiteSpace","widows","width","window","windowRoot","windowState","wordBreak","wordSpacing","wordWrap","wrap", + "writingMode","x","XMLDocument","xmlEncoding","XMLNS","xmlStandalone","xmlVersion","XSLDocument","y","zIndex","zoom", + + # DHTML Method + "abort","add","addBehavior","addBinding","addColorStop","addEventListener","AddChannel","AddDesktopComponent", + "addElement","AddFavorite","addImport","addPageRule","addRange","addReadRequest","addRule","adoptNode","alert", + "appendChild","appendData","appendMedium","applyElement","arc","arcTo","assign","atob","attachEvent", + "AutoCompleteSaveForm","AutoScan","back","beginPath","bezierCurveTo","blur","btoa","captureEvents","ChooseColorDlg", + "clear","clearAttributes","clearData","clearInterval","clearParameters","clearRect","clearRequest","clearTimeout", + "click","clip","cloneNode","cloneRange","close","closePath","collapse","collapseToEnd","collapseToStart", + "compareBoundaryPoints","compareDocumentPosition","compareEndPoints","compareNode","comparePoint","componentFromPoint", + "confirm","contains","containsNode","containsNS","createAttribute","createAttributeNS","createCaption", + "createCDATASection","createComment","createContextualFragment","createControlRange","createCSSStyleSheet", + "createDocument","createDocumentFragment","createDocumentType","createElement","createElementNS", + "createEntityReference","createEvent","createEventObject","createExpression","createLinearGradient", + "createHTMLDocument","createNodeIterator","createNSResolver","createPattern","createPopup", + "createProcessingInstruction","createRadialGradient","createRange","createRangeCollection","createStyleSheet", + "createTextNode","createTextRange","createTFoot","createTHead","createTreeWalker","deleteCaption","deleteCell", + "deleteContents","deleteData","deleteFromDocument","deleteMedium","deleteRow","deleteRule","deleteTFoot", + "deleteTHead","detach","detachEvent","disableExternalCapture","dispatchEvent","doImport","doReadRequest", + "doScroll","dragDrop","drawImage","dump","duplicate","elementFromPoint","enableExternalCapture","empty", + "escape","evaluate","evaluateFIXptr","evaluateWithContext","evaluateXPointer","execCommand","execCommandShowHelp", + "execScript","expand","extend","extractContents","fill","fillRect","find","findText","fireEvent","firstPage", + "focus","forward","getAdjacentText","getAllResponseHeaders","getAnonymousElementByAttribute","getAnonymousNodes", + "getAttention","getAttentionWithCycleCount","getAttribute","getAttributeNode","getAttributeNodeNS","getAttributeNS", + "getBindingParent","getBookmark","getBoundingClientRect","getBoxObjectFor","getCharset","getClientRects", + "getComputedStyle","getContext","getCounterValue","getData","getElementById","getElementsByName","getElementsByTagName", + "getElementsByTagNameNS","getExpression","getFeature","getFloatValue","getName","getNamedItem","getNamedItemNS", + "getNamespaceURI","getOverrideStyle","getParameter","getPreventDefault","getPropertyCSSValue","getPropertyPriority", + "getPropertyValue","getRangeAt","getRectValue","getResponseHeader","getRGBColorValue","getSelection","getStringValue", + "getSVGDocument","getUserData","go","hasAttribute","hasAttributeNS","hasAttributes","hasChildNodes","hasFeature", + "hasFocus","hide","home","ImportExportFavorites","importNode","importStylesheet","Init","initEvent","initKeyEvent", + "initMouseEvent","initMutationEvent","initPageTransitionEvent","initPopupBlockedEvent","initUIEvent","inRange", + "insertNode","insertAdjacentElement","insertAdjacentHTML","insertAdjacentText","insertBefore","insertCell","insertData", + "insertRow","insertRule","intersectsNode","isDefaultNamespace","isEqual","isEqualNode","isPointInRange","isSameNode", + "IsSubscribed","isSupported","item","Item","iterateNext","javaEnabled","lastPage","lineTo","load","loadAsync", + "loadBindingDocument","loadOverlay","lookupNamespaceURI","lookupPrefix","maximize","mergeAttributes","minimize", + "move","moveBy","moveEnd","moveRow","moveStart","moveTo","moveToBookmark","moveToElementText","moveToPoint", + "namedItem","namedRecordset","navigate","NavigateAndFind","nextNode","nextPage","normalize","normalizeDocument", + "nSDetach","open","openDialog","openRequest","overrideMimeType","parentElement","parseFromBuffer","parseFromStream", + "parseFromString","pasteHTML","preference","preventBubble","preventCapture","preventDefault","previousNode", + "previousPage","print","processSchemaElement","prompt","quadraticCurveTo","queryCommandEnabled","queryCommandIndeterm", + "queryCommandState","queryCommandSupported","queryCommandText","queryCommandValue","recalc","rect","refresh", + "releaseCapture","releaseEvents","reload","remove","removeAllRanges","removeAttribute","removeAttributeNode", + "removeAttributeNS","removeBehavior","removeBinding","removeChild","removeEventListener","removeExpression", + "removeNamedItem","removeNamedItemNS","removeNode","removeParameter","removeProperty","removeRange","removeRule", + "renameNode","replace","replaceAdjacentText","replaceChild","replaceData","replaceNode","reset","resizeBy", + "resizeTo","restore","restoreImage","restoreImageTo","rotate","routeEvent","save","scale","scroll","scrollBy", + "scrollByLines","scrollByPages","scrollIntoView","scrollTo","select","selectAllChildren","selectionLanguageChange", + "selectNode","selectNodeContents","send","serializeToStream","serializeToString","setActive","setAttribute", + "setAttributeNode","setAttributeNodeNS","setAttributeNS","setBoxObjectFor","setCapture","setCursor","setData", + "setEnd","setEndAfter","setEndBefore","setEndPoint","setExpression","setFloatValue","setInterval","setNamedItem", + "setNamedItemNS","setParameter","setProperty","setPropertyPriority","setRequestHeader","setResizable", + "setSelectionRange","setStart","setStartAfter","setStartBefore","setStringValue","setTimeout","setUserData", + "show","ShowBrowserUI","showHelp","showModalDialog","showModelessDialog","shrinkToFit","sizeToContent", + "snapshotItem","splitText","start","stop","stopPropagation","stroke","strokeRect","submit","substringData", + "supports","surroundContents","swapNode","tags","taintEnabled","toggleImageSize","transformToDocument", + "transformToFragment","translate","unescape","updateCommands","urns","write","writeln", + + # DHTML Event + "onabort","onactivate", + "onafterprint","onafterupdate","onbeforeactivate","onbeforecopy","onbeforecut","onbeforedeactivate","onbeforeeditfocus", + "onbeforepaste","onbeforeprint","onbeforeunload","onbeforeupdate","onblur","onbounce","oncellchange","onchange", + "onclick","onclose","oncontextmenu","oncontrolselect","oncopy","oncut","ondataavailable","ondatasetchanged", + "ondatasetcomplete","ondblclick","ondeactivate","ondrag","ondragdrop","ondragend","ondragenter","ondragleave", + "ondragover","ondragstart","ondrop","onerror","onerrorupdate","onfilterchange","onfinish","onfocus","onfocusin", + "onfocusout","onhelp","onkeydown","onkeypress","onkeyup","onlayoutcomplete","onload","onlosecapture","onmousedown", + "onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmousewheel","onmove","onmoveend", + "onmovestart","onpaint","onpaste","onprogress","onpropertychange","onreadystatechange","onreset","onresize", + "onresizeend","onresizestart","onrowenter","onrowexit","onrowsdelete","onrowsinserted","onscroll","onselect", + "onselectionchange","onselectstart","onstart","onstop","onsubmit","onunload", + + # DHTML Collection + "all","anchors","applets","areas", + "attributes","behaviorUrns","blockFormats","bookmarks","boundElements","cells","childNodes","children","classes", + "Components","controllers","controlRange","elements","embeds","filters","fonts","forms","frames","ids","images", + "imports","interfaces","layers","links","mimeTypes","namespaces","options","pages","plugins","rows","rules","scripts", + "styleSheets","tBodies","TextRange","TextRectangle", + + # IE Default Behavior + "anchorClick","anim","clientCaps","download","homePage","httpFolder", + "mediaBar","saveFavorite","saveHistory","saveSnapshot","userData", + + # IE Default Behavior Object + "MediaItem","PlaylistInfo", + + # IE Default Behavior Property + "attributeCount", + "availHeight","availWidth","bufferDepth","colorDepth","connectionType","cookieEnabled","cpuClass","currentItem", + "disabledUI","duration","enabled","expires","folder","hasNextItem","height","image","javaEnabled","name","nextItem", + "openState","platform","playlistInfo","playState","sound","sourceURL","statics","systemLanguage","target", + "userLanguage","width","XMLDocument", + + # IE Default Behavior Method + "addComponentRequest","addDABehavior","clearComponentRequest","compareVersions", + "doComponentRequest","getAttribute","getAttributeName","getComponentVersion","getItemInfo","isComponentInstalled", + "isHomePage","load","navigate","navigateFrame","navigateHomePage","playNext","playURL","removeAttribute", + "removeDABehavior","save","setAttribute","setHomePage","startDownload","stop", + + # IE Default Behavior Event + "onhide","onload","onopenstatechange", + "onplaystatechange","onsave","onshow", + + # XMLHTTP Object Property + "onreadystatechange","readyState","responseBody","responseStream","responseText", + "responseXML","status","statusText", + + # XMLHTTP Object Method + "abort","getAllResponseHeaders","getResponseHeader","open","send", + "setRequestHeader" +] + + +def search(node, names): + + if node.type == "assignment": + left = node.getChild("left", False) + + if left: + variable = left.getChild("variable", False) + + if variable: + last = variable.getLastChild() + first = variable.getFirstChild() + + if last == first: + if last.type == "identifier": + pass + + elif last.type == "identifier": + name = last.get("name") + + ignore = False + + if name in systemNames or name in qooxdooNames: + ignore = True + + if not ignore: + for item in qooxdooStart: + if name.startswith(item): + ignore = True + + # only apply to names which starts with an underscore + if not name.startswith("_"): + ignore = True + + if not ignore: + if not names.has_key(name): + # print "Add %s" % name + + names[name] = 1 + else: + names[name] += 1 + + if node.hasChildren(): + for child in node.children: + search(child, names) + + return names + + + + +def update(node, list, prefix): + counter = 0 + + if node.type == "identifier": + idenName = node.get("name", False) + + if idenName != None and idenName in list: + replName = "%s%s" % (prefix, mapper.convert(list.index(idenName))) + node.set("name", replName) + counter += 1 + + # print " - Replaced '%s' with '%s'" % (idenName, replName) + + if node.hasChildren(): + for child in node.children: + counter += update(child, list, prefix) + + return counter + + + +def sort(names): + temp = [] + + for name in names: + temp.append({ "name" : name, "number" : names[name] }) + + temp.sort(lambda x, y: y["number"]-x["number"]) + + list = [] + + for item in temp: + list.append(item["name"]) + + print " * Found %s names" % len(list) + + return list diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/optparseext.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/optparseext.py new file mode 100755 index 0000000000..8184413f68 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/optparseext.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Andreas Ecker (ecker) +# +################################################################################ + +from optparse import * + +class ExtendAction(Option): + ACTIONS = Option.ACTIONS + ("extend",) + STORE_ACTIONS = Option.STORE_ACTIONS + ("extend",) + TYPED_ACTIONS = Option.TYPED_ACTIONS + ("extend",) + + def take_action(self, action, dest, opt, value, values, parser): + if action == "extend": + lvalue = value.split(",") + values.ensure_value(dest, []).extend(lvalue) + else: + Option.take_action( + self, action, dest, opt, value, values, parser) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/resources.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/resources.py new file mode 100755 index 0000000000..58cc1549f6 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/resources.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# +################################################################################ + +import os, shutil, re +import config, textutil + + + + +def copy(options, sortedIncludeList, fileDb): + if options.enableResourceFilter: + print " * Processing embeds..." + + definedEmbeds = {} + compiledEmbeds = {} + + for fileId in sortedIncludeList: + fileEmbeds = fileDb[fileId]["embeds"] + + + if len(fileEmbeds) > 0: + print " - Found %i embeds in %s" % (len(fileEmbeds), fileId) + + for fileEmbed in fileEmbeds: + resourceNS = fileEmbed["namespace"] + resourceId = fileEmbed["id"] + embedEntry = fileEmbed["entry"] + + if not definedEmbeds.has_key(resourceNS): + definedEmbeds[resourceNS] = {} + + if not definedEmbeds[resourceNS].has_key(resourceId): + definedEmbeds[resourceNS][resourceId] = [] + + if not embedEntry in definedEmbeds[resourceNS][resourceId]: + definedEmbeds[resourceNS][resourceId].append(embedEntry) + + + # We must do this in a separate step because otherwise the string compare + # above does not work (how to compare compiled regexp?) + + print " * Compiling embeds..." + + for resourceNS in definedEmbeds: + for resourceId in definedEmbeds[resourceNS]: + for embedEntry in definedEmbeds[resourceNS][resourceId]: + if not compiledEmbeds.has_key(resourceNS): + compiledEmbeds[resourceNS] = {} + + if not compiledEmbeds[resourceNS].has_key(resourceId): + compiledEmbeds[resourceNS][resourceId] = [] + + compiledEmbeds[resourceNS][resourceId].append(textutil.toRegExp(embedEntry)) + + + + print " * Syncing files..." + + for fileId in sortedIncludeList: + filePath = fileDb[fileId]["path"] + fileResources = fileDb[fileId]["resources"] + + if len(fileResources) > 0: + print " - Found %i resources in %s" % (len(fileResources), fileId) + + for fileResource in fileResources: + resourceNS = fileResource["namespace"] + resourceId = fileResource["id"] + resourceEntry = fileResource["entry"] + + if options.enableResourceFilter: + if compiledEmbeds.has_key(resourceNS) and compiledEmbeds[resourceNS].has_key(resourceId): + resourceFilter = compiledEmbeds[resourceNS][resourceId] + else: + resourceFilter = [] + + + + # Preparing source directory + + sourceDirectory = os.path.join(fileDb[fileId]["resourceInput"], resourceEntry) + + try: + os.listdir(sourceDirectory) + except OSError: + print " - Source directory isn't readable! Ignore resource!" + continue + + + # Preparing destination directory + + destinationDirectory = os.path.join(fileDb[fileId]["resourceOutput"], resourceEntry) + + + + + + print " - Copying %s [%s.%s]" % (resourceEntry, resourceNS, resourceId) + + for root, dirs, files in os.walk(sourceDirectory): + + # Filter ignored directories + for ignoredDir in config.DIRIGNORE: + if ignoredDir in dirs: + dirs.remove(ignoredDir) + + # Searching for items (resource files) + for itemName in files: + + # Generate absolute source file path + itemSourcePath = os.path.join(root, itemName) + + # Extract relative path and directory + itemRelPath = itemSourcePath.replace(sourceDirectory + os.sep, "") + itemRelDir = os.path.dirname(itemRelPath) + + # Filter items + if options.enableResourceFilter: + include = False + + for filterEntry in resourceFilter: + if filterEntry.search(itemRelPath): + include = True + break + + if not include: + continue + + # Generate destination directory and file path + itemDestDir = os.path.join(destinationDirectory, itemRelDir) + itemDestPath = os.path.join(itemDestDir, itemName) + + # Check/Create destination directory + if not os.path.exists(itemDestDir): + os.makedirs(itemDestDir) + + # Copy file + if options.verbose: + print " - Copying file: %s" % itemRelPath + + shutil.copyfile(itemSourcePath, itemDestPath) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/settings.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/settings.py new file mode 100755 index 0000000000..aee16e542e --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/settings.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# +################################################################################ + +import sys, re, os, optparse +import filetool + + + + +def generate(options): + if len(options.defineRuntimeSetting) == 0: + return "" + + typeFloat = re.compile("^([0-9\-]+\.[0-9]+)$") + typeNumber = re.compile("^([0-9\-])$") + + settingsStr = "" + + settingsStr += 'if(!window.qx)qx={};' + + if options.addNewLines: + settingsStr += "\n" + + settingsStr += 'if(!qx.Settings)qx.Settings={};' + + if options.addNewLines: + settingsStr += "\n" + + settingsStr += 'if(!qx.Settings._customSettings)qx.Settings._customSettings={};' + + if options.addNewLines: + settingsStr += "\n" + + for setting in options.defineRuntimeSetting: + settingSplit = setting.split(":") + settingKey = settingSplit.pop(0) + settingValue = ":".join(settingSplit) + + settingKeySplit = settingKey.split(".") + settingKeyName = settingKeySplit.pop() + settingKeySpace = ".".join(settingKeySplit) + + checkStr = 'if(!qx.Settings._customSettings["%s"])qx.Settings._customSettings["%s"]={};' % (settingKeySpace, settingKeySpace) + if not checkStr in settingsStr: + settingsStr += checkStr + + if options.addNewLines: + settingsStr += "\n" + + settingsStr += 'qx.Settings._customSettings["%s"]["%s"]=' % (settingKeySpace, settingKeyName) + + if settingValue == "false" or settingValue == "true" or typeFloat.match(settingValue) or typeNumber.match(settingValue): + settingsStr += '%s' % settingValue + + else: + settingsStr += '"%s"' % settingValue.replace("\"", "\\\"") + + settingsStr += ";" + + if options.addNewLines: + settingsStr += "\n" + + return settingsStr + + + + +def main(): + parser = optparse.OptionParser() + + parser.add_option("-d", "--define-runtime-setting", action="append", dest="defineRuntimeSetting", metavar="NAMESPACE.KEY:VALUE", default=[], help="Define a setting.") + parser.add_option("-s", "--settings-script-file", dest="settingsScriptFile", metavar="FILENAME", help="Name of settings script file.") + parser.add_option("-n", "--add-new-lines", action="store_true", dest="addNewLines", default=False, help="Keep newlines in compiled files.") + + (options, args) = parser.parse_args() + + if options.settingsScriptFile == None: + print " * Please define the output file!" + sys.exit(1) + + if len(options.defineRuntimeSetting) == 0: + print " * Please define at least one runtime setting!" + sys.exit(1) + + print " * Saving settings to %s" % options.settingsScriptFile + filetool.save(options.settingsScriptFile, generate(options)) + + + + +if __name__ == '__main__': + try: + main() + + except KeyboardInterrupt: + print + print " * Keyboard Interrupt" + sys.exit(1) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/stringoptimizer.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/stringoptimizer.py new file mode 100755 index 0000000000..3796192c29 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/stringoptimizer.py @@ -0,0 +1,198 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# * Fabian Jakobs (fjakobs) +# +################################################################################ + +import tree + + +def search(node, verbose=False): + return search_loop(node, {}, verbose) + + +def search_loop(node, stringMap={}, verbose=False): + if node.type == "constant" and node.get("constantType") == "string": + + if verbose: + pvalue = node.get("value") + if isinstance(pvalue, unicode): + pvalue = pvalue.encode("utf-8") + print " - Found: %s" % pvalue + + if node.get("detail") == "singlequotes": + quote = "'" + elif node.get("detail") == "doublequotes": + quote = '"' + + value = "%s%s%s" % (quote, node.get("value"), quote) + + if value in stringMap: + stringMap[value] += 1 + else: + stringMap[value] = 1 + + if check(node, verbose): + for child in node.children: + search_loop(child, stringMap, verbose) + + return stringMap + + + +def check(node, verbose=False): + # Needs children + if not node.hasChildren(): + return False + + # Try to find all output statements + if node.type == "call": + cu = node + nx = cu.getChild("operand", False) + + if nx != None: + cu = nx + + all = cu.getAllChildrenOfType("identifier") + + for ch in all: + if ch.get("name", False) in [ "Error", "debug", "info", "warning", "error", "alert" ]: + if verbose: + print " - Ignore output statement at line: %s" % ch.get("line") + return False + + # Try to find all constant assignments (ns.UPPER = string) + elif node.type == "assignment": + left = node.getChild("left", False) + if left != None: + var = left.getChild("variable", False) + + if var != None: + last = var.getLastChild() + + if last.type == "identifier" and last.get("name").isupper(): + if verbose: + print " - Ignore constant assignment at line: %s" % last.get("line") + return False + + # Try to find all constant assignments from Maps ({ UPPER : string }) + elif node.type == "keyvalue": + if node.get("key").isupper(): + if verbose: + print " - Ignore constant key value at line: %s" % node.get("line") + return False + + return True + + + +def sort(stringMap): + stringList = [] + + for value in stringMap: + stringList.append({ "value" : value, "number" : stringMap[value] }) + + stringList.sort(lambda x, y: y["number"]-x["number"]) + + return stringList + + + + +def replace(node, stringList, var="$", verbose=False): + if node.type == "constant" and node.get("constantType") == "string": + if node.get("detail") == "singlequotes": + quote = "'" + elif node.get("detail") == "doublequotes": + quote = '"' + + oldvalue = "%s%s%s" % (quote, node.get("value"), quote) + + pos = 0 + for item in stringList: + if item["value"] == oldvalue: + newvalue = "%s[%s]" % (var, pos) + + if verbose: + poldvalue = oldvalue + if isinstance(poldvalue, unicode): + poldvalue = poldvalue.encode("utf-8") + print " - Replace: %s => %s" % (poldvalue, newvalue) + + line = node.get("line") + + + # GENERATE IDENTIFIER + + newidentifier = tree.Node("identifier") + newidentifier.set("line", line) + + childidentifier = tree.Node("identifier") + childidentifier.set("line", line) + childidentifier.set("name", var) + + newidentifier.addChild(childidentifier) + + + + # GENERATE KEY + + newkey = tree.Node("key") + newkey.set("line", line) + + newconstant = tree.Node("constant") + newconstant.set("line", line) + newconstant.set("constantType", "number") + newconstant.set("value", "%s" % pos) + + newkey.addChild(newconstant) + + + + # COMBINE CHILDREN + + newnode = tree.Node("accessor") + newnode.set("line", line) + newnode.set("optimized", True) + newnode.set("original", oldvalue) + newnode.addChild(newidentifier) + newnode.addChild(newkey) + + + # REPLACE NODE + + node.parent.replaceChild(node, newnode) + break + + pos += 1 + + if check(node, verbose): + for child in node.children: + replace(child, stringList, var, verbose) + + + +def replacement(stringList, var="$"): + repl = "%s=[" % var + + for item in stringList: + repl += "%s," % (item["value"]) + + repl = repl[:-1] + "];" + + return repl diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/svninfo.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/svninfo.py new file mode 100755 index 0000000000..9e7025d0bd --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/svninfo.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +################################################################################ +# +# qooxdoo - the new era of web development +# +# http://qooxdoo.org +# +# Copyright: +# 2006-2007 1&1 Internet AG, Germany, http://www.1and1.org +# +# License: +# LGPL: http://www.gnu.org/licenses/lgpl.html +# EPL: http://www.eclipse.org/org/documents/epl-v10.php +# See the LICENSE file in the project's top-level directory for details. +# +# Authors: +# * Sebastian Werner (wpbasti) +# +################################################################################ + +import os, sys, re, optparse +import filetool + + + +DIRINFO = re.compile("dir\n([0-9]+)\nhttps://.*/svnroot/qooxdoo/(\w+)/(\w+)/", re.M | re.S) + + + +def query(path): + if os.path.exists(path): + entries = os.path.join(path, ".svn", "entries") + + if os.path.exists(entries): + content = filetool.read(entries) + + mtch = DIRINFO.search(content) + if mtch: + folder = mtch.group(2) + if folder in [ "tags", "branches" ]: + folder = mtch.group(3) + + revision = mtch.group(1) + + return revision, folder + + return None, None + + + +def format(revision, folder): + return "(r%s) [%s]" % (revision, folder) + + + +if __name__ == '__main__': + try: + parser = optparse.OptionParser() + + (options, args) = parser.parse_args() + + revision, folder = query(args[0]) + if revision != None: + print format(revision, folder) + + + except KeyboardInterrupt: + print + print " * Keyboard Interrupt" + sys.exit(1) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/textile.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/textile.py new file mode 100755 index 0000000000..cc6f2873c9 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/textile.py @@ -0,0 +1,2910 @@ +#!/usr/bin/env python +# _*_ coding: latin1 _*_ + +"""This is Textile +A Humane Web Text Generator + +TODO: +* Make it work with Python 2.1. +* Make it work with Python 1.5.2? Or that's too optimistic? + +--- +To get an overview of all PyTextile's features, simply +type 'tell me about textile.' in a single line. +""" + +__authors__ = ["Roberto A. F. De Almeida (roberto@dealmeida.net)", + "Mark Pilgrim (f8dy@diveintomark.org)"] +__version__ = "2.0.10" +__date__ = "2004/10/06" +__copyright__ = """ +Copyright (c) 2004, Roberto A. F. De Almeida, http://dealmeida.net/ +Copyright (c) 2003, Mark Pilgrim, http://diveintomark.org/ +All rights reserved. + +Original PHP version: +Version 1.0 +21 Feb, 2003 + +Copyright (c) 2003, Dean Allen, www.textism.com +All rights reserved. + +Parts of the documentation and some of the regular expressions are (c) Brad +Choate, http://bradchoate.com/. Thanks, Brad! +""" +__license__ = """ +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 Textile nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +""" +__history__ = """ +1.0 - 2003/03/19 - MAP - initial release +1.01 - 2003/03/19 - MAP - don't strip whitespace within
 tags;
+  map high-bit ASCII to HTML numeric entities
+1.02 - 2003/03/19 - MAP - changed hyperlink qtag expression to only
+  match valid URL characters (per RFC 2396); fixed preg_replace to
+  not match across line breaks (solves lots of problems with
+  mistakenly matching overlapping inline markup); fixed whitespace
+  stripping to only strip whitespace from beginning and end of lines,
+  not immediately before and after HTML tags.
+1.03 - 2003/03/20 - MAP - changed hyperlink qtag again to more
+  closely match original Textile (fixes problems with links
+  immediately followed by punctuation -- somewhere Dean is
+  grinning right now); handle curly apostrophe with "ve"
+  contraction; clean up empty titles at end.
+1.04 - 2003/03/23 - MAP - lstrip input to deal with extra spaces at
+  beginning of first line; tweaked list loop to handle consecutive lists
+1.1 - 2003/06/06 - MAP - created initial test suite for links and images,
+  and fixed a bunch of related bugs to pass them
+1.11 - 2003/07/20 - CL - don't demoronise unicode strings; handle
+  "they're" properly
+1.12 - 2003/07/23 - GW - print debug messages to stderr; handle bq(cite).
+1.13 - 2003/07/23 - MAP - wrap bq. text in 

...

+2 - 2004/03/26 - RAFA - rewritten from (almost) scratch to include + all features from Textile 2 and a little bit more. +2.0.1 - 2004/04/02 - RAFA - Fixed validating function that uses uTidyLib. +2.0.2 - 2004/04/02 - RAFA - Fixed problem with caps letters in URLs. +2.0.3 - 2004/04/19 - RAFA - Multiple classes are allowed, thanks to Dave + Anderson. The "lang" attribute is now removed from , to be valid + XHTML. Fixed UCAS problem. +2.0.4 - 2004/05/20 - RAFA, CLB - Added inline formatting to table cells. + Curt Bergmann fixed a bug with the colspan formatting. Added Amazon + Associated id. +2.0.5 - 2004/06/01 - CL - Applied patch from Chris Lawrence to (1) fix + that Amazon associates ID was being added to all search URIs, (2) + customize the Amazon site used with the AMAZON variable, and (3) added + an "isbn" URI type that links directly to an Amazon product by ISBN or + Amazon ASIN. +2.0.6 - 2004/06/02 - RAFA - Fixed CAPS problem, again. I hope this is + the last time. +2.0.7 - 2004/06/04 - RAFA, MW - Fixed bullet macro, thanks to Adam + Messinger. Added patch from Michal Wallace changing {}.pop() for + compatibility with Python 2.2.x. +2.0.8 - 2004/06/25 - RAFA - Strip tags when adding the content from a + footnote to the reference link. Escaped '<' and '>' in the self- + generated documentation. +2.0.9 - 2004/10/04 - RAFA - In images, if ALT is not defined, add an + empty attribute. Added "LaTeX" style open/close quotes. Fixed a bug + where the acronym definition was being formatted with inline rules. + Handle "broken" lines correctly, removing the
from inside + split HTML tags. +2.0.10 - 2004/10/06 - RAFA, LO - Escape all non-escaped ampersands. + Applied "trivial patch" from Ludvig Omholt to remove newline right + after the
 tag.
+"""
+
+# Set your encoding here.
+ENCODING = 'utf-8'
+
+# Output? Non-ASCII characters will be automatically
+# converted to XML entities if you choose ASCII.
+OUTPUT = 'utf-8'
+
+# PyTextile can optionally validate the generated
+# XHTML code. We can use either mxTidy or uTidyLib.
+# You can change the default behaviour here.
+VALIDATE = 0
+
+# If you want h1. to be translated to something other
+# than 

, change this offset. You can also pass it +# as an argument to textile(). +HEAD_OFFSET = 0 + +# If you want to use itex2mml, specify the full path +# to the binary here. You can download it from here: +# http://golem.ph.utexas.edu/~distler/blog/files/itexToMML.tar.gz +itex2mml = None +#itex2mml = '/usr/local/bin/itex2MML' +#itex2mml = '/usr/people/almeida/bin/itex2MML' + +# PyTextile can optionally sanitize the generated XHTML, +# which is good for weblog comments or if you don't trust +# yourself. +SANITIZE = 1 + +# Turn debug on? +DEBUGLEVEL = 0 + +# Amazon associate for links: "keywords":amazon +# If you don't have one, please consider leaving mine here as +# a small compensation for writing PyTextile. It's commented +# off as default. +#amazon_associate_id = 'bomtempo-21' +amazon_associate_id = None + +#AMAZON = 'www.amazon.co.uk' +AMAZON = 'www.amazon.com' + +import re +import sys +import os +import sgmllib +import unicodedata + + +def _in_tag(text, tag): + """Extracts text from inside a tag. + + This function extracts the text from inside a given tag. + It's useful to get the text between or +
 when using the validators or the colorizer.
+    """
+    if text.count('<%s' % tag):
+        text = text.split('<%s' % tag, 1)[1]
+        if text.count('>'):
+            text = text.split('>', 1)[1]
+    if text.count('

from input. + code = _in_tag(code_out.getvalue(), 'pre') + + # Fix newlines. + code = code.replace('\n', '\n') + + return code + +except ImportError: + htmlizer = None + + +# PyTextile can optionally validate the generated +# XHTML code using either mxTidy or uTidyLib. +try: + # This is mxTidy. + from mx.Tidy import Tidy + + def _tidy1(text): + """mxTidy's XHTML validator. + + This function is a wrapper to mxTidy's validator. + """ + nerrors, nwarnings, text, errortext = Tidy.tidy(text, output_xhtml=1, numeric_entities=1, wrap=0) + return _in_tag(text, 'body') + + _tidy = _tidy1 + +except ImportError: + try: + # This is uTidyLib. + import tidy + + def _tidy2(text): + """uTidyLib's XHTML validator. + + This function is a wrapper to uTidyLib's validator. + """ + text = tidy.parseString(text, output_xhtml=1, add_xml_decl=0, indent=0, tidy_mark=0) + return _in_tag(str(text), 'body') + + _tidy = _tidy2 + + except ImportError: + _tidy = None + + +# This is good for debugging. +def _debug(s, level=1): + """Outputs debug information to sys.stderr. + + This function outputs debug information if DEBUGLEVEL is + higher than a given treshold. + """ + if DEBUGLEVEL >= level: print >> sys.stderr, s + + +############################# +# Useful regular expressions. +parameters = { + # Horizontal alignment. + 'align': r'''(?:(?:<>|[<>=]) # Either '<>', '<', '>' or '=' + (?![^\s]*(?:<>|[<>=]))) # Look-ahead to ensure it happens once + ''', + + # Horizontal padding. + 'padding': r'''(?:[\(\)]+) # Any number of '(' and/or ')' + ''', + + # Class and/or id. + 'classid': r'''( # + (?:\(\#[\w]+\)) # (#id) + | # + (?:\((?:[\w]+(?:\s[\w]+)*) # + (?:\#[\w]+)?\)) # (class1 class2 ... classn#id) or (class1 class2 ... classn) + ) # + (?![^\s]*(?:\([\w#]+\))) # must happen once + ''', + + # Language. + 'lang': r'''(?:\[[\w-]+\]) # [lang] + (?![^\s]*(?:\[.*?\])) # must happen once + ''', + + # Style. + 'style': r'''(?:{[^\}]+}) # {style} + (?![^\s]*(?:{.*?})) # must happen once + ''', +} + +res = { + # Punctuation. + 'punct': r'''[\!"#\$%&'()\*\+,\-\./:;<=>\?@\[\\\]\^_`{\|}\~]''', + + # URL regular expression. + 'url': r'''(?=[a-zA-Z0-9./#]) # Must start correctly + (?: # Match the leading part (proto://hostname, or just hostname) + (?:ftp|https?|telnet|nntp) # protocol + :// # :// + (?: # Optional 'username:password@' + \w+ # username + (?::\w+)? # optional :password + @ # @ + )? # + [-\w]+(?:\.\w[-\w]*)+ # hostname (sub.example.com) + | # + (?:mailto:)? # Optional mailto: + [-\+\w]+ # username + \@ # at + [-\w]+(?:\.\w[-\w]*)+ # hostname + | # + (?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\.)+ # domain without protocol + (?:com\b # TLD + | edu\b # + | biz\b # + | gov\b # + | in(?:t|fo)\b # .int or .info + | mil\b # + | net\b # + | org\b # + | museum\b # + | aero\b # + | coop\b # + | name\b # + | pro\b # + | [a-z][a-z]\b # two-letter country codes + ) # + )? # + (?::\d+)? # Optional port number + (?: # Rest of the URL, optional + /? # Start with '/' + [^.!,?;:"'<>()\[\]{}\s\x7F-\xFF]* # Can't start with these + (?: # + [.!,?;:]+ # One or more of these + [^.!,?;:"'<>()\[\]{}\s\x7F-\xFF]+ # Can't finish with these + #'" # # or ' or " + )* # + )? # + ''', + + + # Block attributes. + 'battr': r'''(?P # + (?: %(align)s # alignment + | %(classid)s # class and/or id + | %(padding)s # padding tags + | %(lang)s # [lang] + | %(style)s # {style} + )+ # + )? # + ''' % parameters, + + # (Un)ordered list attributes. + 'olattr': r'''(?P # + (?: %(align)s # alignment + | ((?:\(\#[\w]+\)) # (#id) + | # + (?:\((?:[\w]+(?:\s[\w]+)*) # + (?:\#[\w]+)?\)) # (class1 class2 ... classn#id) or (class1 class2 ... classn) + ) # + | %(padding)s # padding tags + | %(lang)s # [lang] + | %(style)s # {style} + )+ # + )? # + ''' % parameters, + + # List item attributes. + 'liattr': r'''(?P # + (?: %(align)s # alignment + | %(classid)s # class and/or id + | %(padding)s # padding tags + | %(lang)s # [lang] + | %(style)s # {style} + )+ # + )? # + ''' % parameters, + + # Qtag attributes. + 'qattr': r'''(?P # + (?: %(classid)s # class and/or id + | %(lang)s # [lang] + | %(style)s # {style} + )+ # + )? # + ''' % parameters, + + # Link attributes. + 'lattr': r'''(?P # Links attributes + (?: %(align)s # alignment + | %(classid)s # class and/or id + | %(lang)s # [lang] + | %(style)s # {style} + )+ # + )? # + ''' % parameters, + + # Image attributes. + 'iattr': r'''(?P # + (?: # + (?: [<>]+ # horizontal alignment tags + (?![^\s]*(?:[<>]))) # (must happen once) + | # + (?: [\-\^~]+ # vertical alignment tags + (?![^\s]*(?:[\-\^~]))) # (must happen once) + | %(classid)s # class and/or id + | %(padding)s # padding tags + | %(style)s # {style} + )+ # + )? # + ''' % parameters, + + # Resize attributes. + 'resize': r'''(?: # + (?:([\d]+%?)x([\d]+%?)) # 20x10 + | # + (?: # or + (?:([\d]+)%?w\s([\d]+)%?h) # 10h 20w + | # or + (?:([\d]+)%?h\s([\d]+)%?w) # 20w 10h + ) # + )? # + ''', + + # Table attributes. + 'tattr': r'''(?P # + (?: # + (?: [\^~] # vertical alignment + (?![^\s]*(?:[\^~]))) # (must happen once) + | %(align)s # alignment + | %(lang)s # [lang] + | %(style)s # {style} + | %(classid)s # class and/or id + | %(padding)s # padding + | _ # is this a header row/cell? + | \\\d+ # colspan + | /\d+ # rowspan + )+ # + )? # + ''' % parameters, +} + + +def preg_replace(pattern, replacement, text): + """Alternative re.sub that handles empty groups. + + This acts like re.sub, except it replaces empty groups with '' + instead of raising an exception. + """ + + def replacement_func(matchobj): + counter = 1 + rc = replacement + _debug(matchobj.groups()) + for matchitem in matchobj.groups(): + if not matchitem: + matchitem = '' + + rc = rc.replace(r'\%s' % counter, matchitem) + counter += 1 + + return rc + + p = re.compile(pattern) + _debug(pattern) + + return p.sub(replacement_func, text) + + +def html_replace(pattern, replacement, text): + """Replacement outside HTML tags. + + Does a preg_replace only outside HTML tags. + """ + # If there is no html, do a simple search and replace. + if not re.search(r'''<.*>''', text): + return preg_replace(pattern, replacement, text) + + else: + lines = [] + # Else split the text into an array at <>. + for line in re.split('(<.*?>)', text): + if not re.match('<.*?>', line): + line = preg_replace(pattern, replacement, line) + + lines.append(line) + + return ''.join(lines) + + +# PyTextile can optionally sanitize the generated XHTML, +# which is good for weblog comments. This code is from +# Mark Pilgrim's feedparser. +class _BaseHTMLProcessor(sgmllib.SGMLParser): + elements_no_end_tag = ['area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', + 'img', 'input', 'isindex', 'link', 'meta', 'param'] + + def __init__(self): + sgmllib.SGMLParser.__init__(self) + + def reset(self): + self.pieces = [] + sgmllib.SGMLParser.reset(self) + + def normalize_attrs(self, attrs): + # utility method to be called by descendants + attrs = [(k.lower(), sgmllib.charref.sub(lambda m: unichr(int(m.groups()[0])), v).strip()) for k, v in attrs] + attrs = [(k, k in ('rel', 'type') and v.lower() or v) for k, v in attrs] + return attrs + + def unknown_starttag(self, tag, attrs): + # called for each start tag + # attrs is a list of (attr, value) tuples + # e.g. for
, tag="pre", attrs=[("class", "screen")]
+        strattrs = "".join([' %s="%s"' % (key, value) for key, value in attrs])
+        if tag in self.elements_no_end_tag:
+            self.pieces.append("<%(tag)s%(strattrs)s />" % locals())
+        else:
+            self.pieces.append("<%(tag)s%(strattrs)s>" % locals())
+        
+    def unknown_endtag(self, tag):
+        # called for each end tag, e.g. for 
, tag will be "pre" + # Reconstruct the original end tag. + if tag not in self.elements_no_end_tag: + self.pieces.append("" % locals()) + + def handle_charref(self, ref): + # called for each character reference, e.g. for " ", ref will be "160" + # Reconstruct the original character reference. + self.pieces.append("&#%(ref)s;" % locals()) + + def handle_entityref(self, ref): + # called for each entity reference, e.g. for "©", ref will be "copy" + # Reconstruct the original entity reference. + self.pieces.append("&%(ref)s;" % locals()) + + def handle_data(self, text): + # called for each block of plain text, i.e. outside of any tag and + # not containing any character or entity references + # Store the original text verbatim. + self.pieces.append(text) + + def handle_comment(self, text): + # called for each HTML comment, e.g. + # Reconstruct the original comment. + self.pieces.append("" % locals()) + + def handle_pi(self, text): + # called for each processing instruction, e.g. + # Reconstruct original processing instruction. + self.pieces.append("" % locals()) + + def handle_decl(self, text): + # called for the DOCTYPE, if present, e.g. + # + # Reconstruct original DOCTYPE + self.pieces.append("" % locals()) + + def output(self): + """Return processed HTML as a single string""" + return "".join(self.pieces) + + +class _HTMLSanitizer(_BaseHTMLProcessor): + acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area', 'b', 'big', + 'blockquote', 'br', 'button', 'caption', 'center', 'cite', 'code', 'col', + 'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'fieldset', + 'font', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'input', + 'ins', 'kbd', 'label', 'legend', 'li', 'map', 'menu', 'ol', 'optgroup', + 'option', 'p', 'pre', 'q', 's', 'samp', 'select', 'small', 'span', 'strike', + 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', + 'thead', 'tr', 'tt', 'u', 'ul', 'var'] + + acceptable_attributes = ['abbr', 'accept', 'accept-charset', 'accesskey', + 'action', 'align', 'alt', 'axis', 'border', 'cellpadding', 'cellspacing', + 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'clear', 'cols', + 'colspan', 'color', 'compact', 'coords', 'datetime', 'dir', 'disabled', + 'enctype', 'for', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', + 'id', 'ismap', 'label', 'lang', 'longdesc', 'maxlength', 'media', 'method', + 'multiple', 'name', 'nohref', 'noshade', 'nowrap', 'prompt', 'readonly', + 'rel', 'rev', 'rows', 'rowspan', 'rules', 'scope', 'selected', 'shape', 'size', + 'span', 'src', 'start', 'summary', 'tabindex', 'target', 'title', 'type', + 'usemap', 'valign', 'value', 'vspace', 'width'] + + unacceptable_elements_with_end_tag = ['script', 'applet'] + + # This if for MathML. + mathml_elements = ['math', 'mi', 'mn', 'mo', 'mrow', 'msup'] + mathml_attributes = ['mode', 'xmlns'] + + acceptable_elements = acceptable_elements + mathml_elements + acceptable_attributes = acceptable_attributes + mathml_attributes + + def reset(self): + _BaseHTMLProcessor.reset(self) + self.unacceptablestack = 0 + + def unknown_starttag(self, tag, attrs): + if not tag in self.acceptable_elements: + if tag in self.unacceptable_elements_with_end_tag: + self.unacceptablestack += 1 + return + attrs = self.normalize_attrs(attrs) + attrs = [(key, value) for key, value in attrs if key in self.acceptable_attributes] + _BaseHTMLProcessor.unknown_starttag(self, tag, attrs) + + def unknown_endtag(self, tag): + if not tag in self.acceptable_elements: + if tag in self.unacceptable_elements_with_end_tag: + self.unacceptablestack -= 1 + return + _BaseHTMLProcessor.unknown_endtag(self, tag) + + def handle_pi(self, text): + pass + + def handle_decl(self, text): + pass + + def handle_data(self, text): + if not self.unacceptablestack: + _BaseHTMLProcessor.handle_data(self, text) + + +class Textiler: + """Textile formatter. + + This is the base class for the PyTextile text processor. + """ + def __init__(self, text=''): + """Instantiate the class, passing the text to be formatted. + + Here we pre-process the text and collect all the link + lookups for later. + """ + self.text = text + + # Basic regular expressions. + self.res = res + + # Smart searches. + self.searches = {} + self.searches['imdb'] = 'http://www.imdb.com/Find?for=%s' + self.searches['google'] = 'http://www.google.com/search?q=%s' + self.searches['python'] = 'http://www.python.org/doc/current/lib/module-%s.html' + if amazon_associate_id: + self.searches['isbn'] = ''.join(['http://', AMAZON, '/exec/obidos/ASIN/%s/', amazon_associate_id]) + self.searches['amazon'] = ''.join(['http://', AMAZON, '/exec/obidos/external-search?mode=blended&keyword=%s&tag=', amazon_associate_id]) + else: + self.searches['isbn'] = ''.join(['http://', AMAZON, '/exec/obidos/ASIN/%s']) + self.searches['amazon'] = ''.join(['http://', AMAZON, '/exec/obidos/external-search?mode=blended&keyword=%s']) + + # These are the blocks we know. + self.signatures = [ + # Paragraph. + (r'''^p # Paragraph signature + %(battr)s # Paragraph attributes + (?P\.) # . + (?P\.)? # Extended paragraph denoted by a second dot + \s # whitespace + (?P.*) # text + ''' % self.res, self.paragraph), + + # Pre-formatted text. + (r'''^pre # Pre signature + %(battr)s # Pre attributes + (?P\.) # . + (?P\.)? # Extended pre denoted by a second dot + \s # whitespace + (?P.*) # text + ''' % self.res, self.pre), + + # Block code. + (r'''^bc # Blockcode signature + %(battr)s # Blockcode attributes + (?P\.) # . + (?P\.)? # Extended blockcode denoted by a second dot + \s # whitespace + (?P.*) # text + ''' % self.res, self.bc), + + # Blockquote. + (r'''^bq # Blockquote signature + %(battr)s # Blockquote attributes + (?P\.) # . + (?P\.)? # Extended blockquote denoted by a second dot + (:(?P # Optional cite attribute + ( # + %(url)s # URL + | "[\w]+(?:\s[\w]+)*" # "Name inside quotes" + )) # + )? # + \s # whitespace + (?P.*) # text + ''' % self.res, self.blockquote), + + # Header. + (r'''^h # Header signature + (?P
\d) # Header number + %(battr)s # Header attributes + (?P\.) # . + (?P\.)? # Extended header denoted by a second dot + \s # whitespace + (?P.*) # text + ''' % self.res, self.header), + + # Footnote. + (r'''^fn # Footnote signature + (?P[\d]+) # Footnote number + (?P\.) # . + (?P\.)? # Extended footnote denoted by a second dot + \s # whitespace + (?P.*) # text + ''', self.footnote), + + # Definition list. + (r'''^dl # Definition list signature + %(battr)s # Definition list attributes + (?P\.) # . + (?P\.)? # Extended definition list denoted by a second dot + \s # whitespace + (?P.*) # text + ''' % self.res, self.dl), + + # Ordered list (attributes to first
  • ). + (r'''^%(olattr)s # Ordered list attributes + \# # Ordered list signature + %(liattr)s # List item attributes + (?P\.)? # . + \s # whitespace + (?P.*) # text + ''' % self.res, self.ol), + + # Unordered list (attributes to first
  • ). + (r'''^%(olattr)s # Unrdered list attributes + \* # Unordered list signature + %(liattr)s # Unordered list attributes + (?P\.)? # . + \s # whitespace + (?P.*) # text + ''' % self.res, self.ul), + + # Escaped text. + (r'''^==?(?P.*?)(==)?$ # Escaped text + ''', self.escape), + + (r'''^(?P<.*)$ # XHTML tag + ''', self.escape), + + # itex code. + (r'''^(?P # itex code + \\\[ # starts with \[ + .*? # complicated mathematical equations go here + \\\]) # ends with \] + ''', self.itex), + + # Tables. + (r'''^table # Table signature + %(tattr)s # Table attributes + (?P\.) # . + (?P\.)? # Extended blockcode denoted by a second dot + \s # whitespace + (?P.*) # text + ''' % self.res, self.table), + + # Simple tables. + (r'''^(?P + \| + .*) + ''', self.table), + + # About. + (r'''^(?Ptell\sme\sabout\stextile\.)$''', self.about), + ] + + + def protectPre(self, text): + regexps = re.compile(r'''^
    ?(?P.*?)
    ?$''', re.VERBOSE | re.DOTALL | re.M) + counter = 0 + self.protectedPres = [] + + for item in regexps.findall(text): + text = text.replace(item, "[[[[[REPL%s]]]]]" % counter, 1) + self.protectedPres.append(item) + counter += 1 + + #if len(self.protectedPres) > 0: + # print ">>>> PREPROCESSED: %s items" % len(self.protectedPres) + + return text + + + def preprocess(self): + """Pre-processing of the text. + + Remove whitespace, fix carriage returns. + """ + # Remove whitespace. + self.text = self.text.strip() + + # Zap carriage returns. + self.text = self.text.replace("\r\n", "\n") + self.text = self.text.replace("\r", "\n") + + # Protect existing pre blocks + self.text = self.protectPre(self.text) + + # Minor sanitizing. + self.text = self.sanitize(self.text) + + + def postprocess(self, text): + counter = 0 + + #if len(self.protectedPres) > 0: + # print ">>>> POSTPROCESS: %s items" % len(self.protectedPres) + + for entry in self.protectedPres: + text = text.replace("[[[[[REPL%s]]]]]" % counter, entry, 1) + counter += 1 + + return text + + + def grab_links(self): + """Grab link lookups. + + Check the text for link lookups, store them in a + dictionary, and clean them up. + """ + # Grab links like this: '[id]example.com' + links = {} + p = re.compile(r'''(?:^|\n)\[([\w]+?)\](%(url)s)(?:$|\n)''' % self.res, re.VERBOSE) + for key, link in p.findall(self.text): + links[key] = link + + # And clear them from the text. + self.text = p.sub('', self.text) + + return links + + + def process(self, head_offset=HEAD_OFFSET, validate=VALIDATE, sanitize=SANITIZE, output=OUTPUT, encoding=ENCODING): + """Process the text. + + Here we actually process the text, splitting the text in + blocks and applying the corresponding function to each + one of them. + """ + # Basic global changes. + self.preprocess() + + # Grab lookup links and clean them from the text. + self._links = self.grab_links() + + # Offset for the headers. + self.head_offset = head_offset + + # Process each block. + self.blocks = self.split_text() + + text = [] + for [function, captures] in self.blocks: + text.append(function(**captures)) + + text = '\n\n'.join(text) + + # Add titles to footnotes. + text = self.footnotes(text) + + # Convert to desired output. + text = unicode(text, encoding) + text = text.encode(output, 'xmlcharrefreplace') + + # Postprocess + text = self.postprocess(text) + + # Sanitize? + if sanitize: + p = _HTMLSanitizer() + p.feed(text) + text = p.output() + + # Validate output. + if _tidy and validate: + text = _tidy(text) + + return text + + + def sanitize(self, text): + """Fix single tags. + + Fix tags like ,
    and
    . + + --- + h1. Sanitizing + + Textile can help you generate valid XHTML(eXtensible HyperText Markup Language). + It will fix any single tags that are not properly closed, like + @@, @
    @ and @
    @. + + If you have "mx.Tidy":http://www.egenix.com/files/python/mxTidy.html + and/or "µTidyLib":http://utidylib.sourceforge.net/ installed, + it also can optionally validade the generated code with these wrappers + to ensure 100% valid XHTML(eXtensible HyperText Markup Language). + """ + # Fix single tags like and
    . + text = preg_replace(r'''<(img|br|hr)(.*?)(?:\s*/?\s*)?>''', r'''<\1\2 />''', text) + + # Remove ampersands. + text = preg_replace(r'''&(?!#?[xX]?(?:[0-9a-fA-F]+|\w{1,8});)''', r'''&''', text) + + return text + + + def split_text(self): + """Process the blocks from the text. + + Split the blocks according to the signatures, join extended + blocks and associate each one of them with a function to + process them. + + --- + h1. Blocks + + Textile process your text by dividing it in blocks. Each block + is identified by a signature and separated from other blocks by + an empty line. + + All signatures should end with a period followed by a space. A + header @

    @ can be done this way: + + pre. h1. This is a header 1. + + Blocks may continue for multiple paragraphs of text. If you want + a block signature to stay "active", use two periods after the + signature instead of one. For example: + + pre.. bq.. This is paragraph one of a block quote. + + This is paragraph two of a block quote. + + =p. Now we're back to a regular paragraph. + + p. Becomes: + + pre..
    +

    This is paragraph one of a block quote.

    + +

    This is paragraph two of a block quote.

    +
    + +

    Now we’re back to a regular paragraph.

    + + p. The blocks can be customised by adding parameters between the + signature and the period. These include: + + dl. {style rule}:A CSS(Cascading Style Sheets) style rule. + [ll]:A language identifier (for a "lang" attribute). + (class) or (#id) or (class#id):For CSS(Cascading Style Sheets) class and id attributes. + >, <, =, <>:Modifier characters for alignment. Right-justification, left-justification, centered, and full-justification. The paragraph will also receive the class names "right", "left", "center" and "justify", respectively. + ( (one or more):Adds padding on the left. 1em per "(" character is applied. When combined with the align-left or align-right modifier, it makes the block float. + ) (one or more):Adds padding on the right. 1em per ")" character is applied. When combined with the align-left or align-right modifier, it makes the block float. + + Here's an overloaded example: + + pre. p(())>(class#id)[en]{color:red}. A simple paragraph. + + Becomes: + + pre.

    A simple paragraph.

    + """ + # Clear signature. + clear_sig = r'''^clear(?P[<>])?\.$''' + clear = None + + extending = 0 + + + + # We capture the \n's because they are important inside "pre..". + blocks = re.split(r'''((\n\s*){2,})''', self.text) + output = [] + for block in blocks: + # Check for the clear signature. + m = re.match(clear_sig, block) + if m: + clear = m.group('alignment') + if clear: + clear = {'<': 'clear:left;', '>': 'clear:right;'}[clear] + else: + clear = 'clear:both;' + + else: + # Check each of the code signatures. + for regexp, function in self.signatures: + p = re.compile(regexp, (re.VERBOSE | re.DOTALL)) + m = p.match(block) + if m: + # Put everything in a dictionary. + captures = m.groupdict() + + # If we are extending a block, we require a dot to + # break it, so we can start lines with '#' inside + # an extended
     without matching an ordered list.
    +                        if extending and not captures.get('dot', None):
    +                            output[-1][1]['text'] += block
    +                            break 
    +                        elif captures.has_key('dot'):
    +                            del captures['dot']
    +                            
    +                        # If a signature matches, we are not extending a block.
    +                        extending = 0
    +
    +                        # Check if we should extend this block.
    +                        if captures.has_key('extend'):
    +                            extending = captures['extend']
    +                            del captures['extend']
    +                            
    +                        # Apply head_offset.
    +                        if captures.has_key('header'):
    +                            captures['header'] = int(captures['header']) + self.head_offset
    +
    +                        # Apply clear.
    +                        if clear:
    +                            captures['clear'] = clear
    +                            clear = None
    +
    +                        # Save the block to be processed later.
    +                        output.append([function, captures])
    +
    +                        break
    +
    +                else:
    +                    if extending:
    +                        # Append the text to the last block.
    +                        output[-1][1]['text'] += block
    +                    elif block.strip():
    +                        output.append([self.paragraph, {'text': block}])
    +    
    +        return output
    +
    +
    +    def parse_params(self, parameters, clear=None, align_type='block'):
    +        """Parse the parameters from a block signature.
    +
    +        This function parses the parameters from a block signature,
    +        splitting the information about class, id, language and
    +        style. The positioning (indentation and alignment) is parsed
    +        and stored in the style.
    +
    +        A paragraph like:
    +
    +            p>(class#id){color:red}[en]. Paragraph.
    +
    +        or:
    +            
    +            p{color:red}[en](class#id)>. Paragraph.
    +
    +        will have its parameters parsed to:
    +
    +            output = {'lang' : 'en',
    +                      'class': 'class',
    +                      'id'   : 'id',
    +                      'style': 'color:red;text-align:right;'}
    +
    +        Note that order is not important.
    +        """
    +        if not parameters:
    +            if clear:
    +                return {'style': clear}
    +            else:
    +                return {}
    +
    +        output = {}
    +        
    +        # Match class from (class) or (class#id).
    +        m = re.search(r'''\((?P[\w]+(\s[\w]+)*)(\#[\w]+)?\)''', parameters)
    +        if m: output['class'] = m.group('class')
    +
    +        # Match id from (#id) or (class#id).
    +        m = re.search(r'''\([\w]*(\s[\w]+)*\#(?P[\w]+)\)''', parameters)
    +        if m: output['id'] = m.group('id')
    +
    +        # Match [language].
    +        m = re.search(r'''\[(?P[\w-]+)\]''', parameters)
    +        if m: output['lang'] = m.group('lang')
    +
    +        # Match {style}.
    +        m = re.search(r'''{(?P