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"
30 #include <aros/debug.h>
32 /*****************************************************************************
36 #include <proto/desktop.h>
38 AROS_LH1(struct DesktopOperationItem
*, GetMenuItemList
,
42 AROS_LHA(ULONG
, operationType
, D0
),
46 struct DesktopBase
*, DesktopBase
, 10, Desktop
)
66 *****************************************************************************
70 struct DesktopOperationItem
*doi
= NULL
;
71 struct DesktopOperation
*dop
,
76 //LONG itemNumber = 1;
78 dop
= (struct DesktopOperation
*) DesktopBase
->db_OperationList
.lh_Head
;
79 while (dop
->do_Node
.ln_Succ
)
82 dop
= (struct DesktopOperation
*) dop
->do_Node
.ln_Succ
;
88 (struct DesktopOperationItem
*)
89 AllocVec(sizeof(struct DesktopOperationItem
) * (items
+ 1),
95 dop
= (struct DesktopOperation
*) DesktopBase
->db_OperationList
.lh_Head
;
96 while (dop
->do_Node
.ln_Succ
)
98 if (dop
->do_Code
& operationType
)
100 doi
[index
].doi_Code
= dop
->do_Code
;
101 doi
[index
].doi_Number
= dop
->do_Number
;
102 doi
[index
].doi_Name
= dop
->do_Name
;
104 doi
[index
].doi_Flags
= 0;
105 if (dop
->do_Flags
& DOF_CHECKED
)
106 doi
[index
].doi_Flags
|= DOIF_CHECKED
;
107 if (dop
->do_Flags
& DOF_CHECKABLE
)
108 doi
[index
].doi_Flags
|= DOIF_CHECKABLE
;
109 if (dop
->do_Flags
& DOF_MUTUALEXCLUDE
)
110 doi
[index
].doi_Flags
|= DOIF_MUTUALEXCLUDE
;
112 doi
[index
].doi_MutualExclude
= dop
->do_MutualExclude
;
114 // this bit does the subitem array... at the moment only
115 // one level of subitems are supported.. it would be
116 // a nice option to have more, so this part will have to be changed
120 // subdop=DesktopBase->db_OperationList.lh_Head;
121 subdop
= (struct DesktopOperation
*) dop
->do_SubItems
.lh_Head
;
122 if (subdop
->do_Node
.ln_Succ
)
124 while (subdop
->do_Node
.ln_Succ
)
126 if (subdop
->do_Code
& operationType
)
128 subdop
= (struct DesktopOperation
*) subdop
->do_Node
.ln_Succ
;
133 doi
[index
].doi_SubItems
=
134 (struct DesktopOperationItem
*)
135 AllocVec(sizeof(struct DesktopOperationItem
) * (items
),
138 subdop
= (struct DesktopOperation
*) dop
->do_SubItems
.lh_Head
;
139 while (subdop
->do_Node
.ln_Succ
)
141 doi
[index
].doi_SubItems
[subindex
].doi_Code
=
143 doi
[index
].doi_SubItems
[subindex
].doi_Number
=
145 doi
[index
].doi_SubItems
[subindex
].doi_Name
=
147 doi
[index
].doi_SubItems
[subindex
].doi_MutualExclude
=
148 subdop
->do_MutualExclude
;
149 doi
[index
].doi_SubItems
[subindex
].doi_Flags
= 0;
150 if (subdop
->do_Flags
& DOF_CHECKED
)
151 doi
[index
].doi_SubItems
[subindex
].doi_Flags
|=
153 if (subdop
->do_Flags
& DOF_CHECKABLE
)
154 doi
[index
].doi_SubItems
[subindex
].doi_Flags
|=
156 if (subdop
->do_Flags
& DOF_MUTUALEXCLUDE
)
157 doi
[index
].doi_SubItems
[subindex
].doi_Flags
|=
159 doi
[index
].doi_SubItems
[subindex
].doi_SubItems
= NULL
;
162 (struct DesktopOperation
*) subdop
->do_Node
.ln_Succ
;
166 doi
[index
].doi_SubItems
[subindex
].doi_Number
= 0;
167 doi
[index
].doi_SubItems
[subindex
].doi_Code
= 0;
168 doi
[index
].doi_SubItems
[subindex
].doi_Name
= NULL
;
171 doi
[index
].doi_SubItems
= NULL
;
176 dop
= (struct DesktopOperation
*) dop
->do_Node
.ln_Succ
;
179 doi
[index
].doi_Number
= 0;
180 doi
[index
].doi_Code
= 0;
181 doi
[index
].doi_Name
= NULL
;
183 // kprintf("set doi[%d] to NULL\n", index);
187 { LONG numberWindowItems=0, subs=0;
189 while(doi[numberWindowItems].doi_Code!=0 &&
190 doi[numberWindowItems].doi_Name!=NULL) { kprintf("processing [%d] (addr):
191 %d\n", numberWindowItems, doi[numberWindowItems].doi_Name);
192 if(doi[numberWindowItems].doi_SubItems) { subs=0; kprintf("subitem.code
193 is: %d\n", doi[numberWindowItems].doi_SubItems[subs].doi_Code);
194 while(doi[numberWindowItems].doi_SubItems[subs].doi_Code!=0) { kprintf("
195 processing sub (addr): %d\n",
196 doi[numberWindowItems].doi_SubItems[subs].doi_Name); subs++;
197 kprintf("subitem.code is: %d\n",
198 doi[numberWindowItems].doi_SubItems[subs].doi_Code); } if(subs) subs++; }
199 numberWindowItems++; } }
207 } /* CreateWorkbenchObjectA */