JSDOC/Introspect/Base.js
[gnome.introspection-doc-generator] / JSDOC / Introspect / Base.js
index 39cfa76..9876fb5 100644 (file)
@@ -5,12 +5,11 @@ GLib    = imports.gi.GLib;
 xml     = imports.libxml;
 //GObject = imports.gi.GObject;
 
-imports['Object.js'].load(Object);
+XObject = imports.XObject.XObject;
+console = imports.console.console;
 
-console = imports['console.js'].console;
-JSDOC   = imports['JSDOC.js'].JSDOC;
-Introspect = imports['JSDOC/Introspect.js'].Introspect;
-Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
+NameSpace = imports.NameSpace.NameSpace;
+Basic = imports.Basic.Basic;
 
 
 
@@ -22,7 +21,7 @@ Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
 
 
  
-Base = Object.define(
+Base = XObject.define(
    function(ns, name) {
         // fake should not happen?
         
@@ -53,7 +52,16 @@ Base = Object.define(
         this.implementedBy = []; // interface - which object uses it.
         this.extendsClasses = []; // what it extends...
         this.childClasses = []; // what 
-         this.desc = Introspect.doc(this.alias );
+         this.desc = NameSpace.doc(this.alias );
+        
+        
+        var gi = GI.IRepository.get_default();
+        var ver = gi.get_version(ns);
+        var pth = GI.IRepository.get_search_path ();
+        var gir_path = pth[0].replace(/lib\/girepository-1.0/, 'share\/gir-1.0');
+       //console.log(fn);
+        this.gir_file = gir_path + '/'+ ns + '-' + ver + '.gir';
+        this.gir_filename = ns + '-' + ver + '.gir';
         
         
     }, 
@@ -97,7 +105,8 @@ Base = Object.define(
             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.
+            var clname = type[0].toUpperCase() + type.substring(1);
+            var cls = imports[clname][clname];
             if (!cls) {
                 console.log("COULD NOT FIND Introspect: " + type[0].toUpperCase() + type.substring(1));
                }