2 Copyright 2004-2009, The AROS Development Team. All rights reserved.
6 #include "portable_macros.h"
9 #define MUIMASTER_YES_INLINE_STDARG
12 //#define DEBUG_NETWORKBROWSER
13 //#define DEBUG_SHOWUSERFILES
14 #define TXTBUFF_LEN 1024
18 #include <aros/debug.h>
21 #include <exec/types.h>
22 #include <libraries/mui.h>
25 #include <zune/customclasses.h>
27 #include <zune_AROS/customclasses.h>
31 #include <proto/utility.h>
33 #include <proto/graphics.h>
34 #include <proto/exec.h>
35 #include <proto/datatypes.h>
36 #include <proto/icon.h>
39 #include <proto/dos.h>
44 #include <intuition/screens.h>
45 #include <datatypes/pictureclass.h>
46 #include <clib/macros.h>
48 #if defined(__AMIGA__) && !defined(__PPC__)
49 #define NO_INLINE_STDARG
51 #ifndef _PROTO_INTUITION_H
52 #include <proto/intuition.h>
54 #include <proto/muimaster.h>
56 #include "Classes/iconlist.h"
57 #include "Classes/iconlist_attributes.h"
58 #include "Classes/icon_attributes.h"
61 #include "wandererprefs.h"
62 #include "iconwindow.h"
63 #include "iconwindowcontents.h"
70 #define D(x) if (DEBUG) x
72 #define bug DebugPrintF
81 extern struct IconWindow_BackFill_Descriptor
*iconwindow_BackFill_Active
;
83 #define BG_DRAWFLAG 0xf00dd00f
85 /*** Instance Data **********************************************************/
87 struct IconWindowIconList_DATA
89 Object
*iwcd_IconWindow
;
90 struct RastPort
*iwcd_RastPort
;
91 struct MUI_EventHandlerNode iwcd_EventHandlerNode
;
93 struct Hook iwcd_ProcessIconListPrefs_hook
;
95 struct Hook
*iwcd_ProcessIconListPrefs_hook
;
98 IPTR iwcd_ViewPrefs_ID
;
99 Object
*iwcd_ViewPrefs_NotificationObject
;
102 struct IconWindowIconDrawerList_DATA
104 Object
*iwcd_IconWindow
;
105 struct RastPort
*iwcd_RastPort
;
106 struct MUI_EventHandlerNode iwcd_EventHandlerNode
;
108 struct Hook iwcd_ProcessIconListPrefs_hook
;
110 struct Hook
*iwcd_ProcessIconListPrefs_hook
;
113 IPTR iwcd_ViewPrefs_ID
;
114 Object
*iwcd_ViewPrefs_NotificationObject
;
115 struct NotifyRequest iwdcd_DrawerNotifyRequest
;
118 struct IconWindowIconVolumeList_DATA
120 Object
*iwcd_IconWindow
;
121 struct RastPort
*iwcd_RastPort
;
122 struct MUI_EventHandlerNode iwcd_EventHandlerNode
;
125 struct Hook iwcd_ProcessIconListPrefs_hook
;
127 struct Hook
*iwcd_ProcessIconListPrefs_hook
;
130 IPTR iwcd_ViewPrefs_ID
;
131 Object
*iwcd_ViewPrefs_NotificationObject
;
134 struct Hook iwvcd_UpdateNetworkPrefs_hook
;
136 struct Hook
*iwvcd_UpdateNetworkPrefs_hook
;
139 IPTR iwvcd_ShowNetworkBrowser
;
140 IPTR iwvcd_ShowUserFolder
;
141 char *iwvcd_UserFolderPath
;
145 struct IconWindowIconNetworkBrowserList_DATA
147 Object
*iwcd_IconWindow
;
148 struct RastPort
*iwcd_RastPort
;
149 struct MUI_EventHandlerNode iwcd_EventHandlerNode
;
151 struct Hook iwcd_ProcessIconListPrefs_hook
;
153 struct Hook
*iwcd_ProcessIconListPrefs_hook
;
156 IPTR iwcd_ViewPrefs_ID
;
157 Object
*iwcd_ViewPrefs_NotificationObject
;
158 struct Hook iwnbcd_UpdateNetworkPrefs_hook
;
159 struct List iwnbcd_NetworkClasses
;
162 static char __icwc_intern_TxtBuff
[TXTBUFF_LEN
];
164 /*** Macros *****************************************************************/
165 #define SETUP_INST_DATA struct IconWindowIconList_DATA *data = INST_DATA(CLASS, self)
167 /*** Hook functions *********************************************************/
168 ///IconWindowIconList__HookFunc_ProcessIconListPrefsFunc()
171 void, IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
,
172 AROS_UFHA(struct Hook
*, hook
, A0
),
173 AROS_UFHA(APTR
*, obj
, A2
),
174 AROS_UFHA(IPTR
*, param
, A1
)
178 HOOKPROTO(IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
, void, APTR
*obj
, IPTR
*param
)
183 /* Get our private data */
184 Object
*self
= ( Object
*)obj
;
185 IPTR CHANGED_ATTRIB
= *param
;
186 Class
*CLASS
= OCLASS(self
);
190 Object
*prefs
= NULL
;
192 D(bug("[IconWindowIconList] %s()\n", __PRETTY_FUNCTION__
));
194 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
198 IPTR attrib_Current
, attrib_Prefs
, prefs_Processing
= 0;
199 BOOL options_changed
= FALSE
;
201 D(bug("[IconWindowIconList] %s: Setting IconList options ..\n", __PRETTY_FUNCTION__
));
203 GET(prefs
, MUIA_WandererPrefs_Processing
, &prefs_Processing
);
205 switch (CHANGED_ATTRIB
)
207 case MUIA_IconList_IconListMode
:
208 GET(self
, MUIA_IconList_IconListMode
, &attrib_Current
);
210 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_IconListMode
)) != -1) &&
211 (attrib_Current
!= attrib_Prefs
))
213 D(bug("[IconWindowIconList] %s: IconList ListMode changed - updating ..\n", __PRETTY_FUNCTION__
));
214 options_changed
= TRUE
;
215 if (prefs_Processing
)
217 NNSET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
221 SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
226 case MUIA_IconList_LabelText_Mode
:
227 GET(self
, MUIA_IconList_LabelText_Mode
, &attrib_Current
);
229 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
)) != -1) &&
230 (attrib_Current
!= attrib_Prefs
))
232 D(bug("[IconWindowIconList] %s: IconList TextRenderMode changed - updating ..\n", __PRETTY_FUNCTION__
));
233 options_changed
= TRUE
;
234 if (prefs_Processing
)
236 NNSET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
240 SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
245 case MUIA_IconList_LabelText_MaxLineLen
:
246 GET(self
, MUIA_IconList_LabelText_MaxLineLen
, &attrib_Current
);
248 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
)) != -1) &&
249 (attrib_Current
!= attrib_Prefs
))
251 D(bug("[IconWindowIconList] %s: IconList Max Text Length changed - updating ..\n", __PRETTY_FUNCTION__
));
252 options_changed
= TRUE
;
253 if (prefs_Processing
)
255 NNSET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
259 SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
264 case MUIA_IconList_LabelText_MultiLine
:
265 GET(self
, MUIA_IconList_LabelText_MultiLine
, &attrib_Current
);
267 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
)) != -1) &&
268 (attrib_Current
!= attrib_Prefs
))
270 D(bug("[IconWindowIconList] %s: IconList Multi-Line changed - updating ..\n", __PRETTY_FUNCTION__
));
271 options_changed
= TRUE
;
272 if (prefs_Processing
)
274 NNSET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
278 SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
283 case MUIA_IconList_LabelText_MultiLineOnFocus
:
284 GET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, &attrib_Current
);
286 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
)) != -1) &&
287 (attrib_Current
!= attrib_Prefs
))
289 D(bug("[IconWindowIconList] %s: Multi-Line on Focus changed - updating ..\n", __PRETTY_FUNCTION__
));
290 options_changed
= TRUE
;
291 if (prefs_Processing
)
293 NNSET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
297 SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
302 case MUIA_IconList_Icon_HorizontalSpacing
:
303 GET(self
, MUIA_IconList_Icon_HorizontalSpacing
, &attrib_Current
);
305 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
)) != -1) &&
306 (attrib_Current
!= attrib_Prefs
))
308 D(bug("[IconWindowIconList] %s: Icon Horizontal Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
309 options_changed
= TRUE
;
310 if (prefs_Processing
)
312 NNSET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
316 SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
321 case MUIA_IconList_Icon_VerticalSpacing
:
322 GET(self
, MUIA_IconList_Icon_VerticalSpacing
, &attrib_Current
);
324 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
)) != -1) &&
325 (attrib_Current
!= attrib_Prefs
))
327 D(bug("[IconWindowIconList] %s: Icon Vertical Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
328 options_changed
= TRUE
;
329 if (prefs_Processing
)
331 NNSET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
335 SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
340 case MUIA_IconList_Icon_ImageSpacing
:
341 GET(self
, MUIA_IconList_Icon_ImageSpacing
, &attrib_Current
);
343 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
)) != -1) &&
344 (attrib_Current
!= attrib_Prefs
))
346 D(bug("[IconWindowIconList] %s: Icon Label Image Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
347 options_changed
= TRUE
;
348 if (prefs_Processing
)
350 NNSET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
354 SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
359 case MUIA_IconList_LabelText_HorizontalPadding
:
360 GET(self
, MUIA_IconList_LabelText_HorizontalPadding
, &attrib_Current
);
362 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
)) != -1) &&
363 (attrib_Current
!= attrib_Prefs
))
365 D(bug("[IconWindowIconList] %s: Icon Label Horizontal Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
366 options_changed
= TRUE
;
367 if (prefs_Processing
)
369 NNSET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
373 SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
378 case MUIA_IconList_LabelText_VerticalPadding
:
379 GET(self
, MUIA_IconList_LabelText_VerticalPadding
, &attrib_Current
);
381 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
)) != -1) &&
382 (attrib_Current
!= attrib_Prefs
))
384 D(bug("[IconWindowIconList] %s: Icon Label Vertical Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
385 options_changed
= TRUE
;
386 if (prefs_Processing
)
388 NNSET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
392 SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
397 case MUIA_IconList_LabelText_BorderWidth
:
398 GET(self
, MUIA_IconList_LabelText_BorderWidth
, &attrib_Current
);
400 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
)) != -1) &&
401 (attrib_Current
!= attrib_Prefs
))
403 D(bug("[IconWindowIconList] %s: Icon Label Border Width changed - updating ..\n", __PRETTY_FUNCTION__
));
404 options_changed
= TRUE
;
405 if (prefs_Processing
)
407 NNSET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
411 SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
416 case MUIA_IconList_LabelText_BorderHeight
:
417 GET(self
, MUIA_IconList_LabelText_BorderHeight
, &attrib_Current
);
419 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
)) != -1) &&
420 (attrib_Current
!= attrib_Prefs
))
422 D(bug("[IconWindowIconList] %s: Icon Label Border Height changed - updating ..\n", __PRETTY_FUNCTION__
));
423 options_changed
= TRUE
;
424 if (prefs_Processing
)
426 NNSET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
430 SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
436 D(bug("[IconWindowIconList] %s: Unhandled change\n", __PRETTY_FUNCTION__
));
442 if (!(prefs_Processing
))
444 D(bug("[IconWindowIconList] %s: IconList Options have changed, causing an update ..\n", __PRETTY_FUNCTION__
));
445 DoMethod(self
, MUIM_IconList_Update
);
447 else if (data
->iwcd_IconWindow
)
449 SET(data
->iwcd_IconWindow
, MUIA_IconWindow_Changed
, TRUE
);
456 MakeStaticHook(Hook_ProcessIconListPrefsFunc
,IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
);
460 ///IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc()
463 void, IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
,
464 AROS_UFHA(struct Hook
*, hook
, A0
),
465 AROS_UFHA(APTR
*, obj
, A2
),
466 AROS_UFHA(APTR
, param
, A1
)
470 HOOKPROTO(IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
, void, APTR
*obj
, APTR param
)
475 /* Get our private data */
476 Object
*self
= ( Object
*)obj
;
477 Object
*prefs
= NULL
;
478 Class
*CLASS
= *( Class
**)param
;
482 D(bug("[IconWindowIconList] %s()\n", __PRETTY_FUNCTION__
));
484 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
488 BOOL options_changed
= FALSE
;
489 IPTR prefs_Processing
= 0;
491 GET(prefs
, MUIA_WandererPrefs_Processing
, &prefs_Processing
);
493 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
495 ULONG current_ShowNetwork
;
496 ULONG prefs_ShowNetwork
;
498 D(bug("[IconWindowIconList] %s: Setting ROOT view Network options ..\n", __PRETTY_FUNCTION__
));
499 current_ShowNetwork
= 0;
501 GET(self
, MUIA_IconWindowExt_NetworkBrowser_Show
, ¤t_ShowNetwork
);
503 D(bug("[IconWindowIconList] %s: Current = %d\n", __PRETTY_FUNCTION__
, current_ShowNetwork
));
505 prefs_ShowNetwork
= 0;
507 GET(prefs
, MUIA_IconWindowExt_NetworkBrowser_Show
, &prefs_ShowNetwork
);
509 D(bug("[IconWindowIconList] %s: Prefs = %d\n", __PRETTY_FUNCTION__
, prefs_ShowNetwork
));
511 if ((BOOL
)current_ShowNetwork
!= (BOOL
)prefs_ShowNetwork
)
513 D(bug("[IconWindowIconList] %s: ROOT view Network prefs changed - updating ..\n", __PRETTY_FUNCTION__
));
514 options_changed
= TRUE
;
515 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_ShowNetworkBrowser
= prefs_ShowNetwork
;
518 if ((options_changed
) && !(prefs_Processing
))
520 D(bug("[IconWindowIconList] %s: Network prefs changed, causing an update ..\n", __PRETTY_FUNCTION__
));
521 DoMethod(self
, MUIM_IconList_Update
);
523 else if (data
->iwcd_IconWindow
)
525 SET(data
->iwcd_IconWindow
, MUIA_IconWindow_Changed
, TRUE
);
531 MakeStaticHook(Hook_UpdateNetworkPrefsFunc
,IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
);
534 #define BDRPLINELEN_MAX 1024
535 BOOL
IconWindowIconList__Func_ParseBackdrop(Class
*CLASS
, Object
*self
, char *bdrp_dir
)
537 BPTR bdrp_lock
= (BPTR
)NULL
;
538 char *bdrp_file
= NULL
, *linebuf
= NULL
, *bdrp_fullfile
= NULL
, *bdrp_namepart
= NULL
;
539 struct DiskObject
*bdrp_currfile_dob
= NULL
;
542 if ((bdrp_dir
== NULL
) || (bdrp_dir
[strlen(bdrp_dir
) - 1] != ':'))
545 if ((bdrp_file
= AllocVec(strlen(bdrp_dir
) + 9 + 1, MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
547 sprintf(bdrp_file
, "%s.backdrop", bdrp_dir
);
548 if ((bdrp_lock
= Open(bdrp_file
, MODE_OLDFILE
)))
550 D(bug("[IconWindowIconList] IconWindowIconList__Func_ParseBackdrop: Loading config file: '%s'\n", bdrp_file
));
551 if ((linebuf
= AllocMem(BDRPLINELEN_MAX
, MEMF_PUBLIC
)) != NULL
)
553 while (FGets(bdrp_lock
, linebuf
, BDRPLINELEN_MAX
))
559 linelen
= strlen(linebuf
) - 1; /* drop the newline char */
560 linebuf
[linelen
] = '\0';
562 if ((bdrp_fullfile
= AllocVec(linelen
+ strlen(bdrp_dir
), MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
564 sprintf(bdrp_fullfile
, "%s%s", bdrp_dir
, &linebuf
[1]);
565 bdrp_namepart
= FilePart(bdrp_fullfile
);
566 bdrp_currfile_dob
= GetIconTags
569 ICONGETA_FailIfUnavailable
, FALSE
,
570 ICONGETA_Label
, bdrp_namepart
,
574 D(bug("[IconWindowIconList] IconWindowIconList__Func_ParseBackdrop: LEAVEOUT Icon '%s' ('%s') DOB @ 0x%p\n", bdrp_fullfile
, bdrp_namepart
, bdrp_currfile_dob
));
576 if (bdrp_currfile_dob
)
578 struct IconEntry
*this_entry
= NULL
;
579 if ((this_entry
= (struct IconEntry
*)DoMethod(self
, MUIM_IconList_CreateEntry
, (IPTR
)bdrp_fullfile
, (IPTR
)bdrp_namepart
, (IPTR
)NULL
, (IPTR
)bdrp_currfile_dob
, 0)))
581 struct FileInfoBlock
*fib
= AllocDosObject(DOS_FIB
, NULL
);
584 BPTR fib_lock
= (BPTR
)NULL
;
585 if ((fib_lock
= Lock(bdrp_fullfile
, SHARED_LOCK
)) != NULL
)
587 if (Examine(fib_lock
, fib
))
589 if (fib
->fib_DirEntryType
== ST_FILE
)
591 this_entry
->ile_IconListEntry
.type
= ST_LINKFILE
;
592 D(bug("[IconWindowIconList] %s: LEAVEOUT ST_LINKFILE Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
594 else if (fib
->fib_DirEntryType
== ST_USERDIR
)
596 this_entry
->ile_IconListEntry
.type
= ST_LINKDIR
;
597 D(bug("[IconWindowIconList] %s: LEAVEOUT ST_LINKDIR Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
601 D(bug("[IconWindowIconList] %s: LEAVEOUT Unknown Entry Type @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
606 FreeDosObject(DOS_FIB
, fib
);
613 FreeMem(linebuf
, BDRPLINELEN_MAX
);
623 /*** Methods ****************************************************************/
625 Object
*IconWindowIconList__OM_NEW(Class
*CLASS
, Object
*self
, struct opSet
*message
)
627 IPTR _newIconList__FSNotifyPort
= 0;
629 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW()\n"));
631 _newIconList__FSNotifyPort
= GetTagData(MUIA_Wanderer_FileSysNotifyPort
, (IPTR
) NULL
, message
->ops_AttrList
);
633 self
= (Object
*) DoSuperNewTags
637 TAG_MORE
, (IPTR
) message
->ops_AttrList
643 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW: SELF = 0x%p\n", self
));
646 data
->iwcd_ProcessIconListPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
;
648 data
->iwcd_ProcessIconListPrefs_hook
= &Hook_ProcessIconListPrefsFunc
;
651 if (_newIconList__FSNotifyPort
!= 0)
653 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
654 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
= _newIconList__FSNotifyPort
;
655 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW: FS Notify Port @ 0x%p\n", _newIconList__FSNotifyPort
));
658 D(bug("[IconWindowIconList] obj = %ld\n", self
));
664 IPTR
IconWindowIconList__OM_SET(Class
*CLASS
, Object
*self
, struct opSet
*message
)
668 struct TagItem
*tstate
= message
->ops_AttrList
, *tag
;
670 while ((tag
= NextTagItem((const struct TagItem
**)&tstate
)) != NULL
)
674 case MUIA_Background
:
676 D(bug("[IconWindowIconList] %s: MUIA_Background\n", __PRETTY_FUNCTION__
));
679 case MUIA_IconWindow_Window
:
681 D(bug("[IconWindowIconList] %s: MUIA_IconWindow_Window @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
682 data
->iwcd_IconWindow
= (Object
*)tag
->ti_Data
;
685 case MUIA_IconList_BufferRastport
:
687 D(bug("[IconWindowIconList] %s: MUIA_IconList_BufferRastport @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
688 data
->iwcd_RastPort
= (struct RastPort
*)tag
->ti_Data
;
693 return DoSuperMethodA(CLASS
, self
, (Msg
) message
);
698 IPTR
IconWindowIconList__OM_GET(Class
*CLASS
, Object
*self
, struct opGet
*message
)
701 //IPTR *store = message->opg_Storage;
704 switch (message
->opg_AttrID
)
707 rv
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
714 ///IconWindowIconList__MUIM_Setup()
715 IPTR IconWindowIconList__MUIM_Setup
717 Class
*CLASS
, Object
*self
, Msg message
722 Object
*prefs
= NULL
;
724 if (!DoSuperMethodA(CLASS
, self
, message
)) return FALSE
;
726 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
730 /* Set our initial options */
733 GET(_win(self
), MUIA_IconWindow_BackgroundAttrib
, &data
->iwcd_ViewPrefs_ID
);
734 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Setup: Window Background = '%s'\n", data
->iwcd_ViewPrefs_ID
));
735 data
->iwcd_ViewPrefs_NotificationObject
= (Object
*)DoMethod(prefs
,
736 MUIM_WandererPrefs_ViewSettings_GetNotifyObject
,
737 data
->iwcd_ViewPrefs_ID
);
739 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Setup: Background Notification Obj @ 0x%p\n", data
->iwcd_ViewPrefs_NotificationObject
));
743 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_IconListMode
);
744 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_IconListMode
))) SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
746 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
);
747 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_Mode
))) SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
749 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
);
750 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MaxLineLen
))) SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
752 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
);
753 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLine
))) SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
755 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
);
756 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
))) SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
758 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
);
759 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_HorizontalSpacing
))) SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
761 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
);
762 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_VerticalSpacing
))) SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
764 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
);
765 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_ImageSpacing
))) SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
767 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
);
768 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_HorizontalPadding
))) SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
770 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
);
771 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_VerticalPadding
))) SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
773 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
);
774 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderWidth
))) SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
776 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
);
777 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderHeight
))) SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
779 /* Configure notifications incase they get updated =) */
782 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_IconListMode
, MUIV_EveryTime
,
784 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_IconListMode
789 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_Mode
, MUIV_EveryTime
,
791 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_Mode
796 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MaxLineLen
, MUIV_EveryTime
,
798 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MaxLineLen
803 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLine
, MUIV_EveryTime
,
805 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLine
810 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLineOnFocus
, MUIV_EveryTime
,
812 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLineOnFocus
817 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_HorizontalSpacing
, MUIV_EveryTime
,
819 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_HorizontalSpacing
824 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_VerticalSpacing
, MUIV_EveryTime
,
826 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_VerticalSpacing
831 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_ImageSpacing
, MUIV_EveryTime
,
833 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_ImageSpacing
838 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_HorizontalPadding
, MUIV_EveryTime
,
840 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_HorizontalPadding
845 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_VerticalPadding
, MUIV_EveryTime
,
847 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_VerticalPadding
852 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderWidth
, MUIV_EveryTime
,
854 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderWidth
859 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderHeight
, MUIV_EveryTime
,
861 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderHeight
865 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
870 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
;
872 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
= &Hook_UpdateNetworkPrefsFunc
;
878 prefs
, MUIM_Notify
, MUIA_IconWindowExt_NetworkBrowser_Show
, MUIV_EveryTime
,
880 MUIM_CallHook
, &((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
, (IPTR
)CLASS
884 if (muiRenderInfo(self
))
886 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Setting up EventHandler for (IDCMP_DISKINSERTED | IDCMP_DISKREMOVED)\n"));
888 data
->iwcd_EventHandlerNode
.ehn_Priority
= 1;
889 data
->iwcd_EventHandlerNode
.ehn_Flags
= MUI_EHF_GUIMODE
;
890 data
->iwcd_EventHandlerNode
.ehn_Object
= self
;
891 data
->iwcd_EventHandlerNode
.ehn_Class
= CLASS
;
892 data
->iwcd_EventHandlerNode
.ehn_Events
= IDCMP_DISKINSERTED
| IDCMP_DISKREMOVED
;
894 DoMethod(_win(self
), MUIM_Window_AddEventHandler
, &data
->iwcd_EventHandlerNode
);
898 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Couldnt add IDCMP EventHandler!\n"));
903 /* Setup notification on the directory -------------------------------- */
904 STRPTR directory_path
= NULL
;
905 GET(self
, MUIA_IconDrawerList_Drawer
, &directory_path
);
907 if (directory_path
!= NULL
)
909 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
911 if (drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
!= NULL
)
913 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
= directory_path
;
914 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Flags
= NRF_SEND_MESSAGE
;
915 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_UserData
= self
;
917 if (StartNotify(&drawerlist_data
->iwdcd_DrawerNotifyRequest
))
919 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Drawer-notification setup on '%s'\n", drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
));
923 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: FAILED to setup Drawer-notification!\n"));
924 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
= NULL
;
930 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Setup complete!\n"));
936 ///IconWindowIconList__MUIM_Cleanup()
937 IPTR IconWindowIconList__MUIM_Cleanup
939 Class
*CLASS
, Object
*self
, Msg message
944 Object
*prefs
= NULL
;
946 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup()\n"));
947 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
953 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_IconListMode
, (IPTR
)self
958 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_Mode
, (IPTR
)self
963 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MaxLineLen
, (IPTR
)self
968 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLine
, (IPTR
)self
973 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLineOnFocus
, (IPTR
)self
978 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_HorizontalSpacing
, (IPTR
)self
983 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_VerticalSpacing
, (IPTR
)self
988 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_ImageSpacing
, (IPTR
)self
993 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_HorizontalPadding
, (IPTR
)self
998 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_VerticalPadding
, (IPTR
)self
1003 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderWidth
, (IPTR
)self
1008 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderHeight
, (IPTR
)self
1012 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
1019 MUIM_KillNotifyObj
, MUIA_IconWindowExt_NetworkBrowser_Show
, (IPTR
) self
1022 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup: (ROOT WINDOW) Removing our Disk Event Handler\n"));
1023 DoMethod(_win(self
), MUIM_Window_RemEventHandler
, &data
->iwcd_EventHandlerNode
);
1027 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
1028 if (drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
!= NULL
)
1030 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup: (DRAWER WINDOW) Removing our Drawer Notification Request\n"));
1031 EndNotify(&drawerlist_data
->iwdcd_DrawerNotifyRequest
);
1035 return DoSuperMethodA(CLASS
, self
, message
);
1039 ///IconWindowIconList__MUIM_HandleEvent()
1040 IPTR IconWindowIconList__MUIM_HandleEvent
1042 Class
*CLASS
, Object
*self
, struct MUIP_HandleEvent
*message
1047 struct IntuiMessage
*imsg
= message
->imsg
;
1049 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent()\n"));
1051 if(imsg
->Class
== IDCMP_DISKINSERTED
)
1053 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent: IDCMP_DISKINSERTED\n"));
1054 DoMethod(self
, MUIM_IconList_Update
);
1055 return(MUI_EventHandlerRC_Eat
);
1057 else if (imsg
->Class
== IDCMP_DISKREMOVED
)
1059 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent: IDCMP_DISKREMOVED\n"));
1060 DoMethod(self
, MUIM_IconList_Update
);
1061 return(MUI_EventHandlerRC_Eat
);
1067 ///IconWindowIconList__MUIM_DrawBackground()
1068 IPTR IconWindowIconList__MUIM_DrawBackground
1070 Class
*CLASS
, Object
*self
, struct MUIP_DrawBackground
*message
1075 IPTR retVal
= (IPTR
)TRUE
;
1077 struct RastPort
*DrawBackGround_RastPort
;
1078 struct IconWindowBackFillMsg DrawBackGround_BackFillMsg
;
1080 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground()\n"));
1082 if ((iconwindow_BackFill_Active
== NULL
) ||
1083 (data
->iwcd_IconWindow
== NULL
))
1085 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: No Backfill support/Window not set .. causing parent class to render\n"));
1086 goto iwc_ParentBackground
;
1089 DrawBackGround_RastPort
= _rp(self
);
1092 if ((data
->iwcd_RastPort
!= NULL
) && (DrawBackGround_RastPort
!= data
->iwcd_RastPort
))
1094 DrawBackGround_RastPort
= data
->iwcd_RastPort
;
1096 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= 0;
1097 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= 0;
1098 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= _mwidth(self
);
1099 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= _mheight(self
);
1101 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
- _mleft(self
);
1102 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
- _mtop(self
);
1103 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= message
->width
;
1104 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= message
->height
;
1108 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= _mleft(self
);
1109 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= _mtop(self
);
1110 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= (_mleft(self
) + _mwidth(self
));
1111 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= (_mtop(self
) + _mheight(self
));
1113 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
;
1114 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
;
1115 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= (message
->left
+ message
->width
);
1116 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= (message
->top
+ message
->height
);
1119 DrawBackGround_BackFillMsg
.Layer
= DrawBackGround_RastPort
->Layer
;
1121 /* Offset into source image (ala scroll bar position) */
1122 DrawBackGround_BackFillMsg
.OffsetX
= message
->xoffset
;
1123 DrawBackGround_BackFillMsg
.OffsetY
= message
->yoffset
;
1125 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: RastPort @ 0x%p\n", DrawBackGround_RastPort
));
1127 if ((retVal
= DoMethod(data
->iwcd_IconWindow
, MUIM_IconWindow_BackFill_DrawBackground
, XGET(data
->iwcd_IconWindow
, MUIA_IconWindow_BackFillData
), &DrawBackGround_BackFillMsg
, DrawBackGround_RastPort
)) == (IPTR
)TRUE
)
1129 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: Backfill module rendered background ..\n"));
1132 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: Backfill module failed to render background ..\n"));
1134 iwc_ParentBackground
:
1136 clip
= (IPTR
)MUI_AddClipping(muiRenderInfo(self
), message
->left
, message
->top
, message
->width
, message
->height
);
1138 message
->width
= _mwidth(self
);
1139 message
->height
= _mheight(self
);
1140 message
->left
= _mleft(self
);
1141 message
->top
= _mtop(self
);
1143 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
1145 MUI_RemoveClipping(muiRenderInfo(self
), (APTR
)clip
);
1151 ///IconWindowIconList__MUIM_IconList_Update()
1152 IPTR IconWindowIconList__MUIM_IconList_Update
1154 Class
*CLASS
, Object
*self
, struct MUIP_IconList_Update
*message
1159 IPTR retVal
= (IPTR
)TRUE
;
1161 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
1163 struct IconList_Entry
*icon_entry
= (IPTR
)MUIV_IconList_NextIcon_Start
;
1164 Object
*prefs
= NULL
;
1165 BOOL sort_list
= FALSE
;
1167 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: (ROOT WINDOW) Causing parent to update\n"));
1168 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
1170 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: Checking for '.backdrop' files\n"));
1173 DoMethod(self
, MUIM_IconList_NextIcon
, MUIV_IconList_NextIcon_Visible
, (IPTR
)&icon_entry
);
1175 ((IPTR
)icon_entry
!= MUIV_IconList_NextIcon_End
) &&
1176 ((icon_entry
->type
== ST_ROOT
) && !(icon_entry
->flags
& ICONENTRY_VOL_OFFLINE
))
1179 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: checking entry '%s'\n", icon_entry
->label
));
1180 if (IconWindowIconList__Func_ParseBackdrop(CLASS
, self
, icon_entry
->label
))
1189 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: Check if we should show NetworkBrowser Icon ..\n"));
1191 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
1195 struct IconWindowIconVolumeList_DATA
*volumel_data
= (struct IconWindowIconVolumeList_DATA
*)data
;
1197 GET(prefs
, MUIA_IconWindowExt_NetworkBrowser_Show
, &volumel_data
->iwvcd_ShowNetworkBrowser
);
1199 #if defined(DEBUG_NETWORKBROWSER)
1200 volumel_data
->iwvcd_ShowNetworkBrowser
= TRUE
;
1203 if (volumel_data
->iwvcd_ShowNetworkBrowser
)
1205 struct DiskObject
*_nb_dob
= NULL
;
1206 _nb_dob
= GetIconTags
1208 "ENV:SYS/def_NetworkHost",
1209 ICONGETA_FailIfUnavailable
, FALSE
,
1210 ICONGETA_Label
, (IPTR
)"Network Access..",
1214 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: NetworkBrowser Icon DOB @ 0x%p\n", _nb_dob
));
1218 struct Node
*this_entry
= NULL
;
1219 if ((this_entry
= (struct Node
*)DoMethod(self
, MUIM_IconList_CreateEntry
, (IPTR
)"?wanderer.networkbrowse?", (IPTR
)"Network Access..", (IPTR
)NULL
, (IPTR
)_nb_dob
, 0)))
1221 this_entry
->ln_Pri
= 3; /// Network Access gets Priority 3 so its displayed after special dirs
1223 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: NetworkBrowser Icon Entry @ 0x%p\n", this_entry
));
1228 GET(prefs
, MUIA_IconWindowExt_UserFiles_ShowFilesFolder
, &volumel_data
->iwvcd_ShowUserFolder
);
1230 #if defined(DEBUG_SHOWUSERFILES)
1231 volumel_data
->iwvcd_ShowUserFolder
= TRUE
;
1233 if (volumel_data
->iwvcd_ShowUserFolder
)
1235 if (GetVar("SYS/UserFilesLocation", __icwc_intern_TxtBuff
, TXTBUFF_LEN
, GVF_GLOBAL_ONLY
) != -1)
1237 char * userfiles_path
= NULL
;
1239 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: SYS/UserFilesLocation = '%s'\n", __icwc_intern_TxtBuff
));
1241 if ((userfiles_path
= AllocVec(strlen(__icwc_intern_TxtBuff
) + 1, MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
1243 struct DiskObject
*_nb_dob
= NULL
;
1245 volumel_data
->iwvcd_UserFolderPath
= userfiles_path
;
1247 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: UserFilesLocation Path storage @ 0x%p\n", userfiles_path
));
1249 strcpy(userfiles_path
, __icwc_intern_TxtBuff
);
1251 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: UserFilesLocation Path storage contains '%s'\n", userfiles_path
));
1253 _nb_dob
= GetIconTags
1255 "ENV:SYS/def_UserHome",
1256 ICONGETA_FailIfUnavailable
, FALSE
,
1257 ICONGETA_Label
, (IPTR
)"User Files..",
1261 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: UserFiles Icon DOB @ 0x%p\n", _nb_dob
));
1265 struct Node
*this_entry
= NULL
;
1266 if ((this_entry
= (struct Node
*)DoMethod(self
, MUIM_IconList_CreateEntry
, userfiles_path
, (IPTR
)"User Files..", (IPTR
)NULL
, (IPTR
)_nb_dob
, 0)))
1268 this_entry
->ln_Pri
= 5; /// Special dirs get Priority 5
1275 if (sort_list
) DoMethod(self
, MUIM_IconList_Sort
);
1281 DoMethod(self
, MUIM_IconList_Clear
);
1287 /*** Setup ******************************************************************/
1289 ICONWINDOWICONDRAWERLIST_CUSTOMCLASS
1291 IconWindowIconDrawerList
, IconWindowIconList
, NULL
, MUIC_IconDrawerList
, NULL
,
1292 OM_NEW
, struct opSet
*,
1293 OM_SET
, struct opSet
*,
1294 OM_GET
, struct opGet
*,
1297 MUIM_DrawBackground
, Msg
1300 ICONWINDOWICONVOLUMELIST_CUSTOMCLASS
1302 IconWindowIconVolumeList
, IconWindowIconList
, NULL
, MUIC_IconVolumeList
, NULL
,
1303 OM_NEW
, struct opSet
*,
1304 OM_SET
, struct opSet
*,
1305 OM_GET
, struct opGet
*,
1308 MUIM_DrawBackground
, Msg
,
1309 MUIM_HandleEvent
, Msg
,
1310 MUIM_IconList_Update
, struct MUIP_IconList_Update
*
1313 ICONWINDOWICONNETWORKBROWSERLIST_CUSTOMCLASS
1315 IconWindowIconNetworkBrowserList
, IconWindowIconList
, NULL
, MUIC_IconList
, NULL
,
1316 OM_NEW
, struct opSet
*,
1317 OM_SET
, struct opSet
*,
1318 OM_GET
, struct opGet
*,
1321 MUIM_DrawBackground
, Msg
,
1322 MUIM_HandleEvent
, Msg
,
1323 MUIM_IconList_Update
, struct MUIP_IconList_Update
*
1327 ICONWINDOWICONDRAWERLIST_CUSTOMCLASS
1329 IconWindowIconDrawerList
, IconWindowIconList
, NULL
, NULL
, IconDrawerList_Class
,
1330 OM_NEW
, struct opSet
*,
1331 OM_SET
, struct opSet
*,
1332 OM_GET
, struct opGet
*,
1335 MUIM_DrawBackground
, Msg
1338 ICONWINDOWICONVOLUMELIST_CUSTOMCLASS
1340 IconWindowIconVolumeList
, IconWindowIconList
, NULL
, NULL
, IconVolumeList_Class
,
1341 OM_NEW
, struct opSet
*,
1342 OM_SET
, struct opSet
*,
1343 OM_GET
, struct opGet
*,
1346 MUIM_DrawBackground
, Msg
,
1347 MUIM_HandleEvent
, Msg
,
1348 MUIM_IconList_Update
, struct MUIP_IconList_Update
*
1351 ICONWINDOWICONNETWORKBROWSERLIST_CUSTOMCLASS
1353 IconWindowIconNetworkBrowserList
, IconWindowIconList
, NULL
, NULL
, IconList_Class
,
1354 OM_NEW
, struct opSet
*,
1355 OM_SET
, struct opSet
*,
1356 OM_GET
, struct opGet
*,
1359 MUIM_DrawBackground
, Msg
,
1360 MUIM_HandleEvent
, Msg
,
1361 MUIM_IconList_Update
, struct MUIP_IconList_Update
*