2 * as state management is a bit too complicated inside the builder
3 * it's better to seperate this into this class
5 * This class has references to all the Class instances that make up the window..
8 public class WindowState : Object
10 public Xcls_MainWindow win;
21 PROJECT, // project settings..
22 FILEPROJECT, // project when in file mode
23 PROJECTCODEONLY // when editing code...
26 public State state = State.NONE;
28 public bool children_loaded = false;
31 public Project.Project project;
32 public JsRender.JsRender file;
35 public Xcls_WindowLeftTree left_tree;
36 public Xcls_WindowAddProp add_props;
37 public Xcls_LeftProps left_props;
38 public Xcls_ProjectSettings projectsettings;
39 public ValaProjectSettings vala_projectsettings;
40 public Xcls_RightPalete rightpalete;
41 public Editor code_editor;
42 public Xcls_WindowRooView window_rooview;
43 public Xcls_GtkView window_gladeview;
45 public Xcls_ClutterFiles clutterfiles;
47 public Xcls_WindowLeftProjects left_projects; // can not see where this is initialized..
49 public DialogTemplateSelect template_select;
51 public Xcls_PopoverFileDetails file_details;
54 public Xcls_ValaCompileResults compile_results;
57 public Xcls_DialogPluginWebkit webkit_plugin;
60 public Palete.ValaSource valasource; // the spawner that runs the vala compiler.
61 public Json.Object last_compile_result;
64 public WindowState(Xcls_MainWindow win)
73 // on clutter space...
74 this.projectEditInit();
76 this.projectListInit();
86 this.webkitViewInit();
90 this.fileDetailsInit();
92 this.webkit_plugin = new Xcls_DialogPluginWebkit();
93 this.template_select = new DialogTemplateSelect();
94 this.children_loaded = true;
97 this.valasource = new Palete.ValaSource();
98 this.valasource.compiled.connect(this.valaCompiled);
100 this.compile_results = new Xcls_ValaCompileResults();
101 this.compile_results.window = this.win;
102 this.valasource.compile_output.connect(this.compile_results.addLine);
104 this.win.statusbar_compilestatus_label.el.hide();
105 this.win.statusbar_run.el.hide();
106 this.win.search_results.el.hide();
112 public void leftTreeInit()
115 this.left_tree = new Xcls_WindowLeftTree();
116 this.left_tree.ref();
117 this.left_tree.main_window = this.win;
119 this.win.tree.el.pack_start(this.left_tree.el,true, true,0);
120 this.left_tree.el.show_all();
122 this.left_tree.before_node_change.connect(() => {
123 return this.leftTreeBeforeChange();
127 this.left_tree.node_selected.connect((sel) => {
128 this.leftTreeNodeSelected(sel);
131 this.left_tree.changed.connect(() => {
134 if (this.left_tree.getActiveFile().xtype == "Roo" ) {
135 this.window_rooview.requestRedraw();
137 this.window_gladeview.loadFile(this.left_tree.getActiveFile());
144 public bool leftTreeBeforeChange()
146 if (this.state != State.CODE) {
147 this.left_props.finish_editing();
150 if (!this.code_editor.saveContents()) {
156 public void leftTreeNodeSelected(JsRender.Node? sel)
159 print("node_selected called %s\n", (sel == null) ? "NULL" : "a value");
162 this.left_props.el.hide();
164 this.left_props.el.show();
165 this.left_props.load(this.left_tree.getActiveFile(), sel);
166 switch (this.state) {
171 this.rightpalete.clear();
174 this.rightpalete.load(this.left_tree.getActiveFile().palete(), sel.fqn());
180 this.add_props.clear();
183 this.add_props.show(this.left_tree.getActiveFile().palete(), "props", sel.fqn());
189 this.add_props.clear();
192 this.add_props.show(this.left_tree.getActiveFile().palete(), "signals", sel.fqn());
196 this.switchState(State.PREVIEW);
209 public void propsListInit()
212 this.left_props =new Xcls_LeftProps();
213 this.left_props.ref();
214 this.left_props.main_window = this.win;
215 this.win.props.el.pack_start(this.left_props.el,true, true,0);
216 this.left_props.el.show_all();
218 this.left_props.show_editor.connect( (file, node, type, key) => {
219 this.switchState(State.CODE);
220 this.code_editor.show(
231 this.left_props.stop_editor.connect( () => {
232 if (this.state != State.CODE) {
236 var ret = this.code_editor.saveContents();
240 this.switchState(State.PREVIEW);
244 this.left_props.changed.connect(() => {
245 if (this.left_tree.getActiveFile().xtype == "Roo" ) {
246 this.window_rooview.requestRedraw();
248 this.window_gladeview.loadFile(this.left_tree.getActiveFile());
250 this.left_tree.model.updateSelected();
252 if (this.file.xtype=="Gtk") {
253 this.valasource.checkFileSpawn(this.file);
261 //------------- projects edit
263 public void projectEditInit()
265 this.projectsettings =new Xcls_ProjectSettings();
266 this.projectsettings.ref(); /// really?
268 this.vala_projectsettings =new ValaProjectSettings();
269 this.vala_projectsettings.ref();
270 this.vala_projectsettings.window = this.win;
272 ((Gtk.Container)(this.win.projecteditview.el.get_widget())).add(this.projectsettings.el);
273 //this.projectsettings.el.show_all();
275 var stage = this.win.projecteditview.el.get_stage();
276 stage.set_background_color( Clutter.Color.from_string("#000"));
278 this.projectsettings.buttonPressed.connect((btn) => {
279 if (this.left_tree.getActiveFile().xtype == "Roo" ) {
281 this.window_rooview.view.renderJS(true);
283 if (btn == "apply") {
284 this.window_rooview.view.renderJS(true);
288 // do nothing for gtk..
290 if (btn == "save" || btn == "apply") {
291 this.win.project.save();
294 this.switchState (State.PREVIEW);
299 // ----------- object adding
300 public void objectAddInit()
303 this.rightpalete = new Xcls_RightPalete();
304 this.rightpalete.ref(); /// really?
305 ((Gtk.Container)(this.win.objectview.el.get_widget())).add(this.rightpalete.el);
306 //this.projectsettings.el.show_all();
308 var stage = this.win.objectview.el.get_stage();
309 stage.set_background_color( Clutter.Color.from_string("#000"));
313 // ----------- properties adding list...
314 // listener uses the properties
315 public void propsAddInit()
318 this.add_props = new Xcls_WindowAddProp();
319 this.add_props.ref(); /// really?
320 ((Gtk.Container)(this.win.addpropsview.el.get_widget())).add(this.add_props.el);
321 //this.projectsettings.el.show_all();
323 var stage = this.win.addpropsview.el.get_stage();
324 stage.set_background_color( Clutter.Color.from_string("#000"));
327 this.add_props.select.connect( (key,type,skel, etype) => {
328 this.left_props.addProp(etype, key, skel, type);
332 public void propsAddShow()
336 public void propsAddHide()
344 // ----------- Add / Edit listener
345 // listener uses the properties
346 //public void listenerInit() { }
347 public void listenerShow()
351 public void listenerHide()
356 // -------------- codeEditor
358 public void codeEditInit()
360 this.code_editor = new Editor();
361 //this.code_editor.ref(); /// really?
362 ((Gtk.Container)(this.win.codeeditview.el.get_widget())).add(this.code_editor.el);
364 this.code_editor.window = this.win;
365 //this.projectsettings.el.show_all();
367 var stage = this.win.codeeditview.el.get_stage();
368 stage.set_background_color( Clutter.Color.from_string("#000"));
371 this.code_editor.save.connect( () => {
373 this.left_tree.model.updateSelected();
374 if (this.left_tree.getActiveFile().xtype == "Roo" ) {
375 this.window_rooview.requestRedraw();
377 this.window_gladeview.loadFile(this.left_tree.getActiveFile());
379 // we do not need to call spawn... - as it's already called by the editor?
385 // ----------- list of projects on left
386 public void projectListInit()
389 this.left_projects = new Xcls_WindowLeftProjects();
390 this.left_projects.ref();
391 this.win.leftpane.el.pack_start(this.left_projects.el,true, true,0);
392 this.left_projects.el.show_all();
393 this.left_projects.project_selected.connect((proj) => {
394 this.buttonsShowHide();
396 this.clutterfiles.loadProject(proj);
401 // ----------- file view
403 public void fileViewInit()
405 var stage = this.win.rooview.el.get_stage(); // seems odd...
406 this.clutterfiles = new Xcls_ClutterFiles();
407 this.clutterfiles.ref();
408 stage.add_child(this.clutterfiles.el);
409 this.clutterfiles.el.show();
412 this.clutterfiles.open.connect((file) => {
413 this.fileViewOpen(file);
415 this.clutterfiles.el.transitions_completed.connect(() => {
416 if (this.state == State.FILES) {
417 this.win.rooview.el.hide();
419 this.clutterfiles.el.hide();
427 public void fileDetailsInit()
429 this.file_details = new Xcls_PopoverFileDetails();
430 this.file_details.mainwindow = this.win;
431 // force it modal to the main window..
433 this.file_details.success.connect((project,file) =>
435 this.fileViewOpen(file);
440 public void fileViewOpen(JsRender.JsRender file, int line = -1)
442 this.win.project = file.project;
443 this.project = file.project;
447 if (file.xtype == "PlainFile") {
448 this.switchState (State.CODEONLY);
450 this.code_editor.show(file, null, "", "");
452 this.code_editor.scroll_to_line(line);
456 this.switchState (State.PREVIEW);
457 // this triggers loadItems..
458 this.left_tree.model.loadFile(file);
459 if (file.project.xtype == "Gtk" && line> -1 ) {
460 this.window_gladeview.scroll_to_line(line);
466 var ctr= ((Gtk.Container)(this.win.rooview.el.get_widget()));
467 var ctr_p= ((Gtk.Container)(this.win.projecteditview.el.get_widget()));
469 if (file.project.xtype == "Roo" ) {
470 ctr.foreach( (w) => { ctr.remove(w); });
471 ctr_p.foreach( (w) => { ctr_p.remove(w); });
472 ctr.add(this.window_rooview.el);
473 ctr_p.add(this.projectsettings.el);
474 if (file.xtype != "PlainFile") {
475 this.window_rooview.loadFile(file);
476 this.window_rooview.el.show_all();
478 this.projectsettings.el.show_all();
482 ctr.foreach( (w) => { ctr.remove(w); });
483 ctr_p.foreach( (w) => { ctr_p.remove(w); });
484 ctr.add(this.window_gladeview.el);
485 ctr_p.add(this.vala_projectsettings.el);
486 if (file.xtype != "PlainFile") {
487 this.window_gladeview.loadFile(file);
488 this.window_gladeview.el.show_all();
490 this.vala_projectsettings.el.show_all();
492 print("OPEN : " + file.name);
493 if (file.xtype != "PlainFile") {
494 this.win.editpane.el.set_position(this.win.editpane.el.max_position);
496 this.win.setTitle(file.project.name + " : " + file.name);
500 // our project properties is different for Roo and Gtk
501 // it would be better to change the above code to use this,
502 public void attachProjectSettings() {
504 var ctr_p= ((Gtk.Container)(this.win.projecteditview.el.get_widget()));
506 if (this.win.project.xtype == "Roo" ) {
507 ctr_p.foreach( (w) => { ctr_p.remove(w); });
508 ctr_p.add(this.projectsettings.el);
509 this.projectsettings.el.show_all();
512 ctr_p.foreach( (w) => { ctr_p.remove(w); });
513 ctr_p.add(this.vala_projectsettings.el);
514 this.vala_projectsettings.el.show_all();
519 // --------- webkit view
520 public void webkitViewInit()
522 this.window_rooview =new Xcls_WindowRooView();
523 this.window_rooview.main_window = this.win;
524 this.window_rooview.ref();
525 ((Gtk.Container)(this.win.rooview.el.get_widget())).add(this.window_rooview.el);
526 this.window_rooview.el.show_all();
528 var stage = this.win.rooview.el.get_stage();
529 stage.set_background_color( Clutter.Color.from_string("#000"));
534 public void gtkViewInit()
536 this.window_gladeview =new Xcls_GtkView();
537 this.window_gladeview.ref();
538 this.window_gladeview.main_window = this.win;
541 public void easingSaveAll()
543 this.win.addpropsview.el.save_easing_state();
544 this.win.codeeditview.el.save_easing_state();
545 this.win.objectview.el.save_easing_state();
546 this.win.projecteditview.el.save_easing_state();
547 this.win.rooview.el.save_easing_state();
548 this.clutterfiles.el.save_easing_state();
551 public void easingRestoreAll()
553 this.win.addpropsview.el.restore_easing_state();
554 this.win.codeeditview.el.restore_easing_state();
555 this.win.objectview.el.restore_easing_state();
556 this.win.projecteditview.el.restore_easing_state();
557 this.win.rooview.el.restore_easing_state();
558 this.clutterfiles.el.restore_easing_state();
561 public void switchState(State new_state)
564 // if the new state and the old state are the same..
566 if (new_state == this.state) {
570 // stop werid stuff happening
572 if (this.state == State.FILES
573 && new_state == State.FILEPROJECT
574 && this.left_projects.getSelectedProject() == null) {
577 // save the easing state of everything..
578 this.easingSaveAll();
580 switch (this.state) {
583 if (this.left_tree.getActiveFile() != null) {
584 if (this.left_tree.getActiveFile().xtype == "Roo" ) {
585 this.window_rooview.createThumb();
587 this.window_gladeview.createThumb();
590 // normally we are going from preview to another state.
591 // and different windows hide the preview in differnt ways..
599 this.win.addpropsview.el.set_scale(0.0f,0.0f);
603 this.code_editor.saveContents();
605 this.win.codeeditview.el.set_scale(0.0f,0.0f);
609 // going from codeonly..
611 // enable re-calc of canvas..
613 //this.code_editor.saveContents(); << not yet...
614 if (new_state != State.PROJECTCODEONLY) {
615 this.win.rooview.el.show();
616 this.win.leftpane.el.show();
617 this.win.codeeditview.el.set_scale(0.0f,0.0f);
619 this.win.codeeditview.el.set_pivot_point(0.0f,1.0f); // bottom left
620 this.win.codeeditview.el.set_scale(0.5f,0.5f);
622 while (Gtk.events_pending()) {
623 Gtk.main_iteration();
626 // hides it completely...
632 this.win.objectview.el.set_scale(0.0f,0.0f);
635 case State.FILEPROJECT:
637 case State.PROJECTCODEONLY:
638 if (this.win.project.xtype == "Gtk") {
639 this.vala_projectsettings.save();
641 if (this.state == State.FILEPROJECT) {
642 this.clutterfiles.el.set_scale(1.0f,1.0f);
645 this.win.projecteditview.el.set_scale(0.0f,0.0f);
648 case State.FILES: // goes to preview or codeonly...
652 if (new_state == State.FILEPROJECT) {
654 this.clutterfiles.el.set_easing_duration(1000);
655 this.clutterfiles.el.set_pivot_point(0.5f,1.0f);
656 this.clutterfiles.el.set_scale(0.5f,0.5f);
660 if (new_state == State.CODEONLY) {
661 this.win.rooview.el.hide();
663 this.win.rooview.el.show();
666 this.win.rooview.el.set_easing_duration(1000);
667 this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
668 this.win.rooview.el.set_scale(1.0f,1.0f);
669 this.win.rooview.el.set_pivot_point(0.5f,0.5f);
670 this.win.rooview.el.set_opacity(0xff);
672 this.clutterfiles.el.set_easing_duration(1000);
673 this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
674 this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, -180.0f);
675 this.clutterfiles.el.set_opacity(0);
678 //this.clutterfiles.el.hide();
686 var oldstate =this.state;
687 this.state = new_state;
691 this.buttonsShowHide();
694 switch (this.state) {
696 case State.PREVIEW: // this is the default state when working...
697 this.win.editpane.el.show(); // holder for tree and properties..
700 this.left_projects.el.hide();
701 if (oldstate != State.FILES) {
702 // it's handled above..
703 print ("changing state to preview from NOT files..");
706 this.win.rooview.el.set_scale(1.0f,1.0f);
715 var ae = this.left_tree.getActiveElement();
717 this.state = oldstate;
718 this.buttonsShowHide();
719 this.resizeCanvasElements();
720 this.easingRestoreAll();
723 this.add_props.el.show_all();
725 Palete.factory(this.win.project.xtype),
726 this.state == State.LISTENER ? "signals" : "props",
733 // -- FIXME? this needs to be State aware?
735 this.win.rooview.el.set_pivot_point(1.0f,0.5f);
737 this.win.addpropsview.el.set_scale(1.0f,1.0f);
741 var n = this.left_tree.getActiveElement();
743 if (this.file == null) {
744 this.state =oldstate;
745 this.buttonsShowHide();
746 this.resizeCanvasElements();
747 this.easingRestoreAll();
751 if (n == null && this.file.tree != null) {
752 this.state = oldstate;
753 this.buttonsShowHide();
754 this.resizeCanvasElements();
755 this.easingRestoreAll();
759 this.rightpalete.el.show_all();
760 this.rightpalete.load(this.left_tree.getActiveFile().palete(), n == null ? "*top" : n.fqn());
764 this.win.rooview.el.set_pivot_point(1.0f,0.5f);
765 this.win.objectview.el.set_scale(1.0f,1.0f);
771 this.win.codeeditview.el.show();
772 this.code_editor.el.show_all();
773 // caller needs to call editor - show....
774 this.win.codeeditview.el.set_scale(1.0f,1.0f);
775 this.win.rooview.el.set_pivot_point(1.0f,0.5f);
780 // going to codeonly..
781 this.win.codeeditview.el.show();
783 //while (Gtk.events_pending()) {
784 // Gtk.main_iteration();
787 this.win.leftpane.el.hide();
788 this.win.codeeditview.el.show();
789 //while (Gtk.events_pending()) {
790 // Gtk.main_iteration();
794 this.code_editor.el.show_all();
796 this.win.codeeditview.el.set_scale(1.0f,1.0f);
797 this.win.rooview.el.set_pivot_point(1.0f,0.5f);
800 case State.PROJECTCODEONLY:
801 // going to project edit (when in code only)
805 if (this.win.project.xtype == "Roo") {
806 this.projectsettings.el.show_all();
807 this.projectsettings.show(this.win.project);
809 this.vala_projectsettings.el.show_all();
810 this.vala_projectsettings.show((Project.Gtk)this.win.project);
813 this.win.projecteditview.el.set_scale(1.0f,1.0f);
819 this.win.rooview.el.set_pivot_point(1.0f,1.0f); // bottom right..
821 if (this.win.project.xtype == "Roo") {
822 this.projectsettings.el.show_all();
823 this.projectsettings.show(this.win.project);
825 this.vala_projectsettings.el.show_all();
826 this.vala_projectsettings.show((Project.Gtk)this.win.project);
829 this.win.projecteditview.el.set_scale(1.0f,1.0f);
833 case State.FILEPROJECT:
834 var pr = this.left_projects.getSelectedProject();
836 this.win.project = pr;
838 this.attachProjectSettings();
839 print("FIlE PROJECT - show %s\n", pr.xtype);
841 if (pr.xtype == "Roo") {
842 this.projectsettings.el.show_all();
843 this.projectsettings.show(this.win.project);
845 this.vala_projectsettings.el.show_all();
846 this.vala_projectsettings.show((Project.Gtk)this.win.project);
849 this.win.projecteditview.el.set_scale(1.0f,1.0f);
853 case State.FILES: // can only get here from PREVIEW (or code-only) state.. in theory..
856 this.win.editpane.el.hide(); // holder for tree and properties..
858 this.left_projects.el.show();
860 // rotate the preview to hidden...
861 this.win.rooview.el.set_easing_duration(1000);
862 this.win.rooview.el.set_pivot_point(0.5f,0.5f);
863 this.win.rooview.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 180.0f);
864 this.win.rooview.el.set_opacity(0);
869 if (this.win.project != null) {
870 this.left_projects.selectProject(this.win.project);
874 this.clutterfiles.el.show();
876 this.clutterfiles.el.set_easing_duration(1000);
877 this.clutterfiles.el.set_pivot_point(0.5f,0.5f);
878 this.clutterfiles.el.set_rotation_angle(Clutter.RotateAxis.Y_AXIS, 0.0f);
879 this.clutterfiles.el.set_opacity(0xff);
887 this.resizeCanvasElements();
888 this.easingRestoreAll();
890 // run the animation.. - then load files...
891 GLib.Timeout.add(500, () =>{
892 this.resizeCanvasElements();
898 public int redraw_count = 0;
899 public void resizeCanvas() // called by window resize .. delays redraw
901 var rc = this.redraw_count;
902 this.redraw_count = 2;
904 GLib.Timeout.add(100, () =>{
905 return this.resizeCanvasQueue();
909 public bool resizeCanvasQueue()
911 //print("WindowState.resizeCanvasQueue %d\n", this.redraw_count);
913 if (this.redraw_count < 1) {
914 return false; // should not really happen...
920 if (this.redraw_count > 0) {
921 return true; // do it again in 1 second...
923 // got down to 0 or -1....
924 this.redraw_count = 0;
925 this.resizeCanvasElements();
929 public void resizeCanvasElements()
931 Gtk.Allocation alloc;
932 this.win.clutterembed.el.get_allocation(out alloc);
934 // print("WindowState.resizeCanvasElements\n");
935 if (!this.children_loaded || this.win.clutterembed == null) {
936 print("WindowState.resizeCanvasElements = ingnore not loaded or no clutterfiles\n");
940 var avail = alloc.width < 50.0f ? 0 : alloc.width - 50.0f;
941 var palsize = avail < 300.0f ? avail : 300.0f;
944 // -------- code edit min 600
946 var codesize = avail < 800.0f ? avail : 800.0f;
949 //print("set code size %f\n", codesize);
953 switch ( this.state) {
956 this.win.rooview.el.set_size(alloc.width-50, alloc.height);
960 this.clutterfiles.set_size(alloc.width-50, alloc.height);
965 this.win.projecteditview.el.set_size(alloc.width-50, alloc.height / 2.0f);
967 // this.win.rooview.el.save_easing_state();
968 //this.win.rooview.el.set_size(alloc.width / 2.0f, alloc.height / 2.0f);
970 this.win.rooview.el.set_scale(0.5f, 0.5f);
971 //this.win.rooview.el.restore_easing_state();
975 this.win.codeeditview.el.set_size(codesize, alloc.height);
976 var scale = avail > 0.0f ? (avail - codesize -10 ) / avail : 0.0f;
977 //this.win.rooview.el.save_easing_state();
979 this.win.rooview.el.set_scale(scale,scale);
980 // this.win.rooview.el.restore_easing_state();
984 this.win.codeeditview.el.set_size(codesize, alloc.height);
985 var scale = avail > 0.0f ? (avail - codesize -10 ) / avail : 0.0f;
986 //this.win.rooview.el.save_easing_state();
987 this.win.rooview.el.hide();
988 this.win.rooview.el.set_scale(scale,scale);
989 // this.win.rooview.el.restore_easing_state();
993 this.win.addpropsview.el.set_size(palsize, alloc.height);
994 var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
995 this.win.rooview.el.set_scale(scale,scale);
999 this.win.objectview.el.set_size(palsize, alloc.height);
1000 var scale = avail > 0.0f ? (avail - palsize -10 ) / avail : 0.0f;
1001 //this.win.rooview.el.save_easing_state();
1002 this.win.rooview.el.set_scale(scale,scale);
1003 // this.win.rooview.el.restore_easing_state();
1008 // -- buttons show hide.....
1010 public void buttonsShowHide()
1012 // basically hide everything, then show the relivant..
1015 this.win.openbtn.el.hide();
1016 this.win.openbackbtn.el.hide();
1018 this.win.backbutton.el.hide();
1021 this.win.editfilebutton.el.hide();
1022 this.win.projecteditbutton.el.hide();
1025 this.win.objectshowbutton.el.hide(); // add objects
1026 this.win.addpropbutton.el.hide();
1027 this.win.addlistenerbutton.el.hide();
1031 this.win.addprojectbutton.el.hide();
1032 this.win.addfilebutton.el.hide();
1033 this.win.delprojectbutton.el.hide();
1035 this.win.search_entry.el.hide();
1036 this.win.search_results.el.hide();
1037 switch (this.state) {
1039 case State.PREVIEW: // this is the default state when working...
1042 this.win.editfilebutton.el.show();
1043 this.win.projecteditbutton.el.show();
1047 this.win.objectshowbutton.el.show(); // add objects
1048 this.win.addpropbutton.el.show();
1049 this.win.addlistenerbutton.el.show();
1050 this.win.search_entry.el.show();
1052 this.win.openbtn.el.show();
1056 case State.CODEONLY:
1057 this.win.openbtn.el.show();
1058 this.win.projecteditbutton.el.show();
1059 this.win.search_entry.el.show();
1063 this.win.search_entry.el.show();
1064 this.win.backbutton.el.show();
1065 this.win.objectshowbutton.el.show(); // add objects ?? can you do this from here?
1066 this.win.addpropbutton.el.show();
1067 this.win.addlistenerbutton.el.show();
1071 case State.LISTENER:
1074 this.win.backbutton.el.show();
1075 this.win.objectshowbutton.el.show(); // add objects
1076 this.win.addpropbutton.el.show();
1077 this.win.addlistenerbutton.el.show();
1081 case State.FILEPROJECT:
1082 case State.PROJECTCODEONLY:
1084 this.win.backbutton.el.show();
1090 if (this.left_projects.getSelectedProject() != null ) {
1091 if (this.left_tree.getActiveFile() != null) {
1093 this.win.openbackbtn.el.show();
1095 this.win.addfilebutton.el.show();
1096 this.win.search_entry.el.show();
1097 this.win.projecteditbutton.el.show();
1101 this.win.addprojectbutton.el.show();
1102 this.win.delprojectbutton.el.show();
1115 public void valaCompiled(Json.Object obj)
1117 // vala has finished compiling...
1118 print("vala compiled");
1120 var buf = this.code_editor.buffer;
1121 buf.check_running = false;
1122 var has_errors = false;
1124 if (obj.has_member("ERR-TOTAL")) {
1125 if (obj.get_int_member("ERR-TOTAL")> 0) {
1128 this.win.statusbar_errors.setNotices( obj.get_object_member("ERR") , (int) obj.get_int_member("ERR-TOTAL"));
1130 this.win.statusbar_errors.setNotices( new Json.Object() , 0);
1133 if (obj.has_member("WARN-TOTAL")) {
1135 this.win.statusbar_warnings.setNotices(obj.get_object_member("WARN"), (int) obj.get_int_member("WARN-TOTAL"));
1137 this.win.statusbar_warnings.setNotices( new Json.Object() , 0);
1140 if (obj.has_member("DEPR-TOTAL")) {
1142 this.win.statusbar_depricated.setNotices( obj.get_object_member("DEPR"), (int) obj.get_int_member("DEPR-TOTAL"));
1145 this.win.statusbar_depricated.setNotices( new Json.Object(),0);
1148 buf.highlightErrorsJson("ERR", obj);
1149 buf.highlightErrorsJson("WARN", obj);
1150 buf.highlightErrorsJson("DEPR", obj);
1152 this.win.statusbar_compilestatus_label.el.hide();
1153 this.win.statusbar_run.el.hide();
1155 this.win.statusbar_compilestatus_label.el.show();
1156 this.win.statusbar_run.el.show();
1158 if (this.file.xtype == "Gtk") {
1159 // not sure how this is working ok? - as highlighting is happening on the vala files at present..
1160 var gbuf = this.window_gladeview.sourceview;
1161 gbuf.highlightErrorsJson("ERR", obj);
1162 gbuf.highlightErrorsJson("WARN", obj);
1163 gbuf.highlightErrorsJson("DEPR", obj);
1166 this.last_compile_result = obj;