X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2Flibaxwin3.so_src%2Fwm.c;h=4a6242b19025ee80282827f6f9cb93ec08c776e8;hb=dd2491a82880ed9b01b5d66b1814d271921797a4;hp=fd91e883b2f446b53958921cd8f263208ac10b24;hpb=1314c5a4586315b526d84500d5b2ef5f7800b703;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 fd91e883..4a6242b1 100644 --- a/Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c +++ b/Usermode/Applications/axwin3_src/libaxwin3.so_src/wm.c @@ -54,7 +54,7 @@ tWindow *AxWin3_int_GetWindowFromID(uint32_t ServerID) tWindow *AxWin3_int_AllocateWindowInfo(int DataBytes, int *WinID) { int idx, newWinID; - tWindowBlock *block, *prev; + tWindowBlock *block, *prev = NULL; tWindow *ret; block = &gAxWin3_WindowList; @@ -89,6 +89,48 @@ tWindow *AxWin3_int_AllocateWindowInfo(int DataBytes, int *WinID) return ret; } +int AxWin3_GetDisplayCount(void) +{ + tAxWin_IPCMessage *msg; + tIPCMsg_ReturnInt *ret; + int rv; + + msg = AxWin3_int_AllocateIPCMessage(NULL, IPCMSG_GETDISPLAYCOUNT, IPCMSG_FLAG_RETURN, 0); + AxWin3_int_SendIPCMessage(msg); + free(msg); + + msg = AxWin3_int_WaitIPCMessage(IPCMSG_GETDISPLAYCOUNT); + if(msg->Size < sizeof(*ret)) return -1; + ret = (void*)msg->Data; + rv = ret->Value; + free(msg); + return rv; +} + +int AxWin3_GetDisplayDims(int Display, int *X, int *Y, int *Width, int *Height) +{ + tAxWin_IPCMessage *msg; + tIPCMsg_GetDisplayDims *req; + tIPCMsg_RetDisplayDims *ret; + + msg = AxWin3_int_AllocateIPCMessage(NULL, IPCMSG_GETDISPLAYDIMS, IPCMSG_FLAG_RETURN, sizeof(*req)); + req = (void*)msg->Data; + req->DisplayID = Display; + AxWin3_int_SendIPCMessage(msg); + free(msg); + + msg = AxWin3_int_WaitIPCMessage(IPCMSG_GETDISPLAYDIMS); + if(msg->Size < sizeof(*ret)) return -1; + ret = (void*)msg->Data; + + if(X) *X = ret->X; + if(X) *X = ret->Y; + if(Width) *Width = ret->W; + if(Height) *Height = ret->H; + + return 0; +} + tHWND AxWin3_CreateWindow( tHWND Parent, const char *Renderer, int RendererArg, int DataBytes, tAxWin3_WindowMessageHandler MessageHandler @@ -154,6 +196,19 @@ void AxWin3_int_HandleMessage(tAxWin_IPCMessage *Msg) } } +void AxWin3_SetWindowTitle(tHWND Window, const char *Title) +{ + tAxWin_IPCMessage *msg; + int len = strlen(Title); + + msg = AxWin3_int_AllocateIPCMessage(Window, IPCMSG_SETWINTITLE, 0, len+1); + strcpy(msg->Data, Title); + + AxWin3_int_SendIPCMessage(msg); + + free(msg); +} + void AxWin3_SendMessage(tHWND Window, tHWND Destination, int Message, int Length, void *Data) { tAxWin_IPCMessage *msg; @@ -170,14 +225,38 @@ void AxWin3_SendMessage(tHWND Window, tHWND Destination, int Message, int Length free(msg); } +void AxWin3_FocusWindow(tHWND Window) +{ + tAxWin_IPCMessage *msg; + + msg = AxWin3_int_AllocateIPCMessage(Window, IPCMSG_FOCUSWINDOW, 0, 0); + + AxWin3_int_SendIPCMessage(msg); + free(msg); +} + void AxWin3_ShowWindow(tHWND Window, int bShow) { tAxWin_IPCMessage *msg; - tIPCMsg_ShowWindow *info; + tIPCMsg_Boolean *info; msg = AxWin3_int_AllocateIPCMessage(Window, IPCMSG_SHOWWINDOW, 0, sizeof(*info)); info = (void*)msg->Data; - info->bShow = !!bShow; + info->Value = !!bShow; + + AxWin3_int_SendIPCMessage(msg); + + free(msg); +} + +void AxWin3_DecorateWindow(tHWND Window, int bDecorate) +{ + tAxWin_IPCMessage *msg; + tIPCMsg_Boolean *info; + + msg = AxWin3_int_AllocateIPCMessage(Window, IPCMSG_DECORATEWINDOW, 0, sizeof(*info)); + info = (void*)msg->Data; + info->Value = !!bDecorate; AxWin3_int_SendIPCMessage(msg);