sync with gnome master
authorAlan Knowles <alan@akbkhome.com>
Thu, 31 Mar 2011 05:39:28 +0000 (13:39 +0800)
committerAlan Knowles <alan@akbkhome.com>
Thu, 31 Mar 2011 05:39:28 +0000 (13:39 +0800)
30 files changed:
File.js
Introspect/Base.js
Introspect/Basic.js
Introspect/Callback.js
Introspect/Class.js
Introspect/Constant.js
Introspect/Enum.js
Introspect/Field.js
Introspect/Interface.js
Introspect/Link.js
Introspect/Method.js
Introspect/NameSpace.js
Introspect/Property.js
Introspect/Signal.js
Introspect/Struct.js
Introspect/Union.js
JSDOC/DocComment.js
JSDOC/Packer.js
JsTemplate/Template.js
String.js
XObject.js
console.js
docs.js
templates/gjs/class.html [new file with mode: 0644]
templates/gjs/class_ix.html [new file with mode: 0644]
templates/gjs/index.html [new file with mode: 0644]
templates/gjs/references.html [new file with mode: 0644]
templates/resources/page.js
templates/seed/class.html
templates/seed/class_ix.html

diff --git a/File.js b/File.js
index 77777ba..c09d036 100755 (executable)
--- a/File.js
+++ b/File.js
@@ -1,8 +1,10 @@
 // <script type ="text/Javascript">
-GLib = imports.gi.GLib;
-Gio = imports.gi.Gio;
+const GLib = imports.gi.GLib;
+const Gio  = imports.gi.Gio;
+
+//const String  = imports.String.String;
+const console = imports.console.console;
 
-String  = imports.String.String; 
 /**
 * @namespace File
 * 
@@ -21,34 +23,67 @@ var File = {
 
     SEPARATOR : '/',
 
+    // fixme - this needs a bitter location..
+    // they where in a string class before, but  overriding String methods is not a good normally a good idea..
+    rtrim : function (s,toTrim) {
+        if (s.substr(s.length - toTrim.length) == toTrim) {
+            return s.slice(0, s.length - toTrim.length);
+        }
+   
+        return s;
+    },
+
+    trim : function (s,toTrim) {
+        var out = this.ltrim(s,toTrim);
+        out = this.rtrim(out,toTrim);
+        return out;
+    },
+    
+    ltrim : function (s, toTrim) {
+        if (s.substr(0, toTrim.length) == toTrim) {
+            return s.slice(toTrim.length);
+        }
+        
+        return s;
+    },
+    
     join : function () {
         var out = "";
         for (var i = 0; i < arguments.length; i++) {
             if (i == 0) {
-              out += arguments[i].rtrim(File.SEPARATOR);
+              out += this.rtrim(arguments[i], File.SEPARATOR);
             }
             else if (i == arguments.length - 1) {
-              out += File.SEPARATOR + arguments[i].ltrim(File.SEPARATOR);
+              out += File.SEPARATOR + this.ltrim(arguments[i], File.SEPARATOR);
             }
             else {
-              out += File.SEPARATOR + arguments[i].trim(File.SEPARATOR);
+              out += File.SEPARATOR + this.trim(arguments[i], File.SEPARATOR);
             }
         }
         return out;
-    },
+    }, 
 
     read : function (path) {
         var out = {};
-        GLib.file_get_contents(path, out, null, null);
-        return out['value'];
+        if (typeof(Seed) == 'undefined') {
+            var ret;
+            var err;
+            [ret, out, err] = GLib.file_get_contents(path, out, null, null);
+            return out;
+        } else {
+            GLib.file_get_contents(path, out, null);
+            return out['value'];
+        }
     },
 
     isFile : function (path) {
       return GLib.file_test(path, GLib.FileTest.IS_REGULAR);
     },
+
     exists : function (path) {
       return GLib.file_test(path, GLib.FileTest.EXISTS);
     },
+
     isDirectory : function (path) {
       return GLib.file_test(path, GLib.FileTest.IS_DIR);
     },
@@ -56,7 +91,8 @@ var File = {
     list : function (path) {
         var listing = [];
 
-        var f = Gio.file_new_for_path(String(path));
+        //var f = Gio.file_new_for_path(String(path));
+        var f = Gio.file_new_for_path(path);
         var file_enum = f.enumerate_children(Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME, Gio.FileQueryInfoFlags.NONE, null);
 
         var next_file = null;
@@ -73,7 +109,8 @@ var File = {
     },
 
     mtime : function (path) {
-        var f = Gio.file_new_for_path(String(path));
+        //var f = Gio.file_new_for_path(String(path));
+        var f = Gio.file_new_for_path(path);
         var mtime = new GLib.TimeVal();
 
         var info = f.query_info(Gio.FILE_ATTRIBUTE_TIME_MODIFIED, Gio.FileQueryInfoFlags.NONE, null);
@@ -83,7 +120,8 @@ var File = {
     },
 
     canonical : function (path) {
-        var f = Gio.file_new_for_path(String(path));
+        //var f = Gio.file_new_for_path(String(path));
+        var f = Gio.file_new_for_path(path);
         var can = f.resolve_relative_path('');
         return can.get_path();
     },
@@ -95,11 +133,13 @@ var File = {
      * 
      */
     write : function (path, string) {
-        var f = Gio.file_new_for_path(String(path));
+        //var f = Gio.file_new_for_path(String(path));
+        var f = Gio.file_new_for_path(path);
         var data_out = new Gio.DataOutputStream({base_stream:f.replace(null, false, Gio.FileCreateFlags.NONE, null)});
         data_out.put_string(string, null);
         data_out.close(null);
     },
+
     /**
      * append
      * @arg path {String} File to write to
@@ -107,13 +147,15 @@ var File = {
      * 
      */
     append : function (path, string) {
-        var f = Gio.file_new_for_path(String(path));
+        //var f = Gio.file_new_for_path(String(path));
+        var f = Gio.file_new_for_path(path);
         var data_out = new Gio.DataOutputStream({
                 base_stream:f.append_to(Gio.FileCreateFlags.NONE, null)
         });
         data_out.put_string(string, null);
         data_out.close(null);
     },
+
     /**
      * remove 
      * Delete a file.
@@ -123,9 +165,11 @@ var File = {
      */
     remove : function (path)
     {
-        var f = Gio.file_new_for_path(String(path));
+        //var f = Gio.file_new_for_path(String(path));
+        var f = Gio.file_new_for_path(path);
         return f['delete']();
     },
+
     /**
      * silentRecursiveCopy
      * copy files recursively from fromDir, silently ignore them if they already exist in toDir
@@ -137,45 +181,50 @@ var File = {
      * 
      */
     silentRecursiveCopy : function (fromDir, toDir, opts) {
-        
+
         var filesToCopy = File.recursiveListing(fromDir);
         var srcPath, destPath, src, dest;
         if (typeof(opts) =='undefined') {
             opts = Gio.FileCopyFlags.NONE;
         }
-        
+
         for (var index in filesToCopy) {
-            srcPath = File.join(String(fromDir), filesToCopy[index]);
-            destPath = File.join(String(toDir), filesToCopy[index]);
+            //srcPath  = File.join(String(fromDir), filesToCopy[index]);
+            //destPath = File.join(String(toDir), filesToCopy[index]);
+            srcPath  = File.join(fromDir, filesToCopy[index]);
+            destPath = File.join(toDir,   filesToCopy[index]);
 
             if (File.isDirectory(srcPath) && !File.isDirectory(destPath)) {
                 File.mkdir(destPath);
                 continue;
             }
+
             // source is not file..?!?!?
             if (!File.isFile(srcPath)) {
                 continue;
             }
+
             if (File.isFile(destPath) && opts == Gio.FileCopyFlags.NONE) {
                 // do not overwrite.. - if file exists and we are not flaged to overwrite.
                 continue;
             }
-            
+
             File.copyFile(srcPath, destPath, opts);
-           
         }
     },
-    
+
     /**
      * mkdir
      * make a directory..
      * @arg {String} dstPath directory to make
      */
     mkdir : function (destPath) {
-        var dest = Gio.file_new_for_path(String(destPath));
-        
+        //var dest = Gio.file_new_for_path(String(destPath));
+        var dest = Gio.file_new_for_path(destPath);
+
         return dest.make_directory(null, null);
     },
+
     /**
      * copyFile
      * @arg {String} src source path
@@ -188,11 +237,18 @@ var File = {
             opts = Gio.FileCopyFlags.NONE;
         }
         var dest = Gio.file_new_for_path(String(destPath));
-        var src = Gio.file_new_for_path(String(srcPath));
+        //var dest = Gio.file_new_for_path(destPath);
+        var src  = Gio.file_new_for_path(String(srcPath));
+        //var src  = Gio.file_new_for_path(srcPath);
 
         // a bit of a hack for the fact that Gio.File.copy arguments
         // can be nulled, but not according to the GIR file
-        return src.copy(dest, opts);
+        //return src.copy(dest, opts);
+        if (typeof(Seed) != 'undefined')
+            return src.copy(dest, opts, null);
+        else
+            return src.copy(dest, opts, null, null);
+
     },
 
     recursiveListing : function (dir) {
index 9876fb5..4a2460e 100644 (file)
@@ -1,15 +1,16 @@
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
-GI      = imports.gi.GIRepository;
-GLib    = imports.gi.GLib;
-xml     = imports.libxml;
+const GI      = imports.gi.GIRepository;
+const GLib    = imports.gi.GLib;
+//xml     = imports.libxml;
+const xml     = imports.gi.libxml2;
 //GObject = imports.gi.GObject;
 
-XObject = imports.XObject.XObject;
-console = imports.console.console;
+const XObject = imports.XObject.XObject;
+const console = imports.console.console;
 
-NameSpace = imports.NameSpace.NameSpace;
-Basic = imports.Basic.Basic;
+const NameSpace = imports.Introspect.NameSpace.NameSpace;
+const Basic     = imports.Introspect.Basic.Basic;
 
 
 
@@ -21,7 +22,7 @@ Basic = imports.Basic.Basic;
 
 
  
-Base = XObject.define(
+var Base = XObject.define(
    function(ns, name) {
         // fake should not happen?
         
@@ -55,15 +56,14 @@ Base = XObject.define(
          this.desc = NameSpace.doc(this.alias );
         
         
-        var gi = GI.IRepository.get_default();
+        var gi = GI.Repository.get_default();
         var ver = gi.get_version(ns);
-        var pth = GI.IRepository.get_search_path ();
+        var pth = GI.Repository.get_search_path ();
         var gir_path = pth[0].replace(/lib\/girepository-1.0/, 'share\/gir-1.0');
        //console.log(fn);
         this.gir_file = gir_path + '/'+ ns + '-' + ver + '.gir';
         this.gir_filename = ns + '-' + ver + '.gir';
         
-        
     }, 
     Basic, 
     {
@@ -90,7 +90,7 @@ Base = XObject.define(
         
         getBI : function()  {
             
-            var gi = GI.IRepository.get_default();
+            var gi = GI.Repository.get_default();
             return gi.find_by_name(this.ns, this.name);
         },
          // on, getwhat, simple list (name), variable to add to.
@@ -106,7 +106,8 @@ Base = XObject.define(
             var _this = this;
            //console.log("ADD " + type[0].toUpperCase() + type.substring(1));
             var clname = type[0].toUpperCase() + type.substring(1);
-            var cls = imports[clname][clname];
+            //var cls = imports[clname][clname];
+            var cls = imports.Introspect[clname][clname];
             if (!cls) {
                 console.log("COULD NOT FIND Introspect: " + type[0].toUpperCase() + type.substring(1));
                }
index 50f58b9..ccb0909 100644 (file)
@@ -1,12 +1,13 @@
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
-GI      = imports.gi.GIRepository;
-GLib    = imports.gi.GLib;
-xml     = imports.libxml;
+const GI      = imports.gi.GIRepository;
+const GLib    = imports.gi.GLib;
+//xml     = imports.libxml;
+const xml     = imports.gi.libxml2;
 //GObject = imports.gi.GObject;
 
-XObject = imports.XObject.XObject;
-console = imports.console.console;
+const XObject = imports.XObject.XObject;
+const console = imports.console.console;
 
 
 
@@ -15,54 +16,54 @@ console = imports.console.console;
  */
 
 
-Basic = XObject.define(
+var Basic = XObject.define(
     function( ) {
          // never called?
     },
+
     Object,
+
     {
-        
         typeToName : function (type_info) {
             var ty = GI.type_tag_to_string( GI.type_info_get_tag(type_info));
             
             if ((ty == 'void') && GI.type_info_is_pointer(type_info)) {
                 return 'void*'; // it's a fake string?!?!!? - slightly naughty...
             }
+
             if (ty == 'array') {
                 // array of what!?!?
                 var param_type = GI.type_info_get_param_type (type_info, 0);
                 var atype = GI.type_info_get_tag(param_type);
-                if (atype == GI.ITypeTag.UINT8) {
+                if (atype == GI.TypeTag.UINT8) {
                     return 'utf8';
                 }
                 
-                            
                 return ty;
             }
+
             if (ty != 'interface') {
                 return ty;
             }
+
             var interface_info = GI.type_info_get_interface (type_info);       
             var interface_type = GI.base_info_get_type (interface_info);
-            if (interface_type  == GI.IInfoType.CALLBACK) {
+            if (interface_type  == GI.InfoType.CALLBACK) {
                 // callback.. 
-                var Callback = imports.Callback.Callback ;
+                var Callback = imports.Introspect.Callback.Callback ;
                 var ret=  new Callback(interface_info, this, false, false);
-                ret.alias = GI.base_info_get_namespace(interface_info) + '.' + GI.base_info_get_name(interface_info);
+                ret.alias = interface_info.get_namespace() + '.' + interface_info.get_name();
+
                 return ret;
-                 
-                
             }
 
-            return  GI.base_info_get_namespace(interface_info) + '.' + GI.base_info_get_name(interface_info);
-            
+            return  interface_info.get_namespace() + '.' + interface_info.get_name();
         },
-        
+
         directions : [ "in", "out"," inout"],
-        
+
         argsToArrays : function(m,  returnArray) 
         {
-            
             var outIntoReturn = false;
             if (returnArray && returnArray.length == 1 && returnArray[0].type == 'void') {
                 outIntoReturn = true;
@@ -86,12 +87,12 @@ Basic = XObject.define(
                 var direction = this.directions[GI.arg_info_get_direction(arg)];
                 
                 var add = {
-                    name : GI.base_info_get_name(arg),
-                    ns : GI.base_info_get_namespace(arg),
+                    name : arg.get_name(),
+                    ns : arg.get_namespace(),
                     type : this.typeToName(GI.arg_info_get_type(arg)),
                     direction : direction,
                     be_null :  GI.arg_info_may_be_null(arg) || GI.arg_info_is_optional(arg),
-                    desc : GI.base_info_get_attribute(arg, 'doc') || ''
+                    desc : arg.get_attribute('doc') || ''
                 };
                 
                 
index d9a7318..0c1d6e5 100644 (file)
@@ -1,20 +1,21 @@
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
-GI      = imports.gi.GIRepository;
-GLib    = imports.gi.GLib;
-xml     = imports.libxml;
+const GI      = imports.gi.GIRepository;
+const GLib    = imports.gi.GLib;
+//xml     = imports.libxml;
+const xml     = imports.gi.libxml2;
 //GObject = imports.gi.GObject;
 
-XObject = imports.XObject.XObject;
-console = imports.console.console;
+const XObject = imports.XObject.XObject;
+const console = imports.console.console;
 
 
-NameSpace = imports.NameSpace.NameSpace;
-Basic = imports.Basic.Basic;
+const NameSpace = imports.Introspect.NameSpace.NameSpace;
+const Basic     = imports.Introspect.Basic.Basic;
 
 
 
-Callback = XObject.define(
+var Callback = XObject.define(
     function(sig, memberOf, saveto, keylist) {
 
         
@@ -30,7 +31,7 @@ Callback = XObject.define(
         */
         
         XObject.extend(this,{
-            name : GI.base_info_get_name(sig),
+            name : sig.get_name(),
             params : params,
             //memberOf : memberOf.alias,
             exceptions : [],
index dba5f90..0e389ab 100644 (file)
@@ -1,16 +1,17 @@
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
-GI      = imports.gi.GIRepository;
-GLib    = imports.gi.GLib;
-xml     = imports.libxml;
+const GI      = imports.gi.GIRepository;
+const GLib    = imports.gi.GLib;
+//xml     = imports.libxml;
+const xml     = imports.gi.libxml2;
 //GObject = imports.gi.GObject;
  
  
-XObject = imports.XObject.XObject;
-console = imports.console.console;
-NameSpace = imports.NameSpace.NameSpace;
+const XObject = imports.XObject.XObject;
+const console = imports.console.console;
 
-Base = imports.Base.Base;
+const NameSpace = imports.Introspect.NameSpace.NameSpace;
+const Base      = imports.Introspect.Base.Base;
 
 
 
@@ -22,9 +23,10 @@ Base = imports.Base.Base;
 
 
 
-Class = XObject.define(
+var Class = XObject.define(
     function(ns, name) {
         Base.call(this, ns, name);
+        print("Class ctr - parent called");
         this.loadExtends();
         this.loadImplements();
         //console.log("CREATED(Class) " + this.alias);
@@ -39,13 +41,13 @@ Class = XObject.define(
             
             var pi = GI.object_info_get_parent(bi);
             this.extendsClasses = [];
-            if (!pi) {
+            if (!pi || (pi.get_namespace() == this.ns && pi.get_name() == this.name )) {
                 return;
-            }
+            } 
             this.parent = NameSpace.factory(
                 'Class',
-                GI.base_info_get_namespace(pi),
-                GI.base_info_get_name(pi)
+                pi.get_namespace(),
+                pi.get_name()
             );
             
             this.extendsClasses = [ this.parent ];
@@ -55,9 +57,21 @@ Class = XObject.define(
                 this.extendsClasses.push(p);
             },this);
             
+            if (this.parent) {
+                this.parent.addChildClass(this.alias);
+            }
             
             
         },
+        
+        addChildClass : function (n) {
+            this.childClasses.push(n);
+            if (this.parent) {
+                this.parent.addChildClass(n);
+            }
+        },
+        
+        
         loadImplements : function()
         {
             var bb = this.getBI();
@@ -71,7 +85,7 @@ Class = XObject.define(
                 
                 var iface = NameSpace.factory(
                     'Interface', 
-                    GI.base_info_get_namespace(prop) , GI.base_info_get_name(prop)
+                    prop.get_namespace() , prop.get_name()
                 );
                 
                 
index bad3f6d..9992ffb 100644 (file)
@@ -1,15 +1,16 @@
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
-GI      = imports.gi.GIRepository;
-GLib    = imports.gi.GLib;
-xml     = imports.libxml;
+const GI        = imports.gi.GIRepository;
+const GLib      = imports.gi.GLib;
+//const xml       = imports.libxml;
+const xml       = imports.gi.libxml2;
 
 
-XObject     = imports.XObject.XObject;
-console     = imports.console.console;
-NameSpace   = imports.NameSpace.NameSpace;
+const XObject   = imports.XObject.XObject;
+const console   = imports.console.console;
 
-Basic        = imports.Basic.Basic;
+const NameSpace = imports.Introspect.NameSpace.NameSpace;
+const Basic     = imports.Introspect.Basic.Basic;
 
  
  
@@ -19,36 +20,39 @@ Basic        = imports.Basic.Basic;
  */
 
 
-Constant = XObject.define(
+var Constant = XObject.define(
     function(prop, memberOf, saveto, keylist) {
-          
-        this.name  =  GI.base_info_get_name(prop);
+
+        this.name  = prop.get_name();
         var tif    = GI.constant_info_get_type(prop);
-        var ty = GI.type_tag_to_string( GI.type_info_get_tag(tif));
+        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';
-        
-        
+
+        /* gjs constant_info_get_value introspectable="0"
         if (ty != 'interface') {
-            
-            var argm = new GI.Argument();
-            GI.constant_info_get_value ( prop ,argm);
+            //var argm = new GI.Argument();
+            //var argm = new GI._Argument();
+            var argm;
+            GI.constant_info_get_value(prop, argm);
             if (ty != 'utf8') {
                 this.value = argm.v_long;
             } else {
                 this.value = argm.v_string;
             }
         } 
-        
+        */
+
         this.desc = NameSpace.doc(memberOf.alias + '.' + this.name)
-        
+
         memberOf[saveto].push(this);
         keylist.push(this.name);
     },
+
     Basic,
-    { }
+
+    {}
 );
index 1dddc21..8c21355 100644 (file)
@@ -1,16 +1,17 @@
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
-GI      = imports.gi.GIRepository;
-GLib    = imports.gi.GLib;
-xml     = imports.libxml;
+const GI      = imports.gi.GIRepository;
+const GLib    = imports.gi.GLib;
+//xml     = imports.libxml;
+const xml     = imports.gi.libxml2;
 
 
 
-XObject     = imports.XObject.XObject;
-console     = imports.console.console;
-NameSpace   = imports.NameSpace.NameSpace;
+const XObject     = imports.XObject.XObject;
+const console     = imports.console.console;
 
-Base        = imports.Base.Base;
+const NameSpace   = imports.Introspect.NameSpace.NameSpace;
+const Base        = imports.Introspect.Base.Base;
 
  
   
@@ -18,7 +19,7 @@ Base        = imports.Base.Base;
 
 
 
-Enum = XObject.define(
+var Enum = XObject.define(
     function(ns, name) {
         Base.call(this, ns, name);
     },
@@ -41,7 +42,7 @@ Enum = XObject.define(
                  
               
                 this.values.push({
-                    name :  GI.base_info_get_name(prop).toUpperCase() ,
+                    name :  prop.get_name().toUpperCase() ,
                     type :   GI.type_tag_to_string(GI.enum_info_get_storage_type(bi)),
                     value:   GI.value_info_get_value(prop) ,
                     memberOf : this.alias
index ee59e3a..8206b7b 100644 (file)
@@ -1,16 +1,17 @@
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
-GI      = imports.gi.GIRepository;
-GLib    = imports.gi.GLib;
-xml     = imports.libxml;
+const GI      = imports.gi.GIRepository;
+const GLib    = imports.gi.GLib;
+//xml     = imports.libxml;
+const xml     = imports.gi.libxml2;
 
 
 
-XObject     = imports.XObject.XObject;
-console     = imports.console.console;
-NameSpace   = imports.NameSpace.NameSpace;
+const XObject     = imports.XObject.XObject;
+const console     = imports.console.console;
 
-Basic        = imports.Basic.Basic;
+const NameSpace   = imports.Introspect.NameSpace.NameSpace;
+const Basic       = imports.Introspect.Basic.Basic;
 
  
  
@@ -19,13 +20,13 @@ Basic        = imports.Basic.Basic;
  * Field
  */
 
-Field = XObject.define(
+var Field = XObject.define(
     function(prop, memberOf, saveto, keylist) {
           
-       this.name  =  GI.base_info_get_name(prop) ,
-        this.type  = this.typeToName(GI.field_info_get_type(prop)),
-        this.flags =  GI.field_info_get_flags(prop),
-        this.memberOf = memberOf.alias
+       this.name  =  prop.get_name() ;
+        this.type  = this.typeToName(GI.field_info_get_type(prop));
+        this.flags =  GI.field_info_get_flags(prop);
+        this.memberOf = memberOf.alias;
         memberOf[saveto].push(this);
         keylist.push(this.name);
 
index a83a5ac..0df776c 100644 (file)
@@ -1,11 +1,11 @@
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
  
-XObject     = imports.XObject.XObject;
-console     = imports.console.console;
-NameSpace   = imports.NameSpace.NameSpace;
+const XObject     = imports.XObject.XObject;
+const console     = imports.console.console;
 
-Base        = imports.Base.Base;
+const NameSpace   = imports.Introspect.NameSpace.NameSpace;
+const Base        = imports.Introspect.Base.Base;
 
  
 
@@ -14,7 +14,7 @@ Base        = imports.Base.Base;
  * Interface
  */
 
-Interface = XObject.define(
+var Interface = XObject.define(
     function(ns, name) {
         Base.call(this, ns, name);
        
index fb7d5a1..104f5cc 100644 (file)
@@ -1,8 +1,8 @@
 //<script type="text/javascript">
 
-console = imports.console.console;
+const console = imports.console.console;
 
-XObject = imports.XObject.XObject
+const XObject = imports.XObject.XObject
 
 
 /** Handle the creation of HTML links to documented symbols.
@@ -13,7 +13,7 @@ XObject = imports.XObject.XObject
 */
 
  
-Link = XObject.define(
+var Link = XObject.define(
     function() {
         this.alias = "";
         this.src = "";
index 2c44879..7d1caa1 100644 (file)
@@ -1,13 +1,12 @@
 //<script type="text/javascript">
+const GI      = imports.gi.GIRepository;
 
-GI      = imports.gi.GIRepository;
 
+const XObject     = imports.XObject.XObject;
+const console     = imports.console.console;
 
-XObject     = imports.XObject.XObject;
-console     = imports.console.console;
-NameSpace   = imports.NameSpace.NameSpace;
-
-Basic        = imports.Basic.Basic;
+const NameSpace   = imports.Introspect.NameSpace.NameSpace;
+const Basic       = imports.Introspect.Basic.Basic;
 
   
 /**
@@ -17,103 +16,86 @@ Basic        = imports.Basic.Basic;
 
 
 
-Method = XObject.define(
+var Method = XObject.define(
     function(m, memberOf, saveto, keylist) {
         this.propertyType  = 'Method';
         
         var flags = GI.function_info_get_flags (m);
-        var n = GI.base_info_get_name(m);
+        var n = m.get_name();
         var n_original = n + '';
         // posibly add: sink, 
         if (n.match(/_(ref|unref)$/) || n.match(/^(ref|unref|weakref|weakunref)$/)) {
             return false; // skip these!
         }
-        
-        if (n == 'new') {
+
+        if(n == 'new') {
             n = 'c_new';
         }
 
-        
         var retval = [ { 
                 name : 0, 
                 type :  this.typeToName(GI.callable_info_get_return_type(m)),
                 desc : NameSpace.doc(memberOf.alias + '.' + n_original + '.return-value')
         } ];
-        
-        
-        
+
         var args = this.argsToArrays(m, retval);
-        
-        
+
         if ((n == 'c_new') && !args.length && memberOf.constructors.length) {
-            
+
             memberOf.constructors[0].doc = NameSpace.doc(memberOf.alias + '.' + n_original);
-            
+
             return false; // skip.
         }
-        
 
-        
-        
-        
         //console.log(GI.base_info_get_name(m));
-       // console.dump(GI.base_info_get_attribute(m, 'doc') );
-       
-         // this is a bit messy, as we probably loose the doc's on new..
-       
-        
+        // console.dump(GI.base_info_get_attribute(m, 'doc') );
+
+        // this is a bit messy, as we probably loose the doc's on new..
+
         XObject.extend(this, {
             name : n,
             params: args,
             returns :  retval,
-            isConstructor : flags & GI.IFunctionInfoFlags.IS_CONSTRUCTOR,
-            isStatic : !(flags & GI.IFunctionInfoFlags.IS_METHOD),
+            isConstructor : flags & GI.FunctionInfoFlags.IS_CONSTRUCTOR,
+            isStatic : !(flags & GI.FunctionInfoFlags.IS_METHOD),
             memberOf : memberOf.alias,
             exceptions : [],
             desc : NameSpace.doc(memberOf.alias + '.' + n_original)
         });
         // add descriptions to the arguments..
         this.params.map(function(p) {
-            
-            
             p.desc = NameSpace.doc(memberOf.alias + '.' + n_original + '.' + p.name);
             //Seed.print(memberOf.alias + '.' + n_original + '.' + p.name + ':' +  p.desc);
-            
         });
-        
-        
-            // collect references...
+
+        // collect references...
         var addedto = [ memberOf.alias ]; // do not add to self...
-       
-         for(var i =0; i < args.length;i++) {
+
+        for(var i =0; i < args.length;i++) {
             var ty = args[i].type;
             if (typeof(ty) != 'string' || ty.indexOf('.') < 0) {
                 continue;
             }
+
             if (addedto.indexOf(ty) > -1) {
                 continue;
             }
-            
-            
-            
             NameSpace.references[ty] = NameSpace.references[ty] || [];
             NameSpace.references[ty].push(this);
             addedto.push(ty);
         }
-        
-        
-         // decide what to add to...
-         
+
+        // decide what to add to...
         if (this.isConstructor) {
-            
             if (this.name.match(/^new_/)) {
                 this.name = this.name.substring(4);
             }
-            
-            
             memberOf.constructors.push(this);
-            return;
+
+            //return;
+            return true;
         }
+
         // return values  = only applicable to non-constructors..
         for(var i =0; i < retval.length;i++) {
             var ty = retval[i].type;
@@ -123,28 +105,24 @@ Method = XObject.define(
             if (addedto.indexOf(ty) > -1) {
                 continue;
             }
-            
-            
-            
             NameSpace.references[ty] = NameSpace.references[ty] || [];
             NameSpace.references[ty].push(this);
             addedto.push(ty);
         }
-        
-        
+
         if (this.isStatic) {
-            
             memberOf.functions.push(this);
-            return;
+            //return;
+            return true;
         }
-            
-            
+
         memberOf.methods.push(this);
         keylist.push(this.name);
-            
-        
-            
+
+        return true;
     },
-    Basic, 
-    { }
+
+    Basic,
+
+    {}
 );
\ No newline at end of file
index a169d1b..c14c5b1 100644 (file)
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
-GI      = imports.gi.GIRepository;
-GLib    = imports.gi.GLib;
-xml     = imports.libxml;
 
+const GI      = imports.gi.GIRepository;
+const GLib    = imports.gi.GLib;
+//const xml     = imports.libxml;
+const xml     = imports.gi.libxml2;
 
-XObject = imports.XObject.XObject;
+const File    = imports.File.File;
+const XObject = imports.XObject.XObject;
+const console = imports.console.console;
+//const Constant = imports.Constant;
 
-console = imports.console.console;
+// BC/FC
+if (!GI.Repository) {
+    GI.Repository        = GI.IRepository;
+    GI.FunctionInfoFlags = GI.IFunctionInfoFlags;
+    GI.InfoType          = GI.IInfoType;
+    GI.TypeTag           = GI.ITypeTag;
 
+    GI.IBaseInfo.prototype.get_name = function(n) {
+        return GI.base_info_get_name(this, n);
+    }
 
-NameSpace = {
-   
-    references : { }, 
-    
-    namespaces : function(ns) 
-    {
+    GI.IBaseInfo.prototype.get_namespace = function(n) {
+        return GI.base_info_get_namespace(this, n);
+    }
+
+    GI.IBaseInfo.prototype.get_attribute = function( n) {
+        return GI.base_info_get_attribute(this, n);
+    }
+}
+
+//NameSpace = {
+var NameSpace = {
+
+    references : {},
+
+    namespaces : function(ns) {
         // this should be a class of it's own...
         this.references[ns] = []; // technically not needed - but fills in files..
         // get this from GI... (it's the path..)
         var ret = [];
-       
+
         function scanGir(dir) 
         {
             if (!GLib.file_test(dir, GLib.FileTest.EXISTS)) {
                 return;
             }
-            var gdir = GLib.dir_open(dir,0);
-            
-            while (true) {
-                
-                var fn = gdir.read_name ? gdir.read_name () : GLib.dir_read_name(gdir);
-           //      console.log('trying ' +  fn);
-                if (!fn) {
-                    gdir.close ? gdir.close() : GLib.dir_close(gdir);
-                    return;;
-                }
-                if (!fn.match(/.typelib$/)) {
-                    continue;
+
+            File.list(dir).forEach(function(fn)
+            {
+                if (!fn.match(/\.typelib$/)) {
+                    return;
                 }
+
                 var par = fn.split('-').shift();
                  //console.log('trying ' +  par);
+
                 if (ret.indexOf(par) > -1) {
-                     continue;
+                     return;
                 }
                 ret.push(par);
-                
-                
-            } 
+            }); 
         }
-        var gi = GI.IRepository.get_default();
-        var pth = GI.IRepository.get_search_path ();
-        
+
+        var gi  = GI.Repository.get_default();
+        var pth = GI.Repository.get_search_path();
+
         scanGir(pth[0]);
         ret.sort();
         console.dump(ret);
+
         return ret;
-        
     },
-        
-        
+
     ns:  function(ns) {
-        var gi = GI.IRepository.get_default();
-        ret = {
-            titleType: 'Namespace',
-            ns: ns,
-            name : ns,
-            alias : ns,
-            objects : [],
+        var gi  = GI.Repository.get_default();
+        var ret = {
+            titleType : 'Namespace',
+            ns        : ns,
+            name      : ns,
+            alias     : ns,
+            objects   : [],
             functions : [],
-            enums : [],
-            structs: [],
+            enums     : [],
+            structs   : [],
             constants : [],
-            unions : [],
-            
+            unions    : [],
+
             // so ns looks like class..
-          
+
             extendsClasses : [], // what it extends...
-            childClasses : [], // what uses it..
-            properties : [],
-            constructors : [],
-            methods : [],
-            values : [], /// really constants.
-            signals : [],
-            interfaces: [],
+            childClasses   : [], // what uses it..
+            properties     : [],
+            constructors   : [],
+            methods        : [],
+            values         : [], /// really constants.
+            signals        : [],
+            interfaces     : [],
         };
-     
-        for (var i=0; i <  gi.get_n_infos (ns); i++ ) {
+
+        //console.log("NS: " + ns);
+        var n_info = gi.get_n_infos(ns);
+        //console.log("n_info: " + n_info);
+
+        for (var i=0; i<n_info; i++) {
+
             var info = gi.get_info (ns, i);
-            
+            //console.log("NAME: " + info.get_name());
+            //continue;
+
             var info_type = GI.base_info_get_type (info);
+            // print("Type: " + info_type);
+
             switch(info_type) {
-                case  GI.IInfoType.OBJECT:
-                    ret.objects.push(GI.base_info_get_name(info));
-                    this.clsGatherInterfaces(ns , GI.base_info_get_name(info));
+                case  GI.InfoType.OBJECT:
+                    ret.objects.push(info.get_name());
+                    this.clsGatherInterfaces(ns , info.get_name());
                     continue;
-                 case  GI.IInfoType.INTERFACE:
-                    ret.interfaces.push(GI.base_info_get_name(info));
+
+                case  GI.InfoType.INTERFACE:
+                    ret.interfaces.push(info.get_name());
                     continue;
-                case  GI.IInfoType.FUNCTION:
-                    new imports.Method.Method(info, ret, 'functions', []);    
+
+                case  GI.InfoType.FUNCTION:
+                    new imports.Introspect.Method.Method(info, ret, 'functions', []);    
                     continue;
-                
-                case  GI.IInfoType.CALLBACK:
+
+                case  GI.InfoType.CALLBACK:
                    // new Introspect.Callback(info, ret, 'callbacks', []);
                     continue;
-                
-                case  GI.IInfoType.ENUM:
-                case  GI.IInfoType.FLAGS:
-                    ret.enums.push(GI.base_info_get_name(info));
+
+                case  GI.InfoType.ENUM:
+                case  GI.InfoType.FLAGS:
+                    ret.enums.push(info.get_name());
                     continue;
-                case  GI.IInfoType.STRUCT:
-                    if (GI.struct_info_is_gtype_struct (info)) {
+
+                case  GI.InfoType.STRUCT:
+                    if (GI.struct_info_is_gtype_struct(info)) {
                         continue;
                     }
-
-                    ret.structs.push(GI.base_info_get_name(info));
+                    ret.structs.push(info.get_name());
                     continue;
-                case  GI.IInfoType.UNION:
-                    ret.unions.push(GI.base_info_get_name(info));
+
+                case  GI.InfoType.UNION:
+                    ret.unions.push(info.get_name());
                     continue;
-                case  GI.IInfoType.CONSTANT:
-                    new imports.Constant.Constant(info, ret, 'values', []);
-                    
+
+                case  GI.InfoType.CONSTANT:
+                    new imports.Introspect.Constant.Constant(info, ret, 'values', []);
                     continue;
-                
-                
+
+
                 default:
                     continue;
             }
         }
-        
-                
-        var gi = GI.IRepository.get_default();
-        var ver = gi.get_version(ns);
-        var pth = GI.IRepository.get_search_path ();
-        var gir_path = pth[0].replace(/lib\/girepository-1.0/, 'share\/gir-1.0');
-       //console.log(fn);
-        ret.gir_file = gir_path + '/'+ ns + '-' + ver + '.gir';
+        //print ("SCAN NAMESPACES ALL DONE");
+
+        //var gi       = GI.Repository.get_default();
+        var ver      = gi.get_version(ns);
+        var pth      = GI.Repository.get_search_path ();
+
+        // SD replace lib with lib.?.? (match lib64 or lib)
+        //var gir_path = pth[0].replace(/lib\/girepository-1.0/, 'share\/gir-1.0');
+        var gir_path = pth[0].replace(/lib.?.?\/girepository-1.0/, 'share\/gir-1.0');
+        //console.log("gir_path: " + gir_path);
+
+        ret.gir_file     = gir_path + '/'+ ns + '-' + ver + '.gir';
         ret.gir_filename = ns + '-' + ver + '.gir';
-        
+
         //console.dump(this.ifaceList);
-        return ret;
 
+        return ret;
     },
-    
-  
+
     // store all the interfaces, so we can show a list of them later...
     // called when you list the namespace
     clsGatherInterfaces : function(ns, cls)
     {
-        var gi = GI.IRepository.get_default();
+       // print("clsGatherInterfaces: " + ns + ", " + cls);
+        var gi = GI.Repository.get_default();
         var bb = gi.find_by_name(ns, cls);
         var fullname = ns+'.'+cls;
         this.ifaceList = this.ifaceList || { };
-         
-        
+
         for(var i =0; i < GI.object_info_get_n_interfaces(bb); i++) {
-           
+
             var prop = GI.object_info_get_interface(bb,i);
-           
-            var add =  GI.base_info_get_namespace(prop) +'.' + GI.base_info_get_name(prop);
+
+            var add =  prop.get_namespace() + '.' + prop.get_name();
             this.ifaceList[add] = this.ifaceList[add] || [];
             if (this.ifaceList[add].indexOf(fullname) < 0) {
                 this.ifaceList[add].push(fullname);
             }
-             
         }
-        
-       
-        
     },
-    
-           
-        
-   
+
     doc : function(what) {
+        //print ("DOC: + " +what);
         var ns = what.split('.').shift();
+        return '';
         this.commentLoad(ns);
+
         return typeof(this.comments[ns][what]) == 'undefined' ?  '' : this.comments[ns][what];
-        
     },
-    
-    
-    
+
     comments : {},
-    
+
     commentLoad : function(ns)
     {
-        
+
         if (typeof(this.comments[ns]) != 'undefined') {
             return;
         }
-        
+
         console.log("LOAD DOCS: " + ns);
-        var gi = GI.IRepository.get_default();
+        var gi = GI.Repository.get_default();
         var ver = gi.get_version(ns);
         if (!ver) {
             this.comments[ns] = {};
             return;
         }
-        var ret = { };
-        
+        var ret = {};
+
         // no idea why this is broken on my build system.
         var  getAttribute = function(n, name){
             var properties = n.properties;
@@ -214,35 +234,34 @@ NameSpace = {
             }
             return null;
         }
-                
-        
+
         function walk (element, path) {
-            
-            
+
             if (!element) {
                 return;
             }
-            
+
             var n =  getAttribute(element, 'name') ;
             //console.log("WALK" + n);
             if (element.name == 'signal') {
                 path += '.signal';
             }
-            
+
             if (n) {
                 path += path.length ? '.' : '';
                 path += n;
             }
+
             if (element.name == 'return-value') {
                 path += '.return-value';
             }
-            
+
             var d =   getAttribute(element,'doc');
             if (d) {
              //   Seed.print(path + ':' + d);
                 ret[path] = d;
             }
-            
+
             var child = element.children;
 
             while (child){
@@ -253,41 +272,39 @@ NameSpace = {
                 child = child.next;
             }
         }
-        
-        var pth = GI.IRepository.get_search_path ();
-        
-        
+
+        var pth = GI.Repository.get_search_path ();
+
         var gir_path = pth[0].replace(/lib\/girepository-1.0/, 'share\/gir-1.0');
-       
-        
+
         //console.log(fn);
         var  fn = gir_path + '/'+ ns + '-' + ver + '.gir';
-       // console.log(fn);
-        
+        // console.log(fn);
+
         if (!GLib.file_test(fn, GLib.FileTest.EXISTS)) {
             console.log('missing docc file ' + fn);
             this.comments[ns] = {};
-            
+
             return;
         }
+
         var doc = xml.parseFile(fn);
         //console.log("xmldoc?" + doc);
         walk (doc.root, '');
         //console.dump(ret);
         this.comments[ns] = ret;
-
     },
-    registry : { },
+
+    registry : {},
+
     factory : function(type, ns, name) {
         if (typeof (this.registry[ns +'.' + name]) == 'undefined') {
-            this.registry[ns +'.' + name] = new imports[type][type](ns,name);
+            //this.registry[ns +'.' + name] = new imports[type][type](ns,name);
+            this.registry[ns +'.' + name] = new imports.Introspect[type][type](ns,name);
             this.registry[ns +'.' + name].load();
         }
-        
+
         return this.registry[ns +'.' + name];
     }
-        
 };
-
-
-
+//})();
index 832152f..fb0a9be 100644 (file)
@@ -1,26 +1,22 @@
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
-GI      = imports.gi.GIRepository;
+const GI      = imports.gi.GIRepository;
 
+const XObject     = imports.XObject.XObject;
+const console     = imports.console.console;
 
-
-XObject     = imports.XObject.XObject;
-console     = imports.console.console;
-NameSpace   = imports.NameSpace.NameSpace;
-
-Basic        = imports.Basic.Basic;
-
-   
+const NameSpace   = imports.Introspect.NameSpace.NameSpace;
+const Basic       = imports.Introspect.Basic.Basic;
 
 
 /**
  * Property
  */
 
-Property = XObject.define(
+var Property = XObject.define(
     function(prop, memberOf, saveto, keylist) {
         this.propertyType = 'Property';
-        var n_original = GI.base_info_get_name(prop);
+        var n_original = prop.get_name();
         this.name  =  n_original.replace(/\-/g, '_') ,
         this.type  = this.typeToName(GI.property_info_get_type(prop)),
         this.flags =  GI.property_info_get_flags(prop),
index 9524512..0624ebf 100644 (file)
@@ -1,17 +1,17 @@
 //<script type="text/javascript">
 //Gtk = imports.gi.Gtk;
-GI      = imports.gi.GIRepository;
+const GI      = imports.gi.GIRepository;
 
-XObject     = imports.XObject.XObject;
-console     = imports.console.console;
-NameSpace   = imports.NameSpace.NameSpace;
+const XObject     = imports.XObject.XObject;
+const console     = imports.console.console;
 
-Basic        = imports.Basic.Basic;
+const NameSpace   = imports.Introspect.NameSpace.NameSpace;
+const Basic       = imports.Introspect.Basic.Basic;
 
   
  
 
-Signal = XObject.define(
+var Signal = XObject.define(
     function(sig, memberOf, saveto, keylist) {
 
         this.propertyType  = 'Signal';
@@ -25,7 +25,7 @@ Signal = XObject.define(
             be_null :  false
                 
         });
-        var n_original  = GI.base_info_get_name(sig);
+        var n_original  = sig.get_name();
         
         XObject.extend(this,{
             name : n_original.replace(/-/g,'_'),
index a3a72dc..d2ae597 100644 (file)
@@ -1,14 +1,12 @@
 //<script type="text/javascript">
 
-GI      = imports.gi.GIRepository;
+const GI      = imports.gi.GIRepository;
 
+const XObject     = imports.XObject.XObject;
+const console     = imports.console.console;
 
-
-XObject     = imports.XObject.XObject;
-console     = imports.console.console;
-NameSpace   = imports.NameSpace.NameSpace;
-
-Base        = imports.Base.Base;
+const NameSpace   = imports.Introspect.NameSpace.NameSpace;
+const Base        = imports.Introspect.Base.Base;
 
  
  
@@ -16,7 +14,7 @@ Base        = imports.Base.Base;
  * Struct
  */
 
-Struct = XObject.define(
+var Struct = XObject.define(
     function(ns, name) {
         Base.call(this, ns, name);
        
index 723a756..e1cc926 100644 (file)
@@ -1,13 +1,13 @@
 //<script type="text/javascript">
 
-GI      = imports.gi.GIRepository;
+const GI      = imports.gi.GIRepository;
 
 
 
-XObject     = imports.XObject.XObject;
-console     = imports.console.console;
+const XObject     = imports.XObject.XObject;
+const console     = imports.console.console;
  
-Base        = imports.Base.Base;
+const Base        = imports.Introspect.Base.Base;
 
   
    
@@ -16,7 +16,7 @@ Base        = imports.Base.Base;
  * Union
  */
  
-Union = XObject.define(
+var Union = XObject.define(
     function(ns, name) {
         Base.call(this, ns, name);
        
index 452ce3c..25691cb 100644 (file)
@@ -23,8 +23,10 @@ DocComment = XObject.define(
         if (typeof comment != "undefined") {
             this.parse(comment);
         }
-    }, 
+    },
+
     Object, // extends
+
     {
         isUserComment : true,
         src           : "",
@@ -203,8 +205,8 @@ DocComment = XObject.define(
 
 /// static methods..
 
-XObject.extend(DocComment, 
-    {
+XObject.extend(DocComment,
+{
         
         /**
          * Used to store the currently shared tag text.
@@ -229,4 +231,4 @@ XObject.extend(DocComment,
             }
             return ns;
         }
-});
\ No newline at end of file
+});
index 22a3757..b4a41fa 100644 (file)
@@ -10,7 +10,6 @@ CompressWhite   = imports.CompressWhite.CompressWhite;
 Collapse        = imports.Collapse.Collapse;
 
 GLib = imports.gi.GLib;
-Gio = imports.gi.Gio;
 /**
  * @namespace JSDOC
  * @class  Packer
@@ -86,10 +85,25 @@ Packer = function(cfg)
     
     var link = false;
     if (cfg.autoBuild) {
+        
+        function dateString(d){
+            function pad(n){return n<10 ? '0'+n : n}
+            return d.getFullYear() +
+                 pad(d.getMonth()+1)+
+                 pad(d.getDate())+'_'+
+                 pad(d.getHours())+
+                 pad(d.getMinutes())+
+                 pad(d.getSeconds());
+        }
+
+        
+        
         var version = 0;
         this.files.forEach(function(f) {
             version = Math.max(File.mtime(f), version);
         });
+        var version  = dateString(new Date(version));
+        
         var dirname = GLib.path_get_dirname(this.files[0]);
         var outname = this.module ? this.module : GLib.path_get_basename(dirname);
         this.target = dirname + '/compiled/' + outname + '-' + version + '.js';
@@ -112,33 +126,24 @@ Packer = function(cfg)
 }
 Packer.prototype = {
     /**
-     * @cfg {String} srcfiles file containing a list of files/or classes to use.
+     * @prop srcfiles {String} file containing a list of files/or classes to use.
      */
     srcfile : false,
     
     /**
-     * @cfg {Array} files list of files to compress (must be full path)
+     * @prop files {Array} list of files to compress (must be full path)
      */
     files : false,
     /**
-     * @cfg {String} target to write files to - must be full path.
+     * @prop target {String} target to write files to - must be full path.
      */
     target : '',
     /**
-     * @cfg {Boolean} autoBuild - turn on autobuild feature (puts files in compiled directory,
-     * and enables translation toolkit.
-     */
-    autoBuild : false,
-     /**
-     * @cfg {String} module used with autoBuild to force a file name
-     */
-    module: false,
-    /**
-     * @cfg {String} debugTargettarget to write files debug version to (uncompacted)- must be full path.
+     * @prop debugTarget {String} target to write files debug version to (uncompacted)- must be full path.
      */
     debugTarget : '', // merged file without compression.
     /**
-     * @cfg {String} tmpDir  (optional) where to put the temporary files. 
+     * @prop tmpDir {String} (optional) where to put the temporary files. 
      *      if you set this, then files will not be cleaned up
      */
     tmpDir : '/tmp',
@@ -146,29 +151,18 @@ Packer.prototype = {
     translateJSON : '', // json based list of strings in all files.
    
     /**
-     * @cfg {Boolean} cleanup  (optional) clean up temp files after done - 
+     * @prop cleanup {Boolean} (optional) clean up temp files after done - 
      *    Defaults to false if you set tmpDir, otherwise true.
      */
     cleanup : true,  
-    /**
-     * @cfg {Boolean} keepWhite (optional) do not remove white space in output.
-     *    usefull for debugging compressed files.
-     */
-    
-    keepWhite: true,
     
     /**
-     * @cfg {String} prefix (optional) prefix of directory to be stripped of when
+     * @prop prefix {String} (optional) prefix of directory to be stripped of when
      *    Calculating md5 of filename 
      */
     prefix : '',  
     out : '', // if no target is specified - then this will contain the result
     
-    /**
-     * load a dependancy list -f option
-     * @param {String} srcfile sourcefile to parse
-     * 
-     */
     
     loadSourceFile : function(srcfile)
     {
@@ -338,8 +332,6 @@ Packer.prototype = {
             }
             
         }
-        print("Output file: " + this.target);
-        if (this.debugTarget) print("Output debug file: " + this.debugTarget);
         
          
     
@@ -362,8 +354,7 @@ Packer.prototype = {
             keepWhite : true,  
             keepComments : true, 
             sepIdents : true,
-            collapseWhite : false,
-            filename : fn
+            collapseWhite : false
         });
         this.timerPrint("START" + fn);
         
@@ -397,9 +388,8 @@ Packer.prototype = {
         print(sp.warnings.join("\n"));
         
         
-        var out = CompressWhite(new TokenStream(toks), this, this.keepWhite); // do not kill whitespace..
-        
-        
+        //var out = CompressWhite(new TokenStream(toks), this, true); // do not kill whitespace..
+        var out = CompressWhite(new TokenStream(toks), this, false);
         this.timerPrint("Compressed");
         return out;
         
@@ -461,13 +451,10 @@ Packer.prototype = {
          
         File.write(transmd5, '');
         for(v in map) {
-            if (!v.length) {
-                continue;
-            }
-            File.append(transfile, l + "\n\t" + JSON.stringify(v) + " : " + JSON.stringify(v));
+            File.append(transfile, l + "\n\t \"" + v + '" : "' + v + '"');
             l = ',';
             // strings are raw... - as the where encoded to start with!!!
-            File.append(transmd5, '_T["' + this.md5(ffn + '-' + v) + '"]='+JSON.stringify(v)+";\n");
+            File.append(transmd5, '_T["' + this.md5(ffn + '-' + v) + '"]="'+v+"\";\n");
         }
         File.append(transfile, "\n},"); // always one trailing..
         
index 6adb708..bd094ad 100644 (file)
@@ -1,60 +1,63 @@
 //<script type="text/javscript">
 
-Gio = imports.gi.Gio;
-GLib = imports.gi.GLib;
+const Gio     = imports.gi.Gio;
+const GLib    = imports.gi.GLib;
 
-XObject = imports.XObject.XObject;
+const XObject = imports.XObject.XObject;
+const console = imports.console.console;
 
-console = imports.console.console;
+const File    = imports.File.File;
 
 /**
  * Template 
  * 
  * 
  */
-  
-  
 
-Template = XObject.define(
-    
+var Template = XObject.define(
 
     function(cfg) {
-        XObject.extend(this, cfg)
+        XObject.extend(this, cfg);
+
         //this.templateFile = templateFile;
-        if (!this.templateFile  || !this.Link) {
-            throw  "No templateFile or Link sent to Template Contructor..";
-            
+
+        if (!this.templateFile || !this.Link) {
+            throw  "No templateFile or Link sent to Template Constructor..";
         }
-        
-        
-        this.template = Gio.simple_read(this.templateFile);
+        //console.log("this.templateFile: " + this.templateFile);
+
+        //this.template     = Gio.simple_read(this.templateFile);
+        this.template     = File.read(this.templateFile);
+        //console.log("this.template: " + this.template);
+
         this.templateName = GLib.path_get_basename(this.templateFile);
         this.code = "";
         this.parse();
-    }, 
-    Object,  {
-    
+    },
+
+    Object,
 
+    {
         parse : function() {
-            
-            console.log("Parsing template? " + this.templateName);
-            
+
+            console.log("Parsing template: " + this.templateName);
             this.template = this.template.replace(/\{#[\s\S]+?#\}/gi, "");
-            this.code = "var output=``"+this.template;
+            this.code     = "var output=``" + this.template;
 
             this.code = this.code.replace(
                 /<for +each="(.+?)" +in="(.+?)" *>/gi, 
                 function (match, eachName, inName) {
                     return "``;\rvar $"+eachName+"_keys = keys("+inName+");\rfor(var $"+eachName+"_i = 0; $"+eachName+"_i < $"+eachName+"_keys.length; $"+eachName+"_i++) {\rvar $"+eachName+"_last = ($"+eachName+"_i == $"+eachName+"_keys.length-1);\rvar $"+eachName+"_key = $"+eachName+"_keys[$"+eachName+"_i];\rvar "+eachName+" = "+inName+"[$"+eachName+"_key];\routput+=``";
                 }
-            ); 
+            );
+
             this.code = this.code.replace(/<if test="(.+?)">/g, "``;\rif ($1) { \routput+=``");
             this.code = this.code.replace(/<else\s*\/>/g, "``;} \relse\r{ \routput+=``");
-            
+
             this.code = this.code.replace(/<\/(if|for)>/g, "``;\r};\routput+=``");
-            
+
             //File.write("/tmp/jstookit_eval_"+this.templateName+".4.js", this.code);
-            
+
             this.code = this.code.replace(
                 /\{\+\s*([\s\S]+?)\s*\+\}/gi,
                 function (match, code) {
@@ -64,7 +67,7 @@ Template = XObject.define(
                 }
             );
             //File.write("/tmp/jstookit_eval_"+this.templateName+".6.js", this.code);
-            
+
             this.code = this.code.replace(
                 /\{!\s*([\s\S]+?)\s*!\}/gi,
                 function (match, code) {
@@ -76,17 +79,13 @@ Template = XObject.define(
            //File.write("/tmp/jstookit_eval_"+this.templateName+".7.js", this.code);
             this.code = this.code+"``;";
 
-            
-            
             this.code = this.code.replace(/(\r?\n)/g, "\\n");
             this.code = this.code.replace(/"/g, "\\\"");
-            
+
             this.code = this.code.replace(/``/g, "\"");
             this.code = this.code.replace(/\\r/g, "\n");
             //File.write("/tmp/jstookit_eval_"+this.templateName+".9.js", this.code);
             this.code = this.code.replace(/\r/g, "\n\n");
-            
-
         },
 
         toCode : function() {
@@ -128,49 +127,52 @@ Template = XObject.define(
         process : function(data) {
             
             //console.log("processing template");
-            var keys = this.keys;
-            var values = this.values;
+            var keys          = this.keys;
+            var values        = this.values;
             
-            var makeSortby = this.makeSortby;
-            var makeSignature =   XObject.createDelegate(this.makeSignature, this);
-            var summarize = this.summarize ;
-            var makeFuncSkel = this.makeFuncSkel;
-            var resolveLinks = this.resolveLinks;
-            var makeImage = this.makeImage;
+            var makeSortby    = this.makeSortby;
+            var makeSignature = XObject.createDelegate(this.makeSignature, this);
+            var summarize     = this.summarize ;
+            var makeFuncSkel  = this.makeFuncSkel;
+            var resolveLinks  = this.resolveLinks;
+            var makeImage     = this.makeImage;
+
             // usefull for cross refing..
             Template.data = data;
-            
+
             var Link = this.Link;
-            var Options = imports.Options ? imports.Options.Options : false;
+            //var Options = imports.Options ? imports.Options.Options : false;
+
             try {
                 eval(this.code);
             } catch (e) {
-                 Gio.simple_write('/tmp/template.js', this.code);
-                 Seed.print('in /tmp/template.js');
-                throw e;
-                Seed.quit();
+                 //Gio.simple_write('/tmp/template.js', this.code);
+                 File.write('/tmp/template.js', this.code);
+                 //Seed.print('in /tmp/template.js');
+                 console.log('in /tmp/template.js');
+                 //throw e;
+                 //Seed.quit();
             }
-            
-            
+
             //File.write("/tmp/jstookit_eval.js", this.code);
             //try {
             //eval('include     "/tmp/jstookit_eval.js";');
             //includeJs("/tmp/jstookit_eval.js");
                 //eval(this.code);
-           // console.log("done eval of template");   
-            
+            // console.log("done eval of template");
+
             return output;
         },
 
-     
         isdefined : function (typ) {
             return typ != 'undefined';
         },
-        
-        
+
         summarize : function(desc) {
             if (typeof desc != "undefined")
                 return desc.match(/([\w\W]+?\.)[^a-z0-9]/i)? RegExp.$1 : desc;
+            else
+                return '';
         },
 
         /** make a symbol sorter by some attribute */
@@ -180,24 +182,22 @@ Template = XObject.define(
                     a = a[attribute]; //.toLowerCase();
                     b = b[attribute];//.toLowerCase();
                     if (a < b) return -1;
-                    if (a > b) return 1;
-                    return 0;
+                    if (a > b) return  1;
+                    //return 0;
                 }
+                return 0;
             }
         },
+
         makeImage : function(alias) {
             ///  http://library.gnome.org/devel/gtk/stable/notebook.png
-            var ns = alias.split('.').shift();
+            var ns  = alias.split('.').shift();
             var cls = alias.split('.').pop().toLowerCase();
             if (ns != 'Gtk' ) {
                 return '';//ns;
             }
             return '<img class="class-picture" src="http://library.gnome.org/devel/gtk/stable/' + cls + '.png">';
-            
-            
         },
-        
-        
 
         makeSignature : function(params) {
             if (!params) return "()";
@@ -240,30 +240,32 @@ Template = XObject.define(
                 ).map( function($) { return $.name == 'this' ? '_self' : $.name; } ).join(", ")
             +
             ")\n{\n\n}";
-            
+
         },
 
         /** Find symbol {@link ...} strings in text and turn into html links */
         resolveLinks : function (str, from) {
+
             if (!str || typeof(str) == 'undefined') {
                 return '';
             }
-            
+
             // gtk specific. now..
             // @ -> bold.. - they are arguments..
-            
+
             str = str.replace(/@([a-z_]+)/gi,
                 function(match, symbolName) {
                     return '<b>' + symbolName + '</b>';
                 }
             );
+
             // constants.
             str = str.replace(/%([a-z_]+)/gi,
                 function(match, symbolName) {
                     return '<b>' + symbolName + '</b>';
                 }
             );
-            
+
             str = str.replace(/#([a-z_]+)/gi,
                 function(match, symbolName) {
                     return '<b>' + symbolName + '</b>';
@@ -272,9 +274,9 @@ Template = XObject.define(
                     //return new Link().toSymbol(Template.data.ns + '.' + symbolName);
                 }
             );
-            
+
             str = str.replace(/\n/gi, '<br/>');
-            
+
             /*
             str = str.replace(/\{@link ([^} ]+) ?\}/gi,
                 function(match, symbolName) {
@@ -305,9 +307,7 @@ Template = XObject.define(
                 }
             );
             */
-            
+
             return str;
         }
-        
-        
-});
\ No newline at end of file
+});
index d30b494..716803a 100755 (executable)
--- a/String.js
+++ b/String.js
@@ -8,16 +8,18 @@
  * Fork - LGPL
  * <script type="text/javascript">
  */
+
 // usage:
 // Seed.include('String.js');
-XObject = imports.XObject.XObject;
+
+const XObject = imports.XObject.XObject;
 
 
-XObject.extend(String, 
+XObject.extend(String,
     {
-    
+
         /** @scope String */
-        
+
         /**
          * Escapes the passed string for ' and \
          * @param {String} string The string to escape
@@ -51,7 +53,8 @@ XObject.extend(String,
             }
             return result;
         },
-         /**
+
+        /**
          * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens.  Each
          * token must be unique, and must increment in the format {0}, {1}, etc.  Example usage:
          * <pre><code>
@@ -71,7 +74,6 @@ XObject.extend(String,
                 return args[i];
             });
         },
-        
 
         /**
          * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens.  Each
@@ -93,7 +95,7 @@ XObject.extend(String,
                 return this.htmlEncode(args[i]);
             });
         },
-        
+
         /**
          * Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.
          * @param {String} value The string to encode
@@ -104,8 +106,6 @@ XObject.extend(String,
                 String(value).replace(/&/g, "&amp;"
                     ).replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
         }
-        
-        
     }
 );
 
@@ -125,35 +125,32 @@ XObject.extend(String,
      * @param {String} other The new value to use if the string already equals the first value passed in
      * @return {String} The new value
      */
-     
+
 XObject.extend(String.prototype,  {
-        
+
         toggle : function(value, other){
             return this == value ? other : value;
         },
-        
+
         trim : function (toTrim) {
             var out = this.ltrim(toTrim);
             out = out.rtrim(toTrim);
             return out;
         },
-        
+
         ltrim : function (toTrim) {
             if (this.substr(0, toTrim.length) == toTrim) {
                 return this.slice(toTrim.length);
             }
-            
+
             return this;
         },
-        
+
         rtrim : function (toTrim) {
             if (this.substr(this.length - toTrim.length) == toTrim) {
                 return this.slice(0, this.length - toTrim.length);
             }
-       
+
             return this;
         }
-    
-   
-});
\ No newline at end of file
+});
index 05b35dc..1508659 100644 (file)
  * 
  * 
  * 
- * @arg xtype {String|Function} constructor or string.
- * @arg id {String}  (optional) id for registry
- * @arg xns {String|Object}   (optional) namespace eg. Gtk or 'Gtk' - used with xtype.
- * @arg items {Array}   (optional) list of child elements which will be constructed.. using XObject
+ * @arg xtype     {String|Function} constructor or string.
+ * @arg id        {String}  (optional) id for registry
+ * @arg xns       {String|Object}   (optional) namespace eg. Gtk or 'Gtk' - used with xtype.
+ * @arg items     {Array}   (optional) list of child elements which will be constructed.. using XObject
  * @arg listeners {Object}   (optional) map Gobject signals to functions
- * @arg pack {Function|String|Array}   (optional) how this object gets added to it's parent
- * @arg el {Object}   (optional) premade GObject
+ * @arg pack      {Function|String|Array}   (optional) how this object gets added to it's parent
+ * @arg el        {Object}   (optional) premade GObject
  * 
  *  --- needs a xdebug option!
  * 
@@ -57,12 +57,8 @@ function XObject (cfg) {
     if (cfg.init) {
         this.init = cfg.init; // override!
     }
-    
-    
 }
 
-
-
 XObject.prototype = {
     /**
      * @property el {GObject} the Gtk / etc. element.
@@ -113,9 +109,9 @@ XObject.prototype = {
         for (var i in o) {
             if ((typeof(o[i]) == 'object') || 
                 (typeof(o[i]) == 'function') || 
-                i == 'pack' ||
-                i == 'id' ||
-                i == 'xtype' ||
+                i == 'pack'   ||
+                i == 'id'     ||
+                i == 'xtype'  ||
                 i == 'xdebug' ||
                 i == 'xns'
             ) {
@@ -185,8 +181,7 @@ XObject.prototype = {
       * @arg cfg {Object} same as XObject constructor.
       */
     addItem : function(o) {
-        
-         
+
         var item = (o.constructor == XObject) ? o : new XObject(o);
         item.init();
         item.parent = this;
@@ -195,12 +190,14 @@ XObject.prototype = {
         if (item.pack===false) {  // no 
             return;
         }
+
         if (typeof(item.pack) == 'function') {
             // parent, child
             item.pack.apply(o, [ o , o.items[i] ]);
             item.parent = this;
             return;
         }
+
         var args = [];
         var pack_m  = false;
         if (typeof(item.pack) == 'string') {
@@ -225,17 +222,15 @@ XObject.prototype = {
         if (pack_m) {
             this.el[pack_m].apply(this.el, args);
         }
-        
-       
-        
     },
+
     /**
-      * @method addListener
-      * Connects a method to a signal. (gjs/Seed aware)
-      * 
-      * @arg sig  {String} name of signal
-      * @arg fn  {Function} handler.
-      */
+     * @method addListener
+     * Connects a method to a signal. (gjs/Seed aware)
+     *
+     * @arg sig  {String} name of signal
+     * @arg fn  {Function} handler.
+     */
     addListener  : function(sig, fn) 
     {
  
@@ -250,48 +245,49 @@ XObject.prototype = {
         } else {
             this.el.connect( sig, _li);
         }
-             
-        
     },
-     /**
-      * @method get
-      * Finds an object in the child elements using xid of object.
-      * prefix with '.' to look up the tree.. multiple '..' to look further up..
-      * 
-      * @arg name  {String} name of signal
-      * @return   {XObject|false} the object if found.
-      */
+
+    /**
+     * @method get
+     * Finds an object in the child elements using xid of object.
+     * prefix with '.' to look up the tree.. multiple '..' to look further up..
+     *
+     * @arg name  {String} name of signal
+     * @return   {XObject|false} the object if found.
+     */
     get : function(xid)
     {
         var ret=  false;
         if (xid[0] == '.') {
             return this.parent.get(xid.substring(1));
         }
-        
-        
+
         this.items.forEach(function(ch) {
             if (ch.id == xid) {
                 ret = ch;
                 return true;
-            }
-        })
+            } else
+                return false;
+        });
+
         if (ret) {
             return ret;
         }
+
         // iterate children.
         this.items.forEach(function(ch) {
             ret = ch.get(xid);
             if (ret) {
                 return true;
-            }
-        })
+            } else
+                return false;
+        });
+
         return ret;
     }
-      
-      
 } 
-         
-        
+
+
 /**
  * Copies all the properties of config to obj.
  *
@@ -302,8 +298,6 @@ XObject.prototype = {
  * @return {Object} returns obj
  * @member XObject extend
  */
-
-
 XObject.extend = function(o, c, defaults){
     if(defaults){
         // no "this" reference for friendly out of scope calls
@@ -326,24 +320,22 @@ XObject.extend(XObject,
      * @return {Object} returns obj
      * @member Object extendIf
      */
-
-
     extendIf : function(o, c){
 
         if(!o || !c || typeof c != 'object'){
             return o;
         }
+
         for(var p in c){
             if (typeof(o[p]) != 'undefined') {
                 continue;
             }
             o[p] = c[p];
         }
+
         return o;
     },
 
-
     /**
      * Extends one class with another class and optionally overrides members with the passed literal. This class
      * also adds the function "override()" to the class that can be used to override
@@ -359,6 +351,7 @@ XObject.extend(XObject,
      *        ... methods and properties.
      *     }
      * });
+     *
      * @param {Function} constructor The class inheriting the functionality
      * @param {Object} superclass The class being extended
      * @param {Object} overrides (optional) A literal with members
@@ -372,6 +365,7 @@ XObject.extend(XObject,
                 this[m] = o[m];
             }
         };
+
         return function(sb, sp, overrides) {
             if (typeof(sp) == 'undefined') {
                 // error condition - try and dump..
@@ -398,7 +392,6 @@ XObject.extend(XObject,
         };
     }(),
 
-         
     /**
      * returns a list of keys of the object.
      * @param {Object} obj object to inspect
@@ -429,7 +422,6 @@ XObject.extend(XObject,
      * x = XObject.createDelegate(a, this);
      * 
      */
-
     createDelegate : function(method, obj, args, appendArgs){
         
         return function() {
@@ -438,12 +430,11 @@ XObject.extend(XObject,
                 callArgs = Array.prototype.slice.call(arguments, 0);
                 callArgs = callArgs.concat(args);
             }else if(typeof appendArgs == "number"){
-                callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first
-                    var applyArgs = [appendArgs, 0].concat(args); // create method call params
+                callArgs = Array.prototype.slice.call(arguments, 0);   // copy arguments first
+                    var applyArgs = [appendArgs, 0].concat(args);      // create method call params
                     Array.prototype.splice.apply(callArgs, applyArgs); // splice them in
                 }
                 return method.apply(obj || window, callArgs);
             };
     }
-    
-});
\ No newline at end of file
+});
index e3bd0f3..f3384ff 100644 (file)
@@ -3,10 +3,12 @@
 
 var console = {
     log : function (v)  {
-       Seed.print(v);
+       //Seed.print(v);
+        print(v);
     },
     dump : function (ar) {
-        Seed.print(this._dump(ar, 0));
+        //Seed.print(this._dump(ar, 0));
+        print(this._dump(ar, 0));
     },
 
     _dump: function(arr,level) {
diff --git a/docs.js b/docs.js
index a34e3ef..1d67d12 100644 (file)
--- a/docs.js
+++ b/docs.js
@@ -1,28 +1,41 @@
 //<Script type="text/javascript">
 
-Gtk = imports.gi.Gtk;
-Gio = imports.gi.Gio;
-Gdk = imports.gi.Gdk;
+const Gtk  = imports.gi.Gtk;
+const Gio  = imports.gi.Gio;
+const Gdk  = imports.gi.Gdk;
+const GLib = imports.gi.GLib;
+
 
 // generic libraries
-XObject     = imports.XObject.XObject;
-File        = imports.File.File; 
-console     = imports.console.console; 
-Template    = imports.JsTemplate.Template.Template; 
+const XObject     = imports.XObject.XObject;
+const File        = imports.File.File; 
+const console     = imports.console.console; 
+const Template    = imports.JsTemplate.Template.Template; 
 
 // Introspecion specific..
-NameSpace   = imports.Introspect.NameSpace.NameSpace; 
-Link        = imports.Introspect.Link.Link; 
-
+const NameSpace   = imports.Introspect.NameSpace.NameSpace; 
+const Link        = imports.Introspect.Link.Link; 
 
 
-var outputdir = Seed.argv[2];
+var isSeed = typeof(Seed) != 'undefined';
+function argv(n) {
+    if (isSeed)
+        return Seed.argv[n];
+    else
+        return ARGV[n-2]; // running gjs from gnome-shell 3 (~/binjhbuild run ..)
+                          // make args shift 2 place
+}
 
+//var outputdir = Seed.argv[2];
+var outputdir = argv(2);
 if (!outputdir) {
     throw {
-        name: "ArgumentError", 
-        message: "No output directory specified on the command line\n" +
-          "Usage seed docs.js /var/www/seed  [Gtk] \n"
+        name   : "ArgumentError",
+        message: "No output directory specified on the command line\n"           +
+                 "Usage:\n"                                                      +
+                 "\t<seed|gjs> docs.js <output_dir> [root_gir_name_list]\n"      +
+                 "\toutput_dir          - ex: /var/www/seed \n"                  +
+                 "\tgir_root_name_list  - comma separated gir root name ex: Gtk,Gio, ...\n"
     };
 }
 
@@ -32,101 +45,137 @@ if (!File.isDirectory(outputdir)) {
     File.mkdir(outputdir);
 };
 
-// Which libraries to build.
 
+// Which libraries to build.
 var ns_list = NameSpace.namespaces();
-if (typeof(Seed.argv[3]) == 'string') {
-    console.log(Seed.argv.length);
-    ns_list = Seed.argv[3].split(',');
+//if (typeof(Seed.argv[3]) == 'string') {
+if (typeof(argv(3)) == 'string') {
+//    console.log(Seed.argv.length);
+//    ns_list = Seed.argv[3].split(',');
+    ns_list = argv(3).split(',');
 }
-
 ns_list = ns_list.sort();
 
+// let's try and load them, so we find out early what will fail.
+//print("loading library to make sure it works.");
+ns_list.forEach(function(ns_name)
+{
+    var core = imports.gi[ns_name];
+});
+
+var script_path = GLib.get_current_dir();
 
 // which languages do we want to output for.
-langs=[];
-File.list(__script_path__ + '/templates/').forEach(function(f) {
-    if (!File.isDirectory(__script_path__ + '/templates/' + f)) {
+var langs = [];
+//File.list(__script_path__ + '/templates/').forEach(function(f) {
+File.list(script_path + '/templates/').forEach(function(f) {
+    // skip file
+    //if (!File.isDirectory(__script_path__ + '/templates/' + f)) {
+    if (!File.isDirectory(script_path + '/templates/' + f)) {
         return;
     }
+
+    // skip dir
     if (f == 'resources') {
         return;
     }
+
+    //console.log("lang: " + f);
     langs.push({
-        name : f,
-        cls_template       : new Template( {
-            templateFile : __script_path__ + '/templates/' + f + '/class.html',
-            Link : Link // links might be specific to languages..
-        }),
-        cls_ix_template    : new Template( {
-            templateFile : __script_path__ + '/templates/' + f + '/class_ix.html',
-            Link : Link // links might be specific to languages..
-        }),
+        name               : f,
+        cls_template       : new Template({
+                                            //templateFile : __script_path__ + '/templates/' + f + '/class.html',
+                                            templateFile : script_path + '/templates/' + f + '/class.html',
+                                            Link         : Link // links might be specific to languages..
+                                         }),
+        cls_ix_template    : new Template({
+                                            //templateFile : __script_path__ + '/templates/' + f + '/class_ix.html',
+                                            templateFile : script_path + '/templates/' + f + '/class_ix.html',
+                                            Link         : Link // links might be specific to languages..
+                                         }),
         reference_template : new Template({
-            templateFile : __script_path__ + '/templates/' + f + '/references.html',
-            Link : Link // links might be specific to languages..
-        }),
+                                            //templateFile : __script_path__ + '/templates/' + f + '/references.html',
+                                            templateFile : script_path + '/templates/' + f + '/references.html',
+                                            Link         : Link // links might be specific to languages..
+                                         }),
     });
 });
 
 
 /*
-var cls_template = new Template(__script_path__ + '/templates/class.html');
-var cls_ix_template = new Template(__script_path__ + '/templates/class_ix.html');
+var cls_template       = new Template(__script_path__ + '/templates/class.html');
+var cls_ix_template    = new Template(__script_path__ + '/templates/class_ix.html');
 var reference_template = new Template(__script_path__ + '/templates/references.html');
 */
 
-
+print("Looping throught namespaces");
 var ns_idx = [];
 ns_list.forEach(function(ns_name) 
 {
     
     //if (ns_idx.length) {         return ;/* do one - for testing */ } 
-    
-    var  core = imports.gi[ns_name];
-    var idx = { name: ns_name}; 
+
+    // need to load the lib before introspecting it later
+    //var core = imports.gi[ns_name];
+
+    var idx = {name: ns_name};
     console.log("START:" + ns_name);
-   
+
     var ns = NameSpace.ns(ns_name);
-    
+
     // gir goes in top level...
     if (File.exists(ns.gir_file)) {
+        console.log("gir_file: " + ns.gir_file);
         File.copyFile(ns.gir_file, outputdir + '/'+ ns.gir_filename, Gio.FileCopyFlags.OVERWRITE);
     }
-    
-    
-    
 
     langs.forEach(function(lang) {
-        ns['left_bar'] = lang.cls_ix_template.process(ns);
+
+        //console.log("lang.name: " + lang.name);
+
+        //ns['left_bar'] = lang.cls_ix_template.process(ns);
+        ns.left_bar = lang.cls_ix_template.process(ns);
+
+        // create lang dir if needed
+        if (!File.isDirectory(outputdir + '/' + lang.name)) {
+            console.log("Creating directory: " + outputdir + '/' + lang.name);
+            File.mkdir(outputdir + '/' + lang.name);
+        };
+
         // namespace template
-        Gio.simple_write(outputdir + '/'+ lang.name+ '/' +ns_name +  '.html', lang.cls_template.process(ns));
-        
+        //Gio.simple_write(outputdir + '/'+ lang.name + '/' + ns_name + '.html', lang.cls_template.process(ns));
+        File.write(outputdir + '/' + lang.name + '/' + ns_name + '.html', lang.cls_template.process(ns));
+
         // left bar index of elements in namespace...
-        Gio.simple_write(outputdir + '/'+ lang.name + '/_ix_'+ ns_name +  '.shtml', lang.cls_ix_template.process(ns));
-            
+        //Gio.simple_write(outputdir + '/'+ lang.name + '/_ix_'+ ns_name + '.shtml', lang.cls_ix_template.process(ns));
+        File.write(outputdir + '/' + lang.name + '/_ix_'+ ns_name + '.shtml', lang.cls_ix_template.process(ns));
     });
-     
-    
+
     var actions = {
-        'objects' : 'Class',
+        'objects'    : 'Class',
         'interfaces' : 'Interface',
-        'structs' : 'Struct',
-        'unions' : 'Union',
-        'enums' : 'Enum'
-        
+        'structs'    : 'Struct',
+        'unions'     : 'Union',
+        'enums'      : 'Enum'
     };
+
     for (var i in actions) {
         // we flag GLib as a GObject lib...
         idx[i]= ns_name == 'GLib' ? 1 : ns[i].length ;
+        
         ns[i].forEach( function(n) {
+            
+            //print('NameSpace.factory(' + actions[i] +','+ns_name+','+n);
             var odata = XObject.extend(
                 NameSpace.factory(actions[i], ns_name, n),
                 { 'left_bar' :ns['left_bar'] }
             );
+            
             langs.forEach(function(lang) {
-                Gio.simple_write(outputdir +  '/'+ lang.name + '/' + ns_name + '.' + n + '.html', 
+                //Gio.simple_write(outputdir +  '/'+ lang.name + '/' + ns_name + '.' + n + '.html',
+                //    lang.cls_template.process(odata)
+                //)
+                File.write(outputdir +  '/'+ lang.name + '/' + ns_name + '.' + n + '.html',
                     lang.cls_template.process(odata)
                 )
             });
@@ -134,40 +183,40 @@ ns_list.forEach(function(ns_name)
         }); 
     }
     ns_idx.push(idx);
-    
 });
 
-var refs = '';
+var refs           = '';
 var html_file_path = '';
-var html = ''
+var html           = '';
 
 // output cross reference data..
 langs.forEach(function(lang) {
-    
+
     for (var i in NameSpace.references) {
-        
+
         html_file_path = [ outputdir, lang.name, i + '.html'].join('/');
-      
+
         if (i == 'undefined') {
           console.log("Undefined name space - ignored");
           continue;
         }
-        
+
         if (!File.isFile(html_file_path)) {
           console.log("No HTML file " + html_file_path + " to insert references into - ignored");
           continue;
         }
-        
-        refs = langs.reference_template.process(NameSpace.references[i]);
 
-          // HTML to put refs into
+        refs = lang.reference_template.process(NameSpace.references[i]);
+
+        // HTML to put refs into
         html =  File.read(html_file_path);
 
-          // do the replacement
+        // do the replacement
         html = html.replace(/\<!--references--\>/, refs);
 
-          // write back to file
-        Gio.simple_write(html_file_path, html);
+        // write back to file
+        //Gio.simple_write(html_file_path, html);
+        File.write(html_file_path, html);
 
     }
 });
@@ -175,10 +224,15 @@ langs.forEach(function(lang) {
 // set up index and resources.
 langs.forEach(function(lang) {
     var ix_template = new Template({
-        templateFile : __script_path__ + '/templates/' + lang.name + '/index.html',
-        Link : Link, // lang specifc?
-    });
-    Gio.simple_write(outputdir + '/' + lang.name +  '/index.html', ix_template.process(ns_idx));
-    File.silentRecursiveCopy(__script_path__ + '/templates/resources/', 
-        outputdir + '/'  + lang.name , Gio.FileCopyFlags.OVERWRITE);
-});
\ No newline at end of file
+                                    //templateFile : __script_path__ + '/templates/' + lang.name + '/index.html',
+                                    templateFile : script_path + '/templates/' + lang.name + '/index.html',
+                                    Link : Link, // lang specifc?
+                                });
+
+    //Gio.simple_write(outputdir + '/' + lang.name +  '/index.html', ix_template.process(ns_idx));
+    File.write(outputdir + '/' + lang.name +  '/index.html', ix_template.process(ns_idx));
+    //File.silentRecursiveCopy(__script_path__ + '/templates/resources/',
+    File.silentRecursiveCopy(script_path + '/templates/resources/',
+                             outputdir + '/'  + lang.name ,
+                             Gio.FileCopyFlags.OVERWRITE);
+});
diff --git a/templates/gjs/class.html b/templates/gjs/class.html
new file mode 100644 (file)
index 0000000..63f88c7
--- /dev/null
@@ -0,0 +1,750 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:roo="http://www.akbkhome.com/roojs1/" xml:lang="en" lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+               <meta name="generator" content="JsDoc Toolkit" />
+               {! Link.base = "../"; /* all generated links will be relative to this */ !}
+               
+               <title>JsDoc Reference - {+data.name+}</title>
+               
+        <script type="text/javascript" src="page.js"></script>
+
+        <link rel="stylesheet" type="text/css" href="default.css" />
+        <link rel="stylesheet" type="text/css" href="library_gnome.css"></link>
+        <link media="print" rel="stylesheet" type="text/css" href="library_gnome_print.css"></link>
+       </head>
+
+       <body onload="RooDocsPage.onload();">
+       
+       <div id="page">
+        
+        <div id="header">
+            <div id="header-wrap">
+                <h1>
+                    Un-official Seed Documentation<!-- GNOME Documentation Library-->
+                </h1>
+        
+            </div>
+        </div>
+       
+       
+       
+       
+       
+       
+       
+       
+       
+        
+        <div class="left-class-list"  style="width:18%;float:left;"> 
+            <a href="index.html"> Back to Seed Clases </a>
+            <br/><br/> 
+            {+data.left_bar+}
+        </div>
+         
+ <div class="body-wrap" style="width:78%;float:left;">
+
+    <!-- ============================== links to methods. ================================= -->        
+
+    <div class="top-tools">
+    <!--
+        <a class="inner-link" href="#{+data.name+}-props"><img src="resources/s.gif" class="item-icon icon-prop">Properties</a>
+        <a class="inner-link" href="#{+data.name+}-methods"><img src="resources/s.gif" class="item-icon icon-method">Methods</a>
+        <a class="inner-link" href="#{+data.name+}-events"><img src="resources/s.gif" class="item-icon icon-event">Events</a>
+        <a class="inner-link" href="#{+data.name+}-configs"><img src="resources/s.gif" class="item-icon icon-config">Config Options</a>
+        <a class="bookmark" href="NEED_TO_CREATE_DIRECT_LINK_HREF"><img src="resources/s.gif" class="item-icon icon-fav">Direct Link</a>
+       -->
+    </div>
+
+
+    
+    
+    
+<!-- ============================== inheritance Block. ================================= -->   
+       <if test="data.extendsClasses.length">
+               <div class="inheritance res-block">
+                  <p class="res-block-inner">{!
+                               var iblock_indent = 0;
+                               
+                                       
+                                data.extendsClasses.reverse().map(
+                                       function($) {  
+                                               
+                                               output += (iblock_indent ? '<img src="elbow-end.gif" class="elbow elbow_indent' +
+                            + iblock_indent + '" alt="parent-child marker"/>' : '');
+                                               output += new Link().toSymbolLong($.alias);
+                                               output += "\n<br/>";
+                                               iblock_indent += 1;
+                        
+                                       }
+                               )
+                               
+                       !}<img class="elbow elbow_indent{+iblock_indent+}" src="elbow-end.gif" alt="parent-child marker"/>
+                {+data.alias+}
+
+                  </p>
+               </div>
+       </if>
+       
+       {+makeImage(data.alias)+}
+       
+       
+<!-- ============================== class title / details ============================ -->
+    
+   
+    <h1 class="classTitle">
+                                
+                               
+        {+data.titleType+} {+data.alias+}
+                       </h1>
+                       
+    <table cellspacing="0" class="class-summary-table">
+    
+<if test="data.ns">
+        <tr>
+            <td class="label">Import line:</td>
+            <td class="hd-info">{+data.ns+} = imports.gi.{+data.ns+}; </td>
+       </tr>
+</if>
+     <tr>
+            <td class="label">GIR File:</td>
+            <td class="hd-info"><a href="../{+data.gir_filename+}">{+data.gir_filename+}</a></td>
+        </tr>
+        <tr>
+            <td class="label">C documentation:</td>
+            <td class="hd-info">{+new Link().toGnome(data.alias)+}</td>
+        </tr>
+        <tr>
+            <td class="label">{+data.titleType+} :</td>
+            <td class="hd-info">{+data.name+}</td>
+        </tr>
+       
+<if test="data.implementInterfaces && data.implementInterfaces.length">
+
+        <tr>
+            <td class="label">Implements:</td>
+            <td class="hd-info">
+               {+
+                       data.implementInterfaces.map(
+                               function($) { return new Link().toSymbolLong($.alias); }
+                       ).join(", ")
+               +}
+            </td>
+        </tr>
+
+</if>
+<if test="data.implementedBy && data.implementedBy.length">
+        <tr>
+            <td class="label">Implementations:</td>
+            <td class="hd-info">
+               {+
+                       data.implementedBy
+                       .sort()
+                       .map(
+                               function($) { return new Link().toSymbolLong($); }
+                       ).join(", ")
+               +}
+            </td>
+        </tr>
+
+
+</if>
+<if test="data.childClasses.length">
+        <tr>
+            <td class="label">Subclasses:</td>
+            <td class="hd-info">
+               {+
+                       data.childClasses
+                       .sort()
+                       .map(
+                               function($) { return new Link().toSymbolLong($); }
+                       ).join(", ")
+               +}
+
+       
+       
+            </td>
+        </tr>
+</if>
+
+       <if test="data.extendsClasses.length">
+       
+               <tr><td class="label">Extends:</td><td class="hd-info">
+                       {+
+                               new Link().toSymbolLong(data.extendsClasses[data.extendsClasses.length -1].alias)
+                               
+                       +}
+       
+               </td></tr>    
+       </if>
+       
+    </table>
+
+    
+<!-- ============================== class summary ========================== -->                       
+    <div class="description">
+       {+resolveLinks(data.desc)+}
+    </div>
+
+       
+<!-- ============================== Class comment block... ========================== -->                                      
+<!-- 
+<div class="comments">
+       <b>Class Comments / Notes</B> =>  
+       <u onclick="parent.CommentDialog.showCommentId = '{+data.name+}';">[Add Your comment/notes about this class]</u>
+       <br/>
+       <iframe frameborder="0"  id="comments-{+data.name+}" style="border: none;width:100%;" 
+               src="http://www.akbkhome.com/blog.php/SeedComments/{+data.ns+}.{+data.name+}.html"></iframe>
+</div>
+-->    
+       
+<!-- ============================== enum values ========================== -->                                         
+                
+    
+       {!
+       
+        
+        
+       
+               cfgProperties = data.values ? data.values.sort(makeSortby("name")) : [];
+               
+       
+               
+               
+       !}
+               
+    <div class="hr"></div>
+    <a id="{+data.alias+}-values"></a>
+               
+    <if test="!cfgProperties.length">
+    
+     
+    </if>
+     
+    <if test="cfgProperties.length">
+       
+      <table cellspacing="0" class="member-table">   
+      <caption>Values </caption>
+    
+       
+        <tr>
+            <th class="sig-header" colspan="2">Properties</th>
+           
+        </tr>
+       
+       
+       
+       <for each="dtag" in="cfgProperties">
+       
+               <tr class="config-row expandable config-row-alt{+$dtag_i % 2+}{+ ((dtag.memberOf == data.alias) ?   " notInherited" : "") +}">
+                  <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
+                   <td class="sig">
+
+                       <a id="{+dtag.memberOf+}-cfg-{+dtag.name+}" name=".{+dtag.name+}"></a>
+                       <div class="fixedFont">
+               {+(new Link().toSymbolLong(dtag.type))+} {+data.alias+}.<b  class="itemname">{+dtag.name+}</b> : {+dtag.value+}
+                       </div>
+                 
+                       <div class="mdesc">
+                           <div class="short">{+resolveLinks(summarize(dtag.desc))+}</div> 
+                       </div>
+                       
+                       <div class="mdesc">
+                           <div class="long">{+resolveLinks(dtag.desc)+}</div> 
+                       </div>
+                       
+                       
+
+                   </td>
+                  
+               </tr>
+        </for>
+        
+    </table>
+  </if>                
+  
+  
+  
+  
+               
+<!-- ============================== config options ========================== -->                                              
+                
+    
+       {!
+       
+        
+        
+       
+               cfgProperties = data.properties.sort(makeSortby("name"));
+               
+       
+               
+               
+       !}
+               
+    <div class="hr"></div>
+    <a id="{+data.alias+}-configs"></a>
+               
+    <if test="!cfgProperties.length">
+    
+     <table cellspacing="0" class="member-table">
+      <caption class="Empty">Properties</caption>
+      <tr><td>None</td></tr>
+     </table>
+    
+    </if>
+     
+    <if test="cfgProperties.length">
+       
+      <table cellspacing="0" class="member-table">   
+      <caption>Properties </caption>
+    
+       
+        <tr>
+            <th class="sig-header" colspan="2">Properties</th>
+           
+            <th class="msource-header">Defined By</th>
+        </tr>
+       
+       
+       
+       <for each="dtag" in="cfgProperties">
+       
+               <tr class="config-row expandable config-row-alt{+$dtag_i % 2+}{+ ((dtag.memberOf == data.alias) ?   " notInherited" : "") +}">
+                  <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
+                   <td class="sig">
+
+                       <a id="{+dtag.memberOf+}-cfg-{+dtag.name+}" name=".{+dtag.name+}"></a>
+                       <div class="fixedFont">
+                               <b  class="itemname">{+dtag.name+}</b> : {+((dtag.type) ? (new Link().toSymbolLong(dtag.type)) : "" )+} 
+                 {+ (dtag.flags ? (dtag.flags & 2 ? '' : 'read only') : '')+}  
+                     
+                       </div>
+                 
+                       <div class="mdesc">
+                           <div class="short">{+resolveLinks(summarize(dtag.desc))+}</div> 
+                       </div>
+                       
+                       <div class="mdesc">
+                           <div class="long">{+resolveLinks(dtag.desc)+}</div> 
+                       </div>
+                       
+                       
+
+                   </td>
+                   <td class="msource">
+                       {# - fixme - add inheritied as link here #}
+                       {+ (dtag.memberOf == data.alias) ? dtag.memberOf :  new Link().toSymbolLong(dtag.memberOf) +}
+                               
+                   </td>
+               </tr>
+        </for>
+        
+    </table>
+  </if>                
+  
+  
+  
+  
+  
+  
+   
+  <!-- ============================== methods summary / details ======================== -->
+  
+  
+  <a id="{+data.alias+}-methods"></a>
+       <!-- constructor?? -->
+       {! 
+               
+        
+               
+               var ownMethods = [];
+               ownMethods.push.apply(ownMethods, data.constructors.sort(makeSortby("name")));
+               ownMethods.push.apply(ownMethods, data.functions.sort(makeSortby("name")));
+               ownMethods.push.apply(ownMethods, data.methods.sort(makeSortby("name")));
+               
+       !}
+    <!-- constructors, then statics, then dynamics -->
+  
+  
+    <if test="!ownMethods.length">
+    
+     <table cellspacing="0" class="member-table">
+      <caption class="Empty">Public Methods</caption>
+      <tr><td>None</td></tr>
+     </table>
+    
+    </if>
+    <if test="ownMethods.length">
+    
+      <table cellspacing="0" class="member-table">
+      <caption>Methods / Constructors</caption>
+        <tr>
+            <th class="sig-header" colspan="2">Method / Constructor</th>            
+            <th class="msource-header">Defined By</th>
+
+        </tr>
+        
+       
+       
+        
+       
+        <for each="member" in="ownMethods">
+         
+          <tr class="method-row config-row-alt{+$member_i % 2+}{!
+                 if (member.isConstructor && (!member.params || !member.params.length)) {
+                         output += '';
+                } else {
+                         output += ' expandable';
+                       }
+                 
+                 
+               if (member.memberOf == data.alias) {
+                       output += " notInherited";
+                }
+                 
+                !}">
+            <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
+          
+          
+            <td class="sig">
+                <a id="{+member.memberOf+}-method-{+member.name+}"   name=".{+member.name+}"></a>
+               <div class="fixedFont">
+                       <span class="attributes">{!
+                                       if (member.isConstructor) {
+                                               output +=  "new  <B>" + 
+                                                    member.memberOf + (!member.name || !member.name.length ? "" : ".") +"</B>";
+                                       } else {
+                                                
+                                               if (member.isStatic) {
+                                                       output +=  data.alias + ".";
+                                               }
+                                       }
+                               !}</span><b class="itemname">{!  
+                                        output += (!member.name || !member.name.length  ? "" : member.name);
+                               !}</b>
+                               
+                                {+makeSignature(member.params)+} 
+                       
+                               <if test="(member.returns && member.returns.length) || !member.isConstructor">
+                                        : 
+                                       {! 
+                                          if (member.returns.length > 1) {
+                                                  output += (new Link().toSymbol("Object"));
+                                          } else {
+                                                  output += (new Link().toSymbolLong(member.returns[0].type));
+                                          }
+                                         
+                                        !}
+                                       
+                               </if>
+                       
+               </div>
+                <div class="mdesc">
+               <if test="!member.isConstructor">
+                   <div class="short">{+resolveLinks(summarize(member.desc))+}</div> 
+                </if>
+                <if test="member.isConstructor">
+                       <div class="short">Create a new {+data.alias +}</div> 
+                </if>
+                
+                    <div class="long">
+                       <if test="!member.isConstructor">
+                               {+resolveLinks(member.desc)+}
+                   
+                               <if test="member.example">
+                                       <pre class="code">{+member.example+}</pre>
+                               </if>
+                       </if>
+                       
+                       <if test="member.isConstructor">
+                               Create a new {+data.alias +}
+                       </if>
+                       <if test="member.params && member.params.length">
+                               <dl class="detailList">
+                               <dt class="heading">Parameters:</dt>
+                               <for each="item" in="member.params">
+                                       <dt>
+                    
+                       <if test="typeof(item.type) == 'object'">
+                            <span class="fixedFont">{+(new Link().toSymbolLong('Function'))+}</span>
+                            {+makeSignature(item.type.params)+} 
+                            
+                        
+                               {! 
+                                   if (member.returns && member.returns.length) {
+                                       output += ' : ' + (new Link().toSymbolLong(member.returns[0].type)) + ' ';
+                                   } else {
+                                       output += ' :  none ';
+                                   }
+                                  
+                                 !}
+                                 
+                        </if>
+                        <if test="typeof(item.type) != 'object'">
+                            {+((item.type)?"<span class=\"fixedFont\">"+(new Link().toSymbolLong(item.type))+"</span> " : "")+} <b>{+item.name+}</b>
+                        </if>
+                    
+                        <if test="item.isOptional">
+                            <i>Optional
+                            <if test="item.defaultValue">, 
+                                Default: {+item.defaultValue+}
+                            </if>
+                            </i>
+                        </if>
+                        <if test="!item.be_null">
+                            <span style="color:red;">
+                               Required (not null)
+                            </span>
+                        </if>
+                        
+                                               
+                                               
+                                               
+                                       </dt>
+                                       <dd>
+                                               {+resolveLinks(item.desc)+}
+                                               
+                                               
+                                               <if test="item.properties && item.properties.length">
+                                                    <dl class="detailList">
+                                                       <for each="returnitem" in="item.properties">
+                                                            <dt>
+                                                               {+((returnitem.type)?"<span class=\"fixedFont\">"+(new Link().toSymbolLong(returnitem.type))+"</span> " : "")+} <b>{+returnitem.name+}</b>
+                                                             </dt>
+                                                             <dd>
+                                                             {+resolveLinks(returnitem.desc)+}
+                                                               </dd>
+                                                       
+                                                       </for>
+                                                     </dl>
+                                               
+                                               </if>
+                                       
+                                        
+                                       
+                                       
+                                       
+                                       </dd>
+                                       
+                                       
+                                       
+                               </for>
+                               </dl>
+                       </if>
+                       <if test="member.deprecated">
+                               <dl class="detailList">
+                               <dt class="heading">Deprecated:</dt>
+                               <dt>
+                                       {+member.deprecated+}
+                               </dt>
+                               </dl>
+                       </if>
+                        
+                       <if test="member.exceptions && member.exceptions.length">
+                               <dl class="detailList">
+                               <dt class="heading">Throws:</dt>
+                               <for each="item" in="member.exceptions">
+                                       <dt>
+                                               {+((item.type)?"<span class=\"fixedFont\">{"+(new Link().toSymbolLong(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+                                       </dt>
+                                       <dd>{+resolveLinks(item.desc)+}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                       <if test="member.returns && member.returns.length">
+                               <dl class="detailList">
+                               <dt class="heading">Returns:</dt>
+                               
+                               <if test="member.returns > 1">
+                                       <dl>An Object with these properties</dl>
+                               </if>
+                               
+                               <for each="item" in="member.returns">
+                                       <dd>{! 
+                                               if (member.returns.length > 1) {
+                                                       output += item.name+ ': ';
+                                               }
+                                               !}
+                                        {+((item.type)?"<span class=\"fixedFont\">"+(new Link().toSymbolLong(item.type))+"</span> " : "")+} 
+                                           {+resolveLinks(item.desc)+}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                        
+                   
+                    
+                    </div>                    
+                </div>
+
+            </td>
+            <td class="msource">
+               <if test="!member.isConstructor">
+                       {+ (member.memberOf == data.alias) ? member.memberOf :  new Link().toSymbolLong(member.memberOf) +}
+               </if>&nbsp;
+            </td>
+        </tr>
+       </for>
+                                                      
+    </table>
+</if>
+  
+  <!-- ============================== events summary / details ======================== -->
+  
+  
+  <a id="{+data.alias+}-events"></a>
+    
+  
+       {! 
+               
+               
+               var ownEvents = data.signals.sort(makeSortby("name"));
+                
+       !}
+   <if test="!ownEvents.length">
+    
+     <table cellspacing="0" class="member-table">
+      <caption class="Empty">Events</caption>
+      <tr><td>None</td></tr>
+     </table>
+    
+    </if>
+  
+    
+    <if test="ownEvents.length">
+    
+      <table cellspacing="0" class="member-table">
+               <caption>Events - usage syntax:  this.signals.EVENTNAME.connect( {+(new Link().toSymbolLong('Function' ))+} ) </caption>
+             <thead>
+               <tr>
+                   <th class="sig-header" colspan="2">Event</th>            
+                   <th class="msource-header">Defined By</th>
+
+               </tr>
+             </thead>  
+       
+       
+        
+       
+        <for each="member" in="ownEvents">
+          <tr class="method-row expandable config-row-alt{+$member_i % 2+}{!
+
+               if (member.memberOf == data.alias) {
+                       output += " notInherited";
+                }
+                 
+                 
+                 
+                 
+                 
+                 
+                !}">
+            <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
+           
+            <td class="sig">
+                <a id="{+member.memberOf+}-event-{+member.name+}"></a>
+                
+              <div class="fixedFont">
+               <b class="itemname">{+member.name+}</b> {+makeSignature(member.params)+} 
+                : 
+                                       {! 
+                                          if (member.returns && member.returns.length) {
+                                                  output += (new Link().toSymbolLong(member.returns[0].type));
+                                          } else {
+                                                  output += 'none';
+                                          }
+                                         
+                                        !}
+                                       
+        
+        
+               </div>
+
+                <div class="mdesc">
+
+                   <div class="short">{+resolveLinks(summarize(member.desc))+}
+                  
+               </div> 
+                   
+                    <div class="long">
+                   
+                       {+resolveLinks(member.desc)+}
+                   
+                        
+                       <if test="member.params && member.params.length">
+                               <dl class="detailList">
+                               <dt class="heading">Parameters:</dt>
+                               <for each="item" in="member.params">
+                                       <dt>
+                                               {+((item.type)?"<span class=\"fixedFont\">"+(new Link().toSymbolLong(item.type))+"</span> " : "")+}<b>{+item.name+}</b>
+                                               <if test="item.isOptional"><i>Optional
+                                                       <if test="item.defaultValue">, 
+                                                       Default: {+item.defaultValue+}
+                                               </if></i></if>
+                                       </dt>
+                                       <dd>{+resolveLinks(item.desc)+}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                        
+                       <if test="member.exceptions.length">
+                               <dl class="detailList">
+                               <dt class="heading">Throws:</dt>
+                               <for each="item" in="member.exceptions">
+                                       <dt>
+                                               {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbolLong(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+                                       </dt>
+                                       <dd>{+resolveLinks(item.desc)+}</dd>
+                               </for>  
+                               </dl>
+                       </if>
+                       <if test="member.returns && member.returns.length">
+                               <dl class="detailList">
+                               <dt class="heading">Returns:</dt>
+                               <for each="item" in="member.returns">
+                                       <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbolLong(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                        
+                   
+                   
+                    
+                    </div>                    
+                </div>
+
+            </td>
+            <td class="msource">
+                {+ (member.memberOf == data.alias) ? member.memberOf :  new Link().toSymbolLong(member.memberOf) +}
+            </td>
+        </tr>
+       </for>
+                                                      
+    </table>
+</if>
+  
+  <a id="{+data.alias+}-references"></a> 
+  <!--references-->
+</div>
+</div>
+  
+<!-- ============================== footer ================================= -->
+               <div class="fineprint" style="clear:both">
+                       <if test="data.copyright">&copy;{+data.copyright+}<br /></if>
+                       Documentation generated by 
+            <a href="http://git.gnome.org/browse/introspection-doc-generator">Introspection Doc Generator</a> 
+                       Loosely Based on 
+                       <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> on {+new Date()+}
+               </div>
+       </body>
+</html>
diff --git a/templates/gjs/class_ix.html b/templates/gjs/class_ix.html
new file mode 100644 (file)
index 0000000..09d011b
--- /dev/null
@@ -0,0 +1,49 @@
+<h2 class="classTitle">{+ (new Link().toSymbol(data.name)) +}</h2>
+<br/>
+
+<h3>Classes</h3>
+
+<if test="data.objects.length > 0">
+  <ul>
+         <for each="c" in="data.objects">
+                 <li>  {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+         </for>
+  </ul>
+</if>
+
+<h3>Interfaces</h3>
+<if test="data.interfaces.length > 0">
+  <ul>
+    <for each="c" in="data.interfaces">
+      <li>  {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+    </for>
+  </ul>
+</if>
+
+<h3>Structs</h3>
+<if test="data.structs.length > 0">
+  <ul>
+    <for each="c" in="data.structs">
+      <li>  {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+    </for>
+  </ul>
+</if>
+
+<h3>Unions</h3>
+<if test="data.unions.length > 0">
+  <ul>
+         <for each="c" in="data.unions">
+                 <li>  {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+         </for>
+  </ul>
+</if>
+
+<h3>Enums</h3>
+<if test="data.enums.length > 0">
+  <ul>
+         <for each="c" in="data.enums">
+                 <li>  {+ (new Link().toSymbol(data.name + '.' + c)) +} </li>
+         </for>
+
+  </ul>
+</if>
diff --git a/templates/gjs/index.html b/templates/gjs/index.html
new file mode 100644 (file)
index 0000000..0accbb3
--- /dev/null
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
+ <head> 
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
+  <title>Seed Documentation</title> 
+  <link rel="stylesheet" type="text/css" href="default.css" /> 
+  <link rel="stylesheet" type="text/css" href="library_gnome.css"></link> 
+  <link media="print" rel="stylesheet" type="text/css" href="library_gnome_print.css"></link> 
+ </head> 
+ <body> 
+     
+    <div id="page"> 
+        <div id="header"> 
+            <div id="header-wrap"> 
+                <h1>Un-official Seed Documentation</h1> 
+            </div> 
+        </div> 
+        <div class="body-wrap"> 
+                
+            <div class="ns-list"> 
+                <h2>GObject Libraries</h2> 
+                <for each="thisClass" in="data"> 
+                    {!
+                    if (!thisClass.objects) { continue; }
+                    !}
+                    <div> 
+                        <h2 class="classTitle">{+ (new Link().toSymbol(thisClass.name)) +}</h2> 
+                    </div> 
+                </for> 
+            </div> 
+            
+            <div class="ns-list"> 
+     
+                <h2>Non - GObject Libraries</h2> 
+                <for each="thisClass" in="data"> 
+                    {!
+                    if (thisClass.objects) { continue; }
+                    !}
+                    <div> 
+                        <h2 class="classTitle">{+ (new Link().toSymbol(thisClass.name)) +}</h2> 
+                    </div> 
+                </for> 
+            </div> 
+     
+        </div> 
+    </div> 
+</body> 
+</html> 
+       
\ No newline at end of file
diff --git a/templates/gjs/references.html b/templates/gjs/references.html
new file mode 100644 (file)
index 0000000..bd1d2c7
--- /dev/null
@@ -0,0 +1,146 @@
+  
+   
+  <!-- ============================== methods summary / details ======================== -->
+  
+  
+  <! --  -->
+       <!-- constructor?? -->
+       {! 
+               
+        
+               var ownMethods = data.sort(makeSortby("memberOf"));
+               //var ownMethods = [];
+               //ownMethods.push.apply(ownMethods, data.sort(makeSortby("alias")));
+        //ownMethods.push.apply(ownMethods, data);
+               
+               
+       !}
+        
+        
+       <!-- then dynamics first -->
+  
+  
+    <if test="!ownMethods.length">
+    
+     <table cellspacing="0" class="member-table">
+      <caption class="Empty">Used by These Methods / Signals / Properties- Nowhere other than here</caption>
+     </table>
+    
+    </if>
+    <if test="ownMethods.length">
+    
+    
+    
+    
+      <table cellspacing="0" class="member-table">
+      <caption>Used by These Methods / Signals / Properties</caption>
+        <tr>
+                    <th class="msource-header">Class / Namespace</th>
+            <th class="sig-header">Method / Signal / Properties</th>            
+
+
+        </tr>
+               
+       
+        <for each="member" in="ownMethods">
+         
+          <tr class="method-row config-row-alt{+$member_i % 2+}">
+         
+             <td class="msource">
+               
+                       {+  new Link().toSymbolLong(member.memberOf) +}
+            <br/>
+            {+ member.propertyType +}
+            <!--<div class="mdesc">
+                <div class="short">
+                 
+                </div>
+            </div> -->
+               
+            </td>
+
+            
+            
+<if test="member.propertyType != 'Property'">
+ <!-- signal or method -->
+          
+            <td class="sig">
+                <a id="{+member.memberOf+}-method-{+member.name+}"   name=".{+member.name+}"></a>
+               <div class="fixedFont">
+                       <span class="attributes">{!
+                                       if (member.isConstructor) {
+                                               output +=  "new  <B>" + 
+                                                    member.memberOf + (!member.name || !member.name.length ? "" : ".") +"</B>";
+                                       } else {
+                                                
+                                               if (member.isStatic) {
+                                                       output +=  member.memberOf + ".";
+                                               }
+                                       }
+                               !}</span><b class="itemname">{!  
+                                        output += (!member.name || !member.name.length  ? "" : member.name);
+                               !}</b>
+                               
+                                {+makeSignature(member.params)+} 
+                       
+                               <if test="(member.returns && member.returns.length) || !member.isConstructor">
+                                        : 
+                                       {! 
+                                          if (member.returns.length > 1) {
+                                                  output += (new Link().toSymbol("Object"));
+                                          } else {
+                                                  output += (new Link().toSymbolLong(member.returns[0].type));
+                                          }
+                                         
+                                        !}
+                                       
+                               </if>
+                       
+               </div>
+                <div class="mdesc">
+               <if test="!member.isConstructor">
+                   <div class="short">{+resolveLinks(summarize(member.desc))+}</div> 
+                </if>
+                <if test="member.isConstructor">
+                       <div class="short">Create a new {+member.memberOf +}</div> 
+                </if>
+                
+                 
+                    
+              
+            </td>
+</if>
+<!-- property -->
+
+<if test="member.propertyType == 'Property'">
+ <!-- signal or method -->
+  <td class="sig">
+
+                       <a id="{+member.memberOf+}-cfg-{+member.name+}" name=".{+member.name+}"></a>
+                       <div class="fixedFont">
+                               <b  class="itemname">{+member.name+}</b> : {+((member.type) ? (new Link().toSymbolLong(member.type)) : "" )+} 
+                 {+ (member.flags ? (member.flags & 2 ? '' : 'read only') : '')+}  
+                     
+                       </div>
+                 
+                       <div class="mdesc">
+                           <div class="short">{+resolveLinks(summarize(member.desc))+}</div> 
+                       </div>
+                        
+                       
+
+                   </td>
+</if>
+
+
+            
+        
+        </tr>
+       </for>
+                                                      
+    </table>
+</if>
+   
\ No newline at end of file
index 3d7c49c..2aee037 100644 (file)
@@ -126,8 +126,21 @@ RooDocsPage = {
             
         } 
         return d.getAttributeNS(ns, name) || d.getAttribute(ns+":"+name) || d.getAttribute(name) || d[name];
+    },
+    vis : '',
+    toggle : function()
+    {
+        this.vis = this.vis == '' ? 'none' : '';
+        var vis = this.vis;
+        // new browsers only...
+        Array.prototype.slice.call(
+            document.getElementsByClassName('expandable')
+        ).forEach(function(e) { 
+            if (!e.className.match(/notInherited/)) { 
+                e.style.display= vis; 
+            }
+        })
     }
-    
 }
 
 
index 3b729a3..63f88c7 100644 (file)
@@ -11,7 +11,7 @@
                <title>JsDoc Reference - {+data.name+}</title>
                
         <script type="text/javascript" src="page.js"></script>
-               
+
         <link rel="stylesheet" type="text/css" href="default.css" />
         <link rel="stylesheet" type="text/css" href="library_gnome.css"></link>
         <link media="print" rel="stylesheet" type="text/css" href="library_gnome_print.css"></link>
 </if>
      <tr>
             <td class="label">GIR File:</td>
-            <td class="hd-info"><a href="{+data.gir_filename+}">{+data.gir_filename+}</a></td>
+            <td class="hd-info"><a href="../{+data.gir_filename+}">{+data.gir_filename+}</a></td>
         </tr>
         <tr>
             <td class="label">C documentation:</td>
                        <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> on {+new Date()+}
                </div>
        </body>
-</html>
\ No newline at end of file
+</html>
index 96602b1..09d011b 100644 (file)
@@ -46,4 +46,4 @@
          </for>
 
   </ul>
-</if>
\ No newline at end of file
+</if>