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