2 Copyright 2004-2009, The AROS Development Team. All rights reserved.
8 #include "portable_macros.h"
11 #define MUIMASTER_YES_INLINE_STDARG
14 //#define DEBUG_NETWORKBROWSER
15 //#define DEBUG_SHOWUSERFILES
16 #define TXTBUFF_LEN 1024
20 #include <aros/debug.h>
23 #include <exec/types.h>
24 #include <libraries/mui.h>
27 #include <zune/customclasses.h>
29 #include <zune_AROS/customclasses.h>
33 #include <proto/utility.h>
35 #include <proto/graphics.h>
36 #include <proto/exec.h>
37 #include <proto/datatypes.h>
38 #include <proto/icon.h>
41 #include <proto/dos.h>
46 #include <intuition/screens.h>
47 #include <datatypes/pictureclass.h>
48 #include <clib/macros.h>
50 #if defined(__AMIGA__) && !defined(__PPC__)
51 #define NO_INLINE_STDARG
53 #ifndef _PROTO_INTUITION_H
54 #include <proto/intuition.h>
56 #include <proto/muimaster.h>
58 #include "Classes/iconlist.h"
59 #include "Classes/iconlist_attributes.h"
60 #include "Classes/icon_attributes.h"
63 #include "wandererprefs.h"
64 #include "iconwindow.h"
65 #include "iconwindow_iconlist.h"
72 #define D(x) if (DEBUG) x
74 #define bug DebugPrintF
83 extern struct IconWindow_BackFill_Descriptor
*iconwindow_BackFill_Active
;
88 #define BG_DRAWFLAG 0xf00dd00f
90 /*** Instance Data **********************************************************/
92 struct IconWindowVolumeList_DATA
94 Object
*iwcd_IconWindow
;
95 struct RastPort
*iwcd_RastPort
;
96 struct MUI_EventHandlerNode iwcd_EventHandlerNode
;
98 struct Hook iwcd_ProcessIconListPrefs_hook
;
100 struct Hook
*iwcd_ProcessIconListPrefs_hook
;
103 IPTR iwcd_ViewPrefs_ID
;
104 Object
*iwcd_ViewPrefs_NotificationObject
;
106 struct Hook iwvcd_UpdateNetworkPrefs_hook
;
108 struct Hook
*iwvcd_UpdateNetworkPrefs_hook
;
111 IPTR iwvcd_ShowNetworkBrowser
;
112 IPTR iwvcd_ShowUserFolder
;
113 char *iwvcd_UserFolderPath
;
116 static char __icwc_intern_TxtBuff
[TXTBUFF_LEN
];
118 /*** Macros *****************************************************************/
119 #define SETUP_INST_DATA struct IconWindowVolumeList_DATA *data = INST_DATA(CLASS, self)
121 /*** Hook functions *********************************************************/
122 ///IconWindowVolumeList__HookFunc_ProcessIconListPrefsFunc()
125 void, IconWindowVolumeList__HookFunc_ProcessIconListPrefsFunc
,
126 AROS_UFHA(struct Hook
*, hook
, A0
),
127 AROS_UFHA(APTR
*, obj
, A2
),
128 AROS_UFHA(IPTR
*, param
, A1
)
132 HOOKPROTO(IconWindowVolumeList__HookFunc_ProcessIconListPrefsFunc
, void, APTR
*obj
, IPTR
*param
)
137 /* Get our private data */
138 Object
*self
= ( Object
*)obj
;
139 IPTR CHANGED_ATTRIB
= *param
;
140 Class
*CLASS
= OCLASS(self
);
144 Object
*prefs
= NULL
;
146 D(bug("[Wanderer:VolumeList]: %s()\n", __PRETTY_FUNCTION__
));
148 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
152 IPTR attrib_Current
, attrib_Prefs
, prefs_Processing
= 0;
153 BOOL options_changed
= FALSE
;
155 D(bug("[Wanderer:VolumeList] %s: Setting IconList options ..\n", __PRETTY_FUNCTION__
));
157 GET(prefs
, MUIA_WandererPrefs_Processing
, &prefs_Processing
);
159 switch (CHANGED_ATTRIB
)
161 case MUIA_IconList_IconListMode
:
162 GET(self
, MUIA_IconList_IconListMode
, &attrib_Current
);
164 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_IconListMode
)) != -1) &&
165 (attrib_Current
!= attrib_Prefs
))
167 D(bug("[Wanderer:VolumeList] %s: IconList ListMode changed - updating ..\n", __PRETTY_FUNCTION__
));
168 options_changed
= TRUE
;
169 if (prefs_Processing
)
171 NNSET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
175 SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
180 case MUIA_IconList_LabelText_Mode
:
181 GET(self
, MUIA_IconList_LabelText_Mode
, &attrib_Current
);
183 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
)) != -1) &&
184 (attrib_Current
!= attrib_Prefs
))
186 D(bug("[Wanderer:VolumeList] %s: IconList TextRenderMode changed - updating ..\n", __PRETTY_FUNCTION__
));
187 options_changed
= TRUE
;
188 if (prefs_Processing
)
190 NNSET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
194 SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
199 case MUIA_IconList_LabelText_MaxLineLen
:
200 GET(self
, MUIA_IconList_LabelText_MaxLineLen
, &attrib_Current
);
202 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
)) != -1) &&
203 (attrib_Current
!= attrib_Prefs
))
205 D(bug("[Wanderer:VolumeList] %s: IconList Max Text Length changed - updating ..\n", __PRETTY_FUNCTION__
));
206 options_changed
= TRUE
;
207 if (prefs_Processing
)
209 NNSET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
213 SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
218 case MUIA_IconList_LabelText_MultiLine
:
219 GET(self
, MUIA_IconList_LabelText_MultiLine
, &attrib_Current
);
221 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
)) != -1) &&
222 (attrib_Current
!= attrib_Prefs
))
224 D(bug("[Wanderer:VolumeList] %s: IconList Multi-Line changed - updating ..\n", __PRETTY_FUNCTION__
));
225 options_changed
= TRUE
;
226 if (prefs_Processing
)
228 NNSET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
232 SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
237 case MUIA_IconList_LabelText_MultiLineOnFocus
:
238 GET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, &attrib_Current
);
240 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
)) != -1) &&
241 (attrib_Current
!= attrib_Prefs
))
243 D(bug("[Wanderer:VolumeList] %s: Multi-Line on Focus changed - updating ..\n", __PRETTY_FUNCTION__
));
244 options_changed
= TRUE
;
245 if (prefs_Processing
)
247 NNSET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
251 SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
256 case MUIA_IconList_Icon_HorizontalSpacing
:
257 GET(self
, MUIA_IconList_Icon_HorizontalSpacing
, &attrib_Current
);
259 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
)) != -1) &&
260 (attrib_Current
!= attrib_Prefs
))
262 D(bug("[Wanderer:VolumeList] %s: Icon Horizontal Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
263 options_changed
= TRUE
;
264 if (prefs_Processing
)
266 NNSET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
270 SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
275 case MUIA_IconList_Icon_VerticalSpacing
:
276 GET(self
, MUIA_IconList_Icon_VerticalSpacing
, &attrib_Current
);
278 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
)) != -1) &&
279 (attrib_Current
!= attrib_Prefs
))
281 D(bug("[Wanderer:VolumeList] %s: Icon Vertical Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
282 options_changed
= TRUE
;
283 if (prefs_Processing
)
285 NNSET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
289 SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
294 case MUIA_IconList_Icon_ImageSpacing
:
295 GET(self
, MUIA_IconList_Icon_ImageSpacing
, &attrib_Current
);
297 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
)) != -1) &&
298 (attrib_Current
!= attrib_Prefs
))
300 D(bug("[Wanderer:VolumeList] %s: Icon Label Image Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
301 options_changed
= TRUE
;
302 if (prefs_Processing
)
304 NNSET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
308 SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
313 case MUIA_IconList_LabelText_HorizontalPadding
:
314 GET(self
, MUIA_IconList_LabelText_HorizontalPadding
, &attrib_Current
);
316 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
)) != -1) &&
317 (attrib_Current
!= attrib_Prefs
))
319 D(bug("[Wanderer:VolumeList] %s: Icon Label Horizontal Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
320 options_changed
= TRUE
;
321 if (prefs_Processing
)
323 NNSET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
327 SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
332 case MUIA_IconList_LabelText_VerticalPadding
:
333 GET(self
, MUIA_IconList_LabelText_VerticalPadding
, &attrib_Current
);
335 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
)) != -1) &&
336 (attrib_Current
!= attrib_Prefs
))
338 D(bug("[Wanderer:VolumeList] %s: Icon Label Vertical Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
339 options_changed
= TRUE
;
340 if (prefs_Processing
)
342 NNSET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
346 SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
351 case MUIA_IconList_LabelText_BorderWidth
:
352 GET(self
, MUIA_IconList_LabelText_BorderWidth
, &attrib_Current
);
354 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
)) != -1) &&
355 (attrib_Current
!= attrib_Prefs
))
357 D(bug("[Wanderer:VolumeList] %s: Icon Label Border Width changed - updating ..\n", __PRETTY_FUNCTION__
));
358 options_changed
= TRUE
;
359 if (prefs_Processing
)
361 NNSET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
365 SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
370 case MUIA_IconList_LabelText_BorderHeight
:
371 GET(self
, MUIA_IconList_LabelText_BorderHeight
, &attrib_Current
);
373 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
)) != -1) &&
374 (attrib_Current
!= attrib_Prefs
))
376 D(bug("[Wanderer:VolumeList] %s: Icon Label Border Height changed - updating ..\n", __PRETTY_FUNCTION__
));
377 options_changed
= TRUE
;
378 if (prefs_Processing
)
380 NNSET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
384 SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
390 D(bug("[Wanderer:VolumeList] %s: Unhandled change\n", __PRETTY_FUNCTION__
));
396 if (!(prefs_Processing
))
398 D(bug("[Wanderer:VolumeList] %s: IconList Options have changed, causing an update ..\n", __PRETTY_FUNCTION__
));
399 DoMethod(self
, MUIM_IconList_Update
);
401 else if (data
->iwcd_IconWindow
)
403 SET(data
->iwcd_IconWindow
, MUIA_IconWindow_Changed
, TRUE
);
410 MakeStaticHook(Hook_ProcessIconListPrefsFunc
,IconWindowVolumeList__HookFunc_ProcessIconListPrefsFunc
);
414 ///IconWindowVolumeList__HookFunc_UpdateNetworkPrefsFunc()
417 void, IconWindowVolumeList__HookFunc_UpdateNetworkPrefsFunc
,
418 AROS_UFHA(struct Hook
*, hook
, A0
),
419 AROS_UFHA(APTR
*, obj
, A2
),
420 AROS_UFHA(APTR
, param
, A1
)
424 HOOKPROTO(IconWindowVolumeList__HookFunc_UpdateNetworkPrefsFunc
, void, APTR
*obj
, APTR param
)
429 /* Get our private data */
430 Object
*self
= ( Object
*)obj
;
431 Object
*prefs
= NULL
;
432 Class
*CLASS
= *( Class
**)param
;
436 D(bug("[Wanderer:VolumeList]: %s()\n", __PRETTY_FUNCTION__
));
438 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
442 BOOL options_changed
= FALSE
;
443 IPTR prefs_Processing
= 0;
445 GET(prefs
, MUIA_WandererPrefs_Processing
, &prefs_Processing
);
447 IPTR current_ShowNetwork
= 0;
448 IPTR prefs_ShowNetwork
= 0;
450 D(bug("[Wanderer:VolumeList] %s: Setting ROOT view Network options ..\n", __PRETTY_FUNCTION__
));
452 GET(self
, MUIA_IconWindowExt_NetworkBrowser_Show
, ¤t_ShowNetwork
);
454 D(bug("[Wanderer:VolumeList] %s: Current = %d\n", __PRETTY_FUNCTION__
, current_ShowNetwork
));
456 GET(prefs
, MUIA_IconWindowExt_NetworkBrowser_Show
, &prefs_ShowNetwork
);
458 D(bug("[Wanderer:VolumeList] %s: Prefs = %d\n", __PRETTY_FUNCTION__
, prefs_ShowNetwork
));
460 if ((BOOL
)current_ShowNetwork
!= (BOOL
)prefs_ShowNetwork
)
462 D(bug("[Wanderer:VolumeList] %s: ROOT view Network prefs changed - updating ..\n", __PRETTY_FUNCTION__
));
463 options_changed
= TRUE
;
464 ((struct IconWindowVolumeList_DATA
*)data
)->iwvcd_ShowNetworkBrowser
= prefs_ShowNetwork
;
466 if ((options_changed
) && !(prefs_Processing
))
468 D(bug("[Wanderer:VolumeList] %s: Network prefs changed, causing an update ..\n", __PRETTY_FUNCTION__
));
469 DoMethod(self
, MUIM_IconList_Update
);
471 else if (data
->iwcd_IconWindow
)
473 SET(data
->iwcd_IconWindow
, MUIA_IconWindow_Changed
, TRUE
);
479 MakeStaticHook(Hook_UpdateNetworkPrefsFunc
,IconWindowVolumeList__HookFunc_UpdateNetworkPrefsFunc
);
482 #define BDRPLINELEN_MAX 1024
483 BOOL
IconWindowVolumeList__Func_ParseBackdrop(Class
*CLASS
, Object
*self
, char *bdrp_dir
)
485 BPTR bdrp_lock
= (BPTR
)NULL
;
486 char *bdrp_file
= NULL
, *linebuf
= NULL
, *bdrp_fullfile
= NULL
, *bdrp_namepart
= NULL
;
487 struct DiskObject
*bdrp_currfile_dob
= NULL
;
490 if ((bdrp_dir
== NULL
) || (bdrp_dir
[strlen(bdrp_dir
) - 1] != ':'))
493 D(bug("[Wanderer:VolumeList] %s: Checking '%s' for .backdrop file .. \n", __PRETTY_FUNCTION__
, bdrp_dir
));
495 if ((bdrp_file
= AllocVec(strlen(bdrp_dir
) + 9 + 1, MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
497 sprintf(bdrp_file
, "%s.backdrop", bdrp_dir
);
498 if ((bdrp_lock
= Open(bdrp_file
, MODE_OLDFILE
)))
500 D(bug("[Wanderer:VolumeList] %s: Loading backdrop file: '%s'\n", __PRETTY_FUNCTION__
, bdrp_file
));
502 if ((linebuf
= AllocMem(BDRPLINELEN_MAX
, MEMF_PUBLIC
)) != NULL
)
504 while (FGets(bdrp_lock
, linebuf
, BDRPLINELEN_MAX
))
510 linelen
= strlen(linebuf
) - 1; /* drop the newline char */
511 linebuf
[linelen
] = '\0';
513 if ((bdrp_fullfile
= AllocVec(linelen
+ strlen(bdrp_dir
), MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
515 sprintf(bdrp_fullfile
, "%s%s", bdrp_dir
, &linebuf
[1]);
516 bdrp_namepart
= FilePart(bdrp_fullfile
);
517 bdrp_currfile_dob
= GetIconTags
520 ICONGETA_FailIfUnavailable
, FALSE
,
521 ICONGETA_Label
, bdrp_namepart
,
525 D(bug("[Wanderer:VolumeList] %s: LEAVEOUT Icon '%s' ('%s') DOB @ 0x%p\n", __PRETTY_FUNCTION__
, bdrp_fullfile
, bdrp_namepart
, bdrp_currfile_dob
));
527 if (bdrp_currfile_dob
)
529 struct IconEntry
*this_entry
= NULL
;
530 if ((this_entry
= (struct IconEntry
*)DoMethod(self
, MUIM_IconList_CreateEntry
, (IPTR
)bdrp_fullfile
, (IPTR
)bdrp_namepart
, (IPTR
)NULL
, (IPTR
)bdrp_currfile_dob
, 0)))
532 struct FileInfoBlock
*fib
= AllocDosObject(DOS_FIB
, NULL
);
535 BPTR fib_lock
= (BPTR
)NULL
;
536 if ((fib_lock
= Lock(bdrp_fullfile
, SHARED_LOCK
)) != NULL
)
538 if (Examine(fib_lock
, fib
))
540 if (fib
->fib_DirEntryType
== ST_FILE
)
542 this_entry
->ie_IconListEntry
.type
= ST_LINKFILE
;
543 D(bug("[Wanderer:VolumeList] %s: LEAVEOUT ST_LINKFILE Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
545 else if (fib
->fib_DirEntryType
== ST_USERDIR
)
547 this_entry
->ie_IconListEntry
.type
= ST_LINKDIR
;
548 D(bug("[Wanderer:VolumeList] %s: LEAVEOUT ST_LINKDIR Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
552 D(bug("[Wanderer:VolumeList] %s: LEAVEOUT Unknown Entry Type @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
557 FreeDosObject(DOS_FIB
, fib
);
564 FreeMem(linebuf
, BDRPLINELEN_MAX
);
574 /*** Methods ****************************************************************/
576 Object
*IconWindowVolumeList__OM_NEW(Class
*CLASS
, Object
*self
, struct opSet
*message
)
578 IPTR _newIconList__FSNotifyPort
= 0;
580 D(bug("[Wanderer:VolumeList]: %s()\n", __PRETTY_FUNCTION__
));
582 _newIconList__FSNotifyPort
= GetTagData(MUIA_Wanderer_FileSysNotifyPort
, (IPTR
) NULL
, message
->ops_AttrList
);
584 self
= (Object
*) DoSuperNewTags
588 TAG_MORE
, (IPTR
) message
->ops_AttrList
594 D(bug("[Wanderer:VolumeList] %s: SELF = 0x%p\n", __PRETTY_FUNCTION__
, self
));
597 data
->iwcd_ProcessIconListPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowVolumeList__HookFunc_ProcessIconListPrefsFunc
;
599 data
->iwcd_ProcessIconListPrefs_hook
= &Hook_ProcessIconListPrefsFunc
;
608 IPTR
IconWindowVolumeList__OM_SET(Class
*CLASS
, Object
*self
, struct opSet
*message
)
612 struct TagItem
*tstate
= message
->ops_AttrList
, *tag
;
614 while ((tag
= NextTagItem((const struct TagItem
**)&tstate
)) != NULL
)
618 case MUIA_Background
:
620 D(bug("[Wanderer:VolumeList] %s: MUIA_Background\n", __PRETTY_FUNCTION__
));
623 case MUIA_IconWindow_Window
:
625 D(bug("[Wanderer:VolumeList] %s: MUIA_IconWindow_Window @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
626 data
->iwcd_IconWindow
= (Object
*)tag
->ti_Data
;
629 case MUIA_IconList_BufferRastport
:
631 D(bug("[Wanderer:VolumeList] %s: MUIA_IconList_BufferRastport @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
632 data
->iwcd_RastPort
= (struct RastPort
*)tag
->ti_Data
;
637 return DoSuperMethodA(CLASS
, self
, (Msg
) message
);
642 IPTR
IconWindowVolumeList__OM_GET(Class
*CLASS
, Object
*self
, struct opGet
*message
)
645 IPTR
*store
= message
->opg_Storage
;
648 switch (message
->opg_AttrID
)
651 *store
= (IPTR
)WIWVLVERS
;
655 *store
= (IPTR
)WIWVLREV
;
659 rv
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
666 ///IconWindowVolumeList__MUIM_Setup()
667 IPTR IconWindowVolumeList__MUIM_Setup
669 Class
*CLASS
, Object
*self
, Msg message
674 Object
*prefs
= NULL
;
676 if (!DoSuperMethodA(CLASS
, self
, message
)) return FALSE
;
678 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
682 /* Set our initial options */
685 GET(_win(self
), MUIA_IconWindow_BackgroundAttrib
, &data
->iwcd_ViewPrefs_ID
);
686 D(bug("[Wanderer:VolumeList] %s: Window Background = '%s'\n", __PRETTY_FUNCTION__
, data
->iwcd_ViewPrefs_ID
));
687 data
->iwcd_ViewPrefs_NotificationObject
= (Object
*)DoMethod(prefs
,
688 MUIM_WandererPrefs_ViewSettings_GetNotifyObject
,
689 data
->iwcd_ViewPrefs_ID
);
691 D(bug("[Wanderer:VolumeList] %s: Background Notification Obj @ 0x%p\n", __PRETTY_FUNCTION__
, data
->iwcd_ViewPrefs_NotificationObject
));
693 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_IconListMode
);
694 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_IconListMode
))) SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
696 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
);
697 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_Mode
))) SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
699 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
);
700 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MaxLineLen
))) SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
702 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
);
703 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLine
))) SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
705 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
);
706 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
))) SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
708 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
);
709 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_HorizontalSpacing
))) SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
711 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
);
712 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_VerticalSpacing
))) SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
714 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
);
715 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_ImageSpacing
))) SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
717 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
);
718 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_HorizontalPadding
))) SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
720 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
);
721 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_VerticalPadding
))) SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
723 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
);
724 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderWidth
))) SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
726 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
);
727 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderHeight
))) SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
729 /* Configure notifications incase they get updated =) */
732 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_IconListMode
, MUIV_EveryTime
,
734 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_IconListMode
739 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_Mode
, MUIV_EveryTime
,
741 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_Mode
746 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MaxLineLen
, MUIV_EveryTime
,
748 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MaxLineLen
753 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLine
, MUIV_EveryTime
,
755 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLine
760 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLineOnFocus
, MUIV_EveryTime
,
762 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLineOnFocus
767 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_HorizontalSpacing
, MUIV_EveryTime
,
769 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_HorizontalSpacing
774 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_VerticalSpacing
, MUIV_EveryTime
,
776 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_VerticalSpacing
781 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_ImageSpacing
, MUIV_EveryTime
,
783 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_ImageSpacing
788 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_HorizontalPadding
, MUIV_EveryTime
,
790 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_HorizontalPadding
795 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_VerticalPadding
, MUIV_EveryTime
,
797 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_VerticalPadding
802 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderWidth
, MUIV_EveryTime
,
804 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderWidth
809 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderHeight
, MUIV_EveryTime
,
811 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderHeight
818 ((struct IconWindowVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowVolumeList__HookFunc_UpdateNetworkPrefsFunc
;
820 ((struct IconWindowVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
= &Hook_UpdateNetworkPrefsFunc
;
825 prefs
, MUIM_Notify
, MUIA_IconWindowExt_NetworkBrowser_Show
, MUIV_EveryTime
,
827 MUIM_CallHook
, &((struct IconWindowVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
, (IPTR
)CLASS
831 if (muiRenderInfo(self
))
833 D(bug("[Wanderer:VolumeList] %s: Setting up EventHandler for (IDCMP_DISKINSERTED | IDCMP_DISKREMOVED)\n", __PRETTY_FUNCTION__
));
835 data
->iwcd_EventHandlerNode
.ehn_Priority
= 1;
836 data
->iwcd_EventHandlerNode
.ehn_Flags
= MUI_EHF_GUIMODE
;
837 data
->iwcd_EventHandlerNode
.ehn_Object
= self
;
838 data
->iwcd_EventHandlerNode
.ehn_Class
= CLASS
;
839 data
->iwcd_EventHandlerNode
.ehn_Events
= IDCMP_DISKINSERTED
| IDCMP_DISKREMOVED
;
841 DoMethod(_win(self
), MUIM_Window_AddEventHandler
, &data
->iwcd_EventHandlerNode
);
845 D(bug("[Wanderer:VolumeList] %s: Couldnt add IDCMP EventHandler!\n", __PRETTY_FUNCTION__
));
848 D(bug("[Wanderer:VolumeList] %s: Setup complete!\n", __PRETTY_FUNCTION__
));
854 ///IconWindowVolumeList__MUIM_Cleanup()
855 IPTR IconWindowVolumeList__MUIM_Cleanup
857 Class
*CLASS
, Object
*self
, Msg message
862 Object
*prefs
= NULL
;
864 D(bug("[Wanderer:VolumeList]: %s()\n", __PRETTY_FUNCTION__
));
865 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
871 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_IconListMode
, (IPTR
)self
876 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_Mode
, (IPTR
)self
881 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MaxLineLen
, (IPTR
)self
886 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLine
, (IPTR
)self
891 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLineOnFocus
, (IPTR
)self
896 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_HorizontalSpacing
, (IPTR
)self
901 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_VerticalSpacing
, (IPTR
)self
906 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_ImageSpacing
, (IPTR
)self
911 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_HorizontalPadding
, (IPTR
)self
916 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_VerticalPadding
, (IPTR
)self
921 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderWidth
, (IPTR
)self
926 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderHeight
, (IPTR
)self
935 MUIM_KillNotifyObj
, MUIA_IconWindowExt_NetworkBrowser_Show
, (IPTR
) self
938 D(bug("[Wanderer:VolumeList] %s: Removing Disk Event Handler\n", __PRETTY_FUNCTION__
));
939 DoMethod(_win(self
), MUIM_Window_RemEventHandler
, &data
->iwcd_EventHandlerNode
);
941 return DoSuperMethodA(CLASS
, self
, message
);
945 ///IconWindowVolumeList__MUIM_HandleEvent()
946 IPTR IconWindowVolumeList__MUIM_HandleEvent
948 Class
*CLASS
, Object
*self
, struct MUIP_HandleEvent
*message
953 struct IntuiMessage
*imsg
= message
->imsg
;
955 D(bug("[Wanderer:VolumeList]: %s()\n", __PRETTY_FUNCTION__
));
957 if(imsg
->Class
== IDCMP_DISKINSERTED
)
959 D(bug("[Wanderer:VolumeList] %s: IDCMP_DISKINSERTED\n", __PRETTY_FUNCTION__
));
960 DoMethod(self
, MUIM_IconList_Update
);
961 return(MUI_EventHandlerRC_Eat
);
963 else if (imsg
->Class
== IDCMP_DISKREMOVED
)
965 D(bug("[Wanderer:VolumeList] %s: IDCMP_DISKREMOVED\n", __PRETTY_FUNCTION__
));
966 DoMethod(self
, MUIM_IconList_Update
);
967 return(MUI_EventHandlerRC_Eat
);
973 ///IconWindowVolumeList__MUIM_DrawBackground()
974 IPTR IconWindowVolumeList__MUIM_DrawBackground
976 Class
*CLASS
, Object
*self
, struct MUIP_DrawBackground
*message
981 IPTR retVal
= (IPTR
)TRUE
;
983 struct RastPort
*DrawBackGround_RastPort
;
984 struct IconWindowBackFillMsg DrawBackGround_BackFillMsg
;
986 D(bug("[Wanderer:VolumeList]: %s()\n", __PRETTY_FUNCTION__
));
988 if ((iconwindow_BackFill_Active
== NULL
) ||
989 (data
->iwcd_IconWindow
== NULL
))
991 D(bug("[Wanderer:VolumeList] %s: No Backfill support/Window not set .. causing parent class to render\n", __PRETTY_FUNCTION__
));
992 goto iwc_ParentBackground
;
995 DrawBackGround_RastPort
= _rp(self
);
997 if ((data
->iwcd_RastPort
!= NULL
) && (DrawBackGround_RastPort
!= data
->iwcd_RastPort
))
999 DrawBackGround_RastPort
= data
->iwcd_RastPort
;
1001 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= 0;
1002 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= 0;
1003 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= _mwidth(self
);
1004 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= _mheight(self
);
1006 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
- _mleft(self
);
1007 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
- _mtop(self
);
1008 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= message
->width
;
1009 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= message
->height
;
1013 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= _mleft(self
);
1014 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= _mtop(self
);
1015 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= (_mleft(self
) + _mwidth(self
));
1016 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= (_mtop(self
) + _mheight(self
));
1018 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
;
1019 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
;
1020 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= (message
->left
+ message
->width
);
1021 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= (message
->top
+ message
->height
);
1024 DrawBackGround_BackFillMsg
.Layer
= DrawBackGround_RastPort
->Layer
;
1026 /* Offset into source image (ala scroll bar position) */
1027 DrawBackGround_BackFillMsg
.OffsetX
= message
->xoffset
;
1028 DrawBackGround_BackFillMsg
.OffsetY
= message
->yoffset
;
1030 D(bug("[Wanderer:VolumeList] %s: RastPort @ 0x%p\n", __PRETTY_FUNCTION__
, DrawBackGround_RastPort
));
1032 if ((retVal
= DoMethod(data
->iwcd_IconWindow
, MUIM_IconWindow_BackFill_DrawBackground
, XGET(data
->iwcd_IconWindow
, MUIA_IconWindow_BackFillData
), &DrawBackGround_BackFillMsg
, DrawBackGround_RastPort
)) == (IPTR
)TRUE
)
1034 D(bug("[Wanderer:VolumeList] %s: Backfill module rendered background ..\n", __PRETTY_FUNCTION__
));
1037 D(bug("[Wanderer:VolumeList] %s: Backfill module failed to render background ..\n", __PRETTY_FUNCTION__
));
1039 iwc_ParentBackground
:
1041 clip
= (IPTR
)MUI_AddClipping(muiRenderInfo(self
), message
->left
, message
->top
, message
->width
, message
->height
);
1043 message
->width
= _mwidth(self
);
1044 message
->height
= _mheight(self
);
1045 message
->left
= _mleft(self
);
1046 message
->top
= _mtop(self
);
1048 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
1050 MUI_RemoveClipping(muiRenderInfo(self
), (APTR
)clip
);
1056 ///IconWindowVolumeList__MUIM_IconList_Update()
1057 IPTR IconWindowVolumeList__MUIM_IconList_Update
1059 Class
*CLASS
, Object
*self
, struct MUIP_IconList_Update
*message
1064 IPTR retVal
= (IPTR
)TRUE
;
1066 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
1068 struct IconList_Entry
*icon_entry
= (IPTR
)MUIV_IconList_NextIcon_Start
;
1069 Object
*prefs
= NULL
;
1070 BOOL sort_list
= FALSE
;
1072 D(bug("[Wanderer:VolumeList] %s: Causing parent to update\n", __PRETTY_FUNCTION__
));
1073 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
1075 D(bug("[Wanderer:VolumeList] %s: Check if we should show NetworkBrowser Icon ..\n", __PRETTY_FUNCTION__
));
1077 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
1081 struct IconWindowVolumeList_DATA
*volumel_data
= (struct IconWindowVolumeList_DATA
*)data
;
1083 GET(prefs
, MUIA_IconWindowExt_NetworkBrowser_Show
, &volumel_data
->iwvcd_ShowNetworkBrowser
);
1085 #if defined(DEBUG_NETWORKBROWSER)
1086 volumel_data
->iwvcd_ShowNetworkBrowser
= TRUE
;
1089 if (volumel_data
->iwvcd_ShowNetworkBrowser
)
1091 struct DiskObject
*_nb_dob
= NULL
;
1092 _nb_dob
= GetIconTags
1094 "ENV:SYS/def_NetworkHost",
1095 ICONGETA_FailIfUnavailable
, FALSE
,
1096 ICONGETA_Label
, (IPTR
)"Network Access..",
1100 D(bug("[Wanderer:VolumeList] %s: NetworkBrowser Icon DOB @ 0x%p\n", __PRETTY_FUNCTION__
, _nb_dob
));
1104 struct Node
*this_entry
= NULL
;
1105 if ((this_entry
= (struct Node
*)DoMethod(self
, MUIM_IconList_CreateEntry
, (IPTR
)"?wanderer.networkbrowse?", (IPTR
)"Network Access..", (IPTR
)NULL
, (IPTR
)_nb_dob
, 0)))
1107 this_entry
->ln_Pri
= 3; /// Network Access gets Priority 3 so its displayed after special dirs
1109 D(bug("[Wanderer:VolumeList] %s: NetworkBrowser Icon Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
1114 GET(prefs
, MUIA_IconWindowExt_UserFiles_ShowFilesFolder
, &volumel_data
->iwvcd_ShowUserFolder
);
1116 #if defined(DEBUG_SHOWUSERFILES)
1117 volumel_data
->iwvcd_ShowUserFolder
= TRUE
;
1119 if (volumel_data
->iwvcd_ShowUserFolder
)
1121 if (GetVar("SYS/Wanderer/userfiles.prefs", __icwc_intern_TxtBuff
, TXTBUFF_LEN
, GVF_GLOBAL_ONLY
) != -1)
1123 char * userfiles_path
= NULL
;
1125 D(bug("[Wanderer:VolumeList] %s: SYS/UserFilesLocation = '%s'\n", __PRETTY_FUNCTION__
, __icwc_intern_TxtBuff
));
1127 if ((userfiles_path
= AllocVec(strlen(__icwc_intern_TxtBuff
) + 1, MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
1129 struct DiskObject
*_nb_dob
= NULL
;
1131 volumel_data
->iwvcd_UserFolderPath
= userfiles_path
;
1133 D(bug("[Wanderer:VolumeList] %s: UserFilesLocation Path storage @ 0x%p\n", __PRETTY_FUNCTION__
, userfiles_path
));
1135 strcpy(userfiles_path
, __icwc_intern_TxtBuff
);
1137 D(bug("[Wanderer:VolumeList] %s: UserFilesLocation Path storage contains '%s'\n", __PRETTY_FUNCTION__
, userfiles_path
));
1139 _nb_dob
= GetIconTags
1141 "ENV:SYS/def_UserHome",
1142 ICONGETA_FailIfUnavailable
, FALSE
,
1143 ICONGETA_Label
, (IPTR
)"User Files..",
1147 D(bug("[Wanderer:VolumeList] %s: UserFiles Icon DOB @ 0x%p\n", __PRETTY_FUNCTION__
, _nb_dob
));
1151 struct Node
*this_entry
= NULL
;
1152 if ((this_entry
= (struct Node
*)DoMethod(self
, MUIM_IconList_CreateEntry
, userfiles_path
, (IPTR
)"User Files..", (IPTR
)NULL
, (IPTR
)_nb_dob
, 0)))
1154 this_entry
->ln_Pri
= 5; /// Special dirs get Priority 5
1161 if (sort_list
) DoMethod(self
, MUIM_IconList_Sort
);
1167 DoMethod(self
, MUIM_IconList_Clear
);
1174 IPTR
IconWindowVolumeList__MUIM_IconList_CreateEntry(struct IClass
*CLASS
, Object
*obj
, struct MUIP_IconList_CreateEntry
*message
)
1176 struct IconEntry
*this_Icon
= NULL
;
1177 struct VolumeIcon_Private
*volPrivate
= NULL
;
1179 D(bug("[Wanderer:VolumeList]: %s()\n", __PRETTY_FUNCTION__
));
1181 this_Icon
= DoSuperMethodA(CLASS
, obj
, (Msg
) message
);
1185 D(bug("[Wanderer:VolumeList] %s: IconEntry Allocated @ %p\n", __PRETTY_FUNCTION__
, this_Icon
));
1187 volPrivate
= this_Icon
->ie_IconListEntry
.udata
;
1189 if ((this_Icon
->ie_IconListEntry
.type
== ST_ROOT
) && (volPrivate
&& ((volPrivate
->vip_FLags
& (ICONENTRY_VOL_OFFLINE
|ICONENTRY_VOL_DISABLED
)) == 0)))
1191 IconWindowVolumeList__Func_ParseBackdrop(CLASS
, obj
, this_Icon
->ie_IconListEntry
.label
);
1197 IPTR
IconWindowVolumeList__MUIM_IconList_UpdateEntry(struct IClass
*CLASS
, Object
*obj
, struct MUIP_IconList_UpdateEntry
*message
)
1199 struct IconEntry
*this_Icon
= NULL
;
1200 struct VolumeIcon_Private
*volPrivate
= NULL
;
1202 D(bug("[Wanderer:VolumeList]: %s()\n", __PRETTY_FUNCTION__
));
1204 volPrivate
= message
->icon
->ie_IconListEntry
.udata
;
1206 this_Icon
= DoSuperMethodA(CLASS
, obj
, (Msg
) message
);
1211 IPTR
IconWindowVolumeList__MUIM_IconList_DestroyEntry(struct IClass
*CLASS
, Object
*obj
, struct MUIP_IconList_DestroyEntry
*message
)
1213 struct VolumeIcon_Private
*volPrivate
= NULL
;
1216 D(bug("[Wanderer:VolumeList]: %s()\n", __PRETTY_FUNCTION__
));
1218 volPrivate
= message
->icon
->ie_IconListEntry
.udata
;
1220 rv
= DoSuperMethodA(CLASS
, obj
, (Msg
) message
);
1226 /*** Setup ******************************************************************/
1228 ICONWINDOWICONVOLUMELIST_CUSTOMCLASS
1230 IconWindowVolumeList
, NULL
, MUIC_IconVolumeList
, NULL
,
1231 OM_NEW
, struct opSet
*,
1232 OM_SET
, struct opSet
*,
1233 OM_GET
, struct opGet
*,
1236 MUIM_DrawBackground
, Msg
,
1237 MUIM_HandleEvent
, Msg
,
1238 MUIM_IconList_Update
, struct MUIP_IconList_Update
*,
1239 MUIM_IconList_CreateEntry
, struct MUIP_IconList_CreateEntry
*,
1240 MUIM_IconList_UpdateEntry
, struct MUIP_IconList_UpdateEntry
*,
1241 MUIM_IconList_DestroyEntry
, struct MUIP_IconList_DestroyEntry
*
1244 ICONWINDOWICONVOLUMELIST_CUSTOMCLASS
1246 IconWindowVolumeList
, NULL
, NULL
, IconVolumeList_Class
,
1247 OM_NEW
, struct opSet
*,
1248 OM_SET
, struct opSet
*,
1249 OM_GET
, struct opGet
*,
1252 MUIM_DrawBackground
, Msg
,
1253 MUIM_HandleEvent
, Msg
,
1254 MUIM_IconList_Update
, struct MUIP_IconList_Update
*,
1255 MUIM_IconList_CreateEntry
, struct MUIP_IconList_CreateEntry
*,
1256 MUIM_IconList_UpdateEntry
, struct MUIP_IconList_UpdateEntry
*,
1257 MUIM_IconList_DestroyEntry
, struct MUIP_IconList_DestroyEntry
*