--- /dev/null
+/**
+ * Compat array utils..
+ *
+ * <script type="text/javascript">
+ *
+ */
+Array.prototype.filter = function(fun /*, thisp*/)
+ {
+ var len = this.length;
+ if (typeof(fun) != "function")
+ throw "typeerror";
+
+ var res = new Array();
+ var thisp = arguments[1];
+ var t = this;
+ for (var i = 0; i < len; i++)
+ {
+
+ var val = t[i]; // in case fun mutates this
+ if (fun.call(thisp, val, i, t))
+ res.push(val);
+ //}
+ }
+
+ return res;
+ };
+
+Array.prototype.map = function(fun /*, thisp*/)
+ {
+ var len = this.length;
+ if (typeof(fun) != "function")
+ throw "typeerror";
+
+ var res = new Array(len);
+ var thisp = arguments[1];
+ for (var i = 0; i < len; i++)
+ {
+
+ res[i] = fun.call(thisp, this[i], i, this);
+ }
+
+ return res;
+ };
+
+if (typeof(Array.prototype['lastIndexOf']) == 'undefined')
+{
+ Array.prototype.lastIndexOf = function(elt /*, from*/)
+ {
+ var len = this.length;
+
+ var from = Number(arguments[1]);
+ if (isNaN(from)) {
+ from = len - 1;
+ } else {
+ from = (from < 0)
+ ? Math.ceil(from)
+ : Math.floor(from);
+ if (from < 0)
+ from += len;
+ else if (from >= len)
+ from = len - 1;
+ }
+ var _t = this;
+ for (; from > -1; from--)
+ {
+ if ((typeof(_t[from]) !== 'undefined') &&
+ this[from] === elt)
+ return from;
+ }
+ return -1;
+ };
+}
\ No newline at end of file
--- /dev/null
+// <script type="text/javascript">
+GLib = imports.gi.GLib;
+
+xnew = imports['xnew.js'].xnew;
+
+var JSDOC = {};
+
+xnew.load(JSDOC, 'JSDOC');
--- /dev/null
+//<script type="text/javscript">
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+console = imports['console.js'].console;
+
+// make sure parent is loaded..
+TokenStream = imports['JSDOC/TokenStream.js'].TokenStream;
+/**
+ *
+ * base class for parsing segments of token array..
+ *
+ *
+ * We want to make parsing the whole thing easy..
+ *
+ * so we do various tricks:
+ *
+ *
+ * a) white space collased
+ * wsPrefix
+ * b) toks
+ * { } - collapse into first element.
+ ( ) - collapse into first element.
+ [ ] - collapse into first element.
+ * c) items = , seperation within the above..
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+Collapse = function (ar)
+{
+
+ Collapse.superclass.constructor.call(this, ar);
+
+ this.spaces();
+ var ar = this.collapse(this.tokens);
+
+ this.tokens = ar;
+
+ // console.dump(ar);
+
+}
+
+Roo.extend(Collapse, TokenStream, {
+
+ spaces : function () {
+ var ar = [];
+ var pref = [];
+
+ var tok;
+
+ for (var i = 0; i < this.tokens.length; i ++) {
+ tok = this.tokens[i];
+ if (tok.is("COMM") || tok.is("WHIT")) {
+ pref.push(tok);
+ continue;
+ }
+ tok.prefix = '';
+ if (pref.length) {
+ Roo.each(pref, function(e) {
+ if (!e) {
+ return;
+ }
+ tok.prefix += e.data;
+ })
+ }
+
+ ar.push(tok);
+ pref= [];
+
+ }
+ this.tokens = ar;
+
+ },
+ collapse : function(ar) {
+
+ var st = new TokenStream(ar);
+ var ret = [];
+
+ while (true) {
+ var tok = st.look(1,true);
+ if (!tok || !tok.is) {
+ // Seed.print(TokenStream.toString(ret));
+ return ret;
+ }
+ // console.log(tok.data);
+ switch(tok.type) {
+
+
+ case "KEYW":
+ case "TOKN":
+ case "NAME":
+ case "STRN":
+ case "NUMB":
+ case "REGX":
+ ret.push(st.next(1));
+ continue;
+
+ case "PUNC":
+ switch (tok.data) {
+ case "[":
+ case "{":
+ case "(":
+
+ var start = st.cursor;
+ st.next(1);
+ var add = st.balance(tok.name);
+ if (!add) {
+ console.dump(tok);
+ console.dump(start + '...' + st.cursor);
+ console.dump(st.tokens);
+
+ }
+ if (add) {
+ add.shift();
+ }
+ //Seed.print(TokenStream.toString(aa));
+
+
+ var toks = add ? this.collapse(add) : [];
+ tok.items = false;
+ tok.props = false;
+
+ if (tok.data != '{') {
+ // paramters or array elements..
+ tok.items = this.toItems(toks, [',']);
+ } else {
+ // check for types.. it could be a list of statements.. or object
+
+ var ost = new TokenStream(toks);
+ //console.dump(ost.look(2,true) );
+ if (ost.look(2,true) && ost.look(2,true).data == ":") {
+ tok.props = this.toProps(toks);
+ } else {
+ // list of statemetns..
+ tok.items = this.toItems(toks,[ ';', '{'] );;
+ }
+
+
+ }
+
+
+
+
+
+
+
+ //Seed.print(" ADD : " + add.length + " ITEMS: " + tok.items.length);
+
+ ret.push(tok);
+
+ continue;
+
+ default:
+ ret.push(st.next(1));
+ continue;
+ }
+ Seed.print("OOPS");
+ continue;
+ default :
+ Seed.print("OOPS");
+ continue;
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+ },
+ toItems : function(ar,sep)
+ {
+ var ret = [];
+ var g = [];
+
+ for (var i = 0; i < ar.length; i ++) {
+ if (sep.indexOf(ar[i].data) < 0) {
+ g.push(ar[i]);
+ continue;
+ }
+ g.push(ar[i]);
+ ret.push(g);
+ g = [];
+
+ }
+ // last..
+ if (g.length) {
+ ret.push(g);
+ }
+ return ret;
+
+ },
+ toProps : function(ar)
+ {
+
+ var ret = { }
+
+ var g = { key : '', val: [] }
+
+
+ var k = '';
+ var state = 0;
+ for (var i = 0; i < ar.length; i ++) {
+
+ switch(state) {
+ case 0:
+ k = ar[i].data;
+ g.key = ar[i];
+ state = 1;
+ continue;
+ case 1:
+ state =2; // should be ':'
+ continue;
+ case 2:
+ g.val.push(ar[i]);
+ if (ar[i].data != ',') {
+ continue;
+ }
+ ret[k] = g;
+ g = { key : '', val: [] }
+ state = 0;
+ continue;
+
+ }
+ }
+ // last..
+ if (k.length) {
+ ret[k] = g;
+ }
+ return ret;
+
+
+ }
+
+
+
+});
\ No newline at end of file
--- /dev/null
+//<script type="text/javscript">
+
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+console = imports['console.js'].console;
+
+// make sure parent is loaded..
+RooFile = imports['JSDOC/RooFile.js'].RooFile;
+
+/**
+ *
+ * this takes our collased file, and turns it into the config array..
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+
+GtkFile = function (ar)
+{
+ GtkFile.superclass.constructor.call(this, ar);
+ // console.log("STARTING OUTPUT");
+
+
+
+}
+
+Roo.extend(GtkFile, RooFile, {
+
+ cfg : { },
+ giImports : [],
+ imports : { },
+ parse: function()
+ {
+ // parse imports...
+
+ this.parseImports();
+ // function create() { return;
+
+ var pos = this.lookFor( 'function');
+
+
+ // standard create format.
+
+ if (pos > -1 && this.tokens[pos+1].data == 'create') {
+ var tree = this.tokens[pos+3].items[0][1].props;
+ this.cfg= this.parseProps(tree);
+ return;
+ }
+ GtkFile.superclass.parse.call(this);
+
+
+
+
+
+
+
+
+
+ },
+
+ parseImports : function()
+ {
+ // console.dump(this.tokens);
+ this.giImports = [];
+ while (true) {
+ var pos = this.lookFor('=');
+ if (pos < 0) {
+ break;
+ }
+ this.cursor = pos;
+ var k = this.look(-1, true);
+ var v = this.look(1, true);
+ // Seed.print(k.data + " => " + v.data);
+
+ /// finish!!! - not an import ...
+
+ if (!v.data.match(/^imports/)) {
+ return; ///
+
+ this.cursor++;
+ continue;
+ }
+ if (v.data.match(/^imports\.gi/)) {
+ // gi import..
+ this.giImports.push(v.data.replace(/imports\.gi\./, ''));
+
+ this.cursor++;
+ continue;
+ }
+
+ // two types of import left
+ // imports.xnew
+ if (v.data.match(/^imports\./)) {
+ this.imports[k.data] = v.data.replace(/imports\./, '') + '.js';
+ this.cursor++;
+ continue;
+ }
+ // imports[.....]
+ this.cursor++;
+ if (this.lookFor('[') > this.lookFor('=')) {
+ continue;
+ }
+ var bpos = this.lookFor('[');
+ // console.dump(this.tokens[bpos]);
+
+ this.imports[k.data] = this.tokens[bpos].items[0][0].toJS();
+
+ this.cursor++;
+
+ }
+ // console.dump(this.giImports);
+ // console.dump(this.imports);
+ //Seed.quit();
+
+ }
+
+});
+
\ No newline at end of file
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+xnew = imports['xnew.js'].xnew;
+
+
+
+
+Introspect = {};
+
+xnew.load(Introspect,'JSDOC/Introspect');
+
+
+
+Roo.apply( Introspect, {
+
+
+ references : { },
+
+ namespaces : function(ns)
+ {
+ // this should be a class of it's own...
+ this.references[ns] = []; // technically not needed - but fills in files..
+ // get this from GI... (it's the path..)
+ var ret = [];
+
+ function scanGir(dir)
+ {
+ if (!GLib.file_test(dir, GLib.FileTest.EXISTS)) {
+ return;
+ }
+ var gdir = GLib.dir_open(dir,0);
+
+ while (true) {
+
+ var fn = GLib.dir_read_name(gdir);
+ // console.log('trying ' + fn);
+ if (!fn) {
+ GLib.dir_close(gdir);
+ return;;
+ }
+ if (!fn.match(/.typelib$/)) {
+ continue;
+ }
+ var par = fn.split('-').shift();
+ //console.log('trying ' + par);
+ if (ret.indexOf(par) > -1) {
+ continue;
+ }
+ ret.push(par);
+
+
+ }
+ }
+ var gi = GI.IRepository.get_default();
+ var pth = GI.IRepository.get_search_path ();
+
+ scanGir(pth[0]);
+ ret.sort();
+ console.dump(ret);
+ return ret;
+
+ },
+
+
+ ns: function(ns) {
+ var gi = GI.IRepository.get_default();
+ ret = {
+ titleType: 'Namespace',
+ ns: ns,
+ name : ns,
+ alias : ns,
+ objects : [],
+ functions : [],
+ enums : [],
+ structs: [],
+ constants : [],
+ unions : [],
+
+ // so ns looks like class..
+
+ extendsClasses : [], // what it extends...
+ childClasses : [], // what uses it..
+ properties : [],
+ constructors : [],
+ methods : [],
+ values : [], /// really constants.
+ signals : [],
+ interfaces: [],
+ };
+
+ for (var i=0; i < gi.get_n_infos (ns); i++ ) {
+ var info = gi.get_info (ns, i);
+
+ var info_type = GI.base_info_get_type (info);
+ switch(info_type) {
+ case GI.IInfoType.OBJECT:
+ ret.objects.push(GI.base_info_get_name(info));
+ this.clsGatherInterfaces(ns , GI.base_info_get_name(info));
+ continue;
+ case GI.IInfoType.INTERFACE:
+ ret.interfaces.push(GI.base_info_get_name(info));
+ continue;
+ case GI.IInfoType.FUNCTION:
+ new Introspect.Method(info, ret, 'functions', []);
+ continue;
+
+ case GI.IInfoType.CALLBACK:
+ // new Introspect.Callback(info, ret, 'callbacks', []);
+ continue;
+
+ case GI.IInfoType.ENUM:
+ case GI.IInfoType.FLAGS:
+ ret.enums.push(GI.base_info_get_name(info));
+ continue;
+ case GI.IInfoType.STRUCT:
+ if (GI.struct_info_is_gtype_struct (info)) {
+ continue;
+ }
+
+ ret.structs.push(GI.base_info_get_name(info));
+ continue;
+ case GI.IInfoType.UNION:
+ ret.unions.push(GI.base_info_get_name(info));
+ continue;
+ case GI.IInfoType.CONSTANT:
+ new Introspect.Constant(info, ret, 'values', []);
+
+ continue;
+
+
+ default:
+ continue;
+ }
+ }
+ //console.dump(this.ifaceList);
+ return ret;
+
+ },
+
+
+
+ // store all the interfaces, so we can show a list of them later...
+ // called when you list the namespace
+ clsGatherInterfaces : function(ns, cls)
+ {
+ var gi = GI.IRepository.get_default();
+ var bb = gi.find_by_name(ns, cls);
+ var fullname = ns+'.'+cls;
+ this.ifaceList = this.ifaceList || { };
+
+
+ for(var i =0; i < GI.object_info_get_n_interfaces(bb); i++) {
+
+ var prop = GI.object_info_get_interface(bb,i);
+
+ var add = GI.base_info_get_namespace(prop) +'.' + GI.base_info_get_name(prop);
+ this.ifaceList[add] = this.ifaceList[add] || [];
+ if (this.ifaceList[add].indexOf(fullname) < 0) {
+ this.ifaceList[add].push(fullname);
+ }
+
+ }
+
+
+
+ },
+
+
+
+
+ doc : function(what) {
+ var ns = what.split('.').shift();
+ this.commentLoad(ns);
+ return typeof(this.comments[ns][what]) == 'undefined' ? '' : this.comments[ns][what];
+
+ },
+
+
+
+ comments : {},
+
+ commentLoad : function(ns)
+ {
+
+ if (typeof(this.comments[ns]) != 'undefined') {
+ return;
+ }
+
+ console.log("LOAD DOCS: " + ns);
+ var gi = GI.IRepository.get_default();
+ var ver = gi.get_version(ns);
+ if (!ver) {
+ this.comments[ns] = {};
+ return;
+ }
+ var ret = { };
+
+ // no idea why this is broken on my build system.
+ var getAttribute = function(n, name){
+ var properties = n.properties;
+ while (properties){
+ if (properties.name == name)
+ return properties.children.content;
+ properties = properties.next
+ }
+ return null;
+ }
+
+
+ function walk (element, path) {
+
+
+ if (!element) {
+ return;
+ }
+
+ var n = getAttribute(element, 'name') ;
+ //console.log("WALK" + n);
+ if (n) {
+ path += path.length ? '.' : '';
+ path += n;
+ }
+ if (element.name == 'return-value') {
+ path += '.return-value';
+ }
+
+
+ var d = getAttribute(element,'doc');
+ if (d) {
+ // Seed.print(path + ':' + d);
+ ret[path] = d;
+ }
+
+ var child = element.children;
+
+ while (child){
+ //console.log(child.tag);
+ if (child.type == "element"){
+ walk (child, path);
+ }
+ child = child.next;
+ }
+ }
+
+ var pth = GI.IRepository.get_search_path ();
+
+
+ var gir_path = pth[0].replace(/lib\/girepository-1.0/, 'share\/gir-1.0');
+
+
+ //console.log(fn);
+ var fn = gir_path + '/'+ ns + '-' + ver + '.gir';
+ // console.log(fn);
+
+ if (!GLib.file_test(fn, GLib.FileTest.EXISTS)) {
+ console.log('missing docc file ' + fn);
+ this.comments[ns] = {};
+
+ return;
+ }
+ var doc = xml.parseFile(fn);
+ console.log("xmldoc?" + doc);
+ walk (doc.root, '');
+ //console.dump(ret);
+ this.comments[ns] = ret;
+
+ },
+ registry : { },
+ factory : function(type, ns, name) {
+ if (typeof (this.registry[ns +'.' + name]) == 'undefined') {
+ this.registry[ns +'.' + name] = new Introspect[type](ns,name);
+ this.registry[ns +'.' + name].load();
+ }
+
+ return this.registry[ns +'.' + name];
+ }
+
+
+
+});
+
+
+
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
+
+
+
+
+/**
+ * Base types methods/interfaces/structs/unions etc.
+ */
+
+
+
+
+
+Base = function(ns, name) {
+ // fake should not happen?
+
+
+ if (typeof(name) == 'undefined') {
+ var ar = ns.split('.');
+ ns = ar[0];
+ name = ar[1];
+ }
+ this.ns = ns;
+ this.name = name;
+ this.alias = ns + '.' + name;
+ //console.log("CREATE(Base) " + this.alias);
+ this._loaded = false;
+
+
+ // reset all of these..
+ this.signals = [];
+ this.methods = [];
+ this.constructors = [];
+ this.functions= [];
+
+ this.values = []; // for enum;g;
+ this.constants = [];
+
+ this.properties = [];
+ this.implementInterfaces = []; // obect - which interface it implements.
+ this.implementedBy = []; // interface - which object uses it.
+ this.extendsClasses = []; // what it extends...
+ this.childClasses = []; // what
+ this.desc = Introspect.doc(this.alias );
+
+
+}
+Roo.extend(Base, Basic, {
+ titleType: 'Unknown',
+ name : '',
+ ns : '',
+
+ signals : [],
+ methods : [],
+ constructors : [],
+ functions: [],
+
+ values : [], // for enum
+ constants : [],
+
+ properties : [],
+ implementInterfaces : [], // obect - which interface it implements.
+ implementedBy : [], // interface - which object uses it.
+ extendsClasses : [], // what it extends...
+ childClasses : [], // what
+
+
+
+
+ getBI : function() {
+
+ var gi = GI.IRepository.get_default();
+ return gi.find_by_name(this.ns, this.name);
+ },
+ // on, getwhat, simple list (name), variable to add to.
+ genericBuildList : function( onwhat, type, keylist, saveto)
+ {
+
+ //console.log(this.alias +" - ADDING :" + type);
+ //if (this[saveto].length) {
+ // Seed.print( "EROROR = it's alreayd loaded why?");
+ //throw "oops";
+ // }
+ var bb = this.getBI();
+ var _this = this;
+ //console.log("ADD " + type[0].toUpperCase() + type.substring(1));
+ var cls = Introspect[type[0].toUpperCase() + type.substring(1)]; // ucfirst.
+ if (!cls) {
+ console.log("COULD NOT FIND Introspect: " + type[0].toUpperCase() + type.substring(1));
+ }
+
+ var plural = type + 's';
+ plural = plural == 'propertys' ? 'properties' : plural;
+
+
+ for(var i =0; i < GI[onwhat + '_info_get_n_' + plural ](bb); i++) {
+ var add= new cls(GI[onwhat + '_info_get_' + type ](bb,i), this, saveto, keylist);
+ //console.log("CLS :" + this.alias + " EL: " + add.name);
+ }
+
+
+ },
+ // loop through and add stuff from extends..
+ genericExtends : function( keylist, saveto)
+ {
+ // do not overlay gobject props or methods etc.
+
+ if (!this.extendsClasses.length) {
+ return;
+ }
+ if (this.extendsClasses[0].alias == 'GObject.Object') {
+ return;
+ }
+
+
+ var _this = this;
+
+ this.extendsClasses[0].load();
+ Roo.each(this.extendsClasses[0][saveto], function(prop) {
+ if (keylist.indexOf(prop.name) < 0) {
+ _this[saveto].push(prop);
+ keylist.push(prop.name);
+ }
+ },this);
+
+ },
+ // loop through and add stuff from implements..
+ genericImplements : function( keylist, saveto) {
+
+ var _this = this;
+ Roo.each(this.implementInterfaces, function(iface) {
+
+ iface.load();
+
+ Roo.each(iface[saveto], function(prop) {
+ if (keylist.indexOf(prop.name) < 0) {
+ _this[saveto].push(prop);
+ keylist.push(prop.name);
+ }
+ },this);
+
+ }, this);
+
+ },
+
+
+
+});
+
+
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+
+
+
+/**
+ * Base class for Properties, functions, methods etc.
+ */
+
+
+Basic = function( ) {
+ // never called?
+}
+Roo.apply(Basic.prototype, {
+
+ typeToName : function (type_info) {
+ var ty = GI.type_tag_to_string( GI.type_info_get_tag(type_info));
+
+ if ((ty == 'void') && GI.type_info_is_pointer(type_info)) {
+ return 'void*'; // it's a fake string?!?!!? - slightly naughty...
+ }
+ if (ty == 'array') {
+ // array of what!?!?
+ var param_type = GI.type_info_get_param_type (type_info, 0);
+ var atype = GI.type_info_get_tag(param_type);
+ if (atype == GI.ITypeTag.UINT8) {
+ return 'utf8';
+ }
+
+
+ return ty;
+ }
+ if (ty != 'interface') {
+ return ty;
+ }
+ var interface_info = GI.type_info_get_interface (type_info);
+ var interface_type = GI.base_info_get_type (interface_info);
+ if (interface_type == GI.IInfoType.CALLBACK) {
+ // callback..
+ var Callback = Introspect.Callback ;
+ var ret= new Callback(interface_info, this, false, false);
+ ret.alias = GI.base_info_get_namespace(interface_info) + '.' + GI.base_info_get_name(interface_info);
+ return ret;
+
+
+ }
+
+ return GI.base_info_get_namespace(interface_info) + '.' + GI.base_info_get_name(interface_info);
+
+ },
+
+ directions : [ "in", "out"," inout"],
+
+ argsToArrays : function(m, returnArray)
+ {
+
+ var outIntoReturn = false;
+ if (returnArray && returnArray.length == 1 && returnArray[0].type == 'void') {
+ outIntoReturn = true;
+ }
+
+ var outArg = {
+ name : 'out_values',
+ ns : '',
+ type : 'Object',
+ direction : 'out',
+ be_null : true, // in theory..
+ desc : "Return Object, use an empty Object, and the properties will get set as follows",
+ properties : []
+ };
+
+ var args = [];
+ var firstOut = -1;
+ for(var a_i =0; a_i < GI.callable_info_get_n_args(m); a_i++) {
+ var arg = GI.callable_info_get_arg(m, a_i);
+
+ var direction = this.directions[GI.arg_info_get_direction(arg)];
+
+ var add = {
+ name : GI.base_info_get_name(arg),
+ ns : GI.base_info_get_namespace(arg),
+ type : this.typeToName(GI.arg_info_get_type(arg)),
+ direction : direction,
+ be_null : GI.arg_info_may_be_null(arg) || GI.arg_info_is_optional(arg),
+ desc : GI.base_info_get_attribute(arg, 'doc') || ''
+ };
+
+
+ add.alias = add.ns + '.' + add.name;
+
+ if (direction == 'out') {
+ firstOut = firstOut > -1 ? firstOut : a_i;
+ if (outIntoReturn) {
+ returnArray.push(add);
+ } else {
+ outArg.properties.push(add);
+ }
+ }
+
+
+ args.push(add);
+ }
+
+ // drop all the 'out args from the end of args..
+ if (returnArray) {
+
+ while (true) {
+ if (!args.length) {
+ break;
+ }
+ var l = args.pop(); // drop!
+ if (l.direction == 'out') {
+ // got an out arg..
+ continue;
+ }
+ args.push(l); // put it back in (it's not a out).
+ break;
+
+ }
+ }
+ if (outArg.properties.length) {
+ // put the out arg in there...
+ if (firstOut >= args.length) {
+ args.push(outArg);
+ } else {
+ args[firstOut] = outArg;
+ }
+ }
+
+
+ // remove void return....
+
+ if (returnArray && returnArray.length > 1 && returnArray[0].type == 'void') {
+ returnArray.shift();
+ }
+
+ return args;
+ }
+});
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
+
+
+
+Callback = function(sig, memberOf, saveto, keylist) {
+
+
+ var params = this.argsToArrays(sig);
+ // add a reference to self...
+ /*params.unshift({
+ name : 'self',
+ type : memberOf.alias,
+ direction : 'in',
+ be_null : false
+
+ });
+ */
+
+ Roo.apply(this,{
+ name : GI.base_info_get_name(sig),
+ params : params,
+ //memberOf : memberOf.alias,
+ exceptions : [],
+ returns : [ { type : this.typeToName(GI.callable_info_get_return_type(sig)) } ]
+
+ });
+ this.desc = Introspect.doc(memberOf.alias + '.' + this.name);
+ //memberOf[saveto].push(this);
+ //keylist.push(this.name);
+
+}
+Roo.extend(Callback,Basic);
+
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Base = imports['JSDOC/Introspect/Base.js'].Base;
+
+
+
+
+/**
+ * Class
+ */
+
+
+
+
+Class = function(ns, name) {
+ Base.call(this, ns, name);
+ this.loadExtends();
+ this.loadImplements();
+ //console.log("CREATED(Class) " + this.alias);
+}
+
+
+Roo.extend(Class, Base, {
+ titleType : 'Class',
+
+ loadExtends : function()
+ {
+ var bi = this.getBI();
+
+ var pi = GI.object_info_get_parent(bi);
+ this.extendsClasses = [];
+ if (!pi) {
+ return;
+ }
+ this.parent = Introspect.factory(
+ 'Class',
+ GI.base_info_get_namespace(pi),
+ GI.base_info_get_name(pi)
+ );
+
+ this.extendsClasses = [ this.parent ];
+
+
+ Roo.each(this.parent.extendsClasses, function(p) {
+ this.extendsClasses.push(p);
+ },this);
+
+
+
+ },
+ loadImplements : function()
+ {
+ var bb = this.getBI();
+ this.implementInterfaces = [];
+
+ var iflist = [];
+ for(var i =0; i < GI.object_info_get_n_interfaces(bb); i++) {
+
+ var prop = GI.object_info_get_interface(bb,i);
+
+
+ var iface = Introspect.factory(
+ 'Interface',
+ GI.base_info_get_namespace(prop) , GI.base_info_get_name(prop)
+ );
+
+
+ if (iflist.indexOf(iface.alias) < 0) {
+ //console.log("ADDING IFACE " + iface.alias);
+ iflist.push(iface.alias);
+ this.implementInterfaces.push(iface);
+ }
+ }
+ // ask the first of the parents.. - which will have it loaded already
+ if (this.extendsClasses.length) {
+
+ //this.extendsClasses[0].loadImplements();
+
+ Roo.each(this.extendsClasses[0].implementInterfaces, function(si) {
+
+ if (iflist.indexOf(si.alias) < 0) {
+ //console.log("From extends ("+ si.alias + ") IFACE " + si.alias);
+ iflist.push(si.alias);
+ this.implementInterfaces.push(si);
+ }
+ },this);
+
+ }
+ //console.dump(iflist);
+ if (this.alias == 'Atk.NoOpObject') {
+ // throw "exut";
+ }
+ // console.dump(this.implementInterfaces);
+ },
+
+
+
+
+ load : function()
+ {
+ if (this._loaded) {
+ return; // already loaded..
+ }
+
+ if (this.parent) { // load up parents first
+ this.parent.load();
+ }
+ Roo.each(this.implementInterfaces, function(iface) {
+ iface.load();
+ });
+
+
+ //console.log("load(Class) " + this.alias);
+ // my props..
+ var props = [];
+ this.genericBuildList('object', 'property', props, 'properties');
+ this.genericBuildList('object', 'field', props, 'properties');
+
+ this.genericExtends( props, 'properties');
+ this.genericImplements( props, 'properties');
+
+ var signals = [];
+ this.genericBuildList('object', 'signal', signals, 'signals');
+ this.genericExtends( signals, 'signals');
+ this.genericImplements( signals, 'signals');
+
+
+ Introspect.references[this.alias] = Introspect.references[this.alias] || [];
+ if (this.alias == 'GObject.Object') {
+ this._loaded = true;
+ return;
+ }
+
+
+ this.constructors.push({
+ name : '', // not really...
+ params: this.properties.length ? [ { type : 'Object', be_null : true, name : 'properties' } ] : [],
+ returns : [],
+ isConstructor : true,
+ isStatic : false,
+ memberOf : this.alias,
+ exceptions : [],
+ // in theory..
+ desc : ''
+ });
+
+
+ var methods = [];
+ this.genericBuildList('object', 'method', methods, 'methods');
+ // dont inherit functiosn or consturctors...
+
+ this.genericExtends( methods, 'methods');
+ this.genericImplements( methods, 'methods');
+
+
+
+ //console.log("loaded(Class) " + this.alias);
+
+ this._loaded = true;
+ }
+
+
+
+
+
+});
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
+
+
+/**
+ * Constant
+ */
+
+
+Constant = function(prop, memberOf, saveto, keylist) {
+
+ this.name = GI.base_info_get_name(prop);
+ var tif = GI.constant_info_get_type(prop);
+ var ty = GI.type_tag_to_string( GI.type_info_get_tag(tif));
+ this.type = this.typeToName(GI.constant_info_get_type(prop));
+
+ ///this.flags = GI.property_info_get_flags(prop),
+
+
+ this.value= 'UNKNOWN';
+
+
+ if (ty != 'interface') {
+
+ var argm = new GI.Argument();
+ GI.constant_info_get_value ( prop ,argm);
+ if (ty != 'utf8') {
+ this.value = argm.v_long;
+ } else {
+ this.value = argm.v_string;
+ }
+ }
+
+ this.desc = Introspect.doc(memberOf.alias + '.' + this.name)
+
+ memberOf[saveto].push(this);
+ keylist.push(this.name);
+}
+
+
+Roo.extend(Constant,Basic);
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Base = imports['JSDOC/Introspect/Base.js'].Base;
+
+
+
+
+
+Enum = function(ns, name) {
+ Base.call(this, ns, name);
+
+}
+Roo.extend(Enum, Base, {
+ titleType: 'Enum',
+ _loaded : false,
+ load : function()
+ {
+ if (this._loaded) {
+ return; // already loaded..
+ }
+
+ this.desc = Introspect.doc(this.alias);
+ var bi = this.getBI();
+
+ for(var i =0; i < GI.enum_info_get_n_values(bi); i++) {
+
+ var prop = GI.enum_info_get_value(bi,i);
+
+
+ this.values.push({
+ name : GI.base_info_get_name(prop).toUpperCase() ,
+ type : GI.type_tag_to_string(GI.enum_info_get_storage_type(bi)),
+ value: GI.value_info_get_value(prop) ,
+ memberOf : this.alias
+ });
+ }
+
+ this._loaded = true;
+
+
+
+
+ }
+});
+
+
\ No newline at end of file
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
+
+
+/**
+ * Field
+ */
+
+Field = function(prop, memberOf, saveto, keylist) {
+
+ this.name = GI.base_info_get_name(prop) ,
+ this.type = this.typeToName(GI.field_info_get_type(prop)),
+ this.flags = GI.field_info_get_flags(prop),
+ this.memberOf = memberOf.alias
+ memberOf[saveto].push(this);
+ keylist.push(this.name);
+
+}
+
+
+Roo.extend(Field,Basic);
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Base = imports['JSDOC/Introspect/Base.js'].Base;
+
+
+
+/**
+ * Interface
+ */
+
+Interface = function(ns, name) {
+ Base.call(this, ns, name);
+
+}
+
+Roo.extend(Interface, Base, {
+ titleType: 'Interface',
+ _loaded : false,
+ load : function()
+ {
+ if (this._loaded) {
+ return; // already loaded..
+ }
+ // my props..
+ var props = [];
+ this.genericBuildList('interface', 'property', props, 'properties');
+
+
+ var signals = [];
+ this.genericBuildList('interface', 'signal', signals, 'signals');
+
+
+ var methods = [];
+ this.genericBuildList('interface', 'method', methods, 'methods');
+
+
+ Introspect.ifaceList[this.alias] = Introspect.ifaceList[this.alias] || [];
+ this.implementedBy = Introspect.ifaceList[this.alias];
+
+
+
+ this._loaded = true;
+ },
+
+
+});
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
+/**
+ * Methods, functiosn or consturctors
+ */
+
+
+
+
+Method = function(m, memberOf, saveto, keylist) {
+ this.propertyType = 'Method';
+
+ var flags = GI.function_info_get_flags (m);
+ var n = GI.base_info_get_name(m);
+ var n_original = n + '';
+ // posibly add: sink,
+ if (n.match(/_(ref|unref)$/) || n.match(/^(ref|unref|weakref|weakunref)$/)) {
+ return false; // skip these!
+ }
+
+ if (n == 'new') {
+ n = 'c_new';
+ }
+
+
+ var retval = [ {
+ name : 0,
+ type : this.typeToName(GI.callable_info_get_return_type(m)),
+ desc : Introspect.doc(memberOf.alias + '.' + n_original + '.return-value')
+ } ];
+
+
+
+ var args = this.argsToArrays(m, retval);
+
+
+ if ((n == 'c_new') && !args.length && memberOf.constructors.length) {
+
+ memberOf.constructors[0].doc = Introspect.doc(memberOf.alias + '.' + n_original);
+
+ return false; // skip.
+ }
+
+
+
+
+
+ //console.log(GI.base_info_get_name(m));
+ // console.dump(GI.base_info_get_attribute(m, 'doc') );
+
+ // this is a bit messy, as we probably loose the doc's on new..
+
+
+ Roo.apply(this, {
+ name : n,
+ params: args,
+ returns : retval,
+ isConstructor : flags & GI.IFunctionInfoFlags.IS_CONSTRUCTOR,
+ isStatic : !(flags & GI.IFunctionInfoFlags.IS_METHOD),
+ memberOf : memberOf.alias,
+ exceptions : [],
+ desc : Introspect.doc(memberOf.alias + '.' + n_original)
+ });
+ // add descriptions to the arguments..
+ Roo.each(this.params, function(p) {
+
+
+ p.desc = Introspect.doc(memberOf.alias + '.' + n_original + '.' + p.name);
+ //Seed.print(memberOf.alias + '.' + n_original + '.' + p.name + ':' + p.desc);
+
+ });
+
+
+ // collect references...
+ var addedto = [ memberOf.alias ]; // do not add to self...
+
+ for(var i =0; i < args.length;i++) {
+ var ty = args[i].type;
+ if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
+ continue;
+ }
+ if (addedto.indexOf(ty) > -1) {
+ continue;
+ }
+
+
+
+ Introspect.references[ty] = Introspect.references[ty] || [];
+ Introspect.references[ty].push(this);
+ addedto.push(ty);
+ }
+
+
+ // decide what to add to...
+
+ if (this.isConstructor) {
+
+ if (this.name.match(/^new_/)) {
+ this.name = this.name.substring(4);
+ }
+
+
+ memberOf.constructors.push(this);
+ return;
+ }
+ // return values = only applicable to non-constructors..
+ for(var i =0; i < retval.length;i++) {
+ var ty = retval[i].type;
+ if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
+ continue;
+ }
+ if (addedto.indexOf(ty) > -1) {
+ continue;
+ }
+
+
+
+ Introspect.references[ty] = Introspect.references[ty] || [];
+ Introspect.references[ty].push(this);
+ addedto.push(ty);
+ }
+
+
+ if (this.isStatic) {
+
+ memberOf.functions.push(this);
+ return;
+ }
+
+
+ memberOf.methods.push(this);
+ keylist.push(this.name);
+
+
+
+}
+
+
+Roo.extend(Method,Basic);
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
+
+
+/**
+ * Property
+ */
+
+Property = function(prop, memberOf, saveto, keylist) {
+ this.propertyType = 'Property';
+ var n_original = GI.base_info_get_name(prop);
+ this.name = n_original.replace(/\-/g, '_') ,
+ this.type = this.typeToName(GI.property_info_get_type(prop)),
+ this.flags = GI.property_info_get_flags(prop),
+ this.memberOf = memberOf.alias
+ memberOf[saveto].push(this);
+ keylist.push(this.name);
+ this.desc = Introspect.doc(this.memberOf + '.' + n_original);
+
+
+ if (typeof(this.type) == 'string' && this.type.indexOf('.') > -1) {
+
+ Introspect.references[this.type] = Introspect.references[this.type] || [];
+ Introspect.references[this.type].push(this);
+ }
+
+}
+
+
+Roo.extend(Property,Basic);
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
+
+
+
+Signal = function(sig, memberOf, saveto, keylist) {
+
+ this.propertyType = 'Signal';
+
+ var params = this.argsToArrays(sig);
+ // add a reference to self...
+ params.unshift({
+ name : 'self',
+ type : memberOf.alias,
+ direction : 'in',
+ be_null : false
+
+ });
+ var n_original = GI.base_info_get_name(sig);
+
+ Roo.apply(this,{
+ name : n_original.replace(/-/g,'_'),
+ params : params,
+ memberOf : memberOf.alias,
+ exceptions : [],
+ returns : [ { type : this.typeToName(GI.callable_info_get_return_type(sig)) } ],
+ desc : Introspect.doc(memberOf.alias + '.' + n_original)
+ });
+ memberOf[saveto].push(this);
+ keylist.push(this.name);
+
+ var addedto = [ memberOf.alias ]; // do not add to self...
+
+ for(var i =1; i < params.length;i++) {
+ var ty = params[i].type;
+ if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
+ continue;
+ }
+ if (addedto.indexOf(ty) > -1) {
+ continue;
+ }
+
+
+
+ Introspect.references[ty] = Introspect.references[ty] || [];
+ Introspect.references[ty].push(this);
+ addedto.push(ty);
+ }
+
+
+
+
+
+}
+Roo.extend(Signal,Basic);
+
+
+
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Base = imports['JSDOC/Introspect/Base.js'].Base;
+/**
+ * Struct
+ */
+
+Struct = function(ns, name) {
+ Base.call(this, ns, name);
+
+}
+
+Roo.extend(Struct, Base,
+{
+ titleType: 'Struct',
+
+ _loaded : false,
+ load : function()
+ {
+ if (this._loaded) {
+ return; // already loaded..
+ }
+ // my props..
+ var props = [];
+ this.genericBuildList('struct', 'field', props, 'properties');
+
+ var methods = [];
+
+
+ if (GI.struct_info_get_size (this.getBI()) > 0 ) {
+
+
+
+ this.constructors.push({
+ name : '',
+ params: [],
+ returns : [],
+ isConstructor : true,
+ isStatic : false,
+ memberOf : this.alias,
+ exceptions : [],
+ desc : ''
+ });
+ }
+
+ this.genericBuildList('struct', 'method', methods, 'methods');
+
+ this._loaded = true;
+ },
+
+
+});
\ No newline at end of file
--- /dev/null
+//<script type="text/javascript">
+//Gtk = imports.gi.Gtk;
+GI = imports.gi.GIRepository;
+GLib = imports.gi.GLib;
+xml = imports.libxml;
+//GObject = imports.gi.GObject;
+
+console = imports['console.js'].console;
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+Base = imports['JSDOC/Introspect/Base.js'].Base;
+
+/**
+ * Union
+ */
+
+Union = function(ns, name) {
+ Base.call(this, ns, name);
+
+}
+
+Roo.extend(Union, Base, {
+ titleType: 'Union',
+ _loaded : false,
+ load : function()
+ {
+ if (this._loaded) {
+ return; // already loaded..
+ }
+ // my props..
+ var props = [];
+ this.genericBuildList('union', 'field', props, 'properties');
+
+ if (GI.union_info_get_size (this.getBI()) > 0 ) {
+
+ this.constructors.push({
+ name : '',
+ params: [],
+ returns : [],
+ isConstructor : true,
+ isStatic : false,
+ memberOf : this.alias,
+ exceptions : [],
+ desc : ''
+ });
+ }
+ var methods = [];
+ this.genericBuildList('union', 'method', methods, 'methods');
+
+ this._loaded = true;
+ },
+
+
+});
\ No newline at end of file
--- /dev/null
+//<script type="text/javascript">
+/**
+* @class xml.XMLNode
+* Xml node
+* @noconstructor
+*
+* @cfg {String} name Name of Node ???
+* @cfg {XMLNode} children First child (use next property to iterate children
+* @cfg {XMLNode} parent Parent node of this one
+* @cfg {XMLNode} next Next sibling
+* @cfg {XMLNode} prev Previous sibling
+* @cfg {String} Text contents of Node
+* @cfg {XMLNode} last Last Sibling? or last child - FIXME
+* @cfg {String} type - Type of node : element, attribute, text
+* @cfg {XMLAttribute} properties First Attribute of node
+*/
+XMLNode = function() {}
+
+Roo.apply(XMLNode.prototype, {
+
+});
+
+
+/**
+* @class xml.XMLDocument
+* Xml document
+* @noconstructor
+*
+* @cfg {String} name Name of Node ???
+* @cfg {XMLNode} children First child (use next property to iterate children
+* @cfg {XMLNode} parent Parent node of this one
+* @cfg {XMLNode} next Next sibling
+* @cfg {XMLNode} prev Previous sibling
+* @cfg {String} Text contents of Node
+* @cfg {XMLNode} last Last Sibling? or last child - FIXME
+* @cfg {String} type - Type of node : element, attribute, text
+* @cfg {XMLAttribute} properties First Attribute of node
+* @cfg {XMLNode} root Root node of document.
+*/
+
+
+XMLDocument = function () { };
+
+Roo.extend(XMLDocument, XMLNode, {
+ root : { },
+});
+
+
+/**
+* Create a new xpath context ?
+* @param {Object} .....
+* @return {XMLNode} returns obj
+* @member XMLDocument xpathNewContext
+*/
+
+XMLDocument.xpathNewContext = function() { }
+
+
+
+
+
+XMLAttribute = function () { };
+
+Roo.extend(XMLAttribute, XMLNode, {
+
+});
+
+
+XMLXPathContext = function() { };
+Roo.apply(XMLXPathContext.prototype, {
+ value : '',
+});
+
+XMLXPathContext.xpathEval = function () {}
+XMLXPathContext.xpathRegisterNs = function () {}
+
+
+XMLXPathObj = function() { };
+Roo.apply(XMLXPathObj.prototype, {
+ value : '',
+});
+
+
+
+parseFile = function () { }
+parseString = function () { }
+_nodeProto = { }
+
+
+
\ No newline at end of file
--- /dev/null
+//<script type="text/javscript">
+
+/**
+ @namespace
+*/
+Lang = {
+
+
+ isBuiltin : function(name) {
+ return (this.coreObjects.indexOf(name) > -1);
+ },
+ coreObjects : ['_global_', 'Array', 'Boolean', 'Date', 'Error',
+ 'Function', 'Math', 'Number', 'Object', 'RegExp', 'String'],
+
+
+ whitespace : function(ch) {
+ return this.whitespaceNames[ch];
+ },
+
+ whitespaceNames : {
+ " ": "SPACE",
+ "\f": "FORMFEED",
+ "\t": "TAB",
+ "\u0009": "UNICODE_TAB",
+ "\u000A": "UNICODE_NBR",
+ "\u0008": "VERTICAL_TAB"
+ },
+
+ newline : function(ch) {
+ return this.newlineNames[ch];
+ },
+ newlineNames : {
+ "\n": "NEWLINE",
+ "\r": "RETURN",
+ "\u000A": "UNICODE_LF",
+ "\u000D": "UNICODE_CR",
+ "\u2029": "UNICODE_PS",
+ "\u2028": "UNICODE_LS"
+ },
+
+ keyword : function(word) {
+ return this.keywordNames["="+word];
+ },
+ isKeyword: function(word) {
+ return typeof(this.keywordNames["="+word]) == 'undefined' ? false : true;
+ },
+
+ keywordNames : {
+ "=break": "BREAK",
+ "=case": "CASE",
+ "=catch": "CATCH",
+ "=const": "VAR",
+ "=continue": "CONTINUE",
+ "=default": "DEFAULT",
+ "=delete": "DELETE",
+ "=do": "DO",
+ "=else": "ELSE",
+ "=false": "FALSE",
+ "=finally": "FINALLY",
+ "=for": "FOR",
+ "=function": "FUNCTION",
+ "=if": "IF",
+ "=in": "IN",
+ "=instanceof": "INSTANCEOF",
+ "=new": "NEW",
+ "=null": "NULL",
+ "=return": "RETURN",
+ "=switch": "SWITCH",
+ "=this": "THIS",
+ "=throw": "THROW",
+ "=true": "TRUE",
+ "=try": "TRY",
+ "=typeof": "TYPEOF",
+ "=void": "VOID",
+ "=while": "WHILE",
+ "=with": "WITH",
+ "=var": "VAR"
+ },
+
+ punc : function(ch) {
+ return this.puncNames[ch];
+ },
+ puncNames : {
+ ";": "SEMICOLON",
+ ",": "COMMA",
+ "?": "HOOK",
+ ":": "COLON",
+ "||": "OR",
+ "&&": "AND",
+ "|": "BITWISE_OR",
+ "^": "BITWISE_XOR",
+ "&": "BITWISE_AND",
+ "===": "STRICT_EQ",
+ "==": "EQ",
+ "=": "ASSIGN",
+ "!==": "STRICT_NE",
+ "!=": "NE",
+ "<<": "LSH",
+ "<=": "LE",
+ "<": "LT",
+ ">>>": "URSH",
+ ">>": "RSH",
+ ">=": "GE",
+ ">": "GT",
+ "++": "INCREMENT",
+ "--": "DECREMENT",
+ "+": "PLUS",
+ "-": "MINUS",
+ "*": "MUL",
+ "/": "DIV",
+ "%": "MOD",
+ "!": "NOT",
+ "~": "BITWISE_NOT",
+ ".": "DOT",
+ "[": "LEFT_BRACE",
+ "]": "RIGHT_BRACE",
+ "{": "LEFT_CURLY",
+ "}": "RIGHT_CURLY",
+ "(": "LEFT_PAREN",
+ ")": "RIGHT_PAREN"
+ },
+
+ matching : function(name) {
+ return this.matchingNames[name];
+ },
+ matchingNames : {
+ "LEFT_PAREN": "RIGHT_PAREN",
+ "RIGHT_PAREN": "LEFT_PAREN",
+ "LEFT_CURLY": "RIGHT_CURLY",
+ "RIGHT_CURLY": "LEFT_CURLY",
+ "LEFT_BRACE": "RIGHT_BRACE",
+ "RIGHT_BRACE": "LEFT_BRACE"
+ },
+
+ isNumber : function(str) {
+ return /^(\.[0-9]|[0-9]+\.|[0-9])[0-9]*([eE][+-][0-9]+)?$/i.test(str);
+ },
+
+ isHexDec : function(str) {
+ return /^0x[0-9A-F]+$/i.test(str);
+ },
+
+ isWordChar : function(str) {
+ return /^[a-zA-Z0-9$_.]+$/.test(str);
+ },
+
+ isSpace : function(str) {
+ return (typeof this.whitespace(str) != "undefined");
+ },
+
+ isNewline : function(str) {
+ return (typeof this.newline(str) != "undefined");
+ }
+
+};
\ No newline at end of file
--- /dev/null
+//<script type="text/javscript">
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+console = imports['console.js'].console;
+
+TokenStream = imports['JSDOC/TokenStream.js'].TokenStream;
+/**
+ *
+ * this takes our collased file, and turns it into the config array..
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+
+RooFile = function (ar)
+{
+ RooFile.superclass.constructor.call(this, ar);
+ // console.log("STARTING OUTPUT");
+
+
+
+}
+
+Roo.extend(RooFile, TokenStream, {
+
+ cfg : { },
+
+ parse: function()
+ {
+
+ if (this.tokens[0].data == 'Pman.on') {
+ // then it's a layout style..
+
+ //Seed.quit();
+
+
+ //console.dump(this.tokens);
+ // the list of statements inside of function..?
+ var stmts = this.tokens[1].items[1][2].items;
+ // look for register..
+ var topp = false;
+ Roo.each(stmts, function(s, i) {
+ if (s[0].data == 'Pman.register') {
+ topp = brace = s[1].items[0][0].props;
+ }
+ });
+ if (!topp) {
+ console.dump(this.tokens);
+ throw "could not find top props...";
+
+ }
+
+ this.cfg = this.parseProps(topp);
+ this.cfg.name = this.tokens[3].data;
+
+
+ // ( { add { this.panel ( {
+ var cfg = this.tokens[7].items[0][0].props.add.val[2].items[2][3].items[0][0].props;
+ this.cfg.items = [ this.parseProps(cfg) ];
+ // console.dump(this.cfg);
+
+ return;
+ }
+
+ if (this.tokens[2].props && typeof(this.tokens[2].props.create) != 'undefined') {
+ //console.dump(this.tokens);
+ this.cfg.name = this.tokens[0].data;
+
+
+
+ var cfg = this.tokens[2].props.create.val[2].items[1][3].items[0][0].props;
+ //console.dump(this.tokens);
+ this.cfg.items = [ this.parseProps(cfg) ];
+
+ }
+ // perfect for dialogs...
+
+
+ var pos = this.lookFor( 'function');
+
+ // XXXXX = function(
+ var cfg = {};
+
+ if (pos > -1 && (this.tokens[pos-1].data == '=') && (this.tokens[pos-2].type == 'NAME')) {
+
+ this.cfg = {
+ '*class' : this.tokens[pos-2].data,
+ '*extends' : '',
+ '//constructor' : this.tokens[pos-2].prefix,
+ '|constructor' : 'function ' + this.tokens[pos+1].toRaw() +
+ this.tokens[pos+2].toRaw(),
+
+ };
+ this.cursor = pos+2;
+
+ }
+
+ if (pos < 0) {
+ // no function - we have a static one...
+ pos = this.lookFor( '=');
+ if (pos > 1 &&
+ (this.tokens[pos-1].type == 'NAME') &&
+ (this.tokens[pos+1].data == '{')
+ ) {
+ this.cfg = {
+ '*class' : this.tokens[pos-1].data,
+ '//*class' : this.tokens[pos-1].prefix,
+
+
+ };
+ Roo.apply(this.cfg, this.parseProps(this.tokens[pos+1].props));
+ return;
+
+ }
+
+
+
+ }
+
+
+ // Roo.apply (l
+ var pos = this.lookFor( 'Roo.apply');
+ //console.dump(this.tokens);
+
+
+ if (
+ (pos > -1) &&
+ (this.tokens[pos+1].items[0][0].data == this.cfg['*class'] + '.prototype')
+ ) {
+ // XXXXXx.prototype = {
+
+
+
+ Roo.apply(this.cfg, this.parseProps(this.tokens[pos+1].items[1][0].props));
+ return;
+
+ }
+
+
+ var pos = this.lookFor('new');
+
+ if (pos > -1 &&
+ (this.tokens[pos-2].type == 'NAME') &&
+ (this.tokens[pos-1].data == '=') &&
+ (this.tokens[pos+1].type == 'NAME') &&
+ (this.tokens[pos+2].data == '(')
+ ) {
+
+ this.cfg = {
+ '//*class' : this.tokens[pos-2].prefix,
+ '*class' : this.tokens[pos-2].data,
+ '*extends' : this.tokens[pos+1].data
+ };
+
+ Roo.apply(this.cfg, this.parseProps(this.tokens[pos+2].items[0][0].props));
+
+ return;
+
+ }
+
+ ///Builder.Provider.ProjectManager = new Roo.Observable({
+
+
+
+ var pos = this.lookFor( 'Roo.extend');
+ if (pos > -1) {
+
+ this.cfg['*extends'] = this.tokens[pos+1].items[1][0].data;
+ Roo.apply(this.cfg, this.parseProps(this.tokens[pos+1].items[2][0].props));
+
+ // no more..
+ return;
+ }
+
+
+
+ var pos = this.lookFor( 'Roo.extend');
+ if (pos > -1) {
+
+ this.cfg['*extends'] = this.tokens[pos+1].items[1][0].data;
+ Roo.apply(this.cfg, this.parseProps(this.tokens[pos+1].items[2][0].props));
+
+ // no more..
+ return;
+ }
+
+
+
+ //console.dump(cfg);
+ //Seed.quit();
+
+
+
+ // other type of layout
+ // console.dump(this.tokens);
+
+ // this type of file..
+ // xxxx.xxx = function
+ // -> into |constructor..
+ // -> extend + prototype
+
+
+
+
+ },
+
+ parseProps: function(o)
+ {
+ var ret = { };
+ var fakeItems = [];
+ for(var k in o) {
+
+
+ if (o[k].key.data == '}') {
+ // typo trailing comma in object def.
+ continue;
+ }
+
+ var kv = k;
+ if (o[k].key.type == 'STRN') {
+ kv = o[k].key.toJS();
+ }
+ if (!o[k].val.length) {
+ console.dump(o[k]);
+ }
+ //console.dump(o[k]);
+ if (o[k].val[0].data == "function") {
+ // add comments..
+ // console.dump(o[k].key.prefix);
+ var pr = typeof(o[k].key.prefix) == 'undefined' ? '' : o[k].key.prefix ;
+ pr = this.clean_prefix( pr) ;
+ if (pr.length) {
+ ret['//' +kv ] = pr;
+ }
+
+ ret['|' +kv ] = this.clean_body( this.expand(o[k].val));
+ continue;
+ }
+ if (o[k].val[0].data == "[") {
+
+ if (o[k].val[0].items[0][0].data == '{') {
+ // array of objects..
+
+ // this works for items..
+
+ // used elsewhere for buttons: -> in which case we have a fake xtype
+
+
+
+ // if K is not ITEMS - we need to add '*prop' -> and add it to the items array..
+ var add = this.parseArray(o[k].val[0].items);
+ if (kv == 'items') {
+ ret[kv] = add;
+ continue;
+ }
+ var fake_array = {
+ xtype : 'Array.' + kv,
+ '*prop' : kv,
+ items : add
+ }
+ fakeItems.push(fake_array);
+ continue;
+ }
+ // raw array
+
+
+ ret['|' +kv ] = this.clean_body(this.expand(o[k].val)); // remove ','...
+ continue;
+ }
+ if (o[k].val[0].data == "(") {
+ ret['|' +kv ] = this.expand(o[k].val);
+ continue;
+ }
+ if (o[k].val[0].data == "{") {
+
+ // things that can be property of object type:
+ // listeners, set,
+ var add = this.parseProps(o[k].val[0].props);
+ if (kv == 'set' || kv =='listeners') {
+ ret[kv ] = add;
+ continue;
+ }
+ if ((typeof(add.xtype) != 'undefined') || ['sortInfo', 'center', 'east', 'west', 'north', 'south'].indexOf(kv) > -1) {
+ add['*prop'] = kv;
+ fakeItems.push(add);
+ continue;
+ }
+
+
+ ret[ '|' + kv ] = this.expand(o[k].val);
+
+
+ // this hsould be added to 'items', with a *prop element..
+ continue;
+ }
+ //console.dump(o[k].val);
+
+ if (o[k].val[1].data == ',' || o[k].val[1].data == '}') {
+ // single item piece of data...
+ var t1= o[k].val[0];
+ switch(o[k].val[0].type) {
+ case 'STRN':
+ case 'NUMB':
+ case 'KEYW':
+ ret[ kv ] = t1.toJS();
+ continue;
+ case 'NAME':
+ ret[ '|' + kv ] = t1.data;
+ continue;
+
+ }
+ }
+
+ ret[ '|' + kv ] = this.expand(o[k].val);
+
+ }
+ if (!ret.items && fakeItems.length) {
+ ret.items = [];
+ }
+ Roo.each(fakeItems, function(e) {
+ ret.items.push(e);
+ })
+ // merge fakeItems;
+ //console.dump(ret);
+
+ return ret;
+ },
+ parseArray: function(ar) {
+ // console.dump(ar);
+ // Seed.quit();
+ var ret = [];
+ Roo.each(ar, function (e) {
+ // has no props...
+ if (typeof(e[0].props) == 'undefined') {
+ return;
+ }
+
+
+ ret.push( this.parseProps(e[0].props));
+
+ },this);
+
+ return ret;
+
+ },
+
+
+ expand: function(ar)
+ {
+ var ret = '';
+
+
+ for(var i =0 ; i < ar.length -1; i++) {
+ ret += ar[i].toRaw();
+ }
+
+
+
+ return ret;
+
+
+ },
+ clean_body : function(str)
+ {
+ var lns = str.split("\n");
+ var mindent = -1;
+ Roo.each(lns, function(l, i) {
+ if (!i || !l.length || l.match(/^\s+$/)) {
+ return;
+ }
+
+ var spc = l.match(/\s+/);
+ if (!spc || !spc[0].length) {
+ return;
+ }
+ mindent = mindent < 0 ? spc[0].length : Math.min(spc[0].length, mindent);
+
+ });
+ //console.log(mindent + ":" + lns[0]);
+ var ar = [];
+ if (mindent < 0) {
+ return str;
+ }
+ Roo.each(lns, function(l,i) {
+ if (!i) {
+ ar.push(l.replace(/^\s+/, ''));
+ return;
+ }
+ ar.push(l.substring(mindent));
+ });
+ return ar.join("\n");
+ },
+ clean_prefix: function(str) {
+
+
+
+ if (!str.length) {
+ return '';
+ }
+ var ret = str.replace(/^\s+/gm, "\n").replace(/\n+/gm, "\n");
+ return ret == "\n" ? '' : ret;
+
+ }
+
+
+
+});
\ No newline at end of file
--- /dev/null
+//<script type="text/javscript">
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+console = imports['console.js'].console;
+xnew = imports['xnew.js'].xnew;
+
+Gio = imports.gi.Gio;
+GLib = imports.gi.GLib;
+
+
+Link = imports['JSDOC/Template/Link.js'].Link;
+
+Template = function(templateFile) {
+ if (templateFile) {
+
+ this.template = Gio.simple_read(templateFile);
+
+ }
+
+ this.templateFile = templateFile;
+ this.templateName = GLib.path_get_basename(templateFile);
+ this.code = "";
+ this.parse();
+}
+
+xnew.load(Template , 'JSDOC/Template');
+
+
+Roo.apply(Template.prototype , {
+
+
+ parse : function() {
+
+ console.log("Parsing template? " + this.templateName);
+
+ this.template = this.template.replace(/\{#[\s\S]+?#\}/gi, "");
+ this.code = "var output=``"+this.template;
+
+ this.code = this.code.replace(
+ /<for +each="(.+?)" +in="(.+?)" *>/gi,
+ function (match, eachName, inName) {
+ return "``;\rvar $"+eachName+"_keys = keys("+inName+");\rfor(var $"+eachName+"_i = 0; $"+eachName+"_i < $"+eachName+"_keys.length; $"+eachName+"_i++) {\rvar $"+eachName+"_last = ($"+eachName+"_i == $"+eachName+"_keys.length-1);\rvar $"+eachName+"_key = $"+eachName+"_keys[$"+eachName+"_i];\rvar "+eachName+" = "+inName+"[$"+eachName+"_key];\routput+=``";
+ }
+ );
+ this.code = this.code.replace(/<if test="(.+?)">/g, "``;\rif ($1) { \routput+=``");
+ this.code = this.code.replace(/<else\s*\/>/g, "``;} \relse\r{ \routput+=``");
+
+ this.code = this.code.replace(/<\/(if|for)>/g, "``;\r};\routput+=``");
+
+ //File.write("/tmp/jstookit_eval_"+this.templateName+".4.js", this.code);
+
+ this.code = this.code.replace(
+ /\{\+\s*([\s\S]+?)\s*\+\}/gi,
+ function (match, code) {
+ code = code.replace(/"/g, "``"); // prevent qoute-escaping of inline code
+ code = code.replace(/(\r?\n)/g, " ");
+ return "``+ \r("+code+") +\r``";
+ }
+ );
+ //File.write("/tmp/jstookit_eval_"+this.templateName+".6.js", this.code);
+
+ this.code = this.code.replace(
+ /\{!\s*([\s\S]+?)\s*!\}/gi,
+ function (match, code) {
+ code = code.replace(/"/g, "``"); // prevent qoute-escaping of inline code
+ code = code.replace(/(\n)/g, " "); // remove quotes..
+ return "``; "+code+";\routput+=``";
+ }
+ );
+ //File.write("/tmp/jstookit_eval_"+this.templateName+".7.js", this.code);
+ this.code = this.code+"``;";
+
+
+
+ this.code = this.code.replace(/(\r?\n)/g, "\\n");
+ this.code = this.code.replace(/"/g, "\\\"");
+
+ this.code = this.code.replace(/``/g, "\"");
+ this.code = this.code.replace(/\\r/g, "\n");
+ //File.write("/tmp/jstookit_eval_"+this.templateName+".9.js", this.code);
+ this.code = this.code.replace(/\r/g, "\n\n");
+
+
+ },
+
+ toCode : function() {
+ return this.code;
+ },
+
+ keys : function(obj) {
+ var keys = [];
+ if (obj && obj.constructor.toString().indexOf("Array") > -1) {
+ for (var i = 0; i < obj.length; i++) {
+ keys.push(i);
+ }
+ }
+ else {
+ for (var i in obj) {
+ keys.push(i);
+ }
+ }
+ return keys;
+ },
+
+ values : function(obj) {
+ var values = [];
+ if (obj.constructor.toString().indexOf("Array") > -1) {
+ for (var i = 0; i < obj.length; i++) {
+ values.push(obj[i]);
+ }
+ }
+ else {
+ for (var i in obj) {
+ values.push(obj[i]);
+ }
+ }
+
+
+ return values;
+ },
+
+ process : function(data) {
+
+ //console.log("processing template");
+ var keys = this.keys;
+ var values = this.values;
+
+ var makeSortby = this.makeSortby;
+ var makeSignature = this.makeSignature;
+ var summarize = this.summarize ;
+ var makeFuncSkel = this.makeFuncSkel;
+ var resolveLinks = this.resolveLinks;
+ var makeImage = this.makeImage;
+ // usefull for cross refing..
+ Template.data = data;
+
+
+
+ try {
+ eval(this.code);
+ } catch (e) {
+ Gio.simple_write('/tmp/template.js', this.code);
+ Seed.print('in /tmp/template.js');
+ throw e;
+ Seed.quit();
+ }
+
+
+ //File.write("/tmp/jstookit_eval.js", this.code);
+ //try {
+ //eval('include "/tmp/jstookit_eval.js";');
+ //includeJs("/tmp/jstookit_eval.js");
+ //eval(this.code);
+ // console.log("done eval of template");
+
+ return output;
+ },
+
+
+ isdefined : function (typ) {
+ return typ != 'undefined';
+ },
+
+
+ summarize : function(desc) {
+ if (typeof desc != "undefined")
+ return desc.match(/([\w\W]+?\.)[^a-z0-9]/i)? RegExp.$1 : desc;
+ },
+
+ /** make a symbol sorter by some attribute */
+ makeSortby : function(attribute) {
+ return function(a, b) {
+ if (a[attribute] != undefined && b[attribute] != undefined) {
+ a = a[attribute]; //.toLowerCase();
+ b = b[attribute];//.toLowerCase();
+ if (a < b) return -1;
+ if (a > b) return 1;
+ return 0;
+ }
+ }
+ },
+ makeImage : function(alias) {
+ /// http://library.gnome.org/devel/gtk/stable/notebook.png
+ var ns = alias.split('.').shift();
+ var cls = alias.split('.').pop().toLowerCase();
+ if (ns != 'Gtk' ) {
+ return '';//ns;
+ }
+ return '<img class="class-picture" src="http://library.gnome.org/devel/gtk/stable/' + cls + '.png">';
+
+
+ },
+
+
+
+ makeSignature : function(params) {
+ if (!params) return "()";
+ var signature = "(" +
+ params.filter(
+ function($) {
+ return $.name.indexOf(".") == -1; // don't show config params in signature
+ }
+ ).map(
+ function($) {
+ $.defaultValue = typeof($.defaultValue) == 'undefined' ? false : $.defaultValue;
+
+ return "" +
+ ($.isOptional ? "[" : "") +
+ (($.type) ?
+ (new Link().toSymbol(
+ (typeof($.type) == 'object' ) ? 'Function' : $.type
+ )) + " " : ""
+ ) +
+ "<B><i>" +$.name + "</i></B>" +
+ ($.defaultValue ? "=" +item.defaultValue : "") +
+ ($.isOptional ? "]" : "");
+
+
+ }
+ ).join(", ")
+ +
+ ")";
+ return signature;
+ },
+
+ makeFuncSkel : function(params) {
+ if (!params) return "function ()\n{\n\n}";
+ return "function (" +
+ params.filter(
+ function($) {
+ return $.name.indexOf(".") == -1; // don't show config params in signature
+ }
+ ).map( function($) { return $.name == 'this' ? '_self' : $.name; } ).join(", ")
+ +
+ ")\n{\n\n}";
+
+ },
+
+ /** Find symbol {@link ...} strings in text and turn into html links */
+ resolveLinks : function (str, from) {
+ if (!str || typeof(str) == 'undefined') {
+ return '';
+ }
+
+ // gtk specific. now..
+ // @ -> bold.. - they are arguments..
+
+ str = str.replace(/@([a-z_]+)/gi,
+ function(match, symbolName) {
+ return '<b>' + symbolName + '</b>';
+ }
+ );
+ // constants.
+ str = str.replace(/%([a-z_]+)/gi,
+ function(match, symbolName) {
+ return '<b>' + symbolName + '</b>';
+ }
+ );
+
+ str = str.replace(/#([a-z_]+)/gi,
+ function(match, symbolName) {
+ return '<b>' + symbolName + '</b>';
+ // this should do a lookup!!!!
+ /// it could use data in the signature to find out..
+ //return new Link().toSymbol(Template.data.ns + '.' + symbolName);
+ }
+ );
+
+ str = str.replace(/\n/gi, '<br/>');
+
+ /*
+ str = str.replace(/\{@link ([^} ]+) ?\}/gi,
+ function(match, symbolName) {
+ return new Link().toSymbol(symbolName);
+ }
+ );
+ */
+ /*
+ str = str.replace(/\{([a-z\.\/]+)\}/gi,
+ function(match, symbolName) {
+ //println("got match " + symbolName);
+ bits = symbolName.split('/');
+ var mret = '';
+ for(var i = 0; i < bits.length; i++) {
+
+ mret += (mret.length ? ' | ' : '') + new Link().toSymbol(bits[i]);
+ }
+
+ return mret; //new Link().toSymbol(symbolName);
+ }
+ );
+ */
+ // look for aaaa.\S+ ??? this might work???
+ /*
+ str = str.replace(/\([a-z]+\.\S+)/gi,
+ function(match, symbolName) {
+ return new Link().toSymbol(symbolName);
+ }
+ );
+ */
+
+ return str;
+ }
+
+
+});
\ No newline at end of file
--- /dev/null
+//<script type="text/javascript">
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+console = imports['console.js'].console;
+
+Template = imports['JSDOC/Template.js'];
+
+/** Handle the creation of HTML links to documented symbols.
+ @constructor
+ *
+ * // JSDOC.Template.Link.base = "";
+ * JSDOC.Template.Link.symbolsDir
+ *
+*/
+
+
+Link = function() {
+ this.alias = "";
+ this.src = "";
+ this.file = "";
+ this.text = "";
+ this.innerName = "";
+ this.classLink = false;
+ this.targetName = "";
+
+ Link.symbolsDir = Link.symbolsDir || '';
+ Link.base = Link.base || '';
+ Link.ext= Link.ext || '';
+ Link.srcDir= Link.srcDir || '';
+
+
+}
+
+
+
+Roo.apply(Link.prototype, {
+
+ alias : "",
+ src : "",
+ file : "",
+ text : "",
+ innerName : "",
+ classLink : false,
+ targetName : "",
+
+
+
+ toString : function() {
+ var linkString;
+ var thisLink = this;
+
+ if (this.none) {
+ return 'none';
+ }
+ if (this.alias) {
+
+ if (typeof(this.builtins[this.alias]) != 'undefined') {
+ this.text = this.alias;
+ return thisLink._makeExternLink(this.builtins[this.alias]);
+ }
+
+
+ return thisLink._makeSymbolLink(this.alias);
+
+ /*
+
+ linkString = this.alias.replace(/(^|[^a-z$0-9_#.:-])([|a-z$0-9_#.:-]+)($|[^a-z$0-9_#.:-])/i,
+ function(match, prematch, symbolName, postmatch) {
+ var symbolNames = symbolName.split("|");
+ var links = [];
+ for (var i = 0, l = symbolNames.length; i < l; i++) {
+ thisLink.alias = symbolNames[i];
+ links.push(thisLink._makeSymbolLink(symbolNames[i]));
+ }
+ return prematch+links.join("|")+postmatch;
+ }
+ );
+ */
+ }
+ else if (this.extern) {
+ linkString = thisLink._makeExternLink(this.extern);
+ }
+ else if (this.src) {
+ linkString = thisLink._makeSrcLink(this.src);
+ }
+ else if (this.file) {
+ linkString = thisLink._makeFileLink(this.file);
+ }
+
+ return linkString;
+ },
+
+ builtins : {
+ 'Object' : 'https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Object',
+ //'Object...' : 'http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object',
+ 'Array' : 'https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Array',
+ 'Function' : 'https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Function',
+ 'String' : 'https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/String',
+ 'Number' : 'https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Number',
+ 'Boolean' : 'https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Objects/Boolean',
+ 'HTMLElement' : 'http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-58190037'
+ },
+
+
+ toGnome: function(alias)
+ {
+ this.file = "#";
+ var pr = alias.split('.');
+ var aa = alias;
+ var site = 'library.gnome.org';
+ var extra = '';
+ switch(pr[0]) {
+ case 'GIRepository':
+ this.extern = 'http://live.gnome.org/GObjectIntrospection';
+ aa = pr[0];
+ break;
+ case 'Gio':
+ case 'GLib':
+ case 'GObject':
+ aa = pr.length > 1 ? 'G' + pr[1] : pr[0];
+ break;
+ case 'GdkPixbuf':
+ aa = pr.length > 1 ? 'Gdk' + pr[1] : pr[0];
+ break;
+ case 'GtkSource':
+ aa = pr.length > 1 ? pr[0] + pr[1] : 'GtkSourceView';
+ break;
+
+ case 'Gst':
+ aa = pr.length > 1 ? pr[0] + pr[1] : 'GStreamer';
+ break;
+
+ case 'Pango':
+ extra = ' GTK-Doc';
+ break;
+ case 'GstController':
+ case 'GstApp':
+ case 'GstAudio':
+ case 'GstBase':
+ case 'GstCheck':
+ case 'GstFft':
+ case 'GstInterfaces':
+ case 'GstNet':
+ case 'GstNetbuffer':
+ case 'GstPbutils':
+ case 'GstRiff':
+ case 'GstRtp':
+ case 'GstRtsp':
+ case 'GstSdp':
+ case 'GstTag':
+ case 'GstVideo':
+
+ aa = pr.length > 1 ? 'Gst' + pr[1] : pr[0];
+ break;
+
+ case 'Epiphany':
+ aa = pr.length > 1 ? pr[1] : pr[0];
+ break;
+ case 'WebKit':
+ site = 'webkitgtk.org';
+
+ default:
+
+ aa = alias.replace('.', '');
+
+ break;
+
+ }
+ if (!this.extern) {
+ this.extern = 'http://www.google.com/search?hl=en&' +
+ 'q=site%3A' + site + '+' + aa + extra +
+ '&btnI=I%27m+Feeling+Lucky&meta=&aq=f&oq=';
+ }
+
+ this.text = aa;
+ return this;
+ },
+
+ target : function(targetName) {
+ if (typeof(targetName) != 'undefined') this.targetName = targetName;
+ return this;
+ },
+ inner : function(inner) {
+ if (typeof(inner) != 'undefined') this.innerName = inner;
+ return this;
+ },
+ withText: function(text) {
+ if (typeof(text) != 'undefined') this.text = text;
+ return this;
+ },
+ toSrc :function(filename) {
+ if (typeof(filename) != 'undefined') this.src = filename;
+ return this;
+ },
+
+ toSymbolLong : function(alias)
+ {
+ this.show_full = true;
+ return this.toSymbol(alias)
+ },
+ toSymbol : function(alias) {
+
+
+ switch(alias) {
+ case 'boolean' : this.alias = 'Boolean'; return this;
+ case 'int' : this.alias = 'Number'; return this;
+ case 'uint' : this.alias = 'Number'; return this;
+
+ case 'long' : this.alias = 'Number'; return this;
+ case 'ulong' : this.alias = 'Number'; return this;
+
+
+ case 'uint8' : this.alias = 'Number'; return this;
+ case 'int8' : this.alias = 'Number'; return this;
+
+ case 'uint16' : this.alias = 'Number'; return this;
+ case 'uint16' : this.alias = 'Number'; return this;
+
+ case 'int32' : this.alias = 'Number'; return this;
+ case 'uint32' : this.alias = 'Number'; return this;
+
+ case 'uint64' : this.alias = 'Number'; return this;
+ case 'int64' : this.alias = 'Number'; return this;
+
+
+ case 'GType' : this.alias = 'Number'; return this;
+ case 'size' : this.alias = 'Number'; return this;
+ case 'ssize' : this.alias = 'Number'; return this;
+
+ case 'float' : this.alias = 'Number'; return this;
+ case 'double' : this.alias = 'Number'; return this;
+ case 'time_t' : this.alias = 'Number'; return this;
+ // fixme - should find out more details..
+ case 'array' : this.alias = 'Array'; return this;
+ case 'gslist' : this.alias = 'Array'; return this;
+ case 'glist' : this.alias = 'Array'; return this; // homefully.
+ case 'ghash' : this.alias = 'Object'; return this; // homefully.
+
+
+ case 'error' : this.alias = 'Object'; return this; // homefully.
+ case 'filename' : this.alias = 'String'; return this; // hopefully..
+ case 'utf8' : this.alias = 'String'; return this;
+
+ case 'void' : this.none = true; return this;
+
+
+ }
+
+
+ if (typeof(alias) != 'undefined') {
+ this.alias = new String(alias);
+ }
+ return this;
+ },
+ toClass : function(alias) {
+ this.classLink = true;
+ return this.toSymbol(alias);
+ },
+ toFile : function(file) {
+ if (typeof(file) != 'undefined') this.file = file;
+ return this;
+ },
+
+
+
+
+ /** prefixed for hashes */
+
+
+ /** Appended to the front of relative link paths. */
+
+
+ symbolNameToLinkName : function(symbol) {
+ var linker = "";
+ if (symbol.isStatic) linker = ".";
+ else if (symbol.isInner) linker = "-";
+
+ return linker+symbol.name;
+ },
+
+
+
+
+ /** Create a link to a snother symbol. */
+ _makeSymbolLink : function(alias)
+ {
+ var target = '';
+ var txt = this.show_full ? alias : alias.split('.').pop();
+ return "<a href=\"./"+alias+".shtml\""+target+" roo:cls=\""+alias+"\">"+txt+"</a>";
+
+ /*
+ // look for '/' in alias..
+ if (/\//.test(alias)) {
+ var bits = alias.split('/');
+ var ret = "";
+ for(var i=0; i < bits.length; i++) {
+ if (i > 0) {
+ ret +="/";
+ }
+ ret += this._makeSymbolLink(bits[i]);
+ }
+ return ret;
+
+ }
+
+
+ */
+
+ var linkBase = Link.base + Link.symbolsDir;
+ //var linkTo = Link.symbolSet.getSymbol(alias);
+ linkTo = "FIXME";
+ var linkPath;
+ var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
+
+ // is it an internal link?
+ if (alias.charAt(0) == "#") {
+ linkPath = alias;
+ fullLinkPath = alias;
+
+ // if there is no symbol by that name just return the name unaltered
+ } else if (!linkTo) {
+
+ if (typeof(this.builtins[alias]) != 'undefined') {
+ return "<a href=\""+ this.builtins[alias]+"\""+target+">"+alias+"</a>";
+ }
+
+ return this.text || alias;
+
+
+ // it's a symbol in another file
+ } else {
+
+ if (!linkTo.isConstructor && !linkTo.isNamespace) { // it's a method or property
+ linkPath = escape(linkTo.memberOf) || "_global_";
+ linkPath += Link.ext + "#" + this.symbolNameToLinkName(linkTo);
+ }
+ else {
+ linkPath = escape(linkTo.alias);
+ linkPath += Link.ext + (this.classLink? "":"#" + "constructor");
+ }
+ //linkPath = linkBase + linkPath;
+ fullLinkPath = linkBase + linkPath;
+ }
+
+ var linkText = this.text || alias;
+
+ var link = {linkPath: linkPath, linkText: linkText, fullLinkPath: fullLinkPath};
+
+ if (typeof PluginManager != "undefined") {
+ JSDOC.PluginManager.run("onSymbolLink", link);
+ }
+
+ return "<a href=\""+link.fullLinkPath+"\""+target+" roo:cls=\""+link.linkPath+"\">"+link.linkText+"</a>";
+ },
+
+
+ /** Create a link to a source file. */
+ _makeSrcLink : function(srcFilePath) {
+ var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
+
+ // transform filepath into a filename
+ var srcFile = srcFilePath.replace(/\.\.?[\\\/]/g, "").replace(/[:\\\/]/g, "."); // was _
+ var lsrcFile = srcFilePath.replace(/\.\.?[\\\/]/g, "").replace(/[:\\\/]/g, ".");
+ var outFilePath = Link.base + Link.srcDir + srcFile.replace(/.js$/, '') + Link.ext;
+
+ if (!this.text) this.text = FilePath.fileName(srcFilePath);
+ return "<a href=\""+outFilePath+"\""+target+" roo:cls=\"src/"+lsrcFile+"\">"+this.text+"</a>";
+ },
+
+ /** Create a link to a source file. */
+ _makeFileLink : function(filePath) {
+ var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
+
+ var outFilePath = Link.base + filePath;
+
+ if (!this.text) this.text = filePath;
+ return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
+ },
+
+ /** Create a link to a source file. */
+ _makeExternLink : function(filePath) {
+ var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
+
+ if (!this.text) this.text = filePath;
+ return "<a href=\""+filePath+"\""+target+">"+this.text+"</a>";
+ }
+
+});
\ No newline at end of file
--- /dev/null
+//<script type="text/javscript">
+
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+
+
+
+/**
+ @constructor
+*/
+TextStream = function(text) {
+ if (typeof(text) == "undefined") text = "";
+ text = ""+text;
+ this.text = text;
+ this.cursor = 0;
+}
+
+Roo.apply( TextStream.prototype, {
+
+ look : function(n) {
+ if (typeof n == "undefined") n = 0;
+
+ if (this.cursor+n < 0 || this.cursor+n >= this.text.length) {
+ var result = new String("");
+ result.eof = true;
+ return result;
+ }
+ return this.text.charAt(this.cursor+n);
+ },
+
+ next : function(n) {
+ if (typeof n == "undefined") n = 1;
+ if (n < 1) return null;
+
+ var pulled = "";
+ for (var i = 0; i < n; i++) {
+ if (this.cursor+i < this.text.length) {
+ pulled += this.text.charAt(this.cursor+i);
+ }
+ else {
+ var result = new String("");
+ result.eof = true;
+ return result;
+ }
+ }
+
+ this.cursor += n;
+ return pulled;
+ }
+});
\ No newline at end of file
--- /dev/null
+//<Script type="text/javascript">
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+console = imports['console.js'].console;
+/**
+ @constructor
+*/
+Token = function(data, type, name) {
+ this.data = data;
+ this.type = type;
+ this.name = name;
+ this.prefix = '';
+}
+
+//JSDOC.Token.prototype.toString = function() {
+// return "<"+this.type+" name=\""+this.name+"\">"+this.data+"</"+this.type+">";
+//}
+Roo.apply( Token.prototype, {
+
+ toRaw : function(lvl)
+ {
+ lvl = lvl || 0;
+
+ var ret = this.data ;
+ if (this.items) {
+ var ar = [];
+ Roo.each(this.items, function(ai) {
+
+ var str = '';
+ Roo.each(ai, function(it) {
+ str += it.toRaw(lvl + 1);
+ })
+ ar.push(str);
+
+ })
+ ret += ar.join('');
+
+ }
+ if (this.props) {
+ for (var i in this.props) {
+ ret += this.props[i].key.toRaw(lvl+1) + ' : ';
+ Roo.each(this.props[i].val, function(e) {
+ ret+=e.toRaw(lvl+1);
+ })
+
+ }
+ }
+
+
+
+ return this.prefix + ret;
+
+ },
+
+ toJS : function() {
+
+ try {
+ var _tmp = '';
+ eval( "_tmp = " + this.data);
+ return _tmp;
+ } catch( e) {
+ return "ERROR unparsable" + this.data;
+ }
+ },
+
+
+
+ is : function(what) {
+ return this.name === what || this.type === what;
+ }
+});
+
\ No newline at end of file
--- /dev/null
+//<script type="text/javascript">
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+console = imports['console.js'].console;
+
+
+
+Token = imports['JSDOC/Token.js'].Token;
+Lang = imports['JSDOC/Token.js'].Lang;
+
+/**
+ @class Search a {@link JSDOC.TextStream} for language tokens.
+*/
+TokenReader = function(o) {
+
+ this.keepDocs = true;
+ this.keepWhite = false;
+ this.keepComments = false;
+ Roo.apply(this, o || {});
+
+}
+
+
+Roo.apply(TokenReader.prototype, {
+
+
+ /**
+ @type {JSDOC.Token[]}
+ */
+
+
+ tokenize : function(/**JSDOC.TextStream*/stream) {
+ var tokens = [];
+ /**@ignore*/ tokens.last = function() { return tokens[tokens.length-1]; }
+ /**@ignore*/ tokens.lastSym = function() {
+ for (var i = tokens.length-1; i >= 0; i--) {
+ if (!(tokens[i].is("WHIT") || tokens[i].is("COMM"))) return tokens[i];
+ }
+ }
+
+ while (!stream.look().eof) {
+ if (this.read_mlcomment(stream, tokens)) continue;
+ if (this.read_slcomment(stream, tokens)) continue;
+ if (this.read_dbquote(stream, tokens)) continue;
+ if (this.read_snquote(stream, tokens)) continue;
+ if (this.read_regx(stream, tokens)) continue;
+ if (this.read_numb(stream, tokens)) continue;
+ if (this.read_punc(stream, tokens)) continue;
+ if (this.read_newline(stream, tokens)) continue;
+ if (this.read_space(stream, tokens)) continue;
+ if (this.read_word(stream, tokens)) continue;
+
+ // if execution reaches here then an error has happened
+ tokens.push(new Token(stream.next(), "TOKN", "UNKNOWN_TOKEN"));
+ }
+
+
+
+ return tokens;
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_word : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found = "";
+ while (!stream.look().eof && Lang.isWordChar(stream.look())) {
+ found += stream.next();
+ }
+
+ if (found === "") {
+ return false;
+ }
+ else {
+ var name;
+ if ((name = Lang.keyword(found))) tokens.push(new Token(found, "KEYW", name));
+ else tokens.push(new Token(found, "NAME", "NAME"));
+ return true;
+ }
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_punc : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found = "";
+ var name;
+ while (!stream.look().eof && Lang.punc(found+stream.look())) {
+ found += stream.next();
+ }
+
+ if (found === "") {
+ return false;
+ }
+ else {
+ tokens.push(new Token(found, "PUNC", Lang.punc(found)));
+ return true;
+ }
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_space : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found = "";
+
+ while (!stream.look().eof && Lang.isSpace(stream.look())) {
+ found += stream.next();
+ }
+
+ if (found === "") {
+ return false;
+ }
+ else {
+ if (this.collapseWhite) found = " ";
+ if (this.keepWhite) tokens.push(new Token(found, "WHIT", "SPACE"));
+ return true;
+ }
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_newline : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found = "";
+
+ while (!stream.look().eof && Lang.isNewline(stream.look())) {
+ found += stream.next();
+ }
+
+ if (found === "") {
+ return false;
+ }
+ else {
+ if (this.collapseWhite) found = "\n";
+ if (this.keepWhite) tokens.push(new Token(found, "WHIT", "NEWLINE"));
+ return true;
+ }
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_mlcomment : function(/**JSDOC.TokenStream*/stream, tokens) {
+ if (stream.look() == "/" && stream.look(1) == "*") {
+ var found = stream.next(2);
+
+ while (!stream.look().eof && !(stream.look(-1) == "/" && stream.look(-2) == "*")) {
+ found += stream.next();
+ }
+
+ // to start doclet we allow /** or /*** but not /**/ or /****
+ if (/^\/\*\*([^\/]|\*[^*])/.test(found) && this.keepDocs) tokens.push(new Token(found, "COMM", "JSDOC"));
+ else if (this.keepComments) tokens.push(new Token(found, "COMM", "MULTI_LINE_COMM"));
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_slcomment : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found;
+ if (
+ (stream.look() == "/" && stream.look(1) == "/" && (found=stream.next(2)))
+ ||
+ (stream.look() == "<" && stream.look(1) == "!" && stream.look(2) == "-" && stream.look(3) == "-" && (found=stream.next(4)))
+ ) {
+
+ while (!stream.look().eof && !Lang.isNewline(stream.look())) {
+ found += stream.next();
+ }
+
+ if (this.keepComments) {
+ tokens.push(new Token(found, "COMM", "SINGLE_LINE_COMM"));
+ }
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_dbquote : function(/**JSDOC.TokenStream*/stream, tokens) {
+ if (stream.look() == "\"") {
+ // find terminator
+ var string = stream.next();
+
+ while (!stream.look().eof) {
+ if (stream.look() == "\\") {
+ if (Lang.isNewline(stream.look(1))) {
+ do {
+ stream.next();
+ } while (!stream.look().eof && Lang.isNewline(stream.look()));
+ string += "\\\n";
+ }
+ else {
+ string += stream.next(2);
+ }
+ }
+ else if (stream.look() == "\"") {
+ string += stream.next();
+ tokens.push(new Token(string, "STRN", "DOUBLE_QUOTE"));
+ return true;
+ }
+ else {
+ string += stream.next();
+ }
+ }
+ }
+ return false; // error! unterminated string
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_snquote : function(/**JSDOC.TokenStream*/stream, tokens) {
+ if (stream.look() == "'") {
+ // find terminator
+ var string = stream.next();
+
+ while (!stream.look().eof) {
+ if (stream.look() == "\\") { // escape sequence
+ string += stream.next(2);
+ }
+ else if (stream.look() == "'") {
+ string += stream.next();
+ tokens.push(new Token(string, "STRN", "SINGLE_QUOTE"));
+ return true;
+ }
+ else {
+ string += stream.next();
+ }
+ }
+ }
+ return false; // error! unterminated string
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_numb : function(/**JSDOC.TokenStream*/stream, tokens) {
+ if (stream.look() === "0" && stream.look(1) == "x") {
+ return this.read_hex(stream, tokens);
+ }
+
+ var found = "";
+
+ while (!stream.look().eof && Lang.isNumber(found+stream.look())){
+ found += stream.next();
+ }
+
+ if (found === "") {
+ return false;
+ }
+ else {
+ if (/^0[0-7]/.test(found)) tokens.push(new Token(found, "NUMB", "OCTAL"));
+ else tokens.push(new Token(found, "NUMB", "DECIMAL"));
+ return true;
+ }
+ },
+ /*t:
+ requires("../lib/JSDOC/TextStream.js");
+ requires("../lib/JSDOC/Token.js");
+ requires("../lib/JSDOC/Lang.js");
+
+ plan(3, "testing read_numb");
+
+ //// setup
+ var src = "function foo(num){while (num+8.0 >= 0x20 && num < 0777){}}";
+ var tr = new TokenReader();
+ var tokens = tr.tokenize(new TextStream(src));
+
+ var hexToken, octToken, decToken;
+ for (var i = 0; i < tokens.length; i++) {
+ if (tokens[i].name == "HEX_DEC") hexToken = tokens[i];
+ if (tokens[i].name == "OCTAL") octToken = tokens[i];
+ if (tokens[i].name == "DECIMAL") decToken = tokens[i];
+ }
+ ////
+
+ is(decToken.data, "8.0", "decimal number is found in source.");
+ is(hexToken.data, "0x20", "hexdec number is found in source (issue #99).");
+ is(octToken.data, "0777", "octal number is found in source.");
+ */
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_hex : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var found = stream.next(2);
+
+ while (!stream.look().eof) {
+ if (Lang.isHexDec(found) && !Lang.isHexDec(found+stream.look())) { // done
+ tokens.push(new Token(found, "NUMB", "HEX_DEC"));
+ return true;
+ }
+ else {
+ found += stream.next();
+ }
+ }
+ return false;
+ },
+
+ /**
+ @returns {Boolean} Was the token found?
+ */
+ read_regx : function(/**JSDOC.TokenStream*/stream, tokens) {
+ var last;
+ if (
+ stream.look() == "/"
+ &&
+ (
+
+ (
+ !(last = tokens.lastSym()) // there is no last, the regex is the first symbol
+ ||
+ (
+ !last.is("NUMB")
+ && !last.is("NAME")
+ && !last.is("RIGHT_PAREN")
+ && !last.is("RIGHT_BRACKET")
+ )
+ )
+ )
+ ) {
+ var regex = stream.next();
+
+ while (!stream.look().eof) {
+ if (stream.look() == "\\") { // escape sequence
+ regex += stream.next(2);
+ }
+ else if (stream.look() == "/") {
+ regex += stream.next();
+
+ while (/[gmi]/.test(stream.look())) {
+ regex += stream.next();
+ }
+
+ tokens.push(new Token(regex, "REGX", "REGX"));
+ return true;
+ }
+ else {
+ regex += stream.next();
+ }
+ }
+ // error: unterminated regex
+ }
+ return false;
+ }
+});
\ No newline at end of file
--- /dev/null
+//<script type="text/javscript">
+JSDOC = imports['JSDOC.js'].JSDOC;
+Roo = imports['Roo.js'].Roo;
+console = imports['console.js'].console;
+
+Token = imports['JSDOC/Token.js'].Token;
+Lang = imports['JSDOC/Lang.js'].Lang;
+
+/**
+ @constructor
+*/
+
+TokenStream = function(tokens) {
+
+
+ this.tokens = (tokens || []);
+ // Seed.print(this.tokens.length);
+ this.rewind();
+}
+
+
+Roo.apply( TokenStream.prototype , {
+
+ rewind : function() {
+ this.cursor = -1;
+ },
+
+ /**
+ @type JSDOC.Token
+ */
+ look : function(/**Number*/n, /**Boolean*/considerWhitespace) {
+ if (typeof n == "undefined") n = 0;
+
+ if (considerWhitespace == true) {
+ if (this.cursor+n < 0 || this.cursor+n > this.tokens.length) return {};
+ return this.tokens[this.cursor+n];
+ }
+ else {
+ var count = 0;
+ var i = this.cursor;
+
+ while (true) {
+ if (i < 0) return new Token("", "VOID", "START_OF_STREAM");
+ else if (i > this.tokens.length) return new Token("", "VOID", "END_OF_STREAM");
+
+ if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT"))) {
+ if (n < 0) i--; else i++;
+ continue;
+ }
+
+ if (count == Math.abs(n)) {
+ return this.tokens[i];
+ }
+ count++;
+ (n < 0)? i-- : i++;
+ }
+
+ return new Token("", "VOID", "STREAM_ERROR"); // because null isn't an object and caller always expects an object
+ }
+ },
+
+ lookFor : function (data)
+ {
+ // non tree version..
+ var i = this.cursor < 0 ? 0 : this.cursor ;
+
+ while (true) {
+ if (i >= this.tokens.length) return -1;
+ if (this.tokens[i].data == data) {
+ return i;
+ }
+ i++;
+
+ }
+ // should not get here!
+ return -1;
+
+ },
+
+
+ /**
+ * look ahead (or back) x number of tokens (which are not comment or whitespace)
+ * ?? used any more?
+ */
+ lookTok : function(/**Number*/n) {
+ if (typeof n == "undefined") n = 1;
+
+
+ var count = 0;
+ var i = this.cursor;
+
+ while (true) {
+ if (i < 0) return false;
+ else if (i > this.tokens.length) return false;
+
+ if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT") || this.tokens[i].is("COMM"))) {
+ if (n < 0) i--; else i++;
+ continue;
+ }
+
+ if (count == Math.abs(n)) {
+ return this.tokens[i];
+ }
+ count++;
+ (n < 0)? i-- : i++;
+ }
+
+ return false; // because null isn't an object and caller always expects an object;
+
+ },
+
+ /**
+ @type JSDOC.Token|JSDOC.Token[]| null!
+ */
+ next : function(/**Number*/howMany) {
+ if (typeof howMany == "undefined") howMany = 1;
+ if (howMany < 1) return null;
+ var got = [];
+
+ for (var i = 1; i <= howMany; i++) {
+ if (this.cursor+i >= this.tokens.length) {
+ return null;
+ }
+ got.push(this.tokens[this.cursor+i]);
+ }
+ this.cursor += howMany;
+
+ if (howMany == 1) {
+ return got[0];
+ }
+ else return got;
+ },
+ // what about comments after 'function'...
+ // is this used ???
+
+ nextNonSpace : function ()
+ {
+
+ while (true) {
+ tok = this.next(1);
+ if (!tok) {
+ return false;
+ }
+ if (tok.is('WHIT') || tok.is('COMM')) {
+ continue;
+ }
+ return tok;
+ }
+ },
+ /**
+ @type JSDOC.Token[]
+ */
+ balance : function(/**String*/start, /**String*/stop) {
+ if (!stop) stop = Lang.matching(start);
+
+ var depth = 0;
+ var got = [];
+ var started = false;
+ //Seed.print("STOP:" + stop);
+ while ((token = this.look())) {
+ if (token.is(start)) {
+ depth++;
+ started = true;
+ }
+
+ if (started) {
+ got.push(token);
+ }
+
+ if (token.is(stop)) {
+ depth--;
+ if (depth == 0) return got;
+ }
+ if (!this.next()) break;
+ }
+ },
+
+ getMatchingToken : function(/**String*/start, /**String*/stop) {
+ var depth = 0;
+ var cursor = this.cursor;
+
+ if (!start) {
+ start = Lang.matching(stop);
+ depth = 1;
+ }
+ if (!stop) stop = Lang.matching(start);
+
+ while ((token = this.tokens[cursor])) {
+ if (token.is(start)) {
+ depth++;
+ }
+
+ if (token.is(stop) && cursor) {
+ depth--;
+ if (depth == 0) return this.tokens[cursor];
+ }
+ cursor++;
+ }
+ },
+
+ insertAhead : function(/**JSDOC.Token*/token) {
+ this.tokens.splice(this.cursor+1, 0, token);
+ },
+
+ remaining : function() {
+ var ret = [];
+ while (true) {
+ var tok = this.look(1,true);
+ if (!tok || !tok.is || tok.is('VOID')) {
+ return ret;
+ }
+ ret.push(this.next(1));
+ }
+ },
+
+
+ arrayToString : function(ar) {
+ console.log(typeof(ar));
+ var ret = [];
+ Roo.each(ar, function(e) {
+ ret.push(e.data);
+ })
+ return ret.join('');
+ }
+});
+
\ No newline at end of file
--- /dev/null
+
+
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+
+/**
+ * @class Roo
+ * Roo core utilities and functions.
+ * @singleton
+ */
+//Roo = imports['Roo.js'];
+//xnew = imports['xnew.js'];
+Roo = { };
+
+/**
+ * Copies all the properties of config to obj.
+ * @param {Object} obj The receiver of the properties
+ * @param {Object} config The source of the properties
+ * @param {Object} defaults A different object that will also be applied for default values
+ * @return {Object} returns obj
+ * @member Roo apply
+ */
+
+Roo.apply = function(o, c, defaults){
+ if(defaults){
+ // no "this" reference for friendly out of scope calls
+ Roo.apply(o, defaults);
+ }
+ if(o && c && typeof c == 'object'){
+ for(var p in c){
+ o[p] = c[p];
+ }
+ }
+ return o;
+};
+
+
+(function(){
+
+ var idSeed = 0;
+
+ Roo.apply(Roo, {
+
+ /**
+ * Generates unique ids. If the element already has an id, it is unchanged
+ * @param {String/HTMLElement/Element} el (optional) The element to generate an id for
+ * @param {String} prefix (optional) Id prefix (defaults "Roo-gen")
+ * @return {String} The generated Id.
+ */
+ id : function(el, prefix){
+ prefix = prefix || "roo-gen";
+ //el = Roo.getDom(el);
+ var id = prefix + (++idSeed);
+ return id;
+ //return el ? (el.id ? el.id : (el.id = id)) : id;
+ },
+ /**
+ * Extends one class with another class and optionally overrides members with the passed literal. This class
+ * also adds the function "override()" to the class that can be used to override
+ * members on an instance.
+ * @param {Object} subclass The class inheriting the functionality
+ * @param {Object} superclass The class being extended
+ * @param {Object} overrides (optional) A literal with members
+ * @method extend
+ */
+ extend : function(){
+ // inline overrides
+ var io = function(o){
+ for(var m in o){
+ this[m] = o[m];
+ }
+ };
+ return function(sb, sp, overrides) {
+ if (typeof(sp) == 'undefined') {
+ // error condition - try and dump..
+ imports['console.js'].console.dump(sb);
+ }
+
+ if(typeof sp == 'object'){ // eg. prototype, rather than function constructor..
+ overrides = sp;
+ sp = sb;
+ sb = function(){sp.apply(this, arguments);};
+ }
+ var F = function(){}, sbp, spp = sp.prototype;
+ F.prototype = spp;
+ sbp = sb.prototype = new F();
+ sbp.constructor=sb;
+ sb.superclass=spp;
+
+ if(spp.constructor == Object.prototype.constructor){
+ spp.constructor=sp;
+
+ }
+
+ sb.override = function(o){
+ Roo.override(sb, o);
+ };
+ sbp.override = io;
+ Roo.override(sb, overrides);
+ return sb;
+ };
+ }(),
+ /**
+ * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.
+ * Usage:<pre><code>
+Roo.override(MyClass, {
+ newMethod1: function(){
+ // etc.
+ },
+ newMethod2: function(foo){
+ // etc.
+ }
+});
+ </code></pre>
+ * @param {Object} origclass The class to override
+ * @param {Object} overrides The list of functions to add to origClass. This should be specified as an object literal
+ * containing one or more methods.
+ * @method override
+ */
+ override : function(origclass, overrides){
+ if(overrides){
+ var p = origclass.prototype;
+ for(var method in overrides){
+ p[method] = overrides[method];
+ }
+ }
+ },
+
+
+ /**
+ * Iterates an array calling the passed function with each item, stopping if your function returns false. If the
+ * passed array is not really an array, your function is called once with it.
+ * The supplied function is called with (Object item, Number index, Array allItems).
+ * @param {Array/NodeList/Mixed} array
+ * @param {Function} fn
+ * @param {Object} scope
+ */
+ each : function(array, fn, scope){
+ if(typeof array.length == "undefined" || typeof array == "string"){
+ array = [array];
+ }
+ for(var i = 0, len = array.length; i < len; i++){
+ if(fn.call(scope || array[i], array[i], i, array) === false){ return i; };
+ }
+ },
+
+ /**
+ * Copies all the properties of config to obj if they don't already exist.
+ * @param {Object} obj The receiver of the properties
+ * @param {Object} config The source of the properties
+ * @return {Object} returns obj
+ */
+ applyIf : function(o, c){
+ if(o && c){
+ for(var p in c){
+ if(typeof o[p] == "undefined"){ o[p] = c[p]; }
+ }
+ }
+ return o;
+ },
+
+
+ })
+
+ imports['xnew.js'].xnew.load( Roo, 'Roo' );
+})();
+
+
+
+
+
\ No newline at end of file
--- /dev/null
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+Roo = imports['Roo.js'].Roo;
+/**
+ * @class Roo.Observable
+ * Base class that provides a common interface for publishing events. Subclasses are expected to
+ * to have a property "events" with all the events defined.<br>
+ * For example:
+ * <pre><code>
+ Employee = function(name){
+ this.name = name;
+ this.addEvents({
+ "fired" : true,
+ "quit" : true
+ });
+ }
+ Roo.extend(Employee, Roo.Observable);
+</code></pre>
+ * @param {Object} config properties to use (incuding events / listeners)
+ */
+
+
+Observable = function(cfg){
+
+ cfg = cfg|| {};
+ this.addEvents(cfg.events || {});
+ if (cfg.events) {
+ delete cfg.events; // make sure
+ }
+
+ Roo.apply(this, cfg);
+
+ if(this.listeners){
+ this.on(this.listeners);
+ delete this.listeners;
+ }
+};
+Observable.prototype = {
+ /**
+ * @cfg {Object} listeners list of events and functions to call for this object,
+ * For example :
+ * <pre><code>
+ listeners : {
+ 'click' : function(e) {
+ .....
+ } ,
+ ....
+ }
+ </code></pre>
+ */
+
+
+ /**
+ * Fires the specified event with the passed parameters (minus the event name).
+ * @param {String} eventName
+ * @param {Object...} args Variable number of parameters are passed to handlers
+ * @return {Boolean} returns false if any of the handlers return false otherwise it returns true
+ */
+ fireEvent : function(){
+ var ce = this.events[arguments[0].toLowerCase()];
+ if(typeof ce == "object"){
+ return ce.fire.apply(ce, Array.prototype.slice.call(arguments, 1));
+ }else{
+ return true;
+ }
+ },
+
+ // private
+ filterOptRe : /^(?:scope|delay|buffer|single)$/,
+
+ /**
+ * Appends an event handler to this component
+ * @param {String} eventName The type of event to listen for
+ * @param {Function} handler The method the event invokes
+ * @param {Object} scope (optional) The scope in which to execute the handler
+ * function. The handler function's "this" context.
+ * @param {Object} options (optional) An object containing handler configuration
+ * properties. This may contain any of the following properties:<ul>
+ * <li>scope {Object} The scope in which to execute the handler function. The handler function's "this" context.</li>
+ * <li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li>
+ * <li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li>
+ * <li>buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.DelayedTask} delayed
+ * by the specified number of milliseconds. If the event fires again within that time, the original
+ * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>
+ * </ul><br>
+ * <p>
+ * <b>Combining Options</b><br>
+ * Using the options argument, it is possible to combine different types of listeners:<br>
+ * <br>
+ * A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
+ <pre><code>
+ el.on('click', this.onClick, this, {
+ single: true,
+ delay: 100,
+ forumId: 4
+ });
+ </code></pre>
+ * <p>
+ * <b>Attaching multiple handlers in 1 call</b><br>
+ * The method also allows for a single argument to be passed which is a config object containing properties
+ * which specify multiple handlers.
+ * <pre><code>
+ el.on({
+ 'click': {
+ fn: this.onClick,
+ scope: this,
+ delay: 100
+ },
+ 'mouseover': {
+ fn: this.onMouseOver,
+ scope: this
+ },
+ 'mouseout': {
+ fn: this.onMouseOut,
+ scope: this
+ }
+ });
+ </code></pre>
+ * <p>
+ * Or a shorthand syntax which passes the same scope object to all handlers:
+ <pre><code>
+ el.on({
+ 'click': this.onClick,
+ 'mouseover': this.onMouseOver,
+ 'mouseout': this.onMouseOut,
+ scope: this
+ });
+ </code></pre>
+ */
+ on : function(eventName, fn, scope, o){
+ if(typeof eventName == "object"){
+ o = eventName;
+ for(var e in o){
+ if(this.filterOptRe.test(e)){
+ continue;
+ }
+ if(typeof o[e] == "function"){
+ // shared options
+ this.on(e, o[e], o.scope, o);
+ }else{
+ // individual options
+ this.on(e, o[e].fn, o[e].scope, o[e]);
+ }
+ }
+ return;
+ }
+ o = (!o || typeof o == "boolean") ? {} : o;
+ eventName = eventName.toLowerCase();
+ var ce = this.events[eventName] || true;
+ if(typeof ce == "boolean"){
+ ce = new Roo.Event(this, eventName);
+ this.events[eventName] = ce;
+ }
+ ce.addListener(fn, scope, o);
+ },
+
+ /**
+ * Removes a listener
+ * @param {String} eventName The type of event to listen for
+ * @param {Function} handler The handler to remove
+ * @param {Object} scope (optional) The scope (this object) for the handler
+ */
+ un : function(eventName, fn, scope){
+ var ce = this.events[eventName.toLowerCase()];
+ if(typeof ce == "object"){
+ ce.removeListener(fn, scope);
+ }
+ },
+
+ /**
+ * Removes all listeners for this object
+ */
+ purgeListeners : function(){
+ for(var evt in this.events){
+ if(typeof this.events[evt] == "object"){
+ this.events[evt].clearListeners();
+ }
+ }
+ },
+
+ relayEvents : function(o, events){
+ var createHandler = function(ename){
+ return function(){
+ return this.fireEvent.apply(this, Roo.combine(ename, Array.prototype.slice.call(arguments, 0)));
+ };
+ };
+ for(var i = 0, len = events.length; i < len; i++){
+ var ename = events[i];
+ if(!this.events[ename]){ this.events[ename] = true; };
+ o.on(ename, createHandler(ename), this);
+ }
+ },
+
+ /**
+ * Used to define events on this Observable
+ * @param {Object} object The object with the events defined
+ */
+ addEvents : function(o){
+ if(!this.events){
+ this.events = {};
+ }
+ Roo.applyIf(this.events, o);
+ },
+
+ /**
+ * Checks to see if this object has any listeners for a specified event
+ * @param {String} eventName The name of the event to check for
+ * @return {Boolean} True if the event is being listened for, else false
+ */
+ hasListener : function(eventName){
+ var e = this.events[eventName];
+ return typeof e == "object" && e.listeners.length > 0;
+ }
+};
+
+/**
+ * Starts capture on the specified Observable. All events will be passed
+ * to the supplied function with the event name + standard signature of the event
+ * <b>before</b> the event is fired. If the supplied function returns false,
+ * the event will not fire.
+ * @param {Observable} o The Observable to capture
+ * @param {Function} fn The function to call
+ * @param {Object} scope (optional) The scope (this object) for the fn
+ * @static
+ */
+Observable.capture = function(o, fn, scope){
+ o.fireEvent = o.fireEvent.createInterceptor(fn, scope);
+};
+
+/**
+ * Removes <b>all</b> added captures from the Observable.
+ * @param {Observable} o The Observable to release
+ * @static
+ */
+Observable.releaseCapture = function(o){
+ o.fireEvent = Observable.prototype.fireEvent;
+};
+
+(function(){
+
+ var createBuffered = function(h, o, scope){
+ var task = new Roo.DelayedTask();
+ return function(){
+ task.delay(o.buffer, h, scope, Array.prototype.slice.call(arguments, 0));
+ };
+ };
+
+ var createSingle = function(h, e, fn, scope){
+ return function(){
+ e.removeListener(fn, scope);
+ return h.apply(scope, arguments);
+ };
+ };
+
+ var createDelayed = function(h, o, scope){
+ return function(){
+ var args = Array.prototype.slice.call(arguments, 0);
+ setTimeout(function(){
+ h.apply(scope, args);
+ }, o.delay || 10);
+ };
+ };
+
+ Roo.Event = function(obj, name){
+ this.name = name;
+ this.obj = obj;
+ this.listeners = [];
+ };
+
+ Roo.Event.prototype = {
+ addListener : function(fn, scope, options){
+ var o = options || {};
+ scope = scope || this.obj;
+ if(!this.isListening(fn, scope)){
+ var l = {fn: fn, scope: scope, options: o};
+ var h = fn;
+ if(o.delay){
+ h = createDelayed(h, o, scope);
+ }
+ if(o.single){
+ h = createSingle(h, this, fn, scope);
+ }
+ if(o.buffer){
+ h = createBuffered(h, o, scope);
+ }
+ l.fireFn = h;
+ if(!this.firing){ // if we are currently firing this event, don't disturb the listener loop
+ this.listeners.push(l);
+ }else{
+ this.listeners = this.listeners.slice(0);
+ this.listeners.push(l);
+ }
+ }
+ },
+
+ findListener : function(fn, scope){
+ scope = scope || this.obj;
+ var ls = this.listeners;
+ for(var i = 0, len = ls.length; i < len; i++){
+ var l = ls[i];
+ if(l.fn == fn && l.scope == scope){
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ isListening : function(fn, scope){
+ return this.findListener(fn, scope) != -1;
+ },
+
+ removeListener : function(fn, scope){
+ var index;
+ if((index = this.findListener(fn, scope)) != -1){
+ if(!this.firing){
+ this.listeners.splice(index, 1);
+ }else{
+ this.listeners = this.listeners.slice(0);
+ this.listeners.splice(index, 1);
+ }
+ return true;
+ }
+ return false;
+ },
+
+ clearListeners : function(){
+ this.listeners = [];
+ },
+
+ fire : function(){
+ var ls = this.listeners, scope, len = ls.length;
+ if(len > 0){
+ this.firing = true;
+ var args = Array.prototype.slice.call(arguments, 0);
+ for(var i = 0; i < len; i++){
+ var l = ls[i];
+ if(l.fireFn.apply(l.scope||this.obj||window, arguments) === false){
+ this.firing = false;
+ return false;
+ }
+ }
+ this.firing = false;
+ }
+ return true;
+ }
+ };
+})();
\ No newline at end of file
--- /dev/null
+//<Script type="text/javascript">
+
+
+var console = {
+ log : function (v) {
+ Seed.print(v);
+ },
+ dump : function (ar) {
+ Seed.print(this._dump(ar, 0));
+ },
+
+ _dump: function(arr,level) {
+ var dumped_text = "";
+ if(!level) level = 0;
+
+
+ //The padding given at the beginning of the line.
+ var level_padding = "";
+ for(var j=0;j<level+1;j++) level_padding += " ";
+
+ if(level > 15) return level_padding + "[ ... to deep ...]\n";
+
+ if(typeof(arr) == 'object') { //Array/Hashes/Objects
+
+
+ for(var item in arr) {
+ var value = arr[item];
+ switch (typeof(value)) {
+ case 'object' :
+ dumped_text += level_padding + "'" + item + "' ...\n";
+ dumped_text += this._dump(value,level+1) + "\n";
+ break;
+
+ case 'function' :
+ dumped_text += level_padding + "'" + item + "' => FUNCTION \n";
+ break;
+
+ default:
+ dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
+ break;
+ }
+ }
+ } else { //Stings/Chars/Numbers etc.
+ dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
+ }
+ return dumped_text;
+ }
+}
\ No newline at end of file
--- /dev/null
+//<Script type="text/javascript">
+
+Gtk = imports.gi.Gtk;
+Gio = imports.gi.Gio;
+Gdk = imports.gi.Gdk;
+
+imports['Array.js'];
+JSDOC = imports['JSDOC.js'].JSDOC;
+console = imports['console.js'].console;
+Roo = imports['Roo.js'].Roo;
+
+Introspect = imports['JSDOC/Introspect.js'].Introspect;
+
+
+
+//var outputdir = '/home2/www/devel/seed';
+var outputdir = '/var/www/seed';
+
+// list namespace..
+//var ns_list = [ 'GIRepository' ];
+
+var ns_list = JSDOC.Introspect.namespaces().sort();
+//console.dump(ns_list);
+ // ns_list = [ 'Gio' ];
+//ns_list = [ 'Gtk' ];
+ /* 'Gdk',
+ 'Gtk',
+ 'GLib',
+ 'Gio',
+ 'GObject',
+ 'GIRepository',
+ 'Gst',
+ 'Pango']
+*/
+var cls_list = [];
+
+var cls_template = new JSDOC.Template(__script_path__ + '/docs/class.html');
+var cls_ix_template = new JSDOC.Template(__script_path__ + '/docs/class_ix.tmpl');
+var reference_template = new JSDOC.Template(__script_path__ + '/docs/references.html');
+
+Roo.each(ns_list, function(ns_name) {
+ var core;
+ //if (ns_name == 'Epiphany') {
+ // return;
+ //}
+ if (ns_name == 'GnomeGamesSupport') { // on gnome dev cd stuff.
+ return;
+ }
+
+ //try {
+ core = imports.gi[ns_name];
+ //} catch (e) {
+ // Seed.print("SKIP (no import): "+ ns_name + ": " + e);
+
+ // return;
+ //}
+ Seed.print("START:" + ns_name);
+ // ones that cause problems.
+
+
+
+ // Namespace file..
+ var ns = Introspect.ns(ns_name);
+
+ Gio.simple_write(outputdir + '/'+ ns_name + '.shtml', cls_template.process(ns));
+ cls_list.push({
+ alias : ns_name
+ });
+
+ // left bar index of elements in namespace...
+ Gio.simple_write(outputdir + '/_ix_'+ ns_name + '.shtml', cls_ix_template.process(ns));
+
+ // index...
+
+
+ Roo.each(ns.objects, function(n) {
+
+
+ Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.shtml',
+ cls_template.process( Introspect.factory('Class', ns_name, n)));
+
+ Seed.print(ns_name + '.' +n);
+ });
+ Roo.each(ns.interfaces, function(n) {
+
+
+ Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.shtml',
+ cls_template.process( Introspect.factory('Interface', ns_name, n)));
+
+ Seed.print(ns_name + '.' +n);
+ });
+ Roo.each(ns.structs, function(n) {
+
+
+ Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.shtml',
+ cls_template.process( Introspect.factory('Struct', ns_name, n)));
+
+
+ Seed.print(ns_name + '.' +n);
+ });
+
+ Roo.each(ns.unions, function(n) {
+
+
+ Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.shtml',
+ cls_template.process( Introspect.factory('Union', ns_name, n)));
+
+
+ Seed.print(ns_name + '.' +n);
+ });
+
+ Roo.each(ns.enums, function(n) {
+
+
+ Gio.simple_write(outputdir + '/'+ ns_name + '.' + n + '.shtml',
+ cls_template.process( Introspect.factory('Enum', ns_name, n)));
+
+
+ Seed.print(ns_name + '.' +n);
+ });
+
+})
+
+for (var i in Introspect.references) {
+
+ console.log("REFERENCE: " + i + ' : ' + Introspect.references[i].length);
+ Gio.simple_write(outputdir + '/references.'+ i + '.html',
+ reference_template.process( Introspect.references[i] ));
+
+}
+
+var ix_template = new JSDOC.Template(__script_path__ + '/docs/index.tmpl');
+Gio.simple_write(outputdir + '/index.shtml', ix_template.process(ns_list));
+
+
+
--- /dev/null
+#!/bin/sh
+
+# build a few of the packages.
+
+
+
+jhbuild buildone atk
+jhbuild buildone avahi
+jhbuild buildone clutter
+jhbuild buildone clutter-gtk
+jhbuild buildone dbus
+jhbuild buildone epiphany
+jhbuild buildone gconf
+
+jhbuild buildone glib
+jhbuild buildone gssdp
+jhbuild buildone gupnp
+jhbuild buildone gnome-keyring
+jhbuild buildone gstreamer
+jhbuild buildone gst-plugins-base
+jhbuild buildone gst-plugins-good
+jhbuild buildone gtk+
+jhbuild buildone gtksourceview
+jhbuild buildone libnotify
+jhbuild buildone pango
+jhbuild buildone poppler
+jhbuild buildone libsoup
+jhbuild buildone vte
+jhbuild buildone WebKit
+jhbuild buildone cairo
+jhbuild buildone fontconfig
+jhbuild buildone gnome-menus
+jhbuild buildone libunique
+jhbuild buildone libgda
+
+#// last of all - so that it picks up changes for all the other files.
+jhbuild buildone gobject-introspection
+
+jhbuild buildone seed
+
+#build docs
+cd /home/alan/seed
+svn up
+/opt/gnome2/bin/seed docs.js
+
+#//?? copy?
+
+
+
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset="UTF-8" />
+ <meta name="generator" content="JsDoc Toolkit" />
+ {! Link.base = "../"; /* all generated links will be relative to this */ !}
+
+ <title>JsDoc Reference - {+data.name+}</title>
+
+
+ <link rel="stylesheet" type="text/css" href="default.css" />
+
+ <script type="text/javascript" src="page.js">
+
+ </script>
+
+
+ </head>
+
+ <body onload="RooDocsPage.onload();">
+
+ <div id="page">
+ <ul id="general">
+ <li id="siteaction-gnome_home" class="home">
+ <a href="http://www.gnome.org/">Home</a>
+ </li>
+ <li id="siteaction-gnome_news">
+ <a href="http://news.gnome.org">
+ News</a>
+ </li>
+ <li id="siteaction-gnome_projects">
+ <a href="http://www.gnome.org/projects/">
+ Projects</a>
+ </li>
+ <li id="siteaction-gnome_art">
+ <a href="http://art.gnome.org">
+ Art</a>
+ </li>
+ <li id="siteaction-gnome_support">
+ <a href="http://www.gnome.org/support/">
+ Support</a>
+ </li>
+ <li id="siteaction-gnome_development">
+ <a href="http://developer.gnome.org">
+ Development</a>
+ </li>
+ <li id="siteaction-gnome_community">
+ <a href="http://www.gnome.org/community/">
+ Community</a>
+ </li>
+ </ul>
+ <div id="header">
+ <div id="header-wrap">
+ <h1>
+ Un-official Seed Documentation<!-- GNOME Documentation Library--></h1>
+ <div id="control">
+ <div id="search">
+ <form method="get" action="http://www.google.com/custom">
+ <input type="hidden" name="domains" value="library.gnome.org">
+ </input>
+ <input type="hidden" name="sitesearch" value="library.gnome.org">
+ </input>
+ <input type="text" name="q" maxlength="255" size="15" class="searchTerms">
+ </input>
+ <input type="submit" class="searchButton" value="Search">
+ </input>
+ </form>
+ </div>
+ </div>
+ <div id="tabs">
+ <ul id="portal-globalnav">
+ <li id="portaltab-root">
+ <a href="http://library.gnome.org/">
+ <span>
+ Home</span>
+ </a>
+ </li>
+ <li id="portaltab-users">
+ <a href="http://library.gnome.org/users/">
+ <span>
+ Users</span>
+ </a>
+ </li>
+ <li id="portaltab-sysadmins">
+ <a href="http://library.gnome.org/admin/">
+ <span>
+ Administrators</span>
+ </a>
+ </li>
+ <li id="portaltab-developers" class="selected">
+ <a href="http://library.gnome.org/devel/">
+ <span>
+ Developers</span>
+ </a>
+ </li>
+ <li id="portaltab-about">
+ <a href="http://library.gnome.org/about/about">
+ <span>
+ About</span>
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+<div class="left-class-list" style="width:18%;float:left;">
+ <a href="index.shtml"> Back to Seed Clases </a> <br/><br/>
+ <!--#include virtual="_ix_{+data.ns+}.shtml" -->
+</div>
+
+ <div class="body-wrap" style="width:78%;float:left;">
+
+ <!-- ============================== links to methods. ================================= -->
+
+ <div class="top-tools">
+ <!--
+ <a class="inner-link" href="#{+data.name+}-props"><img src="resources/s.gif" class="item-icon icon-prop">Properties</a>
+ <a class="inner-link" href="#{+data.name+}-methods"><img src="resources/s.gif" class="item-icon icon-method">Methods</a>
+ <a class="inner-link" href="#{+data.name+}-events"><img src="resources/s.gif" class="item-icon icon-event">Events</a>
+ <a class="inner-link" href="#{+data.name+}-configs"><img src="resources/s.gif" class="item-icon icon-config">Config Options</a>
+ <a class="bookmark" href="NEED_TO_CREATE_DIRECT_LINK_HREF"><img src="resources/s.gif" class="item-icon icon-fav">Direct Link</a>
+ -->
+ </div>
+
+
+
+
+
+<!-- ============================== inheritance Block. ================================= -->
+ <if test="data.extendsClasses.length">
+ <div class="inheritance res-block">
+ <pre class="res-block-inner">{!
+ var iblock_indent = 0;
+
+
+ data.extendsClasses.reverse().map(
+ function($) {
+
+ output += iblock_indent ? ('<img src="s.gif" height="1" width="' +
+ iblock_indent + '"/><img src="elbow-end.gif" class="elbow"/>') : '';
+ output += new Link().toSymbolLong($.alias) + "\n";
+ iblock_indent += 20;
+ }
+ )
+
+
+ !}<img src="s.gif" height="1" width="{+ iblock_indent +}"/><img class="elbow" src="http://www.akbkhome.com/roojs1/images/default/tree/elbow-end.gif"/>{+data.alias+}
+
+ </pre>
+ </div>
+ </if>
+
+ {+makeImage(data.alias)+}
+
+
+<!-- ============================== class title / details ============================ -->
+
+
+ <h1 class="classTitle">
+
+
+ {+data.titleType+} {+data.alias+}
+ </h1>
+
+ <table cellspacing="0" class="class-summary-table">
+
+<if test="data.ns">
+ <tr>
+ <td class="label">Import line:</td>
+ <td class="hd-info">{+data.ns+} = imports.gi.{+data.ns+}; </td>
+ </tr>
+</if>
+
+ <tr>
+ <td class="label">C documentation:</td>
+ <td class="hd-info">{+new Link().toGnome(data.alias)+}</td>
+ </tr>
+ <tr>
+ <td class="label">{+data.titleType+} :</td>
+ <td class="hd-info">{+data.name+}</td>
+ </tr>
+
+<if test="data.implementInterfaces && data.implementInterfaces.length">
+
+ <tr>
+ <td class="label">Implements:</td>
+ <td class="hd-info">
+ {+
+ data.implementInterfaces.map(
+ function($) { return new Link().toSymbolLong($.alias); }
+ ).join(", ")
+ +}
+ </td>
+ </tr>
+
+</if>
+<if test="data.implementedBy && data.implementedBy.length">
+ <tr>
+ <td class="label">Implementations:</td>
+ <td class="hd-info">
+ {+
+ data.implementedBy
+ .sort()
+ .map(
+ function($) { return new Link().toSymbolLong($); }
+ ).join(", ")
+ +}
+ </td>
+ </tr>
+
+
+</if>
+<if test="data.childClasses.length">
+ <tr>
+ <td class="label">Subclasses:</td>
+ <td class="hd-info">
+ {+
+ data.childClasses
+ .sort()
+ .map(
+ function($) { return new Link().toSymbolLong($); }
+ ).join(", ")
+ +}
+
+
+
+ </td>
+ </tr>
+</if>
+
+ <if test="data.extendsClasses.length">
+
+ <tr><td class="label">Extends:</td><td class="hd-info">
+ {+
+ new Link().toSymbolLong(data.extendsClasses[data.extendsClasses.length -1].alias)
+
+ +}
+
+ </td></tr>
+ </if>
+
+ </table>
+
+
+<!-- ============================== class summary ========================== -->
+ <div class="description">
+ {+resolveLinks(data.desc)+}
+ </div>
+
+
+<!-- ============================== Class comment block... ========================== -->
+<!--
+<div class="comments">
+ <b>Class Comments / Notes</B> =>
+ <u onclick="parent.CommentDialog.showCommentId = '{+data.name+}';">[Add Your comment/notes about this class]</u>
+ <br/>
+ <iframe frameborder="0" id="comments-{+data.name+}" style="border: none;width:100%;"
+ src="http://www.akbkhome.com/blog.php/SeedComments/{+data.ns+}.{+data.name+}.html"></iframe>
+</div>
+-->
+
+<!-- ============================== enum values ========================== -->
+
+
+ {!
+
+
+
+
+ cfgProperties = data.values ? data.values.sort(makeSortby("name")) : [];
+
+
+
+
+
+ !}
+
+ <div class="hr"></div>
+ <a id="{+data.alias+}-values"></a>
+
+ <if test="!cfgProperties.length">
+
+
+ </if>
+
+ <if test="cfgProperties.length">
+
+ <table cellspacing="0" class="member-table">
+ <caption>Values </caption>
+
+
+ <tr>
+ <th class="sig-header" colspan="2">Properties</th>
+
+ </tr>
+
+
+
+ <for each="dtag" in="cfgProperties">
+
+ <tr class="config-row expandable config-row-alt{+$dtag_i % 2+}{+ ((dtag.memberOf == data.alias) ? " notInherited" : "") +}">
+ <td class="micon"><a class="exi" href="#expand"> </a></td>
+ <td class="sig">
+
+ <a id="{+dtag.memberOf+}-cfg-{+dtag.name+}" name=".{+dtag.name+}"></a>
+ <div class="fixedFont">
+ {+(new Link().toSymbolLong(dtag.type))+} {+data.alias+}.<b class="itemname">{+dtag.name+}</b> : {+dtag.value+}
+ </div>
+
+ <div class="mdesc">
+ <div class="short">{+resolveLinks(summarize(dtag.desc))+}</div>
+ </div>
+
+ <div class="mdesc">
+ <div class="long">{+resolveLinks(dtag.desc)+}</div>
+ </div>
+
+
+
+ </td>
+
+ </tr>
+ </for>
+
+ </table>
+ </if>
+
+
+
+
+
+<!-- ============================== config options ========================== -->
+
+
+ {!
+
+
+
+
+ cfgProperties = data.properties.sort(makeSortby("name"));
+
+
+
+
+
+ !}
+
+ <div class="hr"></div>
+ <a id="{+data.alias+}-configs"></a>
+
+ <if test="!cfgProperties.length">
+
+ <table cellspacing="0" class="member-table">
+ <caption class="Empty">Properties- Has None</caption>
+ </table>
+
+ </if>
+
+ <if test="cfgProperties.length">
+
+ <table cellspacing="0" class="member-table">
+ <caption>Properties </caption>
+
+
+ <tr>
+ <th class="sig-header" colspan="2">Properties</th>
+
+ <th class="msource-header">Defined By</th>
+ </tr>
+
+
+
+ <for each="dtag" in="cfgProperties">
+
+ <tr class="config-row expandable config-row-alt{+$dtag_i % 2+}{+ ((dtag.memberOf == data.alias) ? " notInherited" : "") +}">
+ <td class="micon"><a class="exi" href="#expand"> </a></td>
+ <td class="sig">
+
+ <a id="{+dtag.memberOf+}-cfg-{+dtag.name+}" name=".{+dtag.name+}"></a>
+ <div class="fixedFont">
+ <b class="itemname">{+dtag.name+}</b> : {+((dtag.type) ? (new Link().toSymbolLong(dtag.type)) : "" )+}
+ {+ (dtag.flags ? (dtag.flags & 2 ? '' : 'read only') : '')+}
+
+ </div>
+
+ <div class="mdesc">
+ <div class="short">{+resolveLinks(summarize(dtag.desc))+}</div>
+ </div>
+
+ <div class="mdesc">
+ <div class="long">{+resolveLinks(dtag.desc)+}</div>
+ </div>
+
+
+
+ </td>
+ <td class="msource">
+ {# - fixme - add inheritied as link here #}
+ {+ (dtag.memberOf == data.alias) ? dtag.memberOf : new Link().toSymbolLong(dtag.memberOf) +}
+
+ </td>
+ </tr>
+ </for>
+
+ </table>
+ </if>
+
+
+
+
+
+
+
+ <!-- ============================== methods summary / details ======================== -->
+
+
+ <a id="{+data.alias+}-methods"></a>
+ <!-- constructor?? -->
+ {!
+
+
+
+ var ownMethods = [];
+ ownMethods.push.apply(ownMethods, data.constructors.sort(makeSortby("name")));
+ ownMethods.push.apply(ownMethods, data.functions.sort(makeSortby("name")));
+ ownMethods.push.apply(ownMethods, data.methods.sort(makeSortby("name")));
+
+ !}
+ <!-- static's first
+
+
+ -->
+
+ <!-- then dynamics first -->
+
+
+
+ <if test="!ownMethods.length">
+
+ <table cellspacing="0" class="member-table">
+ <caption class="Empty">Methods - Has None</caption>
+ </table>
+
+ </if>
+ <if test="ownMethods.length">
+
+ <table cellspacing="0" class="member-table">
+ <caption>Methods / Constructors</caption>
+ <tr>
+ <th class="sig-header" colspan="2">Method / Constructor</th>
+ <th class="msource-header">Defined By</th>
+
+ </tr>
+
+
+
+
+
+ <for each="member" in="ownMethods">
+
+ <tr class="method-row config-row-alt{+$member_i % 2+}{!
+ if (member.isConstructor && (!member.params || !member.params.length)) {
+ output += '';
+ } else {
+ output += ' expandable';
+ }
+
+
+ if (member.memberOf == data.alias) {
+ output += " notInherited";
+ }
+
+ !}">
+ <td class="micon"><a class="exi" href="#expand"> </a></td>
+
+
+ <td class="sig">
+ <a id="{+member.memberOf+}-method-{+member.name+}" name=".{+member.name+}"></a>
+ <div class="fixedFont">
+ <span class="attributes">{!
+ if (member.isConstructor) {
+ output += "new <B>" +
+ member.memberOf + (!member.name || !member.name.length ? "" : ".") +"</B>";
+ } else {
+
+ if (member.isStatic) {
+ output += data.alias + ".";
+ }
+ }
+ !}</span><b class="itemname">{!
+ output += (!member.name || !member.name.length ? "" : member.name);
+ !}</b>
+
+ {+makeSignature(member.params)+}
+
+ <if test="(member.returns && member.returns.length) || !member.isConstructor">
+ :
+ {!
+ if (member.returns.length > 1) {
+ output += (new Link().toSymbol("Object"));
+ } else {
+ output += (new Link().toSymbolLong(member.returns[0].type));
+ }
+
+ !}
+
+ </if>
+
+ </div>
+ <div class="mdesc">
+ <if test="!member.isConstructor">
+ <div class="short">{+resolveLinks(summarize(member.desc))+}</div>
+ </if>
+ <if test="member.isConstructor">
+ <div class="short">Create a new {+data.alias +}</div>
+ </if>
+
+ <div class="long">
+ <if test="!member.isConstructor">
+ {+resolveLinks(member.desc)+}
+
+ <if test="member.example">
+ <pre class="code">{+member.example+}</pre>
+ </if>
+ </if>
+
+ <if test="member.isConstructor">
+ Create a new {+data.alias +}
+ </if>
+ <if test="member.params && member.params.length">
+ <dl class="detailList">
+ <dt class="heading">Parameters:</dt>
+ <for each="item" in="member.params">
+ <dt>
+
+ <if test="typeof(item.type) == 'object'">
+ <span class="fixedFont">{+(new Link().toSymbolLong('Function'))+}</span>
+ {+makeSignature(item.type.params)+}
+
+
+ {!
+ if (member.returns && member.returns.length) {
+ output += ' : ' + (new Link().toSymbolLong(member.returns[0].type)) + ' ';
+ } else {
+ output += ' : none ';
+ }
+
+ !}
+
+ </if>
+ <if test="typeof(item.type) != 'object'">
+ {+((item.type)?"<span class=\"fixedFont\">"+(new Link().toSymbolLong(item.type))+"</span> " : "")+} <b>{+item.name+}</b>
+ </if>
+
+ <if test="item.isOptional">
+ <i>Optional
+ <if test="item.defaultValue">,
+ Default: {+item.defaultValue+}
+ </if>
+ </i>
+ </if>
+ <if test="!item.be_null">
+ <span style="color:red;">
+ Required (not null)
+ </span>
+ </if>
+
+
+
+
+ </dt>
+ <dd>
+ {+resolveLinks(item.desc)+}
+
+
+ <if test="item.properties && item.properties.length">
+ <dl class="detailList">
+ <for each="returnitem" in="item.properties">
+ <dt>
+ {+((returnitem.type)?"<span class=\"fixedFont\">"+(new Link().toSymbolLong(returnitem.type))+"</span> " : "")+} <b>{+returnitem.name+}</b>
+ </dt>
+ <dd>
+ {+resolveLinks(returnitem.desc)+}
+ </dd>
+
+ </for>
+ </dl>
+
+ </if>
+
+
+
+
+
+ </dd>
+
+
+
+ </for>
+ </dl>
+ </if>
+ <if test="member.deprecated">
+ <dl class="detailList">
+ <dt class="heading">Deprecated:</dt>
+ <dt>
+ {+member.deprecated+}
+ </dt>
+ </dl>
+ </if>
+
+ <if test="member.exceptions && member.exceptions.length">
+ <dl class="detailList">
+ <dt class="heading">Throws:</dt>
+ <for each="item" in="member.exceptions">
+ <dt>
+ {+((item.type)?"<span class=\"fixedFont\">{"+(new Link().toSymbolLong(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+ </dt>
+ <dd>{+resolveLinks(item.desc)+}</dd>
+ </for>
+ </dl>
+ </if>
+ <if test="member.returns && member.returns.length">
+ <dl class="detailList">
+ <dt class="heading">Returns:</dt>
+
+ <if test="member.returns > 1">
+ <dl>An Object with these properties</dl>
+ </if>
+
+ <for each="item" in="member.returns">
+ <dd>{!
+ if (member.returns.length > 1) {
+ output += item.name+ ': ';
+ }
+ !}
+ {+((item.type)?"<span class=\"fixedFont\">"+(new Link().toSymbolLong(item.type))+"</span> " : "")+}
+ {+resolveLinks(item.desc)+}</dd>
+ </for>
+ </dl>
+ </if>
+
+
+
+ </div>
+ </div>
+
+ </td>
+ <td class="msource">
+ <if test="!member.isConstructor">
+ {+ (member.memberOf == data.alias) ? member.memberOf : new Link().toSymbolLong(member.memberOf) +}
+ </if>
+ </td>
+ </tr>
+ </for>
+
+ </table>
+</if>
+
+ <!-- ============================== events summary / details ======================== -->
+
+
+ <a id="{+data.alias+}-events"></a>
+
+
+ {!
+
+
+ var ownEvents = data.signals.sort(makeSortby("name"));
+
+ !}
+ <if test="!ownEvents.length">
+
+ <table cellspacing="0" class="member-table">
+ <caption class="Empty">Events - Has None</caption>
+ </table>
+
+ </if>
+
+
+ <if test="ownEvents.length">
+
+ <table cellspacing="0" class="member-table">
+ <caption>Events - usage syntax: this.signals.EVENTNAME.connect( {+(new Link().toSymbolLong('Function' ))+} ) </caption>
+ <thead>
+ <tr>
+ <th class="sig-header" colspan="2">Event</th>
+ <th class="msource-header">Defined By</th>
+
+ </tr>
+ </thead>
+
+
+
+
+ <for each="member" in="ownEvents">
+ <tr class="method-row expandable config-row-alt{+$member_i % 2+}{!
+
+ if (member.memberOf == data.alias) {
+ output += " notInherited";
+ }
+
+
+
+
+
+
+ !}">
+ <td class="micon"><a class="exi" href="#expand"> </a></td>
+
+ <td class="sig">
+ <a id="{+member.memberOf+}-event-{+member.name+}"></a>
+
+ <div class="fixedFont">
+ <b class="itemname">{+member.name+}</b> {+makeSignature(member.params)+}
+ :
+ {!
+ if (member.returns && member.returns.length) {
+ output += (new Link().toSymbolLong(member.returns[0].type));
+ } else {
+ output += 'none';
+ }
+
+ !}
+
+
+
+ </div>
+
+ <div class="mdesc">
+
+ <div class="short">{+resolveLinks(summarize(member.desc))+}
+
+ </div>
+
+ <div class="long">
+
+ {+resolveLinks(member.desc)+}
+
+
+ <if test="member.params && member.params.length">
+ <dl class="detailList">
+ <dt class="heading">Parameters:</dt>
+ <for each="item" in="member.params">
+ <dt>
+ {+((item.type)?"<span class=\"fixedFont\">"+(new Link().toSymbolLong(item.type))+"</span> " : "")+}<b>{+item.name+}</b>
+ <if test="item.isOptional"><i>Optional
+ <if test="item.defaultValue">,
+ Default: {+item.defaultValue+}
+ </if></i></if>
+ </dt>
+ <dd>{+resolveLinks(item.desc)+}</dd>
+ </for>
+ </dl>
+ </if>
+
+ <if test="member.exceptions.length">
+ <dl class="detailList">
+ <dt class="heading">Throws:</dt>
+ <for each="item" in="member.exceptions">
+ <dt>
+ {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbolLong(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+ </dt>
+ <dd>{+resolveLinks(item.desc)+}</dd>
+ </for>
+ </dl>
+ </if>
+ <if test="member.returns && member.returns.length">
+ <dl class="detailList">
+ <dt class="heading">Returns:</dt>
+ <for each="item" in="member.returns">
+ <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbolLong(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
+ </for>
+ </dl>
+ </if>
+
+
+
+
+ </div>
+ </div>
+
+ </td>
+ <td class="msource">
+ {+ (member.memberOf == data.alias) ? member.memberOf : new Link().toSymbolLong(member.memberOf) +}
+ </td>
+ </tr>
+ </for>
+
+ </table>
+</if>
+
+ <a id="{+data.alias+}-references"></a>
+ <!--#include virtual="references.{+data.alias+}.html" -->
+
+
+
+<!-- ============================== footer ================================= -->
+ <div class="fineprint" style="clear:both">
+ <if test="data.copyright">©{+data.copyright+}<br /></if>
+ Documentation generated by <a href="http://www.akbkhome.com/svn/seed/JSDOC">Seed/Jstoolkit</a>
+ Based on
+ <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> on {+new Date()+}
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+ <h2 class="classTitle">{+ (new Link().toSymbol(data.name)) +}</h2>
+ <br/>
+ <h3>Classes</h3>
+
+
+ <ul>
+
+ <for each="c" in="data.objects">
+ <li> {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+ </for>
+ </ul>
+
+ <h3>Interfaces</h3>
+
+
+ <ul>
+
+ <for each="c" in="data.interfaces">
+ <li> {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+ </for>
+ </ul>
+ <h3>Structs</h3>
+ <ul>
+
+ <for each="c" in="data.structs">
+ <li> {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+ </for>
+ </ul>
+
+ <h3>Unions</h3>
+ <ul>
+
+ <for each="c" in="data.unions">
+ <li> {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+ </for>
+ </ul>
+ <h3>Enums</h3>
+ <ul>
+
+ <for each="c" in="data.enums">
+ <li> {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+ </for>
+ </ul>
--- /dev/null
+
+@import url("http://library.gnome.org/skin/lgo.css");
+@import url("http://library.gnome.org/skin/print.css") print;
+
+
+/* default.css
+/<style>
+/ */
+body
+{
+ font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+ /* width: 800px; */
+}
+
+.header
+{
+ clear: both;
+ background-color: #ccc;
+ padding: 8px;
+}
+
+h1
+{
+ font-size: 150%;
+ font-weight: bold;
+ padding: 0;
+ margin: 1em 0 0 .3em;
+}
+
+hr
+{
+ border: none 0;
+ border-top: 1px solid #7F8FB1;
+ height: 1px;
+}
+
+pre.code
+{
+ display: block;
+ padding: 8px;
+ border: 1px dashed #ccc;
+}
+
+#index
+{
+ margin-top: 24px;
+ float: left;
+ width: 160px;
+ position: absolute;
+ left: 8px;
+ background-color: #F3F3F3;
+ padding: 8px;
+}
+
+#content
+{
+ margin-left: 190px;
+ width: 600px;
+}
+
+.classList
+{
+ list-style-type: none;
+ padding: 0;
+ margin: 0 0 0 8px;
+ font-family: arial, sans-serif;
+ font-size: 1em;
+ overflow: auto;
+}
+
+.classList li
+{
+ padding: 0;
+ margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+ font-size:170%;
+ line-height:130%;
+}
+
+h2 { font-size: 110%; }
+
+/* --------- the labels at the top of the page... -------- */
+.class-summary-table .label
+{
+ vertical-align: top;
+ margin-bottom: 4px;
+}
+
+.class-summary-table
+{
+ margin-left:10px;
+ margin-top:5px;
+
+}
+.class-summary-table td
+{
+ font-size:12px;
+ padding:2px 10px 2px 2px;
+}
+.elbow
+{
+ vertical-align: middle;
+ padding-right: 2px;
+ }
+
+/** --------------------- Caption above tables -----------------------**/
+caption.Empty,
+caption,
+div.sectionTitle
+{
+ background-color: #7F8FB1;
+ color: #fff;
+ font-size:130%;
+ text-align: left;
+ padding: 2px 6px 2px 6px;
+ border: 1px #7F8FB1 solid;
+ width: 100%;
+ font-weight: bold;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+ vertical-align: top;
+ padding: 4px;
+ border-bottom: 1px #7F8FB1 solid;
+ border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+ border-left: 1px #7F8FB1 solid;
+ width: 140px;
+ text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+ line-height: 15px;
+/* color: #002EBE; */
+ font-family: "Courier New",Courier,monospace;
+ font-size: 13px;
+ margin-left: 10px;
+}
+
+td.attributes, .fixedFont a
+{
+ color: #999999;
+ font-family: "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+}
+td.attributes, .fixedFont b i
+{
+ font-family: "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+}
+.itemname
+{
+ color: #002EBE;
+}
+
+
+.summaryTable td.nameDescription
+{
+ text-align: left;
+ font-size: 13px;
+ line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+ font: 13px Palatino,Garamond,serif;
+ line-height: 15px;
+ padding: 4px;
+ padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+ list-style: square;
+ margin-left: 20px;
+ padding-left: 0;
+}
+
+.detailList {
+ margin-left: 20px;
+ padding-top: 10px;
+ line-height: 20px;
+ clear: left;
+}
+.detailList dt
+{
+ margin-left: 20px;
+ clear: left;
+ float: left;
+
+}
+
+.detailList .heading
+{
+ font-weight: bold;
+ padding-bottom: 6px;
+ margin-left: 0;
+
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+ color: #777;
+ font-style: italic;
+}
+
+.fineprint
+{
+ text-align: right;
+ font-size: 10px;
+}
+
+.detailList dd
+{
+ clear: none;
+ float: left;
+ margin-left: 10px;
+
+
+}
+
+
+.detailList dt
+{
+
+
+ margin-bottom:: 12px;
+ margin-left: 20px;
+}
+/** ----------------------- RooJS extra stuff ----------------------- */
+
+.body-wrap {
+ margin: 5px;
+}
+
+.top-tools {
+ text-align:right;
+}
+.inner-link {
+ margin-left: 10px;
+}
+.inheritance {
+ float:right;
+ margin-top:20px;
+ width:300px;
+}
+.res-block {
+ margin-bottom:15px;
+ padding-top:5px;
+ /* width:210px; */
+}
+.inheritance pre {
+ border:0pt none;
+ font-size:11px;
+ /* line-height:18px !important; */
+ margin:0pt;
+ padding:0pt 8px 5px !important;
+ text-align:left;
+ background-color: #f8f8f8;
+}
+div.hr {
+ background:#CCCCCC none repeat scroll 0%;
+ height:1px;
+ line-height:1px;
+ margin:5px 0pt;
+ overflow:hidden;
+ clear: both;
+}
+/** ----------------------- RooJS table stuff ----------------------- */
+
+.member-table {
+ margin-bottom:10px;
+ width:100%;
+}
+
+.member-table th {
+ background-color:#eee;
+ border-left:1px solid #EEE;
+ border-right:1px solid #DDD;
+ border-top:1px solid #EEE;
+ padding:3px;
+ text-align:left;
+ vertical-align:middle;
+
+
+ font-size:11px;
+ white-space:nowrap;
+
+}
+
+.member-table td.micon {
+ background:#F9F9F9;
+ border-right:1px solid #D0D0D0;
+ padding:0px;
+ width:16px;
+}
+
+.member-table td.micon a {
+
+ display:block;
+
+ text-decoration: none;
+
+ height:18px;
+ width:16px;
+}
+
+.member-table td.micon,
+.member-table td.sig,
+.member-table td.msource {
+ border-top:1px solid #D0D0D0;
+ vertical-align:top;
+ padding: 5px;
+ font-size: 13px;
+}
+.expanded .mdesc .short{
+ display:none;
+}
+.expanded .mdesc .comments,
+.expanded .mdesc .long {
+ display:block;
+ margin-top: 10px;
+ margin-left: 10px;
+}
+
+
+.mdesc .comments,
+.mdesc .long {
+ display:none;
+}
+.mdesc .short {
+ color: #999;
+ margin-left: 10px;
+}
+
+.expandable td.micon a {
+ background:transparent url(http://devel.akbkhome.com/extjs/resources/images/default/tree/elbow-plus-nl.gif) no-repeat scroll 0px 0px;
+ cursor:pointer}
+
+.expanded td.micon a {
+ background:transparent url(http://devel.akbkhome.com/extjs/resources/images/default/tree/elbow-minus-nl.gif) no-repeat scroll 0px 0px;
+ cursor:pointer;
+
+}
+
+
+/* ---- table with no contents */
+
+caption.Empty
+{
+ background-color:#EEEEEE;
+ border:medium none;
+ color:#666666;
+ font-size:10pt;
+ font-style:italic;
+ font-weight: normal;
+}
+
+
+/* fix up lists back to normal */
+
+
+.body-wrap ul
+{
+ ist-style-image: none;
+ list-style-position: outside;
+ list-style-type: disc;
+ padding-left: 40px;
+}
+
+.long pre,
+.description pre {
+ background:#F8F8F8 none repeat scroll 0% 0%;
+ border-color:#ccc;
+ border-style:solid;
+ border-width:1px 1px 1px 5px;
+ font-size:12px !important;
+ line-height:14px !important;
+ margin:10px 10px 10px 0px;
+ padding:10px;
+}
+
+
+.comments {
+ background:#F8F8F8 none repeat scroll 0% 0%;
+ border-color:#f30;
+ border-style:solid;
+ border-width:1px 15px 1px 15px;
+ font-size:12px !important;
+ line-height:14px !important;
+ margin:10px 10px 10px 0px;
+ padding:10px;
+ width:95%;
+ float:left;
+
+}
+
+
+/** methods etc. defined in this class are highlighted. **/
+
+/** -------- alternating rows.. ---- */
+
+.config-row-alt0 {
+ background-color : #f8f8f8;
+}
+.notInherited td.micon,
+.notInherited td.msource
+{
+
+ background-color: #7F8FB1;
+ color : #fff;
+ font-weight: bold;
+ /*border: 1px solid red; */
+}
+td.msource
+{
+ width: 160px;
+}
+
+
+.detailList dd {
+ clear: both;
+}
+.left-class-list ol, .left-class-list ul {
+ list-style-image:none;
+ list-style-position:outside;
+ list-style-type:none;
+ margin: 4px;
+ padding: 4px;
+}
+.left-class-list {
+ background:#F8F8F8 none repeat scroll 0 0;
+ border:1px solid white;
+ float:left;
+ margin:5px;
+ padding:5px;
+ width:18%;
+}
+.class-picture {
+ float:right;
+ margin:20px 10px 10px;
+
+}
+.left-class-list ol, .left-class-list ul {
+ list-style-image:none;
+ list-style-position:outside;
+ list-style-type:none;
+ margin: 4px;
+ padding: 4px;
+}
+.left-class-list {
+ background:#F8F8F8 none repeat scroll 0 0;
+ border:1px solid white;
+ float:left;
+ margin:5px;
+ padding:5px;
+ width:18%;
+}
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <title>Seed Documentation</title>
+
+ <style>
+
+</style>
+ <link rel="stylesheet" type="text/css" href="default.css" />
+
+</head>
+
+
+<body>
+
+
+
+
+ <div id="page">
+ <ul id="general">
+ <li id="siteaction-gnome_home" class="home">
+ <a href="http://www.gnome.org/">Home</a>
+ </li>
+ <li id="siteaction-gnome_news">
+ <a href="http://news.gnome.org">
+ News</a>
+ </li>
+ <li id="siteaction-gnome_projects">
+ <a href="http://www.gnome.org/projects/">
+ Projects</a>
+ </li>
+ <li id="siteaction-gnome_art">
+ <a href="http://art.gnome.org">
+ Art</a>
+ </li>
+ <li id="siteaction-gnome_support">
+ <a href="http://www.gnome.org/support/">
+ Support</a>
+ </li>
+ <li id="siteaction-gnome_development">
+ <a href="http://developer.gnome.org">
+ Development</a>
+ </li>
+ <li id="siteaction-gnome_community">
+ <a href="http://www.gnome.org/community/">
+ Community</a>
+ </li>
+ </ul>
+ <div id="header">
+ <div id="header-wrap">
+ <h1>
+ Un-official Seed Documentation<!-- GNOME Documentation Library--></h1>
+ <div id="control">
+ <div id="search">
+ <form method="get" action="http://www.google.com/custom">
+ <input type="hidden" name="domains" value="library.gnome.org">
+ </input>
+ <input type="hidden" name="sitesearch" value="library.gnome.org">
+ </input>
+ <input type="text" name="q" maxlength="255" size="15" class="searchTerms">
+ </input>
+ <input type="submit" class="searchButton" value="Search">
+ </input>
+ </form>
+ </div>
+ </div>
+ <div id="tabs">
+ <ul id="portal-globalnav">
+ <li id="portaltab-root">
+ <a href="http://library.gnome.org/">
+ <span>
+ Home</span>
+ </a>
+ </li>
+ <li id="portaltab-users">
+ <a href="http://library.gnome.org/users/">
+ <span>
+ Users</span>
+ </a>
+ </li>
+ <li id="portaltab-sysadmins">
+ <a href="http://library.gnome.org/admin/">
+ <span>
+ Administrators</span>
+ </a>
+ </li>
+ <li id="portaltab-developers" class="selected">
+ <a href="http://library.gnome.org/devel/">
+ <span>
+ Developers</span>
+ </a>
+ </li>
+ <li id="portaltab-about">
+ <a href="http://library.gnome.org/about/about">
+ <span>
+ About</span>
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+
+
+
+
+
+
+ <for each="thisClass" in="data">
+
+<div class="left-class-list" style="width:18%;float:left;">
+
+ <h2 class="classTitle">{+ (new Link().toSymbol(thisClass)) +}</h2>
+ <br/>
+ </div>
+ </for>
+
+
+
+</body>
+
+
+</html>
+
+
+
\ No newline at end of file
--- /dev/null
+//<script type="text/javascript">
+/* -- IE kludge as usual! */
+if (!Array.prototype.indexOf)
+{
+ Array.prototype.indexOf = function(elt /*, from*/)
+ {
+ var len = this.length;
+
+ var from = Number(arguments[1]) || 0;
+ from = (from < 0)
+ ? Math.ceil(from)
+ : Math.floor(from);
+ if (from < 0)
+ from += len;
+
+ for (; from < len; from++)
+ {
+ if (from in this &&
+ this[from] === elt)
+ return from;
+ }
+ return -1;
+ };
+}
+
+
+
+RooDocsPage = {
+
+ isIE: function() {
+ var ua = navigator.userAgent.toLowerCase();
+ return ua.indexOf("msie") > -1;
+
+ },
+
+
+ onload : function()
+ {
+ //console.log("loading");
+
+ this.addEvent(document,'click', function(e) {
+ var ev = e || window.event;
+ var t = ev.target || ev.srcElement;
+ //console.log(t);
+ return RooDocsPage.clicked(t);
+
+ });
+
+
+
+ },
+ addEvent: function(el, eventName, fn)
+ {
+
+ if (window.addEventListener) {
+ capture = false;
+ el.addEventListener(eventName, fn, (capture));
+ return;
+ }
+ if (window.attachEvent) {
+ el.attachEvent("on" + eventName, fn);
+ return;
+
+ }
+ },
+ clicked : function(t)
+ {
+
+
+ var classAr = t.className.split(' ');
+ //console.log(classAr)
+ if ((t.nodeName == 'a') && (classAr.indexOf('exi') < 0) && (classAr.indexOf('micon') < 0)) {
+ // link clicked...
+ return false;
+
+ }
+
+
+
+
+ if (classAr.indexOf('exi') > -1 || classAr.indexOf('micon') > -1) {
+
+ var tr = t;
+ //console.log(tr.parentNode);
+ while (tr.parentNode) {
+ ///console.log(tr.nodeName);
+ if (tr.nodeName.toUpperCase() =='TR') {
+ break;
+ }
+ tr = tr.parentNode;
+ }
+ if (tr.nodeName.toUpperCase() != 'TR') { // no tr!
+ return false;
+ }
+ //console.log(tr.className)
+ if (tr.className.match(/expandable/)) {
+
+ if (!/expanded/.test(tr.className)) {
+
+ tr.className += " expanded";
+
+ //this.loadComments(tr);
+
+ // console.log("ADDED:"+ tr.className);
+ } else {
+ tr.className = tr.className.replace(/ expanded/,'');
+ //console.log("REMOVED:"+ tr.className);
+ }
+ }
+ return true;
+
+
+
+ }
+ return false;
+ },
+
+ getAttributeNS : function(d,ns,name) {
+ if (this.isIE()) {
+ // ie uses attribute stuff...
+ var type = typeof d[ns+":"+name];
+ if(type != 'undefined' && type != 'unknown'){
+ return d[ns+":"+name];
+ }
+ return d[name];
+
+ }
+ return d.getAttributeNS(ns, name) || d.getAttribute(ns+":"+name) || d.getAttribute(name) || d[name];
+ }
+
+}
+
+
+ /*
+this.preview.getEl().on('click', function(e, target)
+ {
+ //console.log("click pressed?");
+
+ if(target = e.getTarget('a:not(.exi)', 3)) {
+ var cls = Ext.fly(target).getAttributeNS('roo', 'cls');
+ e.stopEvent();
+ if(cls){
+ var member = Ext.fly(target).getAttributeNS('roo', 'member');
+ //this.loadClass(target.href, cls, member);
+
+ if (/^src\//.test(cls)) {
+ cls = cls.replace(/.js$/, ''); // get rid of .js for source links..
+ }
+
+
+ MainBody.loadPage("symbols/"+ cls +".html");
+ return;
+ }
+ if(target.className == 'inner-link'){ // go to #
+ this.getActiveTab().scrollToSection(target.href.split('#')[1]);
+ return;
+ }
+ window.open(target.href);
+
+ return; // no more...
+ }
+ if(target = e.getTarget('.micon', 2)){
+
+ e.stopEvent();
+ var tr = Ext.fly(target.parentNode);
+ if(tr.hasClass('expandable')){
+ tr.toggleClass('expanded');
+ }
+ }
+
+ });
+*/
\ No newline at end of file
--- /dev/null
+
+
+ <!-- ============================== methods summary / details ======================== -->
+
+
+ <! -- -->
+ <!-- constructor?? -->
+ {!
+
+
+ var ownMethods = data.sort(makeSortby("memberOf"));
+ //var ownMethods = [];
+ //ownMethods.push.apply(ownMethods, data.sort(makeSortby("alias")));
+ //ownMethods.push.apply(ownMethods, data);
+
+
+ !}
+
+
+ <!-- then dynamics first -->
+
+
+
+ <if test="!ownMethods.length">
+
+ <table cellspacing="0" class="member-table">
+ <caption class="Empty">Used by These Methods / Signals / Properties- Nowhere other than here</caption>
+ </table>
+
+ </if>
+ <if test="ownMethods.length">
+
+
+
+
+ <table cellspacing="0" class="member-table">
+ <caption>Used by These Methods / Signals / Properties</caption>
+ <tr>
+ <th class="msource-header">Class / Namespace</th>
+ <th class="sig-header">Method / Signal / Properties</th>
+
+
+ </tr>
+
+
+ <for each="member" in="ownMethods">
+
+ <tr class="method-row config-row-alt{+$member_i % 2+}">
+
+ <td class="msource">
+
+ {+ new Link().toSymbolLong(member.memberOf) +}
+ <br/>
+ {+ member.propertyType +}
+ <!--<div class="mdesc">
+ <div class="short">
+
+ </div>
+ </div> -->
+
+ </td>
+
+
+
+<if test="member.propertyType != 'Property'">
+ <!-- signal or method -->
+
+ <td class="sig">
+ <a id="{+member.memberOf+}-method-{+member.name+}" name=".{+member.name+}"></a>
+ <div class="fixedFont">
+ <span class="attributes">{!
+ if (member.isConstructor) {
+ output += "new <B>" +
+ member.memberOf + (!member.name || !member.name.length ? "" : ".") +"</B>";
+ } else {
+
+ if (member.isStatic) {
+ output += member.memberOf + ".";
+ }
+ }
+ !}</span><b class="itemname">{!
+ output += (!member.name || !member.name.length ? "" : member.name);
+ !}</b>
+
+ {+makeSignature(member.params)+}
+
+ <if test="(member.returns && member.returns.length) || !member.isConstructor">
+ :
+ {!
+ if (member.returns.length > 1) {
+ output += (new Link().toSymbol("Object"));
+ } else {
+ output += (new Link().toSymbolLong(member.returns[0].type));
+ }
+
+ !}
+
+ </if>
+
+ </div>
+ <div class="mdesc">
+ <if test="!member.isConstructor">
+ <div class="short">{+resolveLinks(summarize(member.desc))+}</div>
+ </if>
+ <if test="member.isConstructor">
+ <div class="short">Create a new {+member.memberOf +}</div>
+ </if>
+
+
+
+
+ </td>
+</if>
+<!-- property -->
+
+<if test="member.propertyType == 'Property'">
+ <!-- signal or method -->
+
+
+ <td class="sig">
+
+ <a id="{+member.memberOf+}-cfg-{+member.name+}" name=".{+member.name+}"></a>
+ <div class="fixedFont">
+ <b class="itemname">{+member.name+}</b> : {+((member.type) ? (new Link().toSymbolLong(member.type)) : "" )+}
+ {+ (member.flags ? (member.flags & 2 ? '' : 'read only') : '')+}
+
+ </div>
+
+ <div class="mdesc">
+ <div class="short">{+resolveLinks(summarize(member.desc))+}</div>
+ </div>
+
+
+
+ </td>
+</if>
+
+
+
+
+ </tr>
+ </for>
+
+ </table>
+</if>
+
\ No newline at end of file
--- /dev/null
+//<script type="text/javascript">
+
+/**
+ *
+ * abstraction layer / tree builder etc...
+ *
+ *
+ *
+ *
+ */
+
+var console = imports['console.js'].console;
+
+//var xnew = imports['xnew.js'].xnew;
+
+function apply (o, c){
+ if(o && c && typeof c == 'object'){
+ for(var p in c){
+ o[p] = c[p];
+ }
+ }
+ return o;
+};
+
+
+var xnew = {
+ registry : { },
+ pre_registry : { },
+
+ dumpRegistry: function(scope, id)
+ {
+ var ret = { }
+
+ for (var i in xnew.registry) {
+ ret[i] = [];
+ for(var j in xnew.registry[i]) {
+ ret[i].push(j);
+ }
+ }
+ return ret;
+
+ },
+ /**
+ * xnew.get(this, 'someid')
+ * xnew.get(this).someid
+ *
+ * fetches from a registry of components.
+ *
+ * defined by {
+ * xnsid : 'Builder.test' // at top leve, all sub elements inherit it..
+ * xid : 'test'
+ *
+ *
+ */
+
+ get: function(scope, id)
+ {
+ var s = typeof(scope) == 'object' ? scope.xnsid : scope;
+
+ if (typeof(this.pre_registry[s]) != 'undefined') {
+ this.xnew(this.pre_registry[s]);
+ delete this.pre_registry[s];
+ }
+
+
+ if (typeof(id) == 'undefined') {
+ if (typeof(xnew.registry[s]) !='undefined') {
+ Seed.print("Success - got " + s);
+ return xnew.registry[s];
+ }
+
+ var ar = s.split('.');
+ id = ar.pop();
+ s = ar.join('.');
+ }
+
+
+ xnew.registry[s] = xnew.registry[s] || {};
+
+
+ var ret = typeof(xnew.registry[s][id]) == 'undefined' ? false : xnew.registry[s][id]
+
+
+ Seed.print((ret ? "Success" : "FAILED") + " - check for NS:" + s + " ID: " + id);
+ if (!ret) {
+ console.dump(this.dumpRegistry());
+ }
+ return ret;
+
+ },
+
+
+ /**
+ * load a directory, and overlay it's properties onto the variable provider..
+ *
+ *
+ *
+ */
+
+
+ load: function (obj, path)
+ {
+ var GLib = imports.gi.GLib;
+ var ret = [];
+ var gdir = GLib.dir_open(__script_path__ + '/' + path,0);
+
+
+
+ while (true) {
+
+ var fn = GLib.dir_read_name(gdir);
+ //console.log('trying ' + path + '/' + fn);
+ if (!fn) {
+ GLib.dir_close(gdir);
+ return;
+ }
+ if (!fn.match(/.js$/)) {
+ continue;
+ }
+ var v = fn.replace(/.js$/, '');
+ var assign = imports[path + '/' + fn][v];
+ //console.log('loaded : ' + path + '/'+v);
+ if (!obj[v]) {
+ Seed.print("using file as object for " + path + ':' +v);
+ }
+ obj[v] = obj[v] || assign;
+
+ }
+ },
+ /**
+ * create a delegate..
+ *
+ */
+
+
+ createDelegate : function(method, obj, args, appendArgs){
+
+ return function() {
+ var callArgs = args || arguments;
+ if(appendArgs === true){
+ callArgs = Array.prototype.slice.call(arguments, 0);
+ callArgs = callArgs.concat(args);
+ }else if(typeof appendArgs == "number"){
+ callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first
+ var applyArgs = [appendArgs, 0].concat(args); // create method call params
+ Array.prototype.splice.apply(callArgs, applyArgs); // splice them in
+ }
+ return method.apply(obj || window, callArgs);
+ };
+ },
+ /**
+ * copy an array...
+ *
+ */
+ copyArray: function (ar) {
+ var ret = [];
+ for(var i = 0 ; i < ar.length; i++) {
+ ret[i] = ar[i];
+ }
+ return ret;
+ },
+
+ /**
+ * create a definition of an interface..
+ *
+ * it get's registered, however not created.
+ *
+ *
+ *
+ */
+ create : function (o)
+ {
+ this.pre_registry[o.xnsid] = o;
+
+ },
+
+
+ /**
+ * factory.. ??? - better name???
+ *
+ * converts a object structure, and constructs a class... using xtype/xns fields.
+ *
+ *
+ *
+ */
+
+ xnew: function (o, in_xnsid)
+ {
+ in_xnsid = in_xnsid || '';
+ var xnsid = '' + in_xnsid;
+
+ if ((o.xtype == 'Include') && (o.xns == 'xnew')) {
+ if (typeof(o.cls) != 'string') {
+ return xnew.xnew( o.cls.create(), xnsid);
+ }
+ var cls = o.cls;
+ o = this.pre_registry[cls];
+ }
+ if (typeof(o.xtype) == 'function') {
+ return new o.xtype(o);
+ }
+ o.set = o.set || {};
+ o.listeners = o.listeners || {};
+ o.packing = o.packing || [ 'add' ];
+ o.items = o.items || [];
+ // handle xnsid..
+
+ if (typeof(o.xnsid) !='undefined') {
+ Seed.print("\n\n------------------------------------------");
+ Seed.print( o.xnsid);
+ Seed.print("------------------------------------------\n\n");
+ xnsid = ''+ o.xnsid;
+ }
+ if ((typeof(xnsid) != 'undefined') && !o.xnsid) {
+ o.xnsid = xnsid;
+ }
+ if (o.xnsid && o.xid) {
+ xnew.registry = xnew.registry || { };
+ xnew.registry[o.xnsid] = xnew.registry[o.xnsid] || {};
+ xnew.registry[o.xnsid][o.xid] = o;
+ }
+
+
+ var isSeed = typeof(Seed) != 'undefined';
+
+ var constructor = false
+
+
+ // XNS contructor..
+ Seed.print('xnew : ' + o.xns + '.' + o.xtype);
+ // support for xns='Gtk', xtyle='Window'..
+ var NS = imports.gi[o.xns];
+ if (!NS) {
+ Seed.print('Invalid xns: ' + o.xns);
+ }
+ constructor = NS[o.xtype];
+ if (!constructor) {
+ Seed.print('Invalid xtype: ' + o.xns + '.' + o.xtype);
+ }
+
+ // how to hanlde gjs constructor???? - can it even be done..
+
+ o.el = o.el || (isSeed ? new constructor(o) : new constructor());
+
+
+
+
+ if (o.listeners._new) { // rendered!?!?
+ Seed.print('Call : ' + o.xtype+'.listeners._new');
+ o.listeners._new.call(o);
+ }
+
+
+ //Seed.print(o.pack.length);
+ // packing - if 'add method exists on created node use that..
+
+
+ for( var i =0; i < o.items.length;i++) {
+
+
+
+
+ o.items[i] = xnew.xnew(o.items[i], xnsid);
+
+ if (typeof(o.items[i].packing) == 'function') {
+ // parent, child
+ o.items[i].packing.apply(o, [ o , o.items[i] ]);
+ o.items[i].xparent = o;
+ continue;
+ }
+ var pack_m = o.items[i].packing[0];
+
+ if (pack_m && typeof(o.el[pack_m]) == 'undefined') {
+ Seed.print('pack method not available : ' + o.xtype + '.' + pack_m);
+ continue;
+ }
+ Seed.print('Pack ' + o.xtype + '.'+ pack_m + '(' + o.items[i].xtype + ')');
+ // copy..
+ args = this.copyArray(o.items[i].packing);
+ args[0] = o.items[i].el;
+ Seed.print('args: ' + args.length);
+ if (pack_m) {
+ o.el[pack_m].apply(o.el, args);
+ }
+
+ o.items[i].xparent = o;
+ }
+
+ /// Setting stuff...
+
+ for (var i in o.set) {
+ Seed.print('Set ' + i);
+ if (typeof(o.el[i].apply) !='undefined') {
+ o.el[i].apply(o.el, o.set[i]);
+ }
+
+ }
+
+ for (var i in o.listeners) {
+ if (i.substring(0,1) == '_') {
+ continue;
+ }
+ Seed.print('Add Listener ' + i);
+
+ var _li = this.createDelegate(o.listeners[i],o);
+ // private listeners that are not copied to GTk.
+
+
+ if (isSeed) {
+ // Seed.print(typeof(_li));
+ o.el.signal[i].connect(_li);
+ } else {
+ o.el.connect( i, _li);
+ }
+
+ }
+
+ // apply functions..
+ if (o.listeners._rendered) { // rendered!?!?
+ Seed.print('Call : ' + o.xtype+'.listeners._rendered');
+ o.listeners._rendered.call(o);
+ }
+
+ return o;
+
+ }
+};
\ No newline at end of file