tools/build_gtk_tree.js
[app.Builder.js] / tools / build_gtk_tree.js
index a46b8fb..d3bee79 100644 (file)
@@ -48,7 +48,7 @@ function BuildLists () {
     
  
 
-    var ns_list = [ 'Gtk' , 'Gdk', 'Pango', 'GtkSource', 'WebKit', 'Vte'] ; //NameSpace.namespaces();
+    var ns_list = [ 'Gtk' , 'Gdk', 'Pango', 'GtkSource', 'WebKit', 'Vte', 'GtkClutter'] ; //NameSpace.namespaces();
      
     ns_list = ns_list.sort();
     // let's try and load them, so we find out early what will fail.
@@ -332,21 +332,48 @@ right:
         
     }
     var nusage = {};
+       var usage_left = {};
     for(var par in usage) {
         // see if the parent can be added to something.
         if (!canTop(par)) {
             continue;
         }
+               var duped = false;
+               for(var dupe in usage) {
+                       if (par != dupe && usage[par].join(',') == usage[dupe].join(',') && nusage[dupe]) {
+                               duped = true;
+                               
+                               if (typeof(usage_left[dupe]) == 'undefined') {
+                                       usage_left[dupe] = []; 
+                               }
+                               print(par+ ' is a dupe of ' + dupe);
+                               usage_left[dupe].pushUnique(par);
+                               break;
+                       }
+               }
+                if (duped) {
+                       continue;
+                }
         nusage[par] = usage[par];
         
     }
-    
+    usage = nusage;
     print(JSON.stringify(nusage,null,4));
-    
-    print(JSON.stringify(methods['Gtk.Switch'],null,4));
+    Seed.exit();
+    //print(JSON.stringify(methods['Gtk.Switch'],null,4));
 
-    
-    
+    var str = [];
+       for(var par in usage) {
+               str.push('left');
+               str.push('   ' + par);
+               if (typeof(usage_left[par]) != 'undefined') {
+                       usage_left[par].forEach(function(d) { str.push('    ' + d);});
+               }
+               str.push('right');
+               usage[par].forEach(function(d) { str.push('    ' + d);});
+               str.push('');
+       }
+       print(str.join("\n"));
     //print(JSON.stringify(implementations ,null,4));
     /*
       methods is