1 static Xcls_ValaCompileResults _ValaCompileResults;
3 public class Xcls_ValaCompileResults : Object
6 private Xcls_ValaCompileResults _this;
8 public static Xcls_ValaCompileResults singleton()
10 if (_ValaCompileResults == null) {
11 _ValaCompileResults= new Xcls_ValaCompileResults();
13 return _ValaCompileResults;
15 public Xcls_compile_view compile_view;
18 public Xcls_MainWindow window;
20 public JsRender.JsRender? file;
21 public Json.Object notices;
24 public Xcls_ValaCompileResults()
27 this.el = new Gtk.Popover( null );
33 this.el.width_request = 900;
34 this.el.height_request = 800;
36 this.el.position = Gtk.PositionType.TOP;
37 var child_0 = new Xcls_compile_view( _this );
39 this.el.add ( child_0.el );
42 // user defined functions
43 public void show (Json.Object tree, Gtk.Widget onbtn) {
49 //print("looking for %s\n", id);
50 // loop through parent childnre
53 var store = this.compile_result_store.el;
58 tree.foreach_member((obj, file, node) => {
59 // id line "display text", file
61 var title = GLib.Path.get_basename(GLib.Path.get_dirname( file)) + "/" + GLib.Path.get_basename( file) ;
63 print("Add file %s", title);
64 store.append(out iter, null);
65 var lines = tree.get_object_member(file);
66 title += " (" + lines.get_size().to_string() + ")";
67 store.set(iter, 0, file, 1, 0, 2, title, 3, file,-1);
69 lines.foreach_member((obja, line, nodea) => {
71 var ar = lines.get_array_member(line);
72 for (var i = 0 ; i < ar.get_length(); i++) {
73 msg += (msg.length > 0) ? "\n" : "";
74 msg += ar.get_string_element(i);
77 print("Add line %s", line);
78 store.append(out citer, iter);
82 2, GLib.Markup.escape_text(line + ": " + msg),
92 this.window.el.get_size(out w, out h);
94 // left tree = 250, editor area = 500?
96 var new_w = int.min(250, w-100);
97 if (new_w > (w-100)) {
100 this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));
104 if (this.el.relative_to == null) {
105 this.el.set_relative_to(onbtn);
109 while(Gtk.events_pending()) {
110 Gtk.main_iteration();
112 // this.hpane.el.set_position( 0);
114 public class Xcls_compile_view : Object
117 private Xcls_ValaCompileResults _this;
123 public Xcls_compile_view(Xcls_ValaCompileResults _owner )
126 _this.compile_view = this;
127 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
131 // set gobject values
132 this.el.homogeneous = false;
133 var child_0 = new Xcls_ScrolledWindow3( _this );
135 this.el.pack_end ( child_0.el , true,true,0 );
138 // user defined functions
140 public class Xcls_ScrolledWindow3 : Object
142 public Gtk.ScrolledWindow el;
143 private Xcls_ValaCompileResults _this;
149 public Xcls_ScrolledWindow3(Xcls_ValaCompileResults _owner )
152 this.el = new Gtk.ScrolledWindow( null, null );
156 // set gobject values
157 var child_0 = new Xcls_SourceView4( _this );
163 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
169 // user defined functions
171 public class Xcls_SourceView4 : Object
173 public Gtk.SourceView el;
174 private Xcls_ValaCompileResults _this;
180 public Xcls_SourceView4(Xcls_ValaCompileResults _owner )
183 this.el = new Gtk.SourceView();
187 // set gobject values
193 var description = Pango.FontDescription.from_string("monospace");
194 description.set_size(8000);
195 this.el.override_font(description);
201 // user defined functions