2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <proto/graphics.h>
8 #include <proto/layers.h>
9 #include <proto/exec.h>
10 #include <graphics/rpattr.h>
11 #include "intuition_intern.h"
13 /*****************************************************************************
16 #include <graphics/rastport.h>
17 #include <intuition/cghooks.h>
18 #include <proto/intuition.h>
20 AROS_LH1(struct RastPort
*, ObtainGIRPort
,
23 AROS_LHA(struct GadgetInfo
*, gInfo
, A0
),
26 struct IntuitionBase
*, IntuitionBase
, 93, Intuition
)
29 This function sets up a RastPort for exclusive use by custom
30 gadget hook routines. Call this function each time a hook
31 routine needs to render into the gadget and ReleaseGIRPort()
32 immediately afterwards.
35 gInfo - Pointer to GadgetInfo structure, as passed to each
36 custom gadget hook function.
39 Pointer to a RastPort you can render to. NULL if you aren't
40 allowed to render into this gadget.
43 If a routine passes a RastPort, eg. GM_RENDER, ObtainGIRPort()
56 29-10-95 digulla automatically created from
57 intuition_lib.fd and clib/intuition_protos.h
59 *****************************************************************************/
65 DEBUG_OBTAINGIRPORT(dprintf("ObtainGIRPort: GInfo 0x%lx Task 0x%lx <%s>\n",
66 gInfo
, FindTask(NULL
),
67 FindTask(NULL
)->tc_Node
.ln_Name
? FindTask(NULL
)->tc_Node
.ln_Name
: "NULL"));
69 if (gInfo
&& gInfo
->gi_RastPort
)
71 rp
= CloneRastPort (gInfo
->gi_RastPort
);
76 /*bug("+++++++++++++ OBTAIN rp=%p lay=%p font=%p origfont=%p\n",rp,rp->Layer,rp->Font,gInfo->gi_RastPort->Font);*/
80 LockLayer(0,rp
->Layer
);
82 if (((GetPrivIBase(IntuitionBase
)->BackupLayerContext
.nestcount
)++) == 0)
84 GetPrivIBase(IntuitionBase
)->BackupLayerContext
.scroll_x
= rp
->Layer
->Scroll_X
;
85 GetPrivIBase(IntuitionBase
)->BackupLayerContext
.scroll_y
= rp
->Layer
->Scroll_Y
;
87 rp
->Layer
->Scroll_X
= 0;
88 rp
->Layer
->Scroll_Y
= 0;
90 GetPrivIBase(IntuitionBase
)->BackupLayerContext
.clipregion
= InstallClipRegion(rp
->Layer
, NULL
);
93 SetWriteMask(rp
, 0xFF);
95 SetRPAttrs(rp
,RPTAG_DrMd
,JAM1
,RPTAG_PenMode
,TRUE
,TAG_DONE
);
97 SetRPAttrs(rp
,RPTAG_DrMd
,JAM1
,TAG_DONE
);
98 #endif /* __MORPHOS__ */
102 DEBUG_OBTAINGIRPORT(dprintf("ObtainGIRPort: RPort 0x%lx\n", rp
));
111 } /* ObtainGIRPort */