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