JSDOC/Introspect.js
[gnome.introspection-doc-generator] / JSDOC / Introspect.js
index 1e4a4ca..7777c94 100644 (file)
@@ -8,7 +8,7 @@ xml     = imports.libxml;
 imports['Object.js'].load(Object);
 
 console = imports['console.js'].console;
-JSDOC   = imports['JSDOC.js'].JSDOC;
+
 
 xnew    = imports['xnew.js'].xnew;
 
@@ -42,10 +42,10 @@ Object.extend(Introspect, {
             
             while (true) {
                 
-                var fn = GLib.dir_read_name(gdir);
+                var fn = gdir.read_name();
            //      console.log('trying ' +  fn);
                 if (!fn) {
-                    GLib.dir_close(gdir);
+                    gdir.close();
                     return;;
                 }
                 if (!fn.match(/.typelib$/)) {
@@ -142,6 +142,16 @@ Object.extend(Introspect, {
                     continue;
             }
         }
+        
+                
+        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);
+        ret.gir_file = gir_path + '/'+ ns + '-' + ver + '.gir';
+        ret.gir_filename = ns + '-' + ver + '.gir';
+        
         //console.dump(this.ifaceList);
         return ret;
 
@@ -226,6 +236,10 @@ Object.extend(Introspect, {
             
             var n =  getAttribute(element, 'name') ;
             //console.log("WALK" + n);
+            if (element.name == 'signal') {
+                path += '.signal';
+            }
+            
             if (n) {
                 path += path.length ? '.' : '';
                 path += n;
@@ -234,7 +248,6 @@ Object.extend(Introspect, {
                 path += '.return-value';
             }
             
-            
             var d =   getAttribute(element,'doc');
             if (d) {
              //   Seed.print(path + ':' + d);