Fix #8000 - left tree and file open
[roobuilder] / src / Builder4 / MainWindow.vala
1 static Xcls_MainWindow  _MainWindow;
2
3 public class Xcls_MainWindow : Object
4 {
5         public Gtk.ApplicationWindow el;
6         private Xcls_MainWindow  _this;
7
8         public static Xcls_MainWindow singleton()
9         {
10                 if (_MainWindow == null) {
11                     _MainWindow= new Xcls_MainWindow();
12                 }
13                 return _MainWindow;
14         }
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;
52
53                 // my vars (def)
54         public WindowState windowstate;
55         public bool winloading;
56         public Project.Project project;
57
58         // ctor
59         public Xcls_MainWindow()
60         {
61                 _this = this;
62                 this.el = new Gtk.ApplicationWindow(BuilderApplication.singleton({}));
63
64                 // my vars (dec)
65                 this.winloading = false;
66                 this.project = null;
67
68                 // set gobject values
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;
76
77                 // init method
78
79                 this.el.set_icon_name("roobuilder");
80
81                 //listeners
82                 this.el.close_request.connect( ( ) => {
83                          Resources.singleton().disconnect(_this.statusbar.handler_id);
84                          
85                          
86                          this.windowstate.file.getLanguageServer().document_close(
87                                 this.windowstate.file
88                         );
89                          
90                          BuilderApplication.removeWindow(this);
91                          
92                          if (BuilderApplication.windows.size  < 1) {
93                                 this.windowstate.file.getLanguageServer().exit();
94                                 BuilderApplication.singleton(  null ).quit();
95                          }
96                         return true;
97                         
98                 });
99                 this.el.show.connect( ( ) => {
100                     // hide the file editing..
101                    
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();
109                   
110                     Resources.singleton().checkResources();
111                     
112                   
113                 
114                 });
115                 this.el.hide.connect( () =>  {
116                  
117                  
118                 
119                 });
120         }
121
122         // user defined functions
123         public void updateErrors () {
124         
125         
126                 GLib.debug("updateErrors");
127                 
128                 var pr = this.windowstate.project.getErrors("ERR");
129                 
130                 this.statusbar_errors.setNotices(
131                         pr,
132                         this.windowstate.file.getErrorsTotal("ERR")
133                 );
134                 
135                 this.statusbar_warnings.setNotices(
136                         this.windowstate.project.getErrors("WARN"),
137                         this.windowstate.file.getErrorsTotal("WARN")
138                 );
139                 this.statusbar_depricated.setNotices(
140                         this.windowstate.project.getErrors("DEPR"),
141                         this.windowstate.file.getErrorsTotal("DEPR")
142                 );
143         
144                 _this.statusbar_run.el.hide();
145         
146                 if (pr.get_n_items() < 1) {
147                         _this.statusbar_run.el.show();
148                 } 
149                 
150         }
151         public void initChildren () {
152             // this needs putting in a better place..
153             if (this.windowstate == null) {
154                 this.windowstate = new WindowState(this);
155             
156             }
157              
158         
159          
160         
161             
162         
163         
164         
165         }
166         public void show () {
167            
168             this.el.show();
169             if (this.windowstate.file  == null) {
170                 this.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);
171             }
172         }
173         public void setTitle () {
174             if (_this.windowstate.project == null || 
175                     _this.windowstate.file == null
176             ) {
177                 this.el.set_title("Select File");
178                 return;
179                 }
180             _this.el.set_title(
181                 _this.windowstate.project.name + 
182                 " - " +
183                         _this.windowstate.file.relpath);
184         }
185         public void openNewWindow () {
186          
187             var w = new Xcls_MainWindow();
188             w.ref();
189                 BuilderApplication.addWindow(w);
190             w.el.show();
191             w.initChildren();
192             w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);
193              
194         }
195         public class Xcls_headerbar : Object
196         {
197                 public Gtk.HeaderBar el;
198                 private Xcls_MainWindow  _this;
199
200
201                         // my vars (def)
202                 public bool show_close_button;
203
204                 // ctor
205                 public Xcls_headerbar(Xcls_MainWindow _owner )
206                 {
207                         _this = _owner;
208                         _this.headerbar = this;
209                         this.el = new Gtk.HeaderBar();
210
211                         // my vars (dec)
212                         this.show_close_button = true;
213
214                         // set gobject values
215                         var child_1 = new Xcls_Box3( _this );
216                         child_1.ref();
217                         this.el.pack_start ( child_1.el  );
218                 }
219
220                 // user defined functions
221         }
222         public class Xcls_Box3 : Object
223         {
224                 public Gtk.Box el;
225                 private Xcls_MainWindow  _this;
226
227
228                         // my vars (def)
229
230                 // ctor
231                 public Xcls_Box3(Xcls_MainWindow _owner )
232                 {
233                         _this = _owner;
234                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
235
236                         // my vars (dec)
237
238                         // set gobject values
239                         var child_1 = new Xcls_Button4( _this );
240                         child_1.ref();
241                         this.el.append ( child_1.el  );
242                 }
243
244                 // user defined functions
245         }
246         public class Xcls_Button4 : Object
247         {
248                 public Gtk.Button el;
249                 private Xcls_MainWindow  _this;
250
251
252                         // my vars (def)
253
254                 // ctor
255                 public Xcls_Button4(Xcls_MainWindow _owner )
256                 {
257                         _this = _owner;
258                         this.el = new Gtk.Button();
259
260                         // my vars (dec)
261
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;
268
269                         //listeners
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(); 
274                                 }
275                         });
276                 }
277
278                 // user defined functions
279         }
280         public class Xcls_ButtonContent5 : Object
281         {
282                 public Adw.ButtonContent el;
283                 private Xcls_MainWindow  _this;
284
285
286                         // my vars (def)
287
288                 // ctor
289                 public Xcls_ButtonContent5(Xcls_MainWindow _owner )
290                 {
291                         _this = _owner;
292                         this.el = new Adw.ButtonContent();
293
294                         // my vars (dec)
295
296                         // set gobject values
297                         this.el.icon_name = "preferences-system-windows";
298                         this.el.label = " Files";
299                 }
300
301                 // user defined functions
302         }
303
304
305
306
307         public class Xcls_splitview : Object
308         {
309                 public Adw.OverlaySplitView el;
310                 private Xcls_MainWindow  _this;
311
312
313                         // my vars (def)
314
315                 // ctor
316                 public Xcls_splitview(Xcls_MainWindow _owner )
317                 {
318                         _this = _owner;
319                         _this.splitview = this;
320                         this.el = new Adw.OverlaySplitView();
321
322                         // my vars (dec)
323
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 );
334                 }
335
336                 // user defined functions
337         }
338         public class Xcls_vbox : Object
339         {
340                 public Gtk.Box el;
341                 private Xcls_MainWindow  _this;
342
343
344                         // my vars (def)
345
346                 // ctor
347                 public Xcls_vbox(Xcls_MainWindow _owner )
348                 {
349                         _this = _owner;
350                         _this.vbox = this;
351                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
352
353                         // my vars (dec)
354
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 );
362                         child_2.ref();
363                         this.el.append( child_2.el );
364                 }
365
366                 // user defined functions
367         }
368         public class Xcls_mainpane : Object
369         {
370                 public Gtk.Paned el;
371                 private Xcls_MainWindow  _this;
372
373
374                         // my vars (def)
375                 public int lastWidth;
376
377                 // ctor
378                 public Xcls_mainpane(Xcls_MainWindow _owner )
379                 {
380                         _this = _owner;
381                         _this.mainpane = this;
382                         this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
383
384                         // my vars (dec)
385                         this.lastWidth = 0;
386
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;
395
396                         //listeners
397                         this.el.accept_position.connect( ( ) => {
398                                 _this.windowstate.left_tree.onresize();
399                                 return true;
400                         });
401                 }
402
403                 // user defined functions
404         }
405         public class Xcls_leftpane : Object
406         {
407                 public Gtk.Box el;
408                 private Xcls_MainWindow  _this;
409
410
411                         // my vars (def)
412
413                 // ctor
414                 public Xcls_leftpane(Xcls_MainWindow _owner )
415                 {
416                         _this = _owner;
417                         _this.leftpane = this;
418                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
419
420                         // my vars (dec)
421
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 );
427                 }
428
429                 // user defined functions
430         }
431         public class Xcls_editpane : Object
432         {
433                 public Gtk.Paned el;
434                 private Xcls_MainWindow  _this;
435
436
437                         // my vars (def)
438
439                 // ctor
440                 public Xcls_editpane(Xcls_MainWindow _owner )
441                 {
442                         _this = _owner;
443                         _this.editpane = this;
444                         this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
445
446                         // my vars (dec)
447
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;
453
454                         //listeners
455                         this.el.accept_position.connect( ( ) => {
456                                 _this.windowstate.left_tree.onresize();
457                                 return true;
458                         });
459                         this.el.move_handle.connect( (scroll) => {
460                                 GLib.debug("Move handle");
461                                 return true;
462                         });
463                 }
464
465                 // user defined functions
466         }
467         public class Xcls_tree : Object
468         {
469                 public Gtk.Box el;
470                 private Xcls_MainWindow  _this;
471
472
473                         // my vars (def)
474
475                 // ctor
476                 public Xcls_tree(Xcls_MainWindow _owner )
477                 {
478                         _this = _owner;
479                         _this.tree = this;
480                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
481
482                         // my vars (dec)
483
484                         // set gobject values
485                         this.el.hexpand = true;
486                         this.el.vexpand = true;
487                 }
488
489                 // user defined functions
490         }
491
492         public class Xcls_props : Object
493         {
494                 public Gtk.Box el;
495                 private Xcls_MainWindow  _this;
496
497
498                         // my vars (def)
499
500                 // ctor
501                 public Xcls_props(Xcls_MainWindow _owner )
502                 {
503                         _this = _owner;
504                         _this.props = this;
505                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
506
507                         // my vars (dec)
508
509                         // set gobject values
510                         this.el.hexpand = true;
511                         this.el.vexpand = true;
512                 }
513
514                 // user defined functions
515         }
516
517
518
519         public class Xcls_Box13 : Object
520         {
521                 public Gtk.Box el;
522                 private Xcls_MainWindow  _this;
523
524
525                         // my vars (def)
526
527                 // ctor
528                 public Xcls_Box13(Xcls_MainWindow _owner )
529                 {
530                         _this = _owner;
531                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
532
533                         // my vars (dec)
534
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 );
542                 }
543
544                 // user defined functions
545         }
546         public class Xcls_rooviewbox : Object
547         {
548                 public Gtk.Box el;
549                 private Xcls_MainWindow  _this;
550
551
552                         // my vars (def)
553
554                 // ctor
555                 public Xcls_rooviewbox(Xcls_MainWindow _owner )
556                 {
557                         _this = _owner;
558                         _this.rooviewbox = this;
559                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
560
561                         // my vars (dec)
562
563                         // set gobject values
564                         this.el.hexpand = true;
565                         this.el.vexpand = true;
566                 }
567
568                 // user defined functions
569         }
570
571         public class Xcls_codeeditviewbox : Object
572         {
573                 public Gtk.Box el;
574                 private Xcls_MainWindow  _this;
575
576
577                         // my vars (def)
578
579                 // ctor
580                 public Xcls_codeeditviewbox(Xcls_MainWindow _owner )
581                 {
582                         _this = _owner;
583                         _this.codeeditviewbox = this;
584                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
585
586                         // my vars (dec)
587
588                         // set gobject values
589                         this.el.hexpand = true;
590                         this.el.vexpand = true;
591                 }
592
593                 // user defined functions
594         }
595
596
597
598         public class Xcls_Box16 : Object
599         {
600                 public Gtk.Box el;
601                 private Xcls_MainWindow  _this;
602
603
604                         // my vars (def)
605
606                 // ctor
607                 public Xcls_Box16(Xcls_MainWindow _owner )
608                 {
609                         _this = _owner;
610                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
611
612                         // my vars (dec)
613
614                         // set gobject values
615                         this.el.homogeneous = false;
616                         this.el.vexpand = false;
617                         var child_1 = new Xcls_Button17( _this );
618                         child_1.ref();
619                         this.el.append( child_1.el );
620                         var child_2 = new Xcls_Button18( _this );
621                         child_2.ref();
622                         this.el.append( child_2.el );
623                         var child_3 = new Xcls_MenuButton19( _this );
624                         child_3.ref();
625                         this.el.append( child_3.el );
626                         var child_4 = new Xcls_Label24( _this );
627                         child_4.ref();
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 );
632                         child_6.ref();
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 );
638                 }
639
640                 // user defined functions
641         }
642         public class Xcls_Button17 : Object
643         {
644                 public Gtk.Button el;
645                 private Xcls_MainWindow  _this;
646
647
648                         // my vars (def)
649                 public bool always_show_image;
650
651                 // ctor
652                 public Xcls_Button17(Xcls_MainWindow _owner )
653                 {
654                         _this = _owner;
655                         this.el = new Gtk.Button();
656
657                         // my vars (dec)
658                         this.always_show_image = true;
659
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";
664
665                         //listeners
666                         this.el.clicked.connect( ( ) => {
667                              
668                              _this.windowstate.projectPopoverShow(_this.el, null, null);
669                            
670                           
671                         });
672                 }
673
674                 // user defined functions
675         }
676
677         public class Xcls_Button18 : Object
678         {
679                 public Gtk.Button el;
680                 private Xcls_MainWindow  _this;
681
682
683                         // my vars (def)
684                 public bool always_show_image;
685
686                 // ctor
687                 public Xcls_Button18(Xcls_MainWindow _owner )
688                 {
689                         _this = _owner;
690                         this.el = new Gtk.Button();
691
692                         // my vars (dec)
693                         this.always_show_image = true;
694
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";
699
700                         //listeners
701                         this.el.clicked.connect( ( ) => {
702                           
703                             // create a new file in project..
704                             if (_this.project == null || _this.windowstate.file == null) {
705                                 return  ;
706                             }
707                              _this.windowstate.file_details.show(
708                                 _this.windowstate.file, _this.el, false
709                             );
710                              
711                             return  ;    
712                         
713                         
714                         });
715                 }
716
717                 // user defined functions
718         }
719
720         public class Xcls_MenuButton19 : Object
721         {
722                 public Gtk.MenuButton el;
723                 private Xcls_MainWindow  _this;
724
725
726                         // my vars (def)
727                 public bool always_show_image;
728
729                 // ctor
730                 public Xcls_MenuButton19(Xcls_MainWindow _owner )
731                 {
732                         _this = _owner;
733                         this.el = new Gtk.MenuButton();
734
735                         // my vars (dec)
736                         this.always_show_image = true;
737
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;
743                 }
744
745                 // user defined functions
746         }
747         public class Xcls_topbarmenu : Object
748         {
749                 public Gtk.PopoverMenu el;
750                 private Xcls_MainWindow  _this;
751
752
753                         // my vars (def)
754
755                 // ctor
756                 public Xcls_topbarmenu(Xcls_MainWindow _owner )
757                 {
758                         _this = _owner;
759                         _this.topbarmenu = this;
760                         this.el = new Gtk.PopoverMenu.from_model(null);
761
762                         // my vars (dec)
763
764                         // set gobject values
765                         var child_1 = new Xcls_Box21( _this );
766                         child_1.ref();
767                         this.el.set_child ( child_1.el  );
768
769                         // init method
770
771                         {
772                            // this.el.show();
773                         }
774                 }
775
776                 // user defined functions
777         }
778         public class Xcls_Box21 : Object
779         {
780                 public Gtk.Box el;
781                 private Xcls_MainWindow  _this;
782
783
784                         // my vars (def)
785
786                 // ctor
787                 public Xcls_Box21(Xcls_MainWindow _owner )
788                 {
789                         _this = _owner;
790                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
791
792                         // my vars (dec)
793
794                         // set gobject values
795                         var child_1 = new Xcls_Button22( _this );
796                         child_1.ref();
797                         this.el.append( child_1.el );
798                         var child_2 = new Xcls_Button23( _this );
799                         child_2.ref();
800                         this.el.append( child_2.el );
801                 }
802
803                 // user defined functions
804         }
805         public class Xcls_Button22 : Object
806         {
807                 public Gtk.Button el;
808                 private Xcls_MainWindow  _this;
809
810
811                         // my vars (def)
812
813                 // ctor
814                 public Xcls_Button22(Xcls_MainWindow _owner )
815                 {
816                         _this = _owner;
817                         this.el = new Gtk.Button();
818
819                         // my vars (dec)
820
821                         // set gobject values
822                         this.el.label = "Download updated Resources";
823
824                         //listeners
825                         this.el.activate.connect( ( ) => {
826                                  Resources.singleton().fetchStart();
827                         });
828                 }
829
830                 // user defined functions
831         }
832
833         public class Xcls_Button23 : Object
834         {
835                 public Gtk.Button el;
836                 private Xcls_MainWindow  _this;
837
838
839                         // my vars (def)
840
841                 // ctor
842                 public Xcls_Button23(Xcls_MainWindow _owner )
843                 {
844                         _this = _owner;
845                         this.el = new Gtk.Button();
846
847                         // my vars (dec)
848
849                         // set gobject values
850                         this.el.label = "About the Builder";
851
852                         //listeners
853                         this.el.clicked.connect( () => {
854                             About.singleton().el.show();
855                             });
856                 }
857
858                 // user defined functions
859         }
860
861
862
863
864         public class Xcls_Label24 : Object
865         {
866                 public Gtk.Label el;
867                 private Xcls_MainWindow  _this;
868
869
870                         // my vars (def)
871
872                 // ctor
873                 public Xcls_Label24(Xcls_MainWindow _owner )
874                 {
875                         _this = _owner;
876                         this.el = new Gtk.Label( "   " );
877
878                         // my vars (dec)
879
880                         // set gobject values
881                         this.el.hexpand = true;
882                 }
883
884                 // user defined functions
885         }
886
887         public class Xcls_statusbar : Object
888         {
889                 public Gtk.ProgressBar el;
890                 private Xcls_MainWindow  _this;
891
892
893                         // my vars (def)
894                 public ulong handler_id;
895
896                 // ctor
897                 public Xcls_statusbar(Xcls_MainWindow _owner )
898                 {
899                         _this = _owner;
900                         _this.statusbar = this;
901                         this.el = new Gtk.ProgressBar();
902
903                         // my vars (dec)
904                         this.handler_id = -1;
905
906                         // set gobject values
907                         this.el.show_text = true;
908
909                         // init method
910
911                         {
912                              this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
913                                 if (pos < 1) {
914                                     this.el.hide();
915                                     _this.mainpane.el.set_sensitive(true);
916                                     
917                                     return;
918                                 }
919                                  _this.mainpane.el.set_sensitive(false);
920                                  this.el.show();
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()));
923                                
924                              });
925                         }
926                 }
927
928                 // user defined functions
929         }
930
931         public class Xcls_Box26 : Object
932         {
933                 public Gtk.Box el;
934                 private Xcls_MainWindow  _this;
935
936
937                         // my vars (def)
938
939                 // ctor
940                 public Xcls_Box26(Xcls_MainWindow _owner )
941                 {
942                         _this = _owner;
943                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
944
945                         // my vars (dec)
946
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 );
958                 }
959
960                 // user defined functions
961         }
962         public class Xcls_statusbar_compilestatus_label : Object
963         {
964                 public Gtk.Label el;
965                 private Xcls_MainWindow  _this;
966
967
968                         // my vars (def)
969
970                 // ctor
971                 public Xcls_statusbar_compilestatus_label(Xcls_MainWindow _owner )
972                 {
973                         _this = _owner;
974                         _this.statusbar_compilestatus_label = this;
975                         this.el = new Gtk.Label( "Compile Status:" );
976
977                         // my vars (dec)
978
979                         // set gobject values
980                         this.el.margin_end = 4;
981                         this.el.margin_start = 4;
982                 }
983
984                 // user defined functions
985         }
986
987         public class Xcls_statusbar_errors : Object
988         {
989                 public Gtk.Button el;
990                 private Xcls_MainWindow  _this;
991
992
993                         // my vars (def)
994                 public Xcls_ValaCompileErrors popup;
995
996                 // ctor
997                 public Xcls_statusbar_errors(Xcls_MainWindow _owner )
998                 {
999                         _this = _owner;
1000                         _this.statusbar_errors = this;
1001                         this.el = new Gtk.Button();
1002
1003                         // my vars (dec)
1004
1005                         // set gobject values
1006                         this.el.icon_name = "dialog-error";
1007                         this.el.label = "0 Errors";
1008
1009                         //listeners
1010                         this.el.clicked.connect( () => {
1011                          
1012                                 if (this.popup == null) {
1013                                         return;
1014                                 }
1015                            
1016                             this.popup.show();
1017                           
1018                         });
1019                 }
1020
1021                 // user defined functions
1022                 public void setNotices (GLib.ListStore nots, int ferrors ) {
1023                     BuilderApplication.showSpinner("");
1024                      if (nots.get_n_items() < 1 ) {
1025                         this.el.hide();
1026                         if (this.popup != null) {
1027                                 this.popup.el.hide();
1028                                 }
1029                         return;
1030                     }
1031                     
1032                     this.el.show();
1033                     this.el.label = "%d/%d Errors".printf(ferrors,(int)nots.get_n_items());
1034                 
1035                     
1036                  
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);
1042                     }
1043                  
1044                         this.popup.updateNotices(nots);
1045                          
1046                 }
1047         }
1048
1049         public class Xcls_statusbar_warnings : Object
1050         {
1051                 public Gtk.Button el;
1052                 private Xcls_MainWindow  _this;
1053
1054
1055                         // my vars (def)
1056                 public Xcls_ValaCompileErrors popup;
1057
1058                 // ctor
1059                 public Xcls_statusbar_warnings(Xcls_MainWindow _owner )
1060                 {
1061                         _this = _owner;
1062                         _this.statusbar_warnings = this;
1063                         this.el = new Gtk.Button();
1064
1065                         // my vars (dec)
1066
1067                         // set gobject values
1068                         this.el.icon_name = "dialog-warning";
1069                         this.el.label = "0 Warnings";
1070
1071                         //listeners
1072                         this.el.clicked.connect( () => {
1073                          
1074                                 if (this.popup == null) {
1075                                         return;
1076                                 }
1077                            
1078                             this.popup.show();
1079                             return;
1080                         });
1081                 }
1082
1083                 // user defined functions
1084                 public void setNotices (GLib.ListStore nots, int ferrs ) {
1085                     
1086                      if (nots.get_n_items() < 1 ) {
1087                         this.el.hide();
1088                         if (this.popup != null) {
1089                                 this.popup.el.hide();
1090                                 }
1091                         return;
1092                     }
1093                     
1094                     this.el.show();
1095                     this.el.label = "%d/%d Warnings".printf(ferrs,(int)nots.get_n_items());
1096                 
1097                     
1098                  
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);
1104                     }
1105                         this.popup.updateNotices(nots);
1106                          
1107                 }
1108         }
1109
1110         public class Xcls_statusbar_depricated : Object
1111         {
1112                 public Gtk.Button el;
1113                 private Xcls_MainWindow  _this;
1114
1115
1116                         // my vars (def)
1117                 public Xcls_ValaCompileErrors popup;
1118                 public GLib.ListStore notices;
1119
1120                 // ctor
1121                 public Xcls_statusbar_depricated(Xcls_MainWindow _owner )
1122                 {
1123                         _this = _owner;
1124                         _this.statusbar_depricated = this;
1125                         this.el = new Gtk.Button();
1126
1127                         // my vars (dec)
1128                         this.notices = null;
1129
1130                         // set gobject values
1131                         this.el.icon_name = "dialog-information";
1132                         this.el.label = "0 Depricated";
1133
1134                         //listeners
1135                         this.el.clicked.connect( () => {
1136                          
1137                                 if (this.popup == null) {
1138                                         return;
1139                                 }
1140                            
1141                             this.popup.show();
1142                           
1143                         });
1144                 }
1145
1146                 // user defined functions
1147                 public void setNotices (GLib.ListStore nots, int ferrs ) {
1148                     
1149                      if (nots.get_n_items() < 1 ) {
1150                         this.el.hide();
1151                         if (this.popup != null) {
1152                                 this.popup.el.hide();
1153                                 }
1154                         return;
1155                     }
1156                     
1157                     this.el.show();
1158                     this.el.label = "%d/%d Depricated".printf(ferrs,(int)nots.get_n_items());
1159                 
1160                     
1161                  
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);
1167                     }
1168                         this.popup.updateNotices(nots);
1169                          
1170                 }
1171         }
1172
1173         public class Xcls_statusbar_run : Object
1174         {
1175                 public Gtk.Button el;
1176                 private Xcls_MainWindow  _this;
1177
1178
1179                         // my vars (def)
1180                 public Xcls_ValaCompileErrors popup;
1181                 public Palete.ValaCompileRequest? last_request;
1182
1183                 // ctor
1184                 public Xcls_statusbar_run(Xcls_MainWindow _owner )
1185                 {
1186                         _this = _owner;
1187                         _this.statusbar_run = this;
1188                         this.el = new Gtk.Button();
1189
1190                         // my vars (dec)
1191                         this.last_request = null;
1192
1193                         // set gobject values
1194                         this.el.icon_name = "media-playback-start";
1195                         this.el.label = "Run";
1196                         this.el.visible = false;
1197
1198                         //listeners
1199                         this.el.clicked.connect( () => {
1200                            
1201                            if (_this.windowstate.file == null) {
1202                                         return;
1203                                 }
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.
1207                                 return;
1208                                 }
1209                                 
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);
1214                                         }
1215                                 }
1216                                 var pr = _this.windowstate.project as Project.Gtk;
1217                                 if (pr == null) {
1218                                         return;
1219                                 }
1220                                 
1221                                 
1222                                 this.last_request= new Palete.ValaCompileRequest(
1223                                         pr,
1224                                         pr.firstBuildModuleWith(_this.windowstate.file)
1225                                 );
1226                                 this.last_request.onOutput.connect( ( str) => {
1227                                         _this.windowstate.compile_results.addLine(str);
1228                                 });
1229                                 this.last_request.run.begin( ( a, r) => {
1230                                         this.last_request.run.end(r);
1231                                 });
1232                                  if (_this.windowstate.compile_results.el.parent == null) {
1233                                         _this.windowstate.compile_results.el.set_parent(this.el);
1234                                 }
1235                                 _this.windowstate.compile_results.show(this.el,true);
1236                                          
1237                         });
1238                 }
1239
1240                 // user defined functions
1241         }
1242
1243
1244         public class Xcls_statusbar_compile_spinner : Object
1245         {
1246                 public Gtk.Spinner el;
1247                 private Xcls_MainWindow  _this;
1248
1249
1250                         // my vars (def)
1251
1252                 // ctor
1253                 public Xcls_statusbar_compile_spinner(Xcls_MainWindow _owner )
1254                 {
1255                         _this = _owner;
1256                         _this.statusbar_compile_spinner = this;
1257                         this.el = new Gtk.Spinner();
1258
1259                         // my vars (dec)
1260
1261                         // set gobject values
1262                         this.el.margin_end = 4;
1263                         this.el.margin_start = 4;
1264                         this.el.tooltip_text = "Compiling";
1265                 }
1266
1267                 // user defined functions
1268                 public void start (string icon, string tooltip) {
1269                 
1270                         if (icon == "spinner") {
1271                           this.el.show();
1272                           this.el.start();  
1273                           this.el.tooltip_text = tooltip;
1274                           _this.statusbar_compile_icon.el.hide();
1275                   } else {
1276                           this.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();         
1281                   }
1282                   
1283                          
1284                 }
1285                 public void stop () {
1286                  this.el.stop();
1287                   this.el.hide();
1288                  _this.statusbar_compile_icon.el.hide();  
1289                 }
1290         }
1291
1292         public class Xcls_statusbar_compile_icon : Object
1293         {
1294                 public Gtk.Image el;
1295                 private Xcls_MainWindow  _this;
1296
1297
1298                         // my vars (def)
1299
1300                 // ctor
1301                 public Xcls_statusbar_compile_icon(Xcls_MainWindow _owner )
1302                 {
1303                         _this = _owner;
1304                         _this.statusbar_compile_icon = this;
1305                         this.el = new Gtk.Image();
1306
1307                         // my vars (dec)
1308
1309                         // set gobject values
1310                         this.el.margin_end = 4;
1311                         this.el.margin_start = 4;
1312                         this.el.icon_size = Gtk.IconSize.NORMAL;
1313                 }
1314
1315                 // user defined functions
1316         }
1317
1318
1319
1320         public class Xcls_sidebar : Object
1321         {
1322                 public Gtk.Box el;
1323                 private Xcls_MainWindow  _this;
1324
1325
1326                         // my vars (def)
1327
1328                 // ctor
1329                 public Xcls_sidebar(Xcls_MainWindow _owner )
1330                 {
1331                         _this = _owner;
1332                         _this.sidebar = this;
1333                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1334
1335                         // my vars (dec)
1336
1337                         // set gobject values
1338                         var child_1 = new Xcls_SearchBar35( _this );
1339                         child_1.ref();
1340                         this.el.append( child_1.el );
1341                         var child_2 = new Xcls_Box38( _this );
1342                         child_2.ref();
1343                         this.el.append( child_2.el );
1344                         var child_3 = new Xcls_Paned47( _this );
1345                         child_3.ref();
1346                         this.el.append( child_3.el );
1347                 }
1348
1349                 // user defined functions
1350                 public void show () {
1351                         _this.splitview.el.show_sidebar = true;
1352                          
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));
1359                         }
1360                         _this.winsel.selectCurrent();
1361                         _this.winloading = false;
1362                         
1363                          _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1364                         
1365                         _this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);
1366                         
1367                         _this.treeview.el.set_model(_this.treeselmodel.el);
1368                         
1369                          _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;
1370                         
1371                  
1372                 }
1373         }
1374         public class Xcls_SearchBar35 : Object
1375         {
1376                 public Gtk.SearchBar el;
1377                 private Xcls_MainWindow  _this;
1378
1379
1380                         // my vars (def)
1381
1382                 // ctor
1383                 public Xcls_SearchBar35(Xcls_MainWindow _owner )
1384                 {
1385                         _this = _owner;
1386                         this.el = new Gtk.SearchBar();
1387
1388                         // my vars (dec)
1389
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;
1395                 }
1396
1397                 // user defined functions
1398         }
1399         public class Xcls_filesearch : Object
1400         {
1401                 public Gtk.SearchEntry el;
1402                 private Xcls_MainWindow  _this;
1403
1404
1405                         // my vars (def)
1406
1407                 // ctor
1408                 public Xcls_filesearch(Xcls_MainWindow _owner )
1409                 {
1410                         _this = _owner;
1411                         _this.filesearch = this;
1412                         this.el = new Gtk.SearchEntry();
1413
1414                         // my vars (dec)
1415
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 );
1422                         child_1.ref();
1423                         this.el.add_controller(  child_1.el );
1424
1425                         //listeners
1426                         this.el.search_changed.connect( ( ) => {
1427                         
1428                                 _this.windowsearch.el.set_search(this.el.get_text());
1429                                 if (this.el.text == "") {
1430                                         _this.treescroll.el.visible = false;
1431                                         return;
1432                                 }
1433                                 _this.treescroll.el.visible = true;
1434                                 _this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);
1435                         });
1436                 }
1437
1438                 // user defined functions
1439         }
1440         public class Xcls_EventControllerKey37 : Object
1441         {
1442                 public Gtk.EventControllerKey el;
1443                 private Xcls_MainWindow  _this;
1444
1445
1446                         // my vars (def)
1447
1448                 // ctor
1449                 public Xcls_EventControllerKey37(Xcls_MainWindow _owner )
1450                 {
1451                         _this = _owner;
1452                         this.el = new Gtk.EventControllerKey();
1453
1454                         // my vars (dec)
1455
1456                         // set gobject values
1457
1458                         //listeners
1459                         this.el.key_released.connect( (keyval, keycode, state) => {
1460                                 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1461                                         return;
1462                                 }
1463                                 GLib.debug(
1464                                 
1465                                         "searcj key release %d, %d, %d  ?= %d" , 
1466                                                 (int) keyval, (int)  keycode, state,
1467                                                 (int)Gdk.Key.Return
1468                                         );
1469                                 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1470                                         return;
1471                                 }
1472                                         
1473                                 var dir = 0;
1474                                 
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") {
1481                                                 return;
1482                                         }
1483                                         
1484                                         
1485                                         _this.windowstate.fileViewOpen(f,
1486                                                 _this.keystate.is_shift != 1 
1487                                         );
1488                                         
1489                                         _this.splitview.el.show_sidebar = false;
1490                                         return;
1491                                         
1492                                 
1493                                 }
1494                                 if (keyval == Gdk.Key.Up) {
1495                                         dir = -1;
1496                                 }if (keyval == Gdk.Key.Down) {
1497                                         dir = 1;
1498                                 }
1499                                 if (dir == 0) {
1500                                         return;
1501                                 }
1502                                 var ns = _this.treeselmodel.el.selected + dir;
1503                                 if (ns < 0) {
1504                                         ns = 0;
1505                                 }
1506                                 if (ns >= _this.treeselmodel.el.get_n_items()) {
1507                                         ns  = _this.treeselmodel.el.get_n_items()-1;
1508                                 }
1509                                 _this.treeselmodel.el.selected = ns;
1510                         });
1511                 }
1512
1513                 // user defined functions
1514         }
1515
1516
1517
1518         public class Xcls_Box38 : Object
1519         {
1520                 public Gtk.Box el;
1521                 private Xcls_MainWindow  _this;
1522
1523
1524                         // my vars (def)
1525
1526                 // ctor
1527                 public Xcls_Box38(Xcls_MainWindow _owner )
1528                 {
1529                         _this = _owner;
1530                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1531
1532                         // my vars (dec)
1533
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 );
1539                         child_2.ref();
1540                         this.el.append( child_2.el );
1541                 }
1542
1543                 // user defined functions
1544         }
1545         public class Xcls_open_projects_btn : Object
1546         {
1547                 public Gtk.Button el;
1548                 private Xcls_MainWindow  _this;
1549
1550
1551                         // my vars (def)
1552
1553                 // ctor
1554                 public Xcls_open_projects_btn(Xcls_MainWindow _owner )
1555                 {
1556                         _this = _owner;
1557                         _this.open_projects_btn = this;
1558                         this.el = new Gtk.Button();
1559
1560                         // my vars (dec)
1561
1562                         // set gobject values
1563                         this.el.hexpand = true;
1564                         var child_1 = new Xcls_Box40( _this );
1565                         this.el.child = child_1.el;
1566
1567                         //listeners
1568                         this.el.clicked.connect( ( ) => {
1569                                 _this.windowstate.showPopoverFiles(this.el, _this.project, false);
1570                         });
1571                 }
1572
1573                 // user defined functions
1574         }
1575         public class Xcls_Box40 : Object
1576         {
1577                 public Gtk.Box el;
1578                 private Xcls_MainWindow  _this;
1579
1580
1581                         // my vars (def)
1582
1583                 // ctor
1584                 public Xcls_Box40(Xcls_MainWindow _owner )
1585                 {
1586                         _this = _owner;
1587                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1588
1589                         // my vars (dec)
1590
1591                         // set gobject values
1592                         var child_1 = new Xcls_Image41( _this );
1593                         child_1.ref();
1594                         this.el.append( child_1.el );
1595                         var child_2 = new Xcls_Label42( _this );
1596                         child_2.ref();
1597                         this.el.append( child_2.el );
1598                 }
1599
1600                 // user defined functions
1601         }
1602         public class Xcls_Image41 : Object
1603         {
1604                 public Gtk.Image el;
1605                 private Xcls_MainWindow  _this;
1606
1607
1608                         // my vars (def)
1609
1610                 // ctor
1611                 public Xcls_Image41(Xcls_MainWindow _owner )
1612                 {
1613                         _this = _owner;
1614                         this.el = new Gtk.Image();
1615
1616                         // my vars (dec)
1617
1618                         // set gobject values
1619                         this.el.icon_name = "document-open";
1620                         this.el.margin_end = 4;
1621                 }
1622
1623                 // user defined functions
1624         }
1625
1626         public class Xcls_Label42 : Object
1627         {
1628                 public Gtk.Label el;
1629                 private Xcls_MainWindow  _this;
1630
1631
1632                         // my vars (def)
1633
1634                 // ctor
1635                 public Xcls_Label42(Xcls_MainWindow _owner )
1636                 {
1637                         _this = _owner;
1638                         this.el = new Gtk.Label( "Open File" );
1639
1640                         // my vars (dec)
1641
1642                         // set gobject values
1643                 }
1644
1645                 // user defined functions
1646         }
1647
1648
1649
1650         public class Xcls_Button43 : Object
1651         {
1652                 public Gtk.Button el;
1653                 private Xcls_MainWindow  _this;
1654
1655
1656                         // my vars (def)
1657
1658                 // ctor
1659                 public Xcls_Button43(Xcls_MainWindow _owner )
1660                 {
1661                         _this = _owner;
1662                         this.el = new Gtk.Button();
1663
1664                         // my vars (dec)
1665
1666                         // set gobject values
1667                         this.el.hexpand = true;
1668                         var child_1 = new Xcls_Box44( _this );
1669                         this.el.child = child_1.el;
1670
1671                         //listeners
1672                         this.el.clicked.connect( ( ) => {
1673                                 _this.splitview.el.show_sidebar = false;
1674                                 _this.windowstate.showPopoverFiles(_this.el, _this.project, true);
1675                         });
1676                 }
1677
1678                 // user defined functions
1679         }
1680         public class Xcls_Box44 : Object
1681         {
1682                 public Gtk.Box el;
1683                 private Xcls_MainWindow  _this;
1684
1685
1686                         // my vars (def)
1687
1688                 // ctor
1689                 public Xcls_Box44(Xcls_MainWindow _owner )
1690                 {
1691                         _this = _owner;
1692                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1693
1694                         // my vars (dec)
1695
1696                         // set gobject values
1697                         var child_1 = new Xcls_Image45( _this );
1698                         child_1.ref();
1699                         this.el.append( child_1.el );
1700                         var child_2 = new Xcls_Label46( _this );
1701                         child_2.ref();
1702                         this.el.append( child_2.el );
1703                 }
1704
1705                 // user defined functions
1706         }
1707         public class Xcls_Image45 : Object
1708         {
1709                 public Gtk.Image el;
1710                 private Xcls_MainWindow  _this;
1711
1712
1713                         // my vars (def)
1714
1715                 // ctor
1716                 public Xcls_Image45(Xcls_MainWindow _owner )
1717                 {
1718                         _this = _owner;
1719                         this.el = new Gtk.Image();
1720
1721                         // my vars (dec)
1722
1723                         // set gobject values
1724                         this.el.icon_name = "window-new";
1725                         this.el.margin_end = 4;
1726                 }
1727
1728                 // user defined functions
1729         }
1730
1731         public class Xcls_Label46 : Object
1732         {
1733                 public Gtk.Label el;
1734                 private Xcls_MainWindow  _this;
1735
1736
1737                         // my vars (def)
1738
1739                 // ctor
1740                 public Xcls_Label46(Xcls_MainWindow _owner )
1741                 {
1742                         _this = _owner;
1743                         this.el = new Gtk.Label( "New Window" );
1744
1745                         // my vars (dec)
1746
1747                         // set gobject values
1748                 }
1749
1750                 // user defined functions
1751         }
1752
1753
1754
1755
1756         public class Xcls_Paned47 : Object
1757         {
1758                 public Gtk.Paned el;
1759                 private Xcls_MainWindow  _this;
1760
1761
1762                         // my vars (def)
1763
1764                 // ctor
1765                 public Xcls_Paned47(Xcls_MainWindow _owner )
1766                 {
1767                         _this = _owner;
1768                         this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL );
1769
1770                         // my vars (dec)
1771
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;
1778                 }
1779
1780                 // user defined functions
1781         }
1782         public class Xcls_ScrolledWindow48 : Object
1783         {
1784                 public Gtk.ScrolledWindow el;
1785                 private Xcls_MainWindow  _this;
1786
1787
1788                         // my vars (def)
1789
1790                 // ctor
1791                 public Xcls_ScrolledWindow48(Xcls_MainWindow _owner )
1792                 {
1793                         _this = _owner;
1794                         this.el = new Gtk.ScrolledWindow();
1795
1796                         // my vars (dec)
1797
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;
1802                 }
1803
1804                 // user defined functions
1805         }
1806         public class Xcls_ColumnView49 : Object
1807         {
1808                 public Gtk.ColumnView el;
1809                 private Xcls_MainWindow  _this;
1810
1811
1812                         // my vars (def)
1813
1814                 // ctor
1815                 public Xcls_ColumnView49(Xcls_MainWindow _owner )
1816                 {
1817                         _this = _owner;
1818                         new Xcls_winsel( _this );
1819                         this.el = new Gtk.ColumnView( _this.winsel.el );
1820
1821                         // my vars (dec)
1822
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  );
1828                 }
1829
1830                 // user defined functions
1831         }
1832         public class Xcls_winsel : Object
1833         {
1834                 public Gtk.SingleSelection el;
1835                 private Xcls_MainWindow  _this;
1836
1837
1838                         // my vars (def)
1839                 public bool selecting;
1840
1841                 // ctor
1842                 public Xcls_winsel(Xcls_MainWindow _owner )
1843                 {
1844                         _this = _owner;
1845                         _this.winsel = this;
1846                         var child_1 = new Xcls_SortListModel51( _this );
1847                         child_1.ref();
1848                         this.el = new Gtk.SingleSelection( child_1.el );
1849
1850                         // my vars (dec)
1851                         this.selecting = false;
1852
1853                         // set gobject values
1854                         this.el.can_unselect = false;
1855                         this.el.autoselect = false;
1856
1857                         //listeners
1858                         this.el.notify["selected"].connect( () => {
1859                                 if (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {
1860                                         return;
1861                                 }
1862                                 var ws = this.el.selected_item as WindowState;
1863                                 if (ws == null) {
1864                                         return;
1865                                 }
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;
1869                                 }
1870                                 
1871                                 this.selectCurrent();
1872                          });
1873                 }
1874
1875                 // user defined functions
1876                 public void selectCurrent () {
1877                         this.selecting = true;
1878                          
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;
1883                                         break;
1884                                 }
1885                         }
1886                         this.selecting = false;
1887                  
1888                 
1889                 }
1890         }
1891         public class Xcls_SortListModel51 : Object
1892         {
1893                 public Gtk.SortListModel el;
1894                 private Xcls_MainWindow  _this;
1895
1896
1897                         // my vars (def)
1898
1899                 // ctor
1900                 public Xcls_SortListModel51(Xcls_MainWindow _owner )
1901                 {
1902                         _this = _owner;
1903                         new Xcls_winfilter( _this );
1904                         var child_2 = new Xcls_StringSorter56( _this );
1905                         child_2.ref();
1906                         this.el = new Gtk.SortListModel( _this.winfilter.el, child_2.el );
1907
1908                         // my vars (dec)
1909
1910                         // set gobject values
1911                 }
1912
1913                 // user defined functions
1914         }
1915         public class Xcls_winfilter : Object
1916         {
1917                 public Gtk.FilterListModel el;
1918                 private Xcls_MainWindow  _this;
1919
1920
1921                         // my vars (def)
1922
1923                 // ctor
1924                 public Xcls_winfilter(Xcls_MainWindow _owner )
1925                 {
1926                         _this = _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 );
1931
1932                         // my vars (dec)
1933
1934                         // set gobject values
1935                 }
1936
1937                 // user defined functions
1938         }
1939         public class Xcls_windowsearch : Object
1940         {
1941                 public Gtk.StringFilter el;
1942                 private Xcls_MainWindow  _this;
1943
1944
1945                         // my vars (def)
1946
1947                 // ctor
1948                 public Xcls_windowsearch(Xcls_MainWindow _owner )
1949                 {
1950                         _this = _owner;
1951                         _this.windowsearch = this;
1952                         var child_1 = new Xcls_PropertyExpression54( _this );
1953                         child_1.ref();
1954                         this.el = new Gtk.StringFilter( child_1.el );
1955
1956                         // my vars (dec)
1957
1958                         // set gobject values
1959                 }
1960
1961                 // user defined functions
1962         }
1963         public class Xcls_PropertyExpression54 : Object
1964         {
1965                 public Gtk.PropertyExpression el;
1966                 private Xcls_MainWindow  _this;
1967
1968
1969                         // my vars (def)
1970
1971                 // ctor
1972                 public Xcls_PropertyExpression54(Xcls_MainWindow _owner )
1973                 {
1974                         _this = _owner;
1975                         this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
1976
1977                         // my vars (dec)
1978
1979                         // set gobject values
1980                 }
1981
1982                 // user defined functions
1983         }
1984
1985
1986         public class Xcls_winmodel : Object
1987         {
1988                 public GLib.ListStore el;
1989                 private Xcls_MainWindow  _this;
1990
1991
1992                         // my vars (def)
1993
1994                 // ctor
1995                 public Xcls_winmodel(Xcls_MainWindow _owner )
1996                 {
1997                         _this = _owner;
1998                         _this.winmodel = this;
1999                         this.el = new GLib.ListStore( typeof(WindowState) );
2000
2001                         // my vars (dec)
2002
2003                         // set gobject values
2004                 }
2005
2006                 // user defined functions
2007         }
2008
2009
2010         public class Xcls_StringSorter56 : Object
2011         {
2012                 public Gtk.StringSorter el;
2013                 private Xcls_MainWindow  _this;
2014
2015
2016                         // my vars (def)
2017
2018                 // ctor
2019                 public Xcls_StringSorter56(Xcls_MainWindow _owner )
2020                 {
2021                         _this = _owner;
2022                         var child_1 = new Xcls_PropertyExpression57( _this );
2023                         child_1.ref();
2024                         this.el = new Gtk.StringSorter( child_1.el );
2025
2026                         // my vars (dec)
2027
2028                         // set gobject values
2029                         this.el.ignore_case = true;
2030                 }
2031
2032                 // user defined functions
2033         }
2034         public class Xcls_PropertyExpression57 : Object
2035         {
2036                 public Gtk.PropertyExpression el;
2037                 private Xcls_MainWindow  _this;
2038
2039
2040                         // my vars (def)
2041
2042                 // ctor
2043                 public Xcls_PropertyExpression57(Xcls_MainWindow _owner )
2044                 {
2045                         _this = _owner;
2046                         this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2047
2048                         // my vars (dec)
2049
2050                         // set gobject values
2051                 }
2052
2053                 // user defined functions
2054         }
2055
2056
2057
2058
2059         public class Xcls_projcol : Object
2060         {
2061                 public Gtk.ColumnViewColumn el;
2062                 private Xcls_MainWindow  _this;
2063
2064
2065                         // my vars (def)
2066
2067                 // ctor
2068                 public Xcls_projcol(Xcls_MainWindow _owner )
2069                 {
2070                         _this = _owner;
2071                         _this.projcol = this;
2072                         var child_1 = new Xcls_SignalListItemFactory59( _this );
2073                         child_1.ref();
2074                         this.el = new Gtk.ColumnViewColumn( "Project", child_1.el );
2075
2076                         // my vars (dec)
2077
2078                         // set gobject values
2079                         this.el.id = "projcol";
2080                         this.el.expand = true;
2081                         this.el.resizable = true;
2082                 }
2083
2084                 // user defined functions
2085         }
2086         public class Xcls_SignalListItemFactory59 : Object
2087         {
2088                 public Gtk.SignalListItemFactory el;
2089                 private Xcls_MainWindow  _this;
2090
2091
2092                         // my vars (def)
2093
2094                 // ctor
2095                 public Xcls_SignalListItemFactory59(Xcls_MainWindow _owner )
2096                 {
2097                         _this = _owner;
2098                         this.el = new Gtk.SignalListItemFactory();
2099
2100                         // my vars (dec)
2101
2102                         // set gobject values
2103
2104                         //listeners
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;
2109                                 lbl.xalign = 0;
2110                                 lbl.use_markup = true;
2111                                 lbl.ellipsize = Pango.EllipsizeMode.START;
2112                           
2113                                 (listitem as Gtk.ListItem).activatable = true;
2114                         });
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;
2118                                  
2119                                  lb.label = item.project.name;
2120                         
2121                         
2122                           
2123                         
2124                         });
2125                 }
2126
2127                 // user defined functions
2128         }
2129
2130
2131         public class Xcls_filecol : Object
2132         {
2133                 public Gtk.ColumnViewColumn el;
2134                 private Xcls_MainWindow  _this;
2135
2136
2137                         // my vars (def)
2138
2139                 // ctor
2140                 public Xcls_filecol(Xcls_MainWindow _owner )
2141                 {
2142                         _this = _owner;
2143                         _this.filecol = this;
2144                         var child_1 = new Xcls_SignalListItemFactory61( _this );
2145                         child_1.ref();
2146                         this.el = new Gtk.ColumnViewColumn( "File", child_1.el );
2147
2148                         // my vars (dec)
2149
2150                         // set gobject values
2151                         this.el.id = "filecol";
2152                         this.el.expand = true;
2153                         this.el.resizable = true;
2154                 }
2155
2156                 // user defined functions
2157         }
2158         public class Xcls_SignalListItemFactory61 : Object
2159         {
2160                 public Gtk.SignalListItemFactory el;
2161                 private Xcls_MainWindow  _this;
2162
2163
2164                         // my vars (def)
2165
2166                 // ctor
2167                 public Xcls_SignalListItemFactory61(Xcls_MainWindow _owner )
2168                 {
2169                         _this = _owner;
2170                         this.el = new Gtk.SignalListItemFactory();
2171
2172                         // my vars (dec)
2173
2174                         // set gobject values
2175
2176                         //listeners
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;
2181                                 lbl.xalign = 0;
2182                                 lbl.use_markup = true;
2183                                 lbl.ellipsize = Pango.EllipsizeMode.START;
2184                           
2185                                 (listitem as Gtk.ListItem).activatable = true;
2186                         });
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;
2190                          
2191                          lb.label = item.file.relpath;
2192                         
2193                         
2194                           
2195                         
2196                         });
2197                 }
2198
2199                 // user defined functions
2200         }
2201
2202
2203
2204
2205         public class Xcls_treescroll : Object
2206         {
2207                 public Gtk.ScrolledWindow el;
2208                 private Xcls_MainWindow  _this;
2209
2210
2211                         // my vars (def)
2212
2213                 // ctor
2214                 public Xcls_treescroll(Xcls_MainWindow _owner )
2215                 {
2216                         _this = _owner;
2217                         _this.treescroll = this;
2218                         this.el = new Gtk.ScrolledWindow();
2219
2220                         // my vars (dec)
2221
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;
2230                 }
2231
2232                 // user defined functions
2233         }
2234         public class Xcls_treeview : Object
2235         {
2236                 public Gtk.ColumnView el;
2237                 private Xcls_MainWindow  _this;
2238
2239
2240                         // my vars (def)
2241
2242                 // ctor
2243                 public Xcls_treeview(Xcls_MainWindow _owner )
2244                 {
2245                         _this = _owner;
2246                         _this.treeview = this;
2247                         new Xcls_treeselmodel( _this );
2248                         this.el = new Gtk.ColumnView( _this.treeselmodel.el );
2249
2250                         // my vars (dec)
2251
2252                         // set gobject values
2253                         this.el.hexpand = true;
2254                         this.el.vexpand = true;
2255                         var child_2 = new Xcls_GestureClick64( _this );
2256                         child_2.ref();
2257                         this.el.add_controller(  child_2.el );
2258                         new Xcls_name( _this );
2259                         this.el.append_column ( _this.name.el  );
2260                 }
2261
2262                 // user defined functions
2263         }
2264         public class Xcls_GestureClick64 : Object
2265         {
2266                 public Gtk.GestureClick el;
2267                 private Xcls_MainWindow  _this;
2268
2269
2270                         // my vars (def)
2271
2272                 // ctor
2273                 public Xcls_GestureClick64(Xcls_MainWindow _owner )
2274                 {
2275                         _this = _owner;
2276                         this.el = new Gtk.GestureClick();
2277
2278                         // my vars (dec)
2279
2280                         // set gobject values
2281
2282                         //listeners
2283                         this.el.pressed.connect( (n_press, x, y) => {
2284                                 if (n_press == 2) {
2285                                         GLib.debug("double cliced");
2286                                 } else {
2287                                         return;
2288                                 }
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") {
2294                                         return;
2295                                 }
2296                                 
2297                                 
2298                                 _this.windowstate.fileViewOpen(f,
2299                                         _this.keystate.is_shift != 1 
2300                                 );
2301                                 
2302                                 _this.splitview.el.show_sidebar = false;
2303                                 
2304                                 
2305                         
2306                         });
2307                 }
2308
2309                 // user defined functions
2310         }
2311
2312         public class Xcls_treeselmodel : Object
2313         {
2314                 public Gtk.SingleSelection el;
2315                 private Xcls_MainWindow  _this;
2316
2317
2318                         // my vars (def)
2319
2320                 // ctor
2321                 public Xcls_treeselmodel(Xcls_MainWindow _owner )
2322                 {
2323                         _this = _owner;
2324                         _this.treeselmodel = this;
2325                         var child_1 = new Xcls_FilterListModel66( _this );
2326                         child_1.ref();
2327                         this.el = new Gtk.SingleSelection( child_1.el );
2328
2329                         // my vars (dec)
2330
2331                         // set gobject values
2332                         this.el.can_unselect = true;
2333                         this.el.autoselect = true;
2334                 }
2335
2336                 // user defined functions
2337         }
2338         public class Xcls_FilterListModel66 : Object
2339         {
2340                 public Gtk.FilterListModel el;
2341                 private Xcls_MainWindow  _this;
2342
2343
2344                         // my vars (def)
2345
2346                 // ctor
2347                 public Xcls_FilterListModel66(Xcls_MainWindow _owner )
2348                 {
2349                         _this = _owner;
2350                         new Xcls_treelistsort( _this );
2351                         new Xcls_treefilter( _this );
2352                         this.el = new Gtk.FilterListModel( _this.treelistsort.el, _this.treefilter.el );
2353
2354                         // my vars (dec)
2355
2356                         // set gobject values
2357                 }
2358
2359                 // user defined functions
2360         }
2361         public class Xcls_treelistsort : Object
2362         {
2363                 public Gtk.SortListModel el;
2364                 private Xcls_MainWindow  _this;
2365
2366
2367                         // my vars (def)
2368
2369                 // ctor
2370                 public Xcls_treelistsort(Xcls_MainWindow _owner )
2371                 {
2372                         _this = _owner;
2373                         _this.treelistsort = this;
2374                         new Xcls_treelistmodel( _this );
2375                         var child_2 = new Xcls_TreeListRowSorter70( _this );
2376                         child_2.ref();
2377                         this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
2378
2379                         // my vars (dec)
2380
2381                         // set gobject values
2382                         this.el.incremental = true;
2383                 }
2384
2385                 // user defined functions
2386         }
2387         public class Xcls_treelistmodel : Object
2388         {
2389                 public Gtk.TreeListModel el;
2390                 private Xcls_MainWindow  _this;
2391
2392
2393                         // my vars (def)
2394
2395                 // ctor
2396                 public Xcls_treelistmodel(Xcls_MainWindow _owner )
2397                 {
2398                         _this = _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;
2404 }  );
2405
2406                         // my vars (dec)
2407
2408                         // set gobject values
2409                 }
2410
2411                 // user defined functions
2412         }
2413         public class Xcls_treemodel : Object
2414         {
2415                 public GLib.ListStore el;
2416                 private Xcls_MainWindow  _this;
2417
2418
2419                         // my vars (def)
2420
2421                 // ctor
2422                 public Xcls_treemodel(Xcls_MainWindow _owner )
2423                 {
2424                         _this = _owner;
2425                         _this.treemodel = this;
2426                         this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
2427
2428                         // my vars (dec)
2429
2430                         // set gobject values
2431                 }
2432
2433                 // user defined functions
2434         }
2435
2436
2437         public class Xcls_TreeListRowSorter70 : Object
2438         {
2439                 public Gtk.TreeListRowSorter el;
2440                 private Xcls_MainWindow  _this;
2441
2442
2443                         // my vars (def)
2444
2445                 // ctor
2446                 public Xcls_TreeListRowSorter70(Xcls_MainWindow _owner )
2447                 {
2448                         _this = _owner;
2449                         var child_1 = new Xcls_StringSorter71( _this );
2450                         child_1.ref();
2451                         this.el = new Gtk.TreeListRowSorter( child_1.el );
2452
2453                         // my vars (dec)
2454
2455                         // set gobject values
2456                 }
2457
2458                 // user defined functions
2459         }
2460         public class Xcls_StringSorter71 : Object
2461         {
2462                 public Gtk.StringSorter el;
2463                 private Xcls_MainWindow  _this;
2464
2465
2466                         // my vars (def)
2467
2468                 // ctor
2469                 public Xcls_StringSorter71(Xcls_MainWindow _owner )
2470                 {
2471                         _this = _owner;
2472                         var child_1 = new Xcls_PropertyExpression72( _this );
2473                         child_1.ref();
2474                         this.el = new Gtk.StringSorter( child_1.el );
2475
2476                         // my vars (dec)
2477
2478                         // set gobject values
2479                         this.el.ignore_case = true;
2480                 }
2481
2482                 // user defined functions
2483         }
2484         public class Xcls_PropertyExpression72 : Object
2485         {
2486                 public Gtk.PropertyExpression el;
2487                 private Xcls_MainWindow  _this;
2488
2489
2490                         // my vars (def)
2491
2492                 // ctor
2493                 public Xcls_PropertyExpression72(Xcls_MainWindow _owner )
2494                 {
2495                         _this = _owner;
2496                         this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender) , null, "name" );
2497
2498                         // my vars (dec)
2499
2500                         // set gobject values
2501                 }
2502
2503                 // user defined functions
2504         }
2505
2506
2507
2508
2509         public class Xcls_treefilter : Object
2510         {
2511                 public Gtk.CustomFilter el;
2512                 private Xcls_MainWindow  _this;
2513
2514
2515                         // my vars (def)
2516
2517                 // ctor
2518                 public Xcls_treefilter(Xcls_MainWindow _owner )
2519                 {
2520                         _this = _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) {
2527                 return false;
2528         }
2529         var str = _this.filesearch.el.text.down();      
2530         if (j.xtype == "Dir") {
2531         
2532                 
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") {
2536                         //      continue;
2537                         //}
2538                         if (f.content_type.contains("image")) {
2539                                 continue;
2540                         }
2541                         if (str.length < 1) {
2542                                 return true;
2543                         }
2544                         if (f.name.down().contains(str)) {
2545                                 return true;
2546                         }
2547                         
2548                 }
2549                  
2550                 return false;
2551         }
2552         //if (j.xtype != "PlainFile") {
2553         //      return false;
2554         //}
2555         if (j.content_type.contains("image")) {
2556                 return false;
2557         }
2558                          
2559         if (str.length < 1) { // no search.
2560                 return true;
2561         }
2562         if (j.name.down().contains(str)) {
2563                 return true;
2564         }
2565         return false; 
2566
2567 } );
2568
2569                         // my vars (dec)
2570
2571                         // set gobject values
2572                 }
2573
2574                 // user defined functions
2575         }
2576
2577
2578
2579         public class Xcls_name : Object
2580         {
2581                 public Gtk.ColumnViewColumn el;
2582                 private Xcls_MainWindow  _this;
2583
2584
2585                         // my vars (def)
2586
2587                 // ctor
2588                 public Xcls_name(Xcls_MainWindow _owner )
2589                 {
2590                         _this = _owner;
2591                         _this.name = this;
2592                         var child_1 = new Xcls_SignalListItemFactory75( _this );
2593                         child_1.ref();
2594                         this.el = new Gtk.ColumnViewColumn( "All Project Files", child_1.el );
2595
2596                         // my vars (dec)
2597
2598                         // set gobject values
2599                         this.el.id = "name";
2600                         this.el.expand = true;
2601                         this.el.resizable = true;
2602
2603                         // init method
2604
2605                         {
2606                                 // this.el.set_sorter(  new Gtk.StringSorter(
2607                                 //      new Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, "name")
2608                          //     ));
2609                                         
2610                         }
2611                 }
2612
2613                 // user defined functions
2614         }
2615         public class Xcls_SignalListItemFactory75 : Object
2616         {
2617                 public Gtk.SignalListItemFactory el;
2618                 private Xcls_MainWindow  _this;
2619
2620
2621                         // my vars (def)
2622
2623                 // ctor
2624                 public Xcls_SignalListItemFactory75(Xcls_MainWindow _owner )
2625                 {
2626                         _this = _owner;
2627                         this.el = new Gtk.SignalListItemFactory();
2628
2629                         // my vars (dec)
2630
2631                         // set gobject values
2632
2633                         //listeners
2634                         this.el.setup.connect( (listitem) => {
2635                                 
2636                                 var expand = new Gtk.TreeExpander();
2637                                  
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;
2645                                 
2646                                 
2647                                 lbl.justify = Gtk.Justification.LEFT;
2648                                 lbl.xalign = 0;
2649                         
2650                                 hbox.append(icon);
2651                                 hbox.append(lbl);
2652                                 expand.set_child(hbox);
2653                                 ((Gtk.ListItem)listitem).set_child(expand);
2654                                 ((Gtk.ListItem)listitem).activatable = false;
2655                         });
2656                         this.el.bind.connect( (listitem) => {
2657                                 
2658                                  //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
2659                                                 
2660                                         
2661                                         
2662                                         //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2663                                 var expand = (Gtk.TreeExpander)  ((Gtk.ListItem)listitem).get_child();
2664                                   
2665                                 var hbox = (Gtk.Box) expand.child;
2666                          
2667                                 
2668                                         var img = (Gtk.Image) hbox.get_first_child();
2669                                         var lbl = (Gtk.Label) img.get_next_sibling();
2670                         
2671                          
2672                                 
2673                                  if (lbl == null || lbl.label != "") { // do not update
2674                                         return;
2675                                 }
2676                                 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
2677                                 //GLib.debug("LR = %s", lr.get_type().name());
2678                             
2679                                 
2680                                 var jr =(JsRender.JsRender) lr.get_item();
2681                                 //GLib.debug("JR = %s", jr.get_type().name());          
2682                                 
2683                                  if (jr == null) {
2684                                          GLib.debug("Problem getting item"); 
2685                                          return;
2686                                  }
2687                         
2688                                         jr.bind_property("icon",
2689                                         img, "gicon",
2690                                        GLib.BindingFlags.SYNC_CREATE);
2691                         
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;
2695                                  
2696                                 expand.set_hide_expander(  jr.xtype != "Dir" );
2697                                  expand.set_list_row(lr);
2698                              
2699                                          
2700                                                 // bind image...
2701                         });
2702                 }
2703
2704                 // user defined functions
2705         }
2706
2707
2708
2709
2710
2711
2712         public class Xcls_keystate : Object
2713         {
2714                 public Gtk.EventControllerKey el;
2715                 private Xcls_MainWindow  _this;
2716
2717
2718                         // my vars (def)
2719                 public int is_shift;
2720
2721                 // ctor
2722                 public Xcls_keystate(Xcls_MainWindow _owner )
2723                 {
2724                         _this = _owner;
2725                         _this.keystate = this;
2726                         this.el = new Gtk.EventControllerKey();
2727
2728                         // my vars (dec)
2729                         this.is_shift = 0;
2730
2731                         // set gobject values
2732
2733                         //listeners
2734                         this.el.key_released.connect( (keyval, keycode, state) => {
2735                                 GLib.debug(
2736                                 
2737                                         "key release %d, %d, %d  ?= %d %d" , 
2738                                                 (int) keyval, (int)  keycode, state,
2739                                                 (int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK
2740                                         );
2741                                 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2742                                         this.is_shift = 0;
2743                                 }
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) {
2746                                         // ctrl O pressed
2747                                         if (!_this.splitview.el.show_sidebar) {
2748                                                 _this.sidebar.show(); 
2749                                         }
2750                                 }
2751                                 
2752                         
2753                          
2754                         });
2755                         this.el.key_pressed.connect( (keyval, keycode, state) => {
2756                         
2757                                 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2758                                         this.is_shift = 1;
2759                                         
2760                                 }
2761                                 
2762                                 
2763                                 return true;
2764                                 
2765                         });
2766                 }
2767
2768                 // user defined functions
2769         }
2770
2771
2772 }