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);
137 public class Xcls_ScrolledWindow2 : Object
139 public Gtk.ScrolledWindow el;
140 private Xcls_GtkView _this;
146 public Xcls_ScrolledWindow2(Xcls_GtkView _owner )
149 this.el = new Gtk.ScrolledWindow( null, null );
153 // set gobject values
154 var child_0 = new Xcls_view_layout( _this );
156 this.el.add ( child_0.el );
159 // user defined functions
161 public class Xcls_view_layout : Object
163 public Gtk.Layout el;
164 private Xcls_GtkView _this;
170 public Xcls_view_layout(Xcls_GtkView _owner )
173 _this.view_layout = this;
174 this.el = new Gtk.Layout( null, null );
178 // set gobject values
179 var child_0 = new Xcls_container( _this );
181 this.el.put ( child_0.el , 10,10 );
184 // user defined functions
186 public class Xcls_container : Object
189 private Xcls_GtkView _this;
195 public Xcls_container(Xcls_GtkView _owner )
198 _this.container = this;
199 this.el = new Gtk.HBox( true, 0 );
203 // set gobject values
206 // user defined functions
208 public class Xcls_compile_view : Object
211 private Xcls_GtkView _this;
217 public Xcls_compile_view(Xcls_GtkView _owner )
220 _this.compile_view = this;
221 this.el = new Gtk.VBox( false, 0 );
225 // set gobject values
226 var child_0 = new Xcls_HBox6( _this );
228 this.el.pack_start ( child_0.el , false,false,0 );
229 var child_1 = new Xcls_HBox8( _this );
231 this.el.pack_start ( child_1.el , true,true,0 );
234 // user defined functions
236 public class Xcls_HBox6 : Object
239 private Xcls_GtkView _this;
245 public Xcls_HBox6(Xcls_GtkView _owner )
248 this.el = new Gtk.HBox( true, 0 );
252 // set gobject values
253 var child_0 = new Xcls_Button7( _this );
255 this.el.pack_start ( child_0.el , true,true,0 );
258 // user defined functions
260 public class Xcls_Button7 : Object
262 public Gtk.Button el;
263 private Xcls_GtkView _this;
269 public Xcls_Button7(Xcls_GtkView _owner )
272 this.el = new Gtk.Button();
276 // set gobject values
277 this.el.label = "Full Compile";
280 // user defined functions
282 public class Xcls_HBox8 : Object
285 private Xcls_GtkView _this;
291 public Xcls_HBox8(Xcls_GtkView _owner )
294 this.el = new Gtk.HBox( true, 0 );
298 // set gobject values
299 var child_0 = new Xcls_TreeView9( _this );
301 this.el.add ( child_0.el );
302 var child_1 = new Xcls_ScrolledWindow13( _this );
304 this.el.pack_start ( child_1.el , true,true,0 );
307 // user defined functions
309 public class Xcls_TreeView9 : Object
311 public Gtk.TreeView el;
312 private Xcls_GtkView _this;
318 public Xcls_TreeView9(Xcls_GtkView _owner )
321 this.el = new Gtk.TreeView();
325 // set gobject values
326 var child_0 = new Xcls_ListStore10( _this );
328 this.el.set_model ( child_0.el );
329 var child_1 = new Xcls_column( _this );
333 // user defined functions
335 public class Xcls_ListStore10 : Object
337 public Gtk.ListStore el;
338 private Xcls_GtkView _this;
344 public Xcls_ListStore10(Xcls_GtkView _owner )
347 this.el = new Gtk.ListStore( 1, typeof(string) );
351 // set gobject values
354 // user defined functions
356 public class Xcls_column : Object
358 public Gtk.TreeViewColumn el;
359 private Xcls_GtkView _this;
365 public Xcls_column(Xcls_GtkView _owner )
368 this.el = new Gtk.TreeViewColumn();
372 // set gobject values
373 this.el.title = "Compile output";
374 var child_0 = new Xcls_CellRendererText12( _this );
376 this.el.pack_start ( child_0.el , false );
379 // user defined functions
381 public class Xcls_CellRendererText12 : Object
383 public Gtk.CellRendererText el;
384 private Xcls_GtkView _this;
390 public Xcls_CellRendererText12(Xcls_GtkView _owner )
393 this.el = new Gtk.CellRendererText();
397 // set gobject values
400 // user defined functions
402 public class Xcls_ScrolledWindow13 : Object
404 public Gtk.ScrolledWindow el;
405 private Xcls_GtkView _this;
411 public Xcls_ScrolledWindow13(Xcls_GtkView _owner )
414 this.el = new Gtk.ScrolledWindow( null, null );
418 // set gobject values
419 var child_0 = new Xcls_View14( _this );
421 this.el.add ( child_0.el );
424 // user defined functions
426 public class Xcls_View14 : Object
428 public Gtk.SourceView el;
429 private Xcls_GtkView _this;
435 public Xcls_View14(Xcls_GtkView _owner )
438 this.el = new Gtk.SourceView();
442 // set gobject values
443 this.el.editable = false;
444 this.el.show_line_marks = true;
445 this.el.show_line_numbers = true;
448 // user defined functions