src/Main.vala
[app.Builder.js] / src / Main.vala
1 /**
2  * Test the writer code...
3
4
5 */
6  
7 int main (string[] args) {
8         
9         
10         
11         
12     
13
14         var app =  BuilderApplication.singleton(  args);
15         
16         if (BuilderApplication.opt_debug  || BuilderApplication.opt_compile_project == null) {
17                 GLib.Log.set_handler(null, 
18                         GLib.LogLevelFlags.LEVEL_DEBUG | GLib.LogLevelFlags.LEVEL_WARNING, 
19                         (dom, lvl, msg) => {
20                         print("%s: %s\n", dom, msg);
21                 });
22         }
23         
24         if (BuilderApplication.opt_compile_project != null) {
25                  
26                 Palete.ValaSourceCompiler.buildApplication();
27                 
28                 GLib.Process.exit(Posix.EXIT_SUCCESS);
29         }
30         
31          
32         
33         GLib.debug("project = %s\n", BuilderApplication.opt_compile_project);
34         
35         Gtk.init (ref args);
36         
37         
38         GtkClutter.init (ref args);
39         new JsRender.Lang_Class();
40         GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL); 
41         Project.Project.loadAll();
42         /*var proj = Project.Project.getProject("Pman.Core");
43         if (proj == null) {
44                 print("could not load test project Pman.Core");
45                 return 0;
46         }
47         proj.scanDirs();
48         */
49
50         var w = Xcls_MainWindow.singleton();
51         //w.ref();
52         //w.project = proj;
53         
54         w.el.show_all();
55         // it looks like showall after children causes segfault on ubuntu 14.4
56         w.initChildren();
57         w.windowstate.switchState(WindowState.State.FILES);
58         
59         Gtk.main();
60     
61         
62         return 0;
63 }