d9760d4d291e321b96c4112e874435a2676a070a
[app.Builder.js] / tools / build_gtk_tree.js
1 //<script type="text/javascript">
2
3 // see if we can build the insertion tree for gtk - using introspection
4
5 // it should build the tree of feasible insertions, then we will have to manually prune it..
6
7 // it needs to know
8 // a) what the inherited types are
9 // b) what methods are available for each type, that include a reference to another type..
10
11 // let's start with types.. 
12
13 imports.searchPath.push('../../gnome.introspection-doc-generator');
14
15 XObject     = imports.XObject.XObject;
16 File        = imports.File.File; 
17  
18 // Introspecion specific..
19 NameSpace   = imports.Introspect.NameSpace.NameSpace; 
20 Link        = imports.Introspect.Link.Link; 
21
22 var ns_list = NameSpace.namespaces();
23  
24 ns_list = ns_list.sort();
25 // let's try and load them, so we find out early what will fail.
26 print("loading library to make sure it works.");
27 ns_list.forEach(function(ns_name) {   
28     var  core = imports.gi[ns_name];
29 });
30
31
32 print("Looping throught namespaces");
33 var ns_idx = [];
34 ns_list.forEach(function(ns_name) 
35 {
36     
37     //if (ns_idx.length) {         return ;/* do one - for testing */ } 
38     
39     var  core = imports.gi[ns_name];
40     var idx = { name: ns_name}; 
41     console.log("START:" + ns_name);
42    
43     var ns = NameSpace.ns(ns_name);
44     
45     
46     var actions = {
47         'objects' : 'Class',
48         'interfaces' : 'Interface',
49         //'structs' : 'Struct',
50         //'unions' : 'Union',
51         //'enums' : 'Enum'
52         
53     };
54     
55     for (var i in actions) {
56         // we flag GLib as a GObject lib...
57        
58         ns[i].forEach( function(n) {
59             
60             print('NameSpace.factory(' + actions[i] +','+ns_name+','+n);
61             var odata =   NameSpace.factory(actions[i], ns_name, n);
62             print(odata);
63         }); 
64     }
65     
66     
67 });