* special ID values
* +XXXX -- indicates it's a instance property / not glob...
* *XXXX -- skip writing glob property (used as classes that can be created...)
- *
+ * _XXXX -- (string) a translatable string.
*
*
* FORMATING?
return "";
}
-
+ public void normalize_key(string key, out string kname, out string kflag, out string ktype)
+ {
+ // key formats : XXXX
+ // XXX - plain
+ // string XXX - with type
+ // $ XXX - with flag (no type)
+ // $ string XXX - with flag
+ kname = "";
+ ktype = "-";
+ kflag = "-";
+ var kk = key.strip().split(" ");
+ switch(kk.length) {
+ case 1:
+ kname = kk[0];
+ return;
+ case 2:
+ kname = kk[1];
+ if (kk[0].length > 1) {
+ ktype = kk[0];
+ } else {
+ kflag = kk[0];
+ }
+ return;
+ case 3:
+ kname = kk[2];
+ kflag = kk[0];
+ ktype = kk[1];
+ return;
+ }
+ // everything blank otherwise...
+ }
public void set(string key, string value) {
this.props.set(key,value);
}
if (Node.gen == null) {
Node.gen = new Json.Generator();
gen.pretty = true;
- gen.indent = 4;
+ gen.indent = 1;
}
var n = new Json.Node(Json.NodeType.OBJECT);
n.set_object(this.toJsonObject () );
{
var ret = this.nodeTitle(true);
var funcs = "";
+ var props = "";
+ var listen = "";
var iter = this.props.map_iterator();
while (iter.next()) {
- var i = iter.get_key();
- //, iter.get_value());
+ var i = iter.get_key().strip();
+ var val = iter.get_value().strip();
+ if (val == null || val.length < 1) {
+ continue;
+ }
if ( i[0] != '|') {
+ props += "\n\t<b>" +
+ GLib.Markup.escape_text(i) +"</b> : " +
+ GLib.Markup.escape_text(val.split("\n")[0]);
+
continue;
}
//if (i == "* init") {
// continue;
//}
- var val = iter.get_value();
+
if (Regex.match_simple("^\\s*function", val)) {
- funcs += "\n<b>" +
- GLib.Markup.escape_text(i.substring(1)) +"</b> : " +
+ funcs += "\n\t<b>" +
+ GLib.Markup.escape_text(i.substring(1)).strip() +"</b> : " +
GLib.Markup.escape_text(val.split("\n")[0]);
continue;
}
if (Regex.match_simple("^\\s*\\(", val)) {
- funcs += "\n<b>" + GLib.Markup.escape_text(i.substring(1)) +
+ funcs += "\n\t<b>" + GLib.Markup.escape_text(i.substring(1)).strip() +
"</b> : " +
GLib.Markup.escape_text(val.split("\n")[0]);
continue;
}
}
+ iter = this.listeners.map_iterator();
+ while (iter.next()) {
+ var i = iter.get_key().strip();
+ var val = iter.get_value().strip();
+ if (val == null || val.length < 1) {
+ continue;
+ }
+ listen += "\n\t<b>" +
+ GLib.Markup.escape_text(i) +"</b> : " +
+ GLib.Markup.escape_text(val.split("\n")[0]);
+
+ }
+
+
+ if (props.length > 0) {
+ ret+="\n\nProperties:" + props;
+ }
if (funcs.length > 0) {
ret+="\n\nMethods:" + funcs;
}
+ if (listen.length > 0) {
+ ret+="\n\nListeners:" + listen;
+ }
return ret;
}
if (this.has("layout")) { txt += ("<i>" + GLib.Markup.escape_text(this.get("layout")) + "</i>"); }
if (this.has("title")) { txt += ("<b>" + GLib.Markup.escape_text(this.get("title")) + "</b>"); }
- if (this.has("html")) { txt += ("<b>" + GLib.Markup.escape_text(this.get("html")) + "</b>"); }
+ if (this.has("html") && this.get("html").length > 0) {
+ var ht = this.get("html").split("\n");
+ if (ht.length > 1) {
+ txt += ("<b>" + GLib.Markup.escape_text(ht[0]) + "...</b>");
+ } else {
+ txt += ("<b>" + GLib.Markup.escape_text(this.get("html")) + "</b>");
+ }
+ }
if (this.has("label")) { txt += ("<b>" + GLib.Markup.escape_text(this.get("label"))+ "</b>"); }
if (this.has("header")) { txt += ("<b>" + GLib.Markup.escape_text(this.get("header")) + "</b>"); }
if (this.has("legend")) { txt += ("<b>" + GLib.Markup.escape_text(this.get("legend")) + "</b>"); }