--- /dev/null
+//<script type="text/javscript">
+XObject = imports.XObject.XObject;
+
+
+console = imports.console.console;
+
+// make sure parent is loaded..
+TokenStream = imports.TokenStream.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 = XObject.define(
+ function (ar)
+ {
+
+ Collapse.superclass.constructor.call(this, ar);
+
+ this.spaces();
+ var ar = this.collapse(this.tokens);
+
+ this.tokens = ar;
+
+ // console.dump(ar);
+
+ },
+ 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">
+
+XObject = imports.XObject.XObject;
+
+
+
+console = imports.console.console;
+
+// make sure parent is loaded..
+RooFile = imports.RooFile..RooFile;
+
+/**
+ *
+ * this takes our collased file, and turns it into the config array..
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+
+
+
+GtkFile = XObject.define(
+ function (ar)
+ {
+ GtkFile.superclass.constructor.call(this, ar);
+ // console.log("STARTING OUTPUT");
+
+
+
+ },
+ 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/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) {
+ name = typeof(puncNames[name]) == 'undefined' ? name : puncNames[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">
+
+XObject = imports.XObject.XObject;
+console = imports.console.console;
+TokenStream = imports.TokenStream.TokenStream;
+/**
+ *
+ * this takes our collased file, and turns it into the config array..
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+
+RooFile = XObject.define(
+ function (ar)
+ {
+ RooFile.superclass.constructor.call(this, ar);
+ // console.log("STARTING OUTPUT");
+
+
+
+ },
+ 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;
+ stmts.map( 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,
+
+
+ };
+ XObject.extend(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 = {
+
+
+
+ XObject.extend(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
+ };
+
+ XObject.extend(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;
+ XObject.extend(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;
+ XObject.extend(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 = [];
+ }
+ XObject.extend(fakeItems, function(e) {
+ ret.items.push(e);
+ })
+ // merge fakeItems;
+ //console.dump(ret);
+
+ return ret;
+ },
+ parseArray: function(ar) {
+ // console.dump(ar);
+ // Seed.quit();
+ var ret = [];
+ ar.map(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;
+ lns.map( 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;
+ }
+ lns.map( 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">
+
+XObject = imports.XObject.XObject;
+
+
+/**
+ @constructor
+*/
+TextStream = XObject.define(
+ function(text) {
+ if (typeof(text) == "undefined") text = "";
+ text = ""+text;
+ this.text = text;
+ this.cursor = 0;
+ },
+ Object,
+ {
+
+ 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">
+
+XObject = imports.XObject.XObject;
+
+console = imports.console.console;
+/**
+ * @class Token
+ *
+ * @prop data {String} raw value of token
+ * @prop type {String} type of token
+ * TOKN (unknown) - name is UNKNOWN_TOKEN
+ *
+ * KEYW (keyword) - name is upper case version of keyword
+ * NAME (name/identifier) - name is NAME
+ * COMM (comment) - name is MULTI_LINE_COMM, JSDOC, SINGLE_LINE_COMM
+ * PUNC (puctuation) - name is String description of punctionan (eg LEFTPARAM)
+ * WHIT (white space) - name is SPACE,NEWLINE
+ * STRN (string) - name is DOBULE_QUOTE, SINGLE_QUOTE
+ * NUMB (number) - name is OCTAL,DECIMAL,HEC_DEC
+ * REGX (reg.expression) - name is REGX
+ * @prop name {String} see type details above
+ * @prop identifier {Identifier} identifier class if relivant
+ *
+ *
+ *
+ * old mappings:
+ *
+ * Script.TOKidentifier - type == 'NAME'
+ * Script.TOKassign = data == '='
+ * Script.TOKsemicolon data == '';
+ *
+ *
+ *
+*/
+
+Token = XObject.define(
+ function(data, type, name, line) {
+ this.data = data;
+ this.type = type;
+ this.name = name;
+ this.line = line;
+ this.prefix = '';
+ this.outData = false; // used by packer/scopeparser
+ this.identifier = false; // used by scope
+ },
+ Object,
+ {
+ toString: function()
+ {
+ return 'line:' + this.line + ', type:' + this.type + ', name:' + this.name + ', data:' + this.data;
+ },
+
+
+ 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">
+
+
+XObject = imports.XObject.XObject;
+console = imports.console.console;
+
+
+Token = imports.Token.Token;
+Lang = imports.Lang.Lang;
+
+/**
+ @class Search a {@link JSDOC.TextStream} for language tokens.
+*/
+TokenReader = XObject.define(
+ function(o) {
+
+ this.keepDocs = true;
+ this.keepWhite = false;
+ this.keepComments = false;
+ this.sepIdents = false; // seperate '.' in identifiers..
+ XObject.extend(this, o || {});
+
+ },
+ Object,
+ {
+
+
+ /**
+ * tokenize a stream
+ * @return {Array} of tokens
+ *
+ * ts = new TextStream(File.read(str));
+ * tr = TokenReader({ keepComments : true, keepWhite : true });
+ * tr.tokenize(ts)
+ *
+ */
+
+
+
+ tokenize : function(/**JSDOC.TextStream*/stream) {
+ this.line =1;
+ 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", this.line));
+ }
+
+
+
+ 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, this.line));
+ return true;
+ }
+ if (!this.sepIdents || found.indexOf('.') < 0 ) {
+ tokens.push(new Token(found, "NAME", "NAME", this.line));
+ return true;
+ }
+ var n = found.split('.');
+ var p = false;
+ n.forEach(function(nm) {
+ if (p) {
+ tokens.push(new Token('.', "PUNC", "DOT", this.line));
+ }
+ p=true;
+ tokens.push(new Token(nm, "NAME", "NAME", this.line));
+ });
+ 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), this.line));
+ 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", this.line));
+ 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())) {
+ this.line++;
+ found += stream.next();
+ }
+
+ if (found === "") {
+ return false;
+ }
+ else {
+ if (this.collapseWhite) found = "\n";
+ if (this.keepWhite) tokens.push(new Token(found, "WHIT", "NEWLINE", this.line));
+ 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);
+ var c = '';
+ while (!stream.look().eof && !(stream.look(-1) == "/" && stream.look(-2) == "*")) {
+ c = stream.next();
+ if (c == "\n") this.line++;
+ found += c;
+ }
+
+ // to start doclet we allow /** or /*** but not /**/ or /****
+ if (/^\/\*\*([^\/]|\*[^*])/.test(found) && this.keepDocs) tokens.push(new Token(found, "COMM", "JSDOC", this.line));
+ else if (this.keepComments) tokens.push(new Token(found, "COMM", "MULTI_LINE_COMM", this.line));
+ 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", this.line));
+ }
+ this.line++;
+ 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", this.line));
+ 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", this.line));
+ 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", this.line));
+ else tokens.push(new Token(found, "NUMB", "DECIMAL", this.line));
+ 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", this.line));
+ 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", this.line));
+ return true;
+ }
+ else {
+ regex += stream.next();
+ }
+ }
+ // error: unterminated regex
+ }
+ return false;
+ }
+});
\ No newline at end of file
--- /dev/null
+//<script type="text/javscript">
+
+
+XObject = imports.XObject.XObject;
+
+
+
+console = imports.console.console;
+Token = imports.Token.Token;
+Lang = imports.Lang.Lang;
+
+
+/**
+ * @class TokenStream
+ *
+ * BC notes:
+ *
+ * nextT => nextTok
+ * lookT => lookTok
+ *
+ */
+
+
+TokenStream = XObject.define(
+
+ /**
+ * @constructor
+ *
+ *
+ */
+
+ function(tokens) {
+
+
+ this.tokens = (tokens || []);
+ // Seed.print(this.tokens.length);
+ this.rewind();
+ },
+ Object,
+ {
+ cursor : -1, // where are we in the stream.
+
+ 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 -1)) {
+ return new Token("", "VOID", "START_OF_STREAM");
+ }
+ 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) {
+ // print(i);
+ if (i < 0) {
+ if (n > -1) {
+ i = 0; continue;
+ }
+ return new Token("", "VOID", "END_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") || 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++;
+ }
+ // should never get here..
+ return false; // because null isn't an object and caller always expects an object;
+
+ },
+
+ /**
+ * @return {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 ???
+ nextTok : function() {
+ return this.nextNonSpace();
+ },
+ 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[]
+ * @param start {String} token name or data (eg. '{'
+ * @param stop {String} (Optional) token name or data (eg. '}'
+ */
+ balance : function(/**String*/start, /**String*/stop) {
+
+ start = typeof(Lang.matching(start)) == 'undefined' ? Lang.punc(start) : start;
+
+ 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 = [];
+ ar.forEach(function(e) {
+ ret.push(e.data);
+ })
+ return ret.join('');
+ },
+ dump: function()
+ {
+ this.tokens.forEach(function(t) {
+ print(t.toString());
+ });
+ }
+});
+
\ 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;
+
+// generic libraries
+XObject = imports.XObject.XObject;
+File = imports.File.File;
+console = imports.console.console;
+Template = imports.JsTemplate.Template.Template;
+
+// Introspecion specific..
+NameSpace = imports.Introspect.NameSpace.NameSpace;
+Link = imports.Introspect.Link.Link;
+
+
+
+var outputdir = Seed.argv[2];
+
+if (!outputdir) {
+ throw {
+ name: "ArgumentError",
+ message: "No output directory specified on the command line\n" +
+ "Usage seed docs.js /var/www/seed [Gtk] \n"
+ };
+}
+
+
+if (!File.isDirectory(outputdir)) {
+ console.log("Creating directory " + outputdir);
+ File.mkdir(outputdir);
+};
+
+
+// Which libraries to build.
+
+var ns_list = NameSpace.namespaces();
+if (typeof(Seed.argv[3]) == 'string') {
+ console.log(Seed.argv.length);
+ ns_list = Seed.argv[3].split(',');
+}
+
+ns_list = ns_list.sort();
+
+
+// which languages do we want to output for.
+langs=[];
+File.list(__script_path__ + '/templates/').forEach(function(f) {
+ if (!File.isDirectory(__script_path__ + '/templates/' + f)) {
+ return;
+ }
+ if (f == 'resources') {
+ return;
+ }
+ langs.push({
+ name : f,
+ cls_template : new Template( {
+ templateFile : __script_path__ + '/templates/' + f + '/class.html',
+ Link : Link // links might be specific to languages..
+ }),
+ cls_ix_template : new Template( {
+ templateFile : __script_path__ + '/templates/' + f + '/class_ix.html',
+ Link : Link // links might be specific to languages..
+ }),
+ reference_template : new Template({
+ templateFile : __script_path__ + '/templates/' + f + '/references.html',
+ Link : Link // links might be specific to languages..
+ }),
+ });
+});
+
+
+/*
+var cls_template = new Template(__script_path__ + '/templates/class.html');
+var cls_ix_template = new Template(__script_path__ + '/templates/class_ix.html');
+var reference_template = new Template(__script_path__ + '/templates/references.html');
+*/
+
+
+var ns_idx = [];
+ns_list.forEach(function(ns_name)
+{
+
+ //if (ns_idx.length) { return ;/* do one - for testing */ }
+
+ var core = imports.gi[ns_name];
+ var idx = { name: ns_name};
+ console.log("START:" + ns_name);
+
+ var ns = NameSpace.ns(ns_name);
+
+ // gir goes in top level...
+ if (File.exists(ns.gir_file)) {
+ File.copyFile(ns.gir_file, outputdir + '/'+ ns.gir_filename, Gio.FileCopyFlags.OVERWRITE);
+ }
+
+
+
+
+ langs.forEach(function(lang) {
+ ns['left_bar'] = lang.cls_ix_template.process(ns);
+ // namespace template
+ Gio.simple_write(outputdir + '/'+ lang.name+ '/' +ns_name + '.html', lang.cls_template.process(ns));
+
+ // left bar index of elements in namespace...
+ Gio.simple_write(outputdir + '/'+ lang.name + '/_ix_'+ ns_name + '.shtml', lang.cls_ix_template.process(ns));
+
+ });
+
+
+ var actions = {
+ 'objects' : 'Class',
+ 'interfaces' : 'Interface',
+ 'structs' : 'Struct',
+ 'unions' : 'Union',
+ 'enums' : 'Enum'
+
+ };
+ for (var i in actions) {
+ // we flag GLib as a GObject lib...
+ idx[i]= ns_name == 'GLib' ? 1 : ns[i].length ;
+ ns[i].forEach( function(n) {
+ var odata = XObject.extend(
+ NameSpace.factory(actions[i], ns_name, n),
+ { 'left_bar' :ns['left_bar'] }
+ );
+ langs.forEach(function(lang) {
+ Gio.simple_write(outputdir + '/'+ lang.name + '/' + ns_name + '.' + n + '.html',
+ lang.cls_template.process(odata)
+ )
+ });
+ console.log(ns_name + '.' +n);
+ });
+ }
+ ns_idx.push(idx);
+
+});
+
+var refs = '';
+var html_file_path = '';
+var html = ''
+
+// output cross reference data..
+langs.forEach(function(lang) {
+
+ for (var i in NameSpace.references) {
+
+ html_file_path = [ outputdir, lang.name, i + '.html'].join('/');
+
+ if (i == 'undefined') {
+ console.log("Undefined name space - ignored");
+ continue;
+ }
+
+ if (!File.isFile(html_file_path)) {
+ console.log("No HTML file " + html_file_path + " to insert references into - ignored");
+ continue;
+ }
+
+ refs = langs.reference_template.process(NameSpace.references[i]);
+
+ // HTML to put refs into
+ html = File.read(html_file_path);
+
+ // do the replacement
+ html = html.replace(/\<!--references--\>/, refs);
+
+ // write back to file
+ Gio.simple_write(html_file_path, html);
+
+ }
+});
+
+// set up index and resources.
+langs.forEach(function(lang) {
+ var ix_template = new Template({
+ templateFile : __script_path__ + '/templates/' + lang.name + '/index.html',
+ Link : Link, // lang specifc?
+ });
+ Gio.simple_write(outputdir + '/' + lang.name + '/index.html', ix_template.process(ns_idx));
+ File.silentRecursiveCopy(__script_path__ + '/templates/resources/',
+ outputdir + '/' + lang.name , Gio.FileCopyFlags.OVERWRITE);
+});
\ No newline at end of file
--- /dev/null
+//<script type="text/javascript">
+
+
+/** NOT CURRENTLY BEING WORKED ON !!! */
+
+
+GLib= imports.gi.GLib;
+Gio = imports.gi.Gio;
+
+Roo = imports['Roo.js'].Roo;
+File = imports['File.js'].File;
+console = imports['console.js'].console;
+
+
+imports['Date.js'].load(Date);
+
+
+// these should come from args
+var SRC='/disk2/checkout/gnome2/';
+
+// perhaps we can just do a simple make for building the girs - no make install etc.?
+var UPDATE_SOURCES = false;
+
+
+
+var LOGFILE = "jhbuild-" + (new Date()).format("Y-m-d-H") + '.log';
+
+
+// change src & deleteGirs when you add / remove girs..
+/*
+
+USAGE:
+screen -d -m seed jhbuild.js
+tail /tmp/builder.log
+
+TODO:
+continue - do not trash gir's...
+use this to diff changes when we fix gobject introspection..
+git diff on directories..
+email me the results.
+run the doc tool as well.
+
+
+patching
+--- before jhbuild..
+--- git diff (current to /SRC/package-DATE.diff)
+--- see if we have a patch list
+--- if so: git reset --hard
+--- apply patch..
+--- run jhbuild.
+
+to add:
+avahi + core.
+babl
+dbus
+
+
+sqlite3
+libbonbo
+
+to fix: - see the list of modules commented out.
+
+*/
+
+
+
+var deleteGirs = [
+ 'atk/atk/Atk-1.0.gir',
+ 'clutter/clutter/json/ClutterJson-1.0.gir',
+ 'clutter/clutter/cogl/Cogl-1.0.gir',
+ 'clutter/clutter/Clutter-1.0.gir',
+ 'clutter/clutter/Cogl-1.0.gir',
+ 'clutter/clutter/ClutterJson-1.0.gir',
+ 'epiphany/src/Epiphany-2.29.gir',
+ 'libgda/libgda/Gda-4.0.gir',
+ 'libgda/libgda-ui/Gdaui-4.0.gir',
+ 'libgsf/gsf/Gsf-1.gir',
+ 'gobject-introspection/gir/libxml2-2.0.gir', // needed!
+ 'gobject-introspection/gir/Gio-2.0.gir',
+ 'gobject-introspection/gir/GModule-2.0.gir',
+ 'gobject-introspection/gir/GLib-2.0.gir',
+ 'gobject-introspection/gir/GIRepository-2.0.gir',
+ 'gobject-introspection/gir/GObject-2.0.gir',
+
+ 'gtk+/gdk-pixbuf/GdkPixbuf-2.0.gir',
+ 'gtk+/gtk/Gtk-2.0.gir',
+ 'gtk+/gdk/Gdk-2.0.gir',
+ 'clutter-gtk/clutter-gtk/GtkClutter-0.10.gir',
+ 'gconf/GConf-2.0.gir',
+ 'gtksourceview/gtksourceview/GtkSource-2.0.gir',
+ 'gstreamer/gst/Gst-0.10.gir',
+ 'gstreamer/libs/gst/check/GstCheck-0.10.gir',
+ 'gstreamer/libs/gst/net/GstNet-0.10.gir',
+ 'gstreamer/libs/gst/controller/GstController-0.10.gir',
+ 'gstreamer/libs/gst/base/GstBase-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/video/GstVideo-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/tag/GstTag-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/interfaces/GstInterfaces-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/pbutils/GstPbutils-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/netbuffer/GstNetbuffer-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/riff/GstRiff-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/audio/GstAudio-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/fft/GstFft-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/rtsp/GstRtsp-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/app/GstApp-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/sdp/GstSdp-0.10.gir',
+ 'gst-plugins-base/gst-libs/gst/rtp/GstRtp-0.10.gir',
+
+ 'gssdp/libgssdp/GSSDP-1.0.gir',
+ 'gdome2/libgdome/Gdome-2.0.gir',
+ 'gnome-menus/libmenu/GMenu-2.0.gir',
+
+
+
+ 'pango/pango/PangoFT2-1.0.gir',
+ 'pango/pango/PangoCairo-1.0.gir',
+ 'pango/pango/PangoXft-1.0.gir',
+ 'pango/pango/Pango-1.0.gir',
+ 'PolicyKit/src/polkit/Polkit-1.0.gir',
+ 'unique/unique/Unique-1.0.gir',
+ 'vte/src/Vte-0.gir',
+
+ 'WebKit/WebKit-1.0.gir',
+ //'WebKit/WebKit/gtk/JSCore-1.0.gir', -- not a generated file!
+
+
+];
+
+var all = {
+
+ // package : directory
+ 'atk' : 'atk',
+ 'clutter': 'clutter',
+ 'clutter-gtk' :'clutter-gtk',
+ 'eggdbus' : 'eggdbus',
+ 'glib' : 'glib' ,
+ 'epiphany' : 'epiphany',
+ 'gtk+' : 'gtk+',
+ 'gobject-introspection' : 'gobject-introspection',
+
+ 'gstreamer' : 'gstreamer',
+ 'gst-plugins-base' : 'gst-plugins-base',
+ 'gtksourceview' : 'gtksourceview',
+ 'gnome-menus' : 'gnome-menus',
+ 'gssdp' :'gssdp',
+ 'libgda' :'libgda',
+ 'libgsf' :'libgsf',
+ 'libunique' :'unique',
+ 'libsoup' : 'libsoup',
+ 'pango' : 'pango',
+ 'polkit' : 'PolicyKit',
+ 'vte' : 'vte',
+ 'WebKit' :'WebKit',
+ 'gconf' : 'gconf',
+ //'gupnp', -- needs patch
+ // 'gnome-keyring' -- ndeds patch
+ // gnome-vfs -- needs patch
+ // 'goocanvas' -- needs patch
+ //'libnotify' -- needs patch
+ // 'poppler' ---
+
+};
+
+// we dont use these at present..
+var patches = {
+ 'gconf' : [
+ 'http://bugzilla-attachments.gnome.org/attachment.cgi?id=156459',
+ 'http://bugzilla-attachments.gnome.org/attachment.cgi?id=156457',
+ ],
+ 'gnome-keyring' : [
+ // not valid - against release..
+ //'http://bugzilla-attachments.gnome.org/attachment.cgi?id=145422'
+ ],
+ 'gtksouceview' : [
+ 'http://bugzilla-attachments.gnome.org/attachment.cgi?id=153062',
+ ],
+ 'avahi' : [
+ 'http://www.akbkhome.com/svn/seed/gir/avahi.diff',
+ ]
+};
+/**
+ *
+ * spawnlog:
+ * spawn process, and print/monitor output.
+ *
+ * usage scenarios:
+ * - global log.. -> our global log just indicates what was done and what was the result?
+ * - build log for a specific package?
+ * - return data? -
+ *
+ * @arg string cwd working directory.
+ * @arg array args
+ * @
+ *
+ */
+var streams = { };
+
+function write(fn, str) {
+ if (!str) {
+ return;
+ }
+
+ if (!fn) {
+ return;
+ }
+ console.log(str.replace(/\n/,''));
+
+ if (typeof(streams[fn])=='undefined') {
+ GLib.unlink(fn);
+ var f = Gio.file_new_for_path(String(fn));
+ streams[fn] = new Gio.DataOutputStream({
+ base_stream: f.replace(null, false, Gio.FileCreateFlags.REPLACE_DESTINATION, null)
+ });
+ }
+ streams[fn].put_string(str, null);
+}
+function close(fn) {
+ if (!fn || typeof(streams[fn])=='undefined') {
+ return;
+ }
+ streams[fn].close(null);
+ delete streams[fn];
+}
+
+
+function spawnlog (cwd, s, outfile, errfile) {
+ var ret = { };
+ var retval = { output: '' , error : '', cmd : s.join(' ') , done : false};
+ console.log(retval.cmd);
+ GLib.spawn_async_with_pipes(cwd, s, null,
+ GLib.SpawnFlags.DO_NOT_REAP_CHILD + GLib.SpawnFlags.SEARCH_PATH ,
+ null, null, ret);
+
+ var ctx = GLib.main_loop_new (null, false);
+ var started = false;
+
+ GLib.child_watch_add(GLib.PRIORITY_DEFAULT, ret.child_pid, function(pid, status) {
+ console.log("GOT STATUS:" + status);
+ retval.status = status;
+ retval.done = true;
+ if (started) {
+ console.log("Ending LOOP");
+ GLib.main_loop_quit(ctx);
+ }
+
+ });
+ //console.dump(ret);
+
+ var in_ch = GLib.io_channel_unix_new(ret.standard_input);
+ var out_ch = GLib.io_channel_unix_new(ret.standard_output);
+ var err_ch = GLib.io_channel_unix_new(ret.standard_error);
+
+ function readstr(ch, fn, prop) {
+
+ while (true) {
+
+ var x = new GLib.String();
+
+
+ var cstatus = GLib.io_channel_get_buffer_condition(ch);
+ cstatus = GLib.io_channel_get_flags (ch)
+
+
+ //Seed.print("WAITING INPUT?" + prop+':'+cstatus);
+ //var status = GLib.io_channel_read_line_string (ch, x, null);
+
+
+ var status = GLib.io_channel_read_line_string (ch, x);
+
+ //Seed.print(prop + ":INPUT:" + status);
+
+ switch(status) {
+ case GLib.IOStatus.NORMAL:
+ write(fn, x.str);
+ retval[prop] += x.str;
+ continue
+ case GLib.IOStatus.AGAIN:
+ break;
+ case GLib.IOStatus.ERROR:
+ case GLib.IOStatus.EOF:
+ break;
+
+ }
+ break;
+ }
+ }
+
+
+
+ GLib.io_add_watch(in_ch, GLib.PRIORITY_DEFAULT,
+ GLib.IOCondition.OUT + GLib.IOCondition.IN + GLib.IOCondition.PRI, function()
+ {
+ //Seed.print("GOT INOUT ON IN");
+ readstr(out_ch, outfile, 'output');
+
+ });
+ GLib.io_add_watch(err_ch, GLib.PRIORITY_DEFAULT,
+ GLib.IOCondition.ERR + GLib.IOCondition.IN + GLib.IOCondition.PRI + GLib.IOCondition.OUT,
+ function()
+ {
+ // Seed.print("GOT INOUT ON ERR");
+ readstr(er_ch, errfile, 'error');
+
+ });
+ // let's just write some data...
+ //var x = new GLib.String();
+ //var status = GLib.io_channel_write (out_ch, "\n", 1);
+
+ //while (!retval.done) {
+
+
+ //}
+
+ // do we need this?
+ if (!retval.done) {
+ started = true;
+ console.log("STARTING LOOP");
+ GLib.main_loop_run(ctx, false); // wait fore exit?
+ }
+ readstr(out_ch, outfile, 'output');
+ readstr(err_ch, errfile, 'error');
+
+
+
+
+ close(outfile);
+ close(errfile);
+
+ //GLib.spawn_close_pid(ret.child_pid);
+ return retval;
+
+
+}
+
+
+function log(res) {
+ if (typeof(res) == 'string') {
+ if (!res.length) { // skip blan.
+ return;
+ }
+
+
+ write(SRC + LOGFILE, '[' + (new Date()).format("Y-m-d H:i:s") + '] ' + res);
+ return;
+ }
+ log("CMD:" + res.cmd +"\n");
+ log("RETURN:" + (res.status ? res.status : "OK")+"\n");
+ log(res.output ? "---OUT---\n" + res.output + "\n" : '');
+ log(res.error ? " ---ERROR---\n" + res.error + "\n" : '');
+
+}
+function logresult(res) {
+ log("CMD: " + res.cmd +"\n");
+ log((res.status ? "RETURN: " + res.status : 'BUILD OK') +"\n");
+ if (res.status != 0 ) {
+ log(res.error ? "---ERROR---\n" + res.error + "\n" : '');
+ }
+
+}
+
+var nojhbuild = {
+ gdome : [ 'git', 'clean', 'make' , 'install' ], // fixme..
+
+
+
+}
+
+function main() {
+ // delete old..
+ deleteGirs.map( function(g) {
+ try {
+ console.log("DELETE" + SRC + g);
+ GLib.unlink(SRC+g);
+ } catch(e) {
+ console.log(e);
+ }
+
+ });
+
+
+
+
+ var pkgs = [];
+ var cline = [];
+ for(var i in all) {
+ pkgs.push(i);
+ cline.push(i);
+ }
+ cline.unshift('list');
+ cline.unshift('jhbuild');
+ var order = spawnlog('/tmp', cline).output.split("\n");
+ // push introspection first...!!!
+
+
+ var buildorder = [];
+ for (var i=0; i < order.length; i++) {
+ if (!order[i].length || pkgs.indexOf(order[i]) < 0) {
+ //console.log("SKIP (not related to gir) " + order[i] );
+ log("SKIP (not related to gir) " + order[i] +"\n");
+ continue;
+ }
+
+ // special cases:
+ // just for our reference..
+ spawnlog('/tmp', ['jhbuild','info', order[i]]);
+ // add -a -c for a clean build..
+
+ if (!UPDATE_SOURCES) {
+ // quick rebuild - probably to check introspection change results.
+ log("MAKE INSTALL: " + order[i] + "\n");
+ var res = spawnlog(
+ SRC+all[order[i]], ['bash' , '-c' ,'make install 2>&1'],
+ SRC+all[order[i]]+'/jhbuild.log',
+ SRC+all[order[i]]+'/jhbuild.err'
+ );
+ logresult(res);
+ continue;
+
+ }
+
+
+ // for git.. - do a diff before we start, and store it..
+ // just in case..
+ if (File.exists(SRC+all[order[i]]+'/.git')) {
+
+ var gitres = spawnlog( SRC + all[order[i]], [ 'git', 'diff' ]);
+
+ var fn = false;
+ if (gitres.output.length) {
+ fn = SRC+all[order[i]]+'-' + (new Date()).format('Y-m-d-H') + '.diff';
+ log("DIFF STORED: "+ fn+"\n");
+ write(fn, gitres.output);
+ close(fn);
+ }
+ log("RESET GIT / PULL\n");
+ spawnlog( SRC + all[order[i]], [ 'git', 'reset', '--hard' ]);
+ spawnlog( SRC + all[order[i]], [ 'git', 'pull' ]);
+ if (fn) {
+ log("RE-APPLING DIFF\n");
+ spawnlog( SRC + all[order[i]], [ 'patch', '-p1', '-i', fn ]);
+ }
+ // we should apply patches here..
+
+ }
+
+
+
+ while(true) {
+
+
+ log("BUILDING : " + order[i] + "\n");
+ var res = spawnlog(
+ '/tmp', ['jhbuild', '--no-interact', 'buildone',order[i]],
+ SRC+all[order[i]]+'/jhbuild.log',
+ SRC+all[order[i]]+'/jhbuild.err'
+ );
+ logresult(res);
+ if (res.status == 256 && res.error.match(/The remote end hung up unexpectedly/)) {
+ // try again - git connection failed..
+ continue;
+ }
+ break;
+ }
+
+
+
+
+ }
+ close(SRC + LOGFILE);
+
+
+}
+
+
+main();
+// specials..
+//polkit -> PolicyKit
+//WebKit -> svn
+//gdome -> manual..
+//libxml2 -> last! and must manual..
+
+// refresh build...
+// we can just trash the gir's..
+// usefull for checking changes in introspection..
+// then run make on the whole lot..
+
+
+// special treatment
+//libxml (must be after introspecton)
+
+
+
+
+
+// full build - needs jhbuild really...
+// ideally:
+// -- will not build stuff that's not changed.. (we need to store checkout id's to make this work..)
+// otherwise do a -a -c
+
+
+
+// what this has to do.. (similar to jhbuild...?? why not use it???
+
\ No newline at end of file
--- /dev/null
+#!/usr/bin/seed
+//<script type="text/javascript">
+/**
+ * packer command line
+ *
+ * -o Output
+ * -O Output debug file here.
+ * -t Translate json file.
+ * -w Cache / working dir.
+ * -f File to read with a list of source paths / or class names.
+ * -C no cleanup (use with -w if you need are using a cache directory.)
+ * -p prefix for translation md5 generator (directory that files are in, and is removed
+ * from path when generating an md5 for the translated name.
+ * compresses files listed as arguments and outputs result
+ */
+File = imports.File.File;
+Packer = imports.JSDOC.Packer..Packer;
+
+
+
+
+var args = Array.prototype.slice.call(Seed.argv);
+args.shift(); //seed
+args.shift(); // pack.js
+var cfg = {
+ files : [],
+ target : false,
+}
+
+
+for(var i =0; i < args.length;i++) {
+ if (args[i] == '-o') {
+ cfg.target = args[i+1];
+ i++;
+ continue;
+ }
+ if (args[i] == '-O') {
+ cfg.debugTarget = args[i+1];
+ i++;
+ continue;
+ }
+ if (args[i] == '-t') {
+ cfg.translateJSON = args[i+1];
+ i++;
+ continue;
+ }
+ if (args[i] == '-w') {
+ cfg.tmpDir = args[i+1];
+ i++;
+ continue;
+ }
+ if (args[i] == '-p') {
+ cfg.prefix = args[i+1];
+ i++;
+ continue;
+ }
+
+ if (args[i] == '-C') {
+ cfg.cleanup = false;
+ continue;
+ }
+ if (args[i] == '-f') {
+ cfg.srcfile = args[i+1];
+ i++;
+ continue;
+ }
+ if (cfg.files.indexOf(args[i]) > -1) {
+ continue; // remove dupes.
+ }
+ cfg.files.push(args[i]);
+}
+var pack;
+try {
+ pack = new Packer(cfg)
+} catch (e) {
+ print("ERROR " + e.toString());
+ throw e;
+}
+if (!pack.target) {
+ print(pack.out);
+}
+
+
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+
+
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:roo="http://www.akbkhome.com/roojs1/" 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>
+
+ <script type="text/javascript" src="page.js"></script>
+
+ <link rel="stylesheet" type="text/css" href="default.css" />
+ <link rel="stylesheet" type="text/css" href="library_gnome.css"></link>
+ <link media="print" rel="stylesheet" type="text/css" href="library_gnome_print.css"></link>
+
+
+ </head>
+
+ <body onload="RooDocsPage.onload();">
+
+ <div id="page">
+
+ <div id="header">
+ <div id="header-wrap">
+ <h1>
+ Un-official Seed Documentation<!-- GNOME Documentation Library-->
+ </h1>
+
+ </div>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+ <div class="left-class-list" style="width:18%;float:left;">
+ <a href="index.html"> Back to Seed Clases </a>
+ <br/><br/>
+ {+data.left_bar+}
+ </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">
+ <p class="res-block-inner">{!
+ var iblock_indent = 0;
+
+
+ data.extendsClasses.reverse().map(
+ function($) {
+
+ output += (iblock_indent ? '<img src="elbow-end.gif" class="elbow elbow_indent' +
+ + iblock_indent + '" alt="parent-child marker"/>' : '');
+ output += new Link().toSymbolLong($.alias);
+ output += "\n<br/>";
+ iblock_indent += 1;
+
+ }
+ )
+
+ !}<img class="elbow elbow_indent{+iblock_indent+}" src="elbow-end.gif" alt="parent-child marker"/>
+ {+data.alias+}
+
+ </p>
+ </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">GIR File:</td>
+ <td class="hd-info"><a href="{+data.gir_filename+}">{+data.gir_filename+}</a></td>
+ </tr>
+ <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</caption>
+ <tr><td>None</td></tr>
+ </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")));
+
+ !}
+ <!-- constructors, then statics, then dynamics -->
+
+
+
+ <if test="!ownMethods.length">
+
+ <table cellspacing="0" class="member-table">
+ <caption class="Empty">Public Methods</caption>
+ <tr><td>None</td></tr>
+ </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</caption>
+ <tr><td>None</td></tr>
+ </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>
+ <!--references-->
+</div>
+</div>
+
+
+<!-- ============================== footer ================================= -->
+ <div class="fineprint" style="clear:both">
+ <if test="data.copyright">©{+data.copyright+}<br /></if>
+ Documentation generated by
+ <a href="http://git.gnome.org/browse/introspection-doc-generator">Introspection Doc Generator</a>
+ Loosely 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>
+
+<if test="data.objects.length > 0">
+ <ul>
+ <for each="c" in="data.objects">
+ <li> {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+ </for>
+ </ul>
+</if>
+
+<h3>Interfaces</h3>
+<if test="data.interfaces.length > 0">
+ <ul>
+ <for each="c" in="data.interfaces">
+ <li> {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+ </for>
+ </ul>
+</if>
+
+<h3>Structs</h3>
+<if test="data.structs.length > 0">
+ <ul>
+ <for each="c" in="data.structs">
+ <li> {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+ </for>
+ </ul>
+</if>
+
+<h3>Unions</h3>
+<if test="data.unions.length > 0">
+ <ul>
+ <for each="c" in="data.unions">
+ <li> {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+ </for>
+ </ul>
+</if>
+
+<h3>Enums</h3>
+<if test="data.enums.length > 0">
+ <ul>
+ <for each="c" in="data.enums">
+ <li> {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+ </for>
+
+ </ul>
+</if>
\ No newline at end of file
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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>
+ <link rel="stylesheet" type="text/css" href="default.css" />
+ <link rel="stylesheet" type="text/css" href="library_gnome.css"></link>
+ <link media="print" rel="stylesheet" type="text/css" href="library_gnome_print.css"></link>
+ </head>
+
+ <body>
+
+ <div id="page">
+
+ <div id="header">
+ <div id="header-wrap">
+ <h1>Un-official Seed Documentation</h1>
+ </div>
+ </div>
+ <div class="body-wrap">
+
+ <div class="ns-list">
+ <h2>GObject Libraries</h2>
+ <for each="thisClass" in="data">
+ {!
+ if (!thisClass.objects) { continue; }
+ !}
+ <div>
+ <h2 class="classTitle">{+ (new Link().toSymbol(thisClass.name)) +}</h2>
+ </div>
+ </for>
+ </div>
+
+ <div class="ns-list">
+
+ <h2>Non - GObject Libraries</h2>
+ <for each="thisClass" in="data">
+ {!
+ if (thisClass.objects) { continue; }
+ !}
+ <div>
+ <h2 class="classTitle">{+ (new Link().toSymbol(thisClass.name)) +}</h2>
+ </div>
+ </for>
+ </div>
+
+ </div>
+ </div>
+</body>
+</html>
+
+
\ 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