1 static ValaProjectSettings _ValaProjectSettings;
3 public class ValaProjectSettings : Object
6 private ValaProjectSettings _this;
8 public static ValaProjectSettings singleton()
10 if (_ValaProjectSettings == null) {
11 _ValaProjectSettings= new ValaProjectSettings();
13 return _ValaProjectSettings;
15 public Xcls_label_global label_global;
16 public Xcls_label_targets label_targets;
17 public Xcls_compile_flags compile_flags;
18 public Xcls_default_packages_tree_store default_packages_tree_store;
19 public Xcls_packages_render packages_render;
20 public Xcls_packages_render_use packages_render_use;
21 public Xcls_default_directory_tree_store default_directory_tree_store;
22 public Xcls_directory_render directory_render;
23 public Xcls_default_directory_menu default_directory_menu;
24 public Xcls_targets_tree targets_tree;
25 public Xcls_targets_render targets_render;
26 public Xcls_files_render files_render;
29 public Project.Gtk project;
30 public Xcls_MainWindow window;
33 public ValaProjectSettings()
36 this.el = new Gtk.VBox( true, 0 );
43 var child_0 = new Xcls_Notebook2( _this );
45 this.el.pack_start ( child_0.el , true,true,0 );
48 // user defined functions
49 public void show (Project.Gtk project) {
52 print("ValaProjectSettings show\n");
54 this.project= project;
56 this.compile_flags.el.text = "";
58 this.default_directory_tree_store.load();
59 this.default_packages_tree_store.load();
64 public class Xcls_Notebook2 : Object
66 public Gtk.Notebook el;
67 private ValaProjectSettings _this;
73 public Xcls_Notebook2(ValaProjectSettings _owner )
76 this.el = new Gtk.Notebook();
81 var child_0 = new Xcls_label_global( _this );
83 var child_1 = new Xcls_label_targets( _this );
85 var child_2 = new Xcls_VBox5( _this );
87 this.el.append_page ( child_2.el , _this.label_global.el );
88 var child_3 = new Xcls_HPaned27( _this );
90 this.el.append_page ( child_3.el , _this.label_targets.el );
93 // user defined functions
95 public class Xcls_label_global : Object
98 private ValaProjectSettings _this;
104 public Xcls_label_global(ValaProjectSettings _owner )
107 _this.label_global = this;
108 this.el = new Gtk.Label( "Global" );
112 // set gobject values
115 // user defined functions
117 public class Xcls_label_targets : Object
120 private ValaProjectSettings _this;
126 public Xcls_label_targets(ValaProjectSettings _owner )
129 _this.label_targets = this;
130 this.el = new Gtk.Label( "Targets" );
134 // set gobject values
137 // user defined functions
139 public class Xcls_VBox5 : Object
142 private ValaProjectSettings _this;
148 public Xcls_VBox5(ValaProjectSettings _owner )
151 this.el = new Gtk.VBox( false, 0 );
155 // set gobject values
156 var child_0 = new Xcls_Label6( _this );
158 this.el.pack_start ( child_0.el , false,false,0 );
159 var child_1 = new Xcls_compile_flags( _this );
161 this.el.pack_start ( child_1.el , false,false,0 );
162 var child_2 = new Xcls_Label8( _this );
164 this.el.pack_start ( child_2.el , false,false,0 );
165 var child_3 = new Xcls_ScrolledWindow9( _this );
167 this.el.pack_start ( child_3.el , true,true,0 );
168 var child_4 = new Xcls_Label16( _this );
170 this.el.pack_start ( child_4.el , false,false,0 );
171 var child_5 = new Xcls_ScrolledWindow17( _this );
173 this.el.pack_start ( child_5.el , true,true,0 );
176 // user defined functions
178 public class Xcls_Label6 : Object
181 private ValaProjectSettings _this;
187 public Xcls_Label6(ValaProjectSettings _owner )
190 this.el = new Gtk.Label( "compile flags" );
194 // set gobject values
197 // user defined functions
199 public class Xcls_compile_flags : Object
202 private ValaProjectSettings _this;
208 public Xcls_compile_flags(ValaProjectSettings _owner )
211 _this.compile_flags = this;
212 this.el = new Gtk.Entry();
216 // set gobject values
219 // user defined functions
221 public class Xcls_Label8 : Object
224 private ValaProjectSettings _this;
230 public Xcls_Label8(ValaProjectSettings _owner )
233 this.el = new Gtk.Label( "packages" );
237 // set gobject values
240 // user defined functions
242 public class Xcls_ScrolledWindow9 : Object
244 public Gtk.ScrolledWindow el;
245 private ValaProjectSettings _this;
251 public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
254 this.el = new Gtk.ScrolledWindow( null, null );
258 // set gobject values
259 var child_0 = new Xcls_default_packages_tree( _this );
261 this.el.add ( child_0.el );
264 // user defined functions
266 public class Xcls_default_packages_tree : Object
268 public Gtk.TreeView el;
269 private ValaProjectSettings _this;
275 public Xcls_default_packages_tree(ValaProjectSettings _owner )
278 this.el = new Gtk.TreeView();
282 // set gobject values
283 this.el.headers_visible = false;
284 var child_0 = new Xcls_default_packages_tree_store( _this );
286 this.el.set_model ( child_0.el );
287 var child_1 = new Xcls_TreeViewColumn12( _this );
289 this.el.append_column ( child_1.el );
290 var child_2 = new Xcls_TreeViewColumn14( _this );
292 this.el.append_column ( child_2.el );
295 // user defined functions
297 public class Xcls_default_packages_tree_store : Object
299 public Gtk.ListStore el;
300 private ValaProjectSettings _this;
306 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
309 _this.default_packages_tree_store = this;
310 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
315 // set gobject values
318 // user defined functions
319 public void load () {
321 var def = _this.project.compilegroups.get("_default_");
322 var items = def.packages;
325 var pal = (Palete.Gtk) Palete.factory("Gtk");
326 var pkgs = pal.packages();
327 print("ValaProjectSettings:packages load %d\n", pkgs.size);
331 for(var i =0 ; i < pkgs.size; i++) {
332 this.el.append(out citer);
334 this.el.set_value(citer, 0, pkgs.get(i) ); // title
335 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
337 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
341 public class Xcls_TreeViewColumn12 : Object
343 public Gtk.TreeViewColumn el;
344 private ValaProjectSettings _this;
350 public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
353 this.el = new Gtk.TreeViewColumn();
357 // set gobject values
358 this.el.title = "name";
359 this.el.expand = true;
360 this.el.resizable = true;
361 var child_0 = new Xcls_packages_render( _this );
363 this.el.pack_start ( child_0.el , false );
367 this.el.add_attribute(_this.packages_render.el , "text", 0 ); }
369 // user defined functions
371 public class Xcls_packages_render : Object
373 public Gtk.CellRendererText el;
374 private ValaProjectSettings _this;
380 public Xcls_packages_render(ValaProjectSettings _owner )
383 _this.packages_render = this;
384 this.el = new Gtk.CellRendererText();
388 // set gobject values
391 // user defined functions
393 public class Xcls_TreeViewColumn14 : Object
395 public Gtk.TreeViewColumn el;
396 private ValaProjectSettings _this;
402 public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
405 this.el = new Gtk.TreeViewColumn();
409 // set gobject values
410 this.el.title = "use";
411 this.el.resizable = false;
412 this.el.fixed_width = 50;
413 var child_0 = new Xcls_packages_render_use( _this );
415 this.el.pack_start ( child_0.el , false );
420 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
423 // user defined functions
425 public class Xcls_packages_render_use : Object
427 public Gtk.CellRendererToggle el;
428 private ValaProjectSettings _this;
434 public Xcls_packages_render_use(ValaProjectSettings _owner )
437 _this.packages_render_use = this;
438 this.el = new Gtk.CellRendererToggle();
442 // set gobject values
443 this.el.activatable = true;
446 this.el.toggled.connect( ( path_string) => {
447 var m = _this.default_packages_tree_store.el;
449 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
450 m.get_iter (out iter, path);
452 m.get_value(iter, 1, out val);
453 m.set_value(iter, 1, ((bool) val) ? false :true);
458 // user defined functions
460 public class Xcls_Label16 : Object
463 private ValaProjectSettings _this;
469 public Xcls_Label16(ValaProjectSettings _owner )
472 this.el = new Gtk.Label( "Available Directories" );
476 // set gobject values
479 // user defined functions
481 public class Xcls_ScrolledWindow17 : Object
483 public Gtk.ScrolledWindow el;
484 private ValaProjectSettings _this;
490 public Xcls_ScrolledWindow17(ValaProjectSettings _owner )
493 this.el = new Gtk.ScrolledWindow( null, null );
497 // set gobject values
498 var child_0 = new Xcls_default_directory_tree( _this );
500 this.el.add ( child_0.el );
501 var child_1 = new Xcls_default_directory_menu( _this );
505 // user defined functions
507 public class Xcls_default_directory_tree : Object
509 public Gtk.TreeView el;
510 private ValaProjectSettings _this;
516 public Xcls_default_directory_tree(ValaProjectSettings _owner )
519 this.el = new Gtk.TreeView();
523 // set gobject values
524 this.el.headers_visible = false;
525 var child_0 = new Xcls_default_directory_tree_store( _this );
527 this.el.set_model ( child_0.el );
528 var child_1 = new Xcls_TreeViewColumn20( _this );
530 this.el.append_column ( child_1.el );
533 this.el.button_press_event.connect( ( ev) => {
534 //console.log("button press?");
537 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
538 //print("click" + ev.type);
542 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
546 // this.el.get_selection().select_path(res);
548 //if (!this.get('/LeftTreeMenu').el) {
549 // this.get('/LeftTreeMenu').init();
552 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
553 _this.default_directory_menu.el.show_all();
554 _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);
555 // print("click:" + res.path.to_string());
560 // user defined functions
562 public class Xcls_default_directory_tree_store : Object
564 public Gtk.ListStore el;
565 private ValaProjectSettings _this;
571 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
574 _this.default_directory_tree_store = this;
575 this.el = new Gtk.ListStore( 1, typeof(string)
580 // set gobject values
583 // user defined functions
584 public void load () {
589 var def = _this.project.compilegroups.get("_default_");
590 var items = def.sources;
595 for(var i =0 ; i < items.size; i++) {
596 this.el.append(out citer);
598 this.el.set_value(citer, 0, items.get(i) ); // title
599 //this.el.set_value(citer, 1, items.get(i) );
601 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
605 public class Xcls_TreeViewColumn20 : Object
607 public Gtk.TreeViewColumn el;
608 private ValaProjectSettings _this;
614 public Xcls_TreeViewColumn20(ValaProjectSettings _owner )
617 this.el = new Gtk.TreeViewColumn();
621 // set gobject values
622 this.el.title = "name";
623 this.el.resizable = true;
624 var child_0 = new Xcls_directory_render( _this );
626 this.el.pack_start ( child_0.el , false );
630 this.el.add_attribute(_this.directory_render.el , "text", 0 ); }
632 // user defined functions
634 public class Xcls_directory_render : Object
636 public Gtk.CellRendererText el;
637 private ValaProjectSettings _this;
643 public Xcls_directory_render(ValaProjectSettings _owner )
646 _this.directory_render = this;
647 this.el = new Gtk.CellRendererText();
651 // set gobject values
654 // user defined functions
656 public class Xcls_default_directory_menu : Object
659 private ValaProjectSettings _this;
665 public Xcls_default_directory_menu(ValaProjectSettings _owner )
668 _this.default_directory_menu = this;
669 this.el = new Gtk.Menu();
673 // set gobject values
674 var child_0 = new Xcls_MenuItem23( _this );
676 this.el.add ( child_0.el );
677 var child_1 = new Xcls_MenuItem24( _this );
679 this.el.add ( child_1.el );
680 var child_2 = new Xcls_SeparatorMenuItem25( _this );
682 this.el.add ( child_2.el );
683 var child_3 = new Xcls_MenuItem26( _this );
685 this.el.add ( child_3.el );
688 // user defined functions
690 public class Xcls_MenuItem23 : Object
692 public Gtk.MenuItem el;
693 private ValaProjectSettings _this;
699 public Xcls_MenuItem23(ValaProjectSettings _owner )
702 this.el = new Gtk.MenuItem();
706 // set gobject values
707 this.el.label = "Add Directory";
710 this.el.activate.connect( () => {
712 var chooser = new Gtk.FileChooserDialog (
713 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
715 Gtk.ResponseType.CANCEL,
717 Gtk.ResponseType.ACCEPT);
718 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
723 // add the directory..
724 var fn = _this.project.relPath(chooser.get_filename());
725 _this.project.compilegroups.get("_default_").sources.add(fn);
726 _this.default_directory_tree_store.load();
730 // user defined functions
732 public class Xcls_MenuItem24 : Object
734 public Gtk.MenuItem el;
735 private ValaProjectSettings _this;
741 public Xcls_MenuItem24(ValaProjectSettings _owner )
744 this.el = new Gtk.MenuItem();
748 // set gobject values
749 this.el.label = "Add File";
752 this.el.activate.connect( () => {
754 var chooser = new Gtk.FileChooserDialog (
755 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
757 Gtk.ResponseType.CANCEL,
759 Gtk.ResponseType.ACCEPT);
760 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
765 // add the directory..
766 var fn = _this.project.relPath(chooser.get_filename());
767 _this.project.compilegroups.get("_default_").sources.add(fn);
768 _this.default_directory_tree_store.load();
772 // user defined functions
774 public class Xcls_SeparatorMenuItem25 : Object
776 public Gtk.SeparatorMenuItem el;
777 private ValaProjectSettings _this;
783 public Xcls_SeparatorMenuItem25(ValaProjectSettings _owner )
786 this.el = new Gtk.SeparatorMenuItem();
790 // set gobject values
793 // user defined functions
795 public class Xcls_MenuItem26 : Object
797 public Gtk.MenuItem el;
798 private ValaProjectSettings _this;
804 public Xcls_MenuItem26(ValaProjectSettings _owner )
807 this.el = new Gtk.MenuItem();
811 // set gobject values
812 this.el.label = "Remove File/Directory";
815 this.el.activate.connect( () => {
820 if (!_this.default_directory_tree.get_selection().get_selected(out mod, out iter)) {
825 // add the directory..
829 mod.get_value(iter,0, out val);
830 var fn = (string) val;
831 _this.project.compilegroups.get("_default_").sources.remove(fn);
832 _this.default_directory_tree_store.load();
836 // user defined functions
838 public class Xcls_HPaned27 : Object
840 public Gtk.HPaned el;
841 private ValaProjectSettings _this;
847 public Xcls_HPaned27(ValaProjectSettings _owner )
850 this.el = new Gtk.HPaned();
854 // set gobject values
855 this.el.position = 300;
856 var child_0 = new Xcls_ScrolledWindow28( _this );
858 this.el.add1 ( child_0.el );
859 var child_1 = new Xcls_set_vbox( _this );
861 this.el.add2 ( child_1.el );
864 // user defined functions
866 public class Xcls_ScrolledWindow28 : Object
868 public Gtk.ScrolledWindow el;
869 private ValaProjectSettings _this;
875 public Xcls_ScrolledWindow28(ValaProjectSettings _owner )
878 this.el = new Gtk.ScrolledWindow( null, null );
882 // set gobject values
883 var child_0 = new Xcls_targets_tree( _this );
889 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
893 // user defined functions
895 public class Xcls_targets_tree : Object
897 public Gtk.TreeView el;
898 private ValaProjectSettings _this;
904 public Xcls_targets_tree(ValaProjectSettings _owner )
907 _this.targets_tree = this;
908 this.el = new Gtk.TreeView();
912 // set gobject values
913 var child_0 = new Xcls_ListStore30( _this );
915 this.el.set_model ( child_0.el );
916 var child_1 = new Xcls_TreeViewColumn31( _this );
918 this.el.append_column ( child_1.el );
921 // user defined functions
923 public class Xcls_ListStore30 : Object
925 public Gtk.ListStore el;
926 private ValaProjectSettings _this;
932 public Xcls_ListStore30(ValaProjectSettings _owner )
935 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
941 // set gobject values
944 // user defined functions
946 public class Xcls_TreeViewColumn31 : Object
948 public Gtk.TreeViewColumn el;
949 private ValaProjectSettings _this;
955 public Xcls_TreeViewColumn31(ValaProjectSettings _owner )
958 this.el = new Gtk.TreeViewColumn();
962 // set gobject values
963 this.el.title = "name";
964 this.el.resizable = true;
965 var child_0 = new Xcls_targets_render( _this );
967 this.el.pack_start ( child_0.el , false );
971 this.el.add_attribute(_this.targets_render.el , "markup", 2 );
972 this.el.add_attribute(_this.targets_render.el , "text", 1 ); }
974 // user defined functions
976 public class Xcls_targets_render : Object
978 public Gtk.CellRendererText el;
979 private ValaProjectSettings _this;
985 public Xcls_targets_render(ValaProjectSettings _owner )
988 _this.targets_render = this;
989 this.el = new Gtk.CellRendererText();
993 // set gobject values
996 // user defined functions
998 public class Xcls_set_vbox : Object
1001 private ValaProjectSettings _this;
1007 public Xcls_set_vbox(ValaProjectSettings _owner )
1010 this.el = new Gtk.VBox( false, 0 );
1014 // set gobject values
1015 var child_0 = new Xcls_Label34( _this );
1017 this.el.pack_start ( child_0.el , false,false,0 );
1018 var child_1 = new Xcls_build_pack_target( _this );
1020 this.el.pack_start ( child_1.el , false,false,0 );
1021 var child_2 = new Xcls_Label36( _this );
1023 this.el.pack_start ( child_2.el , false,false,0 );
1024 var child_3 = new Xcls_build_compile_flags( _this );
1026 this.el.pack_start ( child_3.el , false,false,0 );
1027 var child_4 = new Xcls_Label38( _this );
1029 this.el.pack_start ( child_4.el , false,false,0 );
1030 var child_5 = new Xcls_ScrolledWindow39( _this );
1032 this.el.pack_start ( child_5.el , true,true,0 );
1035 // user defined functions
1037 public class Xcls_Label34 : Object
1039 public Gtk.Label el;
1040 private ValaProjectSettings _this;
1046 public Xcls_Label34(ValaProjectSettings _owner )
1049 this.el = new Gtk.Label( "target filename" );
1053 // set gobject values
1056 // user defined functions
1058 public class Xcls_build_pack_target : Object
1060 public Gtk.Entry el;
1061 private ValaProjectSettings _this;
1067 public Xcls_build_pack_target(ValaProjectSettings _owner )
1070 this.el = new Gtk.Entry();
1074 // set gobject values
1077 // user defined functions
1079 public class Xcls_Label36 : Object
1081 public Gtk.Label el;
1082 private ValaProjectSettings _this;
1088 public Xcls_Label36(ValaProjectSettings _owner )
1091 this.el = new Gtk.Label( "compile flags" );
1095 // set gobject values
1098 // user defined functions
1100 public class Xcls_build_compile_flags : Object
1102 public Gtk.Entry el;
1103 private ValaProjectSettings _this;
1109 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1112 this.el = new Gtk.Entry();
1116 // set gobject values
1119 // user defined functions
1121 public class Xcls_Label38 : Object
1123 public Gtk.Label el;
1124 private ValaProjectSettings _this;
1130 public Xcls_Label38(ValaProjectSettings _owner )
1133 this.el = new Gtk.Label( "Files to compile" );
1137 // set gobject values
1140 // user defined functions
1142 public class Xcls_ScrolledWindow39 : Object
1144 public Gtk.ScrolledWindow el;
1145 private ValaProjectSettings _this;
1151 public Xcls_ScrolledWindow39(ValaProjectSettings _owner )
1154 this.el = new Gtk.ScrolledWindow( null, null );
1158 // set gobject values
1159 var child_0 = new Xcls_files_tree( _this );
1163 // user defined functions
1165 public class Xcls_files_tree : Object
1167 public Gtk.TreeView el;
1168 private ValaProjectSettings _this;
1174 public Xcls_files_tree(ValaProjectSettings _owner )
1177 this.el = new Gtk.TreeView();
1181 // set gobject values
1182 var child_0 = new Xcls_ListStore41( _this );
1184 this.el.set_model ( child_0.el );
1185 var child_1 = new Xcls_TreeViewColumn42( _this );
1187 this.el.append_column ( child_1.el );
1190 // user defined functions
1192 public class Xcls_ListStore41 : Object
1194 public Gtk.ListStore el;
1195 private ValaProjectSettings _this;
1201 public Xcls_ListStore41(ValaProjectSettings _owner )
1204 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1205 typeof(string) // ??
1210 // set gobject values
1213 // user defined functions
1215 public class Xcls_TreeViewColumn42 : Object
1217 public Gtk.TreeViewColumn el;
1218 private ValaProjectSettings _this;
1224 public Xcls_TreeViewColumn42(ValaProjectSettings _owner )
1227 this.el = new Gtk.TreeViewColumn();
1231 // set gobject values
1232 this.el.title = "name";
1233 this.el.resizable = true;
1234 var child_0 = new Xcls_files_render( _this );
1236 this.el.pack_start ( child_0.el , false );
1240 this.el.add_attribute(_this.files_render.el , "markup", 2 );
1241 this.el.add_attribute(_this.files_render.el , "text", 1 ); }
1243 // user defined functions
1245 public class Xcls_files_render : Object
1247 public Gtk.CellRendererText el;
1248 private ValaProjectSettings _this;
1254 public Xcls_files_render(ValaProjectSettings _owner )
1257 _this.files_render = this;
1258 this.el = new Gtk.CellRendererText();
1262 // set gobject values
1265 // user defined functions