- // - Open graphics
- Graphics::Initialise(config.m_video);
- // - Open input
- Input::Initialise(config.m_input);
- // > Handles hotkeys?
- // - Initialise compositor structures
- Compositor::Initialise(config.m_compositor);
- // - Bind IPC channels
- IPC::Initialise(config.m_ipc);
- // - Start root child process (from config)
- // TODO: Spin up child process
-
+
+ CVideo* vid = 0;
+ CCompositor* compositor = 0;
+ CInput* input = 0;
+
+ try {
+ // - Open graphics
+ vid = new CVideo(config.m_video);
+ ::_SysDebug("vid = %p", vid);
+ // - Initialise compositor structures
+ compositor = new CCompositor(/*config.m_compositor,*/ *vid);
+ ::_SysDebug("compositor = %p", compositor);
+ // - Open input
+ input = new CInput(config.m_input, *compositor);
+ ::_SysDebug("input = %p", input);
+ // > Handles hotkeys?
+ // - Bind IPC channels
+ IPC::Initialise(config.m_ipc, *compositor);
+ ::_SysDebug("IPC up");
+ // - Start root child process (from config)
+ // TODO: Spin up child process
+
+ {
+ const char *interface_app = "/Acess/Apps/AxWin/4.0/AxWinUI";
+ const char *argv[] = {interface_app, NULL};
+ int rv = _SysSpawn(interface_app, argv, NULL, 0, NULL, NULL);
+ if( rv < 0 ) {
+ _SysDebug("_SysSpawn chucked a sad, rv=%i, errno=%i", rv, _errno);
+ throw ::std::system_error(errno, ::std::system_category());
+ }
+ }
+ }
+ catch(const ::std::exception& e) {
+ fprintf(stderr, "Startup threw exception: %s\n", e.what());
+ _SysDebug("Startup threw exception: %s", e.what());
+ delete input;
+ delete compositor;
+ delete vid;
+ return 1;
+ }
+