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_bjs_compile != null) {
25                  
26                 BuilderApplication.compileBjs();
27                 
28                 GLib.Process.exit(Posix.EXIT_SUCCESS);
29         }
30         
31     
32     
33         if (BuilderApplication.opt_compile_project != null) {
34                  
35                 Palete.ValaSourceCompiler.buildApplication();
36                 
37                 GLib.Process.exit(Posix.EXIT_SUCCESS);
38         }
39         
40          
41         
42         GLib.debug("project = %s\n", BuilderApplication.opt_compile_project);
43         
44         Gtk.init (ref args);
45         
46         
47         GtkClutter.init (ref args);
48         new JsRender.Lang_Class();
49         GLib.Log.set_always_fatal(LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL); 
50         Project.Project.loadAll();
51     
52     
53     // respond to other arguments
54     
55         /*var proj = Project.Project.getProject("Pman.Core");
56         if (proj == null) {
57                 print("could not load test project Pman.Core");
58                 return 0;
59         }
60         proj.scanDirs();
61         */
62
63         var w = Xcls_MainWindow.singleton();
64         //w.ref();
65         //w.project = proj;
66         
67         w.el.show_all();
68         // it looks like showall after children causes segfault on ubuntu 14.4
69         w.initChildren();
70         w.windowstate.switchState(WindowState.State.FILES);
71         
72         Gtk.main();
73     app = null;
74         
75         return 0;
76 }