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;
1474 public class Xcls_filesearch : Object
1476 public Gtk.SearchEntry el;
1477 private Xcls_MainWindow _this;
1483 public Xcls_filesearch(Xcls_MainWindow _owner )
1486 _this.filesearch = this;
1487 this.el = new Gtk.SearchEntry();
1491 // set gobject values
1492 this.el.hexpand = true;
1493 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 ";
1494 this.el.has_tooltip = true;
1495 this.el.placeholder_text = "Search for file";
1496 var child_1 = new Xcls_EventControllerKey37( _this );
1498 this.el.add_controller( child_1.el );
1501 this.el.search_changed.connect( ( ) => {
1503 _this.windowsearch.el.set_search(this.el.get_text());
1504 if (this.el.text == "") {
1505 _this.treescroll.el.visible = false;
1508 _this.treescroll.el.visible = true;
1509 _this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);
1513 // user defined functions
1515 public class Xcls_EventControllerKey37 : Object
1517 public Gtk.EventControllerKey el;
1518 private Xcls_MainWindow _this;
1524 public Xcls_EventControllerKey37(Xcls_MainWindow _owner )
1527 this.el = new Gtk.EventControllerKey();
1531 // set gobject values
1534 this.el.key_released.connect( (keyval, keycode, state) => {
1535 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1540 "searcj key release %d, %d, %d ?= %d" ,
1541 (int) keyval, (int) keycode, state,
1544 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1550 if (keyval == Gdk.Key.Return) {
1551 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
1552 GLib.debug("SELECTED = %s", tr.item.get_type().name());
1553 var f = (JsRender.JsRender) tr.item;
1554 GLib.debug("Click %s", f.name);
1555 if (f.xtype == "Dir") {
1560 _this.windowstate.fileViewOpen(f,
1561 _this.keystate.is_shift != 1
1564 _this.splitview.el.show_sidebar = false;
1569 if (keyval == Gdk.Key.Up) {
1571 }if (keyval == Gdk.Key.Down) {
1577 var ns = _this.treeselmodel.el.selected + dir;
1581 if (ns >= _this.treeselmodel.el.get_n_items()) {
1582 ns = _this.treeselmodel.el.get_n_items()-1;
1584 _this.treeselmodel.el.selected = ns;
1588 // user defined functions
1592 public class Xcls_Box38 : Object
1595 private Xcls_MainWindow _this;
1601 public Xcls_Box38(Xcls_MainWindow _owner )
1604 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1608 // set gobject values
1609 this.el.hexpand = true;
1610 new Xcls_open_projects_btn( _this );
1611 this.el.append( _this.open_projects_btn.el );
1612 var child_2 = new Xcls_Button43( _this );
1614 this.el.append( child_2.el );
1617 // user defined functions
1619 public class Xcls_open_projects_btn : Object
1621 public Gtk.Button el;
1622 private Xcls_MainWindow _this;
1628 public Xcls_open_projects_btn(Xcls_MainWindow _owner )
1631 _this.open_projects_btn = this;
1632 this.el = new Gtk.Button();
1636 // set gobject values
1637 this.el.hexpand = true;
1638 var child_1 = new Xcls_Box40( _this );
1639 this.el.child = child_1.el;
1642 this.el.clicked.connect( ( ) => {
1643 _this.splitview.el.show_sidebar = false;
1644 _this.windowstate.showPopoverFiles(this.el, _this.project, false);
1648 // user defined functions
1650 public class Xcls_Box40 : Object
1653 private Xcls_MainWindow _this;
1659 public Xcls_Box40(Xcls_MainWindow _owner )
1662 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1666 // set gobject values
1667 var child_1 = new Xcls_Image41( _this );
1669 this.el.append( child_1.el );
1670 var child_2 = new Xcls_Label42( _this );
1672 this.el.append( child_2.el );
1675 // user defined functions
1677 public class Xcls_Image41 : Object
1679 public Gtk.Image el;
1680 private Xcls_MainWindow _this;
1686 public Xcls_Image41(Xcls_MainWindow _owner )
1689 this.el = new Gtk.Image();
1693 // set gobject values
1694 this.el.icon_name = "document-open";
1695 this.el.margin_end = 4;
1698 // user defined functions
1701 public class Xcls_Label42 : Object
1703 public Gtk.Label el;
1704 private Xcls_MainWindow _this;
1710 public Xcls_Label42(Xcls_MainWindow _owner )
1713 this.el = new Gtk.Label( "Open File" );
1717 // set gobject values
1720 // user defined functions
1725 public class Xcls_Button43 : Object
1727 public Gtk.Button el;
1728 private Xcls_MainWindow _this;
1734 public Xcls_Button43(Xcls_MainWindow _owner )
1737 this.el = new Gtk.Button();
1741 // set gobject values
1742 this.el.hexpand = true;
1743 var child_1 = new Xcls_Box44( _this );
1744 this.el.child = child_1.el;
1747 this.el.clicked.connect( ( ) => {
1748 _this.splitview.el.show_sidebar = false;
1749 _this.windowstate.showPopoverFiles(_this.el, _this.project, true);
1753 // user defined functions
1755 public class Xcls_Box44 : Object
1758 private Xcls_MainWindow _this;
1764 public Xcls_Box44(Xcls_MainWindow _owner )
1767 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1771 // set gobject values
1772 var child_1 = new Xcls_Image45( _this );
1774 this.el.append( child_1.el );
1775 var child_2 = new Xcls_Label46( _this );
1777 this.el.append( child_2.el );
1780 // user defined functions
1782 public class Xcls_Image45 : Object
1784 public Gtk.Image el;
1785 private Xcls_MainWindow _this;
1791 public Xcls_Image45(Xcls_MainWindow _owner )
1794 this.el = new Gtk.Image();
1798 // set gobject values
1799 this.el.icon_name = "window-new";
1800 this.el.margin_end = 4;
1803 // user defined functions
1806 public class Xcls_Label46 : Object
1808 public Gtk.Label el;
1809 private Xcls_MainWindow _this;
1815 public Xcls_Label46(Xcls_MainWindow _owner )
1818 this.el = new Gtk.Label( "New Window" );
1822 // set gobject values
1825 // user defined functions
1831 public class Xcls_Paned47 : Object
1833 public Gtk.Paned el;
1834 private Xcls_MainWindow _this;
1840 public Xcls_Paned47(Xcls_MainWindow _owner )
1843 this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL );
1847 // set gobject values
1848 this.el.vexpand = true;
1849 var child_1 = new Xcls_ScrolledWindow48( _this );
1850 this.el.start_child = child_1.el;
1851 new Xcls_treescroll( _this );
1852 this.el.end_child = _this.treescroll.el;
1855 // user defined functions
1857 public class Xcls_ScrolledWindow48 : Object
1859 public Gtk.ScrolledWindow el;
1860 private Xcls_MainWindow _this;
1866 public Xcls_ScrolledWindow48(Xcls_MainWindow _owner )
1869 this.el = new Gtk.ScrolledWindow();
1873 // set gobject values
1874 this.el.has_frame = true;
1875 var child_1 = new Xcls_ColumnView49( _this );
1876 this.el.child = child_1.el;
1879 // user defined functions
1881 public class Xcls_ColumnView49 : Object
1883 public Gtk.ColumnView el;
1884 private Xcls_MainWindow _this;
1890 public Xcls_ColumnView49(Xcls_MainWindow _owner )
1893 new Xcls_winsel( _this );
1894 this.el = new Gtk.ColumnView( _this.winsel.el );
1898 // set gobject values
1899 new Xcls_projcol( _this );
1900 this.el.append_column( _this.projcol.el );
1901 new Xcls_filecol( _this );
1902 this.el.append_column ( _this.filecol.el );
1905 // user defined functions
1907 public class Xcls_winsel : Object
1909 public Gtk.SingleSelection el;
1910 private Xcls_MainWindow _this;
1914 public bool selecting;
1917 public Xcls_winsel(Xcls_MainWindow _owner )
1920 _this.winsel = this;
1921 var child_1 = new Xcls_SortListModel51( _this );
1923 this.el = new Gtk.SingleSelection( child_1.el );
1926 this.selecting = false;
1928 // set gobject values
1929 this.el.can_unselect = false;
1930 this.el.autoselect = false;
1933 this.el.notify["selected"].connect( () => {
1934 if (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {
1937 var ws = this.el.selected_item as WindowState;
1941 if (ws.file.path != _this.windowstate.file.path) {
1942 _this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window, -1);
1943 _this.splitview.el.show_sidebar = false;
1946 this.selectCurrent();
1950 // user defined functions
1951 public void selectCurrent () {
1952 this.selecting = true;
1954 for(var i = 0;i < this.el.get_n_items(); i++) {
1955 var ws = this.el.get_item(i) as WindowState;
1956 if (ws.file.path == _this.windowstate.file.path) {
1957 this.el.selected = i;
1961 this.selecting = false;
1966 public class Xcls_SortListModel51 : Object
1968 public Gtk.SortListModel el;
1969 private Xcls_MainWindow _this;
1975 public Xcls_SortListModel51(Xcls_MainWindow _owner )
1978 new Xcls_winfilter( _this );
1979 var child_2 = new Xcls_StringSorter56( _this );
1981 this.el = new Gtk.SortListModel( _this.winfilter.el, child_2.el );
1985 // set gobject values
1988 // user defined functions
1990 public class Xcls_winfilter : Object
1992 public Gtk.FilterListModel el;
1993 private Xcls_MainWindow _this;
1999 public Xcls_winfilter(Xcls_MainWindow _owner )
2002 _this.winfilter = this;
2003 new Xcls_winmodel( _this );
2004 new Xcls_windowsearch( _this );
2005 this.el = new Gtk.FilterListModel( _this.winmodel.el, _this.windowsearch.el );
2009 // set gobject values
2012 // user defined functions
2014 public class Xcls_windowsearch : Object
2016 public Gtk.StringFilter el;
2017 private Xcls_MainWindow _this;
2023 public Xcls_windowsearch(Xcls_MainWindow _owner )
2026 _this.windowsearch = this;
2027 var child_1 = new Xcls_PropertyExpression54( _this );
2029 this.el = new Gtk.StringFilter( child_1.el );
2033 // set gobject values
2036 // user defined functions
2038 public class Xcls_PropertyExpression54 : Object
2040 public Gtk.PropertyExpression el;
2041 private Xcls_MainWindow _this;
2047 public Xcls_PropertyExpression54(Xcls_MainWindow _owner )
2050 this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2054 // set gobject values
2057 // user defined functions
2061 public class Xcls_winmodel : Object
2063 public GLib.ListStore el;
2064 private Xcls_MainWindow _this;
2070 public Xcls_winmodel(Xcls_MainWindow _owner )
2073 _this.winmodel = this;
2074 this.el = new GLib.ListStore( typeof(WindowState) );
2078 // set gobject values
2081 // user defined functions
2085 public class Xcls_StringSorter56 : Object
2087 public Gtk.StringSorter el;
2088 private Xcls_MainWindow _this;
2094 public Xcls_StringSorter56(Xcls_MainWindow _owner )
2097 var child_1 = new Xcls_PropertyExpression57( _this );
2099 this.el = new Gtk.StringSorter( child_1.el );
2103 // set gobject values
2104 this.el.ignore_case = true;
2107 // user defined functions
2109 public class Xcls_PropertyExpression57 : Object
2111 public Gtk.PropertyExpression el;
2112 private Xcls_MainWindow _this;
2118 public Xcls_PropertyExpression57(Xcls_MainWindow _owner )
2121 this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2125 // set gobject values
2128 // user defined functions
2134 public class Xcls_projcol : Object
2136 public Gtk.ColumnViewColumn el;
2137 private Xcls_MainWindow _this;
2143 public Xcls_projcol(Xcls_MainWindow _owner )
2146 _this.projcol = this;
2147 var child_1 = new Xcls_SignalListItemFactory59( _this );
2149 this.el = new Gtk.ColumnViewColumn( "Project", child_1.el );
2153 // set gobject values
2154 this.el.id = "projcol";
2155 this.el.expand = true;
2156 this.el.resizable = true;
2159 // user defined functions
2161 public class Xcls_SignalListItemFactory59 : Object
2163 public Gtk.SignalListItemFactory el;
2164 private Xcls_MainWindow _this;
2170 public Xcls_SignalListItemFactory59(Xcls_MainWindow _owner )
2173 this.el = new Gtk.SignalListItemFactory();
2177 // set gobject values
2180 this.el.setup.connect( (listitem) => {
2181 var lbl = new Gtk.Label("");
2182 (listitem as Gtk.ListItem).set_child(lbl);
2183 lbl.justify = Gtk.Justification.LEFT;
2185 lbl.use_markup = true;
2186 lbl.ellipsize = Pango.EllipsizeMode.START;
2188 (listitem as Gtk.ListItem).activatable = true;
2190 this.el.bind.connect( (listitem) => {
2191 var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();
2192 var item = (listitem as Gtk.ListItem).get_item() as WindowState;
2194 lb.label = item.project.name;
2202 // user defined functions
2206 public class Xcls_filecol : Object
2208 public Gtk.ColumnViewColumn el;
2209 private Xcls_MainWindow _this;
2215 public Xcls_filecol(Xcls_MainWindow _owner )
2218 _this.filecol = this;
2219 var child_1 = new Xcls_SignalListItemFactory61( _this );
2221 this.el = new Gtk.ColumnViewColumn( "File", child_1.el );
2225 // set gobject values
2226 this.el.id = "filecol";
2227 this.el.expand = true;
2228 this.el.resizable = true;
2231 // user defined functions
2233 public class Xcls_SignalListItemFactory61 : Object
2235 public Gtk.SignalListItemFactory el;
2236 private Xcls_MainWindow _this;
2242 public Xcls_SignalListItemFactory61(Xcls_MainWindow _owner )
2245 this.el = new Gtk.SignalListItemFactory();
2249 // set gobject values
2252 this.el.setup.connect( (listitem) => {
2253 var lbl = new Gtk.Label("");
2254 (listitem as Gtk.ListItem).set_child(lbl);
2255 lbl.justify = Gtk.Justification.LEFT;
2257 lbl.use_markup = true;
2258 lbl.ellipsize = Pango.EllipsizeMode.START;
2260 (listitem as Gtk.ListItem).activatable = true;
2262 this.el.bind.connect( (listitem) => {
2263 var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();
2264 var item = (listitem as Gtk.ListItem).get_item() as WindowState;
2266 lb.label = item.file.relpath;
2274 // user defined functions
2280 public class Xcls_treescroll : Object
2282 public Gtk.ScrolledWindow el;
2283 private Xcls_MainWindow _this;
2289 public Xcls_treescroll(Xcls_MainWindow _owner )
2292 _this.treescroll = this;
2293 this.el = new Gtk.ScrolledWindow();
2297 // set gobject values
2298 this.el.has_frame = true;
2299 this.el.hexpand = true;
2300 this.el.vexpand = true;
2301 this.el.tooltip_text = "dbl-click - opens in NEW window \nshift--dbl-click opens in this window";
2302 this.el.visible = false;
2303 new Xcls_treeview( _this );
2304 this.el.child = _this.treeview.el;
2307 // user defined functions
2309 public class Xcls_treeview : Object
2311 public Gtk.ColumnView el;
2312 private Xcls_MainWindow _this;
2318 public Xcls_treeview(Xcls_MainWindow _owner )
2321 _this.treeview = this;
2322 new Xcls_treeselmodel( _this );
2323 this.el = new Gtk.ColumnView( _this.treeselmodel.el );
2327 // set gobject values
2328 this.el.hexpand = true;
2329 this.el.vexpand = true;
2330 var child_2 = new Xcls_GestureClick64( _this );
2332 this.el.add_controller( child_2.el );
2333 new Xcls_name( _this );
2334 this.el.append_column ( _this.name.el );
2337 // user defined functions
2339 public class Xcls_GestureClick64 : Object
2341 public Gtk.GestureClick el;
2342 private Xcls_MainWindow _this;
2348 public Xcls_GestureClick64(Xcls_MainWindow _owner )
2351 this.el = new Gtk.GestureClick();
2355 // set gobject values
2358 this.el.pressed.connect( (n_press, x, y) => {
2360 GLib.debug("double cliced");
2364 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
2365 GLib.debug("SELECTED = %s", tr.item.get_type().name());
2366 var f = (JsRender.JsRender) tr.item;
2367 GLib.debug("Click %s", f.name);
2368 if (f.xtype == "Dir") {
2373 _this.windowstate.fileViewOpen(f,
2374 _this.keystate.is_shift != 1
2377 _this.splitview.el.show_sidebar = false;
2384 // user defined functions
2387 public class Xcls_treeselmodel : Object
2389 public Gtk.SingleSelection el;
2390 private Xcls_MainWindow _this;
2396 public Xcls_treeselmodel(Xcls_MainWindow _owner )
2399 _this.treeselmodel = this;
2400 var child_1 = new Xcls_FilterListModel66( _this );
2402 this.el = new Gtk.SingleSelection( child_1.el );
2406 // set gobject values
2407 this.el.can_unselect = true;
2408 this.el.autoselect = true;
2411 // user defined functions
2413 public class Xcls_FilterListModel66 : Object
2415 public Gtk.FilterListModel el;
2416 private Xcls_MainWindow _this;
2422 public Xcls_FilterListModel66(Xcls_MainWindow _owner )
2425 new Xcls_treelistsort( _this );
2426 new Xcls_treefilter( _this );
2427 this.el = new Gtk.FilterListModel( _this.treelistsort.el, _this.treefilter.el );
2431 // set gobject values
2434 // user defined functions
2436 public class Xcls_treelistsort : Object
2438 public Gtk.SortListModel el;
2439 private Xcls_MainWindow _this;
2445 public Xcls_treelistsort(Xcls_MainWindow _owner )
2448 _this.treelistsort = this;
2449 new Xcls_treelistmodel( _this );
2450 var child_2 = new Xcls_TreeListRowSorter70( _this );
2452 this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
2456 // set gobject values
2457 this.el.incremental = true;
2460 // user defined functions
2462 public class Xcls_treelistmodel : Object
2464 public Gtk.TreeListModel el;
2465 private Xcls_MainWindow _this;
2471 public Xcls_treelistmodel(Xcls_MainWindow _owner )
2474 _this.treelistmodel = this;
2475 new Xcls_treemodel( _this );
2476 this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
2477 //GLib.debug("liststore got %s", item.get_type().name());
2478 return ((JsRender.JsRender)item).childfiles;
2483 // set gobject values
2486 // user defined functions
2488 public class Xcls_treemodel : Object
2490 public GLib.ListStore el;
2491 private Xcls_MainWindow _this;
2497 public Xcls_treemodel(Xcls_MainWindow _owner )
2500 _this.treemodel = this;
2501 this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
2505 // set gobject values
2508 // user defined functions
2512 public class Xcls_TreeListRowSorter70 : Object
2514 public Gtk.TreeListRowSorter el;
2515 private Xcls_MainWindow _this;
2521 public Xcls_TreeListRowSorter70(Xcls_MainWindow _owner )
2524 var child_1 = new Xcls_StringSorter71( _this );
2526 this.el = new Gtk.TreeListRowSorter( child_1.el );
2530 // set gobject values
2533 // user defined functions
2535 public class Xcls_StringSorter71 : Object
2537 public Gtk.StringSorter el;
2538 private Xcls_MainWindow _this;
2544 public Xcls_StringSorter71(Xcls_MainWindow _owner )
2547 var child_1 = new Xcls_PropertyExpression72( _this );
2549 this.el = new Gtk.StringSorter( child_1.el );
2553 // set gobject values
2554 this.el.ignore_case = true;
2557 // user defined functions
2559 public class Xcls_PropertyExpression72 : Object
2561 public Gtk.PropertyExpression el;
2562 private Xcls_MainWindow _this;
2568 public Xcls_PropertyExpression72(Xcls_MainWindow _owner )
2571 this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender) , null, "name" );
2575 // set gobject values
2578 // user defined functions
2584 public class Xcls_treefilter : Object
2586 public Gtk.CustomFilter el;
2587 private Xcls_MainWindow _this;
2593 public Xcls_treefilter(Xcls_MainWindow _owner )
2596 _this.treefilter = this;
2597 this.el = new Gtk.CustomFilter( (item) => {
2598 var tr = ((Gtk.TreeListRow)item).get_item();
2599 //GLib.debug("filter %s", tr.get_type().name());
2600 var j = (JsRender.JsRender) tr;
2601 if (j.xtype == "Dir" && j.childfiles.n_items < 1) {
2604 var str = _this.filesearch.el.text.down();
2605 if (j.xtype == "Dir") {
2608 for (var i =0 ; i < j.childfiles.n_items; i++) {
2609 var f = (JsRender.JsRender) j.childfiles.get_item(i);
2610 //if (f.xtype != "PlainFile") {
2613 if (f.content_type.contains("image")) {
2616 if (str.length < 1) {
2619 if (f.name.down().contains(str)) {
2627 //if (j.xtype != "PlainFile") {
2630 if (j.content_type.contains("image")) {
2634 if (str.length < 1) { // no search.
2637 if (j.name.down().contains(str)) {
2646 // set gobject values
2649 // user defined functions
2654 public class Xcls_name : Object
2656 public Gtk.ColumnViewColumn el;
2657 private Xcls_MainWindow _this;
2663 public Xcls_name(Xcls_MainWindow _owner )
2667 var child_1 = new Xcls_SignalListItemFactory75( _this );
2669 this.el = new Gtk.ColumnViewColumn( "All Project Files", child_1.el );
2673 // set gobject values
2674 this.el.id = "name";
2675 this.el.expand = true;
2676 this.el.resizable = true;
2681 // this.el.set_sorter( new Gtk.StringSorter(
2682 // new Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, "name")
2688 // user defined functions
2690 public class Xcls_SignalListItemFactory75 : Object
2692 public Gtk.SignalListItemFactory el;
2693 private Xcls_MainWindow _this;
2699 public Xcls_SignalListItemFactory75(Xcls_MainWindow _owner )
2702 this.el = new Gtk.SignalListItemFactory();
2706 // set gobject values
2709 this.el.setup.connect( (listitem) => {
2711 var expand = new Gtk.TreeExpander();
2713 expand.set_indent_for_depth(true);
2714 expand.set_indent_for_icon(true);
2715 var hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);
2716 var icon = new Gtk.Image();
2717 icon.margin_end = 4;
2718 var lbl = new Gtk.Label("");
2719 lbl.use_markup = true;
2722 lbl.justify = Gtk.Justification.LEFT;
2727 expand.set_child(hbox);
2728 ((Gtk.ListItem)listitem).set_child(expand);
2729 ((Gtk.ListItem)listitem).activatable = false;
2731 this.el.bind.connect( (listitem) => {
2733 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
2737 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2738 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2740 var hbox = (Gtk.Box) expand.child;
2743 var img = (Gtk.Image) hbox.get_first_child();
2744 var lbl = (Gtk.Label) img.get_next_sibling();
2748 if (lbl == null || lbl.label != "") { // do not update
2751 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
2752 //GLib.debug("LR = %s", lr.get_type().name());
2755 var jr =(JsRender.JsRender) lr.get_item();
2756 //GLib.debug("JR = %s", jr.get_type().name());
2759 GLib.debug("Problem getting item");
2763 jr.bind_property("icon",
2765 GLib.BindingFlags.SYNC_CREATE);
2767 //GLib.debug("change %s to %s", lbl.label, np.name);
2768 lbl.label = jr.name; // for dir's we could hsow the sub path..
2769 lbl.tooltip_markup = jr.path;
2771 expand.set_hide_expander( jr.xtype != "Dir" );
2772 expand.set_list_row(lr);
2779 // user defined functions
2787 public class Xcls_keystate : Object
2789 public Gtk.EventControllerKey el;
2790 private Xcls_MainWindow _this;
2794 public int is_shift;
2797 public Xcls_keystate(Xcls_MainWindow _owner )
2800 _this.keystate = this;
2801 this.el = new Gtk.EventControllerKey();
2806 // set gobject values
2809 this.el.key_released.connect( (keyval, keycode, state) => {
2812 "key release %d, %d, %d ?= %d %d" ,
2813 (int) keyval, (int) keycode, state,
2814 (int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK
2816 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2819 //GLib.debug("set state %d , shift = %d", (int)this.el.get_current_event_state(), Gdk.ModifierType.SHIFT_MASK);
2820 if (keyval == Gdk.Key.o && (state & Gdk.ModifierType.CONTROL_MASK) != 0) {
2822 if (!_this.splitview.el.show_sidebar) {
2823 _this.sidebar.show();
2830 this.el.key_pressed.connect( (keyval, keycode, state) => {
2832 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2843 // user defined functions