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