Permalink
Browse files

Created skeleton of Qooxdoo frontend app

  • Loading branch information...
1 parent 1377cc9 commit 1c78a295d8b46d6bf209c25410558cf6da3e7ac3 tomek committed Jul 11, 2012
@@ -0,0 +1,34 @@
+{
+ "info" :
+ {
+ "name" : "helenos",
+
+ "summary" : "Custom Application",
+ "description" : "This is a skeleton for a custom application with qooxdoo.",
+
+ "homepage" : "http://some.homepage.url/",
+
+ "license" : "SomeLicense",
+ "authors" :
+ [
+ {
+ "name" : "First Author (uid)",
+ "email" : "first.author@some.domain"
+ }
+ ],
+
+ "version" : "trunk",
+ "qooxdoo-versions": ["2.0.1"]
+ },
+
+ "provides" :
+ {
+ "namespace" : "com.kuprowski.helenos",
+ "encoding" : "utf-8",
+ "class" : "source/class",
+ "resource" : "source/resource",
+ "translation" : "source/translation",
+ "type" : "application"
+ }
+}
+
@@ -0,0 +1,85 @@
+{
+ "name" : "helenos",
+
+ "include" :
+ [
+ {
+ "path" : "${QOOXDOO_PATH}/tool/data/config/application.json"
+ }
+ ],
+
+ "export" :
+ [
+ "api",
+ "api-data",
+ "build",
+ "clean",
+ "distclean",
+ "fix",
+ "info",
+ "inspector",
+ "lint",
+ "migration",
+ "pretty",
+ "profiling",
+ "source",
+ "source-all",
+ "source-hybrid",
+ "simulation-build",
+ "simulation-run",
+ "test",
+ "test-source",
+ "translation"
+ ],
+
+ "default-job" : "source-hybrid",
+
+ "let" :
+ {
+ "APPLICATION" : "com.kuprowski.helenos",
+ "QOOXDOO_PATH" : "../../../../../../tools/qooxdoo",
+ "QXTHEME" : "com.kuprowski.helenos.theme.Theme",
+ "API_EXCLUDE" : ["qx.test.*", "${APPLICATION}.theme.*", "${APPLICATION}.test.*", "${APPLICATION}.simulation.*"],
+ "LOCALES" : [ "en" ],
+ "CACHE" : "${TMPDIR}/qx${QOOXDOO_VERSION}/cache",
+ "ROOT" : "."
+ },
+
+ // You only need to edit the remainder of this file, if you want to customize
+ // specific jobs, or add own job definitions.
+
+ "jobs" :
+ {
+ // Uncomment the following entry to add a contrib or library to your
+ // project; make sure to adapt the path to the Manifest.json; if you are
+ // using a contrib: library, it will be downloaded into the path specified
+ // by the 'cache/downloads' config key
+ /*
+ "libraries" :
+ {
+ "library" :
+ [
+ {
+ "manifest" : "contrib://SkeletonApplication/trunk/Manifest.json"
+ }
+ ]
+ }
+ */
+
+ // If you want to tweak a job setting, see the following sample where
+ // the "format" feature of the "build-script" job is overridden.
+ // To see a list of available jobs, invoke 'generate.py x'.
+ /*
+ ,"build-script" :
+ {
+ "compile-options" :
+ {
+ "code" :
+ {
+ "format" : false
+ }
+ }
+ }
+ */
+ }
+}
@@ -0,0 +1,143 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+################################################################################
+#
+# qooxdoo - the new era of web development
+#
+# http://qooxdoo.org
+#
+# Copyright:
+# 2008 - 2012 1&1 Internet AG, Germany, http://www.1und1.de
+#
+# 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:
+# * Thomas Herchenroeder (thron7)
+#
+################################################################################
+
+##
+# This is a stub proxy for the real generator.py
+##
+
+import sys, os, re, subprocess, codecs, optparse
+
+CMD_PYTHON = sys.executable
+QOOXDOO_PATH = '../../../../../../tools/qooxdoo'
+QX_PYLIB = "tool/pylib"
+
+##
+# A derived OptionParser class that ignores unknown options (The parent
+# class raises in those cases, and stops further processing).
+# We need this, as we are only interested in -c/--config on this level, and
+# want to ignore pot. other options.
+#
+class MyOptionParser(optparse.OptionParser):
+ ##
+ # <rargs> is the raw argument list. The original _process_args mutates
+ # rargs, processing options into <values> and copying interspersed args
+ # into <largs>. This overridden version ignores unknown or ambiguous
+ # options.
+ def _process_args(self, largs, rargs, values):
+ while rargs:
+ try:
+ optparse.OptionParser._process_args(self, largs, rargs, values)
+ except (optparse.BadOptionError, optparse.AmbiguousOptionError):
+ pass
+
+
+def parseArgs():
+ parser = MyOptionParser()
+ parser.add_option(
+ "-c", "--config", dest="config", metavar="CFGFILE",
+ default="config.json", help="path to configuration file"
+ )
+ (options, args) = parser.parse_args(sys.argv[1:])
+ return options, args
+
+ShellOptions, ShellArgs = parseArgs()
+
+
+# this is from misc.json, duplicated for decoupling
+_eolComment = re.compile(r'(?<![a-zA-Z]:)//.*$', re.M) # double $ for string.Template
+_mulComment = re.compile(r'/\*.*?\*/', re.S)
+def stripComments(s):
+ b = _eolComment.sub('',s)
+ b = _mulComment.sub('',b)
+ return b
+
+def getQxPath():
+ path = QOOXDOO_PATH
+ # OS env takes precedence
+ if os.environ.has_key("QOOXDOO_PATH"):
+ path = os.environ["QOOXDOO_PATH"]
+
+ # else use QOOXDOO_PATH from config.json
+ else:
+ config_file = ShellOptions.config
+ if os.path.exists(config_file):
+ # try json parsing with qx json
+ if not path.startswith('${'): # template macro has been resolved
+ sys.path.insert(0, os.path.join(path, QX_PYLIB))
+ try:
+ from misc import json
+ got_json = True
+ except:
+ got_json = False
+
+ got_path = False
+ if got_json:
+ config_str = codecs.open(config_file, "r", "utf-8").read()
+ config_str = stripComments(config_str)
+ config = json.loads(config_str)
+ p = config.get("let")
+ if p:
+ p = p.get("QOOXDOO_PATH")
+ if p:
+ path = p
+ got_path = True
+
+ # regex parsing - error prone
+ if not got_path:
+ qpathr=re.compile(r'"QOOXDOO_PATH"\s*:\s*"([^"]*)"\s*,?')
+ conffile = codecs.open(config_file, "r", "utf-8")
+ aconffile = conffile.readlines()
+ for line in aconffile:
+ mo = qpathr.search(line)
+ if mo:
+ path = mo.group(1)
+ break # assume first occurrence is ok
+
+ path = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), path))
+
+ return path
+
+os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) # switch to skeleton dir
+qxpath = getQxPath()
+REAL_GENERATOR = os.path.join(qxpath, 'tool', 'bin', 'generator.py')
+
+if not os.path.exists(REAL_GENERATOR):
+ print "Cannot find real generator script under: \"%s\"; aborting" % REAL_GENERATOR
+ sys.exit(1)
+
+argList = []
+argList.append(CMD_PYTHON)
+argList.append(REAL_GENERATOR)
+argList.extend(sys.argv[1:])
+if sys.platform == "win32":
+ argList1=[]
+ for arg in argList:
+ if arg.find(' ')>-1:
+ argList1.append('"%s"' % arg)
+ else:
+ argList1.append(arg)
+ argList = argList1
+else:
+ argList = ['"%s"' % x for x in argList] # quote argv elements
+
+cmd = " ".join(argList)
+retval = subprocess.call(cmd, shell=True)
+sys.exit(retval)
@@ -0,0 +1,11 @@
+Desktop Skeleton - A qooxdoo Application Template
+==================================================
+
+This is a qooxdoo application skeleton which is used as a template. The
+'create-application.py' script (usually under tool/bin/create-application.py)
+will use this and expand it into a self-contained qooxdoo application which
+can then be further extended. Please refer to the script and other documentation
+for further information.
+
+short:: is a standard qooxdoo GUI application
+copy_file:: tool/data/generator/needs_generation.js source/script/custom.js
@@ -0,0 +1,75 @@
+/* ************************************************************************
+
+ Copyright:
+
+ License:
+
+ Authors:
+
+************************************************************************ */
+
+/* ************************************************************************
+
+#asset(com/kuprowski/helenos/*)
+
+************************************************************************ */
+
+/**
+ * This is the main application class of your custom application "helenos"
+ */
+qx.Class.define("com.kuprowski.helenos.Application",
+{
+ extend : qx.application.Standalone,
+
+
+
+ /*
+ *****************************************************************************
+ MEMBERS
+ *****************************************************************************
+ */
+
+ members :
+ {
+ /**
+ * This method contains the initial application code and gets called
+ * during startup of the application
+ *
+ * @lint ignoreDeprecated(alert)
+ */
+ main : function()
+ {
+ // Call super class
+ this.base(arguments);
+
+ // Enable logging in debug variant
+ if (qx.core.Environment.get("qx.debug"))
+ {
+ // support native logging capabilities, e.g. Firebug for Firefox
+ qx.log.appender.Native;
+ // support additional cross-browser console. Press F7 to toggle visibility
+ qx.log.appender.Console;
+ }
+
+ /*
+ -------------------------------------------------------------------------
+ Below is your actual application code...
+ -------------------------------------------------------------------------
+ */
+
+ // Create a button
+ var button1 = new qx.ui.form.Button("First Button", "com/kuprowski/helenos/test.png");
+
+ // Document is the application root
+ var doc = this.getRoot();
+
+ // Add button to document at fixed coordinates
+ doc.add(button1, {left: 100, top: 50});
+
+ // Add an event listener
+ button1.addListener("execute", function(e) {
+ alert("Hello World!");
+ });
+ }
+ }
+});
@@ -0,0 +1,6 @@
+/** <h3> com.kuprowski.helenos API Documentation </h3>
+ *
+ * Replace this text with an appropriate overview and introduction to your
+ * application.
+ *
+ */
Oops, something went wrong.

0 comments on commit 1c78a29

Please sign in to comment.