gtkrun.js
[app.Builder.js] / gtkrun.js
1 #!/usr/bin/seed
2 //<Script type="text/javascript">
3 /**
4  * runtime file
5  * takes a gtk project directory, and turns it into an application!
6  * by compling the files into JS files..
7  * 
8  * Initially developed for runtime testing. (the vte runner)
9  * 
10  * Might be the way to go for full runtime 
11  * 
12  * 
13  * Usage
14  * gtkrun.js /path/to/myproject
15  * 
16  * Concepts.. 
17  * a) load dependancies.. (eg. gi's..) - derived later?
18  * Gtk.init()
19  * 
20  * loop the files (find .bjs)
21  *   - comple to js (if not exist // or force enabled..)
22  * b) load all the files
23  * 
24  * Gtk.main();
25  * 
26  */
27 // autogen?
28  
29 Gtk = imports.gi.Gtk;
30 Gdk = imports.gi.Gdk;
31 Pango = imports.gi.Pango;
32 GLib = imports.gi.GLib;
33 Gio = imports.gi.Gio;
34 GObject = imports.gi.GObject;
35 GtkSource = imports.gi.GtkSource;
36 WebKit = imports.gi.WebKit;
37 Vte = imports.gi.Vte;
38
39 File = imports.File.File;
40
41 Gtk.init(Seed.argv);
42
43 // error checking todo..
44 var files = Files.list(Seed.argv[2]);
45 var olist = [];
46
47 var gtkbuilder = false;
48 files.forEach(function(f) {
49     if (!f.match(/\.bjs$/)) {
50         continue;
51     }
52     if (File.exist(f.replace(/\.bjs$/, '.js')) {
53         olist.push(imports[f.replace(/\.bjs$/, '.js')]);
54         continue;
55     }
56     var gtkbuilder  new imports.Builder.Provider.File.Gtk.Gtk({ path : f });
57     gtkbuilder.saveJS();
58     olist.push(imports[f.replace(/\.bjs$/, '.js')]);
59     
60     
61 });
62
63
64
65           
66 Gtk.main();
67