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) {
94 this.windowstate.file.getLanguageServer().exit();
97 BuilderApplication.singleton( null ).quit();
102 this.el.show.connect( ( ) => {
103 // hide the file editing..
105 //this.hideViewEditing();
106 // this is updated by windowstate - we try and fill it in..
107 _this.statusbar.el.hide();
108 //_this.statusbar_errors.el.hide();
109 //_this.statusbar_warnings.el.hide();
110 //_this.statusbar_depricated.el.hide();
111 _this.statusbar_compile_spinner.el.hide();
113 Resources.singleton().checkResources();
118 this.el.hide.connect( () => {
125 // user defined functions
126 public void updateErrors () {
129 GLib.debug("updateErrors");
131 var pr = this.windowstate.project.getErrors("ERR");
133 this.statusbar_errors.setNotices(
135 this.windowstate.file.getErrorsTotal("ERR")
138 this.statusbar_warnings.setNotices(
139 this.windowstate.project.getErrors("WARN"),
140 this.windowstate.file.getErrorsTotal("WARN")
142 this.statusbar_depricated.setNotices(
143 this.windowstate.project.getErrors("DEPR"),
144 this.windowstate.file.getErrorsTotal("DEPR")
147 _this.statusbar_run.el.hide();
149 if (pr.get_n_items() < 1) {
150 _this.statusbar_run.el.show();
154 public void initChildren () {
155 // this needs putting in a better place..
156 if (this.windowstate == null) {
157 this.windowstate = new WindowState(this);
169 public void show () {
172 if (this.windowstate.file == null) {
173 this.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);
176 public void setTitle () {
177 if (_this.windowstate.project == null ||
178 _this.windowstate.file == null
180 this.el.set_title("Select File");
184 _this.windowstate.project.name +
186 _this.windowstate.file.relpath);
188 public void openNewWindow () {
190 var w = new Xcls_MainWindow();
192 BuilderApplication.addWindow(w);
195 w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);
198 public class Xcls_headerbar : Object
200 public Gtk.HeaderBar el;
201 private Xcls_MainWindow _this;
205 public bool show_close_button;
208 public Xcls_headerbar(Xcls_MainWindow _owner )
211 _this.headerbar = this;
212 this.el = new Gtk.HeaderBar();
215 this.show_close_button = true;
217 // set gobject values
218 var child_1 = new Xcls_Box2( _this );
220 this.el.pack_start ( child_1.el );
223 // user defined functions
225 public class Xcls_Box2 : Object
228 private Xcls_MainWindow _this;
234 public Xcls_Box2(Xcls_MainWindow _owner )
237 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
241 // set gobject values
242 var child_1 = new Xcls_Button3( _this );
244 this.el.append ( child_1.el );
245 var child_2 = new Xcls_Button5( _this );
247 this.el.append( child_2.el );
248 var child_3 = new Xcls_Button6( _this );
250 this.el.append( child_3.el );
253 // user defined functions
255 public class Xcls_Button3 : Object
257 public Gtk.Button el;
258 private Xcls_MainWindow _this;
264 public Xcls_Button3(Xcls_MainWindow _owner )
267 this.el = new Gtk.Button();
271 // set gobject values
272 this.el.has_frame = false;
273 this.el.tooltip_text = "Manage Windows (Ctrl-O)";
274 this.el.has_tooltip = true;
275 var child_1 = new Xcls_ButtonContent4( _this );
276 this.el.child = child_1.el;
279 this.el.clicked.connect( ( ) => {
280 _this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;
281 if (_this.splitview.el.show_sidebar) {
282 _this.sidebar.show();
287 // user defined functions
289 public class Xcls_ButtonContent4 : Object
291 public Adw.ButtonContent el;
292 private Xcls_MainWindow _this;
298 public Xcls_ButtonContent4(Xcls_MainWindow _owner )
301 this.el = new Adw.ButtonContent();
305 // set gobject values
306 this.el.icon_name = "preferences-system-windows";
307 this.el.label = " Files";
310 // user defined functions
314 public class Xcls_Button5 : Object
316 public Gtk.Button el;
317 private Xcls_MainWindow _this;
323 public Xcls_Button5(Xcls_MainWindow _owner )
326 this.el = new Gtk.Button();
330 // set gobject values
331 this.el.icon_name = "edit-undo";
332 this.el.has_frame = false;
335 this.el.clicked.connect( ( ) => {
337 GLib.debug("undo clicked");
338 if (_this.windowstate.file.xtype == "PlainFile") {
339 _this.windowstate.code_editor_tab.buffer.el.undo();
341 if (!_this.windowstate.file.undoStep(-1)) {
346 _this.windowstate.switchState (WindowState.State.PREVIEW);
347 // this triggers loadItems..
348 _this.windowstate.left_tree.model.loadFile(
349 _this.windowstate.file);
355 // load it everywhere
359 // user defined functions
362 public class Xcls_Button6 : Object
364 public Gtk.Button el;
365 private Xcls_MainWindow _this;
371 public Xcls_Button6(Xcls_MainWindow _owner )
374 this.el = new Gtk.Button();
378 // set gobject values
379 this.el.icon_name = "edit-redo";
380 this.el.has_frame = false;
383 this.el.clicked.connect( ( ) => {
385 GLib.debug("undo clicked");
386 if (_this.windowstate.file.xtype == "PlainFile") {
387 _this.windowstate.code_editor_tab.buffer.el.redo();
389 if (!_this.windowstate.file.undoStep(1)) {
394 _this.windowstate.switchState (WindowState.State.PREVIEW);
395 // this triggers loadItems..
396 _this.windowstate.left_tree.model.loadFile(
397 _this.windowstate.file);
403 // load it everywhere
407 // user defined functions
412 public class Xcls_splitview : Object
414 public Adw.OverlaySplitView el;
415 private Xcls_MainWindow _this;
421 public Xcls_splitview(Xcls_MainWindow _owner )
424 _this.splitview = this;
425 this.el = new Adw.OverlaySplitView();
429 // set gobject values
430 this.el.collapsed = true;
431 this.el.sidebar_width_fraction = 0.400000;
432 this.el.show_sidebar = false;
433 new Xcls_vbox( _this );
434 this.el.content = _this.vbox.el;
435 new Xcls_sidebar( _this );
436 this.el.sidebar = _this.sidebar.el;
437 new Xcls_keystate( _this );
438 this.el.add_controller( _this.keystate.el );
441 // user defined functions
443 public class Xcls_vbox : Object
446 private Xcls_MainWindow _this;
452 public Xcls_vbox(Xcls_MainWindow _owner )
456 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
460 // set gobject values
461 this.el.homogeneous = false;
462 this.el.hexpand = true;
463 this.el.vexpand = false;
464 new Xcls_mainpane( _this );
465 this.el.append( _this.mainpane.el );
466 var child_2 = new Xcls_Box17( _this );
468 this.el.append( child_2.el );
471 // user defined functions
473 public class Xcls_mainpane : Object
476 private Xcls_MainWindow _this;
480 public int lastWidth;
483 public Xcls_mainpane(Xcls_MainWindow _owner )
486 _this.mainpane = this;
487 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
492 // set gobject values
493 this.el.hexpand = true;
494 this.el.vexpand = true;
495 this.el.position = 400;
496 new Xcls_leftpane( _this );
497 this.el.start_child = _this.leftpane.el;
498 var child_2 = new Xcls_Box14( _this );
499 this.el.end_child = child_2.el;
502 this.el.accept_position.connect( ( ) => {
503 _this.windowstate.left_tree.onresize();
508 // user defined functions
510 public class Xcls_leftpane : Object
513 private Xcls_MainWindow _this;
519 public Xcls_leftpane(Xcls_MainWindow _owner )
522 _this.leftpane = this;
523 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
527 // set gobject values
528 this.el.hexpand = true;
529 this.el.vexpand = true;
530 new Xcls_editpane( _this );
531 this.el.append( _this.editpane.el );
534 // user defined functions
536 public class Xcls_editpane : Object
539 private Xcls_MainWindow _this;
545 public Xcls_editpane(Xcls_MainWindow _owner )
548 _this.editpane = this;
549 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
553 // set gobject values
554 new Xcls_tree( _this );
555 this.el.start_child = _this.tree.el;
556 new Xcls_props( _this );
557 this.el.end_child = _this.props.el;
560 this.el.accept_position.connect( ( ) => {
561 _this.windowstate.left_tree.onresize();
564 this.el.move_handle.connect( (scroll) => {
565 GLib.debug("Move handle");
570 // user defined functions
572 public class Xcls_tree : Object
575 private Xcls_MainWindow _this;
581 public Xcls_tree(Xcls_MainWindow _owner )
585 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
589 // set gobject values
590 this.el.hexpand = true;
591 this.el.vexpand = true;
594 // user defined functions
597 public class Xcls_props : Object
600 private Xcls_MainWindow _this;
606 public Xcls_props(Xcls_MainWindow _owner )
610 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
614 // set gobject values
615 this.el.hexpand = true;
616 this.el.vexpand = true;
619 // user defined functions
624 public class Xcls_Box14 : Object
627 private Xcls_MainWindow _this;
633 public Xcls_Box14(Xcls_MainWindow _owner )
636 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
640 // set gobject values
641 this.el.hexpand = true;
642 this.el.vexpand = true;
643 new Xcls_rooviewbox( _this );
644 this.el.append( _this.rooviewbox.el );
645 new Xcls_codeeditviewbox( _this );
646 this.el.append( _this.codeeditviewbox.el );
649 // user defined functions
651 public class Xcls_rooviewbox : Object
654 private Xcls_MainWindow _this;
660 public Xcls_rooviewbox(Xcls_MainWindow _owner )
663 _this.rooviewbox = this;
664 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
668 // set gobject values
669 this.el.hexpand = true;
670 this.el.vexpand = true;
673 // user defined functions
676 public class Xcls_codeeditviewbox : Object
679 private Xcls_MainWindow _this;
685 public Xcls_codeeditviewbox(Xcls_MainWindow _owner )
688 _this.codeeditviewbox = this;
689 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
693 // set gobject values
694 this.el.hexpand = true;
695 this.el.vexpand = true;
698 // user defined functions
703 public class Xcls_Box17 : Object
706 private Xcls_MainWindow _this;
712 public Xcls_Box17(Xcls_MainWindow _owner )
715 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
719 // set gobject values
720 this.el.homogeneous = false;
721 this.el.vexpand = false;
722 var child_1 = new Xcls_Button18( _this );
724 this.el.append( child_1.el );
725 var child_2 = new Xcls_Button19( _this );
727 this.el.append( child_2.el );
728 var child_3 = new Xcls_MenuButton20( _this );
730 this.el.append( child_3.el );
731 var child_4 = new Xcls_Label25( _this );
733 this.el.append( child_4.el );
734 new Xcls_statusbar( _this );
735 this.el.append( _this.statusbar.el );
736 var child_6 = new Xcls_Box27( _this );
738 this.el.append( child_6.el );
739 new Xcls_statusbar_compile_spinner( _this );
740 this.el.append( _this.statusbar_compile_spinner.el );
741 new Xcls_statusbar_compile_icon( _this );
742 this.el.append( _this.statusbar_compile_icon.el );
745 // user defined functions
747 public class Xcls_Button18 : Object
749 public Gtk.Button el;
750 private Xcls_MainWindow _this;
754 public bool always_show_image;
757 public Xcls_Button18(Xcls_MainWindow _owner )
760 this.el = new Gtk.Button();
763 this.always_show_image = true;
765 // set gobject values
766 this.el.icon_name = "emblem-system";
767 this.el.tooltip_text = "Project Details";
768 this.el.label = "Edit Project Settings";
771 this.el.clicked.connect( ( ) => {
773 _this.windowstate.projectPopoverShow(_this.el, null, null);
779 // user defined functions
782 public class Xcls_Button19 : Object
784 public Gtk.Button el;
785 private Xcls_MainWindow _this;
789 public bool always_show_image;
792 public Xcls_Button19(Xcls_MainWindow _owner )
795 this.el = new Gtk.Button();
798 this.always_show_image = true;
800 // set gobject values
801 this.el.icon_name = "document-properties";
802 this.el.tooltip_text = "File Details";
803 this.el.label = "Edit File Properties";
806 this.el.clicked.connect( ( ) => {
808 // create a new file in project..
809 if (_this.project == null || _this.windowstate.file == null) {
812 _this.windowstate.file_details.show(
813 _this.windowstate.file, _this.el, false
822 // user defined functions
825 public class Xcls_MenuButton20 : Object
827 public Gtk.MenuButton el;
828 private Xcls_MainWindow _this;
832 public bool always_show_image;
835 public Xcls_MenuButton20(Xcls_MainWindow _owner )
838 this.el = new Gtk.MenuButton();
841 this.always_show_image = true;
843 // set gobject values
844 this.el.icon_name = "dialog-information";
845 this.el.label = "About";
846 new Xcls_topbarmenu( _this );
847 this.el.popover = _this.topbarmenu.el;
850 // user defined functions
852 public class Xcls_topbarmenu : Object
854 public Gtk.PopoverMenu el;
855 private Xcls_MainWindow _this;
861 public Xcls_topbarmenu(Xcls_MainWindow _owner )
864 _this.topbarmenu = this;
865 this.el = new Gtk.PopoverMenu.from_model(null);
869 // set gobject values
870 var child_1 = new Xcls_Box22( _this );
872 this.el.set_child ( child_1.el );
881 // user defined functions
883 public class Xcls_Box22 : Object
886 private Xcls_MainWindow _this;
892 public Xcls_Box22(Xcls_MainWindow _owner )
895 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
899 // set gobject values
900 var child_1 = new Xcls_Button23( _this );
902 this.el.append( child_1.el );
903 var child_2 = new Xcls_Button24( _this );
905 this.el.append( child_2.el );
908 // user defined functions
910 public class Xcls_Button23 : Object
912 public Gtk.Button el;
913 private Xcls_MainWindow _this;
919 public Xcls_Button23(Xcls_MainWindow _owner )
922 this.el = new Gtk.Button();
926 // set gobject values
927 this.el.label = "Download updated Resources";
930 this.el.activate.connect( ( ) => {
931 Resources.singleton().fetchStart();
935 // user defined functions
938 public class Xcls_Button24 : Object
940 public Gtk.Button el;
941 private Xcls_MainWindow _this;
947 public Xcls_Button24(Xcls_MainWindow _owner )
950 this.el = new Gtk.Button();
954 // set gobject values
955 this.el.label = "About the Builder";
958 this.el.clicked.connect( () => {
959 About.singleton().el.show();
963 // user defined functions
969 public class Xcls_Label25 : Object
972 private Xcls_MainWindow _this;
978 public Xcls_Label25(Xcls_MainWindow _owner )
981 this.el = new Gtk.Label( " " );
985 // set gobject values
986 this.el.hexpand = true;
989 // user defined functions
992 public class Xcls_statusbar : Object
994 public Gtk.ProgressBar el;
995 private Xcls_MainWindow _this;
999 public ulong handler_id;
1002 public Xcls_statusbar(Xcls_MainWindow _owner )
1005 _this.statusbar = this;
1006 this.el = new Gtk.ProgressBar();
1009 this.handler_id = -1;
1011 // set gobject values
1012 this.el.show_text = true;
1017 this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
1020 _this.mainpane.el.set_sensitive(true);
1024 _this.mainpane.el.set_sensitive(false);
1026 this.el.set_fraction ((1.0f * pos) / (1.0f * total));
1027 this.el.set_text("Fetching Resource : %s/%s".printf(pos.to_string(), total.to_string()));
1033 // user defined functions
1036 public class Xcls_Box27 : Object
1039 private Xcls_MainWindow _this;
1045 public Xcls_Box27(Xcls_MainWindow _owner )
1048 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1052 // set gobject values
1053 new Xcls_statusbar_compilestatus_label( _this );
1054 this.el.append( _this.statusbar_compilestatus_label.el );
1055 new Xcls_statusbar_errors( _this );
1056 this.el.append( _this.statusbar_errors.el );
1057 new Xcls_statusbar_warnings( _this );
1058 this.el.append( _this.statusbar_warnings.el );
1059 new Xcls_statusbar_depricated( _this );
1060 this.el.append( _this.statusbar_depricated.el );
1061 new Xcls_statusbar_run( _this );
1062 this.el.append( _this.statusbar_run.el );
1065 // user defined functions
1067 public class Xcls_statusbar_compilestatus_label : Object
1069 public Gtk.Label el;
1070 private Xcls_MainWindow _this;
1076 public Xcls_statusbar_compilestatus_label(Xcls_MainWindow _owner )
1079 _this.statusbar_compilestatus_label = this;
1080 this.el = new Gtk.Label( "Compile Status:" );
1084 // set gobject values
1085 this.el.margin_end = 4;
1086 this.el.margin_start = 4;
1089 // user defined functions
1092 public class Xcls_statusbar_errors : Object
1094 public Gtk.Button el;
1095 private Xcls_MainWindow _this;
1099 public Xcls_ValaCompileErrors popup;
1102 public Xcls_statusbar_errors(Xcls_MainWindow _owner )
1105 _this.statusbar_errors = this;
1106 this.el = new Gtk.Button();
1110 // set gobject values
1111 this.el.icon_name = "dialog-error";
1112 this.el.label = "0 Errors";
1115 this.el.clicked.connect( () => {
1117 if (this.popup == null) {
1126 // user defined functions
1127 public void setNotices (GLib.ListStore nots, int ferrors ) {
1128 BuilderApplication.showSpinner("");
1129 if (nots.get_n_items() < 1 ) {
1131 if (this.popup != null) {
1132 this.popup.el.hide();
1138 this.el.label = "%d/%d Errors".printf(ferrors,(int)nots.get_n_items());
1142 if (this.popup == null) {
1143 this.popup = new Xcls_ValaCompileErrors();
1144 this.popup.window = _this;
1145 // this.popup.el.set_transient_for( _this.el );
1146 this.popup.el.set_parent(this.el);
1149 this.popup.updateNotices(nots);
1154 public class Xcls_statusbar_warnings : Object
1156 public Gtk.Button el;
1157 private Xcls_MainWindow _this;
1161 public Xcls_ValaCompileErrors popup;
1164 public Xcls_statusbar_warnings(Xcls_MainWindow _owner )
1167 _this.statusbar_warnings = this;
1168 this.el = new Gtk.Button();
1172 // set gobject values
1173 this.el.icon_name = "dialog-warning";
1174 this.el.label = "0 Warnings";
1177 this.el.clicked.connect( () => {
1179 if (this.popup == null) {
1188 // user defined functions
1189 public void setNotices (GLib.ListStore nots, int ferrs ) {
1191 if (nots.get_n_items() < 1 ) {
1193 if (this.popup != null) {
1194 this.popup.el.hide();
1200 this.el.label = "%d/%d Warnings".printf(ferrs,(int)nots.get_n_items());
1204 if (this.popup == null) {
1205 this.popup = new Xcls_ValaCompileErrors();
1206 this.popup.window = _this;
1207 // this.popup.el.set_transient_for( _this.el );
1208 this.popup.el.set_parent(this.el);
1210 this.popup.updateNotices(nots);
1215 public class Xcls_statusbar_depricated : Object
1217 public Gtk.Button el;
1218 private Xcls_MainWindow _this;
1222 public Xcls_ValaCompileErrors popup;
1223 public GLib.ListStore notices;
1226 public Xcls_statusbar_depricated(Xcls_MainWindow _owner )
1229 _this.statusbar_depricated = this;
1230 this.el = new Gtk.Button();
1233 this.notices = null;
1235 // set gobject values
1236 this.el.icon_name = "dialog-information";
1237 this.el.label = "0 Depricated";
1240 this.el.clicked.connect( () => {
1242 if (this.popup == null) {
1251 // user defined functions
1252 public void setNotices (GLib.ListStore nots, int ferrs ) {
1254 if (nots.get_n_items() < 1 ) {
1256 if (this.popup != null) {
1257 this.popup.el.hide();
1263 this.el.label = "%d/%d Depricated".printf(ferrs,(int)nots.get_n_items());
1267 if (this.popup == null) {
1268 this.popup = new Xcls_ValaCompileErrors();
1269 this.popup.window = _this;
1270 // this.popup.el.set_transient_for( _this.el );
1271 this.popup.el.set_parent(this.el);
1273 this.popup.updateNotices(nots);
1278 public class Xcls_statusbar_run : Object
1280 public Gtk.Button el;
1281 private Xcls_MainWindow _this;
1285 public Xcls_ValaCompileErrors popup;
1286 public Palete.ValaCompileRequest? last_request;
1289 public Xcls_statusbar_run(Xcls_MainWindow _owner )
1292 _this.statusbar_run = this;
1293 this.el = new Gtk.Button();
1296 this.last_request = null;
1298 // set gobject values
1299 this.el.icon_name = "media-playback-start";
1300 this.el.label = "Run";
1301 this.el.visible = false;
1304 this.el.clicked.connect( () => {
1306 if (_this.windowstate.file == null) {
1309 if (_this.statusbar_compile_spinner.el.spinning) {
1310 _this.windowstate.compile_results.el.set_parent(this.el);
1311 _this.windowstate.compile_results.el.show(); // show currently running.
1315 if (this.last_request != null) {
1316 this.last_request.cancel();
1317 if (this.last_request.terminal_pid > 0) {
1318 this.last_request.killChildren(this.last_request.terminal_pid);
1321 var pr = _this.windowstate.project as Project.Gtk;
1327 this.last_request= new Palete.ValaCompileRequest(
1329 pr.firstBuildModuleWith(_this.windowstate.file)
1331 this.last_request.onOutput.connect( ( str) => {
1332 _this.windowstate.compile_results.addLine(str);
1334 this.last_request.run.begin( ( a, r) => {
1335 this.last_request.run.end(r);
1337 if (_this.windowstate.compile_results.el.parent == null) {
1338 _this.windowstate.compile_results.el.set_parent(this.el);
1340 _this.windowstate.compile_results.show(this.el,true);
1345 // user defined functions
1349 public class Xcls_statusbar_compile_spinner : Object
1351 public Gtk.Spinner el;
1352 private Xcls_MainWindow _this;
1358 public Xcls_statusbar_compile_spinner(Xcls_MainWindow _owner )
1361 _this.statusbar_compile_spinner = this;
1362 this.el = new Gtk.Spinner();
1366 // set gobject values
1367 this.el.margin_end = 4;
1368 this.el.margin_start = 4;
1369 this.el.tooltip_text = "Compiling";
1372 // user defined functions
1373 public void start (string icon, string tooltip) {
1375 if (icon == "spinner") {
1378 this.el.tooltip_text = tooltip;
1379 _this.statusbar_compile_icon.el.hide();
1382 // GLib.debug("set status icon %s, %s", icon, tooltip);
1383 _this.statusbar_compile_icon.el.tooltip_text = tooltip;
1384 _this.statusbar_compile_icon.el.icon_name = icon;
1385 _this.statusbar_compile_icon.el.show();
1390 public void stop () {
1393 _this.statusbar_compile_icon.el.hide();
1397 public class Xcls_statusbar_compile_icon : Object
1399 public Gtk.Image el;
1400 private Xcls_MainWindow _this;
1406 public Xcls_statusbar_compile_icon(Xcls_MainWindow _owner )
1409 _this.statusbar_compile_icon = this;
1410 this.el = new Gtk.Image();
1414 // set gobject values
1415 this.el.margin_end = 4;
1416 this.el.margin_start = 4;
1417 this.el.icon_size = Gtk.IconSize.NORMAL;
1420 // user defined functions
1425 public class Xcls_sidebar : Object
1428 private Xcls_MainWindow _this;
1434 public Xcls_sidebar(Xcls_MainWindow _owner )
1437 _this.sidebar = this;
1438 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1442 // set gobject values
1443 new Xcls_filesearch( _this );
1444 this.el.append( _this.filesearch.el );
1445 var child_2 = new Xcls_Box38( _this );
1447 this.el.append( child_2.el );
1448 var child_3 = new Xcls_Paned47( _this );
1450 this.el.append( child_3.el );
1453 // user defined functions
1454 public void show () {
1455 _this.splitview.el.show_sidebar = true;
1457 _this.filesearch.el.grab_focus();
1458 _this.winloading = true;
1459 _this.winmodel.el.remove_all();
1460 _this.filesearch.el.set_text("");
1461 for(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {
1462 _this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));
1464 _this.winsel.selectCurrent();
1465 _this.winloading = false;
1467 _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1469 _this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);
1471 _this.treeview.el.set_model(_this.treeselmodel.el);
1473 _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;
1477 public class Xcls_filesearch : Object
1479 public Gtk.SearchEntry el;
1480 private Xcls_MainWindow _this;
1486 public Xcls_filesearch(Xcls_MainWindow _owner )
1489 _this.filesearch = this;
1490 this.el = new Gtk.SearchEntry();
1494 // set gobject values
1495 this.el.hexpand = true;
1496 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 ";
1497 this.el.has_tooltip = true;
1498 this.el.placeholder_text = "Search for file";
1499 var child_1 = new Xcls_EventControllerKey37( _this );
1501 this.el.add_controller( child_1.el );
1504 this.el.search_changed.connect( ( ) => {
1506 _this.windowsearch.el.set_search(this.el.get_text());
1507 if (this.el.text == "") {
1508 _this.treescroll.el.visible = false;
1511 _this.treescroll.el.visible = true;
1512 _this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);
1516 // user defined functions
1518 public class Xcls_EventControllerKey37 : Object
1520 public Gtk.EventControllerKey el;
1521 private Xcls_MainWindow _this;
1527 public Xcls_EventControllerKey37(Xcls_MainWindow _owner )
1530 this.el = new Gtk.EventControllerKey();
1534 // set gobject values
1537 this.el.key_released.connect( (keyval, keycode, state) => {
1538 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1542 // "searcj key release %d, %d, %d ?= %d" ,
1543 // (int) keyval, (int) keycode, state,
1544 // (int)Gdk.Key.Return
1546 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1552 if (keyval == Gdk.Key.Return) {
1553 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
1554 GLib.debug("SELECTED = %s", tr.item.get_type().name());
1555 var f = (JsRender.JsRender) tr.item;
1556 GLib.debug("Click %s", f.name);
1557 if (f.xtype == "Dir") {
1562 _this.windowstate.fileViewOpen(f,
1563 _this.keystate.is_shift != 1
1566 _this.splitview.el.show_sidebar = false;
1571 if (keyval == Gdk.Key.Up) {
1573 }if (keyval == Gdk.Key.Down) {
1579 var ns = _this.treeselmodel.el.selected + dir;
1583 if (ns >= _this.treeselmodel.el.get_n_items()) {
1584 ns = _this.treeselmodel.el.get_n_items()-1;
1586 _this.treeselmodel.el.selected = ns;
1590 // user defined functions
1594 public class Xcls_Box38 : Object
1597 private Xcls_MainWindow _this;
1603 public Xcls_Box38(Xcls_MainWindow _owner )
1606 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1610 // set gobject values
1611 this.el.hexpand = true;
1612 new Xcls_open_projects_btn( _this );
1613 this.el.append( _this.open_projects_btn.el );
1614 var child_2 = new Xcls_Button43( _this );
1616 this.el.append( child_2.el );
1619 // user defined functions
1621 public class Xcls_open_projects_btn : Object
1623 public Gtk.Button el;
1624 private Xcls_MainWindow _this;
1630 public Xcls_open_projects_btn(Xcls_MainWindow _owner )
1633 _this.open_projects_btn = this;
1634 this.el = new Gtk.Button();
1638 // set gobject values
1639 this.el.hexpand = true;
1640 var child_1 = new Xcls_Box40( _this );
1641 this.el.child = child_1.el;
1644 this.el.clicked.connect( ( ) => {
1645 _this.splitview.el.show_sidebar = false;
1646 _this.windowstate.showPopoverFiles(this.el, _this.project, false);
1650 // user defined functions
1652 public class Xcls_Box40 : Object
1655 private Xcls_MainWindow _this;
1661 public Xcls_Box40(Xcls_MainWindow _owner )
1664 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1668 // set gobject values
1669 var child_1 = new Xcls_Image41( _this );
1671 this.el.append( child_1.el );
1672 var child_2 = new Xcls_Label42( _this );
1674 this.el.append( child_2.el );
1677 // user defined functions
1679 public class Xcls_Image41 : Object
1681 public Gtk.Image el;
1682 private Xcls_MainWindow _this;
1688 public Xcls_Image41(Xcls_MainWindow _owner )
1691 this.el = new Gtk.Image();
1695 // set gobject values
1696 this.el.icon_name = "document-open";
1697 this.el.margin_end = 4;
1700 // user defined functions
1703 public class Xcls_Label42 : Object
1705 public Gtk.Label el;
1706 private Xcls_MainWindow _this;
1712 public Xcls_Label42(Xcls_MainWindow _owner )
1715 this.el = new Gtk.Label( "Open File" );
1719 // set gobject values
1722 // user defined functions
1727 public class Xcls_Button43 : Object
1729 public Gtk.Button el;
1730 private Xcls_MainWindow _this;
1736 public Xcls_Button43(Xcls_MainWindow _owner )
1739 this.el = new Gtk.Button();
1743 // set gobject values
1744 this.el.hexpand = true;
1745 var child_1 = new Xcls_Box44( _this );
1746 this.el.child = child_1.el;
1749 this.el.clicked.connect( ( ) => {
1750 _this.splitview.el.show_sidebar = false;
1751 _this.windowstate.showPopoverFiles(_this.el, _this.project, true);
1755 // user defined functions
1757 public class Xcls_Box44 : Object
1760 private Xcls_MainWindow _this;
1766 public Xcls_Box44(Xcls_MainWindow _owner )
1769 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1773 // set gobject values
1774 var child_1 = new Xcls_Image45( _this );
1776 this.el.append( child_1.el );
1777 var child_2 = new Xcls_Label46( _this );
1779 this.el.append( child_2.el );
1782 // user defined functions
1784 public class Xcls_Image45 : Object
1786 public Gtk.Image el;
1787 private Xcls_MainWindow _this;
1793 public Xcls_Image45(Xcls_MainWindow _owner )
1796 this.el = new Gtk.Image();
1800 // set gobject values
1801 this.el.icon_name = "window-new";
1802 this.el.margin_end = 4;
1805 // user defined functions
1808 public class Xcls_Label46 : Object
1810 public Gtk.Label el;
1811 private Xcls_MainWindow _this;
1817 public Xcls_Label46(Xcls_MainWindow _owner )
1820 this.el = new Gtk.Label( "New Window" );
1824 // set gobject values
1827 // user defined functions
1833 public class Xcls_Paned47 : Object
1835 public Gtk.Paned el;
1836 private Xcls_MainWindow _this;
1842 public Xcls_Paned47(Xcls_MainWindow _owner )
1845 this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL );
1849 // set gobject values
1850 this.el.vexpand = true;
1851 var child_1 = new Xcls_ScrolledWindow48( _this );
1852 this.el.start_child = child_1.el;
1853 new Xcls_treescroll( _this );
1854 this.el.end_child = _this.treescroll.el;
1857 // user defined functions
1859 public class Xcls_ScrolledWindow48 : Object
1861 public Gtk.ScrolledWindow el;
1862 private Xcls_MainWindow _this;
1868 public Xcls_ScrolledWindow48(Xcls_MainWindow _owner )
1871 this.el = new Gtk.ScrolledWindow();
1875 // set gobject values
1876 this.el.has_frame = true;
1877 var child_1 = new Xcls_ColumnView49( _this );
1878 this.el.child = child_1.el;
1881 // user defined functions
1883 public class Xcls_ColumnView49 : Object
1885 public Gtk.ColumnView el;
1886 private Xcls_MainWindow _this;
1892 public Xcls_ColumnView49(Xcls_MainWindow _owner )
1895 new Xcls_winsel( _this );
1896 this.el = new Gtk.ColumnView( _this.winsel.el );
1900 // set gobject values
1901 new Xcls_projcol( _this );
1902 this.el.append_column( _this.projcol.el );
1903 new Xcls_filecol( _this );
1904 this.el.append_column ( _this.filecol.el );
1907 // user defined functions
1909 public class Xcls_winsel : Object
1911 public Gtk.SingleSelection el;
1912 private Xcls_MainWindow _this;
1916 public bool selecting;
1919 public Xcls_winsel(Xcls_MainWindow _owner )
1922 _this.winsel = this;
1923 var child_1 = new Xcls_SortListModel51( _this );
1925 this.el = new Gtk.SingleSelection( child_1.el );
1928 this.selecting = false;
1930 // set gobject values
1931 this.el.can_unselect = false;
1932 this.el.autoselect = false;
1935 this.el.notify["selected"].connect( () => {
1936 if (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {
1939 var ws = this.el.selected_item as WindowState;
1943 if (ws.file.path != _this.windowstate.file.path) {
1944 _this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window, -1);
1945 _this.splitview.el.show_sidebar = false;
1948 this.selectCurrent();
1952 // user defined functions
1953 public void selectCurrent () {
1954 this.selecting = true;
1956 for(var i = 0;i < this.el.get_n_items(); i++) {
1957 var ws = this.el.get_item(i) as WindowState;
1958 if (ws.file.path == _this.windowstate.file.path) {
1959 this.el.selected = i;
1963 this.selecting = false;
1968 public class Xcls_SortListModel51 : Object
1970 public Gtk.SortListModel el;
1971 private Xcls_MainWindow _this;
1977 public Xcls_SortListModel51(Xcls_MainWindow _owner )
1980 new Xcls_winfilter( _this );
1981 var child_2 = new Xcls_StringSorter56( _this );
1983 this.el = new Gtk.SortListModel( _this.winfilter.el, child_2.el );
1987 // set gobject values
1990 // user defined functions
1992 public class Xcls_winfilter : Object
1994 public Gtk.FilterListModel el;
1995 private Xcls_MainWindow _this;
2001 public Xcls_winfilter(Xcls_MainWindow _owner )
2004 _this.winfilter = this;
2005 new Xcls_winmodel( _this );
2006 new Xcls_windowsearch( _this );
2007 this.el = new Gtk.FilterListModel( _this.winmodel.el, _this.windowsearch.el );
2011 // set gobject values
2014 // user defined functions
2016 public class Xcls_windowsearch : Object
2018 public Gtk.StringFilter el;
2019 private Xcls_MainWindow _this;
2025 public Xcls_windowsearch(Xcls_MainWindow _owner )
2028 _this.windowsearch = this;
2029 var child_1 = new Xcls_PropertyExpression54( _this );
2031 this.el = new Gtk.StringFilter( child_1.el );
2035 // set gobject values
2038 // user defined functions
2040 public class Xcls_PropertyExpression54 : Object
2042 public Gtk.PropertyExpression el;
2043 private Xcls_MainWindow _this;
2049 public Xcls_PropertyExpression54(Xcls_MainWindow _owner )
2052 this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2056 // set gobject values
2059 // user defined functions
2063 public class Xcls_winmodel : Object
2065 public GLib.ListStore el;
2066 private Xcls_MainWindow _this;
2072 public Xcls_winmodel(Xcls_MainWindow _owner )
2075 _this.winmodel = this;
2076 this.el = new GLib.ListStore( typeof(WindowState) );
2080 // set gobject values
2083 // user defined functions
2087 public class Xcls_StringSorter56 : Object
2089 public Gtk.StringSorter el;
2090 private Xcls_MainWindow _this;
2096 public Xcls_StringSorter56(Xcls_MainWindow _owner )
2099 var child_1 = new Xcls_PropertyExpression57( _this );
2101 this.el = new Gtk.StringSorter( child_1.el );
2105 // set gobject values
2106 this.el.ignore_case = true;
2109 // user defined functions
2111 public class Xcls_PropertyExpression57 : Object
2113 public Gtk.PropertyExpression el;
2114 private Xcls_MainWindow _this;
2120 public Xcls_PropertyExpression57(Xcls_MainWindow _owner )
2123 this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2127 // set gobject values
2130 // user defined functions
2136 public class Xcls_projcol : Object
2138 public Gtk.ColumnViewColumn el;
2139 private Xcls_MainWindow _this;
2145 public Xcls_projcol(Xcls_MainWindow _owner )
2148 _this.projcol = this;
2149 var child_1 = new Xcls_SignalListItemFactory59( _this );
2151 this.el = new Gtk.ColumnViewColumn( "Project", child_1.el );
2155 // set gobject values
2156 this.el.id = "projcol";
2157 this.el.expand = true;
2158 this.el.resizable = true;
2161 // user defined functions
2163 public class Xcls_SignalListItemFactory59 : Object
2165 public Gtk.SignalListItemFactory el;
2166 private Xcls_MainWindow _this;
2172 public Xcls_SignalListItemFactory59(Xcls_MainWindow _owner )
2175 this.el = new Gtk.SignalListItemFactory();
2179 // set gobject values
2182 this.el.setup.connect( (listitem) => {
2184 var li = (listitem as Gtk.ListItem);
2189 var lbl = new Gtk.Label("");
2191 lbl.justify = Gtk.Justification.LEFT;
2193 lbl.use_markup = true;
2194 lbl.ellipsize = Pango.EllipsizeMode.START;
2196 li.activatable = true;
2198 this.el.bind.connect( (listitem) => {
2199 var li = (listitem as Gtk.ListItem);
2203 var lb = (Gtk.Label) li.get_child() as Gtk.Label;
2207 var item = li.get_item() as WindowState;
2211 lb.label = item.project.name;
2219 // user defined functions
2223 public class Xcls_filecol : Object
2225 public Gtk.ColumnViewColumn el;
2226 private Xcls_MainWindow _this;
2232 public Xcls_filecol(Xcls_MainWindow _owner )
2235 _this.filecol = this;
2236 var child_1 = new Xcls_SignalListItemFactory61( _this );
2238 this.el = new Gtk.ColumnViewColumn( "File", child_1.el );
2242 // set gobject values
2243 this.el.id = "filecol";
2244 this.el.expand = true;
2245 this.el.resizable = true;
2248 // user defined functions
2250 public class Xcls_SignalListItemFactory61 : Object
2252 public Gtk.SignalListItemFactory el;
2253 private Xcls_MainWindow _this;
2259 public Xcls_SignalListItemFactory61(Xcls_MainWindow _owner )
2262 this.el = new Gtk.SignalListItemFactory();
2266 // set gobject values
2269 this.el.setup.connect( (listitem) => {
2270 var li = (listitem as Gtk.ListItem);
2274 var lbl = new Gtk.Label("");
2276 lbl.justify = Gtk.Justification.LEFT;
2278 lbl.use_markup = true;
2279 lbl.ellipsize = Pango.EllipsizeMode.START;
2281 li.activatable = true;
2283 this.el.bind.connect( (listitem) => {
2284 var li = (listitem as Gtk.ListItem);
2288 var lb = (Gtk.Label) li.get_child() as Gtk.Label;
2292 var item = li.get_item() as WindowState;
2299 lb.label = item.file.relpath;
2307 // user defined functions
2313 public class Xcls_treescroll : Object
2315 public Gtk.ScrolledWindow el;
2316 private Xcls_MainWindow _this;
2322 public Xcls_treescroll(Xcls_MainWindow _owner )
2325 _this.treescroll = this;
2326 this.el = new Gtk.ScrolledWindow();
2330 // set gobject values
2331 this.el.has_frame = true;
2332 this.el.hexpand = true;
2333 this.el.vexpand = true;
2334 this.el.tooltip_text = "dbl-click - opens in NEW window \nshift--dbl-click opens in this window";
2335 this.el.visible = false;
2336 new Xcls_treeview( _this );
2337 this.el.child = _this.treeview.el;
2340 // user defined functions
2342 public class Xcls_treeview : Object
2344 public Gtk.ColumnView el;
2345 private Xcls_MainWindow _this;
2351 public Xcls_treeview(Xcls_MainWindow _owner )
2354 _this.treeview = this;
2355 new Xcls_treeselmodel( _this );
2356 this.el = new Gtk.ColumnView( _this.treeselmodel.el );
2360 // set gobject values
2361 this.el.hexpand = true;
2362 this.el.vexpand = true;
2363 var child_2 = new Xcls_GestureClick64( _this );
2365 this.el.add_controller( child_2.el );
2366 new Xcls_name( _this );
2367 this.el.append_column ( _this.name.el );
2370 // user defined functions
2372 public class Xcls_GestureClick64 : Object
2374 public Gtk.GestureClick el;
2375 private Xcls_MainWindow _this;
2381 public Xcls_GestureClick64(Xcls_MainWindow _owner )
2384 this.el = new Gtk.GestureClick();
2388 // set gobject values
2391 this.el.pressed.connect( (n_press, x, y) => {
2393 GLib.debug("double cliced");
2397 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
2398 GLib.debug("SELECTED = %s", tr.item.get_type().name());
2399 var f = (JsRender.JsRender) tr.item;
2400 GLib.debug("Click %s", f.name);
2401 if (f.xtype == "Dir") {
2406 _this.windowstate.fileViewOpen(f,
2407 _this.keystate.is_shift != 1
2410 _this.splitview.el.show_sidebar = false;
2417 // user defined functions
2420 public class Xcls_treeselmodel : Object
2422 public Gtk.SingleSelection el;
2423 private Xcls_MainWindow _this;
2429 public Xcls_treeselmodel(Xcls_MainWindow _owner )
2432 _this.treeselmodel = this;
2433 var child_1 = new Xcls_FilterListModel66( _this );
2435 this.el = new Gtk.SingleSelection( child_1.el );
2439 // set gobject values
2440 this.el.can_unselect = true;
2441 this.el.autoselect = true;
2444 // user defined functions
2446 public class Xcls_FilterListModel66 : Object
2448 public Gtk.FilterListModel el;
2449 private Xcls_MainWindow _this;
2455 public Xcls_FilterListModel66(Xcls_MainWindow _owner )
2458 new Xcls_treelistsort( _this );
2459 new Xcls_treefilter( _this );
2460 this.el = new Gtk.FilterListModel( _this.treelistsort.el, _this.treefilter.el );
2464 // set gobject values
2467 // user defined functions
2469 public class Xcls_treelistsort : Object
2471 public Gtk.SortListModel el;
2472 private Xcls_MainWindow _this;
2478 public Xcls_treelistsort(Xcls_MainWindow _owner )
2481 _this.treelistsort = this;
2482 new Xcls_treelistmodel( _this );
2483 var child_2 = new Xcls_TreeListRowSorter70( _this );
2485 this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
2489 // set gobject values
2490 this.el.incremental = true;
2493 // user defined functions
2495 public class Xcls_treelistmodel : Object
2497 public Gtk.TreeListModel el;
2498 private Xcls_MainWindow _this;
2504 public Xcls_treelistmodel(Xcls_MainWindow _owner )
2507 _this.treelistmodel = this;
2508 new Xcls_treemodel( _this );
2509 this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
2510 //GLib.debug("liststore got %s", item.get_type().name());
2511 return ((JsRender.JsRender)item).childfiles;
2516 // set gobject values
2519 // user defined functions
2521 public class Xcls_treemodel : Object
2523 public GLib.ListStore el;
2524 private Xcls_MainWindow _this;
2530 public Xcls_treemodel(Xcls_MainWindow _owner )
2533 _this.treemodel = this;
2534 this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
2538 // set gobject values
2541 // user defined functions
2545 public class Xcls_TreeListRowSorter70 : Object
2547 public Gtk.TreeListRowSorter el;
2548 private Xcls_MainWindow _this;
2554 public Xcls_TreeListRowSorter70(Xcls_MainWindow _owner )
2557 var child_1 = new Xcls_StringSorter71( _this );
2559 this.el = new Gtk.TreeListRowSorter( child_1.el );
2563 // set gobject values
2566 // user defined functions
2568 public class Xcls_StringSorter71 : Object
2570 public Gtk.StringSorter el;
2571 private Xcls_MainWindow _this;
2577 public Xcls_StringSorter71(Xcls_MainWindow _owner )
2580 var child_1 = new Xcls_PropertyExpression72( _this );
2582 this.el = new Gtk.StringSorter( child_1.el );
2586 // set gobject values
2587 this.el.ignore_case = true;
2590 // user defined functions
2592 public class Xcls_PropertyExpression72 : Object
2594 public Gtk.PropertyExpression el;
2595 private Xcls_MainWindow _this;
2601 public Xcls_PropertyExpression72(Xcls_MainWindow _owner )
2604 this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender) , null, "name" );
2608 // set gobject values
2611 // user defined functions
2617 public class Xcls_treefilter : Object
2619 public Gtk.CustomFilter el;
2620 private Xcls_MainWindow _this;
2626 public Xcls_treefilter(Xcls_MainWindow _owner )
2629 _this.treefilter = this;
2630 this.el = new Gtk.CustomFilter( (item) => {
2631 var tr = ((Gtk.TreeListRow)item).get_item();
2632 //GLib.debug("filter %s", tr.get_type().name());
2633 var j = (JsRender.JsRender) tr;
2634 if (j.xtype == "Dir" && j.childfiles.n_items < 1) {
2637 var str = _this.filesearch.el.text.down();
2638 if (j.xtype == "Dir") {
2641 for (var i =0 ; i < j.childfiles.n_items; i++) {
2642 var f = (JsRender.JsRender) j.childfiles.get_item(i);
2643 //if (f.xtype != "PlainFile") {
2646 if (f.content_type.contains("image")) {
2649 if (str.length < 1) {
2652 if (f.name.down().contains(str)) {
2660 //if (j.xtype != "PlainFile") {
2663 if (j.content_type.contains("image")) {
2667 if (str.length < 1) { // no search.
2670 if (j.name.down().contains(str)) {
2679 // set gobject values
2682 // user defined functions
2687 public class Xcls_name : Object
2689 public Gtk.ColumnViewColumn el;
2690 private Xcls_MainWindow _this;
2696 public Xcls_name(Xcls_MainWindow _owner )
2700 var child_1 = new Xcls_SignalListItemFactory75( _this );
2702 this.el = new Gtk.ColumnViewColumn( "All Project Files", child_1.el );
2706 // set gobject values
2707 this.el.id = "name";
2708 this.el.expand = true;
2709 this.el.resizable = true;
2714 // this.el.set_sorter( new Gtk.StringSorter(
2715 // new Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, "name")
2721 // user defined functions
2723 public class Xcls_SignalListItemFactory75 : Object
2725 public Gtk.SignalListItemFactory el;
2726 private Xcls_MainWindow _this;
2732 public Xcls_SignalListItemFactory75(Xcls_MainWindow _owner )
2735 this.el = new Gtk.SignalListItemFactory();
2739 // set gobject values
2742 this.el.setup.connect( (listitem) => {
2744 var expand = new Gtk.TreeExpander();
2746 expand.set_indent_for_depth(true);
2747 expand.set_indent_for_icon(true);
2748 var hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);
2749 var icon = new Gtk.Image();
2750 icon.margin_end = 4;
2751 var lbl = new Gtk.Label("");
2752 lbl.use_markup = true;
2755 lbl.justify = Gtk.Justification.LEFT;
2760 expand.set_child(hbox);
2761 ((Gtk.ListItem)listitem).set_child(expand);
2762 ((Gtk.ListItem)listitem).activatable = false;
2764 this.el.bind.connect( (listitem) => {
2766 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
2770 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2771 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2773 var hbox = (Gtk.Box) expand.child;
2776 var img = (Gtk.Image) hbox.get_first_child();
2777 var lbl = (Gtk.Label) img.get_next_sibling();
2781 if (lbl == null || lbl.label != "") { // do not update
2784 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
2785 //GLib.debug("LR = %s", lr.get_type().name());
2788 var jr =(JsRender.JsRender) lr.get_item();
2789 //GLib.debug("JR = %s", jr.get_type().name());
2792 GLib.debug("Problem getting item");
2796 jr.bind_property("icon",
2798 GLib.BindingFlags.SYNC_CREATE);
2800 //GLib.debug("change %s to %s", lbl.label, np.name);
2801 lbl.label = jr.name; // for dir's we could hsow the sub path..
2802 lbl.tooltip_markup = jr.path;
2804 expand.set_hide_expander( jr.xtype != "Dir" );
2805 expand.set_list_row(lr);
2812 // user defined functions
2820 public class Xcls_keystate : Object
2822 public Gtk.EventControllerKey el;
2823 private Xcls_MainWindow _this;
2827 public int is_shift;
2830 public Xcls_keystate(Xcls_MainWindow _owner )
2833 _this.keystate = this;
2834 this.el = new Gtk.EventControllerKey();
2839 // set gobject values
2842 this.el.key_released.connect( (keyval, keycode, state) => {
2844 // "key release %d, %d, %d ?= %d %d" ,
2845 // (int) keyval, (int) keycode, state,
2846 // (int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK
2848 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2851 //GLib.debug("set state %d , shift = %d", (int)this.el.get_current_event_state(), Gdk.ModifierType.SHIFT_MASK);
2852 if (keyval == Gdk.Key.o && (state & Gdk.ModifierType.CONTROL_MASK) != 0) {
2854 if (!_this.splitview.el.show_sidebar) {
2855 _this.sidebar.show();
2862 this.el.key_pressed.connect( (keyval, keycode, state) => {
2864 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2875 // user defined functions