X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=tools%2Fbuild_gtk_tree.js;h=e6b11ff09e2f3dd812c8666f08191c94b65f6bcd;hb=079a24cfb978501128d183bc580ddb787024d9c2;hp=d053dfa92ead6de53bf5a22f8ccf35b94a973c6e;hpb=9d7c8ec6478148f28168397dfacad5373e2c5fe4;p=app.Builder.js diff --git a/tools/build_gtk_tree.js b/tools/build_gtk_tree.js index d053dfa92..e6b11ff09 100644 --- a/tools/build_gtk_tree.js +++ b/tools/build_gtk_tree.js @@ -276,9 +276,41 @@ function BuildLists () { if (method !='Gtk.Container:add') { return true; } - var cls = parent.split('.').pop(); - var x = new Gtk[cls](); + var ar = parent.split('.') + var cls =ar[1]; + var ns =ar[0]; + + /* + if (parent == 'Gtk.Bin' || methods['Gtk.Bin'].extendsClasses.indexOf(parent) > -1) { + return false; + } + if (['GtkSource.CompletionInfo', + 'Gtk.MenuShell', + 'GtkSource.View', // ??? nothing can be added to it? + 'WebKit.WebView', // ??? nothing can be added to it? + 'GtkClutter.Embed' + ].indexOf(parent) > -1) { + return false; + } + */ + + + try { + var x = new imports.gi[ns][cls](); + } catch(e) { + print("TRY ctor: " + parent ); + print(e.toString()); + return false; + } + + //print("TRY child type: " + parent); + print(parent + " : says children are of type : " + x.child_type()); + // get the Gtype for the child? + + print ("matching?" + GObject.type_From_name(ar.join(''))); + + return true; } @@ -342,13 +374,15 @@ right: } for (var par in methods[cls].can_be_added_to_as) { + if (!verifyUsage(par,cls)) { + continue; + } + if (typeof(usage[par]) == 'undefined') { usage[par] = []; } - if (!verifyUsage(par,cls)) { - continue; - } + usage[par].pushUnique(cls); if (typeof(tops[cls]) == 'undefined') { @@ -381,6 +415,10 @@ right: return false; } + + + + print (JSON.stringify(usage,null,4)); var nusage = {}; var usage_left = {}; for(var par in usage) { @@ -429,7 +467,7 @@ right: /* methods is [a class] - [has methods that use this object] + [has methods that use this object] [list of methods of the top class..] @@ -459,6 +497,9 @@ right: //print(JSON.stringify(implementations,null,4)); } +imports.gi.Gtk.init(Seed.argv); + +imports.gi.GtkClutter.init(Seed.argv); BuildLists(); // we now have a list of classes / methods that can be used..