Fix #8028 - language server performance, fix warnings and critical errors
[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                                 //      "searcj key release %d, %d, %d  ?= %d" , 
1543                                 //              (int) keyval, (int)  keycode, state,
1544                                 //              (int)Gdk.Key.Return
1545                                 //      );
1546                                 if (!_this.treescroll.el.visible || _this.treeselmodel.el.get_n_items() < 0) {
1547                                         return;
1548                                 }
1549                                         
1550                                 var dir = 0;
1551                                 
1552                                 if (keyval == Gdk.Key.Return) {
1553                                         var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
1554                                         GLib.debug("SELECTED = %s", tr.item.get_type().name());
1555                                         var f = (JsRender.JsRender) tr.item;
1556                                         GLib.debug("Click %s", f.name);
1557                                         if (f.xtype == "Dir") {
1558                                                 return;
1559                                         }
1560                                         
1561                                         
1562                                         _this.windowstate.fileViewOpen(f,
1563                                                 _this.keystate.is_shift != 1 
1564                                         );
1565                                         
1566                                         _this.splitview.el.show_sidebar = false;
1567                                         return;
1568                                         
1569                                 
1570                                 }
1571                                 if (keyval == Gdk.Key.Up) {
1572                                         dir = -1;
1573                                 }if (keyval == Gdk.Key.Down) {
1574                                         dir = 1;
1575                                 }
1576                                 if (dir == 0) {
1577                                         return;
1578                                 }
1579                                 var ns = _this.treeselmodel.el.selected + dir;
1580                                 if (ns < 0) {
1581                                         ns = 0;
1582                                 }
1583                                 if (ns >= _this.treeselmodel.el.get_n_items()) {
1584                                         ns  = _this.treeselmodel.el.get_n_items()-1;
1585                                 }
1586                                 _this.treeselmodel.el.selected = ns;
1587                         });
1588                 }
1589
1590                 // user defined functions
1591         }
1592
1593
1594         public class Xcls_Box38 : Object
1595         {
1596                 public Gtk.Box el;
1597                 private Xcls_MainWindow  _this;
1598
1599
1600                         // my vars (def)
1601
1602                 // ctor
1603                 public Xcls_Box38(Xcls_MainWindow _owner )
1604                 {
1605                         _this = _owner;
1606                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1607
1608                         // my vars (dec)
1609
1610                         // set gobject values
1611                         this.el.hexpand = true;
1612                         new Xcls_open_projects_btn( _this );
1613                         this.el.append( _this.open_projects_btn.el );
1614                         var child_2 = new Xcls_Button43( _this );
1615                         child_2.ref();
1616                         this.el.append( child_2.el );
1617                 }
1618
1619                 // user defined functions
1620         }
1621         public class Xcls_open_projects_btn : Object
1622         {
1623                 public Gtk.Button el;
1624                 private Xcls_MainWindow  _this;
1625
1626
1627                         // my vars (def)
1628
1629                 // ctor
1630                 public Xcls_open_projects_btn(Xcls_MainWindow _owner )
1631                 {
1632                         _this = _owner;
1633                         _this.open_projects_btn = this;
1634                         this.el = new Gtk.Button();
1635
1636                         // my vars (dec)
1637
1638                         // set gobject values
1639                         this.el.hexpand = true;
1640                         var child_1 = new Xcls_Box40( _this );
1641                         this.el.child = child_1.el;
1642
1643                         //listeners
1644                         this.el.clicked.connect( ( ) => {
1645                                 _this.splitview.el.show_sidebar = false;
1646                                 _this.windowstate.showPopoverFiles(this.el, _this.project, false);
1647                         });
1648                 }
1649
1650                 // user defined functions
1651         }
1652         public class Xcls_Box40 : Object
1653         {
1654                 public Gtk.Box el;
1655                 private Xcls_MainWindow  _this;
1656
1657
1658                         // my vars (def)
1659
1660                 // ctor
1661                 public Xcls_Box40(Xcls_MainWindow _owner )
1662                 {
1663                         _this = _owner;
1664                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1665
1666                         // my vars (dec)
1667
1668                         // set gobject values
1669                         var child_1 = new Xcls_Image41( _this );
1670                         child_1.ref();
1671                         this.el.append( child_1.el );
1672                         var child_2 = new Xcls_Label42( _this );
1673                         child_2.ref();
1674                         this.el.append( child_2.el );
1675                 }
1676
1677                 // user defined functions
1678         }
1679         public class Xcls_Image41 : Object
1680         {
1681                 public Gtk.Image el;
1682                 private Xcls_MainWindow  _this;
1683
1684
1685                         // my vars (def)
1686
1687                 // ctor
1688                 public Xcls_Image41(Xcls_MainWindow _owner )
1689                 {
1690                         _this = _owner;
1691                         this.el = new Gtk.Image();
1692
1693                         // my vars (dec)
1694
1695                         // set gobject values
1696                         this.el.icon_name = "document-open";
1697                         this.el.margin_end = 4;
1698                 }
1699
1700                 // user defined functions
1701         }
1702
1703         public class Xcls_Label42 : Object
1704         {
1705                 public Gtk.Label el;
1706                 private Xcls_MainWindow  _this;
1707
1708
1709                         // my vars (def)
1710
1711                 // ctor
1712                 public Xcls_Label42(Xcls_MainWindow _owner )
1713                 {
1714                         _this = _owner;
1715                         this.el = new Gtk.Label( "Open File" );
1716
1717                         // my vars (dec)
1718
1719                         // set gobject values
1720                 }
1721
1722                 // user defined functions
1723         }
1724
1725
1726
1727         public class Xcls_Button43 : Object
1728         {
1729                 public Gtk.Button el;
1730                 private Xcls_MainWindow  _this;
1731
1732
1733                         // my vars (def)
1734
1735                 // ctor
1736                 public Xcls_Button43(Xcls_MainWindow _owner )
1737                 {
1738                         _this = _owner;
1739                         this.el = new Gtk.Button();
1740
1741                         // my vars (dec)
1742
1743                         // set gobject values
1744                         this.el.hexpand = true;
1745                         var child_1 = new Xcls_Box44( _this );
1746                         this.el.child = child_1.el;
1747
1748                         //listeners
1749                         this.el.clicked.connect( ( ) => {
1750                                 _this.splitview.el.show_sidebar = false;
1751                                 _this.windowstate.showPopoverFiles(_this.el, _this.project, true);
1752                         });
1753                 }
1754
1755                 // user defined functions
1756         }
1757         public class Xcls_Box44 : Object
1758         {
1759                 public Gtk.Box el;
1760                 private Xcls_MainWindow  _this;
1761
1762
1763                         // my vars (def)
1764
1765                 // ctor
1766                 public Xcls_Box44(Xcls_MainWindow _owner )
1767                 {
1768                         _this = _owner;
1769                         this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1770
1771                         // my vars (dec)
1772
1773                         // set gobject values
1774                         var child_1 = new Xcls_Image45( _this );
1775                         child_1.ref();
1776                         this.el.append( child_1.el );
1777                         var child_2 = new Xcls_Label46( _this );
1778                         child_2.ref();
1779                         this.el.append( child_2.el );
1780                 }
1781
1782                 // user defined functions
1783         }
1784         public class Xcls_Image45 : Object
1785         {
1786                 public Gtk.Image el;
1787                 private Xcls_MainWindow  _this;
1788
1789
1790                         // my vars (def)
1791
1792                 // ctor
1793                 public Xcls_Image45(Xcls_MainWindow _owner )
1794                 {
1795                         _this = _owner;
1796                         this.el = new Gtk.Image();
1797
1798                         // my vars (dec)
1799
1800                         // set gobject values
1801                         this.el.icon_name = "window-new";
1802                         this.el.margin_end = 4;
1803                 }
1804
1805                 // user defined functions
1806         }
1807
1808         public class Xcls_Label46 : Object
1809         {
1810                 public Gtk.Label el;
1811                 private Xcls_MainWindow  _this;
1812
1813
1814                         // my vars (def)
1815
1816                 // ctor
1817                 public Xcls_Label46(Xcls_MainWindow _owner )
1818                 {
1819                         _this = _owner;
1820                         this.el = new Gtk.Label( "New Window" );
1821
1822                         // my vars (dec)
1823
1824                         // set gobject values
1825                 }
1826
1827                 // user defined functions
1828         }
1829
1830
1831
1832
1833         public class Xcls_Paned47 : Object
1834         {
1835                 public Gtk.Paned el;
1836                 private Xcls_MainWindow  _this;
1837
1838
1839                         // my vars (def)
1840
1841                 // ctor
1842                 public Xcls_Paned47(Xcls_MainWindow _owner )
1843                 {
1844                         _this = _owner;
1845                         this.el = new Gtk.Paned( Gtk.Orientation.VERTICAL );
1846
1847                         // my vars (dec)
1848
1849                         // set gobject values
1850                         this.el.vexpand = true;
1851                         var child_1 = new Xcls_ScrolledWindow48( _this );
1852                         this.el.start_child = child_1.el;
1853                         new Xcls_treescroll( _this );
1854                         this.el.end_child = _this.treescroll.el;
1855                 }
1856
1857                 // user defined functions
1858         }
1859         public class Xcls_ScrolledWindow48 : Object
1860         {
1861                 public Gtk.ScrolledWindow el;
1862                 private Xcls_MainWindow  _this;
1863
1864
1865                         // my vars (def)
1866
1867                 // ctor
1868                 public Xcls_ScrolledWindow48(Xcls_MainWindow _owner )
1869                 {
1870                         _this = _owner;
1871                         this.el = new Gtk.ScrolledWindow();
1872
1873                         // my vars (dec)
1874
1875                         // set gobject values
1876                         this.el.has_frame = true;
1877                         var child_1 = new Xcls_ColumnView49( _this );
1878                         this.el.child = child_1.el;
1879                 }
1880
1881                 // user defined functions
1882         }
1883         public class Xcls_ColumnView49 : Object
1884         {
1885                 public Gtk.ColumnView el;
1886                 private Xcls_MainWindow  _this;
1887
1888
1889                         // my vars (def)
1890
1891                 // ctor
1892                 public Xcls_ColumnView49(Xcls_MainWindow _owner )
1893                 {
1894                         _this = _owner;
1895                         new Xcls_winsel( _this );
1896                         this.el = new Gtk.ColumnView( _this.winsel.el );
1897
1898                         // my vars (dec)
1899
1900                         // set gobject values
1901                         new Xcls_projcol( _this );
1902                         this.el.append_column( _this.projcol.el );
1903                         new Xcls_filecol( _this );
1904                         this.el.append_column ( _this.filecol.el  );
1905                 }
1906
1907                 // user defined functions
1908         }
1909         public class Xcls_winsel : Object
1910         {
1911                 public Gtk.SingleSelection el;
1912                 private Xcls_MainWindow  _this;
1913
1914
1915                         // my vars (def)
1916                 public bool selecting;
1917
1918                 // ctor
1919                 public Xcls_winsel(Xcls_MainWindow _owner )
1920                 {
1921                         _this = _owner;
1922                         _this.winsel = this;
1923                         var child_1 = new Xcls_SortListModel51( _this );
1924                         child_1.ref();
1925                         this.el = new Gtk.SingleSelection( child_1.el );
1926
1927                         // my vars (dec)
1928                         this.selecting = false;
1929
1930                         // set gobject values
1931                         this.el.can_unselect = false;
1932                         this.el.autoselect = false;
1933
1934                         //listeners
1935                         this.el.notify["selected"].connect( () => {
1936                                 if (_this.winloading || this.selecting || this.el.selected == Gtk.INVALID_LIST_POSITION) {
1937                                         return;
1938                                 }
1939                                 var ws = this.el.selected_item as WindowState;
1940                                 if (ws == null) {
1941                                         return;
1942                                 }
1943                                 if (ws.file.path != _this.windowstate.file.path) {
1944                                         _this.windowstate.fileViewOpen(ws.file, ws.file_details.new_window,  -1);
1945                                         _this.splitview.el.show_sidebar = false;
1946                                 }
1947                                 
1948                                 this.selectCurrent();
1949                          });
1950                 }
1951
1952                 // user defined functions
1953                 public void selectCurrent () {
1954                         this.selecting = true;
1955                          
1956                         for(var i = 0;i < this.el.get_n_items(); i++) {
1957                                 var ws = this.el.get_item(i) as WindowState;
1958                                 if (ws.file.path == _this.windowstate.file.path) {
1959                                         this.el.selected = i;
1960                                         break;
1961                                 }
1962                         }
1963                         this.selecting = false;
1964                  
1965                 
1966                 }
1967         }
1968         public class Xcls_SortListModel51 : Object
1969         {
1970                 public Gtk.SortListModel el;
1971                 private Xcls_MainWindow  _this;
1972
1973
1974                         // my vars (def)
1975
1976                 // ctor
1977                 public Xcls_SortListModel51(Xcls_MainWindow _owner )
1978                 {
1979                         _this = _owner;
1980                         new Xcls_winfilter( _this );
1981                         var child_2 = new Xcls_StringSorter56( _this );
1982                         child_2.ref();
1983                         this.el = new Gtk.SortListModel( _this.winfilter.el, child_2.el );
1984
1985                         // my vars (dec)
1986
1987                         // set gobject values
1988                 }
1989
1990                 // user defined functions
1991         }
1992         public class Xcls_winfilter : Object
1993         {
1994                 public Gtk.FilterListModel el;
1995                 private Xcls_MainWindow  _this;
1996
1997
1998                         // my vars (def)
1999
2000                 // ctor
2001                 public Xcls_winfilter(Xcls_MainWindow _owner )
2002                 {
2003                         _this = _owner;
2004                         _this.winfilter = this;
2005                         new Xcls_winmodel( _this );
2006                         new Xcls_windowsearch( _this );
2007                         this.el = new Gtk.FilterListModel( _this.winmodel.el, _this.windowsearch.el );
2008
2009                         // my vars (dec)
2010
2011                         // set gobject values
2012                 }
2013
2014                 // user defined functions
2015         }
2016         public class Xcls_windowsearch : Object
2017         {
2018                 public Gtk.StringFilter el;
2019                 private Xcls_MainWindow  _this;
2020
2021
2022                         // my vars (def)
2023
2024                 // ctor
2025                 public Xcls_windowsearch(Xcls_MainWindow _owner )
2026                 {
2027                         _this = _owner;
2028                         _this.windowsearch = this;
2029                         var child_1 = new Xcls_PropertyExpression54( _this );
2030                         child_1.ref();
2031                         this.el = new Gtk.StringFilter( child_1.el );
2032
2033                         // my vars (dec)
2034
2035                         // set gobject values
2036                 }
2037
2038                 // user defined functions
2039         }
2040         public class Xcls_PropertyExpression54 : Object
2041         {
2042                 public Gtk.PropertyExpression el;
2043                 private Xcls_MainWindow  _this;
2044
2045
2046                         // my vars (def)
2047
2048                 // ctor
2049                 public Xcls_PropertyExpression54(Xcls_MainWindow _owner )
2050                 {
2051                         _this = _owner;
2052                         this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2053
2054                         // my vars (dec)
2055
2056                         // set gobject values
2057                 }
2058
2059                 // user defined functions
2060         }
2061
2062
2063         public class Xcls_winmodel : Object
2064         {
2065                 public GLib.ListStore el;
2066                 private Xcls_MainWindow  _this;
2067
2068
2069                         // my vars (def)
2070
2071                 // ctor
2072                 public Xcls_winmodel(Xcls_MainWindow _owner )
2073                 {
2074                         _this = _owner;
2075                         _this.winmodel = this;
2076                         this.el = new GLib.ListStore( typeof(WindowState) );
2077
2078                         // my vars (dec)
2079
2080                         // set gobject values
2081                 }
2082
2083                 // user defined functions
2084         }
2085
2086
2087         public class Xcls_StringSorter56 : Object
2088         {
2089                 public Gtk.StringSorter el;
2090                 private Xcls_MainWindow  _this;
2091
2092
2093                         // my vars (def)
2094
2095                 // ctor
2096                 public Xcls_StringSorter56(Xcls_MainWindow _owner )
2097                 {
2098                         _this = _owner;
2099                         var child_1 = new Xcls_PropertyExpression57( _this );
2100                         child_1.ref();
2101                         this.el = new Gtk.StringSorter( child_1.el );
2102
2103                         // my vars (dec)
2104
2105                         // set gobject values
2106                         this.el.ignore_case = true;
2107                 }
2108
2109                 // user defined functions
2110         }
2111         public class Xcls_PropertyExpression57 : Object
2112         {
2113                 public Gtk.PropertyExpression el;
2114                 private Xcls_MainWindow  _this;
2115
2116
2117                         // my vars (def)
2118
2119                 // ctor
2120                 public Xcls_PropertyExpression57(Xcls_MainWindow _owner )
2121                 {
2122                         _this = _owner;
2123                         this.el = new Gtk.PropertyExpression( typeof(WindowState), null, "file_name" );
2124
2125                         // my vars (dec)
2126
2127                         // set gobject values
2128                 }
2129
2130                 // user defined functions
2131         }
2132
2133
2134
2135
2136         public class Xcls_projcol : Object
2137         {
2138                 public Gtk.ColumnViewColumn el;
2139                 private Xcls_MainWindow  _this;
2140
2141
2142                         // my vars (def)
2143
2144                 // ctor
2145                 public Xcls_projcol(Xcls_MainWindow _owner )
2146                 {
2147                         _this = _owner;
2148                         _this.projcol = this;
2149                         var child_1 = new Xcls_SignalListItemFactory59( _this );
2150                         child_1.ref();
2151                         this.el = new Gtk.ColumnViewColumn( "Project", child_1.el );
2152
2153                         // my vars (dec)
2154
2155                         // set gobject values
2156                         this.el.id = "projcol";
2157                         this.el.expand = true;
2158                         this.el.resizable = true;
2159                 }
2160
2161                 // user defined functions
2162         }
2163         public class Xcls_SignalListItemFactory59 : Object
2164         {
2165                 public Gtk.SignalListItemFactory el;
2166                 private Xcls_MainWindow  _this;
2167
2168
2169                         // my vars (def)
2170
2171                 // ctor
2172                 public Xcls_SignalListItemFactory59(Xcls_MainWindow _owner )
2173                 {
2174                         _this = _owner;
2175                         this.el = new Gtk.SignalListItemFactory();
2176
2177                         // my vars (dec)
2178
2179                         // set gobject values
2180
2181                         //listeners
2182                         this.el.setup.connect( (listitem) => {
2183                         
2184                                 var li = (listitem as Gtk.ListItem);
2185                                 if (li == null) {
2186                                         return;
2187                                 }
2188                         
2189                                 var lbl = new Gtk.Label("");
2190                                 li.set_child(lbl);
2191                                 lbl.justify = Gtk.Justification.LEFT;
2192                                 lbl.xalign = 0;
2193                                 lbl.use_markup = true;
2194                                 lbl.ellipsize = Pango.EllipsizeMode.START;
2195                           
2196                                 li.activatable = true;
2197                         });
2198                         this.el.bind.connect( (listitem) => {
2199                                 var li = (listitem as Gtk.ListItem);
2200                                 if (li == null) {
2201                                         return;
2202                                 }
2203                                  var lb = (Gtk.Label) li.get_child() as Gtk.Label;
2204                                  if (lb == null) {
2205                                         return;
2206                                 }
2207                                  var item =  li.get_item() as WindowState;
2208                                  if (item == null) {
2209                                         return;
2210                                 }
2211                                  lb.label = item.project.name;
2212                         
2213                         
2214                           
2215                         
2216                         });
2217                 }
2218
2219                 // user defined functions
2220         }
2221
2222
2223         public class Xcls_filecol : Object
2224         {
2225                 public Gtk.ColumnViewColumn el;
2226                 private Xcls_MainWindow  _this;
2227
2228
2229                         // my vars (def)
2230
2231                 // ctor
2232                 public Xcls_filecol(Xcls_MainWindow _owner )
2233                 {
2234                         _this = _owner;
2235                         _this.filecol = this;
2236                         var child_1 = new Xcls_SignalListItemFactory61( _this );
2237                         child_1.ref();
2238                         this.el = new Gtk.ColumnViewColumn( "File", child_1.el );
2239
2240                         // my vars (dec)
2241
2242                         // set gobject values
2243                         this.el.id = "filecol";
2244                         this.el.expand = true;
2245                         this.el.resizable = true;
2246                 }
2247
2248                 // user defined functions
2249         }
2250         public class Xcls_SignalListItemFactory61 : Object
2251         {
2252                 public Gtk.SignalListItemFactory el;
2253                 private Xcls_MainWindow  _this;
2254
2255
2256                         // my vars (def)
2257
2258                 // ctor
2259                 public Xcls_SignalListItemFactory61(Xcls_MainWindow _owner )
2260                 {
2261                         _this = _owner;
2262                         this.el = new Gtk.SignalListItemFactory();
2263
2264                         // my vars (dec)
2265
2266                         // set gobject values
2267
2268                         //listeners
2269                         this.el.setup.connect( (listitem) => {
2270                                 var li = (listitem as Gtk.ListItem);
2271                                 if (li == null) {
2272                                         return;
2273                                 }
2274                                 var lbl = new Gtk.Label("");
2275                                 li.set_child(lbl);
2276                                 lbl.justify = Gtk.Justification.LEFT;
2277                                 lbl.xalign = 0;
2278                                 lbl.use_markup = true;
2279                                 lbl.ellipsize = Pango.EllipsizeMode.START;
2280                           
2281                                 li.activatable = true;
2282                         });
2283                         this.el.bind.connect( (listitem) => {
2284                                 var li = (listitem as Gtk.ListItem);
2285                                 if (li == null) {
2286                                         return;
2287                                 }
2288                                  var lb = (Gtk.Label) li.get_child() as Gtk.Label;
2289                                  if (lb == null) {
2290                                         return;
2291                                 }
2292                                  var item =  li.get_item() as WindowState;
2293                                  if (item == null) {
2294                                         return;
2295                                 }
2296                                 
2297                                  
2298                           
2299                                 lb.label = item.file.relpath;
2300                         
2301                         
2302                           
2303                         
2304                         });
2305                 }
2306
2307                 // user defined functions
2308         }
2309
2310
2311
2312
2313         public class Xcls_treescroll : Object
2314         {
2315                 public Gtk.ScrolledWindow el;
2316                 private Xcls_MainWindow  _this;
2317
2318
2319                         // my vars (def)
2320
2321                 // ctor
2322                 public Xcls_treescroll(Xcls_MainWindow _owner )
2323                 {
2324                         _this = _owner;
2325                         _this.treescroll = this;
2326                         this.el = new Gtk.ScrolledWindow();
2327
2328                         // my vars (dec)
2329
2330                         // set gobject values
2331                         this.el.has_frame = true;
2332                         this.el.hexpand = true;
2333                         this.el.vexpand = true;
2334                         this.el.tooltip_text = "dbl-click - opens in NEW window                        \nshift--dbl-click opens in this window";
2335                         this.el.visible = false;
2336                         new Xcls_treeview( _this );
2337                         this.el.child = _this.treeview.el;
2338                 }
2339
2340                 // user defined functions
2341         }
2342         public class Xcls_treeview : Object
2343         {
2344                 public Gtk.ColumnView el;
2345                 private Xcls_MainWindow  _this;
2346
2347
2348                         // my vars (def)
2349
2350                 // ctor
2351                 public Xcls_treeview(Xcls_MainWindow _owner )
2352                 {
2353                         _this = _owner;
2354                         _this.treeview = this;
2355                         new Xcls_treeselmodel( _this );
2356                         this.el = new Gtk.ColumnView( _this.treeselmodel.el );
2357
2358                         // my vars (dec)
2359
2360                         // set gobject values
2361                         this.el.hexpand = true;
2362                         this.el.vexpand = true;
2363                         var child_2 = new Xcls_GestureClick64( _this );
2364                         child_2.ref();
2365                         this.el.add_controller(  child_2.el );
2366                         new Xcls_name( _this );
2367                         this.el.append_column ( _this.name.el  );
2368                 }
2369
2370                 // user defined functions
2371         }
2372         public class Xcls_GestureClick64 : Object
2373         {
2374                 public Gtk.GestureClick el;
2375                 private Xcls_MainWindow  _this;
2376
2377
2378                         // my vars (def)
2379
2380                 // ctor
2381                 public Xcls_GestureClick64(Xcls_MainWindow _owner )
2382                 {
2383                         _this = _owner;
2384                         this.el = new Gtk.GestureClick();
2385
2386                         // my vars (dec)
2387
2388                         // set gobject values
2389
2390                         //listeners
2391                         this.el.pressed.connect( (n_press, x, y) => {
2392                                 if (n_press == 2) {
2393                                         GLib.debug("double cliced");
2394                                 } else {
2395                                         return;
2396                                 }
2397                                 var tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;
2398                                 GLib.debug("SELECTED = %s", tr.item.get_type().name());
2399                                 var f = (JsRender.JsRender) tr.item;
2400                                 GLib.debug("Click %s", f.name);
2401                                 if (f.xtype == "Dir") {
2402                                         return;
2403                                 }
2404                                 
2405                                 
2406                                 _this.windowstate.fileViewOpen(f,
2407                                         _this.keystate.is_shift != 1 
2408                                 );
2409                                 
2410                                 _this.splitview.el.show_sidebar = false;
2411                                 
2412                                 
2413                         
2414                         });
2415                 }
2416
2417                 // user defined functions
2418         }
2419
2420         public class Xcls_treeselmodel : Object
2421         {
2422                 public Gtk.SingleSelection el;
2423                 private Xcls_MainWindow  _this;
2424
2425
2426                         // my vars (def)
2427
2428                 // ctor
2429                 public Xcls_treeselmodel(Xcls_MainWindow _owner )
2430                 {
2431                         _this = _owner;
2432                         _this.treeselmodel = this;
2433                         var child_1 = new Xcls_FilterListModel66( _this );
2434                         child_1.ref();
2435                         this.el = new Gtk.SingleSelection( child_1.el );
2436
2437                         // my vars (dec)
2438
2439                         // set gobject values
2440                         this.el.can_unselect = true;
2441                         this.el.autoselect = true;
2442                 }
2443
2444                 // user defined functions
2445         }
2446         public class Xcls_FilterListModel66 : Object
2447         {
2448                 public Gtk.FilterListModel el;
2449                 private Xcls_MainWindow  _this;
2450
2451
2452                         // my vars (def)
2453
2454                 // ctor
2455                 public Xcls_FilterListModel66(Xcls_MainWindow _owner )
2456                 {
2457                         _this = _owner;
2458                         new Xcls_treelistsort( _this );
2459                         new Xcls_treefilter( _this );
2460                         this.el = new Gtk.FilterListModel( _this.treelistsort.el, _this.treefilter.el );
2461
2462                         // my vars (dec)
2463
2464                         // set gobject values
2465                 }
2466
2467                 // user defined functions
2468         }
2469         public class Xcls_treelistsort : Object
2470         {
2471                 public Gtk.SortListModel el;
2472                 private Xcls_MainWindow  _this;
2473
2474
2475                         // my vars (def)
2476
2477                 // ctor
2478                 public Xcls_treelistsort(Xcls_MainWindow _owner )
2479                 {
2480                         _this = _owner;
2481                         _this.treelistsort = this;
2482                         new Xcls_treelistmodel( _this );
2483                         var child_2 = new Xcls_TreeListRowSorter70( _this );
2484                         child_2.ref();
2485                         this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
2486
2487                         // my vars (dec)
2488
2489                         // set gobject values
2490                         this.el.incremental = true;
2491                 }
2492
2493                 // user defined functions
2494         }
2495         public class Xcls_treelistmodel : Object
2496         {
2497                 public Gtk.TreeListModel el;
2498                 private Xcls_MainWindow  _this;
2499
2500
2501                         // my vars (def)
2502
2503                 // ctor
2504                 public Xcls_treelistmodel(Xcls_MainWindow _owner )
2505                 {
2506                         _this = _owner;
2507                         _this.treelistmodel = this;
2508                         new Xcls_treemodel( _this );
2509                         this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
2510         //GLib.debug("liststore got %s", item.get_type().name());
2511         return ((JsRender.JsRender)item).childfiles;
2512 }  );
2513
2514                         // my vars (dec)
2515
2516                         // set gobject values
2517                 }
2518
2519                 // user defined functions
2520         }
2521         public class Xcls_treemodel : Object
2522         {
2523                 public GLib.ListStore el;
2524                 private Xcls_MainWindow  _this;
2525
2526
2527                         // my vars (def)
2528
2529                 // ctor
2530                 public Xcls_treemodel(Xcls_MainWindow _owner )
2531                 {
2532                         _this = _owner;
2533                         _this.treemodel = this;
2534                         this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
2535
2536                         // my vars (dec)
2537
2538                         // set gobject values
2539                 }
2540
2541                 // user defined functions
2542         }
2543
2544
2545         public class Xcls_TreeListRowSorter70 : Object
2546         {
2547                 public Gtk.TreeListRowSorter el;
2548                 private Xcls_MainWindow  _this;
2549
2550
2551                         // my vars (def)
2552
2553                 // ctor
2554                 public Xcls_TreeListRowSorter70(Xcls_MainWindow _owner )
2555                 {
2556                         _this = _owner;
2557                         var child_1 = new Xcls_StringSorter71( _this );
2558                         child_1.ref();
2559                         this.el = new Gtk.TreeListRowSorter( child_1.el );
2560
2561                         // my vars (dec)
2562
2563                         // set gobject values
2564                 }
2565
2566                 // user defined functions
2567         }
2568         public class Xcls_StringSorter71 : Object
2569         {
2570                 public Gtk.StringSorter el;
2571                 private Xcls_MainWindow  _this;
2572
2573
2574                         // my vars (def)
2575
2576                 // ctor
2577                 public Xcls_StringSorter71(Xcls_MainWindow _owner )
2578                 {
2579                         _this = _owner;
2580                         var child_1 = new Xcls_PropertyExpression72( _this );
2581                         child_1.ref();
2582                         this.el = new Gtk.StringSorter( child_1.el );
2583
2584                         // my vars (dec)
2585
2586                         // set gobject values
2587                         this.el.ignore_case = true;
2588                 }
2589
2590                 // user defined functions
2591         }
2592         public class Xcls_PropertyExpression72 : Object
2593         {
2594                 public Gtk.PropertyExpression el;
2595                 private Xcls_MainWindow  _this;
2596
2597
2598                         // my vars (def)
2599
2600                 // ctor
2601                 public Xcls_PropertyExpression72(Xcls_MainWindow _owner )
2602                 {
2603                         _this = _owner;
2604                         this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender) , null, "name" );
2605
2606                         // my vars (dec)
2607
2608                         // set gobject values
2609                 }
2610
2611                 // user defined functions
2612         }
2613
2614
2615
2616
2617         public class Xcls_treefilter : Object
2618         {
2619                 public Gtk.CustomFilter el;
2620                 private Xcls_MainWindow  _this;
2621
2622
2623                         // my vars (def)
2624
2625                 // ctor
2626                 public Xcls_treefilter(Xcls_MainWindow _owner )
2627                 {
2628                         _this = _owner;
2629                         _this.treefilter = this;
2630                         this.el = new Gtk.CustomFilter( (item) => { 
2631         var tr = ((Gtk.TreeListRow)item).get_item();
2632         //GLib.debug("filter %s", tr.get_type().name());
2633         var j =  (JsRender.JsRender) tr;
2634         if (j.xtype == "Dir" && j.childfiles.n_items < 1) {
2635                 return false;
2636         }
2637         var str = _this.filesearch.el.text.down();      
2638         if (j.xtype == "Dir") {
2639         
2640                 
2641                 for (var i =0 ; i < j.childfiles.n_items; i++) {
2642                         var f = (JsRender.JsRender) j.childfiles.get_item(i);
2643                         //if (f.xtype != "PlainFile") {
2644                         //      continue;
2645                         //}
2646                         if (f.content_type.contains("image")) {
2647                                 continue;
2648                         }
2649                         if (str.length < 1) {
2650                                 return true;
2651                         }
2652                         if (f.name.down().contains(str)) {
2653                                 return true;
2654                         }
2655                         
2656                 }
2657                  
2658                 return false;
2659         }
2660         //if (j.xtype != "PlainFile") {
2661         //      return false;
2662         //}
2663         if (j.content_type.contains("image")) {
2664                 return false;
2665         }
2666                          
2667         if (str.length < 1) { // no search.
2668                 return true;
2669         }
2670         if (j.name.down().contains(str)) {
2671                 return true;
2672         }
2673         return false; 
2674
2675 } );
2676
2677                         // my vars (dec)
2678
2679                         // set gobject values
2680                 }
2681
2682                 // user defined functions
2683         }
2684
2685
2686
2687         public class Xcls_name : Object
2688         {
2689                 public Gtk.ColumnViewColumn el;
2690                 private Xcls_MainWindow  _this;
2691
2692
2693                         // my vars (def)
2694
2695                 // ctor
2696                 public Xcls_name(Xcls_MainWindow _owner )
2697                 {
2698                         _this = _owner;
2699                         _this.name = this;
2700                         var child_1 = new Xcls_SignalListItemFactory75( _this );
2701                         child_1.ref();
2702                         this.el = new Gtk.ColumnViewColumn( "All Project Files", child_1.el );
2703
2704                         // my vars (dec)
2705
2706                         // set gobject values
2707                         this.el.id = "name";
2708                         this.el.expand = true;
2709                         this.el.resizable = true;
2710
2711                         // init method
2712
2713                         {
2714                                 // this.el.set_sorter(  new Gtk.StringSorter(
2715                                 //      new Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, "name")
2716                          //     ));
2717                                         
2718                         }
2719                 }
2720
2721                 // user defined functions
2722         }
2723         public class Xcls_SignalListItemFactory75 : Object
2724         {
2725                 public Gtk.SignalListItemFactory el;
2726                 private Xcls_MainWindow  _this;
2727
2728
2729                         // my vars (def)
2730
2731                 // ctor
2732                 public Xcls_SignalListItemFactory75(Xcls_MainWindow _owner )
2733                 {
2734                         _this = _owner;
2735                         this.el = new Gtk.SignalListItemFactory();
2736
2737                         // my vars (dec)
2738
2739                         // set gobject values
2740
2741                         //listeners
2742                         this.el.setup.connect( (listitem) => {
2743                                 
2744                                 var expand = new Gtk.TreeExpander();
2745                                  
2746                                 expand.set_indent_for_depth(true);
2747                                 expand.set_indent_for_icon(true);
2748                                 var hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);
2749                                 var icon = new Gtk.Image();
2750                                 icon.margin_end = 4;
2751                                 var lbl = new Gtk.Label("");
2752                                 lbl.use_markup = true;
2753                                 
2754                                 
2755                                 lbl.justify = Gtk.Justification.LEFT;
2756                                 lbl.xalign = 0;
2757                         
2758                                 hbox.append(icon);
2759                                 hbox.append(lbl);
2760                                 expand.set_child(hbox);
2761                                 ((Gtk.ListItem)listitem).set_child(expand);
2762                                 ((Gtk.ListItem)listitem).activatable = false;
2763                         });
2764                         this.el.bind.connect( (listitem) => {
2765                                 
2766                                  //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
2767                                                 
2768                                         
2769                                         
2770                                         //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
2771                                 var expand = (Gtk.TreeExpander)  ((Gtk.ListItem)listitem).get_child();
2772                                   
2773                                 var hbox = (Gtk.Box) expand.child;
2774                          
2775                                 
2776                                         var img = (Gtk.Image) hbox.get_first_child();
2777                                         var lbl = (Gtk.Label) img.get_next_sibling();
2778                         
2779                          
2780                                 
2781                                  if (lbl == null || lbl.label != "") { // do not update
2782                                         return;
2783                                 }
2784                                 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
2785                                 //GLib.debug("LR = %s", lr.get_type().name());
2786                             
2787                                 
2788                                 var jr =(JsRender.JsRender) lr.get_item();
2789                                 //GLib.debug("JR = %s", jr.get_type().name());          
2790                                 
2791                                  if (jr == null) {
2792                                          GLib.debug("Problem getting item"); 
2793                                          return;
2794                                  }
2795                         
2796                                         jr.bind_property("icon",
2797                                         img, "gicon",
2798                                        GLib.BindingFlags.SYNC_CREATE);
2799                         
2800                                 //GLib.debug("change  %s to %s", lbl.label, np.name);
2801                                 lbl.label = jr.name; // for dir's we could hsow the sub path..
2802                                 lbl.tooltip_markup = jr.path;
2803                                  
2804                                 expand.set_hide_expander(  jr.xtype != "Dir" );
2805                                  expand.set_list_row(lr);
2806                              
2807                                          
2808                                                 // bind image...
2809                         });
2810                 }
2811
2812                 // user defined functions
2813         }
2814
2815
2816
2817
2818
2819
2820         public class Xcls_keystate : Object
2821         {
2822                 public Gtk.EventControllerKey el;
2823                 private Xcls_MainWindow  _this;
2824
2825
2826                         // my vars (def)
2827                 public int is_shift;
2828
2829                 // ctor
2830                 public Xcls_keystate(Xcls_MainWindow _owner )
2831                 {
2832                         _this = _owner;
2833                         _this.keystate = this;
2834                         this.el = new Gtk.EventControllerKey();
2835
2836                         // my vars (dec)
2837                         this.is_shift = 0;
2838
2839                         // set gobject values
2840
2841                         //listeners
2842                         this.el.key_released.connect( (keyval, keycode, state) => {
2843                                 //GLib.debug(
2844                                 //      "key release %d, %d, %d  ?= %d %d" , 
2845                                 //              (int) keyval, (int)  keycode, state,
2846                                 //              (int)Gdk.Key.O, Gdk.ModifierType.CONTROL_MASK
2847                                 //      );
2848                                 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2849                                         this.is_shift = 0;
2850                                 }
2851                                 //GLib.debug("set state %d , shift = %d", (int)this.el.get_current_event_state(), Gdk.ModifierType.SHIFT_MASK);
2852                                 if (keyval == Gdk.Key.o && (state & Gdk.ModifierType.CONTROL_MASK) != 0) {
2853                                         // ctrl O pressed
2854                                         if (!_this.splitview.el.show_sidebar) {
2855                                                 _this.sidebar.show(); 
2856                                         }
2857                                 }
2858                                 
2859                         
2860                          
2861                         });
2862                         this.el.key_pressed.connect( (keyval, keycode, state) => {
2863                         
2864                                 if (keyval == Gdk.Key.Shift_L || keyval == Gdk.Key.Shift_R) {
2865                                         this.is_shift = 1;
2866                                         
2867                                 }
2868                                 
2869                                 
2870                                 return true;
2871                                 
2872                         });
2873                 }
2874
2875                 // user defined functions
2876         }
2877
2878
2879 }