More commits to sync working copy
[gnome.introspection-doc-generator] / JSDOC / Introspect / Constant.js
index 10502e0..f9558b2 100644 (file)
@@ -3,11 +3,12 @@
 GI      = imports.gi.GIRepository;
 GLib    = imports.gi.GLib;
 xml     = imports.libxml;
-//GObject = imports.gi.GObject;
+
+imports['Object.js'].load(Object);
 
 console = imports['console.js'].console;
 JSDOC   = imports['JSDOC.js'].JSDOC;
-Roo     = imports['Roo.js'].Roo;
+
 
 
 Introspect = imports['JSDOC/Introspect.js'].Introspect;
@@ -19,35 +20,36 @@ Basic = imports['JSDOC/Introspect/Basic.js'].Basic;
  */
 
 
-Constant = function(prop, memberOf, saveto, keylist) {
-      
-    this.name  =  GI.base_info_get_name(prop);
-    var tif    = GI.constant_info_get_type(prop);
-    var ty = GI.type_tag_to_string( GI.type_info_get_tag(tif));
-    this.type  = this.typeToName(GI.constant_info_get_type(prop));
-    
-    ///this.flags =  GI.property_info_get_flags(prop),
-    
-    
-    this.value= 'UNKNOWN';
-    
-    
-    if (ty != 'interface') {
+Constant = Object.define(
+    function(prop, memberOf, saveto, keylist) {
+          
+        this.name  =  GI.base_info_get_name(prop);
+        var tif    = GI.constant_info_get_type(prop);
+        var ty = GI.type_tag_to_string( GI.type_info_get_tag(tif));
+        this.type  = this.typeToName(GI.constant_info_get_type(prop));
+        
+        ///this.flags =  GI.property_info_get_flags(prop),
+        
+        
+        this.value= 'UNKNOWN';
+        
+        
+        if (ty != 'interface') {
+            
+            var argm = new GI.Argument();
+            GI.constant_info_get_value ( prop ,argm);
+            if (ty != 'utf8') {
+                this.value = argm.v_long;
+            } else {
+                this.value = argm.v_string;
+            }
+        } 
+        
+        this.desc = Introspect.doc(memberOf.alias + '.' + this.name)
         
-        var argm = new GI.Argument();
-        GI.constant_info_get_value ( prop ,argm);
-        if (ty != 'utf8') {
-            this.value = argm.v_long;
-        } else {
-            this.value = argm.v_string;
-        }
-    } 
-    
-    this.desc = Introspect.doc(memberOf.alias + '.' + this.name)
-    
-    memberOf[saveto].push(this);
-    keylist.push(this.name);
-}
-
-
-Roo.extend(Constant,Basic);
+        memberOf[saveto].push(this);
+        keylist.push(this.name);
+    },
+    Basic,
+    { }
+);