ULONG TellWBTaskToCloseWindows(struct IntuitionBase *IntuitionBase) { DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: currenttask <%s>\n", FindTask(NULL)->tc_Node.ln_Name)); if( GetPrivIBase(IntuitionBase)->WorkBenchMP != NULL ) { struct IntuiMessage *imsg; if ((imsg = AllocIntuiMessage(NULL))) { /* Setup our message */ imsg->ExecMessage.mn_ReplyPort = GetPrivIBase(IntuitionBase)->IntuiReplyPort; imsg->Class = IDCMP_WBENCHMESSAGE; imsg->Code = WBENCHCLOSE; DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: Send Msg\n")); /* Sends it to the handler asynchron */ PutMsg( GetPrivIBase(IntuitionBase)->WorkBenchMP, &imsg->ExecMessage); DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: done\n")); return(TRUE); } else { DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: no memory\n")); } } else { DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: no Workbench port\n")); } return(FALSE); }
struct IntuiMessage *alloc_intuimessage(struct Window *w, struct IntuitionBase *IntuitionBase) { struct IntuiMessage *imsg; imsg = AllocIntuiMessage(w); if (imsg) { if (w) { if (w->IDCMPFlags & IDCMP_DELTAMOVE) { struct IIHData *iihd = (struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data; imsg->MouseX = iihd->DeltaMouseX; imsg->MouseY = iihd->DeltaMouseY; } else { imsg->MouseX = w->MouseX; imsg->MouseY = w->MouseY; } } CurrentTime(&imsg->Seconds, &imsg->Micros); } return imsg; }