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;
21 public JsRender.JsRender file;
27 this.el = new Gtk.VPaned();
34 var child_0 = new Xcls_ScrolledWindow2( _this );
36 this.el.pack1 ( child_0.el , true,true );
37 var child_1 = new Xcls_compile_view( _this );
39 this.el.pack2 ( child_1.el , true,true );
42 // user defined functions
43 public void createThumb () {
46 if (this.file == null) {
49 var filename = this.file.getIconFileName(false);
51 var win = this.el.get_parent_window();
52 var width = win.get_width();
53 var height = win.get_height();
55 Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?
57 screenshot.save(filename,"png");
66 // should we hold until it's printed...
77 public void loadFile (JsRender.JsRender file)
80 // this.el.set_position((int)(this.el.max_position * 0.7));
81 this.el.set_position(this.el.max_position );
84 if (file.tree == null) {
88 if (this.lastObj != null) {
89 this.container.el.remove(this.lastObj);
92 // hide the compile view at present..
95 var w = _this.el.get_allocated_width();
96 var h = _this.el.get_allocated_height();
98 print("ALLOC SET SIZES %d, %d\n", w,h);
100 // set the container size min to 500/500 or 20 px less than max..
101 w = int.max (w-20, 500);
102 h = int.max (h-20, 500);
104 print("SET SIZES %d, %d\n", w,h);
105 _this.container.el.set_size_request(w,h);
107 _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.
108 var rgba = Gdk.RGBA ();
110 _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);
113 var x = new JsRender.NodeToGtk(file.tree);
114 var obj = x.munge() as Gtk.Widget;
121 this.container.el.add(obj);
127 public class Xcls_ScrolledWindow2 : Object
129 public Gtk.ScrolledWindow el;
130 private Xcls_GtkView _this;
136 public Xcls_ScrolledWindow2(Xcls_GtkView _owner )
139 this.el = new Gtk.ScrolledWindow( null, null );
143 // set gobject values
144 var child_0 = new Xcls_view_layout( _this );
146 this.el.add ( child_0.el );
149 // user defined functions
151 public class Xcls_view_layout : Object
153 public Gtk.Layout el;
154 private Xcls_GtkView _this;
160 public Xcls_view_layout(Xcls_GtkView _owner )
163 _this.view_layout = this;
164 this.el = new Gtk.Layout( null, null );
168 // set gobject values
169 var child_0 = new Xcls_container( _this );
171 this.el.put ( child_0.el , 10,10 );
174 // user defined functions
176 public class Xcls_container : Object
179 private Xcls_GtkView _this;
185 public Xcls_container(Xcls_GtkView _owner )
188 _this.container = this;
189 this.el = new Gtk.HBox( true, 0 );
193 // set gobject values
196 // user defined functions
198 public class Xcls_compile_view : Object
201 private Xcls_GtkView _this;
207 public Xcls_compile_view(Xcls_GtkView _owner )
210 _this.compile_view = this;
211 this.el = new Gtk.VBox( false, 0 );
215 // set gobject values
216 var child_0 = new Xcls_HBox6( _this );
218 this.el.pack_start ( child_0.el , false,false,0 );
219 var child_1 = new Xcls_HBox8( _this );
221 this.el.pack_start ( child_1.el , true,true,0 );
224 // user defined functions
226 public class Xcls_HBox6 : Object
229 private Xcls_GtkView _this;
235 public Xcls_HBox6(Xcls_GtkView _owner )
238 this.el = new Gtk.HBox( true, 0 );
242 // set gobject values
243 var child_0 = new Xcls_Button7( _this );
245 this.el.pack_start ( child_0.el , true,true,0 );
248 // user defined functions
250 public class Xcls_Button7 : Object
252 public Gtk.Button el;
253 private Xcls_GtkView _this;
259 public Xcls_Button7(Xcls_GtkView _owner )
262 this.el = new Gtk.Button();
266 // set gobject values
267 this.el.label = "Full Compile";
270 // user defined functions
272 public class Xcls_HBox8 : Object
275 private Xcls_GtkView _this;
281 public Xcls_HBox8(Xcls_GtkView _owner )
284 this.el = new Gtk.HBox( true, 0 );
288 // set gobject values
289 var child_0 = new Xcls_TreeView9( _this );
291 this.el.add ( child_0.el );
292 var child_1 = new Xcls_ScrolledWindow13( _this );
294 this.el.pack_start ( child_1.el , true,true,0 );
297 // user defined functions
299 public class Xcls_TreeView9 : Object
301 public Gtk.TreeView el;
302 private Xcls_GtkView _this;
308 public Xcls_TreeView9(Xcls_GtkView _owner )
311 this.el = new Gtk.TreeView();
315 // set gobject values
316 var child_0 = new Xcls_ListStore10( _this );
318 this.el.set_model ( child_0.el );
319 var child_1 = new Xcls_column( _this );
323 // user defined functions
325 public class Xcls_ListStore10 : Object
327 public Gtk.ListStore el;
328 private Xcls_GtkView _this;
334 public Xcls_ListStore10(Xcls_GtkView _owner )
337 this.el = new Gtk.ListStore( 1, typeof(string) );
341 // set gobject values
344 // user defined functions
346 public class Xcls_column : Object
348 public Gtk.TreeViewColumn el;
349 private Xcls_GtkView _this;
355 public Xcls_column(Xcls_GtkView _owner )
358 this.el = new Gtk.TreeViewColumn();
362 // set gobject values
363 this.el.title = "Compile output";
364 var child_0 = new Xcls_CellRendererText12( _this );
366 this.el.pack_start ( child_0.el , false );
369 // user defined functions
371 public class Xcls_CellRendererText12 : Object
373 public Gtk.CellRendererText el;
374 private Xcls_GtkView _this;
380 public Xcls_CellRendererText12(Xcls_GtkView _owner )
383 this.el = new Gtk.CellRendererText();
387 // set gobject values
390 // user defined functions
392 public class Xcls_ScrolledWindow13 : Object
394 public Gtk.ScrolledWindow el;
395 private Xcls_GtkView _this;
401 public Xcls_ScrolledWindow13(Xcls_GtkView _owner )
404 this.el = new Gtk.ScrolledWindow( null, null );
408 // set gobject values
409 var child_0 = new Xcls_View14( _this );
411 this.el.add ( child_0.el );
414 // user defined functions
416 public class Xcls_View14 : Object
418 public Gtk.SourceView el;
419 private Xcls_GtkView _this;
425 public Xcls_View14(Xcls_GtkView _owner )
428 this.el = new Gtk.SourceView();
432 // set gobject values
433 this.el.editable = false;
434 this.el.show_line_marks = true;
435 this.el.show_line_numbers = true;
438 // user defined functions