X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=tools%2Fbuild_gtk_tree.js;h=e6b11ff09e2f3dd812c8666f08191c94b65f6bcd;hb=079a24cfb978501128d183bc580ddb787024d9c2;hp=dce96d7e4c1548f80cf3a9679e42565a44096165;hpb=2a88a98a3c906c84f782d110362bfe40e8ef99c6;p=app.Builder.js diff --git a/tools/build_gtk_tree.js b/tools/build_gtk_tree.js index dce96d7e4..e6b11ff09 100644 --- a/tools/build_gtk_tree.js +++ b/tools/build_gtk_tree.js @@ -276,11 +276,41 @@ function BuildLists () { if (method !='Gtk.Container:add') { return true; } - var cls = parent.split('.').pop(); - print("TRY ctor: " + parent ); - - var x = new imports.gi.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; } @@ -344,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') { @@ -383,6 +415,10 @@ right: return false; } + + + + print (JSON.stringify(usage,null,4)); var nusage = {}; var usage_left = {}; for(var par in usage) { @@ -431,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..] @@ -462,6 +498,8 @@ right: } 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..