1 //<script type="text/javascript">
2 //Gtk = imports.gi.Gtk;
3 GI = imports.gi.GIRepository;
4 GLib = imports.gi.GLib;
6 //GObject = imports.gi.GObject;
8 console = imports['console.js'].console;
9 JSDOC = imports['JSDOC.js'].JSDOC;
10 Roo = imports['Roo.js'].Roo;
13 Introspect = imports['JSDOC/Introspect.js'].Introspect;
14 Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
20 * Base types methods/interfaces/structs/unions etc.
27 Base = function(ns, name) {
28 // fake should not happen?
31 if (typeof(name) == 'undefined') {
32 var ar = ns.split('.');
38 this.alias = ns + '.' + name;
39 //console.log("CREATE(Base) " + this.alias);
43 // reset all of these..
46 this.constructors = [];
49 this.values = []; // for enum;g;
53 this.implementInterfaces = []; // obect - which interface it implements.
54 this.implementedBy = []; // interface - which object uses it.
55 this.extendsClasses = []; // what it extends...
56 this.childClasses = []; // what
57 this.desc = Introspect.doc(this.alias );
61 Roo.extend(Base, Basic, {
71 values : [], // for enum
75 implementInterfaces : [], // obect - which interface it implements.
76 implementedBy : [], // interface - which object uses it.
77 extendsClasses : [], // what it extends...
78 childClasses : [], // what
85 var gi = GI.IRepository.get_default();
86 return gi.find_by_name(this.ns, this.name);
88 // on, getwhat, simple list (name), variable to add to.
89 genericBuildList : function( onwhat, type, keylist, saveto)
92 //console.log(this.alias +" - ADDING :" + type);
93 //if (this[saveto].length) {
94 // Seed.print( "EROROR = it's alreayd loaded why?");
97 var bb = this.getBI();
99 //console.log("ADD " + type[0].toUpperCase() + type.substring(1));
100 var cls = Introspect[type[0].toUpperCase() + type.substring(1)]; // ucfirst.
102 console.log("COULD NOT FIND Introspect: " + type[0].toUpperCase() + type.substring(1));
105 var plural = type + 's';
106 plural = plural == 'propertys' ? 'properties' : plural;
109 for(var i =0; i < GI[onwhat + '_info_get_n_' + plural ](bb); i++) {
110 var add= new cls(GI[onwhat + '_info_get_' + type ](bb,i), this, saveto, keylist);
111 //console.log("CLS :" + this.alias + " EL: " + add.name);
116 // loop through and add stuff from extends..
117 genericExtends : function( keylist, saveto)
119 // do not overlay gobject props or methods etc.
121 if (!this.extendsClasses.length) {
124 if (this.extendsClasses[0].alias == 'GObject.Object') {
131 this.extendsClasses[0].load();
132 Roo.each(this.extendsClasses[0][saveto], function(prop) {
133 if (keylist.indexOf(prop.name) < 0) {
134 _this[saveto].push(prop);
135 keylist.push(prop.name);
140 // loop through and add stuff from implements..
141 genericImplements : function( keylist, saveto) {
144 Roo.each(this.implementInterfaces, function(iface) {
148 Roo.each(iface[saveto], function(prop) {
149 if (keylist.indexOf(prop.name) < 0) {
150 _this[saveto].push(prop);
151 keylist.push(prop.name);