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