Re-arrange files, add support for classic JS Documentor, and packer
[gnome.introspection-doc-generator] / Introspect / NameSpace.js
similarity index 93%
rename from JSDOC/Introspect.js
rename to Introspect/NameSpace.js
index f85d174..a169d1b 100644 (file)
@@ -5,24 +5,13 @@ GLib    = imports.gi.GLib;
 xml     = imports.libxml;
 
 
-imports['Object.js'].load(Object);
+XObject = imports.XObject.XObject;
 
-console = imports['console.js'].console;
-
-
-xnew    = imports['xnew.js'].xnew;
+console = imports.console.console;
 
  
 
-
-Introspect = {};
-
-xnew.load(Introspect,'JSDOC/Introspect');
-
-
-
-Object.extend(Introspect, {
-    
+NameSpace = {
    
     references : { }, 
     
@@ -42,10 +31,10 @@ Object.extend(Introspect, {
             
             while (true) {
                 
-                var fn = GLib.dir_read_name(gdir);
+                var fn = gdir.read_name ? gdir.read_name () : GLib.dir_read_name(gdir);
            //      console.log('trying ' +  fn);
                 if (!fn) {
-                    GLib.dir_close(gdir);
+                    gdir.close ? gdir.close() : GLib.dir_close(gdir);
                     return;;
                 }
                 if (!fn.match(/.typelib$/)) {
@@ -111,7 +100,7 @@ Object.extend(Introspect, {
                     ret.interfaces.push(GI.base_info_get_name(info));
                     continue;
                 case  GI.IInfoType.FUNCTION:
-                    new Introspect.Method(info, ret, 'functions', []);    
+                    new imports.Method.Method(info, ret, 'functions', []);    
                     continue;
                 
                 case  GI.IInfoType.CALLBACK:
@@ -133,7 +122,7 @@ Object.extend(Introspect, {
                     ret.unions.push(GI.base_info_get_name(info));
                     continue;
                 case  GI.IInfoType.CONSTANT:
-                    new Introspect.Constant(info, ret, 'values', []);
+                    new imports.Constant.Constant(info, ret, 'values', []);
                     
                     continue;
                 
@@ -236,6 +225,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;
@@ -244,7 +237,6 @@ Object.extend(Introspect, {
                 path += '.return-value';
             }
             
-            
             var d =   getAttribute(element,'doc');
             if (d) {
              //   Seed.print(path + ':' + d);
@@ -288,16 +280,14 @@ Object.extend(Introspect, {
     registry : { },
     factory : function(type, ns, name) {
         if (typeof (this.registry[ns +'.' + name]) == 'undefined') {
-            this.registry[ns +'.' + name] = new Introspect[type](ns,name);
+            this.registry[ns +'.' + name] = new imports[type][type](ns,name);
             this.registry[ns +'.' + name].load();
         }
         
         return this.registry[ns +'.' + name];
     }
         
-            
-    
-});
+};