2 "build_module" : "builder",
6 "Gtk.PositionType position" : "Gtk.PositionType.TOP",
7 "JsRender.JsRender? file" : "",
8 "Json.Object notices" : "",
9 "Xcls_MainWindow window" : "",
10 "bool active" : false,
11 "bool hexpand" : false,
13 "id" : "ValaCompileErrors",
14 "int height_request" : 800,
15 "int width_request" : 900,
20 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
21 "bool hexpand" : false,
22 "gboolean homogeneous" : false,
23 "id" : "compile_view",
27 "* pack" : "pack_start,false,false,0",
28 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
32 "* pack" : "pack_start,true,true,0",
33 "utf8 label" : "Compile and Run ",
43 " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
49 "* pack" : "pack_end,true,true,0",
55 " var description = new Pango.FontDescription();",
56 " description.set_size(10000);",
57 " this.el.override_font(description);",
63 "id" : "compile_tree",
67 "* pack" : "set_model",
75 "id" : "compile_result_store",
82 " this.el.add_attribute(_this.renderer.el , \"markup\", 2 );",
87 "* pack" : "append_column",
91 "* pack" : "pack_start,true",
93 "xtype" : "CellRendererText"
96 "string id" : "column",
97 "utf8 title" : "Compile output",
98 "xtype" : "TreeViewColumn"
102 "button_press_event" : [
105 " Gtk.TreeViewColumn col;",
108 " Gtk.TreePath path;",
109 " if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {",
110 " print(\"nothing selected on click\");",
112 " return false; //not on a element.",
117 " if (ev.type != Gdk.EventType.2BUTTON_PRESS || ev.button != 1 ) { ",
123 " Gtk.TreeIter iter;",
124 " var mod = _this.compile_result_store.el;",
125 " mod.get_iter (out iter, path);",
129 " // var val = \"\";",
130 " GLib.Value value;",
131 " _this.compile_result_store.el.get_value(iter, 3, out value);",
132 " var fname = (string)value;",
133 " GLib.Value lvalue;",
134 " _this.compile_result_store.el.get_value(iter, 1, out lvalue);",
135 " var line = (int) lvalue;",
137 " print(\"open %s @ %d\\n\", fname, line);",
142 " var regex = new Regex(\"\\\\.vala$\");",
145 " bjsf = regex.replace(fname,fname.length , 0 , \".bjs\");",
146 " } catch (GLib.RegexError e) {",
149 " var p = _this.window.project;",
153 " var jsr = p.getByPath(bjsf);",
154 " if (jsr != null) {",
155 " _this.window.windowstate.fileViewOpen(jsr, true, line);",
161 " var pf = JsRender.JsRender.factory(\"PlainFile\", p, fname);",
162 " _this.window.windowstate.fileViewOpen(pf, true, line);",
164 " // try hiding the left nav..",
175 "xtype" : "ScrolledWindow"
183 "(Json.Object tree, Gtk.Widget onbtn) {",
186 " this.file = null;",
187 " this.notices = tree;",
189 " //print(\"looking for %s\\n\", id);",
190 " // loop through parent childnre",
193 " var store = this.compile_result_store.el; ",
198 " tree.foreach_member((obj, file, node) => {",
199 " // id line \"display text\", file",
201 " var title = GLib.Path.get_basename(GLib.Path.get_dirname( file)) + \"/\" + GLib.Path.get_basename( file) ;",
202 " Gtk.TreeIter iter;",
203 " print(\"Add file %s\", title);",
204 " store.append(out iter, null);",
205 " var lines = tree.get_object_member(file);",
206 " title += \" (\" + lines.get_size().to_string() + \")\";",
214 " lines.foreach_member((obja, line, nodea) => {",
216 " var ar = lines.get_array_member(line);",
217 " for (var i = 0 ; i < ar.get_length(); i++) {",
218 "\t\t\t\tmsg += (msg.length > 0) ? \"\\n\" : \"\";",
219 "\t\t\t\tmsg += ar.get_string_element(i);",
221 "\t\t Gtk.TreeIter citer; ",
222 "\t\t print(\"Add line %s\", line);",
223 "\t\t store.append(out citer, iter);",
224 "\t\t store.set(citer, ",
225 "\t\t 0, file + \":\" + line, ",
226 "\t\t 1, int.parse(line), ",
227 "\t\t 2, GLib.Markup.escape_text(line + \": \" + msg), ",
236 " store.set_sort_column_id(0,Gtk.SortType.ASCENDING);",
240 " this.window.el.get_size(out w, out h);",
242 " // left tree = 250, editor area = 500?",
245 " var new_w = int.min(450, w-100);",
246 " if (new_w > (w-100)) {",
249 " this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));",
253 " if (this.el.relative_to == null) {",
254 " this.el.set_relative_to(onbtn);",
256 " this.el.show_all();",
258 " while(Gtk.events_pending()) { ",
259 " Gtk.main_iteration();",
261 " // this.hpane.el.set_position( 0);",
268 "name" : "ValaCompileErrors",
270 "path" : "/home/alan/gitlive/roobuilder/src/Builder4/ValaCompileErrors.bjs",