src/Builder4/ValaCompileErrors.bjs
[app.Builder.js] / src / Builder4 / ValaCompileErrors.vala
1 static Xcls_ValaCompileErrors  _ValaCompileErrors;
2
3 public class Xcls_ValaCompileErrors : Object 
4 {
5     public Gtk.Popover el;
6     private Xcls_ValaCompileErrors  _this;
7
8     public static Xcls_ValaCompileErrors singleton()
9     {
10         if (_ValaCompileErrors == null) {
11             _ValaCompileErrors= new Xcls_ValaCompileErrors();
12         }
13         return _ValaCompileErrors;
14     }
15     public Xcls_compile_view compile_view;
16     public Xcls_compile_tree compile_tree;
17     public Xcls_compile_result_store compile_result_store;
18     public Xcls_renderer renderer;
19
20         // my vars (def)
21     public Xcls_MainWindow window;
22
23     // ctor 
24     public Xcls_ValaCompileErrors()
25     {
26         _this = this;
27         this.el = new Gtk.Popover( null );
28
29         // my vars (dec)
30
31         // set gobject values
32         this.el.position = Gtk.PositionType.TOP;
33         var child_0 = new Xcls_compile_view( _this );
34         child_0.ref();
35         this.el.add (  child_0.el  );
36     }
37
38     // user defined functions 
39     public void show (Json.Object tree, Gtk.Widget onbtn) {
40         this.el.set_relative_to(onbtn);
41             this.el.show_all();
42             
43              //print("looking for %s\n", id);
44             // loop through parent childnre
45               
46             
47             var store = this.compile_result_store.el;    
48             
49             store.clear();
50          
51             
52             tree.foreach_member((obj, file, node) => {
53                 // id line "display text", file
54                 
55                 var title = GLib.Path.get_basename( file) ;
56                 Gtk.TreeIter iter;
57             
58                 store.append(out iter, null);
59                 store.set(iter, 0, file, 1, 0, 2, title, 3, file,-1);
60                 var lines = tree.get_object_member(file);
61                 lines.foreach_member((obja, line, nodea) => {
62                     var msg  = "";
63                     var ar = lines.get_array_member(line);
64                     for (var i = 0 ; i < ar.get_length(); i++) {
65                             msg += (msg.length > 0) ? "\n" : "";
66                             msg += ar.get_string_element(i);
67                     }
68                             Gtk.TreeIter citer;  
69     
70                     store.append(out citer, iter);
71                     store.set(iter, 
72                         0, file + ":" + line, 
73                         1, int.parse(line), 
74                         2, GLib.Markup.escape_text(line + ": " + msg), 
75                         3, file,-1);
76                 
77                 });
78                 
79                 
80             
81             });     
82                  
83     
84     }
85     public class Xcls_compile_view : Object 
86     {
87         public Gtk.VBox el;
88         private Xcls_ValaCompileErrors  _this;
89
90
91             // my vars (def)
92
93         // ctor 
94         public Xcls_compile_view(Xcls_ValaCompileErrors _owner )
95         {
96             _this = _owner;
97             _this.compile_view = this;
98             this.el = new Gtk.VBox( false, 0 );
99
100             // my vars (dec)
101
102             // set gobject values
103             var child_0 = new Xcls_HBox3( _this );
104             child_0.ref();
105             this.el.pack_start (  child_0.el , false,false,0 );
106             var child_1 = new Xcls_HPaned5( _this );
107             child_1.ref();
108             this.el.pack_start (  child_1.el , true,true,0 );
109         }
110
111         // user defined functions 
112     }
113     public class Xcls_HBox3 : Object 
114     {
115         public Gtk.HBox el;
116         private Xcls_ValaCompileErrors  _this;
117
118
119             // my vars (def)
120
121         // ctor 
122         public Xcls_HBox3(Xcls_ValaCompileErrors _owner )
123         {
124             _this = _owner;
125             this.el = new Gtk.HBox( true, 0 );
126
127             // my vars (dec)
128
129             // set gobject values
130             var child_0 = new Xcls_Button4( _this );
131             child_0.ref();
132             this.el.pack_start (  child_0.el , true,true,0 );
133         }
134
135         // user defined functions 
136     }
137     public class Xcls_Button4 : Object 
138     {
139         public Gtk.Button el;
140         private Xcls_ValaCompileErrors  _this;
141
142
143             // my vars (def)
144
145         // ctor 
146         public Xcls_Button4(Xcls_ValaCompileErrors _owner )
147         {
148             _this = _owner;
149             this.el = new Gtk.Button();
150
151             // my vars (dec)
152
153             // set gobject values
154             this.el.label = "Compile and Run";
155         }
156
157         // user defined functions 
158     }
159     public class Xcls_HPaned5 : Object 
160     {
161         public Gtk.HPaned el;
162         private Xcls_ValaCompileErrors  _this;
163
164
165             // my vars (def)
166
167         // ctor 
168         public Xcls_HPaned5(Xcls_ValaCompileErrors _owner )
169         {
170             _this = _owner;
171             this.el = new Gtk.HPaned();
172
173             // my vars (dec)
174
175             // set gobject values
176             var child_0 = new Xcls_ScrolledWindow6( _this );
177             child_0.ref();
178             this.el.add (  child_0.el  );
179             var child_1 = new Xcls_ScrolledWindow11( _this );
180             child_1.ref();
181             this.el.add (  child_1.el  );
182         }
183
184         // user defined functions 
185     }
186     public class Xcls_ScrolledWindow6 : Object 
187     {
188         public Gtk.ScrolledWindow el;
189         private Xcls_ValaCompileErrors  _this;
190
191
192             // my vars (def)
193
194         // ctor 
195         public Xcls_ScrolledWindow6(Xcls_ValaCompileErrors _owner )
196         {
197             _this = _owner;
198             this.el = new Gtk.ScrolledWindow( null, null );
199
200             // my vars (dec)
201
202             // set gobject values
203             var child_0 = new Xcls_compile_tree( _this );
204             child_0.ref();
205             this.el.add (  child_0.el  );
206
207             // init method 
208
209             {
210              this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
211              
212             
213             }
214         }
215
216         // user defined functions 
217     }
218     public class Xcls_compile_tree : Object 
219     {
220         public Gtk.TreeView el;
221         private Xcls_ValaCompileErrors  _this;
222
223
224             // my vars (def)
225
226         // ctor 
227         public Xcls_compile_tree(Xcls_ValaCompileErrors _owner )
228         {
229             _this = _owner;
230             _this.compile_tree = this;
231             this.el = new Gtk.TreeView();
232
233             // my vars (dec)
234
235             // set gobject values
236             var child_0 = new Xcls_compile_result_store( _this );
237             child_0.ref();
238             this.el.set_model (  child_0.el  );
239             var child_1 = new Xcls_column( _this );
240             child_1.ref();
241             this.el.append_column (  child_1.el  );
242         }
243
244         // user defined functions 
245     }
246     public class Xcls_compile_result_store : Object 
247     {
248         public Gtk.TreeStore el;
249         private Xcls_ValaCompileErrors  _this;
250
251
252             // my vars (def)
253
254         // ctor 
255         public Xcls_compile_result_store(Xcls_ValaCompileErrors _owner )
256         {
257             _this = _owner;
258             _this.compile_result_store = this;
259             this.el = new Gtk.TreeStore( 4,   typeof(string), typeof(int), typeof(string), typeof(string)  );
260
261             // my vars (dec)
262
263             // set gobject values
264         }
265
266         // user defined functions 
267     }
268     public class Xcls_column : Object 
269     {
270         public Gtk.TreeViewColumn el;
271         private Xcls_ValaCompileErrors  _this;
272
273
274             // my vars (def)
275
276         // ctor 
277         public Xcls_column(Xcls_ValaCompileErrors _owner )
278         {
279             _this = _owner;
280             this.el = new Gtk.TreeViewColumn();
281
282             // my vars (dec)
283
284             // set gobject values
285             this.el.title = "Compile output";
286             var child_0 = new Xcls_renderer( _this );
287             child_0.ref();
288             this.el.pack_start (  child_0.el , true );
289
290             // init method 
291
292             {
293               this.el.add_attribute(_this.renderer.el , "markup", 2 );
294              
295             }
296         }
297
298         // user defined functions 
299     }
300     public class Xcls_renderer : Object 
301     {
302         public Gtk.CellRendererText el;
303         private Xcls_ValaCompileErrors  _this;
304
305
306             // my vars (def)
307
308         // ctor 
309         public Xcls_renderer(Xcls_ValaCompileErrors _owner )
310         {
311             _this = _owner;
312             _this.renderer = this;
313             this.el = new Gtk.CellRendererText();
314
315             // my vars (dec)
316
317             // set gobject values
318         }
319
320         // user defined functions 
321     }
322     public class Xcls_ScrolledWindow11 : Object 
323     {
324         public Gtk.ScrolledWindow el;
325         private Xcls_ValaCompileErrors  _this;
326
327
328             // my vars (def)
329
330         // ctor 
331         public Xcls_ScrolledWindow11(Xcls_ValaCompileErrors _owner )
332         {
333             _this = _owner;
334             this.el = new Gtk.ScrolledWindow( null, null );
335
336             // my vars (dec)
337
338             // set gobject values
339             var child_0 = new Xcls_SourceView12( _this );
340             child_0.ref();
341             this.el.add (  child_0.el  );
342         }
343
344         // user defined functions 
345     }
346     public class Xcls_SourceView12 : Object 
347     {
348         public Gtk.SourceView el;
349         private Xcls_ValaCompileErrors  _this;
350
351
352             // my vars (def)
353
354         // ctor 
355         public Xcls_SourceView12(Xcls_ValaCompileErrors _owner )
356         {
357             _this = _owner;
358             this.el = new Gtk.SourceView();
359
360             // my vars (dec)
361
362             // set gobject values
363             this.el.editable = false;
364             this.el.show_line_marks = true;
365             this.el.show_line_numbers = true;
366         }
367
368         // user defined functions 
369     }
370 }