More commits to sync working copy
[gnome.introspection-doc-generator] / JSDOC / Introspect / Enum.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 imports['Object.js'].load(Object);
9
10 console = imports['console.js'].console;
11 JSDOC   = imports['JSDOC.js'].JSDOC;
12
13
14
15 Introspect = imports['JSDOC/Introspect.js'].Introspect;
16 Base = imports['JSDOC/Introspect/Base.js'].Base;
17
18
19
20
21
22 Enum = Object.define(
23     function(ns, name) {
24         Base.call(this, ns, name);
25     },
26     Base, 
27     {
28         titleType: 'Enum',
29          _loaded : false,
30         load : function()
31         {
32             if (this._loaded) {
33                 return; // already loaded..
34             }
35             
36             this.desc = Introspect.doc(this.alias);
37             var bi = this.getBI();
38                  
39             for(var i =0; i < GI.enum_info_get_n_values(bi); i++) {
40                
41                 var prop = GI.enum_info_get_value(bi,i);
42                  
43               
44                 this.values.push({
45                     name :  GI.base_info_get_name(prop).toUpperCase() ,
46                     type :   GI.type_tag_to_string(GI.enum_info_get_storage_type(bi)),
47                     value:   GI.value_info_get_value(prop) ,
48                     memberOf : this.alias
49                 });
50             }
51             
52             this._loaded = true;
53              
54              
55             
56             
57         }
58 });
59
60