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 default_directory_tree;
22 public Xcls_default_directory_tree_store default_directory_tree_store;
23 public Xcls_directory_render directory_render;
24 public Xcls_default_directory_menu default_directory_menu;
25 public Xcls_targets_tree targets_tree;
26 public Xcls_targets_render targets_render;
27 public Xcls_files_render files_render;
30 public Project.Gtk project;
31 public Xcls_MainWindow window;
34 public ValaProjectSettings()
37 this.el = new Gtk.VBox( true, 0 );
44 var child_0 = new Xcls_Notebook2( _this );
46 this.el.pack_start ( child_0.el , true,true,0 );
49 // user defined functions
50 public void show (Project.Gtk project) {
53 print("ValaProjectSettings show\n");
55 this.project= project;
57 this.compile_flags.el.text = "";
59 this.default_directory_tree_store.load();
60 this.default_packages_tree_store.load();
65 public class Xcls_Notebook2 : Object
67 public Gtk.Notebook el;
68 private ValaProjectSettings _this;
74 public Xcls_Notebook2(ValaProjectSettings _owner )
77 this.el = new Gtk.Notebook();
82 var child_0 = new Xcls_label_global( _this );
84 var child_1 = new Xcls_label_targets( _this );
86 var child_2 = new Xcls_VBox5( _this );
88 this.el.append_page ( child_2.el , _this.label_global.el );
89 var child_3 = new Xcls_HPaned27( _this );
91 this.el.append_page ( child_3.el , _this.label_targets.el );
94 // user defined functions
96 public class Xcls_label_global : Object
99 private ValaProjectSettings _this;
105 public Xcls_label_global(ValaProjectSettings _owner )
108 _this.label_global = this;
109 this.el = new Gtk.Label( "Global" );
113 // set gobject values
116 // user defined functions
118 public class Xcls_label_targets : Object
121 private ValaProjectSettings _this;
127 public Xcls_label_targets(ValaProjectSettings _owner )
130 _this.label_targets = this;
131 this.el = new Gtk.Label( "Targets" );
135 // set gobject values
138 // user defined functions
140 public class Xcls_VBox5 : Object
143 private ValaProjectSettings _this;
149 public Xcls_VBox5(ValaProjectSettings _owner )
152 this.el = new Gtk.VBox( false, 0 );
156 // set gobject values
157 var child_0 = new Xcls_Label6( _this );
159 this.el.pack_start ( child_0.el , false,false,0 );
160 var child_1 = new Xcls_compile_flags( _this );
162 this.el.pack_start ( child_1.el , false,false,0 );
163 var child_2 = new Xcls_Label8( _this );
165 this.el.pack_start ( child_2.el , false,false,0 );
166 var child_3 = new Xcls_ScrolledWindow9( _this );
168 this.el.pack_start ( child_3.el , true,true,0 );
169 var child_4 = new Xcls_Label16( _this );
171 this.el.pack_start ( child_4.el , false,false,0 );
172 var child_5 = new Xcls_ScrolledWindow17( _this );
174 this.el.pack_start ( child_5.el , true,true,0 );
177 // user defined functions
179 public class Xcls_Label6 : Object
182 private ValaProjectSettings _this;
188 public Xcls_Label6(ValaProjectSettings _owner )
191 this.el = new Gtk.Label( "compile flags" );
195 // set gobject values
198 // user defined functions
200 public class Xcls_compile_flags : Object
203 private ValaProjectSettings _this;
209 public Xcls_compile_flags(ValaProjectSettings _owner )
212 _this.compile_flags = this;
213 this.el = new Gtk.Entry();
217 // set gobject values
220 // user defined functions
222 public class Xcls_Label8 : Object
225 private ValaProjectSettings _this;
231 public Xcls_Label8(ValaProjectSettings _owner )
234 this.el = new Gtk.Label( "packages" );
238 // set gobject values
241 // user defined functions
243 public class Xcls_ScrolledWindow9 : Object
245 public Gtk.ScrolledWindow el;
246 private ValaProjectSettings _this;
252 public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
255 this.el = new Gtk.ScrolledWindow( null, null );
259 // set gobject values
260 var child_0 = new Xcls_default_packages_tree( _this );
262 this.el.add ( child_0.el );
265 // user defined functions
267 public class Xcls_default_packages_tree : Object
269 public Gtk.TreeView el;
270 private ValaProjectSettings _this;
276 public Xcls_default_packages_tree(ValaProjectSettings _owner )
279 this.el = new Gtk.TreeView();
283 // set gobject values
284 this.el.headers_visible = false;
285 var child_0 = new Xcls_default_packages_tree_store( _this );
287 this.el.set_model ( child_0.el );
288 var child_1 = new Xcls_TreeViewColumn12( _this );
290 this.el.append_column ( child_1.el );
291 var child_2 = new Xcls_TreeViewColumn14( _this );
293 this.el.append_column ( child_2.el );
296 // user defined functions
298 public class Xcls_default_packages_tree_store : Object
300 public Gtk.ListStore el;
301 private ValaProjectSettings _this;
307 public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
310 _this.default_packages_tree_store = this;
311 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
316 // set gobject values
319 // user defined functions
320 public void load () {
322 var def = _this.project.compilegroups.get("_default_");
323 var items = def.packages;
326 var pal = (Palete.Gtk) Palete.factory("Gtk");
327 var pkgs = pal.packages();
328 print("ValaProjectSettings:packages load %d\n", pkgs.size);
332 for(var i =0 ; i < pkgs.size; i++) {
333 this.el.append(out citer);
335 this.el.set_value(citer, 0, pkgs.get(i) ); // title
336 this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );
338 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
342 public class Xcls_TreeViewColumn12 : Object
344 public Gtk.TreeViewColumn el;
345 private ValaProjectSettings _this;
351 public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
354 this.el = new Gtk.TreeViewColumn();
358 // set gobject values
359 this.el.title = "name";
360 this.el.expand = true;
361 this.el.resizable = true;
362 var child_0 = new Xcls_packages_render( _this );
364 this.el.pack_start ( child_0.el , false );
368 this.el.add_attribute(_this.packages_render.el , "text", 0 ); }
370 // user defined functions
372 public class Xcls_packages_render : Object
374 public Gtk.CellRendererText el;
375 private ValaProjectSettings _this;
381 public Xcls_packages_render(ValaProjectSettings _owner )
384 _this.packages_render = this;
385 this.el = new Gtk.CellRendererText();
389 // set gobject values
392 // user defined functions
394 public class Xcls_TreeViewColumn14 : Object
396 public Gtk.TreeViewColumn el;
397 private ValaProjectSettings _this;
403 public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
406 this.el = new Gtk.TreeViewColumn();
410 // set gobject values
411 this.el.title = "use";
412 this.el.resizable = false;
413 this.el.fixed_width = 50;
414 var child_0 = new Xcls_packages_render_use( _this );
416 this.el.pack_start ( child_0.el , false );
421 this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
424 // user defined functions
426 public class Xcls_packages_render_use : Object
428 public Gtk.CellRendererToggle el;
429 private ValaProjectSettings _this;
435 public Xcls_packages_render_use(ValaProjectSettings _owner )
438 _this.packages_render_use = this;
439 this.el = new Gtk.CellRendererToggle();
443 // set gobject values
444 this.el.activatable = true;
447 this.el.toggled.connect( ( path_string) => {
448 var m = _this.default_packages_tree_store.el;
450 Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);
451 m.get_iter (out iter, path);
453 m.get_value(iter, 1, out val);
454 m.set_value(iter, 1, ((bool) val) ? false :true);
456 m.get_value(iter, 0, out fval);
459 var def = _this.project.compilegroups.get("_default_");
460 var items = def.packages;
468 // user defined functions
470 public class Xcls_Label16 : Object
473 private ValaProjectSettings _this;
479 public Xcls_Label16(ValaProjectSettings _owner )
482 this.el = new Gtk.Label( "Available Directories" );
486 // set gobject values
489 // user defined functions
491 public class Xcls_ScrolledWindow17 : Object
493 public Gtk.ScrolledWindow el;
494 private ValaProjectSettings _this;
500 public Xcls_ScrolledWindow17(ValaProjectSettings _owner )
503 this.el = new Gtk.ScrolledWindow( null, null );
507 // set gobject values
508 var child_0 = new Xcls_default_directory_tree( _this );
510 this.el.add ( child_0.el );
511 var child_1 = new Xcls_default_directory_menu( _this );
515 // user defined functions
517 public class Xcls_default_directory_tree : Object
519 public Gtk.TreeView el;
520 private ValaProjectSettings _this;
526 public Xcls_default_directory_tree(ValaProjectSettings _owner )
529 _this.default_directory_tree = this;
530 this.el = new Gtk.TreeView();
534 // set gobject values
535 this.el.headers_visible = false;
536 var child_0 = new Xcls_default_directory_tree_store( _this );
538 this.el.set_model ( child_0.el );
539 var child_1 = new Xcls_TreeViewColumn20( _this );
541 this.el.append_column ( child_1.el );
544 this.el.button_press_event.connect( ( ev) => {
545 //console.log("button press?");
548 if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {
549 //print("click" + ev.type);
553 //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {
557 // this.el.get_selection().select_path(res);
559 //if (!this.get('/LeftTreeMenu').el) {
560 // this.get('/LeftTreeMenu').init();
563 _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());
564 _this.default_directory_menu.el.show_all();
565 _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);
566 // print("click:" + res.path.to_string());
571 // user defined functions
573 public class Xcls_default_directory_tree_store : Object
575 public Gtk.ListStore el;
576 private ValaProjectSettings _this;
582 public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
585 _this.default_directory_tree_store = this;
586 this.el = new Gtk.ListStore( 1, typeof(string)
591 // set gobject values
594 // user defined functions
595 public void load () {
600 var def = _this.project.compilegroups.get("_default_");
601 var items = def.sources;
606 for(var i =0 ; i < items.size; i++) {
607 this.el.append(out citer);
609 this.el.set_value(citer, 0, items.get(i) ); // title
610 //this.el.set_value(citer, 1, items.get(i) );
612 this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
616 public class Xcls_TreeViewColumn20 : Object
618 public Gtk.TreeViewColumn el;
619 private ValaProjectSettings _this;
625 public Xcls_TreeViewColumn20(ValaProjectSettings _owner )
628 this.el = new Gtk.TreeViewColumn();
632 // set gobject values
633 this.el.title = "name";
634 this.el.resizable = true;
635 var child_0 = new Xcls_directory_render( _this );
637 this.el.pack_start ( child_0.el , false );
641 this.el.add_attribute(_this.directory_render.el , "text", 0 ); }
643 // user defined functions
645 public class Xcls_directory_render : Object
647 public Gtk.CellRendererText el;
648 private ValaProjectSettings _this;
654 public Xcls_directory_render(ValaProjectSettings _owner )
657 _this.directory_render = this;
658 this.el = new Gtk.CellRendererText();
662 // set gobject values
665 // user defined functions
667 public class Xcls_default_directory_menu : Object
670 private ValaProjectSettings _this;
676 public Xcls_default_directory_menu(ValaProjectSettings _owner )
679 _this.default_directory_menu = this;
680 this.el = new Gtk.Menu();
684 // set gobject values
685 var child_0 = new Xcls_MenuItem23( _this );
687 this.el.add ( child_0.el );
688 var child_1 = new Xcls_MenuItem24( _this );
690 this.el.add ( child_1.el );
691 var child_2 = new Xcls_SeparatorMenuItem25( _this );
693 this.el.add ( child_2.el );
694 var child_3 = new Xcls_MenuItem26( _this );
696 this.el.add ( child_3.el );
699 // user defined functions
701 public class Xcls_MenuItem23 : Object
703 public Gtk.MenuItem el;
704 private ValaProjectSettings _this;
710 public Xcls_MenuItem23(ValaProjectSettings _owner )
713 this.el = new Gtk.MenuItem();
717 // set gobject values
718 this.el.label = "Add Directory";
721 this.el.activate.connect( () => {
723 var chooser = new Gtk.FileChooserDialog (
724 "Add a directory", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,
726 Gtk.ResponseType.CANCEL,
728 Gtk.ResponseType.ACCEPT);
729 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
734 // add the directory..
735 var fn = _this.project.relPath(chooser.get_filename());
736 _this.project.compilegroups.get("_default_").sources.add(fn);
737 _this.default_directory_tree_store.load();
741 // user defined functions
743 public class Xcls_MenuItem24 : Object
745 public Gtk.MenuItem el;
746 private ValaProjectSettings _this;
752 public Xcls_MenuItem24(ValaProjectSettings _owner )
755 this.el = new Gtk.MenuItem();
759 // set gobject values
760 this.el.label = "Add File";
763 this.el.activate.connect( () => {
765 var chooser = new Gtk.FileChooserDialog (
766 "Add a directory", _this.window.el, Gtk.FileChooserAction.OPEN ,
768 Gtk.ResponseType.CANCEL,
770 Gtk.ResponseType.ACCEPT);
771 if (chooser.run () != Gtk.ResponseType.ACCEPT) {
776 // add the directory..
777 var fn = _this.project.relPath(chooser.get_filename());
778 _this.project.compilegroups.get("_default_").sources.add(fn);
779 _this.default_directory_tree_store.load();
783 // user defined functions
785 public class Xcls_SeparatorMenuItem25 : Object
787 public Gtk.SeparatorMenuItem el;
788 private ValaProjectSettings _this;
794 public Xcls_SeparatorMenuItem25(ValaProjectSettings _owner )
797 this.el = new Gtk.SeparatorMenuItem();
801 // set gobject values
804 // user defined functions
806 public class Xcls_MenuItem26 : Object
808 public Gtk.MenuItem el;
809 private ValaProjectSettings _this;
815 public Xcls_MenuItem26(ValaProjectSettings _owner )
818 this.el = new Gtk.MenuItem();
822 // set gobject values
823 this.el.label = "Remove File/Directory";
826 this.el.activate.connect( () => {
831 if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {
832 print("nothing selected\n");
837 // add the directory..
841 mod.get_value(iter,0, out val);
842 var fn = (string) val;
844 print("remove: %s\n", fn);
845 if (!_this.project.compilegroups.get("_default_").sources.remove(fn)) {
846 print("remove failed");
848 _this.default_directory_tree_store.load();
852 // user defined functions
854 public class Xcls_HPaned27 : Object
856 public Gtk.HPaned el;
857 private ValaProjectSettings _this;
863 public Xcls_HPaned27(ValaProjectSettings _owner )
866 this.el = new Gtk.HPaned();
870 // set gobject values
871 this.el.position = 300;
872 var child_0 = new Xcls_ScrolledWindow28( _this );
874 this.el.add1 ( child_0.el );
875 var child_1 = new Xcls_set_vbox( _this );
877 this.el.add2 ( child_1.el );
880 // user defined functions
882 public class Xcls_ScrolledWindow28 : Object
884 public Gtk.ScrolledWindow el;
885 private ValaProjectSettings _this;
891 public Xcls_ScrolledWindow28(ValaProjectSettings _owner )
894 this.el = new Gtk.ScrolledWindow( null, null );
898 // set gobject values
899 var child_0 = new Xcls_targets_tree( _this );
905 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
909 // user defined functions
911 public class Xcls_targets_tree : Object
913 public Gtk.TreeView el;
914 private ValaProjectSettings _this;
920 public Xcls_targets_tree(ValaProjectSettings _owner )
923 _this.targets_tree = this;
924 this.el = new Gtk.TreeView();
928 // set gobject values
929 var child_0 = new Xcls_ListStore30( _this );
931 this.el.set_model ( child_0.el );
932 var child_1 = new Xcls_TreeViewColumn31( _this );
934 this.el.append_column ( child_1.el );
937 // user defined functions
939 public class Xcls_ListStore30 : Object
941 public Gtk.ListStore el;
942 private ValaProjectSettings _this;
948 public Xcls_ListStore30(ValaProjectSettings _owner )
951 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
957 // set gobject values
960 // user defined functions
962 public class Xcls_TreeViewColumn31 : Object
964 public Gtk.TreeViewColumn el;
965 private ValaProjectSettings _this;
971 public Xcls_TreeViewColumn31(ValaProjectSettings _owner )
974 this.el = new Gtk.TreeViewColumn();
978 // set gobject values
979 this.el.title = "name";
980 this.el.resizable = true;
981 var child_0 = new Xcls_targets_render( _this );
983 this.el.pack_start ( child_0.el , false );
987 this.el.add_attribute(_this.targets_render.el , "markup", 2 );
988 this.el.add_attribute(_this.targets_render.el , "text", 1 ); }
990 // user defined functions
992 public class Xcls_targets_render : Object
994 public Gtk.CellRendererText el;
995 private ValaProjectSettings _this;
1001 public Xcls_targets_render(ValaProjectSettings _owner )
1004 _this.targets_render = this;
1005 this.el = new Gtk.CellRendererText();
1009 // set gobject values
1012 // user defined functions
1014 public class Xcls_set_vbox : Object
1017 private ValaProjectSettings _this;
1023 public Xcls_set_vbox(ValaProjectSettings _owner )
1026 this.el = new Gtk.VBox( false, 0 );
1030 // set gobject values
1031 var child_0 = new Xcls_Label34( _this );
1033 this.el.pack_start ( child_0.el , false,false,0 );
1034 var child_1 = new Xcls_build_pack_target( _this );
1036 this.el.pack_start ( child_1.el , false,false,0 );
1037 var child_2 = new Xcls_Label36( _this );
1039 this.el.pack_start ( child_2.el , false,false,0 );
1040 var child_3 = new Xcls_build_compile_flags( _this );
1042 this.el.pack_start ( child_3.el , false,false,0 );
1043 var child_4 = new Xcls_Label38( _this );
1045 this.el.pack_start ( child_4.el , false,false,0 );
1046 var child_5 = new Xcls_ScrolledWindow39( _this );
1048 this.el.pack_start ( child_5.el , true,true,0 );
1051 // user defined functions
1053 public class Xcls_Label34 : Object
1055 public Gtk.Label el;
1056 private ValaProjectSettings _this;
1062 public Xcls_Label34(ValaProjectSettings _owner )
1065 this.el = new Gtk.Label( "target filename" );
1069 // set gobject values
1072 // user defined functions
1074 public class Xcls_build_pack_target : Object
1076 public Gtk.Entry el;
1077 private ValaProjectSettings _this;
1083 public Xcls_build_pack_target(ValaProjectSettings _owner )
1086 this.el = new Gtk.Entry();
1090 // set gobject values
1093 // user defined functions
1095 public class Xcls_Label36 : Object
1097 public Gtk.Label el;
1098 private ValaProjectSettings _this;
1104 public Xcls_Label36(ValaProjectSettings _owner )
1107 this.el = new Gtk.Label( "compile flags" );
1111 // set gobject values
1114 // user defined functions
1116 public class Xcls_build_compile_flags : Object
1118 public Gtk.Entry el;
1119 private ValaProjectSettings _this;
1125 public Xcls_build_compile_flags(ValaProjectSettings _owner )
1128 this.el = new Gtk.Entry();
1132 // set gobject values
1135 // user defined functions
1137 public class Xcls_Label38 : Object
1139 public Gtk.Label el;
1140 private ValaProjectSettings _this;
1146 public Xcls_Label38(ValaProjectSettings _owner )
1149 this.el = new Gtk.Label( "Files to compile" );
1153 // set gobject values
1156 // user defined functions
1158 public class Xcls_ScrolledWindow39 : Object
1160 public Gtk.ScrolledWindow el;
1161 private ValaProjectSettings _this;
1167 public Xcls_ScrolledWindow39(ValaProjectSettings _owner )
1170 this.el = new Gtk.ScrolledWindow( null, null );
1174 // set gobject values
1175 var child_0 = new Xcls_files_tree( _this );
1179 // user defined functions
1181 public class Xcls_files_tree : Object
1183 public Gtk.TreeView el;
1184 private ValaProjectSettings _this;
1190 public Xcls_files_tree(ValaProjectSettings _owner )
1193 this.el = new Gtk.TreeView();
1197 // set gobject values
1198 var child_0 = new Xcls_ListStore41( _this );
1200 this.el.set_model ( child_0.el );
1201 var child_1 = new Xcls_TreeViewColumn42( _this );
1203 this.el.append_column ( child_1.el );
1206 // user defined functions
1208 public class Xcls_ListStore41 : Object
1210 public Gtk.ListStore el;
1211 private ValaProjectSettings _this;
1217 public Xcls_ListStore41(ValaProjectSettings _owner )
1220 this.el = new Gtk.ListStore( 2, typeof(string), // 0 key type
1221 typeof(string) // ??
1226 // set gobject values
1229 // user defined functions
1231 public class Xcls_TreeViewColumn42 : Object
1233 public Gtk.TreeViewColumn el;
1234 private ValaProjectSettings _this;
1240 public Xcls_TreeViewColumn42(ValaProjectSettings _owner )
1243 this.el = new Gtk.TreeViewColumn();
1247 // set gobject values
1248 this.el.title = "name";
1249 this.el.resizable = true;
1250 var child_0 = new Xcls_files_render( _this );
1252 this.el.pack_start ( child_0.el , false );
1256 this.el.add_attribute(_this.files_render.el , "markup", 2 );
1257 this.el.add_attribute(_this.files_render.el , "text", 1 ); }
1259 // user defined functions
1261 public class Xcls_files_render : Object
1263 public Gtk.CellRendererText el;
1264 private ValaProjectSettings _this;
1270 public Xcls_files_render(ValaProjectSettings _owner )
1273 _this.files_render = this;
1274 this.el = new Gtk.CellRendererText();
1278 // set gobject values
1281 // user defined functions