Fixed warnings.
[cake.git] / rom / workbench / removeappwindow.c
blobc98caa09a27367fe0538b9225e36f17f877c8868
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Remove a window from Workbench's list of AppWindows.
6 Lang: English
7 */
9 #include <exec/lists.h>
11 #include "workbench_intern.h"
12 #include <workbench/workbench.h>
14 /*****************************************************************************
16 NAME */
18 #include <proto/workbench.h>
20 AROS_LH1(BOOL, RemoveAppWindow,
22 /* SYNOPSIS */
24 AROS_LHA(struct AppWindow *, appWindow, A0),
26 /* LOCATION */
27 struct WorkbenchBase *, WorkbenchBase, 9, Workbench)
29 /* FUNCTION
31 Try to remove an AppWindow from workbench.library's list of AppWindow:s.
33 INPUTS
35 appWindow -- pointer to AppWindow structure got from AddAppWindow().
37 RESULT
39 TRUE if the window could be removed, FALSE otherwise.
41 NOTES
43 You have to do another check for messages on the AppWindow message port
44 you specified at the AppWindow creation time (AddAppWindow()) after the
45 window is removed as it may have arrived messages between the last time
46 you checked and the call of this function.
47 Before the AppWindow is removed, all its drop zones will be removed.
48 Thus there is no need to call RemoveAppWindowDropZone() explicitly.
50 EXAMPLE
52 BUGS
54 SEE ALSO
56 AddAppWindowA(), RemoveAppWindowDropZone()
58 INTERNALS
60 ******************************************************************************/
62 AROS_LIBFUNC_INIT
64 if (appWindow == NULL)
66 return FALSE;
69 LockWorkbench();
71 while (!IsListEmpty(&appWindow->aw_DropZones))
73 RemoveAppWindowDropZone(appWindow,
74 (struct AppWindowDropZone *)GetHead(&appWindow->aw_DropZones));
77 Remove((struct Node *)appWindow);
79 UnlockWorkbench();
81 FreeVec(appWindow);
83 /* NotifyWorkbench(WBNOTIFY_Create, WBNOTIFY_AppWindow, WorkbenchBase); */
85 return TRUE;
87 AROS_LIBFUNC_EXIT
88 } /* RemoveAppWindow */