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 "id" : "generate_meson",
97 "\t_this.project.generate_meson = this.el.active;",
102 "string label" : "Generate Meson",
103 "xtype" : "CheckButton"
110 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
115 "Gtk.Align halign" : "Gtk.Align.START",
116 "bool hexpand" : false,
117 "utf8 label" : "Version:",
127 " _this.project.version = this.el.buffer.text;",
128 " _this.project.save();",
129 "// _this.project.save();",
134 "utf8 placeholder_text" : "eg. 1.5",
139 "Gtk.Align halign" : "Gtk.Align.START",
140 "bool hexpand" : false,
141 "utf8 label" : "Licence:",
151 " _this.project.licence = this.el.buffer.text;",
152 " _this.project.save();",
153 "// _this.project.save();",
158 "utf8 placeholder_text" : "eg. LGPL",
166 "Gtk.PolicyType hscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
167 "Gtk.PolicyType vscrollbar_policy" : "Gtk.PolicyType.AUTOMATIC",
168 "bool has_frame" : true,
169 "bool hexpand" : true,
170 "bool vexpand" : true,
171 "id" : "vapi_scroll",
192 "GLib.Type item_type" : "typeof(Project.VapiSelection)",
194 "xtype" : "ListStore"
202 "* prop" : "expression",
203 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
204 "string property_name" : "sortkey",
205 "xtype" : "PropertyExpression"
208 "xtype" : "StringSorter"
211 "xtype" : "SortListModel"
216 "id" : "vapi_filter",
220 "* prop" : "expression",
221 "GLib.Type this_type" : "typeof(Project.VapiSelection)",
222 "string property_name" : "sortkey",
223 "xtype" : "PropertyExpression"
226 "xtype" : "StringFilter"
229 "xtype" : "FilterListModel"
232 "xtype" : "NoSelection"
236 "* pack" : "append_column",
237 "bool expand" : true,
241 "* prop" : "factory",
246 "\tvar lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
248 "\tvar item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
250 "\titem.bind_property(\"name\",",
252 " GLib.BindingFlags.SYNC_CREATE);",
260 "\t//var j = (JsRender.JsRender) item;",
261 "\tvar gi = (Gtk.ListItem)item;",
263 "\tvar lbl = new Gtk.Label(\"\");",
264 "\tlbl.halign = Gtk.Align.START;",
265 "\tgi.set_child(lbl);",
273 "xtype" : "SignalListItemFactory"
276 "string title" : "Vapi Package",
277 "xtype" : "ColumnViewColumn"
281 "* pack" : "append_column",
285 "* prop" : "factory",
289 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
293 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
294 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
297 "\tvar vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();",
299 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
301 "\tbtn.active = vs.selected; ",
304 " \t// bind image...",
312 "\tvar btn = new Gtk.CheckButton();",
314 "\t((Gtk.ListItem)listitem).set_child(btn);",
316 "\tbtn.toggled.connect(() => {",
318 "\t\tvar jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();",
319 "\t\tjr.selected = btn.active;",
325 "xtype" : "SignalListItemFactory"
328 "string title" : "use",
329 "xtype" : "ColumnViewColumn"
332 "xtype" : "ColumnView"
335 "xtype" : "ScrolledWindow"
339 "id" : "vapi_search",
344 " _this.vapi_filter.el.set_search(this.el.get_text());",
350 "string placeholder_text" : "Search Libraries (Vapi)",
351 "uint search_delay" : 500,
352 "xtype" : "SearchEntry"
359 "* pack" : "append_page,_this.label_targets.el",
360 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
361 "bool vexpand" : true,
362 "gint position" : 300,
366 "* pack" : "set_end_child",
367 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
368 "gboolean homogeneous" : false,
373 "bool vexpand" : true,
383 "id" : "treeselmodel",
393 "\t//this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));",
398 "id" : "treelistsort",
403 "Gtk.TreeListModelCreateModelFunc create_func" : [
405 "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
406 "\treturn ((JsRender.JsRender)item).childfiles;",
409 "bool autoexpand" : true,
410 "bool passthrough" : false,
411 "id" : "treelistmodel",
416 "GLib.Type item_type" : "typeof(JsRender.JsRender)",
418 "xtype" : "ListStore"
421 "xtype" : "TreeListModel"
433 "* prop" : "expression",
434 "GLib.Type this_type" : "typeof(JsRender.JsRender)",
435 "string property_name" : "name",
436 "xtype" : "PropertyExpression"
439 "xtype" : "StringSorter"
442 "xtype" : "TreeListRowSorter"
445 "xtype" : "SortListModel"
450 "Gtk.CustomFilterFunc match_func" : [
453 "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
454 "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
455 "\tvar j = (JsRender.JsRender) tr;",
456 "\tif (j.xtype == \"Gtk\") {",
459 "\tif (j.xtype != \"Dir\") {",
460 "\t\treturn j.path.has_suffix(\".vala\") || j.path.has_suffix(\".c\");",
464 "\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
465 "\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
466 "\t\tif (f.xtype == \"Gtk\") {",
467 "\t\t\treturn true;",
469 "\t\tif (f.path.has_suffix(\".vala\") || f.path.has_suffix(\".c\")) {",
470 "\t\t\treturn true;",
477 "xtype" : "CustomFilter"
480 "xtype" : "FilterListModel"
483 "xtype" : "SingleSelection"
489 "\t this.el.set_sorter( new Gtk.StringSorter(",
490 "\t \tnew Gtk.PropertyExpression(typeof(JsRender.JsRender), null, \"name\")",
497 "* pack" : "append_column",
498 "bool expand" : true,
499 "bool resizable" : true,
504 "* prop" : "factory",
508 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
512 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
513 "\tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
516 "\tvar lbl = (Gtk.Label) expand.child;",
518 "\t if (lbl.label != \"\") { // do not update",
523 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
524 "\tvar jr = (JsRender.JsRender) lr.get_item();",
525 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
526 "\tlbl.label = jr.name; // for dir's we could hsow the sub path..",
527 "\tlbl.tooltip_markup = jr.path;",
529 " expand.set_hide_expander( jr.childfiles.n_items < 1);",
530 " \texpand.set_list_row(lr);",
532 " \texpand.set_hide_expander( jr.xtype != \"Dir\" );",
533 " \t expand.set_list_row(lr);",
535 " \t// bind image...",
543 "\tvar expand = new Gtk.TreeExpander();",
545 "\texpand.set_indent_for_depth(true);",
546 "\texpand.set_indent_for_icon(true);",
548 "\tvar lbl = new Gtk.Label(\"\");",
549 "\tlbl.use_markup = true;",
552 " \tlbl.justify = Gtk.Justification.LEFT;",
553 " \tlbl.xalign = 0;",
556 "\texpand.set_child(lbl);",
557 "\t((Gtk.ListItem)listitem).set_child(expand);",
558 "\t((Gtk.ListItem)listitem).activatable = false;",
563 "xtype" : "SignalListItemFactory"
566 "string title" : "Other Files",
567 "xtype" : "ColumnViewColumn"
571 "* pack" : "append_column",
575 "* prop" : "factory",
579 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
583 "\t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
584 "\tvar btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();",
587 "\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
588 "\tvar jr = (JsRender.JsRender) lr.get_item();",
589 "\t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
591 "\t//btn.active = jr.compile_group_selected;",
592 "\tbtn.active = _this.selected_target.has_file(jr);",
594 " \t//jr.bind_property(\"compile_group_selected\",",
595 " // btn, \"active\",",
596 " // GLib.BindingFlags.BIDIRECTIONAL); ",
597 " \t// bind image...",
604 "\tvar btn = new Gtk.CheckButton();",
606 "\t((Gtk.ListItem)listitem).set_child(btn);",
608 "\tbtn.toggled.connect(() => {",
609 "\t \tif (_this.cg_loading) {",
612 "\t\tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
613 "\t\tvar jr = (JsRender.JsRender) lr.get_item();",
614 "\t\tjr.compile_group_selected = btn.active;",
622 "xtype" : "SignalListItemFactory"
625 "string title" : "use",
626 "xtype" : "ColumnViewColumn"
629 "xtype" : "ColumnView"
632 "xtype" : "ScrolledWindow"
639 "* prop" : "start_child",
640 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
645 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
646 "bool hexpand" : true,
651 "bool hexpand" : true,
656 " if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {",
659 " var cg = new Project.GtkValaSettings(_this.project, \"NEW GROUP\");",
660 " _this.project.compilegroups.set(cg.name, cg);",
661 " _this.project.loadTargetsIntoStore(_this.target_model.el);",
662 " // select it.. ?? should load it??",
663 " for(var i =0;i < _this.target_model.el.n_items; i++) {",
664 " \tvar ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);",
665 " \tif (ncg.name == cg.name) {",
666 " \t\t_this.target_sel.el.selected = i;",
667 " \t\t_this.target_sel.selectTarget(cg);",
677 "utf8 label" : "Add Compile Target",
682 "bool hexpand" : true,
686 " // load the new values.",
687 "\tif (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {",
688 "\t\tGLib.debug(\"nothing selected\");",
693 "\t// add the directory..",
694 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);",
697 "\tGLib.debug(\"remove: %s\\n\", cg.name);",
698 "\tif (!_this.project.compilegroups.unset(cg.name)) {",
699 "\t\tGLib.debug(\"remove failed\");",
701 " \t_this.project.loadTargetsIntoStore(_this.target_model.el);",
705 "utf8 label" : "Remove Target",
715 "this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
720 "bool vexpand" : true,
734 "GLib.Type item_type" : "typeof(Project.GtkValaSettings)",
735 "id" : "target_model",
736 "xtype" : "ListStore"
740 "selection_changed" : [
741 "(position, n_items) => {",
744 "\t// load the new values.",
745 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
746 "\t\tthis.selectTarget(null);",
749 "\tthis.selectTarget(null);",
753 "\t// add the directory..",
754 "\tvar cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);",
756 "\tthis.selectTarget(cg);",
762 "xtype" : "SingleSelection",
763 "| void selectTarget" : [
764 "(Project.GtkValaSettings? cg) {",
765 "// load the new values",
766 "\t _this.selected_target = cg; ",
767 "\t _this.project.active_cg = cg;",
770 "\tif (cg == null) {",
772 "\t\t_this.set_vbox.el.hide();\t",
773 "\t\t_this.set_vboxb.el.hide();\t",
778 "\t_this.set_vbox.el.show();",
779 "\t_this.set_vboxb.el.show();",
780 "\t// add the directory..",
783 "\t GLib.debug(\"loading dirs into project list\");",
784 "\t cg.loading_ui = true;",
785 "\t _this.cg_loading = true;",
787 "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
788 "\t _this.project.loadDirsIntoStore(_this.treemodel.el);",
789 " \t _this.treeview.el.set_model(_this.treeselmodel.el);",
791 "\t cg.loading_ui = false;",
793 "\t _this.cg_loading = false;",
794 "\t GLib.debug(\"Set name to %s\", cg.name);",
796 " \t_this.build_name.el.buffer.set_text(cg.name.data);",
797 " \t_this.build_as_library.el.active = cg.is_library;",
799 "\t_this.build_execute_args.el.buffer.set_text( cg.execute_args.data );",
807 "* pack" : "append_column",
808 "bool expand" : true,
812 "* prop" : "factory",
817 "\tvar lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
819 "\tvar item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();",
821 "\titem.bind_property(\"name\",",
823 " GLib.BindingFlags.SYNC_CREATE);",
831 "\t//var j = (JsRender.JsRender) item;",
832 "\tvar gi = (Gtk.ListItem)item;",
834 "\tvar lbl = new Gtk.Label(\"\");",
835 "\tlbl.halign = Gtk.Align.START;",
836 "\tgi.set_child(lbl);",
844 "xtype" : "SignalListItemFactory"
847 "string title" : "Build Target",
848 "xtype" : "ColumnViewColumn"
851 "xtype" : "ColumnView"
854 "xtype" : "ScrolledWindow"
858 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
864 "utf8 label" : "Build Name (executable name)",
868 "# bool in_insert" : false,
872 "var ed = (this.el.get_delegate() as Gtk.Editable);",
874 "\ted.insert_text.connect((text, length, ref position) => {",
875 "\t\tif (this.in_insert) {",
878 "\t\tGLib.debug(\"got insert text %s\", text);",
880 "\t\tvar nt = \"\";",
881 "\t\tfor(var i = 0;i < text.length; i++){ ",
882 "\t\t\tif (Posix.isupper(text[i]) ||Posix.islower(text[i]) ) {",
883 "\t\t\t\tnt += text[i].to_string();",
886 "\t\tif (nt.length < 1) {",
887 "\t\t\tGLib.Signal.stop_emission_by_name(ed, \"insert_text\");",
891 "\t\tthis.in_insert = true;",
893 "\t\tthis.el.insert_text(nt,nt.length, ref position);",
894 "\t\tthis.in_insert = false;",
895 "\t\tGLib.Signal.stop_emission_by_name(ed, \"insert_text\");",
904 "\tif (_this.selected_target == null) {",
907 "\tvar name = this.el.text;",
908 "\t// name ischanging.. probably always..",
909 "\tif (_this.selected_target.name != name) {",
910 "\t\t_this.project.compilegroups.unset(_this.selected_target.name);",
911 "\t\t_this.project.compilegroups.set(name, _this.selected_target);",
914 "\t_this.selected_target.name = this.el.buffer.text;",
918 "(text, length, ref position) => {",
919 "\tif (this.in_insert) {",
922 "\tGLib.debug(\"got insert text %s\", text);",
925 "\tfor(var i = 0;i < text.length; i++){ ",
926 "\t\tif (Posix.isalpha(text[i])) {",
927 "\t\t\tnt += text[i].to_string();",
930 "\tif (nt.length < 1) {",
934 "\tthis.in_insert = true;",
936 "\tthis.el.insert_text(text,length, ref position);",
937 "\tthis.in_insert = false;",
946 "utf8 label" : "test argments - when run after a build",
951 "id" : "build_execute_args",
955 " if (_this.selected_target == null) {",
958 " _this.selected_target.execute_args = this.el.buffer.text;",
963 "string placeholder_text" : "eg. -f somefile -g ",
968 "id" : "build_as_library",
970 "notify[\"active\"]" : [
972 " if (_this.selected_target == null) {",
975 " _this.selected_target.is_library = this.el.active;",
981 "string label" : "build as library",
982 "xtype" : "CheckButton"
997 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
999 "bool hexpand" : true,
1000 "int margin_bottom" : 4,
1001 "int margin_end" : 4,
1002 "int margin_start" : 4,
1003 "int margin_top" : 4,
1011 " _this.done = true;",
1012 " _this.el.hide(); ",
1016 "string label" : "Cancel",
1021 "bool hexpand" : true,
1022 "string label" : "",
1027 "css_classes" : "{ \"suggested-action\" }",
1034 "_this.project.save(); ",
1036 "\t// what about .js ?",
1037 "_this.done = true;",
1039 "if (_this.doneObj != null) {",
1040 "\t_this.doneObj.call(_this.project);",
1047 "string label" : "Save",
1060 "\tif (!this.done) {",
1070 "\t if (!this.done) {",
1071 " _this.el.show();",
1076 "uint border_width" : 0,
1080 " this.project.save(); ",
1084 "(Gtk.Window pwin, Project.Gtk project, Project.Callback? doneObj) {",
1086 " //print(\"ValaProjectSettings show\\n\");",
1087 " this.doneObj = doneObj;",
1088 " this.project= project;",
1090 " this.compile_flags.el.buffer.set_text(",
1091 " \tproject.compile_flags.data",
1093 " this.version.el.buffer.set_text(",
1094 " \tproject.version.data",
1096 "\t this.licence.el.buffer.set_text(",
1097 " \tproject.licence.data",
1099 " project.loadVapiIntoStore(_this.vapimodel.el);",
1100 " GLib.Timeout.add(500, () => {",
1101 " \t\t this.vapi_scroll.el.vadjustment.value = 0;\t ",
1105 " this.generate_meson.el.active = this.project.generate_meson;",
1107 " \tproject.loadTargetsIntoStore(this.target_model.el);",
1109 " \t_this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;",
1110 "\t_this.target_sel.selectTarget(null);",
1111 "//\tGtk.Allocation rect;",
1112 "\t//btn.get_allocation(out rect);",
1113 " // this.el.set_pointing_to(rect);",
1114 " this.el.application = pwin.application; // ??? make it modal?",
1115 "\t this.el.set_transient_for(pwin);",
1117 "\t// window + header?",
1118 "\t// print(\"SHOWALL - POPIP\\n\");",
1119 "\tthis.el.set_size_request(800,800);",
1120 "\tthis.el.show();",
1121 "\tthis.notebook.el.page = 0; // first page.",
1123 "\t//this.view.el.grab_focus();",
1130 "name" : "ValaProjectSettingsPopover"