Indentation fix, cleanup.
[AROS.git] / workbench / system / Wanderer / iconwindow.c
blob44bcc9c5c6dd280d132b5a6ade6810faa9e98252
1 /*
2 Copyright © 2004-2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #define DOPENWINDOW(x) /* Window positioning and size */
9 #define ZCC_QUIET
11 #include "portable_macros.h"
12 #ifdef __AROS__
13 #define MUIMASTER_YES_INLINE_STDARG
14 #endif
16 #define ICONWINDOW_NODETAILVIEWCLASS
17 //#define ICONWINDOW_BUFFERLIST
19 #include <exec/types.h>
20 #include <libraries/mui.h>
22 #include <proto/utility.h>
24 #include <proto/graphics.h>
26 #include <proto/exec.h>
27 #include <proto/datatypes.h>
29 #include <dos/dos.h>
30 #include <proto/dos.h>
32 #include <proto/icon.h>
34 #include <stdio.h>
35 #include <string.h>
37 #include <intuition/screens.h>
38 #include <datatypes/pictureclass.h>
39 #include <clib/macros.h>
41 #ifdef __AROS__
42 #include <aros/debug.h>
43 #include <clib/alib_protos.h>
44 #include <prefs/wanderer.h>
45 #include <zune/customclasses.h>
46 #else
47 #include <prefs_AROS/wanderer.h>
48 #include <zune_AROS/customclasses.h>
49 #endif
51 #if defined(__AMIGA__) && !defined(__PPC__)
52 #define NO_INLINE_STDARG
53 #endif
54 #include <proto/intuition.h>
55 #include <proto/muimaster.h>
57 #include "Classes/iconlist.h"
58 #include "Classes/iconlistview.h"
59 #include "Classes/iconlist_attributes.h"
60 #include "Classes/icon_attributes.h"
61 #include "wanderer.h"
62 #include "wandererprefs.h"
64 #include "iconwindow.h"
65 #include "iconwindow_attributes.h"
66 #include "iconwindow_iconlist.h"
67 #include "iconwindowbackfill.h"
69 #include "version.h"
71 #ifndef __AROS__
73 #ifdef DEBUG
74 #define D(x) if (DEBUG) x
75 #ifdef __amigaos4__
76 #define bug DebugPrintF
77 #else
78 #define bug kprintf
79 #endif
80 #else
81 #define D(...)
82 #endif
83 #endif
85 #if defined(ICONWINDOW_NODETAILVIEWCLASS)
86 struct MUI_CustomClass *IconWindowDetailDrawerList_CLASS;
87 #endif
89 #define WIWVERS 1
90 #define WIWREV 0
92 #ifdef __AROS__
93 #define DoSuperNew(cl, obj, ...) DoSuperNewTags(cl, obj, NULL, __VA_ARGS__)
94 #else
95 #define IconListviewObject NewObject(IconListview_Class->mcc_Class
96 #endif
98 /*** Private Global Data *********************************************************/
100 static struct List iconwindow_BackFillNodes;
101 struct List iconwindow_Extensions;
102 struct IconWindow_BackFill_Descriptor *iconwindow_BackFill_Active;
104 static char __intern_wintitle_wanderer[] = WANDERERNAME;
106 #define TT_WNDRRSRT "WNDRRSRT"
107 #define TT_COUNT 1
109 /*** Helper functions ***********************************************************/
110 STATIC VOID IconWindow_RestoreSettings(struct DiskObject * dskobj, Object * iconwindowiconlist, BOOL forceshowall)
112 ULONG displayFlags = (ICONLIST_DISP_SHOWINFO | ICONLIST_DISP_MODEDEFAULT);
113 BOOL displayFlagsRestored = FALSE;
115 if (dskobj->do_ToolTypes)
117 STRPTR hexFlags = FindToolType(dskobj->do_ToolTypes, TT_WNDRRSRT);
118 if (hexFlags != NULL)
120 ULONG sortFlags = strtol(hexFlags, NULL, 16);
121 SET(iconwindowiconlist, MUIA_IconWindowIconList_RestoredSortFlags, (ULONG)sortFlags);
125 if (dskobj->do_Gadget.UserData)
128 * Note: it is actually possible when reading icons not snapshoted by Wanderer to end up in situation where
129 * only one of the dd_Flafs/dd_ViewModes has supported values. In that case however still the complete
130 * displayFlags are marked as restored. That is why the displayFlags have default value, so not to end
131 * up with invalid window settings.
133 D(bug("[Wanderer:IconWindow] %s: Drawer Icon has OS 2.x/3.x data: FLAGS %x\n", __PRETTY_FUNCTION__, dskobj->do_DrawerData->dd_Flags));
135 if (dskobj->do_DrawerData->dd_Flags == DDFLAGS_SHOWICONS)
137 displayFlags |= ICONLIST_DISP_SHOWINFO;
138 displayFlagsRestored = TRUE;
140 if (dskobj->do_DrawerData->dd_Flags == DDFLAGS_SHOWALL)
142 displayFlags &= ~ICONLIST_DISP_SHOWINFO;
143 displayFlagsRestored = TRUE;
145 if (dskobj->do_DrawerData->dd_ViewModes == DDVM_BYICON)
147 displayFlags &= ~ICONLIST_DISP_MODE_MASK;
148 displayFlags |= ICONLIST_DISP_MODEDEFAULT;
149 displayFlagsRestored = TRUE;
151 if (dskobj->do_DrawerData->dd_ViewModes == DDVM_BYNAME)
153 displayFlags &= ~ICONLIST_DISP_MODE_MASK;
154 displayFlags |= ICONLIST_DISP_MODELIST;
155 displayFlagsRestored = TRUE;
159 if (forceshowall)
161 displayFlags &= ~ICONLIST_DISP_SHOWINFO;
162 displayFlagsRestored = TRUE;
165 if (displayFlagsRestored)
166 SET(iconwindowiconlist, MUIA_IconWindowIconList_RestoredDisplayFlags, displayFlags);
169 STATIC VOID IconWindow_StoreSettings(Object * iconwindow)
171 Object *iconList = (Object *) XGET(iconwindow, MUIA_IconWindow_IconList);
172 STRPTR dir_name = (char *)XGET(iconwindow, MUIA_IconWindow_Location);
173 struct DiskObject *drawericon = NULL;
174 IPTR geticon_error = 0;
175 IPTR display_bits = 0, sort_bits = 0;
177 drawericon = GetIconTags(dir_name,
178 ICONGETA_FailIfUnavailable, FALSE,
179 ICONA_ErrorCode, &geticon_error,
180 TAG_DONE);
182 if (drawericon != NULL)
184 if (drawericon->do_DrawerData == NULL)
186 D(bug("[Wanderer:IconWindow] %s: Icon for '%s' has no DRAWER data!\n", __PRETTY_FUNCTION__, dir_name));
187 drawericon->do_DrawerData = AllocMem(sizeof(struct DrawerData), MEMF_CLEAR|MEMF_PUBLIC);
190 drawericon->do_Gadget.UserData = (APTR)1;
192 if (drawericon->do_DrawerData != NULL)
194 drawericon->do_DrawerData->dd_NewWindow.TopEdge = XGET(iconwindow, MUIA_Window_TopEdge);
195 drawericon->do_DrawerData->dd_NewWindow.LeftEdge = XGET(iconwindow, MUIA_Window_LeftEdge);
196 drawericon->do_DrawerData->dd_NewWindow.Width = XGET(iconwindow, MUIA_Window_Width);
197 drawericon->do_DrawerData->dd_NewWindow.Height = XGET(iconwindow, MUIA_Window_Height);
199 GET(iconList, MUIA_IconList_DisplayFlags, &display_bits);
200 if (display_bits & ICONLIST_DISP_SHOWINFO)
202 D(bug("[Wanderer:IconWindow] %s: ICONLIST_DISP_SHOWINFO\n", __PRETTY_FUNCTION__));
203 drawericon->do_DrawerData->dd_Flags = DDFLAGS_SHOWICONS;
205 else
207 drawericon->do_DrawerData->dd_Flags = DDFLAGS_SHOWALL;
210 if (display_bits & ICONLIST_DISP_MODEDEFAULT)
212 drawericon->do_DrawerData->dd_ViewModes = DDVM_BYICON;
214 if (display_bits & ICONLIST_DISP_MODELIST)
217 * ByName mode is used to encode list-view display mode. Note that actual sorting
218 * is stored in tool type, so the list-view window stores as DDVM_BYNAME does not
219 * have to be sorted by name.
221 drawericon->do_DrawerData->dd_ViewModes = DDVM_BYNAME;
225 /* Save settings into Tool Types */
227 LONG i = 0, inew = 0, tocopy = 0;
228 TEXT buffer[128] = {0};
229 UBYTE ** oldtooltypes = drawericon->do_ToolTypes;
230 UBYTE ** newtooltypes = NULL;
232 /* Find how many need to be copied */
233 if (oldtooltypes != NULL)
235 for (i = 0; oldtooltypes[i]; i++)
237 if (Strnicmp(oldtooltypes[i], TT_WNDRRSRT, strlen(TT_WNDRRSRT)) == 0)
238 continue;
239 tocopy++;
243 /* Create new pointer array */
244 newtooltypes = AllocVec(sizeof(STRPTR) * (tocopy + TT_COUNT + 1), MEMF_CLEAR);
246 if (newtooltypes != NULL)
248 /* Copy, inew will have last index value */
249 if (oldtooltypes != NULL)
251 for (i = 0, inew = 0; oldtooltypes[i]; i++)
253 if (Strnicmp(oldtooltypes[i], TT_WNDRRSRT, strlen(TT_WNDRRSRT)) == 0)
254 continue;
255 newtooltypes[inew++] = StrDup(oldtooltypes[i]);
259 /* Add TT_WNDRRSRT value */
260 GET(iconList, MUIA_IconList_SortFlags, &sort_bits);
261 __sprintf(buffer, TT_WNDRRSRT"=0x%lx", sort_bits);
262 newtooltypes[inew++] = StrDup(buffer);
264 drawericon->do_ToolTypes = newtooltypes;
266 PutDiskObject(dir_name, drawericon);
268 drawericon->do_ToolTypes = oldtooltypes;
270 /* Free memory */
271 for (i = 0; i < inew; i++)
272 FreeVec(newtooltypes[i]);
273 FreeVec(newtooltypes);
280 /*** Hook functions *********************************************************/
282 ///IconWindow__HookFunc_PrefsUpdatedFunc()
283 #ifdef __AROS__
284 AROS_UFH3(
285 void, IconWindow__HookFunc_PrefsUpdatedFunc,
286 AROS_UFHA(struct Hook *, hook, A0),
287 AROS_UFHA(APTR *, obj, A2),
288 AROS_UFHA(APTR, param, A1)
291 #else
292 HOOKPROTO(IconWindow__HookFunc_PrefsUpdatedFunc, void, APTR *obj, APTR param)
294 #endif
295 AROS_USERFUNC_INIT
297 /* Get our private data */
298 Object *self = ( Object *)obj;
299 Class *CLASS = *( Class **)param;
300 IPTR changed_state;
302 SETUP_ICONWINDOW_INST_DATA;
304 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
306 changed_state = 0;
307 GET(self, MUIA_IconWindow_Changed, &changed_state);
309 if ((changed_state) && (data->iwd_IconListObj))
311 D(bug("[Wanderer:IconWindow] %s: Window contents have changed .. updating display ..\n", __PRETTY_FUNCTION__));
312 DoMethod(data->iwd_IconListObj, MUIM_IconList_Update);
313 DoMethod(data->iwd_IconListObj, MUIM_IconList_Sort);
314 SET(self, MUIA_IconWindow_Changed, FALSE);
317 AROS_USERFUNC_EXIT
319 #ifndef __AROS__
320 MakeStaticHook(iwd_PrefsUpdated_hook,IconWindow__HookFunc_PrefsUpdatedFunc);
321 #endif
324 ///IconWindow__HookFunc_ProcessBackgroundFunc()
325 #ifdef __AROS__
326 AROS_UFH3(
327 void, IconWindow__HookFunc_ProcessBackgroundFunc,
328 AROS_UFHA(struct Hook *, hook, A0),
329 AROS_UFHA(APTR *, obj, A2),
330 AROS_UFHA(APTR, param, A1)
333 #else
334 HOOKPROTO(IconWindow__HookFunc_ProcessBackgroundFunc, void, APTR *obj, APTR param)
336 #endif
337 AROS_USERFUNC_INIT
339 /* Get our private data */
340 Object *self = ( Object *)obj,
341 *prefs = NULL;
342 Class *CLASS = *( Class **)param;
344 SETUP_ICONWINDOW_INST_DATA;
346 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
348 DoMethod(self, MUIM_IconWindow_BackFill_ProcessBackground, data->iwd_BackFillInfo, data->iwd_RootViewObj);
350 GET(_app(self), MUIA_Wanderer_Prefs, &prefs);
352 if (prefs)
354 //BOOL options_changed = FALSE;
355 IPTR prefs_Processing = 0;
357 GET(prefs, MUIA_WandererPrefs_Processing, &prefs_Processing);
358 if (!prefs_Processing)
360 /* TODO: We arent in prefs-processing so cause an update! */
364 AROS_USERFUNC_EXIT
366 #ifndef __AROS__
367 MakeStaticHook(iwd_ProcessBackground_hook,IconWindow__HookFunc_ProcessBackgroundFunc);
368 #endif
371 ///IconWindow__HookFunc_WandererBackFillFunc()
372 #ifdef __AROS__
373 AROS_UFH3(
374 void, IconWindow__HookFunc_WandererBackFillFunc,
375 AROS_UFHA(struct Hook *, hook, A0),
376 AROS_UFHA(struct RastPort *, RP, A2),
377 AROS_UFHA(struct BackFillMsg *, BFM, A1)
380 #else
381 HOOKPROTO(IconWindow__HookFunc_WandererBackFillFunc, void, struct RastPort *RP, struct BackFillMsg *BFM)
383 #endif
384 AROS_USERFUNC_INIT
386 struct IconWindow_BackFillHookData *HookData = NULL;
388 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
390 if ((HookData = hook->h_Data) && (iconwindow_BackFill_Active != NULL))
392 Class *CLASS = HookData->bfhd_IWClass;
393 Object *self = HookData->bfhd_IWObject;
395 SETUP_ICONWINDOW_INST_DATA;
397 struct RastPort *DrawBackGround_RastPort = NULL;
398 struct IconWindowBackFillMsg DrawBackGround_BackFillMsg;
400 GET(data->iwd_IconListObj, MUIA_IconList_BufferRastport, &DrawBackGround_RastPort);
402 if (DrawBackGround_RastPort != NULL)
404 if ((DrawBackGround_BackFillMsg.Layer = DrawBackGround_RastPort->Layer) == NULL)
406 D(bug("[Wanderer:IconWindow] %s: Rastport Layer = NULL!\n", __PRETTY_FUNCTION__));
409 GET(data->iwd_IconListObj,MUIA_IconList_BufferLeft, &DrawBackGround_BackFillMsg.AreaBounds.MinX);
410 GET(data->iwd_IconListObj,MUIA_IconList_BufferTop, &DrawBackGround_BackFillMsg.AreaBounds.MinY);
411 GET(data->iwd_IconListObj,MUIA_IconList_BufferWidth, &DrawBackGround_BackFillMsg.AreaBounds.MaxX);
412 GET(data->iwd_IconListObj,MUIA_IconList_BufferHeight, &DrawBackGround_BackFillMsg.AreaBounds.MaxY);
414 DrawBackGround_BackFillMsg.AreaBounds.MaxX += DrawBackGround_BackFillMsg.AreaBounds.MinX - 1;
415 DrawBackGround_BackFillMsg.AreaBounds.MaxY += DrawBackGround_BackFillMsg.AreaBounds.MinY - 1;
417 DrawBackGround_BackFillMsg.DrawBounds.MinX = BFM->Bounds.MinX;
418 DrawBackGround_BackFillMsg.DrawBounds.MinY = BFM->Bounds.MinY;
419 DrawBackGround_BackFillMsg.DrawBounds.MaxX = BFM->Bounds.MaxX;
420 DrawBackGround_BackFillMsg.DrawBounds.MaxY = BFM->Bounds.MaxY;
422 /* Offset into source image (ala scroll bar position) */
423 DrawBackGround_BackFillMsg.OffsetX = BFM->OffsetX;
424 DrawBackGround_BackFillMsg.OffsetY = BFM->OffsetY;
425 DoMethod(self, MUIM_IconWindow_BackFill_DrawBackground, data->iwd_BackFillInfo, &DrawBackGround_BackFillMsg, DrawBackGround_RastPort);
430 AROS_USERFUNC_EXIT
432 #ifndef __AROS__
433 MakeStaticHook(Hook_WandererBackFillFunc,IconWindow__HookFunc_WandererBackFillFunc);
434 #endif
437 ///OM_NEW()
438 Object *IconWindow__OM_NEW(Class *CLASS, Object *self, struct opSet *message)
440 struct iconWindow_Extension *iw_Extension = NULL;
442 struct Screen *_newIconWin__Screen = NULL;
443 Object *_newIconWin__IconListObj = NULL,
444 *_newIconWin__RootViewObj = NULL,
446 *_newIconWin__TopPanelContainerObj = NULL,
447 *_newIconWin__TopPanelRootGroupObj = NULL,
448 *_newIconWin__TopPanelSpacerObj = NULL,
450 *_newIconWin__LeftPanelContainerObj = NULL,
451 *_newIconWin__LeftPanelRootGroupObj = NULL,
452 *_newIconWin__LeftPanelSpacerObj = NULL,
454 *_newIconWin__BottomPanelContainerObj = NULL,
455 *_newIconWin__BottomPanelRootGroupObj = NULL,
456 *_newIconWin__BottomPanelSpacerObj = NULL,
458 *prefs = NULL;
460 char *_newIconWin__Title = NULL;
462 UBYTE _newIconWin__VOLVIEWMODE = MUIV_IconWindow_VolumeInfoMode_ShowAllIfNoInfo;
464 BOOL isRoot = FALSE,
465 isBackdrop = FALSE;
467 struct Hook *actionHook = NULL;
469 struct Hook *_newIconWin__BackFillHook = NULL;
471 IPTR WindowBF_TAG = (IPTR)TAG_IGNORE;
473 IPTR _newIconWin__WindowWidth = 0;
474 IPTR _newIconWin__WindowHeight = 0;
475 IPTR _newIconWin__WindowLeft = 0;
476 IPTR _newIconWin__WindowTop = 0;
478 IPTR _newIconWin__FSNotifyPort = (IPTR)NULL;
479 struct MUI_CustomClass *iconviewclass = NULL;
480 #if defined(ICONWINDOW_NODETAILVIEWCLASS)
481 IconWindowDetailDrawerList_CLASS = IconWindowDrawerList_CLASS;
482 #endif
484 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
486 /* More than one GetTagData is not very efficient, however since this isn't called very often... */
487 isBackdrop = (BOOL)GetTagData(MUIA_IconWindow_IsBackdrop, (IPTR)FALSE, message->ops_AttrList);
489 isRoot = (BOOL)GetTagData(MUIA_IconWindow_IsRoot, (IPTR)FALSE, message->ops_AttrList);
491 actionHook = (struct Hook *)GetTagData(MUIA_IconWindow_ActionHook, (IPTR) NULL, message->ops_AttrList);
492 prefs = (Object *)GetTagData(MUIA_Wanderer_Prefs, (IPTR) NULL, message->ops_AttrList);
494 _newIconWin__FSNotifyPort = (IPTR)GetTagData(MUIA_Wanderer_FileSysNotifyPort, (IPTR) NULL, message->ops_AttrList);
496 /* Request the screen we should use .. */
497 if (!(_newIconWin__Screen = (struct Screen *)GetTagData(MUIA_Wanderer_Screen, (IPTR) NULL, message->ops_AttrList)))
499 D(bug("[Wanderer:IconWindow] %s: NO SCREEN SET!\n", __PRETTY_FUNCTION__));
500 return NULL;
502 D(bug("[Wanderer:IconWindow] %s: Screen @ 0x%p\n", __PRETTY_FUNCTION__, _newIconWin__Screen));
504 if ((_newIconWin__BackFillHook = AllocVec(sizeof(struct Hook), MEMF_CLEAR|MEMF_PUBLIC))!=NULL)
506 D(bug("[Wanderer:IconWindow] %s: Allocated WindowBackFillHook @ 0x%p\n", __PRETTY_FUNCTION__, _newIconWin__BackFillHook));
508 #ifdef __AROS__
509 _newIconWin__BackFillHook->h_Entry = ( HOOKFUNC )IconWindow__HookFunc_WandererBackFillFunc;
510 #else
511 _newIconWin__BackFillHook = &Hook_WandererBackFillFunc;
512 #endif
514 //#if defined(__MORPHOS__)
515 // WindowBF_TAG = MUIA_Window_BackFillHook;
516 //#else
517 WindowBF_TAG = WA_BackFill;
518 //#endif
521 if (isRoot)
523 iconviewclass = IconWindowVolumeList_CLASS;
524 _newIconWin__IconListObj = (Object *)NewObject(iconviewclass->mcc_Class, NULL,
525 MUIA_Wanderer_FileSysNotifyPort, _newIconWin__FSNotifyPort,
526 TAG_DONE);
529 * Use MUI built-in support to keep window aligned to size of screen
530 * Remember: sizes of screen can change without window being recreated
532 _newIconWin__WindowWidth = MUIV_Window_Width_Screen(100);
533 _newIconWin__WindowHeight = MUIV_Window_Height_Screen(100);
534 _newIconWin__WindowTop = MUIV_Window_TopEdge_Delta(0);
535 _newIconWin__WindowLeft = 0;
537 DOPENWINDOW(bug("[Wanderer:IconWindow] %s: Screen dimensions .. %ld x %ld\n", __PRETTY_FUNCTION__, _newIconWin__WindowWidth, _newIconWin__WindowHeight));
539 if (isBackdrop)
541 DOPENWINDOW(bug("[Wanderer:IconWindow] %s: BACKDROP ROOT Window\n", __PRETTY_FUNCTION__));
542 _newIconWin__Title = NULL;
544 else
546 DOPENWINDOW(bug("[Wanderer:IconWindow] %s: Plain ROOT Window\n", __PRETTY_FUNCTION__));
547 _newIconWin__Title = __intern_wintitle_wanderer;
550 else
552 struct DiskObject *drawericon = NULL;
553 IPTR geticon_error = 0, geticon_isdefault = 0;
554 IPTR _newIconWin__TitleLen = 0;
555 BOOL forceshowall = FALSE;
556 BOOL isVolume;
558 _newIconWin__WindowTop = MUIV_Window_TopEdge_Centered;
559 _newIconWin__WindowLeft = MUIV_Window_LeftEdge_Centered;
560 _newIconWin__WindowWidth = 300;
561 _newIconWin__WindowHeight = 300;
563 _newIconWin__Title = (STRPTR) GetTagData(MUIA_IconWindow_Location, (IPTR)NULL, message->ops_AttrList);
564 _newIconWin__TitleLen = strlen(_newIconWin__Title);
565 isVolume = (_newIconWin__Title[_newIconWin__TitleLen - 1] == ':');
567 D(bug("[Wanderer:IconWindow] %s: Opening %s Window '%s'\n", __PRETTY_FUNCTION__, isVolume ? "Volume Root" : "Drawer", _newIconWin__Title));
569 drawericon = GetIconTags(_newIconWin__Title,
570 ICONGETA_Screen, _newIconWin__Screen,
571 ICONGETA_FailIfUnavailable, FALSE,
572 ICONGETA_IsDefaultIcon, &geticon_isdefault,
573 ICONA_ErrorCode, &geticon_error,
574 TAG_DONE);
576 if ((drawericon) && (drawericon->do_DrawerData))
578 D(bug("[Wanderer:IconWindow] %s: Directory Icon has DRAWER data!\n", __PRETTY_FUNCTION__));
579 _newIconWin__WindowTop = drawericon->do_DrawerData->dd_NewWindow.TopEdge;
580 _newIconWin__WindowLeft = drawericon->do_DrawerData->dd_NewWindow.LeftEdge;
581 _newIconWin__WindowWidth = drawericon->do_DrawerData->dd_NewWindow.Width;
582 _newIconWin__WindowHeight = drawericon->do_DrawerData->dd_NewWindow.Height;
585 iconviewclass = IconWindowDrawerList_CLASS;
586 if ((drawericon) && (drawericon->do_Gadget.UserData > 0))
588 D(bug("[Wanderer:IconWindow] %s: Directory Icons has OS 2.x/3.x data: FLAGS %x [\n", __PRETTY_FUNCTION__, drawericon->do_DrawerData->dd_Flags));
589 D(bug("] VIEWMODES %x [", drawericon->do_DrawerData->dd_ViewModes));
591 switch (drawericon->do_DrawerData->dd_ViewModes)
593 case 0:
595 D(bug("Default (inherit from parent)"));
596 break;
598 case 1:
600 D(bug("View as icons"));
601 break;
603 case 2:
605 D(bug("View as text, sorted by name"));
606 iconviewclass = IconWindowDetailDrawerList_CLASS;
607 break;
609 case 3:
611 D(bug("View as text, sorted by date"));
612 iconviewclass = IconWindowDetailDrawerList_CLASS;
613 break;
615 case 4:
617 D(bug("View as text, sorted by size"));
618 iconviewclass = IconWindowDetailDrawerList_CLASS;
619 break;
621 case 5:
623 D(bug("View as text, sorted by type"));
624 iconviewclass = IconWindowDetailDrawerList_CLASS;
625 break;
627 default:
629 D(bug("INVALID"));
632 D(bug("]\n"));
635 if (isVolume &&
636 (((geticon_isdefault) && (_newIconWin__VOLVIEWMODE == MUIV_IconWindow_VolumeInfoMode_ShowAllIfNoInfo)) ||
637 (_newIconWin__VOLVIEWMODE == MUIV_IconWindow_VolumeInfoMode_ShowAll)))
639 D(bug("[Wanderer:IconWindow] %s: setting 'SHOW ALL FILES'\n", __PRETTY_FUNCTION__));
640 forceshowall = TRUE;
643 _newIconWin__IconListObj = (Object *) NewObject(iconviewclass->mcc_Class, NULL,
644 MUIA_IconDrawerList_Drawer, (IPTR) _newIconWin__Title,
645 MUIA_Wanderer_FileSysNotifyPort, _newIconWin__FSNotifyPort,
646 TAG_DONE);
648 if (drawericon)
649 IconWindow_RestoreSettings(drawericon, _newIconWin__IconListObj, forceshowall);
651 _newIconWin__TopPanelRootGroupObj = MUI_NewObject(MUIC_Group,
652 MUIA_InnerLeft,(0),
653 MUIA_InnerRight,(0),
654 MUIA_InnerTop,(0),
655 MUIA_InnerBottom,(0),
656 MUIA_Frame, MUIV_Frame_None,
657 MUIA_Group_Spacing, 0,
658 Child, (_newIconWin__TopPanelSpacerObj = HSpace(0)),
659 TAG_DONE);
661 if (_newIconWin__TopPanelRootGroupObj)
663 _newIconWin__TopPanelContainerObj = MUI_NewObject(MUIC_Group, MUIA_Group_Horiz, TRUE,
664 MUIA_ShowMe, FALSE,
665 InnerSpacing(0,0),
666 MUIA_HorizWeight, 100,
667 MUIA_VertWeight, 0,
668 MUIA_Frame, MUIV_Frame_None,
669 MUIA_Group_Spacing, 3,
670 Child, (IPTR)_newIconWin__TopPanelRootGroupObj,
671 TAG_DONE);
674 _newIconWin__BottomPanelRootGroupObj = MUI_NewObject(MUIC_Group,
675 MUIA_InnerLeft,(0),
676 MUIA_InnerRight,(0),
677 MUIA_InnerTop,(0),
678 MUIA_InnerBottom,(0),
679 MUIA_Frame, MUIV_Frame_None,
680 MUIA_Group_Spacing, 0,
681 Child, (_newIconWin__BottomPanelSpacerObj = HSpace(0)),
682 TAG_DONE);
684 if (_newIconWin__BottomPanelRootGroupObj)
686 _newIconWin__BottomPanelContainerObj = MUI_NewObject(MUIC_Group, MUIA_Group_Horiz, TRUE,
687 MUIA_ShowMe, FALSE,
688 InnerSpacing(0,0),
689 MUIA_HorizWeight, 100,
690 MUIA_VertWeight, 0,
691 MUIA_Frame, MUIV_Frame_None,
692 MUIA_Group_Spacing, 3,
693 Child, (IPTR)_newIconWin__BottomPanelRootGroupObj,
694 TAG_DONE);
697 _newIconWin__LeftPanelRootGroupObj = MUI_NewObject(MUIC_Group,
698 MUIA_InnerLeft,(0),
699 MUIA_InnerRight,(0),
700 MUIA_InnerTop,(0),
701 MUIA_InnerBottom,(0),
702 MUIA_Frame, MUIV_Frame_None,
703 MUIA_Group_Spacing, 0,
704 Child, (_newIconWin__LeftPanelSpacerObj = HVSpace),
705 TAG_DONE);
707 if (_newIconWin__LeftPanelRootGroupObj)
709 _newIconWin__LeftPanelContainerObj = MUI_NewObject(MUIC_Group, MUIA_Group_Horiz, TRUE,
710 MUIA_ShowMe, FALSE,
711 InnerSpacing(0,0),
712 MUIA_HorizWeight, 0,
713 MUIA_VertWeight, 100,
714 MUIA_Frame, MUIV_Frame_None,
715 MUIA_Group_Spacing, 3,
716 Child, (IPTR)_newIconWin__LeftPanelRootGroupObj,
717 TAG_DONE);
721 _newIconWin__RootViewObj = (Object *) IconListviewObject,
722 MUIA_Weight, 100,
723 MUIA_IconListview_UseWinBorder, TRUE,
724 MUIA_IconListview_IconList, (IPTR) _newIconWin__IconListObj,
725 End;
727 DOPENWINDOW(bug("[Wanderer:IconWindow] %s: Window Co-ords %d,%d [%d x %d]\n", __PRETTY_FUNCTION__, _newIconWin__WindowLeft, _newIconWin__WindowTop, _newIconWin__WindowWidth, _newIconWin__WindowHeight));
728 D(bug("[Wanderer:IconWindow] %s: Font @ 0x%p\n", __PRETTY_FUNCTION__, _newIconWin__WindowFont));
729 D(bug("[Wanderer:IconWindow] %s: TopPanelContainerObj 0x%p RootViewObj 0x%p\n", __PRETTY_FUNCTION__, _newIconWin__TopPanelContainerObj, _newIconWin__RootViewObj));
731 self = (Object *) DoSuperNew(CLASS, self,
732 MUIA_Window_Screen, _newIconWin__Screen,
733 MUIA_Window_Backdrop, isBackdrop ? TRUE : FALSE,
734 MUIA_Window_Borderless, isBackdrop ? TRUE : FALSE,
735 MUIA_Window_Width, _newIconWin__WindowWidth,
736 MUIA_Window_Height, _newIconWin__WindowHeight,
737 MUIA_Window_LeftEdge, _newIconWin__WindowLeft,
738 MUIA_Window_TopEdge, _newIconWin__WindowTop,
739 (!isBackdrop) ? MUIA_Window_AltWidth : TAG_IGNORE, 100,
740 (!isBackdrop) ? MUIA_Window_AltHeight : TAG_IGNORE, 80,
741 MUIA_Window_Title, (IPTR)_newIconWin__Title,
743 MUIA_Window_DragBar, (!isBackdrop) ? TRUE : FALSE,
744 MUIA_Window_CloseGadget, (!isBackdrop) ? TRUE : FALSE,
745 MUIA_Window_SizeGadget, (!isBackdrop) ? TRUE : FALSE,
746 MUIA_Window_DepthGadget, (!isBackdrop) ? TRUE : FALSE,
747 #if defined(MUIA_Window_ZoomGadget)
748 MUIA_Window_ZoomGadget, (!isBackdrop) ? TRUE : FALSE,
749 #endif
750 MUIA_Window_UseBottomBorderScroller, (!isBackdrop) ? TRUE : FALSE,
751 MUIA_Window_UseRightBorderScroller, (!isBackdrop) ? TRUE : FALSE,
752 MUIA_Window_IsSubWindow, TRUE,
754 WindowBF_TAG, _newIconWin__BackFillHook,
756 MUIA_Window_ScreenTitle, (IPTR) "",
758 WindowContents, (IPTR) MUI_NewObject(MUIC_Group,
759 MUIA_Group_Spacing, 0,
760 MUIA_Group_SameSize, FALSE,
761 InnerSpacing(0,0),
763 /* "Extension" group */
764 _newIconWin__TopPanelContainerObj ? Child : TAG_IGNORE, (IPTR)_newIconWin__TopPanelContainerObj,
766 Child, HGroup,
767 _newIconWin__LeftPanelContainerObj ? Child : TAG_IGNORE, (IPTR)_newIconWin__LeftPanelContainerObj,
768 /* icon list */
769 Child, (IPTR) _newIconWin__RootViewObj,
770 End,
772 _newIconWin__BottomPanelContainerObj ? Child : TAG_IGNORE, (IPTR)_newIconWin__BottomPanelContainerObj,
774 TAG_DONE),
776 TAG_MORE, (IPTR) message->ops_AttrList
779 if (self != NULL)
781 SETUP_ICONWINDOW_INST_DATA;
783 D(bug("[Wanderer:IconWindow] %s: SELF = 0x%p\n", __PRETTY_FUNCTION__, self));
785 data->iwd_VolViewMode = _newIconWin__VOLVIEWMODE;
787 data->iwd_Screen = _newIconWin__Screen;
788 data->iwd_Title = _newIconWin__Title;
790 data->iwd_RootViewObj = _newIconWin__RootViewObj;
791 data->iwd_IconListObj = _newIconWin__IconListObj;
793 SET(data->iwd_RootViewObj, MUIA_IconWindow_Window, self);
795 data->iwd_ActionHook = actionHook;
797 data->iwd_TopPanel.iwp_PanelGroupObj = _newIconWin__TopPanelRootGroupObj;
798 data->iwd_TopPanel.iwp_PanelContainerObj = _newIconWin__TopPanelContainerObj;
799 data->iwd_TopPanel.iwp_PanelGroupSpacerObj = _newIconWin__TopPanelSpacerObj;
801 data->iwd_LeftPanel.iwp_PanelGroupObj = _newIconWin__LeftPanelRootGroupObj;
802 data->iwd_LeftPanel.iwp_PanelContainerObj = _newIconWin__LeftPanelContainerObj;
803 data->iwd_LeftPanel.iwp_PanelGroupSpacerObj = _newIconWin__LeftPanelSpacerObj;
805 data->iwd_BottomPanel.iwp_PanelGroupObj = _newIconWin__BottomPanelRootGroupObj;
806 data->iwd_BottomPanel.iwp_PanelContainerObj = _newIconWin__BottomPanelContainerObj;
807 data->iwd_BottomPanel.iwp_PanelGroupSpacerObj = _newIconWin__BottomPanelSpacerObj;
809 data->iwd_Flags = 0;
811 data->iwd_Flags |= (isRoot) ? IWDFLAG_ISROOT : 0;
812 data->iwd_Flags |= (isBackdrop) ? IWDFLAG_ISBACKDROP : 0;
814 data->iwd_ViewSettings_Attrib = (data->iwd_Flags & IWDFLAG_ISROOT)
815 ? "Workbench"
816 : "Drawer";
818 data->iwd_FSNotifyPort = _newIconWin__FSNotifyPort;
820 if (prefs)
822 #ifdef __AROS__
823 data->iwd_PrefsUpdated_hook.h_Entry = ( HOOKFUNC )IconWindow__HookFunc_PrefsUpdatedFunc;
824 #else
825 data->iwd_PrefsUpdated_hook = &iwd_PrefsUpdated_hook;
826 #endif
828 DoMethod
830 prefs, MUIM_Notify, MUIA_WandererPrefs_Processing, FALSE,
831 (IPTR) self, 3,
832 MUIM_CallHook, &data->iwd_PrefsUpdated_hook, (IPTR)CLASS
835 data->iwd_ViewSettings_PrefsNotificationObject = (Object *) DoMethod(prefs,
836 MUIM_WandererPrefs_ViewSettings_GetNotifyObject,
837 data->iwd_ViewSettings_Attrib);
838 data->iwd_WindowFont = (struct TextFont*)DoMethod(prefs, MUIM_WandererPrefs_ViewSettings_GetAttribute,
839 data->iwd_ViewSettings_Attrib, MUIA_IconWindow_Font);
840 SET(data->iwd_IconListObj, MUIA_Font, data->iwd_WindowFont);
843 #ifdef __AROS__
844 data->iwd_ProcessBackground_hook.h_Entry = ( HOOKFUNC )IconWindow__HookFunc_ProcessBackgroundFunc;
845 #else
846 data->iwd_ProcessBackground_hook = &iwd_ProcessBackground_hook;
847 #endif
849 if ((data->iwd_BackFill_hook = _newIconWin__BackFillHook))
851 data->iwd_BackFillHookData.bfhd_IWClass = CLASS;
852 data->iwd_BackFillHookData.bfhd_IWObject = self;
853 data->iwd_BackFill_hook->h_Data = &data->iwd_BackFillHookData;
856 ForeachNode(&iconwindow_Extensions, iw_Extension)
858 D(bug("[Wanderer:IconWindow] %s: Setting up '%s' @ %p\n", __PRETTY_FUNCTION__, iw_Extension->iwe_Node.ln_Name, iw_Extension));
859 iw_Extension->iwe_Setup(CLASS, self, message);
862 data->iwd_Flags |= IWDFLAG_SETUP;
864 /* If double clicked then we call our own private methods, that's
865 easier then using Hooks */
866 DoMethod
868 _newIconWin__IconListObj, MUIM_Notify, MUIA_IconList_DoubleClick, TRUE,
869 (IPTR) self, 1, MUIM_IconWindow_DoubleClicked
872 /* notify when icons dropped on another (wanderer) window */
873 DoMethod
875 _newIconWin__IconListObj, MUIM_Notify, MUIA_IconList_IconsDropped, MUIV_EveryTime,
876 (IPTR) self, 1, MUIM_IconWindow_IconsDropped
879 /* notify when icons dropped on custom application */
880 DoMethod
882 _newIconWin__IconListObj, MUIM_Notify, MUIA_IconList_AppWindowDrop, MUIV_EveryTime,
883 (IPTR) self, 1, MUIM_IconWindow_AppWindowDrop
886 DoMethod
888 _newIconWin__IconListObj, MUIM_Notify, MUIA_IconList_Clicked, MUIV_EveryTime,
889 (IPTR) self, 1, MUIM_IconWindow_Clicked
892 D(bug("[Wanderer:IconWindow] obj = %ld\n", self));
893 return self;
897 ///OM_DISPOSE()
898 IPTR IconWindow__OM_DISPOSE(Class *CLASS, Object *self, Msg message)
900 SETUP_ICONWINDOW_INST_DATA;
902 struct iconWindow_Extension *iw_Extension = NULL;
903 Object *prefs = NULL;
905 GET(_app(self), MUIA_Wanderer_Prefs, &prefs);
907 if (prefs)
909 DoMethod
911 prefs,
912 MUIM_KillNotifyObj, MUIA_WandererPrefs_Processing, (IPTR) self
915 if (data->iwd_Flags & IWDFLAG_SETUP)
917 ForeachNode(&iconwindow_Extensions, iw_Extension)
919 D(bug("[Wanderer:IconWindow] %s: Cleanup '%s'\n", __PRETTY_FUNCTION__, iw_Extension->iwe_Node.ln_Name));
920 iw_Extension->iwe_Cleanup(CLASS, self, message);
925 FreeVec(data->iwd_BackFill_hook);
927 return DoSuperMethodA(CLASS, self, message);
931 ///OM_SET()
932 IPTR IconWindow__OM_SET(Class *CLASS, Object *self, struct opSet *message)
934 SETUP_ICONWINDOW_INST_DATA;
936 struct iconWindow_Extension *iw_Extension = NULL;
938 struct TagItem *tstate = message->ops_AttrList, *tag;
939 BOOL UpdateIconlist = FALSE;
940 IPTR focusicon = (IPTR) NULL;
941 IPTR rv = TRUE;
943 while ((tag = NextTagItem((TAGITEM)&tstate)) != NULL)
945 switch (tag->ti_Tag)
947 case MUIA_Window_Screen:
948 D(bug("[Wanderer:IconWindow] %s: MUIA_Window_Screen [screen @ %p]\n", __PRETTY_FUNCTION__, tag->ti_Data));
949 data->iwd_Screen = (struct Screen *) tag->ti_Data;
950 break;
952 case MUIA_ShowMe:
953 D(bug("[Wanderer:IconWindow] %s: MUIA_ShowMe [%x]\n", __PRETTY_FUNCTION__, tag->ti_Data));
954 if (tag->ti_Data)
956 struct Screen *__Wanderer__Screen = NULL;
957 GET(_app(self), MUIA_Wanderer_Screen, &__Wanderer__Screen);
958 if (__Wanderer__Screen != data->iwd_Screen)
960 D(bug("[Wanderer:IconWindow] %s: Screen Changed [old = %p, new = %p]\n", __PRETTY_FUNCTION__, data->iwd_Screen, __Wanderer__Screen));
961 SET(self, MUIA_Window_Screen, __Wanderer__Screen);
962 if (((data->iwd_Flags & IWDFLAG_ISROOT)) && ((data->iwd_Flags & IWDFLAG_ISBACKDROP)))
964 IPTR _IconWin__NewWindowWidth = 0;
965 IPTR _IconWin__NewWindowHeight = 0;
966 #if 0 /* unused */
967 IPTR _IconWin__NewWindowLeft = 0;
968 #endif
969 IPTR _IconWin__NewWindowTop = 0;
971 D(bug("[Wanderer:IconWindow] %s: Updating Backdrop Window Dimensions\n", __PRETTY_FUNCTION__));
973 _IconWin__NewWindowWidth = GetBitMapAttr(__Wanderer__Screen->RastPort.BitMap, BMA_WIDTH);
974 _IconWin__NewWindowHeight = GetBitMapAttr(__Wanderer__Screen->RastPort.BitMap, BMA_HEIGHT);
975 D(bug("[Wanderer:IconWindow] %s: Screen dimensions .. %d x %d\n", __PRETTY_FUNCTION__, _IconWin__NewWindowWidth, _IconWin__NewWindowHeight));
977 _IconWin__NewWindowTop = __Wanderer__Screen->BarHeight + 1;
978 #if 0 /* unused */
979 _IconWin__NewWindowLeft = 0;
980 #endif
982 _IconWin__NewWindowHeight -= _IconWin__NewWindowTop;
984 D(bug("[Wanderer:IconWindow] %s: New Window dimensions .. %d x %d @ %d, %d\n", __PRETTY_FUNCTION__, _IconWin__NewWindowWidth, _IconWin__NewWindowHeight, 0, _IconWin__NewWindowTop));
986 SET(self, MUIA_Window_Width, _IconWin__NewWindowWidth);
987 SET(self, MUIA_Window_Height, _IconWin__NewWindowHeight);
991 break;
993 case MUIA_IconWindow_Changed:
994 data->iwd_Flags |= (tag->ti_Data) ? IWDFLAG_NEEDSUPDATE : 0;
995 break;
997 case MUIA_Window_Open:
998 D(bug("[Wanderer:IconWindow] %s: MUIA_Window_Open [%ld]\n", __PRETTY_FUNCTION__, tag->ti_Data));
999 if (tag->ti_Data)
1001 DoMethod(data->iwd_IconListObj, MUIM_IconList_Clear);
1003 rv = DoSuperMethodA(CLASS, self, (Msg) message);
1004 #if defined(ICONWINDOW_BUFFERLIST)
1005 if (!((data->iwd_Flags & IWDFLAG_ISROOT)))
1007 IPTR CURDISPFLAGS = NULL;
1008 GET(data->iwd_IconListObj, MUIA_IconList_DisplayFlags, &CURDISPFLAGS);
1009 CURDISPFLAGS |= ICONLIST_DISP_BUFFERED;
1010 SET(data->iwd_IconListObj, MUIA_IconList_DisplayFlags, CURDISPFLAGS);
1012 #endif
1013 D(bug("[Wanderer:IconWindow] %s: Process the background ..\n", __PRETTY_FUNCTION__));
1014 DoMethod(self, MUIM_IconWindow_BackFill_ProcessBackground, data->iwd_BackFillInfo, data->iwd_RootViewObj);
1016 D(bug("[Wanderer:IconWindow] %s: Force an update of the list ..\n", __PRETTY_FUNCTION__));
1017 DoMethod(data->iwd_IconListObj, MUIM_IconList_Update);
1018 DoMethod(data->iwd_IconListObj, MUIM_IconList_Sort);
1019 return rv;
1021 break;
1023 case MUIA_Window_Activate:
1024 if (data->iwd_IconListObj)
1025 GET(data->iwd_IconListObj, MUIA_IconList_FocusIcon, &focusicon);
1027 break;
1029 case MUIA_IconWindow_Font:
1030 data->iwd_WindowFont = (struct TextFont *)tag->ti_Data;
1031 D(bug("[Wanderer:IconWindow] %s: MUIA_IconWindow_Font [font @ 0x%p]\n", __PRETTY_FUNCTION__, data->iwd_WindowFont));
1033 if (!data->iwd_WindowFont)
1034 SetFont(_rp(self), data->iwd_WindowFont);
1036 if (data->iwd_IconListObj)
1037 SET(data->iwd_IconListObj, MUIA_Font, data->iwd_WindowFont);
1039 break;
1041 case MUIA_IconWindow_Location:
1042 D(bug("[Wanderer:IconWindow] %s: MUIA_IconWindow_Location [drawer '%s']\n", __PRETTY_FUNCTION__, data->iwd_DirectoryPath));
1044 if (!(data->iwd_Flags & IWDFLAG_ISROOT))
1046 strcpy(data->iwd_DirectoryPath, (STRPTR)tag->ti_Data);
1047 SET(self, MUIA_Window_Title, (IPTR)data->iwd_DirectoryPath);
1048 SET(data->iwd_IconListObj, MUIA_IconDrawerList_Drawer, (IPTR)data->iwd_DirectoryPath);
1050 break;
1052 case MUIA_IconWindow_BackgroundAttrib:
1053 D(bug("[Wanderer:IconWindow] %s: MUIA_IconWindow_BackgroundAttrib (not implemented)\n", __PRETTY_FUNCTION__));
1054 break;
1059 rv = DoSuperMethodA(CLASS, self, (Msg) message);
1061 if (data->iwd_Flags & IWDFLAG_SETUP)
1063 ForeachNode(&iconwindow_Extensions, iw_Extension)
1065 D(bug("[Wanderer:IconWindow] %s: Checking '%s'\n", __PRETTY_FUNCTION__, iw_Extension->iwe_Node.ln_Name));
1066 iw_Extension->iwe_Set(CLASS, self, message);
1070 if (UpdateIconlist)
1072 DoMethod(data->iwd_IconListObj, MUIM_IconList_Update);
1073 DoMethod(data->iwd_IconListObj, MUIM_IconList_Sort);
1076 if (focusicon)
1078 D(bug("[Wanderer:IconWindow] %s: Updating focused icon (@ 0x%p)\n", __PRETTY_FUNCTION__, focusicon));
1079 //MUI_Redraw(data->iwd_IconListObj, MADF_DRAWOBJECT);
1082 return rv;
1086 ///OM_GET()
1087 IPTR IconWindow__OM_GET(Class *CLASS, Object *self, struct opGet *message)
1089 SETUP_ICONWINDOW_INST_DATA;
1090 struct iconWindow_Extension *iw_Extension = NULL;
1091 IPTR *store = message->opg_Storage;
1092 IPTR rv = TRUE;
1094 switch (message->opg_AttrID)
1096 case MUIA_IconWindow_Changed:
1097 *store = (IPTR)(data->iwd_Flags & IWDFLAG_NEEDSUPDATE);
1098 break;
1100 case MUIA_IconWindow_Window:
1101 *store = (IPTR)self;
1102 break;
1104 case MUIA_IconWindow_Location:
1105 *store = !(data->iwd_Flags & IWDFLAG_ISROOT)
1106 ? XGET(data->iwd_IconListObj, MUIA_IconDrawerList_Drawer)
1107 : (IPTR)NULL;
1108 break;
1110 case MUIA_IconWindow_IconList:
1111 *store = (IPTR)data->iwd_IconListObj;
1112 break;
1114 case MUIA_IconWindow_IsRoot:
1115 *store = (IPTR)(data->iwd_Flags & IWDFLAG_ISROOT);
1116 break;
1118 case MUIA_IconWindow_IsBackdrop:
1119 *store = (IPTR)(data->iwd_Flags & IWDFLAG_ISBACKDROP);
1120 break;
1122 case MUIA_IconWindow_BackFillData:
1123 *store = (IPTR)data->iwd_BackFillInfo;
1124 break;
1126 case MUIA_IconWindow_BackgroundAttrib:
1127 *store = (IPTR)data->iwd_ViewSettings_Attrib;
1128 break;
1130 case MUIA_Version:
1131 *store = (IPTR)WIWVERS;
1132 break;
1134 case MUIA_Revision:
1135 *store = (IPTR)WIWREV;
1136 break;
1138 default:
1139 rv = FALSE;
1142 if (!rv)
1143 rv = DoSuperMethodA(CLASS, self, (Msg) message);
1145 if (!rv)
1147 ForeachNode(&iconwindow_Extensions, iw_Extension)
1149 D(bug("[Wanderer:IconWindow] %s: Checking '%s'\n", __PRETTY_FUNCTION__, iw_Extension->iwe_Node.ln_Name));
1150 if ((rv = iw_Extension->iwe_Get(CLASS, self, message)))
1151 break;
1155 return rv;
1159 ///IconWindow__MUIM_Window_Setup()
1160 IPTR IconWindow__MUIM_Window_Setup
1162 Class *CLASS, Object *self, Msg message
1165 SETUP_ICONWINDOW_INST_DATA;
1167 Object *prefs = NULL;
1169 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1171 if (!DoSuperMethodA(CLASS, self, message)) return FALSE;
1173 if (iconwindow_BackFill_Active)
1175 data->iwd_BackFillInfo =(struct BackFillInfo *) DoMethod(self, MUIM_IconWindow_BackFill_Setup);
1176 D(bug("[Wanderer:IconWindow] %s: Window BackFill_Data @ 0x%p for '%s'\n", __PRETTY_FUNCTION__, data->iwd_BackFillInfo, iconwindow_BackFill_Active->bfd_BackFillID));
1179 GET(_app(self), MUIA_Wanderer_Prefs, &prefs);
1181 D(bug("[Wanderer:IconWindow] %s: App PrefsObj @ 0x%p\n", __PRETTY_FUNCTION__, prefs));
1183 if ((prefs) && (data->iwd_ViewSettings_PrefsNotificationObject))
1185 D(bug("[Wanderer:IconWindow] %s: Setting up window prefs change hooks\n", __PRETTY_FUNCTION__));
1187 /* Set-up a hook to call ProcessBackground on prefs notification */
1188 DoMethod
1190 data->iwd_ViewSettings_PrefsNotificationObject, MUIM_Notify, MUIA_Background, MUIV_EveryTime,
1191 (IPTR) self, 3,
1192 MUIM_CallHook, &data->iwd_ProcessBackground_hook, (IPTR)CLASS
1195 if ((data->iwd_Flags & IWDFLAG_ISROOT))
1197 DoMethod
1199 data->iwd_ViewSettings_PrefsNotificationObject, MUIM_Notify, MUIA_IconWindowExt_ImageBackFill_BGRenderMode, MUIV_EveryTime,
1200 (IPTR) self, 3,
1201 MUIM_CallHook, &data->iwd_ProcessBackground_hook, (IPTR)CLASS
1205 DoMethod
1207 data->iwd_ViewSettings_PrefsNotificationObject, MUIM_Notify, MUIA_IconWindowExt_ImageBackFill_BGTileMode, MUIV_EveryTime,
1208 (IPTR) self, 3,
1209 MUIM_CallHook, &data->iwd_ProcessBackground_hook, (IPTR)CLASS
1212 DoMethod
1214 data->iwd_ViewSettings_PrefsNotificationObject, MUIM_Notify, MUIA_IconWindowExt_ImageBackFill_BGXOffset, MUIV_EveryTime,
1215 (IPTR) self, 3,
1216 MUIM_CallHook, &data->iwd_ProcessBackground_hook, (IPTR)CLASS
1219 DoMethod
1221 data->iwd_ViewSettings_PrefsNotificationObject, MUIM_Notify, MUIA_IconWindowExt_ImageBackFill_BGYOffset, MUIV_EveryTime,
1222 (IPTR) self, 3,
1223 MUIM_CallHook, &data->iwd_ProcessBackground_hook, (IPTR)CLASS
1226 /* React to notification on font change */
1227 DoMethod
1229 data->iwd_ViewSettings_PrefsNotificationObject, MUIM_Notify, MUIA_IconWindow_Font, MUIV_EveryTime,
1230 (IPTR) self, 3,
1231 MUIM_Set, MUIA_IconWindow_Font, MUIV_TriggerValue
1236 D(bug("[Wanderer:IconWindow] %s: Setup complete!\n", __PRETTY_FUNCTION__));
1238 return TRUE;
1242 ///IconWindow__MUIM_Window_Cleanup()
1243 IPTR IconWindow__MUIM_Window_Cleanup
1245 Class *CLASS, Object *self, Msg message
1248 SETUP_ICONWINDOW_INST_DATA;
1250 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1252 if (data->iwd_BackFillInfo)
1254 DoMethod(self, MUIM_IconWindow_BackFill_Cleanup, data->iwd_BackFillInfo);
1255 data->iwd_BackFillInfo = NULL;
1258 if (data->iwd_ViewSettings_PrefsNotificationObject)
1260 DoMethod
1262 data->iwd_ViewSettings_PrefsNotificationObject,
1263 MUIM_KillNotifyObj, MUIA_IconWindowExt_ImageBackFill_BGYOffset, (IPTR) self
1266 DoMethod
1268 data->iwd_ViewSettings_PrefsNotificationObject,
1269 MUIM_KillNotifyObj, MUIA_IconWindowExt_ImageBackFill_BGXOffset, (IPTR) self
1272 DoMethod
1274 data->iwd_ViewSettings_PrefsNotificationObject,
1275 MUIM_KillNotifyObj, MUIA_IconWindowExt_ImageBackFill_BGTileMode, (IPTR) self
1278 if ((data->iwd_Flags & IWDFLAG_ISROOT))
1280 DoMethod
1282 data->iwd_ViewSettings_PrefsNotificationObject,
1283 MUIM_KillNotifyObj, MUIA_IconWindowExt_ImageBackFill_BGRenderMode, (IPTR) self
1287 DoMethod
1289 data->iwd_ViewSettings_PrefsNotificationObject,
1290 MUIM_KillNotifyObj, MUIA_Background, (IPTR) self
1293 DoMethod
1295 data->iwd_ViewSettings_PrefsNotificationObject,
1296 MUIM_KillNotifyObj, MUIA_IconWindow_Font, (IPTR) self
1299 return DoSuperMethodA(CLASS, self, message);
1303 ///IconWindow__MUIM_IconWindow_DoubleClicked()
1304 IPTR IconWindow__MUIM_IconWindow_DoubleClicked
1306 Class *CLASS, Object *self, Msg message
1309 SETUP_ICONWINDOW_INST_DATA;
1311 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1313 if (data->iwd_ActionHook)
1315 struct IconWindow_ActionMsg msg;
1316 msg.type = ICONWINDOW_ACTION_OPEN;
1317 msg.iconlist = data->iwd_IconListObj;
1318 msg.isroot = (data->iwd_Flags & IWDFLAG_ISROOT);
1319 msg.click = NULL;
1320 CallHookPkt(data->iwd_ActionHook, self, &msg);
1323 return TRUE;
1327 ///IconWindow__MUIM_IconWindow_Clicked()
1328 IPTR IconWindow__MUIM_IconWindow_Clicked
1330 Class *CLASS, Object *self, Msg message
1333 SETUP_ICONWINDOW_INST_DATA;
1335 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1337 if (data->iwd_ActionHook)
1339 struct IconWindow_ActionMsg msg;
1340 msg.type = ICONWINDOW_ACTION_CLICK;
1341 msg.iconlist = data->iwd_IconListObj;
1342 msg.isroot = (data->iwd_Flags & IWDFLAG_ISROOT);
1343 GET(data->iwd_IconListObj, MUIA_IconList_Clicked, &msg.click);
1344 CallHookPkt(data->iwd_ActionHook, self, &msg);
1347 return TRUE;
1351 ///IconWindow__MUIM_IconWindow_IconsDropped()
1352 IPTR IconWindow__MUIM_IconWindow_IconsDropped
1354 Class *CLASS, Object *self, Msg message
1357 SETUP_ICONWINDOW_INST_DATA;
1359 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1361 if (data->iwd_ActionHook)
1363 struct IconWindow_ActionMsg msg;
1364 msg.type = ICONWINDOW_ACTION_ICONDROP;
1365 msg.iconlist = data->iwd_IconListObj;
1366 msg.isroot = (data->iwd_Flags & IWDFLAG_ISROOT);
1367 GET(data->iwd_IconListObj, MUIA_IconList_IconsDropped, &msg.drop);
1368 if (msg.drop)
1370 NNSET(data->iwd_IconListObj, MUIA_IconList_IconsDropped, NULL);
1371 CallHookPkt(data->iwd_ActionHook, self, &msg);
1375 return TRUE;
1379 ///IconWindow__MUIM_IconWindow_AppWindowDrop()
1380 IPTR IconWindow__MUIM_IconWindow_AppWindowDrop
1382 Class *CLASS, Object *self, Msg message
1385 SETUP_ICONWINDOW_INST_DATA;
1387 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1389 if (data->iwd_ActionHook)
1391 struct IconWindow_ActionMsg msg;
1392 msg.type = ICONWINDOW_ACTION_APPWINDOWDROP;
1393 msg.iconlist = data->iwd_IconListObj;
1394 msg.isroot = (data->iwd_Flags & IWDFLAG_ISROOT);
1395 GET(data->iwd_IconListObj, MUIA_IconList_IconsDropped, &msg.drop);
1396 CallHookPkt(data->iwd_ActionHook, self, &msg);
1399 return TRUE;
1403 ///IconWindow__MUIM_IconWindow_Open()
1404 IPTR IconWindow__MUIM_IconWindow_Open
1406 Class *CLASS, Object *self, Msg message
1409 // SETUP_ICONWINDOW_INST_DATA;
1411 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1413 if (!XGET(self, MUIA_Window_Open))
1415 SET(self, MUIA_Window_Open, TRUE);
1418 D(bug("[Wanderer:IconWindow] %s: Setting window as active ..\n", __PRETTY_FUNCTION__));
1419 SET(self, MUIA_Window_Activate, TRUE);
1421 D(bug("[Wanderer:IconWindow] %s: All done\n", __PRETTY_FUNCTION__));
1423 return TRUE;
1427 ///IconWindow__MUIM_IconWindow_DirectoryUp()
1428 IPTR IconWindow__MUIM_IconWindow_DirectoryUp
1430 Class *CLASS, Object *self, Msg message
1433 SETUP_ICONWINDOW_INST_DATA;
1435 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1437 if (data->iwd_ActionHook)
1439 struct IconWindow_ActionMsg msg;
1440 msg.type = ICONWINDOW_ACTION_DIRUP;
1441 msg.iconlist = data->iwd_IconListObj;
1442 msg.isroot = (data->iwd_Flags & IWDFLAG_ISROOT);
1443 msg.click = NULL;
1444 CallHookPkt(data->iwd_ActionHook, self, &msg);
1448 return TRUE;
1452 ///IconWindow__MUIM_IconWindow_UnselectAll()
1453 IPTR IconWindow__MUIM_IconWindow_UnselectAll
1455 Class *CLASS, Object *self, Msg message
1458 SETUP_ICONWINDOW_INST_DATA;
1460 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1462 DoMethod(data->iwd_IconListObj, MUIM_IconList_UnselectAll);
1464 return TRUE;
1468 ///IconWindow__MUIM_IconWindow_Remove()
1469 IPTR IconWindow__MUIM_IconWindow_Remove
1471 Class *CLASS, Object *self, Msg message
1474 // SETUP_ICONWINDOW_INST_DATA;
1476 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1478 // Remove window
1479 SET( self, MUIA_Window_Open, FALSE );
1480 DoMethod ( _app(self), OM_REMMEMBER, self );
1481 DisposeObject(self);
1483 return TRUE;
1487 /*** Stubs for Backfill Hooks ******************************************************************/
1488 ///IconWindow__MUIM_IconWindow_BackFill_Register()
1489 IPTR IconWindow__MUIM_IconWindow_BackFill_Register
1491 Class *CLASS, Object *self, struct MUIP_IconWindow_BackFill_Register *message
1494 // SETUP_ICONWINDOW_INST_DATA;
1496 D(bug("[Wanderer:IconWindow]: %s('%s')\n", __PRETTY_FUNCTION__, message->register_Node->bfd_BackFillID));
1498 AddTail(&iconwindow_BackFillNodes, (struct Node *)message->register_Node);
1499 if (iconwindow_BackFill_Active == NULL) iconwindow_BackFill_Active = message->register_Node;
1501 return TRUE;
1505 ///IconWindow__MUIM_IconWindow_BackFill_Setup()
1506 IPTR IconWindow__MUIM_IconWindow_BackFill_Setup
1508 Class *CLASS, Object *self, struct MUIP_IconWindow_BackFill_Setup *message
1511 // SETUP_ICONWINDOW_INST_DATA;
1513 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1515 if (iconwindow_BackFill_Active == NULL) return FALSE;
1517 return (iconwindow_BackFill_Active->bfd_MUIM_IconWindow_BackFill_Setup)(CLASS, self, message);
1521 ///IconWindow__MUIM_IconWindow_BackFill_Cleanup()
1522 IPTR IconWindow__MUIM_IconWindow_BackFill_Cleanup
1524 Class *CLASS, Object *self, struct MUIP_IconWindow_BackFill_Cleanup *message
1527 //SETUP_ICONWINDOW_INST_DATA;
1529 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1531 if (iconwindow_BackFill_Active == NULL) return FALSE;
1533 return (iconwindow_BackFill_Active->bfd_MUIM_IconWindow_BackFill_Cleanup)(CLASS, self, message);
1537 ///IconWindow__MUIM_IconWindow_BackFill_ProcessBackground()
1538 IPTR IconWindow__MUIM_IconWindow_BackFill_ProcessBackground
1540 Class *CLASS, Object *self, struct MUIP_IconWindow_BackFill_ProcessBackground *message
1543 SETUP_ICONWINDOW_INST_DATA;
1545 IPTR retVal = (IPTR)FALSE;
1547 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1549 if (iconwindow_BackFill_Active != NULL)
1551 D(bug("[Wanderer:IconWindow] %s: Asking module @ 0x%p to process ..\n", __PRETTY_FUNCTION__, iconwindow_BackFill_Active));
1552 retVal = (iconwindow_BackFill_Active->bfd_MUIM_IconWindow_BackFill_ProcessBackground)(CLASS, self, message);
1555 if (!retVal && (data->iwd_RootViewObj != NULL))
1557 Object *IconWindowPB_PrefsObj = NULL;
1559 D(bug("[Wanderer:IconWindow] %s: No BackFill module/ module cant render mode\n", __PRETTY_FUNCTION__));
1560 D(bug("[Wanderer:IconWindow] %s: Using default MUI functions ..\n", __PRETTY_FUNCTION__));
1562 GET(_app(self), MUIA_Wanderer_Prefs, &IconWindowPB_PrefsObj);
1563 if (IconWindowPB_PrefsObj)
1565 IPTR IconWindowPB_Background = 0;
1566 IPTR IconWindowPB_BGMode = 0;
1567 IPTR IconWindowPB_BGTileMode = 0;
1569 if ((IconWindowPB_Background = DoMethod(IconWindowPB_PrefsObj, MUIM_WandererPrefs_ViewSettings_GetAttribute, data->iwd_ViewSettings_Attrib, MUIA_Background)) != -1)
1571 char *bgmode_string;
1572 BYTE this_mode;
1574 if ((IconWindowPB_BGMode = DoMethod(IconWindowPB_PrefsObj, MUIM_WandererPrefs_ViewSettings_GetAttribute,
1575 data->iwd_ViewSettings_Attrib, MUIA_IconWindowExt_ImageBackFill_BGRenderMode)) == -1)
1576 IconWindowPB_BGMode = IconWindowExt_ImageBackFill_RenderMode_Tiled;
1578 if ((IconWindowPB_BGTileMode = DoMethod(IconWindowPB_PrefsObj, MUIM_WandererPrefs_ViewSettings_GetAttribute,
1579 data->iwd_ViewSettings_Attrib, MUIA_IconWindowExt_ImageBackFill_BGTileMode)) == -1)
1580 IconWindowPB_BGTileMode = IconWindowExt_ImageBackFill_TileMode_Float;
1582 SET(data->iwd_RootViewObj, MUIA_Background, IconWindowPB_Background);
1584 bgmode_string =(STRPTR) IconWindowPB_Background;
1585 this_mode = bgmode_string[0] - 48;
1587 D(bug("[Wanderer:IconWindow] %s: MUI BG Mode = %d\n", __PRETTY_FUNCTION__, this_mode));
1589 switch (this_mode)
1591 case 5:
1592 //Image =D
1593 if (IconWindowPB_BGMode == IconWindowExt_ImageBackFill_RenderMode_Scale)
1595 SET(data->iwd_RootViewObj, MUIA_IconListview_ScaledBackground, TRUE);
1596 break;
1598 else
1599 SET(data->iwd_RootViewObj, MUIA_IconListview_ScaledBackground, FALSE);
1601 case 0:
1602 //MUI Pattern
1603 if (IconWindowPB_BGTileMode == IconWindowExt_ImageBackFill_TileMode_Fixed)
1604 SET(data->iwd_RootViewObj, MUIA_IconListview_FixedBackground, TRUE);
1605 else
1606 SET(data->iwd_RootViewObj, MUIA_IconListview_FixedBackground, FALSE);
1607 break;
1611 retVal = FALSE;
1614 return retVal;
1618 ///IconWindow__MUIM_IconWindow_BackFill_DrawBackground()
1619 IPTR IconWindow__MUIM_IconWindow_BackFill_DrawBackground
1621 Class *CLASS, Object *self, struct MUIP_IconWindow_BackFill_DrawBackground *message
1624 // SETUP_ICONWINDOW_INST_DATA;
1626 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1628 if (iconwindow_BackFill_Active == NULL) return FALSE;
1630 return (iconwindow_BackFill_Active->bfd_MUIM_IconWindow_BackFill_DrawBackground)(CLASS, self, message);
1634 ///IconWindow__MUIM_IconWindow_RateLimitRefresh()
1635 IPTR IconWindow__MUIM_IconWindow_RateLimitRefresh
1637 Class *CLASS, Object *self, Msg message
1640 Object * iconList = NULL;
1642 GET(self, MUIA_IconWindow_IconList, &iconList);
1644 if (iconList != NULL)
1645 return DoMethod(iconList, MUIM_IconWindowIconList_RateLimitRefresh);
1647 return (IPTR)FALSE;
1651 ///IconWindow__MUIM_IconWindow_Snapshot()
1652 IPTR IconWindow__MUIM_IconWindow_Snapshot
1654 Class *CLASS, Object *self, struct MUIP_IconWindow_Snapshot * message
1657 Object *iconList = (Object *) XGET(self, MUIA_IconWindow_IconList);
1659 D(bug("[Wanderer:IconWindow]: %s('%s')\n", __PRETTY_FUNCTION__, dir_name));
1661 if (message->snapshotall == TRUE)
1663 struct IconList_Entry *icon_entry = (IPTR)MUIV_IconList_NextIcon_Start;
1664 struct IconEntry *node = NULL;
1665 struct TagItem icon_tags[] =
1667 { ICONPUTA_OnlyUpdatePosition, TRUE },
1668 { TAG_DONE, 0 }
1670 D(bug("[Wanderer:IconWindow] %s: snapshot ALL\n", __PRETTY_FUNCTION__));
1674 DoMethod(iconList, MUIM_IconList_NextIcon, MUIV_IconList_NextIcon_Visible, (IPTR)&icon_entry);
1676 if ((IPTR)icon_entry != MUIV_IconList_NextIcon_End)
1678 node = (struct IconEntry *)((IPTR)icon_entry - ((IPTR)&node->ie_IconListEntry - (IPTR)node));
1679 if (node->ie_Flags & ICONENTRY_FLAG_HASICON)
1681 /* Snapshot-all should only save positions of objects that already have icons.
1682 * This is by design and how 3.1 Workbench works. In order to snapshot all objects in window
1683 * regardless if they have icons or not: 1) make all objects visible, 2) select all objects,
1684 * 3) select icon->snapshot */
1685 D(bug("[Wanderer:IconWindow] %s: SNAPSHOT entry = '%s' @ %p, (%p)\n", __PRETTY_FUNCTION__,
1686 icon_entry->ile_IconEntry->ie_IconNode.ln_Name, icon_entry, node));
1687 if (node->ie_DiskObj)
1689 node->ie_DiskObj->do_CurrentX = node->ie_IconX;
1690 node->ie_DiskObj->do_CurrentY = node->ie_IconY;
1691 PutIconTagList(icon_entry->ile_IconEntry->ie_IconNode.ln_Name, node->ie_DiskObj, icon_tags);
1693 else
1695 D(bug("[[Wanderer:IconWindow] %s: icon has no diskobj!\n", __PRETTY_FUNCTION__));
1699 else
1701 break;
1703 } while (TRUE);
1705 else
1707 D(bug("[Wanderer:IconWindow] %s: snapshot WINDOW\n", __PRETTY_FUNCTION__));
1710 IconWindow_StoreSettings(self);
1712 return (IPTR)TRUE;
1717 IPTR IconWindow__SetupClass()
1719 D(bug("[Wanderer:IconWindow]: %s()\n", __PRETTY_FUNCTION__));
1721 NewList(&iconwindow_BackFillNodes);
1722 D(bug("[Wanderer:IconWindow] %s: iconwindow_BackFillNodes @ %p\n", __PRETTY_FUNCTION__, &iconwindow_BackFillNodes));
1723 NewList(&iconwindow_Extensions);
1724 D(bug("[Wanderer:IconWindow] %s: iconwindow_Extensions @ %p\n", __PRETTY_FUNCTION__, &iconwindow_Extensions));
1725 iconwindow_BackFill_Active = NULL;
1727 return TRUE;
1730 /*** Setup ******************************************************************/
1731 ICONWINDOW_CUSTOMCLASS
1733 IconWindow, NULL, MUIC_Window, NULL,
1734 OM_NEW, struct opSet *,
1735 OM_DISPOSE, Msg,
1736 OM_SET, struct opSet *,
1737 OM_GET, struct opGet *,
1738 MUIM_Window_Setup, Msg,
1739 MUIM_Window_Cleanup, Msg,
1740 MUIM_IconWindow_Open, Msg,
1741 MUIM_IconWindow_UnselectAll, Msg,
1742 MUIM_IconWindow_DoubleClicked, Msg,
1743 MUIM_IconWindow_IconsDropped, Msg,
1744 MUIM_IconWindow_Clicked, Msg,
1745 MUIM_IconWindow_DirectoryUp, Msg,
1746 MUIM_IconWindow_AppWindowDrop, Msg,
1747 MUIM_IconWindow_Remove, Msg,
1748 MUIM_IconWindow_RateLimitRefresh, Msg,
1749 MUIM_IconWindow_Snapshot, struct MUIP_IconWindow_Snapshot *,
1750 MUIM_IconWindow_BackFill_Register, struct MUIP_IconWindow_BackFill_Register *,
1751 MUIM_IconWindow_BackFill_Setup, struct MUIP_IconWindow_BackFill_Setup *,
1752 MUIM_IconWindow_BackFill_Cleanup, struct MUIP_IconWindow_BackFill_Cleanup *,
1753 MUIM_IconWindow_BackFill_ProcessBackground, struct MUIP_IconWindow_BackFill_ProcessBackground *,
1754 MUIM_IconWindow_BackFill_DrawBackground, struct MUIP_IconWindow_BackFill_DrawBackground *
1757 ADD2INIT(IconWindow__SetupClass, 0);
1759 #ifndef __AROS__
1760 int initIconWindowClass(void)
1762 IPTR ret1 = IconWindow_Initialize();
1764 IPTR ret2 = IconWindow__SetupClass();
1766 IPTR ret3 = ImageBackFill__SetupClass();
1768 if (ret1 && ret2 && ret3)
1769 return TRUE;
1770 else
1771 return FALSE;
1774 #endif