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_Box3( _this );
217 this.el.pack_start ( child_1.el );
220 // user defined functions
222 public class Xcls_Box3 : Object
225 private Xcls_MainWindow _this;
231 public Xcls_Box3(Xcls_MainWindow _owner )
234 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
238 // set gobject values
239 var child_1 = new Xcls_Button4( _this );
241 this.el.append ( child_1.el );
244 // user defined functions
246 public class Xcls_Button4 : Object
248 public Gtk.Button el;
249 private Xcls_MainWindow _this;
255 public Xcls_Button4(Xcls_MainWindow _owner )
258 this.el = new Gtk.Button();
262 // set gobject values
263 this.el.has_frame = false;
264 this.el.tooltip_text = "Manage Windows (Ctrl-O)";
265 this.el.has_tooltip = true;
266 var child_1 = new Xcls_ButtonContent5( _this );
267 this.el.child = child_1.el;
270 this.el.clicked.connect( ( ) => {
271 _this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;
272 if (_this.splitview.el.show_sidebar) {
273 _this.sidebar.show();
278 // user defined functions
280 public class Xcls_ButtonContent5 : Object
282 public Adw.ButtonContent el;
283 private Xcls_MainWindow _this;
289 public Xcls_ButtonContent5(Xcls_MainWindow _owner )
292 this.el = new Adw.ButtonContent();
296 // set gobject values
297 this.el.icon_name = "preferences-system-windows";
298 this.el.label = " Files";
301 // user defined functions
307 public class Xcls_splitview : Object
309 public Adw.OverlaySplitView el;
310 private Xcls_MainWindow _this;
316 public Xcls_splitview(Xcls_MainWindow _owner )
319 _this.splitview = this;
320 this.el = new Adw.OverlaySplitView();
324 // set gobject values
325 this.el.collapsed = true;
326 this.el.sidebar_width_fraction = 0.400000;
327 this.el.show_sidebar = false;
328 new Xcls_vbox( _this );
329 this.el.content = _this.vbox.el;
330 new Xcls_sidebar( _this );
331 this.el.sidebar = _this.sidebar.el;
332 new Xcls_keystate( _this );
333 this.el.add_controller( _this.keystate.el );
336 // user defined functions
338 public class Xcls_vbox : Object
341 private Xcls_MainWindow _this;
347 public Xcls_vbox(Xcls_MainWindow _owner )
351 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
355 // set gobject values
356 this.el.homogeneous = false;
357 this.el.hexpand = true;
358 this.el.vexpand = false;
359 new Xcls_mainpane( _this );
360 this.el.append( _this.mainpane.el );
361 var child_2 = new Xcls_Box16( _this );
363 this.el.append( child_2.el );
366 // user defined functions
368 public class Xcls_mainpane : Object
371 private Xcls_MainWindow _this;
375 public int lastWidth;
378 public Xcls_mainpane(Xcls_MainWindow _owner )
381 _this.mainpane = this;
382 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
387 // set gobject values
388 this.el.hexpand = true;
389 this.el.vexpand = true;
390 this.el.position = 400;
391 new Xcls_leftpane( _this );
392 this.el.start_child = _this.leftpane.el;
393 var child_2 = new Xcls_Box13( _this );
394 this.el.end_child = child_2.el;
397 this.el.accept_position.connect( ( ) => {
398 _this.windowstate.left_tree.onresize();
403 // user defined functions
405 public class Xcls_leftpane : Object
408 private Xcls_MainWindow _this;
414 public Xcls_leftpane(Xcls_MainWindow _owner )
417 _this.leftpane = this;
418 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
422 // set gobject values
423 this.el.hexpand = true;
424 this.el.vexpand = true;
425 new Xcls_editpane( _this );
426 this.el.append( _this.editpane.el );
429 // user defined functions
431 public class Xcls_editpane : Object
434 private Xcls_MainWindow _this;
440 public Xcls_editpane(Xcls_MainWindow _owner )
443 _this.editpane = this;
444 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
448 // set gobject values
449 new Xcls_tree( _this );
450 this.el.start_child = _this.tree.el;
451 new Xcls_props( _this );
452 this.el.end_child = _this.props.el;
455 this.el.accept_position.connect( ( ) => {
456 _this.windowstate.left_tree.onresize();
459 this.el.move_handle.connect( (scroll) => {
460 GLib.debug("Move handle");
465 // user defined functions
467 public class Xcls_tree : Object
470 private Xcls_MainWindow _this;
476 public Xcls_tree(Xcls_MainWindow _owner )
480 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
484 // set gobject values
485 this.el.hexpand = true;
486 this.el.vexpand = true;
489 // user defined functions
492 public class Xcls_props : Object
495 private Xcls_MainWindow _this;
501 public Xcls_props(Xcls_MainWindow _owner )
505 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
509 // set gobject values
510 this.el.hexpand = true;
511 this.el.vexpand = true;
514 // user defined functions
519 public class Xcls_Box13 : Object
522 private Xcls_MainWindow _this;
528 public Xcls_Box13(Xcls_MainWindow _owner )
531 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
535 // set gobject values
536 this.el.hexpand = true;
537 this.el.vexpand = true;
538 new Xcls_rooviewbox( _this );
539 this.el.append( _this.rooviewbox.el );
540 new Xcls_codeeditviewbox( _this );
541 this.el.append( _this.codeeditviewbox.el );
544 // user defined functions
546 public class Xcls_rooviewbox : Object
549 private Xcls_MainWindow _this;
555 public Xcls_rooviewbox(Xcls_MainWindow _owner )
558 _this.rooviewbox = this;
559 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
563 // set gobject values
564 this.el.hexpand = true;
565 this.el.vexpand = true;
568 // user defined functions
571 public class Xcls_codeeditviewbox : Object
574 private Xcls_MainWindow _this;
580 public Xcls_codeeditviewbox(Xcls_MainWindow _owner )
583 _this.codeeditviewbox = this;
584 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
588 // set gobject values
589 this.el.hexpand = true;
590 this.el.vexpand = true;
593 // user defined functions
598 public class Xcls_Box16 : Object
601 private Xcls_MainWindow _this;
607 public Xcls_Box16(Xcls_MainWindow _owner )
610 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
614 // set gobject values
615 this.el.homogeneous = false;
616 this.el.vexpand = false;
617 var child_1 = new Xcls_Button17( _this );
619 this.el.append( child_1.el );
620 var child_2 = new Xcls_Button18( _this );
622 this.el.append( child_2.el );
623 var child_3 = new Xcls_MenuButton19( _this );
625 this.el.append( child_3.el );
626 var child_4 = new Xcls_Label24( _this );
628 this.el.append( child_4.el );
629 new Xcls_statusbar( _this );
630 this.el.append( _this.statusbar.el );
631 var child_6 = new Xcls_Box26( _this );
633 this.el.append( child_6.el );
634 new Xcls_statusbar_compile_spinner( _this );
635 this.el.append( _this.statusbar_compile_spinner.el );
636 new Xcls_statusbar_compile_icon( _this );
637 this.el.append( _this.statusbar_compile_icon.el );
640 // user defined functions
642 public class Xcls_Button17 : Object
644 public Gtk.Button el;
645 private Xcls_MainWindow _this;
649 public bool always_show_image;
652 public Xcls_Button17(Xcls_MainWindow _owner )
655 this.el = new Gtk.Button();
658 this.always_show_image = true;
660 // set gobject values
661 this.el.icon_name = "emblem-system";
662 this.el.tooltip_text = "Project Details";
663 this.el.label = "Edit Project Settings";
666 this.el.clicked.connect( ( ) => {
668 _this.windowstate.projectPopoverShow(_this.el, null, null);
674 // user defined functions
677 public class Xcls_Button18 : Object
679 public Gtk.Button el;
680 private Xcls_MainWindow _this;
684 public bool always_show_image;
687 public Xcls_Button18(Xcls_MainWindow _owner )
690 this.el = new Gtk.Button();
693 this.always_show_image = true;
695 // set gobject values
696 this.el.icon_name = "document-properties";
697 this.el.tooltip_text = "File Details";
698 this.el.label = "Edit File Properties";
701 this.el.clicked.connect( ( ) => {
703 // create a new file in project..
704 if (_this.project == null || _this.windowstate.file == null) {
707 _this.windowstate.file_details.show(
708 _this.windowstate.file, _this.el, false
717 // user defined functions
720 public class Xcls_MenuButton19 : Object
722 public Gtk.MenuButton el;
723 private Xcls_MainWindow _this;
727 public bool always_show_image;
730 public Xcls_MenuButton19(Xcls_MainWindow _owner )
733 this.el = new Gtk.MenuButton();
736 this.always_show_image = true;
738 // set gobject values
739 this.el.icon_name = "dialog-information";
740 this.el.label = "About";
741 new Xcls_topbarmenu( _this );
742 this.el.popover = _this.topbarmenu.el;
745 // user defined functions
747 public class Xcls_topbarmenu : Object
749 public Gtk.PopoverMenu el;
750 private Xcls_MainWindow _this;
756 public Xcls_topbarmenu(Xcls_MainWindow _owner )
759 _this.topbarmenu = this;
760 this.el = new Gtk.PopoverMenu.from_model(null);
764 // set gobject values
765 var child_1 = new Xcls_Box21( _this );
767 this.el.set_child ( child_1.el );
776 // user defined functions
778 public class Xcls_Box21 : Object
781 private Xcls_MainWindow _this;
787 public Xcls_Box21(Xcls_MainWindow _owner )
790 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
794 // set gobject values
795 var child_1 = new Xcls_Button22( _this );
797 this.el.append( child_1.el );
798 var child_2 = new Xcls_Button23( _this );
800 this.el.append( child_2.el );
803 // user defined functions
805 public class Xcls_Button22 : Object
807 public Gtk.Button el;
808 private Xcls_MainWindow _this;
814 public Xcls_Button22(Xcls_MainWindow _owner )
817 this.el = new Gtk.Button();
821 // set gobject values
822 this.el.label = "Download updated Resources";
825 this.el.activate.connect( ( ) => {
826 Resources.singleton().fetchStart();
830 // user defined functions
833 public class Xcls_Button23 : Object
835 public Gtk.Button el;
836 private Xcls_MainWindow _this;
842 public Xcls_Button23(Xcls_MainWindow _owner )
845 this.el = new Gtk.Button();
849 // set gobject values
850 this.el.label = "About the Builder";
853 this.el.clicked.connect( () => {
854 About.singleton().el.show();
858 // user defined functions
864 public class Xcls_Label24 : Object
867 private Xcls_MainWindow _this;
873 public Xcls_Label24(Xcls_MainWindow _owner )
876 this.el = new Gtk.Label( " " );
880 // set gobject values
881 this.el.hexpand = true;
884 // user defined functions
887 public class Xcls_statusbar : Object
889 public Gtk.ProgressBar el;
890 private Xcls_MainWindow _this;
894 public ulong handler_id;
897 public Xcls_statusbar(Xcls_MainWindow _owner )
900 _this.statusbar = this;
901 this.el = new Gtk.ProgressBar();
904 this.handler_id = -1;
906 // set gobject values
907 this.el.show_text = true;
912 this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
915 _this.mainpane.el.set_sensitive(true);
919 _this.mainpane.el.set_sensitive(false);
921 this.el.set_fraction ((1.0f * pos) / (1.0f * total));
922 this.el.set_text("Fetching Resource : %s/%s".printf(pos.to_string(), total.to_string()));
928 // user defined functions
931 public class Xcls_Box26 : Object
934 private Xcls_MainWindow _this;
940 public Xcls_Box26(Xcls_MainWindow _owner )
943 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
947 // set gobject values
948 new Xcls_statusbar_compilestatus_label( _this );
949 this.el.append( _this.statusbar_compilestatus_label.el );
950 new Xcls_statusbar_errors( _this );
951 this.el.append( _this.statusbar_errors.el );
952 new Xcls_statusbar_warnings( _this );
953 this.el.append( _this.statusbar_warnings.el );
954 new Xcls_statusbar_depricated( _this );
955 this.el.append( _this.statusbar_depricated.el );
956 new Xcls_statusbar_run( _this );
957 this.el.append( _this.statusbar_run.el );
960 // user defined functions
962 public class Xcls_statusbar_compilestatus_label : Object
965 private Xcls_MainWindow _this;
971 public Xcls_statusbar_compilestatus_label(Xcls_MainWindow _owner )
974 _this.statusbar_compilestatus_label = this;
975 this.el = new Gtk.Label( "Compile Status:" );
979 // set gobject values
980 this.el.margin_end = 4;
981 this.el.margin_start = 4;
984 // user defined functions
987 public class Xcls_statusbar_errors : Object
989 public Gtk.Button el;
990 private Xcls_MainWindow _this;
994 public Xcls_ValaCompileErrors popup;
997 public Xcls_statusbar_errors(Xcls_MainWindow _owner )
1000 _this.statusbar_errors = this;
1001 this.el = new Gtk.Button();
1005 // set gobject values
1006 this.el.icon_name = "dialog-error";
1007 this.el.label = "0 Errors";
1010 this.el.clicked.connect( () => {
1012 if (this.popup == null) {
1021 // user defined functions
1022 public void setNotices (GLib.ListStore nots, int ferrors ) {
1023 BuilderApplication.showSpinner("");
1024 if (nots.get_n_items() < 1 ) {
1026 if (this.popup != null) {
1027 this.popup.el.hide();
1033 this.el.label = "%d/%d Errors".printf(ferrors,(int)nots.get_n_items());
1037 if (this.popup == null) {
1038 this.popup = new Xcls_ValaCompileErrors();
1039 this.popup.window = _this;
1040 // this.popup.el.set_transient_for( _this.el );
1041 this.popup.el.set_parent(this.el);
1044 this.popup.updateNotices(nots);
1049 public class Xcls_statusbar_warnings : Object
1051 public Gtk.Button el;
1052 private Xcls_MainWindow _this;
1056 public Xcls_ValaCompileErrors popup;
1059 public Xcls_statusbar_warnings(Xcls_MainWindow _owner )
1062 _this.statusbar_warnings = this;
1063 this.el = new Gtk.Button();
1067 // set gobject values
1068 this.el.icon_name = "dialog-warning";
1069 this.el.label = "0 Warnings";
1072 this.el.clicked.connect( () => {
1074 if (this.popup == null) {
1083 // user defined functions
1084 public void setNotices (GLib.ListStore nots, int ferrs ) {
1086 if (nots.get_n_items() < 1 ) {
1088 if (this.popup != null) {
1089 this.popup.el.hide();
1095 this.el.label = "%d/%d Warnings".printf(ferrs,(int)nots.get_n_items());
1099 if (this.popup == null) {
1100 this.popup = new Xcls_ValaCompileErrors();
1101 this.popup.window = _this;
1102 // this.popup.el.set_transient_for( _this.el );
1103 this.popup.el.set_parent(this.el);
1105 this.popup.updateNotices(nots);
1110 public class Xcls_statusbar_depricated : Object
1112 public Gtk.Button el;
1113 private Xcls_MainWindow _this;
1117 public Xcls_ValaCompileErrors popup;
1118 public GLib.ListStore notices;
1121 public Xcls_statusbar_depricated(Xcls_MainWindow _owner )
1124 _this.statusbar_depricated = this;
1125 this.el = new Gtk.Button();
1128 this.notices = null;
1130 // set gobject values
1131 this.el.icon_name = "dialog-information";
1132 this.el.label = "0 Depricated";
1135 this.el.clicked.connect( () => {
1137 if (this.popup == null) {
1146 // user defined functions
1147 public void setNotices (GLib.ListStore nots, int ferrs ) {
1149 if (nots.get_n_items() < 1 ) {
1151 if (this.popup != null) {
1152 this.popup.el.hide();
1158 this.el.label = "%d/%d Depricated".printf(ferrs,(int)nots.get_n_items());
1162 if (this.popup == null) {
1163 this.popup = new Xcls_ValaCompileErrors();
1164 this.popup.window = _this;
1165 // this.popup.el.set_transient_for( _this.el );
1166 this.popup.el.set_parent(this.el);
1168 this.popup.updateNotices(nots);
1173 public class Xcls_statusbar_run : Object
1175 public Gtk.Button el;
1176 private Xcls_MainWindow _this;
1180 public Xcls_ValaCompileErrors popup;
1181 public Palete.ValaCompileRequest? last_request;
1184 public Xcls_statusbar_run(Xcls_MainWindow _owner )
1187 _this.statusbar_run = this;
1188 this.el = new Gtk.Button();
1191 this.last_request = null;
1193 // set gobject values
1194 this.el.icon_name = "media-playback-start";
1195 this.el.label = "Run";
1196 this.el.visible = false;
1199 this.el.clicked.connect( () => {
1201 if (_this.windowstate.file == null) {
1204 if (_this.statusbar_compile_spinner.el.spinning) {
1205 _this.windowstate.compile_results.el.set_parent(this.el);
1206 _this.windowstate.compile_results.el.show(); // show currently running.
1210 if (this.last_request != null) {
1211 this.last_request.cancel();
1212 if (this.last_request.terminal_pid > 0) {
1213 this.last_request.killChildren(this.last_request.terminal_pid);
1216 var pr = _this.windowstate.project as Project.Gtk;
1222 this.last_request= new Palete.ValaCompileRequest(
1224 pr.firstBuildModuleWith(_this.windowstate.file)
1226 this.last_request.onOutput.connect( ( str) => {
1227 _this.windowstate.compile_results.addLine(str);
1229 this.last_request.run.begin( ( a, r) => {
1230 this.last_request.run.end(r);
1232 if (_this.windowstate.compile_results.el.parent == null) {
1233 _this.windowstate.compile_results.el.set_parent(this.el);
1235 _this.windowstate.compile_results.show(this.el,true);
1240 // user defined functions
1244 public class Xcls_statusbar_compile_spinner : Object
1246 public Gtk.Spinner el;
1247 private Xcls_MainWindow _this;
1253 public Xcls_statusbar_compile_spinner(Xcls_MainWindow _owner )
1256 _this.statusbar_compile_spinner = this;
1257 this.el = new Gtk.Spinner();
1261 // set gobject values
1262 this.el.margin_end = 4;
1263 this.el.margin_start = 4;
1264 this.el.tooltip_text = "Compiling";
1267 // user defined functions
1268 public void start (string icon, string tooltip) {
1270 if (icon == "spinner") {
1273 this.el.tooltip_text = tooltip;
1274 _this.statusbar_compile_icon.el.hide();
1277 // GLib.debug("set status icon %s, %s", icon, tooltip);
1278 _this.statusbar_compile_icon.el.tooltip_text = tooltip;
1279 _this.statusbar_compile_icon.el.icon_name = icon;
1280 _this.statusbar_compile_icon.el.show();
1285 public void stop () {
1288 _this.statusbar_compile_icon.el.hide();
1292 public class Xcls_statusbar_compile_icon : Object
1294 public Gtk.Image el;
1295 private Xcls_MainWindow _this;
1301 public Xcls_statusbar_compile_icon(Xcls_MainWindow _owner )
1304 _this.statusbar_compile_icon = this;
1305 this.el = new Gtk.Image();
1309 // set gobject values
1310 this.el.margin_end = 4;
1311 this.el.margin_start = 4;
1312 this.el.icon_size = Gtk.IconSize.NORMAL;
1315 // user defined functions
1320 public class Xcls_sidebar : Object
1323 private Xcls_MainWindow _this;
1329 public Xcls_sidebar(Xcls_MainWindow _owner )
1332 _this.sidebar = this;
1333 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1337 // set gobject values
1338 var child_1 = new Xcls_SearchBar35( _this );
1340 this.el.append( child_1.el );
1341 var child_2 = new Xcls_Box38( _this );
1343 this.el.append( child_2.el );
1344 var child_3 = new Xcls_Paned47( _this );
1346 this.el.append( child_3.el );
1349 // user defined functions
1350 public void show () {
1351 _this.splitview.el.show_sidebar = true;
1353 _this.filesearch.el.grab_focus();
1354 _this.winloading = true;
1355 _this.winmodel.el.remove_all();
1356 _this.filesearch.el.set_text("");
1357 for(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {
1358 _this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));
1360 _this.winsel.selectCurrent();
1361 _this.winloading = false;
1363 _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1365 _this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);
1367 _this.treeview.el.set_model(_this.treeselmodel.el);
1369 _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;
1374 public class Xcls_SearchBar35 : Object
1376 public Gtk.SearchBar el;
1377 private Xcls_MainWindow _this;
1383 public Xcls_SearchBar35(Xcls_MainWindow _owner )
1386 this.el = new Gtk.SearchBar();
1390 // set gobject values
1391 this.el.hexpand = true;
1392 this.el.search_mode_enabled = true;
1393 new Xcls_filesearch( _this );
1394 this.el.child = _this.filesearch.el;
1397 // user defined functions
1399 public class Xcls_filesearch : Object
1401 public Gtk.SearchEntry el;
1402 private Xcls_MainWindow _this;
1408 public Xcls_filesearch(Xcls_MainWindow _owner )
1411 _this.filesearch = this;
1412 this.el = new Gtk.SearchEntry();
1416 // set gobject values
1417 this.el.hexpand = true;
1418 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 ";
1419 this.el.has_tooltip = true;
1420 this.el.placeholder_text = "Search for file";
1421 var child_1 = new Xcls_EventControllerKey37( _this );
1423 this.el.add_controller( child_1.el );
1426 this.el.search_changed.connect( ( ) => {
1428 _this.windowsearch.el.set_search(this.el.get_text());
1429 if (this.el.text == "") {
1430 _this.treescroll.el.visible = false;
1433 _this.treescroll.el.visible = true;
1434 _this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);
1438 // user defined functions
1440 public class Xcls_EventControllerKey37 : Object
1442 public Gtk.EventControllerKey el;
1443 private Xcls_MainWindow _this;
1449 public Xcls_EventControllerKey37(Xcls_MainWindow _owner )
1452 this.el = new Gtk.EventControllerKey();
1456 // set gobject values
1459 this.el.key_released.connect( (keyval, keycode, state) => {
1460 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1465 "searcj key release %d, %d, %d ?= %d" ,
1466 (int) keyval, (int) keycode, state,
1469 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1475 if (keyval == Gdk.Key.Return) {
1476 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
1477 GLib.debug("SELECTED = %s", tr.item.get_type().name());
1478 var f = (JsRender.JsRender) tr.item;
1479 GLib.debug("Click %s", f.name);
1480 if (f.xtype == "Dir") {
1485 _this.windowstate.fileViewOpen(f,
1486 _this.keystate.is_shift != 1
1489 _this.splitview.el.show_sidebar = false;
1494 if (keyval == Gdk.Key.Up) {
1496 }if (keyval == Gdk.Key.Down) {
1502 var ns = _this.treeselmodel.el.selected + dir;
1506 if (ns >= _this.treeselmodel.el.get_n_items()) {
1507 ns = _this.treeselmodel.el.get_n_items()-1;
1509 _this.treeselmodel.el.selected = ns;
1513 // user defined functions
1518 public class Xcls_Box38 : Object
1521 private Xcls_MainWindow _this;
1527 public Xcls_Box38(Xcls_MainWindow _owner )
1530 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1534 // set gobject values
1535 this.el.hexpand = true;
1536 new Xcls_open_projects_btn( _this );
1537 this.el.append( _this.open_projects_btn.el );
1538 var child_2 = new Xcls_Button43( _this );
1540 this.el.append( child_2.el );
1543 // user defined functions
1545 public class Xcls_open_projects_btn : Object
1547 public Gtk.Button el;
1548 private Xcls_MainWindow _this;
1554 public Xcls_open_projects_btn(Xcls_MainWindow _owner )
1557 _this.open_projects_btn = this;
1558 this.el = new Gtk.Button();
1562 // set gobject values
1563 this.el.hexpand = true;
1564 var child_1 = new Xcls_Box40( _this );
1565 this.el.child = child_1.el;
1568 this.el.clicked.connect( ( ) => {
1569 _this.windowstate.showPopoverFiles(this.el, _this.project, false);
1573 // user defined functions
1575 public class Xcls_Box40 : Object
1578 private Xcls_MainWindow _this;
1584 public Xcls_Box40(Xcls_MainWindow _owner )
1587 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1591 // set gobject values
1592 var child_1 = new Xcls_Image41( _this );
1594 this.el.append( child_1.el );
1595 var child_2 = new Xcls_Label42( _this );
1597 this.el.append( child_2.el );
1600 // user defined functions
1602 public class Xcls_Image41 : Object
1604 public Gtk.Image el;
1605 private Xcls_MainWindow _this;
1611 public Xcls_Image41(Xcls_MainWindow _owner )
1614 this.el = new Gtk.Image();
1618 // set gobject values
1619 this.el.icon_name = "document-open";
1620 this.el.margin_end = 4;
1623 // user defined functions
1626 public class Xcls_Label42 : Object
1628 public Gtk.Label el;
1629 private Xcls_MainWindow _this;
1635 public Xcls_Label42(Xcls_MainWindow _owner )
1638 this.el = new Gtk.Label( "Open File" );
1642 // set gobject values
1645 // user defined functions
1650 public class Xcls_Button43 : Object
1652 public Gtk.Button el;
1653 private Xcls_MainWindow _this;
1659 public Xcls_Button43(Xcls_MainWindow _owner )
1662 this.el = new Gtk.Button();
1666 // set gobject values
1667 this.el.hexpand = true;
1668 var child_1 = new Xcls_Box44( _this );
1669 this.el.child = child_1.el;
1672 this.el.clicked.connect( ( ) => {
1673 _this.splitview.el.show_sidebar = false;
1674 _this.windowstate.showPopoverFiles(_this.el, _this.project, true);
1678 // user defined functions
1680 public class Xcls_Box44 : Object
1683 private Xcls_MainWindow _this;
1689 public Xcls_Box44(Xcls_MainWindow _owner )
1692 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1696 // set gobject values
1697 var child_1 = new Xcls_Image45( _this );
1699 this.el.append( child_1.el );
1700 var child_2 = new Xcls_Label46( _this );
1702 this.el.append( child_2.el );
1705 // user defined functions
1707 public class Xcls_Image45 : Object
1709 public Gtk.Image el;
1710 private Xcls_MainWindow _this;
1716 public Xcls_Image45(Xcls_MainWindow _owner )
1719 this.el = new Gtk.Image();
1723 // set gobject values
1724 this.el.icon_name = "window-new";
1725 this.el.margin_end = 4;
1728 // user defined functions
1731 public class Xcls_Label46 : Object
1733 public Gtk.Label el;
1734 private Xcls_MainWindow _this;
1740 public Xcls_Label46(Xcls_MainWindow _owner )
1743 this.el = new Gtk.Label( "New Window" );
1747 // set gobject values
1750 // user defined functions
1756 public class Xcls_Paned47 : Object
1758 public Gtk.Paned el;
1759 private Xcls_MainWindow _this;
1765 public Xcls_Paned47(Xcls_MainWindow _owner )
1768 this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL );
1772 // set gobject values
1773 this.el.vexpand = true;
1774 var child_1 = new Xcls_ScrolledWindow48( _this );
1775 this.el.start_child = child_1.el;
1776 new Xcls_treescroll( _this );
1777 this.el.end_child = _this.treescroll.el;
1780 // user defined functions
1782 public class Xcls_ScrolledWindow48 : Object
1784 public Gtk.ScrolledWindow el;
1785 private Xcls_MainWindow _this;
1791 public Xcls_ScrolledWindow48(Xcls_MainWindow _owner )
1794 this.el = new Gtk.ScrolledWindow();
1798 // set gobject values
1799 this.el.has_frame = true;
1800 var child_1 = new Xcls_ColumnView49( _this );
1801 this.el.child = child_1.el;
1804 // user defined functions
1806 public class Xcls_ColumnView49 : Object
1808 public Gtk.ColumnView el;
1809 private Xcls_MainWindow _this;
1815 public Xcls_ColumnView49(Xcls_MainWindow _owner )
1818 new Xcls_winsel( _this );
1819 this.el = new Gtk.ColumnView( _this.winsel.el );
1823 // set gobject values
1824 new Xcls_projcol( _this );
1825 this.el.append_column( _this.projcol.el );
1826 new Xcls_filecol( _this );
1827 this.el.append_column ( _this.filecol.el );
1830 // user defined functions
1832 public class Xcls_winsel : Object
1834 public Gtk.SingleSelection el;
1835 private Xcls_MainWindow _this;
1839 public bool selecting;
1842 public Xcls_winsel(Xcls_MainWindow _owner )
1845 _this.winsel = this;
1846 var child_1 = new Xcls_SortListModel51( _this );
1848 this.el = new Gtk.SingleSelection( child_1.el );
1851 this.selecting = false;
1853 // set gobject values
1854 this.el.can_unselect = false;
1855 this.el.autoselect = false;
1858 this.el.notify["selected"].connect( () => {
1859 if (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {
1862 var ws = this.el.selected_item as WindowState;
1866 if (ws.file.path != _this.windowstate.file.path) {
1867 _this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window, -1);
1868 _this.splitview.el.show_sidebar = false;
1871 this.selectCurrent();
1875 // user defined functions
1876 public void selectCurrent () {
1877 this.selecting = true;
1879 for(var i = 0;i < this.el.get_n_items(); i++) {
1880 var ws = this.el.get_item(i) as WindowState;
1881 if (ws.file.path == _this.windowstate.file.path) {
1882 this.el.selected = i;
1886 this.selecting = false;
1891 public class Xcls_SortListModel51 : Object
1893 public Gtk.SortListModel el;
1894 private Xcls_MainWindow _this;
1900 public Xcls_SortListModel51(Xcls_MainWindow _owner )
1903 new Xcls_winfilter( _this );
1904 var child_2 = new Xcls_StringSorter56( _this );
1906 this.el = new Gtk.SortListModel( _this.winfilter.el, child_2.el );
1910 // set gobject values
1913 // user defined functions
1915 public class Xcls_winfilter : Object
1917 public Gtk.FilterListModel el;
1918 private Xcls_MainWindow _this;
1924 public Xcls_winfilter(Xcls_MainWindow _owner )
1927 _this.winfilter = this;
1928 new Xcls_winmodel( _this );
1929 new Xcls_windowsearch( _this );
1930 this.el = new Gtk.FilterListModel( _this.winmodel.el, _this.windowsearch.el );
1934 // set gobject values
1937 // user defined functions
1939 public class Xcls_windowsearch : Object
1941 public Gtk.StringFilter el;
1942 private Xcls_MainWindow _this;
1948 public Xcls_windowsearch(Xcls_MainWindow _owner )
1951 _this.windowsearch = this;
1952 var child_1 = new Xcls_PropertyExpression54( _this );
1954 this.el = new Gtk.StringFilter( child_1.el );
1958 // set gobject values
1961 // user defined functions
1963 public class Xcls_PropertyExpression54 : Object
1965 public Gtk.PropertyExpression el;
1966 private Xcls_MainWindow _this;
1972 public Xcls_PropertyExpression54(Xcls_MainWindow _owner )
1975 this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
1979 // set gobject values
1982 // user defined functions
1986 public class Xcls_winmodel : Object
1988 public GLib.ListStore el;
1989 private Xcls_MainWindow _this;
1995 public Xcls_winmodel(Xcls_MainWindow _owner )
1998 _this.winmodel = this;
1999 this.el = new GLib.ListStore( typeof(WindowState) );
2003 // set gobject values
2006 // user defined functions
2010 public class Xcls_StringSorter56 : Object
2012 public Gtk.StringSorter el;
2013 private Xcls_MainWindow _this;
2019 public Xcls_StringSorter56(Xcls_MainWindow _owner )
2022 var child_1 = new Xcls_PropertyExpression57( _this );
2024 this.el = new Gtk.StringSorter( child_1.el );
2028 // set gobject values
2029 this.el.ignore_case = true;
2032 // user defined functions
2034 public class Xcls_PropertyExpression57 : Object
2036 public Gtk.PropertyExpression el;
2037 private Xcls_MainWindow _this;
2043 public Xcls_PropertyExpression57(Xcls_MainWindow _owner )
2046 this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2050 // set gobject values
2053 // user defined functions
2059 public class Xcls_projcol : Object
2061 public Gtk.ColumnViewColumn el;
2062 private Xcls_MainWindow _this;
2068 public Xcls_projcol(Xcls_MainWindow _owner )
2071 _this.projcol = this;
2072 var child_1 = new Xcls_SignalListItemFactory59( _this );
2074 this.el = new Gtk.ColumnViewColumn( "Project", child_1.el );
2078 // set gobject values
2079 this.el.id = "projcol";
2080 this.el.expand = true;
2081 this.el.resizable = true;
2084 // user defined functions
2086 public class Xcls_SignalListItemFactory59 : Object
2088 public Gtk.SignalListItemFactory el;
2089 private Xcls_MainWindow _this;
2095 public Xcls_SignalListItemFactory59(Xcls_MainWindow _owner )
2098 this.el = new Gtk.SignalListItemFactory();
2102 // set gobject values
2105 this.el.setup.connect( (listitem) => {
2106 var lbl = new Gtk.Label("");
2107 (listitem as Gtk.ListItem).set_child(lbl);
2108 lbl.justify = Gtk.Justification.LEFT;
2110 lbl.use_markup = true;
2111 lbl.ellipsize = Pango.EllipsizeMode.START;
2113 (listitem as Gtk.ListItem).activatable = true;
2115 this.el.bind.connect( (listitem) => {
2116 var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();
2117 var item = (listitem as Gtk.ListItem).get_item() as WindowState;
2119 lb.label = item.project.name;
2127 // user defined functions
2131 public class Xcls_filecol : Object
2133 public Gtk.ColumnViewColumn el;
2134 private Xcls_MainWindow _this;
2140 public Xcls_filecol(Xcls_MainWindow _owner )
2143 _this.filecol = this;
2144 var child_1 = new Xcls_SignalListItemFactory61( _this );
2146 this.el = new Gtk.ColumnViewColumn( "File", child_1.el );
2150 // set gobject values
2151 this.el.id = "filecol";
2152 this.el.expand = true;
2153 this.el.resizable = true;
2156 // user defined functions
2158 public class Xcls_SignalListItemFactory61 : Object
2160 public Gtk.SignalListItemFactory el;
2161 private Xcls_MainWindow _this;
2167 public Xcls_SignalListItemFactory61(Xcls_MainWindow _owner )
2170 this.el = new Gtk.SignalListItemFactory();
2174 // set gobject values
2177 this.el.setup.connect( (listitem) => {
2178 var lbl = new Gtk.Label("");
2179 (listitem as Gtk.ListItem).set_child(lbl);
2180 lbl.justify = Gtk.Justification.LEFT;
2182 lbl.use_markup = true;
2183 lbl.ellipsize = Pango.EllipsizeMode.START;
2185 (listitem as Gtk.ListItem).activatable = true;
2187 this.el.bind.connect( (listitem) => {
2188 var lb = (Gtk.Label) (listitem as Gtk.ListItem).get_child();
2189 var item = (listitem as Gtk.ListItem).get_item() as WindowState;
2191 lb.label = item.file.relpath;
2199 // user defined functions
2205 public class Xcls_treescroll : Object
2207 public Gtk.ScrolledWindow el;
2208 private Xcls_MainWindow _this;
2214 public Xcls_treescroll(Xcls_MainWindow _owner )
2217 _this.treescroll = this;
2218 this.el = new Gtk.ScrolledWindow();
2222 // set gobject values
2223 this.el.has_frame = true;
2224 this.el.hexpand = true;
2225 this.el.vexpand = true;
2226 this.el.tooltip_text = "dbl-click - opens in NEW window \nshift--dbl-click opens in this window";
2227 this.el.visible = false;
2228 new Xcls_treeview( _this );
2229 this.el.child = _this.treeview.el;
2232 // user defined functions
2234 public class Xcls_treeview : Object
2236 public Gtk.ColumnView el;
2237 private Xcls_MainWindow _this;
2243 public Xcls_treeview(Xcls_MainWindow _owner )
2246 _this.treeview = this;
2247 new Xcls_treeselmodel( _this );
2248 this.el = new Gtk.ColumnView( _this.treeselmodel.el );
2252 // set gobject values
2253 this.el.hexpand = true;
2254 this.el.vexpand = true;
2255 var child_2 = new Xcls_GestureClick64( _this );
2257 this.el.add_controller( child_2.el );
2258 new Xcls_name( _this );
2259 this.el.append_column ( _this.name.el );
2262 // user defined functions
2264 public class Xcls_GestureClick64 : Object
2266 public Gtk.GestureClick el;
2267 private Xcls_MainWindow _this;
2273 public Xcls_GestureClick64(Xcls_MainWindow _owner )
2276 this.el = new Gtk.GestureClick();
2280 // set gobject values
2283 this.el.pressed.connect( (n_press, x, y) => {
2285 GLib.debug("double cliced");
2289 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
2290 GLib.debug("SELECTED = %s", tr.item.get_type().name());
2291 var f = (JsRender.JsRender) tr.item;
2292 GLib.debug("Click %s", f.name);
2293 if (f.xtype == "Dir") {
2298 _this.windowstate.fileViewOpen(f,
2299 _this.keystate.is_shift != 1
2302 _this.splitview.el.show_sidebar = false;
2309 // user defined functions
2312 public class Xcls_treeselmodel : Object
2314 public Gtk.SingleSelection el;
2315 private Xcls_MainWindow _this;
2321 public Xcls_treeselmodel(Xcls_MainWindow _owner )
2324 _this.treeselmodel = this;
2325 var child_1 = new Xcls_FilterListModel66( _this );
2327 this.el = new Gtk.SingleSelection( child_1.el );
2331 // set gobject values
2332 this.el.can_unselect = true;
2333 this.el.autoselect = true;
2336 // user defined functions
2338 public class Xcls_FilterListModel66 : Object
2340 public Gtk.FilterListModel el;
2341 private Xcls_MainWindow _this;
2347 public Xcls_FilterListModel66(Xcls_MainWindow _owner )
2350 new Xcls_treelistsort( _this );
2351 new Xcls_treefilter( _this );
2352 this.el = new Gtk.FilterListModel( _this.treelistsort.el, _this.treefilter.el );
2356 // set gobject values
2359 // user defined functions
2361 public class Xcls_treelistsort : Object
2363 public Gtk.SortListModel el;
2364 private Xcls_MainWindow _this;
2370 public Xcls_treelistsort(Xcls_MainWindow _owner )
2373 _this.treelistsort = this;
2374 new Xcls_treelistmodel( _this );
2375 var child_2 = new Xcls_TreeListRowSorter70( _this );
2377 this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
2381 // set gobject values
2382 this.el.incremental = true;
2385 // user defined functions
2387 public class Xcls_treelistmodel : Object
2389 public Gtk.TreeListModel el;
2390 private Xcls_MainWindow _this;
2396 public Xcls_treelistmodel(Xcls_MainWindow _owner )
2399 _this.treelistmodel = this;
2400 new Xcls_treemodel( _this );
2401 this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
2402 //GLib.debug("liststore got %s", item.get_type().name());
2403 return ((JsRender.JsRender)item).childfiles;
2408 // set gobject values
2411 // user defined functions
2413 public class Xcls_treemodel : Object
2415 public GLib.ListStore el;
2416 private Xcls_MainWindow _this;
2422 public Xcls_treemodel(Xcls_MainWindow _owner )
2425 _this.treemodel = this;
2426 this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
2430 // set gobject values
2433 // user defined functions
2437 public class Xcls_TreeListRowSorter70 : Object
2439 public Gtk.TreeListRowSorter el;
2440 private Xcls_MainWindow _this;
2446 public Xcls_TreeListRowSorter70(Xcls_MainWindow _owner )
2449 var child_1 = new Xcls_StringSorter71( _this );
2451 this.el = new Gtk.TreeListRowSorter( child_1.el );
2455 // set gobject values
2458 // user defined functions
2460 public class Xcls_StringSorter71 : Object
2462 public Gtk.StringSorter el;
2463 private Xcls_MainWindow _this;
2469 public Xcls_StringSorter71(Xcls_MainWindow _owner )
2472 var child_1 = new Xcls_PropertyExpression72( _this );
2474 this.el = new Gtk.StringSorter( child_1.el );
2478 // set gobject values
2479 this.el.ignore_case = true;
2482 // user defined functions
2484 public class Xcls_PropertyExpression72 : Object
2486 public Gtk.PropertyExpression el;
2487 private Xcls_MainWindow _this;
2493 public Xcls_PropertyExpression72(Xcls_MainWindow _owner )
2496 this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender) , null, "name" );
2500 // set gobject values
2503 // user defined functions
2509 public class Xcls_treefilter : Object
2511 public Gtk.CustomFilter el;
2512 private Xcls_MainWindow _this;
2518 public Xcls_treefilter(Xcls_MainWindow _owner )
2521 _this.treefilter = this;
2522 this.el = new Gtk.CustomFilter( (item) => {
2523 var tr = ((Gtk.TreeListRow)item).get_item();
2524 //GLib.debug("filter %s", tr.get_type().name());
2525 var j = (JsRender.JsRender) tr;
2526 if (j.xtype == "Dir" && j.childfiles.n_items < 1) {
2529 var str = _this.filesearch.el.text.down();
2530 if (j.xtype == "Dir") {
2533 for (var i =0 ; i < j.childfiles.n_items; i++) {
2534 var f = (JsRender.JsRender) j.childfiles.get_item(i);
2535 //if (f.xtype != "PlainFile") {
2538 if (f.content_type.contains("image")) {
2541 if (str.length < 1) {
2544 if (f.name.down().contains(str)) {
2552 //if (j.xtype != "PlainFile") {
2555 if (j.content_type.contains("image")) {
2559 if (str.length < 1) { // no search.
2562 if (j.name.down().contains(str)) {
2571 // set gobject values
2574 // user defined functions
2579 public class Xcls_name : Object
2581 public Gtk.ColumnViewColumn el;
2582 private Xcls_MainWindow _this;
2588 public Xcls_name(Xcls_MainWindow _owner )
2592 var child_1 = new Xcls_SignalListItemFactory75( _this );
2594 this.el = new Gtk.ColumnViewColumn( "All Project Files", child_1.el );
2598 // set gobject values
2599 this.el.id = "name";
2600 this.el.expand = true;
2601 this.el.resizable = true;
2606 // this.el.set_sorter( new Gtk.StringSorter(
2607 // new Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, "name")
2613 // user defined functions
2615 public class Xcls_SignalListItemFactory75 : Object
2617 public Gtk.SignalListItemFactory el;
2618 private Xcls_MainWindow _this;
2624 public Xcls_SignalListItemFactory75(Xcls_MainWindow _owner )
2627 this.el = new Gtk.SignalListItemFactory();
2631 // set gobject values
2634 this.el.setup.connect( (listitem) => {
2636 var expand = new Gtk.TreeExpander();
2638 expand.set_indent_for_depth(true);
2639 expand.set_indent_for_icon(true);
2640 var hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);
2641 var icon = new Gtk.Image();
2642 icon.margin_end = 4;
2643 var lbl = new Gtk.Label("");
2644 lbl.use_markup = true;
2647 lbl.justify = Gtk.Justification.LEFT;
2652 expand.set_child(hbox);
2653 ((Gtk.ListItem)listitem).set_child(expand);
2654 ((Gtk.ListItem)listitem).activatable = false;
2656 this.el.bind.connect( (listitem) => {
2658 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
2662 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2663 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2665 var hbox = (Gtk.Box) expand.child;
2668 var img = (Gtk.Image) hbox.get_first_child();
2669 var lbl = (Gtk.Label) img.get_next_sibling();
2673 if (lbl == null || lbl.label != "") { // do not update
2676 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
2677 //GLib.debug("LR = %s", lr.get_type().name());
2680 var jr =(JsRender.JsRender) lr.get_item();
2681 //GLib.debug("JR = %s", jr.get_type().name());
2684 GLib.debug("Problem getting item");
2688 jr.bind_property("icon",
2690 GLib.BindingFlags.SYNC_CREATE);
2692 //GLib.debug("change %s to %s", lbl.label, np.name);
2693 lbl.label = jr.name; // for dir's we could hsow the sub path..
2694 lbl.tooltip_markup = jr.path;
2696 expand.set_hide_expander( jr.xtype != "Dir" );
2697 expand.set_list_row(lr);
2704 // user defined functions
2712 public class Xcls_keystate : Object
2714 public Gtk.EventControllerKey el;
2715 private Xcls_MainWindow _this;
2719 public int is_shift;
2722 public Xcls_keystate(Xcls_MainWindow _owner )
2725 _this.keystate = this;
2726 this.el = new Gtk.EventControllerKey();
2731 // set gobject values
2734 this.el.key_released.connect( (keyval, keycode, state) => {
2737 "key release %d, %d, %d ?= %d %d" ,
2738 (int) keyval, (int) keycode, state,
2739 (int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK
2741 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2744 //GLib.debug("set state %d , shift = %d", (int)this.el.get_current_event_state(), Gdk.ModifierType.SHIFT_MASK);
2745 if (keyval == Gdk.Key.o && (state & Gdk.ModifierType.CONTROL_MASK) != 0) {
2747 if (!_this.splitview.el.show_sidebar) {
2748 _this.sidebar.show();
2755 this.el.key_pressed.connect( (keyval, keycode, state) => {
2757 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2768 // user defined functions