More commits to sync working copy
[gnome.introspection-doc-generator] / JSDOC / Introspect / Base.js
index d64d3aa..39cfa76 100644 (file)
@@ -5,11 +5,10 @@ GLib    = imports.gi.GLib;
 xml     = imports.libxml;
 //GObject = imports.gi.GObject;
 
+imports['Object.js'].load(Object);
+
 console = imports['console.js'].console;
 JSDOC   = imports['JSDOC.js'].JSDOC;
-Roo     = imports['Roo.js'].Roo;
-
-
 Introspect = imports['JSDOC/Introspect.js'].Introspect;
 Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
 
@@ -22,142 +21,143 @@ Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
 
 
 
-
-
-Base = function(ns, name) {
-    // fake should not happen?
-    
-    
-    if (typeof(name) == 'undefined') {
-        var ar = ns.split('.');
-        ns = ar[0];
-        name = ar[1];
-    }
-    this.ns = ns;
-    this.name = name;
-    this.alias = ns + '.' + name;
-    //console.log("CREATE(Base) " + this.alias);
-    this._loaded = false;
-    
-    
-    // reset all of these..
-    this.signals = [];
-    this.methods = [];
-    this.constructors = [];
-    this.functions= [];
-   
-    this.values = []; // for enum;g;
-    this.constants = [];
-    
-    this.properties = [];
-    this.implementInterfaces = []; // obect - which interface it implements.
-    this.implementedBy = []; // interface - which object uses it.
-    this.extendsClasses = []; // what it extends...
-    this.childClasses = []; // what 
-     this.desc = Introspect.doc(this.alias );
-    
-    
-}
-Roo.extend(Base, Basic, {
-    titleType: 'Unknown',
-    name :  '',
-    ns : '',
-   
-    signals : [],
-    methods : [],
-    constructors : [],
-    functions: [],
-   
-    values : [], // for enum
-    constants : [],
-    
-    properties : [],
-    implementInterfaces : [], // obect - which interface it implements.
-    implementedBy : [], // interface - which object uses it.
-    extendsClasses : [], // what it extends...
-    childClasses : [], // what 
-    
-    
-    
-    
-    getBI : function()  {
+Base = Object.define(
+   function(ns, name) {
+        // fake should not happen?
         
-        var gi = GI.IRepository.get_default();
-        return gi.find_by_name(this.ns, this.name);
-    },
-     // on, getwhat, simple list (name), variable to add to.
-    genericBuildList : function( onwhat, type, keylist, saveto)
-    {
         
-        //console.log(this.alias +" - ADDING :" + type);
-        //if (this[saveto].length) {
-        //    Seed.print( "EROROR = it's alreayd loaded why?");
-            //throw "oops";
-        //   }
-        var bb = this.getBI();
-        var _this = this;
-       //console.log("ADD " + type[0].toUpperCase() + type.substring(1));
-        var cls = Introspect[type[0].toUpperCase() + type.substring(1)]; // ucfirst.
-        if (!cls) {
-            console.log("COULD NOT FIND Introspect: " + type[0].toUpperCase() + type.substring(1));
-           }
-            
-        var plural = type + 's';
-        plural = plural == 'propertys' ? 'properties' : plural;
+        if (typeof(name) == 'undefined') {
+            var ar = ns.split('.');
+            ns = ar[0];
+            name = ar[1];
+        }
+        this.ns = ns;
+        this.name = name;
+        this.alias = ns + '.' + name;
+        //console.log("CREATE(Base) " + this.alias);
+        this._loaded = false;
         
         
-        for(var i =0; i < GI[onwhat + '_info_get_n_' + plural ](bb); i++) {            
-            var add= new cls(GI[onwhat + '_info_get_' + type ](bb,i), this, saveto, keylist);
-            //console.log("CLS :" + this.alias + " EL: " + add.name);
-        }
-         
+        // reset all of these..
+        this.signals = [];
+        this.methods = [];
+        this.constructors = [];
+        this.functions= [];
+       
+        this.values = []; // for enum;g;
+        this.constants = [];
+        
+        this.properties = [];
+        this.implementInterfaces = []; // obect - which interface it implements.
+        this.implementedBy = []; // interface - which object uses it.
+        this.extendsClasses = []; // what it extends...
+        this.childClasses = []; // what 
+         this.desc = Introspect.doc(this.alias );
         
-    },
-    // loop through and add stuff from extends..
-    genericExtends :  function(  keylist,  saveto)   
+        
+    }, 
+    Basic, 
     {
-        // do not overlay gobject props or methods etc.
+        titleType: 'Unknown',
+        name :  '',
+        ns : '',
+       
+        signals : [],
+        methods : [],
+        constructors : [],
+        functions: [],
+       
+        values : [], // for enum
+        constants : [],
         
-        if (!this.extendsClasses.length) {
-            return;
-        }
-        if (this.extendsClasses[0].alias == 'GObject.Object') {
-            return;
-        }
-            
+        properties : [],
+        implementInterfaces : [], // obect - which interface it implements.
+        implementedBy : [], // interface - which object uses it.
+        extendsClasses : [], // what it extends...
+        childClasses : [], // what 
         
-        var _this = this;
         
-        this.extendsClasses[0].load();
-        Roo.each(this.extendsClasses[0][saveto], function(prop) {
-            if (keylist.indexOf(prop.name) < 0) {
-                _this[saveto].push(prop);
-                keylist.push(prop.name);
-            }
-        },this);
         
-    },
-    // loop through and add stuff from implements..
-    genericImplements :  function(  keylist,  saveto)   {
-    
-        var _this = this;
-        Roo.each(this.implementInterfaces, function(iface) {
+        
+        getBI : function()  {
+            
+            var gi = GI.IRepository.get_default();
+            return gi.find_by_name(this.ns, this.name);
+        },
+         // on, getwhat, simple list (name), variable to add to.
+        genericBuildList : function( onwhat, type, keylist, saveto)
+        {
             
-            iface.load();
+            //console.log(this.alias +" - ADDING :" + type);
+            //if (this[saveto].length) {
+            //    Seed.print( "EROROR = it's alreayd loaded why?");
+                //throw "oops";
+            //   }
+            var bb = this.getBI();
+            var _this = this;
+           //console.log("ADD " + type[0].toUpperCase() + type.substring(1));
+            var cls = Introspect[type[0].toUpperCase() + type.substring(1)]; // ucfirst.
+            if (!cls) {
+                console.log("COULD NOT FIND Introspect: " + type[0].toUpperCase() + type.substring(1));
+               }
+                
+            var plural = type + 's';
+            plural = plural == 'propertys' ? 'properties' : plural;
+            
+            
+            for(var i =0; i < GI[onwhat + '_info_get_n_' + plural ](bb); i++) {            
+                var add= new cls(GI[onwhat + '_info_get_' + type ](bb,i), this, saveto, keylist);
+                //console.log("CLS :" + this.alias + " EL: " + add.name);
+            }
+             
             
-            Roo.each(iface[saveto], function(prop) {
+        },
+        // loop through and add stuff from extends..
+        genericExtends :  function(  keylist,  saveto)   
+        {
+            // do not overlay gobject props or methods etc.
+            
+            if (!this.extendsClasses.length) {
+                return;
+            }
+            if (this.extendsClasses[0].alias == 'GObject.Object') {
+                return;
+            }
+                
+            
+            var _this = this;
+            
+            this.extendsClasses[0].load();
+            this.extendsClasses[0][saveto].map(function(prop) {
                 if (keylist.indexOf(prop.name) < 0) {
                     _this[saveto].push(prop);
                     keylist.push(prop.name);
                 }
             },this);
             
-        }, this);
+        },
+        // loop through and add stuff from implements..
+        genericImplements :  function(  keylist,  saveto)   {
         
-    },
+            var _this = this;
+            this.implementInterfaces.map(function(iface) {
+                
+                iface.load();
+                
+                iface[saveto].map( function(prop) {
+                    if (keylist.indexOf(prop.name) < 0) {
+                        _this[saveto].push(prop);
+                        keylist.push(prop.name);
+                    }
+                },this);
+                
+            }, this);
+            
+        },
+                
             
         
-    
 });