1 static Xcls_GtkView _GtkView;
3 public class Xcls_GtkView : Object
6 private Xcls_GtkView _this;
8 public static Xcls_GtkView singleton()
10 if (_GtkView == null) {
11 _GtkView= new Xcls_GtkView();
15 public Xcls_view_layout view_layout;
16 public Xcls_container container;
17 public Xcls_compile_view compile_view;
18 public Xcls_compile_result_store compile_result_store;
21 public Gtk.Widget lastObj;
23 public Xcls_MainWindow main_window;
24 public JsRender.JsRender file;
31 this.el = new Gtk.VPaned();
40 var child_0 = new Xcls_ScrolledWindow2( _this );
42 this.el.pack1 ( child_0.el , true,true );
43 var child_1 = new Xcls_compile_view( _this );
45 this.el.pack2 ( child_1.el , true,true );
48 this.el.size_allocate.connect( (aloc) => {
50 this.width = aloc.width;
51 this.height =aloc.height;
55 // user defined functions
56 public void createThumb () {
59 if (this.file == null) {
62 var filename = this.file.getIconFileName(false);
64 var win = this.el.get_parent_window();
65 var width = win.get_width();
66 var height = win.get_height();
68 Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?
70 screenshot.save(filename,"png");
79 // should we hold until it's printed...
90 public void loadFile (JsRender.JsRender file)
93 // this.el.set_position((int)(this.el.max_position * 0.7));
94 this.el.set_position(this.el.max_position );
97 if (file.tree == null) {
101 if (this.lastObj != null) {
102 this.container.el.remove(this.lastObj);
105 // hide the compile view at present..
111 print("ALLOC SET SIZES %d, %d\n", w,h);
113 // set the container size min to 500/500 or 20 px less than max..
114 w = int.max (w-20, 500);
115 h = int.max (h-20, 500);
117 print("SET SIZES %d, %d\n", w,h);
118 _this.container.el.set_size_request(w,h);
120 _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.
121 var rgba = Gdk.RGBA ();
123 _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);
126 var x = new JsRender.NodeToGtk(file.tree);
127 var obj = x.munge() as Gtk.Widget;
134 this.container.el.add(obj);
140 public void compileNotice ( string type, string file, int line, string message) {
141 // if type = "START"... then we reset the tree?
142 // the issue is that the compiler is continually going..
143 // so editing a file etc.. may change things.?
144 // probably not an issue.
145 if (type =="START") {
149 var ts = _this.compile_result_store;
163 //var tn = ts.nodeFindOrCreate(null,top.to_string(), type);
164 //tn = ts.nodeFindOrCreate(tn, "%d:%s".printf(top, file), file);
165 //ts.nodeFindOrAppend(tn, "%d:%s:%d".printf(top, file,line), message);
174 // 0-2 : fname : line
179 public class Xcls_ScrolledWindow2 : Object
181 public Gtk.ScrolledWindow el;
182 private Xcls_GtkView _this;
188 public Xcls_ScrolledWindow2(Xcls_GtkView _owner )
191 this.el = new Gtk.ScrolledWindow( null, null );
195 // set gobject values
196 var child_0 = new Xcls_view_layout( _this );
198 this.el.add ( child_0.el );
201 // user defined functions
203 public class Xcls_view_layout : Object
205 public Gtk.Layout el;
206 private Xcls_GtkView _this;
212 public Xcls_view_layout(Xcls_GtkView _owner )
215 _this.view_layout = this;
216 this.el = new Gtk.Layout( null, null );
220 // set gobject values
221 var child_0 = new Xcls_container( _this );
223 this.el.put ( child_0.el , 10,10 );
226 // user defined functions
228 public class Xcls_container : Object
231 private Xcls_GtkView _this;
237 public Xcls_container(Xcls_GtkView _owner )
240 _this.container = this;
241 this.el = new Gtk.HBox( true, 0 );
245 // set gobject values
248 // user defined functions
250 public class Xcls_compile_view : Object
253 private Xcls_GtkView _this;
259 public Xcls_compile_view(Xcls_GtkView _owner )
262 _this.compile_view = this;
263 this.el = new Gtk.VBox( false, 0 );
267 // set gobject values
268 var child_0 = new Xcls_HBox6( _this );
270 this.el.pack_start ( child_0.el , false,false,0 );
271 var child_1 = new Xcls_HBox8( _this );
273 this.el.pack_start ( child_1.el , true,true,0 );
276 // user defined functions
278 public class Xcls_HBox6 : Object
281 private Xcls_GtkView _this;
287 public Xcls_HBox6(Xcls_GtkView _owner )
290 this.el = new Gtk.HBox( true, 0 );
294 // set gobject values
295 var child_0 = new Xcls_Button7( _this );
297 this.el.pack_start ( child_0.el , true,true,0 );
300 // user defined functions
302 public class Xcls_Button7 : Object
304 public Gtk.Button el;
305 private Xcls_GtkView _this;
311 public Xcls_Button7(Xcls_GtkView _owner )
314 this.el = new Gtk.Button();
318 // set gobject values
319 this.el.label = "Full Compile";
322 // user defined functions
324 public class Xcls_HBox8 : Object
327 private Xcls_GtkView _this;
333 public Xcls_HBox8(Xcls_GtkView _owner )
336 this.el = new Gtk.HBox( true, 0 );
340 // set gobject values
341 var child_0 = new Xcls_TreeView9( _this );
343 this.el.add ( child_0.el );
344 var child_1 = new Xcls_ScrolledWindow13( _this );
346 this.el.pack_start ( child_1.el , true,true,0 );
349 // user defined functions
351 public class Xcls_TreeView9 : Object
353 public Gtk.TreeView el;
354 private Xcls_GtkView _this;
360 public Xcls_TreeView9(Xcls_GtkView _owner )
363 this.el = new Gtk.TreeView();
367 // set gobject values
368 var child_0 = new Xcls_compile_result_store( _this );
370 this.el.set_model ( child_0.el );
371 var child_1 = new Xcls_column( _this );
375 // user defined functions
377 public class Xcls_compile_result_store : Object
379 public Gtk.TreeStore el;
380 private Xcls_GtkView _this;
386 public Xcls_compile_result_store(Xcls_GtkView _owner )
389 _this.compile_result_store = this;
390 this.el = new Gtk.TreeStore( 4, typeof(string), typeof(int), typeof(string), typeof(string) );
394 // set gobject values
397 // user defined functions
399 public class Xcls_column : Object
401 public Gtk.TreeViewColumn el;
402 private Xcls_GtkView _this;
408 public Xcls_column(Xcls_GtkView _owner )
411 this.el = new Gtk.TreeViewColumn();
415 // set gobject values
416 this.el.title = "Compile output";
417 var child_0 = new Xcls_CellRendererText12( _this );
419 this.el.pack_start ( child_0.el , false );
422 // user defined functions
424 public class Xcls_CellRendererText12 : Object
426 public Gtk.CellRendererText el;
427 private Xcls_GtkView _this;
433 public Xcls_CellRendererText12(Xcls_GtkView _owner )
436 this.el = new Gtk.CellRendererText();
440 // set gobject values
443 // user defined functions
445 public class Xcls_ScrolledWindow13 : Object
447 public Gtk.ScrolledWindow el;
448 private Xcls_GtkView _this;
454 public Xcls_ScrolledWindow13(Xcls_GtkView _owner )
457 this.el = new Gtk.ScrolledWindow( null, null );
461 // set gobject values
462 var child_0 = new Xcls_View14( _this );
464 this.el.add ( child_0.el );
467 // user defined functions
469 public class Xcls_View14 : Object
471 public Gtk.SourceView el;
472 private Xcls_GtkView _this;
478 public Xcls_View14(Xcls_GtkView _owner )
481 this.el = new Gtk.SourceView();
485 // set gobject values
486 this.el.editable = false;
487 this.el.show_line_marks = true;
488 this.el.show_line_numbers = true;
491 // user defined functions