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 JsRender.JsRender file;
29 this.el = new Gtk.VPaned();
38 var child_0 = new Xcls_ScrolledWindow2( _this );
40 this.el.pack1 ( child_0.el , true,true );
41 var child_1 = new Xcls_compile_view( _this );
43 this.el.pack2 ( child_1.el , true,true );
46 this.el.size_allocate.connect( (aloc) => {
48 this.width = aloc.width;
49 this.height =aloc.height;
53 // user defined functions
54 public void createThumb () {
57 if (this.file == null) {
60 var filename = this.file.getIconFileName(false);
62 var win = this.el.get_parent_window();
63 var width = win.get_width();
64 var height = win.get_height();
66 Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?
68 screenshot.save(filename,"png");
77 // should we hold until it's printed...
88 public void loadFile (JsRender.JsRender file)
91 // this.el.set_position((int)(this.el.max_position * 0.7));
92 this.el.set_position(this.el.max_position );
95 if (file.tree == null) {
99 if (this.lastObj != null) {
100 this.container.el.remove(this.lastObj);
103 // hide the compile view at present..
109 print("ALLOC SET SIZES %d, %d\n", w,h);
111 // set the container size min to 500/500 or 20 px less than max..
112 w = int.max (w-20, 500);
113 h = int.max (h-20, 500);
115 print("SET SIZES %d, %d\n", w,h);
116 _this.container.el.set_size_request(w,h);
118 _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.
119 var rgba = Gdk.RGBA ();
121 _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);
124 var x = new JsRender.NodeToGtk(file.tree);
125 var obj = x.munge() as Gtk.Widget;
132 this.container.el.add(obj);
138 public class Xcls_ScrolledWindow2 : Object
140 public Gtk.ScrolledWindow el;
141 private Xcls_GtkView _this;
147 public Xcls_ScrolledWindow2(Xcls_GtkView _owner )
150 this.el = new Gtk.ScrolledWindow( null, null );
154 // set gobject values
155 var child_0 = new Xcls_view_layout( _this );
157 this.el.add ( child_0.el );
160 // user defined functions
162 public class Xcls_view_layout : Object
164 public Gtk.Layout el;
165 private Xcls_GtkView _this;
171 public Xcls_view_layout(Xcls_GtkView _owner )
174 _this.view_layout = this;
175 this.el = new Gtk.Layout( null, null );
179 // set gobject values
180 var child_0 = new Xcls_container( _this );
182 this.el.put ( child_0.el , 10,10 );
185 // user defined functions
187 public class Xcls_container : Object
190 private Xcls_GtkView _this;
196 public Xcls_container(Xcls_GtkView _owner )
199 _this.container = this;
200 this.el = new Gtk.HBox( true, 0 );
204 // set gobject values
207 // user defined functions
209 public class Xcls_compile_view : Object
212 private Xcls_GtkView _this;
218 public Xcls_compile_view(Xcls_GtkView _owner )
221 _this.compile_view = this;
222 this.el = new Gtk.VBox( false, 0 );
226 // set gobject values
227 var child_0 = new Xcls_HBox6( _this );
229 this.el.pack_start ( child_0.el , false,false,0 );
230 var child_1 = new Xcls_HBox8( _this );
232 this.el.pack_start ( child_1.el , true,true,0 );
235 // user defined functions
237 public class Xcls_HBox6 : Object
240 private Xcls_GtkView _this;
246 public Xcls_HBox6(Xcls_GtkView _owner )
249 this.el = new Gtk.HBox( true, 0 );
253 // set gobject values
254 var child_0 = new Xcls_Button7( _this );
256 this.el.pack_start ( child_0.el , true,true,0 );
259 // user defined functions
261 public class Xcls_Button7 : Object
263 public Gtk.Button el;
264 private Xcls_GtkView _this;
270 public Xcls_Button7(Xcls_GtkView _owner )
273 this.el = new Gtk.Button();
277 // set gobject values
278 this.el.label = "Full Compile";
281 // user defined functions
283 public class Xcls_HBox8 : Object
286 private Xcls_GtkView _this;
292 public Xcls_HBox8(Xcls_GtkView _owner )
295 this.el = new Gtk.HBox( true, 0 );
299 // set gobject values
300 var child_0 = new Xcls_TreeView9( _this );
302 this.el.add ( child_0.el );
303 var child_1 = new Xcls_ScrolledWindow13( _this );
305 this.el.pack_start ( child_1.el , true,true,0 );
308 // user defined functions
310 public class Xcls_TreeView9 : Object
312 public Gtk.TreeView el;
313 private Xcls_GtkView _this;
319 public Xcls_TreeView9(Xcls_GtkView _owner )
322 this.el = new Gtk.TreeView();
326 // set gobject values
327 var child_0 = new Xcls_ListStore10( _this );
329 this.el.set_model ( child_0.el );
330 var child_1 = new Xcls_column( _this );
334 // user defined functions
336 public class Xcls_ListStore10 : Object
338 public Gtk.ListStore el;
339 private Xcls_GtkView _this;
345 public Xcls_ListStore10(Xcls_GtkView _owner )
348 this.el = new Gtk.ListStore( 1, typeof(string) );
352 // set gobject values
355 // user defined functions
357 public class Xcls_column : Object
359 public Gtk.TreeViewColumn el;
360 private Xcls_GtkView _this;
366 public Xcls_column(Xcls_GtkView _owner )
369 this.el = new Gtk.TreeViewColumn();
373 // set gobject values
374 this.el.title = "Compile output";
375 var child_0 = new Xcls_CellRendererText12( _this );
377 this.el.pack_start ( child_0.el , false );
380 // user defined functions
382 public class Xcls_CellRendererText12 : Object
384 public Gtk.CellRendererText el;
385 private Xcls_GtkView _this;
391 public Xcls_CellRendererText12(Xcls_GtkView _owner )
394 this.el = new Gtk.CellRendererText();
398 // set gobject values
401 // user defined functions
403 public class Xcls_ScrolledWindow13 : Object
405 public Gtk.ScrolledWindow el;
406 private Xcls_GtkView _this;
412 public Xcls_ScrolledWindow13(Xcls_GtkView _owner )
415 this.el = new Gtk.ScrolledWindow( null, null );
419 // set gobject values
420 var child_0 = new Xcls_View14( _this );
422 this.el.add ( child_0.el );
425 // user defined functions
427 public class Xcls_View14 : Object
429 public Gtk.SourceView el;
430 private Xcls_GtkView _this;
436 public Xcls_View14(Xcls_GtkView _owner )
439 this.el = new Gtk.SourceView();
443 // set gobject values
444 this.el.editable = false;
445 this.el.show_line_marks = true;
446 this.el.show_line_numbers = true;
449 // user defined functions