2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include "intuition_intern.h"
8 #include <proto/exec.h>
10 #define DEBUG_FREESYSREQUEST(x) ;
12 /*****************************************************************************
15 #include <proto/intuition.h>
16 #include <exec/types.h>
17 #include <intuition/intuition.h>
19 AROS_LH1(void, FreeSysRequest
,
22 AROS_LHA(struct Window
*, window
, A0
),
25 struct IntuitionBase
*, IntuitionBase
, 62, Intuition
)
28 Frees a requester made with BuildSysRequest() or
29 BuildEasyRequestArgs().
32 Window - The requester to be freed. May be NULL or 1.
41 BuildSysRequest() requesters not supported, yet.
44 BuildSysRequest(), BuildEasyRequestArgs()
50 *****************************************************************************/
55 struct Gadget
*gadgets
;
57 struct IntRequestUserData
*requserdata
;
59 DEBUG_FREESYSREQUEST(dprintf("intrequest_freesysrequest: window 0x%lx\n", (ULONG
) window
));
61 if ((window
== NULL
) || (window
== (void *)1L))
64 scr
= window
->WScreen
;
66 requserdata
= (struct IntRequestUserData
*)window
->UserData
;
68 DEBUG_FREESYSREQUEST(dprintf("intrequest_freesysrequest: requserdata 0x%lx\n", (ULONG
) requserdata
));
70 gadgets
= requserdata
->Gadgets
;
72 DEBUG_FREESYSREQUEST(dprintf("intrequest_freesysrequest: gadgets 0x%lx\n", (ULONG
) gadgets
));
74 /* Remove gadgets before closing window to avoid conflicts with system gadgets */
75 RemoveGList(window
, gadgets
, requserdata
->NumGadgets
);
77 gadgetlabels
= requserdata
->GadgetLabels
;
79 DEBUG_FREESYSREQUEST(dprintf("intrequest_freesysrequest: gadgetlabels 0x%lx\n", (ULONG
) gadgetlabels
));
83 intrequest_freegadgets(gadgets
, IntuitionBase
);
84 intrequest_freelabels(gadgetlabels
, IntuitionBase
);
87 DEBUG_FREESYSREQUEST(dprintf("intrequest_freesysrequest: freeitext 0x%lx\n", (ULONG
) requserdata
->freeitext
));
88 if (requserdata
->freeitext
) intrequest_freeitext(requserdata
->Text
,IntuitionBase
);
89 if (requserdata
->backfilldata
.image
) int_FreeCustomImage(TYPE_REQUESTERCLASS
,requserdata
->dri
,IntuitionBase
);
90 if (requserdata
->Logo
) int_FreeCustomImage(TYPE_REQUESTERCLASS
,requserdata
->dri
,IntuitionBase
);
91 if (requserdata
->ReqGadgets
) FreeVec(requserdata
->ReqGadgets
);
92 if (requserdata
->dri
) FreeScreenDrawInfo(requserdata
->ReqScreen
,(struct DrawInfo
*)requserdata
->dri
);
98 } /* FreeSysRequest */