#include <axwin3/axwin.h>
#include <stdlib.h>
#include <string.h>
-#include "include/ipc.h"
#include "include/internal.h"
+#include "include/ipc.h"
#define WINDOWS_PER_ALLOC (63)
}
tHWND AxWin3_CreateWindow(
- tHWND Parent, const char *Renderer, int Flags,
- int DataBytes, void **DataPtr,
- tAxWin3_WindowMessageHandler MessageHandler
+ tHWND Parent, const char *Renderer, int RendererArg,
+ int DataBytes, tAxWin3_WindowMessageHandler MessageHandler
)
{
tWindow *ret;
msg = AxWin3_int_AllocateIPCMessage(Parent, IPCMSG_CREATEWIN, 0, dataSize);
create_win = (void*)msg->Data;
create_win->NewWinID = newWinID;
- create_win->Flags = Flags;
+ create_win->RendererArg = RendererArg;
strcpy(create_win->Renderer, Renderer);
// Send and clean up
// TODO: Detect and handle possible errors
// Return success
- if(DataPtr) *DataPtr = ret->Data;
return ret;
}
free(msg);
}
+void *AxWin3_int_GetDataPtr(tHWND Window)
+{
+ return &Window->Data;
+}
+
+void AxWin3_SendMessage(tHWND Window, tHWND Destination, int Message, int Length, void *Data)
+{
+ tAxWin_IPCMessage *msg;
+ tIPCMsg_SendMsg *info;
+
+ msg = AxWin3_int_AllocateIPCMessage(Window, IPCMSG_SENDMSG, 0, sizeof(*info)+Length);
+ info = (void*)msg->Data;
+ info->Dest = AxWin3_int_GetWindowID(Destination);
+}
+
void AxWin3_ShowWindow(tHWND Window, int bShow)
{
tAxWin_IPCMessage *msg;
msg = AxWin3_int_AllocateIPCMessage(Window, IPCMSG_SETWINPOS, 0, sizeof(*info));
info = (void*)msg->Data;
- info->Fields = 0xF;
+ info->bSetPos = 1;
+ info->bSetDims = 1;
info->X = X; info->Y = Y;
info->W = W; info->H = H;
msg = AxWin3_int_AllocateIPCMessage(Window, IPCMSG_SETWINPOS, 0, sizeof(*info));
info = (void*)msg->Data;
- info->Fields = 0x3;
+ info->bSetPos = 1;
+ info->bSetDims = 0;
info->X = X;
info->Y = Y;
msg = AxWin3_int_AllocateIPCMessage(Window, IPCMSG_SETWINPOS, 0, sizeof(*info));
info = (void*)msg->Data;
- info->Fields = 0xC;
+ info->bSetPos = 0;
+ info->bSetDims = 1;
info->W = W;
info->H = H;