1 static Xcls_MainWindow _MainWindow;
3 public class Xcls_MainWindow : Object
5 public Gtk.ApplicationWindow el;
6 private Xcls_MainWindow _this;
8 public static Xcls_MainWindow singleton()
10 if (_MainWindow == null) {
11 _MainWindow= new Xcls_MainWindow();
15 public Xcls_headerbar headerbar;
16 public Xcls_splitview splitview;
17 public Xcls_vbox vbox;
18 public Xcls_mainpane mainpane;
19 public Xcls_leftpane leftpane;
20 public Xcls_editpane editpane;
21 public Xcls_tree tree;
22 public Xcls_props props;
23 public Xcls_rooviewbox rooviewbox;
24 public Xcls_codeeditviewbox codeeditviewbox;
25 public Xcls_topbarmenu topbarmenu;
26 public Xcls_statusbar statusbar;
27 public Xcls_statusbar_compilestatus_label statusbar_compilestatus_label;
28 public Xcls_statusbar_errors statusbar_errors;
29 public Xcls_statusbar_warnings statusbar_warnings;
30 public Xcls_statusbar_depricated statusbar_depricated;
31 public Xcls_statusbar_run statusbar_run;
32 public Xcls_statusbar_compile_spinner statusbar_compile_spinner;
33 public Xcls_statusbar_compile_icon statusbar_compile_icon;
34 public Xcls_sidebar sidebar;
35 public Xcls_filesearch filesearch;
36 public Xcls_open_projects_btn open_projects_btn;
37 public Xcls_winsel winsel;
38 public Xcls_winfilter winfilter;
39 public Xcls_windowsearch windowsearch;
40 public Xcls_winmodel winmodel;
41 public Xcls_projcol projcol;
42 public Xcls_filecol filecol;
43 public Xcls_treescroll treescroll;
44 public Xcls_treeview treeview;
45 public Xcls_treeselmodel treeselmodel;
46 public Xcls_treelistsort treelistsort;
47 public Xcls_treelistmodel treelistmodel;
48 public Xcls_treemodel treemodel;
49 public Xcls_treefilter treefilter;
50 public Xcls_name name;
51 public Xcls_keystate keystate;
54 public WindowState windowstate;
55 public bool winloading;
56 public Project.Project project;
59 public Xcls_MainWindow()
62 this.el = new Gtk.ApplicationWindow(BuilderApplication.singleton({}));
65 this.winloading = false;
69 this.el.title = "Roo Application Builder";
70 this.el.default_width = 1200;
71 new Xcls_headerbar( _this );
72 this.el.set_titlebar ( _this.headerbar.el );
73 new Xcls_splitview( _this );
74 this.el.child = _this.splitview.el;
78 this.el.set_icon_name("roobuilder");
81 this.el.close_request.connect( ( ) => {
82 Resources.singleton().disconnect(_this.statusbar.handler_id);
85 this.windowstate.file.getLanguageServer().document_close(
89 BuilderApplication.removeWindow(this);
91 if (BuilderApplication.windows.size < 1) {
93 this.windowstate.file.getLanguageServer().exit();
96 BuilderApplication.singleton( null ).quit();
101 this.el.show.connect( ( ) => {
102 // hide the file editing..
104 //this.hideViewEditing();
105 // this is updated by windowstate - we try and fill it in..
106 _this.statusbar.el.hide();
107 //_this.statusbar_errors.el.hide();
108 //_this.statusbar_warnings.el.hide();
109 //_this.statusbar_depricated.el.hide();
110 _this.statusbar_compile_spinner.el.hide();
112 Resources.singleton().checkResources();
117 this.el.hide.connect( () => {
124 // user defined functions
125 public void updateErrors () {
128 GLib.debug("updateErrors");
130 var pr = this.windowstate.project.getErrors("ERR");
132 this.statusbar_errors.setNotices(
134 this.windowstate.file.getErrorsTotal("ERR")
137 this.statusbar_warnings.setNotices(
138 this.windowstate.project.getErrors("WARN"),
139 this.windowstate.file.getErrorsTotal("WARN")
141 this.statusbar_depricated.setNotices(
142 this.windowstate.project.getErrors("DEPR"),
143 this.windowstate.file.getErrorsTotal("DEPR")
146 _this.statusbar_run.el.hide();
148 if (pr.get_n_items() < 1) {
149 _this.statusbar_run.el.show();
153 public void initChildren () {
154 // this needs putting in a better place..
155 if (this.windowstate == null) {
156 this.windowstate = new WindowState(this);
168 public void show () {
171 if (this.windowstate.file == null) {
172 this.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);
175 public void setTitle () {
176 if (_this.windowstate.project == null ||
177 _this.windowstate.file == null
179 this.el.set_title("Select File");
183 _this.windowstate.project.name +
185 _this.windowstate.file.relpath);
187 public void openNewWindow () {
189 var w = new Xcls_MainWindow();
191 BuilderApplication.addWindow(w);
194 w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);
197 public class Xcls_headerbar : Object
199 public Gtk.HeaderBar el;
200 private Xcls_MainWindow _this;
204 public bool show_close_button;
207 public Xcls_headerbar(Xcls_MainWindow _owner )
210 _this.headerbar = this;
211 this.el = new Gtk.HeaderBar();
214 this.show_close_button = true;
216 // set gobject values
217 var child_1 = new Xcls_Box2( _this );
219 this.el.pack_start ( child_1.el );
222 // user defined functions
224 public class Xcls_Box2 : Object
227 private Xcls_MainWindow _this;
233 public Xcls_Box2(Xcls_MainWindow _owner )
236 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
240 // set gobject values
241 var child_1 = new Xcls_Button3( _this );
243 this.el.append ( child_1.el );
244 var child_2 = new Xcls_Button5( _this );
246 this.el.append( child_2.el );
247 var child_3 = new Xcls_Button6( _this );
249 this.el.append( child_3.el );
252 // user defined functions
254 public class Xcls_Button3 : Object
256 public Gtk.Button el;
257 private Xcls_MainWindow _this;
263 public Xcls_Button3(Xcls_MainWindow _owner )
266 this.el = new Gtk.Button();
270 // set gobject values
271 this.el.has_frame = false;
272 this.el.tooltip_text = "Manage Windows (Ctrl-O)";
273 this.el.has_tooltip = true;
274 var child_1 = new Xcls_ButtonContent4( _this );
275 this.el.child = child_1.el;
278 this.el.clicked.connect( ( ) => {
279 _this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;
280 if (_this.splitview.el.show_sidebar) {
281 _this.sidebar.show();
286 // user defined functions
288 public class Xcls_ButtonContent4 : Object
290 public Adw.ButtonContent el;
291 private Xcls_MainWindow _this;
297 public Xcls_ButtonContent4(Xcls_MainWindow _owner )
300 this.el = new Adw.ButtonContent();
304 // set gobject values
305 this.el.icon_name = "preferences-system-windows";
306 this.el.label = " Files";
309 // user defined functions
313 public class Xcls_Button5 : Object
315 public Gtk.Button el;
316 private Xcls_MainWindow _this;
322 public Xcls_Button5(Xcls_MainWindow _owner )
325 this.el = new Gtk.Button();
329 // set gobject values
330 this.el.icon_name = "edit-undo";
331 this.el.has_frame = false;
334 this.el.clicked.connect( ( ) => {
336 GLib.debug("undo clicked");
337 if (_this.windowstate.file.xtype == "PlainFile") {
338 _this.windowstate.code_editor_tab.buffer.el.undo();
340 if (!_this.windowstate.file.undoStep(-1)) {
345 _this.windowstate.switchState (WindowState.State.PREVIEW);
346 // this triggers loadItems..
347 _this.windowstate.left_tree.model.loadFile(
348 _this.windowstate.file);
354 // load it everywhere
358 // user defined functions
361 public class Xcls_Button6 : Object
363 public Gtk.Button el;
364 private Xcls_MainWindow _this;
370 public Xcls_Button6(Xcls_MainWindow _owner )
373 this.el = new Gtk.Button();
377 // set gobject values
378 this.el.icon_name = "edit-redo";
379 this.el.has_frame = false;
382 this.el.clicked.connect( ( ) => {
384 GLib.debug("undo clicked");
385 if (_this.windowstate.file.xtype == "PlainFile") {
386 _this.windowstate.code_editor_tab.buffer.el.redo();
388 if (!_this.windowstate.file.undoStep(1)) {
393 _this.windowstate.switchState (WindowState.State.PREVIEW);
394 // this triggers loadItems..
395 _this.windowstate.left_tree.model.loadFile(
396 _this.windowstate.file);
402 // load it everywhere
406 // user defined functions
411 public class Xcls_splitview : Object
413 public Adw.OverlaySplitView el;
414 private Xcls_MainWindow _this;
420 public Xcls_splitview(Xcls_MainWindow _owner )
423 _this.splitview = this;
424 this.el = new Adw.OverlaySplitView();
428 // set gobject values
429 this.el.collapsed = true;
430 this.el.sidebar_width_fraction = 0.400000;
431 this.el.show_sidebar = false;
432 new Xcls_vbox( _this );
433 this.el.content = _this.vbox.el;
434 new Xcls_sidebar( _this );
435 this.el.sidebar = _this.sidebar.el;
436 new Xcls_keystate( _this );
437 this.el.add_controller( _this.keystate.el );
440 // user defined functions
442 public class Xcls_vbox : Object
445 private Xcls_MainWindow _this;
451 public Xcls_vbox(Xcls_MainWindow _owner )
455 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
459 // set gobject values
460 this.el.homogeneous = false;
461 this.el.hexpand = true;
462 this.el.vexpand = false;
463 new Xcls_mainpane( _this );
464 this.el.append( _this.mainpane.el );
465 var child_2 = new Xcls_Box17( _this );
467 this.el.append( child_2.el );
470 // user defined functions
472 public class Xcls_mainpane : Object
475 private Xcls_MainWindow _this;
479 public int lastWidth;
482 public Xcls_mainpane(Xcls_MainWindow _owner )
485 _this.mainpane = this;
486 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
491 // set gobject values
492 this.el.hexpand = true;
493 this.el.vexpand = true;
494 this.el.position = 400;
495 new Xcls_leftpane( _this );
496 this.el.start_child = _this.leftpane.el;
497 var child_2 = new Xcls_Box14( _this );
498 this.el.end_child = child_2.el;
501 this.el.accept_position.connect( ( ) => {
502 _this.windowstate.left_tree.onresize();
507 // user defined functions
509 public class Xcls_leftpane : Object
512 private Xcls_MainWindow _this;
518 public Xcls_leftpane(Xcls_MainWindow _owner )
521 _this.leftpane = this;
522 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
526 // set gobject values
527 this.el.hexpand = true;
528 this.el.vexpand = true;
529 new Xcls_editpane( _this );
530 this.el.append( _this.editpane.el );
533 // user defined functions
535 public class Xcls_editpane : Object
538 private Xcls_MainWindow _this;
544 public Xcls_editpane(Xcls_MainWindow _owner )
547 _this.editpane = this;
548 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
552 // set gobject values
553 new Xcls_tree( _this );
554 this.el.start_child = _this.tree.el;
555 new Xcls_props( _this );
556 this.el.end_child = _this.props.el;
559 this.el.accept_position.connect( ( ) => {
560 _this.windowstate.left_tree.onresize();
563 this.el.move_handle.connect( (scroll) => {
564 GLib.debug("Move handle");
569 // user defined functions
571 public class Xcls_tree : Object
574 private Xcls_MainWindow _this;
580 public Xcls_tree(Xcls_MainWindow _owner )
584 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
588 // set gobject values
589 this.el.hexpand = true;
590 this.el.vexpand = true;
593 // user defined functions
596 public class Xcls_props : Object
599 private Xcls_MainWindow _this;
605 public Xcls_props(Xcls_MainWindow _owner )
609 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
613 // set gobject values
614 this.el.hexpand = true;
615 this.el.vexpand = true;
618 // user defined functions
623 public class Xcls_Box14 : Object
626 private Xcls_MainWindow _this;
632 public Xcls_Box14(Xcls_MainWindow _owner )
635 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
639 // set gobject values
640 this.el.hexpand = true;
641 this.el.vexpand = true;
642 new Xcls_rooviewbox( _this );
643 this.el.append( _this.rooviewbox.el );
644 new Xcls_codeeditviewbox( _this );
645 this.el.append( _this.codeeditviewbox.el );
648 // user defined functions
650 public class Xcls_rooviewbox : Object
653 private Xcls_MainWindow _this;
659 public Xcls_rooviewbox(Xcls_MainWindow _owner )
662 _this.rooviewbox = this;
663 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
667 // set gobject values
668 this.el.hexpand = true;
669 this.el.vexpand = true;
672 // user defined functions
675 public class Xcls_codeeditviewbox : Object
678 private Xcls_MainWindow _this;
684 public Xcls_codeeditviewbox(Xcls_MainWindow _owner )
687 _this.codeeditviewbox = this;
688 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
692 // set gobject values
693 this.el.hexpand = true;
694 this.el.vexpand = true;
697 // user defined functions
702 public class Xcls_Box17 : Object
705 private Xcls_MainWindow _this;
711 public Xcls_Box17(Xcls_MainWindow _owner )
714 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
718 // set gobject values
719 this.el.homogeneous = false;
720 this.el.vexpand = false;
721 var child_1 = new Xcls_Button18( _this );
723 this.el.append( child_1.el );
724 var child_2 = new Xcls_Button19( _this );
726 this.el.append( child_2.el );
727 var child_3 = new Xcls_MenuButton20( _this );
729 this.el.append( child_3.el );
730 var child_4 = new Xcls_Label25( _this );
732 this.el.append( child_4.el );
733 new Xcls_statusbar( _this );
734 this.el.append( _this.statusbar.el );
735 var child_6 = new Xcls_Box27( _this );
737 this.el.append( child_6.el );
738 new Xcls_statusbar_compile_spinner( _this );
739 this.el.append( _this.statusbar_compile_spinner.el );
740 new Xcls_statusbar_compile_icon( _this );
741 this.el.append( _this.statusbar_compile_icon.el );
744 // user defined functions
746 public class Xcls_Button18 : Object
748 public Gtk.Button el;
749 private Xcls_MainWindow _this;
753 public bool always_show_image;
756 public Xcls_Button18(Xcls_MainWindow _owner )
759 this.el = new Gtk.Button();
762 this.always_show_image = true;
764 // set gobject values
765 this.el.icon_name = "emblem-system";
766 this.el.tooltip_text = "Project Details";
767 this.el.label = "Edit Project Settings";
770 this.el.clicked.connect( ( ) => {
772 _this.windowstate.projectPopoverShow(_this.el, null, null);
778 // user defined functions
781 public class Xcls_Button19 : Object
783 public Gtk.Button el;
784 private Xcls_MainWindow _this;
788 public bool always_show_image;
791 public Xcls_Button19(Xcls_MainWindow _owner )
794 this.el = new Gtk.Button();
797 this.always_show_image = true;
799 // set gobject values
800 this.el.icon_name = "document-properties";
801 this.el.tooltip_text = "File Details";
802 this.el.label = "Edit File Properties";
805 this.el.clicked.connect( ( ) => {
807 // create a new file in project..
808 if (_this.project == null || _this.windowstate.file == null) {
811 _this.windowstate.file_details.show(
812 _this.windowstate.file, _this.el, false
821 // user defined functions
824 public class Xcls_MenuButton20 : Object
826 public Gtk.MenuButton el;
827 private Xcls_MainWindow _this;
831 public bool always_show_image;
834 public Xcls_MenuButton20(Xcls_MainWindow _owner )
837 this.el = new Gtk.MenuButton();
840 this.always_show_image = true;
842 // set gobject values
843 this.el.icon_name = "dialog-information";
844 this.el.label = "About";
845 new Xcls_topbarmenu( _this );
846 this.el.popover = _this.topbarmenu.el;
849 // user defined functions
851 public class Xcls_topbarmenu : Object
853 public Gtk.PopoverMenu el;
854 private Xcls_MainWindow _this;
860 public Xcls_topbarmenu(Xcls_MainWindow _owner )
863 _this.topbarmenu = this;
864 this.el = new Gtk.PopoverMenu.from_model(null);
868 // set gobject values
869 var child_1 = new Xcls_Box22( _this );
871 this.el.set_child ( child_1.el );
880 // user defined functions
882 public class Xcls_Box22 : Object
885 private Xcls_MainWindow _this;
891 public Xcls_Box22(Xcls_MainWindow _owner )
894 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
898 // set gobject values
899 var child_1 = new Xcls_Button23( _this );
901 this.el.append( child_1.el );
902 var child_2 = new Xcls_Button24( _this );
904 this.el.append( child_2.el );
907 // user defined functions
909 public class Xcls_Button23 : Object
911 public Gtk.Button el;
912 private Xcls_MainWindow _this;
918 public Xcls_Button23(Xcls_MainWindow _owner )
921 this.el = new Gtk.Button();
925 // set gobject values
926 this.el.label = "Download updated Resources";
929 this.el.activate.connect( ( ) => {
930 Resources.singleton().fetchStart();
934 // user defined functions
937 public class Xcls_Button24 : Object
939 public Gtk.Button el;
940 private Xcls_MainWindow _this;
946 public Xcls_Button24(Xcls_MainWindow _owner )
949 this.el = new Gtk.Button();
953 // set gobject values
954 this.el.label = "About the Builder";
957 this.el.clicked.connect( () => {
958 About.singleton().el.show();
962 // user defined functions
968 public class Xcls_Label25 : Object
971 private Xcls_MainWindow _this;
977 public Xcls_Label25(Xcls_MainWindow _owner )
980 this.el = new Gtk.Label( " " );
984 // set gobject values
985 this.el.hexpand = true;
988 // user defined functions
991 public class Xcls_statusbar : Object
993 public Gtk.ProgressBar el;
994 private Xcls_MainWindow _this;
998 public ulong handler_id;
1001 public Xcls_statusbar(Xcls_MainWindow _owner )
1004 _this.statusbar = this;
1005 this.el = new Gtk.ProgressBar();
1008 this.handler_id = -1;
1010 // set gobject values
1011 this.el.show_text = true;
1016 this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
1019 _this.mainpane.el.set_sensitive(true);
1023 _this.mainpane.el.set_sensitive(false);
1025 this.el.set_fraction ((1.0f * pos) / (1.0f * total));
1026 this.el.set_text("Fetching Resource : %s/%s".printf(pos.to_string(), total.to_string()));
1032 // user defined functions
1035 public class Xcls_Box27 : Object
1038 private Xcls_MainWindow _this;
1044 public Xcls_Box27(Xcls_MainWindow _owner )
1047 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1051 // set gobject values
1052 new Xcls_statusbar_compilestatus_label( _this );
1053 this.el.append( _this.statusbar_compilestatus_label.el );
1054 new Xcls_statusbar_errors( _this );
1055 this.el.append( _this.statusbar_errors.el );
1056 new Xcls_statusbar_warnings( _this );
1057 this.el.append( _this.statusbar_warnings.el );
1058 new Xcls_statusbar_depricated( _this );
1059 this.el.append( _this.statusbar_depricated.el );
1060 new Xcls_statusbar_run( _this );
1061 this.el.append( _this.statusbar_run.el );
1064 // user defined functions
1066 public class Xcls_statusbar_compilestatus_label : Object
1068 public Gtk.Label el;
1069 private Xcls_MainWindow _this;
1075 public Xcls_statusbar_compilestatus_label(Xcls_MainWindow _owner )
1078 _this.statusbar_compilestatus_label = this;
1079 this.el = new Gtk.Label( "Compile Status:" );
1083 // set gobject values
1084 this.el.margin_end = 4;
1085 this.el.margin_start = 4;
1088 // user defined functions
1091 public class Xcls_statusbar_errors : Object
1093 public Gtk.Button el;
1094 private Xcls_MainWindow _this;
1098 public Xcls_ValaCompileErrors popup;
1101 public Xcls_statusbar_errors(Xcls_MainWindow _owner )
1104 _this.statusbar_errors = this;
1105 this.el = new Gtk.Button();
1109 // set gobject values
1110 this.el.icon_name = "dialog-error";
1111 this.el.label = "0 Errors";
1114 this.el.clicked.connect( () => {
1116 if (this.popup == null) {
1125 // user defined functions
1126 public void setNotices (GLib.ListStore nots, int ferrors ) {
1127 BuilderApplication.showSpinner("");
1128 if (nots.get_n_items() < 1 ) {
1130 if (this.popup != null) {
1131 this.popup.el.hide();
1137 this.el.label = "%d/%d Errors".printf(ferrors,(int)nots.get_n_items());
1141 if (this.popup == null) {
1142 this.popup = new Xcls_ValaCompileErrors();
1143 this.popup.window = _this;
1144 // this.popup.el.set_transient_for( _this.el );
1145 this.popup.el.set_parent(this.el);
1148 this.popup.updateNotices(nots);
1153 public class Xcls_statusbar_warnings : Object
1155 public Gtk.Button el;
1156 private Xcls_MainWindow _this;
1160 public Xcls_ValaCompileErrors popup;
1163 public Xcls_statusbar_warnings(Xcls_MainWindow _owner )
1166 _this.statusbar_warnings = this;
1167 this.el = new Gtk.Button();
1171 // set gobject values
1172 this.el.icon_name = "dialog-warning";
1173 this.el.label = "0 Warnings";
1176 this.el.clicked.connect( () => {
1178 if (this.popup == null) {
1187 // user defined functions
1188 public void setNotices (GLib.ListStore nots, int ferrs ) {
1190 if (nots.get_n_items() < 1 ) {
1192 if (this.popup != null) {
1193 this.popup.el.hide();
1199 this.el.label = "%d/%d Warnings".printf(ferrs,(int)nots.get_n_items());
1203 if (this.popup == null) {
1204 this.popup = new Xcls_ValaCompileErrors();
1205 this.popup.window = _this;
1206 // this.popup.el.set_transient_for( _this.el );
1207 this.popup.el.set_parent(this.el);
1209 this.popup.updateNotices(nots);
1214 public class Xcls_statusbar_depricated : Object
1216 public Gtk.Button el;
1217 private Xcls_MainWindow _this;
1221 public Xcls_ValaCompileErrors popup;
1222 public GLib.ListStore notices;
1225 public Xcls_statusbar_depricated(Xcls_MainWindow _owner )
1228 _this.statusbar_depricated = this;
1229 this.el = new Gtk.Button();
1232 this.notices = null;
1234 // set gobject values
1235 this.el.icon_name = "dialog-information";
1236 this.el.label = "0 Depricated";
1239 this.el.clicked.connect( () => {
1241 if (this.popup == null) {
1250 // user defined functions
1251 public void setNotices (GLib.ListStore nots, int ferrs ) {
1253 if (nots.get_n_items() < 1 ) {
1255 if (this.popup != null) {
1256 this.popup.el.hide();
1262 this.el.label = "%d/%d Depricated".printf(ferrs,(int)nots.get_n_items());
1266 if (this.popup == null) {
1267 this.popup = new Xcls_ValaCompileErrors();
1268 this.popup.window = _this;
1269 // this.popup.el.set_transient_for( _this.el );
1270 this.popup.el.set_parent(this.el);
1272 this.popup.updateNotices(nots);
1277 public class Xcls_statusbar_run : Object
1279 public Gtk.Button el;
1280 private Xcls_MainWindow _this;
1284 public Xcls_ValaCompileErrors popup;
1285 public Palete.ValaCompileRequest? last_request;
1288 public Xcls_statusbar_run(Xcls_MainWindow _owner )
1291 _this.statusbar_run = this;
1292 this.el = new Gtk.Button();
1295 this.last_request = null;
1297 // set gobject values
1298 this.el.icon_name = "media-playback-start";
1299 this.el.label = "Run";
1300 this.el.visible = false;
1303 this.el.clicked.connect( () => {
1305 if (_this.windowstate.file == null) {
1308 if (_this.statusbar_compile_spinner.el.spinning) {
1309 _this.windowstate.compile_results.el.set_parent(this.el);
1310 _this.windowstate.compile_results.el.show(); // show currently running.
1314 if (this.last_request != null) {
1315 this.last_request.cancel();
1316 if (this.last_request.terminal_pid > 0) {
1317 this.last_request.killChildren(this.last_request.terminal_pid);
1320 var pr = _this.windowstate.project as Project.Gtk;
1326 this.last_request= new Palete.ValaCompileRequest(
1328 pr.firstBuildModuleWith(_this.windowstate.file)
1330 this.last_request.onOutput.connect( ( str) => {
1331 _this.windowstate.compile_results.addLine(str);
1333 this.last_request.run.begin( ( a, r) => {
1334 this.last_request.run.end(r);
1336 if (_this.windowstate.compile_results.el.parent == null) {
1337 _this.windowstate.compile_results.el.set_parent(this.el);
1339 _this.windowstate.compile_results.show(this.el,true);
1344 // user defined functions
1348 public class Xcls_statusbar_compile_spinner : Object
1350 public Gtk.Spinner el;
1351 private Xcls_MainWindow _this;
1357 public Xcls_statusbar_compile_spinner(Xcls_MainWindow _owner )
1360 _this.statusbar_compile_spinner = this;
1361 this.el = new Gtk.Spinner();
1365 // set gobject values
1366 this.el.margin_end = 4;
1367 this.el.margin_start = 4;
1368 this.el.tooltip_text = "Compiling";
1371 // user defined functions
1372 public void start (string icon, string tooltip) {
1374 if (icon == "spinner") {
1377 this.el.tooltip_text = tooltip;
1378 _this.statusbar_compile_icon.el.hide();
1381 // GLib.debug("set status icon %s, %s", icon, tooltip);
1382 _this.statusbar_compile_icon.el.tooltip_text = tooltip;
1383 _this.statusbar_compile_icon.el.icon_name = icon;
1384 _this.statusbar_compile_icon.el.show();
1389 public void stop () {
1392 _this.statusbar_compile_icon.el.hide();
1396 public class Xcls_statusbar_compile_icon : Object
1398 public Gtk.Image el;
1399 private Xcls_MainWindow _this;
1405 public Xcls_statusbar_compile_icon(Xcls_MainWindow _owner )
1408 _this.statusbar_compile_icon = this;
1409 this.el = new Gtk.Image();
1413 // set gobject values
1414 this.el.margin_end = 4;
1415 this.el.margin_start = 4;
1416 this.el.icon_size = Gtk.IconSize.NORMAL;
1419 // user defined functions
1424 public class Xcls_sidebar : Object
1427 private Xcls_MainWindow _this;
1433 public Xcls_sidebar(Xcls_MainWindow _owner )
1436 _this.sidebar = this;
1437 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1441 // set gobject values
1442 new Xcls_filesearch( _this );
1443 this.el.append( _this.filesearch.el );
1444 var child_2 = new Xcls_Box38( _this );
1446 this.el.append( child_2.el );
1447 var child_3 = new Xcls_Paned47( _this );
1449 this.el.append( child_3.el );
1452 // user defined functions
1453 public void show () {
1454 _this.splitview.el.show_sidebar = true;
1456 _this.filesearch.el.grab_focus();
1457 _this.winloading = true;
1458 _this.winmodel.el.remove_all();
1459 _this.filesearch.el.set_text("");
1460 for(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {
1461 _this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));
1463 _this.winsel.selectCurrent();
1464 _this.winloading = false;
1466 _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1468 _this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);
1470 _this.treeview.el.set_model(_this.treeselmodel.el);
1472 _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;
1476 public class Xcls_filesearch : Object
1478 public Gtk.SearchEntry el;
1479 private Xcls_MainWindow _this;
1485 public Xcls_filesearch(Xcls_MainWindow _owner )
1488 _this.filesearch = this;
1489 this.el = new Gtk.SearchEntry();
1493 // set gobject values
1494 this.el.hexpand = true;
1495 this.el.tooltip_text = "up/down arrow to select file from lower file list\nenter opens selected in new window\nshift+enter opens it in this window ";
1496 this.el.has_tooltip = true;
1497 this.el.placeholder_text = "Search for file";
1498 var child_1 = new Xcls_EventControllerKey37( _this );
1500 this.el.add_controller( child_1.el );
1503 this.el.search_changed.connect( ( ) => {
1505 _this.windowsearch.el.set_search(this.el.get_text());
1506 if (this.el.text == "") {
1507 _this.treescroll.el.visible = false;
1510 _this.treescroll.el.visible = true;
1511 _this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);
1515 // user defined functions
1517 public class Xcls_EventControllerKey37 : Object
1519 public Gtk.EventControllerKey el;
1520 private Xcls_MainWindow _this;
1526 public Xcls_EventControllerKey37(Xcls_MainWindow _owner )
1529 this.el = new Gtk.EventControllerKey();
1533 // set gobject values
1536 this.el.key_released.connect( (keyval, keycode, state) => {
1537 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1542 "searcj key release %d, %d, %d ?= %d" ,
1543 (int) keyval, (int) keycode, state,
1546 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1552 if (keyval == Gdk.Key.Return) {
1553 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
1554 GLib.debug("SELECTED = %s", tr.item.get_type().name());
1555 var f = (JsRender.JsRender) tr.item;
1556 GLib.debug("Click %s", f.name);
1557 if (f.xtype == "Dir") {
1562 _this.windowstate.fileViewOpen(f,
1563 _this.keystate.is_shift != 1
1566 _this.splitview.el.show_sidebar = false;
1571 if (keyval == Gdk.Key.Up) {
1573 }if (keyval == Gdk.Key.Down) {
1579 var ns = _this.treeselmodel.el.selected + dir;
1583 if (ns >= _this.treeselmodel.el.get_n_items()) {
1584 ns = _this.treeselmodel.el.get_n_items()-1;
1586 _this.treeselmodel.el.selected = ns;
1590 // user defined functions
1594 public class Xcls_Box38 : Object
1597 private Xcls_MainWindow _this;
1603 public Xcls_Box38(Xcls_MainWindow _owner )
1606 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1610 // set gobject values
1611 this.el.hexpand = true;
1612 new Xcls_open_projects_btn( _this );
1613 this.el.append( _this.open_projects_btn.el );
1614 var child_2 = new Xcls_Button43( _this );
1616 this.el.append( child_2.el );
1619 // user defined functions
1621 public class Xcls_open_projects_btn : Object
1623 public Gtk.Button el;
1624 private Xcls_MainWindow _this;
1630 public Xcls_open_projects_btn(Xcls_MainWindow _owner )
1633 _this.open_projects_btn = this;
1634 this.el = new Gtk.Button();
1638 // set gobject values
1639 this.el.hexpand = true;
1640 var child_1 = new Xcls_Box40( _this );
1641 this.el.child = child_1.el;
1644 this.el.clicked.connect( ( ) => {
1645 _this.splitview.el.show_sidebar = false;
1646 _this.windowstate.showPopoverFiles(this.el, _this.project, false);
1650 // user defined functions
1652 public class Xcls_Box40 : Object
1655 private Xcls_MainWindow _this;
1661 public Xcls_Box40(Xcls_MainWindow _owner )
1664 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1668 // set gobject values
1669 var child_1 = new Xcls_Image41( _this );
1671 this.el.append( child_1.el );
1672 var child_2 = new Xcls_Label42( _this );
1674 this.el.append( child_2.el );
1677 // user defined functions
1679 public class Xcls_Image41 : Object
1681 public Gtk.Image el;
1682 private Xcls_MainWindow _this;
1688 public Xcls_Image41(Xcls_MainWindow _owner )
1691 this.el = new Gtk.Image();
1695 // set gobject values
1696 this.el.icon_name = "document-open";
1697 this.el.margin_end = 4;
1700 // user defined functions
1703 public class Xcls_Label42 : Object
1705 public Gtk.Label el;
1706 private Xcls_MainWindow _this;
1712 public Xcls_Label42(Xcls_MainWindow _owner )
1715 this.el = new Gtk.Label( "Open File" );
1719 // set gobject values
1722 // user defined functions
1727 public class Xcls_Button43 : Object
1729 public Gtk.Button el;
1730 private Xcls_MainWindow _this;
1736 public Xcls_Button43(Xcls_MainWindow _owner )
1739 this.el = new Gtk.Button();
1743 // set gobject values
1744 this.el.hexpand = true;
1745 var child_1 = new Xcls_Box44( _this );
1746 this.el.child = child_1.el;
1749 this.el.clicked.connect( ( ) => {
1750 _this.splitview.el.show_sidebar = false;
1751 _this.windowstate.showPopoverFiles(_this.el, _this.project, true);
1755 // user defined functions
1757 public class Xcls_Box44 : Object
1760 private Xcls_MainWindow _this;
1766 public Xcls_Box44(Xcls_MainWindow _owner )
1769 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1773 // set gobject values
1774 var child_1 = new Xcls_Image45( _this );
1776 this.el.append( child_1.el );
1777 var child_2 = new Xcls_Label46( _this );
1779 this.el.append( child_2.el );
1782 // user defined functions
1784 public class Xcls_Image45 : Object
1786 public Gtk.Image el;
1787 private Xcls_MainWindow _this;
1793 public Xcls_Image45(Xcls_MainWindow _owner )
1796 this.el = new Gtk.Image();
1800 // set gobject values
1801 this.el.icon_name = "window-new";
1802 this.el.margin_end = 4;
1805 // user defined functions
1808 public class Xcls_Label46 : Object
1810 public Gtk.Label el;
1811 private Xcls_MainWindow _this;
1817 public Xcls_Label46(Xcls_MainWindow _owner )
1820 this.el = new Gtk.Label( "New Window" );
1824 // set gobject values
1827 // user defined functions
1833 public class Xcls_Paned47 : Object
1835 public Gtk.Paned el;
1836 private Xcls_MainWindow _this;
1842 public Xcls_Paned47(Xcls_MainWindow _owner )
1845 this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL );
1849 // set gobject values
1850 this.el.vexpand = true;
1851 var child_1 = new Xcls_ScrolledWindow48( _this );
1852 this.el.start_child = child_1.el;
1853 new Xcls_treescroll( _this );
1854 this.el.end_child = _this.treescroll.el;
1857 // user defined functions
1859 public class Xcls_ScrolledWindow48 : Object
1861 public Gtk.ScrolledWindow el;
1862 private Xcls_MainWindow _this;
1868 public Xcls_ScrolledWindow48(Xcls_MainWindow _owner )
1871 this.el = new Gtk.ScrolledWindow();
1875 // set gobject values
1876 this.el.has_frame = true;
1877 var child_1 = new Xcls_ColumnView49( _this );
1878 this.el.child = child_1.el;
1881 // user defined functions
1883 public class Xcls_ColumnView49 : Object
1885 public Gtk.ColumnView el;
1886 private Xcls_MainWindow _this;
1892 public Xcls_ColumnView49(Xcls_MainWindow _owner )
1895 new Xcls_winsel( _this );
1896 this.el = new Gtk.ColumnView( _this.winsel.el );
1900 // set gobject values
1901 new Xcls_projcol( _this );
1902 this.el.append_column( _this.projcol.el );
1903 new Xcls_filecol( _this );
1904 this.el.append_column ( _this.filecol.el );
1907 // user defined functions
1909 public class Xcls_winsel : Object
1911 public Gtk.SingleSelection el;
1912 private Xcls_MainWindow _this;
1916 public bool selecting;
1919 public Xcls_winsel(Xcls_MainWindow _owner )
1922 _this.winsel = this;
1923 var child_1 = new Xcls_SortListModel51( _this );
1925 this.el = new Gtk.SingleSelection( child_1.el );
1928 this.selecting = false;
1930 // set gobject values
1931 this.el.can_unselect = false;
1932 this.el.autoselect = false;
1935 this.el.notify["selected"].connect( () => {
1936 if (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {
1939 var ws = this.el.selected_item as WindowState;
1943 if (ws.file.path != _this.windowstate.file.path) {
1944 _this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window, -1);
1945 _this.splitview.el.show_sidebar = false;
1948 this.selectCurrent();
1952 // user defined functions
1953 public void selectCurrent () {
1954 this.selecting = true;
1956 for(var i = 0;i < this.el.get_n_items(); i++) {
1957 var ws = this.el.get_item(i) as WindowState;
1958 if (ws.file.path == _this.windowstate.file.path) {
1959 this.el.selected = i;
1963 this.selecting = false;
1968 public class Xcls_SortListModel51 : Object
1970 public Gtk.SortListModel el;
1971 private Xcls_MainWindow _this;
1977 public Xcls_SortListModel51(Xcls_MainWindow _owner )
1980 new Xcls_winfilter( _this );
1981 var child_2 = new Xcls_StringSorter56( _this );
1983 this.el = new Gtk.SortListModel( _this.winfilter.el, child_2.el );
1987 // set gobject values
1990 // user defined functions
1992 public class Xcls_winfilter : Object
1994 public Gtk.FilterListModel el;
1995 private Xcls_MainWindow _this;
2001 public Xcls_winfilter(Xcls_MainWindow _owner )
2004 _this.winfilter = this;
2005 new Xcls_winmodel( _this );
2006 new Xcls_windowsearch( _this );
2007 this.el = new Gtk.FilterListModel( _this.winmodel.el, _this.windowsearch.el );
2011 // set gobject values
2014 // user defined functions
2016 public class Xcls_windowsearch : Object
2018 public Gtk.StringFilter el;
2019 private Xcls_MainWindow _this;
2025 public Xcls_windowsearch(Xcls_MainWindow _owner )
2028 _this.windowsearch = this;
2029 var child_1 = new Xcls_PropertyExpression54( _this );
2031 this.el = new Gtk.StringFilter( child_1.el );
2035 // set gobject values
2038 // user defined functions
2040 public class Xcls_PropertyExpression54 : Object
2042 public Gtk.PropertyExpression el;
2043 private Xcls_MainWindow _this;
2049 public Xcls_PropertyExpression54(Xcls_MainWindow _owner )
2052 this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2056 // set gobject values
2059 // user defined functions
2063 public class Xcls_winmodel : Object
2065 public GLib.ListStore el;
2066 private Xcls_MainWindow _this;
2072 public Xcls_winmodel(Xcls_MainWindow _owner )
2075 _this.winmodel = this;
2076 this.el = new GLib.ListStore( typeof(WindowState) );
2080 // set gobject values
2083 // user defined functions
2087 public class Xcls_StringSorter56 : Object
2089 public Gtk.StringSorter el;
2090 private Xcls_MainWindow _this;
2096 public Xcls_StringSorter56(Xcls_MainWindow _owner )
2099 var child_1 = new Xcls_PropertyExpression57( _this );
2101 this.el = new Gtk.StringSorter( child_1.el );
2105 // set gobject values
2106 this.el.ignore_case = true;
2109 // user defined functions
2111 public class Xcls_PropertyExpression57 : Object
2113 public Gtk.PropertyExpression el;
2114 private Xcls_MainWindow _this;
2120 public Xcls_PropertyExpression57(Xcls_MainWindow _owner )
2123 this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2127 // set gobject values
2130 // user defined functions
2136 public class Xcls_projcol : Object
2138 public Gtk.ColumnViewColumn el;
2139 private Xcls_MainWindow _this;
2145 public Xcls_projcol(Xcls_MainWindow _owner )
2148 _this.projcol = this;
2149 var child_1 = new Xcls_SignalListItemFactory59( _this );
2151 this.el = new Gtk.ColumnViewColumn( "Project", child_1.el );
2155 // set gobject values
2156 this.el.id = "projcol";
2157 this.el.expand = true;
2158 this.el.resizable = true;
2161 // user defined functions
2163 public class Xcls_SignalListItemFactory59 : Object
2165 public Gtk.SignalListItemFactory el;
2166 private Xcls_MainWindow _this;
2172 public Xcls_SignalListItemFactory59(Xcls_MainWindow _owner )
2175 this.el = new Gtk.SignalListItemFactory();
2179 // set gobject values
2182 this.el.setup.connect( (listitem) => {
2184 var li = (listitem as Gtk.ListItem);
2189 var lbl = new Gtk.Label("");
2191 lbl.justify = Gtk.Justification.LEFT;
2193 lbl.use_markup = true;
2194 lbl.ellipsize = Pango.EllipsizeMode.START;
2196 li.activatable = true;
2198 this.el.bind.connect( (listitem) => {
2199 var li = (listitem as Gtk.ListItem);
2203 var lb = (Gtk.Label) li.get_child() as Gtk.Label;
2207 var item = li.get_item() as WindowState;
2211 lb.label = item.project.name;
2219 // user defined functions
2223 public class Xcls_filecol : Object
2225 public Gtk.ColumnViewColumn el;
2226 private Xcls_MainWindow _this;
2232 public Xcls_filecol(Xcls_MainWindow _owner )
2235 _this.filecol = this;
2236 var child_1 = new Xcls_SignalListItemFactory61( _this );
2238 this.el = new Gtk.ColumnViewColumn( "File", child_1.el );
2242 // set gobject values
2243 this.el.id = "filecol";
2244 this.el.expand = true;
2245 this.el.resizable = true;
2248 // user defined functions
2250 public class Xcls_SignalListItemFactory61 : Object
2252 public Gtk.SignalListItemFactory el;
2253 private Xcls_MainWindow _this;
2259 public Xcls_SignalListItemFactory61(Xcls_MainWindow _owner )
2262 this.el = new Gtk.SignalListItemFactory();
2266 // set gobject values
2269 this.el.setup.connect( (listitem) => {
2270 var li = (listitem as Gtk.ListItem);
2274 var lbl = new Gtk.Label("");
2276 lbl.justify = Gtk.Justification.LEFT;
2278 lbl.use_markup = true;
2279 lbl.ellipsize = Pango.EllipsizeMode.START;
2281 li.activatable = true;
2283 this.el.bind.connect( (listitem) => {
2284 var li = (listitem as Gtk.ListItem);
2288 var lb = (Gtk.Label) li.get_child() as Gtk.Label;
2292 var item = li.get_item() as WindowState;
2299 lb.label = item.file.relpath;
2307 // user defined functions
2313 public class Xcls_treescroll : Object
2315 public Gtk.ScrolledWindow el;
2316 private Xcls_MainWindow _this;
2322 public Xcls_treescroll(Xcls_MainWindow _owner )
2325 _this.treescroll = this;
2326 this.el = new Gtk.ScrolledWindow();
2330 // set gobject values
2331 this.el.has_frame = true;
2332 this.el.hexpand = true;
2333 this.el.vexpand = true;
2334 this.el.tooltip_text = "dbl-click - opens in NEW window \nshift--dbl-click opens in this window";
2335 this.el.visible = false;
2336 new Xcls_treeview( _this );
2337 this.el.child = _this.treeview.el;
2340 // user defined functions
2342 public class Xcls_treeview : Object
2344 public Gtk.ColumnView el;
2345 private Xcls_MainWindow _this;
2351 public Xcls_treeview(Xcls_MainWindow _owner )
2354 _this.treeview = this;
2355 new Xcls_treeselmodel( _this );
2356 this.el = new Gtk.ColumnView( _this.treeselmodel.el );
2360 // set gobject values
2361 this.el.hexpand = true;
2362 this.el.vexpand = true;
2363 var child_2 = new Xcls_GestureClick64( _this );
2365 this.el.add_controller( child_2.el );
2366 new Xcls_name( _this );
2367 this.el.append_column ( _this.name.el );
2370 // user defined functions
2372 public class Xcls_GestureClick64 : Object
2374 public Gtk.GestureClick el;
2375 private Xcls_MainWindow _this;
2381 public Xcls_GestureClick64(Xcls_MainWindow _owner )
2384 this.el = new Gtk.GestureClick();
2388 // set gobject values
2391 this.el.pressed.connect( (n_press, x, y) => {
2393 GLib.debug("double cliced");
2397 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
2398 GLib.debug("SELECTED = %s", tr.item.get_type().name());
2399 var f = (JsRender.JsRender) tr.item;
2400 GLib.debug("Click %s", f.name);
2401 if (f.xtype == "Dir") {
2406 _this.windowstate.fileViewOpen(f,
2407 _this.keystate.is_shift != 1
2410 _this.splitview.el.show_sidebar = false;
2417 // user defined functions
2420 public class Xcls_treeselmodel : Object
2422 public Gtk.SingleSelection el;
2423 private Xcls_MainWindow _this;
2429 public Xcls_treeselmodel(Xcls_MainWindow _owner )
2432 _this.treeselmodel = this;
2433 var child_1 = new Xcls_FilterListModel66( _this );
2435 this.el = new Gtk.SingleSelection( child_1.el );
2439 // set gobject values
2440 this.el.can_unselect = true;
2441 this.el.autoselect = true;
2444 // user defined functions
2446 public class Xcls_FilterListModel66 : Object
2448 public Gtk.FilterListModel el;
2449 private Xcls_MainWindow _this;
2455 public Xcls_FilterListModel66(Xcls_MainWindow _owner )
2458 new Xcls_treelistsort( _this );
2459 new Xcls_treefilter( _this );
2460 this.el = new Gtk.FilterListModel( _this.treelistsort.el, _this.treefilter.el );
2464 // set gobject values
2467 // user defined functions
2469 public class Xcls_treelistsort : Object
2471 public Gtk.SortListModel el;
2472 private Xcls_MainWindow _this;
2478 public Xcls_treelistsort(Xcls_MainWindow _owner )
2481 _this.treelistsort = this;
2482 new Xcls_treelistmodel( _this );
2483 var child_2 = new Xcls_TreeListRowSorter70( _this );
2485 this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
2489 // set gobject values
2490 this.el.incremental = true;
2493 // user defined functions
2495 public class Xcls_treelistmodel : Object
2497 public Gtk.TreeListModel el;
2498 private Xcls_MainWindow _this;
2504 public Xcls_treelistmodel(Xcls_MainWindow _owner )
2507 _this.treelistmodel = this;
2508 new Xcls_treemodel( _this );
2509 this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
2510 //GLib.debug("liststore got %s", item.get_type().name());
2511 return ((JsRender.JsRender)item).childfiles;
2516 // set gobject values
2519 // user defined functions
2521 public class Xcls_treemodel : Object
2523 public GLib.ListStore el;
2524 private Xcls_MainWindow _this;
2530 public Xcls_treemodel(Xcls_MainWindow _owner )
2533 _this.treemodel = this;
2534 this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
2538 // set gobject values
2541 // user defined functions
2545 public class Xcls_TreeListRowSorter70 : Object
2547 public Gtk.TreeListRowSorter el;
2548 private Xcls_MainWindow _this;
2554 public Xcls_TreeListRowSorter70(Xcls_MainWindow _owner )
2557 var child_1 = new Xcls_StringSorter71( _this );
2559 this.el = new Gtk.TreeListRowSorter( child_1.el );
2563 // set gobject values
2566 // user defined functions
2568 public class Xcls_StringSorter71 : Object
2570 public Gtk.StringSorter el;
2571 private Xcls_MainWindow _this;
2577 public Xcls_StringSorter71(Xcls_MainWindow _owner )
2580 var child_1 = new Xcls_PropertyExpression72( _this );
2582 this.el = new Gtk.StringSorter( child_1.el );
2586 // set gobject values
2587 this.el.ignore_case = true;
2590 // user defined functions
2592 public class Xcls_PropertyExpression72 : Object
2594 public Gtk.PropertyExpression el;
2595 private Xcls_MainWindow _this;
2601 public Xcls_PropertyExpression72(Xcls_MainWindow _owner )
2604 this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender) , null, "name" );
2608 // set gobject values
2611 // user defined functions
2617 public class Xcls_treefilter : Object
2619 public Gtk.CustomFilter el;
2620 private Xcls_MainWindow _this;
2626 public Xcls_treefilter(Xcls_MainWindow _owner )
2629 _this.treefilter = this;
2630 this.el = new Gtk.CustomFilter( (item) => {
2631 var tr = ((Gtk.TreeListRow)item).get_item();
2632 //GLib.debug("filter %s", tr.get_type().name());
2633 var j = (JsRender.JsRender) tr;
2634 if (j.xtype == "Dir" && j.childfiles.n_items < 1) {
2637 var str = _this.filesearch.el.text.down();
2638 if (j.xtype == "Dir") {
2641 for (var i =0 ; i < j.childfiles.n_items; i++) {
2642 var f = (JsRender.JsRender) j.childfiles.get_item(i);
2643 //if (f.xtype != "PlainFile") {
2646 if (f.content_type.contains("image")) {
2649 if (str.length < 1) {
2652 if (f.name.down().contains(str)) {
2660 //if (j.xtype != "PlainFile") {
2663 if (j.content_type.contains("image")) {
2667 if (str.length < 1) { // no search.
2670 if (j.name.down().contains(str)) {
2679 // set gobject values
2682 // user defined functions
2687 public class Xcls_name : Object
2689 public Gtk.ColumnViewColumn el;
2690 private Xcls_MainWindow _this;
2696 public Xcls_name(Xcls_MainWindow _owner )
2700 var child_1 = new Xcls_SignalListItemFactory75( _this );
2702 this.el = new Gtk.ColumnViewColumn( "All Project Files", child_1.el );
2706 // set gobject values
2707 this.el.id = "name";
2708 this.el.expand = true;
2709 this.el.resizable = true;
2714 // this.el.set_sorter( new Gtk.StringSorter(
2715 // new Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, "name")
2721 // user defined functions
2723 public class Xcls_SignalListItemFactory75 : Object
2725 public Gtk.SignalListItemFactory el;
2726 private Xcls_MainWindow _this;
2732 public Xcls_SignalListItemFactory75(Xcls_MainWindow _owner )
2735 this.el = new Gtk.SignalListItemFactory();
2739 // set gobject values
2742 this.el.setup.connect( (listitem) => {
2744 var expand = new Gtk.TreeExpander();
2746 expand.set_indent_for_depth(true);
2747 expand.set_indent_for_icon(true);
2748 var hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);
2749 var icon = new Gtk.Image();
2750 icon.margin_end = 4;
2751 var lbl = new Gtk.Label("");
2752 lbl.use_markup = true;
2755 lbl.justify = Gtk.Justification.LEFT;
2760 expand.set_child(hbox);
2761 ((Gtk.ListItem)listitem).set_child(expand);
2762 ((Gtk.ListItem)listitem).activatable = false;
2764 this.el.bind.connect( (listitem) => {
2766 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
2770 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2771 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2773 var hbox = (Gtk.Box) expand.child;
2776 var img = (Gtk.Image) hbox.get_first_child();
2777 var lbl = (Gtk.Label) img.get_next_sibling();
2781 if (lbl == null || lbl.label != "") { // do not update
2784 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
2785 //GLib.debug("LR = %s", lr.get_type().name());
2788 var jr =(JsRender.JsRender) lr.get_item();
2789 //GLib.debug("JR = %s", jr.get_type().name());
2792 GLib.debug("Problem getting item");
2796 jr.bind_property("icon",
2798 GLib.BindingFlags.SYNC_CREATE);
2800 //GLib.debug("change %s to %s", lbl.label, np.name);
2801 lbl.label = jr.name; // for dir's we could hsow the sub path..
2802 lbl.tooltip_markup = jr.path;
2804 expand.set_hide_expander( jr.xtype != "Dir" );
2805 expand.set_list_row(lr);
2812 // user defined functions
2820 public class Xcls_keystate : Object
2822 public Gtk.EventControllerKey el;
2823 private Xcls_MainWindow _this;
2827 public int is_shift;
2830 public Xcls_keystate(Xcls_MainWindow _owner )
2833 _this.keystate = this;
2834 this.el = new Gtk.EventControllerKey();
2839 // set gobject values
2842 this.el.key_released.connect( (keyval, keycode, state) => {
2845 "key release %d, %d, %d ?= %d %d" ,
2846 (int) keyval, (int) keycode, state,
2847 (int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK
2849 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2852 //GLib.debug("set state %d , shift = %d", (int)this.el.get_current_event_state(), Gdk.ModifierType.SHIFT_MASK);
2853 if (keyval == Gdk.Key.o && (state & Gdk.ModifierType.CONTROL_MASK) != 0) {
2855 if (!_this.splitview.el.show_sidebar) {
2856 _this.sidebar.show();
2863 this.el.key_pressed.connect( (keyval, keycode, state) => {
2865 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2876 // user defined functions