示例#1
0
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);
}
示例#2
0
BOOL fire_message(struct Window *w,ULONG Class, UWORD Code, APTR IAddress, struct IntuitionBase *IntuitionBase)
{
    struct ExtIntuiMessage *imsg;
    BOOL            	    result = FALSE;

    if ((w->IDCMPFlags & Class) && (w->UserPort))
    {
        if ((imsg = (struct ExtIntuiMessage *)alloc_intuimessage(w, IntuitionBase)))
        {
            struct IIHData *iihdata = (struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data;

            imsg->eim_IntuiMessage.Class     = Class;
            imsg->eim_IntuiMessage.Code      = Code;
            imsg->eim_IntuiMessage.Qualifier = iihdata->ActQualifier;
            if (Class == IDCMP_RAWKEY)
            {
                INT_INTUIMESSAGE(imsg)->prevCodeQuals = IAddress;
                imsg->eim_IntuiMessage.IAddress = &INT_INTUIMESSAGE(imsg)->prevCodeQuals;
            }
            else
            {
                imsg->eim_IntuiMessage.IAddress = IAddress;
            }

            if (iihdata->ActEventTablet && (w->MoreFlags & WMFLG_TABLETMESSAGES))
            {
                if ((imsg->eim_TabletData = AllocPooled(GetPrivIBase(IntuitionBase)->IDCMPPool,sizeof (struct TabletData))))
                {
                    memclr(imsg->eim_TabletData,sizeof (struct TabletData));
                    imsg->eim_TabletData->td_XFraction = iihdata->ActEventTablet->ient_ScaledXFraction;
                    imsg->eim_TabletData->td_YFraction = iihdata->ActEventTablet->ient_ScaledYFraction;
                    imsg->eim_TabletData->td_TabletX = iihdata->ActEventTablet->ient_TabletX;
                    imsg->eim_TabletData->td_TabletY = iihdata->ActEventTablet->ient_TabletY;
                    imsg->eim_TabletData->td_RangeX = iihdata->ActEventTablet->ient_RangeX;
                    imsg->eim_TabletData->td_RangeY = iihdata->ActEventTablet->ient_RangeY;
                    imsg->eim_TabletData->td_TagList = CloneTagItems(iihdata->ActEventTablet->ient_TagList);
                }
            }

            send_intuimessage(imsg, w, IntuitionBase);

            result = TRUE;
        }
        else
        {
            DEBUG_FIREINTUIMSG(dprintf("fire_intuimessage: can't alloc imsg\n"));
        }
    }
    else
    {
        DEBUG_FIREINTUIMSG(dprintf("fire_intuimessage: no Userport or masked out idcmpflags\n"));
    }

    return result;
}
示例#3
0
ULONG TellWBTaskToCloseWindows(struct IntuitionBase *IntuitionBase)
{
    DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: currenttask <%s>\n",
                            FindTask(NULL)->tc_Node.ln_Name));

    if
    (
           GetPrivIBase(IntuitionBase)->WorkBenchMP != NULL
        && GetPrivIBase(IntuitionBase)->WorkBenchMP->mp_SigTask != FindTask(NULL)
    )
    {
        struct MsgPort      replymp;
        struct IntuiMessage imsg;

        /* Setup our reply port. By doing this manually, we can use SIGB_SINGLE
         * and thus avoid allocating a signal (which may fail). */
        memset( &replymp, 0, sizeof( replymp ) );

        replymp.mp_Node.ln_Type = NT_MSGPORT;
        replymp.mp_Flags        = PA_SIGNAL;
        replymp.mp_SigBit       = SIGB_SINGLE;
        replymp.mp_SigTask      = FindTask( NULL );
        NEWLIST( &replymp.mp_MsgList );

        /* Setup our message */
        imsg.ExecMessage.mn_ReplyPort = &replymp;
        imsg.Class = IDCMP_WBENCHMESSAGE;
        imsg.Code  = WBENCHCLOSE;

        SetSignal(0, SIGF_SINGLE);

        DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: Send Msg\n"));
        /* Sends it to the handler and wait for the reply */
        PutMsg( GetPrivIBase(IntuitionBase)->WorkBenchMP,
                (struct Message *) &imsg );
        WaitPort( &replymp );

        /* After leaving this block imsg and repymp will be automagically freed,
         * so we don't have to deallocate them ourselves. */
        DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: done\n"));
        return(TRUE);
    }
    else
    {
        DEBUG_WORKBENCH(dprintf("TellWBTaskToCloseWindows: no Workbench port\n"));
    }
    return(FALSE);
}
示例#4
0
文件: menus.c 项目: michalsc/AROS
void MH2Int_MakeMenusInactive(struct Window *win, UWORD menupick, struct IntuitionBase *IntuitionBase)
{
    struct InputEvent ie;
    struct IOStdReq   ior;
    struct MsgPort    replyport;

    memset( &replyport, 0, sizeof( replyport ) );

    ie.ie_NextEvent     = 0;
    ie.ie_Class         = IECLASS_MENU;
    ie.ie_SubClass      = IESUBCLASS_MENUSTOP;
    ie.ie_Code          = menupick;
    ie.ie_EventAddress  = win;

    replyport.mp_Node.ln_Type = NT_MSGPORT;
    replyport.mp_Flags        = PA_SIGNAL;
    replyport.mp_SigBit       = SIGB_INTUITION;
    replyport.mp_SigTask      = FindTask(NULL);
    NEWLIST(&replyport.mp_MsgList);

    ior = *(GetPrivIBase(IntuitionBase)->InputIO);
    ior.io_Message.mn_ReplyPort = &replyport;

    ior.io_Command = IND_WRITEEVENT;
    ior.io_Data    = &ie;
    ior.io_Length  = sizeof(struct InputEvent);

    DoIO((struct IORequest *)&ior);
}
示例#5
0
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;
}
示例#6
0
void DoSyncAction(void (*func)(struct IntuiActionMsg *, struct IntuitionBase *),
                  struct IntuiActionMsg *msg,
                  struct IntuitionBase *IntuitionBase)
{
    struct IIHData *iihd = (struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data;
    struct Task    *me = FindTask(NULL);

    if (me == iihd->InputDeviceTask)
    {
        func(msg, IntuitionBase);
    }
    else
    {
    #ifdef __MORPHOS__
        struct IOStdReq   req;
        struct MsgPort    port;
        struct InputEvent ie;
    #endif

        msg->handler = func;
        msg->task    = me;
        msg->done    = FALSE;
    
        ObtainSemaphore(&GetPrivIBase(IntuitionBase)->IntuiActionLock);
        AddTail((struct List *)GetPrivIBase(IntuitionBase)->IntuiActionQueue, (struct Node *)msg);
        ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->IntuiActionLock);

    #ifdef __MORPHOS__
        port.mp_Flags 	= PA_SIGNAL;
        port.mp_SigTask = me;
        port.mp_SigBit  = SIGB_INTUITION;
        NEWLIST(&port.mp_MsgList);

        req.io_Message.mn_ReplyPort = &port;
        req.io_Device 	    	    = GetPrivIBase(IntuitionBase)->InputIO->io_Device;
        req.io_Unit 	    	    = GetPrivIBase(IntuitionBase)->InputIO->io_Unit;
        req.io_Command      	    = IND_WRITEEVENT;
        req.io_Length 	    	    = sizeof(ie);
        req.io_Data 	    	    = &ie;

        ie.ie_Class = IECLASS_NULL;
    #endif
    
        if (!msg->done)
        {
    	#ifdef __MORPHOS__
            DoIO((APTR)&req);
    	#else
    	    AddNullEvent();
    	#endif
            while (!msg->done)
            {
                Wait(SIGF_INTUITION);
            }
        }
    }
}
示例#7
0
BOOL DoASyncAction(void (*func)(struct IntuiActionMsg *, struct IntuitionBase *),
                   struct IntuiActionMsg *msg, ULONG size,
                   struct IntuitionBase *IntuitionBase)
{
    struct IIHData  	    *iihd = (struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data;
    struct Task     	    *me = FindTask(NULL);
    struct IntuiActionMsg   *new_msg;

    if (me == iihd->InputDeviceTask)
    {
        func(msg, IntuitionBase);
        return TRUE;
    }
    else if ((new_msg = AllocVecPooled(iihd->ActionsMemPool,size)))
    {
        new_msg->handler = func;
        new_msg->task = NULL;
        if (size > sizeof(*msg))
        {
            CopyMem(msg + 1, new_msg + 1, size - sizeof(*msg));
        }

        ObtainSemaphore(&GetPrivIBase(IntuitionBase)->IntuiActionLock);
        AddTail((struct List *)GetPrivIBase(IntuitionBase)->IntuiActionQueue, (struct Node *)new_msg);
        ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->IntuiActionLock);

    #ifndef __MORPHOS__
    	AddNullEvent();
    #endif
        return TRUE;
    }
    else
    {
        return FALSE;
    }
}
示例#8
0
BOOL fire_intuimessage(struct Window *w,
                       ULONG Class,
                       UWORD Code,
                       APTR IAddress,
                       struct IntuitionBase *IntuitionBase)
{
    struct IntuiMessage *imsg;
    BOOL            	 result = FALSE;

    if ((w->IDCMPFlags & Class) && (w->UserPort))
    {
        if ((imsg = alloc_intuimessage(w, IntuitionBase)))
        {
            struct IIHData *iihd = (struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data;

            imsg->Class =    Class;
            imsg->Code      = Code;
            imsg->Qualifier = iihd->ActQualifier;
            if (Class == IDCMP_RAWKEY)
            {
                INT_INTUIMESSAGE(imsg)->prevCodeQuals = IAddress;
                imsg->IAddress = &INT_INTUIMESSAGE(imsg)->prevCodeQuals;
            }
            else
            {
                imsg->IAddress = IAddress;
            }

            send_intuimessage(imsg, w, IntuitionBase);

            result = TRUE;
        }
        else
        {
            DEBUG_FIREINTUIMSG(dprintf("fire_intuimessage: can't alloc imsg\n"));
        }
    }
    else
    {
        DEBUG_FIREINTUIMSG(dprintf("fire_intuimessage: no Userport or masked out idcmpflags\n"));
    }

    return result;
}
示例#9
0
文件: icclass.c 项目: michalsc/AROS
static void _om_set(struct ICData *ic, struct TagItem *tags, struct IntuitionBase *IntuitionBase)
{
    struct Library *UtilityBase = GetPrivIBase(IntuitionBase)->UtilityBase;
    struct TagItem *tag, *tstate = tags;

    while ((tag = NextTagItem(&tstate)))
    {
	switch(tag->ti_Tag)
	{
	case ICA_MAP:
	    ic->ic_Mapping = (struct TagItem *)tag->ti_Data;
	    break;

	case ICA_TARGET:
	    ic->ic_Target = (Object *)tag->ti_Data;
	    break;
	}
    }
}
示例#10
0
/* render a standard requester */
void render_requester(struct Requester *requester, struct IntuitionBase *IntuitionBase)
{
    struct GfxBase *GfxBase = GetPrivIBase(IntuitionBase)->GfxBase;
    struct RastPort *rp = requester->ReqLayer->rp;

    if ((requester->Flags & NOREQBACKFILL) == 0)
        SetRast(rp, requester->BackFill);

    if (requester->ImageBMap && requester->Flags & PREDRAWN)
        BltBitMapRastPort(requester->ImageBMap, 0, 0,
                          rp, 0, 0, requester->Width, requester->Height, 0xc0);

    if (requester->ReqImage && requester->Flags & USEREQIMAGE)
        DrawImage(rp, requester->ReqImage, 0, 0);

    if (requester->ReqBorder)
        DrawBorder(rp, requester->ReqBorder, 0, 0);

    if (requester->ReqGadget)
        RefreshGList(requester->ReqGadget, requester->RWindow, requester, -1);

    if (requester->ReqText)
        PrintIText(rp, requester->ReqText, 0, 0);
}
示例#11
0
    NOTES

    EXAMPLE

    BUGS

    SEE ALSO

    INTERNALS

*****************************************************************************/
{
    AROS_LIBFUNC_INIT

    struct Library *UtilityBase = GetPrivIBase(IntuitionBase)->UtilityBase;
    DEBUG_SETPOINTER(dprintf("SetWindowPointer: window 0x%lx\n", window));

    if (window)
    {
        ULONG 	lock;
        Object *pointer = (Object *)GetTagData(WA_Pointer, 0, taglist);
        BOOL	busy = (GetTagData(WA_BusyPointer, FALSE, taglist) != 0) ? TRUE : FALSE;

        DEBUG_SETPOINTER(dprintf("SetWindowPointer: pointer 0x%lx busy %d\n",
                                 pointer, busy));

        lock = LockIBase(0);

        DEBUG_SETPOINTER(dprintf("SetWindowPointer: old pointer 0x%lx busy %d\n",
                                 IW(window)->pointer, IW(window)->busy));
示例#12
0
void DoMoveSizeWindow(struct Window *targetwindow, LONG NewLeftEdge, LONG NewTopEdge,
                      LONG NewWidth, LONG NewHeight, BOOL send_newsize, struct IntuitionBase *IntuitionBase)
{
    struct IIHData  	*iihdata = (struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data;
  //struct IntWindow  	*w       = (struct IntWindow *)targetwindow;
    struct Layer    	*targetlayer = WLAYER(targetwindow)/*, *L*/;
    struct Requester    *req;
    struct InputEvent   *ie;
    LONG            	 OldLeftEdge  = targetwindow->LeftEdge;
    LONG            	 OldTopEdge   = targetwindow->TopEdge;
    LONG            	 OldWidth     = targetwindow->Width;
    LONG            	 OldHeight    = targetwindow->Height;
    LONG            	 pos_dx, pos_dy, size_dx, size_dy;

    /* correct new window coords if necessary */

    FixWindowCoords(targetwindow, &NewLeftEdge, &NewTopEdge, &NewWidth, &NewHeight,IntuitionBase);

    D(bug("DoMoveSizeWindow to %d,%d %d x %d\n", NewLeftEdge, NewTopEdge, NewWidth, NewHeight));

    pos_dx  = NewLeftEdge - OldLeftEdge;
    pos_dy  = NewTopEdge  - OldTopEdge;
    size_dx = NewWidth    - OldWidth;
    size_dy = NewHeight   - OldHeight;

    LOCK_REFRESH(targetwindow->WScreen);

/* jDc: intuition 68k doesn't care about that */
//    if (pos_dx || pos_dy || size_dx || size_dy)
//    {

        if (size_dx || size_dy)
        {
            WindowSizeWillChange(targetwindow, size_dx, size_dy, IntuitionBase);
        }

        targetwindow->LeftEdge    += pos_dx;
        targetwindow->TopEdge     += pos_dy;
#ifndef __MORPHOS__
        targetwindow->RelLeftEdge += pos_dx;
        targetwindow->RelTopEdge  += pos_dy;
#endif

        targetwindow->Width     = NewWidth;
        targetwindow->Height    = NewHeight;
        targetwindow->GZZWidth  = targetwindow->Width  - targetwindow->BorderLeft - targetwindow->BorderRight;
        targetwindow->GZZHeight = targetwindow->Height - targetwindow->BorderTop  - targetwindow->BorderBottom;

        /* check for GZZ window */
        if (BLAYER(targetwindow))
        {
            /* move outer window first */
            MoveSizeLayer(BLAYER(targetwindow), pos_dx, pos_dy, size_dx, size_dy);
        }

        MoveSizeLayer(targetlayer, pos_dx, pos_dy, size_dx, size_dy);

        for (req = targetwindow->FirstRequest; req; req = req->OlderRequest)
        {
            struct Layer *layer = req->ReqLayer;

            if (layer)
            {
                int dx, dy, dw, dh;
                int left, top, right, bottom;

                left = NewLeftEdge + req->LeftEdge;
                top = NewTopEdge + req->TopEdge;
                right = left + req->Width - 1;
                bottom = top + req->Height - 1;

                if (left > NewLeftEdge + NewWidth - 1)
                    left = NewLeftEdge + NewWidth - 1;

                if (top > NewTopEdge + NewHeight - 1)
                    top = NewTopEdge + NewHeight - 1;

                if (right > NewLeftEdge + NewWidth - 1)
                    right = NewLeftEdge + NewWidth - 1;

                if (bottom > NewTopEdge + NewHeight - 1)
                    bottom = NewTopEdge + NewHeight - 1;

                dx = left - layer->bounds.MinX;
                dy = top - layer->bounds.MinY;
                dw = right - left - layer->bounds.MaxX + layer->bounds.MinX;
                dh = bottom - top - layer->bounds.MaxY + layer->bounds.MinY;

                MoveSizeLayer(layer, dx, dy, dw, dh);
            }
        }

#if 0
        if (w->ZipLeftEdge != ~0) w->ZipLeftEdge = OldLeftEdge;
        if (w->ZipTopEdge  != ~0) w->ZipTopEdge  = OldTopEdge;
        if (w->ZipWidth    != ~0) w->ZipWidth    = OldWidth;
        if (w->ZipHeight   != ~0) w->ZipHeight   = OldHeight;
#endif

        if (pos_dx || pos_dy)
        {
            UpdateMouseCoords(targetwindow);
#ifndef __MORPHOS__
            if (HAS_CHILDREN(targetwindow))
                move_family(targetwindow, pos_dx, pos_dy);
#endif
        }

//    } /* if (pos_dx || pos_dy || size_dx || size_dy) */

    if (size_dx || size_dy)
    {
        WindowSizeHasChanged(targetwindow, size_dx, size_dy, FALSE, IntuitionBase);
    }

    ih_fire_intuimessage(targetwindow,
                 IDCMP_CHANGEWINDOW,
                 CWCODE_MOVESIZE,
                 targetwindow,
                 IntuitionBase);

    if (send_newsize)
    {
        /* Send IDCMP_NEWSIZE and IDCMP_CHANGEWINDOW to resized window, even
           if there was no resizing/position change at all. BGUI for example
           relies on this! */

        ih_fire_intuimessage(targetwindow,
                     IDCMP_NEWSIZE,
                     0,
                     targetwindow,
                     IntuitionBase);

        if ((ie = AllocInputEvent(iihdata)))
        {
            ie->ie_Class = IECLASS_EVENT;
            ie->ie_Code = IECODE_NEWSIZE;
            ie->ie_EventAddress = targetwindow;
            CurrentTime(&ie->ie_TimeStamp.tv_secs, &ie->ie_TimeStamp.tv_micro);
        }
    }

    // jDc: CheckLayers calls LOCK_REFRESH, so there's no reason to UNLOCK here!
    //    UNLOCK_REFRESH(targetwindow->WScreen);

    CheckLayers(targetwindow->WScreen, IntuitionBase);

    UNLOCK_REFRESH(targetwindow->WScreen);
    
#if 0    
    if (size_dx || size_dy)
    {
        if (!(((struct IntWindow *)targetwindow)->CustomShape))
        {
            struct wdpWindowShape       shapemsg;
            struct Region               *shape;
            shapemsg.MethodID           = WDM_WINDOWSHAPE;
            shapemsg.wdp_Width      = targetwindow->Width;
            shapemsg.wdp_Height     = targetwindow->Height;
            shapemsg.wdp_Window = targetwindow;
            shapemsg.wdp_TrueColor      = (((struct IntScreen *)targetwindow->WScreen)->DInfo.dri.dri_Flags & DRIF_DIRECTCOLOR);
            shapemsg.wdp_UserBuffer     = ((struct IntWindow *)targetwindow)->DecorUserBuffer;
            shape = DoMethodA(((struct IntScreen *)(targetwindow->WScreen))->WinDecorObj, (Msg)&shapemsg);	

            if (((struct IntWindow *)targetwindow)->OutlineShape) DisposeRegion(((struct IntWindow *)targetwindow)->OutlineShape);
            ((struct IntWindow *)targetwindow)->OutlineShape = shape;
            ChangeWindowShape(targetwindow, shape, NULL);
            ((struct IntWindow *)targetwindow)->CustomShape = FALSE;
        }
    }
#endif
    
}
示例#13
0
        SetDefaultPubScreen(), OpenWindow()

    INTERNALS

*****************************************************************************/
{
    AROS_LIBFUNC_INIT

    struct Screen *defscreen;
    STRPTR  	   name;

    DEBUG_GETDEFAULTPUBSCREEN(dprintf("GetDefaultPubScreen(%s)\n",nameBuffer));

    LockPubScreenList();

    defscreen = GetPrivIBase(IntuitionBase)->DefaultPubScreen;

    if (defscreen)
    {
        name = GetPrivScreen(defscreen)->pubScrNode->psn_Node.ln_Name;
    }
    else
    {
        name = "Workbench";
    }

    if (nameBuffer)
    {
        strcpy(nameBuffer, name);
    }
示例#14
0
    NOTES
 
    EXAMPLE
 
    BUGS
 
    SEE ALSO
    MakeClass(), FreeClass(), AddClass(), "Basic Object-Oriented
    Programming System for Intuition" and "boopsi Class Reference"
    Dokument.
 
    INTERNALS
 
*****************************************************************************/
{
    AROS_LIBFUNC_INIT

    ObtainSemaphore( &GetPrivIBase(IntuitionBase)->ClassListLock );

    /* Class there and still/already in the list ? */
    if (classPtr && (classPtr->cl_Flags & CLF_INLIST))
    {
        Remove ((struct Node *)classPtr);
        classPtr->cl_Flags &= ~CLF_INLIST;
    }

    ReleaseSemaphore( &GetPrivIBase(IntuitionBase)->ClassListLock );

    AROS_LIBFUNC_EXIT
} /* RemoveClass() */
示例#15
0
    Workbench has a deadlock timer and is smart enough to release the
    lock and abort the drag. With this routine below this locking does
    not occur. Some might call it a good thing, however the issue
    should be revisited once more of Intuition has been implemented -
    if it hasn't been already?!. :)

    HISTORY
    29-10-95    digulla automatically created from
                intuition_lib.fd and clib/intuition_protos.h
    25-10-96    calid   submitted the code

*****************************************************************************/
{
    AROS_LIBFUNC_INIT

    struct GadgetInfo   *gi = &GetPrivIBase(IntuitionBase)->DoGadgetMethodGI;
    struct RastPort 	*rp = &GetPrivIBase(IntuitionBase)->DoGadgetMethodRP;
    IPTR            	 ret = 0;

    DEBUG_DOGADGETMETHOD(dprintf("DoGadgetMethod[%x]: Gad %p Win %p Req %p Method %ld (0x%lx)\n",
                                 gi, gad, win, req, msg->MethodID, msg->MethodID));

    if (!win && req) win = req->RWindow;

    if (gad && (((gad->GadgetType & GTYP_GTYPEMASK) == GTYP_CUSTOMGADGET) || (gad->GadgetType & 0x100))) /* OS routines work with NULL objects */
    {

        /* Protect DoMethodA against race conditions between app task
        and input.device task (which executes Intuitions Inputhandler) */

        ObtainSemaphore(&GetPrivIBase(IntuitionBase)->GadgetLock);
示例#16
0
        Yes, I do repeat it again:
    Use this function only if the Menu has been added before by
    SetMenuStrip() and you changed nothing in the struct except
    CHECKED and ITEMENABLED flags.
 
    EXAMPLE
 
    BUGS
 
    SEE ALSO
    SetMenuStrip(), ClearMenuStrip()
 
    INTERNALS
 
    HISTORY
 
*****************************************************************************/
{
    AROS_LIBFUNC_INIT

    SANITY_CHECKR(window,TRUE)

    ObtainSemaphore(&GetPrivIBase(IntuitionBase)->MenuLock);
    window->MenuStrip = menu;
    ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->MenuLock);

    return TRUE;

    AROS_LIBFUNC_EXIT
} /* ResetMenuStrip */
示例#17
0
    EXAMPLE

    BUGS

    SEE ALSO
        RethinkDisplay(), MakeScreen(), graphics.library/MakeVPort(),
        graphics.library/MrgCop(), graphics.library/LoadView()

    INTERNALS

*****************************************************************************/
{
    AROS_LIBFUNC_INIT

    struct GfxBase *GfxBase = GetPrivIBase(IntuitionBase)->GfxBase;
    struct Screen   *screen;
    ULONG   	     ilock = LockIBase(0);
    LONG    	     failure = 0;

    for (screen = IntuitionBase->FirstScreen; screen; screen = screen->NextScreen)
    {
        LONG error = MakeVPort(&IntuitionBase->ViewLord, &screen->ViewPort);

        if (error)
            failure = error;
    }

    if (!failure)
        failure = RethinkDisplay();
示例#18
0
STATIC VOID GetPensAndFont(struct Gadget *gad,
                           UWORD     *pens,
                           struct Window *win,
                           struct RastPort *rp,
                           struct IntuitionBase *IntuitionBase)
{

    struct DrawInfo *dri = GetScreenDrawInfo(win->WScreen);
    BOOL    	     docursor = FALSE;

    SetFont(rp, dri->dri_Font);

    if (gad->Flags & GFLG_STRINGEXTEND)
    {
        struct StringExtend *strext;

        strext = ((struct StringInfo *)gad->SpecialInfo)->Extension;

        if (strext->Font)
        {
            SetFont(rp, strext->Font);
        }

        if ((gad->Flags & GFLG_SELECTED) == GFLG_SELECTED)
        {
            pens[STRTEXTPEN]    = strext->ActivePens[0];
            pens[STRBACKPEN]    = strext->ActivePens[1];
        }
        else
        {
            pens[STRTEXTPEN]    = strext->Pens[0];
            pens[STRBACKPEN]    = strext->Pens[1];
        }

    }
    else
    {
        /* We don't care to lock the screen because the window we're
        ** drawn on does this. If the window is moved to another
        ** public screen we will be called again to rerender (and get new
        ** valid pens). If the window is closed, and the screen is closed
        ** we won't be here anymore.
        */

        /* jDc: set the font to Topaz,8! */
        if (GetPrivIBase(IntuitionBase)->TopazFont)
        {
            SetFont(rp,GetPrivIBase(IntuitionBase)->TopazFont);
        } else {
            SetFont(rp,GfxBase->DefaultFont);
        }

#if 0
        if ((gad->Flags & GFLG_SELECTED) == GFLG_SELECTED)
        {
            pens[STRTEXTPEN]    = dri->dri_Pens[TEXTPEN];
            pens[STRBACKPEN]    = dri->dri_Pens[BACKGROUNDPEN];

        }
        else
        {
#endif
            pens[STRTEXTPEN]    = dri->dri_Pens[TEXTPEN];
            pens[STRBACKPEN]    = dri->dri_Pens[BACKGROUNDPEN];
#if 0
        }
#endif

    }
    pens[CURSORPEN] = dri->dri_Pens[FILLPEN];

    /* do some protection against stupid apps so we don't get into white text on white background pb */
    if (pens[STRTEXTPEN] == pens[STRBACKPEN])
    {
        if (pens[STRTEXTPEN] != 0)
        {
            pens[STRBACKPEN] = 0;
            if (pens[STRTEXTPEN] != 3) docursor = TRUE;
        }
	else
	{
            pens[STRTEXTPEN] = 1;
            pens[STRBACKPEN] = 0;
            docursor = TRUE;
        }
    }

    if ((pens[CURSORPEN] == pens[STRTEXTPEN]) || (pens[CURSORPEN] == pens[STRBACKPEN]))
    {
        pens[CURSORPEN] = (docursor ? 3 : ((pens[STRTEXTPEN] == 2) ? 2 : 1));
    }

    FreeScreenDrawInfo(win->WScreen, dri);

    return;
}
示例#19
0
文件: menus.c 项目: michalsc/AROS
UWORD FindMenuShortCut(struct Menu *menu, UBYTE key, BOOL do_click_op,
                       struct IntuitionBase *IntuitionBase)
{
    struct Library  *UtilityBase = GetPrivIBase(IntuitionBase)->UtilityBase;
    struct MenuItem *item, *sub;
    UWORD   	     menunum, itemnum = 0, subnum = 0;
    BOOL    	     found = FALSE;

    DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: Menu 0x%lx key 0x%lx <%c> do_click_op 0x%lx\n",menu,key,key,do_click_op));

    key = ToUpper(key);

    DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: Upperkey 0x%lx <%c>\n",key));

    for(menunum = 0; menu; menu = menu->NextMenu, menunum ++)
    {
        DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: Menu 0x%lx Menunum %ld\n",menu,menunum));

        for(item = menu->FirstItem, itemnum = 0; item; item = item->NextItem, itemnum++)
        {
            DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: Item 0x%lx itemnum %ld\n",item,itemnum));
            if ((sub = item->SubItem))
            {
                DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: Sub 0x%lx\n",sub));
                for(subnum = 0; sub; sub = sub->NextItem, subnum++)
                {
                    DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: Sub 0x%lx subnum %ld Flags 0x%lx Cmd 0x%lx <%c>\n",sub,subnum,sub->Flags,sub->Command,sub->Command));
                    if ((sub->Flags & COMMSEQ) &&
                            (ToUpper((UBYTE)sub->Command) == key))
                    {
                        DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: found\n"));
                        if (do_click_op)
                        {
                            DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: click_op\n"));
                            if (sub->Flags & CHECKIT)
                            {
                                DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: CheckIt change\n"));
                                CheckMenuItemWasClicked(sub, subnum, item);
                            }
                            sub->NextSelect = MENUNULL;
                        }
                        found = TRUE;
                        break;
                    }
                }
                if (found) break;

            }
            else
            {
                DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: Item 0x%lx itemnum %ld Flags 0x%lx Cmd 0x%lx <%c>\n",item,itemnum,item->Flags,item->Command,item->Command));

                if ((item->Flags & COMMSEQ) &&
                        (ToUpper((UBYTE)item->Command) == key))
                {
                    DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: found\n"));
                    if (do_click_op)
                    {
                        DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: click_op\n"));
                        if (item->Flags & CHECKIT)
                        {
                            DEBUG_FINDMENUSHORTCUT(dprintf("FindMenuShortCut: CheckIt change\n"));
                            CheckMenuItemWasClicked(item, itemnum, menu->FirstItem);
                        }
                        item->NextSelect = MENUNULL;
                    }
                    found = TRUE;
                    subnum = NOSUB;
                    break;
                }
            }

        } /* for each item */

        if (found) break;

    } /* for each menu */

    return found ? FULLMENUNUM(menunum, itemnum, subnum) : MENUNULL;
}
示例#20
0
ULONG HandleStrInput(   struct Gadget       *gad,
                      struct GadgetInfo *ginfo,
                      struct InputEvent *ievent,
                      UWORD         *imsgcode,
                      struct IntuitionBase  *IntuitionBase)
{
    struct SGWork   	 sgw;
    struct StringInfo   *strinfo = (struct StringInfo *)gad->SpecialInfo;
    struct StringExtend *strext = NULL;
    ULONG           	 command = 0;

    EnterFunc(bug("HandleStrInput(gad=%p, ginfo=%p, ievent=%p)\n",
                  gad, ginfo, ievent));

    if ((ievent->ie_Class == IECLASS_TIMER)) return 0;

    D(bug("Gadget text: %s\n", strinfo->Buffer));

    if (!ginfo)
        ReturnInt("HandleStrInput", ULONG, 0UL);

    UpdateStringInfo(gad);

    /* Initialize SGWork */
    sgw.Gadget  = gad;
    sgw.StringInfo  = strinfo;
    sgw.WorkBuffer  = strinfo->Buffer; /* default */
    sgw.PrevBuffer  = strinfo->Buffer;
    sgw.Modes   = 0;
    sgw.IEvent  = ievent;
    sgw.Code    = 0;
    sgw.BufferPos   = strinfo->BufferPos;
    sgw.NumChars    = strinfo->NumChars;
    sgw.Actions = 0;
    sgw.LongInt = strinfo->LongInt;
    sgw.GadgetInfo  = ginfo;
    sgw.EditOp  = EO_NOOP;

    if (gad->Flags & GFLG_STRINGEXTEND)
    {
        D(bug("HandleStrInput: Extended gadget\n"));
        strext = strinfo->Extension;
        if (strext->WorkBuffer)
        {
            sgw.WorkBuffer = strext->WorkBuffer;
            /* The edit hook gets *copy* of the current buffer contents */
            strcpy(sgw.WorkBuffer, strinfo->Buffer);
        }
        sgw.Modes = strext->InitialModes;
    }

    switch (ievent->ie_Class)
    {
	case IECLASS_RAWMOUSE:
            if (ievent->ie_Code == SELECTDOWN)
            {
        	command = SGH_CLICK;
        	sgw.Actions = SGA_USE | SGA_REDISPLAY;
        	D(bug("HandleStrInput: RAWMOUSE event\n"));
            }
            break;

	case IECLASS_RAWKEY:
        {
            UBYTE buf;

            D(bug("HandleStrInput: RAWKEY event\n"));
            if (ievent->ie_Code & IECODE_UP_PREFIX)
            {
                D(bug("HandleStrInput: filter UP event\n"));
            }
            else
            {
                command = SGH_KEY;
                sgw.Actions = SGA_USE;
                if (1 == MapRawKey(sgw.IEvent, &buf, 1, strinfo->AltKeyMap))
                {
                    D(bug("HandleStrInput: sgw.Code 0x%lx\n",buf));
                    sgw.Code = (UWORD)buf;
                }
            }
	    break;
        }

    }

    if (!command)
        ReturnInt("HandleStrInput", ULONG , 0UL);

    /* Call the global editing hook */

    D(bug("calling global hook, Buffer=%s, WorkBuffer=%s\n",
          strinfo->Buffer, sgw.WorkBuffer));
    CallHookPkt(GetPrivIBase(IntuitionBase)->GlobalEditHook, &sgw, &command);

    /* If there is a local edit hook, run it */
    if (strext)
    {
        if (strext->EditHook)
        {
            D(bug("calling local edit hook\n"));
            CallHookPkt(strext->EditHook, &sgw, &command);
        }
    }

    /* Copy possibly changed stuff into stringgad */
    if (sgw.Actions & SGA_USE)
    {
        if (strext)
        {
            if (strext->WorkBuffer)
                strcpy(strinfo->Buffer, strext->WorkBuffer);
        }

        strinfo->BufferPos = sgw.BufferPos;
        strinfo->NumChars  = sgw.NumChars;
        strinfo->LongInt   = sgw.LongInt;

#if 0
        if (gad->Activation & GACT_LONGINT)
        {
            kprintf("strinfo->LongInt = %d\n",strinfo->LongInt);
            */
        }
        else
        {
示例#21
0
IPTR PointerClass__OM_NEW(Class *cl, Object *o, struct opSet *msg)
{
    struct IntuitionBase *IntuitionBase = (struct IntuitionBase *)cl->cl_UserData;
    struct GfxBase *GfxBase = GetPrivIBase(IntuitionBase)->GfxBase;
    struct Library *UtilityBase = GetPrivIBase(IntuitionBase)->UtilityBase;
    OOP_MethodID HiddBitMapBase = ((struct IntIntuitionBase *)IntuitionBase)->ib_HiddBitMapBase;
    D(kprintf("PointerClass: OM_NEW\n"));

    if (cl)
    {
	struct TagItem *tags = msg->ops_AttrList;
	struct BitMap *bitmap = (struct BitMap *)GetTagData(POINTERA_BitMap, (IPTR)NULL, tags);
	
	/* Hack: we accept and pass on to AllocSpriteDataA() these attributes in order to
	         provide code reuse. Applications should not rely on it, this is private! */
	BOOL oldbitmap = GetTagData(SPRITEA_OldDataFormat, FALSE, tags);
	IPTR width = GetTagData(SPRITEA_Width, 16, tags);
	IPTR height = GetTagData(SPRITEA_OutputHeight, 0, tags);

	//ULONG xResolution = GetTagData(POINTERA_XResolution, POINTERXRESN_DEFAULT, tags);
	//ULONG yResolution = GetTagData(POINTERA_YResolution, POINTERYRESN_DEFAULT, tags);

	D(
        {
	    struct TagItem *tagscan=tags;

	    while(tagscan->ti_Tag != 0)
	    {
		kprintf("  0x%08lx, %08lx\n",tagscan->ti_Tag,tagscan->ti_Data);
		tagscan++;
	    }
	}
	)

        if (1)  // bitmap
        {
	    struct TagItem spritetags[] =
	    {
		{SPRITEA_Width        , 0   },
		{SPRITEA_OutputHeight , 0   },
		{SPRITEA_OldDataFormat, TRUE},
		{TAG_DONE        	    }
	    };
	    struct ExtSprite *sprite;
	    struct BitMap *spritedata=(struct BitMap *)bitmap;

	    if(spritedata != NULL)
	    {
	        if (oldbitmap) {
		    spritetags[0].ti_Data = width;
		    spritetags[1].ti_Data = height;
		} else {
		    spritetags[0].ti_Data = GetTagData(POINTERA_WordWidth, ((GetBitMapAttr(bitmap, BMA_WIDTH) + 15) & ~15)>>4, tags) * 16;
		    spritetags[1].ti_Tag = TAG_DONE;
		}
	    }
	    else
	    {
		D(kprintf("PointerClass: OM_NEW called without bitmap, using dummy sprite !\n"));

		spritetags[0].ti_Data = 16;
		spritetags[1].ti_Data = 1; 
		bitmap = (struct BitMap *)posctldata;

	    }

	    sprite = AllocSpriteDataA(bitmap, spritetags);

	    D(kprintf("PointerClass: extSprite 0x%lx\n",sprite));
	    D(kprintf("MoveSprite data 0x%lx, height %ld, x %ld, y %ld, num %ld, wordwidth, 0x%lx, flags 0x%lx\n",
		      sprite->es_SimpleSprite.posctldata,
		      sprite->es_SimpleSprite.height,
		      sprite->es_SimpleSprite.x,
		      sprite->es_SimpleSprite.y,
		      sprite->es_SimpleSprite.num,
		      sprite->es_wordwidth,
		      sprite->es_flags));

	    if (sprite)
	    {
	        struct SharedPointer *shared;

	        /* If our pointer doesn't already have a user-supplied colormap, we attach it here.
		   This makes the pointer to always have its own colors on hi- and truecolor screens.
		   In addition it gets an alpha channel.
		   Note that this relies on the fact that AllocSpriteDataA() always generates HIDD bitmap
		   in sprite->es_BitMap. */
		if (!HIDD_BM_COLMAP(sprite->es_BitMap)) {
		    ULONG i;
		    HIDDT_Color col[DEF_POINTER_DEPTH] = {{0}};
		    struct Color32 *q = GetPrivIBase(IntuitionBase)->Colors;

		    for (i = 1; i < DEF_POINTER_DEPTH; i++ ) {
			col[i].red   = q[i + 7].red >> 16;
			col[i].green = q[i + 7].green >> 16;
			col[i].blue  = q[i + 7].blue >> 16;
			col[i].alpha = GetPrivIBase(IntuitionBase)->PointerAlpha;
		    }
		    HIDD_BM_SetColors(HIDD_BM_OBJ(sprite->es_BitMap), col, 0, DEF_POINTER_DEPTH);
		}
	    
		shared = CreateSharedPointer(sprite,
					     GetTagData(POINTERA_XOffset, 0, tags),
					     GetTagData(POINTERA_YOffset, 0, tags),
					     IntuitionBase);

		if (shared)
		{
		    o = (Object *)DoSuperMethodA(cl, o, (Msg)msg);

		    if (o)
		    {
			struct PointerData *data = INST_DATA(cl, o);
			
			data->shared_pointer = shared;
			//data->xRes = xResolution;
			//data->yRes = yResolution;
			D(kprintf("PointerClass: set extSprite 0x%lx and XOffset %ld YOffset %ld\n",shared->sprite,shared->xoffset,shared->yoffset));
		    }
		    else
		    {
			D(kprintf("PointerClass: free sprite\n"));
			ReleaseSharedPointer(shared, IntuitionBase);
		    }
		}
		else
		{
		    D(kprintf("PointerClass: free sprite\n"));
		    FreeSpriteData(sprite);
		}
	    }
示例#22
0
文件: menus.c 项目: michalsc/AROS
void SendMenuMessage(struct MenuMessage *msg, struct IntuitionBase *IntuitionBase)
{
    PutMsg(GetPrivIBase(IntuitionBase)->MenuHandlerPort, &msg->msg);
}
示例#23
0
void WindowSizeHasChanged(struct Window *targetwindow, WORD dx, WORD dy,
                                 BOOL is_sizewindow, struct IntuitionBase *IntuitionBase)
{
    struct IIHData  *iihdata = (struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data;
    struct Layer    *lay;

    D(bug("********* WindowSizeHasChanged ********\n"));

    lay = (BLAYER(targetwindow)) ? BLAYER(targetwindow) : WLAYER(targetwindow);

    /* Fix GadgetInfo domain if there is an active gadget in window
       which was resized */

    if ((iihdata->ActiveGadget) && (targetwindow == iihdata->GadgetInfo.gi_Window))
    {
        GetGadgetDomain(iihdata->ActiveGadget,
                	iihdata->GadgetInfo.gi_Screen,
                	iihdata->GadgetInfo.gi_Window,
                	NULL,
                	&iihdata->GadgetInfo.gi_Domain);
    }

    /* Relayout GFLG_REL??? gadgets */
    DoGMLayout(targetwindow->FirstGadget, targetwindow, NULL, -1, FALSE, IntuitionBase);

    /* Add the new area of all GFLG_REL??? gadgets to the damagelist, but
       don't EraseRect() as the gadgets will be re-rendered at their new
       position anyway */
       
    {
    	struct Rectangle innerrect;
	
	innerrect.MinX = targetwindow->BorderLeft;
	innerrect.MinY = targetwindow->BorderTop;
	innerrect.MaxX = targetwindow->Width - 1 - targetwindow->BorderRight;
	innerrect.MaxY = targetwindow->Height - 1 - targetwindow->BorderBottom;
	
    	EraseRelGadgetArea(targetwindow, AVOID_WINBORDERERASE ? &innerrect : NULL, TRUE, IntuitionBase);
    }

    /* If new size is smaller than old size add right/bottom
       frame to damagelist */
    if ( ((dx < 0) && (targetwindow->BorderRight  > 0)) ||
        ((dx > 0) && (targetwindow->BorderTop > 0)) ||
        ((dy < 0) && (targetwindow->BorderBottom > 0)) )
    {
        struct Rectangle rect;

        LockLayer(0, lay);

        if ((dx < 0) && (targetwindow->BorderRight > 0))
        {
            rect.MinX = targetwindow->Width - targetwindow->BorderRight;
            rect.MinY = 0;
            rect.MaxX = targetwindow->Width - 1;
            rect.MaxY = targetwindow->Height - 1;

            OrRectRegion(lay->DamageList, &rect);
            lay->Flags |= LAYERREFRESH;
        }

        if ((dx > 0) && (targetwindow->BorderTop > 0))
        {
            rect.MinX = 0;
            rect.MinY = 0;
            rect.MaxX = targetwindow->Width - 1;
            rect.MaxY = targetwindow->BorderTop - 1;

            OrRectRegion(lay->DamageList, &rect);
            lay->Flags |= LAYERREFRESH;
        }

        if ((dy < 0) && (targetwindow->BorderBottom > 0))
        {
            rect.MinX = 0;
            rect.MinY = targetwindow->Height - targetwindow->BorderBottom;
            rect.MaxX = targetwindow->Width - 1;
            rect.MaxY = targetwindow->Height - 1;

            OrRectRegion(lay->DamageList, &rect);
            lay->Flags |= LAYERREFRESH;
        }

        UnlockLayer(lay);

    } /* if ( ((dx < 0) && (targetwindow->BorderRight > 0)) || ((dy < 0) && (targetwindow->BorderBottom > 0)) ) */

    ((struct IntWindow *)(targetwindow))->specialflags |= SPFLAG_LAYERRESIZED;

#if 0
    if (IS_GZZWINDOW(targetwindow))
    {
        lay = targetwindow->BorderRPort->Layer;

        if (lay->Flags & LAYERREFRESH)
        {
            Gad_BeginUpdate(lay, IntuitionBase);
            RefreshWindowFrame(targetwindow);
            lay->Flags &= ~LAYERREFRESH;
            Gad_EndUpdate(lay, TRUE, IntuitionBase);
        }

        lay = targetwindow->WLayer;

        if (lay->Flags & LAYERREFRESH)
        {
            Gad_BeginUpdate(lay, IntuitionBase);
            int_refreshglist(targetwindow->FirstGadget, targetwindow, NULL, -1, 0, REFRESHGAD_BORDER, IntuitionBase);
            Gad_EndUpdate(lay, IS_NOCAREREFRESH(targetwindow), IntuitionBase);
        }

    }
    else
    {
        lay = targetwindow->WLayer;

        if (lay->Flags & LAYERREFRESH)
        {
            Gad_BeginUpdate(lay, IntuitionBase);
            RefreshWindowFrame(targetwindow);
            int_refreshglist(targetwindow->FirstGadget, targetwindow, NULL, -1, 0, REFRESHGAD_BORDER, IntuitionBase);
            Gad_EndUpdate(lay, IS_NOCAREREFRESH(targetwindow), IntuitionBase);
        }
    }

    lay = targetwindow->WLayer;

    if (IS_NOCAREREFRESH(targetwindow))
    {
        LockLayer(0, lay);
        lay->Flags &= ~LAYERREFRESH;
        UnlockLayer(lay);
    }
#endif

#if 0
    //if (is_sizewindow)
    {
        /* Send IDCMP_NEWSIZE to resized window */

        ih_fire_intuimessage(targetwindow,
                     IDCMP_NEWSIZE,
                     0,
                     targetwindow,
                     IntuitionBase);
    }

    if (ie = AllocInputEvent(iihdata))
    {
        ie->ie_Class = IECLASS_EVENT;
        ie->ie_Code = IECODE_NEWSIZE;
        ie->ie_EventAddress = targetwindow;
        CurrentTime(&ie->ie_TimeStamp.tv_secs, &ie->ie_TimeStamp.tv_micro);
    }

    /* Send IDCMP_CHANGEWINDOW to resized window */

    ih_fire_intuimessage(targetwindow,
                 IDCMP_CHANGEWINDOW,
                 CWCODE_MOVESIZE,
                 targetwindow,
                 IntuitionBase);
#endif

}
示例#24
0
 
    SEE ALSO
 
    INTERNALS
 
*****************************************************************************/
{
    AROS_LIBFUNC_INIT

    /* shut up the compiler */
    data = data;

    /* setup pointers */
    GetPrivIBase(IntuitionBase)->DefaultPointer = MakePointerFromPrefs
    (
        IntuitionBase, GetPrivIBase(IntuitionBase)->ActivePreferences
    );
    GetPrivIBase(IntuitionBase)->BusyPointer = MakePointerFromPrefs
    (
        IntuitionBase, GetPrivIBase(IntuitionBase)->ActivePreferences
    );

    if
    (
           !GetPrivIBase(IntuitionBase)->DefaultPointer 
        || !GetPrivIBase(IntuitionBase)->BusyPointer
    )
    {
        return FALSE;
    }
示例#25
0
BOOL ih_fire_intuimessage(struct Window * w,
                          ULONG Class,
                          UWORD Code,
                          APTR IAddress,
                          struct IntuitionBase *IntuitionBase)
{
    struct IIHData    *iihd = (struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data;
    struct InputEvent *ie/* = iihd->ActInputEvent*/;

    BOOL result;

    DEBUG_FIREINTUIMSG(dprintf("ih_fire_intuimessage: win 0x%lx class 0x%lx code 0x%lx IAddress 0x%lx\n",
                	       w,
                	       Class,
                	       Code,
                	       IAddress));

    result = fire_message(w, Class, Code, IAddress, IntuitionBase);

    DEBUG_FIREINTUIMSG(dprintf("ih_fire_intuimessage: fire_intuimessage result 0x%lx\n",
                result));

    if (result /*&& ie*/)
    {
        /* was sent as IDCMP to window so eat inputevent */

        //ie->ie_Class = IECLASS_NULL;

    }

#if 0
    else if (ie/* && (ie->ie_Class != IECLASS_NULL) && !iihd->ActInputEventUsed*/)
    {

        /* ih_fire_intuimessage was called from inside Intuition's event handling loop */

        //iihd->ActInputEventUsed = TRUE;

        ie->ie_SubClass     = 0;
        ie->ie_Code 	    = Code;
      //ie->ie_Qualifier    = iihd->ActQualifier;
        ie->ie_EventAddress = IAddress;

        switch(Class)
        {
        case IDCMP_GADGETUP:
            /* Note: on the Amiga if a boopsi Gadget which is GA_Immediate
               and GA_RelVerify immediately in GM_GOACTIVE returns GMR_VERIFY,
               then this sends IDCMP_GADGETDOWN + IDCMP_GADGETUP. AROS does
               the same. But for changed inputevents (if window does not have this
               IDCMP Flags set) there will be only one IECLASS_GADGETDOWN
            */

            ie->ie_Class = IECLASS_GADGETUP;
            break;

        case IDCMP_GADGETDOWN:
            ie->ie_Class = IECLASS_GADGETDOWN;
            break;

        case IDCMP_ACTIVEWINDOW:
            ie->ie_Class = IECLASS_ACTIVEWINDOW;
            break;

        case IDCMP_INACTIVEWINDOW:
            ie->ie_Class = IECLASS_INACTIVEWINDOW;
            break;

        case IDCMP_CLOSEWINDOW:
            ie->ie_Class = IECLASS_CLOSEWINDOW;
            break;

        case IDCMP_MENUHELP:
            ie->ie_Class = IECLASS_MENUHELP;
            break;

        case IDCMP_MENUPICK:
            ie->ie_Class = IECLASS_MENULIST;
            break;

        case IDCMP_MOUSEBUTTONS:
        case IDCMP_MOUSEMOVE:
        case IDCMP_RAWKEY:
        case IDCMP_VANILLAKEY:
            break;

        default:
            D(bug("ih_fireintuimessage: unexpected IDCMP (%x) for an inputevent-handling-fireintuimessage!\n", Class));
            break;

        }
    }
#endif
    else //if (!ie)
    {
        /* ih_fire_intuimessage was called from inside Intuition's defered action handling routines */

        if ((ie = AllocInputEvent(iihd)))
        {
            switch(Class)
            {
            case IDCMP_NEWSIZE:
                ie->ie_Class = IECLASS_SIZEWINDOW;
                break;

            case IDCMP_CHANGEWINDOW:
                ie->ie_Class = IECLASS_CHANGEWINDOW;
                break;

            case IDCMP_ACTIVEWINDOW:
                ie->ie_Class = IECLASS_ACTIVEWINDOW;
                break;

            case IDCMP_INACTIVEWINDOW:
                ie->ie_Class = IECLASS_INACTIVEWINDOW;
                break;

            case IDCMP_CLOSEWINDOW:
                ie->ie_Class = IECLASS_CLOSEWINDOW;
                break;

            case IDCMP_GADGETUP:
                ie->ie_Class = IECLASS_GADGETUP;
                break;

            case IDCMP_GADGETDOWN:
                ie->ie_Class = IECLASS_GADGETDOWN;
                break;

            case IDCMP_REFRESHWINDOW:
                ie->ie_Class = IECLASS_REFRESHWINDOW;
                break;

            case IDCMP_MENUHELP:
                ie->ie_Class = IECLASS_MENUHELP;
                break;

            case IDCMP_MENUPICK:
                ie->ie_Class = IECLASS_MENULIST;
                break;

            default:
                D(bug("ih_fireintuimessage: unexpected IDCMP (0x%X) for a deferred-action-fireintuimessage!\n", Class));
                break;

            } /* switch(Class) */

            ie->ie_Code     	= Code;
            ie->ie_Qualifier    = iihd->ActQualifier;
            ie->ie_EventAddress = IAddress;
            CurrentTime(&ie->ie_TimeStamp.tv_secs, &ie->ie_TimeStamp.tv_micro);

            D(bug("ih_fireintuimessage: generated InputEvent. Class = 0x%X  Code = %d  EventAddress = 0x%X\n",
                  ie->ie_Class,
                  ie->ie_Code,
                  ie->ie_EventAddress));

        } /* if ((ie = AllocInputEvent(iihd))) */
    }

    DEBUG_FIREINTUIMSG(dprintf("ih_fire_intuimessage: result 0x%lx\n",
                result));

    return result;
}
示例#26
0
    EXAMPLE

    BUGS

    SEE ALSO

    INTERNALS

*****************************************************************************/
{
    AROS_LIBFUNC_INIT

    ASSERT_VALID_PTR(window);
    ASSERT_VALID_PTR(imsg);

    struct Library *TimerBase = GetPrivIBase(IntuitionBase)->TimerBase;

    DEBUG_SENDINTUIMESSAGE(dprintf("SendIntuiMessage: Window 0x%lx Port 0x%lx Msg 0x%lx\n",
                                   window, window->UserPort, imsg));

    SANITY_CHECK(window)
    SANITY_CHECK(imsg)

    Forbid();

#ifdef __MORPHOS__
    if (window->UserPort)
    {
        struct Task *apptask = window->UserPort->mp_SigTask;
	
        if (apptask && (!apptask->tc_SigWait) && (apptask->tc_State == TS_WAIT))
示例#27
0
    RESULT
        The flags set before the change was made.

    NOTES

    EXAMPLE

    BUGS

    SEE ALSO

    OpenScreen()

    INTERNALS

*****************************************************************************/
{
    AROS_LIBFUNC_INIT

    UWORD retval;

    Forbid();
    retval = GetPrivIBase(IntuitionBase)->pubScrGlobalMode;
    GetPrivIBase(IntuitionBase)->pubScrGlobalMode = modes;
    Permit();

    return retval;

    AROS_LIBFUNC_EXIT
} /* SetPubScreenModes */