Update of /cvsroot/qooxdoo/qooxdoo/source/script/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23878/source/script/core
Modified Files:
Tag: renderer
QxApplication.js
Log Message:
Minor improvements and fixes
Index: QxApplication.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/core/QxApplication.js,v
retrieving revision 1.2.2.61
retrieving revision 1.2.2.62
diff -u -d -r1.2.2.61 -r1.2.2.62
--- QxApplication.js 27 Jan 2006 15:32:02 -0000 1.2.2.61
+++ QxApplication.js 28 Jan 2006 12:28:34 -0000 1.2.2.62
@@ -42,6 +42,12 @@
window.application.init();
};
+function QxApplicationUnload()
+{
+ window.application.dispose();
+ window.application = null;
+};
+
/*!
This contains the main qooxdoo application.
@@ -58,6 +64,8 @@
} else {
QxDom.addEventListener(window, "load", QxApplicationInit);
};
+
+ QxDom.addEventListener(window, QxConst.EVENT_TYPE_UNLOAD, QxApplicationUnload);
};
QxApplication.extend(QxTarget, "QxApplication");
@@ -96,13 +104,13 @@
if (this._initDone) {
return;
};
-
+
this._initDone = true;
-
+
this._initApplication();
this._initMain();
this._initPreload();
-
+
// initPostload will be executed from the first queue flush
};
@@ -120,34 +128,34 @@
proto._initApplication = function()
{
var s = (new Date).valueOf();
-
+
this.info("Pre phase");
-
+
try
{
// Output the number of available classes
this._printClassInfo();
-
+
// Output the number existing properties
this._printPropertyInfo();
-
+
// Print short client detection info
this._printClientInfo();
-
+
// Execute user define 'pre' method
this.debug("Executing application pre");
this.pre();
-
+
// Fire global 'pre' event
this.createDispatchEvent(QxConst.EVENT_TYPE_PRE);
-
+
// Create client window instance (and client-document, event- and focus-manager, ...)
- this._clientWindow = new QxClientWindow(window);
-
+ this._clientWindow = new QxClientWindow();
+
// Build virtual methods for easy additions of childrens and so on
this._remappingChildTable = QxParent.prototype._remappingChildTable;
QxParent.prototype.remapChildrenHandlingTo.call(this, this._clientWindow.getClientDocument());
-
+
// Output the number of currently instanciated objects
this._printInstanceInfo();
}
@@ -155,7 +163,7 @@
{
return this.error("...failed: " + ex);
};
-
+
this.debug("Done in: " + ((new Date).valueOf() - s) + "ms");
};
@@ -163,24 +171,24 @@
{
var s = (new Date).valueOf();
this.info("Main phase");
-
+
try
{
// Execute user define 'main' method
this.debug("Executing application main");
this.main();
-
+
// Fire global 'main' event
this.createDispatchEvent(QxConst.EVENT_TYPE_MAIN);
-
+
// Output the number of currently instanciated objects
- this._printInstanceInfo();
+ this._printInstanceInfo();
}
catch(ex)
{
return this.error("...failed: " + ex);
};
-
+
this.debug("Done in: " + ((new Date).valueOf() - s) + "ms");
};
@@ -188,31 +196,31 @@
{
var s = (new Date).valueOf();
this.info("Preloading phase");
-
+
try
{
// Preloading images which should be currently visible
var vPreloadList = QxImageManager._preloadList;
-
+
for (var vImageUri in vPreloadList) {
new QxImagePreloader(QxImageManager.buildURI(vImageUri));
};
-
+
// Fire global 'cache' event
this.createDispatchEvent(QxConst.EVENT_TYPE_CACHE);
-
+
// Finally flushing the queues with a timeout of 100ms
window.setTimeout(function()
{
var s = (new Date).valueOf();
var a = window.application;
-
+
a.info("Widget phase");
- a.debug("Rendering widgets");
-
+ a.debug("Rendering widgets");
+
a._ready = true;
QxWidget.flushGlobalQueues(true);
-
+
a.debug("Done in: " + ((new Date).valueOf() - s) + "ms");
a._initPostload();
}, 100);
@@ -221,7 +229,7 @@
{
return this.error("...failed: " + ex);
};
-
+
this.debug("Done in: " + ((new Date).valueOf() - s) + "ms");
};
@@ -229,27 +237,27 @@
{
var s = (new Date).valueOf();
this.info("Post phase");
-
+
try
{
// Output the number of currently instanciated objects
- this._printInstanceInfo();
-
+ this._printInstanceInfo();
+
// Execute user define 'post' method
this.debug("Executing application post");
this.post();
-
+
// Post load images which could be visible later
var vPreloadList = QxImageManager._preloadList;
var vImageList = QxImageManager._imageList;
-
+
for (var vImageUri in vImageList)
{
if (!vPreloadList[vImageUri]) {
new QxImagePreloader(QxImageManager.buildURI(vImageUri));
};
};
-
+
// Fire global 'post' event
this.createDispatchEvent(QxConst.EVENT_TYPE_POST);
}
@@ -257,7 +265,7 @@
{
return this.error("...failed: " + ex);
};
-
+
this.debug("Done in: " + ((new Date).valueOf() - s) + "ms");
};
@@ -346,19 +354,19 @@
return;
};
+ QxDom.removeEventListener(window, QxConst.EVENT_TYPE_UNLOAD, QxApplicationUnload);
+
if (QxClient.isGecko()) {
QxDom.removeEventListener(window, "DOMContentLoaded", QxApplicationInit);
} else {
QxDom.removeEventListener(window, "load", QxApplicationInit);
};
-
+
this._clientWindow = null;
QxTarget.prototype.dispose.call(this);
-
+
QxObject.dispose();
-
- window.application = null;
};
window.application = new QxApplication;
|