Fix #7959 - new project flow - use void func to callback after each step, tidy up...
[roobuilder] / src / Builder4 / WindowState.vala
index 168f12e..832c367 100644 (file)
@@ -12,52 +12,41 @@ public class WindowState : Object
        public enum State {
                NONE,
                PREVIEW,
-               OBJECT,
-               PROP,
-               LISTENER,
-               CODE,    // code editor.
-               CODEONLY,
-               FILES //,
-               // PROJECTCODEONLY // when editing code...              ??
-               //PROJECT, // project settings..
-               //FILEPROJECT, // project when in file mode
-
+               CODE,
+               CODEONLY  
        }
-
        public State state = State.NONE;
-
        public bool children_loaded = false;
  
-       public Project.Project project;
-       public JsRender.JsRender file;
-        
-       
+       public Project.Project? project = null;
+       public JsRender.JsRender? file = null;
+         
        public Xcls_WindowLeftTree  left_tree;
-       public Xcls_WindowAddProp   add_props;
+       public Xcls_PopoverAddProp   add_props;
        public Xcls_LeftProps       left_props;
        public Xcls_RooProjectSettings roo_projectsettings_pop;
-       public Xcls_ValaProjectSettingsPopover  vala_projectsettings_pop;
-       public Xcls_RightPalete     rightpalete;
-       public Editor               code_editor;    
+       public ValaProjectSettingsPopover  vala_projectsettings_pop; 
+       public Xcls_PopoverAddObject     rightpalete;
+       //public Xcls_PopoverEditor               code_editor_popover;
+       public Editor                                    code_editor_tab; 
        public Xcls_WindowRooView   window_rooview;
        public Xcls_GtkView         window_gladeview;
+       public DialogFiles popover_files;
        
-       public Xcls_ClutterFiles     clutterfiles;
-
-       public Xcls_WindowLeftProjects left_projects; // can not see where this is initialized.. 
-       
+       //public Xcls_ClutterFiles     clutterfiles;
+       //public Xcls_WindowLeftProjects left_projects; // can not see where this is initialized.. 
+        
        public DialogTemplateSelect template_select; 
        
        public Xcls_PopoverFileDetails file_details;
-       
-       
        public Xcls_ValaCompileResults compile_results;
        
        // dialogs??
-       public Xcls_DialogPluginWebkit webkit_plugin;
+
        
        
-       public Palete.ValaSource valasource; // the spawner that runs the vala compiler.
+       //public Palete.ValaSource valasource; // the spawner that runs the vala compiler.
        public Json.Object last_compile_result;
        
        // ctor 
@@ -73,8 +62,9 @@ public class WindowState : Object
                // on clutter space...
                this.projectEditInit();
                this.codeEditInit();
-               this.projectListInit();
-               this.fileViewInit();
+               //this.codePopoverEditInit();
+               //this.projectListInit();
+               //this.fileViewInit();
 
                // adding stuff
                this.objectAddInit();
@@ -89,25 +79,31 @@ public class WindowState : Object
 
                this.fileDetailsInit();
 
-               this.webkit_plugin = new Xcls_DialogPluginWebkit();
+
                this.template_select = new DialogTemplateSelect();
                this.children_loaded = true;
                
                
-               this.valasource = new Palete.ValaSource();
-               this.valasource.window = this.win;
-               this.valasource.compiled.connect(this.showCompileResult);
+                
+               //BuilderApplication.valasource.compiled.connect(this.showCompileResult); 
+               
                
-               this.compile_results = new  Xcls_ValaCompileResults();
+               this.compile_results = new  Xcls_ValaCompileResults(); // the poup dialogs with results in.
                this.compile_results.window = this.win;
-               this.valasource.compile_output.connect(this.compile_results.addLine);
+               //BuilderApplication.valasource.compile_output.connect(this.compile_results.addLine);
                
                this.win.statusbar_compilestatus_label.el.hide();
                this.win.statusbar_run.el.hide();
-               this.win.search_results.el.hide();
-       }
+  
+               this.popover_files = new DialogFiles();
+                this.popover_files.win = this.win;
+           this.popover_files.el.application = this.win.el.application;
+           this.popover_files.el.set_transient_for( this.win.el );
 
+       }
 
        // left tree
 
        public void leftTreeInit()
@@ -117,8 +113,13 @@ public class WindowState : Object
                this.left_tree.ref();
                this.left_tree.main_window = this.win;
        
-               this.win.tree.el.pack_start(this.left_tree.el,true, true,0);
-               this.left_tree.el.show_all();
+               this.win.leftpane.el.remove(this.win.editpane.el);
+       //this.win.tree.el.remove(this.left_tree.el);
+       this.win.leftpane.el.append(this.left_tree.el);
+           
+       
+               //this.win.tree.el.pack_start(this.left_tree.el,true, true,0);
+               this.left_tree.el.show();
                   
                this.left_tree.before_node_change.connect(() => {
                        // if the node change is caused by the editor (code preview)
@@ -129,23 +130,23 @@ public class WindowState : Object
 
                });
                // node selected -- only by clicking?
-               this.left_tree.node_selected.connect((sel, source) => {
-                       if (source == "editor") {
-                               return;
-                       }
+               this.left_tree.node_selected.connect((sel) => {
+                       //if (source == "editor") {
+                       //      return;
+                       //}
                        if (this.file.xtype == "Roo") { 
                                this.window_rooview.sourceview.nodeSelected(sel,true); // foce scroll.
                        } else {
-                               this.window_gladeview.sourceview.nodeSelected(sel);
+                               this.window_gladeview.sourceview.nodeSelected(sel, true);
                        }
                });
                
-               this.left_tree.node_selected.connect((sel, source) => {
-                       this.leftTreeNodeSelected(sel, source);
+               this.left_tree.node_selected.connect((sel) => {
+                       this.leftTreeNodeSelected(sel);
                });
         
                this.left_tree.changed.connect(() => {
-                       print("LEFT TREE: Changed fired\n");
+                       GLib.debug("LEFT TREE: Changed fired\n");
                        this.file.save();
                        if (this.left_tree.getActiveFile().xtype == "Roo" ) {
                                   this.window_rooview.requestRedraw();
@@ -159,55 +160,149 @@ public class WindowState : Object
 
        public bool leftTreeBeforeChange()
        {
-               if (this.state != State.CODE) {
-                       this.left_props.finish_editing();
+               // in theory code editor has to hide before tree change occurs.
+               //if (this.state != State.CODE) {
+                       //this.left_props.finish_editing();
+                       
+                       if (this.state == State.CODE) {
+                               this.code_editor_tab.saveContents();
+                               this.switchState(State.PREVIEW);
+                       }
+                       
                        return true;
-               }
-               if (!this.code_editor.saveContents()) {
-                       return false;
-               }
-               return false;
+               //}
+
+               //if (!this.code_editor.saveContents()) {
+               //      return false;
+               //}
+               //return false;
        }
        
-       public void leftTreeNodeSelected(JsRender.Node? sel, string source)
+       int tree_width = 300;
+       int props_width = 300;
+       
+       public void leftTreeNodeSelected(JsRender.Node? sel)
        {
-
+               
+               // do we really want to flip paletes if differnt nodes are selected
+               // showing palete should be deliberate thing..
+                
+        
                print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
 
+               this.add_props.hide(); // always hide add node/add listener if we change node.
+               this.rightpalete.hide();
+               
+               this.left_props.load(this.left_tree.getActiveFile(), sel);
+               
+               var outerpane = this.win.mainpane.el;
+               var innerpane = this.win.editpane.el;
+               
+                if (this.win.editpane.el.parent != null && sel != null) {
+                       // select another node... no change to show hide/resize
+                       return;
+               }
+                                
                if (sel == null) {
+                   // remove win.editpane from leftpane
+                   // remove lefttree from from win.tree 
+                   // add win.tree to leftpane
+                   if (this.win.editpane.el.parent != null) {
+                       this.props_width =  outerpane.get_position() - innerpane.get_position();
+                       this.tree_width = innerpane.get_position();
+                       GLib.debug("HIDE: prop_w = %d, tree_w = %d", this.props_width, this.tree_width);
+                       
+                       this.win.leftpane.el.remove(this.win.editpane.el);
+                       this.win.tree.el.remove(this.left_tree.el);
+                       this.win.leftpane.el.append(this.left_tree.el);
+               }
+                   
+               
+                       //GLib.debug("Hide Properties");
+                       outerpane.show(); // make sure it's visiable..
                        this.left_props.el.hide();
-               } 
-               this.left_props.el.show();
-               this.left_props.load(this.left_tree.getActiveFile(), sel);
-               switch (this.state) {
-                       
-                       case State.OBJECT: 
-                                 
-                                if (sel == null) {
-                                       this.rightpalete.clear();
-                                       break;
-                               }
-                               this.rightpalete.load(this.left_tree.getActiveFile().palete(), sel.fqn());
-                               break;
-                                
+                       GLib.debug("set position: %d", this.tree_width);
+                       outerpane.set_position(this.tree_width);
+                       //outerpane.set_position(int.max(250,innerpane.get_position()));
+                       //this.left_props.el.width_request =  this.left_props.el.get_allocated_width();
+                       return;
+               }
+               
+               // at this point we are showing the outer only,
+               
+               
+               
+               
+               this.tree_width = outerpane.get_position();
+               
+               GLib.debug("SHOW: prop_w = %d, tree_w = %d", this.props_width, this.tree_width);
+                     
+               // remove this.ldeftree from this.win.leftpane
+               this.win.leftpane.el.remove(this.left_tree.el);
+               this.win.tree.el.append(this.left_tree.el);
+               this.win.leftpane.el.append(this.win.editpane.el);
+               
+               
+               
+               
+               GLib.debug("left props is %s",  this.left_props.el.visible ? "shown" : "hidden");
+               // at start (hidden) - outer  = 400 inner = 399
+               // expanded out -> outer = 686, inner = 399 
+               //this.win.props.el.pack_start(this.left_props.el,true, true,0);
+               this.left_props.el.show();              //if (!this.left_props.el.visible) {
+                
+                       GLib.debug("outerpos : %d, innerpos : %d", outerpane.get_position(), innerpane.get_position());
+                       outerpane.set_position(this.tree_width + this.props_width);
+                       innerpane.set_position(this.tree_width);
+                       /* var cw = outerpane.el.get_position();
+                       var rw = int.min(this.left_props.el.width_request, 150);
+                       print("outerpos : %d, innerpos : %d", cw + rw, cw);
+                       
+                       innerpane.set_position(cw); */
+                       this.left_props.el.show();
+               
+               //}
+               
+                
+               
+               
                
-                  case State.PROP:
-                               if (sel == null) {
-                                       this.add_props.clear();
-                                       break;
-                               }
-                               this.add_props.show(this.left_tree.getActiveFile().palete(), "props", sel.fqn());
-                               break;
 
-                       case State.LISTENER:
-                          
-                               if (sel == null) {
-                                       this.add_props.clear();
-                                       break;
-                               }
-                               this.add_props.show(this.left_tree.getActiveFile().palete(), "signals", sel.fqn());
-                               break;
-                               
+               
+               
+               // if either of these are active.. then we should update them??
+               
+               
+               
+   /**
+   
+   make outerpane = {current width of left pane} + width of props
+   make innerpane = {current width of left pane}
+   
+   
+   
+   
+   
+   var outerpane = _this.main_window.leftpane.el;
+   var pane = _this.main_window.editpane.el;
+   
+  
+   
+    var try_size = (i * 25) + 60; // est. 20px per line + 40px header
+    GLib.Timeout.add_seconds(1, () => { 
+               // max 80%...
+               pane.set_position( 
+                    ((try_size * 1.0f) /  (pane.max_position * 1.0f))  > 0.8f  ? 
+                   (int) (pane.max_position * 0.2f) :
+                   pane.max_position-try_size);
+           return GLib.Source.REMOVE;
+       });
+       */
+               
+               
+               /*
+               switch (this.state) {
+                
                        case State.CODE:
                                 this.switchState(State.PREVIEW);
                         
@@ -215,6 +310,8 @@ public class WindowState : Object
                           
                                                        
                }
+               */
                 
 
        }
@@ -228,32 +325,31 @@ public class WindowState : Object
                this.left_props =new Xcls_LeftProps();
                this.left_props.ref();
                this.left_props.main_window = this.win;
-               this.win.props.el.pack_start(this.left_props.el,true, true,0);
-               this.left_props.el.show_all();
+               this.win.props.el.append(this.left_props.el);
+               this.left_props.el.show();
        
-               this.left_props.show_editor.connect( (file, node, type,  key) => {
+               this.left_props.show_editor.connect( (file, node, prop) => {
                        this.switchState(State.CODE);
-                       this.code_editor.show(
+                       
+                       
+                       this.code_editor_tab.show(
                                file,
                                node,
-                               type,
-                               key
+                               prop
                        );
+                       ///this.markBuf();
                        
                        
                });
 
-   
+               // not sure if this is needed - as closing the popvoer should save it.
                this.left_props.stop_editor.connect( () => {
-                       if (this.state != State.CODE) {
-                               return true;
-                       }
-       
-                       var ret =  this.code_editor.saveContents();
+                       var ret =  this.code_editor_tab.saveContents();
                        if (!ret) {
                                return false;
                        }
                        this.switchState(State.PREVIEW);
+                        
                        return ret;
                });
        
@@ -263,14 +359,17 @@ public class WindowState : Object
                        } else {
                                  this.window_gladeview.loadFile(this.left_tree.getActiveFile());
                        }
-                       this.left_tree.model.updateSelected();
+                       //this.left_tree.model.updateSelected();
                        this.file.save();
-                       if (this.file.xtype=="Gtk") {
-                               this.valasource.checkFileSpawn(this.file);
+                       if (this.file.project.xtype=="Gtk") {
+                                       BuilderApplication.valacompilequeue.addFile( 
+                                               Palete.ValaCompileRequestType.PROJECT, 
+                                               this.file, "", true ) ;
+                       
+                               //BuilderApplication.valasource.checkFileSpawn(this.file);
                        }
                });
-       
-
+        
 
        }
 
@@ -279,46 +378,67 @@ public class WindowState : Object
        public void projectEditInit()
        {
                this.roo_projectsettings_pop  =new Xcls_RooProjectSettings();
-               this.roo_projectsettings_pop.ref();  /// really?
+               this.roo_projectsettings_pop.el.application = this.win.el.application;
+
        
-               this.vala_projectsettings_pop  =new Xcls_ValaProjectSettingsPopover();
-               this.vala_projectsettings_pop.ref();
-               this.vala_projectsettings_pop.window = this.win;
+               this.vala_projectsettings_pop  =new  ValaProjectSettingsPopover();
+
+               this.vala_projectsettings_pop.window = this.win;
+               this.vala_projectsettings_pop.el.application = this.win.el.application;
+               
+               //this.vala_projectsettings_pop.el.set_parent(this.win.el); // = this.win;
        
                //((Gtk.Container)(this.win.projecteditview.el.get_widget())).add(this.projectsettings.el);
  
  
                this.roo_projectsettings_pop.buttonPressed.connect((btn) => {
+                       if (btn == "save" || btn == "apply") {
+                               this.roo_projectsettings_pop.save();
+                               this.roo_projectsettings_pop.project.save();
+                
+                       }
+               
                        // in theory active file can only be rooo...
-                        if (this.left_tree.getActiveFile().xtype == "Roo" ) {
-                               if (btn == "save") {
-                                       this.window_rooview.view.renderJS(true);
-                                       this.roo_projectsettings_pop.el.hide();
-                               }
-                               if (btn == "apply") {
-                                       this.window_rooview.view.renderJS(true);
-                                       return;
+                       var ep = this.roo_projectsettings_pop.project;
+                       foreach(var ww in BuilderApplication.windows) {
+                               if (ww.windowstate.file != null && 
+                                       ww.windowstate.project.path == ep.path && 
+                                       ww.windowstate.file.xtype == "Roo") {
+                                        
+                                   ww.windowstate.window_rooview.view.renderJS(true);
+                                                
                                }
-                       } else {
-                               // do nothing for gtk..
                        }
-                       if (btn == "save" || btn == "apply") {
-                               this.win.project.save();
-                
+                       
+                        
+                       
+                       if (btn == "save") {
+                               this.roo_projectsettings_pop.el.hide();
                        }
                        //this.switchState (State.PREVIEW); 
                         
                 });
 
        }
-       public void projectPopoverShow(Gtk.Widget btn)
-       {
-               if (this.left_tree.getActiveFile().xtype == "Roo" ) {
-                       this.roo_projectsettings_pop.show(btn,this.project);
+       
+       public void projectPopoverShow(Gtk.Window pwin, Project.Project? pr, Project.Callback? doneObj) 
+       { 
+               if (pr == null) {
+                   pr = this.project;
+           }
+         
+           
+        if (pr.xtype == "") {
+            return;
+        }
+        if (pr.xtype  == "Roo" ) {
+                       this.roo_projectsettings_pop.show(pwin,(Project.Roo)pr);
                        return;
                }
+
                // gtk..
-               this.vala_projectsettings_pop.show(btn,(Project.Gtk)this.project);
+               
+               this.vala_projectsettings_pop.show(pwin,(Project.Gtk)pr,  doneObj);
        
        }
        
@@ -327,14 +447,15 @@ public class WindowState : Object
        public void objectAddInit()
        {
 
-               this.rightpalete  = new Xcls_RightPalete();
+               this.rightpalete  = new Xcls_PopoverAddObject();
+               this.rightpalete.mainwindow = this.win;
                this.rightpalete.ref();  /// really?
-               ((Gtk.Container)(this.win.objectview.el.get_widget())).add(this.rightpalete.el);
+               /*((Gtk.Container)(this.win.objectview.el.get_widget())).add(this.rightpalete.el);
  
 
                var stage = this.win.objectview.el.get_stage();
                stage.set_background_color(  Clutter.Color.from_string("#000"));
-                  
+                */
        }
        
        // -----------  properties adding list...
@@ -342,18 +463,18 @@ public class WindowState : Object
        public void propsAddInit()
        {
        // Add properties
-               this.add_props  = new Xcls_WindowAddProp();
+               this.add_props  = new Xcls_PopoverAddProp();
+               this.add_props.mainwindow = this.win;
                this.add_props.ref();  /// really?
-               ((Gtk.Container)(this.win.addpropsview.el.get_widget())).add(this.add_props.el);
+               // don't need to add it..
+               //((Gtk.Container)(this.win.addpropsview.el.get_widget())).add(this.add_props.el);
  
 
-               var  stage = this.win.addpropsview.el.get_stage();
-               stage.set_background_color(  Clutter.Color.from_string("#000"));
+               //var  stage = this.win.addpropsview.el.get_stage();
+               //stage.set_background_color(  Clutter.Color.from_string("#000"));
 
 
-               this.add_props.select.connect( (key,type,skel, etype) => {
-                       this.left_props.addProp(etype, key, skel, type);
-               });
+        
 
        }
        public void propsAddShow()
@@ -365,9 +486,7 @@ public class WindowState : Object
        
        }
 
-
-
-       
        // ----------- Add / Edit listener
        // listener uses the properties 
        //public void listenerInit()     { }
@@ -384,143 +503,212 @@ public class WindowState : Object
 
        public void codeEditInit()
        {
-               this.code_editor  = new  Editor();
+               this.code_editor_tab  = new  Editor();
                //this.code_editor.ref();  /// really?
-               ((Gtk.Container)(this.win.codeeditview.el.get_widget())).add(this.code_editor.el);
+               this.win.codeeditviewbox.el.append(this.code_editor_tab.el);
                
-               this.code_editor.window = this.win;
+               this.win.codeeditviewbox.el.hide();
+               this.code_editor_tab.window = this.win;
  
-
-               var stage = this.win.codeeditview.el.get_stage();
-               stage.set_background_color(  Clutter.Color.from_string("#000"));
                // editor.save...
 
-               this.code_editor.save.connect( () => {
+               this.code_editor_tab.save.connect( () => {
                        this.file.save();
-                       this.left_tree.model.updateSelected();
+                       //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());
                        }
+                       if (this.file.project.xtype=="Gtk") {
+                               BuilderApplication.valacompilequeue.addFile( 
+                                               Palete.ValaCompileRequestType.PROJECT, 
+                                               this.file, "", false ) ;
+                       }
+                       
                         // we do not need to call spawn... - as it's already called by the editor?
                         
                });
                
        }
-
-       // ----------- list of projects on left
-       public void  projectListInit() 
-       {
-
-               this.left_projects = new Xcls_WindowLeftProjects();
-                this.left_projects.ref();
-                this.win.leftpane.el.pack_start(this.left_projects.el,true, true,0);
-                this.left_projects.el.show_all();
-                this.left_projects.project_selected.connect((proj) => {
-                       this.buttonsShowHide();
-                       proj.scanDirs();
-                       this.clutterfiles.loadProject(proj);
-               
-                });
-
-       }
+        
+       
        // ----------- file view
-
-       public void fileViewInit()
+       public void showPopoverFiles(Gtk.Widget btn, Project.Project? project, bool new_window)
        {
-               var stage = this.win.rooview.el.get_stage(); // seems odd... 
-               this.clutterfiles = new Xcls_ClutterFiles();
-               this.clutterfiles.ref();
-               stage.add_child(this.clutterfiles.el);
-               this.clutterfiles.el.show();
-
-
-               this.clutterfiles.open.connect((file) => { 
-                       this.fileViewOpen(file);
-               });
-               this.clutterfiles.el.transitions_completed.connect(() => {
-                       if (this.state == State.FILES) {
-                               this.win.rooview.el.hide();
-                       } else {
-                               this.clutterfiles.el.hide();
-                       }
-                       
-                       
-               });
-
+               this.popover_files.show(  project, new_window);
+       
        }
+       
+       
  
        public void fileDetailsInit()
        {
                this.file_details = new Xcls_PopoverFileDetails();
                this.file_details.mainwindow = this.win;
+               this.file_details.el.application = this.win.el.application;
+//             this.file_details.el.set_parent(this.win.el);
                // force it modal to the main window..
                
                this.file_details.success.connect((project,file) =>
                {
-                       this.fileViewOpen(file);
+                       this.popover_files.el.hide();
+                       this.fileViewOpen(file, this.file_details.new_window,  -1);
+                       // if it's comming from the file dialog -> hide it...
+                       
                });
 
        }
        
-       public void fileViewOpen(JsRender.JsRender file, int line = -1)
+       
+       public void gotoLine(int line)
+       {
+       
+               if (line < 0) {
+                       return;
+               }
+               if (file.xtype == "PlainFile") {
+                   this.switchState (State.CODEONLY); 
+                        
+                       this.code_editor_tab.scroll_to_line(line);
+                       return;
+               }               
+       
+       
+               this.switchState (State.PREVIEW); 
+                
+               if ( line> -1 ) {
+                       // fixme - show the editing tab.
+                       // node and prop?
+                       var node = file.lineToNode(line);
+                       if (node != null) {
+                               this.left_tree.model.selectNode(node);
+                               var prop = node.lineToProp(line);
+                               
+                               if (prop == null) {
+                                       GLib.debug("could not find prop at line %d", line);
+                                       return;
+                               }
+                                this.left_props.view.editProp(prop);
+                               
+                               
+                               
+                               return;
+                       } 
+                       
+                       if (this.project.xtype == "Gtk") {
+                               this.window_gladeview.scroll_to_line(line);
+                       } else {
+                               this.window_rooview.scroll_to_line(line);                       
+                       }
+                       
+                       return;
+               } 
+               var node = file.lineToNode(line);
+               if (node != null) {
+                       this.left_tree.model.selectNode(node);
+                       //var prop = node.lineToProp(line);
+                       return;
+               } 
+       
+               this.window_rooview.scroll_to_line(line);
+               
+       
+       
+       }
+       
+       public void fileViewOpen(JsRender.JsRender file, bool new_window, int line = -1)
        {
+               var existing = BuilderApplication.getWindow(file);
+               
+               if (existing != null) {
+                       existing.el.present();
+                       existing.windowstate.gotoLine(line);
+                       return;
+               }
+               
+               if (new_window) {
+       
+                       this.popover_files.el.hide();
+                       BuilderApplication.newWindow(file, line);
+                       return;
+               }
+               
+               
                this.win.project = file.project;
                this.project = file.project;
                this.file = file;
+               BuilderApplication.updateWindows();
                
-               
+
+                       
+                       
                if (file.xtype == "PlainFile") {
+                       this.win.codeeditviewbox.el.show();
                        this.switchState (State.CODEONLY); 
-                       file.loadItems();
-                       this.code_editor.show(file, null, "", "");
-                       if (line> -1) {
-                               this.code_editor.scroll_to_line(line);
-                       }
+                       try {
+                               file.loadItems();
+                       } catch (Error e) {}
+                       this.code_editor_tab.show(file, null, null);
+                        
                } else {
                
                        this.switchState (State.PREVIEW); 
                        // this triggers loadItems..
                        this.left_tree.model.loadFile(file);
-                       if (file.project.xtype == "Gtk" && line> -1 ) {
-                               this.window_gladeview.scroll_to_line(line);
-                       }
+                        
 
                }
+               BuilderApplication.updateCompileResults();
+               if (file.project.xtype == "Gtk" && file.project.last_request == null ) {
+                               
+                       BuilderApplication.valacompilequeue.addFile( 
+                               Palete.ValaCompileRequestType.PROJECT, 
+                               this.file, "" , true) ;
+                        
+               }
+               this.gotoLine(line);
        
-       
-               var ctr= ((Gtk.Container)(this.win.rooview.el.get_widget()));
+               var ctr= this.win.rooviewbox.el;
  
        
                if (file.project.xtype == "Roo" ) { 
-                       ctr.foreach( (w) => { ctr.remove(w); });
-                       ctr.add(this.window_rooview.el);
+                   // removes all the childe elemnts from rooviewbox
+                       while( ctr.get_last_child() != null) {
+                               ctr.remove(ctr.get_last_child());
+                       }
+                       
+                       ctr.append(this.window_rooview.el);
  
                        if (file.xtype != "PlainFile") {       
                                this.window_rooview.loadFile(file);
-                               this.window_rooview.el.show_all();
+                               this.window_rooview.el.show();
                        }
  
                        
 
                } else {
-                       ctr.foreach( (w) => { ctr.remove(w); });
+                       while( ctr.get_last_child() != null) {
+                               ctr.remove(ctr.get_last_child());
+                       }
 
-                       ctr.add(this.window_gladeview.el);
+                       ctr.append(this.window_gladeview.el);
  
                        if (file.xtype != "PlainFile") {    
+                               
                                this.window_gladeview.loadFile(file);
-                               this.window_gladeview.el.show_all();
+                               this.window_gladeview.el.show();
                        }
  
                }
                print("OPEN : " + file.name);
-               if (file.xtype != "PlainFile") {    
-                       this.win.editpane.el.set_position(this.win.editpane.el.max_position);
+               if (file.xtype != "PlainFile") { 
+                       // hide the file editor.
+                  this.win.codeeditviewbox.el.hide();
+                       //this.win.editpane.el.set_position(this.win.editpane.el.max_position);
                }
-               this.win.setTitle(file.project.name + " : " + file.name);
+               this.win.setTitle();
                         
 
        }
@@ -541,40 +729,67 @@ public class WindowState : Object
                this.window_rooview  =new Xcls_WindowRooView();
                this.window_rooview.main_window = this.win;
                this.window_rooview.ref();
-               ((Gtk.Container)(this.win.rooview.el.get_widget())).add(this.window_rooview.el);
-               this.window_rooview.el.show_all();
-
-               var stage = this.win.rooview.el.get_stage();
-               stage.set_background_color(  Clutter.Color.from_string("#000"));
+               this.win.rooviewbox.el.append(this.window_rooview.el);
+               
+               this.window_rooview.el.show();
+               this.win.rooviewbox.el.hide();
+       
        }
 
        // ------ Gtk  - view
 
        public void gtkViewInit()
        {
-               this.window_gladeview  =new Xcls_GtkView();
+
+               
+               
+               this.window_gladeview  =new Xcls_GtkView( );
                this.window_gladeview.ref();
                this.window_gladeview.main_window = this.win;
        }
        
-       public void easingSaveAll()
+
+       
+       
+       public void showProps(Gtk.Widget btn, JsRender.NodePropType sig_or_listen)
        {
-               this.win.addpropsview.el.save_easing_state();
-               this.win.codeeditview.el.save_easing_state();
-               this.win.objectview.el.save_easing_state();
-               this.win.rooview.el.save_easing_state();
-               this.clutterfiles.el.save_easing_state();
-                
+               var ae =  this.left_tree.getActiveElement();
+               if (ae == null) {
+                               return;
+               }
+               this.rightpalete.hide(); 
+               this.add_props.el.set_parent(btn);
+               this.add_props.el.set_position(Gtk.PositionType.RIGHT);
+        
+               this.add_props.show(
+                       this.win.project.palete, //Palete.factory(this.win.project.xtype), 
+                        sig_or_listen, //this.state == State.LISTENER ? "signals" : "props",
+                       ae,
+                       btn
+                       
+               );
        }
-       public void easingRestoreAll()
+       
+       public void showAddObject(Gtk.Widget btn, JsRender.Node? on_node)
        {
-               this.win.addpropsview.el.restore_easing_state();
-               this.win.codeeditview.el.restore_easing_state();
-               this.win.objectview.el.restore_easing_state();
-               this.win.rooview.el.restore_easing_state();
-               this.clutterfiles.el.restore_easing_state();
+        
+                
+               this.add_props.hide();
+                
+               this.add_props.el.set_position(Gtk.PositionType.RIGHT);
                
+               //this.rightpalete.el.set_parent(btn);
+               this.rightpalete.show(
+                       this.left_tree.getActiveFile().palete(), 
+                       on_node == null ? "*top" : on_node.fqn(),
+                       btn
+               );
        }
+        
+                 
+       
        public void switchState(State new_state)
        {
                
@@ -584,19 +799,18 @@ public class WindowState : Object
                        return;
                }
                
-               // stop werid stuff happening
-               
-               if (this.state == State.FILES 
-                       //&& new_state == State.FILEPROJECT 
-                       && this.left_projects.getSelectedProject() == null) {
-                       return;
-               }
-               // save the easing state of everything..
-               this.easingSaveAll();
+               // anything to do beforehand?
                
                switch (this.state) {
-
+                        
+                
+                       
                        case State.PREVIEW:
+                               // stop editing the editor tab.
+                               // always save before calling switch state to preview?
+                               
+                               this.code_editor_tab.reset();
+                                
                                if (this.left_tree.getActiveFile() != null) {
                                         if (this.left_tree.getActiveFile().xtype == "Roo" ) {
                                                 this.window_rooview.createThumb();
@@ -606,615 +820,50 @@ public class WindowState : Object
                                }
                                // normally we are going from preview to another state.
                                // and different windows hide the preview in differnt ways..
-                               
-                               break;
-                               
-                       
-                  case State.LISTENER:
-                  case State.PROP:
-                               
-                               this.win.addpropsview.el.set_scale(0.0f,0.0f);
-                                break;
-                               
-                       case State.CODE:
-                               this.code_editor.saveContents();
-                         
-                               this.win.codeeditview.el.set_scale(0.0f,0.0f);
                                break;
                                
                        case State.CODEONLY:
-                               // going from codeonly..
-                               
-                               // enable re-calc of canvas..
-
-                               //this.code_editor.saveContents(); << not yet...
-
-                               this.win.rooview.el.show(); 
-                               this.win.leftpane.el.show();
-                               this.win.codeeditview.el.set_scale(0.0f,0.0f);
-                       
-                               /*this.win.codeeditview.el.set_easing_duration(1000);
-                               this.win.codeeditview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
-                               //this.win.codeeditview.el.set_scale(1.0f,1.0f);
-                               this.win.codeeditview.el.set_pivot_point(0.5f,0.5f);
-                               this.win.codeeditview.el.set_opacity(0xff);
-                       */
-                       
-                           while (Gtk.events_pending()) { 
-                                       Gtk.main_iteration();
-                               }
-                               
-                                // hides it completely...
-                                
-                               break;
-
-                        case State.OBJECT:
-                          
-                               this.win.objectview.el.set_scale(0.0f,0.0f);
-                                break;
-
-                       /*case State.FILEPROJECT:
-                       //case State.PROJECT:
-                       //case State.PROJECTCODEONLY:
-                               if (this.win.project.xtype == "Gtk") {
-                                       this.vala_projectsettings.save();
-                               } 
-                               if (this.state == State.FILEPROJECT) {
-                                       this.clutterfiles.el.set_scale(1.0f,1.0f);
-                               
-                               }
-                               this.win.projecteditview.el.set_scale(0.0f,0.0f);
-                               break;
-                       */
-                 case State.FILES: // goes to preview or codeonly...
-                               // hide files...
-                               
-                               
-                               /*if (new_state == State.FILEPROJECT) {
-                               
-                                       this.clutterfiles.el.set_easing_duration(1000);
-                                       this.clutterfiles.el.set_pivot_point(0.5f,1.0f);
-                                       this.clutterfiles.el.set_scale(0.5f,0.5f);
-                                       break;
-                               }
-                               */
-                               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_pivot_point(0.5f,0.5f);
-                               this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, -180.0f);
-                               this.clutterfiles.el.set_opacity(0);
-                          
-                               //this.clutterfiles.el.hide();
-                                
-
+                       case State.CODE:
+                       case State.NONE:
                                break;
-
                                
-               }
-          
-               var oldstate  =this.state;
+        }
+                        
                this.state = new_state;
-               
-               
-                               
-               this.buttonsShowHide();
-               
+                
                
                switch (this.state) {
-                       
-                       case State.PREVIEW:  // this is the default state when working...
-                                this.win.editpane.el.show(); // holder for tree and properties..
-                                
-                        
-                                this.left_projects.el.hide(); 
-                                if (oldstate != State.FILES) {
-                                       // it's handled above..
-                                       print ("changing state to preview from NOT files..");
-                                        
-                                       this.win.rooview.el.set_scale(1.0f,1.0f);
-                                }
-                          
-                               break;
-
-
-                       case State.LISTENER:
-               // same as prop?
-                       case State.PROP:
-                               var ae =      this.left_tree.getActiveElement();
-                               if (ae == null) {
-                                       this.state = oldstate;
-                                       this.buttonsShowHide();
-                                       this.resizeCanvasElements();
-                                       this.easingRestoreAll();
-                                       return;
-                               }
-                               this.add_props.el.show_all();
-                               this.add_props.show(
-                                       this.win.project.palete, //Palete.factory(this.win.project.xtype), 
-                                       this.state == State.LISTENER ? "signals" : "props",
-                                       ae.fqn()
-                               );
-                                        
-                               
-                               // -- FIXME? this needs to be State aware?
-                
-                               this.win.rooview.el.set_pivot_point(1.0f,0.5f);
-                                 
-                               this.win.addpropsview.el.set_scale(1.0f,1.0f);
-                               break;
-                  
-                       case State.OBJECT:
-                                var n = this.left_tree.getActiveElement();
-
-                               if (this.file == null) {
-                                       this.state =oldstate;
-                                       this.buttonsShowHide();
-                                       this.resizeCanvasElements();
-                                       this.easingRestoreAll();
-                                       return;
-                               }
-                               
-                               if (n == null && this.file.tree != null) {
-                                       this.state = oldstate;
-                                       this.buttonsShowHide();
-                                       this.resizeCanvasElements();
-                                       this.easingRestoreAll();
-                                       return;
-                               }
-
-                               this.rightpalete.el.show_all();
-                               this.rightpalete.load(this.left_tree.getActiveFile().palete(), n == null ? "*top" : n.fqn());
-
-                               
-                         
-                               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);
-                               this.win.rooview.el.set_pivot_point(1.0f,0.5f);
 
-                               break;
+                       case State.PREVIEW:  // this is the default state when working...
+                               this.win.leftpane.el.show();
+                               this.win.editpane.el.show(); // holder for tree and properties..
+                           this.win.rooviewbox.el.show();
+                               this.win.codeeditviewbox.el.hide();
+                               break;
+
+                       case State.CODE:
+                               this.win.leftpane.el.show();
+                               this.win.editpane.el.show();
+                               this.win.rooviewbox.el.hide();
+                               this.win.codeeditviewbox.el.show();
+                               this.code_editor_tab.el.show();
+                               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);
+                               this.win.codeeditviewbox.el.show();
+                               this.win.rooviewbox.el.hide();
+                               this.code_editor_tab.el.show();
                                break;
 
-                       /*case State.PROJECTCODEONLY:
-                           // going to project edit (when in code only)
-
-                               
-                           
-                               if (this.win.project.xtype == "Roo") {
-                                       this.projectsettings.el.show_all();
-                                       this.projectsettings.show(this.win.project);
-                               } else {
-                                       this.vala_projectsettings.el.show_all();
-                                       this.vala_projectsettings.show((Project.Gtk)this.win.project);
-                               }
-                               this.win.projecteditview.el.set_scale(1.0f,1.0f);
-                                
+                       case State.NONE:
                                break;
 
-
-                       case State.PROJECT:
-                               this.win.rooview.el.set_pivot_point(1.0f,1.0f); // bottom right..
-                               
-                               if (this.win.project.xtype == "Roo") {
-                                       this.projectsettings.el.show_all();
-                                       this.projectsettings.show(this.win.project);
-                               } else {
-                                       this.vala_projectsettings.el.show_all();
-                                       this.vala_projectsettings.show((Project.Gtk)this.win.project);
-                               }
-                               this.win.projecteditview.el.set_scale(1.0f,1.0f);
-                                
-                               break;
-                               
-                       case State.FILEPROJECT:
-                               var pr = this.left_projects.getSelectedProject();
-
-                               this.win.project = pr;
-                               
-                               this.attachProjectSettings();
-                               print("FIlE PROJECT -  show %s\n", pr.xtype);
-                               
-                               if (pr.xtype == "Roo") {
-                                       this.projectsettings.el.show_all();
-                                       this.projectsettings.show(this.win.project);
-                               } else {
-                                       this.vala_projectsettings.el.show_all();
-                                       this.vala_projectsettings.show((Project.Gtk)this.win.project);
-                               }
-                               this.win.projecteditview.el.set_scale(1.0f,1.0f);
-                                
-                               break;
-                       */
-                  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(); 
-                               
-                               // 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);
-                        
-                               
-                               
-        
-                               if (this.win.project != null) {
-                                       this.left_projects.selectProject(this.win.project);
-                               }
-                        
-                               
-                               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;
-
-
                }
-               this.resizeCanvasElements();
-               this.easingRestoreAll();
-               
-               // run the animation.. - then load files...
-               GLib.Timeout.add(500,  ()  =>{
-                        this.resizeCanvasElements();
-                        return false;
-               });
-                       
-       }
-       
-       public int redraw_count = 0;
-       public void resizeCanvas() // called by window resize .. delays redraw
-       {
-               var rc = this.redraw_count;        
-               this.redraw_count = 2;
-               if (rc == 0) {
-                       GLib.Timeout.add(100,  ()  =>{
-                                return this.resizeCanvasQueue();
-                       });
-               }
-       }
-       public bool  resizeCanvasQueue()
-       {
-               //print("WindowState.resizeCanvasQueue %d\n", this.redraw_count);        
-
-               if (this.redraw_count < 1) {
-                       return false; // should not really happen...
-               }
-
-
-               this.redraw_count--;
-
-               if (this.redraw_count > 0) {
-                       return true; // do it again in 1 second...
-               }
-               // got down to 0 or -1....
-               this.redraw_count = 0;
-               this.resizeCanvasElements();
-               return false;
 
        }
-       public void resizeCanvasElements()
-       {
-               Gtk.Allocation alloc;
-               this.win.clutterembed.el.get_allocation(out alloc);
-
-          // print("WindowState.resizeCanvasElements\n");
-               if (!this.children_loaded || this.win.clutterembed == null) {
-                       print("WindowState.resizeCanvasElements = ingnore not loaded or no clutterfiles\n");
-                       return; 
-               }
-               
-               var avail = alloc.width < 50.0f ? 0 :  alloc.width - 50.0f;
-               var palsize = avail < 300.0f ? avail : 300.0f;
-                  
+  
  
-               // -------- code edit min 600
-               
-               var codesize = avail < 800.0f ? avail : 800.0f;
-               
-               
-               //print("set code size %f\n", codesize);
-
-                       
-               
-               switch ( this.state) {
-                       case State.PREVIEW:
-                                
-                               this.win.rooview.el.set_size(alloc.width-50, alloc.height);
-                               break;
-       
-                       case State.FILES: 
-                               this.clutterfiles.set_size(alloc.width-50, alloc.height);
-                               break;
-
-                       /*case State.PROJECT:
-                
-                               this.win.projecteditview.el.set_size(alloc.width-50, alloc.height / 2.0f);
-               
-                          // 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;
-               */
-                       case State.CODE: 
-                               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.set_scale(scale,scale);
-                          // 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);
-                               var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
-                               this.win.rooview.el.set_scale(scale,scale);
-                               break;
-                               
-                       case State.OBJECT:  
-                               this.win.objectview.el.set_size(palsize, alloc.height);    
-                               var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
-                               //this.win.rooview.el.save_easing_state();
-                               this.win.rooview.el.set_scale(scale,scale);
-                          // this.win.rooview.el.restore_easing_state();
-                               break;
-               }
-       }
-
-       // -- buttons show hide.....
-
-       public void buttonsShowHide()
-       {
-               // basically hide everything, then show the relivant..
-
-               // top bar btns
-               this.win.openbtn.el.hide();
-               this.win.openbackbtn.el.hide();
-               
-               this.win.backbutton.el.hide();
-               
-
-               this.win.editfilebutton.el.hide();
-               this.win.projecteditbutton.el.hide();
-                
-               
-               this.win.objectshowbutton.el.hide(); // add objects
-               this.win.addpropbutton.el.hide();  
-               this.win.addlistenerbutton.el.hide(); 
-
-       
-       
-               this.win.addprojectbutton.el.hide();
-               this.win.addfilebutton.el.hide();
-               this.win.delprojectbutton.el.hide();
-               
-               this.win.search_entry.el.hide();
-               this.win.search_results.el.hide();
-               switch (this.state) {
-                       
-                       case State.PREVIEW:  // this is the default state when working...
-                          
-                               
-                               this.win.editfilebutton.el.show();
-                               this.win.projecteditbutton.el.show();
-                                
-                                
-                               
-                               this.win.objectshowbutton.el.show(); // add objects
-                               this.win.addpropbutton.el.show();  
-                               this.win.addlistenerbutton.el.show(); 
-                               this.win.search_entry.el.show();
-                               
-                               this.win.openbtn.el.show();
-                               
-                               break;
-                       
-                       case State.CODEONLY: 
-                               this.win.openbtn.el.show();
-                               this.win.projecteditbutton.el.show();
-                               this.win.search_entry.el.show();
-                               break;
-                  
-                       case State.CODE: 
-                               this.win.search_entry.el.show();
-                               this.win.backbutton.el.show();
-                               this.win.objectshowbutton.el.show(); // add objects ?? can you do this from here?
-                               this.win.addpropbutton.el.show();  
-                               this.win.addlistenerbutton.el.show(); 
-                               break;
-                               // continue thru..
-                       case State.PROP:
-                       case State.LISTENER:
-                       case State.OBJECT:
-                               
-                               this.win.backbutton.el.show();
-                               this.win.objectshowbutton.el.show(); // add objects
-                               this.win.addpropbutton.el.show();  
-                               this.win.addlistenerbutton.el.show(); 
-                               break;
-                       /*
-                       case State.PROJECT: 
-                       case State.FILEPROJECT:
-                       case State.PROJECTCODEONLY:
-                               // anything else?
-                               this.win.backbutton.el.show();
-                               
-                               break;
-                       */
-       
-                       case State.FILES:
-                               if (this.left_projects.getSelectedProject() != null ) {
-                                       if (this.left_tree.getActiveFile() != null) {
-                                        
-                                               this.win.openbackbtn.el.show();
-                                       }
-                                       this.win.addfilebutton.el.show();
-                                       this.win.search_entry.el.show();
-                                       this.win.projecteditbutton.el.show(); 
-                               } 
-                               
-                                        
-                               this.win.addprojectbutton.el.show();
-                               this.win.delprojectbutton.el.show();
-                               
-                               
-                               
-                               
-                               break;
-               }
-               
-               
-
-       }
-       
-       
-       public void showCompileResult(Json.Object obj)
-               {
-                       // vala has finished compiling...
-                       print("vala compiled");
-                       // stop the spinner...
-                       
-                       var generator = new Json.Generator ();
-                       var n  = new Json.Node(Json.NodeType.OBJECT);
-                       n.init_object(obj);
-                       generator.set_root (n);
-                       print("result :%s", generator.to_data (null));
-                       
-                       
-                       var buf = this.code_editor.buffer;
-                       buf.check_running = false;
-                       var has_errors = false;
-                                     
-                       if (obj.has_member("ERR-TOTAL")) {
-                               if (obj.get_int_member("ERR-TOTAL")> 0) {
-                                       has_errors = true;
-                               }
-                                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);
-                       }
-                       //if (this.state == State.CODE || this.state == State.PROJECTCODEONLY) {
-                       if (this.state == State.CODE) {
-                               buf.highlightErrorsJson("ERR", obj); 
-                               buf.highlightErrorsJson("WARN", obj);
-                               buf.highlightErrorsJson("DEPR", obj);
-                       }
-                       
-                       this.win.statusbar_compilestatus_label.el.hide();
-                       this.win.statusbar_run.el.hide();
-                       if (!has_errors) { 
-                               this.win.statusbar_compilestatus_label.el.show();
-                               this.win.statusbar_run.el.show();
-                       }
-                       if (this.file.xtype == "Gtk") {
-                               // not sure how this is working ok? - as highlighting is happening on the vala files at present..
-                               var gbuf =   this.window_gladeview.sourceview;
-                               gbuf.highlightErrorsJson("ERR", obj);
-                               gbuf.highlightErrorsJson("WARN", obj);
-                               gbuf.highlightErrorsJson("DEPR", obj);                  
-                               
-                               if (!has_errors) {
-                                       this.win.statusbar_run.el.show();
-                               }
-                       
-                  }
-                  
-                  if (this.file.xtype == "Gtk") {
-                               // not sure how this is working ok? - as highlighting is happening on the vala files at present..
-                               var gbuf =   this.window_rooview.sourceview;
-                               gbuf.highlightErrorsJson("ERR", obj);
-                               gbuf.highlightErrorsJson("WARN", obj);
-                               gbuf.highlightErrorsJson("DEPR", obj);                  
-                       
-                  }
-                  
-                       this.last_compile_result = obj;
-                       
-                       
-               }
-       
 }