Update of /cvsroot/qooxdoo/qooxdoo/source/script/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13188/source/script/core
Modified Files:
Tag: renderer
QxObject.js QxTimer.js
Log Message:
Improved code and structure of QxObject, some cleanups
Index: QxObject.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/core/QxObject.js,v
retrieving revision 1.2.2.34
retrieving revision 1.2.2.35
diff -u -d -r1.2.2.34 -r1.2.2.35
--- QxObject.js 16 Jan 2006 16:11:55 -0000 1.2.2.34
+++ QxObject.js 23 Jan 2006 12:43:46 -0000 1.2.2.35
@@ -26,11 +26,10 @@
/* ************************************************************************
#package(core)
-#require(QxNative)
#require(QxExtend)
-#require(QxClient)
-#require(QxMain)
+#require(QxConst)
#require(QxUtil)
+#post(QxObjectCore)
************************************************************************ */
@@ -51,43 +50,41 @@
QxObject.extend(Object, "QxObject");
-var QxObjectCounter = 0;
-var QxObjectDataBase = [];
-QxObject.toHashCode = function(o)
+
+
+
+/*
+---------------------------------------------------------------------------
+ UTILITIES
+---------------------------------------------------------------------------
+*/
+
+proto.toString = function()
{
- if(o._hashCode != null) {
- return o._hashCode;
+ if(this.classname) {
+ return "[object " + this.classname + "]";
};
- return o._hashCode = QxObjectCounter++;
+ return "[object Object]";
};
-QxObject.dispose = function()
-{
- for (var i=QxObjectDataBase.length-1; i>=0; i--)
- {
- if (typeof QxObjectDataBase[i] != QxConst.TYPEOF_UNDEFINED)
- {
- QxObjectDataBase[i].dispose();
+proto.toHashCode = function() {
+ return this._hashCode;
+};
- if (typeof QxObjectDataBase == QxConst.TYPEOF_UNDEFINED) {
- break;
- };
- delete QxObjectDataBase[i];
- };
- };
- delete QxObjectDataBase;
-};
-QxObject.addProperty({ name : "enabled", type : QxConst.TYPEOF_BOOLEAN, defaultValue : true, getAlias : "isEnabled" });
-QxObject.DEBUG_MSG_BEFORE = "[HASHCODE:";
-QxObject.DEBUG_MSG_AFTER = "]";
-QxObject.DEBUG_FUNCERRORPRE = "Failed to execute \"";
-QxObject.DEBUG_FUNCERRORPOST = "()\": ";
+
+
+
+/*
+---------------------------------------------------------------------------
+ DEBUGGING INTERFACE
+---------------------------------------------------------------------------
+*/
proto.debug = function(m, c) {
QxDebug(this.classname + QxObject.DEBUG_MSG_BEFORE + this._hashCode + QxObject.DEBUG_MSG_AFTER, m, c);
@@ -113,61 +110,16 @@
};
};
-proto.toString = function()
-{
- if(this.classname) {
- return "[object " + this.classname + "]";
- };
-
- return "[object Object]";
-};
-
-proto.toHashCode = function() {
- return this._hashCode;
-};
-
-proto._modifyEnabled = function(propValue, propOldValue, propData) {
- return true;
-};
-proto._disposed = false;
-/*!
- Dispose this object
-*/
-proto.dispose = function()
-{
- if (this.getDisposed()) {
- return;
- };
- if (this._data)
- {
- for(var p in this._data) {
- delete this._data[p];
- };
- delete this._data;
- };
- this._disposed = true;
-
- delete QxObjectDataBase[this._hashCode];
-};
-
-/*!
- Returns true if the object is disposed.
-*/
-proto.getDisposed = function() {
- return this._disposed;
-};
-
-/*!
- Returns true if the object is disposed.
+/*
+---------------------------------------------------------------------------
+ COMMON SETTER/GETTER SUPPORT
+---------------------------------------------------------------------------
*/
-proto.isDisposed = function() {
- return this._disposed;
-};
/*!
Sets multiple properties at once by using a property list
@@ -258,6 +210,18 @@
};
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ DYNAMIC DATA STORAGE SUPPORT
+---------------------------------------------------------------------------
+*/
+
/*!
*/
@@ -378,4 +342,57 @@
delete this[QxConst.INTERNAL_RETRIEVEDEFAULT + methodKey];
delete this[QxConst.INTERNAL_STOREDEFAULT + methodKey];
delete this[QxConst.INTERNAL_RESTORE + methodKey];
-};
\ No newline at end of file
+};
+
+
+
+
+
+
+
+/*
+---------------------------------------------------------------------------
+ DISPOSER
+---------------------------------------------------------------------------
+*/
+
+proto._disposed = false;
+
+/*!
+ Dispose this object
+*/
+proto.dispose = function()
+{
+ if (this.getDisposed()) {
+ return;
+ };
+
+ // Dispose data
+ if (this._data)
+ {
+ for(var p in this._data) {
+ this._data[p] = null;
+ };
+
+ this._data = null;
+ };
+
+ this._disposed = true;
+
+ // Delete Entry from Object DB
+ QxObjectDataBase[this._hashCode] = null;
+};
+
+/*!
+ Returns true if the object is disposed.
+*/
+proto.getDisposed = function() {
+ return this._disposed;
+};
+
+/*!
+ Returns true if the object is disposed.
+*/
+proto.isDisposed = function() {
+ return this._disposed;
+};
Index: QxTimer.js
===================================================================
RCS file: /cvsroot/qooxdoo/qooxdoo/source/script/core/QxTimer.js,v
retrieving revision 1.5.2.20
retrieving revision 1.5.2.21
diff -u -d -r1.5.2.20 -r1.5.2.21
--- QxTimer.js 16 Jan 2006 16:11:55 -0000 1.5.2.20
+++ QxTimer.js 23 Jan 2006 12:43:46 -0000 1.5.2.21
@@ -73,7 +73,7 @@
this._intervalHandle = window.setInterval(this.__oninterval, this.getInterval());
};
- return QxTarget.prototype._modifyEnabled.call(this, propValue, propOldValue, propData);
+ return true;
};
|