Clones.bjs
[gitlive] / Clones.vala
1 static Clones  _Clones;
2
3 public class Clones : Object
4 {
5     public Gtk.Dialog el;
6     private Clones  _this;
7
8     public static Clones singleton()
9     {
10         if (_Clones == null) {
11             _Clones= new Clones();
12         }
13         return _Clones;
14     }
15     public Xcls_Clones Clones;
16     public Xcls_reposView reposView;
17     public Xcls_reposStore reposStore;
18     public Xcls_tv_autocommit tv_autocommit;
19     public Xcls_tv_autopush tv_autopush;
20     public Xcls_tv_repo tv_repo;
21     public Xcls_tv_current_branch tv_current_branch;
22     public Xcls_tv_last_updated tv_last_updated;
23     public Xcls_ok_button ok_button;
24
25         // my vars (def)
26
27     // ctor
28     public Clones()
29     {
30         _this = this;
31         this.el = new Gtk.Dialog();
32
33         // my vars (dec)
34
35         // set gobject values
36         this.el.title = "Manage Clones";
37         this.el.border_width = 3;
38         this.el.default_height = 500;
39         this.el.default_width = 600;
40         this.el.deletable = true;
41         this.el.modal = true;
42         var child_0 = new Xcls_Clones( _this );
43         child_0.ref();
44         this.el.get_content_area().add (  child_0.el  );
45         var child_1 = new Xcls_ok_button( _this );
46         child_1.ref();
47         this.el.add_action_widget (  child_1.el , 1  );
48
49         //listeners
50         this.el.delete_event.connect( (self, event) => {
51             this.el.hide();
52             return true; 
53             //test  
54         });
55         this.el.response.connect( (self, response_id) =>  { 
56          
57                 this.el.hide();
58           
59         });
60     }
61
62     // user defined functions
63     public void show ()    {
64     
65         
66         this.el.set_deletable(false);
67         this.el.show_all();
68         // load clones..
69     //     this.get('/reposStore').load();
70         
71         //this.get('/ok_button').el.set_sensitive(false);
72         
73         // block until we return.
74     //    var run_ret = this.el.run();
75     //    if (run_ret < 1 ) {
76     //        return  "DONE";
77     //    }
78     //    print("RUN RETURN : " + run_ret);
79     //    return "DONE";
80         //print(JSON.stringify(this.get('bug').getValue()));
81        // return this.get('bug').getValue();
82         //this.success = c.success;
83     }
84     public class Xcls_Clones : Object
85     {
86         public Gtk.Box el;
87         private Clones  _this;
88
89
90             // my vars (def)
91
92         // ctor
93         public Xcls_Clones(Clones _owner )
94         {
95             _this = _owner;
96             _this.Clones = this;
97             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
98
99             // my vars (dec)
100
101             // set gobject values
102             var child_0 = new Xcls_Box3( _this );
103             child_0.ref();
104             this.el.pack_start (  child_0.el , false,false,0 );
105             var child_1 = new Xcls_ScrolledWindow9( _this );
106             child_1.ref();
107             this.el.pack_end (  child_1.el , true,true,0 );
108         }
109
110         // user defined functions
111     }
112     public class Xcls_Box3 : Object
113     {
114         public Gtk.Box el;
115         private Clones  _this;
116
117
118             // my vars (def)
119
120         // ctor
121         public Xcls_Box3(Clones _owner )
122         {
123             _this = _owner;
124             this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
125
126             // my vars (dec)
127
128             // set gobject values
129             var child_0 = new Xcls_Button4( _this );
130             child_0.ref();
131             this.el.add (  child_0.el  );
132             var child_1 = new Xcls_Button5( _this );
133             child_1.ref();
134             this.el.add (  child_1.el  );
135             var child_2 = new Xcls_Button6( _this );
136             child_2.ref();
137             this.el.add (  child_2.el  );
138             var child_3 = new Xcls_Button7( _this );
139             child_3.ref();
140             this.el.add (  child_3.el  );
141             var child_4 = new Xcls_Button8( _this );
142             child_4.ref();
143             this.el.add (  child_4.el  );
144         }
145
146         // user defined functions
147     }
148     public class Xcls_Button4 : Object
149     {
150         public Gtk.Button el;
151         private Clones  _this;
152
153
154             // my vars (def)
155
156         // ctor
157         public Xcls_Button4(Clones _owner )
158         {
159             _this = _owner;
160             this.el = new Gtk.Button();
161
162             // my vars (dec)
163
164             // set gobject values
165             this.el.label = "Remotes / Clones";
166
167             //listeners
168             this.el.clicked.connect( () => {
169             
170             /*    var rv = this.get('/reposView');
171                 var rs = this.get('/reposStore');
172                 if (rv.el.get_selection().count_selected_rows() != 1) {
173                     //nothing?
174                     // error condition.
175                     return;
176                 }
177                 var Remotes =     imports.Remotes.Remotes;
178                 
179              
180                 var ret = {};       
181                 var s = rv.el.get_selection();
182                 var path = '';
183                 s.selected_foreach(function(model,p,iter) {
184                                                                 
185                    path = model.get_value(iter, 6).value.get_string();
186                  
187                 }); 
188             
189                 var repo = false;
190                 rs.repos.forEach(function(r) {
191                     if (r.repopath == path) {
192                         repo = r;
193                     
194                     }
195                 
196                 });
197                 Remotes.repo = repo;
198                 Remotes.el.set_transient_for(Clones.el);
199                 Clones.el.set_title("Manage Clones - " + repo.repopath);
200                 Remotes.show();
201                 Clones.el.set_title("Manage Clones");
202             
203               */   
204                 
205                  
206             
207                    
208                 
209                 
210             });
211         }
212
213         // user defined functions
214     }
215
216     public class Xcls_Button5 : Object
217     {
218         public Gtk.Button el;
219         private Clones  _this;
220
221
222             // my vars (def)
223
224         // ctor
225         public Xcls_Button5(Clones _owner )
226         {
227             _this = _owner;
228             this.el = new Gtk.Button();
229
230             // my vars (dec)
231
232             // set gobject values
233             this.el.label = "Branches";
234
235             //listeners
236             this.el.clicked.connect( () => {
237             /*
238                 var rv = this.get('/reposView');
239                 var rs = this.get('/reposStore');
240                 if (rv.el.get_selection().count_selected_rows() != 1) {
241                     //nothing?
242                     // error condition.
243                     return;
244                 }
245                 var Branches =     imports.Branches.Branches;
246                 
247              
248                 var ret = {};       
249                 var s = rv.el.get_selection();
250                 var path = '';
251                 s.selected_foreach(function(model,p,iter) {
252                                                                 
253                    path = model.get_value(iter, 6).value.get_string();
254                  
255                 }); 
256             
257                 var repo = false;
258                 rs.repos.forEach(function(r) {
259                     if (r.repopath == path) {
260                         repo = r;
261                     
262                     }
263                 
264                 });
265                 Branches.repo = repo;
266                 Branches.el.set_transient_for(Clones.el);
267                 Clones.el.set_title("Manage Clones - " + repo.repopath);
268                 Branches.show();
269                 Clones.el.set_title("Manage Clones");
270             
271                  
272                 
273                 
274                 
275             
276                    
277              */   
278                 
279             });
280         }
281
282         // user defined functions
283     }
284
285     public class Xcls_Button6 : Object
286     {
287         public Gtk.Button el;
288         private Clones  _this;
289
290
291             // my vars (def)
292
293         // ctor
294         public Xcls_Button6(Clones _owner )
295         {
296             _this = _owner;
297             this.el = new Gtk.Button();
298
299             // my vars (dec)
300
301             // set gobject values
302             this.el.label = "Merge";
303
304             //listeners
305             this.el.clicked.connect( () =>  {
306             /*
307                 var rv = this.get('/reposView');
308                 var rs = this.get('/reposStore');
309                 if (rv.el.get_selection().count_selected_rows() != 1) {
310                     //nothing?
311                     // error condition.
312                     return;
313                 }
314                 var Merger =     imports.Merger.Merger;
315                 
316              
317                 var ret = {};       
318                 var s = rv.el.get_selection();
319                 var path = '';
320                 s.selected_foreach(function(model,p,iter) {
321                                                                 
322                    path = model.get_value(iter, 6).value.get_string();
323                  
324                 }); 
325             
326                 var repo = false;
327                 rs.repos.forEach(function(r) {
328                     if (r.repopath == path) {
329                         repo = r;
330                     
331                     }
332                 
333                 });
334                 Merger.repo = repo;
335                 Merger.el.set_transient_for(Clones.el);
336                 Clones.el.set_title("Manage Clones - " + repo.repopath);
337                 Merger.show();
338                 Clones.el.set_title("Manage Clones");
339             
340                 
341                 
342             
343                  
344                 
345             
346              */      
347                 
348                 
349             });
350         }
351
352         // user defined functions
353     }
354
355     public class Xcls_Button7 : Object
356     {
357         public Gtk.Button el;
358         private Clones  _this;
359
360
361             // my vars (def)
362
363         // ctor
364         public Xcls_Button7(Clones _owner )
365         {
366             _this = _owner;
367             this.el = new Gtk.Button();
368
369             // my vars (dec)
370
371             // set gobject values
372             this.el.label = "Switch Branch";
373
374             //listeners
375             this.el.clicked.connect( () => {
376                 
377                 
378              
379                    
380                 
381                 
382             });
383         }
384
385         // user defined functions
386     }
387
388     public class Xcls_Button8 : Object
389     {
390         public Gtk.Button el;
391         private Clones  _this;
392
393
394             // my vars (def)
395
396         // ctor
397         public Xcls_Button8(Clones _owner )
398         {
399             _this = _owner;
400             this.el = new Gtk.Button();
401
402             // my vars (dec)
403
404             // set gobject values
405             this.el.label = "Pull";
406
407             //listeners
408             this.el.clicked.connect( () => {
409                 
410                 
411              
412                    
413                 
414                 
415             });
416         }
417
418         // user defined functions
419     }
420
421
422     public class Xcls_ScrolledWindow9 : Object
423     {
424         public Gtk.ScrolledWindow el;
425         private Clones  _this;
426
427
428             // my vars (def)
429
430         // ctor
431         public Xcls_ScrolledWindow9(Clones _owner )
432         {
433             _this = _owner;
434             this.el = new Gtk.ScrolledWindow( null, null );
435
436             // my vars (dec)
437
438             // set gobject values
439             this.el.shadow_type = Gtk.ShadowType.IN;
440             var child_0 = new Xcls_reposView( _this );
441             child_0.ref();
442             this.el.add (  child_0.el  );
443             var child_1 = new Xcls_TreeView24( _this );
444             child_1.ref();
445
446             // init method
447
448             {
449               
450                this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
451             }
452         }
453
454         // user defined functions
455     }
456     public class Xcls_reposView : Object
457     {
458         public Gtk.TreeView el;
459         private Clones  _this;
460
461
462             // my vars (def)
463
464         // ctor
465         public Xcls_reposView(Clones _owner )
466         {
467             _this = _owner;
468             _this.reposView = this;
469             this.el = new Gtk.TreeView();
470
471             // my vars (dec)
472
473             // set gobject values
474             var child_0 = new Xcls_reposStore( _this );
475             child_0.ref();
476             this.el.set_model (  child_0.el  );
477             var child_1 = new Xcls_tv_autocommit( _this );
478             child_1.ref();
479             this.el.append_column (  child_1.el  );
480             var child_2 = new Xcls_tv_autopush( _this );
481             child_2.ref();
482             this.el.append_column (  child_2.el  );
483             var child_3 = new Xcls_tv_repo( _this );
484             child_3.ref();
485             this.el.append_column (  child_3.el  );
486             var child_4 = new Xcls_tv_current_branch( _this );
487             child_4.ref();
488             this.el.append_column (  child_4.el  );
489             var child_5 = new Xcls_tv_last_updated( _this );
490             child_5.ref();
491             this.el.append_column (  child_5.el  );
492             var child_6 = new Xcls_TreeViewColumn22( _this );
493             child_6.ref();
494             this.el.append_column (  child_6.el  );
495
496             // init method
497
498             {
499                 var selection = this.el.get_selection();
500                 selection.set_mode( Gtk.SelectionMode.SINGLE);
501             
502             
503                 var description = new Pango.FontDescription();
504                 description.set_size(10000);
505                 this.el.override_font(description);
506             }
507
508             //listeners
509             this.el.cursor_changed.connect( ()  => {
510               // SEE SELECTION.CHANGED
511               /*
512               
513               return;
514               
515                 if (this.el.get_selection().count_selected_rows() < 1) {
516                     //nothing? - clea it?
517                     return;
518                 }
519                     var ret = {};         
520                 var model = this.get('/changedFilesStore');
521             
522                  var s = this.el.get_selection();
523                  var files = [];
524                 s.selected_foreach(function(model,p,iter) {
525                 
526                    files.push( model.get_value(iter, 0).value.get_string());
527                  
528                 });
529                 this.get('/patchview').showDiff(files); 
530                 //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();
531                  //print("OUT?" + value);// id..
532                 // load the list in the right grid..
533                  
534                 return true;
535             */
536             });
537         }
538
539         // user defined functions
540     }
541     public class Xcls_reposStore : Object
542     {
543         public Gtk.ListStore el;
544         private Clones  _this;
545
546
547             // my vars (def)
548
549         // ctor
550         public Xcls_reposStore(Clones _owner )
551         {
552             _this = _owner;
553             _this.reposStore = this;
554             this.el = new Gtk.ListStore( 0,      typeof(string),  // 0 repo
555      typeof(string),  // 1 current branch
556      typeof(string),  // 2 all branch
557      typeof(string),  // 3 updated
558      typeof(bool),   // 4 auto commit
559      typeof(bool),   // 5 auto push
560      typeof(string)   // 7 repopath
561       typeof(string)   // 8 color highlighting? );
562
563             // my vars (dec)
564
565             // set gobject values
566         }
567
568         // user defined functions
569     }
570
571     public class Xcls_tv_autocommit : Object
572     {
573         public Gtk.TreeViewColumn el;
574         private Clones  _this;
575
576
577             // my vars (def)
578
579         // ctor
580         public Xcls_tv_autocommit(Clones _owner )
581         {
582             _this = _owner;
583             _this.tv_autocommit = this;
584             this.el = new Gtk.TreeViewColumn();
585
586             // my vars (dec)
587
588             // set gobject values
589             this.el.title = "Auto Commit";
590             this.el.min_width = 50;
591             var child_0 = new Xcls_CellRendererToggle13( _this );
592             child_0.ref();
593             this.el.pack_start (  child_0.el , false );
594
595             // init method
596
597             //    this.items[0].el.set_activatable(true);
598              this.el.add_attribute(_this.keyrender.el , "active", 4 );
599         }
600
601         // user defined functions
602     }
603     public class Xcls_CellRendererToggle13 : Object
604     {
605         public Gtk.CellRendererToggle el;
606         private Clones  _this;
607
608
609             // my vars (def)
610
611         // ctor
612         public Xcls_CellRendererToggle13(Clones _owner )
613         {
614             _this = _owner;
615             this.el = new Gtk.CellRendererToggle();
616
617             // my vars (dec)
618
619             // set gobject values
620             this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
621
622             //listeners
623             this.el.toggled.connect( (self, path)  => {
624             /*    var ret ={} ;
625                 var store = this.get('/reposStore');
626                 store.el.get_iter_from_string(ret, path);
627                                                                              
628                 var value =   store.el.get_value(ret.iter,4).value.get_boolean();
629                                                                              
630                 //print(JSON.stringify(value));
631                 store.el.set_value(ret.iter,4, !value);
632                 
633                  var path =  store.el.get_value(ret.iter, 6).value.get_string();
634                  var repo = imports.Scm.Repo.Repo.get(path);
635                  repo.autocommit(!value);
636               */   
637                 
638                 
639             });
640         }
641
642         // user defined functions
643     }
644
645
646     public class Xcls_tv_autopush : Object
647     {
648         public Gtk.TreeViewColumn el;
649         private Clones  _this;
650
651
652             // my vars (def)
653
654         // ctor
655         public Xcls_tv_autopush(Clones _owner )
656         {
657             _this = _owner;
658             _this.tv_autopush = this;
659             this.el = new Gtk.TreeViewColumn();
660
661             // my vars (dec)
662
663             // set gobject values
664             this.el.title = "Auto Push";
665             this.el.min_width = 50;
666             var child_0 = new Xcls_CellRendererToggle15( _this );
667             child_0.ref();
668             this.el.pack_start (  child_0.el  );
669
670             // init method
671
672             this.el.add_attribute(this.items[0].el , 'active', 5 );
673             //      this.items[0].el.set_activatable(true);
674         }
675
676         // user defined functions
677     }
678     public class Xcls_CellRendererToggle15 : Object
679     {
680         public Gtk.CellRendererToggle el;
681         private Clones  _this;
682
683
684             // my vars (def)
685
686         // ctor
687         public Xcls_CellRendererToggle15(Clones _owner )
688         {
689             _this = _owner;
690             this.el = new Gtk.CellRendererToggle();
691
692             // my vars (dec)
693
694             // set gobject values
695             this.el.mode = Gtk.CellRendererMode.ACTIVATABLE;
696
697             //listeners
698             this.el.toggled.connect( function (self, path) {
699                 var ret ={} ;
700                 var store = this.get('/reposStore');
701                 store.el.get_iter_from_string(ret, path);
702                                                                              
703                 var value =   store.el.get_value(ret.iter,5).value.get_boolean();
704                                                                              
705                 //print(JSON.stringify(value));
706                 store.el.set_value(ret.iter,5, !value);
707                   var path =  store.el.get_value(ret.iter, 6).value.get_string();
708                  var repo = imports.Scm.Repo.Repo.get(path);
709                  repo.autopush(!value);
710                  
711             });
712         }
713
714         // user defined functions
715     }
716
717
718     public class Xcls_tv_repo : Object
719     {
720         public Gtk.TreeViewColumn el;
721         private Clones  _this;
722
723
724             // my vars (def)
725
726         // ctor
727         public Xcls_tv_repo(Clones _owner )
728         {
729             _this = _owner;
730             _this.tv_repo = this;
731             this.el = new Gtk.TreeViewColumn();
732
733             // my vars (dec)
734
735             // set gobject values
736             this.el.title = "Repo";
737             this.el.min_width = 200;
738             this.el.resizable = true;
739             var child_0 = new Xcls_CellRendererText17( _this );
740             child_0.ref();
741             this.el.pack_start (  child_0.el  );
742
743             // init method
744
745             function() {
746                 XObject.prototype.init.call(this);
747                 this.el.add_attribute(this.items[0].el , 'markup', 0 );
748             
749             }
750         }
751
752         // user defined functions
753     }
754     public class Xcls_CellRendererText17 : Object
755     {
756         public Gtk.CellRendererText el;
757         private Clones  _this;
758
759
760             // my vars (def)
761
762         // ctor
763         public Xcls_CellRendererText17(Clones _owner )
764         {
765             _this = _owner;
766             this.el = new Gtk.CellRendererText();
767
768             // my vars (dec)
769
770             // set gobject values
771         }
772
773         // user defined functions
774     }
775
776
777     public class Xcls_tv_current_branch : Object
778     {
779         public Gtk.TreeViewColumn el;
780         private Clones  _this;
781
782
783             // my vars (def)
784
785         // ctor
786         public Xcls_tv_current_branch(Clones _owner )
787         {
788             _this = _owner;
789             _this.tv_current_branch = this;
790             this.el = new Gtk.TreeViewColumn();
791
792             // my vars (dec)
793
794             // set gobject values
795             this.el.title = "Current Branch";
796             this.el.min_width = 50;
797             var child_0 = new Xcls_CellRendererText19( _this );
798             child_0.ref();
799             this.el.pack_start (  child_0.el  );
800
801             // init method
802
803             function() {
804                 XObject.prototype.init.call(this);
805                 this.el.add_attribute(this.items[0].el , 'markup', 1 );
806                  this.el.add_attribute(this.items[0].el , 'cell-background', 7 );
807             
808             }
809         }
810
811         // user defined functions
812     }
813     public class Xcls_CellRendererText19 : Object
814     {
815         public Gtk.CellRendererText el;
816         private Clones  _this;
817
818
819             // my vars (def)
820
821         // ctor
822         public Xcls_CellRendererText19(Clones _owner )
823         {
824             _this = _owner;
825             this.el = new Gtk.CellRendererText();
826
827             // my vars (dec)
828
829             // set gobject values
830         }
831
832         // user defined functions
833     }
834
835
836     public class Xcls_tv_last_updated : Object
837     {
838         public Gtk.TreeViewColumn el;
839         private Clones  _this;
840
841
842             // my vars (def)
843
844         // ctor
845         public Xcls_tv_last_updated(Clones _owner )
846         {
847             _this = _owner;
848             _this.tv_last_updated = this;
849             this.el = new Gtk.TreeViewColumn();
850
851             // my vars (dec)
852
853             // set gobject values
854             this.el.title = "Last updated";
855             this.el.min_width = 50;
856             var child_0 = new Xcls_CellRendererText21( _this );
857             child_0.ref();
858             this.el.pack_start (  child_0.el  );
859
860             // init method
861
862             function() {
863                 XObject.prototype.init.call(this);
864                 this.el.add_attribute(this.items[0].el , 'markup', 3 );
865             
866             }
867         }
868
869         // user defined functions
870     }
871     public class Xcls_CellRendererText21 : Object
872     {
873         public Gtk.CellRendererText el;
874         private Clones  _this;
875
876
877             // my vars (def)
878
879         // ctor
880         public Xcls_CellRendererText21(Clones _owner )
881         {
882             _this = _owner;
883             this.el = new Gtk.CellRendererText();
884
885             // my vars (dec)
886
887             // set gobject values
888         }
889
890         // user defined functions
891     }
892
893
894     public class Xcls_TreeViewColumn22 : Object
895     {
896         public Gtk.TreeViewColumn el;
897         private Clones  _this;
898
899
900             // my vars (def)
901
902         // ctor
903         public Xcls_TreeViewColumn22(Clones _owner )
904         {
905             _this = _owner;
906             this.el = new Gtk.TreeViewColumn();
907
908             // my vars (dec)
909
910             // set gobject values
911             this.el.title = "All Branches";
912             this.el.min_width = 50;
913             this.el.resizable = false;
914             var child_0 = new Xcls_CellRendererText23( _this );
915             child_0.ref();
916             this.el.pack_start (  child_0.el  );
917
918             // init method
919
920             function() {
921                 XObject.prototype.init.call(this);
922                 this.el.add_attribute(this.items[0].el , 'markup', 2 );
923             
924             }
925         }
926
927         // user defined functions
928     }
929     public class Xcls_CellRendererText23 : Object
930     {
931         public Gtk.CellRendererText el;
932         private Clones  _this;
933
934
935             // my vars (def)
936
937         // ctor
938         public Xcls_CellRendererText23(Clones _owner )
939         {
940             _this = _owner;
941             this.el = new Gtk.CellRendererText();
942
943             // my vars (dec)
944
945             // set gobject values
946         }
947
948         // user defined functions
949     }
950
951
952
953     public class Xcls_TreeView24 : Object
954     {
955         public Gtk.TreeView el;
956         private Clones  _this;
957
958
959             // my vars (def)
960
961         // ctor
962         public Xcls_TreeView24(Clones _owner )
963         {
964             _this = _owner;
965             this.el = new Gtk.TreeView();
966
967             // my vars (dec)
968
969             // set gobject values
970             var child_0 = new Xcls_ListStore25( _this );
971             child_0.ref();
972         }
973
974         // user defined functions
975     }
976     public class Xcls_ListStore25 : Object
977     {
978         public Gtk.ListStore el;
979         private Clones  _this;
980
981
982             // my vars (def)
983
984         // ctor
985         public Xcls_ListStore25(Clones _owner )
986         {
987             _this = _owner;
988             this.el = new Gtk.ListStore( 0, null );
989
990             // my vars (dec)
991
992             // set gobject values
993         }
994
995         // user defined functions
996     }
997
998
999
1000
1001     public class Xcls_ok_button : Object
1002     {
1003         public Gtk.Button el;
1004         private Clones  _this;
1005
1006
1007             // my vars (def)
1008
1009         // ctor
1010         public Xcls_ok_button(Clones _owner )
1011         {
1012             _this = _owner;
1013             _this.ok_button = this;
1014             this.el = new Gtk.Button();
1015
1016             // my vars (dec)
1017
1018             // set gobject values
1019             this.el.label = "Close";
1020         }
1021
1022         // user defined functions
1023     }
1024
1025 }