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