*/
/**
- * XObject
+ * @class XObject
+ *
* Yet another attempt to create a usable object construction library for seed..
*
* Why is this useful?
* Extend this.. to use it's wonderful features..
*
* normal usage:
+ * <pre><code>
* XObject = imports.XObject.XObject;
*
* Xyz = new XObject({
* ]
* });
* Xyz.init(); // create and show.
- *
- *
- *
- * @arg xtype {String|Function} constructor or string.
- * @arg id {String} (optional) id for registry
- * @arg xns {String|Object} (optional) namespace eg. Gtk or 'Gtk' - used with xtype.
- * @arg items {Array} (optional) list of child elements which will be constructed.. using XObject
- * @arg listeners {Object} (optional) map Gobject signals to functions
- * @arg pack {Function|String|Array} (optional) how this object gets added to it's parent
- * @arg el {Object} (optional) premade GObject
- *
- * --- needs a xdebug option!
- *
+ * </code></pre>
*
* He's some questions.
* - should we generate ID's for all elements? (if so we probably need to garbage collect)
* - should we have a special property to use as the constructor / gobject.properties rather
* than sending all basic types to this?
+ *
+ *
*
- *
+ * @cfg xtype {String|Function} constructor or string.
+ * @cfg id {String} (optional) id for registry
+ * @cfg xns {String|Object} (optional) namespace eg. Gtk or 'Gtk' - used with xtype.
+ * @cfg items {Array} (optional) list of child elements which will be constructed.. using XObject
+ * @cfg listeners {Object} (optional) map Gobject signals to functions
+ * @cfg pack {Function|String|Array} (optional) how this object gets added to it's parent
+ * @cfg el {Object} (optional) premade GObject
+ *
*/
function XObject (cfg) {
XObject.prototype = {
/**
- * @property el {GObject} the Gtk / etc. element.
+ * @type {GObject}
+ * the Gtk / GObject element.
*/
el : false,
- /*
- * @property items {Array} list of sub elements
+ /**
+ * @type {Array}
+ * list of sub elements
*/
+ items : false,
/**
- * @property parent {XObject} parent Element
+ * @type {XObject}
+ * parent Element
*/
-
+ parent: false,
/**
- * @property config {Object} the construction configuration.
+ * @type {Object}
+ * the constructor configuration.
*/
+ config: false,
/**
- * @method init
* Initializes the Element (el) hooks up all the listeners
* and packs the children.
* you can override this, in child objects, then
/**
- * @method addItem
* Adds an item to the object using a new XObject
* uses pack property to determine how to add it.
- * @arg cfg {Object} same as XObject constructor.
+ * @param {Object} o same as XObject constructor.
*/
addItem : function(o) {
},
/**
- * @method addListener
* Connects a method to a signal. (gjs/Seed aware)
*
- * @arg sig {String} name of signal
- * @arg fn {Function} handler.
+ * @param {String} sig name of signal
+ * @param {Function} fn handler.
*/
addListener : function(sig, fn)
{
},
/**
- * @method get
* Finds an object in the child elements using xid of object.
* prefix with '.' to look up the tree.. multiple '..' to look further up..
*
- * @arg name {String} name of signal
+ * @param {String} name name of signal
* @return {XObject|false} the object if found.
*/
get : function(xid)
ret = ch;
return true;
}
- })
+ });
if (ret) {
return ret;
}
if (ret) {
return true;
}
- })
+ });
return ret;
}
* @param {Object} config The source of the properties
* @param {Object} defaults A different object that will also be applied for default values
* @return {Object} returns obj
- * @member XObject extend
+ * @static
*/
return o;
};
-XObject.extend(XObject,
+XObject = XObject.extend(XObject,
{
/**
* Copies all the properties of config to obj, if the do not exist.
* @param {Object} obj The receiver of the properties
* @param {Object} config The source of the properties
* @return {Object} returns obj
- * @member Object extendIf
+ * @static
*/
* @param {Object} superclass The class being extended
* @param {Object} overrides (optional) A literal with members
* @return {Function} constructor (eg. class
- * @method define
*/
define : function(){
// inline overrides
* returns a list of keys of the object.
* @param {Object} obj object to inspect
* @return {Array} returns list of kyes
- * @member XObject keys
*/
keys : function(o)
{
},
/**
- * @member XObject createDelegate
- * creates a delage metdhod
+ * creates a delegate method (binds scope to a method call)
* @param {Function} method to wrap
* @param {Object} scope
* @param {Array} args to add