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 int Renderer_RichText_Init(void);
22 extern void WM_Update(void);
23 extern void WM_Hotkey_Register(int nKeys, uint32_t *Keys, const char *ActionName);
26 void ParseCommandline(int argc, char **argv);
29 const char *gsTerminalDevice = NULL;
30 const char *gsMouseDevice = NULL;
32 int giScreenWidth = 640;
33 int giScreenHeight = 480;
35 int giTerminalFD = -1;
36 int giTerminalFD_Input = 0;
39 #define __INSTALL_ROOT "/Acess/Apps/AxWin/3.0"
41 const char *gsInstallRoot = __INSTALL_ROOT;
45 * \brief Program Entrypoint
47 int main(int argc, char *argv[])
49 ParseCommandline(argc, argv);
51 if( gsTerminalDevice == NULL ) {
52 gsTerminalDevice = "/Devices/VTerm/6";
54 if( gsMouseDevice == NULL ) {
55 gsMouseDevice = "/Devices/Mouse/system";
63 Renderer_Widget_Init();
64 Renderer_Background_Init();
65 Renderer_Framebuffer_Init();
66 Renderer_RichText_Init();
71 keys[0] = KEYSYM_LEFTGUI; keys[1] = KEYSYM_r;
72 WM_Hotkey_Register(2, keys, "Interface>Run");
74 // Spawn interface root
76 int server_tid = gettid();
77 _SysDebug("server_tid = %i", server_tid);
78 static char csInterfaceApp[] = __INSTALL_ROOT"/AxWinUI";
79 char server_info[] = "AXWIN3_SERVER=00000";
80 const char *envp[] = {server_info, NULL};
81 const char *argv[] = {csInterfaceApp, NULL};
82 _SysDebug("server_tid = %i, &server_tid = %p", server_tid, &server_tid);
83 sprintf(server_info, "AXWIN3_SERVER=%i", server_tid);
84 // TODO: Does the client need FDs?
85 int rv = _SysSpawn(csInterfaceApp, argv, envp, 0, NULL, NULL);
87 _SysDebug("_SysSpawn chucked a sad, rv=%i, errno=%i", rv, _errno);
100 Input_FillSelect(&nfds, &fds);
101 IPC_FillSelect(&nfds, &fds);
104 if( _SysSelect(nfds, &fds, NULL, NULL, NULL, THREAD_EVENT_IPCMSG) == -1 ) {
105 _SysDebug("ERROR: select() returned -1");
109 Input_HandleSelect(&fds);
110 IPC_HandleSelect(&fds);
115 void ParseCommandline(int argc, char **argv)