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 imports['Object.js'].load(Object);
10 console = imports['console.js'].console;
11 JSDOC = imports['JSDOC.js'].JSDOC;
12 Introspect = imports['JSDOC/Introspect.js'].Introspect;
13 Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
19 * Base types methods/interfaces/structs/unions etc.
27 // fake should not happen?
30 if (typeof(name) == 'undefined') {
31 var ar = ns.split('.');
37 this.alias = ns + '.' + name;
38 //console.log("CREATE(Base) " + this.alias);
42 // reset all of these..
45 this.constructors = [];
48 this.values = []; // for enum;g;
52 this.implementInterfaces = []; // obect - which interface it implements.
53 this.implementedBy = []; // interface - which object uses it.
54 this.extendsClasses = []; // what it extends...
55 this.childClasses = []; // what
56 this.desc = Introspect.doc(this.alias );
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 this.extendsClasses[0][saveto].map(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 this.implementInterfaces.map(function(iface) {
148 iface[saveto].map( function(prop) {
149 if (keylist.indexOf(prop.name) < 0) {
150 _this[saveto].push(prop);
151 keylist.push(prop.name);