2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #define MUIMASTER_YES_INLINE_STDARG
8 #include <exec/types.h>
9 #include <exec/memory.h>
10 #include <intuition/classusr.h>
11 #include <libraries/desktop.h>
12 #include <libraries/mui.h>
13 #include <utility/tagitem.h>
15 #include <proto/exec.h>
16 #include <proto/intuition.h>
17 #include <proto/muimaster.h>
18 #include <proto/utility.h>
20 #include "desktop_intern.h"
23 #include "iconclass.h"
24 #include "iconobserver.h"
25 #include "iconcontainerclass.h"
26 #include "iconcontainerobserver.h"
28 #include "presentation.h"
31 #include <aros/debug.h>
33 /*****************************************************************************
37 #include <proto/desktop.h>
39 AROS_LH2(Object
*, CreateDesktopObjectA
,
43 AROS_LHA(ULONG
, kind
, D0
),
44 AROS_LHA(struct TagItem
*, tags
, A0
),
48 struct DesktopBase
*, DesktopBase
, 8, Desktop
)
56 NOTES This function is sloppy - sort it out!
66 *****************************************************************************
71 Object
*newObject
= NULL
,
72 *semanticObject
= NULL
;
76 case CDO_IconContainer
:
81 tag
= FindTagItem(ICOA_Directory
, tags
);
84 dir
= (STRPTR
) tag
->ti_Data
;
85 tag
->ti_Tag
= TAG_IGNORE
;
88 newObject
= NewObjectA(IconContainer
->mcc_Class
, NULL
, tags
);
90 semanticObject
= NewObject
92 IconContainerObserver
->mcc_Class
, NULL
,
94 OA_Presentation
, (IPTR
) newObject
,
95 ICOA_Directory
, (IPTR
) dir
,
100 set(newObject
, PA_Observer
, (IPTR
) semanticObject
);
108 struct TagItem
*labelTI
= FindTagItem(IA_Label
, tags
);
112 label
= (STRPTR
) labelTI
->ti_Data
;
115 newObject
= NewObjectA(DiskIcon
->mcc_Class
, NULL
, tags
);
117 semanticObject
= NewObject
119 DiskIconObserver
->mcc_Class
, NULL
,
121 IOA_Name
, (IPTR
) label
,
122 OA_Presentation
, (IPTR
) newObject
,
134 struct TagItem
*labelTI
= FindTagItem(IA_Label
, tags
),
135 *directoryTI
= FindTagItem(IOA_Directory
, tags
);
139 label
= (STRPTR
) labelTI
->ti_Data
;
142 if (directoryTI
!= NULL
)
144 directory
= (STRPTR
) directoryTI
->ti_Data
;
147 newObject
= NewObjectA(DrawerIcon
->mcc_Class
, NULL
, tags
);
149 semanticObject
= NewObject
151 DrawerIconObserver
->mcc_Class
, NULL
,
153 IOA_Name
, (IPTR
) label
,
154 OA_Presentation
, (IPTR
) newObject
,
155 IOA_Directory
, (IPTR
) directory
,
165 newObject
= NewObjectA(ToolIcon
->mcc_Class
, NULL
, tags
);
167 semanticObject
= NewObject(ToolIconObserver
->mcc_Class
, NULL
,
168 OA_Presentation
, (IPTR
) newObject
, TAG_END
);
171 case CDO_ProjectIcon
:
172 newObject
= NewObjectA(ProjectIcon
->mcc_Class
, NULL
, tags
);
174 semanticObject
= NewObject
176 ProjectIconObserver
->mcc_Class
, NULL
,
177 OA_Presentation
, (IPTR
) newObject
,
182 case CDO_TrashcanIcon
:
183 newObject
= NewObjectA(TrashcanIcon
->mcc_Class
, NULL
, tags
);
185 semanticObject
= NewObject
187 TrashcanIconObserver
->mcc_Class
, NULL
,
188 OA_Presentation
, (IPTR
) newObject
,
194 newObject
= NewObjectA
196 DesktopBase
->db_Desktop
->mcc_Class
, NULL
, tags
199 semanticObject
= NewObject
201 DesktopObserver
->mcc_Class
, NULL
,
202 OA_Presentation
, (IPTR
) newObject
,
208 case CDO_DirectoryWindow
:
211 Object
*windowObject
;
213 if (DesktopBase
->db_DefaultWindow
)
215 windowClass
= DesktopBase
->db_DefaultWindow
->cl_ID
;
219 windowClass
= MUIC_Window
;
222 windowObject
= MUI_NewObject
226 MUIA_Window_UseBottomBorderScroller
, TRUE
,
227 MUIA_Window_UseRightBorderScroller
, TRUE
,
229 WindowContents
, (IPTR
) CreateDesktopObjectA
231 CDO_IconContainer
, tags
243 } /* CreateWorkbenchObjectA */