X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=JSDOC%2FIntrospect.js;h=7777c94af3f146462560529c21abfae4eedb1338;hb=bf1653b60d77386954fa54c8c285031ee27f3a27;hp=28b033297b8aa17bf030388e85f5c26801c3210f;hpb=d29d581b911370e5350ca88a2eecaab1ae3d7073;p=gnome.introspection-doc-generator diff --git a/JSDOC/Introspect.js b/JSDOC/Introspect.js index 28b0332..7777c94 100644 --- a/JSDOC/Introspect.js +++ b/JSDOC/Introspect.js @@ -4,11 +4,12 @@ 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; + + xnew = imports['xnew.js'].xnew; @@ -20,7 +21,7 @@ xnew.load(Introspect,'JSDOC/Introspect'); -Roo.apply( Introspect, { +Object.extend(Introspect, { references : { }, @@ -41,10 +42,10 @@ Roo.apply( 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$/)) { @@ -141,6 +142,16 @@ Roo.apply( 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; @@ -225,6 +236,10 @@ Roo.apply( Introspect, { var n = getAttribute(element, 'name') ; //console.log("WALK" + n); + if (element.name == 'signal') { + path += '.signal'; + } + if (n) { path += path.length ? '.' : ''; path += n; @@ -233,7 +248,6 @@ Roo.apply( Introspect, { path += '.return-value'; } - var d = getAttribute(element,'doc'); if (d) { // Seed.print(path + ':' + d); @@ -268,7 +282,7 @@ Roo.apply( Introspect, { return; } var doc = xml.parseFile(fn); - console.log("xmldoc?" + doc); + //console.log("xmldoc?" + doc); walk (doc.root, ''); //console.dump(ret); this.comments[ns] = ret;