2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
5 Desc: Add a window to Workbench's list of AppWindows.
9 #include <exec/types.h>
10 #include <exec/ports.h>
11 #include <utility/tagitem.h>
12 #include <intuition/intuition.h>
13 #include <proto/alib.h>
15 #include "workbench_intern.h"
16 #include <workbench/workbench.h>
18 /*****************************************************************************
22 #include <proto/workbench.h>
24 AROS_LH5(struct AppWindow
*, AddAppWindowA
,
27 AROS_LHA(ULONG
, id
, D0
),
28 AROS_LHA(ULONG
, userdata
, D1
),
29 AROS_LHA(struct Window
* , window
, A0
),
30 AROS_LHA(struct MsgPort
*, msgport
, A1
),
31 AROS_LHA(struct TagItem
*, taglist
, A2
),
34 struct WorkbenchBase
*, WorkbenchBase
, 8, Workbench
)
38 Try to add an AppWindow to workbench.library's list of AppWindow:s.
39 The supplied message port will be used to send notification messages
40 whenever an icon is dropped on the window. The message will be of
41 type 'MTYPE_APPWINDOW' and am_ArgList will point to the list of icons
42 that were dropped in the window.
46 id -- window identifier; for your convenience (ignored by
48 userdata -- user specific data (ignored by workbench.library)
49 window -- pointer to the window to add AppWindow functionality to
50 msgport -- port to which notification messages regarding the window
52 taglist -- tags (must be NULL)
56 A pointer to an AppWindow structure to use with RemoveAppWindow() when
57 you want to remove the window from the list of AppWindow:s, or NULL
58 if it was not possible to add the 'window' to the AppWindow list.
62 Applications generally want to call GetDiskObjectNew() -- rather than
63 GetDiskObject() -- to get disk objects for icons dropped in the window.
64 Contrary to AmigaOS, this function will succeed even when there
65 is no running workbench application.
73 AddAppWindowDropZoneA(), RemoveAppWindow()
77 ******************************************************************************/
81 struct AppWindow
*appWindow
;
83 if (window
== NULL
|| msgport
== NULL
)
88 appWindow
= AllocVec(sizeof(struct AppWindow
), MEMF_ANY
| MEMF_CLEAR
);
90 if (appWindow
== NULL
)
95 appWindow
->aw_ID
= id
;
96 appWindow
->aw_UserData
= userdata
;
97 appWindow
->aw_Window
= window
;
98 appWindow
->aw_MsgPort
= msgport
;
100 NewList(&appWindow
->aw_DropZones
);
103 AddTail(&WorkbenchBase
->wb_AppWindows
, (struct Node
*)appWindow
);
106 /* NotifyWorkbench(WBNOTIFY_Create, WBNOTIFY_AppWindow, WorkbenchBase); */
111 } /* AddAppWindowA */