2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 #define MUIMASTER_YES_INLINE_STDARG
9 #include <aros/debug.h>
11 #include <exec/types.h>
12 #include <exec/memory.h>
13 #include <intuition/classes.h>
14 #include <intuition/classusr.h>
15 #include <libraries/gadtools.h>
16 #include <libraries/mui.h>
17 #include <libraries/desktop.h>
21 #include "desktop_intern.h"
23 #include <proto/desktop.h>
24 #include <proto/dos.h>
25 #include <proto/muimaster.h>
26 #include <proto/intuition.h>
27 #include <proto/utility.h>
29 #include "presentation.h"
31 #include "iconobserver.h"
32 #include "drawericonobserver.h"
33 #include "desktopobserver.h"
34 #include "iconcontainerclass.h"
35 #include "iconclass.h"
37 #include "desktop_intern_protos.h"
41 IPTR
containerIconObserverExecute(Class
* cl
, Object
* obj
, Msg msg
)
48 struct ContainerIconObserverClassData
*data
;
55 struct NewMenu
*menuDat
;
56 Object
*desktop
= NULL
;
59 data
= (struct ContainerIconObserverClassData
*) INST_DATA(cl
, obj
);
60 retval
= DoSuperMethodA(cl
, obj
, msg
);
63 directory
= _directory(obj
);
65 // directory is NULL if this is a disk icon
67 dirNameLen
= strlen(directory
);
69 length
= strlen(name
) + dirNameLen
+ 1 /* ':' or '/' */ + 1;
70 newDir
= AllocVec(length
, MEMF_ANY
);
74 strlcpy(newDir
, directory
, length
);
75 strlcat(newDir
, name
, length
);
76 strlcat(newDir
, "/", length
);
81 strlcpy(newDir
, name
, length
);
82 strlcat(newDir
, ":", length
);
87 MUIA_Prop_Horiz
, TRUE
,
89 MUIA_Prop_UseWinBorder
, MUIV_Prop_UseWinBorder_Bottom
, End
;
91 MUIA_Prop_Horiz
, FALSE
,
92 MUIA_Prop_UseWinBorder
, MUIV_Prop_UseWinBorder_Right
, End
;
94 menuDat
= BuildDesktopMenus();
96 GetAttr(IA_Desktop
, _presentation(obj
), (IPTR
*) &desktop
);
98 iconcontainer
= CreateDesktopObject
102 ICOA_Directory
, (IPTR
) newDir
,
103 AICA_Desktop
, (IPTR
) desktop
,
104 ICA_VertScroller
, (IPTR
) vert
,
105 ICA_HorizScroller
, (IPTR
) horiz
,
106 MUIA_FillArea
, FALSE
,
115 // TEMPORARY!!!!! Use CreateDesktopObjectA(CDO_Window.....) instead!
116 dirWindow
= WindowObject
,
117 MUIA_Window_Width
, 300,
118 MUIA_Window_Height
, 300,
119 MUIA_Window_Title
, (IPTR
) title
,
120 MUIA_Window_Menustrip
, (IPTR
) strip
= MUI_MakeObject(MUIO_MenustripNM
, (IPTR
) menuDat
, 0),
121 MUIA_Window_UseBottomBorderScroller
, TRUE
,
122 MUIA_Window_UseRightBorderScroller
, TRUE
,
123 MUIA_Window_EraseArea
, FALSE
,
125 WindowContents
, (IPTR
) iconcontainer
,
128 DoMethod(_app(_presentation(obj
)), OM_ADDMEMBER
, (IPTR
) dirWindow
);
130 DoMethod(dirWindow
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
131 (IPTR
) dirWindow
, 3, MUIM_Set
, MUIA_Window_Open
, FALSE
);
133 DoMethod(vert
, MUIM_Notify
, MUIA_Prop_First
, MUIV_EveryTime
,
134 (IPTR
) iconcontainer
, 3, MUIM_Set
, ICA_ScrollToVert
, MUIV_TriggerValue
);
135 DoMethod(horiz
, MUIM_Notify
, MUIA_Prop_First
, MUIV_EveryTime
,
136 (IPTR
) iconcontainer
, 3, MUIM_Set
, ICA_ScrollToHoriz
,
138 DoMethod(dirWindow
, MUIM_Notify
, MUIA_Window_Activate
, TRUE
, (IPTR
) desktop
, 3,
139 MUIM_Set
, DA_ActiveWindow
, (IPTR
) dirWindow
);
140 SetAttrs(dirWindow
, MUIA_Window_Open
, TRUE
, TAG_END
);
145 IPTR
containerIconObserverNew(Class
* cl
, Object
* obj
, struct opSet
* msg
)
148 struct ContainerIconObserverClassData
*data
;
150 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
153 obj
= (Object
*) retval
;
154 data
= INST_DATA(cl
, obj
);
160 IPTR
containerIconObserverSet(Class
* cl
, Object
* obj
, struct opSet
* msg
)
162 struct ContainerIconObserverClassData
*data
;
165 *tstate
= msg
->ops_AttrList
;
167 data
= (struct ContainerIconObserverClassData
*) INST_DATA(cl
, obj
);
169 while ((tag
= NextTagItem(&tstate
)))
176 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
181 IPTR
containerIconObserverGet(Class
* cl
, Object
* obj
, struct opGet
* msg
)
184 struct ContainerIconObserverClassData
*data
;
186 data
= (struct ContainerIconObserverClassData
*) INST_DATA(cl
, obj
);
188 switch (msg
->opg_AttrID
)
191 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
198 IPTR
containerIconObserverDispose(Class
* cl
, Object
* obj
, Msg msg
)
202 retval
= DoSuperMethodA(cl
, obj
, msg
);
207 BOOPSI_DISPATCHER(IPTR
, containerIconObserverDispatcher
, cl
, obj
, msg
)
211 switch (msg
->MethodID
)
214 retval
= containerIconObserverNew(cl
, obj
, (struct opSet
*) msg
);
217 retval
= containerIconObserverSet(cl
, obj
, (struct opSet
*) msg
);
220 retval
= containerIconObserverGet(cl
, obj
, (struct opGet
*) msg
);
223 retval
= containerIconObserverDispose(cl
, obj
, msg
);
226 retval
= containerIconObserverExecute(cl
, obj
, msg
);
229 retval
= DoSuperMethodA(cl
, obj
, msg
);
235 BOOPSI_DISPATCHER_END