Modules/Mouse - Fixing bugs, removing debug
[tpg/acess2.git] / Usermode / Applications / axwin3_src / WM / main.c
index c6a4546..0d15046 100644 (file)
 #include <stdio.h>
 
 // === IMPORTS ===
-extern void    WM_Update(void);
 extern void    Video_Setup(void);
+extern void    WM_Initialise(void);
+extern int     Renderer_Menu_Init(void);
+extern int     Renderer_Widget_Init(void);
+extern int     Renderer_Background_Init(void);
+extern void    WM_Update(void);
 
 // === PROTOTYPES ===
 void   ParseCommandline(int argc, char **argv);
@@ -45,15 +49,17 @@ int main(int argc, char *argv[])
                gsTerminalDevice = "/Devices/VTerm/6";
        }
        if( gsMouseDevice == NULL ) {
-               gsMouseDevice = "/Devices/PS2Mouse";
+               gsMouseDevice = "/Devices/Mouse/system";
        }
        
        Video_Setup();
-//     Interface_Init();
        IPC_Init();
        Input_Init();
        
-//     WM_Update();
+       Renderer_Menu_Init();
+       Renderer_Widget_Init();
+       Renderer_Background_Init();
+       WM_Initialise();
        
        // Spawn interface root
        if( clone(CLONE_VM, 0) == 0 )
@@ -62,8 +68,10 @@ int main(int argc, char *argv[])
                char    server_info[] = "AXWIN3_SERVER=00000";
                char    *envp[] = {server_info, NULL};
                char    *argv[] = {csInterfaceApp, NULL};
+               _SysDebug("server_tid = %i, &server_tid = %p", server_tid, &server_tid);
                sprintf(server_info, "AXWIN3_SERVER=%i", server_tid);
                execve(csInterfaceApp, argv, envp);
+               exit(1);
        }
 
        // Main Loop
@@ -73,11 +81,13 @@ int main(int argc, char *argv[])
                 int    nfds = 0;
                FD_ZERO(&fds);
        
+               WM_Update();
+
                Input_FillSelect(&nfds, &fds);
                IPC_FillSelect(&nfds, &fds);
                
                nfds ++;
-               if( select(nfds, &fds, NULL, NULL, NULL) == -1 ) {
+               if( _SysSelect(nfds, &fds, NULL, NULL, NULL, THREAD_EVENT_IPCMSG) == -1 ) {
                        _SysDebug("ERROR: select() returned -1");
                        return -1;
                }

UCC git Repository :: git.ucc.asn.au