if (item.items.size < 1) {
return;
}
for(var i =0;i<item.items.size;i++) {
this.toValaName(item.items.get(i), depth+1);
}
if (item.items.size < 1) {
return;
}
for(var i =0;i<item.items.size;i++) {
this.toValaName(item.items.get(i), depth+1);
}
-
- // class header..
- // class xxx { WrappedGtk el; }
- this.ret += inpad + "public class " + this.xcls + " : Object \n" + this.inpad + "{\n";
- this.ret += this.pad + "public " + this.cls + " el;\n";
-
-
- this.ret += this.pad + "private " + this.top.xcls + " _this;\n\n";
-
-
-
- // singleton
+
+ // class header..
+ // class xxx { WrappedGtk el; }
+ this.ret += inpad + "public class " + this.xcls + " : Object \n" + this.inpad + "{\n";
+ this.ret += this.pad + "public " + this.cls + " el;\n";
+
+
+ this.ret += this.pad + "private " + this.top.xcls + " _this;\n\n";
+
+
+
+ // singleton
- if (depth > 0) {
- return;
- }
- this.ret += pad + "public static " + xcls + " singleton()\n" +
- this.pad + "{\n" +
- this.ipad + "if (_" + this.node.xvala_id + " == null) {\n" +
- this.ipad + " _" + this.node.xvala_id + "= new "+ this.xcls + "();\n" + // what about args?
+ if (depth > 0) {
+ return;
+ }
+ this.ret += pad + "public static " + xcls + " singleton()\n" +
+ this.pad + "{\n" +
+ this.ipad + "if (_" + this.node.xvala_id + " == null) {\n" +
+ this.ipad + " _" + this.node.xvala_id + "= new "+ this.xcls + "();\n" + // what about args?
- if (!n.props.has_key("id") || n.xvala_id.length < 0) {
- continue;
-
- }
- if (n.xvala_id[0] == '*') {
- continue;
- }
- if (n.xvala_id[0] == '+') {
- continue;
- }
- this.ret += this.pad + "public " + n.xvala_xcls + " " + n.xvala_id + ";\n";
- }
-
+ if (!n.props.has_key("id") || n.xvala_id.length < 0) {
+ continue;
+
+ }
+ if (n.xvala_id[0] == '*') {
+ continue;
+ }
+ if (n.xvala_id[0] == '+') {
+ continue;
+ }
+ this.ret += this.pad + "public " + n.xvala_xcls + " " + n.xvala_id + ";\n";
+ }
+
-
- if (ci.xvala_id[0] != '+') {
- continue; // skip generation of children?
-
- }
- this.ret += this.pad + "public " + ci.xvala_xcls + " " + ci.xvala_id.substring(1) + ";\n";
-
-
- }
+
+ if (ci.xvala_id[0] != '+') {
+ continue; // skip generation of children?
+
+ }
+ this.ret += this.pad + "public " + ci.xvala_xcls + " " + ci.xvala_id.substring(1) + ";\n";
+
+
+ }
- // not sure what this is supposed to be ding..
-
- cargs_str = ", " + this.node.get("* args");
- //var ar = this.node.get("* args");.split(",");
- //for (var ari =0; ari < ar.length; ari++) {
- // cargs += (ar[ari].trim().split(" ").pop();
- // }
- }
+ // not sure what this is supposed to be ding..
+
+ cargs_str = ", " + this.node.get("* args");
+ //var ar = this.node.get("* args");.split(",");
+ //for (var ari =0; ari < ar.length; ari++) {
+ // cargs += (ar[ari].trim().split(" ").pop();
+ // }
+ }
this.ret+= this.pad + "public " + this.xcls + "(" +
this.top.xcls + " _owner " + cargs_str + ")\n" + this.pad + "{\n";
}
this.ret+= this.pad + "public " + this.xcls + "(" +
this.top.xcls + " _owner " + cargs_str + ")\n" + this.pad + "{\n";
}
this.ret += this.ipad + "_this = this;\n";
return;
}
this.ret+= this.ipad + "_this = _owner;\n";
if (this.node.props.has_key("id")
this.ret += this.ipad + "_this = this;\n";
return;
}
this.ret+= this.ipad + "_this = _owner;\n";
if (this.node.props.has_key("id")
- &&
- this.node.xvala_id != ""
- &&
- this.node.xvala_id[0] != '*'
- &&
- this.node.xvala_id[0] != '+'
- ) {
- this.ret+= this.ipad + "_this." + node.xvala_id + " = this;\n";
-
+ &&
+ this.node.xvala_id != ""
+ &&
+ this.node.xvala_id[0] != '*'
+ &&
+ this.node.xvala_id[0] != '+'
+ ) {
+ this.ret+= this.ipad + "_this." + node.xvala_id + " = this;\n";
+
- //var meths = this.palete.getPropertiesFor(item['|xns'] + '.' + item.xtype, 'methods');
- //print(JSON.stringify(meths,null,4));Seed.quit();
-
-
-
- // initialize.. my vars..
+ //var meths = this.palete.getPropertiesFor(item['|xns'] + '.' + item.xtype, 'methods');
+ //print(JSON.stringify(meths,null,4));Seed.quit();
+
+
+
+ // initialize.. my vars..
- // what are the properties of this class???
- this.ret += "\n" + this.ipad + "// set gobject values\n";
+ // what are the properties of this class???
+ this.ret += "\n" + this.ipad + "// set gobject values\n";
this.ret += "%sthis.el.%s = %s;\n".printf(ipad,p,v); // // %s, iter.get_value().type);
this.ret += "%sthis.el.%s = %s;\n".printf(ipad,p,v); // // %s, iter.get_value().type);
- continue; // skip generation of children?
- }
-
- var xargs = "";
- if (ci.has("* args")) {
-
- var ar = ci.get("* args").split(",");
- for (var ari = 0 ; ari < ar.length; ari++ ) {
+ continue; // skip generation of children?
+ }
+
+ var xargs = "";
+ if (ci.has("* args")) {
+
+ var ar = ci.get("* args").split(",");
+ for (var ari = 0 ; ari < ar.length; ari++ ) {
- xargs += "," + arg[arg.length -1];
- }
- }
-
- this.ret += this.ipad + "var child_" + "%d".printf(i) + " = new " + ci.xvala_xcls +
+ xargs += "," + arg[arg.length -1];
+ }
+ }
+
+ this.ret += this.ipad + "var child_" + "%d".printf(i) + " = new " + ci.xvala_xcls +
-
- this.ret+= this.ipad + "child_" + "%d".printf(i) +".ref();\n"; // we need to reference increase unnamed children...
-
- if (ci.has("* prop")) {
- this.ret+= ipad + "this.el." + ci.get("* prop") + " = child_" + "%d".printf(i) + ".el;\n";
- continue;
- }
+
+ this.ret+= this.ipad + "child_" + "%d".printf(i) +".ref();\n"; // we need to reference increase unnamed children...
+
+ if (ci.has("* prop")) {
+ this.ret+= ipad + "this.el." + ci.get("* prop") + " = child_" + "%d".printf(i) + ".el;\n";
+ continue;
+ }
- if (!ci.has("pack") || ci.get("pack").down() == "false" || ci.get("pack").down() == "true") {
- continue;
- }
-
- string[] packing = { "add" };
+ if (!ci.has("pack") || ci.get("pack").down() == "false" || ci.get("pack").down() == "true") {
+ continue;
+ }
+
+ string[] packing = { "add" };
- (packing.length > 1 ?
- (", " + string.joinv(",", packing).substring(pack.length+1))
- :
- ""
- ) + " );\n";
-
-
- if (ci.xvala_id[0] != '+') {
- continue; // skip generation of children?
-
- }
- this.ret+= this.ipad + "this." + ci.xvala_id.substring(1) + " = child_" + "%d".printf(i) + ";\n";
-
+ (packing.length > 1 ?
+ (", " + string.joinv(",", packing).substring(pack.length+1))
+ :
+ ""
+ ) + " );\n";
+
+
+ if (ci.xvala_id[0] != '+') {
+ continue; // skip generation of children?
+
+ }
+ this.ret+= this.ipad + "this." + ci.xvala_id.substring(1) + " = child_" + "%d".printf(i) + ";\n";
+
this.ret+= "\n" + ipad + "// listeners \n";
var iter = this.node.listeners.map_iterator();
while (iter.next()) {
var k = iter.get_key();
var v = iter.get_value();
this.ret+= "\n" + ipad + "// listeners \n";
var iter = this.node.listeners.map_iterator();
while (iter.next()) {
var k = iter.get_key();
var v = iter.get_value();
-
- this.ret+= "\n" + pad + "// user defined functions \n";
-
- // user defined functions...
- var iter = this.node.props.map_iterator();
+
+ this.ret+= "\n" + pad + "// user defined functions \n";
+
+ // user defined functions...
+ var iter = this.node.props.map_iterator();
- // function in the format of {type} (args) { .... }
- var kk = k.substring(2);
- var vv = iter.get_value();
- this.ret += this.pad + "public " + kk + " " + this.padMultiline(this.pad, vv) + "\n";
+ // function in the format of {type} (args) { .... }
+ var kk = k.substring(2);
+ var vv = iter.get_value();
+ this.ret += this.pad + "public " + kk + " " + this.padMultiline(this.pad, vv) + "\n";