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/classes.h>
11 #include <intuition/intuition.h>
12 #include <intuition/classusr.h>
13 #include <intuition/imageclass.h>
14 #include <libraries/mui.h>
15 #include <workbench/workbench.h>
19 #include "desktop_intern.h"
21 #include <proto/dos.h>
22 #include <proto/icon.h>
23 #include <proto/input.h>
24 #include <proto/muimaster.h>
25 #include <proto/intuition.h>
26 #include <proto/utility.h>
28 #include "presentation.h"
29 #include "iconcontainerclass.h"
30 #include "iconclass.h"
32 #include "desktop_intern_protos.h"
37 #include <aros/debug.h>
39 static ULONG
DoSetupMethod(Object
* obj
, struct MUI_RenderInfo
*info
)
42 MUI set the correct render info *before* it calls MUIM_Setup so please
43 only use this function instead of DoMethodA()
45 muiRenderInfo(obj
) = info
;
47 return DoMethod(obj
, MUIM_Setup
, (IPTR
) info
);
50 IPTR
iconNew(Class
* cl
, Object
* obj
, struct opSet
* msg
)
53 struct IconClassData
*data
;
55 *tstate
= msg
->ops_AttrList
;
56 struct DiskObject
*diskobject
= NULL
;
58 BOOL selected
= FALSE
;
59 UBYTE viewMode
= IAVM_LARGEICON
;
60 struct DateStamp
*lastChanged
= NULL
;
63 Object
*desktop
= NULL
;
65 while ((tag
= NextTagItem(&tstate
)) != NULL
)
70 diskobject
= (struct DiskObject
*) tag
->ti_Data
;
74 label
= (UBYTE
*) tag
->ti_Data
;
78 selected
= (BOOL
) tag
->ti_Data
;
82 viewMode
= (UBYTE
) tag
->ti_Data
;
86 type
= (LONG
) tag
->ti_Data
;
90 size
= (ULONG
) tag
->ti_Data
;
94 lastChanged
= (struct DateStamp
*) tag
->ti_Data
;
98 desktop
= (Object
*) tag
->ti_Data
;
102 continue; /* Don't supress non-processed tags */
105 tag
->ti_Tag
= TAG_IGNORE
;
108 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
112 obj
= (Object
*) retval
;
113 data
= INST_DATA(cl
, obj
);
114 data
->diskObject
= diskobject
;
116 data
->selected
= selected
;
117 data
->viewMode
= viewMode
;
121 data
->lastChanged
= *lastChanged
;
123 data
->ehn
.ehn_Priority
= 10;
124 data
->ehn
.ehn_Flags
= (1 << 1);
125 data
->ehn
.ehn_Object
= obj
;
126 data
->ehn
.ehn_Class
= cl
;
127 data
->ehn
.ehn_Events
= IDCMP_MOUSEBUTTONS
;
129 data
->imagePart
= NULL
;
130 data
->labelPart
= NULL
;
131 data
->sizePart
= NULL
;
132 data
->typePart
= NULL
;
133 data
->lastModifiedPart
= NULL
;
136 data
->desktop
= desktop
;
142 IPTR
iconSet(Class
* cl
, Object
* obj
, struct opSet
* msg
)
144 struct IconClassData
*data
;
147 *tstate
= msg
->ops_AttrList
;
149 data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
151 while ((tag
= NextTagItem(&tstate
)))
156 SetAttrs(data
->labelPart
, MUIA_Text_Contents
, tag
->ti_Data
,
160 data
->selected
= tag
->ti_Data
;
162 SetAttrs(data
->imagePart
, MUIA_Selected
, tag
->ti_Data
,
168 // this is the same as moving a file
169 data
->directory
= (UBYTE
*) tag
->ti_Data
;
172 data
->type
= (LONG
) tag
->ti_Data
;
175 data
->size
= (ULONG
) tag
->ti_Data
;
177 case IA_LastModified
:
178 data
->lastChanged
= *((struct DateStamp
*) tag
->ti_Data
);
182 data
->viewMode
= (ULONG
) tag
->ti_Data
;
183 if (data
->viewMode
== IAVM_DETAIL
)
187 // muiNotifyData(data->sizePart)->mnd_ParentObject =
189 // DoMethod(data->sizePart, MUIM_ConnectParent, obj);
190 // DoSetupMethod(data->sizePart, muiRenderInfo(obj));
194 // muiNotifyData(data->typePart)->mnd_ParentObject =
196 // DoMethod(data->typePart, MUIM_ConnectParent, obj);
197 // DoSetupMethod(data->typePart, muiRenderInfo(obj));
199 if (data
->lastModifiedPart
)
201 // muiNotifyData(data->lastModifiedPart)->mnd_ParentObject
203 // DoMethod(data->lastModifiedPart,
204 // MUIM_ConnectParent, obj);
205 // DoSetupMethod(data->lastModifiedPart,
206 // muiRenderInfo(obj));
213 // DoMethod(data->sizePart, MUIM_Cleanup);
214 // these should be disposed of....
215 // data->sizePart=NULL;
219 // DoMethod(data->typePart, MUIM_Cleanup);
220 // data->typePart=NULL;
222 if (data
->lastModifiedPart
)
224 // DoMethod(data->lastModifiedPart, MUIM_Cleanup);
225 // data->lastModifiedPart=NULL;
236 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
241 IPTR
iconGet(Class
* cl
, Object
* obj
, struct opGet
* msg
)
244 struct IconClassData
*data
;
246 data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
248 switch (msg
->opg_AttrID
)
251 *msg
->opg_Storage
= (ULONG
) data
->desktop
;
254 *msg
->opg_Storage
= (ULONG
) data
->diskObject
;
257 *msg
->opg_Storage
= (ULONG
) data
->label
;
260 *msg
->opg_Storage
= (ULONG
) data
->selected
;
263 *msg
->opg_Storage
= (ULONG
) data
->directory
;
266 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
273 IPTR
iconDispose(Class
* cl
, Object
* obj
, Msg msg
)
276 struct IconClassData
*data
;
278 data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
280 retval
= DoSuperMethodA(cl
, obj
, msg
);
285 IPTR
iconHandleInput(Class
* cl
, Object
* obj
, struct MUIP_HandleInput
* msg
)
288 struct IconClassData
*data
;
290 data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
294 switch (msg
->imsg
->Class
)
296 case IDCMP_MOUSEBUTTONS
:
298 if (msg
->imsg
->Code
== SELECTDOWN
)
300 if (msg
->imsg
->MouseX
>= _mleft(obj
)
301 && msg
->imsg
->MouseX
<= _mright(obj
)
302 && msg
->imsg
->MouseY
>= _mtop(obj
)
303 && msg
->imsg
->MouseY
<= _mbottom(obj
))
305 ULONG nowSeconds
= 0,
308 CurrentTime(&nowSeconds
, &nowMicros
);
313 (data
->lastClickSecs
,
314 data
->lastClickMicros
, nowSeconds
,
317 SetAttrs(obj
, IA_Executed
, TRUE
, TAG_END
);
320 SetAttrs(obj
, IA_Selected
, TRUE
, TAG_END
);
323 SetAttrs(obj
, IA_Selected
, TRUE
, TAG_END
);
325 data
->lastClickSecs
= nowSeconds
;
326 data
->lastClickMicros
= nowMicros
;
330 if (data
->selected
== TRUE
)
334 qualifiers
= PeekQualifier();
337 (IEQUALIFIER_LSHIFT
|
338 IEQUALIFIER_RSHIFT
)))
339 SetAttrs(obj
, IA_Selected
, FALSE
,
347 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
355 IPTR
iconSetup(Class
* cl
, Object
* obj
, struct MUIP_Setup
* msg
)
358 struct IconClassData
*data
;
360 data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
362 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
364 DoSetupMethod(data
->imagePart
, muiRenderInfo(obj
));
365 DoSetupMethod(data
->labelPart
, muiRenderInfo(obj
));
367 if (data
->viewMode
== IAVM_DETAIL
)
370 DoSetupMethod(data
->sizePart
, muiRenderInfo(obj
));
372 DoSetupMethod(data
->typePart
, muiRenderInfo(obj
));
373 if (data
->lastModifiedPart
)
374 DoSetupMethod(data
->lastModifiedPart
, muiRenderInfo(obj
));
377 DoMethod(_win(obj
), MUIM_Window_AddEventHandler
, (IPTR
) &data
->ehn
);
382 IPTR
iconCleanup(Class
* cl
, Object
* obj
, struct MUIP_Cleanup
* msg
)
385 struct IconClassData
*data
;
387 data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
389 DoMethod(obj
, MUIM_Window_RemEventHandler
, (IPTR
) &data
->ehn
);
391 DoMethodA(data
->imagePart
, (Msg
) msg
);
392 DoMethodA(data
->labelPart
, (Msg
) msg
);
393 if (data
->viewMode
== IAVM_DETAIL
)
396 DoMethodA(data
->sizePart
, (Msg
) msg
);
398 DoMethodA(data
->typePart
, (Msg
) msg
);
399 if (data
->lastModifiedPart
)
400 DoMethodA(data
->lastModifiedPart
, (Msg
) msg
);
403 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
409 IPTR
iconDraw(Class
* cl
, Object
* obj
, struct MUIP_Draw
* msg
)
412 struct IconClassData
*data
;
413 ULONG imageDrawState
= IDS_NORMAL
;
415 data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
417 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
419 if (data
->viewMode
== IAVM_LARGEICON
)
421 if (data
->whyRedraw
== WR_SELECTED
)
423 if (data
->selected
== TRUE
)
424 imageDrawState
= IDS_SELECTED
;
427 DrawIconStateA(_rp(obj
), data
->diskObject
, NULL
,
428 _left(data
->imagePart
), _top(data
->imagePart
),
429 imageDrawState
, NULL
);
432 MUI_Redraw(data
->imagePart
, MADF_DRAWOBJECT
);
433 MUI_Redraw(data
->labelPart
, MADF_DRAWOBJECT
);
434 if (data
->viewMode
== IAVM_DETAIL
)
437 MUI_Redraw(data
->sizePart
, MADF_DRAWOBJECT
);
439 MUI_Redraw(data
->typePart
, MADF_DRAWOBJECT
);
440 if (data
->lastModifiedPart
)
441 MUI_Redraw(data
->lastModifiedPart
, MADF_DRAWOBJECT
);
447 #define MAX(x,y) (x>y?x:y)
449 IPTR
iconAskMinMax(Class
* cl
, Object
* obj
, struct MUIP_AskMinMax
* msg
)
452 struct MUI_MinMax minMax
;
453 struct IconClassData
*data
;
465 data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
467 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
469 if (data
->viewMode
== IAVM_LARGEICON
)
471 iconWidth
= data
->diskObject
->do_Gadget
.Width
;
472 iconHeight
= data
->diskObject
->do_Gadget
.Height
;
480 // do minmax for icon
484 minMax
.MinHeight
= 0;
485 minMax
.DefHeight
= 0;
486 minMax
.MaxHeight
= 0;
487 DoMethod(data
->imagePart
, MUIM_AskMinMax
, (IPTR
) &minMax
);
489 _minwidth(data
->imagePart
) = iconWidth
;
490 _minheight(data
->imagePart
) = iconHeight
;
491 _maxwidth(data
->imagePart
) = iconWidth
;
492 _maxheight(data
->imagePart
) = iconHeight
;
493 _defwidth(data
->imagePart
) = iconWidth
;
494 _defheight(data
->imagePart
) = iconHeight
;
496 // do minmax for label
500 minMax
.MinHeight
= 0;
501 minMax
.DefHeight
= 0;
502 minMax
.MaxHeight
= 0;
503 DoMethod(data
->labelPart
, MUIM_AskMinMax
, (IPTR
) &minMax
);
505 _minwidth(data
->labelPart
) = minMax
.MinWidth
;
506 _minheight(data
->labelPart
) = minMax
.MinHeight
;
507 _maxwidth(data
->labelPart
) = minMax
.MaxWidth
;
508 _maxheight(data
->labelPart
) = minMax
.MaxHeight
;
509 _defwidth(data
->labelPart
) = minMax
.DefWidth
;
510 _defheight(data
->labelPart
) = minMax
.DefHeight
;
512 labelWidth
= minMax
.DefWidth
;
513 labelHeight
= minMax
.DefHeight
;
515 if (data
->viewMode
== IAVM_DETAIL
)
517 // do minmax for size
523 minMax
.MinHeight
= 0;
524 minMax
.DefHeight
= 0;
525 minMax
.MaxHeight
= 0;
526 DoMethod(data
->sizePart
, MUIM_AskMinMax
, (IPTR
) &minMax
);
528 _minwidth(data
->sizePart
) = minMax
.MinWidth
;
529 _minheight(data
->sizePart
) = minMax
.MinHeight
;
530 _maxwidth(data
->sizePart
) = minMax
.MaxWidth
;
531 _maxheight(data
->sizePart
) = minMax
.MaxHeight
;
532 _defwidth(data
->sizePart
) = minMax
.DefWidth
;
533 _defheight(data
->sizePart
) = minMax
.DefHeight
;
535 sizeHeight
= _defheight(data
->sizePart
);
536 sizeWidth
= _defwidth(data
->sizePart
);
542 // do minmax for type
546 minMax
.MinHeight
= 0;
547 minMax
.DefHeight
= 0;
548 minMax
.MaxHeight
= 0;
549 DoMethod(data
->typePart
, MUIM_AskMinMax
, (IPTR
) &minMax
);
551 _minwidth(data
->typePart
) = minMax
.MinWidth
;
552 _minheight(data
->typePart
) = minMax
.MinHeight
;
553 _maxwidth(data
->typePart
) = minMax
.MaxWidth
;
554 _maxheight(data
->typePart
) = minMax
.MaxHeight
;
555 _defwidth(data
->typePart
) = minMax
.DefWidth
;
556 _defheight(data
->typePart
) = minMax
.DefHeight
;
558 typeHeight
= _defheight(data
->typePart
);
559 typeWidth
= _defwidth(data
->typePart
);
562 if (data
->lastModifiedPart
)
564 // do minmax for last-modified
568 minMax
.MinHeight
= 0;
569 minMax
.DefHeight
= 0;
570 minMax
.MaxHeight
= 0;
571 DoMethod(data
->lastModifiedPart
, MUIM_AskMinMax
, (IPTR
) &minMax
);
573 _minwidth(data
->lastModifiedPart
) = minMax
.MinWidth
;
574 _minheight(data
->lastModifiedPart
) = minMax
.MinHeight
;
575 _maxwidth(data
->lastModifiedPart
) = minMax
.MaxWidth
;
576 _maxheight(data
->lastModifiedPart
) = minMax
.MaxHeight
;
577 _defwidth(data
->lastModifiedPart
) = minMax
.DefWidth
;
578 _defheight(data
->lastModifiedPart
) = minMax
.DefHeight
;
580 lastModHeight
= _defheight(data
->lastModifiedPart
);
581 lastModWidth
= _defwidth(data
->lastModifiedPart
);
585 switch (data
->viewMode
)
588 msg
->MinMaxInfo
->DefWidth
+= (MAX(iconWidth
, labelWidth
));
589 msg
->MinMaxInfo
->DefHeight
+= (iconHeight
+ labelHeight
);
590 msg
->MinMaxInfo
->MinHeight
+= (iconHeight
+ labelHeight
);
591 msg
->MinMaxInfo
->MaxHeight
+= (iconHeight
+ labelHeight
);
592 msg
->MinMaxInfo
->MinWidth
+= (MAX(iconWidth
, labelWidth
));
593 msg
->MinMaxInfo
->MaxWidth
+= (MAX(iconWidth
, labelWidth
));
596 msg
->MinMaxInfo
->DefWidth
+= (iconWidth
+ labelWidth
);
597 msg
->MinMaxInfo
->DefHeight
+= (MAX(iconHeight
, labelHeight
));
598 msg
->MinMaxInfo
->MinHeight
+= (MAX(iconHeight
, labelHeight
));
599 msg
->MinMaxInfo
->MaxHeight
+= (MAX(iconHeight
, labelHeight
));
600 msg
->MinMaxInfo
->MinWidth
+= (iconWidth
+ labelWidth
);
601 msg
->MinMaxInfo
->MaxWidth
+= (iconWidth
+ labelWidth
);
605 struct DetailColumn
*label
,
611 (struct DetailColumn
*) DoMethod(_parent(obj
),
612 ICM_GetColumn
, IA_Label
);
614 (struct DetailColumn
*) DoMethod(_parent(obj
),
615 ICM_GetColumn
, IA_Size
);
617 (struct DetailColumn
*) DoMethod(_parent(obj
),
618 ICM_GetColumn
, IA_Type
);
620 (struct DetailColumn
*) DoMethod(_parent(obj
),
624 msg
->MinMaxInfo
->DefWidth
+=
625 (modified
->dc_X
+ modified
->dc_Width
);
626 msg
->MinMaxInfo
->DefHeight
+= (MAX(iconHeight
, labelHeight
));
627 msg
->MinMaxInfo
->MinWidth
+=
628 (modified
->dc_X
+ modified
->dc_Width
);
629 msg
->MinMaxInfo
->MinHeight
+= (MAX(iconHeight
, labelHeight
));
630 msg
->MinMaxInfo
->MaxWidth
+=
631 (modified
->dc_X
+ modified
->dc_Width
);
632 msg
->MinMaxInfo
->MaxHeight
+= (MAX(iconHeight
, labelHeight
));
640 IPTR
iconShow(Class
* cl
, Object
* obj
, Msg msg
)
643 struct IconClassData
*data
;
645 data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
647 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
649 DoMethodA(data
->imagePart
, msg
);
650 DoMethodA(data
->labelPart
, msg
);
651 if (data
->viewMode
== IAVM_DETAIL
)
654 DoMethodA(data
->sizePart
, msg
);
656 DoMethodA(data
->typePart
, msg
);
657 if (data
->lastModifiedPart
)
658 DoMethodA(data
->lastModifiedPart
, msg
);
664 IPTR
iconConnectParent(Class
* cl
, Object
* obj
,
665 struct MUIP_ConnectParent
* msg
)
667 struct IconClassData
*data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
671 if (data
->viewMode
!= IAVM_LARGEICON
)
674 if (!data
->imagePart
)
676 data
->imagePart
= RectangleObject
,
678 MUIA_FixHeight
, data
->diskObject
->do_Gadget
.Height
,
679 MUIA_FixWidth
, data
->diskObject
->do_Gadget
.Width
, End
;
682 if (data
->viewMode
== IAVM_LARGEICON
)
683 SetAttrs(data
->imagePart
, MUIA_Frame
, MUIV_Frame_None
, TAG_END
);
685 SetAttrs(data
->imagePart
, MUIA_Frame
, MUIV_Frame_Button
, TAG_END
);
687 if (!data
->labelPart
)
689 data
->labelPart
= TextObject
, MUIA_Text_Contents
, (IPTR
) data
->label
, End
;
692 if (data
->viewMode
== IAVM_DETAIL
)
694 struct DetailColumn
*dc
;
696 dc
= (struct DetailColumn
*) DoMethod
698 _parent(obj
), ICM_GetColumn
, IA_Size
704 buffer
= AllocVec(18, MEMF_ANY
);
706 __sprintf(buffer
, "%u", data
->size
);
708 data
->sizePart
= TextObject
,
709 MUIA_Text_Contents
, (IPTR
) buffer
,
715 dc
= (struct DetailColumn
*) DoMethod
717 _parent(obj
), ICM_GetColumn
, IA_Type
721 STRPTR description
= NULL
;
723 // this will change to tool/project/drawer/etc...
724 if (data
->type
< 0) description
= "File";
725 else if (data
->type
> 0) description
= "Drawer";
726 else description
= "Unknown";
728 data
->typePart
= TextObject
,
729 MUIA_Text_Contents
, (IPTR
) description
,
733 dc
= (struct DetailColumn
*) DoMethod(_parent(obj
), ICM_GetColumn
,
738 UBYTE day
[LEN_DATSTRING
];
739 UBYTE date
[LEN_DATSTRING
];
740 UBYTE time
[LEN_DATSTRING
];
741 ULONG bufferLength
= LEN_DATSTRING
* 3; /* FIXME: ??? */
742 UBYTE
*buffer
= AllocVec(bufferLength
, MEMF_ANY
);
743 /* FIXME: error checking */
745 dt
.dat_Stamp
= data
->lastChanged
;
746 dt
.dat_Format
= FORMAT_DOS
;
747 dt
.dat_Flags
= DTF_SUBST
;
749 dt
.dat_StrDate
= date
;
750 dt
.dat_StrTime
= time
;
754 if (strcmp(dt
.dat_StrDay
, "Yesterday") == 0)
756 strlcpy(buffer
, dt
.dat_StrDay
, bufferLength
);
758 else if (strcmp(dt
.dat_StrDay
, "Today") == 0)
760 strlcpy(buffer
, dt
.dat_StrDay
, bufferLength
);
764 strlcpy(buffer
, dt
.dat_StrDate
, bufferLength
);
767 strlcat(buffer
, " ", bufferLength
);
768 strlcat(buffer
, dt
.dat_StrTime
, bufferLength
);
775 data
->lastModifiedPart
= TextObject
,
776 MUIA_Text_Contents
, (IPTR
) buffer
,
783 retval
= DoSuperMethodA(cl
, obj
, (Msg
) msg
);
785 data
= (struct IconClassData
*) INST_DATA(cl
, obj
);
787 muiNotifyData(data
->imagePart
)->mnd_ParentObject
= obj
;
788 DoMethod(data
->imagePart
, MUIM_ConnectParent
, (IPTR
) obj
);
789 muiNotifyData(data
->labelPart
)->mnd_ParentObject
= obj
;
790 DoMethod(data
->labelPart
, MUIM_ConnectParent
, (IPTR
) obj
);
792 if (data
->viewMode
== IAVM_DETAIL
)
796 muiNotifyData(data
->sizePart
)->mnd_ParentObject
= obj
;
797 DoMethodA(data
->sizePart
, (Msg
) msg
);
798 DoSetupMethod(data
->sizePart
, muiRenderInfo(obj
));
802 muiNotifyData(data
->typePart
)->mnd_ParentObject
= obj
;
803 DoMethodA(data
->typePart
, (Msg
) msg
);
804 DoSetupMethod(data
->typePart
, muiRenderInfo(obj
));
806 if (data
->lastModifiedPart
)
808 muiNotifyData(data
->lastModifiedPart
)->mnd_ParentObject
= obj
;
809 DoMethodA(data
->lastModifiedPart
, (Msg
) msg
);
810 DoSetupMethod(data
->lastModifiedPart
, muiRenderInfo(obj
));
818 ULONG
iconLayout(Class
* cl
, Object
* obj
, Msg msg
)
821 struct IconClassData
*data
;
823 data
= INST_DATA(cl
, obj
);
824 retval
= DoSuperMethodA(cl
, obj
, msg
);
826 switch (data
->viewMode
)
829 MUI_Layout(data
->imagePart
,
830 (_defwidth(obj
) / 2) -
831 (_defwidth(data
->imagePart
) / 2), 0,
832 _defwidth(data
->imagePart
),
833 _defheight(data
->imagePart
), 0);
834 MUI_Layout(data
->labelPart
,
835 (_defwidth(obj
) / 2) -
836 (_defwidth(data
->labelPart
) / 2),
837 _defheight(data
->imagePart
) + 1,
838 _defwidth(data
->labelPart
),
839 _defheight(data
->labelPart
), 0);
842 MUI_Layout(data
->imagePart
, 0,
843 (_defheight(obj
) / 2) -
844 (_defheight(data
->imagePart
) / 2),
845 _defwidth(data
->imagePart
),
846 _defheight(data
->imagePart
), 0);
847 MUI_Layout(data
->labelPart
, _defwidth(data
->imagePart
) + 1,
848 (_defheight(obj
) / 2) -
849 (_defheight(data
->labelPart
) / 2),
850 _defwidth(data
->labelPart
),
851 _defheight(data
->labelPart
), 0);
855 struct DetailColumn
*dc
;
857 dc
= (struct DetailColumn
*) DoMethod(_parent(obj
),
862 MUI_Layout(data
->imagePart
, dc
->dc_X
,
863 (_defheight(obj
) / 2) -
864 (_defheight(data
->labelPart
) / 2),
865 _defwidth(data
->imagePart
),
866 _defheight(data
->imagePart
), 0);
867 MUI_Layout(data
->labelPart
,
868 _defwidth(data
->imagePart
) + dc
->dc_X
+ 1,
869 (_defheight(obj
) / 2) -
870 (_defheight(data
->labelPart
) / 2),
871 _defwidth(data
->labelPart
),
872 _defheight(data
->labelPart
), 0);
877 dc
= (struct DetailColumn
*) DoMethod(_parent(obj
),
881 MUI_Layout(data
->sizePart
, dc
->dc_X
,
882 (_defheight(obj
) / 2) -
883 (_defheight(data
->labelPart
) / 2),
884 _defwidth(data
->sizePart
),
885 _defheight(data
->sizePart
), 0);
889 dc
= (struct DetailColumn
*) DoMethod(_parent(obj
),
893 MUI_Layout(data
->typePart
, dc
->dc_X
,
894 (_defheight(obj
) / 2) -
895 (_defheight(data
->labelPart
) / 2),
896 _defwidth(data
->typePart
),
897 _defheight(data
->typePart
), 0);
899 if (data
->lastModifiedPart
)
901 dc
= (struct DetailColumn
*) DoMethod(_parent(obj
),
905 MUI_Layout(data
->lastModifiedPart
, dc
->dc_X
,
906 (_defheight(obj
) / 2) -
907 (_defheight(data
->labelPart
) / 2),
908 _defwidth(data
->lastModifiedPart
),
909 _defheight(data
->lastModifiedPart
), 0);
918 BOOPSI_DISPATCHER(IPTR
, iconDispatcher
, cl
, obj
, msg
)
922 switch (msg
->MethodID
)
925 retval
= iconNew(cl
, obj
, (struct opSet
*) msg
);
928 retval
= iconSet(cl
, obj
, (struct opSet
*) msg
);
931 retval
= iconGet(cl
, obj
, (struct opGet
*) msg
);
934 retval
= iconDispose(cl
, obj
, msg
);
936 case MUIM_HandleInput
:
938 iconHandleInput(cl
, obj
, (struct MUIP_HandleInput
*) msg
);
941 retval
= iconSetup(cl
, obj
, (struct MUIP_Setup
*) msg
);
944 retval
= iconCleanup(cl
, obj
, (struct MUIP_Cleanup
*) msg
);
947 retval
= iconShow(cl
, obj
, msg
);
950 retval
= iconDraw(cl
, obj
, (struct MUIP_Draw
*) msg
);
952 case MUIM_ConnectParent
:
954 iconConnectParent(cl
, obj
, (struct MUIP_ConnectParent
*) msg
);
960 retval
= iconLayout(cl
, obj
, msg
);
963 retval
= iconAskMinMax(cl
, obj
, (struct MUIP_AskMinMax
*) msg
);
965 case MUIM_DrawBackground
:
969 struct IconClassData
*data
;
971 data
= INST_DATA(cl
, obj
);
974 DoMethodA(data
->imagePart
, msg
);
976 DoMethodA(data
->labelPart
, msg
);
979 if (data
->viewMode
== IAVM_DETAIL
)
982 DoMethodA(data
->sizePart
, msg
);
984 DoMethodA(data
->typePart
, msg
);
985 if (data
->lastModifiedPart
)
986 DoMethodA(data
->lastModifiedPart
, msg
);
988 retval
= DoSuperMethodA(cl
, obj
, msg
);
995 BOOPSI_DISPATCHER_END