generate gjs documentation, run under gjs
[gnome.introspection-doc-generator] / Introspect / Property.js
1 //<script type="text/javascript">
2 //Gtk = imports.gi.Gtk;
3 const GI      = imports.gi.GIRepository;
4
5 const XObject     = imports.XObject.XObject;
6 const console     = imports.console.console;
7
8 const NameSpace   = imports.Introspect.NameSpace.NameSpace;
9 const Basic       = imports.Introspect.Basic.Basic;
10
11
12 /**
13  * Property
14  */
15
16 var Property = XObject.define(
17     function(prop, memberOf, saveto, keylist) {
18         this.propertyType = 'Property';
19         var n_original = prop.get_name();
20         this.name  =  n_original.replace(/\-/g, '_') ,
21         this.type  = this.typeToName(GI.property_info_get_type(prop)),
22         this.flags =  GI.property_info_get_flags(prop),
23         this.memberOf = memberOf.alias
24         memberOf[saveto].push(this);
25         keylist.push(this.name);
26         this.desc = NameSpace.doc(this.memberOf + '.' + n_original);
27         
28
29         if (typeof(this.type) == 'string' && this.type.indexOf('.') > -1) {
30         
31             NameSpace.references[this.type] = NameSpace.references[this.type] || [];
32             NameSpace.references[this.type].push(this);
33         }
34         
35     },
36     Basic
37 );