X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=blobdiff_plain;f=tools%2Fbuild_gtk_tree.js;h=8d9adc822b3a6d0c532e88bfed0344c34ad69290;hp=9218f312ad4e77cd287bfbbad12095dc8d07302d;hb=372d185cfbe9ac31e2812ffe67f2dda59b976d3b;hpb=53fe01f9c380e3ec557b464d663bb98c302b5793 diff --git a/tools/build_gtk_tree.js b/tools/build_gtk_tree.js index 9218f312a..8d9adc822 100644 --- a/tools/build_gtk_tree.js +++ b/tools/build_gtk_tree.js @@ -267,24 +267,55 @@ function BuildLists () { this.methods = methods; this.allmethods = methods; this.implementations = implementations; - print(JSON.stringify(methods,null,4)); Seed.exit(); + //print(JSON.stringify(methods,null,4)); Seed.exit(); // dump out a usage file.. + function verifyUsageMethod(parent,child,method) + { + // currently only verifies add on container. + if (method !='Gtk.Container:add') { + return true; + } + + var cls = parent.split('.').pop(); + + + 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? + 'GtkClutter.Embed' + ].indexOf(parent) > -1) { + return false; + } + + print("TRY ctor: " + parent ); + + var x = new imports.gi.Gtk[cls](); + print("TRY child type: " + parent); + + print(parent + " : says children are of type : " + x.child_type()); + return true; + + } - - + function is_a(cls, instance_of) { + return methods[cls].extendsClasses.indexOf(instance_of) > -1; + } function verifyUsage(parent,child) { // find all the methods that child can be added to parent. - var methods = methods[parent].can_contain_using; - for(var i =0;i