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_height = 850;
71 this.el.default_width = 1200;
72 new Xcls_headerbar( _this );
73 this.el.set_titlebar ( _this.headerbar.el );
74 new Xcls_splitview( _this );
75 this.el.child = _this.splitview.el;
79 this.el.set_icon_name("roobuilder");
82 this.el.close_request.connect( ( ) => {
83 Resources.singleton().disconnect(_this.statusbar.handler_id);
86 this.windowstate.file.getLanguageServer().document_close(
90 BuilderApplication.removeWindow(this);
92 if (BuilderApplication.windows.size < 1) {
93 this.windowstate.file.getLanguageServer().exit();
94 BuilderApplication.singleton( null ).quit();
99 this.el.show.connect( ( ) => {
100 // hide the file editing..
102 //this.hideViewEditing();
103 // this is updated by windowstate - we try and fill it in..
104 _this.statusbar.el.hide();
105 //_this.statusbar_errors.el.hide();
106 //_this.statusbar_warnings.el.hide();
107 //_this.statusbar_depricated.el.hide();
108 _this.statusbar_compile_spinner.el.hide();
110 Resources.singleton().checkResources();
115 this.el.hide.connect( () => {
122 // user defined functions
123 public void updateErrors () {
126 GLib.debug("updateErrors");
128 var pr = this.windowstate.project.getErrors("ERR");
130 this.statusbar_errors.setNotices(
132 this.windowstate.file.getErrorsTotal("ERR")
135 this.statusbar_warnings.setNotices(
136 this.windowstate.project.getErrors("WARN"),
137 this.windowstate.file.getErrorsTotal("WARN")
139 this.statusbar_depricated.setNotices(
140 this.windowstate.project.getErrors("DEPR"),
141 this.windowstate.file.getErrorsTotal("DEPR")
144 _this.statusbar_run.el.hide();
146 if (pr.get_n_items() < 1) {
147 _this.statusbar_run.el.show();
151 public void initChildren () {
152 // this needs putting in a better place..
153 if (this.windowstate == null) {
154 this.windowstate = new WindowState(this);
166 public void show () {
169 if (this.windowstate.file == null) {
170 this.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);
173 public void setTitle () {
174 if (_this.windowstate.project == null ||
175 _this.windowstate.file == null
177 this.el.set_title("Select File");
181 _this.windowstate.project.name +
183 _this.windowstate.file.relpath);
185 public void openNewWindow () {
187 var w = new Xcls_MainWindow();
189 BuilderApplication.addWindow(w);
192 w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);
195 public class Xcls_headerbar : Object
197 public Gtk.HeaderBar el;
198 private Xcls_MainWindow _this;
202 public bool show_close_button;
205 public Xcls_headerbar(Xcls_MainWindow _owner )
208 _this.headerbar = this;
209 this.el = new Gtk.HeaderBar();
212 this.show_close_button = true;
214 // set gobject values
215 var child_1 = new Xcls_Box2( _this );
217 this.el.pack_start ( child_1.el );
220 // user defined functions
222 public class Xcls_Box2 : Object
225 private Xcls_MainWindow _this;
231 public Xcls_Box2(Xcls_MainWindow _owner )
234 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
238 // set gobject values
239 var child_1 = new Xcls_Button3( _this );
241 this.el.append ( child_1.el );
242 var child_2 = new Xcls_Button5( _this );
244 this.el.append( child_2.el );
245 var child_3 = new Xcls_Button6( _this );
247 this.el.append( child_3.el );
250 // user defined functions
252 public class Xcls_Button3 : Object
254 public Gtk.Button el;
255 private Xcls_MainWindow _this;
261 public Xcls_Button3(Xcls_MainWindow _owner )
264 this.el = new Gtk.Button();
268 // set gobject values
269 this.el.has_frame = false;
270 this.el.tooltip_text = "Manage Windows (Ctrl-O)";
271 this.el.has_tooltip = true;
272 var child_1 = new Xcls_ButtonContent4( _this );
273 this.el.child = child_1.el;
276 this.el.clicked.connect( ( ) => {
277 _this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;
278 if (_this.splitview.el.show_sidebar) {
279 _this.sidebar.show();
284 // user defined functions
286 public class Xcls_ButtonContent4 : Object
288 public Adw.ButtonContent el;
289 private Xcls_MainWindow _this;
295 public Xcls_ButtonContent4(Xcls_MainWindow _owner )
298 this.el = new Adw.ButtonContent();
302 // set gobject values
303 this.el.icon_name = "preferences-system-windows";
304 this.el.label = " Files";
307 // user defined functions
311 public class Xcls_Button5 : Object
313 public Gtk.Button el;
314 private Xcls_MainWindow _this;
320 public Xcls_Button5(Xcls_MainWindow _owner )
323 this.el = new Gtk.Button();
327 // set gobject values
328 this.el.icon_name = "edit-undo";
329 this.el.has_frame = false;
332 this.el.clicked.connect( ( ) => {
334 GLib.debug("undo clicked");
335 if (_this.windowstate.file.xtype == "PlainFile") {
336 _this.windowstate.code_editor_tab.buffer.el.undo();
338 if (!_this.windowstate.file.undoStep(-1)) {
343 _this.windowstate.switchState (WindowState.State.PREVIEW);
344 // this triggers loadItems..
345 _this.windowstate.left_tree.model.loadFile(
346 _this.windowstate.file);
352 // load it everywhere
356 // user defined functions
359 public class Xcls_Button6 : Object
361 public Gtk.Button el;
362 private Xcls_MainWindow _this;
368 public Xcls_Button6(Xcls_MainWindow _owner )
371 this.el = new Gtk.Button();
375 // set gobject values
376 this.el.icon_name = "edit-redo";
377 this.el.has_frame = false;
380 this.el.clicked.connect( ( ) => {
382 GLib.debug("undo clicked");
383 if (_this.windowstate.file.xtype == "PlainFile") {
384 _this.windowstate.code_editor_tab.buffer.el.redo();
386 if (!_this.windowstate.file.undoStep(1)) {
391 _this.windowstate.switchState (WindowState.State.PREVIEW);
392 // this triggers loadItems..
393 _this.windowstate.left_tree.model.loadFile(
394 _this.windowstate.file);
400 // load it everywhere
404 // user defined functions
409 public class Xcls_splitview : Object
411 public Adw.OverlaySplitView el;
412 private Xcls_MainWindow _this;
418 public Xcls_splitview(Xcls_MainWindow _owner )
421 _this.splitview = this;
422 this.el = new Adw.OverlaySplitView();
426 // set gobject values
427 this.el.collapsed = true;
428 this.el.sidebar_width_fraction = 0.400000;
429 this.el.show_sidebar = false;
430 new Xcls_vbox( _this );
431 this.el.content = _this.vbox.el;
432 new Xcls_sidebar( _this );
433 this.el.sidebar = _this.sidebar.el;
434 new Xcls_keystate( _this );
435 this.el.add_controller( _this.keystate.el );
438 // user defined functions
440 public class Xcls_vbox : Object
443 private Xcls_MainWindow _this;
449 public Xcls_vbox(Xcls_MainWindow _owner )
453 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
457 // set gobject values
458 this.el.homogeneous = false;
459 this.el.hexpand = true;
460 this.el.vexpand = false;
461 new Xcls_mainpane( _this );
462 this.el.append( _this.mainpane.el );
463 var child_2 = new Xcls_Box17( _this );
465 this.el.append( child_2.el );
468 // user defined functions
470 public class Xcls_mainpane : Object
473 private Xcls_MainWindow _this;
477 public int lastWidth;
480 public Xcls_mainpane(Xcls_MainWindow _owner )
483 _this.mainpane = this;
484 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
489 // set gobject values
490 this.el.hexpand = true;
491 this.el.vexpand = true;
492 this.el.position = 400;
493 new Xcls_leftpane( _this );
494 this.el.start_child = _this.leftpane.el;
495 var child_2 = new Xcls_Box14( _this );
496 this.el.end_child = child_2.el;
499 this.el.accept_position.connect( ( ) => {
500 _this.windowstate.left_tree.onresize();
505 // user defined functions
507 public class Xcls_leftpane : Object
510 private Xcls_MainWindow _this;
516 public Xcls_leftpane(Xcls_MainWindow _owner )
519 _this.leftpane = this;
520 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
524 // set gobject values
525 this.el.hexpand = true;
526 this.el.vexpand = true;
527 new Xcls_editpane( _this );
528 this.el.append( _this.editpane.el );
531 // user defined functions
533 public class Xcls_editpane : Object
536 private Xcls_MainWindow _this;
542 public Xcls_editpane(Xcls_MainWindow _owner )
545 _this.editpane = this;
546 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
550 // set gobject values
551 new Xcls_tree( _this );
552 this.el.start_child = _this.tree.el;
553 new Xcls_props( _this );
554 this.el.end_child = _this.props.el;
557 this.el.accept_position.connect( ( ) => {
558 _this.windowstate.left_tree.onresize();
561 this.el.move_handle.connect( (scroll) => {
562 GLib.debug("Move handle");
567 // user defined functions
569 public class Xcls_tree : Object
572 private Xcls_MainWindow _this;
578 public Xcls_tree(Xcls_MainWindow _owner )
582 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
586 // set gobject values
587 this.el.hexpand = true;
588 this.el.vexpand = true;
591 // user defined functions
594 public class Xcls_props : Object
597 private Xcls_MainWindow _this;
603 public Xcls_props(Xcls_MainWindow _owner )
607 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
611 // set gobject values
612 this.el.hexpand = true;
613 this.el.vexpand = true;
616 // user defined functions
621 public class Xcls_Box14 : Object
624 private Xcls_MainWindow _this;
630 public Xcls_Box14(Xcls_MainWindow _owner )
633 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
637 // set gobject values
638 this.el.hexpand = true;
639 this.el.vexpand = true;
640 new Xcls_rooviewbox( _this );
641 this.el.append( _this.rooviewbox.el );
642 new Xcls_codeeditviewbox( _this );
643 this.el.append( _this.codeeditviewbox.el );
646 // user defined functions
648 public class Xcls_rooviewbox : Object
651 private Xcls_MainWindow _this;
657 public Xcls_rooviewbox(Xcls_MainWindow _owner )
660 _this.rooviewbox = this;
661 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
665 // set gobject values
666 this.el.hexpand = true;
667 this.el.vexpand = true;
670 // user defined functions
673 public class Xcls_codeeditviewbox : Object
676 private Xcls_MainWindow _this;
682 public Xcls_codeeditviewbox(Xcls_MainWindow _owner )
685 _this.codeeditviewbox = this;
686 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
690 // set gobject values
691 this.el.hexpand = true;
692 this.el.vexpand = true;
695 // user defined functions
700 public class Xcls_Box17 : Object
703 private Xcls_MainWindow _this;
709 public Xcls_Box17(Xcls_MainWindow _owner )
712 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
716 // set gobject values
717 this.el.homogeneous = false;
718 this.el.vexpand = false;
719 var child_1 = new Xcls_Button18( _this );
721 this.el.append( child_1.el );
722 var child_2 = new Xcls_Button19( _this );
724 this.el.append( child_2.el );
725 var child_3 = new Xcls_MenuButton20( _this );
727 this.el.append( child_3.el );
728 var child_4 = new Xcls_Label25( _this );
730 this.el.append( child_4.el );
731 new Xcls_statusbar( _this );
732 this.el.append( _this.statusbar.el );
733 var child_6 = new Xcls_Box27( _this );
735 this.el.append( child_6.el );
736 new Xcls_statusbar_compile_spinner( _this );
737 this.el.append( _this.statusbar_compile_spinner.el );
738 new Xcls_statusbar_compile_icon( _this );
739 this.el.append( _this.statusbar_compile_icon.el );
742 // user defined functions
744 public class Xcls_Button18 : Object
746 public Gtk.Button el;
747 private Xcls_MainWindow _this;
751 public bool always_show_image;
754 public Xcls_Button18(Xcls_MainWindow _owner )
757 this.el = new Gtk.Button();
760 this.always_show_image = true;
762 // set gobject values
763 this.el.icon_name = "emblem-system";
764 this.el.tooltip_text = "Project Details";
765 this.el.label = "Edit Project Settings";
768 this.el.clicked.connect( ( ) => {
770 _this.windowstate.projectPopoverShow(_this.el, null, null);
776 // user defined functions
779 public class Xcls_Button19 : Object
781 public Gtk.Button el;
782 private Xcls_MainWindow _this;
786 public bool always_show_image;
789 public Xcls_Button19(Xcls_MainWindow _owner )
792 this.el = new Gtk.Button();
795 this.always_show_image = true;
797 // set gobject values
798 this.el.icon_name = "document-properties";
799 this.el.tooltip_text = "File Details";
800 this.el.label = "Edit File Properties";
803 this.el.clicked.connect( ( ) => {
805 // create a new file in project..
806 if (_this.project == null || _this.windowstate.file == null) {
809 _this.windowstate.file_details.show(
810 _this.windowstate.file, _this.el, false
819 // user defined functions
822 public class Xcls_MenuButton20 : Object
824 public Gtk.MenuButton el;
825 private Xcls_MainWindow _this;
829 public bool always_show_image;
832 public Xcls_MenuButton20(Xcls_MainWindow _owner )
835 this.el = new Gtk.MenuButton();
838 this.always_show_image = true;
840 // set gobject values
841 this.el.icon_name = "dialog-information";
842 this.el.label = "About";
843 new Xcls_topbarmenu( _this );
844 this.el.popover = _this.topbarmenu.el;
847 // user defined functions
849 public class Xcls_topbarmenu : Object
851 public Gtk.PopoverMenu el;
852 private Xcls_MainWindow _this;
858 public Xcls_topbarmenu(Xcls_MainWindow _owner )
861 _this.topbarmenu = this;
862 this.el = new Gtk.PopoverMenu.from_model(null);
866 // set gobject values
867 var child_1 = new Xcls_Box22( _this );
869 this.el.set_child ( child_1.el );
878 // user defined functions
880 public class Xcls_Box22 : Object
883 private Xcls_MainWindow _this;
889 public Xcls_Box22(Xcls_MainWindow _owner )
892 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
896 // set gobject values
897 var child_1 = new Xcls_Button23( _this );
899 this.el.append( child_1.el );
900 var child_2 = new Xcls_Button24( _this );
902 this.el.append( child_2.el );
905 // user defined functions
907 public class Xcls_Button23 : Object
909 public Gtk.Button el;
910 private Xcls_MainWindow _this;
916 public Xcls_Button23(Xcls_MainWindow _owner )
919 this.el = new Gtk.Button();
923 // set gobject values
924 this.el.label = "Download updated Resources";
927 this.el.activate.connect( ( ) => {
928 Resources.singleton().fetchStart();
932 // user defined functions
935 public class Xcls_Button24 : Object
937 public Gtk.Button el;
938 private Xcls_MainWindow _this;
944 public Xcls_Button24(Xcls_MainWindow _owner )
947 this.el = new Gtk.Button();
951 // set gobject values
952 this.el.label = "About the Builder";
955 this.el.clicked.connect( () => {
956 About.singleton().el.show();
960 // user defined functions
966 public class Xcls_Label25 : Object
969 private Xcls_MainWindow _this;
975 public Xcls_Label25(Xcls_MainWindow _owner )
978 this.el = new Gtk.Label( " " );
982 // set gobject values
983 this.el.hexpand = true;
986 // user defined functions
989 public class Xcls_statusbar : Object
991 public Gtk.ProgressBar el;
992 private Xcls_MainWindow _this;
996 public ulong handler_id;
999 public Xcls_statusbar(Xcls_MainWindow _owner )
1002 _this.statusbar = this;
1003 this.el = new Gtk.ProgressBar();
1006 this.handler_id = -1;
1008 // set gobject values
1009 this.el.show_text = true;
1014 this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
1017 _this.mainpane.el.set_sensitive(true);
1021 _this.mainpane.el.set_sensitive(false);
1023 this.el.set_fraction ((1.0f * pos) / (1.0f * total));
1024 this.el.set_text("Fetching Resource : %s/%s".printf(pos.to_string(), total.to_string()));
1030 // user defined functions
1033 public class Xcls_Box27 : Object
1036 private Xcls_MainWindow _this;
1042 public Xcls_Box27(Xcls_MainWindow _owner )
1045 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1049 // set gobject values
1050 new Xcls_statusbar_compilestatus_label( _this );
1051 this.el.append( _this.statusbar_compilestatus_label.el );
1052 new Xcls_statusbar_errors( _this );
1053 this.el.append( _this.statusbar_errors.el );
1054 new Xcls_statusbar_warnings( _this );
1055 this.el.append( _this.statusbar_warnings.el );
1056 new Xcls_statusbar_depricated( _this );
1057 this.el.append( _this.statusbar_depricated.el );
1058 new Xcls_statusbar_run( _this );
1059 this.el.append( _this.statusbar_run.el );
1062 // user defined functions
1064 public class Xcls_statusbar_compilestatus_label : Object
1066 public Gtk.Label el;
1067 private Xcls_MainWindow _this;
1073 public Xcls_statusbar_compilestatus_label(Xcls_MainWindow _owner )
1076 _this.statusbar_compilestatus_label = this;
1077 this.el = new Gtk.Label( "Compile Status:" );
1081 // set gobject values
1082 this.el.margin_end = 4;
1083 this.el.margin_start = 4;
1086 // user defined functions
1089 public class Xcls_statusbar_errors : Object
1091 public Gtk.Button el;
1092 private Xcls_MainWindow _this;
1096 public Xcls_ValaCompileErrors popup;
1099 public Xcls_statusbar_errors(Xcls_MainWindow _owner )
1102 _this.statusbar_errors = this;
1103 this.el = new Gtk.Button();
1107 // set gobject values
1108 this.el.icon_name = "dialog-error";
1109 this.el.label = "0 Errors";
1112 this.el.clicked.connect( () => {
1114 if (this.popup == null) {
1123 // user defined functions
1124 public void setNotices (GLib.ListStore nots, int ferrors ) {
1125 BuilderApplication.showSpinner("");
1126 if (nots.get_n_items() < 1 ) {
1128 if (this.popup != null) {
1129 this.popup.el.hide();
1135 this.el.label = "%d/%d Errors".printf(ferrors,(int)nots.get_n_items());
1139 if (this.popup == null) {
1140 this.popup = new Xcls_ValaCompileErrors();
1141 this.popup.window = _this;
1142 // this.popup.el.set_transient_for( _this.el );
1143 this.popup.el.set_parent(this.el);
1146 this.popup.updateNotices(nots);
1151 public class Xcls_statusbar_warnings : Object
1153 public Gtk.Button el;
1154 private Xcls_MainWindow _this;
1158 public Xcls_ValaCompileErrors popup;
1161 public Xcls_statusbar_warnings(Xcls_MainWindow _owner )
1164 _this.statusbar_warnings = this;
1165 this.el = new Gtk.Button();
1169 // set gobject values
1170 this.el.icon_name = "dialog-warning";
1171 this.el.label = "0 Warnings";
1174 this.el.clicked.connect( () => {
1176 if (this.popup == null) {
1185 // user defined functions
1186 public void setNotices (GLib.ListStore nots, int ferrs ) {
1188 if (nots.get_n_items() < 1 ) {
1190 if (this.popup != null) {
1191 this.popup.el.hide();
1197 this.el.label = "%d/%d Warnings".printf(ferrs,(int)nots.get_n_items());
1201 if (this.popup == null) {
1202 this.popup = new Xcls_ValaCompileErrors();
1203 this.popup.window = _this;
1204 // this.popup.el.set_transient_for( _this.el );
1205 this.popup.el.set_parent(this.el);
1207 this.popup.updateNotices(nots);
1212 public class Xcls_statusbar_depricated : Object
1214 public Gtk.Button el;
1215 private Xcls_MainWindow _this;
1219 public Xcls_ValaCompileErrors popup;
1220 public GLib.ListStore notices;
1223 public Xcls_statusbar_depricated(Xcls_MainWindow _owner )
1226 _this.statusbar_depricated = this;
1227 this.el = new Gtk.Button();
1230 this.notices = null;
1232 // set gobject values
1233 this.el.icon_name = "dialog-information";
1234 this.el.label = "0 Depricated";
1237 this.el.clicked.connect( () => {
1239 if (this.popup == null) {
1248 // user defined functions
1249 public void setNotices (GLib.ListStore nots, int ferrs ) {
1251 if (nots.get_n_items() < 1 ) {
1253 if (this.popup != null) {
1254 this.popup.el.hide();
1260 this.el.label = "%d/%d Depricated".printf(ferrs,(int)nots.get_n_items());
1264 if (this.popup == null) {
1265 this.popup = new Xcls_ValaCompileErrors();
1266 this.popup.window = _this;
1267 // this.popup.el.set_transient_for( _this.el );
1268 this.popup.el.set_parent(this.el);
1270 this.popup.updateNotices(nots);
1275 public class Xcls_statusbar_run : Object
1277 public Gtk.Button el;
1278 private Xcls_MainWindow _this;
1282 public Xcls_ValaCompileErrors popup;
1283 public Palete.ValaCompileRequest? last_request;
1286 public Xcls_statusbar_run(Xcls_MainWindow _owner )
1289 _this.statusbar_run = this;
1290 this.el = new Gtk.Button();
1293 this.last_request = null;
1295 // set gobject values
1296 this.el.icon_name = "media-playback-start";
1297 this.el.label = "Run";
1298 this.el.visible = false;
1301 this.el.clicked.connect( () => {
1303 if (_this.windowstate.file == null) {
1306 if (_this.statusbar_compile_spinner.el.spinning) {
1307 _this.windowstate.compile_results.el.set_parent(this.el);
1308 _this.windowstate.compile_results.el.show(); // show currently running.
1312 if (this.last_request != null) {
1313 this.last_request.cancel();
1314 if (this.last_request.terminal_pid > 0) {
1315 this.last_request.killChildren(this.last_request.terminal_pid);
1318 var pr = _this.windowstate.project as Project.Gtk;
1324 this.last_request= new Palete.ValaCompileRequest(
1326 pr.firstBuildModuleWith(_this.windowstate.file)
1328 this.last_request.onOutput.connect( ( str) => {
1329 _this.windowstate.compile_results.addLine(str);
1331 this.last_request.run.begin( ( a, r) => {
1332 this.last_request.run.end(r);
1334 if (_this.windowstate.compile_results.el.parent == null) {
1335 _this.windowstate.compile_results.el.set_parent(this.el);
1337 _this.windowstate.compile_results.show(this.el,true);
1342 // user defined functions
1346 public class Xcls_statusbar_compile_spinner : Object
1348 public Gtk.Spinner el;
1349 private Xcls_MainWindow _this;
1355 public Xcls_statusbar_compile_spinner(Xcls_MainWindow _owner )
1358 _this.statusbar_compile_spinner = this;
1359 this.el = new Gtk.Spinner();
1363 // set gobject values
1364 this.el.margin_end = 4;
1365 this.el.margin_start = 4;
1366 this.el.tooltip_text = "Compiling";
1369 // user defined functions
1370 public void start (string icon, string tooltip) {
1372 if (icon == "spinner") {
1375 this.el.tooltip_text = tooltip;
1376 _this.statusbar_compile_icon.el.hide();
1379 // GLib.debug("set status icon %s, %s", icon, tooltip);
1380 _this.statusbar_compile_icon.el.tooltip_text = tooltip;
1381 _this.statusbar_compile_icon.el.icon_name = icon;
1382 _this.statusbar_compile_icon.el.show();
1387 public void stop () {
1390 _this.statusbar_compile_icon.el.hide();
1394 public class Xcls_statusbar_compile_icon : Object
1396 public Gtk.Image el;
1397 private Xcls_MainWindow _this;
1403 public Xcls_statusbar_compile_icon(Xcls_MainWindow _owner )
1406 _this.statusbar_compile_icon = this;
1407 this.el = new Gtk.Image();
1411 // set gobject values
1412 this.el.margin_end = 4;
1413 this.el.margin_start = 4;
1414 this.el.icon_size = Gtk.IconSize.NORMAL;
1417 // user defined functions
1422 public class Xcls_sidebar : Object
1425 private Xcls_MainWindow _this;
1431 public Xcls_sidebar(Xcls_MainWindow _owner )
1434 _this.sidebar = this;
1435 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1439 // set gobject values
1440 new Xcls_filesearch( _this );
1441 this.el.append( _this.filesearch.el );
1442 var child_2 = new Xcls_Box38( _this );
1444 this.el.append( child_2.el );
1445 var child_3 = new Xcls_Paned47( _this );
1447 this.el.append( child_3.el );
1450 // user defined functions
1451 public void show () {
1452 _this.splitview.el.show_sidebar = true;
1454 _this.filesearch.el.grab_focus();
1455 _this.winloading = true;
1456 _this.winmodel.el.remove_all();
1457 _this.filesearch.el.set_text("");
1458 for(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {
1459 _this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));
1461 _this.winsel.selectCurrent();
1462 _this.winloading = false;
1464 _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1466 _this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);
1468 _this.treeview.el.set_model(_this.treeselmodel.el);
1470 _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;
1475 public class Xcls_filesearch : Object
1477 public Gtk.SearchEntry el;
1478 private Xcls_MainWindow _this;
1484 public Xcls_filesearch(Xcls_MainWindow _owner )
1487 _this.filesearch = this;
1488 this.el = new Gtk.SearchEntry();
1492 // set gobject values
1493 this.el.hexpand = true;
1494 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 ";
1495 this.el.has_tooltip = true;
1496 this.el.placeholder_text = "Search for file";
1497 var child_1 = new Xcls_EventControllerKey37( _this );
1499 this.el.add_controller( child_1.el );
1502 this.el.search_changed.connect( ( ) => {
1504 _this.windowsearch.el.set_search(this.el.get_text());
1505 if (this.el.text == "") {
1506 _this.treescroll.el.visible = false;
1509 _this.treescroll.el.visible = true;
1510 _this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);
1514 // user defined functions
1516 public class Xcls_EventControllerKey37 : Object
1518 public Gtk.EventControllerKey el;
1519 private Xcls_MainWindow _this;
1525 public Xcls_EventControllerKey37(Xcls_MainWindow _owner )
1528 this.el = new Gtk.EventControllerKey();
1532 // set gobject values
1535 this.el.key_released.connect( (keyval, keycode, state) => {
1536 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1541 "searcj key release %d, %d, %d ?= %d" ,
1542 (int) keyval, (int) keycode, state,
1545 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1551 if (keyval == Gdk.Key.Return) {
1552 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
1553 GLib.debug("SELECTED = %s", tr.item.get_type().name());
1554 var f = (JsRender.JsRender) tr.item;
1555 GLib.debug("Click %s", f.name);
1556 if (f.xtype == "Dir") {
1561 _this.windowstate.fileViewOpen(f,
1562 _this.keystate.is_shift != 1
1565 _this.splitview.el.show_sidebar = false;
1570 if (keyval == Gdk.Key.Up) {
1572 }if (keyval == Gdk.Key.Down) {
1578 var ns = _this.treeselmodel.el.selected + dir;
1582 if (ns >= _this.treeselmodel.el.get_n_items()) {
1583 ns = _this.treeselmodel.el.get_n_items()-1;
1585 _this.treeselmodel.el.selected = ns;
1589 // user defined functions
1593 public class Xcls_Box38 : Object
1596 private Xcls_MainWindow _this;
1602 public Xcls_Box38(Xcls_MainWindow _owner )
1605 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1609 // set gobject values
1610 this.el.hexpand = true;
1611 new Xcls_open_projects_btn( _this );
1612 this.el.append( _this.open_projects_btn.el );
1613 var child_2 = new Xcls_Button43( _this );
1615 this.el.append( child_2.el );
1618 // user defined functions
1620 public class Xcls_open_projects_btn : Object
1622 public Gtk.Button el;
1623 private Xcls_MainWindow _this;
1629 public Xcls_open_projects_btn(Xcls_MainWindow _owner )
1632 _this.open_projects_btn = this;
1633 this.el = new Gtk.Button();
1637 // set gobject values
1638 this.el.hexpand = true;
1639 var child_1 = new Xcls_Box40( _this );
1640 this.el.child = child_1.el;
1643 this.el.clicked.connect( ( ) => {
1644 _this.splitview.el.show_sidebar = false;
1645 _this.windowstate.showPopoverFiles(this.el, _this.project, false);
1649 // user defined functions
1651 public class Xcls_Box40 : Object
1654 private Xcls_MainWindow _this;
1660 public Xcls_Box40(Xcls_MainWindow _owner )
1663 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1667 // set gobject values
1668 var child_1 = new Xcls_Image41( _this );
1670 this.el.append( child_1.el );
1671 var child_2 = new Xcls_Label42( _this );
1673 this.el.append( child_2.el );
1676 // user defined functions
1678 public class Xcls_Image41 : Object
1680 public Gtk.Image el;
1681 private Xcls_MainWindow _this;
1687 public Xcls_Image41(Xcls_MainWindow _owner )
1690 this.el = new Gtk.Image();
1694 // set gobject values
1695 this.el.icon_name = "document-open";
1696 this.el.margin_end = 4;
1699 // user defined functions
1702 public class Xcls_Label42 : Object
1704 public Gtk.Label el;
1705 private Xcls_MainWindow _this;
1711 public Xcls_Label42(Xcls_MainWindow _owner )
1714 this.el = new Gtk.Label( "Open File" );
1718 // set gobject values
1721 // user defined functions
1726 public class Xcls_Button43 : Object
1728 public Gtk.Button el;
1729 private Xcls_MainWindow _this;
1735 public Xcls_Button43(Xcls_MainWindow _owner )
1738 this.el = new Gtk.Button();
1742 // set gobject values
1743 this.el.hexpand = true;
1744 var child_1 = new Xcls_Box44( _this );
1745 this.el.child = child_1.el;
1748 this.el.clicked.connect( ( ) => {
1749 _this.splitview.el.show_sidebar = false;
1750 _this.windowstate.showPopoverFiles(_this.el, _this.project, true);
1754 // user defined functions
1756 public class Xcls_Box44 : Object
1759 private Xcls_MainWindow _this;
1765 public Xcls_Box44(Xcls_MainWindow _owner )
1768 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1772 // set gobject values
1773 var child_1 = new Xcls_Image45( _this );
1775 this.el.append( child_1.el );
1776 var child_2 = new Xcls_Label46( _this );
1778 this.el.append( child_2.el );
1781 // user defined functions
1783 public class Xcls_Image45 : Object
1785 public Gtk.Image el;
1786 private Xcls_MainWindow _this;
1792 public Xcls_Image45(Xcls_MainWindow _owner )
1795 this.el = new Gtk.Image();
1799 // set gobject values
1800 this.el.icon_name = "window-new";
1801 this.el.margin_end = 4;
1804 // user defined functions
1807 public class Xcls_Label46 : Object
1809 public Gtk.Label el;
1810 private Xcls_MainWindow _this;
1816 public Xcls_Label46(Xcls_MainWindow _owner )
1819 this.el = new Gtk.Label( "New Window" );
1823 // set gobject values
1826 // user defined functions
1832 public class Xcls_Paned47 : Object
1834 public Gtk.Paned el;
1835 private Xcls_MainWindow _this;
1841 public Xcls_Paned47(Xcls_MainWindow _owner )
1844 this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL );
1848 // set gobject values
1849 this.el.vexpand = true;
1850 var child_1 = new Xcls_ScrolledWindow48( _this );
1851 this.el.start_child = child_1.el;
1852 new Xcls_treescroll( _this );
1853 this.el.end_child = _this.treescroll.el;
1856 // user defined functions
1858 public class Xcls_ScrolledWindow48 : Object
1860 public Gtk.ScrolledWindow el;
1861 private Xcls_MainWindow _this;
1867 public Xcls_ScrolledWindow48(Xcls_MainWindow _owner )
1870 this.el = new Gtk.ScrolledWindow();
1874 // set gobject values
1875 this.el.has_frame = true;
1876 var child_1 = new Xcls_ColumnView49( _this );
1877 this.el.child = child_1.el;
1880 // user defined functions
1882 public class Xcls_ColumnView49 : Object
1884 public Gtk.ColumnView el;
1885 private Xcls_MainWindow _this;
1891 public Xcls_ColumnView49(Xcls_MainWindow _owner )
1894 new Xcls_winsel( _this );
1895 this.el = new Gtk.ColumnView( _this.winsel.el );
1899 // set gobject values
1900 new Xcls_projcol( _this );
1901 this.el.append_column( _this.projcol.el );
1902 new Xcls_filecol( _this );
1903 this.el.append_column ( _this.filecol.el );
1906 // user defined functions
1908 public class Xcls_winsel : Object
1910 public Gtk.SingleSelection el;
1911 private Xcls_MainWindow _this;
1915 public bool selecting;
1918 public Xcls_winsel(Xcls_MainWindow _owner )
1921 _this.winsel = this;
1922 var child_1 = new Xcls_SortListModel51( _this );
1924 this.el = new Gtk.SingleSelection( child_1.el );
1927 this.selecting = false;
1929 // set gobject values
1930 this.el.can_unselect = false;
1931 this.el.autoselect = false;
1934 this.el.notify["selected"].connect( () => {
1935 if (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {
1938 var ws = this.el.selected_item as WindowState;
1942 if (ws.file.path != _this.windowstate.file.path) {
1943 _this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window, -1);
1944 _this.splitview.el.show_sidebar = false;
1947 this.selectCurrent();
1951 // user defined functions
1952 public void selectCurrent () {
1953 this.selecting = true;
1955 for(var i = 0;i < this.el.get_n_items(); i++) {
1956 var ws = this.el.get_item(i) as WindowState;
1957 if (ws.file.path == _this.windowstate.file.path) {
1958 this.el.selected = i;
1962 this.selecting = false;
1967 public class Xcls_SortListModel51 : Object
1969 public Gtk.SortListModel el;
1970 private Xcls_MainWindow _this;
1976 public Xcls_SortListModel51(Xcls_MainWindow _owner )
1979 new Xcls_winfilter( _this );
1980 var child_2 = new Xcls_StringSorter56( _this );
1982 this.el = new Gtk.SortListModel( _this.winfilter.el, child_2.el );
1986 // set gobject values
1989 // user defined functions
1991 public class Xcls_winfilter : Object
1993 public Gtk.FilterListModel el;
1994 private Xcls_MainWindow _this;
2000 public Xcls_winfilter(Xcls_MainWindow _owner )
2003 _this.winfilter = this;
2004 new Xcls_winmodel( _this );
2005 new Xcls_windowsearch( _this );
2006 this.el = new Gtk.FilterListModel( _this.winmodel.el, _this.windowsearch.el );
2010 // set gobject values
2013 // user defined functions
2015 public class Xcls_windowsearch : Object
2017 public Gtk.StringFilter el;
2018 private Xcls_MainWindow _this;
2024 public Xcls_windowsearch(Xcls_MainWindow _owner )
2027 _this.windowsearch = this;
2028 var child_1 = new Xcls_PropertyExpression54( _this );
2030 this.el = new Gtk.StringFilter( child_1.el );
2034 // set gobject values
2037 // user defined functions
2039 public class Xcls_PropertyExpression54 : Object
2041 public Gtk.PropertyExpression el;
2042 private Xcls_MainWindow _this;
2048 public Xcls_PropertyExpression54(Xcls_MainWindow _owner )
2051 this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2055 // set gobject values
2058 // user defined functions
2062 public class Xcls_winmodel : Object
2064 public GLib.ListStore el;
2065 private Xcls_MainWindow _this;
2071 public Xcls_winmodel(Xcls_MainWindow _owner )
2074 _this.winmodel = this;
2075 this.el = new GLib.ListStore( typeof(WindowState) );
2079 // set gobject values
2082 // user defined functions
2086 public class Xcls_StringSorter56 : Object
2088 public Gtk.StringSorter el;
2089 private Xcls_MainWindow _this;
2095 public Xcls_StringSorter56(Xcls_MainWindow _owner )
2098 var child_1 = new Xcls_PropertyExpression57( _this );
2100 this.el = new Gtk.StringSorter( child_1.el );
2104 // set gobject values
2105 this.el.ignore_case = true;
2108 // user defined functions
2110 public class Xcls_PropertyExpression57 : Object
2112 public Gtk.PropertyExpression el;
2113 private Xcls_MainWindow _this;
2119 public Xcls_PropertyExpression57(Xcls_MainWindow _owner )
2122 this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2126 // set gobject values
2129 // user defined functions
2135 public class Xcls_projcol : Object
2137 public Gtk.ColumnViewColumn el;
2138 private Xcls_MainWindow _this;
2144 public Xcls_projcol(Xcls_MainWindow _owner )
2147 _this.projcol = this;
2148 var child_1 = new Xcls_SignalListItemFactory59( _this );
2150 this.el = new Gtk.ColumnViewColumn( "Project", child_1.el );
2154 // set gobject values
2155 this.el.id = "projcol";
2156 this.el.expand = true;
2157 this.el.resizable = true;
2160 // user defined functions
2162 public class Xcls_SignalListItemFactory59 : Object
2164 public Gtk.SignalListItemFactory el;
2165 private Xcls_MainWindow _this;
2171 public Xcls_SignalListItemFactory59(Xcls_MainWindow _owner )
2174 this.el = new Gtk.SignalListItemFactory();
2178 // set gobject values
2181 this.el.setup.connect( (listitem) => {
2182 var lbl = new Gtk.Label("");
2183 (listitem as Gtk.ListItem).set_child(lbl);
2184 lbl.justify = Gtk.Justification.LEFT;
2186 lbl.use_markup = true;
2187 lbl.ellipsize = Pango.EllipsizeMode.START;
2189 (listitem as Gtk.ListItem).activatable = true;
2191 this.el.bind.connect( (listitem) => {
2192 var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();
2193 var item = (listitem as Gtk.ListItem).get_item() as WindowState;
2195 lb.label = item.project.name;
2203 // user defined functions
2207 public class Xcls_filecol : Object
2209 public Gtk.ColumnViewColumn el;
2210 private Xcls_MainWindow _this;
2216 public Xcls_filecol(Xcls_MainWindow _owner )
2219 _this.filecol = this;
2220 var child_1 = new Xcls_SignalListItemFactory61( _this );
2222 this.el = new Gtk.ColumnViewColumn( "File", child_1.el );
2226 // set gobject values
2227 this.el.id = "filecol";
2228 this.el.expand = true;
2229 this.el.resizable = true;
2232 // user defined functions
2234 public class Xcls_SignalListItemFactory61 : Object
2236 public Gtk.SignalListItemFactory el;
2237 private Xcls_MainWindow _this;
2243 public Xcls_SignalListItemFactory61(Xcls_MainWindow _owner )
2246 this.el = new Gtk.SignalListItemFactory();
2250 // set gobject values
2253 this.el.setup.connect( (listitem) => {
2254 var lbl = new Gtk.Label("");
2255 (listitem as Gtk.ListItem).set_child(lbl);
2256 lbl.justify = Gtk.Justification.LEFT;
2258 lbl.use_markup = true;
2259 lbl.ellipsize = Pango.EllipsizeMode.START;
2261 (listitem as Gtk.ListItem).activatable = true;
2263 this.el.bind.connect( (listitem) => {
2264 var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();
2265 var item = (listitem as Gtk.ListItem).get_item() as WindowState;
2267 lb.label = item.file.relpath;
2275 // user defined functions
2281 public class Xcls_treescroll : Object
2283 public Gtk.ScrolledWindow el;
2284 private Xcls_MainWindow _this;
2290 public Xcls_treescroll(Xcls_MainWindow _owner )
2293 _this.treescroll = this;
2294 this.el = new Gtk.ScrolledWindow();
2298 // set gobject values
2299 this.el.has_frame = true;
2300 this.el.hexpand = true;
2301 this.el.vexpand = true;
2302 this.el.tooltip_text = "dbl-click - opens in NEW window \nshift--dbl-click opens in this window";
2303 this.el.visible = false;
2304 new Xcls_treeview( _this );
2305 this.el.child = _this.treeview.el;
2308 // user defined functions
2310 public class Xcls_treeview : Object
2312 public Gtk.ColumnView el;
2313 private Xcls_MainWindow _this;
2319 public Xcls_treeview(Xcls_MainWindow _owner )
2322 _this.treeview = this;
2323 new Xcls_treeselmodel( _this );
2324 this.el = new Gtk.ColumnView( _this.treeselmodel.el );
2328 // set gobject values
2329 this.el.hexpand = true;
2330 this.el.vexpand = true;
2331 var child_2 = new Xcls_GestureClick64( _this );
2333 this.el.add_controller( child_2.el );
2334 new Xcls_name( _this );
2335 this.el.append_column ( _this.name.el );
2338 // user defined functions
2340 public class Xcls_GestureClick64 : Object
2342 public Gtk.GestureClick el;
2343 private Xcls_MainWindow _this;
2349 public Xcls_GestureClick64(Xcls_MainWindow _owner )
2352 this.el = new Gtk.GestureClick();
2356 // set gobject values
2359 this.el.pressed.connect( (n_press, x, y) => {
2361 GLib.debug("double cliced");
2365 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
2366 GLib.debug("SELECTED = %s", tr.item.get_type().name());
2367 var f = (JsRender.JsRender) tr.item;
2368 GLib.debug("Click %s", f.name);
2369 if (f.xtype == "Dir") {
2374 _this.windowstate.fileViewOpen(f,
2375 _this.keystate.is_shift != 1
2378 _this.splitview.el.show_sidebar = false;
2385 // user defined functions
2388 public class Xcls_treeselmodel : Object
2390 public Gtk.SingleSelection el;
2391 private Xcls_MainWindow _this;
2397 public Xcls_treeselmodel(Xcls_MainWindow _owner )
2400 _this.treeselmodel = this;
2401 var child_1 = new Xcls_FilterListModel66( _this );
2403 this.el = new Gtk.SingleSelection( child_1.el );
2407 // set gobject values
2408 this.el.can_unselect = true;
2409 this.el.autoselect = true;
2412 // user defined functions
2414 public class Xcls_FilterListModel66 : Object
2416 public Gtk.FilterListModel el;
2417 private Xcls_MainWindow _this;
2423 public Xcls_FilterListModel66(Xcls_MainWindow _owner )
2426 new Xcls_treelistsort( _this );
2427 new Xcls_treefilter( _this );
2428 this.el = new Gtk.FilterListModel( _this.treelistsort.el, _this.treefilter.el );
2432 // set gobject values
2435 // user defined functions
2437 public class Xcls_treelistsort : Object
2439 public Gtk.SortListModel el;
2440 private Xcls_MainWindow _this;
2446 public Xcls_treelistsort(Xcls_MainWindow _owner )
2449 _this.treelistsort = this;
2450 new Xcls_treelistmodel( _this );
2451 var child_2 = new Xcls_TreeListRowSorter70( _this );
2453 this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
2457 // set gobject values
2458 this.el.incremental = true;
2461 // user defined functions
2463 public class Xcls_treelistmodel : Object
2465 public Gtk.TreeListModel el;
2466 private Xcls_MainWindow _this;
2472 public Xcls_treelistmodel(Xcls_MainWindow _owner )
2475 _this.treelistmodel = this;
2476 new Xcls_treemodel( _this );
2477 this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
2478 //GLib.debug("liststore got %s", item.get_type().name());
2479 return ((JsRender.JsRender)item).childfiles;
2484 // set gobject values
2487 // user defined functions
2489 public class Xcls_treemodel : Object
2491 public GLib.ListStore el;
2492 private Xcls_MainWindow _this;
2498 public Xcls_treemodel(Xcls_MainWindow _owner )
2501 _this.treemodel = this;
2502 this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
2506 // set gobject values
2509 // user defined functions
2513 public class Xcls_TreeListRowSorter70 : Object
2515 public Gtk.TreeListRowSorter el;
2516 private Xcls_MainWindow _this;
2522 public Xcls_TreeListRowSorter70(Xcls_MainWindow _owner )
2525 var child_1 = new Xcls_StringSorter71( _this );
2527 this.el = new Gtk.TreeListRowSorter( child_1.el );
2531 // set gobject values
2534 // user defined functions
2536 public class Xcls_StringSorter71 : Object
2538 public Gtk.StringSorter el;
2539 private Xcls_MainWindow _this;
2545 public Xcls_StringSorter71(Xcls_MainWindow _owner )
2548 var child_1 = new Xcls_PropertyExpression72( _this );
2550 this.el = new Gtk.StringSorter( child_1.el );
2554 // set gobject values
2555 this.el.ignore_case = true;
2558 // user defined functions
2560 public class Xcls_PropertyExpression72 : Object
2562 public Gtk.PropertyExpression el;
2563 private Xcls_MainWindow _this;
2569 public Xcls_PropertyExpression72(Xcls_MainWindow _owner )
2572 this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender) , null, "name" );
2576 // set gobject values
2579 // user defined functions
2585 public class Xcls_treefilter : Object
2587 public Gtk.CustomFilter el;
2588 private Xcls_MainWindow _this;
2594 public Xcls_treefilter(Xcls_MainWindow _owner )
2597 _this.treefilter = this;
2598 this.el = new Gtk.CustomFilter( (item) => {
2599 var tr = ((Gtk.TreeListRow)item).get_item();
2600 //GLib.debug("filter %s", tr.get_type().name());
2601 var j = (JsRender.JsRender) tr;
2602 if (j.xtype == "Dir" && j.childfiles.n_items < 1) {
2605 var str = _this.filesearch.el.text.down();
2606 if (j.xtype == "Dir") {
2609 for (var i =0 ; i < j.childfiles.n_items; i++) {
2610 var f = (JsRender.JsRender) j.childfiles.get_item(i);
2611 //if (f.xtype != "PlainFile") {
2614 if (f.content_type.contains("image")) {
2617 if (str.length < 1) {
2620 if (f.name.down().contains(str)) {
2628 //if (j.xtype != "PlainFile") {
2631 if (j.content_type.contains("image")) {
2635 if (str.length < 1) { // no search.
2638 if (j.name.down().contains(str)) {
2647 // set gobject values
2650 // user defined functions
2655 public class Xcls_name : Object
2657 public Gtk.ColumnViewColumn el;
2658 private Xcls_MainWindow _this;
2664 public Xcls_name(Xcls_MainWindow _owner )
2668 var child_1 = new Xcls_SignalListItemFactory75( _this );
2670 this.el = new Gtk.ColumnViewColumn( "All Project Files", child_1.el );
2674 // set gobject values
2675 this.el.id = "name";
2676 this.el.expand = true;
2677 this.el.resizable = true;
2682 // this.el.set_sorter( new Gtk.StringSorter(
2683 // new Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, "name")
2689 // user defined functions
2691 public class Xcls_SignalListItemFactory75 : Object
2693 public Gtk.SignalListItemFactory el;
2694 private Xcls_MainWindow _this;
2700 public Xcls_SignalListItemFactory75(Xcls_MainWindow _owner )
2703 this.el = new Gtk.SignalListItemFactory();
2707 // set gobject values
2710 this.el.setup.connect( (listitem) => {
2712 var expand = new Gtk.TreeExpander();
2714 expand.set_indent_for_depth(true);
2715 expand.set_indent_for_icon(true);
2716 var hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);
2717 var icon = new Gtk.Image();
2718 icon.margin_end = 4;
2719 var lbl = new Gtk.Label("");
2720 lbl.use_markup = true;
2723 lbl.justify = Gtk.Justification.LEFT;
2728 expand.set_child(hbox);
2729 ((Gtk.ListItem)listitem).set_child(expand);
2730 ((Gtk.ListItem)listitem).activatable = false;
2732 this.el.bind.connect( (listitem) => {
2734 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
2738 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2739 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2741 var hbox = (Gtk.Box) expand.child;
2744 var img = (Gtk.Image) hbox.get_first_child();
2745 var lbl = (Gtk.Label) img.get_next_sibling();
2749 if (lbl == null || lbl.label != "") { // do not update
2752 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
2753 //GLib.debug("LR = %s", lr.get_type().name());
2756 var jr =(JsRender.JsRender) lr.get_item();
2757 //GLib.debug("JR = %s", jr.get_type().name());
2760 GLib.debug("Problem getting item");
2764 jr.bind_property("icon",
2766 GLib.BindingFlags.SYNC_CREATE);
2768 //GLib.debug("change %s to %s", lbl.label, np.name);
2769 lbl.label = jr.name; // for dir's we could hsow the sub path..
2770 lbl.tooltip_markup = jr.path;
2772 expand.set_hide_expander( jr.xtype != "Dir" );
2773 expand.set_list_row(lr);
2780 // user defined functions
2788 public class Xcls_keystate : Object
2790 public Gtk.EventControllerKey el;
2791 private Xcls_MainWindow _this;
2795 public int is_shift;
2798 public Xcls_keystate(Xcls_MainWindow _owner )
2801 _this.keystate = this;
2802 this.el = new Gtk.EventControllerKey();
2807 // set gobject values
2810 this.el.key_released.connect( (keyval, keycode, state) => {
2813 "key release %d, %d, %d ?= %d %d" ,
2814 (int) keyval, (int) keycode, state,
2815 (int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK
2817 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2820 //GLib.debug("set state %d , shift = %d", (int)this.el.get_current_event_state(), Gdk.ModifierType.SHIFT_MASK);
2821 if (keyval == Gdk.Key.o && (state & Gdk.ModifierType.CONTROL_MASK) != 0) {
2823 if (!_this.splitview.el.show_sidebar) {
2824 _this.sidebar.show();
2831 this.el.key_pressed.connect( (keyval, keycode, state) => {
2833 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2844 // user defined functions