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