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;
20 public Gtk.Widget lastObj;
22 public Xcls_MainWindow main_window;
23 public JsRender.JsRender file;
30 this.el = new Gtk.VPaned();
39 var child_0 = new Xcls_ScrolledWindow2( _this );
41 this.el.pack1 ( child_0.el , true,true );
42 var child_1 = new Xcls_compile_view( _this );
44 this.el.pack2 ( child_1.el , true,true );
47 this.el.size_allocate.connect( (aloc) => {
49 this.width = aloc.width;
50 this.height =aloc.height;
54 // user defined functions
55 public void createThumb () {
58 if (this.file == null) {
61 var filename = this.file.getIconFileName(false);
63 var win = this.el.get_parent_window();
64 var width = win.get_width();
65 var height = win.get_height();
67 Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?
69 screenshot.save(filename,"png");
78 // should we hold until it's printed...
89 public void loadFile (JsRender.JsRender file)
92 // this.el.set_position((int)(this.el.max_position * 0.7));
93 this.el.set_position(this.el.max_position );
96 if (file.tree == null) {
100 if (this.lastObj != null) {
101 this.container.el.remove(this.lastObj);
104 // hide the compile view at present..
110 print("ALLOC SET SIZES %d, %d\n", w,h);
112 // set the container size min to 500/500 or 20 px less than max..
113 w = int.max (w-20, 500);
114 h = int.max (h-20, 500);
116 print("SET SIZES %d, %d\n", w,h);
117 _this.container.el.set_size_request(w,h);
119 _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.
120 var rgba = Gdk.RGBA ();
122 _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);
125 var x = new JsRender.NodeToGtk(file.tree);
126 var obj = x.munge() as Gtk.Widget;
133 this.container.el.add(obj);
139 public void compileNotice ( type, file, line, message) {
140 // if type = "START"... then we reset the tree?
141 // the issue is that the compiler is continually going..
142 // so editing a file etc.. may change things.?
143 // probably not an issue.
144 if (type =="START") {
152 public class Xcls_ScrolledWindow2 : Object
154 public Gtk.ScrolledWindow el;
155 private Xcls_GtkView _this;
161 public Xcls_ScrolledWindow2(Xcls_GtkView _owner )
164 this.el = new Gtk.ScrolledWindow( null, null );
168 // set gobject values
169 var child_0 = new Xcls_view_layout( _this );
171 this.el.add ( child_0.el );
174 // user defined functions
176 public class Xcls_view_layout : Object
178 public Gtk.Layout el;
179 private Xcls_GtkView _this;
185 public Xcls_view_layout(Xcls_GtkView _owner )
188 _this.view_layout = this;
189 this.el = new Gtk.Layout( null, null );
193 // set gobject values
194 var child_0 = new Xcls_container( _this );
196 this.el.put ( child_0.el , 10,10 );
199 // user defined functions
201 public class Xcls_container : Object
204 private Xcls_GtkView _this;
210 public Xcls_container(Xcls_GtkView _owner )
213 _this.container = this;
214 this.el = new Gtk.HBox( true, 0 );
218 // set gobject values
221 // user defined functions
223 public class Xcls_compile_view : Object
226 private Xcls_GtkView _this;
232 public Xcls_compile_view(Xcls_GtkView _owner )
235 _this.compile_view = this;
236 this.el = new Gtk.VBox( false, 0 );
240 // set gobject values
241 var child_0 = new Xcls_HBox6( _this );
243 this.el.pack_start ( child_0.el , false,false,0 );
244 var child_1 = new Xcls_HBox8( _this );
246 this.el.pack_start ( child_1.el , true,true,0 );
249 // user defined functions
251 public class Xcls_HBox6 : Object
254 private Xcls_GtkView _this;
260 public Xcls_HBox6(Xcls_GtkView _owner )
263 this.el = new Gtk.HBox( true, 0 );
267 // set gobject values
268 var child_0 = new Xcls_Button7( _this );
270 this.el.pack_start ( child_0.el , true,true,0 );
273 // user defined functions
275 public class Xcls_Button7 : Object
277 public Gtk.Button el;
278 private Xcls_GtkView _this;
284 public Xcls_Button7(Xcls_GtkView _owner )
287 this.el = new Gtk.Button();
291 // set gobject values
292 this.el.label = "Full Compile";
295 // user defined functions
297 public class Xcls_HBox8 : Object
300 private Xcls_GtkView _this;
306 public Xcls_HBox8(Xcls_GtkView _owner )
309 this.el = new Gtk.HBox( true, 0 );
313 // set gobject values
314 var child_0 = new Xcls_TreeView9( _this );
316 this.el.add ( child_0.el );
317 var child_1 = new Xcls_ScrolledWindow13( _this );
319 this.el.pack_start ( child_1.el , true,true,0 );
322 // user defined functions
324 public class Xcls_TreeView9 : Object
326 public Gtk.TreeView el;
327 private Xcls_GtkView _this;
333 public Xcls_TreeView9(Xcls_GtkView _owner )
336 this.el = new Gtk.TreeView();
340 // set gobject values
341 var child_0 = new Xcls_TreeStore10( _this );
343 this.el.set_model ( child_0.el );
344 var child_1 = new Xcls_column( _this );
348 // user defined functions
350 public class Xcls_TreeStore10 : Object
352 public Gtk.TreeStore el;
353 private Xcls_GtkView _this;
359 public Xcls_TreeStore10(Xcls_GtkView _owner )
362 this.el = new Gtk.TreeStore( 1, typeof(string) );
366 // set gobject values
369 // user defined functions
371 public class Xcls_column : Object
373 public Gtk.TreeViewColumn el;
374 private Xcls_GtkView _this;
380 public Xcls_column(Xcls_GtkView _owner )
383 this.el = new Gtk.TreeViewColumn();
387 // set gobject values
388 this.el.title = "Compile output";
389 var child_0 = new Xcls_CellRendererText12( _this );
391 this.el.pack_start ( child_0.el , false );
394 // user defined functions
396 public class Xcls_CellRendererText12 : Object
398 public Gtk.CellRendererText el;
399 private Xcls_GtkView _this;
405 public Xcls_CellRendererText12(Xcls_GtkView _owner )
408 this.el = new Gtk.CellRendererText();
412 // set gobject values
415 // user defined functions
417 public class Xcls_ScrolledWindow13 : Object
419 public Gtk.ScrolledWindow el;
420 private Xcls_GtkView _this;
426 public Xcls_ScrolledWindow13(Xcls_GtkView _owner )
429 this.el = new Gtk.ScrolledWindow( null, null );
433 // set gobject values
434 var child_0 = new Xcls_View14( _this );
436 this.el.add ( child_0.el );
439 // user defined functions
441 public class Xcls_View14 : Object
443 public Gtk.SourceView el;
444 private Xcls_GtkView _this;
450 public Xcls_View14(Xcls_GtkView _owner )
453 this.el = new Gtk.SourceView();
457 // set gobject values
458 this.el.editable = false;
459 this.el.show_line_marks = true;
460 this.el.show_line_numbers = true;
463 // user defined functions