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 cs = _this.compile_result_store;
165 title = "Depricated";
171 var tv = cs.nodeFindOrCreate(null, top.to_string(), title);
172 tv = cs.nodeFindOrCreate(tv, "%d:%s".print(top, file), file);
173 cs.nodeAppendOrCreate(tv, "%d:%s:%d".print(top, file,line), file,line, message);
176 public class Xcls_ScrolledWindow2 : Object
178 public Gtk.ScrolledWindow el;
179 private Xcls_GtkView _this;
185 public Xcls_ScrolledWindow2(Xcls_GtkView _owner )
188 this.el = new Gtk.ScrolledWindow( null, null );
192 // set gobject values
193 var child_0 = new Xcls_view_layout( _this );
195 this.el.add ( child_0.el );
198 // user defined functions
200 public class Xcls_view_layout : Object
202 public Gtk.Layout el;
203 private Xcls_GtkView _this;
209 public Xcls_view_layout(Xcls_GtkView _owner )
212 _this.view_layout = this;
213 this.el = new Gtk.Layout( null, null );
217 // set gobject values
218 var child_0 = new Xcls_container( _this );
220 this.el.put ( child_0.el , 10,10 );
223 // user defined functions
225 public class Xcls_container : Object
228 private Xcls_GtkView _this;
234 public Xcls_container(Xcls_GtkView _owner )
237 _this.container = this;
238 this.el = new Gtk.HBox( true, 0 );
242 // set gobject values
245 // user defined functions
247 public class Xcls_compile_view : Object
250 private Xcls_GtkView _this;
256 public Xcls_compile_view(Xcls_GtkView _owner )
259 _this.compile_view = this;
260 this.el = new Gtk.VBox( false, 0 );
264 // set gobject values
265 var child_0 = new Xcls_HBox6( _this );
267 this.el.pack_start ( child_0.el , false,false,0 );
268 var child_1 = new Xcls_HBox8( _this );
270 this.el.pack_start ( child_1.el , true,true,0 );
273 // user defined functions
275 public class Xcls_HBox6 : Object
278 private Xcls_GtkView _this;
284 public Xcls_HBox6(Xcls_GtkView _owner )
287 this.el = new Gtk.HBox( true, 0 );
291 // set gobject values
292 var child_0 = new Xcls_Button7( _this );
294 this.el.pack_start ( child_0.el , true,true,0 );
297 // user defined functions
299 public class Xcls_Button7 : Object
301 public Gtk.Button el;
302 private Xcls_GtkView _this;
308 public Xcls_Button7(Xcls_GtkView _owner )
311 this.el = new Gtk.Button();
315 // set gobject values
316 this.el.label = "Full Compile";
319 // user defined functions
321 public class Xcls_HBox8 : Object
324 private Xcls_GtkView _this;
330 public Xcls_HBox8(Xcls_GtkView _owner )
333 this.el = new Gtk.HBox( true, 0 );
337 // set gobject values
338 var child_0 = new Xcls_TreeView9( _this );
340 this.el.add ( child_0.el );
341 var child_1 = new Xcls_ScrolledWindow13( _this );
343 this.el.pack_start ( child_1.el , true,true,0 );
346 // user defined functions
348 public class Xcls_TreeView9 : Object
350 public Gtk.TreeView el;
351 private Xcls_GtkView _this;
357 public Xcls_TreeView9(Xcls_GtkView _owner )
360 this.el = new Gtk.TreeView();
364 // set gobject values
365 var child_0 = new Xcls_compile_result_store( _this );
367 this.el.set_model ( child_0.el );
368 var child_1 = new Xcls_column( _this );
372 // user defined functions
374 public class Xcls_compile_result_store : Object
376 public Gtk.TreeStore el;
377 private Xcls_GtkView _this;
383 public Xcls_compile_result_store(Xcls_GtkView _owner )
386 _this.compile_result_store = this;
387 this.el = new Gtk.TreeStore( 4, typeof(string), typeof(int), typeof(string), typeof(string) );
391 // set gobject values
394 // user defined functions
395 public Gtk.TreePath nodeFindOrCreate (Gtk.TreePath? par, string id, string title) {
397 // loop through parent childnre
400 this.el.get_iter(out piter, par);
403 if (this.el.iter_children(out iter, par == null ? null : piter)) {
407 this.el.get_value(iter, 0, out val);
408 var sval = (string)val;
410 return this.el.get_path(iter);
412 loop = this.el.iter_next(iter);
415 // create the node...
417 this.el.append(out iter,par == null ? null : piter);
418 this.el.set(iter, id, 0, title, "",-1);
420 return new this.el.get_path(iter);
424 public class Xcls_column : Object
426 public Gtk.TreeViewColumn el;
427 private Xcls_GtkView _this;
433 public Xcls_column(Xcls_GtkView _owner )
436 this.el = new Gtk.TreeViewColumn();
440 // set gobject values
441 this.el.title = "Compile output";
442 var child_0 = new Xcls_CellRendererText12( _this );
444 this.el.pack_start ( child_0.el , false );
447 // user defined functions
449 public class Xcls_CellRendererText12 : Object
451 public Gtk.CellRendererText el;
452 private Xcls_GtkView _this;
458 public Xcls_CellRendererText12(Xcls_GtkView _owner )
461 this.el = new Gtk.CellRendererText();
465 // set gobject values
468 // user defined functions
470 public class Xcls_ScrolledWindow13 : Object
472 public Gtk.ScrolledWindow el;
473 private Xcls_GtkView _this;
479 public Xcls_ScrolledWindow13(Xcls_GtkView _owner )
482 this.el = new Gtk.ScrolledWindow( null, null );
486 // set gobject values
487 var child_0 = new Xcls_View14( _this );
489 this.el.add ( child_0.el );
492 // user defined functions
494 public class Xcls_View14 : Object
496 public Gtk.SourceView el;
497 private Xcls_GtkView _this;
503 public Xcls_View14(Xcls_GtkView _owner )
506 this.el = new Gtk.SourceView();
510 // set gobject values
511 this.el.editable = false;
512 this.el.show_line_marks = true;
513 this.el.show_line_numbers = true;
516 // user defined functions