JSDOC/Introspect/Constant.js
[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
8 XObject     = imports.XObject.XObject;
9 console     = imports.console.console;
10 NameSpace   = imports.NameSpace.NameSpace;
11
12 Base        = imports.Base.Base;
13
14
15
16
17
18 imports['Object.js'].load(Object);
19
20 console = imports['console.js'].console;
21
22
23
24
25 Introspect = imports['JSDOC/Introspect.js'].Introspect;
26 Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
27
28
29 /**
30  * Constant
31  */
32
33
34 Constant = XObject.define(
35     function(prop, memberOf, saveto, keylist) {
36           
37         this.name  =  GI.base_info_get_name(prop);
38         var tif    = GI.constant_info_get_type(prop);
39         var ty = GI.type_tag_to_string( GI.type_info_get_tag(tif));
40         this.type  = this.typeToName(GI.constant_info_get_type(prop));
41         
42         ///this.flags =  GI.property_info_get_flags(prop),
43         
44         
45         this.value= 'UNKNOWN';
46         
47         
48         if (ty != 'interface') {
49             
50             var argm = new GI.Argument();
51             GI.constant_info_get_value ( prop ,argm);
52             if (ty != 'utf8') {
53                 this.value = argm.v_long;
54             } else {
55                 this.value = argm.v_string;
56             }
57         } 
58         
59         this.desc = Introspect.doc(memberOf.alias + '.' + this.name)
60         
61         memberOf[saveto].push(this);
62         keylist.push(this.name);
63     },
64     Basic,
65     { }
66 );