2 * Acess2 GUI (AxWin) Version 3
3 * - By John Hodge (thePowersGang)
12 #include <axwin3/keysyms.h>
15 extern void Video_Setup(void);
16 extern void WM_Initialise(void);
17 extern int Renderer_Menu_Init(void);
18 extern int Renderer_Widget_Init(void);
19 extern int Renderer_Background_Init(void);
20 extern int Renderer_Framebuffer_Init(void);
21 extern void WM_Update(void);
22 extern void WM_Hotkey_Register(int nKeys, uint32_t *Keys, const char *ActionName);
25 void ParseCommandline(int argc, char **argv);
28 const char *gsTerminalDevice = NULL;
29 const char *gsMouseDevice = NULL;
31 int giScreenWidth = 640;
32 int giScreenHeight = 480;
34 int giTerminalFD = -1;
35 int giTerminalFD_Input = 0;
38 #define __INSTALL_ROOT "/Acess/Apps/AxWin/3.0"
40 const char *gsInstallRoot = __INSTALL_ROOT;
44 * \brief Program Entrypoint
46 int main(int argc, char *argv[])
48 int server_tid = gettid();
50 ParseCommandline(argc, argv);
52 if( gsTerminalDevice == NULL ) {
53 gsTerminalDevice = "/Devices/VTerm/6";
55 if( gsMouseDevice == NULL ) {
56 gsMouseDevice = "/Devices/Mouse/system";
64 Renderer_Widget_Init();
65 Renderer_Background_Init();
66 Renderer_Framebuffer_Init();
71 keys[0] = KEYSYM_LEFTGUI; keys[1] = KEYSYM_r;
72 WM_Hotkey_Register(2, keys, "Interface>Run");
74 // Spawn interface root
75 if( clone(CLONE_VM, 0) == 0 )
77 static char csInterfaceApp[] = __INSTALL_ROOT"/AxWinUI";
78 char server_info[] = "AXWIN3_SERVER=00000";
79 char *envp[] = {server_info, NULL};
80 char *argv[] = {csInterfaceApp, NULL};
81 _SysDebug("server_tid = %i, &server_tid = %p", server_tid, &server_tid);
82 sprintf(server_info, "AXWIN3_SERVER=%i", server_tid);
83 execve(csInterfaceApp, argv, envp);
96 Input_FillSelect(&nfds, &fds);
97 IPC_FillSelect(&nfds, &fds);
100 if( _SysSelect(nfds, &fds, NULL, NULL, NULL, THREAD_EVENT_IPCMSG) == -1 ) {
101 _SysDebug("ERROR: select() returned -1");
105 Input_HandleSelect(&fds);
106 IPC_HandleSelect(&fds);
111 void ParseCommandline(int argc, char **argv)