JSDOC/Introspect/Class.js
[gnome.introspection-doc-generator] / JSDOC / Introspect / Class.js
index 222ffdb..defcce9 100644 (file)
@@ -4,14 +4,22 @@ GI      = imports.gi.GIRepository;
 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;
 Base = imports['JSDOC/Introspect/Base.js'].Base;
 
+XObject = imports.XObject.XObject;
+console = imports.console.console;
+
+
+NameSpace = imports.NameSpace.NameSpace;
+Basic = imports.Basic.Basic;
+
 
 
 
@@ -22,155 +30,155 @@ Base = imports['JSDOC/Introspect/Base.js'].Base;
 
 
 
-Class = function(ns, name) {
-    Base.call(this, ns, name);
-    this.loadExtends();
-    this.loadImplements();
-    //console.log("CREATED(Class) " + this.alias);
-}
-
-
-Roo.extend(Class, Base, {
-    titleType : 'Class',
-    
-    loadExtends : function()
-    {
-        var bi = this.getBI();
-        
-        var pi = GI.object_info_get_parent(bi);
-        this.extendsClasses = [];
-        if (!pi) {
-            return;
-        }
-        this.parent = Introspect.factory(
-            'Class',
-            GI.base_info_get_namespace(pi),
-            GI.base_info_get_name(pi)
-        );
-        
-        this.extendsClasses = [ this.parent ];
-        
-        
-        Roo.each(this.parent.extendsClasses, function(p) {
-            this.extendsClasses.push(p);
-        },this);
-        
-        
-        
+Class = XObject.define(
+    function(ns, name) {
+        Base.call(this, ns, name);
+        this.loadExtends();
+        this.loadImplements();
+        //console.log("CREATED(Class) " + this.alias);
     },
-    loadImplements : function()
+    Base, 
     {
-        var bb = this.getBI();
-        this.implementInterfaces = [];
+        titleType : 'Class',
         
-        var iflist = [];
-        for(var i =0; i < GI.object_info_get_n_interfaces(bb); i++) {
-           
-            var prop = GI.object_info_get_interface(bb,i);
-             
+        loadExtends : function()
+        {
+            var bi = this.getBI();
             
-            var iface = Introspect.factory(
-                'Interface', 
-                GI.base_info_get_namespace(prop) , GI.base_info_get_name(prop)
+            var pi = GI.object_info_get_parent(bi);
+            this.extendsClasses = [];
+            if (!pi) {
+                return;
+            }
+            this.parent = Introspect.factory(
+                'Class',
+                GI.base_info_get_namespace(pi),
+                GI.base_info_get_name(pi)
             );
             
+            this.extendsClasses = [ this.parent ];
+            
+            
+            this.parent.extendsClasses.map(function(p) {
+                this.extendsClasses.push(p);
+            },this);
+            
             
-            if (iflist.indexOf(iface.alias) < 0) {
-                //console.log("ADDING IFACE " + iface.alias);
-                iflist.push(iface.alias);
-                this.implementInterfaces.push(iface);
-            }
-        }
-        // ask the first of the parents.. - which will have it loaded already
-        if (this.extendsClasses.length) {
             
-            //this.extendsClasses[0].loadImplements();
+        },
+        loadImplements : function()
+        {
+            var bb = this.getBI();
+            this.implementInterfaces = [];
             
-            Roo.each(this.extendsClasses[0].implementInterfaces, function(si) {
+            var iflist = [];
+            for(var i =0; i < GI.object_info_get_n_interfaces(bb); i++) {
+               
+                var prop = GI.object_info_get_interface(bb,i);
+                 
                 
-                if (iflist.indexOf(si.alias) < 0) {
-                    //console.log("From extends ("+ si.alias + ") IFACE " + si.alias);
-                    iflist.push(si.alias);
-                    this.implementInterfaces.push(si);
+                var iface = Introspect.factory(
+                    'Interface', 
+                    GI.base_info_get_namespace(prop) , GI.base_info_get_name(prop)
+                );
+                
+                
+                if (iflist.indexOf(iface.alias) < 0) {
+                    //console.log("ADDING IFACE " + iface.alias);
+                    iflist.push(iface.alias);
+                    this.implementInterfaces.push(iface);
                 }
-            },this);
-            
-        }
-        //console.dump(iflist);
-        if (this.alias == 'Atk.NoOpObject') {
-        //    throw "exut";
-           }
-       // console.dump(this.implementInterfaces);
-    },
-    
-    
-    
-    
-    load : function()
-    {
-        if (this._loaded) {
-            return; // already loaded..
-        }
-        
-        if (this.parent) { // load up parents first
-            this.parent.load();
-        }
-        Roo.each(this.implementInterfaces, function(iface) {
-            iface.load();
-        });
+            }
+            // ask the first of the parents.. - which will have it loaded already
+            if (this.extendsClasses.length) {
+                
+                //this.extendsClasses[0].loadImplements();
+                
+                this.extendsClasses[0].implementInterfaces.map( function(si) {
+                    
+                    if (iflist.indexOf(si.alias) < 0) {
+                        //console.log("From extends ("+ si.alias + ") IFACE " + si.alias);
+                        iflist.push(si.alias);
+                        this.implementInterfaces.push(si);
+                    }
+                },this);
+                
+            }
+            //console.dump(iflist);
+            if (this.alias == 'Atk.NoOpObject') {
+            //    throw "exut";
+               }
+           // console.dump(this.implementInterfaces);
+        },
         
         
-        //console.log("load(Class) " + this.alias);
-        // my props..
-        var props = [];
-        this.genericBuildList('object', 'property', props, 'properties');
-        this.genericBuildList('object', 'field', props, 'properties');
-
-        this.genericExtends(  props, 'properties');    
-        this.genericImplements( props, 'properties');    
-       
-        var signals = [];
-        this.genericBuildList('object', 'signal', signals, 'signals');
-        this.genericExtends(  signals, 'signals');    
-        this.genericImplements( signals, 'signals');    
         
         
-        Introspect.references[this.alias] = Introspect.references[this.alias] || [];
-        if (this.alias == 'GObject.Object') {
-            this._loaded = true;
-            return;
+        load : function()
+        {
+            if (this._loaded) {
+                return; // already loaded..
+            }
+            
+            if (this.parent) { // load up parents first
+                this.parent.load();
+            }
+            this.implementInterfaces.map(function(iface) {
+                iface.load();
+            });
+            
+            
+            //console.log("load(Class) " + this.alias);
+            // my props..
+            var props = [];
+            this.genericBuildList('object', 'property', props, 'properties');
+            this.genericBuildList('object', 'field', props, 'properties');
+
+            this.genericExtends(  props, 'properties');    
+            this.genericImplements( props, 'properties');    
+           
+            var signals = [];
+            this.genericBuildList('object', 'signal', signals, 'signals');
+            this.genericExtends(  signals, 'signals');    
+            this.genericImplements( signals, 'signals');    
+            
+            
+            Introspect.references[this.alias] = Introspect.references[this.alias] || [];
+            if (this.alias == 'GObject.Object') {
+                this._loaded = true;
+                return;
+            }
+            
+            
+            this.constructors.push({
+                name : '', // not really...
+                params:   this.properties.length ?  [ { type :  'Object', be_null :  true,  name : 'properties' } ] : [],
+                returns :  [],
+                isConstructor : true,
+                isStatic : false,
+                memberOf : this.alias,
+                exceptions : [],
+                // in theory..
+                desc : ''
+            });
+            
+            
+            var methods = [];
+            this.genericBuildList('object', 'method', methods, 'methods');
+            // dont inherit functiosn or consturctors...
+            
+            this.genericExtends(  methods, 'methods');    
+            this.genericImplements( methods, 'methods');    
+            
+            
+            
+            //console.log("loaded(Class) " + this.alias);
+              
+            this._loaded  = true;
         }
-        
-        
-        this.constructors.push({
-            name : '', // not really...
-            params:   this.properties.length ?  [ { type :  'Object', be_null :  true,  name : 'properties' } ] : [],
-            returns :  [],
-            isConstructor : true,
-            isStatic : false,
-            memberOf : this.alias,
-            exceptions : [],
-            // in theory..
-            desc : ''
-        });
-        
-        
-        var methods = [];
-        this.genericBuildList('object', 'method', methods, 'methods');
-        // dont inherit functiosn or consturctors...
-        
-        this.genericExtends(  methods, 'methods');    
-        this.genericImplements( methods, 'methods');    
+         
+         
         
         
         
-        //console.log("loaded(Class) " + this.alias);
-          
-        this._loaded  = true;
-    }
-     
-     
-    
-    
-    
 });