ns_list = ns_list.sort();
// let's try and load them, so we find out early what will fail.
print("loading library to make sure it works.");
+
+var classes = {};
+
ns_list.forEach(function(ns_name) {
var core = imports.gi[ns_name];
+ var ns = NameSpace.ns(ns_name); // fetch all the elements in namespace...
+ ns['objects'].forEach( function(n) {
+ var odata = NameSpace.factory('Class', ns_name, n);
+ classes[odata.alias] = odata;
+
+ });
+ ns['interfaces'].forEach( function(n) {
+ var odata =NameSpace.factory('Interface', ns_name, n);
+ classes[odata.alias] = odata;
+ });
});
print("Looping throught namespaces");
var ns_idx = [];
-ns_list.forEach(function(ns_name)
-{
-
- //if (ns_idx.length) { return ;/* do one - for testing */ }
-
- var core = imports.gi[ns_name];
- var idx = { name: ns_name};
- print("START:" + ns_name);
+var implementations = {};
+var methods = {}
- var ns = NameSpace.ns(ns_name); // fetch all the elements in namespace...
- // as a type => array list..
-
-
-
- var actions = {
- 'objects' : 'Class',
- 'interfaces' : 'Interface',
- //'structs' : 'Struct',
- //'unions' : 'Union',
- //'enums' : 'Enum'
-
- };
-
- for (var i in actions) {
- // we flag GLib as a GObject lib...
+for (cls in classes) {
+ var odata = classes[cls];
+ methods[cls] = {}
+
+ implementations[odata.alias] = odata.titleType == 'Class' ? odata.childClasses : odata.implementedBy;
+ //print(JSON.stringify(odata.methods,null,4));
+ odata.methods.forEach(function(m) {
- ns[i].forEach( function(n) {
+ m.params.forEach(function(p) {
+
+ if (!p.type || typeof(classes[p.type]) == 'undefined') {
+ return;
+ }
+ if (typeof(methods[cls][p.type]) == 'undefined') {
+ methods[cls][p.type] = [];
+ }
+ methods[cls][p.type].push(m.name);
- print('NameSpace.factory(' + actions[i] +','+ns_name+','+n);
- var odata = NameSpace.factory(actions[i], ns_name, n);
- print(JSON.stringify(odata,null,4));
- });
- }
+ });
+
+ });
+ //for(method in odata.methods) {
+ // print(method.name);
+ //}
-});
+}
+ print(JSON.stringify(methods,null,4));
+print(JSON.stringify(implementations,null,4));
\ No newline at end of file