2 * AxWin Window Manager Interface Library
3 * By John Hodge (thePowersGang)
4 * This file is published under the terms of the Acess Licence. See the
5 * file COPYING for details.
7 * main.c - Library Initialisation
14 int giAxWin_PID = 9; // HACK!
15 tAxWin_MessageCallback *gAxWin_DefaultCallback;
23 tAxWin_Message *AxWin_int_SendAndWait(int RetID, tAxWin_Message *Message)
28 AxWin_SendMessage(Message);
32 msg = AxWin_WaitForMessage();
34 rmsg = (void*)msg->Data;
35 if(msg->ID == MSG_SRSP_RETURN && rmsg->ReqID == Message->ID )
38 AxWin_HandleMessage(msg);
45 int AxWin_Register(const char *Name, tAxWin_MessageCallback *DefaultCallback)
50 int len = strlen(Name);
52 req.ID = MSG_SREQ_REGISTER;
53 req.Size = 1 + (len+1)/4;
54 strcpy(req.Data, Name);
56 msg = AxWin_int_SendAndWait(MSG_SRSP_RETURN, &req);
57 ret = ((tAxWin_RetMsg*)msg->Data)->Value;
60 gAxWin_DefaultCallback = DefaultCallback;
65 tAxWin_Element *AxWin_CreateWindow(const char *Title)
70 int len = strlen(Title);
72 req.ID = MSG_SREQ_ADDWIN;
73 req.Size = 1 + (len+1)/4;
74 strcpy(req.Data, Title);
76 msg = AxWin_int_SendAndWait(MSG_SRSP_RETURN, &req);
77 ret = (tAxWin_Element*) ((tAxWin_RetMsg*)msg->Data)->Value;
83 tAxWin_Element *AxWin_AddMenuItem(tAxWin_Element *Parent, const char *Label, int Message)