gtkrun.js
authorAlan Knowles <alan@akkbhome.com>
Sat, 22 May 2010 12:05:43 +0000 (20:05 +0800)
committerAlan Knowles <alan@akkbhome.com>
Sat, 22 May 2010 12:05:43 +0000 (20:05 +0800)
gtkrun.js [new file with mode: 0644]

diff --git a/gtkrun.js b/gtkrun.js
new file mode 100644 (file)
index 0000000..a0c6e7d
--- /dev/null
+++ b/gtkrun.js
@@ -0,0 +1,67 @@
+#!/usr/bin/seed
+//<Script type="text/javascript">
+/**
+ * runtime file
+ * takes a gtk project directory, and turns it into an application!
+ * by compling the files into JS files..
+ * 
+ * Initially developed for runtime testing. (the vte runner)
+ * 
+ * Might be the way to go for full runtime 
+ * 
+ * 
+ * Usage
+ * gtkrun.js /path/to/myproject
+ * 
+ * Concepts.. 
+ * a) load dependancies.. (eg. gi's..) - derived later?
+ * Gtk.init()
+ * 
+ * loop the files (find .bjs)
+ *   - comple to js (if not exist // or force enabled..)
+ * b) load all the files
+ * 
+ * Gtk.main();
+ * 
+ */
+// autogen?
+Gtk = imports.gi.Gtk;
+Gdk = imports.gi.Gdk;
+Pango = imports.gi.Pango;
+GLib = imports.gi.GLib;
+Gio = imports.gi.Gio;
+GObject = imports.gi.GObject;
+GtkSource = imports.gi.GtkSource;
+WebKit = imports.gi.WebKit;
+Vte = imports.gi.Vte;
+
+File = imports.File.File;
+
+Gtk.init(Seed.argv);
+
+// error checking todo..
+var files = Files.list(Seed.argv[2]);
+var olist = [];
+
+var gtkbuilder = false;
+files.forEach(function(f) {
+    if (!f.match(/\.bjs$/)) {
+        continue;
+    }
+    if (File.exist(f + '.js')) {
+        olist.push(imports[f + '.js']);
+        continue;
+    }
+    var gtkbuilder  new imports.Builder.Provider.File.Gtk.Gtk({ path : f });
+    gtkbuilder.saveJS();
+    olist.push(imports[f + '.js']);
+    
+    
+});
+
+
+
+          
+Gtk.main();
\ No newline at end of file