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