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
;
85 #define BG_DRAWFLAG 0xf00dd00f
87 /*** Instance Data **********************************************************/
89 struct IconWindowIconList_DATA
91 Object
*iwcd_IconWindow
;
92 struct RastPort
*iwcd_RastPort
;
93 struct MUI_EventHandlerNode iwcd_EventHandlerNode
;
95 struct Hook iwcd_ProcessIconListPrefs_hook
;
97 struct Hook
*iwcd_ProcessIconListPrefs_hook
;
100 IPTR iwcd_ViewPrefs_ID
;
101 Object
*iwcd_ViewPrefs_NotificationObject
;
104 static char __icwc_intern_TxtBuff
[TXTBUFF_LEN
];
106 /*** Macros *****************************************************************/
107 #define SETUP_INST_DATA struct IconWindowIconList_DATA *data = INST_DATA(CLASS, self)
109 /*** Hook functions *********************************************************/
110 ///IconWindowIconList__HookFunc_ProcessIconListPrefsFunc()
113 void, IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
,
114 AROS_UFHA(struct Hook
*, hook
, A0
),
115 AROS_UFHA(APTR
*, obj
, A2
),
116 AROS_UFHA(IPTR
*, param
, A1
)
120 HOOKPROTO(IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
, void, APTR
*obj
, IPTR
*param
)
125 /* Get our private data */
126 Object
*self
= ( Object
*)obj
;
127 IPTR CHANGED_ATTRIB
= *param
;
128 Class
*CLASS
= OCLASS(self
);
132 Object
*prefs
= NULL
;
134 D(bug("[IconWindowIconList] %s()\n", __PRETTY_FUNCTION__
));
136 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
140 IPTR attrib_Current
, attrib_Prefs
, prefs_Processing
= 0;
141 BOOL options_changed
= FALSE
;
143 D(bug("[IconWindowIconList] %s: Setting IconList options ..\n", __PRETTY_FUNCTION__
));
145 GET(prefs
, MUIA_WandererPrefs_Processing
, &prefs_Processing
);
147 switch (CHANGED_ATTRIB
)
149 case MUIA_IconList_IconListMode
:
150 GET(self
, MUIA_IconList_IconListMode
, &attrib_Current
);
152 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_IconListMode
)) != -1) &&
153 (attrib_Current
!= attrib_Prefs
))
155 D(bug("[IconWindowIconList] %s: IconList ListMode changed - updating ..\n", __PRETTY_FUNCTION__
));
156 options_changed
= TRUE
;
157 if (prefs_Processing
)
159 NNSET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
163 SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
168 case MUIA_IconList_LabelText_Mode
:
169 GET(self
, MUIA_IconList_LabelText_Mode
, &attrib_Current
);
171 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
)) != -1) &&
172 (attrib_Current
!= attrib_Prefs
))
174 D(bug("[IconWindowIconList] %s: IconList TextRenderMode changed - updating ..\n", __PRETTY_FUNCTION__
));
175 options_changed
= TRUE
;
176 if (prefs_Processing
)
178 NNSET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
182 SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
187 case MUIA_IconList_LabelText_MaxLineLen
:
188 GET(self
, MUIA_IconList_LabelText_MaxLineLen
, &attrib_Current
);
190 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
)) != -1) &&
191 (attrib_Current
!= attrib_Prefs
))
193 D(bug("[IconWindowIconList] %s: IconList Max Text Length changed - updating ..\n", __PRETTY_FUNCTION__
));
194 options_changed
= TRUE
;
195 if (prefs_Processing
)
197 NNSET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
201 SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
206 case MUIA_IconList_LabelText_MultiLine
:
207 GET(self
, MUIA_IconList_LabelText_MultiLine
, &attrib_Current
);
209 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
)) != -1) &&
210 (attrib_Current
!= attrib_Prefs
))
212 D(bug("[IconWindowIconList] %s: IconList Multi-Line changed - updating ..\n", __PRETTY_FUNCTION__
));
213 options_changed
= TRUE
;
214 if (prefs_Processing
)
216 NNSET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
220 SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
225 case MUIA_IconList_LabelText_MultiLineOnFocus
:
226 GET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, &attrib_Current
);
228 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
)) != -1) &&
229 (attrib_Current
!= attrib_Prefs
))
231 D(bug("[IconWindowIconList] %s: Multi-Line on Focus changed - updating ..\n", __PRETTY_FUNCTION__
));
232 options_changed
= TRUE
;
233 if (prefs_Processing
)
235 NNSET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
239 SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
244 case MUIA_IconList_Icon_HorizontalSpacing
:
245 GET(self
, MUIA_IconList_Icon_HorizontalSpacing
, &attrib_Current
);
247 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
)) != -1) &&
248 (attrib_Current
!= attrib_Prefs
))
250 D(bug("[IconWindowIconList] %s: Icon Horizontal Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
251 options_changed
= TRUE
;
252 if (prefs_Processing
)
254 NNSET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
258 SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
263 case MUIA_IconList_Icon_VerticalSpacing
:
264 GET(self
, MUIA_IconList_Icon_VerticalSpacing
, &attrib_Current
);
266 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
)) != -1) &&
267 (attrib_Current
!= attrib_Prefs
))
269 D(bug("[IconWindowIconList] %s: Icon Vertical Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
270 options_changed
= TRUE
;
271 if (prefs_Processing
)
273 NNSET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
277 SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
282 case MUIA_IconList_Icon_ImageSpacing
:
283 GET(self
, MUIA_IconList_Icon_ImageSpacing
, &attrib_Current
);
285 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
)) != -1) &&
286 (attrib_Current
!= attrib_Prefs
))
288 D(bug("[IconWindowIconList] %s: Icon Label Image Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
289 options_changed
= TRUE
;
290 if (prefs_Processing
)
292 NNSET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
296 SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
301 case MUIA_IconList_LabelText_HorizontalPadding
:
302 GET(self
, MUIA_IconList_LabelText_HorizontalPadding
, &attrib_Current
);
304 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
)) != -1) &&
305 (attrib_Current
!= attrib_Prefs
))
307 D(bug("[IconWindowIconList] %s: Icon Label Horizontal Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
308 options_changed
= TRUE
;
309 if (prefs_Processing
)
311 NNSET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
315 SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
320 case MUIA_IconList_LabelText_VerticalPadding
:
321 GET(self
, MUIA_IconList_LabelText_VerticalPadding
, &attrib_Current
);
323 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
)) != -1) &&
324 (attrib_Current
!= attrib_Prefs
))
326 D(bug("[IconWindowIconList] %s: Icon Label Vertical Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
327 options_changed
= TRUE
;
328 if (prefs_Processing
)
330 NNSET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
334 SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
339 case MUIA_IconList_LabelText_BorderWidth
:
340 GET(self
, MUIA_IconList_LabelText_BorderWidth
, &attrib_Current
);
342 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
)) != -1) &&
343 (attrib_Current
!= attrib_Prefs
))
345 D(bug("[IconWindowIconList] %s: Icon Label Border Width changed - updating ..\n", __PRETTY_FUNCTION__
));
346 options_changed
= TRUE
;
347 if (prefs_Processing
)
349 NNSET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
353 SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
358 case MUIA_IconList_LabelText_BorderHeight
:
359 GET(self
, MUIA_IconList_LabelText_BorderHeight
, &attrib_Current
);
361 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
)) != -1) &&
362 (attrib_Current
!= attrib_Prefs
))
364 D(bug("[IconWindowIconList] %s: Icon Label Border Height changed - updating ..\n", __PRETTY_FUNCTION__
));
365 options_changed
= TRUE
;
366 if (prefs_Processing
)
368 NNSET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
372 SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
378 D(bug("[IconWindowIconList] %s: Unhandled change\n", __PRETTY_FUNCTION__
));
384 if (!(prefs_Processing
))
386 D(bug("[IconWindowIconList] %s: IconList Options have changed, causing an update ..\n", __PRETTY_FUNCTION__
));
387 DoMethod(self
, MUIM_IconList_Update
);
389 else if (data
->iwcd_IconWindow
)
391 SET(data
->iwcd_IconWindow
, MUIA_IconWindow_Changed
, TRUE
);
398 MakeStaticHook(Hook_ProcessIconListPrefsFunc
,IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
);
402 ///IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc()
405 void, IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
,
406 AROS_UFHA(struct Hook
*, hook
, A0
),
407 AROS_UFHA(APTR
*, obj
, A2
),
408 AROS_UFHA(APTR
, param
, A1
)
412 HOOKPROTO(IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
, void, APTR
*obj
, APTR param
)
417 /* Get our private data */
418 Object
*self
= ( Object
*)obj
;
419 Object
*prefs
= NULL
;
420 Class
*CLASS
= *( Class
**)param
;
424 D(bug("[IconWindowIconList] %s()\n", __PRETTY_FUNCTION__
));
426 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
430 BOOL options_changed
= FALSE
;
431 IPTR prefs_Processing
= 0;
433 GET(prefs
, MUIA_WandererPrefs_Processing
, &prefs_Processing
);
435 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
437 IPTR current_ShowNetwork
= 0;
438 IPTR prefs_ShowNetwork
= 0;
440 D(bug("[IconWindowIconList] %s: Setting ROOT view Network options ..\n", __PRETTY_FUNCTION__
));
442 GET(self
, MUIA_IconWindowExt_NetworkBrowser_Show
, ¤t_ShowNetwork
);
444 D(bug("[IconWindowIconList] %s: Current = %d\n", __PRETTY_FUNCTION__
, current_ShowNetwork
));
446 GET(prefs
, MUIA_IconWindowExt_NetworkBrowser_Show
, &prefs_ShowNetwork
);
448 D(bug("[IconWindowIconList] %s: Prefs = %d\n", __PRETTY_FUNCTION__
, prefs_ShowNetwork
));
450 if ((BOOL
)current_ShowNetwork
!= (BOOL
)prefs_ShowNetwork
)
452 D(bug("[IconWindowIconList] %s: ROOT view Network prefs changed - updating ..\n", __PRETTY_FUNCTION__
));
453 options_changed
= TRUE
;
454 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_ShowNetworkBrowser
= prefs_ShowNetwork
;
457 if ((options_changed
) && !(prefs_Processing
))
459 D(bug("[IconWindowIconList] %s: Network prefs changed, causing an update ..\n", __PRETTY_FUNCTION__
));
460 DoMethod(self
, MUIM_IconList_Update
);
462 else if (data
->iwcd_IconWindow
)
464 SET(data
->iwcd_IconWindow
, MUIA_IconWindow_Changed
, TRUE
);
470 MakeStaticHook(Hook_UpdateNetworkPrefsFunc
,IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
);
473 #define BDRPLINELEN_MAX 1024
474 BOOL
IconWindowIconList__Func_ParseBackdrop(Class
*CLASS
, Object
*self
, char *bdrp_dir
)
476 BPTR bdrp_lock
= (BPTR
)NULL
;
477 char *bdrp_file
= NULL
, *linebuf
= NULL
, *bdrp_fullfile
= NULL
, *bdrp_namepart
= NULL
;
478 struct DiskObject
*bdrp_currfile_dob
= NULL
;
481 if ((bdrp_dir
== NULL
) || (bdrp_dir
[strlen(bdrp_dir
) - 1] != ':'))
484 if ((bdrp_file
= AllocVec(strlen(bdrp_dir
) + 9 + 1, MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
486 sprintf(bdrp_file
, "%s.backdrop", bdrp_dir
);
487 if ((bdrp_lock
= Open(bdrp_file
, MODE_OLDFILE
)))
489 D(bug("[IconWindowIconList] IconWindowIconList__Func_ParseBackdrop: Loading backdrop file: '%s'\n", bdrp_file
));
491 if ((linebuf
= AllocMem(BDRPLINELEN_MAX
, MEMF_PUBLIC
)) != NULL
)
493 while (FGets(bdrp_lock
, linebuf
, BDRPLINELEN_MAX
))
499 linelen
= strlen(linebuf
) - 1; /* drop the newline char */
500 linebuf
[linelen
] = '\0';
502 if ((bdrp_fullfile
= AllocVec(linelen
+ strlen(bdrp_dir
), MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
504 sprintf(bdrp_fullfile
, "%s%s", bdrp_dir
, &linebuf
[1]);
505 bdrp_namepart
= FilePart(bdrp_fullfile
);
506 bdrp_currfile_dob
= GetIconTags
509 ICONGETA_FailIfUnavailable
, FALSE
,
510 ICONGETA_Label
, bdrp_namepart
,
514 D(bug("[IconWindowIconList] IconWindowIconList__Func_ParseBackdrop: LEAVEOUT Icon '%s' ('%s') DOB @ 0x%p\n", bdrp_fullfile
, bdrp_namepart
, bdrp_currfile_dob
));
516 if (bdrp_currfile_dob
)
518 struct IconEntry
*this_entry
= NULL
;
519 if ((this_entry
= (struct IconEntry
*)DoMethod(self
, MUIM_IconList_CreateEntry
, (IPTR
)bdrp_fullfile
, (IPTR
)bdrp_namepart
, (IPTR
)NULL
, (IPTR
)bdrp_currfile_dob
, 0)))
521 struct FileInfoBlock
*fib
= AllocDosObject(DOS_FIB
, NULL
);
524 BPTR fib_lock
= (BPTR
)NULL
;
525 if ((fib_lock
= Lock(bdrp_fullfile
, SHARED_LOCK
)) != NULL
)
527 if (Examine(fib_lock
, fib
))
529 if (fib
->fib_DirEntryType
== ST_FILE
)
531 this_entry
->ie_IconListEntry
.type
= ST_LINKFILE
;
532 D(bug("[IconWindowIconList] %s: LEAVEOUT ST_LINKFILE Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
534 else if (fib
->fib_DirEntryType
== ST_USERDIR
)
536 this_entry
->ie_IconListEntry
.type
= ST_LINKDIR
;
537 D(bug("[IconWindowIconList] %s: LEAVEOUT ST_LINKDIR Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
541 D(bug("[IconWindowIconList] %s: LEAVEOUT Unknown Entry Type @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
546 FreeDosObject(DOS_FIB
, fib
);
553 FreeMem(linebuf
, BDRPLINELEN_MAX
);
563 /*** Methods ****************************************************************/
565 Object
*IconWindowIconList__OM_NEW(Class
*CLASS
, Object
*self
, struct opSet
*message
)
567 IPTR _newIconList__FSNotifyPort
= 0;
569 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW()\n"));
571 _newIconList__FSNotifyPort
= GetTagData(MUIA_Wanderer_FileSysNotifyPort
, (IPTR
) NULL
, message
->ops_AttrList
);
573 self
= (Object
*) DoSuperNewTags
577 TAG_MORE
, (IPTR
) message
->ops_AttrList
583 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW: SELF = 0x%p\n", self
));
586 data
->iwcd_ProcessIconListPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
;
588 data
->iwcd_ProcessIconListPrefs_hook
= &Hook_ProcessIconListPrefsFunc
;
591 if (_newIconList__FSNotifyPort
!= 0)
593 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
594 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
= _newIconList__FSNotifyPort
;
595 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW: FS Notify Port @ 0x%p\n", _newIconList__FSNotifyPort
));
598 D(bug("[IconWindowIconList] obj = %ld\n", self
));
605 IPTR
IconWindowIconList__OM_SET(Class
*CLASS
, Object
*self
, struct opSet
*message
)
609 struct TagItem
*tstate
= message
->ops_AttrList
, *tag
;
611 while ((tag
= NextTagItem((const struct TagItem
**)&tstate
)) != NULL
)
615 case MUIA_Background
:
617 D(bug("[IconWindowIconList] %s: MUIA_Background\n", __PRETTY_FUNCTION__
));
620 case MUIA_IconWindow_Window
:
622 D(bug("[IconWindowIconList] %s: MUIA_IconWindow_Window @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
623 data
->iwcd_IconWindow
= (Object
*)tag
->ti_Data
;
626 case MUIA_IconList_BufferRastport
:
628 D(bug("[IconWindowIconList] %s: MUIA_IconList_BufferRastport @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
629 data
->iwcd_RastPort
= (struct RastPort
*)tag
->ti_Data
;
634 return DoSuperMethodA(CLASS
, self
, (Msg
) message
);
639 IPTR
IconWindowIconList__OM_GET(Class
*CLASS
, Object
*self
, struct opGet
*message
)
642 //IPTR *store = message->opg_Storage;
645 switch (message
->opg_AttrID
)
648 rv
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
655 ///IconWindowIconList__MUIM_Setup()
656 IPTR IconWindowIconList__MUIM_Setup
658 Class
*CLASS
, Object
*self
, Msg message
663 Object
*prefs
= NULL
;
665 if (!DoSuperMethodA(CLASS
, self
, message
)) return FALSE
;
667 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
671 /* Set our initial options */
674 GET(_win(self
), MUIA_IconWindow_BackgroundAttrib
, &data
->iwcd_ViewPrefs_ID
);
675 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Setup: Window Background = '%s'\n", data
->iwcd_ViewPrefs_ID
));
676 data
->iwcd_ViewPrefs_NotificationObject
= (Object
*)DoMethod(prefs
,
677 MUIM_WandererPrefs_ViewSettings_GetNotifyObject
,
678 data
->iwcd_ViewPrefs_ID
);
680 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Setup: Background Notification Obj @ 0x%p\n", data
->iwcd_ViewPrefs_NotificationObject
));
682 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_IconListMode
);
683 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_IconListMode
))) SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
685 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
);
686 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_Mode
))) SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
688 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
);
689 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MaxLineLen
))) SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
691 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
);
692 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLine
))) SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
694 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
);
695 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
))) SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
697 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
);
698 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_HorizontalSpacing
))) SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
700 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
);
701 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_VerticalSpacing
))) SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
703 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
);
704 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_ImageSpacing
))) SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
706 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
);
707 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_HorizontalPadding
))) SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
709 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
);
710 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_VerticalPadding
))) SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
712 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
);
713 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderWidth
))) SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
715 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
);
716 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderHeight
))) SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
718 /* Configure notifications incase they get updated =) */
721 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_IconListMode
, MUIV_EveryTime
,
723 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_IconListMode
728 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_Mode
, MUIV_EveryTime
,
730 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_Mode
735 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MaxLineLen
, MUIV_EveryTime
,
737 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MaxLineLen
742 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLine
, MUIV_EveryTime
,
744 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLine
749 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLineOnFocus
, MUIV_EveryTime
,
751 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLineOnFocus
756 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_HorizontalSpacing
, MUIV_EveryTime
,
758 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_HorizontalSpacing
763 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_VerticalSpacing
, MUIV_EveryTime
,
765 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_VerticalSpacing
770 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_ImageSpacing
, MUIV_EveryTime
,
772 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_ImageSpacing
777 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_HorizontalPadding
, MUIV_EveryTime
,
779 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_HorizontalPadding
784 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_VerticalPadding
, MUIV_EveryTime
,
786 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_VerticalPadding
791 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderWidth
, MUIV_EveryTime
,
793 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderWidth
798 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderHeight
, MUIV_EveryTime
,
800 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderHeight
804 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
809 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
;
811 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
= &Hook_UpdateNetworkPrefsFunc
;
816 prefs
, MUIM_Notify
, MUIA_IconWindowExt_NetworkBrowser_Show
, MUIV_EveryTime
,
818 MUIM_CallHook
, &((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
, (IPTR
)CLASS
822 if (muiRenderInfo(self
))
824 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Setting up EventHandler for (IDCMP_DISKINSERTED | IDCMP_DISKREMOVED)\n"));
826 data
->iwcd_EventHandlerNode
.ehn_Priority
= 1;
827 data
->iwcd_EventHandlerNode
.ehn_Flags
= MUI_EHF_GUIMODE
;
828 data
->iwcd_EventHandlerNode
.ehn_Object
= self
;
829 data
->iwcd_EventHandlerNode
.ehn_Class
= CLASS
;
830 data
->iwcd_EventHandlerNode
.ehn_Events
= IDCMP_DISKINSERTED
| IDCMP_DISKREMOVED
;
832 DoMethod(_win(self
), MUIM_Window_AddEventHandler
, &data
->iwcd_EventHandlerNode
);
836 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Couldnt add IDCMP EventHandler!\n"));
841 /* Setup notification on the directory -------------------------------- */
842 STRPTR directory_path
= NULL
;
843 GET(self
, MUIA_IconDrawerList_Drawer
, &directory_path
);
845 if (directory_path
!= NULL
)
847 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
849 if (drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
!= NULL
)
851 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
= directory_path
;
852 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Flags
= NRF_SEND_MESSAGE
;
853 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_UserData
= self
;
855 if (StartNotify(&drawerlist_data
->iwdcd_DrawerNotifyRequest
))
857 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Drawer-notification setup on '%s'\n", drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
));
861 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: FAILED to setup Drawer-notification!\n"));
862 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
= NULL
;
868 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Setup complete!\n"));
874 ///IconWindowIconList__MUIM_Cleanup()
875 IPTR IconWindowIconList__MUIM_Cleanup
877 Class
*CLASS
, Object
*self
, Msg message
882 Object
*prefs
= NULL
;
884 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup()\n"));
885 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
891 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_IconListMode
, (IPTR
)self
896 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_Mode
, (IPTR
)self
901 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MaxLineLen
, (IPTR
)self
906 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLine
, (IPTR
)self
911 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLineOnFocus
, (IPTR
)self
916 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_HorizontalSpacing
, (IPTR
)self
921 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_VerticalSpacing
, (IPTR
)self
926 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_ImageSpacing
, (IPTR
)self
931 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_HorizontalPadding
, (IPTR
)self
936 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_VerticalPadding
, (IPTR
)self
941 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderWidth
, (IPTR
)self
946 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderHeight
, (IPTR
)self
950 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
957 MUIM_KillNotifyObj
, MUIA_IconWindowExt_NetworkBrowser_Show
, (IPTR
) self
960 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup: (ROOT WINDOW) Removing our Disk Event Handler\n"));
961 DoMethod(_win(self
), MUIM_Window_RemEventHandler
, &data
->iwcd_EventHandlerNode
);
965 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
966 if (drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
!= NULL
)
968 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup: (DRAWER WINDOW) Removing our Drawer Notification Request\n"));
969 EndNotify(&drawerlist_data
->iwdcd_DrawerNotifyRequest
);
973 return DoSuperMethodA(CLASS
, self
, message
);
977 ///IconWindowIconList__MUIM_HandleEvent()
978 IPTR IconWindowIconList__MUIM_HandleEvent
980 Class
*CLASS
, Object
*self
, struct MUIP_HandleEvent
*message
985 struct IntuiMessage
*imsg
= message
->imsg
;
987 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent()\n"));
989 if(imsg
->Class
== IDCMP_DISKINSERTED
)
991 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent: IDCMP_DISKINSERTED\n"));
992 DoMethod(self
, MUIM_IconList_Update
);
993 return(MUI_EventHandlerRC_Eat
);
995 else if (imsg
->Class
== IDCMP_DISKREMOVED
)
997 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent: IDCMP_DISKREMOVED\n"));
998 DoMethod(self
, MUIM_IconList_Update
);
999 return(MUI_EventHandlerRC_Eat
);
1005 ///IconWindowIconList__MUIM_DrawBackground()
1006 IPTR IconWindowIconList__MUIM_DrawBackground
1008 Class
*CLASS
, Object
*self
, struct MUIP_DrawBackground
*message
1013 IPTR retVal
= (IPTR
)TRUE
;
1015 struct RastPort
*DrawBackGround_RastPort
;
1016 struct IconWindowBackFillMsg DrawBackGround_BackFillMsg
;
1018 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground()\n"));
1020 if ((iconwindow_BackFill_Active
== NULL
) ||
1021 (data
->iwcd_IconWindow
== NULL
))
1023 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: No Backfill support/Window not set .. causing parent class to render\n"));
1024 goto iwc_ParentBackground
;
1027 DrawBackGround_RastPort
= _rp(self
);
1029 if ((data
->iwcd_RastPort
!= NULL
) && (DrawBackGround_RastPort
!= data
->iwcd_RastPort
))
1031 DrawBackGround_RastPort
= data
->iwcd_RastPort
;
1033 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= 0;
1034 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= 0;
1035 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= _mwidth(self
);
1036 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= _mheight(self
);
1038 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
- _mleft(self
);
1039 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
- _mtop(self
);
1040 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= message
->width
;
1041 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= message
->height
;
1045 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= _mleft(self
);
1046 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= _mtop(self
);
1047 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= (_mleft(self
) + _mwidth(self
));
1048 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= (_mtop(self
) + _mheight(self
));
1050 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
;
1051 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
;
1052 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= (message
->left
+ message
->width
);
1053 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= (message
->top
+ message
->height
);
1056 DrawBackGround_BackFillMsg
.Layer
= DrawBackGround_RastPort
->Layer
;
1058 /* Offset into source image (ala scroll bar position) */
1059 DrawBackGround_BackFillMsg
.OffsetX
= message
->xoffset
;
1060 DrawBackGround_BackFillMsg
.OffsetY
= message
->yoffset
;
1062 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: RastPort @ 0x%p\n", DrawBackGround_RastPort
));
1064 if ((retVal
= DoMethod(data
->iwcd_IconWindow
, MUIM_IconWindow_BackFill_DrawBackground
, XGET(data
->iwcd_IconWindow
, MUIA_IconWindow_BackFillData
), &DrawBackGround_BackFillMsg
, DrawBackGround_RastPort
)) == (IPTR
)TRUE
)
1066 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: Backfill module rendered background ..\n"));
1069 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: Backfill module failed to render background ..\n"));
1071 iwc_ParentBackground
:
1073 clip
= (IPTR
)MUI_AddClipping(muiRenderInfo(self
), message
->left
, message
->top
, message
->width
, message
->height
);
1075 message
->width
= _mwidth(self
);
1076 message
->height
= _mheight(self
);
1077 message
->left
= _mleft(self
);
1078 message
->top
= _mtop(self
);
1080 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
1082 MUI_RemoveClipping(muiRenderInfo(self
), (APTR
)clip
);
1088 ///IconWindowIconList__MUIM_IconList_Update()
1089 IPTR IconWindowIconList__MUIM_IconList_Update
1091 Class
*CLASS
, Object
*self
, struct MUIP_IconList_Update
*message
1096 IPTR retVal
= (IPTR
)TRUE
;
1098 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
1100 struct IconList_Entry
*icon_entry
= (IPTR
)MUIV_IconList_NextIcon_Start
;
1101 Object
*prefs
= NULL
;
1102 BOOL sort_list
= FALSE
;
1104 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: (ROOT WINDOW) Causing parent to update\n"));
1105 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
1107 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: Checking for '.backdrop' files\n"));
1110 DoMethod(self
, MUIM_IconList_NextIcon
, MUIV_IconList_NextIcon_Visible
, (IPTR
)&icon_entry
);
1112 ((IPTR
)icon_entry
!= MUIV_IconList_NextIcon_End
) &&
1113 ((icon_entry
->type
== ST_ROOT
) && !(icon_entry
->flags
& ICONENTRY_VOL_OFFLINE
))
1116 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: checking entry '%s'\n", icon_entry
->label
));
1117 if (IconWindowIconList__Func_ParseBackdrop(CLASS
, self
, icon_entry
->label
))
1126 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: Check if we should show NetworkBrowser Icon ..\n"));
1128 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
1132 struct IconWindowIconVolumeList_DATA
*volumel_data
= (struct IconWindowIconVolumeList_DATA
*)data
;
1134 GET(prefs
, MUIA_IconWindowExt_NetworkBrowser_Show
, &volumel_data
->iwvcd_ShowNetworkBrowser
);
1136 #if defined(DEBUG_NETWORKBROWSER)
1137 volumel_data
->iwvcd_ShowNetworkBrowser
= TRUE
;
1140 if (volumel_data
->iwvcd_ShowNetworkBrowser
)
1142 struct DiskObject
*_nb_dob
= NULL
;
1143 _nb_dob
= GetIconTags
1145 "ENV:SYS/def_NetworkHost",
1146 ICONGETA_FailIfUnavailable
, FALSE
,
1147 ICONGETA_Label
, (IPTR
)"Network Access..",
1151 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: NetworkBrowser Icon DOB @ 0x%p\n", _nb_dob
));
1155 struct Node
*this_entry
= NULL
;
1156 if ((this_entry
= (struct Node
*)DoMethod(self
, MUIM_IconList_CreateEntry
, (IPTR
)"?wanderer.networkbrowse?", (IPTR
)"Network Access..", (IPTR
)NULL
, (IPTR
)_nb_dob
, 0)))
1158 this_entry
->ln_Pri
= 3; /// Network Access gets Priority 3 so its displayed after special dirs
1160 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: NetworkBrowser Icon Entry @ 0x%p\n", this_entry
));
1165 GET(prefs
, MUIA_IconWindowExt_UserFiles_ShowFilesFolder
, &volumel_data
->iwvcd_ShowUserFolder
);
1167 #if defined(DEBUG_SHOWUSERFILES)
1168 volumel_data
->iwvcd_ShowUserFolder
= TRUE
;
1170 if (volumel_data
->iwvcd_ShowUserFolder
)
1172 if (GetVar("SYS/Wanderer/userfiles.prefs", __icwc_intern_TxtBuff
, TXTBUFF_LEN
, GVF_GLOBAL_ONLY
) != -1)
1174 char * userfiles_path
= NULL
;
1176 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: SYS/UserFilesLocation = '%s'\n", __icwc_intern_TxtBuff
));
1178 if ((userfiles_path
= AllocVec(strlen(__icwc_intern_TxtBuff
) + 1, MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
1180 struct DiskObject
*_nb_dob
= NULL
;
1182 volumel_data
->iwvcd_UserFolderPath
= userfiles_path
;
1184 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: UserFilesLocation Path storage @ 0x%p\n", userfiles_path
));
1186 strcpy(userfiles_path
, __icwc_intern_TxtBuff
);
1188 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: UserFilesLocation Path storage contains '%s'\n", userfiles_path
));
1190 _nb_dob
= GetIconTags
1192 "ENV:SYS/def_UserHome",
1193 ICONGETA_FailIfUnavailable
, FALSE
,
1194 ICONGETA_Label
, (IPTR
)"User Files..",
1198 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: UserFiles Icon DOB @ 0x%p\n", _nb_dob
));
1202 struct Node
*this_entry
= NULL
;
1203 if ((this_entry
= (struct Node
*)DoMethod(self
, MUIM_IconList_CreateEntry
, userfiles_path
, (IPTR
)"User Files..", (IPTR
)NULL
, (IPTR
)_nb_dob
, 0)))
1205 this_entry
->ln_Pri
= 5; /// Special dirs get Priority 5
1212 if (sort_list
) DoMethod(self
, MUIM_IconList_Sort
);
1218 DoMethod(self
, MUIM_IconList_Clear
);
1224 /*** Setup ******************************************************************/