2 "build_module" : "builder",
3 "gen_extended" : false,
6 "# Project.Gtk project" : "null",
7 "# Project.GtkValaSettings? selected_target" : "null",
8 "# Xcls_MainWindow window" : "null",
9 "# bool cg_loading" : false,
10 "# bool done" : false,
11 "$ Project.Callback doneObj" : "null",
17 "* prop" : "titlebar",
18 "* title" : "Edit Project Details",
22 "* prop" : "title_widget",
23 "string label" : "Change Vala Compile settings",
31 "* pack" : "set_child",
32 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
33 "bool hexpand" : true,
34 "bool vexpand" : true,
38 "bool vexpand" : true,
44 "id" : "label_global",
45 "utf8 label" : "Global",
51 "id" : "label_targets",
52 "utf8 label" : "Targets",
57 "* pack" : "append_page,_this.label_global.el",
58 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
59 "gboolean homogeneous" : false,
63 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
68 "Gtk.Align halign" : "Gtk.Align.START",
69 "bool hexpand" : false,
70 "utf8 label" : "Compile flags:",
75 "id" : "compile_flags",
80 " _this.project.compile_flags = this.el.buffer.text;",
81 " _this.project.save();",
82 "// _this.project.save();",
87 "utf8 placeholder_text" : "eg. -g --valasrc $BASEDIR ",
92 "Gtk.Align halign" : "Gtk.Align.START",
93 "bool hexpand" : false,
94 "utf8 label" : "Version:",
104 " _this.project.version = this.el.buffer.text;",
105 " _this.project.save();",
106 "// _this.project.save();",
111 "utf8 placeholder_text" : "eg. 1.5",
116 "Gtk.Align halign" : "Gtk.Align.START",
117 "bool hexpand" : false,
118 "utf8 label" : "Licence:",
128 " _this.project.licence = this.el.buffer.text;",
129 " _this.project.save();",
130 "// _this.project.save();",
135 "utf8 placeholder_text" : "eg. LGPL",
143 "Gtk.PolicyType hscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
144 "Gtk.PolicyType vscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
145 "bool has_frame" : true,
146 "bool hexpand" : true,
147 "bool vexpand" : true,
148 "id" : "vapi_scroll",
169 "GLib.Type item_type" : "typeof(Project.VapiSelection)",
171 "xtype" : "ListStore"
179 "* prop" : "expression",
180 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
181 "string property_name" : "sortkey",
182 "xtype" : "PropertyExpression"
185 "xtype" : "StringSorter"
188 "xtype" : "SortListModel"
193 "id" : "vapi_filter",
197 "* prop" : "expression",
198 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
199 "string property_name" : "sortkey",
200 "xtype" : "PropertyExpression"
203 "xtype" : "StringFilter"
206 "xtype" : "FilterListModel"
209 "xtype" : "NoSelection"
213 "* pack" : "append_column",
214 "bool expand" : true,
218 "* prop" : "factory",
223 "\tvar lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
225 "\tvar item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
227 "\titem.bind_property(\"name\",",
229 " GLib.BindingFlags.SYNC_CREATE);",
237 "\t//var j = (JsRender.JsRender) item;",
238 "\tvar gi = (Gtk.ListItem)item;",
240 "\tvar lbl = new Gtk.Label(\"\");",
241 "\tlbl.halign = Gtk.Align.START;",
242 "\tgi.set_child(lbl);",
250 "xtype" : "SignalListItemFactory"
253 "string title" : "Vapi Package",
254 "xtype" : "ColumnViewColumn"
258 "* pack" : "append_column",
262 "* prop" : "factory",
266 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
270 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
271 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
274 "\tvar vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();",
276 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
278 "\tbtn.active = vs.selected; ",
281 " \t// bind image...",
289 "\tvar btn = new Gtk.CheckButton();",
291 "\t((Gtk.ListItem)listitem).set_child(btn);",
293 "\tbtn.toggled.connect(() => {",
295 "\t\tvar jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
296 "\t\tjr.selected = btn.active;",
302 "xtype" : "SignalListItemFactory"
305 "string title" : "use",
306 "xtype" : "ColumnViewColumn"
309 "xtype" : "ColumnView"
312 "xtype" : "ScrolledWindow"
316 "id" : "vapi_search",
321 " _this.vapi_filter.el.set_search(this.el.get_text());",
327 "string placeholder_text" : "Search Libraries (Vapi)",
328 "uint search_delay" : 500,
329 "xtype" : "SearchEntry"
336 "* pack" : "append_page,_this.label_targets.el",
337 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
338 "bool vexpand" : true,
339 "gint position" : 300,
343 "* pack" : "set_end_child",
344 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
345 "gboolean homogeneous" : false,
350 "bool vexpand" : true,
360 "id" : "treeselmodel",
370 "\t//this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));",
375 "id" : "treelistsort",
380 "Gtk.TreeListModelCreateModelFunc create_func" : [
382 "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
383 "\treturn ((JsRender.JsRender)item).childfiles;",
386 "bool autoexpand" : true,
387 "bool passthrough" : false,
388 "id" : "treelistmodel",
393 "GLib.Type item_type" : "typeof(JsRender.JsRender)",
395 "xtype" : "ListStore"
398 "xtype" : "TreeListModel"
410 "* prop" : "expression",
411 "GLib.Type this_type" : "typeof(JsRender.JsRender)",
412 "string property_name" : "name",
413 "xtype" : "PropertyExpression"
416 "xtype" : "StringSorter"
419 "xtype" : "TreeListRowSorter"
422 "xtype" : "SortListModel"
427 "Gtk.CustomFilterFunc match_func" : [
430 "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
431 "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
432 "\tvar j = (JsRender.JsRender) tr;",
433 "\tif (j.xtype == \"Gtk\") {",
436 "\tif (j.xtype != \"Dir\") {",
437 "\t\treturn j.path.has_suffix(\".vala\") || j.path.has_suffix(\".c\");",
441 "\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
442 "\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
443 "\t\tif (f.xtype == \"Gtk\") {",
444 "\t\t\treturn true;",
446 "\t\tif (f.path.has_suffix(\".vala\") || f.path.has_suffix(\".c\")) {",
447 "\t\t\treturn true;",
454 "xtype" : "CustomFilter"
457 "xtype" : "FilterListModel"
460 "xtype" : "SingleSelection"
466 "\t this.el.set_sorter( new Gtk.StringSorter(",
467 "\t \tnew Gtk.PropertyExpression(typeof(JsRender.JsRender), null, \"name\")",
474 "* pack" : "append_column",
475 "bool expand" : true,
476 "bool resizable" : true,
481 "* prop" : "factory",
485 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
489 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
490 "\tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
493 "\tvar lbl = (Gtk.Label) expand.child;",
495 "\t if (lbl.label != \"\") { // do not update",
500 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
501 "\tvar jr = (JsRender.JsRender) lr.get_item();",
502 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
503 "\tlbl.label = jr.name; // for dir's we could hsow the sub path..",
504 "\tlbl.tooltip_markup = jr.path;",
506 " expand.set_hide_expander( jr.childfiles.n_items < 1);",
507 " \texpand.set_list_row(lr);",
509 " \texpand.set_hide_expander( jr.xtype != \"Dir\" );",
510 " \t expand.set_list_row(lr);",
512 " \t// bind image...",
520 "\tvar expand = new Gtk.TreeExpander();",
522 "\texpand.set_indent_for_depth(true);",
523 "\texpand.set_indent_for_icon(true);",
525 "\tvar lbl = new Gtk.Label(\"\");",
526 "\tlbl.use_markup = true;",
529 " \tlbl.justify = Gtk.Justification.LEFT;",
530 " \tlbl.xalign = 0;",
533 "\texpand.set_child(lbl);",
534 "\t((Gtk.ListItem)listitem).set_child(expand);",
535 "\t((Gtk.ListItem)listitem).activatable = false;",
540 "xtype" : "SignalListItemFactory"
543 "string title" : "Other Files",
544 "xtype" : "ColumnViewColumn"
548 "* pack" : "append_column",
552 "* prop" : "factory",
556 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
560 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
561 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
564 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
565 "\tvar jr = (JsRender.JsRender) lr.get_item();",
566 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
568 "\t//btn.active = jr.compile_group_selected;",
569 "\tbtn.active = _this.selected_target.has_file(jr);",
571 " \t//jr.bind_property(\"compile_group_selected\",",
572 " // btn, \"active\",",
573 " // GLib.BindingFlags.BIDIRECTIONAL); ",
574 " \t// bind image...",
581 "\tvar btn = new Gtk.CheckButton();",
583 "\t((Gtk.ListItem)listitem).set_child(btn);",
585 "\tbtn.toggled.connect(() => {",
586 "\t \tif (_this.cg_loading) {",
589 "\t\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
590 "\t\tvar jr = (JsRender.JsRender) lr.get_item();",
591 "\t\tjr.compile_group_selected = btn.active;",
599 "xtype" : "SignalListItemFactory"
602 "string title" : "use",
603 "xtype" : "ColumnViewColumn"
606 "xtype" : "ColumnView"
609 "xtype" : "ScrolledWindow"
616 "* prop" : "start_child",
617 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
622 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
623 "bool hexpand" : true,
628 "bool hexpand" : true,
633 " if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {",
636 " var cg = new Project.GtkValaSettings(_this.project, \"NEW GROUP\");",
637 " _this.project.compilegroups.set(cg.name, cg);",
638 " _this.project.loadTargetsIntoStore(_this.target_model.el);",
639 " // select it.. ?? should load it??",
640 " for(var i =0;i < _this.target_model.el.n_items; i++) {",
641 " \tvar ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);",
642 " \tif (ncg.name == cg.name) {",
643 " \t\t_this.target_sel.el.selected = i;",
644 " \t\t_this.target_sel.selectTarget(cg);",
654 "utf8 label" : "Add Compile Target",
659 "bool hexpand" : true,
663 " // load the new values.",
664 "\tif (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {",
665 "\t\tGLib.debug(\"nothing selected\");",
670 "\t// add the directory..",
671 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);",
674 "\tGLib.debug(\"remove: %s\\n\", cg.name);",
675 "\tif (!_this.project.compilegroups.unset(cg.name)) {",
676 "\t\tGLib.debug(\"remove failed\");",
678 " \t_this.project.loadTargetsIntoStore(_this.target_model.el);",
682 "utf8 label" : "Remove Target",
692 "this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
697 "bool vexpand" : true,
711 "GLib.Type item_type" : "typeof(Project.GtkValaSettings)",
712 "id" : "target_model",
713 "xtype" : "ListStore"
717 "selection_changed" : [
718 "(position, n_items) => {",
721 "\t// load the new values.",
722 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
723 "\t\tthis.selectTarget(null);",
726 "\tthis.selectTarget(null);",
730 "\t// add the directory..",
731 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);",
733 "\tthis.selectTarget(cg);",
739 "xtype" : "SingleSelection",
740 "| void selectTarget" : [
741 "(Project.GtkValaSettings? cg) {",
742 "// load the new values",
743 "\t _this.selected_target = cg; ",
744 "\t _this.project.active_cg = cg;",
747 "\tif (cg == null) {",
749 "\t\t_this.set_vbox.el.hide();\t",
750 "\t\t_this.set_vboxb.el.hide();\t",
755 "\t_this.set_vbox.el.show();",
756 "\t_this.set_vboxb.el.show();",
757 "\t// add the directory..",
760 "\t GLib.debug(\"loading dirs into project list\");",
761 "\t cg.loading_ui = true;",
762 "\t _this.cg_loading = true;",
764 "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
765 "\t _this.project.loadDirsIntoStore(_this.treemodel.el);",
766 " \t _this.treeview.el.set_model(_this.treeselmodel.el);",
768 "\t cg.loading_ui = false;",
770 "\t _this.cg_loading = false;",
771 "\t GLib.debug(\"Set name to %s\", cg.name);",
773 " \t_this.build_name.el.buffer.set_text(cg.name.data);",
774 " \t_this.build_as_library.el.active = cg.is_library;",
776 "\t_this.build_execute_args.el.buffer.set_text( cg.execute_args.data );",
784 "* pack" : "append_column",
785 "bool expand" : true,
789 "* prop" : "factory",
794 "\tvar lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
796 "\tvar item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();",
798 "\titem.bind_property(\"name\",",
800 " GLib.BindingFlags.SYNC_CREATE);",
808 "\t//var j = (JsRender.JsRender) item;",
809 "\tvar gi = (Gtk.ListItem)item;",
811 "\tvar lbl = new Gtk.Label(\"\");",
812 "\tlbl.halign = Gtk.Align.START;",
813 "\tgi.set_child(lbl);",
821 "xtype" : "SignalListItemFactory"
824 "string title" : "Build Target",
825 "xtype" : "ColumnViewColumn"
828 "xtype" : "ColumnView"
831 "xtype" : "ScrolledWindow"
835 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
841 "utf8 label" : "Build Name (executable name)",
845 "# bool in_insert" : false,
849 "var ed = (this.el.get_delegate() as Gtk.Editable);",
851 "\ted.insert_text.connect((text, length, ref position) => {",
852 "\t\tif (this.in_insert) {",
855 "\t\tGLib.debug(\"got insert text %s\", text);",
857 "\t\tvar nt = \"\";",
858 "\t\tfor(var i = 0;i < text.length; i++){ ",
859 "\t\t\tif (Posix.isupper(text[i]) ||Posix.islower(text[i]) ) {",
860 "\t\t\t\tnt += text[i].to_string();",
863 "\t\tif (nt.length < 1) {",
864 "\t\t\tGLib.Signal.stop_emission_by_name(ed, \"insert_text\");",
868 "\t\tthis.in_insert = true;",
870 "\t\tthis.el.insert_text(nt,nt.length, ref position);",
871 "\t\tthis.in_insert = false;",
872 "\t\tGLib.Signal.stop_emission_by_name(ed, \"insert_text\");",
881 "\tif (_this.selected_target == null) {",
884 "\tvar name = this.el.text;",
885 "\t// name ischanging.. probably always..",
886 "\tif (_this.selected_target.name != name) {",
887 "\t\t_this.project.compilegroups.unset(_this.selected_target.name);",
888 "\t\t_this.project.compilegroups.set(name, _this.selected_target);",
891 "\t_this.selected_target.name = this.el.buffer.text;",
895 "(text, length, ref position) => {",
896 "\tif (this.in_insert) {",
899 "\tGLib.debug(\"got insert text %s\", text);",
902 "\tfor(var i = 0;i < text.length; i++){ ",
903 "\t\tif (Posix.isalpha(text[i])) {",
904 "\t\t\tnt += text[i].to_string();",
907 "\tif (nt.length < 1) {",
911 "\tthis.in_insert = true;",
913 "\tthis.el.insert_text(text,length, ref position);",
914 "\tthis.in_insert = false;",
923 "utf8 label" : "test argments - when run after a build",
928 "id" : "build_execute_args",
932 " if (_this.selected_target == null) {",
935 " _this.selected_target.execute_args = this.el.buffer.text;",
940 "string placeholder_text" : "eg. -f somefile -g ",
945 "id" : "build_as_library",
947 "notify[\"active\"]" : [
949 " if (_this.selected_target == null) {",
952 " _this.selected_target.is_library = this.el.active;",
958 "string label" : "build as library",
959 "xtype" : "CheckButton"
974 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
976 "bool hexpand" : true,
977 "int margin_bottom" : 4,
978 "int margin_end" : 4,
979 "int margin_start" : 4,
980 "int margin_top" : 4,
988 " _this.done = true;",
989 " _this.el.hide(); ",
993 "string label" : "Cancel",
998 "bool hexpand" : true,
1004 "css_classes" : "{ \"suggested-action\" }",
1011 "_this.project.save(); ",
1013 "\t// what about .js ?",
1014 "_this.done = true;",
1016 "if (_this.doneObj != null) {",
1017 "\t_this.doneObj.call(_this.project);",
1024 "string label" : "Save",
1037 "\tif (!this.done) {",
1047 "\t if (!this.done) {",
1048 " _this.el.show();",
1053 "uint border_width" : 0,
1057 " this.project.save(); ",
1061 "(Gtk.Window pwin, Project.Gtk project, Project.Callback? doneObj) {",
1063 " //print(\"ValaProjectSettings show\\n\");",
1064 " this.doneObj = doneObj;",
1065 " this.project= project;",
1067 " this.compile_flags.el.buffer.set_text(",
1068 " \tproject.compile_flags.data",
1070 " this.version.el.buffer.set_text(",
1071 " \tproject.version.data",
1073 "\t this.licence.el.buffer.set_text(",
1074 " \tproject.licence.data",
1076 " project.loadVapiIntoStore(_this.vapimodel.el);",
1077 " GLib.Timeout.add(500, () => {",
1078 " \t\t this.vapi_scroll.el.vadjustment.value = 0;\t ",
1084 " \tproject.loadTargetsIntoStore(this.target_model.el);",
1086 " \t_this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;",
1087 "\t_this.target_sel.selectTarget(null);",
1088 "//\tGtk.Allocation rect;",
1089 "\t//btn.get_allocation(out rect);",
1090 " // this.el.set_pointing_to(rect);",
1091 " this.el.application = pwin.application; // ??? make it modal?",
1092 "\t this.el.set_transient_for(pwin);",
1094 "\t// window + header?",
1095 "\t// print(\"SHOWALL - POPIP\\n\");",
1096 "\tthis.el.set_size_request(800,800);",
1097 "\tthis.el.show();",
1098 "\tthis.notebook.el.page = 0; // first page.",
1100 "\t//this.view.el.grab_focus();",
1107 "name" : "ValaProjectSettingsPopover"