X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=Introspect%2FNameSpace.js;h=1a20fb70aa8595b1b47bb0a6932ce342e25d822d;hp=9a959f019b1060b5e55e0812e003108a9b5a6b12;hb=HEAD;hpb=7d4fe1745ea09e3eee5feebda77afac81693a49f diff --git a/Introspect/NameSpace.js b/Introspect/NameSpace.js index 9a959f0..1a20fb7 100644 --- a/Introspect/NameSpace.js +++ b/Introspect/NameSpace.js @@ -9,7 +9,25 @@ XObject = imports.XObject.XObject; console = imports.console.console; - +// BC/FC +if (!GI.Repository) { + GI.Repository = GI.IRepository; + GI.FunctionInfoFlags = GI.IFunctionInfoFlags ; + GI.InfoType = GI.IInfoType; + GI.TypeTag= GI.ITypeTag; + + GI.IBaseInfo.prototype.get_name = function(n) { + return GI.base_info_get_name(this, n); + } + GI.IBaseInfo.prototype.get_namespace = function(n) { + return GI.base_info_get_namespace(this, n); + } + GI.IBaseInfo.prototype.get_attribute = function( n) { + return GI.base_info_get_attribute(this, n); + } +} + + NameSpace = { @@ -82,7 +100,7 @@ NameSpace = { var info = gi.get_info (ns, i); // print("NAME: " + info.get_name()); //continue; - var info_type = GI.base_info_get_type (info); + var info_type = GI.base_info_get_type ? GI.base_info_get_type(info) : info.get_type(); // print("Type: " + info_type); switch(info_type) { case GI.InfoType.OBJECT: @@ -124,10 +142,10 @@ NameSpace = { continue; } } - print ("SCAN NAMESPACE ALL DONE"); + //print ("SCAN NAMESPACES ALL DONE"); var gi = GI.Repository.get_default(); - var ver = GI.Repository.get_version(gi,ns); + var ver = gi.get_version(ns); var pth = GI.Repository.get_search_path (); var gir_path = pth[0].replace(/lib\/girepository-1.0/, 'share\/gir-1.0'); //console.log(fn); @@ -140,7 +158,7 @@ NameSpace = { }, - + // store all the interfaces, so we can show a list of them later... // called when you list the namespace clsGatherInterfaces : function(ns, cls) @@ -172,7 +190,7 @@ NameSpace = { doc : function(what) { - print ("DOC: + " +what); + //print ("DOC: + " +what); var ns = what.split('.').shift(); return ''; this.commentLoad(ns); @@ -193,7 +211,7 @@ NameSpace = { console.log("LOAD DOCS: " + ns); var gi = GI.Repository.get_default(); - var ver = GI.Repository.get_version(gi,ns); + var ver = gi.get_version(ns); if (!ver) { this.comments[ns] = {}; return;