Merge branch 'master' of http://git.roojs.com/app.Builder.js
authorEdward <edward@roojs.com>
Tue, 26 May 2015 02:08:16 +0000 (10:08 +0800)
committerEdward <edward@roojs.com>
Tue, 26 May 2015 02:08:16 +0000 (10:08 +0800)
55 files changed:
src/Builder4/About.bjs
src/Builder4/About.vala
src/Builder4/ClutterFiles.bjs
src/Builder4/ClutterFiles.vala
src/Builder4/CompileState.vala [new file with mode: 0644]
src/Builder4/DialogPluginWebkit.bjs
src/Builder4/DialogPluginWebkit.vala
src/Builder4/DialogSaveModule.bjs
src/Builder4/DialogSaveModule.vala
src/Builder4/DialogSaveTemplate.bjs
src/Builder4/DialogSaveTemplate.vala
src/Builder4/DialogTemplateSelect.bjs
src/Builder4/DialogTemplateSelect.vala
src/Builder4/EditProject.bjs
src/Builder4/EditProject.vala
src/Builder4/Editor.bjs
src/Builder4/Editor.vala
src/Builder4/GtkView.bjs
src/Builder4/GtkView.vala
src/Builder4/MainWindow.bjs
src/Builder4/MainWindow.vala
src/Builder4/PopoverFileDetails.bjs
src/Builder4/PopoverFileDetails.vala
src/Builder4/RooProjectProperties.bjs
src/Builder4/RooProjectProperties.vala
src/Builder4/ValaCompileErrors.bjs
src/Builder4/ValaCompileErrors.vala
src/Builder4/ValaProjectSettings.bjs
src/Builder4/ValaProjectSettings.vala
src/Builder4/WindowLeftProjects.bjs
src/Builder4/WindowLeftProjects.vala
src/Builder4/WindowLeftProps.bjs
src/Builder4/WindowLeftProps.vala
src/Builder4/WindowLeftTree.bjs
src/Builder4/WindowLeftTree.vala
src/Builder4/WindowRightPalete.bjs
src/Builder4/WindowRightPalete.vala
src/Builder4/WindowRooView.bjs
src/Builder4/WindowRooView.vala
src/Builder4/WindowState.vala
src/Builder4/config1.builder
src/JsRender/Gtk.vala
src/JsRender/JsRender.vala
src/JsRender/Node.vala
src/JsRender/NodeToGtk.vala
src/JsRender/NodeToVala.vala
src/Main.vala
src/Makefile.am
src/Palete/Palete.vala
src/Palete/ValaSource.vala
src/Palete/ValaSourceCompiler.vala [new file with mode: 0644]
src/Palete/VapiParser.vala
src/Project/Gtk.vala
src/Spawn.vala
tests/enum.vala [new file with mode: 0644]

index c7beb46..5df0967 100644 (file)
@@ -9,7 +9,7 @@
  "items" : [
   {
    "listeners" : {
-    "delete_event" : "(self, event) => {\n    this.el.hide();\n    return true; \n}  \n    ",
+    "delete_event" : "(self, event) => {\n    this.el.hide();\n    return true; \n}           ",
     "response" : "(rid) => {\n    this.el.hide();\n}\n"
    },
    "Gtk.License license_type" : "Gtk.License.LGPL_3_0",
index c316031..2ed51b9 100644 (file)
@@ -1,6 +1,6 @@
 static About  _About;
 
-public class About : Object 
+public class About : Object
 {
     public Gtk.AboutDialog el;
     private About  _this;
@@ -15,7 +15,7 @@ public class About : Object
 
         // my vars (def)
 
-    // ctor 
+    // ctor
     public About()
     {
         _this = this;
@@ -32,7 +32,7 @@ public class About : Object
         this.el.copyright = "LGPL";
         this.el.license_type = Gtk.License.LGPL_3_0;
 
-        // listeners 
+        //listeners
         this.el.delete_event.connect( (self, event) => {
             this.el.hide();
             return true; 
@@ -42,7 +42,7 @@ public class About : Object
         });
     }
 
-    // user defined functions 
+    // user defined functions
     public    void show (Gtk.Window parent) {
         this.el.set_transient_for(parent);
         this.el.modal = true;
index 9e4fbd0..b774536 100644 (file)
  "build_module" : "builder",
  "items" : [
   {
-   "listeners" : {
-    "scroll_event" : "( event) => {\n   //Sprint(\"scroll event\");\n            var y = this.filelayout.el.y;\n            var dir = event.direction;\n            switch (dir) {\n                case Clutter.ScrollDirection.UP:\n                    y += event.y /2;\n                    break;\n                case Clutter.ScrollDirection.DOWN:\n                    y -= event.y /2 ;\n                    break;\n                default:\n                    return false;\n            }\n            // range of scroll -- can go up -- eg.. -ve value.\n            \n            y = float.min(0, y);\n            \n            // to work out the max -ve number\n            // height of filelayout\n            // height of scrollactor..\n            \n            var last_child_bottom = this.filelayout.el.last_child.y +  this.filelayout.el.last_child.height;\n             if ( (-1 * (y+200)) > (  last_child_bottom - this.el.height)) {\n                return  false;\n            }\n        \n        \n            \n            \n        //    print(\"\\nlast child - this height = %f  ==== new y %f\\n \".printf( \n          //          last_child_bottom - this.el.height,\n           //         y));    \n           // y = float.min(0, y);    //??\n           // print(\"scroll event of %f  - new y = %f \".printf(event.y, y));\n            this.filelayout.el.y = y;\n            return true;\n          \n}"
-   },
-   "# Gee.ArrayList<Xcls_fileitem> fileitems" : "",
    "id" : "ClutterFiles",
-   "|  void clearFiles" : "() {\n    \n    this.filelayout.el.remove_all_children();\n    // we need to unref all the chidren that we loaded though...\n    \n}\n",
-   "* init" : "this.fileitems = new Gee.ArrayList<Xcls_fileitem>();\n",
+   "|  void clearFiles" : "() {\n    \n    this.filelayout.el.remove_all_children();\n    // we need to unref all the chidren that we loaded though...\n    \n}\n ",
    "Clutter.ScrollMode scroll_mode" : "Clutter.ScrollMode.VERTICALLY",
-   "xtype" : "ScrollActor",
-   "|  void loadProject" : "(Project.Project pr) {\n    // list all the files, and create new Xcls_fileitem for each one.\n    \n    // LEAK --- we should unref all the chilren...\n    this.filelayout.el.y = 0;\n    this.clearFiles();\n    \n    print(\"clutter files - load project: \" + pr.name +\"\\n\");\n    // should unref.. them hopefully.\n    this.fileitems = new Gee.ArrayList<Xcls_fileitem>();\n\n    \n\n    var fiter = pr.sortedFiles().list_iterator();\n    while (fiter.next()) {\n        var a = new Xcls_fileitem(this,fiter.get());\n        this.fileitems.add(a);\n\n//        a.ref();\n        print(\"add to clutter file view: \" + fiter.get().name + \"\\n\");\n        this.filelayout.el.add_child(a.el);\n    }\n    \n   \n    \n    this.el.show();\n}\n",
+   "xtype" : "Actor",
+   "|  void loadProject" : "(Project.Project pr) {\n    // list all the files, and create new Xcls_fileitem for each one.\n    \n    // LEAK --- we should unref all the chilren...\n    this.filelayout.el.y = 0;\n    this.clearFiles();\n    \n    print(\"clutter files - load project: \" + pr.name +\"\\n\");\n    // should unref.. them hopefully.\n    \n    this.project_title_name.el.text = pr.name;\n    this.project_title_path.el.text = pr.firstPath();\n    \n    // file items contains a reference until we reload ...\n    this.fileitems = new Gee.ArrayList<Object>();\n\n    \n\n    var fiter = pr.sortedFiles().list_iterator();\n    while (fiter.next()) {\n        var a = new Xcls_fileitem(this,fiter.get());\n        this.fileitems.add(a);\n\n//        a.ref();\n        print(\"add to clutter file view: \" + fiter.get().name + \"\\n\");\n        this.filelayout.el.add_child(a.el);\n    }\n    \n    // folders...\n    \n    if (!(pr is Project.Gtk)) {\n        print (\"not gtk... skipping files\");\n        return;\n    }\n    var gpr = (Project.Gtk)pr;\n     var def = gpr.compilegroups.get(\"_default_\");\n     var items  = def.sources;\n     \n     \n     \n    for(var i =0 ; i < items.size; i++) {\n        print (\"cheking folder %s\\n\", items.get(i));\n         var files = gpr.files(items.get(i));\n         if (files.size < 1) {\n            continue;\n         }\n\n        // add the directory... items.get(i);\n        var x = new Xcls_folderitem(this,items.get(i));\n        this.fileitems.add(x);\n        this.filelayout.el.add_child(x.el);\n        \n        for(var j =0 ; j < files.size; j++) {\n            print (\"adding file %s\\n\", files.get(j));\n        \n            var y = new Xcls_folderfile(this, files.get(j));\n            this.fileitems.add(y);\n            x.el.add_child(y.el);\n\n            // add file to files.get(j);\n            \n        }\n        \n        \n        //this.el.set_value(citer, 1,   items.get(i) );\n    }\n    \n   \n    \n    this.el.show();\n}\n",
    "# Gdk.Pixbuf missing_thumb_pixbuf" : "null",
    "@ void open" : "(JsRender.JsRender file)",
    "$ xns" : "Clutter",
    "bool reactive" : true,
-   "|  void set_size" : "(float w, float h) \n{\n     if (this.el == null) {\n        print(\"object not ready yet?\");\n        return;\n    }\n   _this.filelayout_manager.el.max_column_width = w - 150;\n   this.el.set_size(this.el.get_stage().width-150,\n                        this.el.get_stage().height);\n            this.el.set_position(100,50);\n}\n",
+   "|  void set_size" : "(float w, float h) \n{\n    \n     // called by window resize... with is alreaddy -50 (for the buttons?)\n     \n\n\n\n     if (this.el == null) {\n        print(\"object not ready yet?\");\n        return;\n    }\n    \n    print(\"recv width %f, filelayoutw = %f\", w, w-200);\n    \n    // floor ( w/120) * 120...\n    \n   //_this.filelayout_manager.el.max_column_width = w - 200;\n   _this.filelayout.el.width = w - 200;\n   \n    this.el.set_size(\n           // this.el.get_stage().width-150,\n           w,\n           h  // this.el.get_stage().height\n    );\n    \n    // 100 right for buttons ..\n    this.el.set_position(0,0);\n   \n   \n   this.scroller.el.set_size(\n           // this.el.get_stage().width-150,\n           w-50,\n           h  // this.el.get_stage().height\n    );\n    \n    // 100 right for buttons ..\n    this.scroller.el.set_position(75,50);\n    // scroll...\n    _this.filelayout.el.y = 0.0f;\n    \n}\n",
+   "# Gee.ArrayList<Object> fileitems" : "new Gee.ArrayList<Object>()",
    "items" : [
     {
-     "id" : "filelayout",
-     "* init" : "\nthis.el.add_constraint(\n    new Clutter.BindConstraint(_this.el,Clutter.BindCoordinate.SIZE, 0.0f)\n);\n\n",
+     "id" : "project_title",
+     "* init" : "\nthis.el.add_constraint(\n    new Clutter.BindConstraint(_this.el,Clutter.BindCoordinate.SIZE, 0.0f)\n);\nthis.el.set_position(75,0);\n ",
      "xtype" : "Actor",
      "* pack" : "add_child",
      "$ reactive" : true,
      "$ xns" : "Clutter",
      "items" : [
       {
-       "id" : "filelayout_manager",
+       "id" : "project_title_manager",
        "$ orientation" : "Clutter.FlowOrientation.HORIZONTAL",
        "xtype" : "FlowLayout",
+       "boolean homogeneous" : false,
        "$ xns" : "Clutter",
-       "row_spacing" : 20,
+       "row_spacing" : 5,
        "* prop" : "layout_manager",
-       "column_spacing" : 20,
-       "$ homogeneous" : true
+       "column_spacing" : 20
       },
       {
-       "listeners" : {
-        "button_press_event" : "  (  event) => {\n    _this.open(this.file);\n    return false;\n}",
-        "enter_event" : "(  event)  => {\n    this.el.background_color = new Clutter.Color.from_string(\"#333\");\n        return false;\n}",
-        "leave_event" : "(  event)  => {\n    this.el.background_color = new Clutter.Color.from_string(\"#000\");\n    return false;\n}"
-       },
-       "id" : "*fileitem",
-       "* args" : "JsRender.JsRender file",
-       "* init" : "this.file = file;\nthis.el.set_size(100,100);",
-       "* pack" : true,
+       "xtype" : "FixedLayout",
+       "$ xns" : "Clutter",
+       "* prop" : "layout_manager"
+      },
+      {
+       "* ctor" : "new Clutter.Text.full(\"Sans 20px\", \"\",  Clutter.Color.from_string(\"#eee\"))",
+       "id" : "project_title_name",
+       "float x" : "0.0f",
+       "* pack" : "add_child",
+       "xtype" : "Text",
+       "float y" : "10.0f",
+       "boolean x_expand" : false,
+       "$ xns" : "Clutter"
+      },
+      {
+       "* ctor" : "new Clutter.Text.full(\"Sans 10px\", \"\",  Clutter.Color.from_string(\"#ccc\"))",
+       "id" : "project_title_path",
+       "float x" : "0.0f",
+       "* pack" : "add_child",
+       "xtype" : "Text",
+       "float y" : "35.0f",
+       "$ xns" : "Clutter"
+      }
+     ]
+    },
+    {
+     "listeners" : {
+      "scroll_event" : "( event) => {\n   //Sprint(\"scroll event\");\n    var y = _this.filelayout.el.y;\n    var dir = event.direction;\n    \n    var last_child_bottom = _this.filelayout.el.last_child.y +  _this.filelayout.el.last_child.height;\n    var bottompos = -1 * (  last_child_bottom - (0.5f * this.el.height));\n    \n    switch (dir) {\n        case Clutter.ScrollDirection.UP:\n            print(\"Scroll up by %f\\n\", event.y);\n            y += event.y /2;\n            y = float.min(0, y); // \n            break;\n            \n        case Clutter.ScrollDirection.DOWN:\n            print(\"Scroll down by %f\\n\", event.y);\n            y -= event.y /2 ;\n            y = float.max(bottompos, y);\n            \n            \n            break;\n        default:\n            return false;\n    }\n    // range of scroll -- can go up -- eg.. -ve value.\n    \n\n    \n    // to work out the max -ve number\n    // height of filelayout\n    // height of scrollactor..\n    \n/*\n    if ( (-1 * (y+200)) > (  last_child_bottom - this.el.height)) {\n        var nv =         _this.filelayout.el.y ;\n        if (nv != -1 * (  last_child_bottom - this.el.height)) {\n    \n            _this.filelayout.el.y = -1 * (  last_child_bottom - this.el.height);\n            return true;\n        }\n    \n        return  false;\n    }\n\n*/\n    \n    \n//    print(\"\\nlast child - this height = %f  ==== new y %f\\n \".printf( \n  //          last_child_bottom - this.el.height,\n   //         y));    \n   // y = float.min(0, y);    //??\n   // print(\"scroll event of %f  - new y = %f \".printf(event.y, y));\n   print(\"Set scroll to %f (lcb=%f / height = %f)\\n\", y, last_child_bottom, this.el.height);\n   \n    _this.filelayout.el.y = y;\n    return true;\n          \n}"
+     },
+     "# Gee.ArrayList<Xcls_fileitem> fileitems" : "new Gee.ArrayList<Xcls_fileitem>()",
+     "id" : "scroller",
+     "Clutter.ScrollMode scroll_mode" : "Clutter.ScrollMode.VERTICALLY",
+     "xtype" : "ScrollActor",
+     "* pack" : "add_child",
+     "# Gdk.Pixbuf missing_thumb_pixbuf" : "null",
+     "$ xns" : "Clutter",
+     "bool reactive" : true,
+     "items" : [
+      {
+       "id" : "filelayout",
+       "* init" : "\nthis.el.add_constraint(\n    new Clutter.BindConstraint(_this.el,Clutter.BindCoordinate.SIZE, 0.0f)\n);\n\n ",
        "xtype" : "Actor",
-       "# JsRender.JsRender file" : "",
+       "* pack" : "add_child",
        "$ reactive" : true,
        "$ xns" : "Clutter",
        "items" : [
         {
-         "spacing" : 4,
-         "xtype" : "BoxLayout",
-         "orientation" : "Clutter.Orientation.VERTICAL",
+         "id" : "filelayout_manager",
+         "$ orientation" : "Clutter.FlowOrientation.HORIZONTAL",
+         "bool homogeneous" : false,
+         "xtype" : "FlowLayout",
+         "float max_column_width" : "100.0f",
          "$ xns" : "Clutter",
-         "* prop" : "layout_manager"
+         "row_spacing" : 20,
+         "* prop" : "layout_manager",
+         "column_spacing" : 20
         },
         {
-         "$ margin_right" : 5,
-         "$ margin_top" : 5,
-         "id" : "+image",
+         "listeners" : {
+          "button_press_event" : "  (  event) => {\n    _this.open(this.file);\n    return false;\n} ",
+          "enter_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#333\");\n        return false;\n}",
+          "leave_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#000\");\n    return false;\n}"
+         },
+         "id" : "*fileitem",
          "* args" : "JsRender.JsRender file",
-         "* init" : "{\n    Gdk.Pixbuf pixbuf;\n    var fname = file.getIconFileName(false);\n\n    if (FileUtils.test(fname, FileTest.EXISTS)) {\n        pixbuf = new Gdk.Pixbuf.from_file(fname);\n    } else {\n        if (_this.missing_thumb_pixbuf == null) {\n                var     icon_theme = Gtk.IconTheme.get_default ();\n                _this.missing_thumb_pixbuf = icon_theme.load_icon (\"package-x-generic\", 92, 0);\n                _this.missing_thumb_pixbuf.ref();\n            }\n            pixbuf = _this.missing_thumb_pixbuf;\n\n    }\n\n    var img = new Clutter.Image();\n    img.set_data(pixbuf.get_pixels(),   \n                        pixbuf.has_alpha \n                          ? Cogl.PixelFormat.RGBA_8888\n                          : Cogl.PixelFormat.RGB_888,\n                        pixbuf.get_width (),\n            pixbuf.get_height (),\n                        pixbuf.get_rowstride ()\n    );\n    this.el.set_content(img);\n     // should probably do smarter scaling...\n    \n    \n    this.el.set_size(90, 70);\n}\n",
-         "$ x_expand" : true,
-         "* pack" : "add_child",
+         "* init" : "this.file = file;\nthis.el.set_size(100,100);",
+         "* pack" : true,
          "xtype" : "Actor",
-         "$ y_align" : "Clutter.ActorAlign.START",
-         "$ margin_left" : 5,
+         "# JsRender.JsRender file" : "",
+         "$ reactive" : true,
          "$ xns" : "Clutter",
-         "$ y_expand" : true,
-         "$ x_align" : "Clutter.ActorAlign.START"
+         "items" : [
+          {
+           "spacing" : 4,
+           "xtype" : "BoxLayout",
+           "orientation" : "Clutter.Orientation.VERTICAL",
+           "$ xns" : "Clutter",
+           "* prop" : "layout_manager"
+          },
+          {
+           "$ margin_right" : 5,
+           "$ margin_top" : 5,
+           "id" : "+image",
+           "* args" : "JsRender.JsRender file",
+           "* init" : "{\n    Gdk.Pixbuf pixbuf= null;\n    \n    var fname = file.getIconFileName(false);\n\n    try {\n        if (FileUtils.test(fname, FileTest.EXISTS)) {\n            pixbuf = new Gdk.Pixbuf.from_file(fname);\n        } \n    } catch (Error e) {\n        // noop\n    \n    }\n    if (pixbuf == null) {\n        \n        try {\n            if (_this.missing_thumb_pixbuf == null) {\n                    var icon_theme = Gtk.IconTheme.get_default ();\n                    _this.missing_thumb_pixbuf = icon_theme.load_icon (\"package-x-generic\", 92, 0);\n                    _this.missing_thumb_pixbuf.ref();\n                }\n                pixbuf = _this.missing_thumb_pixbuf;\n\n        } catch (Error e) {\n            // noop?\n        }\n    }\n    try {\n        var img = new Clutter.Image();\n        img.set_data(pixbuf.get_pixels(),   \n                            pixbuf.has_alpha \n                              ? Cogl.PixelFormat.RGBA_8888\n                              : Cogl.PixelFormat.RGB_888,\n                            pixbuf.get_width (),\n                pixbuf.get_height (),\n                            pixbuf.get_rowstride ()\n        );\n        this.el.set_content(img);\n    } catch (Error e) {\n        // noop?\n    }\n     // should probably do smarter scaling...\n    \n    \n    this.el.set_size(90, 70);\n}\n",
+           "* pack" : "add_child",
+           "xtype" : "Actor",
+           "bool x_expand" : false,
+           "$ y_align" : "Clutter.ActorAlign.START",
+           "$ margin_left" : 5,
+           "$ xns" : "Clutter",
+           "bool y_expand" : false,
+           "$ x_align" : "Clutter.ActorAlign.START"
+          },
+          {
+           "* ctor" : "new Clutter.Text.full(\"Sans 10px\", file.nickType(),  Clutter.Color.from_string(\"#fff\"))",
+           "id" : "+typetitle",
+           "* args" : "JsRender.JsRender file",
+           "* pack" : "add_child",
+           "xtype" : "Text",
+           "bool x_expand" : false,
+           "$ y_align" : "Clutter.ActorAlign.START",
+           "$ xns" : "Clutter",
+           "bool y_expand" : false,
+           "$ x_align" : "Clutter.ActorAlign.START"
+          },
+          {
+           "* ctor" : "new Clutter.Text.full(\"Sans 10px\", file.nickName(),  Clutter.Color.from_string(\"#fff\"))",
+           "id" : "+title",
+           "* args" : "JsRender.JsRender file",
+           "* pack" : "add_child",
+           "xtype" : "Text",
+           "bool x_expand" : false,
+           "$ y_align" : "Clutter.ActorAlign.START",
+           "$ xns" : "Clutter",
+           "bool y_expand" : false,
+           "$ x_align" : "Clutter.ActorAlign.START"
+          }
+         ]
         },
         {
-         "* ctor" : "new Clutter.Text.full(\"Sans 10px\", file.nickType(),new Clutter.Color.from_string(\"#fff\"))",
-         "* args" : "JsRender.JsRender file",
-         "id" : "+typetitle",
-         "$ x_expand" : true,
-         "* pack" : "add_child",
-         "xtype" : "Text",
-         "$ y_align" : "Clutter.ActorAlign.START",
-         "$ xns" : "Clutter",
-         "$ y_expand" : true,
-         "$ x_align" : "Clutter.ActorAlign.START"
-        },
-        {
-         "* ctor" : "new Clutter.Text.full(\"Sans 10px\", file.nickName(),new Clutter.Color.from_string(\"#fff\"))",
-         "* args" : "JsRender.JsRender file",
-         "id" : "+title",
-         "$ x_expand" : true,
-         "* pack" : "add_child",
-         "xtype" : "Text",
-         "$ y_align" : "Clutter.ActorAlign.START",
+         "id" : "*folderitem",
+         "* args" : "string folderpath",
+         "* init" : " \n//this.el.set_size(100,100);",
+         "* pack" : true,
+         "xtype" : "Actor",
+         "$ reactive" : true,
          "$ xns" : "Clutter",
-         "$ y_expand" : true,
-         "$ x_align" : "Clutter.ActorAlign.START"
+         "items" : [
+          {
+           "spacing" : 2,
+           "xtype" : "BoxLayout",
+           "orientation" : "Clutter.Orientation.VERTICAL",
+           "$ xns" : "Clutter",
+           "* prop" : "layout_manager"
+          },
+          {
+           "* ctor" : "new Clutter.Text.full(\"Sans bold 14px\", GLib.Path.get_basename(folderpath),  Clutter.Color.from_string(\"#fff\"))",
+           "* args" : "string folderpath",
+           "id" : "+foldertitle",
+           "$ x_expand" : true,
+           "* pack" : "add_child",
+           "xtype" : "Text",
+           "$ y_align" : "Clutter.ActorAlign.START",
+           "$ xns" : "Clutter",
+           "bool y_expand" : false,
+           "$ x_align" : "Clutter.ActorAlign.START"
+          },
+          {
+           "listeners" : {
+            "button_press_event" : "  (  event) => {\n   // _this.open(this.filepath);\n    return false;\n} ",
+            "enter_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#333\");\n        return false;\n}",
+            "leave_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#000\");\n    return false;\n}"
+           },
+           "* ctor" : "new Clutter.Text.full(\"Sans 10px\", GLib.Path.get_basename(filepath),  Clutter.Color.from_string(\"#fff\"))",
+           "* args" : "string filepath",
+           "id" : "*folderfile",
+           "* init" : "{\n    this.filepath = filepath;\n}\n",
+           "$ x_expand" : true,
+           "* pack" : "add_child",
+           "xtype" : "Text",
+           "$ y_align" : "Clutter.ActorAlign.START",
+           "string filepath" : "",
+           "$ xns" : "Clutter",
+           "bool reactive" : true,
+           "bool y_expand" : false,
+           "$ x_align" : "Clutter.ActorAlign.START"
+          }
+         ]
         }
        ]
       }
index 86b2bc8..a9b225d 100644 (file)
@@ -1,8 +1,8 @@
 static Xcls_ClutterFiles  _ClutterFiles;
 
-public class Xcls_ClutterFiles : Object 
+public class Xcls_ClutterFiles : Object
 {
-    public Clutter.ScrollActor el;
+    public Clutter.Actor el;
     private Xcls_ClutterFiles  _this;
 
     public static Xcls_ClutterFiles singleton()
@@ -12,77 +12,42 @@ public class Xcls_ClutterFiles : Object
         }
         return _ClutterFiles;
     }
+    public Xcls_project_title project_title;
+    public Xcls_project_title_manager project_title_manager;
+    public Xcls_project_title_name project_title_name;
+    public Xcls_project_title_path project_title_path;
+    public Xcls_scroller scroller;
     public Xcls_filelayout filelayout;
     public Xcls_filelayout_manager filelayout_manager;
 
         // my vars (def)
-    public Gee.ArrayList<Xcls_fileitem> fileitems;
+    public Clutter.ScrollMode scroll_mode;
     public Gdk.Pixbuf missing_thumb_pixbuf;
     public signal void open (JsRender.JsRender file);
+    public Gee.ArrayList<Object> fileitems;
 
-    // ctor 
+    // ctor
     public Xcls_ClutterFiles()
     {
         _this = this;
-        this.el = new Clutter.ScrollActor();
+        this.el = new Clutter.Actor();
 
         // my vars (dec)
+        this.scroll_mode = Clutter.ScrollMode.VERTICALLY;
         this.missing_thumb_pixbuf = null;
+        this.fileitems = new Gee.ArrayList<Object>();
 
         // set gobject values
-        this.el.scroll_mode = Clutter.ScrollMode.VERTICALLY;
         this.el.reactive = true;
-        var child_0 = new Xcls_filelayout( _this );
+        var child_0 = new Xcls_project_title( _this );
         child_0.ref();
         this.el.add_child (  child_0.el  );
-
-        // init method 
-
-        this.fileitems = new Gee.ArrayList<Xcls_fileitem>();
-
-        // listeners 
-        this.el.scroll_event.connect( ( event) => {
-           //Sprint("scroll event");
-                    var y = this.filelayout.el.y;
-                    var dir = event.direction;
-                    switch (dir) {
-                        case Clutter.ScrollDirection.UP:
-                            y += event.y /2;
-                            break;
-                        case Clutter.ScrollDirection.DOWN:
-                            y -= event.y /2 ;
-                            break;
-                        default:
-                            return false;
-                    }
-                    // range of scroll -- can go up -- eg.. -ve value.
-                    
-                    y = float.min(0, y);
-                    
-                    // to work out the max -ve number
-                    // height of filelayout
-                    // height of scrollactor..
-                    
-                    var last_child_bottom = this.filelayout.el.last_child.y +  this.filelayout.el.last_child.height;
-                     if ( (-1 * (y+200)) > (  last_child_bottom - this.el.height)) {
-                        return  false;
-                    }
-                
-                
-                    
-                    
-                //    print("\nlast child - this height = %f  ==== new y %f\n ".printf( 
-                  //          last_child_bottom - this.el.height,
-                   //         y));    
-                   // y = float.min(0, y);    //??
-                   // print("scroll event of %f  - new y = %f ".printf(event.y, y));
-                    this.filelayout.el.y = y;
-                    return true;
-                  
-        });
+        var child_1 = new Xcls_scroller( _this );
+        child_1.ref();
+        this.el.add_child (  child_1.el  );
     }
 
-    // user defined functions 
+    // user defined functions
     public  void clearFiles () {
         
         this.filelayout.el.remove_all_children();
@@ -98,7 +63,12 @@ public class Xcls_ClutterFiles : Object
         
         print("clutter files - load project: " + pr.name +"\n");
         // should unref.. them hopefully.
-        this.fileitems = new Gee.ArrayList<Xcls_fileitem>();
+        
+        this.project_title_name.el.text = pr.name;
+        this.project_title_path.el.text = pr.firstPath();
+        
+        // file items contains a reference until we reload ...
+        this.fileitems = new Gee.ArrayList<Object>();
     
         
     
@@ -112,22 +82,326 @@ public class Xcls_ClutterFiles : Object
             this.filelayout.el.add_child(a.el);
         }
         
+        // folders...
+        
+        if (!(pr is Project.Gtk)) {
+            print ("not gtk... skipping files");
+            return;
+        }
+        var gpr = (Project.Gtk)pr;
+         var def = gpr.compilegroups.get("_default_");
+         var items  = def.sources;
+         
+         
+         
+        for(var i =0 ; i < items.size; i++) {
+            print ("cheking folder %s\n", items.get(i));
+             var files = gpr.files(items.get(i));
+             if (files.size < 1) {
+                continue;
+             }
+    
+            // add the directory... items.get(i);
+            var x = new Xcls_folderitem(this,items.get(i));
+            this.fileitems.add(x);
+            this.filelayout.el.add_child(x.el);
+            
+            for(var j =0 ; j < files.size; j++) {
+                print ("adding file %s\n", files.get(j));
+            
+                var y = new Xcls_folderfile(this, files.get(j));
+                this.fileitems.add(y);
+                x.el.add_child(y.el);
+    
+                // add file to files.get(j);
+                
+            }
+            
+            
+            //this.el.set_value(citer, 1,   items.get(i) );
+        }
+        
        
         
         this.el.show();
     }
     public  void set_size (float w, float h) 
     {
+        
+         // called by window resize... with is alreaddy -50 (for the buttons?)
+         
+    
+    
+    
          if (this.el == null) {
             print("object not ready yet?");
             return;
         }
-       _this.filelayout_manager.el.max_column_width = w - 150;
-       this.el.set_size(this.el.get_stage().width-150,
-                            this.el.get_stage().height);
-                this.el.set_position(100,50);
+        
+        print("recv width %f, filelayoutw = %f", w, w-200);
+        
+        // floor ( w/120) * 120...
+        
+       //_this.filelayout_manager.el.max_column_width = w - 200;
+       _this.filelayout.el.width = w - 200;
+       
+        this.el.set_size(
+               // this.el.get_stage().width-150,
+               w,
+               h  // this.el.get_stage().height
+        );
+        
+        // 100 right for buttons ..
+        this.el.set_position(0,0);
+       
+       
+       this.scroller.el.set_size(
+               // this.el.get_stage().width-150,
+               w-50,
+               h  // this.el.get_stage().height
+        );
+        
+        // 100 right for buttons ..
+        this.scroller.el.set_position(75,50);
+        // scroll...
+        _this.filelayout.el.y = 0.0f;
+        
+    }
+    public class Xcls_project_title : Object
+    {
+        public Clutter.Actor el;
+        private Xcls_ClutterFiles  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_project_title(Xcls_ClutterFiles _owner )
+        {
+            _this = _owner;
+            _this.project_title = this;
+            this.el = new Clutter.Actor();
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.reactive = true;
+            var child_0 = new Xcls_project_title_manager( _this );
+            child_0.ref();
+            this.el.layout_manager = child_0.el;
+            var child_1 = new Xcls_FixedLayout4( _this );
+            child_1.ref();
+            this.el.layout_manager = child_1.el;
+            var child_2 = new Xcls_project_title_name( _this );
+            child_2.ref();
+            this.el.add_child (  child_2.el  );
+            var child_3 = new Xcls_project_title_path( _this );
+            child_3.ref();
+            this.el.add_child (  child_3.el  );
+
+            // init method
+
+            this.el.add_constraint(
+                new Clutter.BindConstraint(_this.el,Clutter.BindCoordinate.SIZE, 0.0f)
+            );
+            this.el.set_position(75,0);
+        }
+
+        // user defined functions
+    }
+    public class Xcls_project_title_manager : Object
+    {
+        public Clutter.FlowLayout el;
+        private Xcls_ClutterFiles  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_project_title_manager(Xcls_ClutterFiles _owner )
+        {
+            _this = _owner;
+            _this.project_title_manager = this;
+            this.el = new Clutter.FlowLayout( Clutter.FlowOrientation.HORIZONTAL );
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.homogeneous = false;
+            this.el.row_spacing = 5f;
+            this.el.column_spacing = 20f;
+        }
+
+        // user defined functions
+    }
+
+    public class Xcls_FixedLayout4 : Object
+    {
+        public Clutter.FixedLayout el;
+        private Xcls_ClutterFiles  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_FixedLayout4(Xcls_ClutterFiles _owner )
+        {
+            _this = _owner;
+            this.el = new Clutter.FixedLayout();
+
+            // my vars (dec)
+
+            // set gobject values
+        }
+
+        // user defined functions
+    }
+
+    public class Xcls_project_title_name : Object
+    {
+        public Clutter.Text el;
+        private Xcls_ClutterFiles  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_project_title_name(Xcls_ClutterFiles _owner )
+        {
+            _this = _owner;
+            _this.project_title_name = this;
+            this.el = new Clutter.Text.full("Sans 20px", "",  Clutter.Color.from_string("#eee"));
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.x = 0.0f;
+            this.el.y = 10.0f;
+            this.el.x_expand = false;
+        }
+
+        // user defined functions
+    }
+
+    public class Xcls_project_title_path : Object
+    {
+        public Clutter.Text el;
+        private Xcls_ClutterFiles  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_project_title_path(Xcls_ClutterFiles _owner )
+        {
+            _this = _owner;
+            _this.project_title_path = this;
+            this.el = new Clutter.Text.full("Sans 10px", "",  Clutter.Color.from_string("#ccc"));
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.x = 0.0f;
+            this.el.y = 35.0f;
+        }
+
+        // user defined functions
+    }
+
+
+    public class Xcls_scroller : Object
+    {
+        public Clutter.ScrollActor el;
+        private Xcls_ClutterFiles  _this;
+
+
+            // my vars (def)
+        public Gee.ArrayList<Xcls_fileitem> fileitems;
+        public Gdk.Pixbuf missing_thumb_pixbuf;
+
+        // ctor
+        public Xcls_scroller(Xcls_ClutterFiles _owner )
+        {
+            _this = _owner;
+            _this.scroller = this;
+            this.el = new Clutter.ScrollActor();
+
+            // my vars (dec)
+            this.fileitems = new Gee.ArrayList<Xcls_fileitem>();
+            this.missing_thumb_pixbuf = null;
+
+            // set gobject values
+            this.el.scroll_mode = Clutter.ScrollMode.VERTICALLY;
+            this.el.reactive = true;
+            var child_0 = new Xcls_filelayout( _this );
+            child_0.ref();
+            this.el.add_child (  child_0.el  );
+
+            //listeners
+            this.el.scroll_event.connect( ( event) => {
+               //Sprint("scroll event");
+                var y = _this.filelayout.el.y;
+                var dir = event.direction;
+                
+                var last_child_bottom = _this.filelayout.el.last_child.y +  _this.filelayout.el.last_child.height;
+                var bottompos = -1 * (  last_child_bottom - (0.5f * this.el.height));
+                
+                switch (dir) {
+                    case Clutter.ScrollDirection.UP:
+                        print("Scroll up by %f\n", event.y);
+                        y += event.y /2;
+                        y = float.min(0, y); // 
+                        break;
+                        
+                    case Clutter.ScrollDirection.DOWN:
+                        print("Scroll down by %f\n", event.y);
+                        y -= event.y /2 ;
+                        y = float.max(bottompos, y);
+                        
+                        
+                        break;
+                    default:
+                        return false;
+                }
+                // range of scroll -- can go up -- eg.. -ve value.
+                
+            
+                
+                // to work out the max -ve number
+                // height of filelayout
+                // height of scrollactor..
+                
+            /*
+                if ( (-1 * (y+200)) > (  last_child_bottom - this.el.height)) {
+                    var nv =         _this.filelayout.el.y ;
+                    if (nv != -1 * (  last_child_bottom - this.el.height)) {
+                
+                        _this.filelayout.el.y = -1 * (  last_child_bottom - this.el.height);
+                        return true;
+                    }
+                
+                    return  false;
+                }
+            
+            */
+                
+                
+            //    print("\nlast child - this height = %f  ==== new y %f\n ".printf( 
+              //          last_child_bottom - this.el.height,
+               //         y));    
+               // y = float.min(0, y);    //??
+               // print("scroll event of %f  - new y = %f ".printf(event.y, y));
+               print("Set scroll to %f (lcb=%f / height = %f)\n", y, last_child_bottom, this.el.height);
+               
+                _this.filelayout.el.y = y;
+                return true;
+                      
+            });
+        }
+
+        // user defined functions
     }
-    public class Xcls_filelayout : Object 
+    public class Xcls_filelayout : Object
     {
         public Clutter.Actor el;
         private Xcls_ClutterFiles  _this;
@@ -135,7 +409,7 @@ public class Xcls_ClutterFiles : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_filelayout(Xcls_ClutterFiles _owner )
         {
             _this = _owner;
@@ -150,16 +424,16 @@ public class Xcls_ClutterFiles : Object
             child_0.ref();
             this.el.layout_manager = child_0.el;
 
-            // init method 
+            // init method
 
             this.el.add_constraint(
                 new Clutter.BindConstraint(_this.el,Clutter.BindCoordinate.SIZE, 0.0f)
             );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_filelayout_manager : Object 
+    public class Xcls_filelayout_manager : Object
     {
         public Clutter.FlowLayout el;
         private Xcls_ClutterFiles  _this;
@@ -167,7 +441,7 @@ public class Xcls_ClutterFiles : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_filelayout_manager(Xcls_ClutterFiles _owner )
         {
             _this = _owner;
@@ -177,14 +451,16 @@ public class Xcls_ClutterFiles : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.homogeneous = true;
+            this.el.homogeneous = false;
+            this.el.max_column_width = 100.0f;
             this.el.row_spacing = 20f;
             this.el.column_spacing = 20f;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_fileitem : Object 
+
+    public class Xcls_fileitem : Object
     {
         public Clutter.Actor el;
         private Xcls_ClutterFiles  _this;
@@ -196,7 +472,7 @@ public class Xcls_ClutterFiles : Object
         public Xcls_typetitle typetitle;
         public Xcls_title title;
 
-        // ctor 
+        // ctor
         public Xcls_fileitem(Xcls_ClutterFiles _owner , JsRender.JsRender file)
         {
             _this = _owner;
@@ -206,7 +482,7 @@ public class Xcls_ClutterFiles : Object
 
             // set gobject values
             this.el.reactive = true;
-            var child_0 = new Xcls_BoxLayout5( _this );
+            var child_0 = new Xcls_BoxLayout11( _this );
             child_0.ref();
             this.el.layout_manager = child_0.el;
             var child_1 = new Xcls_image( _this ,file);
@@ -222,29 +498,29 @@ public class Xcls_ClutterFiles : Object
             this.el.add_child (  child_3.el  );
             this.title =  child_3;
 
-            // init method 
+            // init method
 
             this.file = file;
             this.el.set_size(100,100);
 
-            // listeners 
+            //listeners
             this.el.button_press_event.connect( (  event) => {
                 _this.open(this.file);
                 return false;
             });
             this.el.enter_event.connect( (  event)  => {
-                this.el.background_color = new Clutter.Color.from_string("#333");
+                this.el.background_color =   Clutter.Color.from_string("#333");
                     return false;
             });
             this.el.leave_event.connect( (  event)  => {
-                this.el.background_color = new Clutter.Color.from_string("#000");
+                this.el.background_color =   Clutter.Color.from_string("#000");
                 return false;
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_BoxLayout5 : Object 
+    public class Xcls_BoxLayout11 : Object
     {
         public Clutter.BoxLayout el;
         private Xcls_ClutterFiles  _this;
@@ -252,8 +528,8 @@ public class Xcls_ClutterFiles : Object
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_BoxLayout5(Xcls_ClutterFiles _owner )
+        // ctor
+        public Xcls_BoxLayout11(Xcls_ClutterFiles _owner )
         {
             _this = _owner;
             this.el = new Clutter.BoxLayout();
@@ -265,9 +541,10 @@ public class Xcls_ClutterFiles : Object
             this.el.orientation = Clutter.Orientation.VERTICAL;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_image : Object 
+
+    public class Xcls_image : Object
     {
         public Clutter.Actor el;
         private Xcls_ClutterFiles  _this;
@@ -275,7 +552,7 @@ public class Xcls_ClutterFiles : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_image(Xcls_ClutterFiles _owner , JsRender.JsRender file)
         {
             _this = _owner;
@@ -287,39 +564,54 @@ public class Xcls_ClutterFiles : Object
             this.el.margin_right = 5f;
             this.el.margin_left = 5f;
             this.el.x_align = Clutter.ActorAlign.START;
-            this.el.x_expand = true;
+            this.el.x_expand = false;
             this.el.y_align = Clutter.ActorAlign.START;
             this.el.margin_top = 5f;
-            this.el.y_expand = true;
+            this.el.y_expand = false;
 
-            // init method 
+            // init method
 
             {
-                Gdk.Pixbuf pixbuf;
+                Gdk.Pixbuf pixbuf= null;
+                
                 var fname = file.getIconFileName(false);
             
-                if (FileUtils.test(fname, FileTest.EXISTS)) {
-                    pixbuf = new Gdk.Pixbuf.from_file(fname);
-                } else {
-                    if (_this.missing_thumb_pixbuf == null) {
-                            var     icon_theme = Gtk.IconTheme.get_default ();
-                            _this.missing_thumb_pixbuf = icon_theme.load_icon ("package-x-generic", 92, 0);
-                            _this.missing_thumb_pixbuf.ref();
-                        }
-                        pixbuf = _this.missing_thumb_pixbuf;
-            
+                try {
+                    if (FileUtils.test(fname, FileTest.EXISTS)) {
+                        pixbuf = new Gdk.Pixbuf.from_file(fname);
+                    } 
+                } catch (Error e) {
+                    // noop
+                
                 }
+                if (pixbuf == null) {
+                    
+                    try {
+                        if (_this.missing_thumb_pixbuf == null) {
+                                var icon_theme = Gtk.IconTheme.get_default ();
+                                _this.missing_thumb_pixbuf = icon_theme.load_icon ("package-x-generic", 92, 0);
+                                _this.missing_thumb_pixbuf.ref();
+                            }
+                            pixbuf = _this.missing_thumb_pixbuf;
             
-                var img = new Clutter.Image();
-                img.set_data(pixbuf.get_pixels(),   
-                                    pixbuf.has_alpha 
-                                      ? Cogl.PixelFormat.RGBA_8888
-                                      : Cogl.PixelFormat.RGB_888,
-                                    pixbuf.get_width (),
-                        pixbuf.get_height (),
-                                    pixbuf.get_rowstride ()
-                );
-                this.el.set_content(img);
+                    } catch (Error e) {
+                        // noop?
+                    }
+                }
+                try {
+                    var img = new Clutter.Image();
+                    img.set_data(pixbuf.get_pixels(),   
+                                        pixbuf.has_alpha 
+                                          ? Cogl.PixelFormat.RGBA_8888
+                                          : Cogl.PixelFormat.RGB_888,
+                                        pixbuf.get_width (),
+                            pixbuf.get_height (),
+                                        pixbuf.get_rowstride ()
+                    );
+                    this.el.set_content(img);
+                } catch (Error e) {
+                    // noop?
+                }
                  // should probably do smarter scaling...
                 
                 
@@ -327,9 +619,10 @@ public class Xcls_ClutterFiles : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_typetitle : Object 
+
+    public class Xcls_typetitle : Object
     {
         public Clutter.Text el;
         private Xcls_ClutterFiles  _this;
@@ -337,24 +630,25 @@ public class Xcls_ClutterFiles : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_typetitle(Xcls_ClutterFiles _owner , JsRender.JsRender file)
         {
             _this = _owner;
-            this.el = new Clutter.Text.full("Sans 10px", file.nickType(),new Clutter.Color.from_string("#fff"));
+            this.el = new Clutter.Text.full("Sans 10px", file.nickType(),  Clutter.Color.from_string("#fff"));
 
             // my vars (dec)
 
             // set gobject values
             this.el.x_align = Clutter.ActorAlign.START;
-            this.el.x_expand = true;
+            this.el.x_expand = false;
             this.el.y_align = Clutter.ActorAlign.START;
-            this.el.y_expand = true;
+            this.el.y_expand = false;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_title : Object 
+
+    public class Xcls_title : Object
     {
         public Clutter.Text el;
         private Xcls_ClutterFiles  _this;
@@ -362,11 +656,96 @@ public class Xcls_ClutterFiles : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_title(Xcls_ClutterFiles _owner , JsRender.JsRender file)
         {
             _this = _owner;
-            this.el = new Clutter.Text.full("Sans 10px", file.nickName(),new Clutter.Color.from_string("#fff"));
+            this.el = new Clutter.Text.full("Sans 10px", file.nickName(),  Clutter.Color.from_string("#fff"));
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.x_align = Clutter.ActorAlign.START;
+            this.el.x_expand = false;
+            this.el.y_align = Clutter.ActorAlign.START;
+            this.el.y_expand = false;
+        }
+
+        // user defined functions
+    }
+
+
+    public class Xcls_folderitem : Object
+    {
+        public Clutter.Actor el;
+        private Xcls_ClutterFiles  _this;
+
+
+            // my vars (def)
+        public Xcls_foldertitle foldertitle;
+
+        // ctor
+        public Xcls_folderitem(Xcls_ClutterFiles _owner , string folderpath)
+        {
+            _this = _owner;
+            this.el = new Clutter.Actor();
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.reactive = true;
+            var child_0 = new Xcls_BoxLayout16( _this );
+            child_0.ref();
+            this.el.layout_manager = child_0.el;
+            var child_1 = new Xcls_foldertitle( _this ,folderpath);
+            child_1.ref();
+            this.el.add_child (  child_1.el  );
+            this.foldertitle =  child_1;
+
+            // init method
+
+            //this.el.set_size(100,100);
+        }
+
+        // user defined functions
+    }
+    public class Xcls_BoxLayout16 : Object
+    {
+        public Clutter.BoxLayout el;
+        private Xcls_ClutterFiles  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_BoxLayout16(Xcls_ClutterFiles _owner )
+        {
+            _this = _owner;
+            this.el = new Clutter.BoxLayout();
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.spacing = 2;
+            this.el.orientation = Clutter.Orientation.VERTICAL;
+        }
+
+        // user defined functions
+    }
+
+    public class Xcls_foldertitle : Object
+    {
+        public Clutter.Text el;
+        private Xcls_ClutterFiles  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_foldertitle(Xcls_ClutterFiles _owner , string folderpath)
+        {
+            _this = _owner;
+            this.el = new Clutter.Text.full("Sans bold 14px", GLib.Path.get_basename(folderpath),  Clutter.Color.from_string("#fff"));
 
             // my vars (dec)
 
@@ -374,9 +753,61 @@ public class Xcls_ClutterFiles : Object
             this.el.x_align = Clutter.ActorAlign.START;
             this.el.x_expand = true;
             this.el.y_align = Clutter.ActorAlign.START;
-            this.el.y_expand = true;
+            this.el.y_expand = false;
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
+    public class Xcls_folderfile : Object
+    {
+        public Clutter.Text el;
+        private Xcls_ClutterFiles  _this;
+
+
+            // my vars (def)
+        public string filepath;
+
+        // ctor
+        public Xcls_folderfile(Xcls_ClutterFiles _owner , string filepath)
+        {
+            _this = _owner;
+            this.el = new Clutter.Text.full("Sans 10px", GLib.Path.get_basename(filepath),  Clutter.Color.from_string("#fff"));
+
+            // my vars (dec)
+
+            // set gobject values
+            this.el.x_align = Clutter.ActorAlign.START;
+            this.el.x_expand = true;
+            this.el.y_align = Clutter.ActorAlign.START;
+            this.el.reactive = true;
+            this.el.y_expand = false;
+
+            // init method
+
+            {
+                this.filepath = filepath;
+            }
+
+            //listeners
+            this.el.button_press_event.connect( (  event) => {
+               // _this.open(this.filepath);
+                return false;
+            });
+            this.el.enter_event.connect( (  event)  => {
+                this.el.background_color =   Clutter.Color.from_string("#333");
+                    return false;
+            });
+            this.el.leave_event.connect( (  event)  => {
+                this.el.background_color =   Clutter.Color.from_string("#000");
+                return false;
+            });
+        }
+
+        // user defined functions
+    }
+
+
+
+
 }
diff --git a/src/Builder4/CompileState.vala b/src/Builder4/CompileState.vala
new file mode 100644 (file)
index 0000000..4a81482
--- /dev/null
@@ -0,0 +1,44 @@
+/**
+ * handle the compile state 
+ * 
+ * when the app tries to compile the application, it will output information
+ * about errors/warnings and depricated information.
+ * 
+ * This has a number of effects..
+ * 
+ * - when it compiles
+ *  -- if any of the errors// etc.. are affecting the current open file
+ *     then we should flag the tree indicating which node has a problem
+ * 
+ *  -- update the footer bar to show stats (eg. how many errors etc..)
+ * 
+ * 
+ * 
+ * - when you open a file
+ *   - if there are any notices for that file, then we should flag the tree
+ *    to show the errors.
+ * 
+ *  
+ * 
+ */
+public class CompileState : Object 
+{
+       public Xcls_MainWindow win;
+
+       public enum State {
+               NONE,
+               PREVIEW,
+               OBJECT,
+               PROP,
+               LISTENER,
+               CODE,
+               FILES,
+               PROJECT // project settings..
+       }
+
+       public State state = State.NONE;
+
+       public bool children_loaded = false;
+
+       
+       public X
index bccce1d..39c559e 100644 (file)
@@ -17,7 +17,7 @@
    "gint default_height" : 500,
    "gboolean deletable" : true,
    "xtype" : "Dialog",
-   "| string show" : " (Gtk.Window ?parent, Project.Project project, string cls, string tbl) {// JsRender.Node node) {\n \n    if (parent  != null) {\n        this.el.set_transient_for(parent);\n        this.el.modal = true;\n    }\n    this.result_json = \"\";\n     var  db = project.roo_database;\n     \n    \n     this.el.show_all();\n     var   ret = \"\";\n     while (true) {\n    \n        var runhtml = \"<script type=\\\"text/javascript\\\">\\n\" ;\n        string builderhtml;\n        \n        \n        GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + \"/resources/roo.builder.js\", out builderhtml);\n\n        runhtml += builderhtml + \"\\n\";\n        \n        \n        runhtml += \"\\n\" +\n            \"Builder.saveHTML = function() {};\\n\" + \n\t    \"Roo.onReady(function() {\\n\" +\n\n\t    \"Roo.XComponent.build();\\n\" +\n\t    \"});\\n\";\n\t\n\t\n        \n\n        var ar = db.readForeignKeys(tbl);\n        var  generator = new Json.Generator ();\n        var  root = new Json.Node(Json.NodeType.OBJECT);\n        root.init_object(ar);\n        generator.set_root (root);\n        \n        generator.pretty = true;\n        generator.indent = 4;\n        \n        runhtml += \"\\n\" +\n        \" Roo.XComponent.on('buildcomplete', function() {\\n\" +\n         \"    Editor.\" + cls + \".panel.loadData(\" + generator.to_data (null) + \"); \" +\n        \"});\\n\";\n\n        \n\t\n\t\n\n        runhtml += \"</script>\\n\" ;\n\n        print(runhtml);\n        // fix to make sure they are the same..\n        \n        // need to modify paths\n\n        string inhtml;\n        \n        GLib.FileUtils.get_contents(\n            BuilderApplication.configDirectory() + \"/resources/roo.builder.html\"\n                , out inhtml);\n        \n        \n        // fetch the json from the database...\n        \n        //print(runhtml);\n        \n        var html = inhtml.replace(\"</head>\", runhtml + // + this.runhtml + \n            \"<script type=\\\"text/javascript\\\" src=\\\"resources://localhost/Editors/Editor.\" + cls + \".js\\\"></script>\" + \n      \n                        \n        \"</head>\");\n        //print(\"LOAD HTML \" + html);\n        \n         //var rootURL = _this.file.project.rootURL;\n   \n        \n        \n        this.webview.el.load_html( html , \n            //fixme - should be a config option!\n            \"xhttp://localhost/app.Builder.js/\"\n        );\n    \n        \n    \n   \n         var response_id = this.el.run();\n        \n         if (response_id == 1) { // OK...\n             var loop = new MainLoop();\n             // run toBJS to get the data... (calls back into alert handler)\n               this.webview.el.run_javascript.begin(\"Editor.\" + cls + \".panel.toBJS();\", null, (obj, res) => {\n\n                 this.webview.el.run_javascript.end(res);\n\n                    loop.quit();\n                });\n             loop.run();\n             ret = _this.result_json;\n    //           print(\"LOOP END?\");\n             // try and get the resopse...\n            break;\n         }\n        if (response_id < 1) {\n            this.el.hide();\n             return \"\";\n        }\n        // keep showing...?\n        continue;\n    }\n    \n    // now we save it..\n    this.el.hide();\n    \n    return ret;\n    \n    \n    \n}\n",
+   "| string show" : " (Gtk.Window ?parent, Project.Project project, string cls, string tbl) {// JsRender.Node node) {\n \n    if (parent  != null) {\n        this.el.set_transient_for(parent);\n        this.el.modal = true;\n    }\n    this.result_json = \"\";\n     var  db = project.roo_database;\n     \n    \n     this.el.show_all();\n     var   ret = \"\";\n     while (true) {\n    \n        var runhtml = \"<script type=\\\"text/javascript\\\">\\n\" ;\n        string builderhtml;\n        \n        try {\n            GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + \"/resources/roo.builder.js\", out builderhtml);\n        } catch (Error e) {\n            builderhtml = \"\";\n        }\n        \n\n        runhtml += builderhtml + \"\\n\";\n        \n        \n        runhtml += \"\\n\" +\n            \"Builder.saveHTML = function() {};\\n\" + \n\t    \"Roo.onReady(function() {\\n\" +\n\n\t    \"Roo.XComponent.build();\\n\" +\n\t    \"});\\n\";\n\t\n\t\n        \n\n        var ar = db.readForeignKeys(tbl);\n        var  generator = new Json.Generator ();\n        var  root = new Json.Node(Json.NodeType.OBJECT);\n        root.init_object(ar);\n        generator.set_root (root);\n        \n        generator.pretty = true;\n        generator.indent = 4;\n        \n        runhtml += \"\\n\" +\n        \" Roo.XComponent.on('buildcomplete', function() {\\n\" +\n         \"    Editor.\" + cls + \".panel.loadData(\" + generator.to_data (null) + \"); \" +\n        \"});\\n\";\n\n        \n\t\n\t\n\n        runhtml += \"</script>\\n\" ;\n\n        print(runhtml);\n        // fix to make sure they are the same..\n        \n        // need to modify paths\n\n        string inhtml;\n        try {\n            GLib.FileUtils.get_contents(\n                BuilderApplication.configDirectory() + \"/resources/roo.builder.html\"\n                    , out inhtml);\n        \n        } catch (Error e) {\n            inhtml = \"\";\n        }\n        // fetch the json from the database...\n        \n        //print(runhtml);\n        \n        var html = inhtml.replace(\"</head>\", runhtml + // + this.runhtml + \n            \"<script type=\\\"text/javascript\\\" src=\\\"resources://localhost/Editors/Editor.\" + cls + \".js\\\"></script>\" + \n      \n                        \n        \"</head>\");\n        //print(\"LOAD HTML \" + html);\n        \n         //var rootURL = _this.file.project.rootURL;\n   \n        \n        \n        this.webview.el.load_html( html , \n            //fixme - should be a config option!\n            \"xhttp://localhost/app.Builder.js/\"\n        );\n    \n        \n    \n   \n         var response_id = this.el.run();\n        \n         if (response_id == 1) { // OK...\n             var loop = new MainLoop();\n             // run toBJS to get the data... (calls back into alert handler)\n                _this.result_json = \"\";\n                 this.webview.el.run_javascript.begin(\"Editor.\" + cls + \".panel.toBJS();\", null, (obj, res) => {\n                     try {\n                        this.webview.el.run_javascript.end(res);\n                    } catch(Error e) {\n                \n                     }\n                     loop.quit();\n                 });\n                 loop.run();\n                 ret = _this.result_json;\n                 \n             \n    //           print(\"LOOP END?\");\n             // try and get the resopse...\n            break;\n         }\n        if (response_id < 1) {\n            this.el.hide();\n             return \"\";\n        }\n        // keep showing...?\n        continue;\n    }\n    \n    // now we save it..\n    this.el.hide();\n    \n    return ret;\n    \n    \n    \n}\n",
    "| bool has_plugin" : "(string cls) {\n\n     return GLib.FileUtils.test(\n            BuilderApplication.configDirectory() + \"/resources/Editors/Editor.\" + cls + \".js\",\n            GLib.FileTest.IS_REGULAR\n      );\n    \n\n\n}\n",
    "$ xns" : "Gtk",
    "gint default_width" : 750,
index fd72619..e4c46f4 100644 (file)
@@ -1,6 +1,6 @@
 static Xcls_DialogPluginWebkit  _DialogPluginWebkit;
 
-public class Xcls_DialogPluginWebkit : Object 
+public class Xcls_DialogPluginWebkit : Object
 {
     public Gtk.Dialog el;
     private Xcls_DialogPluginWebkit  _this;
@@ -18,7 +18,7 @@ public class Xcls_DialogPluginWebkit : Object
     public string tmpjs;
     public string result_json;
 
-    // ctor 
+    // ctor
     public Xcls_DialogPluginWebkit()
     {
         _this = this;
@@ -45,7 +45,7 @@ public class Xcls_DialogPluginWebkit : Object
         child_3.ref();
         this.el.add_action_widget (  child_3.el , 1 );
 
-        // listeners 
+        //listeners
         this.el.delete_event.connect( (self, event) => {
             this.el.hide();
             return true; 
@@ -53,7 +53,7 @@ public class Xcls_DialogPluginWebkit : Object
         });
     }
 
-    // user defined functions 
+    // user defined functions
     public string show (Gtk.Window ?parent, Project.Project project, string cls, string tbl) {// JsRender.Node node) {
      
         if (parent  != null) {
@@ -71,8 +71,12 @@ public class Xcls_DialogPluginWebkit : Object
             var runhtml = "<script type=\"text/javascript\">\n" ;
             string builderhtml;
             
+            try {
+                GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + "/resources/roo.builder.js", out builderhtml);
+            } catch (Error e) {
+                builderhtml = "";
+            }
             
-            GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + "/resources/roo.builder.js", out builderhtml);
     
             runhtml += builderhtml + "\n";
             
@@ -113,12 +117,14 @@ public class Xcls_DialogPluginWebkit : Object
             // need to modify paths
     
             string inhtml;
+            try {
+                GLib.FileUtils.get_contents(
+                    BuilderApplication.configDirectory() + "/resources/roo.builder.html"
+                        , out inhtml);
             
-            GLib.FileUtils.get_contents(
-                BuilderApplication.configDirectory() + "/resources/roo.builder.html"
-                    , out inhtml);
-            
-            
+            } catch (Error e) {
+                inhtml = "";
+            }
             // fetch the json from the database...
             
             //print(runhtml);
@@ -147,14 +153,19 @@ public class Xcls_DialogPluginWebkit : Object
              if (response_id == 1) { // OK...
                  var loop = new MainLoop();
                  // run toBJS to get the data... (calls back into alert handler)
-                   this.webview.el.run_javascript.begin("Editor." + cls + ".panel.toBJS();", null, (obj, res) => {
-    
-                     this.webview.el.run_javascript.end(res);
-    
-                        loop.quit();
-                    });
-                 loop.run();
-                 ret = _this.result_json;
+                    _this.result_json = "";
+                     this.webview.el.run_javascript.begin("Editor." + cls + ".panel.toBJS();", null, (obj, res) => {
+                         try {
+                            this.webview.el.run_javascript.end(res);
+                        } catch(Error e) {
+                    
+                         }
+                         loop.quit();
+                     });
+                     loop.run();
+                     ret = _this.result_json;
+                     
+                 
         //           print("LOOP END?");
                  // try and get the resopse...
                 break;
@@ -185,7 +196,7 @@ public class Xcls_DialogPluginWebkit : Object
     
     
     }
-    public class Xcls_Box2 : Object 
+    public class Xcls_Box2 : Object
     {
         public Gtk.Box el;
         private Xcls_DialogPluginWebkit  _this;
@@ -193,7 +204,7 @@ public class Xcls_DialogPluginWebkit : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Box2(Xcls_DialogPluginWebkit _owner )
         {
             _this = _owner;
@@ -208,9 +219,9 @@ public class Xcls_DialogPluginWebkit : Object
             this.el.pack_start (  child_0.el , false,true,3 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_ScrolledWindow3 : Object 
+    public class Xcls_ScrolledWindow3 : Object
     {
         public Gtk.ScrolledWindow el;
         private Xcls_DialogPluginWebkit  _this;
@@ -218,7 +229,7 @@ public class Xcls_DialogPluginWebkit : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_ScrolledWindow3(Xcls_DialogPluginWebkit _owner )
         {
             _this = _owner;
@@ -232,14 +243,14 @@ public class Xcls_DialogPluginWebkit : Object
             child_0.ref();
             this.el.add (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_webview : Object 
+    public class Xcls_webview : Object
     {
         public WebKit.WebView el;
         private Xcls_DialogPluginWebkit  _this;
@@ -247,7 +258,7 @@ public class Xcls_DialogPluginWebkit : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_webview(Xcls_DialogPluginWebkit _owner )
         {
             _this = _owner;
@@ -258,7 +269,7 @@ public class Xcls_DialogPluginWebkit : Object
 
             // set gobject values
 
-            // init method 
+            // init method
 
             {
                 // this may not work!?
@@ -290,7 +301,7 @@ public class Xcls_DialogPluginWebkit : Object
                 
             }
 
-            // listeners 
+            //listeners
             this.el.script_dialog.connect( (dialog) => {
                 if (this.el == null) {
                     return true;
@@ -327,9 +338,12 @@ public class Xcls_DialogPluginWebkit : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button5 : Object 
+
+
+
+    public class Xcls_Button5 : Object
     {
         public Gtk.Button el;
         private Xcls_DialogPluginWebkit  _this;
@@ -337,7 +351,7 @@ public class Xcls_DialogPluginWebkit : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button5(Xcls_DialogPluginWebkit _owner )
         {
             _this = _owner;
@@ -349,9 +363,10 @@ public class Xcls_DialogPluginWebkit : Object
             this.el.label = "Reload";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button6 : Object 
+
+    public class Xcls_Button6 : Object
     {
         public Gtk.Button el;
         private Xcls_DialogPluginWebkit  _this;
@@ -359,7 +374,7 @@ public class Xcls_DialogPluginWebkit : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button6(Xcls_DialogPluginWebkit _owner )
         {
             _this = _owner;
@@ -371,9 +386,10 @@ public class Xcls_DialogPluginWebkit : Object
             this.el.label = "Cancel";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button7 : Object 
+
+    public class Xcls_Button7 : Object
     {
         public Gtk.Button el;
         private Xcls_DialogPluginWebkit  _this;
@@ -381,7 +397,7 @@ public class Xcls_DialogPluginWebkit : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button7(Xcls_DialogPluginWebkit _owner )
         {
             _this = _owner;
@@ -393,6 +409,7 @@ public class Xcls_DialogPluginWebkit : Object
             this.el.label = "OK";
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
 }
index ec71f65..ec32110 100644 (file)
      "items" : [
       {
        "label" : "Name",
-       "xtype" : "Label",
        "* pack" : "add",
+       "xtype" : "Label",
        "$ xns" : "Gtk"
       },
       {
        "id" : "name",
-       "xtype" : "Entry",
        "* pack" : "add",
+       "xtype" : "Entry",
        "$ xns" : "Gtk"
       }
      ]
     },
     {
      "label" : "Cancel",
-     "xtype" : "Button",
      "* pack" : "add_action_widget,0",
+     "xtype" : "Button",
      "$ xns" : "Gtk"
     },
     {
      "label" : "OK",
-     "xtype" : "Button",
      "* pack" : "add_action_widget,1",
+     "xtype" : "Button",
      "$ xns" : "Gtk"
     }
    ]
index 0c84456..84c2f08 100644 (file)
@@ -1,6 +1,6 @@
 static DialogSaveModule  _DialogSaveModule;
 
-public class DialogSaveModule : Object 
+public class DialogSaveModule : Object
 {
     public Gtk.Dialog el;
     private DialogSaveModule  _this;
@@ -18,7 +18,7 @@ public class DialogSaveModule : Object
     public Project.Project project;
     public JsRender.Node data;
 
-    // ctor 
+    // ctor
     public DialogSaveModule()
     {
         _this = this;
@@ -40,14 +40,14 @@ public class DialogSaveModule : Object
         child_2.ref();
         this.el.add_action_widget (  child_2.el , 1 );
 
-        // listeners 
+        //listeners
         this.el.delete_event.connect( (self, event) => {
             this.el.response(Gtk.ResponseType.CANCEL);
             return true;
         });
     }
 
-    // user defined functions 
+    // user defined functions
     public   string show (Gtk.Window parent, Project.Project project, JsRender.Node data) {
      
          
@@ -96,7 +96,7 @@ public class DialogSaveModule : Object
         
         
     }
-    public class Xcls_Box2 : Object 
+    public class Xcls_Box2 : Object
     {
         public Gtk.Box el;
         private DialogSaveModule  _this;
@@ -104,7 +104,7 @@ public class DialogSaveModule : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Box2(DialogSaveModule _owner )
         {
             _this = _owner;
@@ -121,9 +121,9 @@ public class DialogSaveModule : Object
             this.el.add (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label3 : Object 
+    public class Xcls_Label3 : Object
     {
         public Gtk.Label el;
         private DialogSaveModule  _this;
@@ -131,7 +131,7 @@ public class DialogSaveModule : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label3(DialogSaveModule _owner )
         {
             _this = _owner;
@@ -142,9 +142,10 @@ public class DialogSaveModule : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_name : Object 
+
+    public class Xcls_name : Object
     {
         public Gtk.Entry el;
         private DialogSaveModule  _this;
@@ -152,7 +153,7 @@ public class DialogSaveModule : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_name(DialogSaveModule _owner )
         {
             _this = _owner;
@@ -164,9 +165,11 @@ public class DialogSaveModule : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button5 : Object 
+
+
+    public class Xcls_Button5 : Object
     {
         public Gtk.Button el;
         private DialogSaveModule  _this;
@@ -174,7 +177,7 @@ public class DialogSaveModule : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button5(DialogSaveModule _owner )
         {
             _this = _owner;
@@ -186,9 +189,10 @@ public class DialogSaveModule : Object
             this.el.label = "Cancel";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button6 : Object 
+
+    public class Xcls_Button6 : Object
     {
         public Gtk.Button el;
         private DialogSaveModule  _this;
@@ -196,7 +200,7 @@ public class DialogSaveModule : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button6(DialogSaveModule _owner )
         {
             _this = _owner;
@@ -208,6 +212,7 @@ public class DialogSaveModule : Object
             this.el.label = "OK";
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
 }
index 4a35338..9bb07d8 100644 (file)
@@ -5,14 +5,14 @@
  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/DialogSaveTemplate.bjs",
  "permname" : "",
  "modOrder" : "",
- "build_module" : "",
+ "build_module" : "builder",
  "items" : [
   {
    "listeners" : {
     "delete_event" : " (self, event) => {\n   this.el.response(Gtk.ResponseType.CANCEL);\n    return true;\n    \n}"
    },
    "default_width" : 400,
-   "|    void show" : " (Gtk.Window parent, Palete.Palete palete, JsRender.Node data) {\n \n    \n        this.el.set_transient_for(parent);\n        this.el.modal = true;\n        \n          this.name.el.set_text(\"\");\n        this.el.show_all();\n         var   name = \"\";\n        while (true) {\n            var response_id = this.el.run();\n            if (response_id < 1) {\n                this.el.hide();\n                 return;\n            }\n            \n            name = _this.name.el.get_text();\n            if (name.length < 1) {\n                StandardErrorDialog.singleton().show(\n                     _this.el,\n                    \"You must give the template a name. \"\n                );\n                continue;\n            }\n            if (!Regex.match_simple (\"^[A-Za-z][A-Za-z0-9. ]+$\", name) )\n            {\n                StandardErrorDialog.singleton().show(\n                     _this.el,\n                    \"Template Name must contain only letters dots\"\n                );\n                continue;\n            }\n            break;\n        }\n        palete.saveTemplate(name, data);\n        \n        // now we save it..\n        this.el.hide();\n        \n        \n  \n   \n}\n",
+   "|    void show" : " (Gtk.Window parent, Palete.Palete palete, JsRender.Node data) {\n \n    \n        this.el.set_transient_for(parent);\n        this.el.modal = true;\n        \n          this.name.el.set_text(\"\");\n        this.el.show_all();\n         var   name = \"\";\n        while (true) {\n            var response_id = this.el.run();\n            if (response_id < 1) {\n                this.el.hide();\n                 return;\n            }\n            \n            name = _this.name.el.get_text();\n            if (name.length < 1) {\n                StandardErrorDialog.singleton().show(\n                     _this.el,\n                    \"You must give the template a name. \"\n                );\n                continue;\n            }\n            if (!Regex.match_simple (\"^[A-Za-z][A-Za-z0-9. ]+$\", name) )\n            {\n                StandardErrorDialog.singleton().show(\n                     _this.el,\n                    \"Template Name must contain only letters dots\"\n                );\n                continue;\n            }\n            break;\n        }\n        palete.saveTemplate(name, data);\n        \n        // now we save it..\n        this.el.hide();\n        \n         \n  \n   \n}\n",
    "xtype" : "Dialog",
    "default_height" : 200,
    "# Palete.Palete palete" : "",
index 053f4cc..1a0936c 100644 (file)
@@ -1,6 +1,6 @@
 static DialogSaveTemplate  _DialogSaveTemplate;
 
-public class DialogSaveTemplate : Object 
+public class DialogSaveTemplate : Object
 {
     public Gtk.Dialog el;
     private DialogSaveTemplate  _this;
@@ -18,7 +18,7 @@ public class DialogSaveTemplate : Object
     public Palete.Palete palete;
     public JsRender.Node data;
 
-    // ctor 
+    // ctor
     public DialogSaveTemplate()
     {
         _this = this;
@@ -40,7 +40,7 @@ public class DialogSaveTemplate : Object
         child_2.ref();
         this.el.add_action_widget (  child_2.el , 1 );
 
-        // listeners 
+        //listeners
         this.el.delete_event.connect( (self, event) => {
            this.el.response(Gtk.ResponseType.CANCEL);
             return true;
@@ -48,7 +48,7 @@ public class DialogSaveTemplate : Object
         });
     }
 
-    // user defined functions 
+    // user defined functions
     public    void show (Gtk.Window parent, Palete.Palete palete, JsRender.Node data) {
      
         
@@ -88,11 +88,11 @@ public class DialogSaveTemplate : Object
             // now we save it..
             this.el.hide();
             
-            
+             
       
        
     }
-    public class Xcls_Box2 : Object 
+    public class Xcls_Box2 : Object
     {
         public Gtk.Box el;
         private DialogSaveTemplate  _this;
@@ -100,7 +100,7 @@ public class DialogSaveTemplate : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Box2(DialogSaveTemplate _owner )
         {
             _this = _owner;
@@ -117,9 +117,9 @@ public class DialogSaveTemplate : Object
             this.el.add (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label3 : Object 
+    public class Xcls_Label3 : Object
     {
         public Gtk.Label el;
         private DialogSaveTemplate  _this;
@@ -127,7 +127,7 @@ public class DialogSaveTemplate : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label3(DialogSaveTemplate _owner )
         {
             _this = _owner;
@@ -138,9 +138,10 @@ public class DialogSaveTemplate : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_name : Object 
+
+    public class Xcls_name : Object
     {
         public Gtk.Entry el;
         private DialogSaveTemplate  _this;
@@ -148,7 +149,7 @@ public class DialogSaveTemplate : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_name(DialogSaveTemplate _owner )
         {
             _this = _owner;
@@ -160,9 +161,11 @@ public class DialogSaveTemplate : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button5 : Object 
+
+
+    public class Xcls_Button5 : Object
     {
         public Gtk.Button el;
         private DialogSaveTemplate  _this;
@@ -170,7 +173,7 @@ public class DialogSaveTemplate : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button5(DialogSaveTemplate _owner )
         {
             _this = _owner;
@@ -182,9 +185,10 @@ public class DialogSaveTemplate : Object
             this.el.label = "Cancel";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button6 : Object 
+
+    public class Xcls_Button6 : Object
     {
         public Gtk.Button el;
         private DialogSaveTemplate  _this;
@@ -192,7 +196,7 @@ public class DialogSaveTemplate : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button6(DialogSaveTemplate _owner )
         {
             _this = _owner;
@@ -204,6 +208,7 @@ public class DialogSaveTemplate : Object
             this.el.label = "OK";
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
 }
index 6b18ba2..4fb7c03 100644 (file)
@@ -17,7 +17,7 @@
    "default_height" : 200,
    "$ modal" : true,
    "$ xns" : "Gtk",
-   "| JsRender.Node? show" : " (Xcls_MainWindow mwindow, Palete.Palete pal, JsRender.Node node, Project.Project project) {\n    \n    this.el.show_all();\n    var opts = pal.listTemplates(node);\n    if (opts.length() < 1) {\n        this.el.hide();\n        return node;\n    }\n    this.el.set_attached_to( mwindow.el);\n    this.el.set_transient_for( mwindow.el);\n    \n    //opts.unshift({ path: '' , name :'Just add Element' });\n     _this.model.loadData(opts);\n     _this.combo.el.set_active(-1);\n     \n     \n     var db =  new Palete.RooDatabase.from_project(project);\n     _this.dbmodel.loadData(db.readTablesGee());\n     \n     var plug = mwindow.windowstate.webkit_plugin;\n     \n     _this.dbcombo.el.set_active(-1);\n     \n     \n   \n    var res = this.el.run();\n    this.el.hide();    \n    //var ix = _this.combo.el.get_active();\n    if (res < 1 ) {\n        return null; // 0 = cancel.\n    }\n    if (res < 2 ) {\n        return node; // 1 = just add it..\n    }\n    \n    // have they selected a table??\n    \n   Gtk.TreeIter iter; \n    Value vfname;   \n    if (_this.dbcombo.el.get_active_iter (out iter)) {    \n         this.dbmodel.el.get_value (iter, 0, out vfname);\n         if (((string)vfname).length > 0 && plug.has_plugin(node.fqn())) {\n            var json_str = plug.show(mwindow.el, project, node.fqn(), (string)vfname);\n            print(\"json_str = %s\\n\", json_str);\n            if (json_str.length < 1) {\n\n                return node;\n            }\n            var pa = new Json.Parser();\n\t    pa.load_from_data(json_str);\n\t    var new_node = pa.get_root();\n\n\t    if (new_node.get_node_type () != Json.NodeType.OBJECT) {\n\t\t    return node;\n\t    }\n\t    var obj = new_node.get_object ();\n\n\t    var ret = new JsRender.Node();\n\n\t    ret.loadFromJson(obj, 1);\n\t    return ret;\n         }\n        \n    }\n\n    if (!_this.combo.el.get_active_iter (out iter)) {\n\n        return node; // nothing selected...\n    }\n   \n    this.model.el.get_value (iter, 0, out vfname);\n    \n    \n    return pal.loadTemplate((string)vfname);\n\n}\n",
+   "| JsRender.Node? show" : " (Xcls_MainWindow mwindow, Palete.Palete pal, JsRender.Node node, Project.Project project) {\n    \n    this.el.show_all();\n    var opts = pal.listTemplates(node);\n    if (opts.length() < 1) {\n        this.el.hide();\n        return node;\n    }\n    this.el.set_attached_to( mwindow.el);\n    this.el.set_transient_for( mwindow.el);\n    \n    //opts.unshift({ path: '' , name :'Just add Element' });\n     _this.model.loadData(opts);\n     _this.combo.el.set_active(-1);\n     \n     \n     var db =  new Palete.RooDatabase.from_project(project);\n     _this.dbmodel.loadData(db.readTablesGee());\n     \n     var plug = mwindow.windowstate.webkit_plugin;\n     \n     _this.dbcombo.el.set_active(-1);\n     \n     \n   \n    var res = this.el.run();\n    this.el.hide();    \n    //var ix = _this.combo.el.get_active();\n    if (res < 1 ) {\n        return null; // 0 = cancel.\n    }\n    if (res < 2 ) {\n        return node; // 1 = just add it..\n    }\n    \n    // have they selected a table??\n    \n   Gtk.TreeIter iter; \n    Value vfname;   \n    if (_this.dbcombo.el.get_active_iter (out iter)) {    \n         this.dbmodel.el.get_value (iter, 0, out vfname);\n         if (((string)vfname).length > 0 && plug.has_plugin(node.fqn())) {\n            var json_str = plug.show(mwindow.el, project, node.fqn(), (string)vfname);\n            print(\"json_str = %s\\n\", json_str);\n            if (json_str.length < 1) {\n\n                return node;\n            }\n            var pa = new Json.Parser();\n            try {\n\n\t        pa.load_from_data(json_str);\n\t    } catch(Error e) {\n\t        return node;\n\t    }\n\t    var new_node = pa.get_root();\n    \n\t    if (new_node.get_node_type () != Json.NodeType.OBJECT) {\n\t\t    return node;\n\t    }\n\t    var obj = new_node.get_object ();\n\n\t    var ret = new JsRender.Node();\n\n\t    ret.loadFromJson(obj, 1);\n\t    return ret;\n         }\n        \n    }\n\n    if (!_this.combo.el.get_active_iter (out iter)) {\n\n        return node; // nothing selected...\n    }\n   \n    this.model.el.get_value (iter, 0, out vfname);\n    \n    \n    return pal.loadTemplate((string)vfname);\n\n}\n",
    "items" : [
     {
      "xtype" : "Box",
@@ -26,9 +26,9 @@
      "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
      "items" : [
       {
-       "gint margin" : 3,
        "* pack" : "pack_start,false,false,0",
        "xtype" : "Box",
+       "gint margin" : 3,
        "$ xns" : "Gtk",
        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
@@ -65,9 +65,9 @@
        ]
       },
       {
-       "gint margin" : 3,
        "* pack" : "pack_start,false,false,0",
        "xtype" : "Box",
+       "gint margin" : 3,
        "$ xns" : "Gtk",
        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
index a314e50..02b788c 100644 (file)
@@ -1,6 +1,6 @@
 static DialogTemplateSelect  _DialogTemplateSelect;
 
-public class DialogTemplateSelect : Object 
+public class DialogTemplateSelect : Object
 {
     public Gtk.Dialog el;
     private DialogTemplateSelect  _this;
@@ -21,7 +21,7 @@ public class DialogTemplateSelect : Object
 
         // my vars (def)
 
-    // ctor 
+    // ctor
     public DialogTemplateSelect()
     {
         _this = this;
@@ -47,14 +47,14 @@ public class DialogTemplateSelect : Object
         child_3.ref();
         this.el.add_action_widget (  child_3.el , 2 );
 
-        // listeners 
+        //listeners
         this.el.delete_event.connect( (self, event)  =>{
             this.el.hide();
             return true;
         });
     }
 
-    // user defined functions 
+    // user defined functions
     public JsRender.Node? show (Xcls_MainWindow mwindow, Palete.Palete pal, JsRender.Node node, Project.Project project) {
         
         this.el.show_all();
@@ -104,9 +104,14 @@ public class DialogTemplateSelect : Object
                     return node;
                 }
                 var pa = new Json.Parser();
-           pa.load_from_data(json_str);
-           var new_node = pa.get_root();
+                try {
     
+               pa.load_from_data(json_str);
+           } catch(Error e) {
+               return node;
+           }
+           var new_node = pa.get_root();
+        
            if (new_node.get_node_type () != Json.NodeType.OBJECT) {
                    return node;
            }
@@ -131,7 +136,7 @@ public class DialogTemplateSelect : Object
         return pal.loadTemplate((string)vfname);
     
     }
-    public class Xcls_Box2 : Object 
+    public class Xcls_Box2 : Object
     {
         public Gtk.Box el;
         private DialogTemplateSelect  _this;
@@ -139,7 +144,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Box2(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -156,9 +161,9 @@ public class DialogTemplateSelect : Object
             this.el.pack_start (  child_1.el , false,false,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Box3 : Object 
+    public class Xcls_Box3 : Object
     {
         public Gtk.Box el;
         private DialogTemplateSelect  _this;
@@ -166,7 +171,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Box3(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -184,9 +189,9 @@ public class DialogTemplateSelect : Object
             this.el.add (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label4 : Object 
+    public class Xcls_Label4 : Object
     {
         public Gtk.Label el;
         private DialogTemplateSelect  _this;
@@ -194,7 +199,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label4(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -205,9 +210,10 @@ public class DialogTemplateSelect : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_combo : Object 
+
+    public class Xcls_combo : Object
     {
         public Gtk.ComboBox el;
         private DialogTemplateSelect  _this;
@@ -215,7 +221,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_combo(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -232,14 +238,14 @@ public class DialogTemplateSelect : Object
             child_1.ref();
             this.el.set_model (  child_1.el  );
 
-            // init method 
+            // init method
 
             this.el.add_attribute(_this.cellrenderer.el , "markup", 1 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_cellrenderer : Object 
+    public class Xcls_cellrenderer : Object
     {
         public Gtk.CellRendererText el;
         private DialogTemplateSelect  _this;
@@ -247,7 +253,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_cellrenderer(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -259,9 +265,10 @@ public class DialogTemplateSelect : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_model : Object 
+
+    public class Xcls_model : Object
     {
         public Gtk.ListStore el;
         private DialogTemplateSelect  _this;
@@ -269,7 +276,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_model(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -281,7 +288,7 @@ public class DialogTemplateSelect : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
         public void loadData (GLib.List<string> data) {
             this.el.clear();                                    
             Gtk.TreeIter iter;
@@ -309,7 +316,10 @@ public class DialogTemplateSelect : Object
                                              
         }
     }
-    public class Xcls_Box8 : Object 
+
+
+
+    public class Xcls_Box8 : Object
     {
         public Gtk.Box el;
         private DialogTemplateSelect  _this;
@@ -317,7 +327,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Box8(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -335,9 +345,9 @@ public class DialogTemplateSelect : Object
             this.el.add (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label9 : Object 
+    public class Xcls_Label9 : Object
     {
         public Gtk.Label el;
         private DialogTemplateSelect  _this;
@@ -345,7 +355,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label9(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -356,9 +366,10 @@ public class DialogTemplateSelect : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_dbcombo : Object 
+
+    public class Xcls_dbcombo : Object
     {
         public Gtk.ComboBox el;
         private DialogTemplateSelect  _this;
@@ -366,7 +377,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_dbcombo(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -383,14 +394,14 @@ public class DialogTemplateSelect : Object
             child_1.ref();
             this.el.set_model (  child_1.el  );
 
-            // init method 
+            // init method
 
             this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_dbcellrenderer : Object 
+    public class Xcls_dbcellrenderer : Object
     {
         public Gtk.CellRendererText el;
         private DialogTemplateSelect  _this;
@@ -398,7 +409,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_dbcellrenderer(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -410,9 +421,10 @@ public class DialogTemplateSelect : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_dbmodel : Object 
+
+    public class Xcls_dbmodel : Object
     {
         public Gtk.ListStore el;
         private DialogTemplateSelect  _this;
@@ -420,7 +432,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_dbmodel(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -432,7 +444,7 @@ public class DialogTemplateSelect : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
         public void loadData (Gee.ArrayList<string> data) {
             this.el.clear();                                    
             Gtk.TreeIter iter;
@@ -464,7 +476,11 @@ public class DialogTemplateSelect : Object
                                              
         }
     }
-    public class Xcls_Button13 : Object 
+
+
+
+
+    public class Xcls_Button13 : Object
     {
         public Gtk.Button el;
         private DialogTemplateSelect  _this;
@@ -472,7 +488,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button13(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -484,9 +500,10 @@ public class DialogTemplateSelect : Object
             this.el.label = "Cancel";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button14 : Object 
+
+    public class Xcls_Button14 : Object
     {
         public Gtk.Button el;
         private DialogTemplateSelect  _this;
@@ -494,7 +511,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button14(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -506,9 +523,10 @@ public class DialogTemplateSelect : Object
             this.el.label = "Just add it";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button15 : Object 
+
+    public class Xcls_Button15 : Object
     {
         public Gtk.Button el;
         private DialogTemplateSelect  _this;
@@ -516,7 +534,7 @@ public class DialogTemplateSelect : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button15(DialogTemplateSelect _owner )
         {
             _this = _owner;
@@ -528,6 +546,7 @@ public class DialogTemplateSelect : Object
             this.el.label = "OK";
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
 }
index d8c9ac5..599247c 100644 (file)
 {
-    "id": "file-gtk-8",
-    "name": "EditProject",
-    "parent": "",
-    "title": false,
-    "path": "/home/alan/gitlive/app.Builder.js/Builder4/EditProject.bjs",
-    "items": [
+ "name" : "EditProject",
+ "parent" : "",
+ "title" : "",
+ "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/EditProject.bjs",
+ "permname" : "",
+ "modOrder" : "",
+ "build_module" : "builder",
+ "items" : [
+  {
+   "listeners" : {
+    "destroy_event" : " (self, event) => {\n  this.el.response(0);\n//     this.el.hide();\n    return false;\n}"
+   },
+   "default_width" : 600,
+   "$ deletable" : true,
+   "title" : "Project Properties",
+   "xtype" : "Dialog",
+   "default_height" : 500,
+   "| Project.Project? show" : "() {\n      \n\n    //[ 'xtype'  ].forEach(function(k) {\n    //    _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);\n    //});\n\t// shouild set path..\n    _this.model.loadData();\n    this.el.show_all();\n    \n    var err_dialog = StandardErrorDialog.singleton();\n\n    var id = -1;\n    while (id < 0) {\n         id =  this.el.run();\n         if (id < 1) {\n                this.el.hide();\n                return null;\n        }\n \n         \n          if (_this.xtype.getValue().length < 1) {\n               \n                err_dialog.show(_this.el,\"You have to set Project type\");             \n                id = -1;\n                continue;\n            }\n            if (_this.dir.el.get_filename().length < 1) {\n \n                err_dialog.show(_this.el,\"You have to select a folder\");             \n                id = -1;\n                continue;\n            }\n           \n    }\n    \n    this.el.hide();\n    \n    \n    \n \n    var fn = _this.dir.el.get_filename();\n    print(\"add %s\\n\" , fn);\n    \n    var project = Project.Project.factory(_this.xtype.getValue(), fn);\n    project.save();\n    Project.projects.set(project.name,project);\n    \n    //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);\n    \n    return project;\n\n    \n    //this.success = c.success;\n}\n",
+   "$ modal" : true,
+   "$ xns" : "Gtk",
+   "border_width" : 3,
+   "name" : "EditProject",
+   "items" : [
+    {
+     "bool expand" : true,
+     "xtype" : "Box",
+     "$ pack" : " get_content_area().add \n \n",
+     "$ xns" : "Gtk",
+     "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+     "$ homogeneous" : false,
+     "items" : [
+      {
+       "xtype" : "Box",
+       "* pack" : "pack_start,false,true,3",
+       "$ xns" : "Gtk",
+       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+       "$ homogeneous" : false,
+       "items" : [
         {
-            "listeners": {
-                "destroy_event": " (self, event) => {\n  this.el.response(0);\n//     this.el.hide();\n    return false;\n}"
-            },
-            "border_width": 3,
-            "default_height": 500,
-            "default_width": 600,
-            "name": "EditProject",
-            "title": "Project Properties",
-            "xtype": "Dialog",
-            "|Project.Project?:show": "() {\n      \n\n    //[ 'xtype'  ].forEach(function(k) {\n    //    _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);\n    //});\n\t// shouild set path..\n    _this.model.loadData();\n    this.el.show_all();\n    \n    var err_dialog = StandardErrorDialog.singleton();\n\n    var id = -1;\n    while (id < 0) {\n         id =  this.el.run();\n         if (id < 1) {\n                this.el.hide();\n                return null;\n        }\n\n         \n          if (_this.xtype.getValue().length < 1) {\n               \n                err_dialog.show(_this.el,\"You have to set Project type\");             \n                id = -1;\n                continue;\n            }\n            if (_this.dir.el.get_filename().length < 1) {\n \n                err_dialog.show(_this.el,\"You have to select a folder\");             \n                id = -1;\n                continue;\n            }\n           \n    }\n    \n    this.el.hide();\n    \n    \n    \n \n    var fn = _this.dir.el.get_filename();\n    print(\"add %s\\n\" , fn);\n    \n    var project = Project.Project.factory(_this.xtype.getValue(), fn);\n    project.save();\n    Project.projects.set(project.name,project);\n    \n    //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);\n    \n    return project;\n\n    \n    //this.success = c.success;\n}\n",
-            "|deletable": "true",
-            "|modal": "true",
-            "|xns": "Gtk",
-            "items": [
-                {
-                    "|homogeneous": "false",
-                    "xtype": "VBox",
-                    "|pack": " get_content_area().add \n \n",
-                    "|xns": "Gtk",
-                    "items": [
-                        {
-                            "|homogeneous": "false",
-                            "pack": "pack_start,false,true,3",
-                            "xtype": "HBox",
-                            "|xns": "Gtk",
-                            "items": [
-                                {
-                                    "|xns": "Gtk",
-                                    "xtype": "Label",
-                                    "pack": "pack_start,false,true,3",
-                                    "label": "Project type :"
-                                },
-                                {
-                                    "id": "xtype",
-                                    "pack": "pack_end,true,true,3",
-                                    "xtype": "ComboBox",
-                                    "|init": " this.el.add_attribute(_this.cellrender.el , \"markup\", 1 );  \n \n",
-                                    "|setValue": " (v)    {\n        var el = this.el;\n        el.set_active(-1);\n        \n        for (var i =0;i < this.data.length; i++ ) {\n            if (v == this.data.nth_datA(i)) {\n                el.set_active(ix);\n                return false;\n            }\n        }\n    }",
-                                    "|string:getValue": " () {\n     var ix = this.el.get_active();\n        if (ix < 0 ) {\n            return \"\";\n        }\n        switch(ix) {\n            case 0:\n                return \"Roo\";\n            case 1:\n                return \"Gtk\";\n        }\n        return \"\";\n}\n",
-                                    "|xns": "Gtk",
-                                    "items": [
-                                        {
-                                            "id": "cellrender",
-                                            "pack": "pack_start,true",
-                                            "xtype": "CellRendererText",
-                                            "|xns": "Gtk"
-                                        },
-                                        {
-                                            "|columns": "typeof(string),typeof(string)",
-                                            "id": "model",
-                                            "n_columns": 2,
-                                            "pack": "set_model",
-                                            "xtype": "ListStore",
-                                            "|void:loadData": "  ( ) {\n        this.el.clear();\n                      \n        Gtk.TreeIter iter;\n                \n        el.append(out iter);\n        \n        el.set_value(iter, 0, \"Roo\");\n        el.set_value(iter, 1, \"Roo Project\");\n         el.append(out iter);\n        \n        el.set_value(iter, 0, \"Gtk\");\n        el.set_value(iter, 1, \"Gtk Project\");\n         \n              \n                                     \n}\n",
-                                            "|xns": "Gtk"
-                                        }
-                                    ]
-                                }
-                            ]
-                        },
-                        {
-                            "|create_folders": "false",
-                            "id": "dir",
-                            "pack": "pack_end,true,true,5",
-                            "xtype": "FileChooserWidget",
-                            "|action": "Gtk.FileChooserAction.SELECT_FOLDER",
-                            "|select_multiple": "false",
-                            "|xns": "Gtk"
-                        }
-                    ]
-                },
-                {
-                    "label": "OK",
-                    "pack": "add_action_widget,1",
-                    "xtype": "Button",
-                    "|xns": "Gtk"
-                },
-                {
-                    "|xns": "Gtk",
-                    "xtype": "Button",
-                    "pack": "add_action_widget,0",
-                    "label": "Cancel"
-                }
-            ]
+         "label" : "Project type :",
+         "xtype" : "Label",
+         "* pack" : "pack_start,false,true,3",
+         "$ xns" : "Gtk"
+        },
+        {
+         "| string getValue" : " () {\n     var ix = this.el.get_active();\n        if (ix < 0 ) {\n            return \"\";\n        }\n        switch(ix) {\n            case 0:\n                return \"Roo\";\n            case 1:\n                return \"Gtk\";\n        }\n        return \"\";\n}\n",
+         "id" : "xtype",
+         "* init" : " this.el.add_attribute(_this.cellrender.el , \"markup\", 1 );  \n  ",
+         "xtype" : "ComboBox",
+         "* pack" : "pack_end,true,true,3",
+         "$ xns" : "Gtk",
+         "items" : [
+          {
+           "id" : "cellrender",
+           "* pack" : "pack_start,true",
+           "xtype" : "CellRendererText",
+           "$ xns" : "Gtk"
+          },
+          {
+           "id" : "model",
+           "xtype" : "ListStore",
+           "* pack" : "set_model",
+           "$ columns" : "typeof(string),typeof(string)",
+           "n_columns" : 2,
+           "$ xns" : "Gtk",
+           "| void loadData" : "  ( ) {\n        this.el.clear();\n                      \n        Gtk.TreeIter iter;\n                \n        el.append(out iter);\n        \n        el.set_value(iter, 0, \"Roo\");\n        el.set_value(iter, 1, \"Roo Project\");\n         el.append(out iter);\n        \n        el.set_value(iter, 0, \"Gtk\");\n        el.set_value(iter, 1, \"Gtk Project\");\n         \n              \n                                     \n}\n"
+          }
+         ]
         }
-    ],
-    "permname": "",
-    "modOrder": ""
+       ]
+      },
+      {
+       "$ create_folders" : false,
+       "id" : "dir",
+       "$ action" : "Gtk.FileChooserAction.SELECT_FOLDER",
+       "bool expand" : true,
+       "* pack" : "pack_end,true,true,5",
+       "xtype" : "FileChooserWidget",
+       "$ xns" : "Gtk",
+       "$ select_multiple" : false
+      }
+     ]
+    },
+    {
+     "label" : "OK",
+     "* pack" : "add_action_widget,1",
+     "xtype" : "Button",
+     "$ xns" : "Gtk"
+    },
+    {
+     "label" : "Cancel",
+     "xtype" : "Button",
+     "* pack" : "add_action_widget,0",
+     "$ xns" : "Gtk"
+    }
+   ]
+  }
+ ]
 }
\ No newline at end of file
index 0203eec..ee58e5e 100644 (file)
@@ -1,62 +1,43 @@
-/* -- to compile
-valac  --pkg gio-2.0  --pkg posix  --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0  --pkg  libwnck-3.0 \
-    /tmp/EditProject.vala  -o /tmp/EditProject
-*/
-
-
-/* -- to test class
-static int main (string[] args) {
-    Gtk.init (ref args);
-    new Xcls_EditProject();
-    EditProject.show_all();
-     Gtk.main ();
-    return 0;
-}
-*/
-
+static EditProject  _EditProject;
 
-public static Xcls_EditProject  EditProject;
-
-public class Xcls_EditProject : Object 
+public class EditProject : Object
 {
     public Gtk.Dialog el;
-    private Xcls_EditProject  _this;
+    private EditProject  _this;
 
-    public static Xcls_EditProject singleton()
+    public static EditProject singleton()
     {
-        if (EditProject == null) {
-            EditProject= new Xcls_EditProject();
+        if (_EditProject == null) {
+            _EditProject= new EditProject();
         }
-        return EditProject;
+        return _EditProject;
     }
     public Xcls_xtype xtype;
     public Xcls_cellrender cellrender;
     public Xcls_model model;
     public Xcls_dir dir;
 
-        // my vars
+        // my vars (def)
 
-        // ctor 
-    public Xcls_EditProject()
+    // ctor
+    public EditProject()
     {
         _this = this;
         this.el = new Gtk.Dialog();
 
-        // my vars
+        // my vars (dec)
 
         // set gobject values
+        this.el.title = "Project Properties";
+        this.el.name = "EditProject";
         this.el.border_width = 3;
         this.el.default_height = 500;
         this.el.default_width = 600;
         this.el.deletable = true;
         this.el.modal = true;
-        this.el.name = "EditProject";
-        this.el.title = "Project Properties";
-        var child_0 = new Xcls_VBox2( _this );
+        var child_0 = new Xcls_Box2( _this );
         child_0.ref();
-        this.el. get_content_area().add 
- (  child_0.el  );
+        this.el.get_content_area().add (  child_0.el  );
         var child_1 = new Xcls_Button9( _this );
         child_1.ref();
         this.el.add_action_widget (  child_1.el , 1 );
@@ -64,90 +45,90 @@ public class Xcls_EditProject : Object
         child_2.ref();
         this.el.add_action_widget (  child_2.el , 0 );
 
-        // listeners 
-        this.el.destroy_event.connect(  (self, event) => {
+        //listeners
+        this.el.destroy_event.connect( (self, event) => {
           this.el.response(0);
         //     this.el.hide();
             return false;
-        } );
+        });
     }
 
-    // userdefined functions 
-    public Project.Project? show() {
-              
+    // user defined functions
+    public Project.Project? show () {
+          
+    
+        //[ 'xtype'  ].forEach(function(k) {
+        //    _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
+        //});
+       // shouild set path..
+        _this.model.loadData();
+        this.el.show_all();
         
-            //[ 'xtype'  ].forEach(function(k) {
-            //    _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]);
-            //});
-               // shouild set path..
-            _this.model.loadData();
-            this.el.show_all();
-            
-            var err_dialog = StandardErrorDialog.singleton();
-        
-            var id = -1;
-            while (id < 0) {
-                 id =  this.el.run();
-                 if (id < 1) {
-                        this.el.hide();
-                        return null;
+        var err_dialog = StandardErrorDialog.singleton();
+    
+        var id = -1;
+        while (id < 0) {
+             id =  this.el.run();
+             if (id < 1) {
+                    this.el.hide();
+                    return null;
+            }
+     
+             
+              if (_this.xtype.getValue().length < 1) {
+                   
+                    err_dialog.show(_this.el,"You have to set Project type");             
+                    id = -1;
+                    continue;
                 }
+                if (_this.dir.el.get_filename().length < 1) {
+     
+                    err_dialog.show(_this.el,"You have to select a folder");             
+                    id = -1;
+                    continue;
+                }
+               
+        }
         
-                 
-                  if (_this.xtype.getValue().length < 1) {
-                       
-                        err_dialog.show(_this.el,"You have to set Project type");             
-                        id = -1;
-                        continue;
-                    }
-                    if (_this.dir.el.get_filename().length < 1) {
-         
-                        err_dialog.show(_this.el,"You have to select a folder");             
-                        id = -1;
-                        continue;
-                    }
-                   
-            }
-            
-            this.el.hide();
-            
-            
-            
-         
-            var fn = _this.dir.el.get_filename();
-            print("add %s\n" , fn);
-            
-            var project = Project.Project.factory(_this.xtype.getValue(), fn);
-            project.save();
-            Project.projects.set(project.name,project);
-            
-            //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
-            
-            return project;
+        this.el.hide();
         
-            
-            //this.success = c.success;
-        }
-
-    // skip |xns - no return type
-    public class Xcls_VBox2 : Object 
+        
+        
+     
+        var fn = _this.dir.el.get_filename();
+        print("add %s\n" , fn);
+        
+        var project = Project.Project.factory(_this.xtype.getValue(), fn);
+        project.save();
+        Project.projects.set(project.name,project);
+        
+        //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
+        
+        return project;
+    
+        
+        //this.success = c.success;
+    }
+    public class Xcls_Box2 : Object
     {
-        public Gtk.VBox el;
-        private Xcls_EditProject  _this;
+        public Gtk.Box el;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_VBox2(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_Box2(EditProject _owner )
         {
             _this = _owner;
-            this.el = new Gtk.VBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_HBox3( _this );
+            this.el.homogeneous = false;
+            this.el.expand = true;
+            var child_0 = new Xcls_Box3( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,true,3 );
             var child_1 = new Xcls_dir( _this );
@@ -155,27 +136,26 @@ public class Xcls_EditProject : Object
             this.el.pack_end (  child_1.el , true,true,5 );
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_HBox3 : Object 
+    public class Xcls_Box3 : Object
     {
-        public Gtk.HBox el;
-        private Xcls_EditProject  _this;
+        public Gtk.Box el;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_HBox3(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_Box3(EditProject _owner )
         {
             _this = _owner;
-            this.el = new Gtk.HBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
+            this.el.homogeneous = false;
             var child_0 = new Xcls_Label4( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,true,3 );
@@ -184,49 +164,46 @@ public class Xcls_EditProject : Object
             this.el.pack_end (  child_1.el , true,true,3 );
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_Label4 : Object 
+    public class Xcls_Label4 : Object
     {
         public Gtk.Label el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_Label4(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_Label4(EditProject _owner )
         {
             _this = _owner;
             this.el = new Gtk.Label( "Project type :" );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_xtype : Object 
+
+    public class Xcls_xtype : Object
     {
         public Gtk.ComboBox el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_xtype(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_xtype(EditProject _owner )
         {
             _this = _owner;
             _this.xtype = this;
             this.el = new Gtk.ComboBox();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
             var child_0 = new Xcls_cellrender( _this );
@@ -236,167 +213,162 @@ public class Xcls_EditProject : Object
             child_1.ref();
             this.el.set_model (  child_1.el  );
 
-            // init method 
-             this.el.add_attribute(_this.cellrender.el , "markup", 1 );  
-             
-        }
+            // init method
 
-        // userdefined functions 
+            this.el.add_attribute(_this.cellrender.el , "markup", 1 );
+        }
 
-        // skip |setValue - no return type
+        // user defined functions
         public string getValue () {
-                 var ix = this.el.get_active();
-                    if (ix < 0 ) {
-                        return "";
-                    }
-                    switch(ix) {
-                        case 0:
-                            return "Roo";
-                        case 1:
-                            return "Gtk";
-                    }
+             var ix = this.el.get_active();
+                if (ix < 0 ) {
                     return "";
-            }
-
-        // skip |xns - no return type
+                }
+                switch(ix) {
+                    case 0:
+                        return "Roo";
+                    case 1:
+                        return "Gtk";
+                }
+                return "";
+        }
     }
-    public class Xcls_cellrender : Object 
+    public class Xcls_cellrender : Object
     {
         public Gtk.CellRendererText el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_cellrender(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_cellrender(EditProject _owner )
         {
             _this = _owner;
             _this.cellrender = this;
             this.el = new Gtk.CellRendererText();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_model : Object 
+
+    public class Xcls_model : Object
     {
         public Gtk.ListStore el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_model(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_model(EditProject _owner )
         {
             _this = _owner;
             _this.model = this;
             this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
         }
 
-        // userdefined functions 
-        public void loadData  ( ) {
-                    this.el.clear();
-                                  
-                    Gtk.TreeIter iter;
-                            
-                    el.append(out iter);
-                    
-                    el.set_value(iter, 0, "Roo");
-                    el.set_value(iter, 1, "Roo Project");
-                     el.append(out iter);
-                    
-                    el.set_value(iter, 0, "Gtk");
-                    el.set_value(iter, 1, "Gtk Project");
-                     
-                          
-                                                 
-            }
-
-        // skip |xns - no return type
+        // user defined functions
+        public void loadData ( ) {
+                this.el.clear();
+                              
+                Gtk.TreeIter iter;
+                        
+                el.append(out iter);
+                
+                el.set_value(iter, 0, "Roo");
+                el.set_value(iter, 1, "Roo Project");
+                 el.append(out iter);
+                
+                el.set_value(iter, 0, "Gtk");
+                el.set_value(iter, 1, "Gtk Project");
+                 
+                      
+                                             
+        }
     }
-    public class Xcls_dir : Object 
+
+
+
+    public class Xcls_dir : Object
     {
         public Gtk.FileChooserWidget el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_dir(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_dir(EditProject _owner )
         {
             _this = _owner;
             _this.dir = this;
             this.el = new Gtk.FileChooserWidget( Gtk.FileChooserAction.SELECT_FOLDER );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
+            this.el.expand = true;
             this.el.create_folders = false;
             this.el.select_multiple = false;
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_Button9 : Object 
+
+
+    public class Xcls_Button9 : Object
     {
         public Gtk.Button el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_Button9(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_Button9(EditProject _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
             this.el.label = "OK";
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
-    public class Xcls_Button10 : Object 
+
+    public class Xcls_Button10 : Object
     {
         public Gtk.Button el;
-        private Xcls_EditProject  _this;
+        private EditProject  _this;
 
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_Button10(Xcls_EditProject _owner )
+        // ctor
+        public Xcls_Button10(EditProject _owner )
         {
             _this = _owner;
             this.el = new Gtk.Button();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
             this.el.label = "Cancel";
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
+        // user defined functions
     }
+
 }
index 83bb929..28eeb87 100644 (file)
@@ -9,28 +9,32 @@
  "items" : [
   {
    "# Xcls_MainWindow window" : "null",
-   "|   bool saveContents" : "  ()  {\n    \n    \n    \n    \n    \n    \n    \n   \n     \n     var str = _this.buffer.toString();\n     \n      \n     \n     \n     if (!_this.buffer.checkSyntax()) {\n         print(\"check syntax failed\");\n         //this.get('/StandardErrorDialog').show(\"Fix errors in code and save..\"); \n         //return false;\n     }\n     \n     // LeftPanel.model.changed(  str , false);\n     _this.dirty = false;\n     _this.save_button.el.sensitive = false;\n     \n     \n        \n     \n    // find the text for the node..\n    if (ptype == \"listener\") {\n        this.node.listeners.set(key,str);\n    \n    } else {\n         this.node.props.set(key,str);\n    }\n\n     \n    \n    // call the signal..\n    this.save();\n    \n    return true;\n\n} ",
    "# string activeEditor" : "\"\"",
+   "|   bool saveContents" : "  ()  {\n    \n    \n    if (_this.file == null) {\n        return true;\n    }\n    \n    \n    \n    \n   \n     \n     var str = _this.buffer.toString();\n     \n      \n     \n     \n     if (!_this.buffer.checkSyntax()) {\n         print(\"check syntax failed\");\n         //this.get('/StandardErrorDialog').show(\"Fix errors in code and save..\"); \n         //return false;\n     }\n     \n     // LeftPanel.model.changed(  str , false);\n     _this.dirty = false;\n     _this.save_button.el.sensitive = false;\n     \n     \n        \n     \n    // find the text for the node..\n    if (ptype == \"listener\") {\n        this.node.listeners.set(key,str);\n    \n    } else {\n         this.node.props.set(key,str);\n    }\n\n     \n    \n    // call the signal..\n    this.save();\n    \n    return true;\n\n} ",
    "# int pos_root_x" : "",
    "# int pos_root_y" : "",
    "# string ptype" : "\"\"",
+   "# string fname" : "\"\"",
+   "| void showPlainFile" : "(string fname)\n{\n    this.ptype = \"\";\n    this.key  = \"\";\n    this.node = null;\n    this.file = null;\n    this.fname = fname;\n    string str;\n    try {\n        GLib.FileUtils.get_contents(fname, out str);\n    } catch (Error e) {\n        str = \"\"; // a tad dangerios... - perhaps we should block editing...\n    }\n    \n    this.view.load(str);\n    this.key_edit.el.text = \"\";    \n\n}",
    "# string key" : "\"\"",
    "* pack" : "add",
-   "xtype" : "VBox",
+   "xtype" : "Box",
    "|   void show" : "(JsRender.JsRender file, JsRender.Node node, string ptype, string key)\n{\n    this.ptype = ptype;\n    this.key  = key;\n    this.node = node;\n    this.file = file;\n    \n   string val = \"\";\n    // find the text for the node..\n    if (ptype == \"listener\") {\n        val = node.listeners.get(key);\n    \n    } else {\n        val = node.props.get(key);\n    }\n    this.view.load(val);\n    this.key_edit.el.text = key;    \n\n}",
    "# JsRender.JsRender file" : "null",
    "# bool pos" : false,
    "string id" : "Editor",
    "# bool dirty" : false,
    "$ xns" : "Gtk",
+   "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
    "@ void save" : "()",
    "$ homogeneous" : false,
    "# JsRender.Node node" : "null",
    "items" : [
     {
      "* pack" : "pack_start,false,true",
-     "xtype" : "HBox",
+     "xtype" : "Box",
      "$ xns" : "Gtk",
+     "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
      "$ homogeneous" : false,
      "items" : [
       {
@@ -45,8 +49,8 @@
       },
       {
        "id" : "key_edit",
-       "xtype" : "Entry",
        "* pack" : "pack_end,true,true",
+       "xtype" : "Entry",
        "$ xns" : "Gtk"
       }
      ]
      "id" : "RightEditor",
      "* init" : "this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
      "xtype" : "ScrolledWindow",
-     "* pack" : "add",
+     "* pack" : "pack_end,true,true",
      "$ xns" : "Gtk",
      "items" : [
       {
        "listeners" : {
-        "key_release_event" : " (event) => {\n    \n    if (event.keyval == 115 && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n        print(\"SAVE: ctrl-S  pressed\");\n        _this.saveContents();\n        return false;\n    }\n   // print(event.key.keyval)\n    \n    return false;\n\n} \n\n"
+        "key_release_event" : " (event) => {\n    \n    if (event.keyval == 115 && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {\n        print(\"SAVE: ctrl-S  pressed\");\n        _this.saveContents();\n        return false;\n    }\n   // print(event.key.keyval)\n    \n    return false;\n\n} \n\n "
        },
        "gboolean show_line_marks" : true,
        "id" : "view",
-       "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(8000);\n    this.el.override_font(description);\n\n    var attrs = new Gtk.SourceMarkAttributes();\n    var  pink = new Gdk.RGBA();\n    pink.parse ( \"pink\");\n    attrs.set_background ( pink);\n    attrs.set_icon_name ( \"process-stop\");    \n    attrs.query_tooltip_text.connect(( mark) => {\n        //print(\"tooltip query? %s\\n\", mark.name);\n        return mark.name;\n    });\n    \n    this.el.set_mark_attributes (\"error\", attrs, 1);\n    \n    ",
+       "* init" : " \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(8000);\n    this.el.override_font(description);\n\n\n  \n    var attrs = new Gtk.SourceMarkAttributes();\n    var  pink =   Gdk.RGBA();\n    pink.parse ( \"pink\");\n    attrs.set_background ( pink);\n    attrs.set_icon_name ( \"process-stop\");    \n    attrs.query_tooltip_text.connect(( mark) => {\n        //print(\"tooltip query? %s\\n\", mark.name);\n        return mark.name;\n    });\n    \n    this.el.set_mark_attributes (\"ERR\", attrs, 1);\n    \n     var wattrs = new Gtk.SourceMarkAttributes();\n    var  blue =   Gdk.RGBA();\n    blue.parse ( \"#ABF4EB\");\n    wattrs.set_background ( blue);\n    wattrs.set_icon_name ( \"process-stop\");    \n    wattrs.query_tooltip_text.connect(( mark) => {\n        //print(\"tooltip query? %s\\n\", mark.name);\n        return mark.name;\n    });\n    \n    this.el.set_mark_attributes (\"WARN\", wattrs, 1);\n    \n \n    \n     var dattrs = new Gtk.SourceMarkAttributes();\n    var  purple =   Gdk.RGBA();\n    purple.parse ( \"#EEA9FF\");\n    dattrs.set_background ( purple);\n    dattrs.set_icon_name ( \"process-stop\");    \n    dattrs.query_tooltip_text.connect(( mark) => {\n        //print(\"tooltip query? %s\\n\", mark.name);\n        return mark.name;\n    });\n    \n    this.el.set_mark_attributes (\"DEPR\", dattrs, 1);\n    \n    ",
        "$ insert_spaces_instead_of_tabs" : true,
        "* pack" : "add",
        "xtype" : "SourceView",
        "gboolean highlight_current_line" : true,
        "$ gboolean auto_indent" : true,
        "$ xns" : "Gtk",
-       "|   void load" : " (string str) {\n\n// show the help page for the active node..\n   //this.get('/Help').show();\n\n\n  // this.get('/BottomPane').el.set_current_page(0);\n    this.el.get_buffer().set_text(str, str.length);\n    var lm = Gtk.SourceLanguageManager.get_default();\n    \n    var lang = _this.file.language;\n    //?? is javascript going to work as js?\n    \n    ((Gtk.SourceBuffer)(this.el.get_buffer())) .set_language(lm.get_language(lang));\n    var buf = this.el.get_buffer();\n     \n    _this.dirty = false;\n    this.el.grab_focus();\n    _this.save_button.el.sensitive = false;\n}",
+       "|   void load" : " (string str) {\n\n// show the help page for the active node..\n   //this.get('/Help').show();\n\n\n  // this.get('/BottomPane').el.set_current_page(0);\n  var buf = (Gtk.SourceBuffer)this.el.get_buffer();\n    buf.set_text(str, str.length);\n    buf.set_undo_manager(null);\n    \n    var lm = Gtk.SourceLanguageManager.get_default();\n    var lang = \"vala\";\n    if (_this.file != null) {\n         lang = _this.file.language;\n    }\n    //?? is javascript going to work as js?\n    \n    ((Gtk.SourceBuffer)(this.el.get_buffer())) .set_language(lm.get_language(lang));\n \n     \n    _this.dirty = false;\n    this.el.grab_focus();\n    _this.save_button.el.sensitive = false;\n}",
        "indent_width" : 4,
        "$ show_line_numbers" : true,
        "items" : [
           "changed" : " () => {\n    // check syntax??\n    // ??needed..??\n    _this.save_button.el.sensitive = true;\n    print(\"EDITOR CHANGED\");\n    this.checkSyntax();\n   \n    _this.dirty = true;\n\n    // this.get('/LeftPanel.model').changed(  str , false);\n    return ;\n}\n\n \n"
          },
          "bool check_queued" : false,
-         "id" : "buffer",
          "int error_line" : "-1",
-         "| bool highlightErrors" : "( Gee.HashMap<int,string> validate_res) {\n        this.error_line = validate_res.size;\n\n        if (this.error_line < 1) {\n              return true;\n        }\n        var tlines = this.el.get_line_count ();\n        Gtk.TextIter iter;\n        var valiter = validate_res.map_iterator();\n        while (valiter.next()) {\n        \n    //        print(\"get inter\\n\");\n            var eline = valiter.get_key();\n            if (eline > tlines) {\n                continue;\n            }\n            this.el.get_iter_at_line( out iter, eline);\n            //print(\"mark line\\n\");\n            this.el.create_source_mark(valiter.get_value(), \"error\", iter);\n        }   \n        return false;\n    }",
+         "id" : "buffer",
+         "| bool highlightErrors" : "( Gee.HashMap<int,string> validate_res) {\n         \n        this.error_line = validate_res.size;\n\n        if (this.error_line < 1) {\n              return true;\n        }\n        var tlines = this.el.get_line_count ();\n        Gtk.TextIter iter;\n        var valiter = validate_res.map_iterator();\n        while (valiter.next()) {\n        \n    //        print(\"get inter\\n\");\n            var eline = valiter.get_key();\n            if (eline > tlines) {\n                continue;\n            }\n            this.el.get_iter_at_line( out iter, eline);\n            //print(\"mark line\\n\");\n            this.el.create_source_mark(valiter.get_value(), \"ERR\", iter);\n        }   \n        return false;\n    }",
          "|   string toString" : "  () {\n    \n    Gtk.TextIter s;\n    Gtk.TextIter e;\n    this.el.get_start_iter(out s);\n    this.el.get_end_iter(out e);\n    var ret = this.el.get_text(s,e,true);\n    //print(\"TO STRING? \" + ret);\n    return ret;\n}\n ",
-         "|   bool checkSyntax" : " () {\n \n    if (this.check_running) {\n        print(\"Check is running\\n\");\n        if (this.check_queued) { \n            print(\"Check is already queued\");\n            return true;\n        }\n        this.check_queued = true;\n        print(\"Adding queued Check \");\n        GLib.Timeout.add_seconds(1, () => {\n            this.check_queued = false;\n            \n            this.checkSyntax();\n            return false;\n        });\n    \n\n        return true;\n    }\n   \n   \n    var p = Palete.factory(_this.file.xtype);   \n    \n    var str = this.toString();\n    \n    string res = \"\";\n    \n    if (this.error_line > 0) {\n         Gtk.TextIter start;\n         Gtk.TextIter end;     \n        this.el.get_bounds (out start, out end);\n\n        this.el.remove_source_marks (start, end, null);\n    }\n    \n    if (str.length < 1) {\n        print(\"checkSyntax - empty string?\\n\");\n        return true;\n    }\n    this.check_running = true;\n    \n    \n    if (_this.file.language == \"js\") {\n        this.check_running = false;\n        print(\"calling validate javascript\\n\"); \n        return this.highlightErrors(p.validateJavascript(\n            str, \n             _this.key, \n            _this.ptype,\n            _this.file,\n            _this.node\n        ));    \n        \n    }\n        \n        \n    print(\"calling validate vala\\n\");    \n    // clear the buttons.\n    _this.window.statusbar_errors.el.hide();\n    _this.window.statusbar_warnings.el.hide();\n    _this.window.statusbar_depricated.el.hide();\n    \n    \n    \n    p.validateVala(\n        str, \n         _this.key, \n        _this.ptype,\n        _this.file,\n        _this.node,\n        (obj) => {\n            this.check_running = false;\n            this.highlightErrorsJson(obj);            \n            \n            //var validate_res = p.validateVala.end(res);\n            //this.highlightErrors(validate_res);\n\n        }\n        \n    );\n     \n    \n    \n    //print(\"done mark line\\n\");\n     \n    return true; // at present allow saving - even if it's invalid..\n}\n",
+         "|   bool checkSyntax" : " () {\n \n    if (this.check_running) {\n        print(\"Check is running\\n\");\n        if (this.check_queued) { \n            print(\"Check is already queued\");\n            return true;\n        }\n        this.check_queued = true;\n        print(\"Adding queued Check \");\n        GLib.Timeout.add_seconds(1, () => {\n            this.check_queued = false;\n            \n            this.checkSyntax();\n            return false;\n        });\n    \n\n        return true;\n    }\n    var str = this.toString();\n    \n    // needed???\n    if (this.error_line > 0) {\n         Gtk.TextIter start;\n         Gtk.TextIter end;     \n        this.el.get_bounds (out start, out end);\n\n        this.el.remove_source_marks (start, end, null);\n    }\n    if (str.length < 1) {\n        print(\"checkSyntax - empty string?\\n\");\n        return true;\n    }\n    \n    if (_this.file == null && _this.fname.length > 0) {\n    \n        // assume it's gtk...\n           this.check_running = true;\n\n         _this.window.windowstate.valasource.checkPlainFileSpawn(\n            _this.window.project,\n\t    _this.fname,\n\t    str\n\t );\n        return true;\n    \n    }\n   if (_this.file == null) {\n       return true;\n   }\n    var p = Palete.factory(_this.file.xtype);   \n    \n\n     \n    this.check_running = true;\n    \n    \n    if (_this.file.language == \"js\") {\n        this.check_running = false;\n        print(\"calling validate javascript\\n\"); \n        return this.highlightErrors(p.validateJavascript(\n            str, \n             _this.key, \n            _this.ptype,\n            _this.file,\n            _this.node\n        ));    \n        \n    }\n        \n        \n    print(\"calling validate vala\\n\");    \n    // clear the buttons.\n \n    \n    p.validateVala(\n        _this.window.windowstate,\n        str, \n         _this.key, \n        _this.ptype,\n        _this.file,\n        _this.node \n        \n        \n    );\n     \n    \n    \n    //print(\"done mark line\\n\");\n     \n    return true; // at present allow saving - even if it's invalid..\n}\n",
          "* pack" : "set_buffer",
          "xtype" : "SourceBuffer",
          "bool check_running" : false,
          "$ xns" : "Gtk",
-         "| bool highlightErrorsJson" : "(Json.Object obj) {\n      Gtk.TextIter start;\n     Gtk.TextIter end;     \n        this.el.get_bounds (out start, out end);\n        \n        this.el.remove_source_marks (start, end, null);\n                 \n    if (obj.has_member(\"ERR-TOTAL\")) {\n\n         _this.window.statusbar_errors.setNotices( obj.get_object_member(\"ERR\") , (int) obj.get_int_member(\"ERR-TOTAL\"));\n    } else {\n         _this.window.statusbar_errors.setNotices( new Json.Object() , 0);\n    }    \n    \n    if (obj.has_member(\"WARN-TOTAL\")) {\n\n         _this.window.statusbar_warnings.setNotices(obj.get_object_member(\"WARN\"), (int) obj.get_int_member(\"WARN-TOTAL\"));\n    } else {\n             _this.window.statusbar_warnings.setNotices( new Json.Object() , 0);\n    }\n    if (obj.has_member(\"DEPR-TOTAL\")) {\n        \n         _this.window.statusbar_depricated.setNotices( obj.get_object_member(\"DEPR\"),  (int) obj.get_int_member(\"DEPR-TOTAL\"));\n \n    } else {\n        _this.window.statusbar_depricated.setNotices( new Json.Object(),0);\n    }\n    \n    if (!obj.has_member(\"ERR\")) {\n        print(\"Return has no errors\\n\");\n        return true;\n    }\n    var err = obj.get_object_member(\"ERR\");\n    \n    \n    \n    if (!err.has_member(_this.file.path)) {\n        print(\"File path has no errors\\n\");\n        return true;\n    }\n\n    var lines = err.get_object_member(_this.file.path);\n    \n    var offset = 1;\n    if (obj.has_member(\"line_offset\")) {\n        offset = (int)obj.get_int_member(\"line_offset\") + 1;\n    }\n     \n    \n    var tlines = this.el.get_line_count () +1;\n    \n    lines.foreach_member((obj, line, node) => {\n        \n             Gtk.TextIter iter;\n    //        print(\"get inter\\n\");\n            var eline = int.parse(line) - offset;\n            print(\"GOT ERROR on line %s -- converted to %d\\n\", line,eline);\n            \n            \n            if (eline > tlines || eline < 0) {\n                return;\n            }\n            this.el.get_iter_at_line( out iter, eline);\n            //print(\"mark line\\n\");\n            var msg  = \"Line: %d\".printf(eline+1);\n            var ar = lines.get_array_member(line);\n            for (var i = 0 ; i < ar.get_length(); i++) {\n\t\t    msg += (msg.length > 0) ? \"\\n\" : \"\";\n\t\t    msg += ar.get_string_element(i);\n\t    }\n            \n            \n            this.el.create_source_mark(msg, \"error\", iter);\n        } );\n        return false;\n    \n\n\n\n\n}\n"
+         "| bool highlightErrorsJson" : "(string type, Json.Object obj) {\n      Gtk.TextIter start;\n     Gtk.TextIter end;     \n        this.el.get_bounds (out start, out end);\n        \n        this.el.remove_source_marks (start, end, type);\n                 \n     \n     // we should highlight other types of errors..\n    \n    if (!obj.has_member(type)) {\n        print(\"Return has no errors\\n\");\n        return true;\n    }\n    \n    if (_this.window.windowstate.state != WindowState.State.CODEONLY && \n        _this.window.windowstate.state != WindowState.State.CODE\n        ) {\n        return true;\n    } \n    \n    \n    var err = obj.get_object_member(type);\n    var valafn = _this.fname;\n    if (_this.file != null) {\n\n\n        \n        \n         valafn = \"\";\n          try {             \n               var  regex = new Regex(\"\\\\.bjs$\");\n            \n             \n                valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");\n             } catch (GLib.RegexError e) {\n                return true;\n            }   \n\n\n\n      }\n       if (!err.has_member(valafn)) {\n            print(\"File path has no errors\\n\");\n            return  true;\n        }\n\n        var lines = err.get_object_member(valafn);\n        \n        var offset = 1;\n        if (obj.has_member(\"line_offset\")) {\n            offset = (int)obj.get_int_member(\"line_offset\") + 1;\n        }\n    \n\n     \n    \n    var tlines = this.el.get_line_count () +1;\n    \n    lines.foreach_member((obj, line, node) => {\n        \n             Gtk.TextIter iter;\n    //        print(\"get inter\\n\");\n            var eline = int.parse(line) - offset;\n            print(\"GOT ERROR on line %s -- converted to %d\\n\", line,eline);\n            \n            \n            if (eline > tlines || eline < 0) {\n                return;\n            }\n            this.el.get_iter_at_line( out iter, eline);\n            //print(\"mark line\\n\");\n            var msg  = \"Line: %d\".printf(eline+1);\n            var ar = lines.get_array_member(line);\n            for (var i = 0 ; i < ar.get_length(); i++) {\n\t\t    msg += (msg.length > 0) ? \"\\n\" : \"\";\n\t\t    msg += ar.get_string_element(i);\n\t    }\n            \n            \n            this.el.create_source_mark(msg, type, iter);\n        } );\n        return false;\n    \n\n\n\n\n}\n"
         }
        ]
       }
index 469f3c0..1752c0c 100644 (file)
@@ -1,8 +1,8 @@
 static Editor  _Editor;
 
-public class Editor : Object 
+public class Editor : Object
 {
-    public Gtk.VBox el;
+    public Gtk.Box el;
     private Editor  _this;
 
     public static Editor singleton()
@@ -24,6 +24,7 @@ public class Editor : Object
     public int pos_root_x;
     public int pos_root_y;
     public string ptype;
+    public string fname;
     public string key;
     public JsRender.JsRender file;
     public bool pos;
@@ -31,16 +32,17 @@ public class Editor : Object
     public signal void save ();
     public JsRender.Node node;
 
-    // ctor 
+    // ctor
     public Editor()
     {
         _this = this;
-        this.el = new Gtk.VBox( false, 0 );
+        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
         // my vars (dec)
         this.window = null;
         this.activeEditor = "";
         this.ptype = "";
+        this.fname = "";
         this.key = "";
         this.file = null;
         this.pos = false;
@@ -48,19 +50,22 @@ public class Editor : Object
         this.node = null;
 
         // set gobject values
-        var child_0 = new Xcls_HBox2( _this );
+        this.el.homogeneous = false;
+        var child_0 = new Xcls_Box2( _this );
         child_0.ref();
         this.el.pack_start (  child_0.el , false,true );
         var child_1 = new Xcls_RightEditor( _this );
         child_1.ref();
-        this.el.add (  child_1.el  );
+        this.el.pack_end (  child_1.el , true,true );
     }
 
-    // user defined functions 
+    // user defined functions
     public   bool saveContents ()  {
         
         
-        
+        if (_this.file == null) {
+            return true;
+        }
         
         
         
@@ -100,6 +105,24 @@ public class Editor : Object
         
         return true;
     
+    }
+    public void showPlainFile (string fname)
+    {
+        this.ptype = "";
+        this.key  = "";
+        this.node = null;
+        this.file = null;
+        this.fname = fname;
+        string str;
+        try {
+            GLib.FileUtils.get_contents(fname, out str);
+        } catch (Error e) {
+            str = ""; // a tad dangerios... - perhaps we should block editing...
+        }
+        
+        this.view.load(str);
+        this.key_edit.el.text = "";    
+    
     }
     public   void show (JsRender.JsRender file, JsRender.Node node, string ptype, string key)
     {
@@ -120,23 +143,24 @@ public class Editor : Object
         this.key_edit.el.text = key;    
     
     }
-    public class Xcls_HBox2 : Object 
+    public class Xcls_Box2 : Object
     {
-        public Gtk.HBox el;
+        public Gtk.Box el;
         private Editor  _this;
 
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_HBox2(Editor _owner )
+        // ctor
+        public Xcls_Box2(Editor _owner )
         {
             _this = _owner;
-            this.el = new Gtk.HBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
+            this.el.homogeneous = false;
             var child_0 = new Xcls_save_button( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,false );
@@ -145,9 +169,9 @@ public class Editor : Object
             this.el.pack_end (  child_1.el , true,true );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_save_button : Object 
+    public class Xcls_save_button : Object
     {
         public Gtk.Button el;
         private Editor  _this;
@@ -155,7 +179,7 @@ public class Editor : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_save_button(Editor _owner )
         {
             _this = _owner;
@@ -167,15 +191,16 @@ public class Editor : Object
             // set gobject values
             this.el.label = "Save";
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( () => { 
                 _this.saveContents();
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_key_edit : Object 
+
+    public class Xcls_key_edit : Object
     {
         public Gtk.Entry el;
         private Editor  _this;
@@ -183,7 +208,7 @@ public class Editor : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_key_edit(Editor _owner )
         {
             _this = _owner;
@@ -195,9 +220,11 @@ public class Editor : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_RightEditor : Object 
+
+
+    public class Xcls_RightEditor : Object
     {
         public Gtk.ScrolledWindow el;
         private Editor  _this;
@@ -205,7 +232,7 @@ public class Editor : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_RightEditor(Editor _owner )
         {
             _this = _owner;
@@ -219,14 +246,14 @@ public class Editor : Object
             child_0.ref();
             this.el.add (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_view : Object 
+    public class Xcls_view : Object
     {
         public Gtk.SourceView el;
         private Editor  _this;
@@ -234,7 +261,7 @@ public class Editor : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_view(Editor _owner )
         {
             _this = _owner;
@@ -254,14 +281,16 @@ public class Editor : Object
             child_0.ref();
             this.el.set_buffer (  child_0.el  );
 
-            // init method 
+            // init method
 
             var description =   Pango.FontDescription.from_string("monospace");
                 description.set_size(8000);
                 this.el.override_font(description);
             
+            
+              
                 var attrs = new Gtk.SourceMarkAttributes();
-                var  pink = new Gdk.RGBA();
+                var  pink =   Gdk.RGBA();
                 pink.parse ( "pink");
                 attrs.set_background ( pink);
                 attrs.set_icon_name ( "process-stop");    
@@ -270,9 +299,35 @@ public class Editor : Object
                     return mark.name;
                 });
                 
-                this.el.set_mark_attributes ("error", attrs, 1);
+                this.el.set_mark_attributes ("ERR", attrs, 1);
+                
+                 var wattrs = new Gtk.SourceMarkAttributes();
+                var  blue =   Gdk.RGBA();
+                blue.parse ( "#ABF4EB");
+                wattrs.set_background ( blue);
+                wattrs.set_icon_name ( "process-stop");    
+                wattrs.query_tooltip_text.connect(( mark) => {
+                    //print("tooltip query? %s\n", mark.name);
+                    return mark.name;
+                });
+                
+                this.el.set_mark_attributes ("WARN", wattrs, 1);
+                
+             
+                
+                 var dattrs = new Gtk.SourceMarkAttributes();
+                var  purple =   Gdk.RGBA();
+                purple.parse ( "#EEA9FF");
+                dattrs.set_background ( purple);
+                dattrs.set_icon_name ( "process-stop");    
+                dattrs.query_tooltip_text.connect(( mark) => {
+                    //print("tooltip query? %s\n", mark.name);
+                    return mark.name;
+                });
+                
+                this.el.set_mark_attributes ("DEPR", dattrs, 1);
 
-            // listeners 
+            //listeners
             this.el.key_release_event.connect( (event) => {
                 
                 if (event.keyval == 115 && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
@@ -287,7 +342,7 @@ public class Editor : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
         public   void load (string str) {
         
         // show the help page for the active node..
@@ -295,21 +350,26 @@ public class Editor : Object
         
         
           // this.get('/BottomPane').el.set_current_page(0);
-            this.el.get_buffer().set_text(str, str.length);
-            var lm = Gtk.SourceLanguageManager.get_default();
+          var buf = (Gtk.SourceBuffer)this.el.get_buffer();
+            buf.set_text(str, str.length);
+            buf.set_undo_manager(null);
             
-            var lang = _this.file.language;
+            var lm = Gtk.SourceLanguageManager.get_default();
+            var lang = "vala";
+            if (_this.file != null) {
+                 lang = _this.file.language;
+            }
             //?? is javascript going to work as js?
             
             ((Gtk.SourceBuffer)(this.el.get_buffer())) .set_language(lm.get_language(lang));
-            var buf = this.el.get_buffer();
+         
              
             _this.dirty = false;
             this.el.grab_focus();
             _this.save_button.el.sensitive = false;
         }
     }
-    public class Xcls_buffer : Object 
+    public class Xcls_buffer : Object
     {
         public Gtk.SourceBuffer el;
         private Editor  _this;
@@ -320,7 +380,7 @@ public class Editor : Object
         public int error_line;
         public bool check_running;
 
-        // ctor 
+        // ctor
         public Xcls_buffer(Editor _owner )
         {
             _this = _owner;
@@ -334,7 +394,7 @@ public class Editor : Object
 
             // set gobject values
 
-            // listeners 
+            //listeners
             this.el.changed.connect( () => {
                 // check syntax??
                 // ??needed..??
@@ -349,8 +409,9 @@ public class Editor : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
         public bool highlightErrors ( Gee.HashMap<int,string> validate_res) {
+                 
                 this.error_line = validate_res.size;
         
                 if (this.error_line < 1) {
@@ -368,7 +429,7 @@ public class Editor : Object
                     }
                     this.el.get_iter_at_line( out iter, eline);
                     //print("mark line\n");
-                    this.el.create_source_mark(valiter.get_value(), "error", iter);
+                    this.el.create_source_mark(valiter.get_value(), "ERR", iter);
                 }   
                 return false;
             }
@@ -402,14 +463,9 @@ public class Editor : Object
         
                 return true;
             }
-           
-           
-            var p = Palete.factory(_this.file.xtype);   
-            
             var str = this.toString();
             
-            string res = "";
-            
+            // needed???
             if (this.error_line > 0) {
                  Gtk.TextIter start;
                  Gtk.TextIter end;     
@@ -417,11 +473,31 @@ public class Editor : Object
         
                 this.el.remove_source_marks (start, end, null);
             }
-            
             if (str.length < 1) {
                 print("checkSyntax - empty string?\n");
                 return true;
             }
+            
+            if (_this.file == null && _this.fname.length > 0) {
+            
+                // assume it's gtk...
+                   this.check_running = true;
+        
+                 _this.window.windowstate.valasource.checkPlainFileSpawn(
+                    _this.window.project,
+                   _this.fname,
+                   str
+                );
+                return true;
+            
+            }
+           if (_this.file == null) {
+               return true;
+           }
+            var p = Palete.factory(_this.file.xtype);   
+            
+        
+             
             this.check_running = true;
             
             
@@ -441,26 +517,16 @@ public class Editor : Object
                 
             print("calling validate vala\n");    
             // clear the buttons.
-            _this.window.statusbar_errors.el.hide();
-            _this.window.statusbar_warnings.el.hide();
-            _this.window.statusbar_depricated.el.hide();
-            
-            
+         
             
             p.validateVala(
+                _this.window.windowstate,
                 str, 
                  _this.key, 
                 _this.ptype,
                 _this.file,
-                _this.node,
-                (obj) => {
-                    this.check_running = false;
-                    this.highlightErrorsJson(obj);            
-                    
-                    //var validate_res = p.validateVala.end(res);
-                    //this.highlightErrors(validate_res);
-        
-                }
+                _this.node 
+                
                 
             );
              
@@ -470,53 +536,61 @@ public class Editor : Object
              
             return true; // at present allow saving - even if it's invalid..
         }
-        public bool highlightErrorsJson (Json.Object obj) {
+        public bool highlightErrorsJson (string type, Json.Object obj) {
               Gtk.TextIter start;
              Gtk.TextIter end;     
                 this.el.get_bounds (out start, out end);
                 
-                this.el.remove_source_marks (start, end, null);
+                this.el.remove_source_marks (start, end, type);
                          
-            if (obj.has_member("ERR-TOTAL")) {
-        
-                 _this.window.statusbar_errors.setNotices( obj.get_object_member("ERR") , (int) obj.get_int_member("ERR-TOTAL"));
-            } else {
-                 _this.window.statusbar_errors.setNotices( new Json.Object() , 0);
-            }    
-            
-            if (obj.has_member("WARN-TOTAL")) {
-        
-                 _this.window.statusbar_warnings.setNotices(obj.get_object_member("WARN"), (int) obj.get_int_member("WARN-TOTAL"));
-            } else {
-                     _this.window.statusbar_warnings.setNotices( new Json.Object() , 0);
-            }
-            if (obj.has_member("DEPR-TOTAL")) {
-                
-                 _this.window.statusbar_depricated.setNotices( obj.get_object_member("DEPR"),  (int) obj.get_int_member("DEPR-TOTAL"));
-         
-            } else {
-                _this.window.statusbar_depricated.setNotices( new Json.Object(),0);
-            }
+             
+             // we should highlight other types of errors..
             
-            if (!obj.has_member("ERR")) {
+            if (!obj.has_member(type)) {
                 print("Return has no errors\n");
                 return true;
             }
-            var err = obj.get_object_member("ERR");
             
+            if (_this.window.windowstate.state != WindowState.State.CODEONLY && 
+                _this.window.windowstate.state != WindowState.State.CODE
+                ) {
+                return true;
+            } 
             
             
-            if (!err.has_member(_this.file.path)) {
-                print("File path has no errors\n");
-                return true;
-            }
+            var err = obj.get_object_member(type);
+            var valafn = _this.fname;
+            if (_this.file != null) {
+        
+        
+                
+                
+                 valafn = "";
+                  try {             
+                       var  regex = new Regex("\\.bjs$");
+                    
+                     
+                        valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , ".vala");
+                     } catch (GLib.RegexError e) {
+                        return true;
+                    }   
+        
+        
         
-            var lines = err.get_object_member(_this.file.path);
+              }
+               if (!err.has_member(valafn)) {
+                    print("File path has no errors\n");
+                    return  true;
+                }
+        
+                var lines = err.get_object_member(valafn);
+                
+                var offset = 1;
+                if (obj.has_member("line_offset")) {
+                    offset = (int)obj.get_int_member("line_offset") + 1;
+                }
             
-            var offset = 1;
-            if (obj.has_member("line_offset")) {
-                offset = (int)obj.get_int_member("line_offset") + 1;
-            }
+        
              
             
             var tlines = this.el.get_line_count () +1;
@@ -542,7 +616,7 @@ public class Editor : Object
                    }
                     
                     
-                    this.el.create_source_mark(msg, "error", iter);
+                    this.el.create_source_mark(msg, type, iter);
                 } );
                 return false;
             
@@ -552,4 +626,7 @@ public class Editor : Object
         
         }
     }
+
+
+
 }
index f96ef03..69344b1 100644 (file)
    },
    "id" : "GtkView",
    "# Gtk.Widget lastObj" : "null",
-   "| void createThumb" : "() {\n    \n    \n    if (this.file == null) {\n        return;\n    }\n    var filename = this.file.getIconFileName(false);\n    \n    var  win = this.el.get_parent_window();\n    var width = win.get_width();\n    var height = win.get_height();\n\n    Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?\n\n    screenshot.save(filename,\"png\");\n    return;\n    \n    \n    \n    \n    \n     \n    \n    // should we hold until it's printed...\n    \n      \n\n    \n    \n\n\n    \n     \n}\n",
-   "| void loadFile" : "(JsRender.JsRender file) \n{\n        this.file = null;\n        \n        if (file.tree == null) {\n            return;\n        }\n        this.file = file;\n        if (this.lastObj != null) {\n            this.container.el.remove(this.lastObj);\n        }\n        \n        // hide the compile view at present..\n          \n        \n        var w = this.width;\n        var h = this.height;\n        \n        print(\"ALLOC SET SIZES %d, %d\\n\", w,h); \n        \n        // set the container size min to 500/500 or 20 px less than max..\n        w = int.max (w-20, 500);\n        h = int.max (h-20, 500); \n        \n        print(\"SET SIZES %d, %d\\n\", w,h);       \n        _this.container.el.set_size_request(w,h);\n        \n        _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.\n        var rgba = Gdk.RGBA ();\n        rgba.parse (\"#ccc\");\n        _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);\n        \n        \n\tvar x = new JsRender.NodeToGtk(file.tree);\n        var obj = x.munge() as Gtk.Widget;\n        this.lastObj = null;\n\tif (obj == null) {\n        \treturn;\n\t}\n\tthis.lastObj = obj;\n        \n        this.container.el.add(obj);\n        obj.show_all();\n        \n         \n        \n}\n ",
+   "| void createThumb" : "() {\n    \n    \n    if (this.file == null) {\n        return;\n    }\n    // only screenshot the gtk preview..\n    if (this.notebook.el.page > 0 ) {\n        return;\n    }\n    \n    \n    var filename = this.file.getIconFileName(false);\n    \n    var  win = this.el.get_parent_window();\n    var width = win.get_width();\n    var height = win.get_height();\n    try {\n         Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?\n         screenshot.save(filename,\"png\");\n    } catch (Error e) {\n        \n    }\n\n   \n    return;\n    \n    \n     \n     \n    \n    // should we hold until it's printed...\n    \n      \n\n    \n    \n\n\n    \n     \n}\n",
+   "| void loadFile" : "(JsRender.JsRender file) \n{\n        this.file = null;\n        \n        if (file.tree == null) {\n            return;\n        }\n       this.file = file;     \n        this.sourceview.loadFile();\n        \n        \n\n        if (this.lastObj != null) {\n            this.container.el.remove(this.lastObj);\n        }\n        \n        // hide the compile view at present..\n          \n        \n        var w = this.width;\n        var h = this.height;\n        \n        print(\"ALLOC SET SIZES %d, %d\\n\", w,h); \n        \n        // set the container size min to 500/500 or 20 px less than max..\n        w = int.max (w-20, 500);\n        h = int.max (h-20, 500); \n        \n        print(\"SET SIZES %d, %d\\n\", w,h);       \n        _this.container.el.set_size_request(w,h);\n        \n        _this.view_layout.el.set_size(w,h); // should be baded on calc.. -- see update_scrolled.\n        var rgba = Gdk.RGBA ();\n        rgba.parse (\"#ccc\");\n        _this.view_layout.el.override_background_color(Gtk.StateFlags.NORMAL, rgba);\n        \n        \n\tvar x = new JsRender.NodeToGtk(file.tree);\n        var obj = x.munge() as Gtk.Widget;\n        this.lastObj = null;\n\tif (obj == null) {\n        \treturn;\n\t}\n\tthis.lastObj = obj;\n        \n        this.container.el.add(obj);\n        obj.show_all();\n        \n         \n        \n}\n ",
    "int width" : 0,
-   "Xcls_MainWindow main_window" : "",
-   "xtype" : "VBox",
+   "xtype" : "Box",
    "# JsRender.JsRender file" : "null",
    "int height" : 0,
    "$ xns" : "Gtk",
+   "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+   "# Xcls_MainWindow main_window" : "",
    "items" : [
     {
+     "id" : "notebook",
+     "xtype" : "Notebook",
      "* pack" : "pack_start,true,true,0",
-     "xtype" : "ScrolledWindow",
      "$ xns" : "Gtk",
      "items" : [
       {
-       "id" : "view_layout",
-       "* pack" : "add",
-       "xtype" : "Layout",
+       "id" : "label_preview",
+       "xtype" : "Label",
+       "* pack" : false,
+       "$ xns" : "Gtk",
+       "utf8 label" : "Preview"
+      },
+      {
+       "id" : "label_code",
+       "* pack" : false,
+       "xtype" : "Label",
+       "$ xns" : "Gtk",
+       "utf8 label" : "Preview Generated Code"
+      },
+      {
+       "* pack" : "append_page,_this.label_preview.el",
+       "xtype" : "ScrolledWindow",
+       "$ xns" : "Gtk",
+       "items" : [
+        {
+         "id" : "view_layout",
+         "* pack" : "add",
+         "xtype" : "Layout",
+         "$ xns" : "Gtk",
+         "items" : [
+          {
+           "id" : "container",
+           "xtype" : "Box",
+           "* pack" : "put,10,10",
+           "$ xns" : "Gtk",
+           "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL"
+          }
+         ]
+        }
+       ]
+      },
+      {
+       "xtype" : "ScrolledWindow",
+       "* pack" : "append_page,_this.label_code.el",
        "$ xns" : "Gtk",
        "items" : [
         {
-         "id" : "container",
-         "xtype" : "HBox",
-         "* pack" : "put,10,10",
-         "$ xns" : "Gtk"
+         "gboolean show_line_marks" : true,
+         "id" : "sourceview",
+         "* init" : "{\n   \n    var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(8000);\n    this.el.override_font(description);\n\n    this.loading = true;\n    var buf = this.el.get_buffer();\n    buf.notify.connect((ps) => {\n        if (this.loading) {\n            return;\n        }\n        if (ps.name != \"cursor-position\") {\n            return;\n        }\n        print(\"cursor changed : %d\\n\", buf.cursor_position);\n        Gtk.TextIter cpos;\n        buf.get_iter_at_offset(out cpos, buf.cursor_position);\n        \n        var ln = cpos.get_line();\n        \n        var node = _this.file.lineToNode(ln);\n        if (node == null) {\n            print(\"can not find node\\n\");\n            return;\n        }\n        var ltree = _this.main_window.windowstate.left_tree;\n        var tp = ltree.model.treePathFromNode(node);\n        print(\"got tree path %s\\n\", tp);\n        if (tp != \"\") {\n            ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false);\n        }\n        \n        // highlight the node..\n        \n    });\n  \n  \n  \n    var attrs = new Gtk.SourceMarkAttributes();\n    var  pink =   Gdk.RGBA();\n    pink.parse ( \"pink\");\n    attrs.set_background ( pink);\n    attrs.set_icon_name ( \"process-stop\");    \n    attrs.query_tooltip_text.connect(( mark) => {\n        //print(\"tooltip query? %s\\n\", mark.name);\n        return mark.name;\n    });\n    \n    this.el.set_mark_attributes (\"ERR\", attrs, 1);\n    \n     var wattrs = new Gtk.SourceMarkAttributes();\n    var  blue =   Gdk.RGBA();\n    blue.parse ( \"#ABF4EB\");\n    wattrs.set_background ( blue);\n    wattrs.set_icon_name ( \"process-stop\");    \n    wattrs.query_tooltip_text.connect(( mark) => {\n        //print(\"tooltip query? %s\\n\", mark.name);\n        return mark.name;\n    });\n    \n    this.el.set_mark_attributes (\"WARN\", wattrs, 1);\n    \n \n    \n     var dattrs = new Gtk.SourceMarkAttributes();\n    var  purple =   Gdk.RGBA();\n    purple.parse ( \"#EEA9FF\");\n    dattrs.set_background ( purple);\n    dattrs.set_icon_name ( \"process-stop\");    \n    dattrs.query_tooltip_text.connect(( mark) => {\n        //print(\"tooltip query? %s\\n\", mark.name);\n        return mark.name;\n    });\n    \n    this.el.set_mark_attributes (\"DEPR\", dattrs, 1);\n    \n    \n    var gattrs = new Gtk.SourceMarkAttributes();\n    var  grey =   Gdk.RGBA();\n    grey.parse ( \"#ccc\");\n    gattrs.set_background ( grey);\n \n    \n    this.el.set_mark_attributes (\"grey\", gattrs, 1);\n    \n    \n    \n    \n    \n    \n}\n ",
+         "| void nodeSelected" : "(JsRender.Node? sel) {\n  \n    \n  \n    // this is connected in widnowstate\n    print(\"node selected\");\n    var buf = this.el.get_buffer();\n \n    var sbuf = (Gtk.SourceBuffer) buf;\n\n   \n    while(Gtk.events_pending()) {\n        Gtk.main_iteration();\n    }\n    \n   \n    // clear all the marks..\n     Gtk.TextIter start;\n    Gtk.TextIter end;     \n        \n    sbuf.get_bounds (out start, out end);\n    sbuf.remove_source_marks (start, end, \"grey\");\n    \n    \n     if (sel == null) {\n        // no highlighting..\n        return;\n    }\n    Gtk.TextIter iter;   \n    sbuf.get_iter_at_line(out iter,  sel.line_start);\n    this.el.scroll_to_iter(iter,  0.1f, true, 0.0f, 0.0f);\n    \n    for (var i = 0; i < buf.get_line_count();i++) {\n        if (i < sel.line_start || i > sel.line_end) {\n           \n            sbuf.get_iter_at_line(out iter, i);\n            sbuf.create_source_mark(null, \"grey\", iter);\n            \n        }\n    \n    }\n    \n\n}\n",
+         "bool loading" : true,
+         "| void loadFile" : "( ) {\n    this.loading = true;\n    var buf = this.el.get_buffer();\n    buf.set_text(\"\",0);\n    var sbuf = (Gtk.SourceBuffer) buf;\n\n    \n\n    if (_this.file == null || _this.file.xtype != \"Gtk\") {\n        print(\"xtype != Gtk\");\n        this.loading = false;\n        return;\n    }\n    \n    var valafn = \"\";\n      try {             \n           var  regex = new Regex(\"\\\\.bjs$\");\n        \n         \n            valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");\n         } catch (GLib.RegexError e) {\n             this.loading = false;\n            return;\n        }   \n    \n\n   if (!FileUtils.test(valafn,FileTest.IS_REGULAR) ) {\n        print(\"File path has no errors\\n\");\n        this.loading = false;\n        return  ;\n    }\n    \n    string str;\n    try {\n    \n        GLib.FileUtils.get_contents (valafn, out str);\n    } catch (Error e) {\n        this.loading = false;\n        return  ;\n    }\n\n//    print(\"setting str %d\\n\", str.length);\n    buf.set_text(str, str.length);\n    var lm = Gtk.SourceLanguageManager.get_default();\n     \n    //?? is javascript going to work as js?\n    \n    ((Gtk.SourceBuffer)(buf)) .set_language(lm.get_language(_this.file.language));\n  \n    \n    Gtk.TextIter start;\n    Gtk.TextIter end;     \n        \n    sbuf.get_bounds (out start, out end);\n    sbuf.remove_source_marks (start, end, null); // remove all marks..\n    \n    \n    if (_this.main_window.windowstate.last_compile_result != null) {\n        var obj = _this.main_window.windowstate.last_compile_result;\n        this.highlightErrorsJson(\"ERR\", obj);\n        this.highlightErrorsJson(\"WARN\", obj);\n        this.highlightErrorsJson(\"DEPR\", obj);\t\t\t\n    }\n    //while (Gtk.events_pending()) {\n     //   Gtk.main_iteration();\n   // }\n    \n    this.loading = false; \n}\n",
+         "* pack" : "add",
+         "xtype" : "SourceView",
+         "| void highlightErrorsJson" : " (string type, Json.Object obj) {\n      Gtk.TextIter start;\n     Gtk.TextIter end;   \n     \n     var buf =  this.el.get_buffer();\n       var sbuf = (Gtk.SourceBuffer)buf;\n        buf.get_bounds (out start, out end);\n        \n        sbuf.remove_source_marks (start, end, type);\n                 \n     \n     // we should highlight other types of errors..\n    \n    if (!obj.has_member(type)) {\n        print(\"Return has no errors\\n\");\n        return  ;\n    }\n    var err = obj.get_object_member(type);\n    \n     \n\n    var valafn = \"\";\n      try {             \n           var  regex = new Regex(\"\\\\.bjs$\");\n        \n         \n            valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , \".vala\");\n         } catch (GLib.RegexError e) {\n            return;\n        }   \n\n   if (!err.has_member(valafn)) {\n        print(\"File path has no errors\\n\");\n        return  ;\n    }\n    var lines = err.get_object_member(valafn);\n    \n   \n    \n    var tlines = buf.get_line_count () +1;\n    \n    lines.foreach_member((obj, line, node) => {\n        \n             Gtk.TextIter iter;\n    //        print(\"get inter\\n\");\n            var eline = int.parse(line) -1  ;\n            print(\"GOT ERROR on line %s -- converted to %d\\n\", line,eline);\n            \n            \n            if (eline > tlines || eline < 0) {\n                return;\n            }\n            sbuf.get_iter_at_line( out iter, eline);\n            //print(\"mark line\\n\");\n            var msg  = type + \" on line: %d - %s\".printf(eline+1, valafn);\n            var ar = lines.get_array_member(line);\n            for (var i = 0 ; i < ar.get_length(); i++) {\n\t\t    msg += (msg.length > 0) ? \"\\n\" : \"\";\n\t\t    msg += ar.get_string_element(i);\n\t    }\n            \n            \n            sbuf.create_source_mark(msg, type, iter);\n        } );\n        return  ;\n    \n \n\n\n}",
+         "$ xns" : "Gtk",
+         "gboolean show_line_numbers" : true,
+         "gboolean editable" : false
         }
        ]
       }
index fa3d562..c1fdad2 100644 (file)
@@ -1,8 +1,8 @@
 static Xcls_GtkView  _GtkView;
 
-public class Xcls_GtkView : Object 
+public class Xcls_GtkView : Object
 {
-    public Gtk.VBox el;
+    public Gtk.Box el;
     private Xcls_GtkView  _this;
 
     public static Xcls_GtkView singleton()
@@ -12,21 +12,25 @@ public class Xcls_GtkView : Object
         }
         return _GtkView;
     }
+    public Xcls_notebook notebook;
+    public Xcls_label_preview label_preview;
+    public Xcls_label_code label_code;
     public Xcls_view_layout view_layout;
     public Xcls_container container;
+    public Xcls_sourceview sourceview;
 
         // my vars (def)
     public Gtk.Widget lastObj;
     public int width;
-    public Xcls_MainWindow main_window;
     public JsRender.JsRender file;
     public int height;
+    public Xcls_MainWindow main_window;
 
-    // ctor 
+    // ctor
     public Xcls_GtkView()
     {
         _this = this;
-        this.el = new Gtk.VBox( true, 0 );
+        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
         // my vars (dec)
         this.lastObj = null;
@@ -35,11 +39,11 @@ public class Xcls_GtkView : Object
         this.height = 0;
 
         // set gobject values
-        var child_0 = new Xcls_ScrolledWindow2( _this );
+        var child_0 = new Xcls_notebook( _this );
         child_0.ref();
         this.el.pack_start (  child_0.el , true,true,0 );
 
-        // listeners 
+        //listeners
         this.el.size_allocate.connect( (aloc) => {
         
             this.width = aloc.width;
@@ -47,28 +51,36 @@ public class Xcls_GtkView : Object
             });
     }
 
-    // user defined functions 
+    // user defined functions
     public void createThumb () {
         
         
         if (this.file == null) {
             return;
         }
+        // only screenshot the gtk preview..
+        if (this.notebook.el.page > 0 ) {
+            return;
+        }
+        
+        
         var filename = this.file.getIconFileName(false);
         
         var  win = this.el.get_parent_window();
         var width = win.get_width();
         var height = win.get_height();
+        try {
+             Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?
+             screenshot.save(filename,"png");
+        } catch (Error e) {
+            
+        }
     
-        Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?
-    
-        screenshot.save(filename,"png");
+       
         return;
         
         
-        
-        
-        
+         
          
         
         // should we hold until it's printed...
@@ -89,7 +101,11 @@ public class Xcls_GtkView : Object
             if (file.tree == null) {
                 return;
             }
-            this.file = file;
+           this.file = file;     
+            this.sourceview.loadFile();
+            
+            
+    
             if (this.lastObj != null) {
                 this.container.el.remove(this.lastObj);
             }
@@ -129,7 +145,85 @@ public class Xcls_GtkView : Object
              
             
     }
-    public class Xcls_ScrolledWindow2 : Object 
+    public class Xcls_notebook : Object
+    {
+        public Gtk.Notebook el;
+        private Xcls_GtkView  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_notebook(Xcls_GtkView _owner )
+        {
+            _this = _owner;
+            _this.notebook = this;
+            this.el = new Gtk.Notebook();
+
+            // my vars (dec)
+
+            // set gobject values
+            var child_0 = new Xcls_label_preview( _this );
+            child_0.ref();
+            var child_1 = new Xcls_label_code( _this );
+            child_1.ref();
+            var child_2 = new Xcls_ScrolledWindow5( _this );
+            child_2.ref();
+            this.el.append_page (  child_2.el , _this.label_preview.el );
+            var child_3 = new Xcls_ScrolledWindow8( _this );
+            child_3.ref();
+            this.el.append_page (  child_3.el , _this.label_code.el );
+        }
+
+        // user defined functions
+    }
+    public class Xcls_label_preview : Object
+    {
+        public Gtk.Label el;
+        private Xcls_GtkView  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_label_preview(Xcls_GtkView _owner )
+        {
+            _this = _owner;
+            _this.label_preview = this;
+            this.el = new Gtk.Label( "Preview" );
+
+            // my vars (dec)
+
+            // set gobject values
+        }
+
+        // user defined functions
+    }
+
+    public class Xcls_label_code : Object
+    {
+        public Gtk.Label el;
+        private Xcls_GtkView  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_label_code(Xcls_GtkView _owner )
+        {
+            _this = _owner;
+            _this.label_code = this;
+            this.el = new Gtk.Label( "Preview Generated Code" );
+
+            // my vars (dec)
+
+            // set gobject values
+        }
+
+        // user defined functions
+    }
+
+    public class Xcls_ScrolledWindow5 : Object
     {
         public Gtk.ScrolledWindow el;
         private Xcls_GtkView  _this;
@@ -137,8 +231,8 @@ public class Xcls_GtkView : Object
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_ScrolledWindow2(Xcls_GtkView _owner )
+        // ctor
+        public Xcls_ScrolledWindow5(Xcls_GtkView _owner )
         {
             _this = _owner;
             this.el = new Gtk.ScrolledWindow( null, null );
@@ -151,9 +245,9 @@ public class Xcls_GtkView : Object
             this.el.add (  child_0.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_view_layout : Object 
+    public class Xcls_view_layout : Object
     {
         public Gtk.Layout el;
         private Xcls_GtkView  _this;
@@ -161,7 +255,7 @@ public class Xcls_GtkView : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_view_layout(Xcls_GtkView _owner )
         {
             _this = _owner;
@@ -176,28 +270,363 @@ public class Xcls_GtkView : Object
             this.el.put (  child_0.el , 10,10 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_container : Object 
+    public class Xcls_container : Object
     {
-        public Gtk.HBox el;
+        public Gtk.Box el;
         private Xcls_GtkView  _this;
 
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_container(Xcls_GtkView _owner )
         {
             _this = _owner;
             _this.container = this;
-            this.el = new Gtk.HBox( true, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
+
+
+    public class Xcls_ScrolledWindow8 : Object
+    {
+        public Gtk.ScrolledWindow el;
+        private Xcls_GtkView  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_ScrolledWindow8(Xcls_GtkView _owner )
+        {
+            _this = _owner;
+            this.el = new Gtk.ScrolledWindow( null, null );
+
+            // my vars (dec)
+
+            // set gobject values
+            var child_0 = new Xcls_sourceview( _this );
+            child_0.ref();
+            this.el.add (  child_0.el  );
+        }
+
+        // user defined functions
+    }
+    public class Xcls_sourceview : Object
+    {
+        public Gtk.SourceView el;
+        private Xcls_GtkView  _this;
+
+
+            // my vars (def)
+        public bool loading;
+
+        // ctor
+        public Xcls_sourceview(Xcls_GtkView _owner )
+        {
+            _this = _owner;
+            _this.sourceview = this;
+            this.el = new Gtk.SourceView();
+
+            // my vars (dec)
+            this.loading = true;
+
+            // set gobject values
+            this.el.editable = false;
+            this.el.show_line_marks = true;
+            this.el.show_line_numbers = true;
+
+            // init method
+
+            {
+               
+                var description =   Pango.FontDescription.from_string("monospace");
+                description.set_size(8000);
+                this.el.override_font(description);
+            
+                this.loading = true;
+                var buf = this.el.get_buffer();
+                buf.notify.connect((ps) => {
+                    if (this.loading) {
+                        return;
+                    }
+                    if (ps.name != "cursor-position") {
+                        return;
+                    }
+                    print("cursor changed : %d\n", buf.cursor_position);
+                    Gtk.TextIter cpos;
+                    buf.get_iter_at_offset(out cpos, buf.cursor_position);
+                    
+                    var ln = cpos.get_line();
+                    
+                    var node = _this.file.lineToNode(ln);
+                    if (node == null) {
+                        print("can not find node\n");
+                        return;
+                    }
+                    var ltree = _this.main_window.windowstate.left_tree;
+                    var tp = ltree.model.treePathFromNode(node);
+                    print("got tree path %s\n", tp);
+                    if (tp != "") {
+                        ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false);
+                    }
+                    
+                    // highlight the node..
+                    
+                });
+              
+              
+              
+                var attrs = new Gtk.SourceMarkAttributes();
+                var  pink =   Gdk.RGBA();
+                pink.parse ( "pink");
+                attrs.set_background ( pink);
+                attrs.set_icon_name ( "process-stop");    
+                attrs.query_tooltip_text.connect(( mark) => {
+                    //print("tooltip query? %s\n", mark.name);
+                    return mark.name;
+                });
+                
+                this.el.set_mark_attributes ("ERR", attrs, 1);
+                
+                 var wattrs = new Gtk.SourceMarkAttributes();
+                var  blue =   Gdk.RGBA();
+                blue.parse ( "#ABF4EB");
+                wattrs.set_background ( blue);
+                wattrs.set_icon_name ( "process-stop");    
+                wattrs.query_tooltip_text.connect(( mark) => {
+                    //print("tooltip query? %s\n", mark.name);
+                    return mark.name;
+                });
+                
+                this.el.set_mark_attributes ("WARN", wattrs, 1);
+                
+             
+                
+                 var dattrs = new Gtk.SourceMarkAttributes();
+                var  purple =   Gdk.RGBA();
+                purple.parse ( "#EEA9FF");
+                dattrs.set_background ( purple);
+                dattrs.set_icon_name ( "process-stop");    
+                dattrs.query_tooltip_text.connect(( mark) => {
+                    //print("tooltip query? %s\n", mark.name);
+                    return mark.name;
+                });
+                
+                this.el.set_mark_attributes ("DEPR", dattrs, 1);
+                
+                
+                var gattrs = new Gtk.SourceMarkAttributes();
+                var  grey =   Gdk.RGBA();
+                grey.parse ( "#ccc");
+                gattrs.set_background ( grey);
+             
+                
+                this.el.set_mark_attributes ("grey", gattrs, 1);
+                
+                
+                
+                
+                
+                
+            }
+        }
+
+        // user defined functions
+        public void nodeSelected (JsRender.Node? sel) {
+          
+            
+          
+            // this is connected in widnowstate
+            print("node selected");
+            var buf = this.el.get_buffer();
+         
+            var sbuf = (Gtk.SourceBuffer) buf;
+        
+           
+            while(Gtk.events_pending()) {
+                Gtk.main_iteration();
+            }
+            
+           
+            // clear all the marks..
+             Gtk.TextIter start;
+            Gtk.TextIter end;     
+                
+            sbuf.get_bounds (out start, out end);
+            sbuf.remove_source_marks (start, end, "grey");
+            
+            
+             if (sel == null) {
+                // no highlighting..
+                return;
+            }
+            Gtk.TextIter iter;   
+            sbuf.get_iter_at_line(out iter,  sel.line_start);
+            this.el.scroll_to_iter(iter,  0.1f, true, 0.0f, 0.0f);
+            
+            for (var i = 0; i < buf.get_line_count();i++) {
+                if (i < sel.line_start || i > sel.line_end) {
+                   
+                    sbuf.get_iter_at_line(out iter, i);
+                    sbuf.create_source_mark(null, "grey", iter);
+                    
+                }
+            
+            }
+            
+        
+        }
+        public void loadFile ( ) {
+            this.loading = true;
+            var buf = this.el.get_buffer();
+            buf.set_text("",0);
+            var sbuf = (Gtk.SourceBuffer) buf;
+        
+            
+        
+            if (_this.file == null || _this.file.xtype != "Gtk") {
+                print("xtype != Gtk");
+                this.loading = false;
+                return;
+            }
+            
+            var valafn = "";
+              try {             
+                   var  regex = new Regex("\\.bjs$");
+                
+                 
+                    valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , ".vala");
+                 } catch (GLib.RegexError e) {
+                     this.loading = false;
+                    return;
+                }   
+            
+        
+           if (!FileUtils.test(valafn,FileTest.IS_REGULAR) ) {
+                print("File path has no errors\n");
+                this.loading = false;
+                return  ;
+            }
+            
+            string str;
+            try {
+            
+                GLib.FileUtils.get_contents (valafn, out str);
+            } catch (Error e) {
+                this.loading = false;
+                return  ;
+            }
+        
+        //    print("setting str %d\n", str.length);
+            buf.set_text(str, str.length);
+            var lm = Gtk.SourceLanguageManager.get_default();
+             
+            //?? is javascript going to work as js?
+            
+            ((Gtk.SourceBuffer)(buf)) .set_language(lm.get_language(_this.file.language));
+          
+            
+            Gtk.TextIter start;
+            Gtk.TextIter end;     
+                
+            sbuf.get_bounds (out start, out end);
+            sbuf.remove_source_marks (start, end, null); // remove all marks..
+            
+            
+            if (_this.main_window.windowstate.last_compile_result != null) {
+                var obj = _this.main_window.windowstate.last_compile_result;
+                this.highlightErrorsJson("ERR", obj);
+                this.highlightErrorsJson("WARN", obj);
+                this.highlightErrorsJson("DEPR", obj);                 
+            }
+            //while (Gtk.events_pending()) {
+             //   Gtk.main_iteration();
+           // }
+            
+            this.loading = false; 
+        }
+        public void highlightErrorsJson (string type, Json.Object obj) {
+              Gtk.TextIter start;
+             Gtk.TextIter end;   
+             
+             var buf =  this.el.get_buffer();
+               var sbuf = (Gtk.SourceBuffer)buf;
+                buf.get_bounds (out start, out end);
+                
+                sbuf.remove_source_marks (start, end, type);
+                         
+             
+             // we should highlight other types of errors..
+            
+            if (!obj.has_member(type)) {
+                print("Return has no errors\n");
+                return  ;
+            }
+            var err = obj.get_object_member(type);
+            
+             
+        
+            var valafn = "";
+              try {             
+                   var  regex = new Regex("\\.bjs$");
+                
+                 
+                    valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , ".vala");
+                 } catch (GLib.RegexError e) {
+                    return;
+                }   
+        
+           if (!err.has_member(valafn)) {
+                print("File path has no errors\n");
+                return  ;
+            }
+            var lines = err.get_object_member(valafn);
+            
+           
+            
+            var tlines = buf.get_line_count () +1;
+            
+            lines.foreach_member((obj, line, node) => {
+                
+                     Gtk.TextIter iter;
+            //        print("get inter\n");
+                    var eline = int.parse(line) -1  ;
+                    print("GOT ERROR on line %s -- converted to %d\n", line,eline);
+                    
+                    
+                    if (eline > tlines || eline < 0) {
+                        return;
+                    }
+                    sbuf.get_iter_at_line( out iter, eline);
+                    //print("mark line\n");
+                    var msg  = type + " on line: %d - %s".printf(eline+1, valafn);
+                    var ar = lines.get_array_member(line);
+                    for (var i = 0 ; i < ar.get_length(); i++) {
+                           msg += (msg.length > 0) ? "\n" : "";
+                           msg += ar.get_string_element(i);
+                   }
+                    
+                    
+                    sbuf.create_source_mark(msg, type, iter);
+                } );
+                return  ;
+            
+         
+        
+        
+        }
+    }
+
+
+
 }
index decb3ca..df81807 100644 (file)
    "items" : [
     {
      "id" : "headerbar",
-     "xtype" : "HeaderBar",
      "* pack" : "set_titlebar",
+     "xtype" : "HeaderBar",
      "bool show_close_button" : true,
      "$ xns" : "Gtk",
      "string title" : "Application Builder",
      "items" : [
       {
        "* pack" : "pack_start",
-       "xtype" : "HBox",
+       "xtype" : "Box",
        "$ xns" : "Gtk",
+       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
         {
          "bool use_popover" : false,
-         "xtype" : "MenuButton",
          "* pack" : "add",
+         "xtype" : "MenuButton",
          "$ xns" : "Gtk",
          "items" : [
           {
@@ -59,9 +60,9 @@
              "listeners" : {
               "activate" : "  ( ) => {\n        Xcls_MainWindow.singleton().no_windows++;\n        var w = new Xcls_MainWindow();\n        w.ref();\n\n        w.el.show_all();\n        w.initChildren();\n        w.windowstate.switchState(WindowState.State.FILES);\n}"
              },
-             "* pack" : "append",
              "xtype" : "MenuItem",
              "string label" : "Open a new Window",
+             "* pack" : "append",
              "$ xns" : "Gtk"
             },
             {
              "listeners" : {
               "activate" : " ( ) => {\n         Resources.singleton().fetchStart();\n}"
              },
-             "string label" : "Download updated Resources",
              "* pack" : "append",
              "xtype" : "MenuItem",
+             "string label" : "Download updated Resources",
              "$ xns" : "Gtk"
             },
             {
              "listeners" : {
               "activate" : "() => {\n    About.singleton().el.show();\n    }"
              },
-             "xtype" : "MenuItem",
              "string label" : "About the Builder",
              "* pack" : "append",
+             "xtype" : "MenuItem",
              "$ xns" : "Gtk"
             }
            ]
           },
           {
-           "* pack" : "set_image",
            "xtype" : "Image",
            "utf8 icon_name" : "help-about",
+           "* pack" : "set_image",
            "$ xns" : "Gtk"
           }
          ]
     },
     {
      "id" : "vbox",
+     "xtype" : "Box",
      "* pack" : "add",
-     "xtype" : "VBox",
      "$ xns" : "Gtk",
+     "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
      "$ homogeneous" : false,
      "items" : [
       {
        "position" : 400,
        "* pack" : "pack_start,true,true,0",
        "# int lastWidth" : 0,
-       "xtype" : "HPaned",
+       "xtype" : "Paned",
        "$ xns" : "Gtk",
+       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
         {
          "id" : "leftpane",
-         "xtype" : "VBox",
          "* pack" : "add1",
+         "xtype" : "Box",
          "$ xns" : "Gtk",
+         "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
          "items" : [
           {
            "id" : "editpane",
-           "xtype" : "VPaned",
-           "* pack" : "pack_start,false,true,0",
+           "* pack" : "pack_start,true,true,0",
+           "xtype" : "Paned",
            "$ xns" : "Gtk",
+           "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
            "items" : [
             {
              "id" : "tree",
-             "xtype" : "VBox",
              "* pack" : "add1",
-             "$ xns" : "Gtk"
+             "xtype" : "Box",
+             "$ xns" : "Gtk",
+             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
             },
             {
              "id" : "props",
-             "xtype" : "VBox",
              "* pack" : "add2",
-             "$ xns" : "Gtk"
+             "xtype" : "Box",
+             "$ xns" : "Gtk",
+             "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL"
             }
            ]
           }
         },
         {
          "* pack" : "add2",
-         "xtype" : "VBox",
+         "xtype" : "Box",
          "$ xns" : "Gtk",
+         "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
          "items" : [
           {
            "listeners" : {
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "xtype" : "Actor",
                  "* pack" : "add_child",
+                 "xtype" : "Actor",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                     "clicked" : "  ( ) => {\n  \n    _this.windowstate.switchState(WindowState.State.PREVIEW);\n    \n\n}"
                    },
                    "utf8 tooltip_text" : "Back",
-                   "* pack" : false,
                    "xtype" : "Button",
+                   "* pack" : false,
                    "width_request" : 50,
                    "$ xns" : "Gtk",
                    "height_request" : 50,
                    "items" : [
                     {
-                     "utf8 icon_name" : "go-previous",
                      "* pack" : "set_image",
                      "xtype" : "Image",
+                     "utf8 icon_name" : "go-previous",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "$ tooltop_text" : "\"Open File\"",
                    "items" : [
                     {
-                     "xtype" : "Image",
                      "utf8 icon_name" : "document-open",
                      "* pack" : "set_image",
+                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "document-properties",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "utf8 icon_name" : "emblem-system",
                      "* pack" : "set_image",
                      "xtype" : "Image",
+                     "utf8 icon_name" : "emblem-system",
                      "$ xns" : "Gtk"
                     }
                    ]
               },
               {
                "listeners" : {
-                "enter_event" : "(  event)  => {\n    this.el.background_color = new Clutter.Color.from_string(\"#333\");\n        return false;\n}",
-                "leave_event" : "(  event)  => {\n    this.el.background_color = new Clutter.Color.from_string(\"#000\");\n    return false;\n}"
+                "enter_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#333\");\n        return false;\n}",
+                "leave_event" : "(  event)  => {\n    this.el.background_color =   Clutter.Color.from_string(\"#000\");\n    return false;\n}"
                },
                "id" : "objectshowbutton",
                "* init" : "this.el.set_size(50,50);",
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "xtype" : "Image",
                      "utf8 icon_name" : "list-add",
                      "* pack" : "set_image",
+                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "format-justify-left",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "utf8 icon_name" : "appointment-new",
                      "* pack" : "set_image",
                      "xtype" : "Image",
+                     "utf8 icon_name" : "appointment-new",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "listeners" : {
-                    "clicked" : "  ( ) => {\n  \n    // create a new file in project..\n    //Xcls_DialogNewComponent.singleton().show(\n   var  pe =     Xcls_EditProject.singleton();\n    pe.el.set_transient_for(_this.el);\n    pe.el.set_modal(true);   \n   \n    var p  = pe.show();\n\n    if (p == null) {\n        return;\n    }\n    \n    \n    _this.windowstate.left_projects.is_loaded = false;    \n    _this.windowstate.left_projects.load();\n    _this.windowstate.left_projects.selectProject(p);\n    return  ;    \n\n\n}"
+                    "clicked" : "  ( ) => {\n  \n    // create a new file in project..\n    //Xcls_DialogNewComponent.singleton().show(\n   var  pe =      EditProject.singleton();\n    pe.el.set_transient_for(_this.el);\n    pe.el.set_modal(true);   \n   \n    var p  = pe.show();\n\n    if (p == null) {\n        return;\n    }\n    \n    \n    _this.windowstate.left_projects.is_loaded = false;    \n    _this.windowstate.left_projects.load();\n    _this.windowstate.left_projects.selectProject(p);\n    return  ;    \n\n\n}"
                    },
                    "* pack" : false,
                    "xtype" : "Button",
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "folder-new",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "xtype" : "Image",
                      "utf8 icon_name" : "document-new",
                      "* pack" : "set_image",
+                     "xtype" : "Image",
                      "$ xns" : "Gtk"
                     }
                    ]
                "items" : [
                 {
                  "* init" : "((Gtk.Container)(this.el.get_widget())).add ( child_0.el);",
-                 "* pack" : "add_child",
                  "xtype" : "Actor",
+                 "* pack" : "add_child",
                  "$ xns" : "GtkClutter",
                  "items" : [
                   {
                    "height_request" : 50,
                    "items" : [
                     {
-                     "* pack" : "set_image",
                      "xtype" : "Image",
                      "utf8 icon_name" : "user-trash",
+                     "* pack" : "set_image",
                      "$ xns" : "Gtk"
                     }
                    ]
       },
       {
        "bool homogeneous" : false,
-       "xtype" : "HBox",
        "* pack" : "pack_end,false,true,0",
+       "xtype" : "Box",
        "$ xns" : "Gtk",
+       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
         {
-         "xtype" : "Label",
          "string label" : "   ",
          "* pack" : "pack_start,true,true,0",
+         "xtype" : "Label",
          "$ xns" : "Gtk"
         },
         {
          "bool show_text" : true,
-         "id" : "statusbar",
          "ulong handler_id" : "-1",
+         "id" : "statusbar",
          "* init" : "{\n     this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {\n        if (pos < 1) {\n            this.el.hide();\n            _this.mainpane.el.set_sensitive(true);\n            \n            return;\n        }\n         _this.mainpane.el.set_sensitive(false);\n         this.el.show();\n         this.el.set_fraction ((1.0f * pos) / (1.0f * total));\n         this.el.set_text(\"Fetching Resource : %s/%s\".printf(pos.to_string(), total.to_string()));\n       \n     });\n}\n",
          "xtype" : "ProgressBar",
          "* pack" : "pack_start,true,true,0",
          "$ xns" : "Gtk",
          "items" : [
           {
-           "string label" : "Compile Status:",
            "* pack" : "add",
            "xtype" : "MenuItem",
+           "string label" : "Compile Status:",
            "$ xns" : "Gtk"
           },
           {
            "listeners" : {
-            "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    if (_this.statusbar_warnings.popup != null && _this.statusbar_warnings.popup.active) {\n        _this.statusbar_warnings.popup.active = false;\n        _this.statusbar_warnings.popup.el.hide();\n    }\n    if (_this.statusbar_depricated.popup != null && _this.statusbar_depricated.popup.active) {\n        _this.statusbar_depricated.popup.active = false;\n        _this.statusbar_depricated.popup.el.hide();\n    }\n    \n    if (this.popup.active) {\n        this.popup.active = false;\n        this.popup.el.hide();\n        return true;\n    }\n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
+            "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n   \n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
            },
            "bool always_show_image" : true,
            "id" : "statusbar_errors",
            "$ xns" : "Gtk",
            "items" : [
             {
-             "utf8 icon_name" : "dialog-error",
              "* pack" : "set_image",
              "xtype" : "Image",
+             "utf8 icon_name" : "dialog-error",
              "$ xns" : "Gtk"
             }
            ]
           },
           {
            "listeners" : {
-            "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    \n    if (_this.statusbar_errors.popup != null && _this.statusbar_errors.popup.active) {\n        _this.statusbar_errors.popup.active = false;\n        _this.statusbar_errors.popup.el.hide();\n    }\n    if (_this.statusbar_depricated.popup != null && _this.statusbar_depricated.popup.active) {\n        _this.statusbar_depricated.popup.active = false;\n        _this.statusbar_depricated.popup.el.hide();\n    }\n    \n    if (this.popup.active) {\n        this.popup.active = false;\n        this.popup.el.hide();\n        return true;\n    }\n    this.popup.show(this.notices, this.el);\n    return true;\n}"
+            "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
            },
            "bool always_show_image" : true,
            "id" : "statusbar_warnings",
            "$ xns" : "Gtk",
            "items" : [
             {
-             "xtype" : "Image",
              "utf8 icon_name" : "dialog-warning",
              "* pack" : "set_image",
+             "xtype" : "Image",
              "$ xns" : "Gtk"
             }
            ]
           },
           {
            "listeners" : {
-            "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    \n    if (_this.statusbar_errors.popup != null && _this.statusbar_errors.popup.active) {\n        _this.statusbar_errors.popup.active = false;\n        _this.statusbar_errors.popup.el.hide();\n    }\n    if (_this.statusbar_warnings.popup != null && _this.statusbar_warnings.popup.active) {\n        _this.statusbar_warnings.popup.active = false;\n        _this.statusbar_warnings.popup.el.hide();\n    }\n    \n    if (this.popup.active) {\n        this.popup.active = false;\n        this.popup.el.hide();\n        return true;\n    }\n    this.popup.show(this.notices, this.el);\n    return true;\n}"
+            "button_press_event" : "() => {\n    if (this.popup == null) {\n        this.popup = new Xcls_ValaCompileErrors();\n        this.popup.window = _this;\n    }\n    \n    \n    this.popup.show(this.notices, this.el);\n    return true;\n}"
            },
            "bool always_show_image" : true,
            "id" : "statusbar_depricated",
            "$ xns" : "Gtk",
            "items" : [
             {
-             "* pack" : "set_image",
              "xtype" : "Image",
              "utf8 icon_name" : "dialog-information",
+             "* pack" : "set_image",
              "$ xns" : "Gtk"
             }
            ]
index 26091ee..922a972 100644 (file)
@@ -1,6 +1,6 @@
 static Xcls_MainWindow  _MainWindow;
 
-public class Xcls_MainWindow : Object 
+public class Xcls_MainWindow : Object
 {
     public Gtk.Window el;
     private Xcls_MainWindow  _this;
@@ -48,7 +48,7 @@ public class Xcls_MainWindow : Object
     public int no_windows;
     public WindowState windowstate;
 
-    // ctor 
+    // ctor
     public Xcls_MainWindow()
     {
         _this = this;
@@ -71,11 +71,11 @@ public class Xcls_MainWindow : Object
         child_1.ref();
         this.el.add (  child_1.el  );
 
-        // init method 
+        // init method
 
         //this.el.show_all();
 
-        // listeners 
+        //listeners
         this.el.delete_event.connect( (   event) => {
             return false;
         });
@@ -105,7 +105,7 @@ public class Xcls_MainWindow : Object
         });
     }
 
-    // user defined functions 
+    // user defined functions
     public        void initChildren () {
         // this needs putting in a better place..
         this.windowstate = new WindowState(this);
@@ -130,7 +130,7 @@ public class Xcls_MainWindow : Object
     public             void setTitle (string str) {
         this.headerbar.el.set_title(this.title + " - " + str);
     }
-    public class Xcls_headerbar : Object 
+    public class Xcls_headerbar : Object
     {
         public Gtk.HeaderBar el;
         private Xcls_MainWindow  _this;
@@ -138,7 +138,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_headerbar(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -150,26 +150,26 @@ public class Xcls_MainWindow : Object
             // set gobject values
             this.el.title = "Application Builder";
             this.el.show_close_button = true;
-            var child_0 = new Xcls_HBox3( _this );
+            var child_0 = new Xcls_Box3( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_HBox3 : Object 
+    public class Xcls_Box3 : Object
     {
-        public Gtk.HBox el;
+        public Gtk.Box el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_HBox3(Xcls_MainWindow _owner )
+        // ctor
+        public Xcls_Box3(Xcls_MainWindow _owner )
         {
             _this = _owner;
-            this.el = new Gtk.HBox( true, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
 
             // my vars (dec)
 
@@ -179,9 +179,9 @@ public class Xcls_MainWindow : Object
             this.el.add (  child_0.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuButton4 : Object 
+    public class Xcls_MenuButton4 : Object
     {
         public Gtk.MenuButton el;
         private Xcls_MainWindow  _this;
@@ -189,7 +189,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuButton4(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -207,9 +207,9 @@ public class Xcls_MainWindow : Object
             this.el.set_image (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_topbarmenu : Object 
+    public class Xcls_topbarmenu : Object
     {
         public Gtk.Menu el;
         private Xcls_MainWindow  _this;
@@ -217,7 +217,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_topbarmenu(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -240,16 +240,16 @@ public class Xcls_MainWindow : Object
             child_3.ref();
             this.el.append (  child_3.el  );
 
-            // init method 
+            // init method
 
             {
                 this.el.show_all();
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem6 : Object 
+    public class Xcls_MenuItem6 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_MainWindow  _this;
@@ -257,7 +257,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem6(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -268,7 +268,7 @@ public class Xcls_MainWindow : Object
             // set gobject values
             this.el.label = "Open a new Window";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) => {
                     Xcls_MainWindow.singleton().no_windows++;
                     var w = new Xcls_MainWindow();
@@ -280,9 +280,10 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_SeparatorMenuItem7 : Object 
+
+    public class Xcls_SeparatorMenuItem7 : Object
     {
         public Gtk.SeparatorMenuItem el;
         private Xcls_MainWindow  _this;
@@ -290,7 +291,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_SeparatorMenuItem7(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -301,9 +302,10 @@ public class Xcls_MainWindow : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem8 : Object 
+
+    public class Xcls_MenuItem8 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_MainWindow  _this;
@@ -311,7 +313,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem8(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -322,15 +324,16 @@ public class Xcls_MainWindow : Object
             // set gobject values
             this.el.label = "Download updated Resources";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) => {
                      Resources.singleton().fetchStart();
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem9 : Object 
+
+    public class Xcls_MenuItem9 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_MainWindow  _this;
@@ -338,7 +341,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem9(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -349,15 +352,17 @@ public class Xcls_MainWindow : Object
             // set gobject values
             this.el.label = "About the Builder";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( () => {
                 About.singleton().el.show();
                 });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image10 : Object 
+
+
+    public class Xcls_Image10 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -365,7 +370,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image10(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -377,51 +382,56 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "help-about";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_vbox : Object 
+
+
+
+
+    public class Xcls_vbox : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_vbox(Xcls_MainWindow _owner )
         {
             _this = _owner;
             _this.vbox = this;
-            this.el = new Gtk.VBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
+            this.el.homogeneous = false;
             var child_0 = new Xcls_mainpane( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , true,true,0 );
-            var child_1 = new Xcls_HBox66( _this );
+            var child_1 = new Xcls_Box66( _this );
             child_1.ref();
             this.el.pack_end (  child_1.el , false,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_mainpane : Object 
+    public class Xcls_mainpane : Object
     {
-        public Gtk.HPaned el;
+        public Gtk.Paned el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
         public int lastWidth;
 
-        // ctor 
+        // ctor
         public Xcls_mainpane(Xcls_MainWindow _owner )
         {
             _this = _owner;
             _this.mainpane = this;
-            this.el = new Gtk.HPaned();
+            this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
 
             // my vars (dec)
             this.lastWidth = 0;
@@ -431,52 +441,52 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_leftpane( _this );
             child_0.ref();
             this.el.add1 (  child_0.el  );
-            var child_1 = new Xcls_VBox17( _this );
+            var child_1 = new Xcls_Box17( _this );
             child_1.ref();
             this.el.add2 (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_leftpane : Object 
+    public class Xcls_leftpane : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_leftpane(Xcls_MainWindow _owner )
         {
             _this = _owner;
             _this.leftpane = this;
-            this.el = new Gtk.VBox( true, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
             var child_0 = new Xcls_editpane( _this );
             child_0.ref();
-            this.el.pack_start (  child_0.el , false,true,0 );
+            this.el.pack_start (  child_0.el , true,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_editpane : Object 
+    public class Xcls_editpane : Object
     {
-        public Gtk.VPaned el;
+        public Gtk.Paned el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_editpane(Xcls_MainWindow _owner )
         {
             _this = _owner;
             _this.editpane = this;
-            this.el = new Gtk.VPaned();
+            this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL );
 
             // my vars (dec)
 
@@ -489,65 +499,69 @@ public class Xcls_MainWindow : Object
             this.el.add2 (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_tree : Object 
+    public class Xcls_tree : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_tree(Xcls_MainWindow _owner )
         {
             _this = _owner;
             _this.tree = this;
-            this.el = new Gtk.VBox( true, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_props : Object 
+
+    public class Xcls_props : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_props(Xcls_MainWindow _owner )
         {
             _this = _owner;
             _this.props = this;
-            this.el = new Gtk.VBox( true, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_VBox17 : Object 
+
+
+
+    public class Xcls_Box17 : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_VBox17(Xcls_MainWindow _owner )
+        // ctor
+        public Xcls_Box17(Xcls_MainWindow _owner )
         {
             _this = _owner;
-            this.el = new Gtk.VBox( true, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
@@ -557,9 +571,9 @@ public class Xcls_MainWindow : Object
             this.el.pack_start (  child_0.el , true,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_clutterembed : Object 
+    public class Xcls_clutterembed : Object
     {
         public GtkClutter.Embed el;
         private Xcls_MainWindow  _this;
@@ -567,7 +581,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_clutterembed(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -596,12 +610,12 @@ public class Xcls_MainWindow : Object
             child_5.ref();
             this.el.get_stage().add_child (  child_5.el  );
 
-            // init method 
+            // init method
 
             var stage = this.el.get_stage();
                 stage.set_background_color(  Clutter.Color.from_string("#000"));
 
-            // listeners 
+            //listeners
             this.el.size_allocate.connect( (  alloc) => {
                 if (_this.windowstate == null) {
                     return;
@@ -611,9 +625,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_rooview : Object 
+    public class Xcls_rooview : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -621,7 +635,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_rooview(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -632,7 +646,7 @@ public class Xcls_MainWindow : Object
 
             // set gobject values
 
-            // init method 
+            // init method
 
             {
                
@@ -654,9 +668,10 @@ public class Xcls_MainWindow : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_objectview : Object 
+
+    public class Xcls_objectview : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -664,7 +679,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_objectview(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -675,7 +690,7 @@ public class Xcls_MainWindow : Object
 
             // set gobject values
 
-            // init method 
+            // init method
 
             {
                
@@ -699,9 +714,10 @@ public class Xcls_MainWindow : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_codeeditview : Object 
+
+    public class Xcls_codeeditview : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -709,7 +725,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_codeeditview(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -720,7 +736,7 @@ public class Xcls_MainWindow : Object
 
             // set gobject values
 
-            // init method 
+            // init method
 
             {
                
@@ -744,9 +760,10 @@ public class Xcls_MainWindow : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_addpropsview : Object 
+
+    public class Xcls_addpropsview : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -754,7 +771,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_addpropsview(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -765,7 +782,7 @@ public class Xcls_MainWindow : Object
 
             // set gobject values
 
-            // init method 
+            // init method
 
             {
                
@@ -789,9 +806,10 @@ public class Xcls_MainWindow : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_projecteditview : Object 
+
+    public class Xcls_projecteditview : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -799,7 +817,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_projecteditview(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -810,7 +828,7 @@ public class Xcls_MainWindow : Object
 
             // set gobject values
 
-            // init method 
+            // init method
 
             {
                
@@ -832,9 +850,10 @@ public class Xcls_MainWindow : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_buttonlayout : Object 
+
+    public class Xcls_buttonlayout : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -842,7 +861,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_buttonlayout(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -886,7 +905,7 @@ public class Xcls_MainWindow : Object
             child_10.ref();
             this.el.add_child (  child_10.el  );
 
-            // init method 
+            // init method
 
             {
                 
@@ -907,9 +926,9 @@ public class Xcls_MainWindow : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_BoxLayout25 : Object 
+    public class Xcls_BoxLayout25 : Object
     {
         public Clutter.BoxLayout el;
         private Xcls_MainWindow  _this;
@@ -917,7 +936,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_BoxLayout25(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -929,9 +948,10 @@ public class Xcls_MainWindow : Object
             this.el.orientation = Clutter.Orientation.VERTICAL;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_backbutton : Object 
+
+    public class Xcls_backbutton : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -939,7 +959,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_backbutton(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -953,14 +973,14 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.add_child (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_size(50,50);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Actor27 : Object 
+    public class Xcls_Actor27 : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -968,7 +988,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Actor27(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -980,14 +1000,14 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Button28( _this );
             child_0.ref();
 
-            // init method 
+            // init method
 
             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button28 : Object 
+    public class Xcls_Button28 : Object
     {
         public Gtk.Button el;
         private Xcls_MainWindow  _this;
@@ -995,7 +1015,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button28(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1011,7 +1031,7 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) => {
               
                 _this.windowstate.switchState(WindowState.State.PREVIEW);
@@ -1020,9 +1040,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image29 : Object 
+    public class Xcls_Image29 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -1030,7 +1050,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image29(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1042,9 +1062,13 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "go-previous";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_projectbutton : Object 
+
+
+
+
+    public class Xcls_projectbutton : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1052,7 +1076,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_projectbutton(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1066,14 +1090,14 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.add_child (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_size(50,50);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Actor31 : Object 
+    public class Xcls_Actor31 : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1081,7 +1105,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Actor31(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1093,14 +1117,14 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Button32( _this );
             child_0.ref();
 
-            // init method 
+            // init method
 
             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button32 : Object 
+    public class Xcls_Button32 : Object
     {
         public Gtk.Button el;
         private Xcls_MainWindow  _this;
@@ -1108,7 +1132,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button32(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1123,7 +1147,7 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) => {
                _this.windowstate.switchState(WindowState.State.FILES);
                   
@@ -1131,9 +1155,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image33 : Object 
+    public class Xcls_Image33 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -1141,7 +1165,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image33(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1153,9 +1177,13 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "document-open";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_editfilebutton : Object 
+
+
+
+
+    public class Xcls_editfilebutton : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1163,7 +1191,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_editfilebutton(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1177,14 +1205,14 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.add_child (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_size(50.0f,50.0f);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Actor35 : Object 
+    public class Xcls_Actor35 : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1192,7 +1220,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Actor35(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1204,14 +1232,14 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Button36( _this );
             child_0.ref();
 
-            // init method 
+            // init method
 
             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button36 : Object 
+    public class Xcls_Button36 : Object
     {
         public Gtk.Button el;
         private Xcls_MainWindow  _this;
@@ -1219,7 +1247,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button36(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1235,7 +1263,7 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) => {
               
                 // create a new file in project..
@@ -1252,9 +1280,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image37 : Object 
+    public class Xcls_Image37 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -1262,7 +1290,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image37(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1274,9 +1302,13 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "document-properties";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_projecteditbutton : Object 
+
+
+
+
+    public class Xcls_projecteditbutton : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1284,7 +1316,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_projecteditbutton(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1298,14 +1330,14 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.add_child (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_size(50,50);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Actor39 : Object 
+    public class Xcls_Actor39 : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1313,7 +1345,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Actor39(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1325,14 +1357,14 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Button40( _this );
             child_0.ref();
 
-            // init method 
+            // init method
 
             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button40 : Object 
+    public class Xcls_Button40 : Object
     {
         public Gtk.Button el;
         private Xcls_MainWindow  _this;
@@ -1340,7 +1372,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button40(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1356,7 +1388,7 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) => {
                  _this.windowstate.switchState(WindowState.State.PROJECT);
                
@@ -1365,9 +1397,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image41 : Object 
+    public class Xcls_Image41 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -1375,7 +1407,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image41(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1387,9 +1419,13 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "emblem-system";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_objectshowbutton : Object 
+
+
+
+
+    public class Xcls_objectshowbutton : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1397,7 +1433,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_objectshowbutton(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1411,24 +1447,24 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.add_child (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_size(50,50);
 
-            // listeners 
+            //listeners
             this.el.enter_event.connect( (  event)  => {
-                this.el.background_color = new Clutter.Color.from_string("#333");
+                this.el.background_color =   Clutter.Color.from_string("#333");
                     return false;
             });
             this.el.leave_event.connect( (  event)  => {
-                this.el.background_color = new Clutter.Color.from_string("#000");
+                this.el.background_color =   Clutter.Color.from_string("#000");
                 return false;
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Actor43 : Object 
+    public class Xcls_Actor43 : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1436,7 +1472,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Actor43(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1448,14 +1484,14 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Button44( _this );
             child_0.ref();
 
-            // init method 
+            // init method
 
             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button44 : Object 
+    public class Xcls_Button44 : Object
     {
         public Gtk.Button el;
         private Xcls_MainWindow  _this;
@@ -1463,7 +1499,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button44(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1479,7 +1515,7 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) => {
                 
                  _this.windowstate.switchState(WindowState.State.OBJECT);
@@ -1488,9 +1524,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image45 : Object 
+    public class Xcls_Image45 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -1498,7 +1534,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image45(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1510,9 +1546,13 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "list-add";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_addpropbutton : Object 
+
+
+
+
+    public class Xcls_addpropbutton : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1520,7 +1560,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_addpropbutton(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1534,14 +1574,14 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.add_child (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_size(50,50);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Actor47 : Object 
+    public class Xcls_Actor47 : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1549,7 +1589,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Actor47(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1561,14 +1601,14 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Button48( _this );
             child_0.ref();
 
-            // init method 
+            // init method
 
             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button48 : Object 
+    public class Xcls_Button48 : Object
     {
         public Gtk.Button el;
         private Xcls_MainWindow  _this;
@@ -1576,7 +1616,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button48(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1592,7 +1632,7 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) => {
                 
                  _this.windowstate.switchState(WindowState.State.PROP);
@@ -1601,9 +1641,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image49 : Object 
+    public class Xcls_Image49 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -1611,7 +1651,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image49(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1623,9 +1663,13 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "format-justify-left";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_addlistenerbutton : Object 
+
+
+
+
+    public class Xcls_addlistenerbutton : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1633,7 +1677,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_addlistenerbutton(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1647,14 +1691,14 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.add_child (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_size(50,50);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Actor51 : Object 
+    public class Xcls_Actor51 : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1662,7 +1706,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Actor51(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1674,14 +1718,14 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Button52( _this );
             child_0.ref();
 
-            // init method 
+            // init method
 
             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button52 : Object 
+    public class Xcls_Button52 : Object
     {
         public Gtk.Button el;
         private Xcls_MainWindow  _this;
@@ -1689,7 +1733,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button52(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1705,7 +1749,7 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) => {
                 
                 _this.windowstate.switchState(WindowState.State.LISTENER);
@@ -1715,9 +1759,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image53 : Object 
+    public class Xcls_Image53 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -1725,7 +1769,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image53(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1737,9 +1781,13 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "appointment-new";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_addprojectbutton : Object 
+
+
+
+
+    public class Xcls_addprojectbutton : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1747,7 +1795,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_addprojectbutton(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1761,14 +1809,14 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.add_child (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_size(50.0f,50.0f);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Actor55 : Object 
+    public class Xcls_Actor55 : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1776,7 +1824,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Actor55(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1788,14 +1836,14 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Button56( _this );
             child_0.ref();
 
-            // init method 
+            // init method
 
             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button56 : Object 
+    public class Xcls_Button56 : Object
     {
         public Gtk.Button el;
         private Xcls_MainWindow  _this;
@@ -1803,7 +1851,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button56(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1819,12 +1867,12 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) => {
               
                 // create a new file in project..
                 //Xcls_DialogNewComponent.singleton().show(
-               var  pe =     Xcls_EditProject.singleton();
+               var  pe =      EditProject.singleton();
                 pe.el.set_transient_for(_this.el);
                 pe.el.set_modal(true);   
                
@@ -1844,9 +1892,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image57 : Object 
+    public class Xcls_Image57 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -1854,7 +1902,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image57(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1866,9 +1914,13 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "folder-new";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_addfilebutton : Object 
+
+
+
+
+    public class Xcls_addfilebutton : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1876,7 +1928,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_addfilebutton(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1890,14 +1942,14 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.add_child (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_size(50.0f,50.0f);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Actor59 : Object 
+    public class Xcls_Actor59 : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -1905,7 +1957,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Actor59(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1917,14 +1969,14 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Button60( _this );
             child_0.ref();
 
-            // init method 
+            // init method
 
             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button60 : Object 
+    public class Xcls_Button60 : Object
     {
         public Gtk.Button el;
         private Xcls_MainWindow  _this;
@@ -1932,7 +1984,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button60(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1948,7 +2000,7 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( () => {
                 // create a new file in project..
                 
@@ -1973,9 +2025,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image61 : Object 
+    public class Xcls_Image61 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -1983,7 +2035,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image61(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -1995,9 +2047,13 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "document-new";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_delprojectbutton : Object 
+
+
+
+
+    public class Xcls_delprojectbutton : Object
     {
         public Clutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -2005,7 +2061,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_delprojectbutton(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2019,14 +2075,14 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.add_child (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_size(50,50);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Actor63 : Object 
+    public class Xcls_Actor63 : Object
     {
         public GtkClutter.Actor el;
         private Xcls_MainWindow  _this;
@@ -2034,7 +2090,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Actor63(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2046,14 +2102,14 @@ public class Xcls_MainWindow : Object
             var child_0 = new Xcls_Button64( _this );
             child_0.ref();
 
-            // init method 
+            // init method
 
             ((Gtk.Container)(this.el.get_widget())).add ( child_0.el);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button64 : Object 
+    public class Xcls_Button64 : Object
     {
         public Gtk.Button el;
         private Xcls_MainWindow  _this;
@@ -2061,7 +2117,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button64(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2077,7 +2133,7 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) => {
                  
                  var cd = DialogConfirm.singleton();
@@ -2108,9 +2164,9 @@ public class Xcls_MainWindow : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image65 : Object 
+    public class Xcls_Image65 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -2118,7 +2174,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image65(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2130,25 +2186,34 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "user-trash";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_HBox66 : Object 
+
+
+
+
+
+
+
+
+    public class Xcls_Box66 : Object
     {
-        public Gtk.HBox el;
+        public Gtk.Box el;
         private Xcls_MainWindow  _this;
 
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_HBox66(Xcls_MainWindow _owner )
+        // ctor
+        public Xcls_Box66(Xcls_MainWindow _owner )
         {
             _this = _owner;
-            this.el = new Gtk.HBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
+            this.el.homogeneous = false;
             var child_0 = new Xcls_Label67( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , true,true,0 );
@@ -2160,9 +2225,9 @@ public class Xcls_MainWindow : Object
             this.el.pack_end (  child_2.el , false,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label67 : Object 
+    public class Xcls_Label67 : Object
     {
         public Gtk.Label el;
         private Xcls_MainWindow  _this;
@@ -2170,7 +2235,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label67(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2181,9 +2246,10 @@ public class Xcls_MainWindow : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_statusbar : Object 
+
+    public class Xcls_statusbar : Object
     {
         public Gtk.ProgressBar el;
         private Xcls_MainWindow  _this;
@@ -2192,7 +2258,7 @@ public class Xcls_MainWindow : Object
             // my vars (def)
         public ulong handler_id;
 
-        // ctor 
+        // ctor
         public Xcls_statusbar(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2205,7 +2271,7 @@ public class Xcls_MainWindow : Object
             // set gobject values
             this.el.show_text = true;
 
-            // init method 
+            // init method
 
             {
                  this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
@@ -2224,9 +2290,10 @@ public class Xcls_MainWindow : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuBar69 : Object 
+
+    public class Xcls_MenuBar69 : Object
     {
         public Gtk.MenuBar el;
         private Xcls_MainWindow  _this;
@@ -2234,7 +2301,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuBar69(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2257,9 +2324,9 @@ public class Xcls_MainWindow : Object
             this.el.add (  child_3.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem70 : Object 
+    public class Xcls_MenuItem70 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_MainWindow  _this;
@@ -2267,7 +2334,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem70(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2279,9 +2346,10 @@ public class Xcls_MainWindow : Object
             this.el.label = "Compile Status:";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_statusbar_errors : Object 
+
+    public class Xcls_statusbar_errors : Object
     {
         public Gtk.ImageMenuItem el;
         private Xcls_MainWindow  _this;
@@ -2291,7 +2359,7 @@ public class Xcls_MainWindow : Object
         public Xcls_ValaCompileErrors popup;
         public Json.Object notices;
 
-        // ctor 
+        // ctor
         public Xcls_statusbar_errors(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2308,33 +2376,20 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.button_press_event.connect( () => {
                 if (this.popup == null) {
                     this.popup = new Xcls_ValaCompileErrors();
                     this.popup.window = _this;
                 }
-                if (_this.statusbar_warnings.popup != null && _this.statusbar_warnings.popup.active) {
-                    _this.statusbar_warnings.popup.active = false;
-                    _this.statusbar_warnings.popup.el.hide();
-                }
-                if (_this.statusbar_depricated.popup != null && _this.statusbar_depricated.popup.active) {
-                    _this.statusbar_depricated.popup.active = false;
-                    _this.statusbar_depricated.popup.el.hide();
-                }
-                
-                if (this.popup.active) {
-                    this.popup.active = false;
-                    this.popup.el.hide();
-                    return true;
-                }
+               
                 
                 this.popup.show(this.notices, this.el);
                 return true;
             });
         }
 
-        // user defined functions 
+        // user defined functions
         public void setNotices (Json.Object nots, int qty) {
             this.el.show();
             this.el.label = qty.to_string() + " Errors";
@@ -2342,7 +2397,7 @@ public class Xcls_MainWindow : Object
         
         }
     }
-    public class Xcls_Image72 : Object 
+    public class Xcls_Image72 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -2350,7 +2405,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image72(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2362,9 +2417,11 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "dialog-error";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_statusbar_warnings : Object 
+
+
+    public class Xcls_statusbar_warnings : Object
     {
         public Gtk.ImageMenuItem el;
         private Xcls_MainWindow  _this;
@@ -2374,7 +2431,7 @@ public class Xcls_MainWindow : Object
         public Xcls_ValaCompileErrors popup;
         public Json.Object notices;
 
-        // ctor 
+        // ctor
         public Xcls_statusbar_warnings(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2391,33 +2448,19 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.button_press_event.connect( () => {
                 if (this.popup == null) {
                     this.popup = new Xcls_ValaCompileErrors();
                     this.popup.window = _this;
                 }
                 
-                if (_this.statusbar_errors.popup != null && _this.statusbar_errors.popup.active) {
-                    _this.statusbar_errors.popup.active = false;
-                    _this.statusbar_errors.popup.el.hide();
-                }
-                if (_this.statusbar_depricated.popup != null && _this.statusbar_depricated.popup.active) {
-                    _this.statusbar_depricated.popup.active = false;
-                    _this.statusbar_depricated.popup.el.hide();
-                }
-                
-                if (this.popup.active) {
-                    this.popup.active = false;
-                    this.popup.el.hide();
-                    return true;
-                }
                 this.popup.show(this.notices, this.el);
                 return true;
             });
         }
 
-        // user defined functions 
+        // user defined functions
         public void setNotices (Json.Object nots, int qty) {
             this.el.show();
             this.el.label = qty.to_string() + " Warnings";
@@ -2425,7 +2468,7 @@ public class Xcls_MainWindow : Object
         
         }
     }
-    public class Xcls_Image74 : Object 
+    public class Xcls_Image74 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -2433,7 +2476,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image74(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2445,9 +2488,11 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "dialog-warning";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_statusbar_depricated : Object 
+
+
+    public class Xcls_statusbar_depricated : Object
     {
         public Gtk.ImageMenuItem el;
         private Xcls_MainWindow  _this;
@@ -2457,7 +2502,7 @@ public class Xcls_MainWindow : Object
         public Xcls_ValaCompileErrors popup;
         public Json.Object notices;
 
-        // ctor 
+        // ctor
         public Xcls_statusbar_depricated(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2474,33 +2519,20 @@ public class Xcls_MainWindow : Object
             child_0.ref();
             this.el.set_image (  child_0.el  );
 
-            // listeners 
+            //listeners
             this.el.button_press_event.connect( () => {
                 if (this.popup == null) {
                     this.popup = new Xcls_ValaCompileErrors();
                     this.popup.window = _this;
                 }
                 
-                if (_this.statusbar_errors.popup != null && _this.statusbar_errors.popup.active) {
-                    _this.statusbar_errors.popup.active = false;
-                    _this.statusbar_errors.popup.el.hide();
-                }
-                if (_this.statusbar_warnings.popup != null && _this.statusbar_warnings.popup.active) {
-                    _this.statusbar_warnings.popup.active = false;
-                    _this.statusbar_warnings.popup.el.hide();
-                }
                 
-                if (this.popup.active) {
-                    this.popup.active = false;
-                    this.popup.el.hide();
-                    return true;
-                }
                 this.popup.show(this.notices, this.el);
                 return true;
             });
         }
 
-        // user defined functions 
+        // user defined functions
         public void setNotices (Json.Object nots, int qty) {
             this.el.show();
             this.el.label = qty.to_string() + " Depricated";
@@ -2508,7 +2540,7 @@ public class Xcls_MainWindow : Object
         
         }
     }
-    public class Xcls_Image76 : Object 
+    public class Xcls_Image76 : Object
     {
         public Gtk.Image el;
         private Xcls_MainWindow  _this;
@@ -2516,7 +2548,7 @@ public class Xcls_MainWindow : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image76(Xcls_MainWindow _owner )
         {
             _this = _owner;
@@ -2528,6 +2560,11 @@ public class Xcls_MainWindow : Object
             this.el.icon_name = "dialog-information";
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
+
+
+
+
 }
index 10bc821..0103ce0 100644 (file)
@@ -9,11 +9,11 @@
  "items" : [
   {
    "listeners" : {
-    "closed" : "() => {\n  if (!this.done) {\n    _this.el.show();\n  \n  }\n}"
+    "closed" : "() => {\n  if (!this.done) {\n    _this.el.show();\n  \n  }\n} "
    },
    "|   void updateFileFromEntry" : "() {\n\n        _this.file.title = _this.title.el.get_text();\n        _this.file.region = _this.region.el.get_text();            \n        _this.file.parent = _this.parent.el.get_text();                        \n        _this.file.permname = _this.permname.el.get_text();                                    \n        _this.file.modOrder = _this.modOrder.el.get_text();\n        \n        if (_this.file.name.length  > 0 && _this.file.name != _this.name.el.get_text()) {\n            _this.file.renameTo(_this.name.el.get_text());\n        }\n        // store the module...\n        _this.file.build_module = \"\";        \n         Gtk.TreeIter iter; \n        if (_this.build_module.el.get_active_iter (out iter)) {\n             Value vfname;\n             this.dbmodel.el.get_value (iter, 0, out vfname);\n             if (((string)vfname).length > 0) {\n                 _this.file.build_module = (string)vfname;\n             }\n    \n        }\n        \n        \n\n                                                    \n}    ",
-   "id" : "PopoverFileDetails",
    "@ void success" : "(Project.Project pr, JsRender.JsRender file)",
+   "id" : "PopoverFileDetails",
    "| void show" : "(JsRender.JsRender c, Gtk.Widget btn) \n{\n    this.project = c.project;\n    this.done = false;\n    \n    \n    //if (!this.el) {\n        //this.init();\n     //}\n    \n    _this.name.el.set_text(c.name);\n    _this.title.el.set_text(c.title);\n    _this.parent.el.set_text(c.parent);    \n    _this.region.el.set_text(c.region);\n    _this.modOrder.el.set_text(c.modOrder);\n     _this.permname.el.set_text(c.permname);\n    \n    if (c.path.length > 0) {\n    \n        this.save_btn.el.set_label(\"Save\");\n    } else {\n        this.save_btn.el.set_label(\"Create\");\n    }\n    \n     var ar = new Gee.ArrayList<string>();\n     _this.dbmodel.loadData(ar,\"\");\n    // load the modules... if relivant..\n    if (this.project.xtype == \"Gtk\") {\n        var p = (Project.Gtk)c.project;\n          var cg = p.compilegroups;\n\n        var iter = cg.map_iterator();\n       while(iter.next()) {\n            var key = iter.get_key();\n            if (key == \"_default_\") {\n                continue;\n            }\n            ar.add(key);\n        };\n        _this.dbmodel.loadData(ar, c.build_module);\n\n    }\n    \n     \n    _this.file = c;\n    //console.log('show all');\n   this.el.set_modal(true);\n    this.el.set_relative_to(btn);\n\n    this.el.set_position(Gtk.PositionType.RIGHT);\n    \n    // window + header?\n     print(\"SHOWALL - POPIP\\n\");\n    this.el.show_all();\n    this.name.el.grab_focus();\n    \n    //this.success = c.success;\n    \n    \n}",
    "bool done" : false,
    "# Project.Project project" : "",
    "items" : [
     {
      "bool homogeneous" : false,
+     "xtype" : "Box",
      "$ pack" : "add",
-     "xtype" : "VBox",
      "$ xns" : "Gtk",
+     "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
      "items" : [
       {
        "* pack" : "pack_start,false,true,0",
@@ -39,8 +40,8 @@
       },
       {
        "int margin_right" : 4,
-       "* pack" : "pack_start,false,false,4",
        "xtype" : "Table",
+       "* pack" : "pack_start,false,false,4",
        "uint row_spacing" : 2,
        "n_columns" : 2,
        "$ xns" : "Gtk",
@@ -83,8 +84,8 @@
         },
         {
          "label" : "Region",
-         "tooltip_text" : "center, north, south, east, west",
          "$ visible" : true,
+         "tooltip_text" : "center, north, south, east, west",
          "xalign" : 0.90000000000000002,
          "* pack" : "attach_defaults,0,1,2,3",
          "xtype" : "Label",
          "items" : [
           {
            "id" : "dbcellrenderer",
-           "* pack" : "pack_start,true",
            "xtype" : "CellRendererText",
+           "* pack" : "pack_start,true",
            "$ xns" : "Gtk"
           },
           {
            "id" : "dbmodel",
-           "* pack" : "set_model",
            "xtype" : "ListStore",
+           "* pack" : "set_model",
            "$ columns" : "typeof(string),typeof(string)",
            "n_columns" : 2,
            "$ xns" : "Gtk",
           "clicked" : " ( ) =>  { \n  \n\t \n\n\n        if (_this.name.el.get_text().length  < 1) {\n            StandardErrorDialog.show(\n                _this.mainwindow.el,\n                \"You have to set Component name \"\n            );\n             \n            return;\n        }\n        // what does this do?\n        \n        var isNew = _this.file.name.length  > 0 ? false : true;\n        /*\n        if (!isNew && this.file.name != _this.name.el.get_text()) {\n            Xcls_StandardErrorDialog.singleton().show(\n                this.el,\n                \"Sorry changing names does not work yet. \"\n            );\n             \n            return;\n        }\n        */\n         \n        \n      \n        // FIXME - this may be more complicated...\n        //for (var i in this.def) {\n        //    this.file[i] =  this.get(i).el.get_text();\n        //}\n\n        if (!isNew) {\n            try {\n                 _this.updateFileFromEntry();\n             } catch( JsRender.Error.RENAME_FILE_EXISTS er) {\n                  Xcls_StandardErrorDialog.singleton().show(\n                    _this.mainwindow.el,\n                    \"The name you used already exists \"\n                );\n                return;\n                 \n             }\n                                                        \n              _this.done = true;\n            _this.file.save();\n            _this.el.hide();\n            return;\n        }\n        var fn = _this.name.el.get_text();\n        var dir = _this.project.firstPath();\n       \n        if (GLib.FileUtils.test(dir + \"/\" + fn + \".bjs\", GLib.FileTest.EXISTS)) {\n            Xcls_StandardErrorDialog.singleton().show(\n                _this.mainwindow.el,\n                \"That file already exists\"\n            ); \n            return;\n        }\n       \n       var f =  JsRender.JsRender.factory(\n                _this.file.project.xtype,  \n                _this.file.project, \n                dir + \"/\" + fn + \".bjs\");\n\n        _this.file = f;\n        \n\n        \n        _this.updateFileFromEntry();\n        _this.file.save();\n        _this.file.project.addFile(_this.file);\n        \n\t \n        // what about .js ?\n       _this.done = true;\n        _this.el.hide();\n \n        \n        \n        _this.success(_this.project, _this.file);\n       \n}"
          },
          "id" : "save_btn",
-         "* pack" : "add",
          "xtype" : "Button",
+         "* pack" : "add",
          "string label" : "Save",
          "$ xns" : "Gtk"
         }
index 92a0bae..211416b 100644 (file)
@@ -1,6 +1,6 @@
 static Xcls_PopoverFileDetails  _PopoverFileDetails;
 
-public class Xcls_PopoverFileDetails : Object 
+public class Xcls_PopoverFileDetails : Object
 {
     public Gtk.Popover el;
     private Xcls_PopoverFileDetails  _this;
@@ -30,7 +30,7 @@ public class Xcls_PopoverFileDetails : Object
     public JsRender.JsRender file;
     public Xcls_MainWindow mainwindow;
 
-    // ctor 
+    // ctor
     public Xcls_PopoverFileDetails()
     {
         _this = this;
@@ -45,11 +45,11 @@ public class Xcls_PopoverFileDetails : Object
         this.el.border_width = 0;
         this.el.modal = true;
         this.el.position = Gtk.PositionType.RIGHT;
-        var child_0 = new Xcls_VBox2( _this );
+        var child_0 = new Xcls_Box2( _this );
         child_0.ref();
         this.el.add (  child_0.el  );
 
-        // listeners 
+        //listeners
         this.el.closed.connect( () => {
           if (!this.done) {
             _this.el.show();
@@ -58,7 +58,7 @@ public class Xcls_PopoverFileDetails : Object
         });
     }
 
-    // user defined functions 
+    // user defined functions
     public   void updateFileFromEntry () {
     
             _this.file.title = _this.title.el.get_text();
@@ -146,23 +146,24 @@ public class Xcls_PopoverFileDetails : Object
         
         
     }
-    public class Xcls_VBox2 : Object 
+    public class Xcls_Box2 : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private Xcls_PopoverFileDetails  _this;
 
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_VBox2(Xcls_PopoverFileDetails _owner )
+        // ctor
+        public Xcls_Box2(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
-            this.el = new Gtk.VBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
+            this.el.homogeneous = false;
             var child_0 = new Xcls_HeaderBar3( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,true,0 );
@@ -174,9 +175,9 @@ public class Xcls_PopoverFileDetails : Object
             this.el.pack_end (  child_2.el , false,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_HeaderBar3 : Object 
+    public class Xcls_HeaderBar3 : Object
     {
         public Gtk.HeaderBar el;
         private Xcls_PopoverFileDetails  _this;
@@ -184,7 +185,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_HeaderBar3(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -196,9 +197,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.title = "Add / Edit File";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Table4 : Object 
+
+    public class Xcls_Table4 : Object
     {
         public Gtk.Table el;
         private Xcls_PopoverFileDetails  _this;
@@ -206,7 +208,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Table4(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -262,9 +264,9 @@ public class Xcls_PopoverFileDetails : Object
             this.el.attach_defaults (  child_13.el , 1,2,6,7 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label5 : Object 
+    public class Xcls_Label5 : Object
     {
         public Gtk.Label el;
         private Xcls_PopoverFileDetails  _this;
@@ -272,7 +274,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label5(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -285,9 +287,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.xalign = 0.900000f;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_name : Object 
+
+    public class Xcls_name : Object
     {
         public Gtk.Entry el;
         private Xcls_PopoverFileDetails  _this;
@@ -295,7 +298,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_name(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -308,9 +311,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label7 : Object 
+
+    public class Xcls_Label7 : Object
     {
         public Gtk.Label el;
         private Xcls_PopoverFileDetails  _this;
@@ -318,7 +322,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label7(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -332,9 +336,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_title : Object 
+
+    public class Xcls_title : Object
     {
         public Gtk.Entry el;
         private Xcls_PopoverFileDetails  _this;
@@ -342,7 +347,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_title(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -355,9 +360,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label9 : Object 
+
+    public class Xcls_Label9 : Object
     {
         public Gtk.Label el;
         private Xcls_PopoverFileDetails  _this;
@@ -365,7 +371,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label9(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -380,9 +386,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_region : Object 
+
+    public class Xcls_region : Object
     {
         public Gtk.Entry el;
         private Xcls_PopoverFileDetails  _this;
@@ -390,7 +397,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_region(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -403,9 +410,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label11 : Object 
+
+    public class Xcls_Label11 : Object
     {
         public Gtk.Label el;
         private Xcls_PopoverFileDetails  _this;
@@ -413,7 +421,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label11(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -427,9 +435,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_parent : Object 
+
+    public class Xcls_parent : Object
     {
         public Gtk.Entry el;
         private Xcls_PopoverFileDetails  _this;
@@ -437,7 +446,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_parent(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -450,9 +459,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label13 : Object 
+
+    public class Xcls_Label13 : Object
     {
         public Gtk.Label el;
         private Xcls_PopoverFileDetails  _this;
@@ -460,7 +470,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label13(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -474,9 +484,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_permname : Object 
+
+    public class Xcls_permname : Object
     {
         public Gtk.Entry el;
         private Xcls_PopoverFileDetails  _this;
@@ -484,7 +495,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_permname(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -497,9 +508,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label15 : Object 
+
+    public class Xcls_Label15 : Object
     {
         public Gtk.Label el;
         private Xcls_PopoverFileDetails  _this;
@@ -507,7 +519,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label15(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -521,9 +533,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_modOrder : Object 
+
+    public class Xcls_modOrder : Object
     {
         public Gtk.Entry el;
         private Xcls_PopoverFileDetails  _this;
@@ -531,7 +544,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_modOrder(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -544,9 +557,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label17 : Object 
+
+    public class Xcls_Label17 : Object
     {
         public Gtk.Label el;
         private Xcls_PopoverFileDetails  _this;
@@ -554,7 +568,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label17(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -568,9 +582,10 @@ public class Xcls_PopoverFileDetails : Object
             this.el.visible = true;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_build_module : Object 
+
+    public class Xcls_build_module : Object
     {
         public Gtk.ComboBox el;
         private Xcls_PopoverFileDetails  _this;
@@ -578,7 +593,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_build_module(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -595,14 +610,14 @@ public class Xcls_PopoverFileDetails : Object
             child_1.ref();
             this.el.set_model (  child_1.el  );
 
-            // init method 
+            // init method
 
             this.el.add_attribute(_this.dbcellrenderer.el , "markup", 1 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_dbcellrenderer : Object 
+    public class Xcls_dbcellrenderer : Object
     {
         public Gtk.CellRendererText el;
         private Xcls_PopoverFileDetails  _this;
@@ -610,7 +625,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_dbcellrenderer(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -622,9 +637,10 @@ public class Xcls_PopoverFileDetails : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_dbmodel : Object 
+
+    public class Xcls_dbmodel : Object
     {
         public Gtk.ListStore el;
         private Xcls_PopoverFileDetails  _this;
@@ -632,7 +648,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_dbmodel(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -644,7 +660,7 @@ public class Xcls_PopoverFileDetails : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
         public void loadData (Gee.ArrayList<string> data, string cur) {
             this.el.clear();                                    
             Gtk.TreeIter iter;
@@ -680,7 +696,10 @@ public class Xcls_PopoverFileDetails : Object
                                              
         }
     }
-    public class Xcls_HButtonBox21 : Object 
+
+
+
+    public class Xcls_HButtonBox21 : Object
     {
         public Gtk.HButtonBox el;
         private Xcls_PopoverFileDetails  _this;
@@ -688,7 +707,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_HButtonBox21(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -708,9 +727,9 @@ public class Xcls_PopoverFileDetails : Object
             this.el.add (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button22 : Object 
+    public class Xcls_Button22 : Object
     {
         public Gtk.Button el;
         private Xcls_PopoverFileDetails  _this;
@@ -718,7 +737,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button22(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -729,7 +748,7 @@ public class Xcls_PopoverFileDetails : Object
             // set gobject values
             this.el.label = "Cancel";
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( () => { 
             
               _this.done = true;
@@ -737,9 +756,10 @@ public class Xcls_PopoverFileDetails : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_save_btn : Object 
+
+    public class Xcls_save_btn : Object
     {
         public Gtk.Button el;
         private Xcls_PopoverFileDetails  _this;
@@ -747,7 +767,7 @@ public class Xcls_PopoverFileDetails : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_save_btn(Xcls_PopoverFileDetails _owner )
         {
             _this = _owner;
@@ -759,7 +779,7 @@ public class Xcls_PopoverFileDetails : Object
             // set gobject values
             this.el.label = "Save";
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) =>  { 
               
                 
@@ -847,6 +867,9 @@ public class Xcls_PopoverFileDetails : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
+
+
 }
index 8616376..96d82e3 100644 (file)
@@ -1,64 +1,65 @@
 {
-    "id": "file-gtk-8",
-    "name": "RooProjectProperties",
-    "parent": "",
-    "title": false,
-    "path": "/home/alan/gitlive/app.Builder.js/Builder4/RooProjectProperties.bjs",
-    "items": [
+ "name" : "RooProjectProperties",
+ "parent" : "",
+ "title" : "",
+ "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/RooProjectProperties.bjs",
+ "permname" : "",
+ "modOrder" : "",
+ "build_module" : "",
+ "items" : [
+  {
+   "listeners" : {
+    "delete_event" : "  (self, event) => {\n    this.el.hide();\n     return true;\n}",
+    "response" : "  (self, response_id)  => {\n   //print(response_id);\n   if (response_id< 1 ) {\n      this.el.hide();\n    \n      return;\n   }\n   \n   var buf =    view.el.get_buffer();\n   Gtk.TextIter s;\n     Gtk.TextIter e;\n    buf.get_start_iter(out s);\n    buf.get_end_iter(out e);\n    var str = buf.get_text(s,e,true);\n    // ideally we should syntax check it.. but it's html!?\n    \n   //var project = this.get('/Window.LeftTree').getActiveFile().project;\n   \n   \n   _this.project.runhtml = str;\n   _this.project.save();\n   \n  // imports.Builder.Provider.ProjectManager.ProjectManager.saveConfig();\n//   print (str);\n   //    this.get('view').el.get_buffer().get_text(project.runjs, project.runjs.length);\n   // ok pressed..\n   this.el.hide();\n}"
+   },
+   "default_width" : 500,
+   "| void show" : " (Project.Project project) {\n    _this.project = project;\n    // get the active project.\n    \n    //print (project.fn);\n    //project.runhtml = project.runhtml || '';\n    _this.view.el.get_buffer().set_text(project.runhtml);\n    \n    this.el.show_all();\n}\n",
+   "# Project.Project project" : "",
+   "xtype" : "Dialog",
+   "$ modal" : true,
+   "$ xns" : "Gtk",
+   "items" : [
+    {
+     "$ pack" : " get_content_area().add\n",
+     "xtype" : "Box",
+     "$ xns" : "Gtk",
+     "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
+     "border_width" : 5,
+     "items" : [
+      {
+       "label" : "HTML To insert at end of <HEAD>",
+       "* pack" : "pack_start,false,false,0",
+       "xtype" : "Label",
+       "$ xns" : "Gtk"
+      },
+      {
+       "* pack" : "pack_end,true,true,0",
+       "xtype" : "ScrolledWindow",
+       "$ xns" : "Gtk",
+       "items" : [
         {
-            "listeners": {
-                "delete_event": "  (self, event) => {\n    this.el.hide();\n     return true;\n}",
-                "response": "  (self, response_id)  => {\n   //print(response_id);\n   if (response_id< 1 ) {\n      this.el.hide();\n    \n      return;\n   }\n   \n   var buf =    view.el.get_buffer();\n   Gtk.TextIter s;\n     Gtk.TextIter e;\n    buf.get_start_iter(out s);\n    buf.get_end_iter(out e);\n    var str = buf.get_text(s,e,true);\n    // ideally we should syntax check it.. but it's html!?\n    \n   //var project = this.get('/Window.LeftTree').getActiveFile().project;\n   \n   \n   _this.project.runhtml = str;\n   _this.project.save();\n   \n  // imports.Builder.Provider.ProjectManager.ProjectManager.saveConfig();\n//   print (str);\n   //    this.get('view').el.get_buffer().get_text(project.runjs, project.runjs.length);\n   // ok pressed..\n   this.el.hide();\n}"
-            },
-            ".Project.Project:project": "",
-            "default_width": 500,
-            "xtype": "Dialog",
-            "|modal": "true",
-            "|void:show": " (Project.Project project) {\n    _this.project = project;\n    // get the active project.\n    \n    //print (project.fn);\n    //project.runhtml = project.runhtml || '';\n    _this.view.el.get_buffer().set_text(project.runhtml);\n    \n    this.el.show_all();\n}\n",
-            "|xns": "Gtk",
-            "items": [
-                {
-                    "border_width": 5,
-                    "xtype": "VBox",
-                    "|pack": " get_content_area().add\n",
-                    "|xns": "Gtk",
-                    "items": [
-                        {
-                            "|xns": "Gtk",
-                            "xtype": "Label",
-                            "pack": "pack_start,false,false,0",
-                            "label": "HTML To insert at end of <HEAD>"
-                        },
-                        {
-                            "|xns": "Gtk",
-                            "xtype": "ScrolledWindow",
-                            "pack": "pack_end,true,true,0",
-                            "items": [
-                                {
-                                    "|xns": "Gtk",
-                                    "xtype": "SourceView",
-                                    "pack": "add",
-                                    "id": "view"
-                                }
-                            ]
-                        }
-                    ]
-                },
-                {
-                    "|xns": "Gtk",
-                    "xtype": "Button",
-                    "pack": "add_action_widget,1",
-                    "label": "OK"
-                },
-                {
-                    "|xns": "Gtk",
-                    "xtype": "Button",
-                    "pack": "add_action_widget,0",
-                    "label": "Cancel"
-                }
-            ]
+         "id" : "view",
+         "* pack" : "add",
+         "xtype" : "SourceView",
+         "$ xns" : "Gtk"
         }
-    ],
-    "permname": "",
-    "modOrder": ""
-}
+       ]
+      }
+     ]
+    },
+    {
+     "label" : "OK",
+     "* pack" : "add_action_widget,1",
+     "xtype" : "Button",
+     "$ xns" : "Gtk"
+    },
+    {
+     "label" : "Cancel",
+     "* pack" : "add_action_widget,0",
+     "xtype" : "Button",
+     "$ xns" : "Gtk"
+    }
+   ]
+  }
+ ]
+}
\ No newline at end of file
index 11f0155..b5842dd 100644 (file)
@@ -1,58 +1,49 @@
-/* -- to compile
-valac  --pkg gio-2.0  --pkg posix  --pkg gtk+-3.0 --pkg libnotify --pkg gtksourceview-3.0  --pkg  libwnck-3.0 \
-    /tmp/RooProjectProperties.vala  -o /tmp/RooProjectProperties
-*/
-
-
-/* -- to test class
-static int main (string[] args) {
-    Gtk.init (ref args);
-    new Xcls_RooProjectProperties();
-    RooProjectProperties.show_all();
-     Gtk.main ();
-    return 0;
-}
-*/
-
-
-public static Xcls_RooProjectProperties  RooProjectProperties;
+static RooProjectProperties  _RooProjectProperties;
 
-public class Xcls_RooProjectProperties
+public class RooProjectProperties : Object
 {
     public Gtk.Dialog el;
-    private static Xcls_RooProjectProperties  _this;
+    private RooProjectProperties  _this;
 
+    public static RooProjectProperties singleton()
+    {
+        if (_RooProjectProperties == null) {
+            _RooProjectProperties= new RooProjectProperties();
+        }
+        return _RooProjectProperties;
+    }
     public Xcls_view view;
 
-        // my vars
+        // my vars (def)
     public Project.Project project;
 
-        // ctor 
-    public Xcls_RooProjectProperties()
+    // ctor
+    public RooProjectProperties()
     {
-        this.el = new Gtk.Dialog();
         _this = this;
-        RooProjectProperties = this;
+        this.el = new Gtk.Dialog();
 
-        // my vars
+        // my vars (dec)
 
         // set gobject values
         this.el.default_width = 500;
         this.el.modal = true;
-        var child_0 = new Xcls_VBox2();
-        this.el. get_content_area().add
- (  child_0.el  );
-        var child_1 = new Xcls_Button6();
+        var child_0 = new Xcls_Box2( _this );
+        child_0.ref();
+        this.el.get_content_area().add (  child_0.el  );
+        var child_1 = new Xcls_Button6( _this );
+        child_1.ref();
         this.el.add_action_widget (  child_1.el , 1 );
-        var child_2 = new Xcls_Button7();
+        var child_2 = new Xcls_Button7( _this );
+        child_2.ref();
         this.el.add_action_widget (  child_2.el , 0 );
 
-        // listeners 
-        this.el.delete_event.connect(   (self, event) => {
+        //listeners
+        this.el.delete_event.connect( (self, event) => {
             this.el.hide();
              return true;
-        } );
-        this.el.response.connect(   (self, response_id)  => {
+        });
+        this.el.response.connect( (self, response_id)  => {
            //print(response_id);
            if (response_id< 1 ) {
               this.el.hide();
@@ -79,244 +70,163 @@ public class Xcls_RooProjectProperties
            //    this.get('view').el.get_buffer().get_text(project.runjs, project.runjs.length);
            // ok pressed..
            this.el.hide();
-        } );
+        });
     }
 
-    // userdefined functions 
-
-    // skip listeners - not pipe 
-
-    // skip .Project.Project:project - already used 
-
-    // skip default_width - already used 
-
-    // skip xtype - not pipe 
-
-    // skip |modal - already used 
+    // user defined functions
     public void show (Project.Project project) {
-            _this.project = project;
-            // get the active project.
-            
-            //print (project.fn);
-            //project.runhtml = project.runhtml || '';
-            _this.view.el.get_buffer().set_text(project.runhtml);
-            
-            this.el.show_all();
-        }
-
-    // skip |xns - no return type
-
-    // skip items - not pipe 
-
-    // skip id - not pipe 
-
-    // skip xvala_cls - not pipe 
-
-    // skip xvala_xcls - not pipe 
-
-    // skip xvala_id - not pipe 
-    public class Xcls_VBox2
+        _this.project = project;
+        // get the active project.
+        
+        //print (project.fn);
+        //project.runhtml = project.runhtml || '';
+        _this.view.el.get_buffer().set_text(project.runhtml);
+        
+        this.el.show_all();
+    }
+    public class Xcls_Box2 : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
+        private RooProjectProperties  _this;
+
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_VBox2()
+        // ctor
+        public Xcls_Box2(RooProjectProperties _owner )
         {
-            this.el = new Gtk.VBox( true, 0 );
+            _this = _owner;
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
             this.el.border_width = 5;
-            var child_0 = new Xcls_Label3();
+            var child_0 = new Xcls_Label3( _this );
+            child_0.ref();
             this.el.pack_start (  child_0.el , false,false,0 );
-            var child_1 = new Xcls_ScrolledWindow4();
+            var child_1 = new Xcls_ScrolledWindow4( _this );
+            child_1.ref();
             this.el.pack_end (  child_1.el , true,true,0 );
         }
 
-        // userdefined functions 
-
-        // skip border_width - already used 
-
-        // skip xtype - not pipe 
-
-        // skip |pack - already used 
-
-        // skip |xns - no return type
-
-        // skip items - not pipe 
-
-        // skip xvala_cls - not pipe 
-
-        // skip xvala_xcls - not pipe 
-
-        // skip xvala_id - not pipe 
+        // user defined functions
     }
-    public class Xcls_Label3
+    public class Xcls_Label3 : Object
     {
         public Gtk.Label el;
+        private RooProjectProperties  _this;
 
-            // my vars
 
-            // ctor 
-        public Xcls_Label3()
+            // my vars (def)
+
+        // ctor
+        public Xcls_Label3(RooProjectProperties _owner )
         {
+            _this = _owner;
             this.el = new Gtk.Label( "HTML To insert at end of <HEAD>" );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
-
-        // skip xtype - not pipe 
-
-        // skip pack - not pipe 
-
-        // skip label - already used 
-
-        // skip xvala_cls - not pipe 
-
-        // skip xvala_xcls - not pipe 
-
-        // skip xvala_id - not pipe 
+        // user defined functions
     }
-    public class Xcls_ScrolledWindow4
+
+    public class Xcls_ScrolledWindow4 : Object
     {
         public Gtk.ScrolledWindow el;
+        private RooProjectProperties  _this;
 
-            // my vars
 
-            // ctor 
-        public Xcls_ScrolledWindow4()
+            // my vars (def)
+
+        // ctor
+        public Xcls_ScrolledWindow4(RooProjectProperties _owner )
         {
+            _this = _owner;
             this.el = new Gtk.ScrolledWindow( null, null );
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_view();
+            var child_0 = new Xcls_view( _this );
+            child_0.ref();
             this.el.add (  child_0.el  );
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
-
-        // skip xtype - not pipe 
-
-        // skip pack - not pipe 
-
-        // skip items - not pipe 
-
-        // skip xvala_cls - not pipe 
-
-        // skip xvala_xcls - not pipe 
-
-        // skip xvala_id - not pipe 
+        // user defined functions
     }
-    public class Xcls_view
+    public class Xcls_view : Object
     {
         public Gtk.SourceView el;
+        private RooProjectProperties  _this;
+
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_view()
+        // ctor
+        public Xcls_view(RooProjectProperties _owner )
         {
-            this.el = new Gtk.SourceView();
+            _this = _owner;
             _this.view = this;
+            this.el = new Gtk.SourceView();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
-
-        // skip xtype - not pipe 
-
-        // skip pack - not pipe 
-
-        // skip id - not pipe 
+        // user defined functions
+    }
 
-        // skip xvala_cls - not pipe 
 
-        // skip xvala_xcls - not pipe 
 
-        // skip xvala_id - not pipe 
-    }
-    public class Xcls_Button6
+    public class Xcls_Button6 : Object
     {
         public Gtk.Button el;
+        private RooProjectProperties  _this;
+
 
-            // my vars
+            // my vars (def)
 
-            // ctor 
-        public Xcls_Button6()
+        // ctor
+        public Xcls_Button6(RooProjectProperties _owner )
         {
+            _this = _owner;
             this.el = new Gtk.Button();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
             this.el.label = "OK";
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
-
-        // skip xtype - not pipe 
-
-        // skip pack - not pipe 
-
-        // skip label - already used 
-
-        // skip xvala_cls - not pipe 
-
-        // skip xvala_xcls - not pipe 
-
-        // skip xvala_id - not pipe 
+        // user defined functions
     }
-    public class Xcls_Button7
+
+    public class Xcls_Button7 : Object
     {
         public Gtk.Button el;
+        private RooProjectProperties  _this;
 
-            // my vars
 
-            // ctor 
-        public Xcls_Button7()
+            // my vars (def)
+
+        // ctor
+        public Xcls_Button7(RooProjectProperties _owner )
         {
+            _this = _owner;
             this.el = new Gtk.Button();
 
-            // my vars
+            // my vars (dec)
 
             // set gobject values
             this.el.label = "Cancel";
         }
 
-        // userdefined functions 
-
-        // skip |xns - no return type
-
-        // skip xtype - not pipe 
-
-        // skip pack - not pipe 
-
-        // skip label - already used 
-
-        // skip xvala_cls - not pipe 
-
-        // skip xvala_xcls - not pipe 
-
-        // skip xvala_id - not pipe 
+        // user defined functions
     }
+
 }
index 7c35acc..b2df12c 100644 (file)
@@ -8,13 +8,10 @@
  "build_module" : "builder",
  "items" : [
   {
-   "listeners" : {
-    "closed" : "() => {\n    if (this.active) {\n        this.el.show();\n        return;\n    }\n   \n}"
-   },
    "int height_request" : 800,
    "id" : "ValaCompileErrors",
    "Xcls_MainWindow window" : "",
-   "| void show" : "(Json.Object tree, Gtk.Widget onbtn) {\n\n        \n        this.file = null;\n        this.notices = tree;\n        this.active = true;\n         //print(\"looking for %s\\n\", id);\n        // loop through parent childnre\n          \n        \n        var store = this.compile_result_store.el;    \n        \n        store.clear();\n     \n        \n        tree.foreach_member((obj, file, node) => {\n            // id line \"display text\", file\n            \n            var title = GLib.Path.get_basename(GLib.Path.get_dirname( file)) + \"/\" +  GLib.Path.get_basename( file) ;\n            Gtk.TreeIter iter;\n            print(\"Add file %s\", title);\n            store.append(out iter, null);\n            var lines = tree.get_object_member(file);\n            title += \" (\" + lines.get_size().to_string() + \")\";\n            store.set(iter, 0, file, 1, 0, 2, title, 3, file,-1);\n            \n            lines.foreach_member((obja, line, nodea) => {\n                var msg  = \"\";\n                var ar = lines.get_array_member(line);\n                for (var i = 0 ; i < ar.get_length(); i++) {\n    \t\t    msg += (msg.length > 0) ? \"\\n\" : \"\";\n    \t\t    msg += ar.get_string_element(i);\n\t        }\n                Gtk.TreeIter citer;  \n                print(\"Add line %s\", line);\n                store.append(out citer, iter);\n                store.set(citer, \n                    0, file + \":\" + line, \n                    1, int.parse(line), \n                    2, GLib.Markup.escape_text(line + \": \" + msg), \n                    3, file,-1);\n            \n            });\n            \n            \n        \n        });\n        \n    int w,h;\n    this.window.el.get_size(out w, out h);\n    \n    // left tree = 250, editor area = 500?\n    \n    var new_w = int.min(250, w-100);\n    if (new_w > (w-100)) {\n        new_w = w-100;\n    }\n    this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));\n\n    \n\n    if (this.el.relative_to == null) {\n        this.el.set_relative_to(onbtn);\n    }\n    this.el.show_all();\n    this.save_btn.el.hide();       \n    while(Gtk.events_pending()) { \n            Gtk.main_iteration();\n    }       \n    this.hpane.el.set_position( 0);\n}\n",
+   "| void show" : "(Json.Object tree, Gtk.Widget onbtn) {\n\n        \n        this.file = null;\n        this.notices = tree;\n       \n         //print(\"looking for %s\\n\", id);\n        // loop through parent childnre\n          \n        \n        var store = this.compile_result_store.el;    \n        \n        store.clear();\n     \n        \n        tree.foreach_member((obj, file, node) => {\n            // id line \"display text\", file\n            \n            var title = GLib.Path.get_basename(GLib.Path.get_dirname( file)) + \"/\" +  GLib.Path.get_basename( file) ;\n            Gtk.TreeIter iter;\n            print(\"Add file %s\", title);\n            store.append(out iter, null);\n            var lines = tree.get_object_member(file);\n            title += \" (\" + lines.get_size().to_string() + \")\";\n            store.set(iter, 0, file, 1, 0, 2, title, 3, file,-1);\n            \n            lines.foreach_member((obja, line, nodea) => {\n                var msg  = \"\";\n                var ar = lines.get_array_member(line);\n                for (var i = 0 ; i < ar.get_length(); i++) {\n    \t\t    msg += (msg.length > 0) ? \"\\n\" : \"\";\n    \t\t    msg += ar.get_string_element(i);\n\t        }\n                Gtk.TreeIter citer;  \n                print(\"Add line %s\", line);\n                store.append(out citer, iter);\n                store.set(citer, \n                    0, file + \":\" + line, \n                    1, int.parse(line), \n                    2, GLib.Markup.escape_text(line + \": \" + msg), \n                    3, file,-1);\n            \n            });\n            \n            \n        \n        });\n        \n    int w,h;\n    this.window.el.get_size(out w, out h);\n    \n    // left tree = 250, editor area = 500?\n    \n    var new_w = int.min(250, w-100);\n    if (new_w > (w-100)) {\n        new_w = w-100;\n    }\n    this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));\n\n    \n\n    if (this.el.relative_to == null) {\n        this.el.set_relative_to(onbtn);\n    }\n    this.el.show_all();\n   \n    while(Gtk.events_pending()) { \n            Gtk.main_iteration();\n    }       \n //   this.hpane.el.set_position( 0);\n}\n",
    "xtype" : "Popover",
    "Gtk.PositionType position" : "Gtk.PositionType.TOP",
    "bool active" : false,
    "$ xns" : "Gtk",
    "JsRender.JsRender? file" : "",
    "Json.Object notices" : "",
-   "bool modal" : false,
+   "bool modal" : true,
    "items" : [
     {
      "id" : "compile_view",
      "* pack" : "add",
-     "xtype" : "VBox",
+     "xtype" : "Box",
      "gboolean homogeneous" : false,
      "$ xns" : "Gtk",
+     "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
      "items" : [
       {
-       "xtype" : "HBox",
+       "xtype" : "Box",
        "* pack" : "pack_start,false,false,0",
        "$ xns" : "Gtk",
+       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
         {
          "* pack" : "pack_start,true,true,0",
          "xtype" : "Button",
          "$ xns" : "Gtk",
-         "utf8 label" : "Compile and Run"
-        },
-        {
-         "listeners" : {
-          "clicked" : "() => {\n    // is the file managed by the builder?\n    \n    var f = _this.sourceview.curfname;\n    \n    Regex regex = new Regex(\"\\\\.vala$\");\n\n    var bjsf = regex.replace(f,f.length , 0 , \".bjs\");\n    \n    var p = _this.window.project;\n    \n    \n    \n    var jsr = p.getByPath(bjsf);\n    if (jsr != null) {\n        _this.window.windowstate.fileViewOpen(jsr);\n        \n        return;\n    \n    }\n\n\n}"
-         },
-         "* pack" : "pack_start,true,true,0",
-         "xtype" : "Button",
-         "$ xns" : "Gtk",
-         "utf8 label" : "Edit"
-        },
-        {
-         "id" : "save_btn",
-         "* pack" : "pack_start,true,true,0",
-         "xtype" : "Button",
-         "$ xns" : "Gtk",
-         "utf8 label" : "Save",
-         "bool visible" : false
+         "utf8 label" : "Compile and Run "
         }
        ]
       },
       {
-       "id" : "hpane",
-       "* pack" : "pack_start,true,true,0",
-       "xtype" : "HPaned",
+       "* init" : "{\n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n\n}\n",
+       "* pack" : "pack_end,true,true,0",
+       "xtype" : "ScrolledWindow",
        "$ xns" : "Gtk",
        "items" : [
         {
-         "xtype" : "ScrolledWindow",
+         "listeners" : {
+          "button_press_event" : "  ( ev)  => {\n \n    Gtk.TreeViewColumn col;\n    int cell_x;\n    int cell_y;\n    Gtk.TreePath path;\n    if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {\n        print(\"nothing selected on click\");\n        \n        return false; //not on a element.\n    }\n    \n     \n     // right click.\n     if (ev.type != Gdk.EventType.2BUTTON_PRESS  || ev.button != 1  ) {    \n        // show popup!.   \n            \n         \n        return false;\n    }\n    Gtk.TreeIter iter;\n     var mod = _this.compile_result_store.el;\n    mod.get_iter (out iter, path);\n    \n     \n    \n    \n    \n    // var val = \"\";\n    GLib.Value value;\n    _this.compile_result_store.el.get_value(iter, 3, out value);\n    var fname = (string)value;\n    //GLib.Value lvalue;\n    //_this.compile_result_store.el.get_value(iter, 1, out lvalue);\n    //var line = (int) lvalue;\n    \n    \n   var  bjsf = \"\";\n    try {             \n       var  regex = new Regex(\"\\\\.vala$\");\n    \n     \n        bjsf = regex.replace(fname,fname.length , 0 , \".bjs\");\n     } catch (GLib.RegexError e) {\n        return false;\n    }   \n    var p = _this.window.project;\n        \n        \n        \n    var jsr = p.getByPath(bjsf);\n    if (jsr != null) {\n        _this.window.windowstate.fileViewOpen(jsr);\n        \n        return false;\n    \n    }\n    _this.window.windowstate.fileViewOpenPlain(fname);\n    \n    // try hiding the left nav..\n \n    return false;\n    \n  }\n    "
+         },
+         "id" : "compile_tree",
+         "* init" : "{\n var description = new Pango.FontDescription();\n    description.set_size(8000);\n    this.el.override_font(description);\n\n}\n",
          "* pack" : "add",
+         "xtype" : "TreeView",
          "$ xns" : "Gtk",
          "items" : [
           {
-           "gboolean show_line_marks" : true,
-           "id" : "sourceview",
-           "* init" : "{\n    this.curfname = \"\";\n       var description =   Pango.FontDescription.from_string(\"monospace\");\n    description.set_size(8000);\n    this.el.override_font(description);\n\n    var attrs = new Gtk.SourceMarkAttributes();\n    var  pink = new Gdk.RGBA();\n    pink.parse ( \"pink\");\n    attrs.set_background ( pink);\n    attrs.set_icon_name ( \"process-stop\");    \n    attrs.query_tooltip_text.connect(( mark) => {\n        //print(\"tooltip query? %s\\n\", mark.name);\n        return mark.name;\n    });\n    \n    this.el.set_mark_attributes (\"error\", attrs, 1);\n    \n}\n",
-           "| void loadFile" : "(string fname, int line ) {\n\n    \n    // resize the view...\n    \n    \n    //if (_this.hpane.el.get_position() < 1) {\n        // left tree = 250, editor area = 500?\n         int w,h;\n        _this.window.el.get_size(out w, out h);\n        \n        var new_w = int.min(750, w-100);\n        if (new_w > (w-100)) {\n            new_w = w-100;\n        }\n        _this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));\n        \n        // let it resize, then find out the new size..\n        while(Gtk.events_pending()) { \n            Gtk.main_iteration();\n        }\n        \n        _this.hpane.el.set_position( _this.hpane.el.max_position - 250);\n\n    //}\n\n    var buf = ((Gtk.SourceBuffer)(this.el.get_buffer()));\n      \n    if (this.curfname != fname) {\n        this.curfname = fname;\n        \n        \n        Regex regex = new Regex(\"\\\\.vala$\");\n\n        var bjsf = regex.replace(fname,fname.length , 0 , \".bjs\");\n        \n        var p = _this.window.project;\n        \n        var jsr = p.getByPath(bjsf);\n        \n        if (_this.file != null) {\n            // remove listeners from the file...\n        }\n        \n        _this.file = null;\n        \n        if (jsr != null) {\n            _this.file = jsr;\n            \n           // return;\n        \n        }\n        \n        \n        \n\n        Gtk.TextIter start;\n        Gtk.TextIter end;     \n        buf.get_bounds (out start, out end);\n            \n        buf.remove_source_marks (start, end, null);\n             \n         \n        \n        string str;\n        FileUtils.get_contents(fname, out str);\n\t\t\t\n        buf.set_text(str, str.length);\n        var lm = Gtk.SourceLanguageManager.get_default();\n        \n       \n        buf.set_language(lm.get_language(\"vala\"));\n     \n         \n        this.el.grab_focus();\n\n\n       \n        var lines = _this.notices.get_object_member(fname);\n         \n            \n        lines.foreach_member((obj, line, node) => {\n            \n                 Gtk.TextIter iter;\n        //        print(\"get inter\\n\");\n                var eline = int.parse(line) -1 ;\n                 \n                \n                buf.get_iter_at_line( out iter, eline);\n                //print(\"mark line\\n\");\n                var msg  = \"Line: %d\".printf(eline+1);\n                var ar = lines.get_array_member(line);\n                for (var i = 0 ; i < ar.get_length(); i++) {\n\t\t        msg += (msg.length > 0) ? \"\\n\" : \"\";\n\t\t        msg += ar.get_string_element(i);\n\t        }\n                \n                \n                buf.create_source_mark(msg, \"error\", iter);\n            } );\n    }\n    // jump to the line...\n    Gtk.TextIter liter;\n    buf.get_iter_at_line (out liter,  line);\n    print(\"Scroll to \\n\");\n    this.el.scroll_to_iter (liter, 0.0f, false, 0.0f, 0.5f);\n    print(\"End Scroll to \\n\");\n\n\n}\n",
-           "* pack" : "add",
-           "xtype" : "SourceView",
-           "$ xns" : "Gtk",
-           "gboolean show_line_numbers" : true,
-           "string curfname" : "",
-           "gboolean editable" : false
-          }
-         ]
-        },
-        {
-         "* init" : "{\n this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n\n}\n",
-         "xtype" : "ScrolledWindow",
-         "* pack" : "add",
-         "$ xns" : "Gtk",
-         "items" : [
+           "gint n_columns" : 4,
+           "id" : "compile_result_store",
+           "columns" : "  typeof(string), typeof(int), typeof(string), typeof(string) ",
+           "* pack" : "set_model",
+           "xtype" : "TreeStore",
+           "$ xns" : "Gtk"
+          },
           {
-           "listeners" : {
-            "cursor_changed" : "() => {\n    var sel = this.el.get_selection();\n\n    if (sel.count_selected_rows() < 1) {\n\n        print(\"selected rows < 1\\n\");\n        //??this.mo \n        return  ;\n    }\n        \n        //console.log('changed');\n     \n     Gtk.TreeIter iter;\n     Gtk.TreeModel mod;\n    sel.get_selected(out mod, out iter);\n    /*\n     store.set(citer, \n            0, file + \":\" + line, \n            1, int.parse(line), \n            2, GLib.Markup.escape_text(line + \": \" + msg), \n            3, file,-1);\n    \n    });\n    */\n    \n    \n    \n    // var val = \"\";\n    GLib.Value value;\n    _this.compile_result_store.el.get_value(iter, 3, out value);\n    var fname = (string)value;\n    GLib.Value lvalue;\n    _this.compile_result_store.el.get_value(iter, 1, out lvalue);\n    var line = (int) lvalue;\n    \n    \n    \n \n    \n    \n    print (\"loadfile %s : %d\", fname,line);\n    \n    _this.sourceview.loadFile(fname, line);\n    \n    \n            \n            \n}\n             "
-           },
-           "id" : "compile_tree",
-           "* init" : "{\n var description = new Pango.FontDescription();\n    description.set_size(8000);\n    this.el.modify_font(description);\n\n}\n",
-           "* pack" : "add",
-           "xtype" : "TreeView",
+           "utf8 title" : "Compile output",
+           "* init" : "{\n  this.el.add_attribute(_this.renderer.el , \"markup\", 2 );\n \n}\n",
+           "xtype" : "TreeViewColumn",
+           "* pack" : "append_column",
+           "string id" : "column",
            "$ xns" : "Gtk",
            "items" : [
             {
-             "gint n_columns" : 4,
-             "id" : "compile_result_store",
-             "columns" : "  typeof(string), typeof(int), typeof(string), typeof(string) ",
-             "* pack" : "set_model",
-             "xtype" : "TreeStore",
+             "id" : "renderer",
+             "xtype" : "CellRendererText",
+             "* pack" : "pack_start,true",
              "$ xns" : "Gtk"
-            },
-            {
-             "utf8 title" : "Compile output",
-             "* init" : "{\n  this.el.add_attribute(_this.renderer.el , \"markup\", 2 );\n \n}\n",
-             "xtype" : "TreeViewColumn",
-             "* pack" : "append_column",
-             "string id" : "column",
-             "$ xns" : "Gtk",
-             "items" : [
-              {
-               "id" : "renderer",
-               "* pack" : "pack_start,true",
-               "xtype" : "CellRendererText",
-               "$ xns" : "Gtk"
-              }
-             ]
             }
            ]
           }
index 7878ca0..e7034ce 100644 (file)
@@ -1,6 +1,6 @@
 static Xcls_ValaCompileErrors  _ValaCompileErrors;
 
-public class Xcls_ValaCompileErrors : Object 
+public class Xcls_ValaCompileErrors : Object
 {
     public Gtk.Popover el;
     private Xcls_ValaCompileErrors  _this;
@@ -13,9 +13,6 @@ public class Xcls_ValaCompileErrors : Object
         return _ValaCompileErrors;
     }
     public Xcls_compile_view compile_view;
-    public Xcls_save_btn save_btn;
-    public Xcls_hpane hpane;
-    public Xcls_sourceview sourceview;
     public Xcls_compile_tree compile_tree;
     public Xcls_compile_result_store compile_result_store;
     public Xcls_renderer renderer;
@@ -26,7 +23,7 @@ public class Xcls_ValaCompileErrors : Object
     public JsRender.JsRender? file;
     public Json.Object notices;
 
-    // ctor 
+    // ctor
     public Xcls_ValaCompileErrors()
     {
         _this = this;
@@ -38,29 +35,20 @@ public class Xcls_ValaCompileErrors : Object
         // set gobject values
         this.el.width_request = 900;
         this.el.height_request = 800;
-        this.el.modal = false;
+        this.el.modal = true;
         this.el.position = Gtk.PositionType.TOP;
         var child_0 = new Xcls_compile_view( _this );
         child_0.ref();
         this.el.add (  child_0.el  );
-
-        // listeners 
-        this.el.closed.connect( () => {
-            if (this.active) {
-                this.el.show();
-                return;
-            }
-           
-        });
     }
 
-    // user defined functions 
+    // user defined functions
     public void show (Json.Object tree, Gtk.Widget onbtn) {
     
             
             this.file = null;
             this.notices = tree;
-            this.active = true;
+           
              //print("looking for %s\n", id);
             // loop through parent childnre
               
@@ -120,53 +108,54 @@ public class Xcls_ValaCompileErrors : Object
             this.el.set_relative_to(onbtn);
         }
         this.el.show_all();
-        this.save_btn.el.hide();       
+       
         while(Gtk.events_pending()) { 
                 Gtk.main_iteration();
         }       
-        this.hpane.el.set_position( 0);
+     //   this.hpane.el.set_position( 0);
     }
-    public class Xcls_compile_view : Object 
+    public class Xcls_compile_view : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private Xcls_ValaCompileErrors  _this;
 
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_compile_view(Xcls_ValaCompileErrors _owner )
         {
             _this = _owner;
             _this.compile_view = this;
-            this.el = new Gtk.VBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_HBox3( _this );
+            this.el.homogeneous = false;
+            var child_0 = new Xcls_Box3( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,false,0 );
-            var child_1 = new Xcls_hpane( _this );
+            var child_1 = new Xcls_ScrolledWindow5( _this );
             child_1.ref();
-            this.el.pack_start (  child_1.el , true,true,0 );
+            this.el.pack_end (  child_1.el , true,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_HBox3 : Object 
+    public class Xcls_Box3 : Object
     {
-        public Gtk.HBox el;
+        public Gtk.Box el;
         private Xcls_ValaCompileErrors  _this;
 
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_HBox3(Xcls_ValaCompileErrors _owner )
+        // ctor
+        public Xcls_Box3(Xcls_ValaCompileErrors _owner )
         {
             _this = _owner;
-            this.el = new Gtk.HBox( true, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
 
             // my vars (dec)
 
@@ -174,17 +163,11 @@ public class Xcls_ValaCompileErrors : Object
             var child_0 = new Xcls_Button4( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , true,true,0 );
-            var child_1 = new Xcls_Button5( _this );
-            child_1.ref();
-            this.el.pack_start (  child_1.el , true,true,0 );
-            var child_2 = new Xcls_save_btn( _this );
-            child_2.ref();
-            this.el.pack_start (  child_2.el , true,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button4 : Object 
+    public class Xcls_Button4 : Object
     {
         public Gtk.Button el;
         private Xcls_ValaCompileErrors  _this;
@@ -192,7 +175,7 @@ public class Xcls_ValaCompileErrors : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button4(Xcls_ValaCompileErrors _owner )
         {
             _this = _owner;
@@ -201,111 +184,14 @@ public class Xcls_ValaCompileErrors : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.label = "Compile and Run";
-        }
-
-        // user defined functions 
-    }
-    public class Xcls_Button5 : Object 
-    {
-        public Gtk.Button el;
-        private Xcls_ValaCompileErrors  _this;
-
-
-            // my vars (def)
-
-        // ctor 
-        public Xcls_Button5(Xcls_ValaCompileErrors _owner )
-        {
-            _this = _owner;
-            this.el = new Gtk.Button();
-
-            // my vars (dec)
-
-            // set gobject values
-            this.el.label = "Edit";
-
-            // listeners 
-            this.el.clicked.connect( () => {
-                // is the file managed by the builder?
-                
-                var f = _this.sourceview.curfname;
-                
-                Regex regex = new Regex("\\.vala$");
-            
-                var bjsf = regex.replace(f,f.length , 0 , ".bjs");
-                
-                var p = _this.window.project;
-                
-                
-                
-                var jsr = p.getByPath(bjsf);
-                if (jsr != null) {
-                    _this.window.windowstate.fileViewOpen(jsr);
-                    
-                    return;
-                
-                }
-            
-            
-            });
-        }
-
-        // user defined functions 
-    }
-    public class Xcls_save_btn : Object 
-    {
-        public Gtk.Button el;
-        private Xcls_ValaCompileErrors  _this;
-
-
-            // my vars (def)
-
-        // ctor 
-        public Xcls_save_btn(Xcls_ValaCompileErrors _owner )
-        {
-            _this = _owner;
-            _this.save_btn = this;
-            this.el = new Gtk.Button();
-
-            // my vars (dec)
-
-            // set gobject values
-            this.el.label = "Save";
-            this.el.visible = false;
+            this.el.label = "Compile and Run ";
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_hpane : Object 
-    {
-        public Gtk.HPaned el;
-        private Xcls_ValaCompileErrors  _this;
-
-
-            // my vars (def)
-
-        // ctor 
-        public Xcls_hpane(Xcls_ValaCompileErrors _owner )
-        {
-            _this = _owner;
-            _this.hpane = this;
-            this.el = new Gtk.HPaned();
 
-            // my vars (dec)
-
-            // set gobject values
-            var child_0 = new Xcls_ScrolledWindow8( _this );
-            child_0.ref();
-            this.el.add (  child_0.el  );
-            var child_1 = new Xcls_ScrolledWindow10( _this );
-            child_1.ref();
-            this.el.add (  child_1.el  );
-        }
 
-        // user defined functions 
-    }
-    public class Xcls_ScrolledWindow8 : Object 
+    public class Xcls_ScrolledWindow5 : Object
     {
         public Gtk.ScrolledWindow el;
         private Xcls_ValaCompileErrors  _this;
@@ -313,190 +199,8 @@ public class Xcls_ValaCompileErrors : Object
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_ScrolledWindow8(Xcls_ValaCompileErrors _owner )
-        {
-            _this = _owner;
-            this.el = new Gtk.ScrolledWindow( null, null );
-
-            // my vars (dec)
-
-            // set gobject values
-            var child_0 = new Xcls_sourceview( _this );
-            child_0.ref();
-            this.el.add (  child_0.el  );
-        }
-
-        // user defined functions 
-    }
-    public class Xcls_sourceview : Object 
-    {
-        public Gtk.SourceView el;
-        private Xcls_ValaCompileErrors  _this;
-
-
-            // my vars (def)
-        public string curfname;
-
-        // ctor 
-        public Xcls_sourceview(Xcls_ValaCompileErrors _owner )
-        {
-            _this = _owner;
-            _this.sourceview = this;
-            this.el = new Gtk.SourceView();
-
-            // my vars (dec)
-
-            // set gobject values
-            this.el.editable = false;
-            this.el.show_line_marks = true;
-            this.el.show_line_numbers = true;
-
-            // init method 
-
-            {
-                this.curfname = "";
-                   var description =   Pango.FontDescription.from_string("monospace");
-                description.set_size(8000);
-                this.el.override_font(description);
-            
-                var attrs = new Gtk.SourceMarkAttributes();
-                var  pink = new Gdk.RGBA();
-                pink.parse ( "pink");
-                attrs.set_background ( pink);
-                attrs.set_icon_name ( "process-stop");    
-                attrs.query_tooltip_text.connect(( mark) => {
-                    //print("tooltip query? %s\n", mark.name);
-                    return mark.name;
-                });
-                
-                this.el.set_mark_attributes ("error", attrs, 1);
-                
-            }
-        }
-
-        // user defined functions 
-        public void loadFile (string fname, int line ) {
-        
-            
-            // resize the view...
-            
-            
-            //if (_this.hpane.el.get_position() < 1) {
-                // left tree = 250, editor area = 500?
-                 int w,h;
-                _this.window.el.get_size(out w, out h);
-                
-                var new_w = int.min(750, w-100);
-                if (new_w > (w-100)) {
-                    new_w = w-100;
-                }
-                _this.el.set_size_request( int.max(100, new_w), int.max(100, h-120));
-                
-                // let it resize, then find out the new size..
-                while(Gtk.events_pending()) { 
-                    Gtk.main_iteration();
-                }
-                
-                _this.hpane.el.set_position( _this.hpane.el.max_position - 250);
-        
-            //}
-        
-            var buf = ((Gtk.SourceBuffer)(this.el.get_buffer()));
-              
-            if (this.curfname != fname) {
-                this.curfname = fname;
-                
-                
-                Regex regex = new Regex("\\.vala$");
-        
-                var bjsf = regex.replace(fname,fname.length , 0 , ".bjs");
-                
-                var p = _this.window.project;
-                
-                var jsr = p.getByPath(bjsf);
-                
-                if (_this.file != null) {
-                    // remove listeners from the file...
-                }
-                
-                _this.file = null;
-                
-                if (jsr != null) {
-                    _this.file = jsr;
-                    
-                   // return;
-                
-                }
-                
-                
-                
-        
-                Gtk.TextIter start;
-                Gtk.TextIter end;     
-                buf.get_bounds (out start, out end);
-                    
-                buf.remove_source_marks (start, end, null);
-                     
-                 
-                
-                string str;
-                FileUtils.get_contents(fname, out str);
-                               
-                buf.set_text(str, str.length);
-                var lm = Gtk.SourceLanguageManager.get_default();
-                
-               
-                buf.set_language(lm.get_language("vala"));
-             
-                 
-                this.el.grab_focus();
-        
-        
-               
-                var lines = _this.notices.get_object_member(fname);
-                 
-                    
-                lines.foreach_member((obj, line, node) => {
-                    
-                         Gtk.TextIter iter;
-                //        print("get inter\n");
-                        var eline = int.parse(line) -1 ;
-                         
-                        
-                        buf.get_iter_at_line( out iter, eline);
-                        //print("mark line\n");
-                        var msg  = "Line: %d".printf(eline+1);
-                        var ar = lines.get_array_member(line);
-                        for (var i = 0 ; i < ar.get_length(); i++) {
-                               msg += (msg.length > 0) ? "\n" : "";
-                               msg += ar.get_string_element(i);
-                       }
-                        
-                        
-                        buf.create_source_mark(msg, "error", iter);
-                    } );
-            }
-            // jump to the line...
-            Gtk.TextIter liter;
-            buf.get_iter_at_line (out liter,  line);
-            print("Scroll to \n");
-            this.el.scroll_to_iter (liter, 0.0f, false, 0.0f, 0.5f);
-            print("End Scroll to \n");
-        
-        
-        }
-    }
-    public class Xcls_ScrolledWindow10 : Object 
-    {
-        public Gtk.ScrolledWindow el;
-        private Xcls_ValaCompileErrors  _this;
-
-
-            // my vars (def)
-
-        // ctor 
-        public Xcls_ScrolledWindow10(Xcls_ValaCompileErrors _owner )
+        // ctor
+        public Xcls_ScrolledWindow5(Xcls_ValaCompileErrors _owner )
         {
             _this = _owner;
             this.el = new Gtk.ScrolledWindow( null, null );
@@ -508,7 +212,7 @@ public class Xcls_ValaCompileErrors : Object
             child_0.ref();
             this.el.add (  child_0.el  );
 
-            // init method 
+            // init method
 
             {
              this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
@@ -517,9 +221,9 @@ public class Xcls_ValaCompileErrors : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_compile_tree : Object 
+    public class Xcls_compile_tree : Object
     {
         public Gtk.TreeView el;
         private Xcls_ValaCompileErrors  _this;
@@ -527,7 +231,7 @@ public class Xcls_ValaCompileErrors : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_compile_tree(Xcls_ValaCompileErrors _owner )
         {
             _this = _owner;
@@ -544,40 +248,41 @@ public class Xcls_ValaCompileErrors : Object
             child_1.ref();
             this.el.append_column (  child_1.el  );
 
-            // init method 
+            // init method
 
             {
              var description = new Pango.FontDescription();
                 description.set_size(8000);
-                this.el.modify_font(description);
+                this.el.override_font(description);
             
             }
 
-            // listeners 
-            this.el.cursor_changed.connect( () => {
-                var sel = this.el.get_selection();
-            
-                if (sel.count_selected_rows() < 1) {
-            
-                    print("selected rows < 1\n");
-                    //??this.mo 
-                    return  ;
-                }
+            //listeners
+            this.el.button_press_event.connect( ( ev)  => {
+             
+                Gtk.TreeViewColumn col;
+                int cell_x;
+                int cell_y;
+                Gtk.TreePath path;
+                if (!this.el.get_path_at_pos((int)ev.x, (int) ev.y, out path, out col, out cell_x, out cell_y )) {
+                    print("nothing selected on click");
                     
-                    //console.log('changed');
+                    return false; //not on a element.
+                }
+                
                  
-                 Gtk.TreeIter iter;
-                 Gtk.TreeModel mod;
-                sel.get_selected(out mod, out iter);
-                /*
-                 store.set(citer, 
-                        0, file + ":" + line, 
-                        1, int.parse(line), 
-                        2, GLib.Markup.escape_text(line + ": " + msg), 
-                        3, file,-1);
+                 // right click.
+                 if (ev.type != Gdk.EventType.2BUTTON_PRESS  || ev.button != 1  ) {    
+                    // show popup!.   
+                        
+                     
+                    return false;
+                }
+                Gtk.TreeIter iter;
+                 var mod = _this.compile_result_store.el;
+                mod.get_iter (out iter, path);
                 
-                });
-                */
+                 
                 
                 
                 
@@ -585,28 +290,43 @@ public class Xcls_ValaCompileErrors : Object
                 GLib.Value value;
                 _this.compile_result_store.el.get_value(iter, 3, out value);
                 var fname = (string)value;
-                GLib.Value lvalue;
-                _this.compile_result_store.el.get_value(iter, 1, out lvalue);
-                var line = (int) lvalue;
+                //GLib.Value lvalue;
+                //_this.compile_result_store.el.get_value(iter, 1, out lvalue);
+                //var line = (int) lvalue;
                 
                 
+               var  bjsf = "";
+                try {             
+                   var  regex = new Regex("\\.vala$");
                 
-             
-                
-                
-                print ("loadfile %s : %d", fname,line);
+                 
+                    bjsf = regex.replace(fname,fname.length , 0 , ".bjs");
+                 } catch (GLib.RegexError e) {
+                    return false;
+                }   
+                var p = _this.window.project;
+                    
+                    
+                    
+                var jsr = p.getByPath(bjsf);
+                if (jsr != null) {
+                    _this.window.windowstate.fileViewOpen(jsr);
+                    
+                    return false;
                 
-                _this.sourceview.loadFile(fname, line);
+                }
+                _this.window.windowstate.fileViewOpenPlain(fname);
                 
+                // try hiding the left nav..
+             
+                return false;
                 
-                        
-                        
-            });
+              });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_compile_result_store : Object 
+    public class Xcls_compile_result_store : Object
     {
         public Gtk.TreeStore el;
         private Xcls_ValaCompileErrors  _this;
@@ -614,7 +334,7 @@ public class Xcls_ValaCompileErrors : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_compile_result_store(Xcls_ValaCompileErrors _owner )
         {
             _this = _owner;
@@ -626,9 +346,10 @@ public class Xcls_ValaCompileErrors : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_column : Object 
+
+    public class Xcls_column : Object
     {
         public Gtk.TreeViewColumn el;
         private Xcls_ValaCompileErrors  _this;
@@ -636,7 +357,7 @@ public class Xcls_ValaCompileErrors : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_column(Xcls_ValaCompileErrors _owner )
         {
             _this = _owner;
@@ -650,7 +371,7 @@ public class Xcls_ValaCompileErrors : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , true );
 
-            // init method 
+            // init method
 
             {
               this.el.add_attribute(_this.renderer.el , "markup", 2 );
@@ -658,9 +379,9 @@ public class Xcls_ValaCompileErrors : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_renderer : Object 
+    public class Xcls_renderer : Object
     {
         public Gtk.CellRendererText el;
         private Xcls_ValaCompileErrors  _this;
@@ -668,7 +389,7 @@ public class Xcls_ValaCompileErrors : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_renderer(Xcls_ValaCompileErrors _owner )
         {
             _this = _owner;
@@ -680,6 +401,11 @@ public class Xcls_ValaCompileErrors : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
+
+
+
+
 }
index 9816420..a385c6e 100644 (file)
       },
       {
        "gint position" : 300,
-       "xtype" : "HPaned",
+       "xtype" : "Paned",
        "* pack" : "append_page,_this.label_targets.el",
        "$ xns" : "Gtk",
+       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
         {
          "* init" : "{  \nthis.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n\n}\n",
         },
         {
          "id" : "set_vbox",
-         "xtype" : "VBox",
+         "xtype" : "Box",
          "* pack" : "add2",
          "gboolean homogeneous" : false,
          "$ xns" : "Gtk",
          "# Project.GtkValaSettings cgroup" : "null",
+         "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
          "items" : [
           {
            "xtype" : "Label",
index ff6b95a..82502e3 100644 (file)
@@ -1,6 +1,6 @@
 static ValaProjectSettings  _ValaProjectSettings;
 
-public class ValaProjectSettings : Object 
+public class ValaProjectSettings : Object
 {
     public Gtk.Box el;
     private ValaProjectSettings  _this;
@@ -37,7 +37,7 @@ public class ValaProjectSettings : Object
     public Project.Gtk project;
     public Xcls_MainWindow window;
 
-    // ctor 
+    // ctor
     public ValaProjectSettings()
     {
         _this = this;
@@ -53,7 +53,7 @@ public class ValaProjectSettings : Object
         this.el.pack_start (  child_0.el , true,true,0 );
     }
 
-    // user defined functions 
+    // user defined functions
     public void show (Project.Gtk project) {
         
         
@@ -72,7 +72,7 @@ public class ValaProjectSettings : Object
     public void save ()  {
         this.project.writeConfig();
     }
-    public class Xcls_Notebook2 : Object 
+    public class Xcls_Notebook2 : Object
     {
         public Gtk.Notebook el;
         private ValaProjectSettings  _this;
@@ -80,7 +80,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Notebook2(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -96,14 +96,14 @@ public class ValaProjectSettings : Object
             var child_2 = new Xcls_Box5( _this );
             child_2.ref();
             this.el.append_page (  child_2.el , _this.label_global.el );
-            var child_3 = new Xcls_HPaned26( _this );
+            var child_3 = new Xcls_Paned26( _this );
             child_3.ref();
             this.el.append_page (  child_3.el , _this.label_targets.el );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_label_global : Object 
+    public class Xcls_label_global : Object
     {
         public Gtk.Label el;
         private ValaProjectSettings  _this;
@@ -111,7 +111,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_label_global(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -123,9 +123,10 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_label_targets : Object 
+
+    public class Xcls_label_targets : Object
     {
         public Gtk.Label el;
         private ValaProjectSettings  _this;
@@ -133,7 +134,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_label_targets(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -145,9 +146,10 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Box5 : Object 
+
+    public class Xcls_Box5 : Object
     {
         public Gtk.Box el;
         private ValaProjectSettings  _this;
@@ -155,7 +157,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Box5(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -176,9 +178,9 @@ public class ValaProjectSettings : Object
             this.el.pack_start (  child_2.el , true,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label6 : Object 
+    public class Xcls_Label6 : Object
     {
         public Gtk.Label el;
         private ValaProjectSettings  _this;
@@ -186,7 +188,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label6(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -197,9 +199,10 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_compile_flags : Object 
+
+    public class Xcls_compile_flags : Object
     {
         public Gtk.Entry el;
         private ValaProjectSettings  _this;
@@ -207,7 +210,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_compile_flags(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -219,7 +222,7 @@ public class ValaProjectSettings : Object
             // set gobject values
             this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
 
-            // listeners 
+            //listeners
             this.el.changed.connect( () => {
                 
                _this.project.compilegroups.get("_default_").compile_flags = this.el.text;
@@ -229,9 +232,10 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Box8 : Object 
+
+    public class Xcls_Box8 : Object
     {
         public Gtk.Box el;
         private ValaProjectSettings  _this;
@@ -239,7 +243,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Box8(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -256,9 +260,9 @@ public class ValaProjectSettings : Object
             this.el.add (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_ScrolledWindow9 : Object 
+    public class Xcls_ScrolledWindow9 : Object
     {
         public Gtk.ScrolledWindow el;
         private ValaProjectSettings  _this;
@@ -266,7 +270,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_ScrolledWindow9(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -280,9 +284,9 @@ public class ValaProjectSettings : Object
             this.el.add (  child_0.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_default_packages_tree : Object 
+    public class Xcls_default_packages_tree : Object
     {
         public Gtk.TreeView el;
         private ValaProjectSettings  _this;
@@ -290,7 +294,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_default_packages_tree(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -311,9 +315,9 @@ public class ValaProjectSettings : Object
             this.el.append_column (  child_2.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_default_packages_tree_store : Object 
+    public class Xcls_default_packages_tree_store : Object
     {
         public Gtk.ListStore el;
         private ValaProjectSettings  _this;
@@ -321,7 +325,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_default_packages_tree_store(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -334,7 +338,7 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
         public void load () {
          
             var def = _this.project.compilegroups.get("_default_");
@@ -357,7 +361,8 @@ public class ValaProjectSettings : Object
             
         }
     }
-    public class Xcls_TreeViewColumn12 : Object 
+
+    public class Xcls_TreeViewColumn12 : Object
     {
         public Gtk.TreeViewColumn el;
         private ValaProjectSettings  _this;
@@ -365,7 +370,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_TreeViewColumn12(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -381,14 +386,14 @@ public class ValaProjectSettings : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , false );
 
-            // init method 
+            // init method
 
             this.el.add_attribute(_this.packages_render.el , "text", 0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_packages_render : Object 
+    public class Xcls_packages_render : Object
     {
         public Gtk.CellRendererText el;
         private ValaProjectSettings  _this;
@@ -396,7 +401,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_packages_render(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -408,9 +413,11 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_TreeViewColumn14 : Object 
+
+
+    public class Xcls_TreeViewColumn14 : Object
     {
         public Gtk.TreeViewColumn el;
         private ValaProjectSettings  _this;
@@ -418,7 +425,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_TreeViewColumn14(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -434,16 +441,16 @@ public class ValaProjectSettings : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , false );
 
-            // init method 
+            // init method
 
             {
              this.el.add_attribute(_this.packages_render_use.el , "active", 1 );
              }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_packages_render_use : Object 
+    public class Xcls_packages_render_use : Object
     {
         public Gtk.CellRendererToggle el;
         private ValaProjectSettings  _this;
@@ -451,7 +458,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_packages_render_use(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -463,7 +470,7 @@ public class ValaProjectSettings : Object
             // set gobject values
             this.el.activatable = true;
 
-            // listeners 
+            //listeners
             this.el.toggled.connect( (  path_string) =>  { 
                 var m = _this.default_packages_tree_store.el;
                Gtk.TreeIter iter;
@@ -488,9 +495,13 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_ScrolledWindow16 : Object 
+
+
+
+
+    public class Xcls_ScrolledWindow16 : Object
     {
         public Gtk.ScrolledWindow el;
         private ValaProjectSettings  _this;
@@ -498,7 +509,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_ScrolledWindow16(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -514,9 +525,9 @@ public class ValaProjectSettings : Object
             child_1.ref();
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_default_directory_tree : Object 
+    public class Xcls_default_directory_tree : Object
     {
         public Gtk.TreeView el;
         private ValaProjectSettings  _this;
@@ -524,7 +535,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_default_directory_tree(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -542,7 +553,7 @@ public class ValaProjectSettings : Object
             child_1.ref();
             this.el.append_column (  child_1.el  );
 
-            // listeners 
+            //listeners
             this.el.button_press_event.connect( ( ev) => {
                 //console.log("button press?");
                
@@ -570,9 +581,9 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_default_directory_tree_store : Object 
+    public class Xcls_default_directory_tree_store : Object
     {
         public Gtk.ListStore el;
         private ValaProjectSettings  _this;
@@ -580,7 +591,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_default_directory_tree_store(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -593,7 +604,7 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
         public void load () {
          
           this.el.clear();
@@ -615,7 +626,8 @@ public class ValaProjectSettings : Object
             
         }
     }
-    public class Xcls_TreeViewColumn19 : Object 
+
+    public class Xcls_TreeViewColumn19 : Object
     {
         public Gtk.TreeViewColumn el;
         private ValaProjectSettings  _this;
@@ -623,7 +635,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_TreeViewColumn19(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -638,14 +650,14 @@ public class ValaProjectSettings : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , false );
 
-            // init method 
+            // init method
 
             this.el.add_attribute(_this.directory_render.el , "text", 0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_directory_render : Object 
+    public class Xcls_directory_render : Object
     {
         public Gtk.CellRendererText el;
         private ValaProjectSettings  _this;
@@ -653,7 +665,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_directory_render(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -665,9 +677,12 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_default_directory_menu : Object 
+
+
+
+    public class Xcls_default_directory_menu : Object
     {
         public Gtk.Menu el;
         private ValaProjectSettings  _this;
@@ -675,7 +690,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_default_directory_menu(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -699,9 +714,9 @@ public class ValaProjectSettings : Object
             this.el.add (  child_3.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem22 : Object 
+    public class Xcls_MenuItem22 : Object
     {
         public Gtk.MenuItem el;
         private ValaProjectSettings  _this;
@@ -709,7 +724,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem22(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -720,7 +735,7 @@ public class ValaProjectSettings : Object
             // set gobject values
             this.el.label = "Add Directory";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ()  => {
                 
                 var  chooser = new Gtk.FileChooserDialog (
@@ -741,9 +756,10 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem23 : Object 
+
+    public class Xcls_MenuItem23 : Object
     {
         public Gtk.MenuItem el;
         private ValaProjectSettings  _this;
@@ -751,7 +767,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem23(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -762,7 +778,7 @@ public class ValaProjectSettings : Object
             // set gobject values
             this.el.label = "Add File";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ()  => {
                 
                 var  chooser = new Gtk.FileChooserDialog (
@@ -783,9 +799,10 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_SeparatorMenuItem24 : Object 
+
+    public class Xcls_SeparatorMenuItem24 : Object
     {
         public Gtk.SeparatorMenuItem el;
         private ValaProjectSettings  _this;
@@ -793,7 +810,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_SeparatorMenuItem24(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -804,9 +821,10 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem25 : Object 
+
+    public class Xcls_MenuItem25 : Object
     {
         public Gtk.MenuItem el;
         private ValaProjectSettings  _this;
@@ -814,7 +832,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem25(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -825,7 +843,7 @@ public class ValaProjectSettings : Object
             // set gobject values
             this.el.label = "Remove File/Directory";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ()  => {
                 
                  //
@@ -852,21 +870,26 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_HPaned26 : Object 
+
+
+
+
+
+    public class Xcls_Paned26 : Object
     {
-        public Gtk.HPaned el;
+        public Gtk.Paned el;
         private ValaProjectSettings  _this;
 
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_HPaned26(ValaProjectSettings _owner )
+        // ctor
+        public Xcls_Paned26(ValaProjectSettings _owner )
         {
             _this = _owner;
-            this.el = new Gtk.HPaned();
+            this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
 
             // my vars (dec)
 
@@ -880,9 +903,9 @@ public class ValaProjectSettings : Object
             this.el.add2 (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_ScrolledWindow27 : Object 
+    public class Xcls_ScrolledWindow27 : Object
     {
         public Gtk.ScrolledWindow el;
         private ValaProjectSettings  _this;
@@ -890,7 +913,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_ScrolledWindow27(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -906,7 +929,7 @@ public class ValaProjectSettings : Object
             child_1.ref();
             this.el.add (  child_1.el  );
 
-            // init method 
+            // init method
 
             {  
             this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
@@ -914,9 +937,9 @@ public class ValaProjectSettings : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_targets_tree_menu : Object 
+    public class Xcls_targets_tree_menu : Object
     {
         public Gtk.Menu el;
         private ValaProjectSettings  _this;
@@ -924,7 +947,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_targets_tree_menu(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -945,9 +968,9 @@ public class ValaProjectSettings : Object
             this.el.add (  child_2.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem29 : Object 
+    public class Xcls_MenuItem29 : Object
     {
         public Gtk.MenuItem el;
         private ValaProjectSettings  _this;
@@ -955,7 +978,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem29(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -966,7 +989,7 @@ public class ValaProjectSettings : Object
             // set gobject values
             this.el.label = "Add Compile Target";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ()  => {
                 
                    if (_this.project.compilegroups.has_key("NEW GROUP")) {
@@ -980,9 +1003,10 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_SeparatorMenuItem30 : Object 
+
+    public class Xcls_SeparatorMenuItem30 : Object
     {
         public Gtk.SeparatorMenuItem el;
         private ValaProjectSettings  _this;
@@ -990,7 +1014,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_SeparatorMenuItem30(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1001,9 +1025,10 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem31 : Object 
+
+    public class Xcls_MenuItem31 : Object
     {
         public Gtk.MenuItem el;
         private ValaProjectSettings  _this;
@@ -1011,7 +1036,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem31(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1022,7 +1047,7 @@ public class ValaProjectSettings : Object
             // set gobject values
             this.el.label = "Remove Target";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ()  => {
                 
                  //
@@ -1049,9 +1074,11 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_targets_tree : Object 
+
+
+    public class Xcls_targets_tree : Object
     {
         public Gtk.TreeView el;
         private ValaProjectSettings  _this;
@@ -1060,7 +1087,7 @@ public class ValaProjectSettings : Object
             // my vars (def)
         public string cursor;
 
-        // ctor 
+        // ctor
         public Xcls_targets_tree(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1077,7 +1104,7 @@ public class ValaProjectSettings : Object
             child_1.ref();
             this.el.append_column (  child_1.el  );
 
-            // listeners 
+            //listeners
             this.el.button_press_event.connect( ( ev) => {
                 //console.log("button press?");
                
@@ -1143,9 +1170,9 @@ public class ValaProjectSettings : Object
               });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_targets_tree_store : Object 
+    public class Xcls_targets_tree_store : Object
     {
         public Gtk.ListStore el;
         private ValaProjectSettings  _this;
@@ -1153,7 +1180,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_targets_tree_store(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1167,7 +1194,7 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
         public void load () {
          
           this.el.clear();
@@ -1193,7 +1220,8 @@ public class ValaProjectSettings : Object
             _this.set_vbox.el.hide();
         }
     }
-    public class Xcls_TreeViewColumn34 : Object 
+
+    public class Xcls_TreeViewColumn34 : Object
     {
         public Gtk.TreeViewColumn el;
         private ValaProjectSettings  _this;
@@ -1201,7 +1229,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_TreeViewColumn34(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1216,16 +1244,16 @@ public class ValaProjectSettings : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , false );
 
-            // init method 
+            // init method
 
             {
                  this.el.add_attribute(_this.targets_render.el , "text", 0 );
              }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_targets_render : Object 
+    public class Xcls_targets_render : Object
     {
         public Gtk.CellRendererText el;
         private ValaProjectSettings  _this;
@@ -1233,7 +1261,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_targets_render(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1245,7 +1273,7 @@ public class ValaProjectSettings : Object
             // set gobject values
             this.el.editable = true;
 
-            // listeners 
+            //listeners
             this.el.edited.connect( (path, newtext) => {
                  
                  Gtk.TreeIter  iter;
@@ -1264,28 +1292,33 @@ public class ValaProjectSettings : Object
               });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_set_vbox : Object 
+
+
+
+
+    public class Xcls_set_vbox : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private ValaProjectSettings  _this;
 
 
             // my vars (def)
         public Project.GtkValaSettings cgroup;
 
-        // ctor 
+        // ctor
         public Xcls_set_vbox(ValaProjectSettings _owner )
         {
             _this = _owner;
             _this.set_vbox = this;
-            this.el = new Gtk.VBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
             this.cgroup = null;
 
             // set gobject values
+            this.el.homogeneous = false;
             var child_0 = new Xcls_Label37( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,false,0 );
@@ -1306,9 +1339,9 @@ public class ValaProjectSettings : Object
             this.el.pack_start (  child_5.el , true,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label37 : Object 
+    public class Xcls_Label37 : Object
     {
         public Gtk.Label el;
         private ValaProjectSettings  _this;
@@ -1316,7 +1349,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label37(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1327,9 +1360,10 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_build_pack_target : Object 
+
+    public class Xcls_build_pack_target : Object
     {
         public Gtk.Entry el;
         private ValaProjectSettings  _this;
@@ -1337,7 +1371,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_build_pack_target(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1348,7 +1382,7 @@ public class ValaProjectSettings : Object
 
             // set gobject values
 
-            // listeners 
+            //listeners
             this.el.changed.connect( ()  => {
                     if (_this.targets_tree.cursor.length < 1) {
                     return;
@@ -1357,9 +1391,10 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label39 : Object 
+
+    public class Xcls_Label39 : Object
     {
         public Gtk.Label el;
         private ValaProjectSettings  _this;
@@ -1367,7 +1402,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label39(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1378,9 +1413,10 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_build_compile_flags : Object 
+
+    public class Xcls_build_compile_flags : Object
     {
         public Gtk.Entry el;
         private ValaProjectSettings  _this;
@@ -1388,7 +1424,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_build_compile_flags(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1399,7 +1435,7 @@ public class ValaProjectSettings : Object
 
             // set gobject values
 
-            // listeners 
+            //listeners
             this.el.changed.connect( () => {
                 if (_this.targets_tree.cursor.length < 1) {
                     return;
@@ -1408,9 +1444,10 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label41 : Object 
+
+    public class Xcls_Label41 : Object
     {
         public Gtk.Label el;
         private ValaProjectSettings  _this;
@@ -1418,7 +1455,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label41(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1429,9 +1466,10 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_ScrolledWindow42 : Object 
+
+    public class Xcls_ScrolledWindow42 : Object
     {
         public Gtk.ScrolledWindow el;
         private ValaProjectSettings  _this;
@@ -1439,7 +1477,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_ScrolledWindow42(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1453,9 +1491,9 @@ public class ValaProjectSettings : Object
             this.el.add (  child_0.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_files_tree : Object 
+    public class Xcls_files_tree : Object
     {
         public Gtk.TreeView el;
         private ValaProjectSettings  _this;
@@ -1463,7 +1501,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_files_tree(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1483,9 +1521,9 @@ public class ValaProjectSettings : Object
             this.el.append_column (  child_2.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_files_tree_store : Object 
+    public class Xcls_files_tree_store : Object
     {
         public Gtk.ListStore el;
         private ValaProjectSettings  _this;
@@ -1493,7 +1531,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_files_tree_store(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1509,7 +1547,7 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
         public void updateDir (string dname, bool bval) {
           
           Gtk.TreeIter citer;
@@ -1616,7 +1654,8 @@ public class ValaProjectSettings : Object
         
         }
     }
-    public class Xcls_TreeViewColumn45 : Object 
+
+    public class Xcls_TreeViewColumn45 : Object
     {
         public Gtk.TreeViewColumn el;
         private ValaProjectSettings  _this;
@@ -1624,7 +1663,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_TreeViewColumn45(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1639,7 +1678,7 @@ public class ValaProjectSettings : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , false );
 
-            // init method 
+            // init method
 
             this.el.add_attribute(_this.files_render.el , "markup", 1 ); // basnemae
              
@@ -1647,9 +1686,9 @@ public class ValaProjectSettings : Object
             */
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_files_render : Object 
+    public class Xcls_files_render : Object
     {
         public Gtk.CellRendererText el;
         private ValaProjectSettings  _this;
@@ -1657,7 +1696,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_files_render(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1669,9 +1708,11 @@ public class ValaProjectSettings : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_TreeViewColumn47 : Object 
+
+
+    public class Xcls_TreeViewColumn47 : Object
     {
         public Gtk.TreeViewColumn el;
         private ValaProjectSettings  _this;
@@ -1679,7 +1720,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_TreeViewColumn47(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1695,16 +1736,16 @@ public class ValaProjectSettings : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , false );
 
-            // init method 
+            // init method
 
             {
              this.el.add_attribute(_this.files_render_use.el , "active", 3 );
              }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_files_render_use : Object 
+    public class Xcls_files_render_use : Object
     {
         public Gtk.CellRendererToggle el;
         private ValaProjectSettings  _this;
@@ -1712,7 +1753,7 @@ public class ValaProjectSettings : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_files_render_use(ValaProjectSettings _owner )
         {
             _this = _owner;
@@ -1724,7 +1765,7 @@ public class ValaProjectSettings : Object
             // set gobject values
             this.el.activatable = true;
 
-            // listeners 
+            //listeners
             this.el.toggled.connect( (  path_string) =>  { 
             
             
@@ -1770,6 +1811,13 @@ public class ValaProjectSettings : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
+
+
+
+
+
+
 }
index 6e88b95..e7029aa 100644 (file)
@@ -5,6 +5,7 @@
  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/WindowLeftProjects.bjs",
  "permname" : "",
  "modOrder" : "",
+ "build_module" : "builder",
  "items" : [
   {
    "listeners" : {
    },
    "@ void project_selected" : "(Project.Project project)",
    "id" : "WindowLeftProjects",
-   "|  void load" : "() {\n     // clear list...\n    \n     if (_this.is_loaded) {\n         return;\n     }\n     _this.is_loading = true;\n        \n     _this.is_loaded = true;\n     \n     Project.Project.loadAll();\n     var projects = Project.Project.allProjectsByName();\n     \n     Gtk.TreeIter iter;\n     var m = this.model.el;\n     m.clear();\n          \n     for (var i = 0; i < projects.size; i++) {\n        m.append(out iter);\n        m.set(iter,   0,projects.get(i).name );\n        \n        var o = new GLib.Value(typeof(Object));\n        o.set_object((Object)projects.get(i));\n                   \n        m.set_value(iter, 1, o);\n     \n     }\n     m.set_sort_column_id(0, Gtk.SortType.ASCENDING);\n     _this.is_loading = false;     \n}\n",
+   "|  void load" : "() {\n     // clear list...\n    \n     if (_this.is_loaded) {\n         return;\n     }\n     _this.is_loading = true;\n        \n     _this.is_loaded = true;\n     \n     Project.Project.loadAll();\n     var projects = Project.Project.allProjectsByName();\n     \n     Gtk.TreeIter iter;\n     var m = this.model.el;\n     m.clear();\n          \n     for (var i = 0; i < projects.size; i++) {\n        m.append(out iter);\n        m.set(iter,   0,projects.get(i).name );\n        \n        var o =  GLib.Value(typeof(Object));\n        o.set_object((Object)projects.get(i));\n                   \n        m.set_value(iter, 1, o);\n     \n     }\n     m.set_sort_column_id(0, Gtk.SortType.ASCENDING);\n     _this.is_loading = false;     \n}\n",
    "# bool is_loaded" : false,
    "* pack" : "add",
-   "xtype" : "VBox",
+   "xtype" : "Box",
    "|  Project.Project? getSelectedProject" : "() {    \n    Gtk.TreeIter iter;\n    Gtk.TreeModel mod;\n            \n    var s = this.view.el.get_selection();\n    if (!s.get_selected(out mod, out iter)) {\n        return null;\n    }\n    \n    GLib.Value gval;\n\n    mod.get_value(iter, 1 , out gval);\n    var project = (Project.Project)gval.get_object();\n    \n    return project;\n}",
    "|  void selectProject" : "(Project.Project project) {\n    \n    var sel = _this.view.el.get_selection();\n    \n    sel.unselect_all();\n    \n    var found = false;\n    _this.model.el.foreach((mod, path, iter) => {\n        GLib.Value val;\n    \n        mod.get_value(iter, 1, out val);\n        if ( ( (Project.Project)val.get_object()).fn != project.fn) {\n            print(\"SKIP %s != %s\\n\", ((Project.Project)val.get_object()).name , project.name);\n            return false;//continue\n        }\n        sel.select_iter(iter);\n        this.project_selected(project);\n        found = true;\n        return true;\n        \n    \n    });\n     if (!found) {\n\t    print(\"tried to select %s, could not find it\", project.name);\n    }\n}\n",
    "# bool is_loading" : false,
    "$ xns" : "Gtk",
+   "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
    "$ homogeneous" : false,
    "@ void show_new_project" : "()",
    "items" : [
      "items" : [
       {
        "listeners" : {
-        "cursor_changed" : " () => {\n    if (_this.is_loading) {\n        return;\n    }\n    \n    Gtk.TreeIter iter;\n    Gtk.TreeModel mod;\n            \n    var s = this.el.get_selection();\n    if (!s.get_selected(out mod, out iter)) {\n        return;\n    }\n    \n    GLib.Value gval;\n\n    mod.get_value(iter, 1 , out gval);\n    var project = (Project.Project)gval.get_object();\n    \n    _this.project_selected(project);\n    \n}"
+        "cursor_changed" : " () => {\n    if (_this.is_loading) {\n        return;\n    }\n    \n    Gtk.TreeIter iter;\n    Gtk.TreeModel mod;\n            \n    var s = this.el.get_selection();\n    if (!s.get_selected(out mod, out iter)) {\n        return;\n    }\n    \n    GLib.Value gval;\n\n    mod.get_value(iter, 1 , out gval);\n    var project = (Project.Project)gval.get_object();\n    \n    _this.project_selected(project);\n    \n}  "
        },
        "id" : "view",
-       "* init" : "  var description = new Pango.FontDescription();\n     description.set_size(8000);\n    this.el.modify_font(description);     \n                    \n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n \n\n    \n  \n",
+       "* init" : "  var description = new Pango.FontDescription();\n     description.set_size(8000);\n    this.el.override_font(description);     \n                    \n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n \n\n    \n   \n ",
        "xtype" : "TreeView",
        "* pack" : "add",
        "$ enable_tree_lines" : true,
@@ -60,8 +62,8 @@
          "items" : [
           {
            "id" : "namecol",
-           "xtype" : "CellRendererText",
            "* pack" : "pack_start,true",
+           "xtype" : "CellRendererText",
            "$ xns" : "Gtk"
           }
          ]
index b9f3a4b..7d3e22c 100644 (file)
@@ -1,8 +1,8 @@
 static Xcls_WindowLeftProjects  _WindowLeftProjects;
 
-public class Xcls_WindowLeftProjects : Object 
+public class Xcls_WindowLeftProjects : Object
 {
-    public Gtk.VBox el;
+    public Gtk.Box el;
     private Xcls_WindowLeftProjects  _this;
 
     public static Xcls_WindowLeftProjects singleton()
@@ -22,28 +22,29 @@ public class Xcls_WindowLeftProjects : Object
     public bool is_loading;
     public signal void show_new_project ();
 
-    // ctor 
+    // ctor
     public Xcls_WindowLeftProjects()
     {
         _this = this;
-        this.el = new Gtk.VBox( false, 0 );
+        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
         // my vars (dec)
         this.is_loaded = false;
         this.is_loading = false;
 
         // set gobject values
+        this.el.homogeneous = false;
         var child_0 = new Xcls_ScrolledWindow2( _this );
         child_0.ref();
         this.el.pack_end (  child_0.el , true,true,0 );
 
-        // listeners 
+        //listeners
         this.el.show.connect( ( ) => {
             this.load();
         });
     }
 
-    // user defined functions 
+    // user defined functions
     public  void load () {
          // clear list...
         
@@ -65,7 +66,7 @@ public class Xcls_WindowLeftProjects : Object
             m.append(out iter);
             m.set(iter,   0,projects.get(i).name );
             
-            var o = new GLib.Value(typeof(Object));
+            var o =  GLib.Value(typeof(Object));
             o.set_object((Object)projects.get(i));
                        
             m.set_value(iter, 1, o);
@@ -116,7 +117,7 @@ public class Xcls_WindowLeftProjects : Object
            print("tried to select %s, could not find it", project.name);
         }
     }
-    public class Xcls_ScrolledWindow2 : Object 
+    public class Xcls_ScrolledWindow2 : Object
     {
         public Gtk.ScrolledWindow el;
         private Xcls_WindowLeftProjects  _this;
@@ -124,7 +125,7 @@ public class Xcls_WindowLeftProjects : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_ScrolledWindow2(Xcls_WindowLeftProjects _owner )
         {
             _this = _owner;
@@ -138,14 +139,14 @@ public class Xcls_WindowLeftProjects : Object
             child_0.ref();
             this.el.add (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_view : Object 
+    public class Xcls_view : Object
     {
         public Gtk.TreeView el;
         private Xcls_WindowLeftProjects  _this;
@@ -153,7 +154,7 @@ public class Xcls_WindowLeftProjects : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_view(Xcls_WindowLeftProjects _owner )
         {
             _this = _owner;
@@ -172,16 +173,16 @@ public class Xcls_WindowLeftProjects : Object
             child_1.ref();
             this.el.append_column (  child_1.el  );
 
-            // init method 
+            // init method
 
             var description = new Pango.FontDescription();
                  description.set_size(8000);
-                this.el.modify_font(description);     
+                this.el.override_font(description);     
                                 
                 var selection = this.el.get_selection();
                 selection.set_mode( Gtk.SelectionMode.SINGLE);
 
-            // listeners 
+            //listeners
             this.el.cursor_changed.connect( () => {
                 if (_this.is_loading) {
                     return;
@@ -205,9 +206,9 @@ public class Xcls_WindowLeftProjects : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_model : Object 
+    public class Xcls_model : Object
     {
         public Gtk.ListStore el;
         private Xcls_WindowLeftProjects  _this;
@@ -215,7 +216,7 @@ public class Xcls_WindowLeftProjects : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_model(Xcls_WindowLeftProjects _owner )
         {
             _this = _owner;
@@ -226,7 +227,7 @@ public class Xcls_WindowLeftProjects : Object
 
             // set gobject values
 
-            // init method 
+            // init method
 
             {
                this.el.set_sort_func(0, (mod,a,b) => {
@@ -244,9 +245,10 @@ public class Xcls_WindowLeftProjects : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_TreeViewColumn5 : Object 
+
+    public class Xcls_TreeViewColumn5 : Object
     {
         public Gtk.TreeViewColumn el;
         private Xcls_WindowLeftProjects  _this;
@@ -254,7 +256,7 @@ public class Xcls_WindowLeftProjects : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_TreeViewColumn5(Xcls_WindowLeftProjects _owner )
         {
             _this = _owner;
@@ -268,14 +270,14 @@ public class Xcls_WindowLeftProjects : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , true );
 
-            // init method 
+            // init method
 
             this.el.add_attribute(_this.namecol.el , "markup", 0  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_namecol : Object 
+    public class Xcls_namecol : Object
     {
         public Gtk.CellRendererText el;
         private Xcls_WindowLeftProjects  _this;
@@ -283,7 +285,7 @@ public class Xcls_WindowLeftProjects : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_namecol(Xcls_WindowLeftProjects _owner )
         {
             _this = _owner;
@@ -295,6 +297,10 @@ public class Xcls_WindowLeftProjects : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
+
+
+
 }
index c7146b8..ca03769 100644 (file)
@@ -13,7 +13,7 @@
    "id" : "LeftProps",
    "|              string keySortFormat" : "(string key) {\n    // listeners first - with 0\n    // specials\n    if (key[0] == '*') {\n        return \"1 \" + key;\n    }\n    // functions\n    \n    var bits = key.split(\" \");\n    \n    if (key[0] == '|') {\n        return \"2 \" + bits[bits.length -1];\n    }\n    // signals\n    if (key[0] == '@') {\n        return \"3 \" + bits[bits.length -1];\n    }\n        \n    // props\n    if (key[0] == '#') {\n        return \"4 \" + bits[bits.length -1];\n    }\n    // the rest..\n    return \"5 \" + bits[bits.length -1];    \n\n\n\n}",
    "|              void finish_editing" : "() {\n     // \n    this.before_edit();\n}",
-   "|              bool startEditingValue" : "( Gtk.TreePath path) {\n\n    // ONLY return true if editing is allowed - eg. combo..\n    \n            print(\"start editing?\\n\");\n            if (!this.stop_editor()) {\n                print(\"stop editor failed\\n\");\n                return false;\n            }\n            \n            Gtk.TreeIter iter;\n\n            var mod = this.model.el;\n            mod.get_iter (out iter, path);\n             \n            /*\n                m.set(iter, \n                        0, \"listener\",\n                        1, miter.get_key(),\n                        2, \"<b>\" + miter.get_key() + \"</b>\",\n                        3, miter.get_value()\n                    ); \n             \n            */\n            GLib.Value gval;\n            mod.get_value(iter, 3 , out gval);\n            var val = (string)gval;\n        \n            mod.get_value(iter, 1 , out gval);\n            var key = (string)gval;\n            var type_ar = key.split(\" \");\n            \n            string kname, kflag, ktype;\n            this.node.normalize_key(key, out kname, out kflag, out ktype);\n             \n            \n            mod.get_value(iter, 0 , out gval);\n            var type = (string)gval; // listerner or prop..\n            \n           \n            \n            var use_textarea = false;\n\n            //------------ things that require the text editor...\n            \n            if (type == \"listener\") {\n                use_textarea = true;\n            }\n            if (key.length > 0 && key[0] == '|') { // user defined method\n                use_textarea = true;\n            }\n            if (key.length > 0 && key[0] == '$') { // raw string\n                use_textarea = true;\n            }\n            if (key.length > 0 && key == \"* init\") {\n                use_textarea = true;\n            }\n            if (val.length > 40) { // long value...\n                use_textarea = true;\n            }\n            \n            \n            \n            if (use_textarea) {\n                print(\"Call show editor\\n\");\n                GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n                    this.view.el.get_selection().select_path(path);\n                    \n                    this.show_editor(file, node, type, key);\n                    \n                    return false;\n                });\n               \n                \n                return false;\n            }\n            \n             var pal = Palete.factory(this.file.project.xtype);\n            \n            string[] opts;\n            var has_opts = pal.typeOptions(this.node.fqn(), kname, ktype, out opts);\n            \n            \n            \n            // others... - fill in options for true/false?\n            print(\"turn on editing %s \\n\" , mod.get_path(iter).to_string());\n           \n               print (ktype.up());\n            if (has_opts) {\n                    print(\"start editing try/false)???\");\n                    this.valrender.el.has_entry = false;\n                  \n                    this.valrender.setOptions(opts);\n                    \n                    this.valrender.el.has_entry = false;\n                    this.valrender.el.editable = true;\n                     this.allow_edit  = true;\n                     GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {\n                         this.view.el.set_cursor_on_cell(\n                            path,\n                            this.valcol.el,\n                            this.valrender.el,\n                            true\n                        );\n                        return false;\n                    });\n                    return true;\n            }\n                                      \n               // see if type is a Enum.\n               \n               \n           \n                \n           \n             opts =  {  };\n            this.valrender.setOptions(opts);\n           \n           GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n                \n                // at this point - work out the type...\n                // if its' a combo... then show the options..\n                this.valrender.el.has_entry = true;\n                \n                this.valrender.el.editable = true;            \n            \n                \n                this.allow_edit  = true;\n                \n                \n                \n                \n\n                this.view.el.set_cursor_on_cell(\n                    path,\n                    this.valcol.el,\n                    this.valrender.el,\n                    true\n                );\n                return false;\n            });\n            return false;\n        }\n",
+   "|              bool startEditingValue" : "( Gtk.TreePath path) {\n\n     // ONLY return true if editing is allowed - eg. combo..\n\n    print(\"start editing?\\n\");\n    if (!this.stop_editor()) {\n        print(\"stop editor failed\\n\");\n        return false;\n    }\n    \n    Gtk.TreeIter iter;\n\n    var mod = this.model.el;\n    mod.get_iter (out iter, path);\n     \n    /*\n        m.set(iter, \n                0, \"listener\",\n                1, miter.get_key(),\n                2, \"<b>\" + miter.get_key() + \"</b>\",\n                3, miter.get_value()\n            ); \n     \n    */\n    GLib.Value gval;\n    mod.get_value(iter, 3 , out gval);\n    var val = (string)gval;\n\n    mod.get_value(iter, 1 , out gval);\n    var key = (string)gval;\n    \n    \n    string kname, kflag, ktype;\n    this.node.normalize_key(key, out kname, out kflag, out ktype);\n     \n    \n    mod.get_value(iter, 0 , out gval);\n    var type = (string)gval; // listerner or prop..\n    \n   \n    \n    var use_textarea = false;\n\n    //------------ things that require the text editor...\n    \n    if (type == \"listener\") {\n        use_textarea = true;\n    }\n    if (key.length > 0 && key[0] == '|') { // user defined method\n        use_textarea = true;\n    }\n    if (key.length > 0 && key[0] == '$') { // raw string\n        use_textarea = true;\n    }\n    if (key.length > 0 && key == \"* init\") {\n        use_textarea = true;\n    }\n    if (val.length > 40) { // long value...\n        use_textarea = true;\n    }\n    \n    \n    \n    if (use_textarea) {\n        print(\"Call show editor\\n\");\n        GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n            this.view.el.get_selection().select_path(path);\n            \n            this.show_editor(file, node, type, key);\n            \n            return false;\n        });\n       \n        \n        return false;\n    }\n    \n     var pal = Palete.factory(this.file.project.xtype);\n    \n    string[] opts;\n    var has_opts = pal.typeOptions(this.node.fqn(), kname, ktype, out opts);\n    \n    \n    \n    // others... - fill in options for true/false?\n    print(\"turn on editing %s \\n\" , mod.get_path(iter).to_string());\n   \n       print (ktype.up());\n    if (has_opts) {\n            print(\"start editing try/false)???\");\n            this.valrender.el.has_entry = false;\n          \n            this.valrender.setOptions(opts);\n            \n            this.valrender.el.has_entry = false;\n            this.valrender.el.editable = true;\n             this.allow_edit  = true;\n             GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {\n                 this.view.el.set_cursor_on_cell(\n                    path,\n                    this.valcol.el,\n                    this.valrender.el,\n                    true\n                );\n                return false;\n            });\n            return true;\n    }\n                              \n       // see if type is a Enum.\n       \n       \n   \n        \n   \n     opts =  {  };\n    this.valrender.setOptions(opts);\n   \n   GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n        \n        // at this point - work out the type...\n        // if its' a combo... then show the options..\n        this.valrender.el.has_entry = true;\n        \n        this.valrender.el.editable = true;            \n    \n        \n        this.allow_edit  = true;\n        \n        \n        \n        \n\n        this.view.el.set_cursor_on_cell(\n            path,\n            this.valcol.el,\n            this.valrender.el,\n            true\n        );\n        return false;\n    });\n    return false;\n}\n",
    "|              void load" : "(JsRender.JsRender file, JsRender.Node? node) \n{\n    print(\"load leftprops\\n\");\n    this.before_edit();\n    this.node = node;\n    this.file = file;\n    \n \n    this.model.el.clear();\n              \n    //this.get('/RightEditor').el.hide();\n    if (node ==null) {\n        return ;\n    }\n     \n    \n\n    //var provider = this.get('/LeftTree').getPaleteProvider();\n    Gtk.TreeIter iter;\n    \n    //typeof(string),  // 0 key type\n     //typeof(string),  // 1 key\n     //typeof(string),  // 2 key (display)\n     //typeof(string),  // 3 value\n     //typeof(string),  // 4 value (display)\n     //typeof(string),  // 5 both (tooltip)\n    \n    \n    \n    \n    // really need a way to sort the hashmap...\n    var m = this.model.el;\n    \n    var miter = node.listeners.map_iterator();\n    var i = 0;\n    \n    while(miter.next()) {\n        i++;\n        m.append(out iter,null);\n        \n        this.updateIter(iter,  \"listener\", miter.get_key(), miter.get_value());\n        \n         \n     }\n     \n      \n    miter = node.props.map_iterator();\n    \n    \n   while(miter.next()) {\n           i++;\n        m.append(out iter,null);\n         this.updateIter(iter,  \"prop\", miter.get_key(), miter.get_value());\n         \n   }\n   print(\"clear selection\\n\");\n   // clear selection?\n   this.model.el.set_sort_column_id(6,Gtk.SortType.ASCENDING); // sort by real key..\n   \n   this.view.el.get_selection().unselect_all();\n   \n   var pane = _this.main_window.editpane.el;\n    var try_size = (i * 25) + 60; // est. 20px per line + 40px header\n    \n    // max 80%...\n    pane.set_position( \n         ((try_size * 1.0f) /  (pane.max_position * 1.0f))  > 0.8f  ? \n        (int) (pane.max_position * 0.2f) :\n        pane.max_position-try_size);\n    \n   \n}\n",
    "xtype" : "Box",
    "|              string keyFormat" : "(string val, string type) {\n    \n    // Glib.markup_escape_text(val);\n\n    if (type == \"listener\") {\n        return \"<span font_weight=\\\"bold\\\" color=\\\"#660000\\\">\" + \n            GLib.Markup.escape_text(val) +\n             \"</span>\";\n    }\n    // property..\n    if (val.length < 1) {\n        return \"<span  color=\\\"#FF0000\\\">--empty--</span>\";\n    }\n    \n    //@ = signal\n    //$ = property with \n    //# - object properties\n    //* = special\n    // all of these... - display value is last element..\n    var ar = val.strip().split(\" \");\n    \n    \n    var dval = GLib.Markup.escape_text(ar[ar.length-1]);\n    \n    \n    \n    \n    switch(val[0]) {\n        case '@': // signal // just bold balck?\n            if (dval[0] == '@') {\n                dval = dval.substring(1);\n            }\n        \n            return @\"<span  font_weight=\\\"bold\\\">@ $dval</span>\";        \n        case '#': // object properties?\n            if (dval[0] == '#') {\n                dval = dval.substring(1);\n            }\n            return @\"<span  font_weight=\\\"bold\\\">$dval</span>\";\n        case '*': // special\n            if (dval[0] == '*') {\n                dval = dval.substring(1);\n            }\n            return @\"<span   color=\\\"#0000CC\\\" font_weight=\\\"bold\\\">$dval</span>\";            \n        case '$':\n            if (dval[0] == '$') {\n                dval = dval.substring(1);\n            }\n            return @\"<span   style=\\\"italic\\\">$dval</span>\";\n       case '|': // user defined methods\n            if (dval[0] == '|') {\n                dval = dval.substring(1);\n            }\n            return @\"<span color=\\\"#008000\\\" font_weight=\\\"bold\\\">$dval</span>\";\n            \n              \n            \n        default:\n            return dval;\n    }\n      \n    \n\n}",
@@ -28,7 +28,7 @@
    "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
    "$ homogeneous" : "false   ",
    "# Xcls_MainWindow main_window" : "null",
-   "|              void addProp" : " (string in_type, string key, string value, string value_type) {\n      // info includes key, val, skel, etype..\n      //console.dump(info);\n        //type = info.type.toLowerCase();\n        //var data = this.toJS();\n          \n    var type = in_type == \"signals\" ? \"listener\" : in_type;\n      \n    var fkey = (value_type.length > 0 ? value_type + \" \" : \"\") + key;\n              \n    if (type == \"listener\") {\n        if (this.node.listeners.has_key(key)) {\n            return;\n        }\n        this.node.listeners.set(key,value);\n    } else  {\n    \n        if (this.node.props.has_key(fkey)) {\n            return;\n        }\n        this.node.props.set(fkey,value);\n    }\n           \n      \n    // add a row???\n    this.load(this.file, this.node);\n    \n    \n    \n    /// need to find the row which I've just added..\n    \n    \n    var s = this.view.el.get_selection();\n    s.unselect_all();\n    \n    print(\"trying to find new iter\");\n  \n    this.model.el.foreach((model, path, iter) => {\n        GLib.Value gval;\n    \n        this.model.el.get_value(iter, 0 , out gval);\n        if ((string)gval != type) {\n            print(\"not type: %s = %s\\n\", (string)gval , type);\n            return false;\n        }\n        this.model.el.get_value(iter, 1 , out gval);\n        if ((string)gval != fkey) {\n            print(\"not key: %s = %s\\n\", (string)gval , fkey);\n            return false;\n        }\n        // delay this?\n        GLib.Timeout.add_full(GLib.Priority.DEFAULT,40 , () => {\n        \n            this.startEditingValue(this.model.el.get_path(iter));\n            return false;\n        });\n        //s.select_iter(iter);\n        return true; \n    });\n    \n    \n    \n              \n}\n",
+   "|              void addProp" : " (string in_type, string key, string value, string value_type) {\n      // info includes key, val, skel, etype..\n      //console.dump(info);\n        //type = info.type.toLowerCase();\n        //var data = this.toJS();\n          \n    var type = in_type == \"signals\" ? \"listener\" : in_type;\n      \n    var fkey = (value_type.length > 0 ? value_type + \" \" : \"\") + key;\n              \n    if (type == \"listener\") {\n        if (this.node.listeners.has_key(key)) {\n            return;\n        }\n        this.node.listeners.set(key,value);\n    } else  {\n    \n        if (this.node.props.has_key(fkey)) {\n            return;\n        }\n        this.node.props.set(fkey,value);\n    }\n            \n      \n    // add a row???\n    this.load(this.file, this.node);\n    \n    \n    \n    /// need to find the row which I've just added..\n    \n    \n    var s = this.view.el.get_selection();\n    s.unselect_all();\n    \n    print(\"trying to find new iter\");\n  \n    this.model.el.foreach((model, path, iter) => {\n        GLib.Value gval;\n    \n        this.model.el.get_value(iter, 0 , out gval);\n        if ((string)gval != type) {\n            print(\"not type: %s = %s\\n\", (string)gval , type);\n            return false;\n        }\n        this.model.el.get_value(iter, 1 , out gval);\n        if ((string)gval != fkey) {\n            print(\"not key: %s = %s\\n\", (string)gval , fkey);\n            return false;\n        }\n        // delay this?\n        GLib.Timeout.add_full(GLib.Priority.DEFAULT,40 , () => {\n        \n            this.startEditingValue(this.model.el.get_path(iter));\n            return false;\n        });\n        //s.select_iter(iter);\n        return true; \n    });\n    \n    \n    \n              \n}\n",
    "|              void updateIter" : "(Gtk.TreeIter iter,  string type, string key, string value) {\n\n    print(\"update Iter %s, %s\\n\", key,value);\n    //typeof(string),  // 0 key type\n     //typeof(string),  // 1 key\n     //typeof(string),  // 2 key (display)\n     //typeof(string),  // 3 value\n     //typeof(string),  // 4 value (display)\n     //typeof(string),  // 5 both (tooltip)\n     //typeof(string),  // 6 key (sort)\n    \n    var dl = value.strip().split(\"\\n\");\n\n    var dis_val = dl.length > 1 ? (dl[0].strip()+ \"...\") : dl[0];\n    \n    if (type == \"listener\") {\n     \n       \n        \n        this.model.el.set(iter, \n                0, type,\n            1, key,\n            2, this.keyFormat(key ,type),\n            3, value,\n            4, dis_val,\n            5, \"<tt>\" +  GLib.Markup.escape_text(key + \" \" +value) + \"</tt>\",\n            6,  \"0 \" + key\n        ); \n        return;\n    }\n    \n\n\n    this.model.el.set(iter, \n            0, \"props\",\n            1, key,\n            2,  this.keyFormat(key , \"prop\"),\n            3, value,\n            4, dis_val,\n             5, \"<tt>\" + GLib.Markup.escape_text(key + \" \" + value) + \"</tt>\",\n             6,  this.keySortFormat(key)\n        ); \n}",
    "# JsRender.Node node" : "",
    "items" : [
@@ -42,6 +42,7 @@
        "listeners" : {
         "button_press_event" : "  (self, ev) => {\n    _this.before_edit();\n    \n        \n    var p = _this.AddPropertyPopup;\n    p.el.set_screen(Gdk.Screen.get_default());\n    p.el.show_all();\n     p.el.popup(null, null, null, ev.button, ev.time);\n     return true;\n}"
        },
+       "bool hexpand" : true,
        "* pack" : "add",
        "xtype" : "Button",
        "$ xns" : "Gtk",
@@ -53,9 +54,9 @@
          "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
          "items" : [
           {
-           "* pack" : "add",
+           "$ Gtk.Stock stock" : "Gtk.Stock.ADD",
            "xtype" : "Image",
-           "$ stock" : "Gtk.STOCK_ADD",
+           "* pack" : "add",
            "$ xns" : "Gtk",
            "$ icon_size" : "Gtk.IconSize.MENU"
           },
index 439316c..f0d3e85 100644 (file)
@@ -1,6 +1,6 @@
 static Xcls_LeftProps  _LeftProps;
 
-public class Xcls_LeftProps : Object 
+public class Xcls_LeftProps : Object
 {
     public Gtk.Box el;
     private Xcls_LeftProps  _this;
@@ -33,7 +33,7 @@ public class Xcls_LeftProps : Object
     public Xcls_MainWindow main_window;
     public JsRender.Node node;
 
-    // ctor 
+    // ctor
     public Xcls_LeftProps()
     {
         _this = this;
@@ -53,7 +53,7 @@ public class Xcls_LeftProps : Object
         this.el.pack_end (  child_1.el , true,true,0 );
     }
 
-    // user defined functions 
+    // user defined functions
     public              void before_edit ()
     {
     
@@ -104,138 +104,103 @@ public class Xcls_LeftProps : Object
     }
     public              bool startEditingValue ( Gtk.TreePath path) {
     
-        // ONLY return true if editing is allowed - eg. combo..
+         // ONLY return true if editing is allowed - eg. combo..
+    
+        print("start editing?\n");
+        if (!this.stop_editor()) {
+            print("stop editor failed\n");
+            return false;
+        }
         
-                print("start editing?\n");
-                if (!this.stop_editor()) {
-                    print("stop editor failed\n");
-                    return false;
-                }
-                
-                Gtk.TreeIter iter;
+        Gtk.TreeIter iter;
     
-                var mod = this.model.el;
-                mod.get_iter (out iter, path);
-                 
-                /*
-                    m.set(iter, 
-                            0, "listener",
-                            1, miter.get_key(),
-                            2, "<b>" + miter.get_key() + "</b>",
-                            3, miter.get_value()
-                        ); 
-                 
-                */
-                GLib.Value gval;
-                mod.get_value(iter, 3 , out gval);
-                var val = (string)gval;
-            
-                mod.get_value(iter, 1 , out gval);
-                var key = (string)gval;
-                var type_ar = key.split(" ");
-                
-                string kname, kflag, ktype;
-                this.node.normalize_key(key, out kname, out kflag, out ktype);
-                 
-                
-                mod.get_value(iter, 0 , out gval);
-                var type = (string)gval; // listerner or prop..
-                
-               
-                
-                var use_textarea = false;
+        var mod = this.model.el;
+        mod.get_iter (out iter, path);
+         
+        /*
+            m.set(iter, 
+                    0, "listener",
+                    1, miter.get_key(),
+                    2, "<b>" + miter.get_key() + "</b>",
+                    3, miter.get_value()
+                ); 
+         
+        */
+        GLib.Value gval;
+        mod.get_value(iter, 3 , out gval);
+        var val = (string)gval;
     
-                //------------ things that require the text editor...
-                
-                if (type == "listener") {
-                    use_textarea = true;
-                }
-                if (key.length > 0 && key[0] == '|') { // user defined method
-                    use_textarea = true;
-                }
-                if (key.length > 0 && key[0] == '$') { // raw string
-                    use_textarea = true;
-                }
-                if (key.length > 0 && key == "* init") {
-                    use_textarea = true;
-                }
-                if (val.length > 40) { // long value...
-                    use_textarea = true;
-                }
-                
-                
-                
-                if (use_textarea) {
-                    print("Call show editor\n");
-                    GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
-                        this.view.el.get_selection().select_path(path);
-                        
-                        this.show_editor(file, node, type, key);
-                        
-                        return false;
-                    });
-                   
-                    
-                    return false;
-                }
-                
-                 var pal = Palete.factory(this.file.project.xtype);
-                
-                string[] opts;
-                var has_opts = pal.typeOptions(this.node.fqn(), kname, ktype, out opts);
-                
+        mod.get_value(iter, 1 , out gval);
+        var key = (string)gval;
+        
+        
+        string kname, kflag, ktype;
+        this.node.normalize_key(key, out kname, out kflag, out ktype);
+         
+        
+        mod.get_value(iter, 0 , out gval);
+        var type = (string)gval; // listerner or prop..
+        
+       
+        
+        var use_textarea = false;
+    
+        //------------ things that require the text editor...
+        
+        if (type == "listener") {
+            use_textarea = true;
+        }
+        if (key.length > 0 && key[0] == '|') { // user defined method
+            use_textarea = true;
+        }
+        if (key.length > 0 && key[0] == '$') { // raw string
+            use_textarea = true;
+        }
+        if (key.length > 0 && key == "* init") {
+            use_textarea = true;
+        }
+        if (val.length > 40) { // long value...
+            use_textarea = true;
+        }
+        
+        
+        
+        if (use_textarea) {
+            print("Call show editor\n");
+            GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
+                this.view.el.get_selection().select_path(path);
                 
+                this.show_editor(file, node, type, key);
                 
-                // others... - fill in options for true/false?
-                print("turn on editing %s \n" , mod.get_path(iter).to_string());
-               
-                   print (ktype.up());
-                if (has_opts) {
-                        print("start editing try/false)???");
-                        this.valrender.el.has_entry = false;
-                      
-                        this.valrender.setOptions(opts);
-                        
-                        this.valrender.el.has_entry = false;
-                        this.valrender.el.editable = true;
-                         this.allow_edit  = true;
-                         GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {
-                             this.view.el.set_cursor_on_cell(
-                                path,
-                                this.valcol.el,
-                                this.valrender.el,
-                                true
-                            );
-                            return false;
-                        });
-                        return true;
-                }
-                                          
-                   // see if type is a Enum.
-                   
-                   
-               
-                    
-               
-                 opts =  {  };
+                return false;
+            });
+           
+            
+            return false;
+        }
+        
+         var pal = Palete.factory(this.file.project.xtype);
+        
+        string[] opts;
+        var has_opts = pal.typeOptions(this.node.fqn(), kname, ktype, out opts);
+        
+        
+        
+        // others... - fill in options for true/false?
+        print("turn on editing %s \n" , mod.get_path(iter).to_string());
+       
+           print (ktype.up());
+        if (has_opts) {
+                print("start editing try/false)???");
+                this.valrender.el.has_entry = false;
+              
                 this.valrender.setOptions(opts);
-               
-               GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
-                    
-                    // at this point - work out the type...
-                    // if its' a combo... then show the options..
-                    this.valrender.el.has_entry = true;
-                    
-                    this.valrender.el.editable = true;            
                 
-                    
-                    this.allow_edit  = true;
-                    
-                    
-                    
-                    
-    
-                    this.view.el.set_cursor_on_cell(
+                this.valrender.el.has_entry = false;
+                this.valrender.el.editable = true;
+                 this.allow_edit  = true;
+                 GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {
+                     this.view.el.set_cursor_on_cell(
                         path,
                         this.valcol.el,
                         this.valrender.el,
@@ -243,8 +208,43 @@ public class Xcls_LeftProps : Object
                     );
                     return false;
                 });
-                return false;
-            }
+                return true;
+        }
+                                  
+           // see if type is a Enum.
+           
+           
+       
+            
+       
+         opts =  {  };
+        this.valrender.setOptions(opts);
+       
+       GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {
+            
+            // at this point - work out the type...
+            // if its' a combo... then show the options..
+            this.valrender.el.has_entry = true;
+            
+            this.valrender.el.editable = true;            
+        
+            
+            this.allow_edit  = true;
+            
+            
+            
+            
+    
+            this.view.el.set_cursor_on_cell(
+                path,
+                this.valcol.el,
+                this.valrender.el,
+                true
+            );
+            return false;
+        });
+        return false;
+    }
     public              void load (JsRender.JsRender file, JsRender.Node? node) 
     {
         print("load leftprops\n");
@@ -457,7 +457,7 @@ public class Xcls_LeftProps : Object
             }
             this.node.props.set(fkey,value);
         }
-               
+                
           
         // add a row???
         this.load(this.file, this.node);
@@ -542,7 +542,7 @@ public class Xcls_LeftProps : Object
                  6,  this.keySortFormat(key)
             ); 
     }
-    public class Xcls_Box2 : Object 
+    public class Xcls_Box2 : Object
     {
         public Gtk.Box el;
         private Xcls_LeftProps  _this;
@@ -550,7 +550,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Box2(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -564,9 +564,9 @@ public class Xcls_LeftProps : Object
             this.el.add (  child_0.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button3 : Object 
+    public class Xcls_Button3 : Object
     {
         public Gtk.Button el;
         private Xcls_LeftProps  _this;
@@ -574,7 +574,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button3(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -583,13 +583,14 @@ public class Xcls_LeftProps : Object
             // my vars (dec)
 
             // set gobject values
+            this.el.hexpand = true;
             var child_0 = new Xcls_Box4( _this );
             child_0.ref();
             this.el.add (  child_0.el  );
             var child_1 = new Xcls_AddPropertyPopup( _this );
             child_1.ref();
 
-            // listeners 
+            //listeners
             this.el.button_press_event.connect( (self, ev) => {
                 _this.before_edit();
                 
@@ -602,9 +603,9 @@ public class Xcls_LeftProps : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Box4 : Object 
+    public class Xcls_Box4 : Object
     {
         public Gtk.Box el;
         private Xcls_LeftProps  _this;
@@ -612,7 +613,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Box4(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -629,9 +630,9 @@ public class Xcls_LeftProps : Object
             this.el.add (  child_1.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Image5 : Object 
+    public class Xcls_Image5 : Object
     {
         public Gtk.Image el;
         private Xcls_LeftProps  _this;
@@ -639,7 +640,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Image5(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -648,13 +649,14 @@ public class Xcls_LeftProps : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.stock = Gtk.STOCK_ADD;
+            this.el.stock = Gtk.Stock.ADD;
             this.el.icon_size = Gtk.IconSize.MENU;
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Label6 : Object 
+
+    public class Xcls_Label6 : Object
     {
         public Gtk.Label el;
         private Xcls_LeftProps  _this;
@@ -662,7 +664,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Label6(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -673,9 +675,11 @@ public class Xcls_LeftProps : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_AddPropertyPopup : Object 
+
+
+    public class Xcls_AddPropertyPopup : Object
     {
         public Gtk.Menu el;
         private Xcls_LeftProps  _this;
@@ -683,7 +687,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_AddPropertyPopup(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -743,9 +747,9 @@ public class Xcls_LeftProps : Object
             this.el.append (  child_15.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem8 : Object 
+    public class Xcls_MenuItem8 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -753,7 +757,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem8(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -765,15 +769,16 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "Using _this.{ID} will map to this element";
             this.el.label = "id: _this.{ID} (Vala)";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ()  => {
                 _this.addProp( "prop", "id", "", "");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem9 : Object 
+
+    public class Xcls_MenuItem9 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -781,7 +786,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem9(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -793,16 +798,17 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "how to pack this element onto parent, (method, 2nd arg, 3rd arg) .. the 1st argument is filled by the element";
             this.el.label = "pack: Pack method (Vala)";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) => {
             
                 _this.addProp( "prop", "pack","add", "*");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem10 : Object 
+
+    public class Xcls_MenuItem10 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -810,7 +816,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem10(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -822,16 +828,17 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "eg. \n\nnew Clutter.Image.from_file(.....)";
             this.el.label = "ctor: Alterative to default contructor";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) => {
             
                 _this.addProp( "prop", "ctor","", "*");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem11 : Object 
+
+    public class Xcls_MenuItem11 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -839,7 +846,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem11(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -851,16 +858,17 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "This code is called after the ctor";
             this.el.label = "init: initialziation code (vala)";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) => {
             
                 _this.addProp( "prop",  "init", "{\n\n}\n", "*" );
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_SeparatorMenuItem12 : Object 
+
+    public class Xcls_SeparatorMenuItem12 : Object
     {
         public Gtk.SeparatorMenuItem el;
         private Xcls_LeftProps  _this;
@@ -868,7 +876,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_SeparatorMenuItem12(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -879,9 +887,10 @@ public class Xcls_LeftProps : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem13 : Object 
+
+    public class Xcls_MenuItem13 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -889,7 +898,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem13(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -901,7 +910,7 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "Add a user defined string property";
             this.el.label = "String";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( (self) => {
             
                 _this.addProp( "prop", "XXXX", "","string");
@@ -909,9 +918,10 @@ public class Xcls_LeftProps : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem14 : Object 
+
+    public class Xcls_MenuItem14 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -919,7 +929,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem14(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -931,16 +941,17 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "Add a user defined number property";
             this.el.label = "Number";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) =>{
             
                 _this.addProp("prop",  "XXX", "0", "int");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem15 : Object 
+
+    public class Xcls_MenuItem15 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -948,7 +959,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem15(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -960,16 +971,17 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "Add a user defined boolean property";
             this.el.label = "Boolean";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) =>{
             
                 _this.addProp( "prop", "XXX", "true", "bool");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_SeparatorMenuItem16 : Object 
+
+    public class Xcls_SeparatorMenuItem16 : Object
     {
         public Gtk.SeparatorMenuItem el;
         private Xcls_LeftProps  _this;
@@ -977,7 +989,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_SeparatorMenuItem16(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -988,9 +1000,10 @@ public class Xcls_LeftProps : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem17 : Object 
+
+    public class Xcls_MenuItem17 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -998,7 +1011,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem17(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1010,16 +1023,17 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "Add a user function boolean property";
             this.el.label = "Javascript Function";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) =>{
             
                 _this.addProp("prop",  "XXXX", "function() { }", "| function");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem18 : Object 
+
+    public class Xcls_MenuItem18 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -1027,7 +1041,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem18(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1039,16 +1053,17 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "Add a user function boolean property";
             this.el.label = "Vala Method";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) =>{
             
                 _this.addProp( "prop", "XXXX", "() {\n\n}\n", "| return_type");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem19 : Object 
+
+    public class Xcls_MenuItem19 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -1056,7 +1071,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem19(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1068,16 +1083,17 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "Add a vala signal";
             this.el.label = "Vala Signal";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) =>{
             
                 _this.addProp( "prop", "XXXX", "()", "@ void");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_SeparatorMenuItem20 : Object 
+
+    public class Xcls_SeparatorMenuItem20 : Object
     {
         public Gtk.SeparatorMenuItem el;
         private Xcls_LeftProps  _this;
@@ -1085,7 +1101,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_SeparatorMenuItem20(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1096,9 +1112,10 @@ public class Xcls_LeftProps : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem21 : Object 
+
+    public class Xcls_MenuItem21 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -1106,7 +1123,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem21(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1118,16 +1135,17 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "Add a flexy if (for HTML templates)";
             this.el.label = "Flexy - If";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) =>{
             
                 _this.addProp("prop",  "flexy:if", "value_or_condition", "string");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem22 : Object 
+
+    public class Xcls_MenuItem22 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -1135,7 +1153,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem22(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1147,16 +1165,17 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "Add a flexy include (for HTML templates)";
             this.el.label = "Flexy - Include";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) =>{
             
                 _this.addProp("prop",  "flexy:include", "name_of_file.html", "string");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem23 : Object 
+
+    public class Xcls_MenuItem23 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -1164,7 +1183,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem23(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1176,16 +1195,20 @@ public class Xcls_LeftProps : Object
             this.el.tooltip_markup = "Add a flexy foreach (for HTML templates)";
             this.el.label = "Flexy - Foreach";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) =>{
             
                 _this.addProp("prop",  "flexy:foreach", "array,key,value", "string");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_EditProps : Object 
+
+
+
+
+    public class Xcls_EditProps : Object
     {
         public Gtk.ScrolledWindow el;
         private Xcls_LeftProps  _this;
@@ -1194,7 +1217,7 @@ public class Xcls_LeftProps : Object
             // my vars (def)
         public bool editing;
 
-        // ctor 
+        // ctor
         public Xcls_EditProps(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1210,7 +1233,7 @@ public class Xcls_LeftProps : Object
             child_0.ref();
             this.el.add (  child_0.el  );
 
-            // init method 
+            // init method
 
             {
               
@@ -1218,9 +1241,9 @@ public class Xcls_LeftProps : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_view : Object 
+    public class Xcls_view : Object
     {
         public Gtk.TreeView el;
         private Xcls_LeftProps  _this;
@@ -1228,7 +1251,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_view(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1253,7 +1276,7 @@ public class Xcls_LeftProps : Object
             var child_3 = new Xcls_ContextMenu( _this );
             child_3.ref();
 
-            // init method 
+            // init method
 
             {
                 var selection = this.el.get_selection();
@@ -1265,7 +1288,7 @@ public class Xcls_LeftProps : Object
                 this.el.override_font(description);
             }
 
-            // listeners 
+            //listeners
             this.el.button_press_event.connect( ( ev)  => {
              
                 Gtk.TreeViewColumn col;
@@ -1366,9 +1389,9 @@ public class Xcls_LeftProps : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_model : Object 
+    public class Xcls_model : Object
     {
         public Gtk.TreeStore el;
         private Xcls_LeftProps  _this;
@@ -1376,7 +1399,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_model(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1395,9 +1418,10 @@ public class Xcls_LeftProps : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_keycol : Object 
+
+    public class Xcls_keycol : Object
     {
         public Gtk.TreeViewColumn el;
         private Xcls_LeftProps  _this;
@@ -1405,7 +1429,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_keycol(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1421,15 +1445,15 @@ public class Xcls_LeftProps : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , false );
 
-            // init method 
+            // init method
 
             this.el.add_attribute(_this.keyrender.el , "markup", 2 );
              this.el.add_attribute(_this.keyrender.el , "text", 1 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_keyrender : Object 
+    public class Xcls_keyrender : Object
     {
         public Gtk.CellRendererText el;
         private Xcls_LeftProps  _this;
@@ -1437,7 +1461,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_keyrender(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1448,7 +1472,7 @@ public class Xcls_LeftProps : Object
 
             // set gobject values
 
-            // listeners 
+            //listeners
             this.el.editing_started.connect( (  editable, path) => {
             
                  Gtk.TreeIter  iter;
@@ -1509,9 +1533,11 @@ public class Xcls_LeftProps : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_valcol : Object 
+
+
+    public class Xcls_valcol : Object
     {
         public Gtk.TreeViewColumn el;
         private Xcls_LeftProps  _this;
@@ -1519,7 +1545,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_valcol(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1535,7 +1561,7 @@ public class Xcls_LeftProps : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , true );
 
-            // init method 
+            // init method
 
             {
                
@@ -1555,9 +1581,9 @@ public class Xcls_LeftProps : Object
             }
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_valrender : Object 
+    public class Xcls_valrender : Object
     {
         public Gtk.CellRendererCombo el;
         private Xcls_LeftProps  _this;
@@ -1565,7 +1591,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_valrender(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1582,7 +1608,7 @@ public class Xcls_LeftProps : Object
             child_0.ref();
             this.el.model = child_0.el;
 
-            // listeners 
+            //listeners
             this.el.editing_started.connect( ( editable, path) => {
                 //_this.editing = true;
                 print("editing started called\n");
@@ -1664,7 +1690,7 @@ public class Xcls_LeftProps : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
         public              void setOptions (string[] ar) {
               var m = _this.valrendermodel.el;
                 m.clear();
@@ -1676,7 +1702,7 @@ public class Xcls_LeftProps : Object
         
         }
     }
-    public class Xcls_valrendermodel : Object 
+    public class Xcls_valrendermodel : Object
     {
         public Gtk.ListStore el;
         private Xcls_LeftProps  _this;
@@ -1684,7 +1710,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_valrendermodel(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1696,9 +1722,12 @@ public class Xcls_LeftProps : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_ContextMenu : Object 
+
+
+
+    public class Xcls_ContextMenu : Object
     {
         public Gtk.Menu el;
         private Xcls_LeftProps  _this;
@@ -1706,7 +1735,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_ContextMenu(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1727,9 +1756,9 @@ public class Xcls_LeftProps : Object
             this.el.append (  child_2.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem33 : Object 
+    public class Xcls_MenuItem33 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -1737,7 +1766,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem33(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1748,7 +1777,7 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.label = "Edit";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( )  =>{
               
                 var s = _this.view.el.get_selection();
@@ -1759,9 +1788,10 @@ public class Xcls_LeftProps : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_SeparatorMenuItem34 : Object 
+
+    public class Xcls_SeparatorMenuItem34 : Object
     {
         public Gtk.SeparatorMenuItem el;
         private Xcls_LeftProps  _this;
@@ -1769,7 +1799,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_SeparatorMenuItem34(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1780,9 +1810,10 @@ public class Xcls_LeftProps : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem35 : Object 
+
+    public class Xcls_MenuItem35 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_LeftProps  _this;
@@ -1790,7 +1821,7 @@ public class Xcls_LeftProps : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem35(Xcls_LeftProps _owner )
         {
             _this = _owner;
@@ -1801,12 +1832,16 @@ public class Xcls_LeftProps : Object
             // set gobject values
             this.el.label = "Delete";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( )  =>{
                _this.deleteSelected();
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
+
+
+
 }
index 02d3ab8..b311309 100644 (file)
@@ -9,8 +9,8 @@
  "items" : [
   {
    "|           JsRender.Node? getActiveElement" : " () { // return path to actie node.\n\n     var path = this.getActivePath();\n     if (path.length < 1) {\n        return null;\n     }\n     return _this.model.pathToNode(path);\n     \n}\n",
-   "id" : "WindowLeftTree",
    "@ bool before_node_change" : "(JsRender.Node? node)",
+   "id" : "WindowLeftTree",
    "$ shadow_type" : "Gtk.ShadowType.IN",
    "* init" : " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
    "|           JsRender.JsRender getActiveFile" : "() {\n    return this.model.file;\n}\n",
    "$ xns" : "Gtk",
    "@ void node_selected" : "(JsRender.Node? node)",
    "# Xcls_MainWindow main_window" : "null",
-   "|           string getActivePath" : " () {\n    var model = this.model;\n    var view = this.view.el;\n    if (view.get_selection().count_selected_rows() < 1) {\n        return \"\";\n    }\n    Gtk.TreeIter iter;\n    Gtk.TreeModel mod;\n    view.get_selection().get_selected(out mod, out iter);\n    return mod.get_path(iter).to_string();\n}\n",
+   "|           string getActivePath" : " () {\n    \n    var view = this.view.el;\n    if (view.get_selection().count_selected_rows() < 1) {\n        return \"\";\n    }\n    Gtk.TreeIter iter;\n    Gtk.TreeModel mod;\n    view.get_selection().get_selected(out mod, out iter);\n    return mod.get_path(iter).to_string();\n}\n ",
    "items" : [
     {
      "listeners" : {
       "button_press_event" : "  ( ev) => {\n    //console.log(\"button press?\");\n    if (! _this.before_node_change(null) ) {\n       return true;\n    }\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.view.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.LeftTreeMenu.el.set_screen(Gdk.Screen.get_default());\n     _this.LeftTreeMenu.el.show_all();\n      _this.LeftTreeMenu.el.popup(null, null, null,  3, ev.time);\n     //   print(\"click:\" + res.path.to_string());\n      return true;\n}",
-      "drag_begin" : "( ctx)  => {\n\t//print('SOURCE: drag-begin');\n        \n        \n        //this.targetData = \"\";\n        \n        // find what is selected in our tree...\n        \n        var s = _this.view.el.get_selection();\n        if (s.count_selected_rows() < 1) {\n            return;\n        }\n        Gtk.TreeIter iter;\n        Gtk.TreeModel mod;\n        s.get_selected(out mod, out iter);\n\n        \n\n        // set some properties of the tree for use by the dropped element.\n        GLib.Value value;\n        _this.model.el.get_value(iter, 2, out value);\n        var tp = mod.get_path(iter).to_string();\n        var data = (JsRender.Node)(value.dup_object());\n        var xname = data.fqn();\n        print (\"XNAME  IS \" + xname+ \"\\n\");\n        this.dragData = tp;\n        this.dropList = _this.model.file.palete().getDropList(xname);\n        \n        print (\"DROP LIST IS \" + string.joinv(\", \", this.dropList) + \"\\n\");\n        \n\n        // make the drag icon a picture of the node that was selected\n    \n        \n    // by default returns the path..\n       var path = _this.model.el.get_path(iter);\n\n         \n        var pix = this.el.create_row_drag_icon ( path);\n        \n        Gtk.drag_set_icon_surface (ctx, pix) ;\n        \n        return;\n}",
       "cursor_changed" : " ( ) => {\n\n\n     if (this.blockChanges) { // probably not needed.. \n       return  ;\n     }\n      if (!_this.before_node_change(null) ) {\n\t     this.blockChanges = true;\n\t     this.el.get_selection().unselect_all();\n\t     this.blockChanges = false;\n\t     return;\n     }\n     if (_this.model.file == null) {\n         return;\n     } \n     \n     //var render = this.get('/LeftTree').getRenderer();                \n    print(\"LEFT TREE -> view -> selection changed called\\n\");\n    \n    \n    // -- it appears that the selection is not updated.\n    \n    GLib.Timeout.add_full(GLib.Priority.DEFAULT,10 , () => {\n         \n\n            if (this.el.get_selection().count_selected_rows() < 1) {\n\n                print(\"selected rows < 1\\n\");\n                //??this.model.load( false);\n                _this.node_selected(null);\n                \n                return false ;\n            }\n                \n                //console.log('changed');\n            var s = this.el.get_selection();\n             Gtk.TreeIter iter;\n             Gtk.TreeModel mod;\n            s.get_selected(out mod, out iter);\n            \n            \n            // var val = \"\";\n            GLib.Value value;\n            _this.model.el.get_value(iter, 2, out value);\n            _this.model.activePath = mod.get_path(iter).to_string();\n            \n            var node = (JsRender.Node)value.dup_object();\n            _this.node_selected(node);\n            while (Gtk.events_pending()) {\n                Gtk.main_iteration();\n            }\n            var cp = mod.get_path(iter);\n            Gtk.TreePath sp, ep;\n            this.el.get_visible_range(out sp, out ep);\n            // if sp is before cp then retuns 1.\n            // if cp is before ep then retuns 1.\n            if (cp.compare(sp) >= 0 && ep.compare(cp) >=1) {\n                return false;\n            }\n            \n             \n            \n            this.el.scroll_to_cell(new Gtk.TreePath.from_string(_this.model.activePath), null, true, 0.1f,0.0f);\n            \n            return false;\n      });  \n    //_this.after_node_change(node);\n\n//        _this.model.file.changed(node, \"tree\");\n   \n    //Seed.print( value.get_string());\n    return  ;\n                \n}",
+      "drag_begin" : "( ctx)  => {\n\t//print('SOURCE: drag-begin');\n        \n        \n        //this.targetData = \"\";\n        \n        // find what is selected in our tree...\n        \n        var s = _this.view.el.get_selection();\n        if (s.count_selected_rows() < 1) {\n            return;\n        }\n        Gtk.TreeIter iter;\n        Gtk.TreeModel mod;\n        s.get_selected(out mod, out iter);\n\n        \n\n        // set some properties of the tree for use by the dropped element.\n        GLib.Value value;\n        _this.model.el.get_value(iter, 2, out value);\n        var tp = mod.get_path(iter).to_string();\n        var data = (JsRender.Node)(value.dup_object());\n        var xname = data.fqn();\n        print (\"XNAME  IS \" + xname+ \"\\n\");\n        this.dragData = tp;\n        this.dropList = _this.model.file.palete().getDropList(xname);\n        \n        print (\"DROP LIST IS \" + string.joinv(\", \", this.dropList) + \"\\n\");\n        \n\n        // make the drag icon a picture of the node that was selected\n    \n        \n    // by default returns the path..\n       var path = _this.model.el.get_path(iter);\n\n         \n        var pix = this.el.create_row_drag_icon ( path);\n        \n        Gtk.drag_set_icon_surface (ctx, pix) ;\n        \n        return;\n}",
       "drag_end" : "  (drag_context) => {\n\t//Seed.print('LEFT-TREE: drag-end');\n        this.dragData = \"\";\n        this.dropList = null;\n//        this.targetData = \"\";\n        this.highlightDropPath(\"\",0);\n//        return true;\n}",
       "drag_motion" : " ( ctx, x, y, time)  => {\n   print(\"got drag motion\\n\");\n    var src = Gtk.drag_get_source_widget(ctx);\n   this.drag_x = x;\n   this.drag_y = y;     \n\n   if (src != this.el) {\n   \n \n \n    // the point of this is to detect where an item could be dropped..\n        print(\"requesting drag data\\n\");\n       this.drag_in_motion = true;\n       \n            // request data that will be recieved by the recieve...              \n        Gtk.drag_get_data\n        (\n                this.el,         // will receive 'drag-data-received' signal \n                ctx,        // represents the current state of the DnD \n                Gdk.Atom.intern(\"STRING\",true),    // the target type we want \n                time            // time stamp \n        );\n        return true;\n  }    \n\n\n  print(\"action: %d\\n\", ctx.get_actions());\n //print(\"GETTING POS\");\n    var  targetData = \"\";\n\n    Gtk.TreePath path;\n    Gtk.TreeViewDropPosition pos;\n    var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n\n    // if there are not items in the tree.. the we have to set isOver to true for anything..\n    var isEmpty = false;\n    if (_this.model.el.iter_n_children(null) < 1) {\n        print(\"got NO children?\\n\");\n        isOver = true; //??? \n        isEmpty = true;\n        pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;\n    }\n\n\n    // ------------- a drag from self..\n\n\n    //var action = Gdk.DragAction.COPY;\n        // unless we are copying!!! ctl button..\n    \n    var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ?\n                 Gdk.DragAction.COPY  : Gdk.DragAction.MOVE ;\n                // Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;\n\n\n    if (_this.model.el.iter_n_children(null) < 1) {\n        // no children.. -- asume it's ok..\n        \n        targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n           \n        this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);        \n        Gdk.drag_status(ctx, action ,time);\n        return true;\n        \n        // continue through to allow drop...\n\n    } \n        \n        \n\n    \n    \n    //print(\"ISOVER? \" + isOver);\n    if (!isOver) {\n  \n        Gdk.drag_status(ctx, 0 ,time);\n         this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);                    \n         return false;\n\n    }\n            \n    // drag node is parent of child..\n    //console.log(\"SRC TREEPATH: \" + src.treepath);\n    //console.log(\"TARGET TREEPATH: \" + data.path.to_string());\n    \n    // nned to check a  few here..\n    //Gtk.TreeViewDropPosition.INTO_OR_AFTER\n    //Gtk.TreeViewDropPosition.INTO_OR_BEFORE\n    //Gtk.TreeViewDropPosition.AFTER\n    //Gtk.TreeViewDropPosition.BEFORE\n    \n    // locally dragged items to not really use the \n    var selection_text = this.dragData;\n    \n            \n            \n    if (selection_text == null || selection_text.length < 1) {\n                //print(\"Error  - drag selection text returned NULL\");\n             Gdk.drag_status(ctx, 0 ,time);\n            this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n             return false;\n     }\n                       \n            \n            // see if we are dragging into ourself?\n    var target_path = path.to_string();            \n    print (\"Drag  %s onto %s--%d\\n \", selection_text, target_path, pos);\n    \n    // pos : 3 = ontop - 0 = after, 1 = before\n    //print(\"target_path=\"+target_path);\n\n    // \n    if (selection_text  == target_path) {\n        print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");\n                \n         Gdk.drag_status(ctx, 0 ,time);\n          this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n          return false;\n//                 -- fixme -- this is not really correct..\n\n    }\n            \n    // check that \n    //print(\"DUMPING DATA\");\n    //console.dump(data);\n    // path, pos\n    \n    //print(data.path.to_string() +' => '+  data.pos);\n    \n    // dropList is a list of xtypes that this node could be dropped on.\n    // it is set up when we start to drag..\n    \n    \n    targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);\n        \n    print(\"targetDAta: \" + targetData +\"\\n\");\n    \n    if (targetData.length < 1) {\n        //print(\"Can not find drop node path\");\n       \n        Gdk.drag_status(ctx, 0, time);\n        this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n        return false;\n    }\n    \n    var td_ar = targetData.split(\"|\");\n      \n    \n\n    Gdk.drag_status(ctx, action ,time);\n    this.highlightDropPath(td_ar[0], (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));\n    return true;\n       \n       \n}",
-      "drag_data_get" : "( drag_context, data, info, time) => {\n            \n            \n                 //print(\"drag-data-get\");\n                 var s = this.el.get_selection();\n                 if (s.count_selected_rows() < 1) {\n                        data.set_text(\"\",0);     \n                         print(\"return empty string - no selection..\");\n                        return;\n                    }\n                 \n                 Gtk.TreeIter iter;\n                 Gtk.TreeModel mod;\n                 \n                 s.get_selected(out mod, out iter);\n                 \n                \n                \n                 GLib.Value value;\n                 _this.model.el.get_value(iter, 2, out value);\n                 var ndata = (JsRender.Node)(value.dup_object());\n                 var xname = ndata.fqn();\n                \n                \n                var tp = mod.get_path(iter).to_string();\n                // by default returns the path..\n                \n               if ( info != Gdk.Atom.intern(\"STRING\",true) ) {\n                    tp = ndata.toJsonString();\n               }   \n               \n               //data.set_text(tp,tp.length);   \n                \n                data.set (data.get_target (), 8, (uchar[]) tp.to_utf8 ());\n            \n                \n               //  print(\"return \" + tp);\n            }",
-      "drag_data_received" : "  (ctx, x, y, sel, info, time)  => {\n  \n        // THIS CODE ONLY RELATES TO drag  or drop of \"NEW\" elements or \"FROM another tree..\"\n  \n  \n        //  print(\"Tree: drag-data-received\\n\");\n        var selection_text = (string)sel.get_data();\n        //print(\"selection_text= %s\\n\",selection_text);\n\n        var is_drag = this.drag_in_motion;\n    \n        \n\n        print(\"Is Drag %s\\n\", is_drag ? \"Y\": \"N\");\n        var  targetData = \"\";\n        \n        Gtk.TreePath path;\n        Gtk.TreeViewDropPosition pos;\n        var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n        \n        // if there are not items in the tree.. the we have to set isOver to true for anything..\n        var isEmpty = false;\n        if (_this.model.el.iter_n_children(null) < 1) {\n            print(\"got NO children?\\n\");\n            isOver = true; //??? \n            isEmpty = true;\n            pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;\n        }\n        \n     \n        //console.log(\"LEFT-TREE: drag-motion\");\n        var src = Gtk.drag_get_source_widget(ctx);\n        \n        // a drag from self - this should be handled by drop and motion.\n        if (src == this.el) {\n            print(\"Source == this element should not happen.. ? \\n\");\n            return;\n        }\n        //print(\"drag_data_recieved from another element\");\n        \n         \n        \n        \n        if (selection_text == null || selection_text.length < 1 || !isOver) {\n            // nothing valid foudn to drop...\n               print(\"empty sel text or not over\");\n            if (is_drag) {\n                Gdk.drag_status(ctx, 0, time);\n                this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n                return;\n            }\n            Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n            // no drop action...\n            return;            \n        \n        }\n        var dropNode = new JsRender.Node(); \n        \n        var dropNodeType  = selection_text;\n        var show_templates = true;\n        // for drop\n        if (dropNodeType[0] == '{') {\n            var pa = new Json.Parser();\n            pa.load_from_data(dropNodeType);\n             \n            dropNode.loadFromJson( pa.get_root().get_object(), 2);\n            dropNodeType = dropNode.fqn();\n            show_templates = false;\n            \n            \n        } else {\n\n            dropNode.setFqn(selection_text);\n        }\n\n         \n        // dropList --- need to gather this ... \n        print(\"get dropList for : %s\\n\",dropNodeType);            \n        var dropList = _this.model.file.palete().getDropList(dropNodeType);\n        \n        print(\"dropList: %s\\n\", string.joinv(\" , \", dropList));\n        \n        // if drag action is link ... then we can drop it anywahere...\n         if ((ctx.get_actions() & Gdk.DragAction.LINK) > 0) {\n             // if path is null?? dragging into an empty tree?\n             targetData = (path == null ? \"\" :  path.to_string()) + \"|%d\".printf((int)pos);\n         } else {\n        \n        \n            targetData = _this.model.findDropNodeByPath( isEmpty ? \"\" : path.to_string(), dropList, pos);\n         }\n        \n        \n            \n        print(\"targetDAta: \" + targetData +\"\\n\");\n        \n        if (targetData.length < 1) {\n         \n            // invalid drop path..\n            if (this.drag_in_motion) {\n                Gdk.drag_status(ctx, 0, time);\n                this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n                return;\n            }\n            Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n            // no drop action...\n            return;\n        }\n        // valid drop path..\n        \n          var td_ar = targetData.split(\"|\");\n          \n        \n        if (this.drag_in_motion) { \n            Gdk.drag_status(ctx, Gdk.DragAction.COPY ,time);\n\n            this.highlightDropPath(  td_ar[0]  , (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));\n            return;\n        }\n        // continue on to allow drop..\n    \n\n        // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n        \n\n        _this.model.dropNode(targetData, dropNode, show_templates);\n        print(\"ADD new node!!!\\n\");\n            \n        ///Xcls_DialogTemplateSelect.singleton().show( _this.model.file.palete(), node);\n        \n        Gtk.drag_finish (ctx, false, false,time);\n        \n        \n            \n            \n      \n}",
-      "drag_drop" : " (  ctx, x, y, time)  => {\n      //Seed.print(\"TARGET: drag-drop\");\n   \n   \n    var src = Gtk.drag_get_source_widget(ctx);\n     \n   if (src != this.el) {\n   \n    \n       \n       this.drag_in_motion = false;   \n            // request data that will be recieved by the recieve...              \n        Gtk.drag_get_data\n        (\n                this.el,         // will receive 'drag-data-received' signal \n                ctx,        // represents the current state of the DnD \n                Gdk.Atom.intern(\"application/json\",true),    // the target type we want \n                time            // time stamp \n        );\n\n         \n        // No target offered by source => error\n   \n\n         return  false;\n     }\n     \n     // handle drop around self..\n     \n                  \n            \n    //print(\"GETTING POS\");\n    var  targetData = \"\";\n    \n    Gtk.TreePath path;\n    Gtk.TreeViewDropPosition pos;\n    var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n    \n    // if there are not items in the tree.. the we have to set isOver to true for anything..\n    var isEmpty = false;\n    if (_this.model.el.iter_n_children(null) < 1) {\n        print(\"got NO children?\\n\");\n        isOver = true; //??? \n        isEmpty = true;\n        pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;\n    }\n    \n     \n     \n    //var action = Gdk.DragAction.COPY;\n        // unless we are copying!!! ctl button..\n    \n    var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ?\n                 Gdk.DragAction.COPY  : Gdk.DragAction.MOVE ;\n                // Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;\n\n      \n    if (_this.model.el.iter_n_children(null) < 1) {\n        // no children.. -- asume it's ok..\n        \n        targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n         \n        // continue through to allow drop...\n\n    } else {\n                \n                \n    \n                \n                \n                //print(\"ISOVER? \" + isOver);\n        if (!isOver) {\n            \n            Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n            return true; // not over apoint!?! - no action on drop or motion..\n        }\n                \n        // drag node is parent of child..\n        //console.log(\"SRC TREEPATH: \" + src.treepath);\n        //console.log(\"TARGET TREEPATH: \" + data.path.to_string());\n        \n        // nned to check a  few here..\n        //Gtk.TreeViewDropPosition.INTO_OR_AFTER\n        //Gtk.TreeViewDropPosition.INTO_OR_BEFORE\n        //Gtk.TreeViewDropPosition.AFTER\n        //Gtk.TreeViewDropPosition.BEFORE\n        \n        // locally dragged items to not really use the \n        var selection_text = this.dragData;\n        \n        \n        \n        if (selection_text == null || selection_text.length < 1) {\n            //print(\"Error  - drag selection text returned NULL\");\n          \n             Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n             return true; /// -- fixme -- this is not really correct..\n        }                \n                \n                // see if we are dragging into ourself?\n                print (\"got selection text of  \" + selection_text);\n        \n        var target_path = path.to_string();\n        //print(\"target_path=\"+target_path);\n\n        // \n        if (selection_text  == target_path) {\n            print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");\n            \n             Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n\n             return true; /// -- fixme -- this is not really correct..\n\n        }\n                \n        // check that \n        //print(\"DUMPING DATA\");\n        //console.dump(data);\n        // path, pos\n        \n        //print(data.path.to_string() +' => '+  data.pos);\n        \n        // dropList is a list of xtypes that this node could be dropped on.\n        // it is set up when we start to drag..\n        \n        \n        targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);\n            \n        print(\"targetDAta: \" + targetData +\"\\n\");\n        \n        if (targetData.length < 1) {\n            //print(\"Can not find drop node path\");\n             \n            Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n            return true;\n        }\n        \n        var td_ar = targetData.split(\"|\");\n                  \n                \n                \n                // continue on to allow drop..\n  }\n        // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n\n\n     var delete_selection_data = false;\n        \n    if (action == Gdk.DragAction.ASK)  {\n        /* Ask the user to move or copy, then set the ctx action. */\n    }\n\n    if (action == Gdk.DragAction.MOVE) {\n        delete_selection_data = true;\n    }\n      \n                // drag around.. - reorder..\n    _this.model.moveNode(targetData, action);\n        \n       \n        \n        \n        \n        // we can send stuff to souce here...\n\n\n// do we always say failure, so we handle the reall drop?\n    Gtk.drag_finish (ctx, false, false,time); //delete_selection_data, time);\n\n    return true;\n \n \n \n \n \n \n}"
+      "drag_data_get" : "( drag_context, data, info, time) => {\n            \n            \n                 //print(\"drag-data-get\");\n                 var s = this.el.get_selection();\n                 if (s.count_selected_rows() < 1) {\n                        data.set_text(\"\",0);     \n                         print(\"return empty string - no selection..\");\n                        return;\n                    }\n                 \n                 Gtk.TreeIter iter;\n                 Gtk.TreeModel mod;\n                 \n                 s.get_selected(out mod, out iter);\n                 \n                \n                \n                 GLib.Value value;\n                 _this.model.el.get_value(iter, 2, out value);\n                 var ndata = (JsRender.Node)(value.dup_object());\n                 \n                \n                \n                var tp = mod.get_path(iter).to_string();\n                // by default returns the path..\n                \n               if ( info != Gdk.Atom.intern(\"STRING\",true) ) {\n                    tp = ndata.toJsonString();\n               }   \n               \n               //data.set_text(tp,tp.length);   \n                \n                data.set (data.get_target (), 8, (uchar[]) tp.to_utf8 ());\n            \n                \n               //  print(\"return \" + tp);\n            }",
+      "drag_data_received" : "  (ctx, x, y, sel, info, time)  => {\n  \n        // THIS CODE ONLY RELATES TO drag  or drop of \"NEW\" elements or \"FROM another tree..\"\n  \n  \n        //  print(\"Tree: drag-data-received\\n\");\n        var selection_text = (string)sel.get_data();\n        //print(\"selection_text= %s\\n\",selection_text);\n\n        var is_drag = this.drag_in_motion;\n    \n        \n\n        print(\"Is Drag %s\\n\", is_drag ? \"Y\": \"N\");\n        var  targetData = \"\";\n        \n        Gtk.TreePath path;\n        Gtk.TreeViewDropPosition pos;\n        var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n        \n        // if there are not items in the tree.. the we have to set isOver to true for anything..\n        var isEmpty = false;\n        if (_this.model.el.iter_n_children(null) < 1) {\n            print(\"got NO children?\\n\");\n            isOver = true; //??? \n            isEmpty = true;\n            pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;\n        }\n        \n     \n        //console.log(\"LEFT-TREE: drag-motion\");\n        var src = Gtk.drag_get_source_widget(ctx);\n        \n        // a drag from self - this should be handled by drop and motion.\n        if (src == this.el) {\n            print(\"Source == this element should not happen.. ? \\n\");\n            return;\n        }\n        //print(\"drag_data_recieved from another element\");\n        \n         \n        \n        \n        if (selection_text == null || selection_text.length < 1 || !isOver) {\n            // nothing valid foudn to drop...\n               print(\"empty sel text or not over\");\n            if (is_drag) {\n                Gdk.drag_status(ctx, 0, time);\n                this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n                return;\n            }\n            Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n            // no drop action...\n            return;            \n        \n        }\n        var dropNode = new JsRender.Node(); \n        \n        var dropNodeType  = selection_text;\n        var show_templates = true;\n        // for drop\n        if (dropNodeType[0] == '{') {\n            var pa = new Json.Parser();\n            try {\n                pa.load_from_data(dropNodeType);\n            } catch (Error e) {\n                Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n                // no drop action...\n                return;   \n            }\n             \n            dropNode.loadFromJson( pa.get_root().get_object(), 2);\n            dropNodeType = dropNode.fqn();\n            show_templates = false;\n            \n            \n        } else {\n\n            dropNode.setFqn(selection_text);\n        }\n\n         \n        // dropList --- need to gather this ... \n        print(\"get dropList for : %s\\n\",dropNodeType);            \n        var dropList = _this.model.file.palete().getDropList(dropNodeType);\n        \n        print(\"dropList: %s\\n\", string.joinv(\" , \", dropList));\n        \n        // if drag action is link ... then we can drop it anywahere...\n         if ((ctx.get_actions() & Gdk.DragAction.LINK) > 0) {\n             // if path is null?? dragging into an empty tree?\n             targetData = (path == null ? \"\" :  path.to_string()) + \"|%d\".printf((int)pos);\n         } else {\n        \n        \n            targetData = _this.model.findDropNodeByPath( isEmpty ? \"\" : path.to_string(), dropList, pos);\n         }\n        \n        \n            \n        print(\"targetDAta: \" + targetData +\"\\n\");\n        \n        if (targetData.length < 1) {\n         \n            // invalid drop path..\n            if (this.drag_in_motion) {\n                Gdk.drag_status(ctx, 0, time);\n                this.highlightDropPath(\"\", (Gtk.TreeViewDropPosition)0);\n                return;\n            }\n            Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n            // no drop action...\n            return;\n        }\n        // valid drop path..\n        \n          var td_ar = targetData.split(\"|\");\n          \n        \n        if (this.drag_in_motion) { \n            Gdk.drag_status(ctx, Gdk.DragAction.COPY ,time);\n\n            this.highlightDropPath(  td_ar[0]  , (Gtk.TreeViewDropPosition)int.parse(td_ar[1]));\n            return;\n        }\n        // continue on to allow drop..\n    \n\n        // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n        \n\n        _this.model.dropNode(targetData, dropNode, show_templates);\n        print(\"ADD new node!!!\\n\");\n            \n        ///Xcls_DialogTemplateSelect.singleton().show( _this.model.file.palete(), node);\n        \n        Gtk.drag_finish (ctx, false, false,time);\n        \n        \n            \n            \n      \n}",
+      "drag_drop" : " (  ctx, x, y, time)  => {\n      //Seed.print(\"TARGET: drag-drop\");\n   \n   \n    var src = Gtk.drag_get_source_widget(ctx);\n     \n   if (src != this.el) {\n   \n    \n       \n       this.drag_in_motion = false;   \n            // request data that will be recieved by the recieve...              \n        Gtk.drag_get_data\n        (\n                this.el,         // will receive 'drag-data-received' signal \n                ctx,        // represents the current state of the DnD \n                Gdk.Atom.intern(\"application/json\",true),    // the target type we want \n                time            // time stamp \n        );\n\n         \n        // No target offered by source => error\n   \n\n         return  false;\n     }\n     \n     // handle drop around self..\n     \n                  \n            \n    //print(\"GETTING POS\");\n    var  targetData = \"\";\n    \n    Gtk.TreePath path;\n    Gtk.TreeViewDropPosition pos;\n    var isOver = _this.view.el.get_dest_row_at_pos(this.drag_x,this.drag_y, out path, out pos);\n    \n    // if there are not items in the tree.. the we have to set isOver to true for anything..\n    var isEmpty = false;\n    if (_this.model.el.iter_n_children(null) < 1) {\n        print(\"got NO children?\\n\");\n        isOver = true; //??? \n        isEmpty = true;\n        pos = Gtk.TreeViewDropPosition.INTO_OR_AFTER;\n    }\n    \n     \n     \n    //var action = Gdk.DragAction.COPY;\n        // unless we are copying!!! ctl button..\n    \n    var action = (ctx.get_actions() & Gdk.DragAction.MOVE) > 0 ?\n                 Gdk.DragAction.COPY  : Gdk.DragAction.MOVE ;\n                // Gdk.DragAction.MOVE : Gdk.DragAction.COPY ;\n\n      \n    if (_this.model.el.iter_n_children(null) < 1) {\n        // no children.. -- asume it's ok..\n        \n        targetData = \"|%d|\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n         \n        // continue through to allow drop...\n\n    } else {\n                \n                \n    \n                \n                \n                //print(\"ISOVER? \" + isOver);\n        if (!isOver) {\n            \n            Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n            return true; // not over apoint!?! - no action on drop or motion..\n        }\n                \n        // drag node is parent of child..\n        //console.log(\"SRC TREEPATH: \" + src.treepath);\n        //console.log(\"TARGET TREEPATH: \" + data.path.to_string());\n        \n        // nned to check a  few here..\n        //Gtk.TreeViewDropPosition.INTO_OR_AFTER\n        //Gtk.TreeViewDropPosition.INTO_OR_BEFORE\n        //Gtk.TreeViewDropPosition.AFTER\n        //Gtk.TreeViewDropPosition.BEFORE\n        \n        // locally dragged items to not really use the \n        var selection_text = this.dragData;\n        \n        \n        \n        if (selection_text == null || selection_text.length < 1) {\n            //print(\"Error  - drag selection text returned NULL\");\n          \n             Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n             return true; /// -- fixme -- this is not really correct..\n        }                \n                \n                // see if we are dragging into ourself?\n                print (\"got selection text of  \" + selection_text);\n        \n        var target_path = path.to_string();\n        //print(\"target_path=\"+target_path);\n\n        // \n        if (selection_text  == target_path) {\n            print(\"self drag ?? == we should perhaps allow copy onto self..\\n\");\n            \n             Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n\n             return true; /// -- fixme -- this is not really correct..\n\n        }\n                \n        // check that \n        //print(\"DUMPING DATA\");\n        //console.dump(data);\n        // path, pos\n        \n        //print(data.path.to_string() +' => '+  data.pos);\n        \n        // dropList is a list of xtypes that this node could be dropped on.\n        // it is set up when we start to drag..\n        \n        \n        targetData = _this.model.findDropNodeByPath( path.to_string(), this.dropList, pos);\n            \n        print(\"targetDAta: \" + targetData +\"\\n\");\n        \n        if (targetData.length < 1) {\n            //print(\"Can not find drop node path\");\n             \n            Gtk.drag_finish (ctx, false, false, time);        // drop failed..\n            return true;\n        }\n                    \n                \n                \n                // continue on to allow drop..\n  }\n        // at this point, drag is not in motion... -- as checked above... - so it's a real drop event..\n\n\n     var delete_selection_data = false;\n        \n    if (action == Gdk.DragAction.ASK)  {\n        /* Ask the user to move or copy, then set the ctx action. */\n    }\n\n    if (action == Gdk.DragAction.MOVE) {\n        delete_selection_data = true;\n    }\n      \n                // drag around.. - reorder..\n    _this.model.moveNode(targetData, action);\n        \n       \n        \n        \n        \n        // we can send stuff to souce here...\n\n\n// do we always say failure, so we handle the reall drop?\n    Gtk.drag_finish (ctx, false, false,time); //delete_selection_data, time);\n\n    return true;\n \n \n \n \n \n \n}"
      },
      "# string dragData" : "",
-     "# int drag_x" : "",
      "# string[] dropList" : "",
+     "# int drag_x" : "",
      "id" : "view",
      "gboolean headers_visible" : true,
      "# int drag_y" : "",
@@ -53,8 +53,8 @@
      "items" : [
       {
        "|           string findDropNode" : " (string treepath_str, string[] targets) {\n\n    // this is used by the dragdrop code in the roo version AFAIR..\n\n    //var path = treepath_str.replace(/^builder-/, '');\n    // treemap is depreciated... - should really check if model has any entries..\n\n    if (this.el.iter_n_children(null) < 1) {\n        //print(\"NO KEYS\");\n        return \"|%d\".printf((int)Gtk.TreeViewDropPosition.INTO_OR_AFTER);\n    }\n    //print(\"FIND treepath: \" + path);\n    //console.dump(this.treemap);\n    \n    //if (!treepath_str.match(/^builder-/)) {\n    //    return []; // nothing!\n    //}\n    if (targets.length > 0 && targets[0] == \"*\") {\n        return  treepath_str;\n    }\n    return this.findDropNodeByPath(treepath_str,targets, -1);\n}\n",
-       "currentTree" : false,
        "id" : "model",
+       "currentTree" : false,
        "# DialogTemplateSelect template_select" : "null",
        "* init" : "print(\"model initialized\");\n\n",
        "|           void loadFile" : "(JsRender.JsRender f) {\n    //console.dump(f);\n    this.el.clear();\n    this.file = f;\n    \n    \n//    if (!f) {\n//        console.log('missing file');\n//        return;\n//    }\n    \n    // load the file if not loaded..\n    if (f.tree == null) {\n        f.loadItems( );\n    }\n    // if it's still null?\n    if (f.tree == null) {\n        return;\n    }\n    \n    /// this.get('/Window').setTitle(f.project.getName() + ' - ' + f.name);\n    \n    //if (f.items.length && typeof(f.items[0]) == 'string') {\n    \n        //this.get('/RightEditor').el.show();\n        //this.get('/RightEditor.view').load( f.items[0]);\n    //    return;\n    //}\n    //print(\"LOAD\");\n    //print(JSON.stringify(f.items, null,4));\n    //console.dump(f.items);\n    var o = new Gee.ArrayList<JsRender.Node>();\n    o.add(f.tree);\n    this.load(o,null);\n    \n    _this.view.el.expand_all();\n\n    if (f.tree.items.size < 1) {\n        // single item..\n        \n        //this.get('/Window.leftvpaned').el.set_position(80);\n        // select first...\n        _this.view.el.set_cursor( \n            new  Gtk.TreePath.from_string(\"0\"), null, false);\n        \n        \n    } else {\n          //this.get('/Window.leftvpaned').el.set_position(200);\n    }\n    \n    return;\n    /*    \n    \n    //print(\"hide right editior\");\n    //this.get('/RightEditor').el.hide();\n    //this.get('/Editor').el.hide();\n    //print(\"set current tree\");\n    //this.currentTree = this.toJS(false, false)[0];\n    //console.dump(this.currentTree);\n    //this.currentTree = this.currentTree || { items: [] };\n    //_this.renderView();\n    //console.dump(this.map);\n    //var RightPalete     = imports.Builder.RightPalete.RightPalete;\n    \n    \n    var pm = this.get('/RightPalete.model');\n    // set up provider..\n    \n    this.get('/RightPalete').provider = this.get('/LeftTree').getPaleteProvider();\n    \n    if (!this.get('/RightPalete').provider) {\n        print (\"********* PALETE PROVIDER MISSING?!!\");\n    }\n    this.get('/LeftTree').renderView();\n    \n    pm.load( this.get('/LeftTree').getPaleteProvider().gatherList(this.listAllTypes()));\n    \n    \n            \n    this.get('/Window.view-notebook').el.set_current_page(\n        this.get('/LeftTree.model').file.getType()== 'Roo' ? 0 : -1);\n        */\n            \n}\n",
        "|           void moveNode" : "(string target_data, Gdk.DragAction action) \n{\n   \n   /// target_data = \"path|pos\");\n   \n   \n    //print(\"MOVE NODE\");\n    // console.dump(target_data);\n    Gtk.TreeIter old_iter;\n    Gtk.TreeModel mod;\n    \n    var s = _this.view.el.get_selection();\n    s.get_selected(out mod , out old_iter);\n    mod.get_path(old_iter);\n    \n    var node = this.pathToNode(mod.get_path(old_iter).to_string());\n    //console.dump(node);\n    if (node == null) {\n        print(\"moveNode: ERROR - node is null?\");\n    }\n    \n    \n\n    // needs to drop first, otherwise the target_data \n    // treepath will be invalid.\n\n    \n    if ((action & Gdk.DragAction.MOVE) > 0) {\n            print(\"REMOVING OLD NODE : \" + target_data + \"\\n\");\n            node.remove();\n            this.dropNode(target_data, node, false);\n            this.el.remove(ref old_iter);\n            \n            \n                         \n    } else {\n        print(\"DROPPING NODE // copy: \" + target_data + \"\\n\");\n        node = node.deepClone();\n        this.dropNode(target_data, node, false);\n    }\n    _this.changed();\n    this.activePath= \"\";\n    //this.updateNode(false,true);\n}\n",
        "# string activePath" : "\"\"",
        "$ columns" : "typeof(string),typeof(string),typeof(Object)",
-       "|           void load" : "(Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter) \n{\n    Gtk.TreeIter citer;\n    //this.insert(citer,iter,0);\n    for(var i =0 ; i < tr.size; i++) {\n        if (iter != null) {\n            this.el.insert(out citer,iter,-1); // why not append?\n        } else {\n            this.el.append(out citer,null);\n        }\n        \n        this.el.set(citer, 0, tr.get(i).nodeTitle(),\n                1, tr.get(i).nodeTip(), -1\n        );\n        var o = new GLib.Value(typeof(Object));\n        o.set_object((Object)tr.get(i));\n        \n        this.el.set_value(citer, 2, o);\n        \n        if (tr.get(i).items.size > 0) {\n            this.load(tr.get(i).items, citer);\n        }\n     \n    }\n\n    \n}",
+       "|           void load" : "(Gee.ArrayList<JsRender.Node> tr, Gtk.TreeIter? iter) \n{\n    Gtk.TreeIter citer;\n    //this.insert(citer,iter,0);\n    for(var i =0 ; i < tr.size; i++) {\n        if (iter != null) {\n            this.el.insert(out citer,iter,-1); // why not append?\n        } else {\n            this.el.append(out citer,null);\n        }\n        \n        this.el.set(citer, 0, tr.get(i).nodeTitle(),\n                1, tr.get(i).nodeTip(), -1\n        );\n        var o =   GLib.Value(typeof(Object));\n        o.set_object((Object)tr.get(i));\n        \n        this.el.set_value(citer, 2, o);\n        \n        if (tr.get(i).items.size > 0) {\n            this.load(tr.get(i).items, citer);\n        }\n     \n    }\n\n    \n}",
        "|           void deleteSelected" : "() {\n    \n    print(\"DELETE SELECTED?\");\n    //_this.view.blockChanges = true;\n    print(\"GET SELECTION?\");\n\n    var s = _this.view.el.get_selection();\n    \n    print(\"GET  SELECTED?\");\n   Gtk.TreeIter iter;\n    Gtk.TreeModel mod;\n\n    \n    if (!s.get_selected(out mod, out iter)) {\n        return; // nothing seleted..\n    }\n      \n\n\n    this.activePath= \"\";      \n    print(\"GET  vnode value?\");\n\n    GLib.Value value;\n    this.el.get_value(iter, 2, out value);\n    var data = (JsRender.Node)(value.get_object());\n    print(\"removing node from Render\\n\");\n    if (data.parent == null) {\n        this.file.tree = null;\n    } else {\n        data.remove();\n    }\n    print(\"removing node from Tree\\n\");    \n    s.unselect_all();\n    this.el.remove(ref iter);\n\n    \n    \n    \n    // \n    \n    \n\n\n    this.activePath= \"\"; // again!?!?      \n    //this.changed(null,true);\n    \n    _this.changed();\n    \n    _this.view.blockChanges = false;\n}\n",
        "# Project.Project? project" : "null",
        "n_columns" : 3,
        "$ xns" : "Gtk",
        "|           JsRender.Node pathToNode" : "(string path) {\n \n     \n     Gtk.TreeIter   iter;\n     _this.model.el.get_iter_from_string(out iter, path);\n     \n     GLib.Value value;\n     _this.model.el.get_value(iter, 2, out value);\n     \n     return (JsRender.Node)value.dup_object();\n\n}",
-       "|           void dropNode" : "(string target_data_str, JsRender.Node node, bool show_templates) {\n//         print(\"drop Node\");\n     // console.dump(node);\n  //    console.dump(target_data);\n  \n  \n        // 0 = before , 1=after 2/3 onto\n  \n  \n        var target_data= target_data_str.split(\"|\");\n  \n        var parent_str = target_data[0].length > 0 ? target_data[0] : \"\";\n        var pos = target_data.length > 1 ? int.parse(target_data[1]) : 2; // ontop..\n  \n  \n        Gtk.TreePath tree_path  =   parent_str.length > 0 ? new  Gtk.TreePath.from_string( parent_str ) : null;\n        \n        \n        \n        //print(\"add \" + tp + \"@\" + target_data[1]  );\n        \n        JsRender.Node parentNode = null;\n        \n        Gtk.TreeIter iter_after;\n        Gtk.TreeIter iter_par ;\n        \n       \n         if (target_data.length == 3 && target_data[2].length > 0) {\n            node.props.set(\"* prop\", target_data[2]);\n        }\n\n        Gtk.TreePath expand_parent = null;\n        \n        // we only need to show the template if it's come from else where?\n         if (show_templates) {\n         \n             var ts = _this.main_window.windowstate.template_select;\n         \n             var new_node = ts.show(\n                  _this.main_window, // (Gtk.Window) _this.el.get_toplevel (),\n                      this.file.palete(),\n                    node,\n                    this.file.project);\n                   \n             if (new_node == null) {\n                 return; // do not add?\n             }\n             node = new_node;\n        }        \n        \n         //print(\"pos is %d  \\n\".printf(pos));\n        \n         Gtk.TreeIter n_iter; \n         \n         if ( parent_str.length < 1) {\n              this.el.append(out n_iter, null); // drop at top level..\n              node.parent = null;\n              this.file.tree = node;\n              \n              \n        } else   if (pos  < 2) {\n            //print(target_data[1]  > 0 ? 'insert_after' : 'insert_before');\n            \n            this.el.get_iter(out iter_after, tree_path );            \n            this.el.iter_parent(out iter_par, iter_after);\n            expand_parent = this.el.get_path(iter_par);\n            \n            GLib.Value value;\n            this.el.get_value( iter_par, 2, out value);\n            parentNode =  (JsRender.Node)value.dup_object();\n            \n            \n            this.el.get_value( iter_after, 2, out value);\n            var relNode =  (JsRender.Node)value.dup_object();\n            \n            if ( pos  > 0 ) {\n             \n                this.el.insert_after(out n_iter,    iter_par  , iter_after);\n                var ix = parentNode.items.index_of(relNode);\n                parentNode.items.insert(ix+1, node);\n                \n            } else {\n                this.el.insert_before(out n_iter,  iter_par  , iter_after);\n                var ix = parentNode.items.index_of(relNode);\n                parentNode.items.insert(ix, node);\n \n            }\n            node.parent = parentNode;\n            \n            \n            \n        } else {\n           //  print(\"appending to  \" + parent_str);\n            this.el.get_iter(out iter_par, tree_path);\n            this.el.append(out n_iter,   iter_par );\n            expand_parent = this.el.get_path(iter_par);\n            \n            GLib.Value value;\n            this.el.get_value( iter_par, 2, out value);\n            parentNode =  (JsRender.Node)value.dup_object();\n            node.parent = parentNode;\n            parentNode.items.add(node);\n        }\n        \n        // reparent node in tree...\n       \n        \n        // why only on no parent???\n        \n        //if (node.parent = null) {\n             \n           \n            \n        //}\n        \n        \n        // work out what kind of packing to use.. -- should be in \n        if (!node.has(\"pack\")   && parent_str.length > 1) {\n            \n            this.file.palete().fillPack(node,parentNode);\n            \n            \n        }\n        \n        // add the node...\n        \n        this.el.set(n_iter, 0, node.nodeTitle(), 1, node.nodeTip(), -1  );\n        var o = new GLib.Value(typeof(Object));\n        o.set_object((Object)node);\n        \n        this.el.set_value(n_iter, 2, o);\n        \n        \n        \n        \n// load children - if it has any..\n      \n        if (node.items.size > 0) {\n            this.load(node.items, n_iter);\n            _this.view.el.expand_row(this.el.get_path(n_iter), true);\n        } else if (expand_parent != null && !_this.view.el.is_row_expanded(expand_parent)) {\n           _this.view.el.expand_row(expand_parent,true);\n        }\n\n        //if (tp != null && (node.items.length() > 0 || pos > 1)) {\n        //    _this.view.el.expand_row(this.el.get_path(iter_par), true);\n       // }\n        // wee need to get the empty proptypes from somewhere..\n        \n        //var olditer = this.activeIter;\n        this.activePath = this.el.get_path(n_iter).to_string();\n\n\n        \n        \n        _this.view.el.set_cursor(this.el.get_path(n_iter), null, false);\n        _this.changed();\n     \n        \n            \n}\n",
-       "$ listAllTypes" : "function() {\n    var s = this.get('/LeftTree.view').selection;\n    print (\"LIST ALL TYPES: \" + s.count_selected_rows() );\n    \n    if (s.count_selected_rows() > 0) {\n        var iter = new Gtk.TreeIter();    \n        s.get_selected(this.el, iter);\n\n        // set some properties of the tree for use by the dropped element.\n        var value = new GObject.Value('');\n        this.el.get_value(iter, 2, value);\n        var data = JSON.parse(value.value);\n        \n        \n        var xname = this.get('/LeftTree.model').file.guessName(data);\n        console.log('selected:' + xname);\n        if (xname.length) {\n            return [ xname ];\n        }\n        return []; // could not find it..\n    }\n    \n    var ret = [ ];\n    \n   var _this = this;\n    function addall(li)\n    {\n        li.forEach(function(el) {\n            // this is specific to roo!!!?\n            if (!el) { // skip empty?\n                return;\n            }\n            var fullpath =  _this.file.guessName(el);\n            if (fullpath.length && ret.indexOf(fullpath) < 0) {\n                ret.push(fullpath);\n            }\n            \n            \n            if (el.items && el.items.length) {\n                addall(el.items);\n            }\n            \n        });\n        \n        \n    }\n    \n    addall([this.currentTree]);\n    \n    // only if we have nothing, should we add '*top'\n    if (!ret.length) {\n        ret = [ '*top' ];\n    }\n    //console.log('all types in tree');\n    //console.dump(ret);\n    \n    return ret;\n                            \n}\n"
+       "|           void dropNode" : "(string target_data_str, JsRender.Node node, bool show_templates) {\n//         print(\"drop Node\");\n     // console.dump(node);\n  //    console.dump(target_data);\n  \n  \n        // 0 = before , 1=after 2/3 onto\n  \n  \n        var target_data= target_data_str.split(\"|\");\n  \n        var parent_str = target_data[0].length > 0 ? target_data[0] : \"\";\n        var pos = target_data.length > 1 ? int.parse(target_data[1]) : 2; // ontop..\n  \n  \n        Gtk.TreePath tree_path  =   parent_str.length > 0 ? new  Gtk.TreePath.from_string( parent_str ) : null;\n        \n        \n        \n        //print(\"add \" + tp + \"@\" + target_data[1]  );\n        \n        JsRender.Node parentNode = null;\n        \n        Gtk.TreeIter iter_after;\n        Gtk.TreeIter iter_par ;\n        \n       \n         if (target_data.length == 3 && target_data[2].length > 0) {\n            node.props.set(\"* prop\", target_data[2]);\n        }\n\n        Gtk.TreePath expand_parent = null;\n        \n        // we only need to show the template if it's come from else where?\n         if (show_templates) {\n         \n             var ts = _this.main_window.windowstate.template_select;\n         \n             var new_node = ts.show(\n                  _this.main_window, // (Gtk.Window) _this.el.get_toplevel (),\n                      this.file.palete(),\n                    node,\n                    this.file.project);\n                   \n             if (new_node == null) {\n                 return; // do not add?\n             }\n             node = new_node;\n        }        \n        \n         //print(\"pos is %d  \\n\".printf(pos));\n        \n         Gtk.TreeIter n_iter; \n         \n         if ( parent_str.length < 1) {\n              this.el.append(out n_iter, null); // drop at top level..\n              node.parent = null;\n              this.file.tree = node;\n              \n              \n        } else   if (pos  < 2) {\n            //print(target_data[1]  > 0 ? 'insert_after' : 'insert_before');\n            \n            this.el.get_iter(out iter_after, tree_path );            \n            this.el.iter_parent(out iter_par, iter_after);\n            expand_parent = this.el.get_path(iter_par);\n            \n            GLib.Value value;\n            this.el.get_value( iter_par, 2, out value);\n            parentNode =  (JsRender.Node)value.dup_object();\n            \n            \n            this.el.get_value( iter_after, 2, out value);\n            var relNode =  (JsRender.Node)value.dup_object();\n            \n            if ( pos  > 0 ) {\n             \n                this.el.insert_after(out n_iter,    iter_par  , iter_after);\n                var ix = parentNode.items.index_of(relNode);\n                parentNode.items.insert(ix+1, node);\n                \n            } else {\n                this.el.insert_before(out n_iter,  iter_par  , iter_after);\n                var ix = parentNode.items.index_of(relNode);\n                parentNode.items.insert(ix, node);\n \n            }\n            node.parent = parentNode;\n            \n            \n            \n        } else {\n           //  print(\"appending to  \" + parent_str);\n            this.el.get_iter(out iter_par, tree_path);\n            this.el.append(out n_iter,   iter_par );\n            expand_parent = this.el.get_path(iter_par);\n            \n            GLib.Value value;\n            this.el.get_value( iter_par, 2, out value);\n            parentNode =  (JsRender.Node)value.dup_object();\n            node.parent = parentNode;\n            parentNode.items.add(node);\n        }\n        \n        // reparent node in tree...\n       \n        \n        // why only on no parent???\n        \n        //if (node.parent = null) {\n             \n           \n            \n        //}\n        \n        \n        // work out what kind of packing to use.. -- should be in \n        if (!node.has(\"pack\")   && parent_str.length > 1) {\n            \n            this.file.palete().fillPack(node,parentNode);\n            \n            \n        }\n        \n        // add the node...\n        \n        this.el.set(n_iter, 0, node.nodeTitle(), 1, node.nodeTip(), -1  );\n        var o =   GLib.Value(typeof(Object));\n        o.set_object((Object)node);\n        \n        this.el.set_value(n_iter, 2, o);\n        \n        \n        \n        \n// load children - if it has any..\n      \n        if (node.items.size > 0) {\n            this.load(node.items, n_iter);\n            _this.view.el.expand_row(this.el.get_path(n_iter), true);\n        } else if (expand_parent != null && !_this.view.el.is_row_expanded(expand_parent)) {\n           _this.view.el.expand_row(expand_parent,true);\n        }\n\n        //if (tp != null && (node.items.length() > 0 || pos > 1)) {\n        //    _this.view.el.expand_row(this.el.get_path(iter_par), true);\n       // }\n        // wee need to get the empty proptypes from somewhere..\n        \n        //var olditer = this.activeIter;\n        this.activePath = this.el.get_path(n_iter).to_string();\n\n\n        \n        \n        _this.view.el.set_cursor(this.el.get_path(n_iter), null, false);\n        _this.changed();\n     \n        \n            \n}\n",
+       "$ listAllTypes" : "function() {\n    var s = this.get('/LeftTree.view').selection;\n    print (\"LIST ALL TYPES: \" + s.count_selected_rows() );\n    \n    if (s.count_selected_rows() > 0) {\n        var iter = new Gtk.TreeIter();    \n        s.get_selected(this.el, iter);\n\n        // set some properties of the tree for use by the dropped element.\n        var value = new GObject.Value('');\n        this.el.get_value(iter, 2, value);\n        var data = JSON.parse(value.value);\n        \n        \n        var xname = this.get('/LeftTree.model').file.guessName(data);\n        console.log('selected:' + xname);\n        if (xname.length) {\n            return [ xname ];\n        }\n        return []; // could not find it..\n    }\n    \n    var ret = [ ];\n    \n   var _this = this;\n    function addall(li)\n    {\n        li.forEach(function(el) {\n            // this is specific to roo!!!?\n            if (!el) { // skip empty?\n                return;\n            }\n            var fullpath =  _this.file.guessName(el);\n            if (fullpath.length && ret.indexOf(fullpath) < 0) {\n                ret.push(fullpath);\n            }\n            \n            \n            if (el.items && el.items.length) {\n                addall(el.items);\n            }\n            \n        });\n        \n        \n    }\n    \n    addall([this.currentTree]);\n    \n    // only if we have nothing, should we add '*top'\n    if (!ret.length) {\n        ret = [ '*top' ];\n    }\n    //console.log('all types in tree');\n    //console.dump(ret);\n    \n    return ret;\n                            \n}\n",
+       "| string treePathFromNode" : "(JsRender.Node node) {\n    // iterate through the tree and find the node\n    var ret = \"\";\n    \n    this.el.foreach((mod, pth, iter) => {\n        // get the node..\n      \n     \n         GLib.Value value;\n         _this.model.el.get_value(iter, 2, out value);\n         \n\n         \n         var n = (JsRender.Node)value;\n\n         print(\"compare %s to %s\\n\", n.fqn(), node.fqn());\n        if (node == n) {\n            ret = pth.to_string();\n            return true;\n        }\n        return false;\n    });\n    return ret;\n\n}\n"
       },
       {
        "utf8 title" : "test",
@@ -84,8 +85,8 @@
        "items" : [
         {
          "id" : "renderer",
-         "xtype" : "CellRendererText",
          "* pack" : "pack_start,true",
+         "xtype" : "CellRendererText",
          "$ xns" : "Gtk"
         }
        ]
@@ -94,8 +95,8 @@
     },
     {
      "id" : "LeftTreeMenu",
-     "xtype" : "Menu",
      "* pack" : false,
+     "xtype" : "Menu",
      "$ xns" : "Gtk",
      "items" : [
       {
         "activate" : "  ( ) => {\n    \n    print(\"ACTIVATE?\");\n    \n  \n     _this.model.deleteSelected();\n}"
        },
        "label" : "Delete Element",
-       "xtype" : "MenuItem",
        "* pack" : "add",
+       "xtype" : "MenuItem",
        "$ xns" : "Gtk"
       },
       {
         "activate" : "  () => {\n\n     DialogSaveTemplate.singleton().show(\n            (Gtk.Window) _this.el.get_toplevel (), \n            _this.model.file.palete(), \n            _this.getActiveElement()\n    );\n     \n    \n}"
        },
        "label" : "Save as Template",
-       "xtype" : "MenuItem",
        "* pack" : "add",
+       "xtype" : "MenuItem",
        "$ xns" : "Gtk"
       },
       {
         "activate" : "  () => {\n    var node = _this.getActiveElement();\n     var name = DialogSaveModule.singleton().show(\n            (Gtk.Window) _this.el.get_toplevel (), \n            _this.model.file.project, \n            node\n     );\n     if (name.length < 1) {\n            return;\n  \n     }\n     node.props.set(\"* xinclude\", name);\n     node.items.clear();\n\n\n    var s = _this.view.el.get_selection();\n    \n    print(\"GET  SELECTED?\");\n    Gtk.TreeIter iter;\n    Gtk.TreeModel mod;\n\n    \n    if (!s.get_selected(out mod, out iter)) {\n        return; // nothing seleted..\n    }\n    Gtk.TreeIter citer;\n    var n_cn = mod.iter_n_children(iter) -1;\n    for (var i = n_cn; i > -1; i--) {\n        mod.iter_nth_child(out citer, iter, i);\n        \n\n        print(\"removing node from Tree\\n\");    \n    \n        _this.model.el.remove(ref citer);\n    }\n    _this.changed();\n    _this.node_selected(node);\n     \n    \n}"
        },
        "label" : "Save as Module",
-       "xtype" : "MenuItem",
        "* pack" : "add",
+       "xtype" : "MenuItem",
        "$ xns" : "Gtk"
       }
      ]
index 26b99eb..441a499 100644 (file)
@@ -1,6 +1,6 @@
 static Xcls_WindowLeftTree  _WindowLeftTree;
 
-public class Xcls_WindowLeftTree : Object 
+public class Xcls_WindowLeftTree : Object
 {
     public Gtk.ScrolledWindow el;
     private Xcls_WindowLeftTree  _this;
@@ -23,7 +23,7 @@ public class Xcls_WindowLeftTree : Object
     public signal void node_selected (JsRender.Node? node);
     public Xcls_MainWindow main_window;
 
-    // ctor 
+    // ctor
     public Xcls_WindowLeftTree()
     {
         _this = this;
@@ -40,12 +40,12 @@ public class Xcls_WindowLeftTree : Object
         var child_1 = new Xcls_LeftTreeMenu( _this );
         child_1.ref();
 
-        // init method 
+        // init method
 
         this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
     }
 
-    // user defined functions 
+    // user defined functions
     public           JsRender.Node? getActiveElement () { // return path to actie node.
     
          var path = this.getActivePath();
@@ -59,7 +59,7 @@ public class Xcls_WindowLeftTree : Object
         return this.model.file;
     }
     public           string getActivePath () {
-        var model = this.model;
+        
         var view = this.view.el;
         if (view.get_selection().count_selected_rows() < 1) {
             return "";
@@ -69,7 +69,7 @@ public class Xcls_WindowLeftTree : Object
         view.get_selection().get_selected(out mod, out iter);
         return mod.get_path(iter).to_string();
     }
-    public class Xcls_view : Object 
+    public class Xcls_view : Object
     {
         public Gtk.TreeView el;
         private Xcls_WindowLeftTree  _this;
@@ -77,13 +77,13 @@ public class Xcls_WindowLeftTree : Object
 
             // my vars (def)
         public string dragData;
-        public int drag_x;
         public string[] dropList;
+        public int drag_x;
         public int drag_y;
         public bool drag_in_motion;
         public bool blockChanges;
 
-        // ctor 
+        // ctor
         public Xcls_view(Xcls_WindowLeftTree _owner )
         {
             _this = _owner;
@@ -104,7 +104,7 @@ public class Xcls_WindowLeftTree : Object
             child_1.ref();
             this.el.append_column (  child_1.el  );
 
-            // init method 
+            // init method
 
             {
                 var description = new Pango.FontDescription();
@@ -145,7 +145,7 @@ public class Xcls_WindowLeftTree : Object
                 //Gtk.drag_dest_add_text_targets(this.el);
             }
 
-            // listeners 
+            //listeners
             this.el.button_press_event.connect( ( ev) => {
                 //console.log("button press?");
                 if (! _this.before_node_change(null) ) {
@@ -174,50 +174,6 @@ public class Xcls_WindowLeftTree : Object
                  //   print("click:" + res.path.to_string());
                   return true;
             });
-            this.el.drag_begin.connect( ( ctx)  => {
-               //print('SOURCE: drag-begin');
-                    
-                    
-                    //this.targetData = "";
-                    
-                    // find what is selected in our tree...
-                    
-                    var s = _this.view.el.get_selection();
-                    if (s.count_selected_rows() < 1) {
-                        return;
-                    }
-                    Gtk.TreeIter iter;
-                    Gtk.TreeModel mod;
-                    s.get_selected(out mod, out iter);
-            
-                    
-            
-                    // set some properties of the tree for use by the dropped element.
-                    GLib.Value value;
-                    _this.model.el.get_value(iter, 2, out value);
-                    var tp = mod.get_path(iter).to_string();
-                    var data = (JsRender.Node)(value.dup_object());
-                    var xname = data.fqn();
-                    print ("XNAME  IS " + xname+ "\n");
-                    this.dragData = tp;
-                    this.dropList = _this.model.file.palete().getDropList(xname);
-                    
-                    print ("DROP LIST IS " + string.joinv(", ", this.dropList) + "\n");
-                    
-            
-                    // make the drag icon a picture of the node that was selected
-                
-                    
-                // by default returns the path..
-                   var path = _this.model.el.get_path(iter);
-            
-                     
-                    var pix = this.el.create_row_drag_icon ( path);
-                    
-                    Gtk.drag_set_icon_surface (ctx, pix) ;
-                    
-                    return;
-            });
             this.el.cursor_changed.connect( ( ) => {
             
             
@@ -292,6 +248,50 @@ public class Xcls_WindowLeftTree : Object
                 return  ;
                             
             });
+            this.el.drag_begin.connect( ( ctx)  => {
+               //print('SOURCE: drag-begin');
+                    
+                    
+                    //this.targetData = "";
+                    
+                    // find what is selected in our tree...
+                    
+                    var s = _this.view.el.get_selection();
+                    if (s.count_selected_rows() < 1) {
+                        return;
+                    }
+                    Gtk.TreeIter iter;
+                    Gtk.TreeModel mod;
+                    s.get_selected(out mod, out iter);
+            
+                    
+            
+                    // set some properties of the tree for use by the dropped element.
+                    GLib.Value value;
+                    _this.model.el.get_value(iter, 2, out value);
+                    var tp = mod.get_path(iter).to_string();
+                    var data = (JsRender.Node)(value.dup_object());
+                    var xname = data.fqn();
+                    print ("XNAME  IS " + xname+ "\n");
+                    this.dragData = tp;
+                    this.dropList = _this.model.file.palete().getDropList(xname);
+                    
+                    print ("DROP LIST IS " + string.joinv(", ", this.dropList) + "\n");
+                    
+            
+                    // make the drag icon a picture of the node that was selected
+                
+                    
+                // by default returns the path..
+                   var path = _this.model.el.get_path(iter);
+            
+                     
+                    var pix = this.el.create_row_drag_icon ( path);
+                    
+                    Gtk.drag_set_icon_surface (ctx, pix) ;
+                    
+                    return;
+            });
             this.el.drag_end.connect( (drag_context) => {
                //Seed.print('LEFT-TREE: drag-end');
                     this.dragData = "";
@@ -476,7 +476,7 @@ public class Xcls_WindowLeftTree : Object
                              GLib.Value value;
                              _this.model.el.get_value(iter, 2, out value);
                              var ndata = (JsRender.Node)(value.dup_object());
-                             var xname = ndata.fqn();
+                             
                             
                             
                             var tp = mod.get_path(iter).to_string();
@@ -556,7 +556,13 @@ public class Xcls_WindowLeftTree : Object
                     // for drop
                     if (dropNodeType[0] == '{') {
                         var pa = new Json.Parser();
-                        pa.load_from_data(dropNodeType);
+                        try {
+                            pa.load_from_data(dropNodeType);
+                        } catch (Error e) {
+                            Gtk.drag_finish (ctx, false, false, time);        // drop failed..
+                            // no drop action...
+                            return;   
+                        }
                          
                         dropNode.loadFromJson( pa.get_root().get_object(), 2);
                         dropNodeType = dropNode.fqn();
@@ -766,9 +772,7 @@ public class Xcls_WindowLeftTree : Object
                         Gtk.drag_finish (ctx, false, false, time);        // drop failed..
                         return true;
                     }
-                    
-                    var td_ar = targetData.split("|");
-                              
+                                
                             
                             
                             // continue on to allow drop..
@@ -809,7 +813,7 @@ public class Xcls_WindowLeftTree : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
         public           void highlightDropPath ( string treepath, Gtk.TreeViewDropPosition pos) {
         
                 // highlighting for drag/drop
@@ -828,7 +832,7 @@ public class Xcls_WindowLeftTree : Object
              this.el.scroll_to_cell(tp, null, false, 0,0);
         }
     }
-    public class Xcls_model : Object 
+    public class Xcls_model : Object
     {
         public Gtk.TreeStore el;
         private Xcls_WindowLeftTree  _this;
@@ -840,7 +844,7 @@ public class Xcls_WindowLeftTree : Object
         public string activePath;
         public Project.Project? project;
 
-        // ctor 
+        // ctor
         public Xcls_model(Xcls_WindowLeftTree _owner )
         {
             _this = _owner;
@@ -855,12 +859,12 @@ public class Xcls_WindowLeftTree : Object
 
             // set gobject values
 
-            // init method 
+            // init method
 
             print("model initialized");
         }
 
-        // user defined functions 
+        // user defined functions
         public           string findDropNode (string treepath_str, string[] targets) {
         
             // this is used by the dragdrop code in the roo version AFAIR..
@@ -1137,7 +1141,7 @@ public class Xcls_WindowLeftTree : Object
                 this.el.set(citer, 0, tr.get(i).nodeTitle(),
                         1, tr.get(i).nodeTip(), -1
                 );
-                var o = new GLib.Value(typeof(Object));
+                var o =   GLib.Value(typeof(Object));
                 o.set_object((Object)tr.get(i));
                 
                 this.el.set_value(citer, 2, o);
@@ -1339,7 +1343,7 @@ public class Xcls_WindowLeftTree : Object
                 // add the node...
                 
                 this.el.set(n_iter, 0, node.nodeTitle(), 1, node.nodeTip(), -1  );
-                var o = new GLib.Value(typeof(Object));
+                var o =   GLib.Value(typeof(Object));
                 o.set_object((Object)node);
                 
                 this.el.set_value(n_iter, 2, o);
@@ -1372,9 +1376,35 @@ public class Xcls_WindowLeftTree : Object
              
                 
                     
+        }
+        public string treePathFromNode (JsRender.Node node) {
+            // iterate through the tree and find the node
+            var ret = "";
+            
+            this.el.foreach((mod, pth, iter) => {
+                // get the node..
+              
+             
+                 GLib.Value value;
+                 _this.model.el.get_value(iter, 2, out value);
+                 
+        
+                 
+                 var n = (JsRender.Node)value;
+        
+                 print("compare %s to %s\n", n.fqn(), node.fqn());
+                if (node == n) {
+                    ret = pth.to_string();
+                    return true;
+                }
+                return false;
+            });
+            return ret;
+        
         }
     }
-    public class Xcls_TreeViewColumn4 : Object 
+
+    public class Xcls_TreeViewColumn4 : Object
     {
         public Gtk.TreeViewColumn el;
         private Xcls_WindowLeftTree  _this;
@@ -1382,7 +1412,7 @@ public class Xcls_WindowLeftTree : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_TreeViewColumn4(Xcls_WindowLeftTree _owner )
         {
             _this = _owner;
@@ -1396,14 +1426,14 @@ public class Xcls_WindowLeftTree : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , true );
 
-            // init method 
+            // init method
 
             this.el.add_attribute(_this.renderer.el , "markup", 0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_renderer : Object 
+    public class Xcls_renderer : Object
     {
         public Gtk.CellRendererText el;
         private Xcls_WindowLeftTree  _this;
@@ -1411,7 +1441,7 @@ public class Xcls_WindowLeftTree : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_renderer(Xcls_WindowLeftTree _owner )
         {
             _this = _owner;
@@ -1423,9 +1453,12 @@ public class Xcls_WindowLeftTree : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_LeftTreeMenu : Object 
+
+
+
+    public class Xcls_LeftTreeMenu : Object
     {
         public Gtk.Menu el;
         private Xcls_WindowLeftTree  _this;
@@ -1433,7 +1466,7 @@ public class Xcls_WindowLeftTree : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_LeftTreeMenu(Xcls_WindowLeftTree _owner )
         {
             _this = _owner;
@@ -1454,9 +1487,9 @@ public class Xcls_WindowLeftTree : Object
             this.el.add (  child_2.el  );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem7 : Object 
+    public class Xcls_MenuItem7 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_WindowLeftTree  _this;
@@ -1464,7 +1497,7 @@ public class Xcls_WindowLeftTree : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem7(Xcls_WindowLeftTree _owner )
         {
             _this = _owner;
@@ -1475,7 +1508,7 @@ public class Xcls_WindowLeftTree : Object
             // set gobject values
             this.el.label = "Delete Element";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( ( ) => {
                 
                 print("ACTIVATE?");
@@ -1485,9 +1518,10 @@ public class Xcls_WindowLeftTree : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem8 : Object 
+
+    public class Xcls_MenuItem8 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_WindowLeftTree  _this;
@@ -1495,7 +1529,7 @@ public class Xcls_WindowLeftTree : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem8(Xcls_WindowLeftTree _owner )
         {
             _this = _owner;
@@ -1506,7 +1540,7 @@ public class Xcls_WindowLeftTree : Object
             // set gobject values
             this.el.label = "Save as Template";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( () => {
             
                  DialogSaveTemplate.singleton().show(
@@ -1519,9 +1553,10 @@ public class Xcls_WindowLeftTree : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_MenuItem9 : Object 
+
+    public class Xcls_MenuItem9 : Object
     {
         public Gtk.MenuItem el;
         private Xcls_WindowLeftTree  _this;
@@ -1529,7 +1564,7 @@ public class Xcls_WindowLeftTree : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_MenuItem9(Xcls_WindowLeftTree _owner )
         {
             _this = _owner;
@@ -1540,7 +1575,7 @@ public class Xcls_WindowLeftTree : Object
             // set gobject values
             this.el.label = "Save as Module";
 
-            // listeners 
+            //listeners
             this.el.activate.connect( () => {
                 var node = _this.getActiveElement();
                  var name = DialogSaveModule.singleton().show(
@@ -1583,6 +1618,8 @@ public class Xcls_WindowLeftTree : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
+
 }
index ae62f4c..ee0957d 100644 (file)
@@ -5,28 +5,31 @@
  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/WindowRightPalete.bjs",
  "permname" : "",
  "modOrder" : "",
+ "build_module" : "builder",
  "items" : [
   {
    "id" : "RightPalete",
    "@ void after_node_change(JsRender.Node? node)" : "",
    "* pack" : "add",
-   "xtype" : "VBox",
+   "xtype" : "Box",
    "@ void before_node_change(JsRender.Node? node)" : "",
    "| void load" : " (Palete.Palete pal, string cls ) {\n   \n   // this.get('model').expanded();\n    \n    var tr = pal.getChildList(cls);\n    this.model.el.clear();\n\n\n    Gtk.TreeIter citer;\n\n    for(var i =0 ; i < tr.length; i++) {\n         this.model.el.append(out citer);   \n         \n        this.model.el.set_value(citer, 0,   tr[i] ); // title \n        \n    }\n    this.model.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);\n    \n} \n\n",
    "@ void drag_end()" : "",
    "$ xns" : "Gtk",
-   "| void clear" : "() {\n   this.model.el.clear();\n}",
+   "| void clear" : "() {\n   this.model.el.clear();\n} ",
+   "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
    "items" : [
     {
      "id" : "viewbox",
-     "* pack" : "add",
-     "xtype" : "VBox",
+     "* pack" : "pack_start,true,true,0",
+     "xtype" : "Box",
      "$ xns" : "Gtk",
+     "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
      "items" : [
       {
        "* init" : "  this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n   this.el.set_size_request(-1,200);\n \n",
        "$ shadow_type" : "Gtk.ShadowType.IN",
-       "* pack" : "add",
+       "* pack" : "pack_start,true,true,0",
        "xtype" : "ScrolledWindow",
        "$ xns" : "Gtk",
        "items" : [
@@ -38,7 +41,7 @@
           "drag_data_get" : "(drag_context, selection_data, info, time) => {\n \t//Seed.print('Palete: drag-data-get: ' + target_type);\n    if (this.dragData.length < 1 ) {\n        return; \n    }\n    \n    print(\"setting drag data to %s\\n\", this.dragData);\n   // selection_data.set_text(this.dragData ,this.dragData.length);\n   selection_data.set (selection_data.get_target (), 8, (uchar[]) this.dragData.to_utf8 ());\n\n        //this.el.dragData = \"TEST from source widget\";\n        \n        \n}"
          },
          "# string dragData" : "",
-         "* init" : " {\n    this.el.set_size_request(150,-1);\n                          //  set_reorderable: [1]\n                                  \n    var description = new Pango.FontDescription();\n    description.set_size(8000);\n    this.el.modify_font(description);\n    \n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n   // this.selection.signal['changed'].connect(function() {\n    //    _view.listeners['cursor-changed'].apply(_view, [ _view, '']);\n    //});\n    // see: http://live.gnome.org/GnomeLove/DragNDropTutorial\n     \n    Gtk.drag_source_set (\n            this.el,            /* widget will be drag-able */\n            Gdk.ModifierType.BUTTON1_MASK,       /* modifier that will start a drag */\n            BuilderApplication.targetList,            /* lists of target to support */\n            Gdk.DragAction.COPY         /* what to do with data after dropped */\n    );\n    //Gtk.drag_source_set_target_list(this.el, LeftTree.targetList);\n   \n   // Gtk.drag_source_set_target_list(this.el, Application.targetList);\n   // Gtk.drag_source_add_text_targets(this.el); \n \n}\n",
+         "* init" : " {\n    this.el.set_size_request(150,-1);\n                          //  set_reorderable: [1]\n                                  \n    var description = new Pango.FontDescription();\n    description.set_size(8000);\n    this.el.override_font(description);\n    \n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n   // this.selection.signal['changed'].connect(function() {\n    //    _view.listeners['cursor-changed'].apply(_view, [ _view, '']);\n    //});\n    // see: http://live.gnome.org/GnomeLove/DragNDropTutorial\n     \n    Gtk.drag_source_set (\n            this.el,            /* widget will be drag-able */\n            Gdk.ModifierType.BUTTON1_MASK,       /* modifier that will start a drag */\n            BuilderApplication.targetList,            /* lists of target to support */\n            Gdk.DragAction.COPY         /* what to do with data after dropped */\n    );\n    //Gtk.drag_source_set_target_list(this.el, LeftTree.targetList);\n   \n   // Gtk.drag_source_set_target_list(this.el, Application.targetList);\n   // Gtk.drag_source_add_text_targets(this.el); \n \n}\n",
          "xtype" : "TreeView",
          "* pack" : "add",
          "$ enable_tree_lines" : true,
index f6cb2f3..046771a 100644 (file)
@@ -1,8 +1,8 @@
 static Xcls_RightPalete  _RightPalete;
 
-public class Xcls_RightPalete : Object 
+public class Xcls_RightPalete : Object
 {
-    public Gtk.VBox el;
+    public Gtk.Box el;
     private Xcls_RightPalete  _this;
 
     public static Xcls_RightPalete singleton()
@@ -21,21 +21,21 @@ public class Xcls_RightPalete : Object
     public signal void before_node_change(JsRender.Node? node) ;
     public signal void drag_end() ;
 
-    // ctor 
+    // ctor
     public Xcls_RightPalete()
     {
         _this = this;
-        this.el = new Gtk.VBox( true, 0 );
+        this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
         // my vars (dec)
 
         // set gobject values
         var child_0 = new Xcls_viewbox( _this );
         child_0.ref();
-        this.el.add (  child_0.el  );
+        this.el.pack_start (  child_0.el , true,true,0 );
     }
 
-    // user defined functions 
+    // user defined functions
     public void load (Palete.Palete pal, string cls ) {
        
        // this.get('model').expanded();
@@ -58,32 +58,32 @@ public class Xcls_RightPalete : Object
     public void clear () {
        this.model.el.clear();
     }
-    public class Xcls_viewbox : Object 
+    public class Xcls_viewbox : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private Xcls_RightPalete  _this;
 
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_viewbox(Xcls_RightPalete _owner )
         {
             _this = _owner;
             _this.viewbox = this;
-            this.el = new Gtk.VBox( true, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
             var child_0 = new Xcls_ScrolledWindow3( _this );
             child_0.ref();
-            this.el.add (  child_0.el  );
+            this.el.pack_start (  child_0.el , true,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_ScrolledWindow3 : Object 
+    public class Xcls_ScrolledWindow3 : Object
     {
         public Gtk.ScrolledWindow el;
         private Xcls_RightPalete  _this;
@@ -91,7 +91,7 @@ public class Xcls_RightPalete : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_ScrolledWindow3(Xcls_RightPalete _owner )
         {
             _this = _owner;
@@ -105,15 +105,15 @@ public class Xcls_RightPalete : Object
             child_0.ref();
             this.el.add (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
                this.el.set_size_request(-1,200);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_TreeView4 : Object 
+    public class Xcls_TreeView4 : Object
     {
         public Gtk.TreeView el;
         private Xcls_RightPalete  _this;
@@ -122,7 +122,7 @@ public class Xcls_RightPalete : Object
             // my vars (def)
         public string dragData;
 
-        // ctor 
+        // ctor
         public Xcls_TreeView4(Xcls_RightPalete _owner )
         {
             _this = _owner;
@@ -140,7 +140,7 @@ public class Xcls_RightPalete : Object
             child_1.ref();
             this.el.append_column (  child_1.el  );
 
-            // init method 
+            // init method
 
             {
                 this.el.set_size_request(150,-1);
@@ -148,7 +148,7 @@ public class Xcls_RightPalete : Object
                                               
                 var description = new Pango.FontDescription();
                 description.set_size(8000);
-                this.el.modify_font(description);
+                this.el.override_font(description);
                 
                 var selection = this.el.get_selection();
                 selection.set_mode( Gtk.SelectionMode.SINGLE);
@@ -170,7 +170,7 @@ public class Xcls_RightPalete : Object
              
             }
 
-            // listeners 
+            //listeners
             this.el.button_press_event.connect( ( event) => {
             
              //        if (!this.get('/Editor').save()) {
@@ -232,9 +232,9 @@ public class Xcls_RightPalete : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_model : Object 
+    public class Xcls_model : Object
     {
         public Gtk.ListStore el;
         private Xcls_RightPalete  _this;
@@ -242,7 +242,7 @@ public class Xcls_RightPalete : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_model(Xcls_RightPalete _owner )
         {
             _this = _owner;
@@ -254,7 +254,7 @@ public class Xcls_RightPalete : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
         public string getValue (Gtk.TreeIter iter, int col)  {
             GLib.Value gval;
              this.el.get_value(iter, col , out gval);
@@ -263,7 +263,8 @@ public class Xcls_RightPalete : Object
             
         }
     }
-    public class Xcls_TreeViewColumn6 : Object 
+
+    public class Xcls_TreeViewColumn6 : Object
     {
         public Gtk.TreeViewColumn el;
         private Xcls_RightPalete  _this;
@@ -271,7 +272,7 @@ public class Xcls_RightPalete : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_TreeViewColumn6(Xcls_RightPalete _owner )
         {
             _this = _owner;
@@ -285,14 +286,14 @@ public class Xcls_RightPalete : Object
             child_0.ref();
             this.el.pack_start (  child_0.el , true );
 
-            // init method 
+            // init method
 
             this.el.add_attribute(_this.txtrender.el , "markup", 0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_txtrender : Object 
+    public class Xcls_txtrender : Object
     {
         public Gtk.CellRendererText el;
         private Xcls_RightPalete  _this;
@@ -300,7 +301,7 @@ public class Xcls_RightPalete : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_txtrender(Xcls_RightPalete _owner )
         {
             _this = _owner;
@@ -312,6 +313,11 @@ public class Xcls_RightPalete : Object
             // set gobject values
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
+
+
+
+
 }
index 9ce5028..7a76cba 100644 (file)
@@ -5,30 +5,34 @@
  "path" : "/home/alan/gitlive/app.Builder.js/src/Builder4/WindowRooView.bjs",
  "permname" : "",
  "modOrder" : "",
+ "build_module" : "builder",
  "items" : [
   {
    "id" : "WindowRooView",
-   "| void createThumb" : "() {\n    \n    \n    if (this.file == null) {\n        return;\n    }\n    var filename = this.file.getIconFileName(false);\n    \n    var  win = this.el.get_parent_window();\n    var width = win.get_width();\n    var height = win.get_height();\n\n    Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, this.el.position);\n\n    screenshot.save(filename,\"png\");\n    return;\n    \n    \n    \n    \n    \n    \n    \n    var p = new WebKit.PrintOperation(_this.view.el);\n     \n    var ps = new Gtk.PrintSettings();\n    ps.set_printer(\"Print to File\");\n    ps.set(\"output-file-format\", \"pdf\");\n    ps.set(\"output-uri\", \"file://\" + filename + \".pdf\");\n\n    // find the printer...\n    \n    /*\n    var ar = Gtk.PaperSize.get_paper_sizes(false);\n    var psetup = new Gtk.PageSetup();\n    for(var i = 0; i < ar.length(); i++) {\n        if (ar.nth_data(i).get_name() ==\"iso_a4\") {\n            psetup.set_paper_size(ar.nth_data(i));\n        }\n    }\n    psetup.set_orientation(Gtk.PageOrientation.LANDSCAPE);\n    \n     \n    p.set_page_setup(psetup);\n    */\n    p.set_print_settings(ps);\n    \n    p.finished.connect(() => {\n        print(\"creating thumbnail for \" + filename + \".pdf\\n\"); \n        var s = new Cairo.PdfSurface(filename + \".pdf\", 400,400);\n    \n        s.write_to_png (filename);\n        \n       // var f = GLib.File.new_for_path (filename + \".pdf\");\n       // f.delete();\n    });\n    \n    \n    p.print();\n    \n    // should we hold until it's printed...\n    \n      \n\n    \n    \n\n\n    \n     \n}\n",
    "| void loadFile" : "(JsRender.JsRender file)\n{\n    this.file = file;\n    this.view.renderJS(true);\n}",
+   "| void createThumb" : "() {\n    \n    \n    if (this.file == null) {\n        return;\n    }\n    var filename = this.file.getIconFileName(false);\n    \n    var  win = this.el.get_parent_window();\n    var width = win.get_width();\n  //  var height = win.get_height();\n    try { \n        Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, this.el.position);\n        screenshot.save(filename,\"png\");\n    } catch(Error e) {\n        //noop\n    }\n\n    \n    \n    \n\n\n    \n     \n}\n",
    "* pack" : "add",
-   "xtype" : "VPaned",
+   "xtype" : "Paned",
    "# JsRender.JsRender file" : "",
    "| void requestRedraw" : "() {\n    this.view.renderJS(false);\n}",
    "$ xns" : "Gtk",
+   "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
    "items" : [
     {
      "id" : "viewbox",
+     "xtype" : "Box",
      "* pack" : "pack1,true,true",
-     "xtype" : "VBox",
      "$ xns" : "Gtk",
+     "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
      "$ homogeneous" : false,
      "items" : [
       {
        "$ vexpand" : false,
-       "$ height_request" : 20,
        "* pack" : "pack_start,false,true,0",
-       "xtype" : "HBox",
+       "$ height_request" : 20,
+       "xtype" : "Box",
        "$ xns" : "Gtk",
+       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "$ homogeneous" : true,
        "items" : [
         {
@@ -36,8 +40,8 @@
           "clicked" : "( ) => {\n    _this.view.renderJS(  true);\n}"
          },
          "label" : "Redraw",
-         "xtype" : "Button",
          "* pack" : "pack_start,false,false,0",
+         "xtype" : "Button",
          "$ xns" : "Gtk"
         },
         {
           "clicked" : " () => {\n  _this.view.redraws = 99;\n    _this.view.el.web_context.clear_cache();  \n  //_this.view.renderJS(true);\n  FakeServerCache.clear();\n  _this.view.reInit();\n\n}"
          },
          "label" : "Full Redraw",
-         "xtype" : "Button",
          "* pack" : "pack_start,false,false,0",
+         "xtype" : "Button",
          "$ xns" : "Gtk"
         }
        ]
       },
       {
        "id" : "viewcontainer",
-       "* init" : "  this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
        "$ shadow_type" : "Gtk.ShadowType.IN",
+       "* init" : "  this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
        "* pack" : "pack_end,true,true,0",
        "xtype" : "ScrolledWindow",
        "$ xns" : "Gtk",
@@ -88,7 +92,7 @@
          "# WebKit.WebInspector inspector" : "",
          "# string runjs" : "\"\"",
          "# int redraws" : 0,
-         "| void runRefresh" : " () \n{\n    // this is run every 2 seconds from the init..\n\n  \n    \n    if (!this.refreshRequired) {\n       // print(\"no refresh required\");\n        return;\n    }\n\n    if (this.lastRedraw != null) {\n       // do not redraw if last redraw was less that 5 seconds ago.\n       if ((int64)(new DateTime.now_local()).difference(this.lastRedraw) < 5000 ) {\n            return;\n        }\n    }\n    \n    if (_this.file == null) {\n        return;\n    }\n    \n    \n     this.refreshRequired = false;\n   //  print(\"HTML RENDERING\");\n     \n     \n     //this.get('/BottomPane').el.show();\n     //this.get('/BottomPane').el.set_current_page(2);// webkit inspector\n    _this.file.webkit_page_id  = this.el.get_page_id();\n    \n    var js = _this.file.toSourcePreview();\n\n    if (js.length < 1) {\n        print(\"no data\");\n        return;\n    }\n//    var  data = js[0];\n    this.redraws++;\n  \n    var project = _this.file.project;  \n\n     //print (project.fn);\n     // set it to non-empty.\n     \n//     runhtml = runhtml.length ?  runhtml : '<script type=\"text/javascript\"></script>'; \n\n\n//   this.runhtml  = this.runhtml || '';\n \n \n    // then we need to reload the browser using\n    // load_html_string..\n\n    // then trigger a redraw once it's loaded..\n    this.pendingRedraw = true;\n\n    var runhtml = \"<script type=\\\"text/javascript\\\">\\n\" ;\n    string builderhtml;\n    \n    \n    GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + \"/resources/roo.builder.js\", out builderhtml);\n\n    runhtml += builderhtml + \"\\n\";\n    runhtml += \"</script>\\n\" ;\n\n    // fix to make sure they are the same..\n    this.runhtml = project.runhtml;\n    // need to modify paths\n\n    string inhtml;\n    var base_template = _this.file.project.base_template;\n    \n    if (base_template.length > 0 && !FileUtils.test(\n        BuilderApplication.configDirectory() + \"/resources/\" +  base_template, FileTest.EXISTS)  \n        ) {\n           print(\"invalid base_template name - using default:  %s\\n\", base_template);\n           base_template = \"\";\n    \n    }\n    \n    GLib.FileUtils.get_contents(\n        BuilderApplication.configDirectory() + \"/resources/\" + \n            (base_template.length > 0 ? base_template :  \"roo.builder.html\")\n            , out inhtml);\n    \n    \n    this.renderedData = js;\n\n\n    string js_src = js + \"\\n\" +\n\t\"Roo.onReady(function() {\\n\" +\n\t\"if (\" + _this.file.name +\".show) \" +  _this.file.name +\".show({});\\n\" +\n\t\"Roo.XComponent.build();\\n\" +\n\t\"});\\n\";\n\t\n   // print(\"render js: \" + js);\n    //if (!this.ready) {\n  //      console.log('not loaded yet');\n    //}\n    this.lastRedraw = new DateTime.now_local();\n\n\n    //this.runjs = js_src;\n    var fc =    FakeServerCache.factory_with_data(js_src);\n    this.runjs = fc.fname;\n    \n        var html = inhtml.replace(\"</head>\", runhtml + this.runhtml + \n            \"<script type=\\\"text/javascript\\\" src=\\\"xhttp://localhost\" + fc.fname + \"\\\"></script>\" +   \n              //  \"<script type=\\\"text/javascript\\\">\\n\" +\n              //  js_src + \"\\n\" + \n              //  \"</script>\" + \n                        \n        \"</head>\");\n        //print(\"LOAD HTML \" + html);\n        \n         var rootURL = _this.file.project.rootURL;\n   \n        \n        \n        this.el.load_html( html , \n            //fixme - should be a config option!\n            (rootURL.length > 0 ? rootURL : \"xhttp://localhost/app.Builder.js/\")\n        );\n        \n    // force the inspector...        \n       //   this.initInspector();\n        \n        // - no need for this, the builder javascript will call it when build is complete\n        //GLib.Timeout.add_seconds(1, () => {\n        //    this.el.run_javascript(\"Builder.saveHTML()\",null);\n        //    return false;\n        //});\n//     print( \"before render\" +    this.lastRedraw);\n//    print( \"after render\" +    (new Date()));\n    \n}\n                                                                                                                                                                                                                        ",
+         "| void runRefresh" : " () \n{\n    // this is run every 2 seconds from the init..\n\n  \n    \n    if (!this.refreshRequired) {\n       // print(\"no refresh required\");\n        return;\n    }\n\n    if (this.lastRedraw != null) {\n       // do not redraw if last redraw was less that 5 seconds ago.\n       if ((int64)(new DateTime.now_local()).difference(this.lastRedraw) < 5000 ) {\n            return;\n        }\n    }\n    \n    if (_this.file == null) {\n        return;\n    }\n    \n    \n     this.refreshRequired = false;\n   //  print(\"HTML RENDERING\");\n     \n     \n     //this.get('/BottomPane').el.show();\n     //this.get('/BottomPane').el.set_current_page(2);// webkit inspector\n    _this.file.webkit_page_id  = this.el.get_page_id();\n    \n    var js = _this.file.toSourcePreview();\n\n    if (js.length < 1) {\n        print(\"no data\");\n        return;\n    }\n//    var  data = js[0];\n    this.redraws++;\n  \n    var project = _this.file.project;  \n\n     //print (project.fn);\n     // set it to non-empty.\n     \n//     runhtml = runhtml.length ?  runhtml : '<script type=\"text/javascript\"></script>'; \n\n\n//   this.runhtml  = this.runhtml || '';\n \n \n    // then we need to reload the browser using\n    // load_html_string..\n\n    // then trigger a redraw once it's loaded..\n    this.pendingRedraw = true;\n\n    var runhtml = \"<script type=\\\"text/javascript\\\">\\n\" ;\n    string builderhtml;\n    \n    try {\n        GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + \"/resources/roo.builder.js\", out builderhtml);\n    } catch (Error e) {\n        builderhtml = \"\";\n    }\n\n    runhtml += builderhtml + \"\\n\";\n    runhtml += \"</script>\\n\" ;\n\n    // fix to make sure they are the same..\n    this.runhtml = project.runhtml;\n    // need to modify paths\n\n    string inhtml;\n    var base_template = _this.file.project.base_template;\n    \n    if (base_template.length > 0 && !FileUtils.test(\n        BuilderApplication.configDirectory() + \"/resources/\" +  base_template, FileTest.EXISTS)  \n        ) {\n           print(\"invalid base_template name - using default:  %s\\n\", base_template);\n           base_template = \"\";\n    \n    }\n    try {\n        GLib.FileUtils.get_contents(\n            BuilderApplication.configDirectory() + \"/resources/\" + \n                (base_template.length > 0 ? base_template :  \"roo.builder.html\")\n                , out inhtml);\n    \n    } catch (Error e) {\n        inhtml = \"\";\n    }    \n    this.renderedData = js;\n\n\n    string js_src = js + \"\\n\" +\n\t\"Roo.onReady(function() {\\n\" +\n\t\"if (\" + _this.file.name +\".show) \" +  _this.file.name +\".show({});\\n\" +\n\t\"Roo.XComponent.build();\\n\" +\n\t\"});\\n\";\n\t\n   // print(\"render js: \" + js);\n    //if (!this.ready) {\n  //      console.log('not loaded yet');\n    //}\n    this.lastRedraw = new DateTime.now_local();\n\n\n    //this.runjs = js_src;\n    var fc =    FakeServerCache.factory_with_data(js_src);\n    this.runjs = fc.fname;\n    \n        var html = inhtml.replace(\"</head>\", runhtml + this.runhtml + \n            \"<script type=\\\"text/javascript\\\" src=\\\"xhttp://localhost\" + fc.fname + \"\\\"></script>\" +   \n              //  \"<script type=\\\"text/javascript\\\">\\n\" +\n              //  js_src + \"\\n\" + \n              //  \"</script>\" + \n                        \n        \"</head>\");\n        //print(\"LOAD HTML \" + html);\n        \n         var rootURL = _this.file.project.rootURL;\n   \n        \n        \n        this.el.load_html( html , \n            //fixme - should be a config option!\n            (rootURL.length > 0 ? rootURL : \"xhttp://localhost/app.Builder.js/\")\n        );\n        \n    // force the inspector...        \n       //   this.initInspector();\n        \n        // - no need for this, the builder javascript will call it when build is complete\n        //GLib.Timeout.add_seconds(1, () => {\n        //    this.el.run_javascript(\"Builder.saveHTML()\",null);\n        //    return false;\n        //});\n//     print( \"before render\" +    this.lastRedraw);\n//    print( \"after render\" +    (new Date()));\n    \n}\n                                                                                                                                                                                                                        ",
          "$ xns" : "WebKit",
          "| void initInspector" : "() {\n    \n   /* if (this.inspector == this.el.get_inspector()) {\n        this.inspector.show();\n        this.inspector.open_window();        \n        print(\"init inspecter called, and inspector is the same as existing\\n\");\n        return;\n    }\n    print(\"new inspector?\\n\");\n*/\n    this.inspector = this.el.get_inspector();\n    this.inspector.ref();\n    \n    // got a new inspector...\n        \n    this.inspector.open_window.connect(() => {\n         this.inspector = this.el.get_inspector();\n        print(\"inspector attach\\n\");\n        var wv = this.inspector.get_web_view();\n        if (wv != null) {\n            print(\"got inspector web view\\n\");\n            \n            var cn = _this.inspectorcontainer.el.get_child();\n            if (cn != null) {\n                 _this.inspectorcontainer.el.remove(cn);\n             }\n            \n            _this.inspectorcontainer.el.add(wv);\n            wv.show();\n        } else {\n            //this.inspector.close();\n            \n            //this.inspector = null;\n           \n \n        }\n        return true;\n       \n    });\n    /*\n    this.inspector.closed.connect(() => {\n         print(\"inspector closed?!?\");\n         // if this happens destroy the webkit..\n         // recreate it..\n         this.el.stop_loading();\n         \n         if (_this.viewbox.el.get_parent() == null) {\n            return;\n         }\n         \n         \n        _this.viewbox.el.remove(_this.viewcontainer.el);\n        _this.el.remove(_this.inspectorcontainer.el);        \n         \n         // destory seems to cause problems.\n         //this.el.destroy();\n        //_this.viewcontainer.el.destroy();\n         //_this.inspectorcontainer.el.destroy();\n\n         this.el = null;         \n         var nv =new Xcls_viewcontainer(_this);\n         nv.ref();\n         _this.viewbox.el.pack_end(nv.el,true,true,0);\n         \n          var  inv =new Xcls_inspectorcontainer(_this);\n          inv.ref();\n          _this.el.pack2(inv.el,true,true);\n         \n         inv.el.show_all();\n         nv.el.show_all();\n         //while(Gtk.events_pending ()) Gtk.main_iteration ();\n         //_this.view.renderJS(true); \n         _this.view.refreshRequired  = true;\n       \n    }); \n    */\n    \n    this.inspector.show();\n}\n",
          "# GLib.DateTime lastRedraw" : "null",
     },
     {
      "id" : "inspectorcontainer",
-     "* init" : "  this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
      "$ shadow_type" : "Gtk.ShadowType.IN",
+     "* init" : "  this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n \n",
      "xtype" : "ScrolledWindow",
      "* pack" : "pack2,true,true",
      "$ xns" : "Gtk"
index 205f753..e741452 100644 (file)
@@ -1,8 +1,8 @@
 static Xcls_WindowRooView  _WindowRooView;
 
-public class Xcls_WindowRooView : Object 
+public class Xcls_WindowRooView : Object
 {
-    public Gtk.VPaned el;
+    public Gtk.Paned el;
     private Xcls_WindowRooView  _this;
 
     public static Xcls_WindowRooView singleton()
@@ -21,11 +21,11 @@ public class Xcls_WindowRooView : Object
         // my vars (def)
     public JsRender.JsRender file;
 
-    // ctor 
+    // ctor
     public Xcls_WindowRooView()
     {
         _this = this;
-        this.el = new Gtk.VPaned();
+        this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL );
 
         // my vars (dec)
 
@@ -38,7 +38,12 @@ public class Xcls_WindowRooView : Object
         this.el.pack2 (  child_1.el , true,true );
     }
 
-    // user defined functions 
+    // user defined functions
+    public void loadFile (JsRender.JsRender file)
+    {
+        this.file = file;
+        this.view.renderJS(true);
+    }
     public void createThumb () {
         
         
@@ -49,94 +54,45 @@ public class Xcls_WindowRooView : Object
         
         var  win = this.el.get_parent_window();
         var width = win.get_width();
-        var height = win.get_height();
-    
-        Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, this.el.position);
-    
-        screenshot.save(filename,"png");
-        return;
-        
-        
-        
-        
-        
-        
-        
-        var p = new WebKit.PrintOperation(_this.view.el);
-         
-        var ps = new Gtk.PrintSettings();
-        ps.set_printer("Print to File");
-        ps.set("output-file-format", "pdf");
-        ps.set("output-uri", "file://" + filename + ".pdf");
-    
-        // find the printer...
-        
-        /*
-        var ar = Gtk.PaperSize.get_paper_sizes(false);
-        var psetup = new Gtk.PageSetup();
-        for(var i = 0; i < ar.length(); i++) {
-            if (ar.nth_data(i).get_name() =="iso_a4") {
-                psetup.set_paper_size(ar.nth_data(i));
-            }
+      //  var height = win.get_height();
+        try { 
+            Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, this.el.position);
+            screenshot.save(filename,"png");
+        } catch(Error e) {
+            //noop
         }
-        psetup.set_orientation(Gtk.PageOrientation.LANDSCAPE);
-        
-         
-        p.set_page_setup(psetup);
-        */
-        p.set_print_settings(ps);
-        
-        p.finished.connect(() => {
-            print("creating thumbnail for " + filename + ".pdf\n"); 
-            var s = new Cairo.PdfSurface(filename + ".pdf", 400,400);
-        
-            s.write_to_png (filename);
-            
-           // var f = GLib.File.new_for_path (filename + ".pdf");
-           // f.delete();
-        });
-        
-        
-        p.print();
-        
-        // should we hold until it's printed...
-        
-          
     
         
         
+        
     
     
         
          
-    }
-    public void loadFile (JsRender.JsRender file)
-    {
-        this.file = file;
-        this.view.renderJS(true);
     }
     public void requestRedraw () {
         this.view.renderJS(false);
     }
-    public class Xcls_viewbox : Object 
+    public class Xcls_viewbox : Object
     {
-        public Gtk.VBox el;
+        public Gtk.Box el;
         private Xcls_WindowRooView  _this;
 
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_viewbox(Xcls_WindowRooView _owner )
         {
             _this = _owner;
             _this.viewbox = this;
-            this.el = new Gtk.VBox( false, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_HBox3( _this );
+            this.el.homogeneous = false;
+            var child_0 = new Xcls_Box3( _this );
             child_0.ref();
             this.el.pack_start (  child_0.el , false,true,0 );
             var child_1 = new Xcls_viewcontainer( _this );
@@ -144,25 +100,26 @@ public class Xcls_WindowRooView : Object
             this.el.pack_end (  child_1.el , true,true,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_HBox3 : Object 
+    public class Xcls_Box3 : Object
     {
-        public Gtk.HBox el;
+        public Gtk.Box el;
         private Xcls_WindowRooView  _this;
 
 
             // my vars (def)
 
-        // ctor 
-        public Xcls_HBox3(Xcls_WindowRooView _owner )
+        // ctor
+        public Xcls_Box3(Xcls_WindowRooView _owner )
         {
             _this = _owner;
-            this.el = new Gtk.HBox( true, 0 );
+            this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
+            this.el.homogeneous = true;
             this.el.height_request = 20;
             this.el.vexpand = false;
             var child_0 = new Xcls_Button4( _this );
@@ -176,9 +133,9 @@ public class Xcls_WindowRooView : Object
             this.el.pack_start (  child_2.el , false,false,0 );
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button4 : Object 
+    public class Xcls_Button4 : Object
     {
         public Gtk.Button el;
         private Xcls_WindowRooView  _this;
@@ -186,7 +143,7 @@ public class Xcls_WindowRooView : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button4(Xcls_WindowRooView _owner )
         {
             _this = _owner;
@@ -197,15 +154,16 @@ public class Xcls_WindowRooView : Object
             // set gobject values
             this.el.label = "Redraw";
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( ( ) => {
                 _this.view.renderJS(  true);
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_AutoRedraw : Object 
+
+    public class Xcls_AutoRedraw : Object
     {
         public Gtk.CheckButton el;
         private Xcls_WindowRooView  _this;
@@ -213,7 +171,7 @@ public class Xcls_WindowRooView : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_AutoRedraw(Xcls_WindowRooView _owner )
         {
             _this = _owner;
@@ -226,15 +184,16 @@ public class Xcls_WindowRooView : Object
             this.el.active = true;
             this.el.label = "Auto Redraw On";
 
-            // listeners 
+            //listeners
             this.el.toggled.connect( (state) => {
                 this.el.set_label(this.el.active  ? "Auto Redraw On" : "Auto Redraw Off");
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_Button6 : Object 
+
+    public class Xcls_Button6 : Object
     {
         public Gtk.Button el;
         private Xcls_WindowRooView  _this;
@@ -242,7 +201,7 @@ public class Xcls_WindowRooView : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_Button6(Xcls_WindowRooView _owner )
         {
             _this = _owner;
@@ -253,7 +212,7 @@ public class Xcls_WindowRooView : Object
             // set gobject values
             this.el.label = "Full Redraw";
 
-            // listeners 
+            //listeners
             this.el.clicked.connect( () => {
               _this.view.redraws = 99;
                 _this.view.el.web_context.clear_cache();  
@@ -264,9 +223,11 @@ public class Xcls_WindowRooView : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_viewcontainer : Object 
+
+
+    public class Xcls_viewcontainer : Object
     {
         public Gtk.ScrolledWindow el;
         private Xcls_WindowRooView  _this;
@@ -274,7 +235,7 @@ public class Xcls_WindowRooView : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_viewcontainer(Xcls_WindowRooView _owner )
         {
             _this = _owner;
@@ -289,14 +250,14 @@ public class Xcls_WindowRooView : Object
             child_0.ref();
             this.el.add (  child_0.el  );
 
-            // init method 
+            // init method
 
             this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
         }
 
-        // user defined functions 
+        // user defined functions
     }
-    public class Xcls_view : Object 
+    public class Xcls_view : Object
     {
         public WebKit.WebView el;
         private Xcls_WindowRooView  _this;
@@ -312,7 +273,7 @@ public class Xcls_WindowRooView : Object
         public string runhtml;
         public bool pendingRedraw;
 
-        // ctor 
+        // ctor
         public Xcls_view(Xcls_WindowRooView _owner )
         {
             _this = _owner;
@@ -330,7 +291,7 @@ public class Xcls_WindowRooView : Object
 
             // set gobject values
 
-            // init method 
+            // init method
 
             {
                 // this may not work!?
@@ -384,7 +345,7 @@ public class Xcls_WindowRooView : Object
                 
             }
 
-            // listeners 
+            //listeners
             this.el.script_dialog.connect( (dialog) => {
                 if (this.el == null) {
                     return true;
@@ -448,7 +409,7 @@ public class Xcls_WindowRooView : Object
             });
         }
 
-        // user defined functions 
+        // user defined functions
         public void reInit () {
            print("reInit?");
                  // if this happens destroy the webkit..
@@ -544,8 +505,11 @@ public class Xcls_WindowRooView : Object
             var runhtml = "<script type=\"text/javascript\">\n" ;
             string builderhtml;
             
-            
-            GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + "/resources/roo.builder.js", out builderhtml);
+            try {
+                GLib.FileUtils.get_contents(BuilderApplication.configDirectory() + "/resources/roo.builder.js", out builderhtml);
+            } catch (Error e) {
+                builderhtml = "";
+            }
         
             runhtml += builderhtml + "\n";
             runhtml += "</script>\n" ;
@@ -564,13 +528,15 @@ public class Xcls_WindowRooView : Object
                    base_template = "";
             
             }
+            try {
+                GLib.FileUtils.get_contents(
+                    BuilderApplication.configDirectory() + "/resources/" + 
+                        (base_template.length > 0 ? base_template :  "roo.builder.html")
+                        , out inhtml);
             
-            GLib.FileUtils.get_contents(
-                BuilderApplication.configDirectory() + "/resources/" + 
-                    (base_template.length > 0 ? base_template :  "roo.builder.html")
-                    , out inhtml);
-            
-            
+            } catch (Error e) {
+                inhtml = "";
+            }    
             this.renderedData = js;
         
         
@@ -713,7 +679,10 @@ public class Xcls_WindowRooView : Object
             this.refreshRequired  = true;
         }
     }
-    public class Xcls_inspectorcontainer : Object 
+
+
+
+    public class Xcls_inspectorcontainer : Object
     {
         public Gtk.ScrolledWindow el;
         private Xcls_WindowRooView  _this;
@@ -721,7 +690,7 @@ public class Xcls_WindowRooView : Object
 
             // my vars (def)
 
-        // ctor 
+        // ctor
         public Xcls_inspectorcontainer(Xcls_WindowRooView _owner )
         {
             _this = _owner;
@@ -733,11 +702,12 @@ public class Xcls_WindowRooView : Object
             // set gobject values
             this.el.shadow_type = Gtk.ShadowType.IN;
 
-            // init method 
+            // init method
 
             this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
         }
 
-        // user defined functions 
+        // user defined functions
     }
+
 }
index 20a81d1..2f7f753 100644 (file)
@@ -16,6 +16,7 @@ public class WindowState : Object
                PROP,
                LISTENER,
                CODE,
+               CODEONLY,
                FILES,
                PROJECT // project settings..
        }
@@ -34,7 +35,6 @@ public class WindowState : Object
        public Editor               code_editor;    
        public Xcls_WindowRooView   window_rooview;
        public Xcls_GtkView         window_gladeview;
-       public Xcls_ValaCompileErrors  valacompileerrors;
        
        public Xcls_ClutterFiles     clutterfiles;
 
@@ -48,6 +48,10 @@ public class WindowState : Object
        // dialogs??
        public Xcls_DialogPluginWebkit webkit_plugin;
        
+       
+       public Palete.ValaSource valasource; // the spawner that runs the vala compiler.
+       public Json.Object last_compile_result;
+       
        // ctor 
        public WindowState(Xcls_MainWindow win)
        {
@@ -79,11 +83,15 @@ public class WindowState : Object
 
                this.webkit_plugin = new Xcls_DialogPluginWebkit();
                this.template_select = new DialogTemplateSelect();
+               this.children_loaded = true;
+               
+               this.left_tree.node_selected.connect((sel) => {
+                       this.window_gladeview.sourceview.nodeSelected(sel);
+               });
+               this.valasource = new Palete.ValaSource();
+               this.valasource.compiled.connect(this.valaCompiled);
                
-               this.vala_compile_errors = new Xcls_ValaCompileErrors();
-               this.vala_compile_errors.window = this.win;
                
-               this.children_loaded = true;
        }
 
 
@@ -109,8 +117,14 @@ public class WindowState : Object
                });
         
                this.left_tree.changed.connect(() => {
-                       this.window_rooview.requestRedraw();
+                       
                        this.left_tree.model.file.save();
+                       if (this.left_tree.getActiveFile().xtype == "Roo" ) {
+                                  this.window_rooview.requestRedraw();
+                       } else {
+                                 this.window_gladeview.loadFile(this.left_tree.getActiveFile());
+                       }
+                        
                });
                 
        }
@@ -216,14 +230,16 @@ public class WindowState : Object
                });
        
                this.left_props.changed.connect(() => {
-                         if (this.left_tree.getActiveFile().xtype == "Roo" ) {
+                       if (this.left_tree.getActiveFile().xtype == "Roo" ) {
                                   this.window_rooview.requestRedraw();
-                                  
-                          } else {
+                       } else {
                                  this.window_gladeview.loadFile(this.left_tree.getActiveFile());
-                         }
-                         this.left_tree.model.updateSelected();
-                         this.left_tree.model.file.save();
+                       }
+                       this.left_tree.model.updateSelected();
+                       this.left_tree.model.file.save();
+                       if (this.left_tree.model.file.xtype=="Gtk") {
+                               this.valasource.checkFileSpawn(this.left_tree.model.file);
+                       }
                });
        
 
@@ -341,8 +357,15 @@ public class WindowState : Object
                // editor.save...
 
                this.code_editor.save.connect( () => {
-                        this.left_tree.model.file.save();
-                        this.left_tree.model.updateSelected();
+                       this.left_tree.model.file.save();
+                       this.left_tree.model.updateSelected();
+                       if (this.left_tree.getActiveFile().xtype == "Roo" ) {
+                                  this.window_rooview.requestRedraw();
+                       } else {
+                                 this.window_gladeview.loadFile(this.left_tree.getActiveFile());
+                       }
+                        // we do not need to call spawn... - as it's already called by the editor?
+                        
                });
                
        }
@@ -371,7 +394,7 @@ public class WindowState : Object
                this.clutterfiles = new Xcls_ClutterFiles();
                this.clutterfiles.ref();
                stage.add_child(this.clutterfiles.el);
-               this.clutterfiles.el.show_all();
+               this.clutterfiles.el.show();
 
 
                this.clutterfiles.open.connect((file) => { 
@@ -435,8 +458,13 @@ public class WindowState : Object
                this.win.setTitle(file.project.name + " : " +file.name);
                         
 
-               }
-
+       }
+       public void fileViewOpenPlain(string file)
+       {
+               
+               this.switchState (State.CODEONLY); 
+               
+       }
        
        // ---------  webkit view
        public void webkitViewInit()
@@ -482,6 +510,12 @@ public class WindowState : Object
        public void switchState(State new_state)
        {
                
+               // if the new state and the old state are the same..
+               
+               if (new_state == this.state) {
+                       return;
+               }
+               
                // save the easing state of everything..
                this.easingSaveAll();
                
@@ -507,13 +541,24 @@ public class WindowState : Object
                                 break;
                                
                        case State.CODE:
-
-
                                this.code_editor.saveContents();
                          
                                this.win.codeeditview.el.set_scale(0.0f,0.0f);
-                                break;
-
+                               break;
+                               
+                       case State.CODEONLY:
+                               // going from codeonly..
+                               this.win.leftpane.el.show();
+                               // enable re-calc of canvas..
+                           while (Gtk.events_pending()) { 
+                                       Gtk.main_iteration();
+                               }
+                               //this.code_editor.saveContents(); << not yet...
+                                
+                               this.win.rooview.el.show(); 
+                               this.win.codeeditview.el.set_scale(0.0f,0.0f);
+                                
+                               break;
 
                         case State.OBJECT:
                           
@@ -528,19 +573,24 @@ public class WindowState : Object
                                this.win.projecteditview.el.set_scale(0.0f,0.0f);
                                 break;
 
-                 case State.FILES:
+                 case State.FILES: // goes to preview or codeonly...
                                // hide files...
                                
-                               this.win.rooview.el.show_all();
+                               if (new_state == State.CODEONLY) {
+                                       this.win.rooview.el.hide();
+                               } else {
+                                       this.win.rooview.el.show();
+                               }
+                               
                                this.win.rooview.el.set_easing_duration(1000);
                                this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
                                this.win.rooview.el.set_scale(1.0f,1.0f);
                                this.win.rooview.el.set_pivot_point(0.5f,0.5f);
                                this.win.rooview.el.set_opacity(0xff);
-                          
+                               
                                
                           
-                                this.clutterfiles.el.set_easing_duration(1000);
+                               this.clutterfiles.el.set_easing_duration(1000);
                                this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
                                this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, -180.0f);
                                this.clutterfiles.el.set_opacity(0);
@@ -605,7 +655,7 @@ public class WindowState : Object
                                this.win.rooview.el.set_pivot_point(1.0f,0.5f);
                                  
                                this.win.addpropsview.el.set_scale(1.0f,1.0f);
-                                break;
+                               break;
                   
                        case State.OBJECT:
                                 var n = this.left_tree.getActiveElement();
@@ -631,23 +681,41 @@ public class WindowState : Object
 
                                
                          
-                       
+                               this.win.rooview.el.set_pivot_point(1.0f,0.5f);
                                this.win.objectview.el.set_scale(1.0f,1.0f);
                                 
                                break;
                   
                   
                        case State.CODE:
-
+                               this.win.codeeditview.el.show();
                                this.code_editor.el.show_all();
-                               
                                // caller needs to call editor - show....
-                                 
-                                this.win.codeeditview.el.set_scale(1.0f,1.0f);
-                                break;
+                               this.win.codeeditview.el.set_scale(1.0f,1.0f);
+                               this.win.rooview.el.set_pivot_point(1.0f,0.5f);
 
+                               break;
 
+                       case State.CODEONLY:
+                               // going to codeonly..
+                               this.win.codeeditview.el.show();
+                               // recalc canvas...
+                               while (Gtk.events_pending()) { 
+                                       Gtk.main_iteration();
+                               }
+                               
+                               this.win.leftpane.el.hide();
+                               this.win.codeeditview.el.show();
+                               //while (Gtk.events_pending()) { 
+                               //      Gtk.main_iteration();
+                               //}
+                               
+                               
+                               this.code_editor.el.show_all();
+                           
+                               this.win.codeeditview.el.set_scale(1.0f,1.0f);
+                               this.win.rooview.el.set_pivot_point(1.0f,0.5f);
+                               break;
 
                   case State.PROJECT:
 
@@ -666,33 +734,35 @@ public class WindowState : Object
                           
                                break;
                                
-                  case State.FILES:  // can only get here from PREVIEW state.. in theory..
+                  case State.FILES:  // can only get here from PREVIEW (or code-only) state.. in theory..
                                
    
                                this.win.editpane.el.hide(); // holder for tree and properties..
-                        
+                               
                                this.left_projects.el.show(); 
-                       
-                                this.win.rooview.el.set_easing_duration(1000);
+                               
+                               // rotate the preview to hidden...
+                               this.win.rooview.el.set_easing_duration(1000);
                                this.win.rooview.el.set_pivot_point(0.5f,0.5f);
                                this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 180.0f);
                                this.win.rooview.el.set_opacity(0);
-                               //el.set_scale(0.0f,0.0f);
-
+                        
+                               
+                               
+        
                                if (this.win.project != null) {
                                        this.left_projects.selectProject(this.win.project);
                                }
                         
                                
-                               this.clutterfiles.el.show_all();
+                               this.clutterfiles.el.show();
                                 
                                this.clutterfiles.el.set_easing_duration(1000);
                                this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
                                this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
                                this.clutterfiles.el.set_opacity(0xff);
                                
-                               
+                                
                                
                                break;
 
@@ -701,6 +771,8 @@ public class WindowState : Object
                this.resizeCanvasElements();
                this.easingRestoreAll();
                
+               // run the animation.. - then load files...
+               
                        
        }
        
@@ -761,6 +833,7 @@ public class WindowState : Object
                
                switch ( this.state) {
                        case State.PREVIEW:
+                                
                                this.win.rooview.el.set_size(alloc.width-50, alloc.height);
                                break;
        
@@ -774,6 +847,7 @@ public class WindowState : Object
                
                           // this.win.rooview.el.save_easing_state();
                                //this.win.rooview.el.set_size(alloc.width / 2.0f, alloc.height / 2.0f);
+                                
                                this.win.rooview.el.set_scale(0.5f, 0.5f);
                                //this.win.rooview.el.restore_easing_state();
                                break;
@@ -787,6 +861,14 @@ public class WindowState : Object
                           // this.win.rooview.el.restore_easing_state();
                                break;
                                
+                       case State.CODEONLY: 
+                               this.win.codeeditview.el.set_size(codesize, alloc.height);
+                               var scale = avail > 0.0f ? (avail - codesize -10 ) / avail : 0.0f;
+                               //this.win.rooview.el.save_easing_state();
+                               this.win.rooview.el.hide(); 
+                               this.win.rooview.el.set_scale(scale,scale);
+                          // this.win.rooview.el.restore_easing_state();
+                               break;  
                        case State.PROP:
                        case State.LISTENER:
                                 this.win.addpropsview.el.set_size(palsize, alloc.height);
@@ -842,6 +924,9 @@ public class WindowState : Object
                                this.win.addlistenerbutton.el.show(); 
                                break;
                        
+                       case State.CODEONLY: 
+                               this.win.projectbutton.el.show();
+                               break;
                   
                        case State.CODE: 
                        case State.PROP:
@@ -873,9 +958,54 @@ public class WindowState : Object
                                
                                break;
                }
+               
+               
 
        }
+       
+       
+       public void valaCompiled(Json.Object obj)
+               {
+                       // vala has finished compiling...
+                       print("vala compiled");
+                       
+                       var buf = this.code_editor.buffer;
+                       buf.check_running = false;
+                                     
+                       if (obj.has_member("ERR-TOTAL")) {
+                                this.win.statusbar_errors.setNotices( obj.get_object_member("ERR") , (int) obj.get_int_member("ERR-TOTAL"));
+                       } else {
+                                this.win.statusbar_errors.setNotices( new Json.Object() , 0);
+                       }    
+                       
+                       if (obj.has_member("WARN-TOTAL")) {
 
+                                this.win.statusbar_warnings.setNotices(obj.get_object_member("WARN"), (int) obj.get_int_member("WARN-TOTAL"));
+                       } else {
+                                this.win.statusbar_warnings.setNotices( new Json.Object() , 0);
+                                
+                       }
+                       if (obj.has_member("DEPR-TOTAL")) {
+                               
+                                this.win.statusbar_depricated.setNotices( obj.get_object_member("DEPR"),  (int) obj.get_int_member("DEPR-TOTAL"));
+                                
+                       } else {
+                               this.win.statusbar_depricated.setNotices( new Json.Object(),0);
+                       }
+                       
+                       buf.highlightErrorsJson("ERR", obj);
+                       buf.highlightErrorsJson("WARN", obj);
+                       buf.highlightErrorsJson("DEPR", obj);
+                       
+                       var gbuf =   this.window_gladeview.sourceview;
+                       gbuf.highlightErrorsJson("ERR", obj);
+                       gbuf.highlightErrorsJson("WARN", obj);
+                       gbuf.highlightErrorsJson("DEPR", obj);                  
+                       
+                       this.last_compile_result = obj;
+                       
+                       
+               }
        
 }
 
index 1f0daa0..b904215 100644 (file)
@@ -60,7 +60,8 @@
             "../Palete/VapiParser.vala",
             "../Builder4/PopoverFileDetails.vala",
             "../../src/Spawn.vala",
-            "../Builder4/ValaCompileErrors.vala"
+            "../Builder4/ValaCompileErrors.vala",
+            "../Palete/ValaSourceCompiler.vala"
         ],
         "packages" : [
         ]
index 7c7a29d..7118f6c 100644 (file)
@@ -116,7 +116,7 @@ namespace JsRender {
                                this.tree.loadFromJson(tree_base, int.parse(bjs_version_str));
 
                        }
-                               
+                       NodeToVala.mungeFile(this); // force line numbering..
                        
                }
          
@@ -195,7 +195,7 @@ namespace JsRender {
                }
                var fn = GLib.Path.get_dirname(this.path) + "/" + this.name + ".vala";
                print("WRITE :%s\n " , fn);
-               this.writeFile(fn,  NodeToVala.mungeFile(this));
+                       this.writeFile(fn,  NodeToVala.mungeFile(this));
             
             
         }
index bd60507..43e15da 100644 (file)
@@ -400,6 +400,17 @@ namespace JsRender {
                        
                    
                }
+               public  Node? lineToNode(int line)
+               {
+                       if (this.tree == null) {
+                               return null;
+                       }
+                       return this.tree.lineToNode(line);
+                       
+                       
+               }
+               
+               
                public abstract void save();
                public abstract void saveHTML(string html);
                public abstract string toSource() ;
index 425a2a2..b034701 100644 (file)
@@ -102,8 +102,13 @@ public class JsRender.Node : Object {
        public string  xvala_cls;
        public string xvala_xcls; // 'Xcls_' + id;
        public string xvala_id; // item id or ""
-               
-
+       public int line_start;
+       public int line_end;
+       public Gee.ArrayList<int> lines;
+       public Gee.HashMap<int,string> line_map; // store of l:xxx or p:....
+       public Gee.ArrayList<int> node_lines;
+       public Gee.HashMap<int,Node> node_lines_map; // store of l:xxx or p:....
+       
 
        public Node()
        {
@@ -114,8 +119,62 @@ public class JsRender.Node : Object {
                this.xvala_xcls = "";
                this.xvala_id = "";
                this.parent = null;
+               this.line_start = -1;
+               this.line_end = -1;             
+               this.lines = new Gee.ArrayList<int>();
+               this.line_map = new Gee.HashMap<int,string>();
+               this.node_lines = new Gee.ArrayList<int>();
+               this.node_lines_map = new Gee.HashMap<int,Node>();
+               
+       }
+       
+       public void setNodeLine(int line, Node node) {
+               this.node_lines.add(line);
+               this.node_lines_map.set(line, node);
+       }
+       
+       public void setLine(int line, string type, string prop) {
+               this.lines.add(line);
+               this.line_map.set(line, type +":" + prop);
+       }
+       public void sortLines() {
+               this.lines.sort((a,b) => {   
+                       return (int)b-(int)a;
+               });
+               this.node_lines.sort((a,b) => {   
+                       return (int)b-(int)a;
+               });
+       }
+       public Node? lineToNode(int line)
+       {
+               print("Searching for line %d\n",line);
+               var l = -1;
+               foreach(int el in this.node_lines) {
+                       print("?match %d\n", el);
+                       if (el < line) {
+                               
+                               l = el;
+                               print("LESS\n");
+                               continue;
+                       }
+                       if (el == line) {
+                               print("SAME\n");
+                               l = el;
+                       }
+                       if (l > -1) {
+                               print("RETURNING NODE ON LINE %d", l);
+                               return this.node_lines_map.get(l);
+                       }
+                       return null;
+                       
+               }
+               if (l > -1) {
+                       print("RETURNING NODE ON LINE %d", l);
+                       return this.node_lines_map.get(l);
+               }
+               return null;
+               
        }
-
        
        public string uid()
        {
index 51bce79..1a15190 100644 (file)
@@ -168,13 +168,50 @@ public class JsRender.NodeToGtk : Object {
                                // print("Check: " +cls + "::(" + pviter.get_value().propertyof + ")" + pviter.get_key() + " " );
                        var k = pviter.get_key();
                        // skip items we have already handled..
-                       if  (!this.node.has(k)) {
+                       if  (!this.node.has(k)) {
                                continue;
                        }
                        // find out the type of the property...
                        var type = pviter.get_value().type;
                        type = Palete.Gir.fqtypeLookup(type, ns);
 
+                       var  ocl = (ObjectClass) cls_gtype.class_ref ();
+                       var ps = ocl.find_property(k);
+                       
+                       // attempt to read property type and enum...
+                       
+                       if (ps != null) {
+                               var vt = ps.value_type;
+                               if (vt.is_enum()) {
+                                       
+                                       var raw_val = this.node.get(k).strip();
+                                       var rv_s = raw_val.split(".");
+                                       if (rv_s.length > 0) {
+                                               raw_val = rv_s[rv_s.length-1];                                  
+                                               EnumClass ec = (EnumClass) vt.class_ref ();
+                                               var foundit = false;
+                                               for (var i =0;i< ec.n_values; i++) {
+                                                       var ev = ec.values[i].value_name;
+                                                       var ev_s= ev.split("_");
+                                                       if (raw_val == ev_s[ev_s.length-1]) {
+                                                               var sval = GLib.Value(typeof(int));
+                                                               sval.set_int(ec.values[i].value);
+                                                               ret.set_property(k, sval);
+                                                               foundit = true;
+                                                               break;
+                                                       }
+                                               }
+                                               if (foundit) {
+                                                       continue;
+                                               }
+                                                       
+                                       }
+                               }
+                       }
+
+
+                       
+
                        var val = this.toValue(this.node.get(k).strip(), type);
                        if (val == null) {
                                print("skip (failed to transform value %s type = %s from %s\n", 
index e25fafc..0d8022a 100644 (file)
@@ -4,6 +4,10 @@
  * 
  * usage : x = (new JsRender.NodeToJs(node)).munge();
  * 
+ * 
+ * 
+ * 
+ * 
 */
 
 
@@ -11,7 +15,7 @@
 
 public class JsRender.NodeToVala : Object {
 
-        Node node;
+       Node node;
 
        int depth;
        string inpad;
@@ -21,6 +25,8 @@ public class JsRender.NodeToVala : Object {
        string xcls;
        
        string ret;
+       
+       int cur_line;
 
        Gee.ArrayList<string> ignoreList;
        Gee.ArrayList<string> ignoreWrappedList; 
@@ -29,7 +35,11 @@ public class JsRender.NodeToVala : Object {
        NodeToVala top;
        JsRender file;
        
-       public NodeToVala( Node node,  int depth, NodeToVala? top) 
+       /* 
+        * ctor - just initializes things
+        * - wraps a render node 
+        */
+       public NodeToVala( Node node,  int depth, NodeToVala? parent) 
        {
 
                
@@ -41,26 +51,40 @@ public class JsRender.NodeToVala : Object {
                this.cls = node.xvala_cls;
                this.xcls = node.xvala_xcls;
                this.ret = "";
-               this.top = top == null ? this : top;
+               this.cur_line = parent == null ? 0 : parent.cur_line;
+               
+               
+               this.top = parent == null ? this : parent.top;
                this.ignoreList = new Gee.ArrayList<string>();
                this.ignoreWrappedList  = new Gee.ArrayList<string>();
                this.myvars = new Gee.ArrayList<string>();
                this.vitems = new Gee.ArrayList<Node>();
                this.file = null;
+               
+               // initialize line data..
+               node.line_start = this.cur_line;
+               node.line_end  = this.cur_line;
+               node.lines = new Gee.ArrayList<int>();
+               node.line_map = new Gee.HashMap<int,string>();
+               if (parent == null) {
+                       node.node_lines = new Gee.ArrayList<int>();
+                       node.node_lines_map = new Gee.HashMap<int,Node>();
+                }
+               
        }
 
        public int vcnt = 0;
        string toValaNS(Node item)
-        {
-            var ns = item.get("xns") ;
-            if (ns == "GtkSource") {
-                return "Gtk.Source";
-            }
-            return ns + ".";
-        }
+       {
+               var ns = item.get("xns") ;
+               if (ns == "GtkSource") {
+                       return "Gtk.Source";
+               }
+               return ns + ".";
+       }
        public void  toValaName(Node item, int depth =0) 
        {
-               this.vcnt++;
+               this.vcnt++;
 
                var ns =  this.toValaNS(item) ;
                var cls = ns + item.get("xtype");
@@ -93,16 +117,18 @@ public class JsRender.NodeToVala : Object {
 
                }
                // loop children..
-                                                                              
+                                                                                                                          
                if (item.items.size < 1) {
                        return;
                }
                for(var i =0;i<item.items.size;i++) {
                        this.toValaName(item.items.get(i), depth+1);
                }
-                                 
-        }
-
+                                         
+       }
+       /**
+        *  Main entry point to convert a file into a string..
+        */
        public static string mungeFile(JsRender file) 
        {
                if (file.tree == null) {
@@ -116,7 +142,7 @@ public class JsRender.NodeToVala : Object {
                n.toValaName(file.tree);
                
                
-               print("top cls %s / xlcs %s\n ",file.tree.xvala_cls,file.tree.xvala_cls); 
+               GLib.debug("top cls %s / xlcs %s\n ",file.tree.xvala_cls,file.tree.xvala_cls); 
                n.cls = file.tree.xvala_cls;
                n.xcls = file.tree.xvala_xcls;
                return n.munge();
@@ -155,58 +181,82 @@ public class JsRender.NodeToVala : Object {
                
                return this.ret;
                 
-                    
+                        
        } 
        public string mungeChild(  Node cnode)
        {
-               var x = new  NodeToVala(cnode,  this.depth+1, this.top);
+               var x = new  NodeToVala(cnode,  this.depth+1, this);
                return x.munge();
        }
-
+       public void addLine(string str= "")
+       {
+               this.cur_line++;
+               //this.ret += "/*%d*/ ".printf(this.cur_line-1) + str + "\n";
+               this.ret += str + "\n";
+       }
+       public void addMultiLine(string str= "")
+       {
+               var l = this.cur_line;
+               this.cur_line += str.split("\n").length;
+               //this.ret +=  "/*%d*/ ".printf(l) + str + "\n";
+               this.ret +=   str + "\n";
+       }
+        
+       
        public void globalVars()
        {
                if (this.depth > 0) {
                        return;
                }
-                // Global Vars..
-                //this.ret += this.inpad + "public static " + this.xcls + "  " + this.node.xvala_id+ ";\n\n";
+               // Global Vars..??? when did this get removed..?
+               //this.ret += this.inpad + "public static " + this.xcls + "  " + this.node.xvala_id+ ";\n\n";
 
-               
-               this.ret += this.inpad + "static " + this.xcls + "  _" + this.node.xvala_id+ ";\n\n";
-                
-                
+               this.addLine(this.inpad + "static " + this.xcls + "  _" + this.node.xvala_id+ ";");
+               this.addLine();
+                  
        }
 
        void classHeader()
        {
-                  
-            // class header..
-            // class xxx {   WrappedGtk  el; }
-            this.ret += inpad + "public class " + this.xcls + " : Object \n" + this.inpad + "{\n";
-           this.ret +=  this.pad + "public " + this.cls + " el;\n";
-
-              
-            this.ret += this.pad + "private " + this.top.xcls + "  _this;\n\n";
-            
-            
-            
-            // singleton
+                          
+               // class header..
+               // class xxx {   WrappedGtk  el; }
+               this.node.line_start = this.cur_line;
+               
+               this.top.node.setNodeLine(this.cur_line, this.node);
+               
+               this.addLine(inpad + "public class " + this.xcls + " : Object");
+               this.addLine(this.inpad + "{");
+               
+                
+               this.addLine(this.pad + "public " + this.cls + " el;");
+               this.addLine(this.pad + "private " + this.top.xcls + "  _this;");
+               this.addLine();
+                       
+                       
+                       
+                       // singleton
        }
        void addSingleton() 
        {
-            if (depth > 0) {
-                   return;
-           }
-            this.ret += pad + "public static " + xcls + " singleton()\n" + 
-                       this.pad + "{\n" +
-                       this.ipad + "if (_" + this.node.xvala_id  + " == null) {\n" +
-                       this.ipad + "    _" + this.node.xvala_id + "= new "+ this.xcls + "();\n" + // what about args?
-                       this.ipad + "}\n" +
-                       this.ipad + "return _" + this.node.xvala_id +";\n" + 
-                       this.pad + "}\n";
+               if (depth > 0) {
+                       return;
+               }
+               this.addLine(pad + "public static " + xcls + " singleton()");
+               this.addLine(this.pad + "{");
+               this.addLine(this.ipad +    "if (_" + this.node.xvala_id  + " == null) {");
+               this.addLine(this.ipad +    "    _" + this.node.xvala_id + "= new "+ this.xcls + "();");  // what about args?
+               this.addLine(this.ipad +    "}");
+               this.addLine(this.ipad +    "return _" + this.node.xvala_id +";");
+               this.addLine(this.pad + "}");
        }
-            
-
+                       
+       /**
+        * when ID is used... on an element, it registeres a property on the top level...
+        * so that _this.ID always works..
+        * 
+        */
        void addTopProperties()
        {
                if (this.depth > 0) {
@@ -219,38 +269,45 @@ public class JsRender.NodeToVala : Object {
                        var n = iter.get();
 
                         
-                       if (!n.props.has_key("id") || n.xvala_id.length < 0) {
-                               continue;
-                        
-                       }
-                       if (n.xvala_id[0] == '*') {
-                               continue;
-                       }
-                       if (n.xvala_id[0] == '+') {
-                               continue;
-                       }
-                       this.ret += this.pad + "public " + n.xvala_xcls + " " + n.xvala_id + ";\n";
-                }
-                
+                       if (!n.props.has_key("id") || n.xvala_id.length < 0) {
+                               continue;
+                               
+                       }
+                       if (n.xvala_id[0] == '*') {
+                               continue;
+                       }
+                       if (n.xvala_id[0] == '+') {
+                               continue;
+                       }
+                       this.addLine(this.pad + "public " + n.xvala_xcls + " " + n.xvala_id + ";");
+                       
+               }
+                               
        }
-        
-        void addMyVars()
+       /**
+        * create properties that are not 'part of the wrapped element.
+        * 
+        * 
+        */
+       
+       void addMyVars()
        {
-               this.ret += "\n" + this.ipad + "// my vars (def)\n";
-            
+               this.addLine();
+               this.addLine(this.ipad + "// my vars (def)");
+                       
 
  
-               var cls = Palete.Gir.factoryFqn(this.node.fqn());
-           
+               var cls = Palete.Gir.factoryFqn(this.node.fqn());
+                  
                if (cls == null) {
                        return;
                }
          
                
-               // Key = TYPE:name
+                       // Key = TYPE:name
                var iter = this.node.props.map_iterator();
                while (iter.next()) {
-                       var k = iter.get_key();
+                       var k = iter.get_key();
                        if (this.shouldIgnore(k)) {
                                continue;
                        }
@@ -262,12 +319,14 @@ public class JsRender.NodeToVala : Object {
                        if (vv[0] == "*") {
                                continue;
                        }
-                       
-                       if (vv[0] == "@") {
-                               this.ret += this.pad + "public signal" + k.substring(1)  + " "  + iter.get_value() + ";\n";
+                               
+                       if (vv[0] == "@") {
+                               this.node.setLine(this.cur_line, "p", k);
+                               this.addLine(this.pad + "public signal" + k.substring(1)  + " "  + iter.get_value() + ";");
+                               
                                this.ignore(k);
                                continue;
-                       }
+                       }
                        var min = (vv[0] == "$" || vv[0] == "#") ? 3 : 2; 
                        if (vv.length < min) {
                                // skip 'old js style properties without a type'
@@ -286,94 +345,108 @@ public class JsRender.NodeToVala : Object {
                        }
                        
                        this.myvars.add(k);
-
-                           
-                       this.ret += this.pad + "public " + 
-                               (k[0] == '$' || k[0] == '#' ? k.substring(2) : k ) + ";\n";
-                       
+                       this.node.setLine(this.cur_line, "p", k);
+                       
+                       this.addLine(this.pad + "public " + 
+                               (k[0] == '$' || k[0] == '#' ? k.substring(2) : k ) + ";");
+                               
                        this.ignore(k);
                        
-                       
+                               
                }
        }
        
-            // if id of child is '+' then it's a property of this..
-        void addPlusProperties()
+       // if id of child is '+' then it's a property of this..
+       void addPlusProperties()
        {
-               if (this.node.items.size < 1) {
-                     return;
+               if (this.node.items.size < 1) {
+                       return;
                }
                var iter = this.node.items.list_iterator();
                while (iter.next()) {
                        var ci = iter.get();
-                    
-                       if (ci.xvala_id[0] != '+') {
-                               continue; // skip generation of children?
-                        
-                       }
-                       this.ret += this.pad + "public " + ci.xvala_xcls + " " + ci.xvala_id.substring(1) + ";\n";
-                               
-                    
-                }
+                               
+                       if (ci.xvala_id[0] != '+') {
+                               continue; // skip generation of children?
+                               
+                       }
+                        
+                       this.addLine(this.pad + "public " + ci.xvala_xcls + " " + ci.xvala_id.substring(1) + ";");
+                                          
+                       
+               }
        }
-
+       /**
+        * add the constructor definition..
+        */
        void addValaCtor()
        {
-            
-            
-            // .vala props.. 
-            
-               string[] cargs = {};
-               var cargs_str = "";
-               // ctor..
-               this.ret += "\n" + this.pad + "// ctor \n";
-                       if (this.node.has("* args")) {
-                       // not sure what this is supposed to be ding..
-                       
-                       cargs_str = ", " + this.node.get("* args");
-                       //var ar = this.node.get("* args");.split(",");
-                       //for (var ari =0; ari < ar.length; ari++) {
-                       //      cargs +=  (ar[ari].trim().split(" ").pop();
-                      // }
-                }
-               
-               if (this.depth < 1) {
-                       this.ret += this.pad + "public " + this.xcls + "(" + 
-                                   cargs_str +")\n" + this.pad + "{\n";
-                       } else {
-                                       
-                                               //code 
-                                       
-                               this.ret+= this.pad + "public " + this.xcls + "(" + 
-                                       this.top.xcls + " _owner " + cargs_str + ")\n" + this.pad + "{\n";
+                       
+               
+               // .vala props.. 
+               
+               string[] cargs = {};
+               var cargs_str = "";
+               // ctor..
+               this.addLine();
+               this.addLine(this.pad + "// ctor");
+               
+               if (this.node.has("* args")) {
+                       // not sure what this is supposed to be ding..
+               
+                       cargs_str = ", " + this.node.get("* args");
+                       //var ar = this.node.get("* args");.split(",");
+                       //for (var ari =0; ari < ar.length; ari++) {
+                               //      cargs +=  (ar[ari].trim().split(" ").pop();
+                                 // }
                        }
-            
+       
+               if (this.depth < 1) {
+                
+                       // top level - does not pass the top level element..
+                       this.addLine(this.pad + "public " + this.xcls + "(" +  cargs_str +")");
+                       this.addLine(this.pad + "{");
+               } else {
+                               
+                       // for sub classes = we passs the top level as _owner
+                       this.addLine(this.pad + "public " + this.xcls + "(" +  this.top.xcls + " _owner " + cargs_str + ")");
+                       this.addLine(this.pad + "{");
+               }
+               
 
        }
+       /**
+        *  make sure _this is defined..
+        */
        void addUnderThis() 
        {
-            // public static?
-               if (depth < 1) {
-                       this.ret += this.ipad + "_this = this;\n";
+               // public static?
+               if (depth < 1) {
+                       this.addLine( this.ipad + "_this = this;");
                        return;
                }
-               this.ret+= this.ipad + "_this = _owner;\n";
+               // for non top level = _this point to owner, and _this.ID is set
+               
+               this.addLine( this.ipad + "_this = _owner;");
 
                if (this.node.props.has_key("id")
-                   &&
-                   this.node.xvala_id != "" 
-                   && 
-                   this.node.xvala_id[0] != '*' 
-                   && 
-                   this.node.xvala_id[0] != '+' 
-                   ) {
-                       this.ret+= this.ipad + "_this." + node.xvala_id  + " = this;\n";
-           
-               }
-                
-                
-   
+                       &&
+                       this.node.xvala_id != "" 
+                       && 
+                       this.node.xvala_id[0] != '*' 
+                       && 
+                       this.node.xvala_id[0] != '+' 
+                       ) {
+                               this.addLine( this.ipad + "_this." + node.xvala_id  + " = this;");
+                  
+               }
+                        
        }
+       /**
+        * Initialize this.el to point to the wrapped element.
+        * 
+        * 
+        */
 
        void addWrappedCtor()
        {
@@ -390,19 +463,14 @@ public class JsRender.NodeToVala : Object {
                }
                */
                if (this.node.has("* ctor")) {
-                       
-            
-                       this.ret +=  this.ipad + "this.el = " + this.node.get("* ctor")+ ";\n";
+                       this.node.setLine(this.cur_line, "p", "* ctor");
+                       this.addLine(this.ipad + "this.el = " + this.node.get("* ctor")+ ";");
                        return;
                }
-               // the ctor arguments...
-
-               // see what the 
-               //var default_ctor = Palete.Gir.factoryFqn(this.node.fqn() + ".newv");
-               //if (default_ctor == null) {
-                       var  default_ctor = Palete.Gir.factoryFqn(this.node.fqn() + ".new");
+                
+               var  default_ctor = Palete.Gir.factoryFqn(this.node.fqn() + ".new");
 
-               //}
+                
                if (default_ctor != null && default_ctor.paramset != null && default_ctor.paramset.params.size > 0) {
                        string[] args  = {};
                        var iter =default_ctor.paramset.params.list_iterator();
@@ -443,49 +511,53 @@ public class JsRender.NodeToVala : Object {
                                args += v;
 
                        }
-                       this.ret += this.ipad + "this.el = new " + cls + "( "+ string.joinv(", ",args) + " );\n" ;
+                       this.node.setLine(this.cur_line, "p", "* xtype");
+                       
+                       this.addLine(this.ipad + "this.el = new " + cls + "( "+ string.joinv(", ",args) + " );") ;
                        return;
                        
                }
+               this.node.setLine(this.cur_line, "p", "* xtype");;
                
-               
-                this.ret += this.ipad + "this.el = new " + this.cls + "();\n";
+               this.addLine(this.ipad + "this.el = new " + this.cls + "();");
 
-            
+                       
        }
 
        void addInitMyVars()
        {
-            //var meths = this.palete.getPropertiesFor(item['|xns'] + '.' + item.xtype, 'methods');
-            //print(JSON.stringify(meths,null,4));Seed.quit();
-            
-               
-            
-            // initialize.. my vars..
-               this.ret += "\n" + this.ipad + "// my vars (dec)\n";
+                       //var meths = this.palete.getPropertiesFor(item['|xns'] + '.' + item.xtype, 'methods');
+                       //print(JSON.stringify(meths,null,4));Seed.quit();
+                       
+                       
+                       
+                       // initialize.. my vars..
+               this.addLine();
+               this.addLine( this.ipad + "// my vars (dec)");
                
                var iter = this.myvars.list_iterator();
                while(iter.next()) {
                        
-                       var k = iter.get();
+                       var k = iter.get();
                        
-                       var ar  = k.strip().split(" ");
+                       var ar  = k.strip().split(" ");
                        var kname = ar[ar.length-1];
                        
-                       var v = this.node.props.get(k);
+                       var v = this.node.props.get(k);
                        // ignore signals.. 
-                       if (v.length < 1) {
-                               continue; 
-                       }
+                       if (v.length < 1) {
+                               continue; 
+                       }
                        if (v == "FALSE" || v == "TRUE") {
                                v = v.down();
                        }
-//FIXME -- check for raw string.. "string XXXX"
+                       //FIXME -- check for raw string.. "string XXXX"
                        
                        // if it's a string...
                        
-                       this.ret += this.ipad + "this." + kname + " = " +   v +";\n";
-               }
+                       
+                       this.addLine(this.ipad + "this." + kname + " = " +   v +";");
+               }
        }
 
        
@@ -494,12 +566,14 @@ public class JsRender.NodeToVala : Object {
        
        void addWrappedProperties()
        {
-               var cls = Palete.Gir.factoryFqn(this.node.fqn());
+               var cls = Palete.Gir.factoryFqn(this.node.fqn());
                if (cls == null) {
                        return;
                }
-            // what are the properties of this class???
-               this.ret += "\n" + this.ipad + "// set gobject values\n";
+                       // what are the properties of this class???
+               this.addLine();
+               this.addLine(this.ipad + "// set gobject values");
+               
 
                var iter = cls.props.map_iterator();
                while (iter.next()) {
@@ -512,7 +586,7 @@ public class JsRender.NodeToVala : Object {
                                continue;
                        }
                        
-                       this.ignore(p);
+                               this.ignore(p);
                        var v = this.node.get(p);
 
                        var nodekey = this.node.get_key(p);
@@ -538,91 +612,103 @@ public class JsRender.NodeToVala : Object {
                        }
                        
                        
-                       this.ret += "%sthis.el.%s = %s;\n".printf(ipad,p,v); // // %s,  iter.get_value().type);
-                           
-                      // got a property..
-                      
+                       this.addLine("%sthis.el.%s = %s;".printf(ipad,p,v)); // // %s,  iter.get_value().type);
+                                       
+                          // got a property..
+                          
 
                }
-           
+               
        }
+       /**
+        *  pack the children into the parent.
+        * 
+        * if the child's id starts with '*' then it is not packed...
+        * - this allows you to define children and add them manually..
+        */
 
        void addChildren()
        {
-                //code
+                               //code
                if (this.node.items.size < 1) {
                        return;
                }
-             
-               var iter = this.node.items.list_iterator();
+                        
+               var iter = this.node.items.list_iterator();
                var i = -1;
                while (iter.next()) {
                        i++;
-                
-                       var ci = iter.get();
+                               
+                       var ci = iter.get();
 
                        if (ci.xvala_id[0] == '*') {
-                               continue; // skip generation of children?
-                       }
-                    
-                       var xargs = "";
-                       if (ci.has("* args")) {
-                        
-                               var ar = ci.get("* args").split(",");
-                               for (var ari = 0 ; ari < ar.length; ari++ ) {
+                               continue; // skip generation of children?
+                       }
+                                       
+                       var xargs = "";
+                       if (ci.has("* args")) {
+                               
+                               var ar = ci.get("* args").split(",");
+                               for (var ari = 0 ; ari < ar.length; ari++ ) {
                                        var arg = ar[ari].split(" ");
-                                       xargs += "," + arg[arg.length -1];
-                               }
-                       }
-                    
-                       this.ret += this.ipad + "var child_" + "%d".printf(i) + " = new " + ci.xvala_xcls +
-                                       "( _this " + xargs + ");\n" ;
-                                   
-                       this.ret+= this.ipad + "child_" + "%d".printf(i) +".ref();\n"; // we need to reference increase unnamed children...
-                    
-                       if (ci.has("* prop")) {
-                               this.ret+= ipad + "this.el." + ci.get("* prop") + " = child_" + "%d".printf(i) + ".el;\n";
-                               continue;
-                       }
-
-                       // not sure why we have 'true' in pack?!?
-                       if (!ci.has("pack") || ci.get("pack").down() == "false" || ci.get("pack").down() == "true") {
-                               continue;
-                       }
-                    
-                       string[]  packing =  { "add" };
+                                       xargs += "," + arg[arg.length -1];
+                               }
+                       }
+                       // create the element..
+                       this.addLine(this.ipad + "var child_" + "%d".printf(i) + " = new " + ci.xvala_xcls +
+                                       "( _this " + xargs + ");" );
+                       
+                       // this is only needed if it does not have an ID???
+                       this.addLine(this.ipad + "child_" + "%d".printf(i) +".ref();"); // we need to reference increase unnamed children...
+                       
+                       if (ci.has("* prop")) {
+                               this.addLine(ipad + "this.el." + ci.get("* prop") + " = child_" + "%d".printf(i) + ".el;");
+                               continue;
+                       } 
+                               
+
+       // not sure why we have 'true' in pack?!?
+                       if (!ci.has("pack") || ci.get("pack").down() == "false" || ci.get("pack").down() == "true") {
+                               continue;
+                       }
+                       
+                       string[]  packing =  { "add" };
                        if (ci.has("pack")) {
                                packing = ci.get("pack").split(",");
                        }
-                       
-                       var pack = packing[0];
-                       this.ret += this.ipad + "this.el." + pack.strip() + " (  child_" + "%d".printf(i) + ".el " +
-                               (packing.length > 1 ? 
-                                       (", " + string.joinv(",", packing).substring(pack.length+1))
-                                       :
-                                       ""
-                                ) + " );\n";
-                       
-                              
-                       if (ci.xvala_id[0] != '+') {
-                               continue; // skip generation of children?
-                                       
-                       }
-                       this.ret+= this.ipad + "this." + ci.xvala_id.substring(1) + " =  child_" + "%d".printf(i) +  ";\n";
-                          
+                       
+                       var pack = packing[0];
+                       this.addLine(this.ipad + "this.el." + pack.strip() + " (  child_" + "%d".printf(i) + ".el " +
+                                  (packing.length > 1 ? 
+                                               (", " + string.joinv(",", packing).substring(pack.length+1))
+                                       :
+                                                       ""
+                                               ) + " );");
+       
+                                         
+                       if (ci.xvala_id[0] != '+') {
+                               continue; // skip generation of children?
+                                               
+                       }
+                       // this.{id - without the '+'} = the element...
+                       this.addLine(this.ipad + "this." + ci.xvala_id.substring(1) + " =  child_" + "%d".printf(i) +  ";");
+                                 
                }
        }
 
        void addInit()
        {
 
-           
+               
                if (!this.node.has("init")) {
-                           return;
+                               return;
                }
-               this.ret+= "\n" + ipad + "// init method \n";
-       
-               this.ret+= "\n" + ipad + this.padMultiline(ipad, this.node.get("init")) + "\n";
+               this.addLine();
+               this.addLine(ipad + "// init method");
+               this.addLine();
+               this.node.setLine(this.cur_line, "p", "init");
+               
+               this.addMultiLine(ipad + this.padMultiline(ipad, this.node.get("init")) );
 
         }
         void addListeners()
@@ -630,27 +716,28 @@ public class JsRender.NodeToVala : Object {
                if (this.node.listeners.size < 1) {
                        return;
                }
-                           
-            
-            
-               this.ret+= "\n" + ipad + "// listeners \n";
+                               
+               this.addLine();
+               this.addLine(ipad + "//listeners");
+                       
+                        
 
                var iter = this.node.listeners.map_iterator();
                while (iter.next()) {
                        var k = iter.get_key();
                        var v = iter.get_value();
-                       this.ret+= this.ipad + "this.el." + k + ".connect( " + 
-                                       this.padMultiline(this.ipad,v) +");\n"; 
-                    
-                }
+                       
+                       this.node.setLine(this.cur_line, "l", k);
+                       this.addMultiLine(this.ipad + "this.el." + k + ".connect( " + 
+                                       this.padMultiline(this.ipad,v) +");"); 
+                               
+               }
        }    
-        void addEndCtor()
+       void addEndCtor()
        {
-            
-            
-            
-               // end ctor..
-               this.ret+= this.pad + "}\n";
+                        
+                       // end ctor..
+                       this.addLine(this.pad + "}");
        }
 
 
@@ -698,48 +785,53 @@ public class JsRender.NodeToVala : Object {
         
        void addUserMethods()
        {
-            
-               this.ret+= "\n" + pad + "// user defined functions \n";  
-            
-               // user defined functions...
-               var iter = this.node.props.map_iterator();
+               this.addLine();
+               this.addLine(this.pad + "// user defined functions");
+                       
+                       // user defined functions...
+               var iter = this.node.props.map_iterator();
                while(iter.next()) {
-                       var k = iter.get_key();
+                       var k = iter.get_key();
                        if (this.shouldIgnore(k)) {
                                continue;
                        }
                        // HOW TO DETERIME if its a method?            
-                       if (k[0] != '|') {
-                               //strbuilder("\n" + pad + "// skip " + k + " - not pipe \n"); 
-                               continue;
-                       }       
-                       // function in the format of {type} (args) { .... }
-                       var kk = k.substring(2);
-                       var vv = iter.get_value();
-                       this.ret += this.pad + "public " + kk + " " + this.padMultiline(this.pad, vv) + "\n";
-                       
-                
-            }
+                       if (k[0] != '|') {
+                                       //strbuilder("\n" + pad + "// skip " + k + " - not pipe \n"); 
+                                       continue;
+                       }
+                       
+                       // function in the format of {type} (args) { .... }
+                       var kk = k.substring(2);
+                       var vv = iter.get_value();
+                       this.node.setLine(this.cur_line, "p", k);
+                       this.addMultiLine(this.pad + "public " + kk + " " + this.padMultiline(this.pad, vv));;
+                       
+                               
+               }
        }
 
        void iterChildren()
        {
-            
-               if (this.depth > 0) {
-                       this.ret+= this.inpad + "}\n";
-               }
+               this.node.line_end = this.cur_line;
+               this.node.sortLines();
+               
+                       
+               if (this.depth > 0) {
+                       this.addLine(this.inpad + "}");
+               }
                
                var iter = this.node.items.list_iterator();
                var i = -1;
                while (iter.next()) {
-                       this.ret += this.mungeChild(iter.get());
+                       this.addMultiLine(this.mungeChild(iter.get()));
+               }
+                        
+               if (this.depth < 1) {
+                       this.addLine(this.inpad + "}");
                }
-             
-               if (this.depth < 1) {
-                       this.ret+= this.inpad + "}\n";
-               }
-            
-        }
+                       
+       }
 
        string padMultiline(string pad, string str)
        {
@@ -763,7 +855,7 @@ public class JsRender.NodeToVala : Object {
        {
                return ignoreWrappedList.contains(i);
        }
-
+       
 }
        
         
index 41f65c6..c897a12 100644 (file)
@@ -23,7 +23,7 @@ int main (string[] args) {
        
        if (BuilderApplication.opt_compile_project != null) {
                 
-               Palete.ValaSource.buildApplication();
+               Palete.ValaSourceCompiler.buildApplication();
                
                GLib.Process.exit(Posix.EXIT_SUCCESS);
        }
index 23446b7..6e9f1b7 100644 (file)
@@ -104,6 +104,7 @@ builder4_SOURCES = \
                Palete/Palete.vala \
                Palete/Roo.vala \
                Palete/ValaSource.vala \
+               Palete/ValaSourceCompiler.vala \
                Builder4/About.vala \
                Builder4/DialogConfirm.vala \
                Builder4/StandardErrorDialog.vala \
index 57ec34e..c743066 100644 (file)
@@ -322,20 +322,18 @@ namespace Palete
 
    }
 
-       ValaSource vs;
-       ValaSourceResult result_callback;
        public   void validateVala(
-                       string code, 
-                               string property
-                               string ptype,
-                               JsRender.JsRender file,
-                               JsRender.Node node,
-                                ValaSourceResult result_cb
-                     
+                       WindowState state,
+                       string code
+                       string property, 
+                       string ptype,
+                       JsRender.JsRender file,
+                       JsRender.Node node
+        ) 
        {   
 
-               this.result_callback = result_cb;
-               print("validate code (%s) %s\n", file.language, code);
+               print("validate code (%s) %s\n", file.language, code);
                 
                
                 
@@ -345,26 +343,19 @@ namespace Palete
                // file.project , file.path, file.build_module, ""
                
                
-               this.vs = new ValaSource((Project.Gtk)file.project, file.path, file.build_module, "");
-               
+                
                //var cd = new JSCore.ClassDefinitionEmpty();
-               this.vs.checkFileWithNodePropChange(
+               state.valasource.checkFileWithNodePropChange(
                                file,
                                node, 
                                property, 
                                ptype,
-                               code,
-                               validateValaResult
-                                
-                                       
+                               code
                 );
                 
 
        }
-       void validateValaResult(Json.Object res) {
-               this.result_callback(res);
-               this.vs = null;
-       }
+        
        
        
        
index 04a4785..b988eff 100644 (file)
 
 // valac TreeBuilder.vala --pkg libvala-0.24 --pkg posix -o /tmp/treebuilder
 
+/**
+ * 
+ *  This just deals with spawning the compiler and getting the results.
+ * 
+ *  each window should have one of these...
+ * 
+ *  x = new ValaSource();
+ *  x.connect.compiled(... do something with results... );
+ *  
+ * x.
+ * 
+ */
+
 namespace Palete {
        
        public errordomain ValaSourceError {
                INVALID_FORMAT 
        }
        
-       public delegate  void ValaSourceResult(Json.Object res);
+       //public delegate  void ValaSourceResult(Json.Object res);
        
-       public class ValaSourceReport  : Vala.Report {
-
-               public string filepath;
-               
-               public string tmpname;
-               
-               //public Gee.ArrayList<ValaSourceNotice> notices;
-               public Json.Object result;
-                
-               //public Gee.HashMap<int,string> line_errors;
-               
-               public void  compile_notice(string type, string filename, int line, string message) {
-                        
-                        if (!this.result.has_member(type+"-TOTAL")) {
-                                this.result.set_int_member(type+"-TOTAL", 1);
-                        } else {
-                               this.result.set_int_member(type+"-TOTAL", 
-                                       this.result.get_int_member(type+"-TOTAL") +1 
-                               );
-                        }
-                        
-                        
-                        if (!this.result.has_member(type)) {
-                                this.result.set_object_member(type, new Json.Object());
-                        }
-                        var t = this.result.get_object_member(type);
-                        if (!t.has_member(filename)) {
-                                t.set_object_member(filename, new Json.Object());
-                        }
-                        var tt = t.get_object_member(filename);
-                        if (!tt.has_member(line.to_string())) {
-                                tt.set_array_member(line.to_string(), new Json.Array());
-                        }
-                        var tl = tt.get_array_member(line.to_string());
-                        tl.add_string_element(message);
-                        
-               }
-               
-               
         
-               public ValaSourceReport(string filepath, string tmpname)
-               {
-                       base();
-                       this.filepath = filepath;
-                       this.tmpname = tmpname;
-                       this.result = new Json.Object();
-                       this.result.set_boolean_member("success", true);
-                       this.result.set_string_member("message", "");
-                       
-                       
-                       
-                       //this.line_errors = new Gee.HashMap<int,string> ();
-                       //this.notices = new Gee.ArrayList<ValaSourceNotice>();
-               }
-               
-               public override void warn (Vala.SourceReference? source, string message) {
-                        
-                       if (source == null) {
-                               return;
-                               //stderr.printf ("My error: %s\n", message);
-                       }
-                       
-                       if (source.file.filename != this.tmpname) {
-                               this.compile_notice("WARN", source.file.filename , source.begin.line, message);
-                               return;
-                       }
-                       this.compile_notice("WARN", this.filepath, source.begin.line, message);
-                       
-               }
-               public override void depr (Vala.SourceReference? source, string message) {
-                        
-                       if (source == null) {
-                               return;
-                               //stderr.printf ("My error: %s\n", message);
-                       }
-                       
-                       if (source.file.filename != this.tmpname) {
-                               this.compile_notice("DEPR", source.file.filename, source.begin.line, message);
-                               return;
-                       }
-                       this.compile_notice("DEPR",  this.filepath, source.begin.line, message);
-                       
-               }
-               
-               public override void err (Vala.SourceReference? source, string message) {
-                       errors++;
-                       if (source == null) {
-                               return;
-                               //stderr.printf ("My error: %s\n", message);
-                       }
-                       if (source.file.filename != this.tmpname) {
-                               this.compile_notice("ERR", source.file.filename, source.begin.line, message);
-                               GLib.debug ("Other file: Got error error: %d:  %s\n", source.begin.line, message);
-                               return;
-                       }
-                        
-                        
-                       this.compile_notice("ERR", this.filepath, source.begin.line, message);
-                       GLib.debug ("Test file: Got error error: %d: %s\n", source.begin.line, message);
-               }
-               /*
-               public void dump()
-               {
-                       var iter = this.line_errors.map_iterator();
-                       while (iter.next()) {
-                               print ("%d : %s\n\n", iter.get_key(), iter.get_value());
-                       }
-               }
-               */
-
-       }
 
        public class ValaSource : Object {
+               
+               public signal void compiled(Json.Object res);
 
-               public static void jerr(string str)
-               {
-                       var ret = new Json.Object(); 
-                       ret.set_boolean_member("success", false);
-                       ret.set_string_member("message", str);
-                       
-                       var  generator = new Json.Generator ();
-                       var  root = new Json.Node(Json.NodeType.OBJECT);
-                       root.init_object(ret);
-                       generator.set_root (root);
-                        
-                       generator.pretty = true;
-                       generator.indent = 4;
-                
-
-                       print("%s\n",  generator.to_data (null));
-                       GLib.Process.exit(Posix.EXIT_FAILURE);
-                       
-               }
-
-               public static void buildApplication()
-               {
-                       //print("build based on Application settings\n");
-                       
-                       if (BuilderApplication.opt_compile_target == null) {
-                               jerr("missing compile target --target");
-                       }
-                       
-                       Project.Project.loadAll();
-                       var proj = Project.Project.getProjectByHash(BuilderApplication.opt_compile_project);
-                       
-                       if (proj == null) {
-                               jerr("could not load test project %s".printf( BuilderApplication.opt_compile_project));
-                       }
-                       
-                       if (proj.xtype != "Gtk") {
-                               jerr("%s is not a Gtk Project".printf( BuilderApplication.opt_compile_project));
-                       }
-                       var gproj = (Project.Gtk)proj;
-                       
-                       
-                       if (!gproj.compilegroups.has_key(BuilderApplication.opt_compile_target)) {
-                               jerr("missing compile target %s".printf(BuilderApplication.opt_compile_target));
-                       }
-                       var skip_file = "";
-                       if (BuilderApplication.opt_compile_skip != null) {
-                               skip_file = BuilderApplication.opt_compile_skip;
-                       }
-                       var add_file = "";
-                       if (BuilderApplication.opt_compile_add != null) {
-                               add_file = BuilderApplication.opt_compile_add;
-                       }
-                       
-                       
-                       var vs = new ValaSource(gproj,  add_file, BuilderApplication.opt_compile_target,   skip_file);
-                       vs.compile();
-                       
-                       
-               }
-
-               Vala.CodeContext context;
-               ValaSourceReport report;
-               Project.Gtk project;
-               public string build_module;
-               public string filepath;
-               public string original_filepath;
-               public int line_offset = 0;
                
-               // file.project , file.path, file.build_module, ""
-               public ValaSource(Project.Gtk project, string filepath, string build_module, string original_filepath) {
+               JsRender.JsRender file;
+               public int line_offset = 0;
+               
+               public ValaSource( ) 
+               {
                        base();
-                       //this.file = file;
-                       this.filepath = filepath;
-                       this.build_module = build_module;
-                       this.original_filepath = original_filepath;
-                       this.project =  project;
-                       
+                       this.compiler = null;
                }
                public void dumpCode(string str) 
                {
@@ -215,15 +52,19 @@ namespace Palete {
                //}
 
                public void checkFileWithNodePropChange(
+                 
                                        JsRender.JsRender file,
                                        JsRender.Node node, 
                                        string prop,
                                        string ptype,
-                                       string val,
-                                       ValaSourceResult result_cb)
+                                       string val
+                                )
                {
-                       
-                       
+                       this.file = file;
+                       
+                       if (this.compiler != null) {
+                               return;
+                       }
                        
                        Gee.HashMap<int,string> ret = new Gee.HashMap<int,string> ();
                        var hash = ptype == "listener" ? node.listeners : node.props;
@@ -231,7 +72,7 @@ namespace Palete {
                        // untill we get a smarter renderer..
                        // we have some scenarios where changing the value does not work
                        if (prop == "* xns" || prop == "xtype") {
-                               result_callback(new Json.Object());
+                               this.compiled(new Json.Object());
                                return ;
                        }
                                
@@ -253,8 +94,7 @@ namespace Palete {
                        
                        //this.dumpCode(tmpstring);
                        //print("offset %d\n", offset);
-                       this.result_callback = result_cb;
-                       this.checkStringSpawn(tmpstring );
+                       this.checkStringSpawn(tmpstring );
                        
                        // modify report
                        
@@ -262,12 +102,16 @@ namespace Palete {
                        
                }
                Spawn compiler;
-               ValaSourceResult result_callback;
+                
                public void checkStringSpawn(
                                        string contents 
                                )
                {
                        
+                       if (this.compiler != null) {
+                               return;
+                       }
+                       
                        FileIOStream iostream;
                        var tmpfile = File.new_tmp ("test-XXXXXX.vala", out iostream);
                        tmpfile.ref();
@@ -276,472 +120,174 @@ namespace Palete {
                        DataOutputStream dostream = new DataOutputStream (ostream);
                        dostream.put_string (contents);
                        
+                       var valafn = "";
+                       try {             
+                          var  regex = new Regex("\\.bjs$");
+                       
+                               valafn = regex.replace(this.file.path,this.file.path.length , 0 , ".vala");
+                        } catch (GLib.RegexError e) {
+                               var ret = new Json.Object();
+                               ret.set_boolean_member("success", false);
+                               ret.set_string_member("message", e.message);
+                           this.compiled(ret);
+                           return;
+                       }   
                        
                        string[] args = {};
                        args += BuilderApplication._self;
                        args += "--project";
-                       args += this.project.fn;
+                       args += this.file.project.fn;
                        args += "--target";
-                       args += this.build_module;
+                       args += this.file.build_module;
                        args += "--add-file";
                        args +=  tmpfile.get_path();
                        args += "--skip-file";
-                       args += this.filepath;
+                       args += valafn;
                        
                         
                        
                        this.compiler = new Spawn("/tmp", args);
+                       this.compiler.complete.connect(spawnResult);
                        
                        try {
-                               this.compiler.run(spawnResult); 
+                               this.compiler.run(); 
                        } catch (GLib.SpawnError e) {
                                var ret = new Json.Object();
                                ret.set_boolean_member("success", false);
                                ret.set_string_member("message", e.message);
-                               this.result_callback(ret);
+                           this.compiled(ret);
+                           this.compiler = null;
                        }
                         
                }
-               public void spawnResult(int res, string output, string stderr)
+               
+               public void checkFileSpawn(JsRender.JsRender file )
                {
+                       // race condition..
+                       if (this.compiler != null) { 
+                               return;
+                       }
+                       
+                       this.file = file;
+                       this.line_offset = 0;
+                         
+                       string[] args = {};
+                       args += BuilderApplication._self;
+                       args += "--project";
+                       args += this.file.project.fn;
+                       args += "--target";
+                       args += this.file.build_module;
                         
-                               
-                       try { 
-                               GLib.debug("GOT output %s", output);
-                               
-                               var pa = new Json.Parser();
-                               pa.load_from_data(output);
-                               var node = pa.get_root();
-
-                               if (node.get_node_type () != Json.NodeType.OBJECT) {
-                                       throw new ValaSourceError.INVALID_FORMAT ("Unexpected element type %s", node.type_name ());
-                               }
-                               var ret = node.get_object ();
-                               ret.set_int_member("line_offset", this.line_offset);
-                               if (result_callback == null) {
-                                       print ("no callback?");
-                                       return;
-                               }
-                               this.result_callback(ret);
-                               
-                               
-                       } catch (Error e) {
+                        
+                       
+                       this.compiler = new Spawn("/tmp", args);
+                       this.compiler.complete.connect(spawnResult);
+                       
+                       try {
+                               this.compiler.run(); 
+                       } catch (GLib.SpawnError e) {
                                var ret = new Json.Object();
                                ret.set_boolean_member("success", false);
                                ret.set_string_member("message", e.message);
-                               this.result_callback(ret);
+                           this.compiled(ret);
+                           this.compiler = null;
                        }
-                       //compiler.unref();
-                       //tmpfile.unref();
                         
-                       
-                       
                }
                
-               public void compile( )
+                
+               public void checkPlainFileSpawn(Project.Project project, string filename, string contents )
                {
-                       // init context:
-                       var valac = "valac " ;
-                       
-                       context = new Vala.CodeContext ();
-                       Vala.CodeContext.push (context);
-               
-                       context.experimental = false;
-                       context.experimental_non_null = false;
-                       
-#if VALA_0_28
-                       var ver=28;
-#elif VALA_0_26        
-                       var ver=26;
-#elif VALA_0_24
-                       var ver=24;
-#elif VALA_0_22        
-                       var ver=22;
-#endif
-                       
-                       for (int i = 2; i <= ver; i += 2) {
-                               context.add_define ("VALA_0_%d".printf (i));
-                       }
-                       
-                       
-                       
-                        
-                       var vapidirs = this.project.vapidirs();
-                        vapidirs +=  Path.get_dirname (context.get_vapi_path("glib-2.0")) ; // usr/share/vala-XXX/vapi
-                        vapidirs +=  Path.get_dirname (context.get_vapi_path("gee-1.0")) ; //usr/share/vala/vapi 
-                               
-                       for(var i =0 ; i < vapidirs.length; i++) {
-                               valac += " --vapidir=" + vapidirs[i];
-                       }
-                               
-                       
-                       context.vapi_directories = vapidirs;
-                       context.report.enable_warnings = true;
-                       context.metadata_directories = { };
-                       context.gir_directories = {};
-                       context.thread = true;
-                        
-                       
-                       this.report = new ValaSourceReport(this.original_filepath, this.filepath);
-                       context.report = this.report;
-                       
-                       
-                       context.basedir = "/tmp"; //Posix.realpath (".");
-               
-                       context.directory = context.basedir;
-               
-
-                       // add default packages:
-                       //if (settings.profile == "gobject-2.0" || settings.profile == "gobject" || settings.profile == null) {
-                       context.profile = Vala.Profile.GOBJECT;
-                        
-                       var ns_ref = new Vala.UsingDirective (new Vala.UnresolvedSymbol (null, "GLib", null));
-                       context.root.add_using_directive (ns_ref);
-
-                       var source_file = new Vala.SourceFile (
-                               context, 
-                               Vala.SourceFileType.SOURCE, 
-                                       this.filepath 
-                       );
-                       source_file.add_using_directive (ns_ref);
-                       context.add_source_file (source_file);
-                       
-               // add all the files (except the current one) - this.file.path
-               var pr = this.project;
-               if (this.build_module.length > 0) {
-                               var cg =  pr.compilegroups.get(this.build_module);
-                               for (var i = 0; i < cg.sources.size; i++) {
-                                       var path = pr.resolve_path(
-                                                       pr.resolve_path_combine_path(pr.firstPath(),cg.sources.get(i)));
-                                                       
-                                       if (!FileUtils.test(path, FileTest.EXISTS)) {
-                                               continue;
-                                       }       
-                       // skip thie original
-                                       if (path == this.original_filepath.replace(".bjs", ".vala")) {
-                                               valac += " " + path;
-                                               continue;
-                                       }
-                                       if (FileUtils.test(path, FileTest.IS_DIR)) {
-                                               continue;
-                                       }
-                                       //print("Add source file %s\n", path);
-                                       
-                                       valac += " " + path;
-                                       
-                                       if (Regex.match_simple("\\.c$", path)) {
-                                               context.add_c_source_file(path);
-                                               continue;
-                                       }
-                                       
-                                       
-                                       var xsf = new Vala.SourceFile (
-                                               context,
-                                               Vala.SourceFileType.SOURCE, 
-                                               path
-                                       );
-                                       xsf.add_using_directive (ns_ref);
-                                       context.add_source_file(xsf);
-                                       
-                               }
-                       }
-                       // default.. packages..
-                       context.add_external_package ("glib-2.0"); 
-                       context.add_external_package ("gobject-2.0");
-                       // user defined ones..
-                       
-               var dcg = pr.compilegroups.get("_default_");
-               for (var i = 0; i < dcg.packages.size; i++) {
-                               valac += " --pkg " + dcg.packages.get(i);
-                               if (!this.has_vapi(context.vapi_directories, dcg.packages.get(i))) {
-                                       GLib.debug("Skip vapi '%s' - does not exist", dcg.packages.get(i));
-                                       continue;
-                               }
-                               
-                               context.add_external_package (dcg.packages.get(i));
-                       }
-               
-                        //Vala.Config.PACKAGE_SUFFIX.substring (1)
-                       
-                       // add the modules...
-                       
-                       context.output = "/tmp/testbuild";
-                       valac += " -o " +context.output;
-                       GLib.debug("%s", valac);
-                       
-                       
-               
-                       //add_documented_files (context, settings.source_files);
-               
-                       Vala.Parser parser = new Vala.Parser ();
-                       parser.parse (context);
-                       //gir_parser.parse (context);
-                       if (context.report.get_errors () > 0) {
-                               Vala.CodeContext.pop ();
-                               GLib.debug("parse got errors");
-                               //((ValaSourceReport)context.report).dump();
-                               this.report.result.set_boolean_member("success", false);
-                               this.report.result.set_string_member("message", "Parse failed");
-                               
-                               this.outputResult();
+                       // race condition..
+                       if (this.compiler != null) { 
                                return;
                        }
+                       
+                       FileIOStream iostream;
+                       var tmpfile = File.new_tmp ("test-XXXXXX.vala", out iostream);
+                       tmpfile.ref();
 
-
-                       
-                       // check context:
-                       context.check ();
-                       if (context.report.get_errors () > 0) {
-                               Vala.CodeContext.pop ();
-                               GLib.debug("check got errors");
-                               //((ValaSourceReport)context.report).dump();
-                               this.report.result.set_boolean_member("success", false);
-                               this.report.result.set_string_member("message", "Check failed");
-                               
-                               this.outputResult();
-                               return;
-                       }
+                       OutputStream ostream = iostream.output_stream;
+                       DataOutputStream dostream = new DataOutputStream (ostream);
+                       dostream.put_string (contents);
                        
-                       //context.codegen = new Vala.GDBusServerModule ();
+                       var gproj = (Project.Gtk)project;
+                       
+                       this.file = null;
+                       this.line_offset = 0;
+                         
+                       string[] args = {};
+                       args += BuilderApplication._self;
+                       args += "--project";
+                       args +=  project.fn;
+                       args += "--target";
+                       args += gproj.firstBuildModule();
+       `               args += "--add-file";
+                       args +=  tmpfile.get_path();
+                       args += "--skip-file";
+                       args += filename;
                        
                         
                        
-                       //context.codegen.emit (context);
-                       /*
-                       var ccompiler = new Vala.CCodeCompiler ();
-                       var cc_command = Environment.get_variable ("CC");
-                       var pkg_config_command = Environment.get_variable ("PKG_CONFIG");
-#if VALA_0_28
-                       ccompiler.compile (context, cc_command, new string[] { }, pkg_config_command);
-#else
-                       ccompiler.compile (context, cc_command, new string[] { });
-#endif
-                       */
-                       Vala.CodeContext.pop ();
-                       this.outputResult();
-               
-               }
-               public bool has_vapi(string[] dirs,  string vapi) 
-               {
-                       for(var i =0 ; i < dirs.length; i++) {
-                               GLib.debug("check VAPI - %s", dirs[i] + "/" + vapi + ".vapi");
-                               if (!FileUtils.test( dirs[i] + "/" + vapi + ".vapi", FileTest.EXISTS)) {
-                                       continue;
-                               }   
-                               return true;
-                       }
-                       return false;
-                       
-               }
-               
-               public void outputResult()
-               {
-                       var generator = new Json.Generator ();
-                   generator.indent = 1;
-                   generator.pretty = true;
-                   var node = new Json.Node(Json.NodeType.OBJECT);
-                   node.set_object(this.report.result);
-                   
-                   generator.set_root(node);
-                        
-                       generator.pretty = true;
-                       generator.indent = 4;
-                
-
-                       print("%s\n",  generator.to_data (null));
-                       GLib.Process.exit(Posix.EXIT_SUCCESS);
+                       this.compiler = new Spawn("/tmp", args);
+                       this.compiler.complete.connect(spawnResult);
                        
+                       try {
+                               this.compiler.run(); 
+                       } catch (GLib.SpawnError e) {
+                               var ret = new Json.Object();
+                               ret.set_boolean_member("success", false);
+                               ret.set_string_member("message", e.message);
+                           this.compiled(ret);
+                           this.compiler = null;
+                       }
                         
                }
-/*             
                
                
-               public Gee.HashMap<int,string> checkString(string contents)
+               public void spawnResult(int res, string output, string stderr)
                {
-                       // init context:
-                       var valac = "valac " ;
-                       
-                       context = new Vala.CodeContext ();
-                       Vala.CodeContext.push (context);
-               
-                       context.experimental = false;
-                       context.experimental_non_null = false;
-                       
-#if VALA_0_28
-                       var ver=28;
-#elif VALA_0_26        
-                       var ver=26;
-#elif VALA_0_24
-                       var ver=24;
-#elif VALA_0_22        
-                       var ver=22;
-#endif
-                       
-                       for (int i = 2; i <= ver; i += 2) {
-                               context.add_define ("VALA_0_%d".printf (i));
-                       }
-                       
-                       
-                       
-                       
-                       
-                       
-                       
-                       var vapidirs = ((Project.Gtk)this.file.project).vapidirs();
-                       // what's the current version of vala???
-                       
-                       
-                       vapidirs +=  Path.get_dirname (context.get_vapi_path("glib-2.0")) ;
-                       
-                       for(var i =0 ; i < vapidirs.length; i++) {
-                               valac += " --vapidir=" + vapidirs[i];
-                       }
+                        
                                
-                       
-                       // or context.get_vapi_path("glib-2.0"); // should return path..
-                       context.vapi_directories = vapidirs;
-                       context.report.enable_warnings = true;
-                       context.metadata_directories = { };
-                       context.gir_directories = {};
-                       context.thread = true;
-                       
-                       
-                       this.report = new ValaSourceReport(this.file.path);
-                       context.report = this.report;
-                       
-                       
-                       context.basedir = "/tmp"; //Posix.realpath (".");
-               
-                       context.directory = context.basedir;
-               
-
-                       // add default packages:
-                       //if (settings.profile == "gobject-2.0" || settings.profile == "gobject" || settings.profile == null) {
-                       context.profile = Vala.Profile.GOBJECT;
-                        
-                       var ns_ref = new Vala.UsingDirective (new Vala.UnresolvedSymbol (null, "GLib", null));
-                       context.root.add_using_directive (ns_ref);
+                       try { 
+                               GLib.debug("GOT output %s", output);
+                               
+                               var pa = new Json.Parser();
+                               pa.load_from_data(output);
+                               var node = pa.get_root();
 
-                       var source_file = new Vala.SourceFile (
-                               context, 
-                               Vala.SourceFileType.SOURCE, 
-                                       "~~~~~testfile.vala",
-                                       contents
-                       );
-                       source_file.add_using_directive (ns_ref);
-                       context.add_source_file (source_file);
-                       
-               // add all the files (except the current one) - this.file.path
-               var pr = ((Project.Gtk)this.file.project);
-               if (this.file.build_module.length > 0) {
-                               var cg =  pr.compilegroups.get(this.file.build_module);
-                               for (var i = 0; i < cg.sources.size; i++) {
-                                       var path = pr.resolve_path(
-                                                       pr.resolve_path_combine_path(pr.firstPath(),cg.sources.get(i)));
-                                                       
-                                       if (!FileUtils.test(path, FileTest.EXISTS)) {
-                                               continue;
-                                       }       
-                        
-                                       if (path == this.file.path.replace(".bjs", ".vala")) {
-                                               valac += " " + path;
-                                               continue;
-                                       }
-                                       if (FileUtils.test(path, FileTest.IS_DIR)) {
-                                               continue;
-                                       }
-                                       //print("Add source file %s\n", path);
-                                       
-                                       valac += " " + path;
-                                       
-                                       if (Regex.match_simple("\\.c$", path)) {
-                                               context.add_c_source_file(path);
-                                               continue;
-                                       }
-                                       
-                                       
-                                       var xsf = new Vala.SourceFile (
-                                               context,
-                                               Vala.SourceFileType.SOURCE, 
-                                               path
+                               if (node.get_node_type () != Json.NodeType.OBJECT) {
+                                       var ret = new Json.Object();
+                                       ret.set_boolean_member("success", false);
+                                       ret.set_string_member("message", 
+                                               "Compiler returned Unexpected element type %s".printf( 
+                                                       node.type_name ()
+                                               )
                                        );
-                                       xsf.add_using_directive (ns_ref);
-                                       context.add_source_file(xsf);
-                                       
+                                       this.compiled(ret);
+                                       this.compiler = null;
                                }
-                       }
-                       // default.. packages..
-                       context.add_external_package ("glib-2.0"); 
-                       context.add_external_package ("gobject-2.0");
-                       // user defined ones..
-                       
-               var dcg = pr.compilegroups.get("_default_");
-               for (var i = 0; i < dcg.packages.size; i++) {
-                               valac += " --pkg " + dcg.packages.get(i);
-                               context.add_external_package (dcg.packages.get(i));
-                       }
-               
-                        //Vala.Config.PACKAGE_SUFFIX.substring (1)
-                       
-                       // add the modules...
-                       
-                       
-                       
-                       //context.add_external_package ("libvala-0.24");
-                       
-                       this.report.compile_notice("START", "", 0, "");
-
-               
-                       //add_documented_files (context, settings.source_files);
-               
-                       Vala.Parser parser = new Vala.Parser ();
-                       parser.parse (context);
-                       //gir_parser.parse (context);
-                       if (context.report.get_errors () > 0) {
-                               print("parse got errors");
-                               ((ValaSourceReport)context.report).dump();
+                               var ret = node.get_object ();
+                               ret.set_int_member("line_offset", this.line_offset);
                                
-                               Vala.CodeContext.pop ();
-                               this.report.compile_notice("END", "", 0, "");
-                               return this.report.line_errors;
-                       }
-
-
-                       
-                       // check context:
-                       context.check ();
-                       if (context.report.get_errors () > 0) {
-                               print("check got errors");
-                               ((ValaSourceReport)context.report).dump();
-                               Vala.CodeContext.pop ();
-                               this.report.compile_notice("END", "", 0, "");
-                               return this.report.line_errors;
+                               this.compiled(ret);
                                
+                               
+                       } catch (Error e) {
+                               var ret = new Json.Object();
+                               ret.set_boolean_member("success", false);
+                               ret.set_string_member("message", e.message);
+                               this.compiled(ret);
                        }
+                       this.compiler = null;
+                       //compiler.unref();
+                       //tmpfile.unref();
+                        
                        
-                       //context.codegen = new Vala.GDBusServerModule ();
                        
-                        
-                       context.output = "/tmp/testbuild";
-                       valac += " -o " +context.output;
-                       //context.codegen.emit (context);
-                        odeContext.pop ();
-                       //(new Vala.CodeNode()).get_error_types().clear();
-                       //(new Vala.NullType()).get_type_arguments().clear();
-                       (new Vala.NullType(null)).get_type_arguments().clear();
-                       parser = null;
-                       this.report.compile_notice("END", "", 0, "");
-                       print("%s\n", valac);
-                       print("ALL OK?\n");
-                       return this.report.line_errors;
                }
-       //
-               // startpoint:
-               //
-        */
        }
+                
 }
 /*
 int main (string[] args) {
diff --git a/src/Palete/ValaSourceCompiler.vala b/src/Palete/ValaSourceCompiler.vala
new file mode 100644 (file)
index 0000000..83ea0dd
--- /dev/null
@@ -0,0 +1,629 @@
+
+// valac TreeBuilder.vala --pkg libvala-0.24 --pkg posix -o /tmp/treebuilder
+
+/**
+ *  this only deals with the compiling (when builder is run with different args..)
+ * 
+ */
+
+
+namespace Palete {
+       
+        
+       public class ValaSourceReport  : Vala.Report {
+
+               public string filepath;
+               
+               public string tmpname;
+               
+               //public Gee.ArrayList<ValaSourceNotice> notices;
+               public Json.Object result;
+                
+               //public Gee.HashMap<int,string> line_errors;
+               
+               public void  compile_notice(string type, string filename, int line, string message) {
+                        
+                        if (!this.result.has_member(type+"-TOTAL")) {
+                                this.result.set_int_member(type+"-TOTAL", 1);
+                        } else {
+                               this.result.set_int_member(type+"-TOTAL", 
+                                       this.result.get_int_member(type+"-TOTAL") +1 
+                               );
+                        }
+                        
+                        
+                        if (!this.result.has_member(type)) {
+                                this.result.set_object_member(type, new Json.Object());
+                        }
+                        var t = this.result.get_object_member(type);
+                        if (!t.has_member(filename)) {
+                                t.set_object_member(filename, new Json.Object());
+                        }
+                        var tt = t.get_object_member(filename);
+                        if (!tt.has_member(line.to_string())) {
+                                tt.set_array_member(line.to_string(), new Json.Array());
+                        }
+                        var tl = tt.get_array_member(line.to_string());
+                        tl.add_string_element(message);
+                        
+               }
+               
+               
+        
+               public ValaSourceReport(string filepath, string tmpname)
+               {
+                       base();
+                       this.filepath = filepath;
+                       this.tmpname = tmpname;
+                       this.result = new Json.Object();
+                       this.result.set_boolean_member("success", true);
+                       this.result.set_string_member("message", "");
+                       
+                       
+                       
+                       //this.line_errors = new Gee.HashMap<int,string> ();
+                       //this.notices = new Gee.ArrayList<ValaSourceNotice>();
+               }
+               
+               public override void warn (Vala.SourceReference? source, string message) {
+                        
+                       if (source == null) {
+                               return;
+                               //stderr.printf ("My error: %s\n", message);
+                       }
+                       
+                       if (source.file.filename != this.tmpname) {
+                               this.compile_notice("WARN", source.file.filename , source.begin.line, message);
+                               return;
+                       }
+                       this.compile_notice("WARN", this.filepath, source.begin.line, message);
+                       
+               }
+               public override void depr (Vala.SourceReference? source, string message) {
+                        
+                       if (source == null) {
+                               return;
+                               //stderr.printf ("My error: %s\n", message);
+                       }
+                       
+                       if (source.file.filename != this.tmpname) {
+                               this.compile_notice("DEPR", source.file.filename, source.begin.line, message);
+                               return;
+                       }
+                       this.compile_notice("DEPR",  this.filepath, source.begin.line, message);
+                       
+               }
+               
+               public override void err (Vala.SourceReference? source, string message) {
+                       errors++;
+                       if (source == null) {
+                               return;
+                               //stderr.printf ("My error: %s\n", message);
+                       }
+                       if (source.file.filename != this.tmpname) {
+                               this.compile_notice("ERR", source.file.filename, source.begin.line, message);
+                               GLib.debug ("Other file: Got error error: %d:  %s\n", source.begin.line, message);
+                               return;
+                       }
+                        
+                        
+                       this.compile_notice("ERR", this.filepath, source.begin.line, message);
+                       GLib.debug ("Test file: Got error error: %d: %s\n", source.begin.line, message);
+               }
+               /*
+               public void dump()
+               {
+                       var iter = this.line_errors.map_iterator();
+                       while (iter.next()) {
+                               print ("%d : %s\n\n", iter.get_key(), iter.get_value());
+                       }
+               }
+               */
+
+       }
+
+       public class ValaSourceCompiler : Object {
+
+               public static void jerr(string str)
+               {
+                       var ret = new Json.Object(); 
+                       ret.set_boolean_member("success", false);
+                       ret.set_string_member("message", str);
+                       
+                       var  generator = new Json.Generator ();
+                       var  root = new Json.Node(Json.NodeType.OBJECT);
+                       root.init_object(ret);
+                       generator.set_root (root);
+                        
+                       generator.pretty = true;
+                       generator.indent = 4;
+                
+
+                       print("%s\n",  generator.to_data (null));
+                       GLib.Process.exit(Posix.EXIT_FAILURE);
+                       
+               }
+
+               public static void buildApplication()
+               {
+                       //print("build based on Application settings\n");
+                       
+                       if (BuilderApplication.opt_compile_target == null) {
+                               jerr("missing compile target --target");
+                       }
+                       
+                       Project.Project.loadAll();
+                       var proj = Project.Project.getProjectByHash(BuilderApplication.opt_compile_project);
+                       
+                       if (proj == null) {
+                               jerr("could not load test project %s".printf( BuilderApplication.opt_compile_project));
+                       }
+                       
+                       if (proj.xtype != "Gtk") {
+                               jerr("%s is not a Gtk Project".printf( BuilderApplication.opt_compile_project));
+                       }
+                       var gproj = (Project.Gtk)proj;
+                       
+                       
+                       if (!gproj.compilegroups.has_key(BuilderApplication.opt_compile_target)) {
+                               jerr("missing compile target %s".printf(BuilderApplication.opt_compile_target));
+                       }
+                       var skip_file = "";
+                       if (BuilderApplication.opt_compile_skip != null) {
+                               skip_file = BuilderApplication.opt_compile_skip;
+                       }
+                       var add_file = "";
+                       if (BuilderApplication.opt_compile_add != null) {
+                               add_file = BuilderApplication.opt_compile_add;
+                       }
+                       
+                       
+                       var vs = new ValaSourceCompiler(gproj,  add_file, BuilderApplication.opt_compile_target,   skip_file);
+                       vs.compile();
+                       
+                       
+               }
+
+               Vala.CodeContext context;
+               ValaSourceReport report;
+               Project.Gtk project;
+               public string build_module;
+               public string filepath;
+               public string original_filepath;
+               public int line_offset = 0;
+               
+               // file.project , file.path, file.build_module, ""
+               public ValaSourceCompiler(Project.Gtk project, string filepath, string build_module, string original_filepath) {
+                       base();
+                       //this.file = file;
+                       this.filepath = filepath;
+                       this.build_module = build_module;
+                       this.original_filepath = original_filepath;
+                       this.project =  project;
+                       
+               }
+               public void dumpCode(string str) 
+               {
+                       var ls = str.split("\n");
+                       for (var i=0;i < ls.length; i++) {
+                               print("%d : %s\n", i+1, ls[i]);
+                       }
+               }
+               
+                
+               
+               public void compile( )
+               {
+                       // init context:
+                       var valac = "valac " ;
+                       
+                       context = new Vala.CodeContext ();
+                       Vala.CodeContext.push (context);
+               
+                       context.experimental = false;
+                       context.experimental_non_null = false;
+                       
+#if VALA_0_28
+                       var ver=28;
+#elif VALA_0_26        
+                       var ver=26;
+#elif VALA_0_24
+                       var ver=24;
+#elif VALA_0_22        
+                       var ver=22;
+#endif
+                       
+                       for (int i = 2; i <= ver; i += 2) {
+                               context.add_define ("VALA_0_%d".printf (i));
+                       }
+                       
+                       
+                       
+                        
+                       var vapidirs = this.project.vapidirs();
+                        vapidirs +=  Path.get_dirname (context.get_vapi_path("glib-2.0")) ; // usr/share/vala-XXX/vapi
+                        vapidirs +=  Path.get_dirname (context.get_vapi_path("gee-1.0")) ; //usr/share/vala/vapi 
+                               
+                       for(var i =0 ; i < vapidirs.length; i++) {
+                               valac += " --vapidir=" + vapidirs[i];
+                       }
+                               
+                       
+                       context.vapi_directories = vapidirs;
+                       context.report.enable_warnings = true;
+                       context.metadata_directories = { };
+                       context.gir_directories = {};
+                       context.thread = true;
+                        
+                       
+                       this.report = new ValaSourceReport(this.original_filepath, this.filepath);
+                       context.report = this.report;
+                       
+                       
+                       context.basedir = "/tmp"; //Posix.realpath (".");
+               
+                       context.directory = context.basedir;
+               
+
+                       // add default packages:
+                       //if (settings.profile == "gobject-2.0" || settings.profile == "gobject" || settings.profile == null) {
+                       context.profile = Vala.Profile.GOBJECT;
+                        
+                       var ns_ref = new Vala.UsingDirective (new Vala.UnresolvedSymbol (null, "GLib", null));
+                       context.root.add_using_directive (ns_ref);
+
+                       var source_file = new Vala.SourceFile (
+                               context, 
+                               Vala.SourceFileType.SOURCE, 
+                                       this.filepath 
+                       );
+                       source_file.add_using_directive (ns_ref);
+                       context.add_source_file (source_file);
+                       
+               // add all the files (except the current one) - this.file.path
+               var pr = this.project;
+               if (this.build_module.length > 0) {
+                               var cg =  pr.compilegroups.get(this.build_module);
+                               for (var i = 0; i < cg.sources.size; i++) {
+                                       var path = pr.resolve_path(
+                                                       pr.resolve_path_combine_path(pr.firstPath(),cg.sources.get(i)));
+                                                       
+                                       if (!FileUtils.test(path, FileTest.EXISTS)) {
+                                               continue;
+                                       }       
+                       // skip thie original
+                                       if (path == this.original_filepath) {
+                                               valac += " " + path;
+                                               continue;
+                                       }
+                                       if (FileUtils.test(path, FileTest.IS_DIR)) {
+                                               continue;
+                                       }
+                                       //print("Add source file %s\n", path);
+                                       
+                                       valac += " " + path;
+                                       
+                                       if (Regex.match_simple("\\.c$", path)) {
+                                               context.add_c_source_file(path);
+                                               continue;
+                                       }
+                                       
+                                       
+                                       var xsf = new Vala.SourceFile (
+                                               context,
+                                               Vala.SourceFileType.SOURCE, 
+                                               path
+                                       );
+                                       xsf.add_using_directive (ns_ref);
+                                       context.add_source_file(xsf);
+                                       
+                               }
+                       }
+                       // default.. packages..
+                       context.add_external_package ("glib-2.0"); 
+                       context.add_external_package ("gobject-2.0");
+                       // user defined ones..
+                       
+               var dcg = pr.compilegroups.get("_default_");
+               for (var i = 0; i < dcg.packages.size; i++) {
+                               valac += " --pkg " + dcg.packages.get(i);
+                               if (!this.has_vapi(context.vapi_directories, dcg.packages.get(i))) {
+                                       GLib.debug("Skip vapi '%s' - does not exist", dcg.packages.get(i));
+                                       continue;
+                               }
+                               
+                               context.add_external_package (dcg.packages.get(i));
+                       }
+               
+                        //Vala.Config.PACKAGE_SUFFIX.substring (1)
+                       
+                       // add the modules...
+                       
+                       context.output = "/tmp/testbuild";
+                       valac += " -o " +context.output;
+                       GLib.debug("%s", valac);
+                       
+                       
+               
+                       //add_documented_files (context, settings.source_files);
+               
+                       Vala.Parser parser = new Vala.Parser ();
+                       parser.parse (context);
+                       //gir_parser.parse (context);
+                       if (context.report.get_errors () > 0) {
+                               Vala.CodeContext.pop ();
+                               GLib.debug("parse got errors");
+                               //((ValaSourceReport)context.report).dump();
+                               this.report.result.set_boolean_member("success", false);
+                               this.report.result.set_string_member("message", "Parse failed");
+                               
+                               this.outputResult();
+                               return;
+                       }
+
+
+                       
+                       // check context:
+                       context.check ();
+                       if (context.report.get_errors () > 0) {
+                               Vala.CodeContext.pop ();
+                               GLib.debug("check got errors");
+                               //((ValaSourceReport)context.report).dump();
+                               this.report.result.set_boolean_member("success", false);
+                               this.report.result.set_string_member("message", "Check failed");
+                               
+                               this.outputResult();
+                               return;
+                       }
+                       
+                       //context.codegen = new Vala.GDBusServerModule ();
+                       
+                        
+                       
+                       //context.codegen.emit (context);
+                       /*
+                       var ccompiler = new Vala.CCodeCompiler ();
+                       var cc_command = Environment.get_variable ("CC");
+                       var pkg_config_command = Environment.get_variable ("PKG_CONFIG");
+#if VALA_0_28
+                       ccompiler.compile (context, cc_command, new string[] { }, pkg_config_command);
+#else
+                       ccompiler.compile (context, cc_command, new string[] { });
+#endif
+                       */
+                       Vala.CodeContext.pop ();
+                       this.outputResult();
+               
+               }
+               public bool has_vapi(string[] dirs,  string vapi) 
+               {
+                       for(var i =0 ; i < dirs.length; i++) {
+                               GLib.debug("check VAPI - %s", dirs[i] + "/" + vapi + ".vapi");
+                               if (!FileUtils.test( dirs[i] + "/" + vapi + ".vapi", FileTest.EXISTS)) {
+                                       continue;
+                               }   
+                               return true;
+                       }
+                       return false;
+                       
+               }
+               
+               public void outputResult()
+               {
+                       var generator = new Json.Generator ();
+                   generator.indent = 1;
+                   generator.pretty = true;
+                   var node = new Json.Node(Json.NodeType.OBJECT);
+                   node.set_object(this.report.result);
+                   
+                   generator.set_root(node);
+                        
+                       generator.pretty = true;
+                       generator.indent = 4;
+                
+
+                       print("%s\n",  generator.to_data (null));
+                       GLib.Process.exit(Posix.EXIT_SUCCESS);
+                       
+                        
+               }
+/*             
+               
+               
+               public Gee.HashMap<int,string> checkString(string contents)
+               {
+                       // init context:
+                       var valac = "valac " ;
+                       
+                       context = new Vala.CodeContext ();
+                       Vala.CodeContext.push (context);
+               
+                       context.experimental = false;
+                       context.experimental_non_null = false;
+                       
+#if VALA_0_28
+                       var ver=28;
+#elif VALA_0_26        
+                       var ver=26;
+#elif VALA_0_24
+                       var ver=24;
+#elif VALA_0_22        
+                       var ver=22;
+#endif
+                       
+                       for (int i = 2; i <= ver; i += 2) {
+                               context.add_define ("VALA_0_%d".printf (i));
+                       }
+                       
+                       
+                       
+                       
+                       
+                       
+                       
+                       var vapidirs = ((Project.Gtk)this.file.project).vapidirs();
+                       // what's the current version of vala???
+                       
+                       
+                       vapidirs +=  Path.get_dirname (context.get_vapi_path("glib-2.0")) ;
+                       
+                       for(var i =0 ; i < vapidirs.length; i++) {
+                               valac += " --vapidir=" + vapidirs[i];
+                       }
+                               
+                       
+                       // or context.get_vapi_path("glib-2.0"); // should return path..
+                       context.vapi_directories = vapidirs;
+                       context.report.enable_warnings = true;
+                       context.metadata_directories = { };
+                       context.gir_directories = {};
+                       context.thread = true;
+                       
+                       
+                       this.report = new ValaSourceReport(this.file.path);
+                       context.report = this.report;
+                       
+                       
+                       context.basedir = "/tmp"; //Posix.realpath (".");
+               
+                       context.directory = context.basedir;
+               
+
+                       // add default packages:
+                       //if (settings.profile == "gobject-2.0" || settings.profile == "gobject" || settings.profile == null) {
+                       context.profile = Vala.Profile.GOBJECT;
+                        
+                       var ns_ref = new Vala.UsingDirective (new Vala.UnresolvedSymbol (null, "GLib", null));
+                       context.root.add_using_directive (ns_ref);
+
+                       var source_file = new Vala.SourceFile (
+                               context, 
+                               Vala.SourceFileType.SOURCE, 
+                                       "~~~~~testfile.vala",
+                                       contents
+                       );
+                       source_file.add_using_directive (ns_ref);
+                       context.add_source_file (source_file);
+                       
+               // add all the files (except the current one) - this.file.path
+               var pr = ((Project.Gtk)this.file.project);
+               if (this.file.build_module.length > 0) {
+                               var cg =  pr.compilegroups.get(this.file.build_module);
+                               for (var i = 0; i < cg.sources.size; i++) {
+                                       var path = pr.resolve_path(
+                                                       pr.resolve_path_combine_path(pr.firstPath(),cg.sources.get(i)));
+                                                       
+                                       if (!FileUtils.test(path, FileTest.EXISTS)) {
+                                               continue;
+                                       }       
+                        
+                                       if (path == this.file.path.replace(".bjs", ".vala")) {
+                                               valac += " " + path;
+                                               continue;
+                                       }
+                                       if (FileUtils.test(path, FileTest.IS_DIR)) {
+                                               continue;
+                                       }
+                                       //print("Add source file %s\n", path);
+                                       
+                                       valac += " " + path;
+                                       
+                                       if (Regex.match_simple("\\.c$", path)) {
+                                               context.add_c_source_file(path);
+                                               continue;
+                                       }
+                                       
+                                       
+                                       var xsf = new Vala.SourceFile (
+                                               context,
+                                               Vala.SourceFileType.SOURCE, 
+                                               path
+                                       );
+                                       xsf.add_using_directive (ns_ref);
+                                       context.add_source_file(xsf);
+                                       
+                               }
+                       }
+                       // default.. packages..
+                       context.add_external_package ("glib-2.0"); 
+                       context.add_external_package ("gobject-2.0");
+                       // user defined ones..
+                       
+               var dcg = pr.compilegroups.get("_default_");
+               for (var i = 0; i < dcg.packages.size; i++) {
+                               valac += " --pkg " + dcg.packages.get(i);
+                               context.add_external_package (dcg.packages.get(i));
+                       }
+               
+                        //Vala.Config.PACKAGE_SUFFIX.substring (1)
+                       
+                       // add the modules...
+                       
+                       
+                       
+                       //context.add_external_package ("libvala-0.24");
+                       
+                       this.report.compile_notice("START", "", 0, "");
+
+               
+                       //add_documented_files (context, settings.source_files);
+               
+                       Vala.Parser parser = new Vala.Parser ();
+                       parser.parse (context);
+                       //gir_parser.parse (context);
+                       if (context.report.get_errors () > 0) {
+                               print("parse got errors");
+                               ((ValaSourceReport)context.report).dump();
+                               
+                               Vala.CodeContext.pop ();
+                               this.report.compile_notice("END", "", 0, "");
+                               return this.report.line_errors;
+                       }
+
+
+                       
+                       // check context:
+                       context.check ();
+                       if (context.report.get_errors () > 0) {
+                               print("check got errors");
+                               ((ValaSourceReport)context.report).dump();
+                               Vala.CodeContext.pop ();
+                               this.report.compile_notice("END", "", 0, "");
+                               return this.report.line_errors;
+                               
+                       }
+                       
+                       //context.codegen = new Vala.GDBusServerModule ();
+                       
+                        
+                       context.output = "/tmp/testbuild";
+                       valac += " -o " +context.output;
+                       //context.codegen.emit (context);
+                        odeContext.pop ();
+                       //(new Vala.CodeNode()).get_error_types().clear();
+                       //(new Vala.NullType()).get_type_arguments().clear();
+                       (new Vala.NullType(null)).get_type_arguments().clear();
+                       parser = null;
+                       this.report.compile_notice("END", "", 0, "");
+                       print("%s\n", valac);
+                       print("ALL OK?\n");
+                       return this.report.line_errors;
+               }
+       //
+               // startpoint:
+               //
+        */
+       }
+}
+/*
+int main (string[] args) {
+
+       var a = new ValaSource(file);
+       a.create_valac_tree();
+       return 0;
+}
+*/
+
+
index c3aad3d..a52a62d 100644 (file)
@@ -338,6 +338,7 @@ namespace Palete {
                        // some of these may fail... - we probalby need a better way to handle this..
                        
                        context.add_external_package ("gtk+-3.0");
+                       context.add_external_package ("libsoup-2.4");
                        if (!context.add_external_package ("webkit2gtk-4.0")) {
                                context.add_external_package ("webkit2gtk-3.0");
                        }
index 95a4ee4..07a159a 100644 (file)
@@ -106,10 +106,26 @@ namespace Project {
                        data_out.close(null);
                        
                        return ;
-                       
-                       
-
+                        
                }
+               /**
+                *  perhaps we should select the default in the window somewhere...
+                */ 
+               public string firstBuildModule()
+               {
+                       var iter = this.compilegroups.map_iterator();
+                       while(iter.next()) {
+                                
+                                if (iter.get_value().name == "__default__") {
+                                        continue;
+                                }
+                                
+                                return iter.get_value().name;
+                       }
+                       return "";
+               }
+               
+               
                public string relPath(string target)
                {
                        var basename = this.firstPath();
index 15c4471..e3df92a 100644 (file)
@@ -43,10 +43,7 @@ public errordomain SpawnError {
  
  * 
  */
-public delegate void SpawnFinish (int res, string str, string stderr);
-
+  
 public class Spawn : Object
 {
        /**
@@ -54,6 +51,11 @@ public class Spawn : Object
         * @return the string or null 
         */
        public signal string? input();
+       /**
+        * @signal complete called at when the command has completed.
+        * 
+        */
+       public signal void complete(int res, string str, string stderr);
        /**
         * @signal output_line called when a line is recieved from the process.
         * Note you may want to connect this and run 
@@ -137,7 +139,7 @@ public class Spawn : Object
      * result is applied to object properties (eg. '?' or 'stderr')
      * @returns {Object} self.
      */
-       public void run(SpawnFinish finish) throws SpawnError, GLib.SpawnError, GLib.IOChannelError
+       public void run( ) throws SpawnError, GLib.SpawnError, GLib.IOChannelError
        {
                
                 
@@ -207,7 +209,7 @@ public class Spawn : Object
                        this.tidyup();
                        //print("DONE TIDYUP");
                        
-                       finish(this.result, this.output, this.stderr);
+                       this.complete(this.result, this.output, this.stderr);
                        
                });
            
diff --git a/tests/enum.vala b/tests/enum.vala
new file mode 100644 (file)
index 0000000..bfe1a77
--- /dev/null
@@ -0,0 +1,20 @@
+// compile
+// valac   --pkg  gtk+-3.0  enum.vala   -o /tmp/enum
+// ??--pkg javascriptcore \
+
+
+int main (string[] args) {
+       Gtk.init(ref args);
+       var type = typeof(Gtk.Box);
+       var  ocl = (ObjectClass) type.class_ref ();
+       var ps = ocl.find_property("orientation");
+       var vt = ps.value_type;
+    EnumClass ec = (EnumClass) vt.class_ref ();
+       for (var i =0;i< ec.n_values; i++) {
+               var ev = ec.values[i];
+               print("%s : %d\n", ev.value_name,ev.value);
+       }
+        
+       return 0;
+}
+