JSDOC/Packer.js
[app.jsdoc] / XObject.js
index ff524fc..d4f6bfd 100644 (file)
@@ -5,7 +5,8 @@
  */
  
 /**
- * XObject
+ * @class XObject
+ * 
  * Yet another attempt to create a usable object construction library for seed..
  * 
  * Why is this useful?
@@ -19,6 +20,7 @@
  * 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) {
@@ -65,21 +64,26 @@ 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 
@@ -179,10 +183,9 @@ XObject.prototype = {
       
      
      /**
-      * @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) {
         
@@ -230,11 +233,10 @@ XObject.prototype = {
         
     },
     /**
-      * @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) 
     {
@@ -254,11 +256,10 @@ XObject.prototype = {
         
     },
      /**
-      * @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)
@@ -300,7 +301,7 @@ XObject.prototype = {
  * @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
  */
 
 
@@ -317,14 +318,14 @@ XObject.extend = function(o, c, defaults){
     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
      */
 
 
@@ -363,7 +364,6 @@ XObject.extend(XObject,
      * @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
@@ -403,7 +403,6 @@ XObject.extend(XObject,
      * 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)
     {
@@ -415,8 +414,7 @@ XObject.extend(XObject,
     },
       
     /**
-     * @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