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;
16 public Xcls_sourceview sourceview;
20 public Xcls_MainWindow window;
24 public Xcls_ValaCompileResults()
27 this.el = new Gtk.Popover();
34 this.el.width_request = 600;
35 this.el.height_request = 400;
36 this.el.position = Gtk.PositionType.TOP;
37 new Xcls_compile_view( _this );
38 this.el.set_child ( _this.compile_view.el );
41 // user defined functions
42 public void xaddLine (string str) {
44 if (this.window.windowstate.project.path != BuilderApplication.valasource.file.project.path) {
50 var buf = (GtkSource.Buffer)this.sourceview.el.get_buffer();
52 buf.get_end_iter (out iter);
53 buf.insert(ref iter, str, str.length);
55 buf.get_end_iter (out iter);
56 this.sourceview.el.scroll_to_iter(iter, 0.0f, true, 0.0f, 1.0f);
59 public void show ( Gtk.Widget onbtn, bool reset) {
60 var win = this.window.el;
61 var w = win.get_width();
62 var h = win.get_height();
64 // left tree = 250, editor area = 500?
66 var new_w = int.min(750, w-100);
67 if (new_w > (w-100)) {
70 this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));
71 if (this.el.parent == null) {
72 this.el.set_parent(win);
74 // Gtk.Allocation rect;
75 //onbtn.get_allocation(out rect);
76 //this.el.set_pointing_to(rect);
82 var buf = (GtkSource.Buffer)this.sourceview.el.get_buffer();
90 public class Xcls_compile_view : Object
93 private Xcls_ValaCompileResults _this;
99 public Xcls_compile_view(Xcls_ValaCompileResults _owner )
102 _this.compile_view = this;
103 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
107 // set gobject values
108 this.el.homogeneous = false;
109 this.el.hexpand = true;
110 this.el.vexpand = true;
111 var child_1 = new Xcls_ScrolledWindow3( _this );
113 this.el.append( child_1.el );
116 // user defined functions
118 public class Xcls_ScrolledWindow3 : Object
120 public Gtk.ScrolledWindow el;
121 private Xcls_ValaCompileResults _this;
127 public Xcls_ScrolledWindow3(Xcls_ValaCompileResults _owner )
130 this.el = new Gtk.ScrolledWindow();
134 // set gobject values
135 this.el.hexpand = true;
136 this.el.vexpand = true;
137 new Xcls_sourceview( _this );
138 this.el.child = _this.sourceview.el;
143 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
149 // user defined functions
151 public class Xcls_sourceview : Object
153 public GtkSource.View el;
154 private Xcls_ValaCompileResults _this;
158 public Gtk.CssProvider css;
161 public Xcls_sourceview(Xcls_ValaCompileResults _owner )
164 _this.sourceview = this;
165 this.el = new GtkSource.View();
169 // set gobject values
170 this.el.name = "compile-results-view";
171 this.el.editable = false;
172 this.el.show_line_numbers = false;
173 this.el.hexpand = true;
174 this.el.vexpand = true;
180 this.css = new Gtk.CssProvider();
182 this.css.load_from_string(
183 "#compile-results-view { font: 10px monospace ;}"
186 Gtk.StyleContext.add_provider_for_display(
187 this.el.get_display(),
189 Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
196 // user defined functions