Sync API with GLib GDir head
[gnome.introspection-doc-generator] / JSDOC / Introspect / Constant.js
1 //<script type="text/javascript">
2 //Gtk = imports.gi.Gtk;
3 GI      = imports.gi.GIRepository;
4 GLib    = imports.gi.GLib;
5 xml     = imports.libxml;
6
7 imports['Object.js'].load(Object);
8
9 console = imports['console.js'].console;
10
11
12
13
14 Introspect = imports['JSDOC/Introspect.js'].Introspect;
15 Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
16
17
18 /**
19  * Constant
20  */
21
22
23 Constant = Object.define(
24     function(prop, memberOf, saveto, keylist) {
25           
26         this.name  =  GI.base_info_get_name(prop);
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         
34         this.value= 'UNKNOWN';
35         
36         
37         if (ty != 'interface') {
38             
39             var argm = new GI.Argument();
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         this.desc = Introspect.doc(memberOf.alias + '.' + this.name)
49         
50         memberOf[saveto].push(this);
51         keylist.push(this.name);
52     },
53     Basic,
54     { }
55 );