--- /dev/null
+{
+ "name" : "ValaProjectSettings",
+ "parent" : "",
+ "title" : "",
+ "path" : "/home/alan/gitlive/app.Builder.js/Builder4/ValaProjectSettings.bjs",
+ "permname" : "",
+ "modOrder" : "",
+ "items" : [
+ {
+ "# Project.Gtk project" : "null",
+ "# Xcls_MainWindow window" : "null",
+ "| void show" : "(Project.Gtk project) {\n \n \n print(\"ValaProjectSettings show\\n\");\n \n this.project= project;\n\n this.compile_flags.el.text = \"\";\n \n this.default_directory_tree_store.load(); \n this.default_packages_tree_store.load(); \n this.targets_tree_store.load();\n this.files_tree_store.load();\n\n}\n",
+ "xtype" : "VBox",
+ "string id" : "ValaProjectSettings",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "* pack" : "pack_start,true,true,0",
+ "xtype" : "Notebook",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "id" : "label_global",
+ "xtype" : "Label",
+ "* pack" : false,
+ "$ xns" : "Gtk",
+ "utf8 label" : "Global"
+ },
+ {
+ "id" : "label_targets",
+ "* pack" : false,
+ "xtype" : "Label",
+ "$ xns" : "Gtk",
+ "utf8 label" : "Targets"
+ },
+ {
+ "xtype" : "VBox",
+ "* pack" : "append_page,_this.label_global.el",
+ "gboolean homogeneous" : false,
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "xtype" : "Label",
+ "* pack" : "pack_start,false,false,0",
+ "$ xns" : "Gtk",
+ "utf8 label" : "compile flags"
+ },
+ {
+ "id" : "compile_flags",
+ "xtype" : "Entry",
+ "* pack" : "pack_start,false,false,0",
+ "$ xns" : "Gtk"
+ },
+ {
+ "xtype" : "Label",
+ "* pack" : "pack_start,false,false,0",
+ "$ xns" : "Gtk",
+ "utf8 label" : "packages"
+ },
+ {
+ "* pack" : "pack_start,true,true,0",
+ "xtype" : "ScrolledWindow",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "gboolean headers_visible" : false,
+ "* pack" : "add",
+ "xtype" : "TreeView",
+ "string id" : "default_packages_tree",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "id" : "default_packages_tree_store",
+ "* pack" : "set_model",
+ "xtype" : "ListStore",
+ "$ n_columns" : 2,
+ "| void load" : "() {\n \n var def = _this.project.compilegroups.get(\"_default_\");\n var items = def.packages;\n \n this.el.clear();\n var pal = (Palete.Gtk) Palete.factory(\"Gtk\");\n var pkgs = pal.packages();\n print(\"ValaProjectSettings:packages load %d\\n\", pkgs.size);\n\n Gtk.TreeIter citer;\n\n for(var i =0 ; i < pkgs.size; i++) {\n this.el.append(out citer); \n \n this.el.set_value(citer, 0, pkgs.get(i) ); // title \n this.el.set_value(citer, 1, items.contains(pkgs.get(i)) );\n }\n this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n \n}\n",
+ "$ columns" : " typeof(string), // 0 key type\n typeof(bool)",
+ "$ xns" : "Gtk"
+ },
+ {
+ "utf8 title" : "name",
+ "* init" : " \n this.el.add_attribute(_this.packages_render.el , \"text\", 0 );\n ",
+ "* pack" : "append_column",
+ "xtype" : "TreeViewColumn",
+ "gboolean resizable" : true,
+ "gboolean expand" : true,
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "id" : "packages_render",
+ "* pack" : "pack_start,false",
+ "xtype" : "CellRendererText",
+ "$ xns" : "Gtk"
+ }
+ ]
+ },
+ {
+ "utf8 title" : "use",
+ "* init" : "{\n this.el.add_attribute(_this.packages_render_use.el , \"active\", 1 );\n }",
+ "* pack" : "append_column",
+ "xtype" : "TreeViewColumn",
+ "gboolean resizable" : false,
+ "$ xns" : "Gtk",
+ "gint fixed_width" : 50,
+ "items" : [
+ {
+ "listeners" : {
+ "toggled" : "( path_string) => { \n var m = _this.default_packages_tree_store.el;\n Gtk.TreeIter iter;\n Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);\n m.get_iter (out iter, path);\n GLib.Value val;\n m.get_value(iter, 1, out val);\n m.set_value(iter, 1, ((bool) val) ? false :true); \n GLib.Value fval; \n m.get_value(iter, 0, out fval);\n var fn = (string)fval;\n \n var def = _this.project.compilegroups.get(\"_default_\");\n var items = def.packages;\n if ((bool)val) {\n // renive\n items.remove(fn);\n } else {\n items.add(fn);\n }\n \n}"
+ },
+ "id" : "packages_render_use",
+ "xtype" : "CellRendererToggle",
+ "* pack" : "pack_start,false",
+ "$ xns" : "Gtk",
+ "gboolean activatable" : true
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "Label",
+ "* pack" : "pack_start,false,false,0",
+ "$ xns" : "Gtk",
+ "utf8 label" : "Available Directories"
+ },
+ {
+ "* pack" : "pack_start,true,true,0",
+ "xtype" : "ScrolledWindow",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "listeners" : {
+ "button_press_event" : " ( ev) => {\n //console.log(\"button press?\");\n \n \n if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {\n //print(\"click\" + ev.type);\n return false;\n }\n //Gtk.TreePath res;\n //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n // return true;\n //}\n \n // this.el.get_selection().select_path(res);\n \n //if (!this.get('/LeftTreeMenu').el) { \n // this.get('/LeftTreeMenu').init(); \n // }\n \n _this.default_directory_menu.el.set_screen(Gdk.Screen.get_default());\n _this.default_directory_menu.el.show_all();\n _this.default_directory_menu.el.popup(null, null, null, 3, ev.time);\n // print(\"click:\" + res.path.to_string());\n return true;\n}"
+ },
+ "gboolean headers_visible" : false,
+ "id" : "default_directory_tree",
+ "* pack" : "add",
+ "xtype" : "TreeView",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "id" : "default_directory_tree_store",
+ "* pack" : "set_model",
+ "xtype" : "ListStore",
+ "$ n_columns" : 1,
+ "| void load" : "() {\n \n this.el.clear();\n \n \n var def = _this.project.compilegroups.get(\"_default_\");\n var items = def.sources;\n \n \n Gtk.TreeIter citer;\n\n for(var i =0 ; i < items.size; i++) {\n this.el.append(out citer); \n \n this.el.set_value(citer, 0, items.get(i) ); // title \n //this.el.set_value(citer, 1, items.get(i) );\n }\n this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n \n}\n",
+ "$ columns" : " typeof(string)\n ",
+ "$ xns" : "Gtk"
+ },
+ {
+ "utf8 title" : "name",
+ "* init" : "\n this.el.add_attribute(_this.directory_render.el , \"text\", 0 );\n ",
+ "* pack" : "append_column",
+ "xtype" : "TreeViewColumn",
+ "gboolean resizable" : true,
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "id" : "directory_render",
+ "* pack" : "pack_start,false",
+ "xtype" : "CellRendererText",
+ "$ xns" : "Gtk"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "id" : "default_directory_menu",
+ "xtype" : "Menu",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "listeners" : {
+ "activate" : "() => {\n \n var chooser = new Gtk.FileChooserDialog (\n\t\"Add a directory\", _this.window.el, Gtk.FileChooserAction.SELECT_FOLDER ,\n\t\"_Cancel\",\n\tGtk.ResponseType.CANCEL,\n\t\"_Add\",\n\tGtk.ResponseType.ACCEPT);\n if (chooser.run () != Gtk.ResponseType.ACCEPT) {\n chooser.close ();\n return;\n }\n chooser.close ();\n // add the directory..\n var fn = _this.project.relPath(chooser.get_filename());\n _this.project.compilegroups.get(\"_default_\").sources.add(fn);\n _this.default_directory_tree_store.load();\n}"
+ },
+ "* pack" : "add",
+ "xtype" : "MenuItem",
+ "$ xns" : "Gtk",
+ "utf8 label" : "Add Directory"
+ },
+ {
+ "listeners" : {
+ "activate" : "() => {\n \n var chooser = new Gtk.FileChooserDialog (\n\t\"Add a directory\", _this.window.el, Gtk.FileChooserAction.OPEN ,\n\t\"_Cancel\",\n\tGtk.ResponseType.CANCEL,\n\t\"_Add\",\n\tGtk.ResponseType.ACCEPT);\n if (chooser.run () != Gtk.ResponseType.ACCEPT) {\n chooser.close ();\n return;\n }\n chooser.close ();\n // add the directory..\n var fn = _this.project.relPath(chooser.get_filename());\n _this.project.compilegroups.get(\"_default_\").sources.add(fn);\n _this.default_directory_tree_store.load();\n}"
+ },
+ "* pack" : "add",
+ "xtype" : "MenuItem",
+ "$ xns" : "Gtk",
+ "utf8 label" : "Add File"
+ },
+ {
+ "* pack" : "add",
+ "xtype" : "SeparatorMenuItem",
+ "$ xns" : "Gtk"
+ },
+ {
+ "listeners" : {
+ "activate" : "() => {\n \n //\n Gtk.TreeModel mod;\n Gtk.TreeIter iter;\n if (!_this.default_directory_tree.el.get_selection().get_selected(out mod, out iter)) {\n print(\"nothing selected\\n\");\n return;\n }\n\n \n // add the directory..\n \n \n GLib.Value val;\n mod.get_value(iter,0, out val);\n var fn = (string) val;\n \n print(\"remove: %s\\n\", fn);\n if (!_this.project.compilegroups.get(\"_default_\").sources.remove(fn)) {\n print(\"remove failed\");\n }\n _this.default_directory_tree_store.load();\n}"
+ },
+ "* pack" : "add",
+ "xtype" : "MenuItem",
+ "$ xns" : "Gtk",
+ "utf8 label" : "Remove File/Directory"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "gint position" : 300,
+ "xtype" : "HPaned",
+ "* pack" : "append_page,_this.label_targets.el",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "* init" : "{ \nthis.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n\n}\n",
+ "xtype" : "ScrolledWindow",
+ "* pack" : "add1",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "id" : "targets_tree_menu",
+ "* pack" : "add",
+ "xtype" : "Menu",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "listeners" : {
+ "activate" : "() => {\n \n if (_this.project.compilegroups.has_key(\"NEW GROUP\")) {\n return;\n }\n \n // add the directory..\n \n _this.project.compilegroups.set(\"NEW GROUP\", new Project.GtkValaSettings(\"NEW GROUP\"));\n _this.targets_tree_store.load();\n}"
+ },
+ "* pack" : "add",
+ "xtype" : "MenuItem",
+ "$ xns" : "Gtk",
+ "utf8 label" : "Add Compile Target"
+ },
+ {
+ "* pack" : "add",
+ "xtype" : "SeparatorMenuItem",
+ "$ xns" : "Gtk"
+ },
+ {
+ "listeners" : {
+ "activate" : "() => {\n \n //\n Gtk.TreeModel mod;\n Gtk.TreeIter iter;\n if (!_this.targets_tree.el.get_selection().get_selected(out mod, out iter)) {\n print(\"nothing selected\\n\");\n return;\n }\n\n \n // add the directory..\n \n \n GLib.Value val;\n mod.get_value(iter,0, out val);\n var fn = (string) val;\n \n print(\"remove: %s\\n\", fn);\n if (!_this.project.compilegroups.unset(fn)) {\n print(\"remove failed\");\n }\n _this.targets_tree_store.load();\n}"
+ },
+ "* pack" : "add",
+ "xtype" : "MenuItem",
+ "$ xns" : "Gtk",
+ "utf8 label" : "Remove Target"
+ }
+ ]
+ },
+ {
+ "listeners" : {
+ "button_press_event" : " ( ev) => {\n //console.log(\"button press?\");\n \n \n if (ev.type != Gdk.EventType.BUTTON_PRESS || ev.button != 3) {\n //print(\"click\" + ev.type);\n return false;\n }\n //Gtk.TreePath res;\n //if (!this.el.get_path_at_pos((int)ev.x,(int)ev.y, out res, null, null, null) ) {\n // return true;\n //}\n \n // this.el.get_selection().select_path(res);\n \n //if (!this.get('/LeftTreeMenu').el) { \n // this.get('/LeftTreeMenu').init(); \n // }\n \n _this.targets_tree_menu.el.set_screen(Gdk.Screen.get_default());\n _this.targets_tree_menu.el.show_all();\n _this.targets_tree_menu.el.popup(null, null, null, 3, ev.time);\n // print(\"click:\" + res.path.to_string());\n return true;\n}",
+ "cursor_changed" : " ( ) => {\n\n if (this.cursor != \"\") {\n // save the values..\n }\n \n // load the new values.\n \n\n Gtk.TreeModel mod;\n Gtk.TreeIter iter;\n if (!this.el.get_selection().get_selected(out mod, out iter)) {\n print(\"nothing selected\\n\");\n return;\n }\n\n \n // add the directory..\n \n \n GLib.Value val;\n mod.get_value(iter,0, out val);\n var fn = (string) val;\n \n this.cursor = fn;\n var cg = _this.project.compilegroups.get(fn);\n _this.build_pack_target.el.set_text(cg.target_bin);\n _this.build_compile_flags.el.set_text(cg.compile_flags);\n // load the srouces\n\n\n }"
+ },
+ "id" : "targets_tree",
+ "# string cursor" : "",
+ "* pack" : "add",
+ "xtype" : "TreeView",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "id" : "targets_tree_store",
+ "xtype" : "ListStore",
+ "* pack" : "set_model",
+ "$ n_columns" : 2,
+ "| void load" : "() {\n \n this.el.clear();\n \n \n var cg = _this.project.compilegroups;\n \n _this.targets_tree.cursor = \"\";\n Gtk.TreeIter citer;\n var iter = cg.map_iterator();\n while(iter.next()) {\n var key = iter.get_key();\n if (key == \"_default_\") {\n continue;\n }\n \n this.el.append(out citer); \n \n this.el.set_value(citer, 0, key ); // title \n //this.el.set_value(citer, 1, items.get(i) );\n };\n this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n \n}\n",
+ "$ columns" : " typeof(string), // 0 key type\n typeof(string) // ??\n ",
+ "$ xns" : "Gtk"
+ },
+ {
+ "utf8 title" : "name",
+ "* init" : " {\n this.el.add_attribute(_this.targets_render.el , \"text\", 0 );\n }",
+ "* pack" : "append_column",
+ "xtype" : "TreeViewColumn",
+ "gboolean resizable" : true,
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "listeners" : {
+ "edited" : " (path, newtext) => {\n \n Gtk.TreeIter iter;\n _this.targets_tree_store.el.get_iter(out iter, new Gtk.TreePath.from_string(path));\n GLib.Value gval;\n _this.targets_tree_store.el.get_value(iter,0, out gval);\n var oldval = (string)gval;\n if (oldval == newtext) {\n return;\n }\n var cg = _this.project.compilegroups.get(oldval);\n cg.name = newtext;\n _this.project.compilegroups.unset(oldval);\n _this.project.compilegroups.set(newtext, cg);\n _this.targets_tree_store.load();\n }"
+ },
+ "id" : "targets_render",
+ "xtype" : "CellRendererText",
+ "* pack" : "pack_start,false",
+ "$ xns" : "Gtk",
+ "gboolean editable" : true
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "xtype" : "VBox",
+ "* pack" : "add2",
+ "string id" : "set_vbox",
+ "gboolean homogeneous" : false,
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "xtype" : "Label",
+ "* pack" : "pack_start,false,false,0",
+ "$ xns" : "Gtk",
+ "utf8 label" : "target filename"
+ },
+ {
+ "listeners" : {
+ "changed" : "() => {\n if (_this.targets_tree.cursor.length < 1) {\n return;\n }\n _this.project.compilegroups.get(_this.targets_tree.cursor).target_bin = this.el.text;\n}"
+ },
+ "id" : "build_pack_target",
+ "xtype" : "Entry",
+ "* pack" : "pack_start,false,false,0",
+ "$ xns" : "Gtk"
+ },
+ {
+ "xtype" : "Label",
+ "* pack" : "pack_start,false,false,0",
+ "$ xns" : "Gtk",
+ "utf8 label" : "compile flags"
+ },
+ {
+ "listeners" : {
+ "changed" : "() => {\n if (_this.targets_tree.cursor.length < 1) {\n return;\n }\n _this.project.compilegroups.get(_this.targets_tree.cursor).compile_flags = this.el.text;\n}"
+ },
+ "id" : "build_compile_flags",
+ "xtype" : "Entry",
+ "* pack" : "pack_start,false,false,0",
+ "$ xns" : "Gtk"
+ },
+ {
+ "xtype" : "Label",
+ "* pack" : "pack_start,false,false,0",
+ "$ xns" : "Gtk",
+ "utf8 label" : "Files to compile"
+ },
+ {
+ "* pack" : "pack_start,true,true,0",
+ "xtype" : "ScrolledWindow",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "xtype" : "TreeView",
+ "string id" : "files_tree",
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "id" : "files_tree_store",
+ "xtype" : "ListStore",
+ "* pack" : "set_model",
+ "$ n_columns" : 2,
+ "| void load" : "() {\n \n this.el.clear();\n \n \n var def = _this.project.compilegroups.get(\"_default_\");\n var items = def.sources;\n \n \n Gtk.TreeIter citer;\n\n for(var i =0 ; i < items.size; i++) {\n this.el.append(out citer); \n \n this.el.set_value(citer, 0, items.get(i) ); // title \n this.el.set_value(citer, 1, \"dir\"); // type \n this.el.set_value(citer, 2, false ); // checked \n /*\n var files = def.files(items.get(i));\n \n for(var j =0 ; j < files.size; j++) {\n this.el.append(out citer); \n \n this.el.set_value(citer, 0, files.get(j) ); // title \n this.el.set_value(citer, 1, \"file\"); // type \n this.el.set_value(citer, 2, false ); // checked \n\n }\n */\n \n //this.el.set_value(citer, 1, items.get(i) );\n }\n this.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n \n}\n ",
+ "$ columns" : " typeof(string), // 0 file name\n typeof(string), // type (dir orfile)\n typeof(bool) // is checked.\n ",
+ "$ xns" : "Gtk"
+ },
+ {
+ "utf8 title" : "name",
+ "* init" : "/* this.el.add_attribute(_this.files_render.el , \"markup\", 2 );\n// this.el.add_attribute(_this.files_render.el , \"text\", 1 ); */\n \n",
+ "* pack" : "append_column",
+ "xtype" : "TreeViewColumn",
+ "gboolean resizable" : true,
+ "$ xns" : "Gtk",
+ "items" : [
+ {
+ "id" : "files_render",
+ "* pack" : "pack_start,false",
+ "xtype" : "CellRendererText",
+ "$ xns" : "Gtk"
+ }
+ ]
+ },
+ {
+ "utf8 title" : "use",
+ "* init" : "/*\n\n this.el.add_attribute(_this.packages_render_use.el , \"active\", 1 );\n \n */\n ",
+ "* pack" : "append_column",
+ "xtype" : "TreeViewColumn",
+ "gboolean resizable" : false,
+ "$ xns" : "Gtk",
+ "gint fixed_width" : 50,
+ "items" : [
+ {
+ "listeners" : {
+ "toggled" : "( path_string) => { \n var m = _this.default_packages_tree_store.el;\n Gtk.TreeIter iter;\n Gtk.TreePath path = new Gtk.TreePath.from_string (path_string);\n m.get_iter (out iter, path);\n GLib.Value val;\n m.get_value(iter, 1, out val);\n m.set_value(iter, 1, ((bool) val) ? false :true); \n GLib.Value fval; \n m.get_value(iter, 0, out fval);\n var fn = (string)fval;\n \n var def = _this.project.compilegroups.get(\"_default_\");\n var items = def.packages;\n if ((bool)val) {\n // renive\n items.remove(fn);\n } else {\n items.add(fn);\n }\n \n}"
+ },
+ "id" : "files_render_use",
+ "xtype" : "CellRendererToggle",
+ "* pack" : "pack_start,false",
+ "$ xns" : "Gtk",
+ "gboolean activatable" : true
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file