diff options
Diffstat (limited to 'webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool')
96 files changed, 19772 insertions, 0 deletions
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="<!-- qooxdoo-script-block -->", 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 = "<?xml version=\"1.0\" encoding=\"" + options.xmlOutputEncoding + "\"?>\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 = "<?xml version=\"1.0\" encoding=\"" + options.xmlOutputEncoding + "\"?>\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 += '<script type="text/javascript">%s</script>' % 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 += '<script type="text/javascript" src="%s%s"></script>' % (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 += "(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\\\"\\'])%s\\.png([\\\"\\'])=\\1%s.png\\2\n" % (qx, qx_to_tango_map[qx]) + return re + + +def get_migration_info(qx_to_tango_map, qx_not_in_tango, qx_in_tango_without_image, qx_icon_path, tango_icon_path): + re = "" + for qx in qx_not_in_tango: + re += "(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status) [/\\\"\\']%s\\.png[\\\"\\']=The image '%s.png' is no longer supported! Try to use a different icon.\n" % (qx, qx) + #re += "[/\\\"\\']%s\\.png[\\\"\\']=The image '%s.png' is no longer supported! Try to use a different icon.\n" % (qx, qx) + + re += "\n" + + for qx in qx_in_tango_without_image: + re += "(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\\\"\\']%s\\.png[\\\"\\']=The image '%s.png' is no longer supported! Try to use a different icon.\n" % (qx, qx) + #re += "\\b%s\\.png[\\\"\\']=The image '%s.png' should be renamed to '%s' but currently no icon for the default icon set exists!\n" % (qx, qx, qx_in_tango_without_image[qx]) + + return re + + +def get_html(qx_to_tango_map, qx_not_in_tango, qx_in_tango_without_image, qx_icon_path, tango_icon_path): + html = """ + <html> + <body> + %s + </body> + </html> + """ + qx_to_tango_table = """ + <h2>qooxdoo to Tango mapping</h2> + <table> + %s + </table> + """ + rows = "" + for qx in qx_to_tango_map: + tango = qx_to_tango_map[qx] + rows += "<tr><td><img src='%s/%s.png'></img>%s</td><td><img src='%s/%s.png'></img>%s</td></tr>\n" % (qx_icon_path, qx, qx, tango_icon_path, tango, tango) + qx_to_tango_table = qx_to_tango_table % rows + + no_tango_icon_table = """ + <h2>qoxxdoo images tango equivalent but no tango icon</h2> + <table> + %s + </table> + """ + rows = "" + keys = qx_in_tango_without_image.keys() + keys.sort() + for qx in keys: + rows += "<tr><td><img src='%s/%s.png'></img>%s</td><td>%s</td></tr>\n" % (qx_icon_path, qx, qx, qx_in_tango_without_image[qx]) + no_tango_icon_table = no_tango_icon_table % rows + + no_tango_list = "<h2>qoxxdoo images without tango equivalent</h2>" + for qx in qx_not_in_tango: + no_tango_list += "<img src='%s/%s.png'></img>%s<br>\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 = <!-- qooxdoo-script-block --> +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="<img style\=\"position:absolute;top:0px;left:"
+\bqx\.ui\.tree\.AbstractTreeElement\.INDENT_CODE_2\b="px\" src\=\""
+\bqx\.ui\.tree\.AbstractTreeElement\.INDENT_CODE_3\b="\" />"
+\bqx\.ui\.tree\.AbstractTreeElement\.IMG_EXTENSION\b="gif"
+\bqx\.ui\.treefullcontrol\.AbstractTreeElement\.INDENT_CODE_1\b="<img style\=\"position:absolute;top:0px;left:"
+\bqx\.ui\.treefullcontrol\.AbstractTreeElement\.INDENT_CODE_2\b="px\" src\=\""
+\bqx\.ui\.treefullcontrol\.AbstractTreeElement\.INDENT_CODE_3\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='<div style\="position:absolute;font-family:\'Segoe UI\', Corbel, Calibri, Tahoma, \'Lucida Sans Unicode\', sans-serif;font-size:11px;left:0px;top:'
+\bqx\.ui\.table\.TablePane\.ARRAY_JOIN_ROW_DIV_WIDTH\b='px;width:'
+\bqx\.ui\.table\.TablePane\.ARRAY_JOIN_ROW_DIV_HEIGHT\b='px;height:'
+\bqx\.ui\.table\.TablePane\.ARRAY_JOIN_ROW_DIV_BG_COLOR\b='px;background-color:'
+\bqx\.ui\.table\.TablePane\.ARRAY_JOIN_ROW_DIV_COLOR\b=';color:'
+\bqx\.ui\.table\.TablePane\.ARRAY_JOIN_ROW_DIV_START_END\b='">'
+\bqx\.ui\.table\.TablePane\.ARRAY_JOIN_ROW_DIV_END\b='</div>'
+
+\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='<table cellspacing\="0" cellpadding\="0" style\="table-layout:fixed;font-family:\'Segoe UI\', Corbel, Calibri, Tahoma, \'Lucida Sans Unicode\', sans-serif;font-size:11px;width:'
+\bqx\.ui\.table\.TablePane\.TABLE_COLGROUP\b='px"><colgroup>'
+\bqx\.ui\.table\.TablePane\.TABLE_COL\b='<col width\="'
+\bqx\.ui\.table\.TablePane\.TABLE_COLEND\b='"/>'
+\bqx\.ui\.table\.TablePane\.TABLE_TBODY\b='</colgroup><tbody>'
+\bqx\.ui\.table\.TablePane\.TABLE_TR\b='<tr style\="height:'
+\bqx\.ui\.table\.TablePane\.TABLE_BGCOLOR\b='px;background-color:'
+\bqx\.ui\.table\.TablePane\.TABLE_TR_END\b='</tr>'
+\bqx\.ui\.table\.TablePane\.TABLE_TBODY_END\b='</tbody></table>'
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/11-embed.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/11-embed.dat new file mode 100644 index 0000000000..bc740fc9fd --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.3/patches/11-embed.dat @@ -0,0 +1,8 @@ +\bqx\.ui\.embed\.IconHtmlEmbed\.START_IMAGE\b="<img src\=\""
+\bqx\.ui\.embed\.IconHtmlEmbed\.START_STYLE\b="\" style\=\"vertical-align:middle;"
+\bqx\.ui\.embed\.IconHtmlEmbed\.STYLE_MARGIN\b="margin-right:"
+\bqx\.ui\.embed\.IconHtmlEmbed\.STYLE_WIDTH\b="width:"
+\bqx\.ui\.embed\.IconHtmlEmbed\.STYLE_HEIGHT\b="height:"
+\bqx\.ui\.embed\.IconHtmlEmbed\.PIXEL_UNIT\b="px;"
+\bqx\.ui\.embed\.IconHtmlEmbed\.FILTER_START\b="filter:"
+\bqx\.ui\.embed\.IconHtmlEmbed\.STOP_IMAGE\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="(<span style\=\"text-decoration:underline\">"
+\bqx\.ui\.basic\.Label\.MNEMONIC_OUT_STOP\b="</span>)"
+\bqx\.ui\.basic\.Label\.MNEMONIC_IN_START\b="<span style\=\"text-decoration:underline\">"
+\bqx\.ui\.basic\.Label\.MNEMONIC_IN_STOP\b="</span>"
+\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="<br/>"
+\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 @@ +(?<!type = )(?<!type=)[\"\']text\/javascript[\"\']=Better use qx.util.Mime.JAVASCRIPT (Please ignore for <script> 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 @@ +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]bell\.png[\"\'\)]=The image 'bell.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]bitmapgraphics\.png[\"\'\)]=The image 'bitmapgraphics.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]bookmark-toolbar\.png[\"\'\)]=The image 'bookmark-toolbar.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]bookmark\.png[\"\'\)]=The image 'bookmark.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]bug\.png[\"\'\)]=The image 'bug.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]cache\.png[\"\'\)]=The image 'cache.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]char-device\.png[\"\'\)]=The image 'char-device.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]chart\.png[\"\'\)]=The image 'chart.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]color-fill\.png[\"\'\)]=The image 'color-fill.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]color-line\.png[\"\'\)]=The image 'color-line.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]connect-creating\.png[\"\'\)]=The image 'connect-creating.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]connect-established\.png[\"\'\)]=The image 'connect-established.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]cookie\.png[\"\'\)]=The image 'cookie.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]core\.png[\"\'\)]=The image 'core.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]energy\.png[\"\'\)]=The image 'energy.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]flowchart\.png[\"\'\)]=The image 'flowchart.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]folder-important\.png[\"\'\)]=The image 'folder-important.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mime-manual\.png[\"\'\)]=The image 'mime-manual.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mime-rpm\.png[\"\'\)]=The image 'mime-rpm.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]no\.png[\"\'\)]=The image 'no.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]notify\.png[\"\'\)]=The image 'notify.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]paint\.png[\"\'\)]=The image 'paint.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]partitions\.png[\"\'\)]=The image 'partitions.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]pda\.png[\"\'\)]=The image 'pda.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]pipe\.png[\"\'\)]=The image 'pipe.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]presentation\.png[\"\'\)]=The image 'presentation.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]queue\.png[\"\'\)]=The image 'queue.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]signature\.png[\"\'\)]=The image 'signature.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]style\.png[\"\'\)]=The image 'style.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]tab-duplicate\.png[\"\'\)]=The image 'tab-duplicate.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]tab-new-raised\.png[\"\'\)]=The image 'tab-new-raised.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]tab-new\.png[\"\'\)]=The image 'tab-new.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]tab-remove\.png[\"\'\)]=The image 'tab-remove.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]view-bottom\.png[\"\'\)]=The image 'view-bottom.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]view-choose\.png[\"\'\)]=The image 'view-choose.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]view-left-right\.png[\"\'\)]=The image 'view-left-right.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]view-right\.png[\"\'\)]=The image 'view-right.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]view-sidetree\.png[\"\'\)]=The image 'view-sidetree.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]view-top-bottom\.png[\"\'\)]=The image 'view-top-bottom.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]wizard\.png[\"\'\)]=The image 'wizard.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]wordprocessor\.png[\"\'\)]=The image 'wordprocessor.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]control-center\.png[\"\'\)]=The image 'control-center.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]locale\.png[\"\'\)]=The image 'locale.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]folder-locked\.png[\"\'\)]=The image 'folder-locked.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]misc\.png[\"\'\)]=The image 'misc.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mail-forward\.png[\"\'\)]=The image 'mail-forward.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]toys\.png[\"\'\)]=The image 'toys.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mime-document\.png[\"\'\)]=The image 'mime-document.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mail-send\.png[\"\'\)]=The image 'mail-send.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mail-get\.png[\"\'\)]=The image 'mail-get.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]icons\.png[\"\'\)]=The image 'icons.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mail-delete\.png[\"\'\)]=The image 'mail-delete.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]bookmark-folder\.png[\"\'\)]=The image 'bookmark-folder.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]attach\.png[\"\'\)]=The image 'attach.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]memory\.png[\"\'\)]=The image 'memory.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mail-find\.png[\"\'\)]=The image 'mail-find.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]keyboard-layout\.png[\"\'\)]=The image 'keyboard-layout.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]exec\.png[\"\'\)]=The image 'exec.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]iconthemes\.png[\"\'\)]=The image 'iconthemes.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]important\.png[\"\'\)]=The image 'important.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]connect-no\.png[\"\'\)]=The image 'connect-no.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mail-reply-all\.png[\"\'\)]=The image 'mail-reply-all.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mail-reply\.png[\"\'\)]=The image 'mail-reply.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]info\.png[\"\'\)]=The image 'info.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mime-card\.png[\"\'\)]=The image 'mime-card.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]rotate\.png[\"\'\)]=The image 'rotate.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]tablet\.png[\"\'\)]=The image 'tablet.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]opera\.png[\"\'\)]=The image 'opera.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]email\.png[\"\'\)]=The image 'email.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]mail-new\.png[\"\'\)]=The image 'mail-new.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]joystick\.png[\"\'\)]=The image 'joystick.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]modem\.png[\"\'\)]=The image 'modem.png' is no longer supported! Try to use a different icon. +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)[/\"\'\(]folder-favorite\.png[\"\'\)]=The image 'folder-favorite.png' is no longer supported! Try to use a different icon. diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/01-locale.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/01-locale.dat new file mode 100644 index 0000000000..d7a06cf835 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/01-locale.dat @@ -0,0 +1,2 @@ +\bqx\.locale\.Number\.getDecimalSeperator\b=qx.locale.Number.getDecimalSeparator +\bqx\.locale\.Number\.getGroupSeperator\b=qx.locale.Number.getGroupSeparator diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/02-spinner.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/02-spinner.dat new file mode 100644 index 0000000000..45afa1dc63 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/02-spinner.dat @@ -0,0 +1,8 @@ +\bqx\.setComputedIncrementAmount\b=.setIncrementAmount +\bqx\.getComputedIncrementAmount\b=.getIncrementAmount + +\bqx\.setWheelComputedIncrementAmount\b=.setWheelIncrementAmount +\bqx\.getWheelComputedIncrementAmount\b=.getWheelIncrementAmount + +\bqx\.setPageComputedIncrementAmount\b=.setPageIncrementAmount +\bqx\.getPageComputedIncrementAmount\b=.getPageIncrementAmount diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/03-api.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/03-api.dat new file mode 100644 index 0000000000..b2a33f7441 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/03-api.dat @@ -0,0 +1,22 @@ +@param\s+([a-zA-Z0-9_\$]+)\s*\((.*?)\)=@param \1 {\2}
+@return\s+\((.*?)\)=@return {\1}
+
+@return\s+{string=@return {String
+@return\s+{float=@return {Float
+@return\s+{int=@return {Integer
+@return\s+{integer=@return {Integer
+@return\s+{boolean=@return {Boolean
+@return\s+{float=@return {Float
+@return\s+{double=@return {Double
+@return\s+{object=@return {Object
+@return\s+{map=@return {Map
+
+@param\s+([a-zA-Z0-9_$]+)\s+{string=@param \1 {String
+@param\s+([a-zA-Z0-9_$]+)\s+{float=@param \1 {Float
+@param\s+([a-zA-Z0-9_$]+)\s+{int=@param \1 {Integer
+@param\s+([a-zA-Z0-9_$]+)\s+{integer=@param \1 {Integer
+@param\s+([a-zA-Z0-9_$]+)\s+{boolean=@param \1 {Boolean
+@param\s+([a-zA-Z0-9_$]+)\s+{float=@param \1 {Float
+@param\s+([a-zA-Z0-9_$]+)\s+{double=@param \1 {Double
+@param\s+([a-zA-Z0-9_$]+)\s+{object=@param \1 {Object
+@param\s+([a-zA-Z0-9_$]+)\s+{map=@param \1 {Map
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/04-string.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/04-string.dat new file mode 100644 index 0000000000..0e01e7788d --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/04-string.dat @@ -0,0 +1,14 @@ +\bqx\.lang\.String\.add\b=qx.lang.String.addListItem +\bqx\.lang\.String\.remove\b=qx.lang.String.removeListItem + +\bqx\.ui\.table\.DefaultDataCellRenderer\.escapeHtml\b=qx.util.StringEscape.escapeHtml +\bqx\.lang\.String\.escapeRegexpChars\b=qx.util.StringEscape.escapeRegexpChars + +# StringUtil never existed, so correct this mistake afterwards +\bqx\.ui\.basic\.Label\.htmlToText\b=qx.util.StringUtil.htmlToText +\bqx\.ui\.basic\.Label\.textToHtml\b=qx.util.StringUtil.textToHtml +\bqx\.util\.StringUtil\.htmlToText\b=qx.html.String.toText +\bqx\.util\.StringUtil\.textToHtml\b=qx.html.String.fromText + +\bqx\.ui\.basic\.Label\.htmlToText\b=qx.html.String.toText +\bqx\.ui\.basic\.Label\.textToHtml\b=qx.html.String.fromText diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/05-xml.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/05-xml.dat new file mode 100644 index 0000000000..65f88d0656 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/05-xml.dat @@ -0,0 +1,139 @@ +################# +# qx.html.String +################# + +\bqx\.util\.StringEscape\.HTML_ENTITIES_TO_CHARCODE\b=qx.html.Entity.TO_CHARCODE +\bqx\.util\.StringEscape\.HTML_CHARCODE_TO_ENTITIES\b=qx.html.Entity.FROM_CHARCODE + +\bqx\.util\.StringEscape\.escapeHtml\b=qx.html.String.escape +\bqx\.util\.StringEscape\.unescapeHtml\b=qx.html.String.unescape + +\bqx\.util\.StringEscape\.textToHtml\b=qx.html.String.fromText +\bqx\.util\.StringEscape\.htmlToText\b=qx.html.String.toText + + +################ +# qx.xml.String +################ + +\bqx\.util\.StringEscape\.XML_ENTITIES_TO_CHARCODE\b=qx.xml.Entity.TO_CHARCODE +\bqx\.util\.StringEscape\.XML_CHARCODE_TO_ENTITIES\b=qx.xml.Entity.FROM_CHARCODE + +\bqx\.util\.StringEscape\.escapeXml\b=qx.xml.String.escape +\bqx\.util\.StringEscape\.unescapeXml\b=qx.xml.String.unescape + + +################ +# qx.dom.String +################ + +\bqx\.util\.StringEscape\._escape\b=qx.dom.String.escapeEntities +\bqx\.util\.StringEscape\._unescape\b=qx.dom.String.unescapeEntities + +\bqx\.lang\.String\.stripTags\b=qx.dom.String.stripTags + + +################# +# qx.lang.String +################# + +\bqx\.util\.StringEscape\.escapeRegexpChars\b=qx.lang.String.escapeRegexpChars + + +##################### +# qx.dom --> 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 @@ +(?<!JSON: )[\"\']text\/json[\"\']=qx.util.Mime.JSON +(?<!JSON: )[\"\']application\/json[\"\']=qx.util.Mime.JSON +(?<!XML: )[\"\']application\/xml[\"\']=qx.util.Mime.XML +(?<!TEXT: )[\"\']text\/plain[\"\']=qx.util.Mime.TEXT +(?<!HTML: )[\"\']text\/html[\"\']=qx.util.Mime.HTML + +# text/javascript is not autmatically replaced with application/javascript. +# Instead, a info warning is given, see info/ folder. diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/07-icons.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/07-icons.dat new file mode 100644 index 0000000000..55a018e4b2 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/07-icons.dat @@ -0,0 +1,114 @@ +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])help\.png([\"\'\)])=\1actions/help-about.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])encrypted\.png([\"\'\)])=\1actions/encrypt.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-image\.png([\"\'\)])=\1mimetypes/image-x-generic.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])themes\.png([\"\'\)])=\1apps/preferences-desktop-theme.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])colors\.png([\"\'\)])=\1actions/format-color.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])view-text\.png([\"\'\)])=\1actions/view-pane-text.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])find\.png([\"\'\)])=\1actions/edit-find.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])spellcheck\.png([\"\'\)])=\1actions/tools-check-spelling.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])movieplayer\.png([\"\'\)])=\1apps/multimedia-movie-player.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])desktop\.png([\"\'\)])=\1places/user-desktop.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])terminal\.png([\"\'\)])=\1apps/utilities-terminal.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])view-remove\.png([\"\'\)])=\1actions/view-pane-remove.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mail\.png([\"\'\)])=\1apps/internet-email-client.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])folder\.png([\"\'\)])=\1places/folder.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])look-and-feel\.png([\"\'\)])=\1apps/preferences-desktop-theme.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-archive\.png([\"\'\)])=\1mimetypes/package-x-generic.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-html\.png([\"\'\)])=\1mimetypes/text-html.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])background\.png([\"\'\)])=\1apps/preferences-desktop-wallpaper.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])view-tree\.png([\"\'\)])=\1actions/view-pane-tree.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])file-open\.png([\"\'\)])=\1actions/document-open.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-quicktime\.png([\"\'\)])=\1mimetypes/application-quicktime.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])password\.png([\"\'\)])=\1status/dialog-password.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])button-ok\.png([\"\'\)])=\1actions/dialog-ok.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])decrypted\.png([\"\'\)])=\1actions/decrypt.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mycomputer\.png([\"\'\)])=\1devices/computer.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])edit\.png([\"\'\)])=\1actions/edit.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])notes\.png([\"\'\)])=\1apps/accessories-notes.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])fonts\.png([\"\'\)])=\1apps/preferences-desktop-font.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])reload\.png([\"\'\)])=\1actions/view-refresh.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])button-cancel\.png([\"\'\)])=\1actions/dialog-cancel.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])file-new\.png([\"\'\)])=\1actions/document-new.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])settings\.png([\"\'\)])=\1categories/preferences.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])adobe-reader\.png([\"\'\)])=\1apps/office-adobe-reader.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])file-save\.png([\"\'\)])=\1actions/document-save.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])edit-cut\.png([\"\'\)])=\1actions/edit-cut.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])back\.png([\"\'\)])=\1actions/go-previous.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])devices\.png([\"\'\)])=\1devices/drive-harddisk.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])home\.png([\"\'\)])=\1actions/go-home.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])file-print\.png([\"\'\)])=\1actions/document-print.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])network\.png([\"\'\)])=\1categories/applications-internet.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])clock\.png([\"\'\)])=\1apps/accessories-clock.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-text\.png([\"\'\)])=\1mimetypes/text-x-generic.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])multimedia\.png([\"\'\)])=\1categories/applications-multimedia.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])viewmag-plus\.png([\"\'\)])=\1actions/zoom-in.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])clipboard\.png([\"\'\)])=\1apps/accessories-clipboard.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])exit\.png([\"\'\)])=\1actions/application-exit.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])run\.png([\"\'\)])=\1actions/system-run.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])dictionary\.png([\"\'\)])=\1apps/accessories-dictionary.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])undo\.png([\"\'\)])=\1actions/edit-undo.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-calendar\.png([\"\'\)])=\1mimetypes/x-office-calendar.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])trashcan-full\.png([\"\'\)])=\1places/user-trash-full.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])ok\.png([\"\'\)])=\1actions/dialog-ok.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])file-save-as\.png([\"\'\)])=\1actions/document-save-as.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])harddrive\.png([\"\'\)])=\1devices/drive-harddisk.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mixer\.png([\"\'\)])=\1apps/multimedia-volume-control.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])tv\.png([\"\'\)])=\1devices/video-display.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])games\.png([\"\'\)])=\1categories/applications-games.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])folder-open\.png([\"\'\)])=\1status/folder-open.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])edit-copy\.png([\"\'\)])=\1actions/edit-copy.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])viewmag\.png([\"\'\)])=\1actions/zoom.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])viewmag-minus\.png([\"\'\)])=\1actions/zoom-out.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])down\.png([\"\'\)])=\1actions/go-down.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])services\.png([\"\'\)])=\1places/services.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])trashcan-empty\.png([\"\'\)])=\1places/user-trash.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-shellscript\.png([\"\'\)])=\1mimetypes/text-x-script.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])cancel\.png([\"\'\)])=\1actions/dialog-cancel.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])apply\.png([\"\'\)])=\1actions/dialog-ok.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])redo\.png([\"\'\)])=\1actions/edit-redo.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])history-clear\.png([\"\'\)])=\1actions/history-clear.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])scanner\.png([\"\'\)])=\1devices/scanner.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-color\.png([\"\'\)])=\1actions/format-color.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])system\.png([\"\'\)])=\1categories/applications-system.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])camera\.png([\"\'\)])=\1devices/camera-photo.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])editor\.png([\"\'\)])=\1apps/accessories-text-editor.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])forward\.png([\"\'\)])=\1actions/go-next.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-sourcecode\.png([\"\'\)])=\1mimetypes/empty-x-generic.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-multimedia\.png([\"\'\)])=\1mimetypes/audio-x-generic.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-video\.png([\"\'\)])=\1mimetypes/video-x-generic.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])configure\.png([\"\'\)])=\1apps/preferences.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])floppy\.png([\"\'\)])=\1devices/media-floppy.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])viewmag-fit\.png([\"\'\)])=\1actions/zoom-best-fit.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])bookmark-add\.png([\"\'\)])=\1actions/favorite-add.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])graphics\.png([\"\'\)])=\1categories/applications-graphics.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])cdrom\.png([\"\'\)])=\1devices/media-optical.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-spreadsheet\.png([\"\'\)])=\1mimetypes/x-office-spreadsheet.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])netscape\.png([\"\'\)])=\1mimetypes/text-html.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])view-icon\.png([\"\'\)])=\1actions/view-pane-icon.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])edit-paste\.png([\"\'\)])=\1actions/edit-paste.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])view-multicolumn\.png([\"\'\)])=\1actions/view-pane-column.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])up\.png([\"\'\)])=\1actions/go-up.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])help-center\.png([\"\'\)])=\1apps/help-browser.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-script\.png([\"\'\)])=\1mimetypes/text-x-script.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])file-manager\.png([\"\'\)])=\1apps/system-file-manager.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])display\.png([\"\'\)])=\1devices/video-display.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])history\.png([\"\'\)])=\1actions/history.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])edit-delete\.png([\"\'\)])=\1actions/edit-delete.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-binary\.png([\"\'\)])=\1mimetypes/application-x-executable.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])calculator\.png([\"\'\)])=\1apps/accessories-calculator.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])accessibility\.png([\"\'\)])=\1apps/preferences-desktop-accessibility.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])organizer\.png([\"\'\)])=\1apps/office-organizer.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mouse\.png([\"\'\)])=\1devices/input-mouse.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])printer\.png([\"\'\)])=\1devices/printer.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])stop\.png([\"\'\)])=\1actions/stop.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])viewmag-original\.png([\"\'\)])=\1actions/zoom-original.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])utilities\.png([\"\'\)])=\1categories/applications-utilities.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])applications\.png([\"\'\)])=\1categories/applications.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])user\.png([\"\'\)])=\1apps/system-users.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])mime-pdf\.png([\"\'\)])=\1mimetypes/application-pdf.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])date\.png([\"\'\)])=\1apps/accessories-date.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])alarm\.png([\"\'\)])=\1apps/accessories-alarm.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])view-detailed\.png([\"\'\)])=\1actions/view-pane-detailed.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])magnifier\.png([\"\'\)])=\1actions/zoom.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])info\.png([\"\'\)])=\1status/dialog-information.png\2 +(?<!actions)(?<!apps)(?<!categories)(?<!devices)(?<!mimetypes)(?<!places)(?<!status)([/\"\'\(])error\.png([\"\'\)])=\1status/dialog-error.png\2 diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/08-genvar.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/08-genvar.dat new file mode 100644 index 0000000000..03ab1d1aa5 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6.5/patches/08-genvar.dat @@ -0,0 +1 @@ +\bqx\.SOURCE_BUILD\b=qx.IS_SOURCE diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/info/01-prototypes.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/info/01-prototypes.dat new file mode 100644 index 0000000000..2cdd4addd0 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/info/01-prototypes.dat @@ -0,0 +1,32 @@ +\.copy\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.clone\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.getFirst\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.getLast\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.insertAt\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.insertBefore\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.insertAfter\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.removeAt\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.removeAll\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.append\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.remove\b=Maybe old use of prototype function. Please use qx.lang.Array instead.
+\.contains\b=Maybe old use of prototype function. Please use qx.lang.Array/qx.lang.String instead.
+
+\.toCamelCase\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+\.trimLeft\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+\.trimRight\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+\.trim\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+\.stripTags\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+\.startsWith\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+\.endsWith\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+\.pad\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+\.toFirstUp\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+\.escapeRegexpChars\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+
+# All widget add/remove is affected. It's generally better to hide these because the string
+# methods are relatively rarely used.
+#\.add\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+#\.remove\b=Maybe old use of prototype function. Please use qx.lang.String instead.
+
+\.isInRange\b=Maybe old use of prototype function. Please use qx.lang.Number instead.
+\.isBetweenRange\b=Maybe old use of prototype function. Please use qx.lang.Number instead.
+\.limit\b=Maybe old use of prototype function. Please use qx.lang.Number instead.
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/info/02-obsolete.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/info/02-obsolete.dat new file mode 100644 index 0000000000..65e5496e21 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/info/02-obsolete.dat @@ -0,0 +1,3 @@ +\bQxSet\b=Does not exist anymore. Maybe qx.manager.object.ObjectManager can be used instead.
+\bQxTransport\b=Does not exist anymore. Please use qx.io.remote.RemoteRequest now.
+\bQxXmlHttpTransport\b=Does not exist anymore. Please use qx.io.remote.RemoteRequest now.
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/01-classnames.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/01-classnames.dat new file mode 100644 index 0000000000..4545fe3b7f --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/01-classnames.dat @@ -0,0 +1,209 @@ +\bQxConst\b=qx.Const +\bQxClient\b=qx.sys.Client + +\bQxDefaultSettings\b=qx.core.DefaultSettings +\bQxSettings\b=qx.core.Settings +\bQxMain\b=qx.core.Main +\bQxObject\b=qx.core.Object +\bQxTarget\b=qx.core.Target +\bQxApplication\b=qx.core.Init + +\bQxRangeManager\b=qx.type.Range +\bQxSelectionStorage\b=qx.type.Selection +\bQxFlashPlayerVersion\b=qx.type.Version + +\bQxTimer\b=qx.client.Timer +\bQxNativeWindow\b=qx.client.NativeWindow +\bQxClientWindow\b=qx.client.ClientWindow +\bQxCommand\b=qx.client.Command +\bQxBuilder\b=qx.client.Builder + +\bQxDebug\b=qx.dev.Debug +\bQxTimeTracker\b=qx.dev.TimeTracker + +\bQxXmlExtras\b=qx.lang.Xml + +\bQxDataEvent\b=qx.event.type.DataEvent +\bQxDomEvent\b=qx.event.type.DomEvent +\bQxDragEvent\b=qx.event.type.DragEvent +\bQxEvent\b=qx.event.type.Event +\bQxFocusEvent\b=qx.event.type.FocusEvent +\bQxKeyEvent\b=qx.event.type.KeyEvent +\bQxMouseEvent\b=qx.event.type.MouseEvent + +\bQxDragAndDropManager\b=qx.event.handler.DragAndDropHandler +\bQxEventManager\b=qx.event.handler.EventHandler +\bQxFocusManager\b=qx.event.handler.FocusHandler + +\bQxRequest\b=qx.io.remote.RemoteRequest +\bQxRequestQueue\b=qx.io.remote.RemoteRequestQueue +\bQxResponse\b=qx.io.remote.RemoteResponse +\bQxCommonTransport\b=qx.io.remote.AbstractRemoteTransport +\bQxIframeTransport\b=qx.io.remote.IframeTransport +\bQxXmlhttpTransport\b=qx.io.remote.XmlhttpTransport + +\bQxCookie\b=qx.io.local.CookieApi +\bQxCookieStorage\b=qx.io.local.CookieTransport + +\bQxImagePreloader\b=qx.io.image.ImagePreloader +\bQxImagePreloaderSystem\b=qx.io.image.ImagePreloaderSystem + +\bQxParent\b=qx.ui.core.Parent +\bQxWidget\b=qx.ui.core.Widget +\bQxClientDocument\b=qx.ui.core.ClientDocument +\bQxBlocker\b=qx.ui.core.ClientDocumentBlocker + +\bQxAtom\b=qx.ui.basic.Atom +\bQxImage\b=qx.ui.basic.Image +\bQxLabel\b=qx.ui.basic.Label +\bQxTerminator\b=qx.ui.basic.Terminator +\bQxInline\b=qx.ui.basic.Inline +\bQxHorizontalSpacer\b=qx.ui.basic.HorizontalSpacer +\bQxVerticalSpacer\b=qx.ui.basic.VerticalSpacer + +\bQxBoxLayout\b=qx.ui.layout.BoxLayout +\bQxCanvasLayout\b=qx.ui.layout.CanvasLayout +\bQxDockLayout\b=qx.ui.layout.DockLayout +\bQxFlowLayout\b=qx.ui.layout.FlowLayout +\bQxHorizontalBoxLayout\b=qx.ui.layout.HorizontalBoxLayout +\bQxVerticalBoxLayout\b=qx.ui.layout.VerticalBoxLayout +\bQxGridLayout\b=qx.ui.layout.GridLayout + +\bQxTextField\b=qx.ui.form.TextField +\bQxTextArea\b=qx.ui.form.TextArea +\bQxPasswordField\b=qx.ui.form.PasswordField +\bQxSpinner\b=qx.ui.form.Spinner +\bQxButton\b=qx.ui.form.Button +\bQxRepeatButton\b=qx.ui.form.RepeatButton +\bQxComboBox\b=qx.ui.form.ComboBox +\bQxList\b=qx.ui.form.List +\bQxCheckBox\b=qx.ui.form.CheckBox +\bQxRadioButton\b=qx.ui.form.RadioButton +\bQxListItem\b=qx.ui.form.ListItem +\bQxInputCheckIcon\b=qx.ui.form.InputCheckSymbol + +\bQxFieldSet\b=qx.ui.groupbox.GroupBox +\bQxCheckBoxFieldSet\b=qx.ui.groupbox.CheckGroupBox +\bQxRadioButtonFieldSet\b=qx.ui.groupbox.RadioGroupBox + +\bQxListView\b=qx.ui.listview.ListView +\bQxListViewContentCellHtml\b=qx.ui.listview.ListViewContentCellHtml +\bQxListViewContentCellIconHtml\b=qx.ui.listview.ListViewContentCellIconHtml +\bQxListViewContentCellImage\b=qx.ui.listview.ListViewContentCellImage +\bQxListViewContentCellLink\b=qx.ui.listview.ListViewContentCellLink +\bQxListViewContentCellText\b=qx.ui.listview.ListViewContentCellText +\bQxListViewHeader\b=qx.ui.listview.ListViewHeader +\bQxListViewHeaderCell\b=qx.ui.listview.ListViewHeaderCell +\bQxListViewHeaderSeparator\b=qx.ui.listview.ListViewHeaderSeparator +\bQxListViewPane\b=qx.ui.listview.ListViewPane + +\bQxWindow\b=qx.ui.window.Window + +\bQxPopup\b=qx.ui.popup.Popup +\bQxPopupAtom\b=qx.ui.popup.PopupAtom +\bQxToolTip\b=qx.ui.popup.ToolTip + +\bQxMenu\b=qx.ui.menu.Menu +\bQxMenuBar\b=qx.ui.menu.MenuBar +\bQxMenuBarButton\b=qx.ui.menu.MenuBarButton +\bQxMenuButton\b=qx.ui.menu.MenuButton +\bQxMenuCheckBox\b=qx.ui.menu.MenuCheckBox +\bQxMenuLayout\b=qx.ui.menu.MenuLayout +\bQxMenuRadioButton\b=qx.ui.menu.MenuRadioButton +\bQxMenuSeparator\b=qx.ui.menu.MenuSeparator + +\bQxCommonView\b=qx.ui.pageview.AbstractPageView +\bQxCommonViewBar\b=qx.ui.pageview.AbstractPageViewBar +\bQxCommonViewButton\b=qx.ui.pageview.AbstractPageViewButton +\bQxCommonViewPage\b=qx.ui.pageview.AbstractPageViewPage +\bQxCommonViewPane\b=qx.ui.pageview.AbstractPageViewPane + +\bQxTabView\b=qx.ui.pageview.tabview.TabView +\bQxTabViewBar\b=qx.ui.pageview.tabview.TabViewBar +\bQxTabViewButton\b=qx.ui.pageview.tabview.TabViewButton +\bQxTabViewPage\b=qx.ui.pageview.tabview.TabViewPage +\bQxTabViewPane\b=qx.ui.pageview.tabview.TabViewPane + +\bQxBarView\b=qx.ui.pageview.buttonview.ButtonView +\bQxBarViewBar\b=qx.ui.pageview.buttonview.ButtonViewBar +\bQxBarViewButton\b=qx.ui.pageview.buttonview.ButtonViewButton +\bQxBarViewPage\b=qx.ui.pageview.buttonview.ButtonViewPage +\bQxBarViewPane\b=qx.ui.pageview.buttonview.ButtonViewPane + +\bQxToolBar\b=qx.ui.toolbar.ToolBar +\bQxToolBarButton\b=qx.ui.toolbar.ToolBarButton +\bQxToolBarCheckBox\b=qx.ui.toolbar.ToolBarCheckBox +\bQxToolBarMenuButton\b=qx.ui.toolbar.ToolBarMenuButton +\bQxToolBarPart\b=qx.ui.toolbar.ToolBarPart +\bQxToolBarPartHandle\b=qx.ui.toolbar.ToolBarPartHandle +\bQxToolBarRadioButton\b=qx.ui.toolbar.ToolBarRadioButton +\bQxToolBarSeparator\b=qx.ui.toolbar.ToolBarSeparator + +\bQxTree\b=qx.ui.tree.Tree +\bQxTreeElement\b=qx.ui.tree.AbstractTreeElement +\bQxTreeFile\b=qx.ui.tree.TreeFile +\bQxTreeFolder\b=qx.ui.tree.TreeFolder + +\bQxColorSelector\b=qx.ui.component.ColorSelector + +\bQxCanvasLayoutImpl\b=qx.renderer.layout.CanvasLayoutImpl +\bQxDockLayoutImpl\b=qx.renderer.layout.DockLayoutImpl +\bQxFlowLayoutImpl\b=qx.renderer.layout.FlowLayoutImpl +\bQxGridLayoutImpl\b=qx.renderer.layout.GridLayoutImpl +\bQxHorizontalBoxLayoutImpl\b=qx.renderer.layout.HorizontalBoxLayoutImpl +\bQxLayoutImpl\b=qx.renderer.layout.LayoutImpl +\bQxMenuButtonLayoutImpl\b=qx.renderer.layout.MenuButtonLayoutImpl +\bQxMenuLayoutImpl\b=qx.renderer.layout.MenuLayoutImpl +\bQxVerticalBoxLayoutImpl\b=qx.renderer.layout.VerticalBoxLayoutImpl + +\bQxBorder\.presets\b=qx.renderer.border.BorderPresets +\bQxBorderObject\.presets\b=qx.renderer.border.BorderPresets +\bQxBorder\b=qx.renderer.border.Border +\bQxBorderCache\b=qx.renderer.border.BorderCache +\bQxBorderObject\b=qx.renderer.border.BorderObject +\bQxBorderPresets\b=qx.renderer.border.BorderPresets + +\bQxColor\b=qx.renderer.color.Color +\bQxColorCache\b=qx.renderer.color.ColorCache +\bQxColorObject\b=qx.renderer.color.ColorObject +\bQxColorUtil\b=qx.util.ColorUtil + +\bQxFont\b=qx.renderer.font.Font +\bQxFontCache\b=qx.renderer.font.FontCache +\bQxFontObject\b=qx.renderer.font.FontObject + +\bQxAppearanceTheme\b=qx.renderer.theme.AppearanceTheme +\bQxColorTheme\b=qx.renderer.theme.ColorTheme +\bQxIconTheme\b=qx.renderer.theme.IconTheme +\bQxWidgetTheme\b=qx.renderer.theme.WidgetTheme + +\bQxManager\b=qx.manager.object.ObjectManager +\bQxAppearanceManager\b=qx.manager.object.AppearanceManager +\bQxColorManager\b=qx.manager.object.ColorManager +\bQxPopupManager\b=qx.manager.object.PopupManager +\bQxMenuManager\b=qx.manager.object.MenuManager +\bQxToolTipManager\b=qx.manager.object.ToolTipManager +\bQxWindowManager\b=qx.manager.object.WindowManager +\bQxImageManager\b=qx.manager.object.ImageManager +\bQxImagePreloaderManager\b=qx.manager.object.ImagePreloaderManager + +\bQxSelectionManager\b=qx.manager.selection.SelectionManager +\bQxDomSelectionManager\b=qx.manager.selection.DomSelectionManager +\bQxTreeSelectionManager\b=qx.manager.selection.TreeSelectionManager +\bQxVirtualSelectionManager\b=qx.manager.selection.VirtualSelectionManager +\bQxRadioManager\b=qx.manager.selection.RadioManager + +\bQxFlash\b=qx.ui.embed.Flash +\bQxIframe\b=qx.ui.embed.Iframe +\bQxGallery\b=qx.ui.embed.Gallery +\bQxGalleryList\b=qx.ui.embed.GalleryList +\bQxHtml\b=qx.ui.embed.HtmlEmbed +\bQxIconHtml\b=qx.ui.embed.IconHtmlEmbed +\bQxLink\b=qx.ui.embed.LinkEmbed +\bQxText\b=qx.ui.embed.TextEmbed +\bQxNode\b=qx.ui.embed.NodeEmbed + +\bQxTextile\b=qx.util.Textile.textilize +\bQxCompare\b=qx.util.Compare +\bQxFormUtils\b=qx.util.FormUtil + diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/02-domapi.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/02-domapi.dat new file mode 100644 index 0000000000..bae7bf0be8 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/02-domapi.dat @@ -0,0 +1,38 @@ +qx.dom.getComputedOuter=qx.dom.DomDimension.getOuter +qx.dom.getComputedInner=qx.dom.DomDimension.getInner +qx.dom.getComputedArea=qx.dom.DomDimension.getArea +qx.dom.getComputedBox=qx.dom.DomDimension.getBox +qx.dom.getComputedInset=qx.dom.DomDimension.getInset +qx.dom.getComputedScrollBar=qx.dom.DomDimension.getScrollBar + +qx.dom.cleanElementWhitespace=qx.dom.DomElement.cleanWhitespace +qx.dom.isElementEmpty=qx.dom.DomElement.isEmpty + +qx.dom.getElementFromPoint=qx.dom.DomElementFromPoint.getElementFromPoint +qx.dom.getElementAbsolutePointChecker=qx.dom.DomElementFromPoint.getElementAbsolutePointChecker + +qx.dom.addEventListener=qx.dom.DomEventRegistration.addEventListener +qx.dom.removeEventListener=qx.dom.DomEventRegistration.removeEventListener + +qx.dom.getIframe=qx.dom.DomIframe.get + +qx.dom.getComputedPage=qx.dom.DomLocation.getPage +qx.dom.getComputedClient=qx.dom.DomLocation.getClient +qx.dom.getComputedScreen=qx.dom.DomLocation.getScreen + +qx.dom.getOffset=qx.dom.DomOffset.get +qx.dom.getScroll=qx.dom.DomScroll.get +qx.dom.scrollIntoView=qx.dom.DomScrollIntoView.scroll + +qx.dom.getComputedStyle=qx.dom.DomStyle.getStyle +qx.dom.getComputedBorder=qx.dom.DomStyle.getBorder +qx.dom.getComputedMargin=qx.dom.DomStyle.getMargin +qx.dom.getComputedPadding=qx.dom.DomStyle.getPadding + +qx.dom.createStyleElement=qx.dom.DomStyleSheet.createElement +qx.dom.addCssRule=qx.dom.DomStyleSheet.addRule +qx.dom.removeCssRule=qx.dom.DomStyleSheet.removeRule +qx.dom.removeAllCssRules=qx.dom.DomStyleSheet.removeAllRules + +qx.dom.getWindowInner=qx.dom.DomWindow.getInner +qx.dom.getClientScroll=qx.dom.DomWindow.getScroll diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/03-const.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/03-const.dat new file mode 100644 index 0000000000..ab9a842d8f --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/03-const.dat @@ -0,0 +1,55 @@ +qx.Const.NAMESPACE_=qx.constant.Net.NAMESPACE_ +qx.Const.REQUEST_STATE_=qx.constant.Net.STATE_ +qx.Const.PROTOCOL_=qx.constant.Net.PROTOCOL_ +qx.Const.URI_=qx.constant.Net.URI_ +qx.Const.METHOD_=qx.constant.Net.METHOD_ +qx.Const.CORE_=qx.constant.Core. +qx.Const.NODE_=qx.constant.Node. +qx.Const.BORDER_STYLE_=qx.renderer.border.Border.STYLE_ +qx.Const.FONT_STYLE_=qx.renderer.font.Font.STYLE_ +qx.Const.HTML_=qx.constant.Html. +qx.Const.TYPEOF_=qx.constant.Type. +qx.Const.IMAGE_BLANK=qx.manager.object.ImageManager.BLANK +qx.Const.CURSOR_=qx.constant.Style.CURSOR_ +qx.Const.OVERFLOW_VALUE_=qx.constant.Style.OVERFLOW_ +qx.Const.MIMETYPE_=qx.constant.Mime. +qx.Const.ORIENTATION_=qx.constant.Layout.ORIENTATION_ +qx.Const.ALIGN_=qx.constant.Layout.ALIGN_ +qx.Const.STATE_OVER=qx.ui.core.Widget.STATE_OVER +qx.Const.STATE_FOCUSED=qx.ui.core.Widget.STATE_FOCUSED +qx.Const.STATE_DISABLED=qx.ui.core.Widget.STATE_DISABLED +qx.Const.STATE_CHECKED=qx.ui.form.Button.STATE_CHECKED +qx.Const.STATE_PRESSED=qx.ui.form.Button.STATE_PRESSED +qx.Const.STATE_ABANDONED=qx.ui.form.Button.STATE_ABANDONED +qx.Const.STATE_SELECTED=qx.manager.selection.SelectionManager.STATE_SELECTED +qx.Const.STATE_ANCHOR=qx.manager.selection.SelectionManager.STATE_ANCHOR +qx.Const.STATE_LEAD=qx.manager.selection.SelectionManager.STATE_LEAD +qx.Const.STATE_ACTIVE=qx.ui.window.Window.STATE_ACTIVE +qx.Const.STATE_MAXIMIZED=qx.ui.window.Window.STATE_MAXIMIZED + +qx.Const.PROPERTY_CLASSNAME=qx.ui.core.Widget.PROPERTY_CLASSNAME +qx.Const.PROPERTY_BORDERX=qx.ui.core.Widget.PROPERTY_BORDERX +qx.Const.PROPERTY_BORDERY=qx.ui.core.Widget.PROPERTY_BORDERY +qx.Const.PROPERTY_BORDERWIDTHX=qx.ui.core.Widget.PROPERTY_BORDERWIDTHX +qx.Const.PROPERTY_BORDERWIDTHY=qx.ui.core.Widget.PROPERTY_BORDERWIDTHY +qx.Const.PROPERTY_PARENT_PADDINGLEFT=qx.ui.core.Widget.PROPERTY_PARENT_PADDINGLEFT +qx.Const.PROPERTY_PARENT_PADDINGRIGHT=qx.ui.core.Widget.PROPERTY_PARENT_PADDINGRIGHT +qx.Const.PROPERTY_PARENT_PADDINGTOP=qx.ui.core.Widget.PROPERTY_PARENT_PADDINGTOP +qx.Const.PROPERTY_PARENT_PADDINGBOTTOM=qx.ui.core.Widget.PROPERTY_PARENT_PADDINGBOTTOM + +qx.Const.PROPERTY_FILTER=qx.constant.Style.PROPERTY_FILTER +qx.Const.PROPERTY_DISPLAY=qx.constant.Style.PROPERTY_DISPLAY +qx.Const.PROPERTY_POSITION=qx.constant.Style.PROPERTY_POSITION +qx.Const.PROPERTY_VISIBILITY=qx.constant.Style.PROPERTY_VISIBILITY +qx.Const.PROPERTY_DISABLED=qx.constant.Style.PROPERTY_DISABLED +qx.Const.PROPERTY_LINEHEIGHT=qx.constant.Style.PROPERTY_LINEHEIGHT +qx.Const.PROPERTY_TEXTALIGN=qx.constant.Style.PROPERTY_TEXTALIGN +qx.Const.PROPERTY_WHITESPACE=qx.constant.Style.PROPERTY_WHITESPACE +qx.Const.PROPERTY_PADDING=qx.constant.Style.PROPERTY_PADDING +qx.Const.PROPERTY_OVERFLOW_BOTH=qx.constant.Style.PROPERTY_OVERFLOW_BOTH +qx.Const.PROPERTY_OVERFLOW_TEXT=qx.constant.Style.PROPERTY_OVERFLOW_TEXT +qx.Const.PROPERTY_OVERFLOW_HORIZONTAL=qx.constant.Style.PROPERTY_OVERFLOW_HORIZONTAL +qx.Const.PROPERTY_OVERFLOW_VERTICAL=qx.constant.Style.PROPERTY_OVERFLOW_VERTICAL + +# Should be the last one +qx.Const.PROPERTY_=qx.OO.PROPERTY_
\ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/04-events.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/04-events.dat new file mode 100644 index 0000000000..7bdd26f42c --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/04-events.dat @@ -0,0 +1,56 @@ +qx.Const.EVENT_TYPE_MOUSEOVER=qx.constant.Event.MOUSEOVER +qx.Const.EVENT_TYPE_MOUSEMOVE=qx.constant.Event.MOUSEMOVE +qx.Const.EVENT_TYPE_MOUSEOUT=qx.constant.Event.MOUSEOUT +qx.Const.EVENT_TYPE_MOUSEDOWN=qx.constant.Event.MOUSEDOWN +qx.Const.EVENT_TYPE_MOUSEUP=qx.constant.Event.MOUSEUP +qx.Const.EVENT_TYPE_MOUSEWHEEL=qx.constant.Event.MOUSEWHEEL +qx.Const.EVENT_TYPE_CLICK=qx.constant.Event.CLICK +qx.Const.EVENT_TYPE_DBLCLICK=qx.constant.Event.DBLCLICK +qx.Const.EVENT_TYPE_CONTEXTMENU=qx.constant.Event.CONTEXTMENU +qx.Const.EVENT_TYPE_KEYDOWN=qx.constant.Event.KEYDOWN +qx.Const.EVENT_TYPE_KEYPRESS=qx.constant.Event.KEYPRESS +qx.Const.EVENT_TYPE_KEYUP=qx.constant.Event.KEYUP + +qx.Const.EVENT_TYPE_BLUR=qx.constant.Event.BLUR +qx.Const.EVENT_TYPE_FOCUS=qx.constant.Event.FOCUS +qx.Const.EVENT_TYPE_SELECT=qx.constant.Event.SELECT +qx.Const.EVENT_TYPE_SCROLL=qx.constant.Event.SCROLL +qx.Const.EVENT_TYPE_INPUT=qx.constant.Event.INPUT +qx.Const.EVENT_TYPE_CHANGE=qx.constant.Event.CHANGE + +qx.Const.EVENT_TYPE_ERROR=qx.constant.Event.ERROR +qx.Const.EVENT_TYPE_RESIZE=qx.constant.Event.RESIZE +qx.Const.EVENT_TYPE_INTERVAL=qx.constant.Event.INTERVAL +qx.Const.EVENT_TYPE_EXECUTE=qx.constant.Event.EXECUTE +qx.Const.EVENT_TYPE_CREATE=qx.constant.Event.CREATE + +qx.Const.EVENT_TYPE_BEFOREAPPEAR=qx.constant.Event.BEFOREAPPEAR +qx.Const.EVENT_TYPE_APPEAR=qx.constant.Event.APPEAR +qx.Const.EVENT_TYPE_BEFOREDISAPPEAR=qx.constant.Event.BEFOREDISAPPEAR +qx.Const.EVENT_TYPE_DISAPPEAR=qx.constant.Event.DISAPPEAR +qx.Const.EVENT_TYPE_BEFOREINSERTDOM=qx.constant.Event.BEFOREINSERTDOM +qx.Const.EVENT_TYPE_INSERTDOM=qx.constant.Event.INSERTDOM +qx.Const.EVENT_TYPE_BEFOREREMOVEDOM=qx.constant.Event.BEFOREREMOVEDOM +qx.Const.EVENT_TYPE_REMOVEDOM=qx.constant.Event.REMOVEDOM + +qx.Const.EVENT_TYPE_LOAD=qx.constant.Event.LOAD +qx.Const.EVENT_TYPE_UNLOAD=qx.constant.Event.UNLOAD +qx.Const.EVENT_TYPE_BEFOREUNLOAD=qx.constant.Event.BEFOREUNLOAD +qx.Const.EVENT_TYPE_SUBMIT=qx.constant.Event.SUBMIT + +qx.Const.EVENT_TYPE_CREATED=qx.constant.Event.CREATED +qx.Const.EVENT_TYPE_CONFIGURED=qx.constant.Event.CONFIGURED +qx.Const.EVENT_TYPE_QUEUED=qx.constant.Event.QUEUED +qx.Const.EVENT_TYPE_SENDING=qx.constant.Event.SENDING +qx.Const.EVENT_TYPE_RECEIVING=qx.constant.Event.RECEIVING +qx.Const.EVENT_TYPE_COMPLETED=qx.constant.Event.COMPLETED +qx.Const.EVENT_TYPE_ABORTED=qx.constant.Event.ABORTED +qx.Const.EVENT_TYPE_FAILED=qx.constant.Event.FAILED +qx.Const.EVENT_TYPE_TIMEOUT=qx.constant.Event.TIMEOUT + +qx.Const.EVENT_TYPE_DRAGDROP=qx.constant.Event.DRAGDROP +qx.Const.EVENT_TYPE_DRAGOVER=qx.constant.Event.DRAGOVER +qx.Const.EVENT_TYPE_DRAGOUT=qx.constant.Event.DRAGOUT +qx.Const.EVENT_TYPE_DRAGMOVE=qx.constant.Event.DRAGMOVE +qx.Const.EVENT_TYPE_DRAGSTART=qx.constant.Event.DRAGSTART +qx.Const.EVENT_TYPE_DRAGEND=qx.constant.Event.DRAGEND diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/05-util.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/05-util.dat new file mode 100644 index 0000000000..d26a57a90f --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/05-util.dat @@ -0,0 +1,47 @@ +\bQxUtil\.returnTrue\b = qx.util.Return.returnTrue +\bQxUtil\.returnFalse\b = qx.util.Return.returnFalse +\bQxUtil\.returnNull\b = qx.util.Return.returnNull +\bQxUtil\.returnThis\b = qx.util.Return.returnThis +\bQxUtil\.returnZero\b = qx.util.Return.returnZero +\bQxUtil\.returnNegativeIndex\b = qx.util.Return.returnNegativeIndex + +\bQxUtil\.isValid\b = qx.util.Validation.isValid +\bQxUtil\.isInvalid\b = qx.util.Validation.isInvalid +\bQxUtil\.isValidNumber\b = qx.util.Validation.isValidNumber +\bQxUtil\.isInvalidNumber\b = qx.util.Validation.isInvalidNumber +\bQxUtil\.isValidString\b = qx.util.Validation.isValidString +\bQxUtil\.isInvalidString\b = qx.util.Validation.isInvalidString +\bQxUtil\.isValidArray\b = qx.util.Validation.isValidArray +\bQxUtil\.isInvalidArray\b = qx.util.Validation.isInvalidArray +\bQxUtil\.isValidObject\b = qx.util.Validation.isValidObject +\bQxUtil\.isInvalidObject\b = qx.util.Validation.isInvalidObject +\bQxUtil\.isValidNode\b = qx.util.Validation.isValidNode +\bQxUtil\.isInvalidNode\b = qx.util.Validation.isInvalidNode +\bQxUtil\.isValidElement\b = qx.util.Validation.isValidElement +\bQxUtil\.isInvalidElement\b = qx.util.Validation.isInvalidElement +\bQxUtil\.isValidFunction\b = qx.util.Validation.isValidFunction +\bQxUtil\.isInvalidFunction\b = qx.util.Validation.isInvalidFunction +\bQxUtil\.isValidBoolean\b = qx.util.Validation.isValidBoolean +\bQxUtil\.isInvalidBoolean\b = qx.util.Validation.isInvalidBoolean +\bQxUtil\.isValidStringOrNumber\b = qx.util.Validation.isValidStringOrNumber +\bQxUtil\.isInvalidStringOrNumber\b = qx.util.Validation.isInvalidStringOrNumber + +\bQxUtil\._normalizeUmlautsRegExp\b = qx.util.Normalization._umlautsRegExp +\bQxUtil\._normalizeUmlautsShortData\b = qx.util.Normalization._umlautsShortData +\bQxUtil\._normalizeUmlautsShort\b = qx.util.Normalization._umlautsShort +\bQxUtil\.normalizeUmlautsShort\b = qx.util.Normalization.umlautsShort +\bQxUtil\._normalizeUmlautsLongData\b = qx.util.Normalization._umlautsLongData +\bQxUtil\._normalizeUmlautsLong\b = qx.util.Normalization._umlautsLong +\bQxUtil\.normalizeUmlautsLong\b = qx.util.Normalization.umlautsLong + +\bQxUtil\.isObjectEmpty\b = qx.lang.Object.isEmpty +\bQxUtil\.isObjectMinLength\b = qx.lang.Object.hasMinLength +\bQxUtil\.getObjectLength\b = qx.lang.Object.getLength +\bQxUtil\.convertObjectKeysToArray\b = qx.lang.Object.getKeys +\bQxUtil\.convertObjectKeysToString\b = qx.lang.Object.getKeysAsString +\bQxUtil\.convertObjectValuesToArray\b = qx.lang.Object.getValues +\bQxUtil\.convertArgumentsToArray\b = qx.lang.Array.fromArguments +\bQxUtil\.convertShortHandToArray\b = qx.lang.Array.fromShortHand +\bQxUtil\.mergeObjectWith\b = qx.lang.Object.mergeWith +\bQxUtil\.mergeObjects\b = qx.lang.Object.merge +\bQxUtil\.copyObject\b = qx.lang.Object.copy diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/06-main.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/06-main.dat new file mode 100644 index 0000000000..acbd2a652c --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/migration/0.6/patches/06-main.dat @@ -0,0 +1,7 @@ +window.application.main\s*\=\s*function\(\)[^\0]*?\{\s* = qx.core.Init.getInstance().defineMain(function() {\n + +\}\;[\n\s]*<\/script> = });</script> + +#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 <b>ElementTree</b> 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 <b>Element</b> 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. +# <p> +# Each element has a number of properties associated with it: +# <ul> +# <li>a <i>tag</i>. This is a string identifying what kind of data +# this element represents (the element type, in other words).</li> +# <li>a number of <i>attributes</i>, stored in a Python dictionary.</li> +# <li>a <i>text</i> string.</li> +# <li>an optional <i>tail</i> string.</li> +# <li>a number of <i>child elements</i>, stored in a Python sequence</li> +# </ul> +# +# To create an element instance, use the {@link #Element} or {@link +# #SubElement} factory functions. +# <p> +# 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. +# <p> +# 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: + # <tag attrib>text<child/>...</tag>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 "<Element %s at %x>" % (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 <b>find</b> 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. + # <p> + # 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. +# <p> +# 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. +# <p> +# 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. +# <p> +# 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("<?xml version='1.0' encoding='%s'?>\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("<!-- %s -->" % _escape_cdata(node.text, encoding)) + elif tag is ProcessingInstruction: + file.write("<?%s?>" % _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("</" + _encode(tag, encoding) + ">") + 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. +# <p> +# 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. +# <p> +# 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 +# <b>expat</b> 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] == "<!DOCTYPE": + self._doctype = [] # inside a doctype declaration + elif self._doctype is not None: + # parse doctype contents + if prefix == ">": + 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 <code>%s</code>." % 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 <code>%s</code> 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("<p>", "\n") + text = text.replace("<br/>", "\n") + text = text.replace("<br>", "\n") + text = text.replace("</p>", " ") + + 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("<pre", "\n\n<pre").replace("</pre>", "</pre>\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 <loewis@informatik.hu-berlin.de> +# Plural forms support added by alexander smishlajev <alex@tycobka.lv> + +""" +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 <pre> 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 <p>...</p> +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 <code>, to be valid + XHTML. Fixed <span class="caps">UCAS</span> 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 <br /> 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 <pre> 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 <h1>, 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 <body></body> or + <pre></pre> 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('</%s' % tag): + text = text.split('</%s' % tag, 1)[0] + + text = text.strip().replace('\r\n', '\n') + + return text + + +# If you want PyTextile to automatically colorize +# your Python code, you need the htmlizer module +# from Twisted. (You can just grab this file from +# the distribution, it has no other dependencies.) +try: + #from twisted.python import htmlizer + import htmlizer + from StringIO import StringIO + + def _color(code): + """Colorizer Python code. + + This function wraps a text string in a StringIO, + and passes it to the htmlizer function from + Twisted. + """ + # Fix line continuations. + code = preg_replace(r' \\\n', ' \\\\\n', code) + + code_in = StringIO(code) + code_out = StringIO() + + htmlizer.filter(code_in, code_out) + + # Remove <pre></pre> from input. + code = _in_tag(code_out.getvalue(), 'pre') + + # Fix newlines. + code = code.replace('<span class="py-src-newline">\n</span>', '<span class="py-src-newline"></span>\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<parameters> # + (?: %(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<olparameters> # + (?: %(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<liparameters> # + (?: %(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<parameters> # + (?: %(classid)s # class and/or id + | %(lang)s # [lang] + | %(style)s # {style} + )+ # + )? # + ''' % parameters, + + # Link attributes. + 'lattr': r'''(?P<parameters> # Links attributes + (?: %(align)s # alignment + | %(classid)s # class and/or id + | %(lang)s # [lang] + | %(style)s # {style} + )+ # + )? # + ''' % parameters, + + # Image attributes. + 'iattr': r'''(?P<parameters> # + (?: # + (?: [<>]+ # 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<parameters> # + (?: # + (?: [\^~] # 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 <pre class="screen">, 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 </pre>, tag will be "pre" + # Reconstruct the original end tag. + if tag not in self.elements_no_end_tag: + self.pieces.append("</%(tag)s>" % 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. <!-- insert Javascript code here --> + # Reconstruct the original comment. + self.pieces.append("<!--%(text)s-->" % locals()) + + def handle_pi(self, text): + # called for each processing instruction, e.g. <?instruction> + # Reconstruct original processing instruction. + self.pieces.append("<?%(text)s>" % locals()) + + def handle_decl(self, text): + # called for the DOCTYPE, if present, e.g. + # <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + # "http://www.w3.org/TR/html4/loose.dtd"> + # Reconstruct original DOCTYPE + self.pieces.append("<!%(text)s>" % 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<dot>\.) # . + (?P<extend>\.)? # Extended paragraph denoted by a second dot + \s # whitespace + (?P<text>.*) # text + ''' % self.res, self.paragraph), + + # Pre-formatted text. + (r'''^pre # Pre signature + %(battr)s # Pre attributes + (?P<dot>\.) # . + (?P<extend>\.)? # Extended pre denoted by a second dot + \s # whitespace + (?P<text>.*) # text + ''' % self.res, self.pre), + + # Block code. + (r'''^bc # Blockcode signature + %(battr)s # Blockcode attributes + (?P<dot>\.) # . + (?P<extend>\.)? # Extended blockcode denoted by a second dot + \s # whitespace + (?P<text>.*) # text + ''' % self.res, self.bc), + + # Blockquote. + (r'''^bq # Blockquote signature + %(battr)s # Blockquote attributes + (?P<dot>\.) # . + (?P<extend>\.)? # Extended blockquote denoted by a second dot + (:(?P<cite> # Optional cite attribute + ( # + %(url)s # URL + | "[\w]+(?:\s[\w]+)*" # "Name inside quotes" + )) # + )? # + \s # whitespace + (?P<text>.*) # text + ''' % self.res, self.blockquote), + + # Header. + (r'''^h # Header signature + (?P<header>\d) # Header number + %(battr)s # Header attributes + (?P<dot>\.) # . + (?P<extend>\.)? # Extended header denoted by a second dot + \s # whitespace + (?P<text>.*) # text + ''' % self.res, self.header), + + # Footnote. + (r'''^fn # Footnote signature + (?P<footnote>[\d]+) # Footnote number + (?P<dot>\.) # . + (?P<extend>\.)? # Extended footnote denoted by a second dot + \s # whitespace + (?P<text>.*) # text + ''', self.footnote), + + # Definition list. + (r'''^dl # Definition list signature + %(battr)s # Definition list attributes + (?P<dot>\.) # . + (?P<extend>\.)? # Extended definition list denoted by a second dot + \s # whitespace + (?P<text>.*) # text + ''' % self.res, self.dl), + + # Ordered list (attributes to first <li>). + (r'''^%(olattr)s # Ordered list attributes + \# # Ordered list signature + %(liattr)s # List item attributes + (?P<dot>\.)? # . + \s # whitespace + (?P<text>.*) # text + ''' % self.res, self.ol), + + # Unordered list (attributes to first <li>). + (r'''^%(olattr)s # Unrdered list attributes + \* # Unordered list signature + %(liattr)s # Unordered list attributes + (?P<dot>\.)? # . + \s # whitespace + (?P<text>.*) # text + ''' % self.res, self.ul), + + # Escaped text. + (r'''^==?(?P<text>.*?)(==)?$ # Escaped text + ''', self.escape), + + (r'''^(?P<text><.*)$ # XHTML tag + ''', self.escape), + + # itex code. + (r'''^(?P<text> # itex code + \\\[ # starts with \[ + .*? # complicated mathematical equations go here + \\\]) # ends with \] + ''', self.itex), + + # Tables. + (r'''^table # Table signature + %(tattr)s # Table attributes + (?P<dot>\.) # . + (?P<extend>\.)? # Extended blockcode denoted by a second dot + \s # whitespace + (?P<text>.*) # text + ''' % self.res, self.table), + + # Simple tables. + (r'''^(?P<text> + \| + .*) + ''', self.table), + + # About. + (r'''^(?P<text>tell\sme\sabout\stextile\.)$''', self.about), + ] + + + def protectPre(self, text): + regexps = re.compile(r'''^<pre>?(?P<text>.*?)</pre>?$''', 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 <img />, <br /> and <hr />. + + --- + 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 + @<img />@, @<br />@ and @<hr />@. + + 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 <img /> and <br />. + 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 @<h1></h1>@ 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.. <blockquote> + <p>This is paragraph one of a block quote.</p> + + <p>This is paragraph two of a block quote.</p> + </blockquote> + + <p>Now we’re back to a regular paragraph.</p> + + 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. <p lang="en" style="color:red;padding-left:2em;padding-right:2em;float:right;" class="class right" id="id">A simple paragraph.</p> + """ + # Clear signature. + clear_sig = r'''^clear(?P<alignment>[<>])?\.$''' + 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 <pre> 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<class>[\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<id>[\w]+)\)''', parameters) + if m: output['id'] = m.group('id') + + # Match [language]. + m = re.search(r'''\[(?P<lang>[\w-]+)\]''', parameters) + if m: output['lang'] = m.group('lang') + + # Match {style}. + m = re.search(r'''{(?P<style>[^\}]+)}''', parameters) + if m: + output['style'] = m.group('style').replace('\n', '') + + # If necessary, apppend a semi-comma to the style. + if not output['style'].endswith(';'): + output['style'] += ';' + + # Clear the block? + if clear: + output['style'] = output.get('style', '') + clear + + # Remove classes, ids, langs and styles. This makes the + # regular expression for the positioning much easier. + parameters = preg_replace(r'''\([\#\w\s]+\)''', '', parameters) + parameters = preg_replace(r'''\[[\w-]+\]''', '', parameters) + parameters = preg_replace(r'''{[\w:;#%-]+}''', '', parameters) + + style = [] + + # Count the left indentation. + l_indent = parameters.count('(') + if l_indent: style.append('padding-left:%dem;' % l_indent) + + # Count the right indentation. + r_indent = parameters.count(')') + if r_indent: style.append('padding-right:%dem;' % r_indent) + + # Add alignment. + if align_type == 'image': + align = [('<', 'float:left;', ' left'), + ('>', 'float:right;', ' right')] + + valign = [('^', 'vertical-align:text-top;', ' top'), + ('-', 'vertical-align:middle;', ' middle'), + ('~', 'vertical-align:text-bottom;', ' bottom')] + + # Images can have both a vertical and a horizontal alignment. + for alignments in [align, valign]: + for _align, _style, _class in alignments: + if parameters.count(_align): + style.append(_style) + + # Append a class name related to the alignment. + output['class'] = output.get('class', '') + _class + break + + elif align_type == 'table': + align = [('<', 'left'), + ('>', 'right'), + ('=', 'center'), + ('<>', 'justify')] + + valign = [('^', 'top'), + ('~', 'bottom')] + + # Horizontal alignment. + for _align, _style, in align: + if parameters.count(_align): + output['align'] = _style + + # Vertical alignment. + for _align, _style, in valign: + if parameters.count(_align): + output['valign'] = _style + + # Colspan and rowspan. + m = re.search(r'''\\(\d+)''', parameters) + if m: + #output['colspan'] = m.groups() + output['colspan'] = int(m.groups()[0]) + + m = re.search(r'''/(\d+)''', parameters) + if m: + output['rowspan'] = int(m.groups()[0]) + + else: + if l_indent or r_indent: + alignments = [('<>', 'text-align:justify;', ' justify'), + ('=', 'text-align:center;', ' center'), + ('<', 'float:left;', ' left'), + ('>', 'float:right;', ' right')] + else: + alignments = [('<>', 'text-align:justify;', ' justify'), + ('=', 'text-align:center;', ' center'), + ('<', 'text-align:left;', ' left'), + ('>', 'text-align:right;', ' right')] + + for _align, _style, _class in alignments: + if parameters.count(_align): + style.append(_style) + + # Append a class name related to the alignment. + output['class'] = output.get('class', '') + _class + break + + # Join all the styles. + output['style'] = output.get('style', '') + ''.join(style) + + # Remove excess whitespace. + if output.has_key('class'): + output['class'] = output['class'].strip() + + return output + + + def build_open_tag(self, tag, attributes={}, single=0): + """Build the open tag with specified attributes. + + This function is used by all block builders to + generate the opening tags with the attributes of + the block. + """ + # Open tag. + open_tag = ['<%s' % tag] + for k,v in attributes.items(): + # The ALT attribute can be empty. + if k == 'alt' or v: open_tag.append(' %s="%s"' % (k, v)) + + if single: + open_tag.append(' /') + + # Close tag. + open_tag.append('>') + + return ''.join(open_tag) + + + def paragraph(self, text, parameters=None, attributes=None, clear=None): + """Process a paragraph. + + This function processes the paragraphs, enclosing the text in a + <p> tag and breaking lines with <br />. Paragraphs are formatted + with all the inline rules. + + --- + h1. Paragraph + + This is how you write a paragraph: + + pre. p. This is a paragraph, although a short one. + + Since the paragraph is the default block, you can safely omit its + signature ([@p@]). Simply write: + + pre. This is a paragraph, although a short one. + + Text in a paragraph block is wrapped in @<p></p>@ tags, and + newlines receive a <br /> tag. In both cases Textile will process + the text to: + + pre. <p>This is a paragraph, although a short one.</p> + + Text in a paragraph block is processed with all the inline rules. + """ + # Split the lines. + lines = re.split('\n{2,}', text) + + # Get the attributes. + attributes = attributes or self.parse_params(parameters, clear) + + output = [] + for line in lines: + if line: + # Clean the line. + line = line.strip() + + # Build the tag. + open_tag = self.build_open_tag('p', attributes) + close_tag = '</p>' + + # Pop the id because it must be unique. + if attributes.has_key('id'): del attributes['id'] + + # Break lines. + # line = preg_replace(r'(<br />|\n)+', '<br />\n', line) + + # Remove <br /> from inside broken HTML tags. + line = preg_replace(r'(<[^>]*)<br />\n(.*?>)', r'\1 \2', line) + + # Inline formatting. + line = self.inline(line) + + output.append(open_tag + line + close_tag) + + return '\n\n'.join(output) + + + def pre(self, text, parameters=None, clear=None): + """Process pre-formatted text. + + This function processes pre-formatted text into a <pre> tag. + No HTML is added for the lines, but @<@ and @>@ are translated into + HTML entities. + + --- + h1. Pre-formatted text + + Pre-formatted text can be specified using the @pre@ signature. + Inside a "pre" block, whitespace is preserved and @<@ and @>@ are + translated into HTML(HyperText Markup Language) entities + automatically. + + Text in a "pre" block is _not processed_ with any inline rule. + + Here's a simple example: + + pre. pre. This text is pre-formatted. + Nothing interesting happens inside here... + + Will become: + + pre. <pre> + This text is pre-formatted. + Nothing interesting happens inside here... + </pre> + """ + + # Remove trailing whitespace. + text = text.rstrip() + + # Get the attributes. + attributes = self.parse_params(parameters, clear) + + # Build the tag. + #open_tag = self.build_open_tag('pre', attributes) + '\n' + open_tag = self.build_open_tag('pre', attributes) + close_tag = '\n</pre>' + + # Replace < and >. + text = text.replace('<', '<') + text = text.replace('>', '>') + + return open_tag + text + close_tag + + + def bc(self, text, parameters=None, clear=None): + """Process block code. + + This function processes block code into a <code> tag inside a + <pre>. No HTML is added for the lines, but @<@ and @>@ are translated + into HTML entities. + + --- + h1. Block code + + A block code, specified by the @bc@ signature, is a block of + pre-formatted text which also receives a @<code></code>@ tag. As + with "pre", whitespace is preserved and @<@ and @>@ are translated + into HTML(HyperText Markup Language) entities automatically. + + Text in a "bc" code is _not processed_ with the inline rules. + + If you have "Twisted":http://www.twistedmatrix.com/ installed, + Textile can automatically colorize your Python code if you + specify its language as "Python": + + pre. bc[python]. from twisted.python import htmlizer + + This will become: + + pre. <pre> + <code lang="python"> + <span class="py-src-keyword">from</span> <span class="py-src-variable">twisted</span><span class="py-src-op">.</span><span class="py-src-variable">python</span> <span class="py-src-keyword">import</span> <span class="py-src-variable">htmlizer</span> + </code> + </pre> + + The colors can be specified in your CSS(Cascading Style Sheets) + file. If you don't want to install Twisted, you can download just + the @htmlizer@ module "independently":http://dealmeida.net/code/htmlizer.py.txt. + """ + + # Get the attributes. + attributes = self.parse_params(parameters, clear) + + # XHTML <code> can't have the attribute lang. + if attributes.has_key('lang'): + lang = attributes['lang'] + del attributes['lang'] + else: + lang = None + + # Build the tag. + open_tag = '<pre>\n' + self.build_open_tag('code', attributes) + '\n' + close_tag = '\n</code>\n</pre>' + + # Colorize Python code? + if htmlizer and lang == 'python': + text = _color(text) + else: + # Replace < and >. + text = text.replace('<', '<') + text = text.replace('>', '>') + + return open_tag + text + close_tag + + + def dl(self, text, parameters=None, clear=None): + """Process definition list. + + This function process definition lists. The text inside + the <dt> and <dd> tags is processed for inline formatting. + + --- + h1. Definition list + + A definition list starts with the signature @dl@, and has + its items separated by a @:@. Here's a simple example: + + pre. dl. name:Sir Lancelot of Camelot. + quest:To seek the Holy Grail. + color:Blue. + + Becomes: + + pre. <dl> + <dt>name</dt> + <dd>Sir Lancelot of Camelot.</dd> + <dt>quest</dt> + <dd>To seek the Holy Grail.</dd> + <dt>color</dt> + <dd>Blue.</dd> + </dl> + """ + # Get the attributes. + attributes = self.parse_params(parameters, clear) + + # Build the tag. + open_tag = self.build_open_tag('dl', attributes) + '\n' + close_tag = '\n</dl>' + + lines = text.split('\n') + output = [] + for line in lines: + if line.count(':'): + [dt, dd] = line.split(':', 1) + else: + dt,dd = line, '' + + if dt: output.append('<dt>%s</dt>\n<dd>%s</dd>' % (dt, dd)) + + text = '\n'.join(output) + + text = self.inline(text) + + return open_tag + text + close_tag + + + def blockquote(self, text, parameters=None, cite=None, clear=None): + """Process block quote. + + The block quote is inserted into a <blockquote> tag, and + processed as a paragraph. An optional cite attribute can + be appended on the last line after two dashes (--), or + after the period following ':' for compatibility with the + Perl version. + + --- + h1. Blockquote + + A blockquote is denoted by the signature @bq@. The text in this + block will be enclosed in @<blockquote></blockquote>@ and @<p></p>@, + receiving the same formatting as a paragraph. For example: + + pre. bq. This is a blockquote. + + Becomes: + + pre. <blockquote> + <p>This is a blockquote.</p> + </blockquote> + + You can optionally specify the @cite@ attribute of the blockquote, + using the following syntax: + + pre. bq.:http://example.com Some text. + + pre. bq.:"John Doe" Some other text. + + Becomes: + + pre. <blockquote cite="http://example.com"> + <p>Some text.</p> + </blockquote> + + pre. <blockquote cite="John Doe"> + <p>Some other text.</p> + </blockquote> + + You can also specify the @cite@ using a pair of dashes on the + last line of the blockquote: + + pre. bq. Some text. + -- http://example.com + """ + + # Get the attributes. + attributes = self.parse_params(parameters, clear) + + if cite: + # Remove the quotes? + cite = cite.strip('"') + attributes['cite'] = cite + else: + # The citation should be on the last line. + text = text.split('\n') + if text[-1].startswith('-- '): + attributes['cite'] = text.pop()[3:] + + text = '\n'.join(text) + + # Build the tag. + open_tag = self.build_open_tag('blockquote', attributes) + '\n' + close_tag = '\n</blockquote>' + + # Process the paragraph, passing the attributes. + # Does it make sense to pass the id, class, etc. to + # the paragraph instead of applying it to the + # blockquote tag? + text = self.paragraph(text) + + return open_tag + text + close_tag + + + def header(self, text, parameters=None, header=1, clear=None): + """Process a header. + + The header number is captured by the regular + expression and lives in header. If head_offset is + set, it is adjusted accordingly. + + --- + h1. Header + + A header is produced by the signature @hn@, where @n@ goes + from 1 to 6. You can adjust the relative output of the headers + passing a @head_offset@ attribute when calling @textile()@. + + To make a header: + + pre. h1. This is a header. + + Becomes: + + pre. <h1>This is a header.</h1> + """ + # Get the attributes. + attributes = self.parse_params(parameters, clear) + + # Get the header number and limit it between 1 and 6. + n = header + n = min(n,6) + n = max(n,1) + + # Build the tag. + open_tag = self.build_open_tag('h%d' % n, attributes) + close_tag = '</h%d>' % n + + text = self.inline(text) + + return open_tag + text + close_tag + + + def footnote(self, text, parameters=None, footnote=1, clear=None): + """Process a footnote. + + A footnote is formatted as a paragraph of class + 'footnote' and id 'fn%d', starting with the footnote + number in a <sup> tag. Here we just build the + attributes and pass them directly to self.paragraph(). + + --- + h1. Footnote + + A footnote is produced by the signature @fn@ followed by + a number. Footnotes are paragraphs of a special CSS(Cascading Style Sheets) + class. An example: + + pre. fn1. This is footnote number one. + + Will produce this: + + pre. <p class="footnote" id="fn1"><sup>1</sup> This is footnote number one.</p> + + This footnote can be referenced anywhere on the text by the + following way: + + pre. This is a reference[1] to footnote number one. + + Which becomes: + + pre. <p>This is a reference<sup class="footnote"><a href="#fn1" title="This is footnote number one.">1</a></sup> to footnote number 1.</p> + + Note that the text from the footnote appears in the @title@ of the + link pointing to it. + """ + # Get the number. + n = int(footnote) + + # Build the attributes to the paragraph. + attributes = self.parse_params(parameters, clear) + attributes['class'] = 'footnote' + attributes['id'] = 'fn%d' % n + + # Build the paragraph text. + text = ('<sup>%d</sup> ' % n) + text + + # And return the paragraph. + return self.paragraph(text=text, attributes=attributes) + + + def build_li(self, items, liattributes): + """Build the list item. + + This function build the list item of an (un)ordered list. It + works by peeking at the next list item, and searching for a + multi-list. If a multi-list is found, it is processed and + appended inside the list item tags, as it should be. + """ + lines = [] + while len(items): + item = items.pop(0) + + # Clean the line. + item = item.lstrip() + item = item.replace('\n', '<br />\n') + + # Get list item attributes. + p = re.compile(r'''^%(liattr)s\s''' % self.res, re.VERBOSE) + m = p.match(item) + if m: + c = m.groupdict('') + liparameters = c['liparameters'] + item = p.sub('', item) + else: + liparameters = '' + + liattributes = liattributes or self.parse_params(liparameters) + + # Build the item tag. + open_tag_li = self.build_open_tag('li', liattributes) + + # Reset the attributes, which should be applied + # only to the first <li>. + liattributes = {} + + # Build the closing tag. + close_tag_li = '</li>' + + # Multi-list recursive routine. + # Here we check the _next_ items for a multi-list. If we + # find one, we extract all items of the multi-list and + # process them recursively. + if len(items): + inlist = [] + + # Grab all the items that start with # or *. + n_item = items.pop(0) + + # Grab the <ol> parameters. + p = re.compile(r'''^%(olattr)s''' % self.res, re.VERBOSE) + m = p.match(n_item) + if m: + c = m.groupdict('') + olparameters = c['olparameters'] + tmp = p.sub('', n_item) + else: + olparameters = '' + + # Check for an ordered list inside this one. + if tmp.startswith('#'): + n_item = tmp + inlist.append(n_item) + while len(items): + # Peek into the next item. + n_item = items.pop(0) + if n_item.startswith('#'): + inlist.append(n_item) + else: + items.insert(0, n_item) + break + + inlist = self.ol('\n'.join(inlist), olparameters=olparameters) + item = item + '\n' + inlist + '\n' + + # Check for an unordered list inside this one. + elif tmp.startswith('*'): + n_item = tmp + inlist.append(n_item) + while len(items): + # Peek into the next item. + n_item = items.pop(0) + if n_item.startswith('*'): + inlist.append(n_item) + else: + items.insert(0, n_item) + break + + inlist = self.ul('\n'.join(inlist), olparameters=olparameters) + item = item + '\n' + inlist + '\n' + + # Otherwise we just put it back in the list. + else: + items.insert(0, n_item) + + item = self.inline(item) + + item = open_tag_li + item + close_tag_li + lines.append(item) + + return '\n'.join(lines) + + + def ol(self, text, liparameters=None, olparameters=None, clear=None): + """Build an ordered list. + + This function basically just sets the <ol></ol> with the + right attributes, and then pass everything inside to + _build_li, which does the real tough recursive job. + + --- + h1. Ordered lists + + Ordered lists can be constructed this way: + + pre. # Item number 1. + # Item number 2. + # Item number 3. + + And you get: + + pre. <ol> + <li>Item number 1.</li> + <li>Item number 2.</li> + <li>Item number 3.</li> + </ol> + + If you want a list to "break" an extended block, you should + add a period after the hash. This is useful for writing + Python code: + + pre.. bc[python].. #!/usr/bin/env python + + # This is a comment, not an ordered list! + # So this won't break the extended "bc". + + p. Lists can be nested: + + pre. # Item number 1. + ## Item number 1a. + ## Item number 1b. + # Item number 2. + ## Item number 2a. + + Textile will transform this to: + + pre. <ol> + <li>Item number 1. + <ol> + <li>Item number 1a.</li> + <li>Item number 1b.</li> + </ol> + </li> + <li>Item number 2. + <ol> + <li>Item number 2a.</li> + </ol> + </li> + </ol> + + You can also mix ordered and unordered lists: + + pre. * To write well you need: + *# to read every day + *# to write every day + *# and X + + You'll get this: + + pre. <ul> + <li>To write well you need: + <ol> + <li>to read every day</li> + <li>to write every day</li> + <li>and X</li> + </ol> + </li> + </ul> + + To style a list, the parameters should go before the hash if you want + to set the attributes on the @<ol>@ tag: + + pre. (class#id)# one + # two + # three + + If you want to customize the firsr @<li>@ tag, apply the parameters + after the hash: + + pre. #(class#id) one + # two + # three + """ + # Get the attributes. + olattributes = self.parse_params(olparameters, clear) + liattributes = self.parse_params(liparameters) + + # Remove list depth. + if text.startswith('#'): + text = text[1:] + + items = text.split('\n#') + + # Build the open tag. + open_tag = self.build_open_tag('ol', olattributes) + '\n' + + close_tag = '\n</ol>' + + # Build the list items. + text = self.build_li(items, liattributes) + + return open_tag + text + close_tag + + + def ul(self, text, liparameters=None, olparameters=None, clear=None): + """Build an unordered list. + + This function basically just sets the <ul></ul> with the + right attributes, and then pass everything inside to + _build_li, which does the real tough recursive job. + + --- + h1. Unordered lists + + Unordered lists behave exactly like the ordered lists, and are + defined using a star: + + pre. * Python + * Perl + * PHP + + Becomes: + + pre. <ul> + <li>Python</li> + <li>Perl</li> + <li><span class="caps">PHP</span></li> + </ul> + """ + # Get the attributes. + olattributes = self.parse_params(olparameters, clear) + liattributes = self.parse_params(liparameters) + + # Remove list depth. + if text.startswith('*'): + text = text[1:] + + items = text.split('\n*') + + # Build the open tag. + open_tag = self.build_open_tag('ul', olattributes) + '\n' + + close_tag = '\n</ul>' + + # Build the list items. + text = self.build_li(items, liattributes) + + return open_tag + text + close_tag + + + def table(self, text, parameters=None, clear=None): + """Build a table. + + To build a table we split the text in lines to get the + rows, and split the rows between '|' to get the individual + cells. + + --- + h1. Tables + + Making a simple table is as easy as possible: + + pre. |a|b|c| + |1|2|3| + + Will be processed into: + + pre. <table> + <tr> + <td>a</td> + <td>b</td> + <td>c</td> + </tr> + <tr> + <td>1</td> + <td>2</td> + <td>3</td> + </tr> + </table> + + If you want to customize the @<table>@ tag, you must use the + @table@ signature: + + pre. table(class#id)[en]. |a|b|c| + |1|2|3| + + To customize a row, apply the modifier _before_ the first @|@: + + pre. table. (class)<>|a|b|c| + |1|2|3| + + Individual cells can by customized by adding the parameters _after_ + the @|@, proceded by a period and a space: + + pre. |(#id). a|b|c| + |1|2|3| + + The allowed modifiers are: + + dl. {style rule}:A CSS(Cascading Style Sheets) style rule. + (class) or (#id) or (class#id):A CSS(Cascading Style Sheets) class and/or id attribute. + ( (one or more):Adds 1em of padding to the left for each '(' character. + ) (one or more):Adds 1em of padding to the right for each ')' character. + <:Aligns to the left (floats to left for tables if combined with the ')' modifier). + >:Aligns to the right (floats to right for tables if combined with the '(' modifier). + =:Aligns to center (sets left, right margins to 'auto' for tables). + <>:For cells only. Justifies text. + ^:For rows and cells only. Aligns to the top. + ~ (tilde):For rows and cells only. Aligns to the bottom. + _ (underscore):Can be applied to a table row or cell to indicate a header row or cell. + \\2 or \\3 or \\4, etc.:Used within cells to indicate a colspan of 2, 3, 4, etc. columns. When you see "\\", think "push forward". + /2 or /3 or /4, etc.:Used within cells to indicate a rowspan of 2, 3, 4, etc. rows. When you see "/", think "push downward". + + When a cell is identified as a header cell and an alignment is + specified, that becomes the default alignment for cells below it. + You can always override this behavior by specifying an alignment + for one of the lower cells. + """ + attributes = self.parse_params(parameters, clear, align_type='table') + #attributes['cellspacing'] = '0' + + # Build the <table>. + open_tag = self.build_open_tag('table', attributes) + '\n' + close_tag = '</table>' + + output = [] + default_align = {} + rows = re.split(r'''\n+''', text) + for row in rows: + # Get the columns. + columns = row.split('|') + + # Build the <tr>. + parameters = columns.pop(0) + + rowattr = self.parse_params(parameters, align_type='table') + open_tr = self.build_open_tag('tr', rowattr) + '\n' + output.append(open_tr) + + # Does the row define headers? + if parameters.count('_'): + td_tag = 'th' + else: + td_tag = 'td' + + col = 0 + for cell in columns[:-1]: + p = re.compile(r'''(?:%(tattr)s\.\s)?(?P<text>.*)''' % self.res, re.VERBOSE) + m = p.match(cell) + if m: + c = m.groupdict('') + cellattr = self.parse_params(c['parameters'], align_type='table') + + # Get the width of this cell. + width = cellattr.get('colspan', 1) + + # Is this a header? + if c['parameters'].count('_'): + td_tag = 'th' + + # If it is a header, let's set the default alignment. + if td_tag == 'th': + # Set the default aligment for all cells below this one. + # This is a little tricky because this header can have + # a colspan set. + for i in range(col, col+width): + default_align[i] = cellattr.get('align', None) + + else: + # Apply the default align, if any. + cellattr['align'] = cellattr.get('align', default_align.get(col, None)) + + open_td = self.build_open_tag(td_tag, cellattr) + close_td = '</%s>\n' % td_tag + + #output.append(open_td + c['text'].strip() + close_td) + output.append(open_td + self.inline(c['text'].strip()) + close_td) + + col += width + + output.append('</tr>\n') + + text = open_tag + ''.join(output) + close_tag + + return text + + + def escape(self, text): + """Do nothing. + + This is used to match escaped text. Nothing to see here! + + --- + h1. Escaping + + If you don't want Textile processing a block, you can simply + enclose it inside @==@: + + pre. p. Regular paragraph + + pre. == + Escaped portion -- will not be formatted + by Textile at all + == + + pre. p. Back to normal. + + This can also be used inline, disabling the formatting temporarily: + + pre. p. This is ==*a test*== of escaping. + """ + return text + + + def itex(self, text): + """Convert itex to MathML. + + If the itex2mml binary is set, we use it to convert the + itex to MathML. Otherwise, the text is unprocessed and + return as is. + + --- + h1. itex + + Textile can automatically convert itex code to MathML(Mathematical Markup Language) + for you, if you have the itex2MML binary (you can download it + from the "Movable Type plugin":http://golem.ph.utexas.edu/~distler/blog/files/itexToMML.tar.gz). + + Block equations should be enclosed inbetween @\[@ and @\]@: + + pre. \[ e^{i\pi} + 1 = 0 \] + + Will be translated to: + + pre. <math xmlns='http://www.w3.org/1998/Math/MathML' mode='display'> + <msup><mi>e</mi> <mrow><mi>i</mi> + <mi>&pi;</mi></mrow></msup> + <mo>+</mo><mn>1</mn><mo>=</mo><mn>0</mn> + </math> + + Equations can also be displayed inline: + + pre. Euler's formula, $e^{i\pi}+1=0$, ... + + (Note that if you want to display MathML(Mathematical Markup Language) + your content must be served as @application/xhtml+xml@, which is not + accepted by all browsers.) + """ + if itex2mml: + try: + text = os.popen("echo '%s' | %s" % (text, itex2mml)).read() + except: + pass + + return text + + + def about(self, text=None): + """Show PyTextile's functionalities. + + An introduction to PyTextile. Can be called when running the + main script or if you write the following line: + + 'tell me about textile.' + + But keep it a secret! + """ + + about = [] + about.append(textile('h1. This is Textile', head_offset=self.head_offset)) + about.append(textile(__doc__.split('---', 1)[1], head_offset=self.head_offset)) + + functions = [(self.split_text, 1), + (self.paragraph, 2), + (self.pre, 2), + (self.bc, 2), + (self.blockquote, 2), + (self.dl, 2), + (self.header, 2), + (self.footnote, 2), + (self.escape, 2), + (self.itex, 2), + (self.ol, 2), + (self.ul, 2), + (self.table, 2), + (self.inline, 1), + (self.qtags, 2), + (self.glyphs, 2), + (self.macros, 2), + (self.acronym, 2), + (self.images, 1), + (self.links, 1), + (self.sanitize, 1), + ] + + for function, offset in functions: + doc = function.__doc__.split('---', 1)[1] + doc = doc.split('\n') + lines = [] + for line in doc: + line = line.strip() + lines.append(line) + + doc = '\n'.join(lines) + about.append(textile(doc, head_offset=self.head_offset+offset)) + + about = '\n'.join(about) + about = about.replace('<br />', '') + + return about + + + def acronym(self, text): + """Process acronyms. + + Acronyms can have letters in upper and lower caps, or even numbers, + provided that the numbers and upper caps are the same in the + abbreviation and in the description. For example: + + XHTML(eXtensible HyperText Markup Language) + OPeNDAP(Open source Project for a Network Data Access Protocol) + L94(Levitus 94) + + are all valid acronyms. + + --- + h1. Acronyms + + You can define acronyms in your text the following way: + + pre. This is XHTML(eXtensible HyperText Markup Language). + + The resulting code is: + + pre. <p><acronym title="eXtensible HyperText Markup Language"><span class="caps">XHTML</span></acronym></p> + + Acronyms can have letters in upper and lower caps, or even numbers, + provided that the numbers and upper caps are the same in the + abbreviation and in the description. For example: + + pre. XHTML(eXtensible HyperText Markup Language) + OPeNDAP(Open source Project for a Network Data Access Protocol) + L94(Levitus 94) + + are all valid acronyms. + """ + # Find the acronyms. + acronyms = r'''(?P<acronym>[\w]+)\((?P<definition>[^\(\)]+?)\)''' + + # Check all acronyms. + for acronym, definition in re.findall(acronyms, text): + caps_acronym = ''.join(re.findall('[A-Z\d]+', acronym)) + caps_definition = ''.join(re.findall('[A-Z\d]+', definition)) + if caps_acronym and caps_acronym == caps_definition: + text = text.replace('%s(%s)' % (acronym, definition), '<acronym title="%s">%s</acronym>' % (definition, acronym)) + + text = html_replace(r'''(^|\s)([A-Z]{3,})\b(?!\()''', r'''\1<span class="caps">\2</span>''', text) + + return text + + + def footnotes(self, text): + """Add titles to footnotes references. + + This function searches for footnotes references like this [1], and + adds a title to the link containing the first paragraph of the + footnote. + """ + # Search for footnotes. + p = re.compile(r'''<p class="footnote" id="fn(?P<n>\d+)"><sup>(?P=n)</sup>(?P<note>.*)</p>''') + for m in p.finditer(text): + n = m.group('n') + note = m.group('note').strip() + + # Strip HTML from note. + note = re.sub('<.*?>', '', note) + + # Add the title. + text = text.replace('<a href="#fn%s">' % n, '<a href="#fn%s" title="%s">' % (n, note)) + + return text + + + def macros(self, m): + """Quick macros. + + This function replaces macros inside brackets using a built-in + dictionary, and also unicode names if the key doesn't exist. + + --- + h1. Macros + + Textile has support for character macros, which should be enclosed + in curly braces. A few useful ones are: + + pre. {C=} or {=C}: euro sign + {+-} or {-+}: plus-minus sign + {L-} or {-L}: pound sign. + + You can also make accented characters: + + pre. Expos{e'} + + Becomes: + + pre. <p>Expos&#233;</p> + + You can also specify Unicode names like: + + pre. {umbrella} + {white smiling face} + """ + entity = m.group(1) + + macros = {'c|': '¢', # cent sign + '|c': '¢', # cent sign + 'L-': '£', # pound sign + '-L': '£', # pound sign + 'Y=': '¥', # yen sign + '=Y': '¥', # yen sign + '(c)': '©', # copyright sign + '<<': '«', # left-pointing double angle quotation + '(r)': '®', # registered sign + '+_': '±', # plus-minus sign + '_+': '±', # plus-minus sign + '>>': '»', # right-pointing double angle quotation + '1/4': '¼', # vulgar fraction one quarter + '1/2': '½', # vulgar fraction one half + '3/4': '¾', # vulgar fraction three quarters + 'A`': 'À', # latin capital letter a with grave + '`A': 'À', # latin capital letter a with grave + 'A\'': 'Á', # latin capital letter a with acute + '\'A': 'Á', # latin capital letter a with acute + 'A^': 'Â', # latin capital letter a with circumflex + '^A': 'Â', # latin capital letter a with circumflex + 'A~': 'Ã', # latin capital letter a with tilde + '~A': 'Ã', # latin capital letter a with tilde + 'A"': 'Ä', # latin capital letter a with diaeresis + '"A': 'Ä', # latin capital letter a with diaeresis + 'Ao': 'Å', # latin capital letter a with ring above + 'oA': 'Å', # latin capital letter a with ring above + 'AE': 'Æ', # latin capital letter ae + 'C,': 'Ç', # latin capital letter c with cedilla + ',C': 'Ç', # latin capital letter c with cedilla + 'E`': 'È', # latin capital letter e with grave + '`E': 'È', # latin capital letter e with grave + 'E\'': 'É', # latin capital letter e with acute + '\'E': 'É', # latin capital letter e with acute + 'E^': 'Ê', # latin capital letter e with circumflex + '^E': 'Ê', # latin capital letter e with circumflex + 'E"': 'Ë', # latin capital letter e with diaeresis + '"E': 'Ë', # latin capital letter e with diaeresis + 'I`': 'Ì', # latin capital letter i with grave + '`I': 'Ì', # latin capital letter i with grave + 'I\'': 'Í', # latin capital letter i with acute + '\'I': 'Í', # latin capital letter i with acute + 'I^': 'Î', # latin capital letter i with circumflex + '^I': 'Î', # latin capital letter i with circumflex + 'I"': 'Ï', # latin capital letter i with diaeresis + '"I': 'Ï', # latin capital letter i with diaeresis + 'D-': 'Ð', # latin capital letter eth + '-D': 'Ð', # latin capital letter eth + 'N~': 'Ñ', # latin capital letter n with tilde + '~N': 'Ñ', # latin capital letter n with tilde + 'O`': 'Ò', # latin capital letter o with grave + '`O': 'Ò', # latin capital letter o with grave + 'O\'': 'Ó', # latin capital letter o with acute + '\'O': 'Ó', # latin capital letter o with acute + 'O^': 'Ô', # latin capital letter o with circumflex + '^O': 'Ô', # latin capital letter o with circumflex + 'O~': 'Õ', # latin capital letter o with tilde + '~O': 'Õ', # latin capital letter o with tilde + 'O"': 'Ö', # latin capital letter o with diaeresis + '"O': 'Ö', # latin capital letter o with diaeresis + 'O/': 'Ø', # latin capital letter o with stroke + '/O': 'Ø', # latin capital letter o with stroke + 'U`': 'Ù', # latin capital letter u with grave + '`U': 'Ù', # latin capital letter u with grave + 'U\'': 'Ú', # latin capital letter u with acute + '\'U': 'Ú', # latin capital letter u with acute + 'U^': 'Û', # latin capital letter u with circumflex + '^U': 'Û', # latin capital letter u with circumflex + 'U"': 'Ü', # latin capital letter u with diaeresis + '"U': 'Ü', # latin capital letter u with diaeresis + 'Y\'': 'Ý', # latin capital letter y with acute + '\'Y': 'Ý', # latin capital letter y with acute + 'a`': 'à', # latin small letter a with grave + '`a': 'à', # latin small letter a with grave + 'a\'': 'á', # latin small letter a with acute + '\'a': 'á', # latin small letter a with acute + 'a^': 'â', # latin small letter a with circumflex + '^a': 'â', # latin small letter a with circumflex + 'a~': 'ã', # latin small letter a with tilde + '~a': 'ã', # latin small letter a with tilde + 'a"': 'ä', # latin small letter a with diaeresis + '"a': 'ä', # latin small letter a with diaeresis + 'ao': 'å', # latin small letter a with ring above + 'oa': 'å', # latin small letter a with ring above + 'ae': 'æ', # latin small letter ae + 'c,': 'ç', # latin small letter c with cedilla + ',c': 'ç', # latin small letter c with cedilla + 'e`': 'è', # latin small letter e with grave + '`e': 'è', # latin small letter e with grave + 'e\'': 'é', # latin small letter e with acute + '\'e': 'é', # latin small letter e with acute + 'e^': 'ê', # latin small letter e with circumflex + '^e': 'ê', # latin small letter e with circumflex + 'e"': 'ë', # latin small letter e with diaeresis + '"e': 'ë', # latin small letter e with diaeresis + 'i`': 'ì', # latin small letter i with grave + '`i': 'ì', # latin small letter i with grave + 'i\'': 'í', # latin small letter i with acute + '\'i': 'í', # latin small letter i with acute + 'i^': 'î', # latin small letter i with circumflex + '^i': 'î', # latin small letter i with circumflex + 'i"': 'ï', # latin small letter i with diaeresis + '"i': 'ï', # latin small letter i with diaeresis + 'n~': 'ñ', # latin small letter n with tilde + '~n': 'ñ', # latin small letter n with tilde + 'o`': 'ò', # latin small letter o with grave + '`o': 'ò', # latin small letter o with grave + 'o\'': 'ó', # latin small letter o with acute + '\'o': 'ó', # latin small letter o with acute + 'o^': 'ô', # latin small letter o with circumflex + '^o': 'ô', # latin small letter o with circumflex + 'o~': 'õ', # latin small letter o with tilde + '~o': 'õ', # latin small letter o with tilde + 'o"': 'ö', # latin small letter o with diaeresis + '"o': 'ö', # latin small letter o with diaeresis + ':-': '÷', # division sign + '-:': '÷', # division sign + 'o/': 'ø', # latin small letter o with stroke + '/o': 'ø', # latin small letter o with stroke + 'u`': 'ù', # latin small letter u with grave + '`u': 'ù', # latin small letter u with grave + 'u\'': 'ú', # latin small letter u with acute + '\'u': 'ú', # latin small letter u with acute + 'u^': 'û', # latin small letter u with circumflex + '^u': 'û', # latin small letter u with circumflex + 'u"': 'ü', # latin small letter u with diaeresis + '"u': 'ü', # latin small letter u with diaeresis + 'y\'': 'ý', # latin small letter y with acute + '\'y': 'ý', # latin small letter y with acute + 'y"': 'ÿ', # latin small letter y with diaeresis + '"y': 'ÿ', # latin small letter y with diaeresis + 'OE': 'Œ', # latin capital ligature oe + 'oe': 'œ', # latin small ligature oe + '*': '•', # bullet + 'Fr': '₣', # french franc sign + 'L=': '₤', # lira sign + '=L': '₤', # lira sign + 'Rs': '₨', # rupee sign + 'C=': '€', # euro sign + '=C': '€', # euro sign + 'tm': '™', # trade mark sign + '<-': '←', # leftwards arrow + '->': '→', # rightwards arrow + '<=': '⇐', # leftwards double arrow + '=>': '⇒', # rightwards double arrow + '=/': '≠', # not equal to + '/=': '≠', # not equal to + '<_': '≤', # less-than or equal to + '_<': '≤', # less-than or equal to + '>_': '≥', # greater-than or equal to + '_>': '≥', # greater-than or equal to + ':(': '☹', # white frowning face + ':)': '☺', # white smiling face + 'spade': '♠', # black spade suit + 'club': '♣', # black club suit + 'heart': '♥', # black heart suit + 'diamond': '♦', # black diamond suit + } + + try: + # Try the key. + entity = macros[entity] + except KeyError: + try: + # Try a unicode entity. + entity = unicodedata.lookup(entity) + entity = entity.encode('ascii', 'xmlcharrefreplace') + except: + # Return the unmodified entity. + entity = '{%s}' % entity + + return entity + + + def glyphs(self, text): + """Glyph formatting. + + This function replaces quotations marks, dashes and a few other + symbol for numerical entities. The em/en dashes use definitions + comes from http://alistapart.com/articles/emen/. + + --- + h1. Glyphs + + Textile replaces some of the characters in your text with their + equivalent numerical entities. These include: + + * Replace single and double primes used as quotation marks with HTML(HyperText Markup Language) entities for opening and closing quotation marks in readable text, while leaving untouched the primes required within HTML(HyperText Markup Language) tags. + * Replace double hyphens (==--==) with an em-dash (—) entity. + * Replace triple hyphens (==---==) with two em-dash (——) entities. + * Replace single hyphens surrounded by spaces with an en-dash (–) entity. + * Replace triplets of periods (==...==) with an ellipsis (…) entity. + * Convert many nonstandard characters to browser-safe entities corresponding to keyboard input. + * Convert ==(TM)==, ==(R)==, and ==(C)== to ™, ®, and ©. + * Convert the letter x to a dimension sign: 2==x==4 to 2x4 and 8 ==x== 10 to 8x10. + """ + glyphs = [(r'''"(?<!\w)\b''', r'''“'''), # double quotes + (r'''"''', r'''”'''), # double quotes + (r"""\b'""", r'''’'''), # single quotes + (r"""'(?<!\w)\b""", r'''‘'''), # single quotes + (r"""'""", r'''’'''), # single single quote + (r'''(\b|^)( )?\.{3}''', r'''\1…'''), # ellipsis + (r'''\b---\b''', r'''——'''), # double em dash + (r'''\s?--\s?''', r'''—'''), # em dash + (r'''(\d+)-(\d+)''', r'''\1–\2'''), # en dash (1954-1999) + (r'''(\d+)-(\W)''', r'''\1—\2'''), # em dash (1954--) + (r'''\s-\s''', r''' – '''), # en dash + (r'''(\d+) ?x ?(\d+)''', r'''\1×\2'''), # dimension sign + (r'''\b ?(\((tm|TM)\))''', r'''™'''), # trademark + (r'''\b ?(\([rR]\))''', r'''®'''), # registered + (r'''\b ?(\([cC]\))''', r'''©'''), # copyright + (r'''([^\s])\[(\d+)\]''', # + r'''\1<sup class="footnote"><a href="#fn\2">\2</a></sup>'''),# footnote + ] + + # Apply macros. + text = re.sub(r'''{([^}]+)}''', self.macros, text) + + # LaTeX style quotes. + text = text.replace('\x60\x60', '“') + text = text.replace('\xb4\xb4', '”') + + # Linkify URL and emails. + 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) + ) # + (?::\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 " + )* # + )?) # + ''' + + email = r'''(?:mailto:)? # Optional mailto: + ([-\+\w]+ # username + \@ # at + [-\w]+(?:\.\w[-\w]*)+) # hostname + ''' + + # If there is no html, do a simple search and replace. + if not re.search(r'''<.*>''', text): + for glyph_search, glyph_replace in glyphs: + text = preg_replace(glyph_search, glyph_replace, text) + + # Linkify. + text = re.sub(re.compile(url, re.VERBOSE), r'''<a href="\1">\1</a>''', text) + text = re.sub(re.compile(email, re.VERBOSE), r'''<a href="mailto:\1">\1</a>''', text) + + else: + lines = [] + # Else split the text into an array at <>. + for line in re.split('(<.*?>)', text): + if not re.match('<.*?>', line): + for glyph_search, glyph_replace in glyphs: + line = preg_replace(glyph_search, glyph_replace, line) + + # Linkify. + line = re.sub(re.compile(url, re.VERBOSE), r'''<a href="\1">\1</a>''', line) + line = re.sub(re.compile(email, re.VERBOSE), r'''<a href="mailto:\1">\1</a>''', line) + + lines.append(line) + + text = ''.join(lines) + + return text + + + def qtags(self, text): + """Quick tags formatting. + + This function does the inline formatting of text, like + bold, italic, strong and also itex code. + + --- + h1. Quick tags + + Quick tags allow you to format your text, making it bold, + emphasized or small, for example. The quick tags operators + include: + + dl. ==*strong*==:Translates into @<strong>strong</strong>@. + ==_emphasis_==:Translates into @<em>emphasis</em>@. + ==**bold**==:Translates into @<b>bold</b>@. + ==__italics__==:Translates into @<i>italics</i>@. + ==++bigger++==:Translates into @<big>bigger</big>@. + ==--smaller--==:Translates into: @<small>smaller</small>@. + ==-deleted text-==:Translates into @<del>deleted text</del>@. + ==+inserted text+==:Translates into @<ins>inserted text</ins>@. + ==^superscript^==:Translates into @<sup>superscript</sup>@. + ==~subscript~==:Translates into @<sub>subscript</sub>@. + ==%span%==:Translates into @<span>span</span>@. + ==@code@==:Translates into @<code>code</code>@. + + Note that within a "==@==...==@==" section, @<@ and @>@ are + translated into HTML entities automatically. + + Inline formatting operators accept the following modifiers: + + 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. + """ + # itex2mml. + text = re.sub('\$(.*?)\$', lambda m: self.itex(m.group()), text) + + # Add span tags to upper-case words which don't have a description. + #text = preg_replace(r'''(^|\s)([A-Z]{3,})\b(?!\()''', r'''\1<span class="caps">\2</span>''', text) + + # Quick tags. + qtags = [('**', 'b', {'qf': '(?<!\*)\*\*(?!\*)', 'cls': '\*'}), + ('__', 'i', {'qf': '(?<!_)__(?!_)', 'cls': '_'}), + ('??', 'cite', {'qf': '\?\?(?!\?)', 'cls': '\?'}), + ('-', 'del', {'qf': '(?<!\-)\-(?!\-)', 'cls': '-'}), + ('+', 'ins', {'qf': '(?<!\+)\+(?!\+)', 'cls': '\+'}), + ('*', 'strong', {'qf': '(?<!\*)\*(?!\*)', 'cls': '\*'}), + ('_', 'em', {'qf': '(?<!_)_(?!_)', 'cls': '_'}), + ('++', 'big', {'qf': '(?<!\+)\+\+(?!\+)', 'cls': '\+\+'}), + ('--', 'small', {'qf': '(?<!\-)\-\-(?!\-)', 'cls': '\-\-'}), + ('~', 'sub', {'qf': '(?<!\~)\~(?!(\\\/~))', 'cls': '\~'}), + ('@', 'code', {'qf': '(?<!@)@(?!@)', 'cls': '@'}), + ('%', 'span', {'qf': '(?<!%)%(?!%)', 'cls': '%'}), + ] + + # Superscript. + text = re.sub(r'''(?<!\^)\^(?!\^)(.+?)(?<!\^)\^(?!\^)''', r'''<sup>\1</sup>''', text) + + # This is from the perl version of Textile. + for qtag, htmltag, redict in qtags: + self.res.update(redict) + p = re.compile(r'''(?: # + ^ # Start of string + | # + (?<=[\s>'"]) # Whitespace, end of tag, quotes + | # + (?P<pre>[{[]) # Surrounded by [ or { + | # + (?<=%(punct)s) # Punctuation + ) # + %(qf)s # opening tag + %(qattr)s # attributes + (?P<text>[^%(cls)s\s].*?) # text + (?<=\S) # non-whitespace + %(qf)s # + (?: # + $ # End of string + | # + (?P<post>[\]}]) # Surrounded by ] or } + | # + (?=%(punct)s{1,2}|\s) # punctuation + ) # + ''' % self.res, re.VERBOSE) + + def _replace(m): + c = m.groupdict('') + + attributes = self.parse_params(c['parameters']) + open_tag = self.build_open_tag(htmltag, attributes) + close_tag = '</%s>' % htmltag + + # Replace < and > inside <code></code>. + if htmltag == 'code': + c['text'] = c['text'].replace('<', '<') + c['text'] = c['text'].replace('>', '>') + + return open_tag + c['text'] + close_tag + + text = p.sub(_replace, text) + + return text + + + def images(self, text): + """Process images. + + This function process images tags, with or without links. Images + can have vertical and/or horizontal alignment, and can be resized + unefficiently using width and height tags. + + --- + h1. Images + + An image is generated by enclosing the image source in @!@: + + pre. !/path/to/image! + + You may optionally specify an alternative text for the image, which + will also be used as its title: + + pre. !image.jpg (Nice picture)! + + Becomes: + + pre. <p><img src="image.jpg" alt="Nice picture" title="Nice picture" /></p> + + If you want to make the image point to a link, simply append a + comma and the URL(Universal Republic of Love) to the image: + + pre. !image.jpg!:http://diveintopython.org + + Images can also be resized. These are all equivalent: + + pre. !image.jpg 10x20! + !image.jpg 10w 20h! + !image.jpg 20h 10w! + + The image @image.jpg@ will be resized to width 10 and height 20. + + Modifiers to the @<img>@ tag go after the opening @!@: + + pre. !(class#id)^image.jpg! + + Allowed modifiers include: + + dl. <:Align the image to the left (causes the image to float if CSS options are enabled). + >:Align the image to the right (causes the image to float if CSS options are enabled). + - (dash):Aligns the image to the middle. + ^:Aligns the image to the top. + ~ (tilde):Aligns the image to the bottom. + {style rule}:Applies a CSS style rule to the image. + (class) or (#id) or (class#id):Applies a CSS class and/or id to the image. + ( (one or more):Pads 1em on the left for each '(' character. + ) (one or more):Pads 1em on the right for each ')' character. + + Images receive the class "top" when using top alignment, "bottom" + for bottom alignment and "middle" for middle alignment. + """ + # Compile the beast. + p = re.compile(r'''\! # Opening ! + %(iattr)s # Image attributes + (?P<src>%(url)s) # Image src + \s? # Optional whitesapce + ( # + \( # + (?P<alt>.*?) # Optional (alt) attribute + \) # + )? # + \s? # Optional whitespace + %(resize)s # Resize parameters + \! # Closing ! + ( # Optional link + : # starts with ':' + (?P<link> # + %(url)s # link HREF + ) # + )? # + ''' % self.res, re.VERBOSE) + + for m in p.finditer(text): + c = m.groupdict('') + + # Build the parameters for the <img /> tag. + attributes = self.parse_params(c['parameters'], align_type='image') + attributes.update(c) + if attributes['alt']: + attributes['title'] = attributes['alt'] + + # Append height and width. + attributes['width'] = m.groups()[5] or m.groups()[7] or m.groups()[10] + attributes['height'] = m.groups()[6] or m.groups()[8] or m.groups()[9] + + # Create the image tag. + tag = self.image(attributes) + + text = text.replace(m.group(), tag) + + return text + + + def image(self, attributes): + """Process each image. + + This method builds the <img> tag for each image in the text. It's + separated from the 'images' method so it can be easily overriden when + subclassing Textiler. Useful if you want to download and/or process + the images, for example. + """ + link = attributes['link'] + del attributes['link'] + del attributes['parameters'] + + # Build the tag. + tag = self.build_open_tag('img', attributes, single=1) + + if link: + href = preg_replace('&(?!(#|amp))', '&', link) + tag = '<a href="%s">%s</a>' % (href, tag) + + return tag + + + def links(self, text): + """Process links. + + This function is responsible for processing links. It has + some nice shortcuts to Google, Amazon and IMDB queries. + + --- + h1. Links + + A links is done the following way: + + pre. "This is the text link":http://example.com + + The result from this markup is: + + pre. <p><a href="http://example.com">This is the text link</a></p> + + You can add an optional @title@ attribute: + + pre. "This is the text link(This is the title)":http://example.com + + The link can be customised as well: + + pre. "(nospam)E-mail me please":mailto:someone@example.com + + You can use either single or double quotes. They must be enclosed in + whitespace, punctuation or brackets: + + pre. You["gotta":http://example.com]seethis! + + If you are going to reference the same link a couple of times, you + can define a lookup list anywhere on your document: + + pre. [python]http://www.python.org + + Links to the Python website can then be defined the following way: + + pre. "Check this":python + + There are also shortcuts for Amazon, IMDB(Internet Movie DataBase) and + Google queries: + + pre. "Has anyone seen this guy?":imdb:Stephen+Fry + "Really nice book":amazon:Goedel+Escher+Bach + "PyBlosxom":google + ["Using Textile and Blosxom with Python":google:python blosxom textile] + + Becomes: + + pre. <a href="http://www.imdb.com/Find?for=Stephen+Fry">Has anyone seen this guy?</a> + <a href="http://www.amazon.com/exec/obidos/external-search?index=blended&keyword=Goedel+Escher+Bach">Really nice book</a> + <a href="http://www.google.com/search?q=PyBlosxom">PyBlosxom</a> + <a href="http://www.google.com/search?q=python+blosxom+textile">Using Textile and Blosxom with Python</a> + """ + linkres = [r'''\[ # [ + (?P<quote>"|') # Opening quotes + %(lattr)s # Link attributes + (?P<text>[^"]+?) # Link text + \s? # Optional whitespace + (?:\((?P<title>[^\)]+?)\))? # Optional (title) + (?P=quote) # Closing quotes + : # : + (?P<href>[^\]]+) # HREF + \] # ] + ''' % self.res, + r'''(?P<quote>"|') # Opening quotes + %(lattr)s # Link attributes + (?P<text>[^"]+?) # Link text + \s? # Optional whitespace + (?:\((?P<title>[^\)]+?)\))? # Optional (title) + (?P=quote) # Closing quotes + : # : + (?P<href>%(url)s) # HREF + ''' % self.res] + + for linkre in linkres: + p = re.compile(linkre, re.VERBOSE) + for m in p.finditer(text): + c = m.groupdict('') + + attributes = self.parse_params(c['parameters']) + attributes['title'] = c['title'].replace('"', '"') + + # Search lookup list. + link = self._links.get(c['href'], None) or c['href'] + + # Hyperlinks for Amazon, IMDB and Google searches. + parts = link.split(':', 1) + proto = parts[0] + if len(parts) == 2: + query = parts[1] + else: + query = c['text'] + + query = query.replace(' ', '+') + + # Look for smart search. + if self.searches.has_key(proto): + link = self.searches[proto] % query + + # Fix URL. + attributes['href'] = preg_replace('&(?!(#|amp))', '&', link) + + open_tag = self.build_open_tag('a', attributes) + close_tag = '</a>' + + repl = open_tag + c['text'] + close_tag + + text = text.replace(m.group(), repl) + + return text + + + def format(self, text): + """Text formatting. + + This function basically defines the order on which the + formatting is applied. + """ + text = self.qtags(text) + text = self.images(text) + text = self.links(text) + text = self.acronym(text) + text = self.glyphs(text) + + return text + + + def inline(self, text): + """Inline formatting. + + This function calls the formatting on the inline text, + taking care to avoid the escaped parts. + + --- + h1. Inline + + Inline formatting is applied within a block of text. + """ + if not re.search(r'''==(.*?)==''', text): + text = self.format(text) + + else: + lines = [] + # Else split the text into an array at <>. + for line in re.split('(==.*?==)', text): + if not re.match('==.*?==', line): + line = self.format(line) + else: + line = line[2:-2] + + lines.append(line) + + text = ''.join(lines) + + return text + + +def textile(text, **args): + """This is Textile. + + Generates XHTML from a simple markup developed by Dean Allen. + + This function should be called like this: + + textile(text, head_offset=0, validate=0, sanitize=0, + encoding='latin-1', output='ASCII') + """ + return Textiler(text).process(**args) + + +if __name__ == '__main__': + print textile('tell me about textile.', head_offset=1) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/textutil.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/textutil.py new file mode 100644 index 0000000000..4498413797 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/textutil.py @@ -0,0 +1,162 @@ +#!/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, optparse +import config, filetool, comment + + + + +def convertMac2Unix(content): + return content.replace("\r", "\n") + +def convertMac2Dos(content): + return content.replace("\r", "\r\n") + +def convertDos2Unix(content): + return content.replace("\r\n", "\n") + +def convertDos2Mac(content): + return content.replace("\r\n", "\r") + +def convertUnix2Dos(content): + return content.replace("\n", "\r\n") + +def convertUnix2Mac(content): + return content.replace("\n", "\r") + + + + +def any2Unix(content): + # DOS must be first, because it is a combination of Unix & Mac + return convertMac2Unix(convertDos2Unix(content)) + +def any2Dos(content): + # to protect old DOS breaks first, we need to convert to + # a line ending with single character first e.g. Unix + return convertUnix2Dos(any2Unix(content)) + +def any2Mac(content): + # to protect old DOS breaks first, we need to convert to + # a line ending with single character first e.g. Unix + return convertUnix2Mac(any2Unix(content)) + + + +def getLineEndingName(content): + if "\r\n" in content: + return "dos" + + if "\r" in content: + return "mac" + + # defaults to unix + return "unix" + +def getLineEndingSequence(content): + if "\r\n" in content: + return "\r\n" + + if "\r" in content: + return "\r" + + # defaults to unix + return "\n" + + + +def tab2Space(content, spaces=2): + return content.replace("\t", " " * spaces) + +def spaces2Tab(content, spaces=2): + return content.replace(" " * spaces, "\t") + + + +def removeTrailingSpaces(content): + ending = getLineEndingSequence(content) + lines = content.split(ending) + length = len(lines) + pos = 0 + + while pos < length: + lines[pos] = lines[pos].rstrip() + pos += 1 + + return ending.join(lines) + + +def toRegExp(text): + return re.compile("^(" + text.replace('.', '\\.').replace('*', '.*').replace('?', '.?') + ")$") + + + + + + + + + + + +def main(): + allowed = [ "any2Dos", "any2Mac", "any2Unix", "convertDos2Mac", "convertDos2Unix", "convertMac2Dos", "convertMac2Unix", "convertUnix2Dos", "convertUnix2Mac", "spaces2Tab", "tab2Space" ] + + parser = optparse.OptionParser() + + 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("-c", "--command", dest="command", default="normalize", help="Normalize a file") + 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 not options.command in allowed: + print "Unallowed command: %s" % options.command + sys.exit(1) + + if len(args) == 0: + print "Needs one or more arguments (files) to modify!" + sys.exit(1) + + for fileName in args: + if options.verbose: + print " * Running %s on: %s" % (options.command, fileName) + + origFileContent = filetool.read(fileName, options.encoding) + patchedFileContent = eval(options.command + "(origFileContent)") + + if patchedFileContent != origFileContent: + filetool.save(fileName, patchedFileContent, options.encoding) + + + + + +if __name__ == '__main__': + try: + main() + + except KeyboardInterrupt: + print + print " * Keyboard Interrupt" + sys.exit(1) +
\ No newline at end of file diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/tokenizer.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/tokenizer.py new file mode 100755 index 0000000000..95376770fb --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/tokenizer.py @@ -0,0 +1,372 @@ +#!/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, filetool, comment + +R_WHITESPACE = re.compile(r"(\s+)") +R_NONWHITESPACE = re.compile("\S+") +R_NUMBER = re.compile("^[0-9]+") +R_NEWLINE = re.compile(r"(\n)") + +# Ideas from: http://www.regular-expressions.info/examplesprogrammer.html +# Multicomment RegExp inspired by: http://ostermiller.org/findcomment.html + +# builds regexp strings +S_STRING_A = "'[^'\\\n]*(\\.|\n[^'\\\n]*)*'" +S_STRING_B = '"[^"\\\n]*(\\.|\n[^"\\\n]*)*"' + +S_FLOAT = "([0-9]+\.[0-9]+)" + +S_OPERATORS_2 = r"(==)|(!=)|(\+\+)|(--)|(-=)|(\+=)|(\*=)|(/=)|(%=)|(&&)|(\|\|)|(\>=)|(\<=)|(>>)|(<<)|(\^\|)|(\|=)|(\^=)|(&=)|(::)|(\.\.)" +S_OPERATORS_3 = r"(===)|(!==)|(\<\<=)|(\>\>=)|(\>\>\>)" +S_OPERATORS_4 = r"(\>\>\>=)" +S_OPERATORS = "(" + S_OPERATORS_4 + "|" + S_OPERATORS_3 + "|" + S_OPERATORS_2 + ")" + +S_REGEXP = "(\/[^\t\n\r\f\v\/]+?\/[mgi]*)" +S_REGEXP_A = "\.(match|search|split)\s*\(\s*\(*\s*" + S_REGEXP + "\s*\)*\s*\)" +S_REGEXP_B = "\.(replace)\s*\(\s*\(*\s*" + S_REGEXP + "\s*\)*\s*?,?" +S_REGEXP_C = "\s*\(*\s*" + S_REGEXP + "\)*\.(test|exec)\s*\(\s*" +S_REGEXP_D = "(:|=|\?)\s*\(*\s*" + S_REGEXP + "\s*\)*" +S_REGEXP_ALL = S_REGEXP_A + "|" + S_REGEXP_B + "|" + S_REGEXP_C + "|" + S_REGEXP_D + +S_ALL = "(" + comment.S_BLOCK_COMMENT + "|" + comment.S_INLINE_COMMENT + "|" + S_STRING_A + "|" + S_STRING_B + "|" + S_REGEXP_ALL + "|" + S_FLOAT + "|" + S_OPERATORS + ")" + +# compile regexp strings +R_STRING_A = re.compile("^" + S_STRING_A + "$") +R_STRING_B = re.compile("^" + S_STRING_B + "$") +R_FLOAT = re.compile("^" + S_FLOAT + "$") +R_OPERATORS = re.compile(S_OPERATORS) +R_REGEXP = re.compile(S_REGEXP) +R_REGEXP_A = re.compile(S_REGEXP_A) +R_REGEXP_B = re.compile(S_REGEXP_B) +R_REGEXP_C = re.compile(S_REGEXP_C) +R_REGEXP_D = re.compile(S_REGEXP_D) +R_ALL = re.compile(S_ALL) + + + + +parseLine = 1 +parseColumn = 1 +parseUniqueId = "" + + + +def protectEscape(s): + return s.replace("\\\\", "__$ESCAPE0$__").replace("\\\"", "__$ESCAPE1$__").replace("\\\'", "__$ESCAPE2__").replace("\/", "__$ESCAPE3__").replace("\!", "__$ESCAPE4__") + + + +def recoverEscape(s): + return s.replace("__$ESCAPE0$__", "\\\\").replace("__$ESCAPE1$__", "\\\"").replace("__$ESCAPE2__", "\\'").replace("__$ESCAPE3__", "\/").replace("__$ESCAPE4__", "\!") + + + +def parseElement(element): + global parseUniqueId + global parseLine + global parseColumn + + if config.JSPROTECTED.has_key(element): + # print "PROTECTED: %s" % PROTECTED[content] + obj = { "type" : "protected", "detail" : config.JSPROTECTED[element], "source" : element, "line" : parseLine, "column" : parseColumn, "id" : parseUniqueId } + + elif element in config.JSBUILTIN: + # print "BUILTIN: %s" % content + obj = { "type" : "builtin", "detail" : "", "source" : element, "line" : parseLine, "column" : parseColumn, "id" : parseUniqueId } + + elif R_NUMBER.search(element): + # print "NUMBER: %s" % content + obj = { "type" : "number", "detail" : "int", "source" : element, "line" : parseLine, "column" : parseColumn, "id" : parseUniqueId } + + elif element.startswith("_"): + # print "PRIVATE NAME: %s" % content + obj = { "type" : "name", "detail" : "private", "source" : element, "line" : parseLine, "column" : parseColumn, "id" : parseUniqueId } + + elif len(element) > 0: + # print "PUBLIC NAME: %s" % content + obj = { "type" : "name", "detail" : "public", "source" : element, "line" : parseLine, "column" : parseColumn, "id" : parseUniqueId } + + parseColumn += len(element) + + return obj + + +def parsePart(part): + global parseUniqueId + global parseLine + global parseColumn + + tokens = [] + element = "" + + for line in R_NEWLINE.split(part): + if line == "\n": + tokens.append({ "type" : "eol", "source" : "", "detail" : "", "line" : parseLine, "column" : parseColumn, "id" : parseUniqueId }) + parseColumn = 1 + parseLine += 1 + + else: + for item in R_WHITESPACE.split(line): + if item == "": + continue + + if not R_NONWHITESPACE.search(item): + parseColumn += len(item) + continue + + # print "ITEM: '%s'" % item + + for char in item: + # work on single character tokens, otherwise concat to a bigger element + if config.JSTOKENS.has_key(char): + # convert existing element + if element != "": + if R_NONWHITESPACE.search(element): + tokens.append(parseElement(element)) + + element = "" + + # add character to token list + tokens.append({ "type" : "token", "detail" : config.JSTOKENS[char], "source" : char, "line" : parseLine, "column" : parseColumn, "id" : parseUniqueId }) + parseColumn += 1 + + else: + element += char + + # convert remaining stuff to tokens + if element != "": + if R_NONWHITESPACE.search(element): + tokens.append(parseElement(element)) + + element = "" + + return tokens + + + +def parseFragmentLead(content, fragment, tokens): + pos = content.find(fragment) + + if pos > 0: + tokens.extend(parsePart(recoverEscape(content[0:pos]))) + + return content[pos+len(fragment):] + + + +def hasLeadingContent(tokens): + pos = len(tokens) - 1 + while pos > 0: + if tokens[pos]["type"] == "eol": + break + + else: + return True + + return False + + + + + +def parseStream(content, uniqueId=""): + # make global variables available + global parseLine + global parseColumn + global parseUniqueId + + # reset global stuff + parseColumn = 1 + parseLine = 1 + parseUniqueId = uniqueId + + # prepare storage + tokens = [] + content = protectEscape(content) + + # print " * searching for patterns..." + all = R_ALL.findall(content) + + # print " * structuring..." + for item in all: + fragment = item[0] + + # print "Found: '%s'" % fragment + + if comment.R_BLOCK_COMMENT.match(fragment): + source = recoverEscape(fragment) + format = comment.getFormat(source) + multiline = comment.isMultiLine(source) + + # print "Type:MultiComment" + content = parseFragmentLead(content, fragment, tokens) + + atBegin = not hasLeadingContent(tokens) + if re.compile("^\s*\n").search(content): + atEnd = True + else: + atEnd = False + + # print "Begin: %s, End: %s" % (atBegin, atEnd) + + # Fixing source content + if atBegin: + source = comment.outdent(source, parseColumn - 1) + + source = comment.correct(source) + + connection = "before" + + if atEnd and not atBegin: + connection = "after" + else: + connection = "before" + + tokens.append({ "type" : "comment", "detail" : format, "multiline" : multiline, "connection" : connection, "source" : source, "id" : parseUniqueId, "line" : parseLine, "column" : parseColumn, "begin" : atBegin, "end" : atEnd }) + parseLine += len(fragment.split("\n")) - 1 + + elif comment.R_INLINE_COMMENT.match(fragment): + # print "Type:SingleComment" + source = recoverEscape(fragment) + content = parseFragmentLead(content, fragment, tokens) + + atBegin = hasLeadingContent(tokens) + atEnd = True + + if atBegin: + connection = "after" + else: + connection = "before" + + source = comment.correct(source) + + tokens.append({ "type" : "comment", "detail" : "inline", "multiline" : False, "connection" : connection, "source" : source, "id" : parseUniqueId, "line" : parseLine, "column" : parseColumn, "begin" : atBegin, "end" : atEnd }) + + elif R_STRING_A.match(fragment): + # print "Type:StringA: %s" % fragment + content = parseFragmentLead(content, fragment, tokens) + source = recoverEscape(fragment)[1:-1] + tokens.append({ "type" : "string", "detail" : "singlequotes", "source" : source.replace("\\\n",""), "id" : parseUniqueId, "line" : parseLine, "column" : parseColumn }) + parseLine += source.count("\\\n"); + + elif R_STRING_B.match(fragment): + # print "Type:StringB: %s" % fragment + content = parseFragmentLead(content, fragment, tokens) + source = recoverEscape(fragment)[1:-1] + tokens.append({ "type" : "string", "detail" : "doublequotes", "source" : source.replace("\\\n",""), "id" : parseUniqueId, "line" : parseLine, "column" : parseColumn }) + parseLine += source.count("\\\n"); + + elif R_FLOAT.match(fragment): + # print "Type:Float: %s" % fragment + content = parseFragmentLead(content, fragment, tokens) + tokens.append({ "type" : "number", "detail" : "float", "source" : fragment, "id" : parseUniqueId, "line" : parseLine, "column" : parseColumn }) + + elif R_OPERATORS.match(fragment): + # print "Type:Operator: %s" % fragment + content = parseFragmentLead(content, fragment, tokens) + tokens.append({ "type" : "token", "detail" : config.JSTOKENS[fragment], "source" : fragment, "id" : parseUniqueId, "line" : parseLine, "column" : parseColumn }) + + else: + fragresult = R_REGEXP.search(fragment) + + if fragresult: + # print "Type:RegExp: %s" % fragresult.group(0) + + if R_REGEXP_A.match(fragment) or R_REGEXP_B.match(fragment) or R_REGEXP_C.match(fragment) or R_REGEXP_D.match(fragment): + content = parseFragmentLead(content, fragresult.group(0), tokens) + tokens.append({ "type" : "regexp", "detail" : "", "source" : recoverEscape(fragresult.group(0)), "id" : parseUniqueId, "line" : parseLine, "column" : parseColumn }) + + else: + print "Bad regular expression: %s" % fragresult.group(0) + + else: + print "Type:None!" + + tokens.extend(parsePart(recoverEscape(content))) + tokens.append({ "type" : "eof", "source" : "", "detail" : "", "id" : parseUniqueId, "line" : parseLine, "column" : parseColumn }) + + return tokens + + + +def parseFile(fileName, uniqueId="", encoding="utf-8"): + return parseStream(filetool.read(fileName, encoding), uniqueId) + + + + +def convertTokensToString(tokens): + tokenizedString = "" + + for token in tokens: + tokenizedString += "%s%s" % (token, "\n") + + return tokenizedString + + + + + +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=".tokenized") + 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 tokenize!" + 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 + + tokenString = convertTokensToString(parseFile(fileName, "", options.encoding)) + + if options.write: + filetool.save(fileName + options.extension, tokenString, options.encoding) + + else: + try: + print tokenString + + 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/tree.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/tree.py new file mode 100755 index 0000000000..ab997738ff --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/tree.py @@ -0,0 +1,582 @@ +#!/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) +# +################################################################################ + +class NodeAccessException (Exception): + def __init__ (self, msg, node): + Exception.__init__(self, msg) + self.node = node + + +class Node: + def __init__ (self, type): + self.type = type + + + + + + def hasAttributes(self): + return hasattr(self, "attributes") + + def set(self, key, value): + """Sets an attribute""" + if not isinstance(value, (basestring, int, long, float, complex, bool)): + raise NodeAccessException("'value' is no string or number: " + str(value), self) + if not self.hasAttributes(): + self.attributes = {} + self.attributes[key] = value + return self + + def get(self, key, mandatory = True): + value = None + if hasattr(self, "attributes") and key in self.attributes: + value = self.attributes[key] + + if value != None: + return value + elif mandatory: + raise NodeAccessException("Node " + self.type + " has no attribute " + key, self) + + def remove(self, key): + del self.attributes[key] + if len(self.attributes) == 0: + del self.attributes + + + + + + + + def hasParent(self): + return hasattr(self, "parent") and self.parent != None + + def hasChildren(self, ignoreComments = False): + if not ignoreComments: + return hasattr(self, "children") and len(self.children) > 0 + else: + if not hasattr(self, "children"): + return False + + for child in self.children: + if child.type != "comment" and child.type != "commentsBefore" and child.type != "commentsAfter": + return True + + def addChild(self, childNode, index = None): + if childNode: + if not self.hasChildren(): + self.children = [] + + if childNode.hasParent(): + childNode.parent.removeChild(childNode) + + if index != None: + self.children.insert(index, childNode) + else: + self.children.append(childNode) + childNode.parent = self + return self + + def removeChild(self, childNode): + if self.hasChildren(): + self.children.remove(childNode) + childNode.parent = None + if len(self.children) == 0: + del self.children + + def replaceChild(self, oldChild, newChild): + if self.hasChildren(): + if newChild.hasParent(): + newChild.parent.removeChild(newChild) + + self.children.insert(self.children.index(oldChild), newChild) + newChild.parent = self + self.children.remove(oldChild) + + + + + + + def getChild(self, type, mandatory = True): + if self.hasChildren(): + for child in self.children: + if child.type == type: + return child + if mandatory: + raise NodeAccessException("Node " + self.type + " has no child with type " + type, self) + + def hasChildRecursive(self, type): + if isinstance(type, basestring): + if self.type == type: + return True + elif isinstance(type, list): + if self.type in type: + return True + + if self.hasChildren(): + for child in self.children: + if child.hasChildRecursive(type): + return True + + return False + + def hasChild(self, type): + if self.hasChildren(): + for child in self.children: + if isinstance(type, basestring): + if child.type == type: + return True + elif isinstance(type, list): + if child.type in type: + return True + + return False + + def getChildrenLength(self, ignoreComments=False): + if self.hasChildren(): + if ignoreComments: + counter = 0 + for child in self.children: + if not child.type in [ "comment", "commentsBefore", "commentsAfter" ]: + counter += 1 + return counter + + else: + return len(self.children) + + return 0 + + + + def makeComplex(self): + makeComplex = self.get("makeComplex", False) + + if makeComplex != None: + return makeComplex + + else: + makeComplex = False + + + + if self.type == "comment": + makeComplex = True + + elif self.type == "block": + if self.hasChildren(): + counter = 0 + for child in self.children: + if child.type != "commentsAfter": + counter += 1 + if counter > 1: + makeComplex = True + + elif self.type == "loop": + if self.get("loopType") == "IF" and self.hasParent() and self.parent.type == "elseStatement": + pass + else: + makeComplex = True + + elif self.type == "function": + makeComplex = self.getChild("body").hasChild("block") and self.getChild("body").getChild("block").getChildrenLength() > 0 + + elif self.type in [ "loop", "switch" ]: + makeComplex = True + + elif self.hasChild("commentsBefore"): + makeComplex = True + + + + # Final test: Ask the children (slower) + if not makeComplex and not self.type in [ "comment", "commentsBefore", "commentsAfter" ]: + makeComplex = self.isComplex() + + + self.set("makeComplex", makeComplex) + + # print "makeComplex: %s = %s" % (self.type, makeComplex) + + return makeComplex + + + + def isComplex(self): + isComplex = self.get("isComplex", False) + + if isComplex != None: + return isComplex + + else: + isComplex = False + + + + if not self.hasChildren(): + isComplex = False + + elif self.type == "block": + counter = 0 + if self.hasChildren(): + for child in self.children: + if child.type != "commentsAfter": + counter += 1 + + if child.hasChild("commentsBefore"): + counter += 1 + + if counter > 1: + break + + if counter > 1: + isComplex = True + + else: + if self.getChildrenLength() == 0: + isComplex = False + + # in else, try to find the mode of the previous if first + elif self.hasParent() and self.parent.type == "elseStatement": + isComplex = self.parent.parent.getChild("statement").hasComplexBlock() + + # in if, try to find the mode of the parent if (if existent) + elif self.hasParent() and self.parent.type == "statement" and self.parent.parent.type == "loop" and self.parent.parent.get("loopType") == "IF": + if self.parent.parent.hasParent() and self.parent.parent.parent.hasParent(): + if self.parent.parent.parent.parent.type == "loop": + isComplex = self.parent.parent.parent.parent.getChild("statement").hasComplexBlock() + + # in catch/finally, try to find the mode of the try statement + elif self.hasParent() and self.parent.hasParent() and self.parent.parent.type in [ "catch", "finally" ]: + isComplex = self.parent.parent.parent.getChild("statement").hasComplexBlock() + + elif self.type == "elseStatement": + if self.hasComplexBlock(): + isComplex = True + elif self.hasChild("loop") and self.getChild("loop").getChild("statement").hasComplexBlock(): + isComplex = True + + elif self.type == "array" : + if self.getChildrenLength(True) > 5: + isComplex = True + + elif self.type == "map" : + ml = self.getChildrenLength(True) + if ml > 1: + isComplex = True + + # Final test: Ask the children (slower) + if not (self.type == "elseStatement" and self.hasChild("loop")): + if not isComplex and self.hasComplexChildren(): + isComplex = True + + # print self.type + " :: %s" % isComplex + self.set("isComplex", isComplex) + + # print "isComplex: %s = %s" % (self.type, isComplex) + + return isComplex + + + + def hasComplexChildren(self): + if self.hasChildren(): + for child in self.children: + if child.makeComplex(): + return True + + return False + + + def hasComplexBlock(self): + if self.hasChild("block"): + return self.getChild("block").isComplex() + + return False + + + def hasBlockChildren(self): + if self.hasChild("block"): + return self.getChild("block").hasChildren() + + return False + + + def getChildPosition(self, searchedChild, ignoreComments = False): + if self.hasChildren() and searchedChild in self.children: + if ignoreComments: + counter = 0 + for child in self.children: + if child == searchedChild: + return counter + + if not child.type in [ "comment", "commentsBefore", "commentsAfter" ]: + counter += 1 + + else: + return self.children.index(searchedChild) + + return -1 + + + + def getChildByPosition(self, pos, mandatory = True, ignoreComments = False): + if self.hasChildren(): + i = 0 + for child in self.children: + if ignoreComments and child.type in [ "comment", "commentsBefore", "commentsAfter" ]: + continue + + if i == pos: + return child + + i += 1 + + if mandatory: + raise NodeAccessException("Node " + self.type + " has no child as position %s" % pos, self) + + + + def getChildByAttribute(self, key, value, mandatory = True): + if self.hasChildren(): + for child in self.children: + if child.get(key) == value: + return child + + if mandatory: + raise NodeAccessException("Node " + self.type + " has no child with attribute " + key + " = " + value, self) + + def getChildByTypeAndAttribute(self, type, key, value, mandatory = True): + if self.hasChildren(): + for child in self.children: + if child.type == type and child.get(key) == value: + return child + + if mandatory: + raise NodeAccessException("Node " + self.type + " has no child with type " + type + " and attribute " + key + " = " + value, self) + + def getFirstChild(self, mandatory = True, ignoreComments = False): + if self.hasChildren(): + for child in self.children: + if ignoreComments and child.type in [ "comment", "commentsBefore", "commentsAfter" ]: + continue + + return child + + if mandatory: + raise NodeAccessException("Node " + self.type + " has no children", self) + + def getLastChild(self, mandatory = True, ignoreComments = False): + if self.hasChildren(): + if not ignoreComments: + return self.children[-1] + else: + pos = len(self.children) - 1 + while pos >= 0: + child = self.children[pos] + + if ignoreComments and child.type in [ "comment", "commentsBefore", "commentsAfter" ]: + pos -= 1 + continue + + return child + + if mandatory: + raise NodeAccessException("Node " + self.type + " has no children", self) + + def getPreviousSibling(self, mandatory = True, ignoreComments = False): + if self.hasParent(): + prev = None + for child in self.parent.children: + + if ignoreComments and child.type in [ "comment", "commentsBefore", "commentsAfter" ]: + continue + + if child == self: + if prev != None: + return prev + else: + break + + prev = child + + if mandatory: + raise NodeAccessException("Node " + self.type + " has no previous sibling", self) + + def getFollowingSibling(self, mandatory = True, ignoreComments = False): + if self.hasParent(): + prev = None + + for child in self.parent.children: + if ignoreComments and child.type in [ "comment", "commentsBefore", "commentsAfter" ]: + continue + + if prev != None: + return child + + if child == self: + prev = child + + if mandatory: + raise NodeAccessException("Node " + self.type + " has no following sibling", self) + + def isFirstChild(self, ignoreComments = False): + if not self.hasParent(): + return False + + return self.parent.getFirstChild(False, ignoreComments) == self + + def isLastChild(self, ignoreComments = False): + if not self.hasParent(): + return False + + return self.parent.getLastChild(False, ignoreComments) == self + + def addListChild(self, listName, childNode): + listNode = self.getChild(listName, False) + if not listNode: + listNode = Node(listName) + self.addChild(listNode) + listNode.addChild(childNode) + + def getListChildByAttribute(self, listName, key, value, mandatory = True): + listNode = self.getChild(listName, False) + if listNode: + return listNode.getChildByAttribute(key, value, mandatory) + + if mandatory: + raise NodeAccessException("Node " + self.type + " has no child " + listName, self) + + def getFirstListChild(self, listName, mandatory = True): + listNode = self.getChild(listName, False) + if listNode: + return listNode.getFirstChild(mandatory) + + if mandatory: + raise NodeAccessException("Node " + self.type + " has no child " + listName, self) + + def getAllChildrenOfType(self, type): + return self._getAllChildrenOfType(type, []) + + def _getAllChildrenOfType(self, type, found=[]): + if self.hasChildren(): + for child in self.children: + if child.type == type: + found.append(child) + + child._getAllChildrenOfType(type, found) + + return found + + + + +def nodeToXmlString(node, prefix = "", childPrefix = " ", newLine="\n", encoding="utf-8"): + hasText = False + asString = prefix + "<" + node.type + if node.hasAttributes(): + for key in node.attributes: + if key == "text": + hasText = True + else: + asString += " " + key + "=\"" + escapeXmlChars(node.attributes[key], True, encoding) + "\"" + + if not node.hasChildren() and not hasText: + asString += "/>" + newLine + else: + asString += ">" + + if hasText: + if node.hasChildren(): + asString += newLine + prefix + childPrefix + else: + asString += newLine + prefix + childPrefix + + asString += "<text>" + escapeXmlChars(node.attributes["text"], False, encoding) + "</text>" + newLine + + if node.hasChildren(): + asString += newLine + for child in node.children: + asString += nodeToXmlString(child, prefix + childPrefix, childPrefix, newLine, encoding) + + asString += prefix + "</" + node.type + ">" + newLine + + return asString + + + +def nodeToJsonString(node, prefix = "", childPrefix = " ", newLine="\n"): + asString = prefix + '{type:"' + escapeJsonChars(node.type) + '"' + + if node.hasAttributes(): + asString += ',attributes:{' + firstAttribute = True + for key in node.attributes: + if not firstAttribute: + asString += ',' + asString += '"' + key + '":"' + escapeJsonChars(node.attributes[key]) + '"' + firstAttribute = False + asString += '}' + + if node.hasChildren(): + asString += ',children:[' + newLine + + firstChild = True + prefix = prefix + childPrefix + for child in node.children: + asString += nodeToJsonString(child, prefix, childPrefix, newLine) + ',' + newLine + firstChild = False + + # NOTE We remove the ',\n' of the last child + if newLine == "": + asString = asString[:-1] + prefix + ']' + else: + asString = asString[:-2] + newLine + prefix + ']' + + asString += '}' + + return asString + + + +def escapeXmlChars(text, inAttribute, encoding="utf-8"): + if isinstance(text, basestring): + text = text.replace("&", "&").replace("<", "<").replace(">", ">") + if inAttribute: + text = text.replace("\"", """) + elif isinstance(text, bool): + text = str(text).lower() + else: + text = str(text) + + return text + + + +def escapeJsonChars(text): + if isinstance(text, basestring): + text = text.replace('"', '\\"').replace('\n', '\\n').replace('\r', '\\r') + elif isinstance(text, bool): + text = str(text).lower() + else: + text = str(text) + + return text diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/treegenerator.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/treegenerator.py new file mode 100755 index 0000000000..aa6f13b7e2 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/treegenerator.py @@ -0,0 +1,1039 @@ +#!/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, optparse +import tokenizer, tree, filetool, variableoptimizer + + +SINGLE_LEFT_OPERATORS = [ "NOT", "BITNOT", "ADD", "SUB", "INC", "DEC" ] + +SINGLE_RIGHT_OPERATORS = [ "INC", "DEC" ] + +MULTI_TOKEN_OPERATORS = [ "HOOK", "ADD", "SUB", "MUL", "DIV", "MOD", \ + "LT", "LE", "GT", "GE", "EQ", "NE", "SHEQ", "SHNE", \ + "AND", "OR", "BITOR", "BITXOR", "BITAND", "POWEROF", \ + "LSH", "RSH", "URSH" ] + +MULTI_PROTECTED_OPERATORS = [ "INSTANCEOF", "IN" ] + +ASSIGN_OPERATORS = [ "ASSIGN", "ASSIGN_ADD", "ASSIGN_SUB", "ASSIGN_MUL", \ + "ASSIGN_DIV", "ASSIGN_MOD", "ASSIGN_BITOR", "ASSIGN_BITXOR", "ASSIGN_BITAND", \ + "ASSIGN_LSH", "ASSIGN_RSH", "ASSIGN_URSH" ] + +LOOP_KEYWORDS = [ "WHILE", "IF", "FOR", "WITH" ] + + +class TokenStream: + def __init__ (self, tokens): + self.tokens = tokens + self.commentsBefore = None + self.parsepos = -1 + self.eolBefore = False + + def curr (self): + """Returns the current token.""" + return self.tokens[self.parsepos] + + def currType (self): + return self.curr()["type"] + + def currDetail (self): + return self.curr()["detail"] + + def currSource (self): + return self.curr()["source"] + + def currLine (self): + return self.curr()["line"] + + def currColumn (self): + return self.curr()["column"] + + def currMultiline (self): + return self.curr()["multiline"] + + def currConnection (self): + return self.curr()["connection"] + + def currIsType (self, tokenType, tokenDetail = None): + if self.currType() != tokenType: + return False + else: + if tokenDetail == None: + return True + elif type(tokenDetail) == list: + return self.currDetail() in tokenDetail + else: + return self.currDetail() == tokenDetail + + def expectCurrType (self, tokenType, tokenDetail = None): + if not self.currIsType(tokenType, tokenDetail): + expectedDesc = tokenType + if type(tokenDetail) == str: + expectedDesc += "/" + tokenDetail + raiseSyntaxException(self.curr(), expectedDesc) + + def finished (self): + # NOTE: the last token is end of file + return self.parsepos >= len(self.tokens) - 1 + + def next (self, item=None, after=False): + length = len(self.tokens) + self.eolBefore = False + self.breakBefore = False + + token = None + while self.parsepos < length - 1: + self.parsepos += 1 + + token = self.tokens[self.parsepos] + + if token["type"] == "eol": + if self.eolBefore: + self.breakBefore = True + + self.eolBefore = True + # ignore end of line + pass + + elif token["type"] == "comment": + # After current item + if token["connection"] == "after": + if not token.has_key("inserted") or not token["inserted"]: + if item: + commentNode = tree.Node("comment") + commentNode.set("line", token["line"]) + commentNode.set("column", token["column"]) + commentNode.set("text", token["source"]) + commentNode.set("detail", token["detail"]) + commentNode.set("multiline", token["multiline"]) + commentNode.set("connection", token["connection"]) + commentNode.set("begin", token["begin"]) + commentNode.set("end", token["end"]) + + if after: + item.addListChild("commentsAfter", commentNode) + else: + item.addChild(commentNode) + + self.eolBefore = False + self.breakBefore = False + + else: + print "Found unresolved after comment in line %s, column %s" % (token["line"], token["column"]) + print token["source"] + pass + + # Documentation and Block comments of next item + else: + if not self.commentsBefore: + self.commentsBefore = [] + + commentNode = tree.Node("comment") + commentNode.set("line", token["line"]) + commentNode.set("column", token["column"]) + commentNode.set("text", token["source"]) + commentNode.set("detail", token["detail"]) + commentNode.set("multiline", token["multiline"]) + commentNode.set("connection", token["connection"]) + commentNode.set("begin", token["begin"]) + commentNode.set("end", token["end"]) + + self.commentsBefore.append(commentNode) + + self.eolBefore = False + self.breakBefore = False + + else: + break + + #print "next token: " + str(token) + + if token == None: + # return end of file token + return self.tokens[length - 1] + else: + return token + + # alternative to use, when we want to check if the next token + # is a comment, but are not able to use next() because if there is + # no comment we want to leave in our position + def comment (self, item, after=False): + length = len(self.tokens) + + token = None + pos = self.parsepos + + while pos < length - 1: + pos += 1 + token = self.tokens[pos] + + if token["type"] == "comment" and token["connection"] == "after" and (not token.has_key("inserted") or not token["inserted"]): + commentNode = tree.Node("comment") + commentNode.set("line", token["line"]) + commentNode.set("column", token["column"]) + commentNode.set("text", token["source"]) + commentNode.set("detail", token["detail"]) + commentNode.set("multiline", token["multiline"]) + commentNode.set("connection", token["connection"]) + commentNode.set("begin", token["begin"]) + commentNode.set("end", token["end"]) + + token["inserted"] = True + + if after: + item.addListChild("commentsAfter", commentNode) + else: + item.addChild(commentNode) + + else: + break + + def hadEolBefore(self): + return self.eolBefore + + def hadBreakBefore(self): + return self.breakBefore + + def clearCommentsBefore(self): + commentsBefore = self.commentsBefore + self.commentsBefore = None + return commentsBefore + + + +class SyntaxException (Exception): + pass + + + +def createItemNode(type, stream): + # print "CREATE %s" % type + + node = tree.Node(type) + node.set("line", stream.currLine()) + node.set("column", stream.currColumn()) + + commentsBefore = stream.clearCommentsBefore() + if commentsBefore: + for comment in commentsBefore: + node.addListChild("commentsBefore", comment) + + return node + + + +def raiseSyntaxException (token, expectedDesc = None): + if expectedDesc: + msg = "Expected " + expectedDesc + " but found " + else: + msg = "Unexpected " + + msg += token["type"] + + if token["detail"]: + msg += "/" + token["detail"] + + msg += ": '" + token["source"] + "'. file:" + \ + token["id"] + ", line:" + str(token["line"]) + \ + ", column:" + str(token["column"]) + + raise SyntaxException(msg) + + + +def createSyntaxTree (tokenArr): + """Creates a syntax tree from a token stream. + + tokens: the token stream.""" + + stream = TokenStream(tokenArr) + stream.next() + + rootBlock = tree.Node("file") + rootBlock.set("file", stream.curr()["id"]) + + while not stream.finished(): + rootBlock.addChild(readStatement(stream)) + + return rootBlock + + + +def readExpression (stream): + return readStatement(stream, True) + + + +def readStatement (stream, expressionMode = False, overrunSemicolon = True, inStatementList = False): + item = None + + eolBefore = stream.hadEolBefore() + breakBefore = stream.hadBreakBefore() + + # print "PROGRESS: %s - %s (%s) [expr=%s]" % (stream.currType(), stream.currDetail(), stream.currLine(), expressionMode) + + if currIsIdentifier(stream, True): + # statement starts with an identifier + variable = readVariable(stream, True) + variable = readObjectOperation(stream, variable) + + if stream.currIsType("token", ASSIGN_OPERATORS): + # This is an assignment + item = createItemNode("assignment", stream) + item.set("operator", stream.currDetail()) + stream.next(item) + + item.addListChild("left", variable) + item.addListChild("right", readExpression(stream)) + elif stream.currIsType("token", "COLON") and not expressionMode: + # This is a label + item = variable + item.type = "label" + stream.next(variable) + else: + # Something else comes after the variable -> It's a sole variable + item = variable + + # Any comments found for the variable belong to the extracted item + commentsChild = variable.getChild("commentsBefore", False) + if item and commentsChild != None: + variable.removeChild(commentsChild) + item.addChild(commentsChild, 0) + elif stream.currIsType("protected", "FUNCTION"): + item = createItemNode("function", stream) + stream.next(item) + + # Read optional function name + if stream.currIsType("name"): + item.set("name", stream.currSource()) + stream.next(item) + + readParamList(item, stream) + item.addListChild("body", readBlock(stream)) + + # Check for direct execution: function() {}() + if stream.currIsType("token", "LP"): + # The function is executed directly + functionItem = item + item = createItemNode("call", stream) + item.addListChild("operand", functionItem) + readParamList(item, stream) + item = readObjectOperation(stream, item) + elif stream.currIsType("protected", "VOID"): + stream.next(item) + item = createItemNode("void", stream) + stream.next(item) + item.addChild(readStatement(stream, expressionMode)) + stream.expectCurrType("token", "RP") + stream.next(item, True) + item = readObjectOperation(stream, item) + elif stream.currIsType("token", "LP"): + igroup = createItemNode("group", stream) + stream.next(igroup) + igroup.addChild(readStatement(stream, expressionMode)) + stream.expectCurrType("token", "RP") + stream.next(igroup, True) + oper = readObjectOperation(stream, igroup) + + # supports e.g. (this.editor.object || this.editor.iframe).style.marginTop = null; + if stream.currIsType("token", ASSIGN_OPERATORS): + # This is an assignment + item = createItemNode("assignment", stream) + item.set("operator", stream.currDetail()) + stream.next(item) + + item.addListChild("left", oper) + item.addListChild("right", readExpression(stream)) + else: + # Something else comes after the variable -> It's a sole variable + item = oper + + elif stream.currIsType("string"): + item = createItemNode("constant", stream) + item.set("constantType", "string") + item.set("value", stream.currSource()) + item.set("detail", stream.currDetail()) + stream.next(item, True) + # This is a member accessor (E.g. "bla.blubb") + item = readObjectOperation(stream, item) + elif stream.currIsType("number"): + item = createItemNode("constant", stream) + item.set("constantType", "number") + item.set("value", stream.currSource()) + item.set("detail", stream.currDetail()) + stream.next(item, True) + # This is a member accessor (E.g. "bla.blubb") + item = readObjectOperation(stream, item) + elif stream.currIsType("regexp"): + item = createItemNode("constant", stream) + item.set("constantType", "regexp") + item.set("value", stream.currSource()) + stream.next(item, True) + # This is a member accessor (E.g. "bla.blubb") + item = readObjectOperation(stream, item) + elif expressionMode and (stream.currIsType("protected", "TRUE") or stream.currIsType("protected", "FALSE")): + item = createItemNode("constant", stream) + item.set("constantType", "boolean") + item.set("value", stream.currSource()) + stream.next(item, True) + elif expressionMode and stream.currIsType("protected", "NULL"): + item = createItemNode("constant", stream) + item.set("constantType", "null") + item.set("value", stream.currSource()) + stream.next(item, True) + elif expressionMode and stream.currIsType("token", "LC"): + item = readMap(stream) + elif expressionMode and stream.currIsType("token", "LB"): + item = readArray(stream) + elif stream.currIsType("token", SINGLE_LEFT_OPERATORS): + item = createItemNode("operation", stream) + item.set("operator", stream.currDetail()) + item.set("left", True) + stream.next(item) + item.addListChild("first", readExpression(stream)) + elif stream.currIsType("protected", "TYPEOF"): + item = createItemNode("operation", stream) + item.set("operator", "TYPEOF") + item.set("left", True) + stream.next(item) + item.addListChild("first", readExpression(stream)) + elif stream.currIsType("protected", "NEW"): + item = readInstantiation(stream) + item = readObjectOperation(stream, item) + elif not expressionMode and stream.currIsType("protected", "VAR"): + item = createItemNode("definitionList", stream) + stream.next(item) + finished = False + while not finished: + if not currIsIdentifier(stream, False): + raiseSyntaxException(stream.curr(), "identifier") + + childitem = createItemNode("definition", stream) + childitem.set("identifier", stream.currSource()) + stream.next(childitem) + if stream.currIsType("token", "ASSIGN"): + assign = createItemNode("assignment", stream) + childitem.addChild(assign) + stream.next(assign) + assign.addChild(readExpression(stream)) + + item.addChild(childitem) + + # Check whether anothe definition follows, e.g. "var a, b=1, c=4" + if stream.currIsType("token", "COMMA"): + stream.next(item) + else: + finished = True + + stream.comment(item, True) + + elif not expressionMode and stream.currIsType("protected", LOOP_KEYWORDS): + item = readLoop(stream) + elif not expressionMode and stream.currIsType("protected", "DO"): + item = readDoWhile(stream) + elif not expressionMode and stream.currIsType("protected", "SWITCH"): + item = readSwitch(stream) + elif not expressionMode and stream.currIsType("protected", "TRY"): + item = readTryCatch(stream) + elif not expressionMode and stream.currIsType("token", "LC"): + item = readBlock(stream) + elif not expressionMode and stream.currIsType("protected", "RETURN"): + item = createItemNode("return", stream) + stream.next(item) + # NOTE: The expression after the return keyword is optional + if not stream.currIsType("token", "SEMICOLON") and not stream.currIsType("token", "RC"): + item.addListChild("expression", readExpression(stream)) + stream.comment(item, True) + elif not expressionMode and stream.currIsType("protected", "THROW"): + item = createItemNode("throw", stream) + stream.next(item) + item.addListChild("expression", readExpression(stream)) + stream.comment(item, True) + elif not expressionMode and stream.currIsType("protected", "DELETE"): + item = createItemNode("delete", stream) + stream.next(item) + item.addListChild("expression", readExpression(stream)) + stream.comment(item, True) + elif not expressionMode and stream.currIsType("protected", "BREAK"): + item = createItemNode("break", stream) + stream.next(item) + # NOTE: The label after the break keyword is optional + if not stream.hadEolBefore() and stream.currIsType("name"): + item.set("label", stream.currSource()) + # As the label is an attribute, we need to put following comments into after + # to differenciate between comments before and after the label + stream.next(item, True) + elif not expressionMode and stream.currIsType("protected", "CONTINUE"): + item = createItemNode("continue", stream) + stream.next(item) + # NOTE: The label after the continue keyword is optional + if not stream.hadEolBefore() and stream.currIsType("name"): + item.set("label", stream.currSource()) + stream.next(item, True) + + if not item: + if stream.currIsType("token", "SEMICOLON") and not expressionMode: + # This is an empty statement + item = createItemNode("emptyStatement", stream) + stream.next(item) + else: + if expressionMode: + expectedDesc = "expression" + else: + expectedDesc = "statement" + raiseSyntaxException(stream.curr(), expectedDesc) + + # check whether this is an operation + if stream.currIsType("token", MULTI_TOKEN_OPERATORS) or stream.currIsType("protected", MULTI_PROTECTED_OPERATORS) or (stream.currIsType("token", SINGLE_RIGHT_OPERATORS) and not stream.hadEolBefore()): + # its an operation -> We've already parsed the first operand (in item) + parsedItem = item + + oper = stream.currDetail() + + item = createItemNode("operation", stream) + item.addListChild("first", parsedItem) + item.set("operator", oper) + stream.next(item) + + if oper in MULTI_TOKEN_OPERATORS or oper in MULTI_PROTECTED_OPERATORS: + # It's a multi operator -> There must be a second argument + item.addListChild("second", readExpression(stream)) + if oper == "HOOK": + # It's a "? :" operation -> There must be a third argument + stream.expectCurrType("token", "COLON") + stream.next(item) + item.addListChild("third", readExpression(stream)) + + # Deep scan on single right operators e.g. if(i-- > 4) + if oper in SINGLE_RIGHT_OPERATORS and stream.currIsType("token", MULTI_TOKEN_OPERATORS) and expressionMode: + paroper = stream.currDetail() + + paritem = createItemNode("operation", stream) + paritem.addListChild("first", item) + paritem.set("operator", paroper) + stream.next(item) + + if paroper in MULTI_TOKEN_OPERATORS or paroper in MULTI_PROTECTED_OPERATORS: + # It's a multi operator -> There must be a second argument + paritem.addListChild("second", readExpression(stream)) + if paroper == "HOOK": + # It's a "? :" operation -> There must be a third argument + stream.expectCurrType("token", "COLON") + stream.next(item) + paritem.addListChild("third", readExpression(stream)) + + # return parent item + item = paritem + + + + # check whether this is a combined statement, e.g. "bla(), i++" + if not expressionMode and not inStatementList and stream.currIsType("token", "COMMA"): + statementList = createItemNode("statementList", stream) + statementList.addChild(item) + while stream.currIsType("token", "COMMA"): + stream.next(statementList) + statementList.addChild(readStatement(stream, False, False, True)) + item = statementList + + # go over the optional semicolon + if not expressionMode and overrunSemicolon and stream.currIsType("token", "SEMICOLON"): + stream.next(item, True) + + + item.set("eolBefore", eolBefore) + item.set("breakBefore", breakBefore) + + return item + + + +def currIsIdentifier (stream, allowThis): + det = stream.currDetail() + return stream.currIsType("name") or stream.currIsType("builtin") \ + or (stream.currIsType("protected") and \ + (det == "INFINITY" or det == "PROTOTYPE" or det == "CALL" or \ + det == "APPLY" or (allowThis and det == "THIS"))) + + + +def readVariable (stream, allowArrays): + # Note: keywords may be used as identifiers, too + item = createItemNode("variable", stream) + + done = False + firstIdentifier = True + while not done: + if not currIsIdentifier(stream, firstIdentifier): + raiseSyntaxException(stream.curr(), "identifier") + + identifier = createItemNode("identifier", stream) + identifier.set("name", stream.currSource()) + stream.next(identifier) + + if allowArrays: + while stream.currIsType("token", "LB"): + accessor = createItemNode("accessor", stream) + stream.next(accessor) + accessor.addListChild("identifier", identifier) + accessor.addListChild("key", readExpression(stream)) + + stream.expectCurrType("token", "RB") + stream.next(accessor, True) + + identifier = accessor + + item.addChild(identifier) + + firstIdentifier = False + + if stream.currIsType("token", "DOT"): + stream.next(item) + else: + done = True + + return item + + + +def readObjectOperation(stream, operand, onlyAllowMemberAccess = False): + if stream.currIsType("token", "DOT"): + # This is a member accessor (E.g. "bla.blubb") + item = createItemNode("accessor", stream) + stream.next(item) + item.addListChild("left", operand) + + # special mode for constants which should be assigned to an accessor first + if operand.type == "constant": + item.addListChild("right", readVariable(stream, False)) + item = readObjectOperation(stream, item) + else: + item.addListChild("right", readObjectOperation(stream, readVariable(stream, False))) + + elif stream.currIsType("token", "LP"): + # This is a function call (E.g. "bla(...)") + item = createItemNode("call", stream) + item.addListChild("operand", operand) + readParamList(item, stream) + item = readObjectOperation(stream, item) + elif stream.currIsType("token", "LB"): + # This is an array access (E.g. "bla[...]") + item = createItemNode("accessor", stream) + stream.next(item) + item.addListChild("identifier", operand) + item.addListChild("key", readExpression(stream)) + + stream.expectCurrType("token", "RB") + stream.next(item, True) + item = readObjectOperation(stream, item) + else: + item = operand + + # Any comments found for the operand belong to the item + if operand != item: + commentsChild = operand.getChild("commentsBefore", False) + if commentsChild != None: + operand.removeChild(commentsChild) + item.addChild(commentsChild, 0) + + return item + + + +def readParamList (node, stream): + stream.expectCurrType("token", "LP") + + params = createItemNode("params", stream) + node.addChild(params) + + stream.next(params) + + firstParam = True + lastExpr = None + while not stream.currIsType("token", "RP"): + if firstParam: + firstParam = False + else: + stream.expectCurrType("token", "COMMA") + stream.next(lastExpr, True) + + lastExpr = readExpression(stream) + params.addChild(lastExpr) + + # Has an end defined by the loop above + # This means that all comments following are after item + stream.next(params, True) + + +def readBlock(stream): + stream.expectCurrType("token", "LC") + item = createItemNode("block", stream) + + # Iterate through children + stream.next(item) + while not stream.currIsType("token", "RC"): + item.addChild(readStatement(stream)) + + # Has an end defined by the loop above + # This means that all comments following are after item + stream.next(item, True) + + return item + + +def readMap(stream): + stream.expectCurrType("token", "LC") + + item = createItemNode("map", stream) + stream.next(item) + + # NOTE: We use our own flag for checking whether the array already has entries + # and not item.hasChildren(), because item.hasChildren() is also true + # when there are comments before the array + hasEntries = False + + while not stream.currIsType("token", "RC"): + if hasEntries: + stream.expectCurrType("token", "COMMA") + stream.next(item) + + if not currIsIdentifier(stream, True) and not stream.currIsType("string") and not stream.currIsType("number"): + raiseSyntaxException(stream.curr(), "map key (identifier, string or number)") + + keyvalue = createItemNode("keyvalue", stream) + keyvalue.set("key", stream.currSource()) + + if stream.currIsType("string"): + keyvalue.set("quote", stream.currDetail()) + + stream.next(keyvalue) + stream.expectCurrType("token", "COLON") + stream.next(keyvalue, True) + keyvalue.addListChild("value", readExpression(stream)) + + item.addChild(keyvalue) + + hasEntries = True + + # Has an end defined by the loop above + # This means that all comments following are after item + stream.next(item, True) + + return item + + + +def readArray(stream): + stream.expectCurrType("token", "LB") + + item = createItemNode("array", stream) + stream.next(item) + + # NOTE: We use our own flag for checking whether the array already has entries + # and not item.hasChildren(), because item.hasChildren() is also true + # when there are comments before the array + hasEntries = False + while not stream.currIsType("token", "RB"): + if hasEntries: + stream.expectCurrType("token", "COMMA") + stream.next(item) + + item.addChild(readExpression(stream)) + hasEntries = True + + # Has an end defined by the loop above + # This means that all comments following are after item + stream.next(item, True) + + # Support constructs like [ "foo", "bar" ].join("") + item = readObjectOperation(stream, item) + + return item + + + +def readInstantiation(stream): + stream.expectCurrType("protected", "NEW") + + item = createItemNode("instantiation", stream) + stream.next(item) + + # Could be a simple variable or a just-in-time function declaration (closure) + # Read this as expression + stmnt = readStatement(stream, True, False) + item.addListChild("expression", stmnt) + + return item + + + +def readLoop(stream): + stream.expectCurrType("protected", LOOP_KEYWORDS) + + loopType = stream.currDetail() + + item = createItemNode("loop", stream) + item.set("loopType", loopType) + + stream.next(item) + stream.expectCurrType("token", "LP") + + if loopType == "FOR": + stream.next(item) + + if not stream.currIsType("token", "SEMICOLON"): + # Read the optional first statement + first = createItemNode("first", stream) + item.addChild(first) + first.addChild(readStatement(stream, False, False)) + stream.comment(first, True) + + if stream.currIsType("token", "SEMICOLON"): + # It's a for (;;) loop + item.set("forVariant", "iter") + + stream.next(item) + if not stream.currIsType("token", "SEMICOLON"): + # Read the optional second expression + second = createItemNode("second", stream) + item.addChild(second) + second.addChild(readExpression(stream)) + stream.comment(second, True) + + stream.expectCurrType("token", "SEMICOLON") + stream.next(item) + + if not stream.currIsType("token", "RP"): + # Read the optional third statement + third = createItemNode("third", stream) + item.addChild(third) + third.addChild(readStatement(stream, False, False)) + stream.comment(third, True) + + elif stream.currIsType("token", "RP"): + # It's a for ( in ) loop + item.set("forVariant", "in") + pass + + else: + raiseSyntaxException(stream.curr(), "semicolon or in") + + stream.expectCurrType("token", "RP") + + else: + expr = createItemNode("expression", stream) + stream.next(expr) + expr.addChild(readExpression(stream)) + item.addChild(expr) + stream.comment(expr, True) + stream.expectCurrType("token", "RP") + + # comments should be already completed from the above code + stmnt = createItemNode("statement", stream) + item.addChild(stmnt) + stream.next() + stmnt.addChild(readStatement(stream)) + + if loopType == "IF" and stream.currIsType("protected", "ELSE"): + elseStmnt = createItemNode("elseStatement", stream) + item.addChild(elseStmnt) + stream.next(elseStmnt) + elseStmnt.addChild(readStatement(stream)) + + return item + + + +def readDoWhile(stream): + stream.expectCurrType("protected", "DO") + + item = createItemNode("loop", stream) + item.set("loopType", "DO") + stream.next(item) + + stmnt = createItemNode("statement", stream) + item.addChild(stmnt) + stmnt.addChild(readStatement(stream)) + + stream.expectCurrType("protected", "WHILE") + stream.next(item) + + stream.expectCurrType("token", "LP") + + expr = createItemNode("expression", stream) + item.addChild(expr) + stream.next(expr) + + expr.addChild(readExpression(stream)) + + stream.expectCurrType("token", "RP") + stream.next(item, True) + + return item + + +def readSwitch(stream): + stream.expectCurrType("protected", "SWITCH") + + item = createItemNode("switch", stream) + item.set("switchType", "case") + + stream.next(item) + stream.expectCurrType("token", "LP") + + expr = createItemNode("expression", stream) + stream.next(expr) + item.addChild(expr) + expr.addChild(readExpression(stream)) + + stream.expectCurrType("token", "RP") + stream.next(expr, True) + + stream.expectCurrType("token", "LC") + stmnt = createItemNode("statement", stream) + item.addChild(stmnt) + stream.next(stmnt) + + while not stream.currIsType("token", "RC"): + if stream.currIsType("protected", "CASE"): + caseItem = createItemNode("case", stream) + stream.next(caseItem) + caseItem.addListChild("expression", readExpression(stream)) + stmnt.addChild(caseItem) + + stream.expectCurrType("token", "COLON") + stream.next(caseItem, True) + + elif stream.currIsType("protected", "DEFAULT"): + defaultItem = createItemNode("default", stream) + stmnt.addChild(defaultItem) + stream.next(defaultItem) + + stream.expectCurrType("token", "COLON") + stream.next(defaultItem, True) + + else: + raiseSyntaxException(stream.curr(), "case or default") + + while not stream.currIsType("token", "RC") and not stream.currIsType("protected", "CASE") and not stream.currIsType("protected", "DEFAULT"): + stmnt.addChild(readStatement(stream)) + + stream.next(stmnt, True) + + return item + + +def readTryCatch(stream): + stream.expectCurrType("protected", "TRY") + + item = createItemNode("switch", stream) + item.set("switchType", "catch") + stream.next(item) + + item.addListChild("statement", readStatement(stream)) + + while stream.currIsType("protected", "CATCH"): + catchItem = createItemNode("catch", stream) + stream.next(catchItem) + + stream.expectCurrType("token", "LP") + + exprItem = createItemNode("expression", stream) + catchItem.addChild(exprItem) + stream.next(exprItem) + exprItem.addChild(readExpression(stream)) + + stream.expectCurrType("token", "RP") + stream.next(exprItem, True) + + stmnt = createItemNode("statement", stream) + catchItem.addChild(stmnt) + stmnt.addChild(readStatement(stream)) + + item.addChild(catchItem) + + if stream.currIsType("protected", "FINALLY"): + finallyItem = createItemNode("finally", stream) + stream.next(finallyItem) + + stmnt = createItemNode("statement", stream) + finallyItem.addChild(stmnt) + stmnt.addChild(readStatement(stream)) + + item.addChild(finallyItem) + + return item + + + + + + + + + +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=".compiled") + 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 "Generating tree of %s => %s%s" % (fileName, fileName, options.extension) + else: + print "Generating tree of %s => stdout" % fileName + + restree = createSyntaxTree(tokenizer.parseFile(fileName, "", options.encoding)) + + if options.optimizeVariables: + variableoptimizer.search(restree, [], 0, "$") + + compiledString = tree.nodeToXmlString(restree) + if options.write: + 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/variableoptimizer.py b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/variableoptimizer.py new file mode 100644 index 0000000000..eb85bd4067 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/modules/variableoptimizer.py @@ -0,0 +1,144 @@ +#!/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 tree, mapper + +def skip(name, prefix): + return len(prefix) > 0 and name[:len(prefix)] == prefix + +def search(node, found, level=0, prefix="$", skipPrefix="", register=False, debug=False): + if node.type == "function": + if register: + name = node.get("name", False) + if name != None and not name in found: + # print "Name: %s" % name + found.append(name) + + foundLen = len(found) + register = True + + if debug: + print "\n%s<scope line='%s'>" % ((" " * level), node.get("line")) + + # e.g. func(name1, name2); + elif register and node.type == "variable" and node.hasChildren() and len(node.children) == 1: + if node.parent.type == "params" and node.parent.parent.type != "call": + first = node.getFirstChild() + + if first.type == "identifier": + name = first.get("name") + + if not name in found: + # print "Name: %s" % name + found.append(name) + + # e.g. var name1, name2 = "foo"; + elif register and node.type == "definition": + name = node.get("identifier", False) + + if name != None: + if not name in found: + # print "Name: %s" % name + found.append(name) + + # Iterate over children + if node.hasChildren(): + if node.type == "function": + for child in node.children: + search(child, found, level+1, prefix, skipPrefix, register, debug) + + else: + for child in node.children: + search(child, found, level, prefix, skipPrefix, register, debug) + + # Function closed + if node.type == "function": + + # Debug + if debug: + for item in found: + print " %s<item>%s</item>" % ((" " * level), item) + print "%s</scope>" % (" " * level) + + # Iterate over content + # Replace variables in current scope + update(node, found, prefix, skipPrefix, debug) + del found[foundLen:] + + + +def update(node, found, prefix="$", skipPrefix="", debug=False): + + # Handle all identifiers + if node.type == "identifier": + + isFirstChild = False + isVariableMember = False + + if node.parent.type == "variable": + isVariableMember = True + varParent = node.parent.parent + + if not (varParent.type == "right" and varParent.parent.type == "accessor"): + isFirstChild = node.parent.getFirstChild(True, True) == node + + elif node.parent.type == "identifier" and node.parent.parent.type == "accessor": + isVariableMember = True + accessor = node.parent.parent + isFirstChild = accessor.parent.getFirstChild(True, True) == accessor + + # inside a variable parent only respect the first member + if not isVariableMember or isFirstChild: + idenName = node.get("name", False) + + if idenName != None and idenName in found and not skip(idenName, skipPrefix): + replName = "%s%s" % (prefix, mapper.convert(found.index(idenName))) + node.set("name", replName) + + if debug: + print " - Replaced '%s' with '%s'" % (idenName, replName) + + # Handle variable definition + elif node.type == "definition": + idenName = node.get("identifier", False) + + if idenName != None and idenName in found and not skip(idenName, skipPrefix): + replName = "%s%s" % (prefix, mapper.convert(found.index(idenName))) + node.set("identifier", replName) + + if debug: + print " - Replaced '%s' with '%s'" % (idenName, replName) + + # Handle function definition + elif node.type == "function": + idenName = node.get("name", False) + + if idenName != None and idenName in found and not skip(idenName, skipPrefix): + replName = "%s%s" % (prefix, mapper.convert(found.index(idenName))) + node.set("name", replName) + + if debug: + print " - Replaced '%s' with '%s'" % (idenName, replName) + + # Iterate over children + if node.hasChildren(): + for child in node.children: + update(child, found, prefix, skipPrefix, debug) diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/core.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/core.dat new file mode 100755 index 0000000000..cf7fdcc0ff --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/core.dat @@ -0,0 +1,12 @@ +###########################################################################
+#
+# Generates a compiled qooxdoo core JavaScript file
+#
+###########################################################################
+
+class-path = framework/source/class
+cache-directory = framework/.cache
+include = core
+generate-compiled-script
+compiled-script-file = core.js
+optimize-strings
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/io.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/io.dat new file mode 100644 index 0000000000..2b0f8d0142 --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/io.dat @@ -0,0 +1,12 @@ +###########################################################################
+#
+# Generates a compiled qooxdoo io JavaScript file
+#
+###########################################################################
+
+class-path = framework/source/class
+cache-directory = framework/.cache
+include = qx.io.remote.*
+generate-compiled-script
+compiled-script-file = io.js
+optimize-strings
diff --git a/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/packages.dat b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/packages.dat new file mode 100755 index 0000000000..d1419546ff --- /dev/null +++ b/webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/presets/packages.dat @@ -0,0 +1,25 @@ +###########################################################################
+#
+# Generates 3 JavaScript files with different include configuration
+#
+###########################################################################
+
+class-path = framework/source/class
+cache-directory = framework/.cache
+generate-compiled-script
+optimize-strings
+
+package = core
+include = core
+compiled-script-file = pkg-core.js
+
+package = ui_core
+include = ui_core
+exclude = core
+compiled-script-file = pkg-ui_core.js
+
+package = ui_basic
+include = ui_basic
+exclude = core
+exclude = ui_core
+compiled-script-file = pkg-ui_basic.js
|