Fix #8089 - phase 1 - code ast navigation
[roobuilder] / src / Builder4 / CodeInfo.vala
1 static CodeInfo  _CodeInfo;
2
3 public class CodeInfo : Object
4 {
5         public Gtk.Popover el;
6         private CodeInfo  _this;
7
8         public static CodeInfo singleton()
9         {
10                 if (_CodeInfo == null) {
11                     _CodeInfo= new CodeInfo();
12                 }
13                 return _CodeInfo;
14         }
15
16                 // my vars (def)
17
18         // ctor
19         public CodeInfo()
20         {
21                 _this = this;
22                 this.el = new Gtk.Popover();
23
24                 // my vars (dec)
25
26                 // set gobject values
27                 var child_1 = new Xcls_Paned1( _this );
28                 child_1.ref();
29                 this.el.child = child_1.el;
30         }
31
32         // user defined functions
33         public void show (Gtk.Widget onbtn) {
34            this.el.set_parent(onbtn);
35                 this.el.popup();
36         }
37         public class Xcls_Paned1 : Object
38         {
39                 public Gtk.Paned el;
40                 private CodeInfo  _this;
41
42
43                         // my vars (def)
44
45                 // ctor
46                 public Xcls_Paned1(CodeInfo _owner )
47                 {
48                         _this = _owner;
49                         this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
50
51                         // my vars (dec)
52
53                         // set gobject values
54                         var child_1 = new Xcls_Notebook2( _this );
55                         child_1.ref();
56                         this.el.end_child = child_1.el;
57                         var child_2 = new Xcls_Box5( _this );
58                         child_2.ref();
59                         this.el.start_child = child_2.el;
60                 }
61
62                 // user defined functions
63         }
64         public class Xcls_Notebook2 : Object
65         {
66                 public Gtk.Notebook el;
67                 private CodeInfo  _this;
68
69
70                         // my vars (def)
71
72                 // ctor
73                 public Xcls_Notebook2(CodeInfo _owner )
74                 {
75                         _this = _owner;
76                         this.el = new Gtk.Notebook();
77
78                         // my vars (dec)
79
80                         // set gobject values
81                         var child_1 = new Xcls_NotebookPage3( _this  , this);
82                         child_1.ref();
83                 }
84
85                 // user defined functions
86         }
87         public class Xcls_NotebookPage3 : Object
88         {
89                 public Gtk.NotebookPage el;
90                 private CodeInfo  _this;
91
92
93                         // my vars (def)
94                 public string tab_label;
95
96                 // ctor
97                 public Xcls_NotebookPage3(CodeInfo _owner , Xcls_Notebook2 notebook)
98                 {
99                         _this = _owner;
100
101                         // my vars (dec)
102                         this.tab_label = "Documentation";
103                         var child_1 = new Xcls_WebView4( _this );
104                         child_1.ref();
105                         notebook.el.append_page( child_1.el , new Gtk.Label(this.tab_label) );
106                 }
107
108                 // user defined functions
109         }
110         public class Xcls_WebView4 : Object
111         {
112                 public WebKit.WebView el;
113                 private CodeInfo  _this;
114
115
116                         // my vars (def)
117
118                 // ctor
119                 public Xcls_WebView4(CodeInfo _owner )
120                 {
121                         _this = _owner;
122                         this.el = new WebKit.WebView();
123
124                         // my vars (dec)
125
126                         // set gobject values
127                 }
128
129                 // user defined functions
130         }
131
132
133
134         public class Xcls_Box5 : Object
135         {
136                 public Gtk.Box el;
137                 private CodeInfo  _this;
138
139
140                         // my vars (def)
141
142                 // ctor
143                 public Xcls_Box5(CodeInfo _owner )
144                 {
145                         _this = _owner;
146                         this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
147
148                         // my vars (dec)
149
150                         // set gobject values
151                         this.el.hexpand = true;
152                         this.el.vexpand = true;
153                         var child_1 = new Xcls_SearchBar6( _this );
154                         child_1.ref();
155                         this.el.append( child_1.el );
156                         var child_2 = new Xcls_ScrolledWindow595( _this );
157                         child_2.ref();
158                         this.el.append( child_2.el );
159                 }
160
161                 // user defined functions
162         }
163         public class Xcls_SearchBar6 : Object
164         {
165                 public Gtk.SearchBar el;
166                 private CodeInfo  _this;
167
168
169                         // my vars (def)
170
171                 // ctor
172                 public Xcls_SearchBar6(CodeInfo _owner )
173                 {
174                         _this = _owner;
175                         this.el = new Gtk.SearchBar();
176
177                         // my vars (dec)
178
179                         // set gobject values
180                         this.el.hexpand = true;
181                         this.el.search_mode_enabled = true;
182                         var child_1 = new Xcls_SearchEntry1881( _this );
183                         child_1.ref();
184                         this.el.child = child_1.el;
185                 }
186
187                 // user defined functions
188         }
189         public class Xcls_SearchEntry1881 : Object
190         {
191                 public Gtk.SearchEntry el;
192                 private CodeInfo  _this;
193
194
195                         // my vars (def)
196
197                 // ctor
198                 public Xcls_SearchEntry1881(CodeInfo _owner )
199                 {
200                         _this = _owner;
201                         this.el = new Gtk.SearchEntry();
202
203                         // my vars (dec)
204
205                         // set gobject values
206                         this.el.hexpand = true;
207                         this.el.activates_default = true;
208                 }
209
210                 // user defined functions
211         }
212
213
214         public class Xcls_ScrolledWindow595 : Object
215         {
216                 public Gtk.ScrolledWindow el;
217                 private CodeInfo  _this;
218
219
220                         // my vars (def)
221
222                 // ctor
223                 public Xcls_ScrolledWindow595(CodeInfo _owner )
224                 {
225                         _this = _owner;
226                         this.el = new Gtk.ScrolledWindow();
227
228                         // my vars (dec)
229
230                         // set gobject values
231                         this.el.hexpand = true;
232                         this.el.vexpand = true;
233                         var child_1 = new Xcls_ColumnView596( _this );
234                         child_1.ref();
235                         this.el.child = child_1.el;
236                 }
237
238                 // user defined functions
239         }
240         public class Xcls_ColumnView596 : Object
241         {
242                 public Gtk.ColumnView el;
243                 private CodeInfo  _this;
244
245
246                         // my vars (def)
247
248                 // ctor
249                 public Xcls_ColumnView596(CodeInfo _owner )
250                 {
251                         _this = _owner;
252                         var child_1 = new Xcls_SingleSelection35( _this );
253                         child_1.ref();
254                         this.el = new Gtk.ColumnView( child_1.el );
255
256                         // my vars (dec)
257
258                         // set gobject values
259                         var child_2 = new Xcls_ColumnViewColumn597( _this );
260                         child_2.ref();
261                         this.el.append_column( child_2.el );
262                 }
263
264                 // user defined functions
265         }
266         public class Xcls_ColumnViewColumn597 : Object
267         {
268                 public Gtk.ColumnViewColumn el;
269                 private CodeInfo  _this;
270
271
272                         // my vars (def)
273
274                 // ctor
275                 public Xcls_ColumnViewColumn597(CodeInfo _owner )
276                 {
277                         _this = _owner;
278                         var child_1 = new Xcls_SignalListItemFactory95( _this );
279                         child_1.ref();
280                         this.el = new Gtk.ColumnViewColumn( "Object Navigation", child_1.el );
281
282                         // my vars (dec)
283
284                         // set gobject values
285                         this.el.expand = true;
286                 }
287
288                 // user defined functions
289         }
290         public class Xcls_SignalListItemFactory95 : Object
291         {
292                 public Gtk.SignalListItemFactory el;
293                 private CodeInfo  _this;
294
295
296                         // my vars (def)
297
298                 // ctor
299                 public Xcls_SignalListItemFactory95(CodeInfo _owner )
300                 {
301                         _this = _owner;
302                         this.el = new Gtk.SignalListItemFactory();
303
304                         // my vars (dec)
305
306                         // set gobject values
307
308                         //listeners
309                         this.el.setup.connect( (listitem) => {
310                                 
311                                 var expand = new Gtk.TreeExpander();
312                                  
313                                 expand.set_indent_for_depth(true);
314                                 expand.set_indent_for_icon(true);
315                                 var hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);
316                                 var icon = new Gtk.Image();
317                                 var lbl = new Gtk.Label("");
318                                 lbl.use_markup = true;
319                                 lbl.ellipsize = Pango.EllipsizeMode.END;
320                                 
321                                 icon.margin_end = 4;
322                                 lbl.justify = Gtk.Justification.LEFT;
323                                 lbl.xalign = 0;
324                         
325                         //      listitem.activatable = true; ??
326                                 
327                                 hbox.append(icon);
328                                 hbox.append(lbl);
329                                 expand.set_child(hbox);
330                                 ((Gtk.ListItem)listitem).set_child(expand);
331                                 
332                         });
333                         this.el.bind.connect( (listitem) => {
334                                 // GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
335                                 
336                                 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
337                                 var expand = (Gtk.TreeExpander)  ((Gtk.ListItem)listitem).get_child();
338                                  
339                                  
340                                 var hbox = (Gtk.Box) expand.child;
341                          
342                                 
343                                 var img = (Gtk.Image) hbox.get_first_child();
344                                 var lbl = (Gtk.Label) img.get_next_sibling();
345                                 
346                                 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
347                                 var node = (JsRender.Node) lr.get_item();
348                                 if (node == null || node.fqn() == "") {
349                                         return;
350                                 }
351                            
352                             expand.set_hide_expander( !node.hasChildren() );
353                                 expand.set_list_row(lr);
354                                 
355                                 node.bind_property("iconResourceName",
356                                             img, "resource",
357                                            GLib.BindingFlags.SYNC_CREATE);
358                                 
359                                 node.bind_property("nodeTitleProp",
360                                             lbl, "label",
361                                            GLib.BindingFlags.SYNC_CREATE);
362                                 node.bind_property("nodeTipProp",
363                                             lbl, "tooltip_markup",
364                                            GLib.BindingFlags.SYNC_CREATE);
365                                 // bind image...
366                                 
367                         });
368                 }
369
370                 // user defined functions
371         }
372
373
374         public class Xcls_SingleSelection35 : Object
375         {
376                 public Gtk.SingleSelection el;
377                 private CodeInfo  _this;
378
379
380                         // my vars (def)
381
382                 // ctor
383                 public Xcls_SingleSelection35(CodeInfo _owner )
384                 {
385                         _this = _owner;
386                         var child_1 = new Xcls_TreeListModel58( _this );
387                         child_1.ref();
388                         this.el = new Gtk.SingleSelection( child_1.el );
389
390                         // my vars (dec)
391
392                         // set gobject values
393                 }
394
395                 // user defined functions
396         }
397         public class Xcls_TreeListModel58 : Object
398         {
399                 public Gtk.TreeListModel el;
400                 private CodeInfo  _this;
401
402
403                         // my vars (def)
404
405                 // ctor
406                 public Xcls_TreeListModel58(CodeInfo _owner )
407                 {
408                         _this = _owner;
409                         var child_1 = new Xcls_ListStore81( _this );
410                         child_1.ref();
411                         this.el = new Gtk.TreeListModel( child_1.el, false, true, (item) => {
412         //fixme...
413         return ((JsRender.Node)item).childstore;
414 }
415  );
416
417                         // my vars (dec)
418
419                         // set gobject values
420                 }
421
422                 // user defined functions
423         }
424         public class Xcls_ListStore81 : Object
425         {
426                 public GLib.ListStore el;
427                 private CodeInfo  _this;
428
429
430                         // my vars (def)
431
432                 // ctor
433                 public Xcls_ListStore81(CodeInfo _owner )
434                 {
435                         _this = _owner;
436                         this.el = new GLib.ListStore( typeof(JsRender.Node) );
437
438                         // my vars (dec)
439
440                         // set gobject values
441                 }
442
443                 // user defined functions
444         }
445
446
447
448
449
450
451
452 }