added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / rom / intuition / endrequest.c
blob245b37af988f1a40358793f9fbd91bf3b8235233
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include <proto/layers.h>
8 #include "intuition_intern.h"
9 #include "inputhandler_actions.h"
11 #ifdef SKINS
12 # include "mosmisc.h"
13 #endif
15 struct EndRequestActionMsg
17 struct IntuiActionMsg msg;
18 struct Requester *requester;
19 struct Window *window;
22 static VOID int_endrequest(struct EndRequestActionMsg *msg,
23 struct IntuitionBase *IntuitionBase);
25 /*****************************************************************************
27 NAME */
28 #include <proto/intuition.h>
30 AROS_LH2(void, EndRequest,
32 /* SYNOPSIS */
33 AROS_LHA(struct Requester *, requester, A0),
34 AROS_LHA(struct Window * , window, A1),
36 /* LOCATION */
37 struct IntuitionBase *, IntuitionBase, 20, Intuition)
39 /* FUNCTION
40 Remove a requester from the specified window.
41 Other open requesters of this window stay alive.
43 INPUTS
44 requester - The requester to be deleted
45 window - The window to which the requester belongs
47 RESULT
48 None.
50 NOTES
52 EXAMPLE
54 BUGS
56 SEE ALSO
57 InitRequester(), Request()
59 INTERNALS
61 HISTORY
63 *****************************************************************************/
65 AROS_LIBFUNC_INIT
67 struct EndRequestActionMsg msg;
69 DEBUG_REQUEST(dprintf("EndRequest: req 0x%lx window 0x%lx\n", requester, window));
71 SANITY_CHECK(window)
72 SANITY_CHECK(requester)
74 msg.requester = requester;
75 msg.window = window;
77 DoSyncAction((APTR)int_endrequest, &msg.msg, IntuitionBase);
79 DEBUG_REQUEST(dprintf("EndRequest: removed succesfuly\n"));
81 AROS_LIBFUNC_EXIT
82 } /* EndRequest */
85 static VOID int_endrequest(struct EndRequestActionMsg *msg,
86 struct IntuitionBase *IntuitionBase)
88 struct Window *window = msg->window;
89 struct Requester *requester = msg->requester;
90 struct Requester *p = window->FirstRequest;
91 // struct IIHData *iihdata = (struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data;
92 // int i;
94 //jDc: intuition68k doesn't care (tested)
95 //if (requester->Flags & REQACTIVE)
97 LOCKWINDOWLAYERS(window);
99 if (p == requester)
101 window->FirstRequest = requester->OlderRequest;//unliked
102 } else {
103 while (p && (p->OlderRequest != requester))
104 p = p->OlderRequest;
106 if (p)
108 p->OlderRequest = requester->OlderRequest;//unlinked
112 if (p)
114 struct Screen *screen = window->WScreen;
116 --window->ReqCount;
117 requester->Flags &= ~REQACTIVE;
119 LOCK_REFRESH(screen);
120 if (requester->ReqLayer) DeleteLayer(0, requester->ReqLayer);
121 requester->OlderRequest = 0;
122 requester->ReqLayer = 0; //sanity
123 CheckLayers(screen, IntuitionBase);
124 UNLOCK_REFRESH(screen);
126 ih_fire_intuimessage(window,
127 IDCMP_REQCLEAR,
129 window,
130 IntuitionBase);
135 UNLOCKWINDOWLAYERS(window);