Some fix for scrolling with lasso.
[tangerine.git] / rom / workbench / removeappwindowdropzone.c
blobfdc877710b32dab2b6262246f97339c692aeddda
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Remove a dropzone from a AppWindow's list of AppWindowDropZones.
6 Lang: English
7 */
9 #include <exec/types.h>
10 #include <exec/ports.h>
11 #include <utility/tagitem.h>
12 #include <intuition/intuition.h>
14 #include "workbench_intern.h"
15 #include <workbench/workbench.h>
17 /*****************************************************************************
19 NAME */
21 #include <proto/workbench.h>
23 AROS_LH2(BOOL, RemoveAppWindowDropZone,
25 /* SYNOPSIS */
26 AROS_LHA(struct AppWindow * , aw , A0),
27 AROS_LHA(struct AppWindowDropZone *, dropZone, A1),
29 /* LOCATION */
30 struct WorkbenchBase *, WorkbenchBase, 20, Workbench)
32 /* FUNCTION
34 Try to remove a drop zone from an AppWindow.
36 INPUTS
38 appWindow -- pointer to the AppWindow (as returned by AddAppWindow()) to
39 try to remove the drop zone from; a value of NULL will
40 result in no operation
41 dropZone -- pointer to an AppWindowDropZone (as returned by
42 AddAppWindowDropZone()); a value of NULL will result in
43 no operation
45 RESULT
47 TRUE if the drop zone could be removed, FALSE otherwise. In case of
48 failure, the reason may be obtained from dos.library/IoErr(). This
49 function may fail if the specified drop zone is not registered with
50 the supplied AppWindow.
52 NOTES
54 You must check for drop zone messages for zones that you just removed as
55 there might have been messages sent between the last time you checked and
56 the call to this function.
58 EXAMPLE
60 BUGS
62 SEE ALSO
64 INTERNALS
66 ******************************************************************************/
68 AROS_LIBFUNC_INIT
69 AROS_LIBBASE_EXT_DECL(struct WorkbenchBase *, WorkbenchBase)
71 struct AppWindowDropZone *dz;
73 BOOL found = FALSE; /* Is the drop zone 'dropZone' added to the
74 window 'aw'? */
76 if ((aw == NULL) || (dropZone == NULL))
78 SetIoErr(ERROR_REQUIRED_ARG_MISSING);
80 return FALSE;
83 LockWorkbench();
84 ForeachNode(&aw->aw_DropZones, dz)
86 if (dz == dropZone)
88 found = TRUE;
89 break;
93 if (!found)
95 UnlockWorkbench();
96 SetIoErr(ERROR_OBJECT_NOT_FOUND);
98 return FALSE;
101 Remove((struct Node *)dropZone);
102 UnlockWorkbench();
104 FreeVec(dropZone);
106 /* NotifyWorkbench(WBNOTIFY_Delete, WBNOTIFY_DropZone, WorkbenchBase); */
108 return TRUE;
110 AROS_LIBFUNC_EXIT
111 } /* RemoveAppWindowDropZone */