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
)
58 This function is sloppy - sort it out!
68 *****************************************************************************
73 Object
*newObject
= NULL
,
74 *semanticObject
= NULL
;
78 case CDO_IconContainer
:
83 tag
= FindTagItem(ICOA_Directory
, tags
);
86 dir
= (STRPTR
) tag
->ti_Data
;
87 tag
->ti_Tag
= TAG_IGNORE
;
90 newObject
= NewObjectA(IconContainer
->mcc_Class
, NULL
, tags
);
92 semanticObject
= NewObject
94 IconContainerObserver
->mcc_Class
, NULL
,
96 OA_Presentation
, (IPTR
) newObject
,
97 ICOA_Directory
, (IPTR
) dir
,
102 set(newObject
, PA_Observer
, (IPTR
) semanticObject
);
110 struct TagItem
*labelTI
= FindTagItem(IA_Label
, tags
);
114 label
= (STRPTR
) labelTI
->ti_Data
;
117 newObject
= NewObjectA(DiskIcon
->mcc_Class
, NULL
, tags
);
119 semanticObject
= NewObject
121 DiskIconObserver
->mcc_Class
, NULL
,
123 IOA_Name
, (IPTR
) label
,
124 OA_Presentation
, (IPTR
) newObject
,
136 struct TagItem
*labelTI
= FindTagItem(IA_Label
, tags
),
137 *directoryTI
= FindTagItem(IOA_Directory
, tags
);
141 label
= (STRPTR
) labelTI
->ti_Data
;
144 if (directoryTI
!= NULL
)
146 directory
= (STRPTR
) directoryTI
->ti_Data
;
149 newObject
= NewObjectA(DrawerIcon
->mcc_Class
, NULL
, tags
);
151 semanticObject
= NewObject
153 DrawerIconObserver
->mcc_Class
, NULL
,
155 IOA_Name
, (IPTR
) label
,
156 OA_Presentation
, (IPTR
) newObject
,
157 IOA_Directory
, (IPTR
) directory
,
167 newObject
= NewObjectA(ToolIcon
->mcc_Class
, NULL
, tags
);
169 semanticObject
= NewObject(ToolIconObserver
->mcc_Class
, NULL
,
170 OA_Presentation
, (IPTR
) newObject
, TAG_END
);
173 case CDO_ProjectIcon
:
174 newObject
= NewObjectA(ProjectIcon
->mcc_Class
, NULL
, tags
);
176 semanticObject
= NewObject
178 ProjectIconObserver
->mcc_Class
, NULL
,
179 OA_Presentation
, (IPTR
) newObject
,
184 case CDO_TrashcanIcon
:
185 newObject
= NewObjectA(TrashcanIcon
->mcc_Class
, NULL
, tags
);
187 semanticObject
= NewObject
189 TrashcanIconObserver
->mcc_Class
, NULL
,
190 OA_Presentation
, (IPTR
) newObject
,
196 newObject
= NewObjectA
198 DesktopBase
->db_Desktop
->mcc_Class
, NULL
, tags
201 semanticObject
= NewObject
203 DesktopObserver
->mcc_Class
, NULL
,
204 OA_Presentation
, (IPTR
) newObject
,
210 case CDO_DirectoryWindow
:
213 Object
*windowObject
;
215 if (DesktopBase
->db_DefaultWindow
)
217 windowClass
= DesktopBase
->db_DefaultWindow
->cl_ID
;
221 windowClass
= MUIC_Window
;
224 windowObject
= MUI_NewObject
228 MUIA_Window_UseBottomBorderScroller
, TRUE
,
229 MUIA_Window_UseRightBorderScroller
, TRUE
,
231 WindowContents
, (IPTR
) CreateDesktopObjectA
233 CDO_IconContainer
, tags
245 } /* CreateWorkbenchObjectA */