X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2Flibaxwin3.so_src%2Fwm.c;h=53208f2de0df1cbd2f7ae26ecfcc1456aa27c943;hb=ed78a9ac44c440180c37c1cbbbd7ecbc4d9076d7;hp=412f5832f0582680a90e99b949e1b50683819ed9;hpb=21192b41da0f87dba07dac08b2d814b0976d929c;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c b/Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c index 412f5832..53208f2d 100644 --- a/Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c +++ b/Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c @@ -127,7 +127,7 @@ int AxWin3_GetDisplayDims(int Display, int *X, int *Y, int *Width, int *Height) ret = (void*)msg->Data; if(X) *X = ret->X; - if(X) *X = ret->Y; + if(Y) *Y = ret->Y; if(Width) *Width = ret->W; if(Height) *Height = ret->H; @@ -161,6 +161,8 @@ tHWND AxWin3_CreateWindow( AxWin3_int_SendIPCMessage(msg); free(msg); + _SysDebug("AxWin3_CreateWindow: %i :: '%s'", newWinID, Renderer); + // TODO: Detect and handle possible errors // Return success @@ -217,7 +219,7 @@ void AxWin3_int_HandleMessage(tAxWin_IPCMessage *Msg) gAxWin3_Hotkeys[mi->ID](); }break; default: - _SysDebug("--- Unhandled SENDMSG %i", info->ID); + _SysDebug("--- Unhandled SENDMSG 0x%x win %i", info->ID, Msg->Window); break; } } @@ -285,6 +287,36 @@ void *AxWin3_WaitMessage(tHWND Window, int MessageID, size_t *Length) } } +void AxWin3_SendIPC(tHWND Window, int Message, size_t Length, const void *Data) +{ + tAxWin_IPCMessage *msg; + + msg = AxWin3_int_AllocateIPCMessage(Window, Message, IPCMSG_FLAG_RENDERER, Length); + memcpy(msg->Data, Data, Length); + AxWin3_int_SendIPCMessage(msg); + free(msg); +} + +void *AxWin3_WaitIPCMessage(tHWND Window, int MessageID, size_t *Length) +{ + tAxWin_IPCMessage *msg; + for( ;; ) + { + msg = AxWin3_int_WaitIPCMessage(MessageID); + if( !(msg->Flags & IPCMSG_FLAG_RENDERER) || msg->Window != AxWin3_int_GetWindowID(Window) ) { + AxWin3_int_HandleMessage(msg); + continue ; + } + + *Length = msg->Size; + void *ret = malloc(msg->Size); + memcpy(ret, msg->Data, msg->Size); + free(msg); + + return ret; + } +} + void AxWin3_FocusWindow(tHWND Window) { tAxWin_IPCMessage *msg;