generate gjs documentation, run under gjs
[gnome.introspection-doc-generator] / Introspect / Constant.js
1 //<script type="text/javascript">
2 //Gtk = imports.gi.Gtk;
3 const GI        = imports.gi.GIRepository;
4 const GLib      = imports.gi.GLib;
5 //const xml       = imports.libxml;
6 const xml       = imports.gi.libxml2;
7
8
9 const XObject   = imports.XObject.XObject;
10 const console   = imports.console.console;
11
12 const NameSpace = imports.Introspect.NameSpace.NameSpace;
13 const Basic     = imports.Introspect.Basic.Basic;
14
15  
16  
17
18 /**
19  * Constant
20  */
21
22
23 var Constant = XObject.define(
24     function(prop, memberOf, saveto, keylist) {
25
26         this.name  = prop.get_name();
27         var tif    = GI.constant_info_get_type(prop);
28         var ty     = GI.type_tag_to_string( GI.type_info_get_tag(tif));
29         this.type  = this.typeToName(GI.constant_info_get_type(prop));
30
31         ///this.flags =  GI.property_info_get_flags(prop),
32
33         this.value= 'UNKNOWN';
34
35         /* gjs constant_info_get_value introspectable="0"
36         if (ty != 'interface') {
37             //var argm = new GI.Argument();
38             //var argm = new GI._Argument();
39             var argm;
40             GI.constant_info_get_value(prop, argm);
41             if (ty != 'utf8') {
42                 this.value = argm.v_long;
43             } else {
44                 this.value = argm.v_string;
45             }
46         } 
47         */
48
49         this.desc = NameSpace.doc(memberOf.alias + '.' + this.name)
50
51         memberOf[saveto].push(this);
52         keylist.push(this.name);
53     },
54
55     Basic,
56
57     {}
58 );