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