Usermode/AxWin3 - Duplicate renderer detection, debug changes
authorJohn Hodge <[email protected]>
Tue, 6 Aug 2013 00:21:34 +0000 (08:21 +0800)
committerJohn Hodge <[email protected]>
Tue, 6 Aug 2013 00:21:34 +0000 (08:21 +0800)
Usermode/Applications/axwin3_src/WM/ipc.c
Usermode/Applications/axwin3_src/WM/renderers/framebuffer.c
Usermode/Applications/axwin3_src/WM/wm.c

index 41949a8..7155c11 100644 (file)
@@ -492,7 +492,7 @@ void IPC_Handle(tIPC_Client *Client, size_t MsgLen, tAxWin_IPCMessage *Msg)
                        _SysDebug("WARNING: Message %i has no handler in %s", Msg->ID, renderer->Name);
                        return ;
                }
-               _SysDebug("IPC_Handle: Call %s-%i", renderer->Name, Msg->ID);
+               _SysDebug("IPC_Handle: Call %s-%i %ib", renderer->Name, Msg->ID, Msg->Size);
                rv = renderer->IPCHandlers[Msg->ID](win, Msg->Size, Msg->Data);
                if( rv )
                        _SysDebug("IPC_Handle: rv != 0 (%i)", rv);
@@ -511,7 +511,7 @@ void IPC_Handle(tIPC_Client *Client, size_t MsgLen, tAxWin_IPCMessage *Msg)
                        return ;
                }
        
-               _SysDebug("IPC_Handle: Call WM-%i", Msg->ID);
+               _SysDebug("IPC_Handle: Call WM-%i %ib", Msg->ID, Msg->Size);
                rv = gIPC_MessageHandlers[Msg->ID](Client, Msg);
                if( rv )
                        _SysDebug("IPC_Handle: rv != 0 (%i)", rv);
index 68a3f8c..90f0033 100644 (file)
@@ -41,6 +41,7 @@ tWMRenderer   gRenderer_Framebuffer = {
        .IPCHandlers = {
                [IPC_FB_COMMIT] = _Handle_Commit,
                [IPC_FB_NEWBUF] = _Handle_CreateBuf,
+               //[IPC_FB_SUBBUF] = _Handle_SubBuf,
        }
 };
 
index 5f204af..e200700 100644 (file)
@@ -60,7 +60,16 @@ void WM_Initialise(void)
 
 void WM_RegisterRenderer(tWMRenderer *Renderer)
 {
-       // TODO: Catch out duplicates
+       // Catch out duplicates
+       for(tWMRenderer *r = gpWM_Renderers; r; r = r->Next ) {
+               if( r == Renderer ) {
+                       return ;
+               }
+               if( strcmp(r->Name, Renderer->Name) == 0 ) {
+                       return ;
+               }
+       }
+       
        Renderer->Next = gpWM_Renderers;
        gpWM_Renderers = Renderer;
 }

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