2 Copyright 2004-2013, 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 "iconwindow_iconlist.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
;
124 struct Hook iwcd_ProcessIconListPrefs_hook
;
126 struct Hook
*iwcd_ProcessIconListPrefs_hook
;
129 IPTR iwcd_ViewPrefs_ID
;
130 Object
*iwcd_ViewPrefs_NotificationObject
;
132 struct Hook iwvcd_UpdateNetworkPrefs_hook
;
134 struct Hook
*iwvcd_UpdateNetworkPrefs_hook
;
137 IPTR iwvcd_ShowNetworkBrowser
;
138 IPTR iwvcd_ShowUserFolder
;
141 struct IconWindowIconNetworkBrowserList_DATA
143 Object
*iwcd_IconWindow
;
144 struct RastPort
*iwcd_RastPort
;
145 struct MUI_EventHandlerNode iwcd_EventHandlerNode
;
147 struct Hook iwcd_ProcessIconListPrefs_hook
;
149 struct Hook
*iwcd_ProcessIconListPrefs_hook
;
152 IPTR iwcd_ViewPrefs_ID
;
153 Object
*iwcd_ViewPrefs_NotificationObject
;
154 struct Hook iwnbcd_UpdateNetworkPrefs_hook
;
155 struct List iwnbcd_NetworkClasses
;
158 static char __icwc_intern_TxtBuff
[TXTBUFF_LEN
];
160 /*** Macros *****************************************************************/
161 #define SETUP_INST_DATA struct IconWindowIconList_DATA *data = INST_DATA(CLASS, self)
163 /*** Hook functions *********************************************************/
164 ///IconWindowIconList__HookFunc_ProcessIconListPrefsFunc()
167 void, IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
,
168 AROS_UFHA(struct Hook
*, hook
, A0
),
169 AROS_UFHA(APTR
*, obj
, A2
),
170 AROS_UFHA(IPTR
*, param
, A1
)
174 HOOKPROTO(IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
, void, APTR
*obj
, IPTR
*param
)
179 /* Get our private data */
180 Object
*self
= ( Object
*)obj
;
181 IPTR CHANGED_ATTRIB
= *param
;
182 Class
*CLASS
= OCLASS(self
);
186 Object
*prefs
= NULL
;
188 D(bug("[IconWindowIconList] %s()\n", __PRETTY_FUNCTION__
));
190 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
194 IPTR attrib_Current
, attrib_Prefs
, prefs_Processing
= 0;
195 BOOL options_changed
= FALSE
;
197 D(bug("[IconWindowIconList] %s: Setting IconList options ..\n", __PRETTY_FUNCTION__
));
199 GET(prefs
, MUIA_WandererPrefs_Processing
, &prefs_Processing
);
201 switch (CHANGED_ATTRIB
)
203 case MUIA_IconList_IconListMode
:
204 GET(self
, MUIA_IconList_IconListMode
, &attrib_Current
);
206 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_IconListMode
)) != -1) &&
207 (attrib_Current
!= attrib_Prefs
))
209 D(bug("[IconWindowIconList] %s: IconList ListMode changed - updating ..\n", __PRETTY_FUNCTION__
));
210 options_changed
= TRUE
;
211 if (prefs_Processing
)
213 NNSET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
217 SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
222 case MUIA_IconList_LabelText_Mode
:
223 GET(self
, MUIA_IconList_LabelText_Mode
, &attrib_Current
);
225 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
)) != -1) &&
226 (attrib_Current
!= attrib_Prefs
))
228 D(bug("[IconWindowIconList] %s: IconList TextRenderMode changed - updating ..\n", __PRETTY_FUNCTION__
));
229 options_changed
= TRUE
;
230 if (prefs_Processing
)
232 NNSET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
236 SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
241 case MUIA_IconList_LabelText_MaxLineLen
:
242 GET(self
, MUIA_IconList_LabelText_MaxLineLen
, &attrib_Current
);
244 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
)) != -1) &&
245 (attrib_Current
!= attrib_Prefs
))
247 D(bug("[IconWindowIconList] %s: IconList Max Text Length changed - updating ..\n", __PRETTY_FUNCTION__
));
248 options_changed
= TRUE
;
249 if (prefs_Processing
)
251 NNSET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
255 SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
260 case MUIA_IconList_LabelText_MultiLine
:
261 GET(self
, MUIA_IconList_LabelText_MultiLine
, &attrib_Current
);
263 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
)) != -1) &&
264 (attrib_Current
!= attrib_Prefs
))
266 D(bug("[IconWindowIconList] %s: IconList Multi-Line changed - updating ..\n", __PRETTY_FUNCTION__
));
267 options_changed
= TRUE
;
268 if (prefs_Processing
)
270 NNSET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
274 SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
279 case MUIA_IconList_LabelText_MultiLineOnFocus
:
280 GET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, &attrib_Current
);
282 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
)) != -1) &&
283 (attrib_Current
!= attrib_Prefs
))
285 D(bug("[IconWindowIconList] %s: Multi-Line on Focus changed - updating ..\n", __PRETTY_FUNCTION__
));
286 options_changed
= TRUE
;
287 if (prefs_Processing
)
289 NNSET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
293 SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
298 case MUIA_IconList_Icon_HorizontalSpacing
:
299 GET(self
, MUIA_IconList_Icon_HorizontalSpacing
, &attrib_Current
);
301 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
)) != -1) &&
302 (attrib_Current
!= attrib_Prefs
))
304 D(bug("[IconWindowIconList] %s: Icon Horizontal Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
305 options_changed
= TRUE
;
306 if (prefs_Processing
)
308 NNSET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
312 SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
317 case MUIA_IconList_Icon_VerticalSpacing
:
318 GET(self
, MUIA_IconList_Icon_VerticalSpacing
, &attrib_Current
);
320 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
)) != -1) &&
321 (attrib_Current
!= attrib_Prefs
))
323 D(bug("[IconWindowIconList] %s: Icon Vertical Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
324 options_changed
= TRUE
;
325 if (prefs_Processing
)
327 NNSET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
331 SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
336 case MUIA_IconList_Icon_ImageSpacing
:
337 GET(self
, MUIA_IconList_Icon_ImageSpacing
, &attrib_Current
);
339 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
)) != -1) &&
340 (attrib_Current
!= attrib_Prefs
))
342 D(bug("[IconWindowIconList] %s: Icon Label Image Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
343 options_changed
= TRUE
;
344 if (prefs_Processing
)
346 NNSET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
350 SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
355 case MUIA_IconList_LabelText_HorizontalPadding
:
356 GET(self
, MUIA_IconList_LabelText_HorizontalPadding
, &attrib_Current
);
358 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
)) != -1) &&
359 (attrib_Current
!= attrib_Prefs
))
361 D(bug("[IconWindowIconList] %s: Icon Label Horizontal Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
362 options_changed
= TRUE
;
363 if (prefs_Processing
)
365 NNSET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
369 SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
374 case MUIA_IconList_LabelText_VerticalPadding
:
375 GET(self
, MUIA_IconList_LabelText_VerticalPadding
, &attrib_Current
);
377 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
)) != -1) &&
378 (attrib_Current
!= attrib_Prefs
))
380 D(bug("[IconWindowIconList] %s: Icon Label Vertical Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
381 options_changed
= TRUE
;
382 if (prefs_Processing
)
384 NNSET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
388 SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
393 case MUIA_IconList_LabelText_BorderWidth
:
394 GET(self
, MUIA_IconList_LabelText_BorderWidth
, &attrib_Current
);
396 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
)) != -1) &&
397 (attrib_Current
!= attrib_Prefs
))
399 D(bug("[IconWindowIconList] %s: Icon Label Border Width changed - updating ..\n", __PRETTY_FUNCTION__
));
400 options_changed
= TRUE
;
401 if (prefs_Processing
)
403 NNSET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
407 SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
412 case MUIA_IconList_LabelText_BorderHeight
:
413 GET(self
, MUIA_IconList_LabelText_BorderHeight
, &attrib_Current
);
415 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
)) != -1) &&
416 (attrib_Current
!= attrib_Prefs
))
418 D(bug("[IconWindowIconList] %s: Icon Label Border Height changed - updating ..\n", __PRETTY_FUNCTION__
));
419 options_changed
= TRUE
;
420 if (prefs_Processing
)
422 NNSET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
426 SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
432 D(bug("[IconWindowIconList] %s: Unhandled change\n", __PRETTY_FUNCTION__
));
438 if (!(prefs_Processing
))
440 D(bug("[IconWindowIconList] %s: IconList Options have changed, causing an update ..\n", __PRETTY_FUNCTION__
));
441 DoMethod(self
, MUIM_IconList_Update
);
442 DoMethod(self
, MUIM_IconList_Sort
);
444 else if (data
->iwcd_IconWindow
)
446 SET(data
->iwcd_IconWindow
, MUIA_IconWindow_Changed
, TRUE
);
453 MakeStaticHook(Hook_ProcessIconListPrefsFunc
,IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
);
457 ///IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc()
460 void, IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
,
461 AROS_UFHA(struct Hook
*, hook
, A0
),
462 AROS_UFHA(APTR
*, obj
, A2
),
463 AROS_UFHA(APTR
, param
, A1
)
467 HOOKPROTO(IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
, void, APTR
*obj
, APTR param
)
472 /* Get our private data */
473 Object
*self
= ( Object
*)obj
;
474 Object
*prefs
= NULL
;
475 Class
*CLASS
= *( Class
**)param
;
479 D(bug("[IconWindowIconList] %s()\n", __PRETTY_FUNCTION__
));
481 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
485 BOOL options_changed
= FALSE
;
486 IPTR prefs_Processing
= 0;
488 GET(prefs
, MUIA_WandererPrefs_Processing
, &prefs_Processing
);
490 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
492 IPTR current_ShowNetwork
= 0;
493 IPTR prefs_ShowNetwork
= 0;
495 D(bug("[IconWindowIconList] %s: Setting ROOT view Network options ..\n", __PRETTY_FUNCTION__
));
497 GET(self
, MUIA_IconWindowExt_NetworkBrowser_Show
, ¤t_ShowNetwork
);
499 D(bug("[IconWindowIconList] %s: Current = %d\n", __PRETTY_FUNCTION__
, current_ShowNetwork
));
501 GET(prefs
, MUIA_IconWindowExt_NetworkBrowser_Show
, &prefs_ShowNetwork
);
503 D(bug("[IconWindowIconList] %s: Prefs = %d\n", __PRETTY_FUNCTION__
, prefs_ShowNetwork
));
505 if ((BOOL
)current_ShowNetwork
!= (BOOL
)prefs_ShowNetwork
)
507 D(bug("[IconWindowIconList] %s: ROOT view Network prefs changed - updating ..\n", __PRETTY_FUNCTION__
));
508 options_changed
= TRUE
;
509 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_ShowNetworkBrowser
= prefs_ShowNetwork
;
512 if ((options_changed
) && !(prefs_Processing
))
514 D(bug("[IconWindowIconList] %s: Network prefs changed, causing an update ..\n", __PRETTY_FUNCTION__
));
515 DoMethod(self
, MUIM_IconList_Update
);
516 DoMethod(self
, MUIM_IconList_Sort
);
518 else if (data
->iwcd_IconWindow
)
520 SET(data
->iwcd_IconWindow
, MUIA_IconWindow_Changed
, TRUE
);
526 MakeStaticHook(Hook_UpdateNetworkPrefsFunc
,IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
);
529 #define BDRPLINELEN_MAX 1024
530 BOOL
IconWindowIconList__Func_ParseBackdrop(Class
*CLASS
, Object
*self
, char *bdrp_dir
)
532 BPTR bdrp_lock
= (BPTR
)NULL
;
533 char *bdrp_file
= NULL
, *linebuf
= NULL
, *bdrp_fullfile
= NULL
, *bdrp_namepart
= NULL
;
534 struct DiskObject
*bdrp_currfile_dob
= NULL
;
537 if ((bdrp_dir
== NULL
) || (bdrp_dir
[strlen(bdrp_dir
) - 1] != ':'))
540 if ((bdrp_file
= AllocVec(strlen(bdrp_dir
) + 9 + 1, MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
542 sprintf(bdrp_file
, "%s.backdrop", bdrp_dir
);
543 if ((bdrp_lock
= Open(bdrp_file
, MODE_OLDFILE
)))
545 D(bug("[IconWindowIconList] IconWindowIconList__Func_ParseBackdrop: Loading backdrop file: '%s'\n", bdrp_file
));
547 if ((linebuf
= AllocMem(BDRPLINELEN_MAX
, MEMF_PUBLIC
)) != NULL
)
549 while (FGets(bdrp_lock
, linebuf
, BDRPLINELEN_MAX
))
555 linelen
= strlen(linebuf
) - 1; /* drop the newline char */
556 linebuf
[linelen
] = '\0';
558 if ((bdrp_fullfile
= AllocVec(linelen
+ strlen(bdrp_dir
), MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
560 sprintf(bdrp_fullfile
, "%s%s", bdrp_dir
, &linebuf
[1]);
561 bdrp_namepart
= FilePart(bdrp_fullfile
);
562 bdrp_currfile_dob
= GetIconTags
565 ICONGETA_FailIfUnavailable
, FALSE
,
566 ICONGETA_Label
, bdrp_namepart
,
570 D(bug("[IconWindowIconList] IconWindowIconList__Func_ParseBackdrop: LEAVEOUT Icon '%s' ('%s') DOB @ 0x%p\n", bdrp_fullfile
, bdrp_namepart
, bdrp_currfile_dob
));
572 if (bdrp_currfile_dob
)
574 struct IconEntry
*this_entry
= NULL
;
575 if ((this_entry
= (struct IconEntry
*)DoMethod(self
, MUIM_IconList_CreateEntry
, (IPTR
)bdrp_fullfile
, (IPTR
)bdrp_namepart
, (IPTR
)NULL
, (IPTR
)bdrp_currfile_dob
, 0, (IPTR
)NULL
)))
577 struct FileInfoBlock
*fib
= AllocDosObject(DOS_FIB
, NULL
);
580 BPTR fib_lock
= (BPTR
)NULL
;
581 if ((fib_lock
= Lock(bdrp_fullfile
, SHARED_LOCK
)) != NULL
)
583 if (Examine(fib_lock
, fib
))
585 if (fib
->fib_DirEntryType
== ST_FILE
)
587 this_entry
->ie_IconListEntry
.type
= ST_LINKFILE
;
588 D(bug("[IconWindowIconList] %s: LEAVEOUT ST_LINKFILE Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
590 else if (fib
->fib_DirEntryType
== ST_USERDIR
)
592 this_entry
->ie_IconListEntry
.type
= ST_LINKDIR
;
593 D(bug("[IconWindowIconList] %s: LEAVEOUT ST_LINKDIR Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
597 D(bug("[IconWindowIconList] %s: LEAVEOUT Unknown Entry Type @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
602 FreeDosObject(DOS_FIB
, fib
);
607 FreeVec(bdrp_fullfile
);
610 FreeMem(linebuf
, BDRPLINELEN_MAX
);
620 /*** Methods ****************************************************************/
622 Object
*IconWindowIconList__OM_NEW(Class
*CLASS
, Object
*self
, struct opSet
*message
)
624 IPTR _newIconList__FSNotifyPort
= 0;
626 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW()\n"));
628 _newIconList__FSNotifyPort
= GetTagData(MUIA_Wanderer_FileSysNotifyPort
, (IPTR
) NULL
, message
->ops_AttrList
);
630 self
= (Object
*) DoSuperNewTags
634 TAG_MORE
, (IPTR
) message
->ops_AttrList
640 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW: SELF = 0x%p\n", self
));
643 data
->iwcd_ProcessIconListPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
;
645 data
->iwcd_ProcessIconListPrefs_hook
= &Hook_ProcessIconListPrefsFunc
;
648 if (_newIconList__FSNotifyPort
!= 0)
650 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
651 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
= _newIconList__FSNotifyPort
;
652 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW: FS Notify Port @ 0x%p\n", _newIconList__FSNotifyPort
));
655 D(bug("[IconWindowIconList] obj = %ld\n", self
));
662 IPTR
IconWindowIconList__OM_SET(Class
*CLASS
, Object
*self
, struct opSet
*message
)
666 struct TagItem
*tstate
= message
->ops_AttrList
, *tag
;
668 while ((tag
= NextTagItem(&tstate
)) != NULL
)
672 case MUIA_Background
:
674 D(bug("[IconWindowIconList] %s: MUIA_Background\n", __PRETTY_FUNCTION__
));
677 case MUIA_IconWindow_Window
:
679 D(bug("[IconWindowIconList] %s: MUIA_IconWindow_Window @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
680 data
->iwcd_IconWindow
= (Object
*)tag
->ti_Data
;
683 case MUIA_IconList_BufferRastport
:
685 D(bug("[IconWindowIconList] %s: MUIA_IconList_BufferRastport @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
686 data
->iwcd_RastPort
= (struct RastPort
*)tag
->ti_Data
;
691 return DoSuperMethodA(CLASS
, self
, (Msg
) message
);
696 IPTR
IconWindowIconList__OM_GET(Class
*CLASS
, Object
*self
, struct opGet
*message
)
699 //IPTR *store = message->opg_Storage;
702 switch (message
->opg_AttrID
)
705 rv
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
712 ///IconWindowIconList__MUIM_Setup()
713 IPTR IconWindowIconList__MUIM_Setup
715 Class
*CLASS
, Object
*self
, Msg message
720 Object
*prefs
= NULL
;
722 if (!DoSuperMethodA(CLASS
, self
, message
)) return FALSE
;
724 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
728 /* Set our initial options */
731 GET(_win(self
), MUIA_IconWindow_BackgroundAttrib
, &data
->iwcd_ViewPrefs_ID
);
732 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Setup: Window Background = '%s'\n", data
->iwcd_ViewPrefs_ID
));
733 data
->iwcd_ViewPrefs_NotificationObject
= (Object
*)DoMethod(prefs
,
734 MUIM_WandererPrefs_ViewSettings_GetNotifyObject
,
735 data
->iwcd_ViewPrefs_ID
);
737 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Setup: Background Notification Obj @ 0x%p\n", data
->iwcd_ViewPrefs_NotificationObject
));
739 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_IconListMode
);
740 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_IconListMode
))) SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
742 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
);
743 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_Mode
))) SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
745 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
);
746 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MaxLineLen
))) SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
748 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
);
749 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLine
))) SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
751 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
);
752 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
))) SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
754 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
);
755 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_HorizontalSpacing
))) SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
757 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
);
758 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_VerticalSpacing
))) SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
760 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
);
761 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_ImageSpacing
))) SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
763 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
);
764 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_HorizontalPadding
))) SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
766 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
);
767 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_VerticalPadding
))) SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
769 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
);
770 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderWidth
))) SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
772 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
);
773 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderHeight
))) SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
775 /* Configure notifications incase they get updated =) */
778 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_IconListMode
, MUIV_EveryTime
,
780 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_IconListMode
785 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_Mode
, MUIV_EveryTime
,
787 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_Mode
792 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MaxLineLen
, MUIV_EveryTime
,
794 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MaxLineLen
799 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLine
, MUIV_EveryTime
,
801 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLine
806 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLineOnFocus
, MUIV_EveryTime
,
808 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLineOnFocus
813 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_HorizontalSpacing
, MUIV_EveryTime
,
815 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_HorizontalSpacing
820 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_VerticalSpacing
, MUIV_EveryTime
,
822 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_VerticalSpacing
827 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_ImageSpacing
, MUIV_EveryTime
,
829 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_ImageSpacing
834 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_HorizontalPadding
, MUIV_EveryTime
,
836 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_HorizontalPadding
841 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_VerticalPadding
, MUIV_EveryTime
,
843 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_VerticalPadding
848 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderWidth
, MUIV_EveryTime
,
850 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderWidth
855 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderHeight
, MUIV_EveryTime
,
857 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderHeight
861 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
866 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
;
868 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
= &Hook_UpdateNetworkPrefsFunc
;
873 prefs
, MUIM_Notify
, MUIA_IconWindowExt_NetworkBrowser_Show
, MUIV_EveryTime
,
875 MUIM_CallHook
, &((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
, (IPTR
)CLASS
879 if (muiRenderInfo(self
))
881 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Setting up EventHandler for (IDCMP_DISKINSERTED | IDCMP_DISKREMOVED)\n"));
883 data
->iwcd_EventHandlerNode
.ehn_Priority
= 1;
884 data
->iwcd_EventHandlerNode
.ehn_Flags
= MUI_EHF_GUIMODE
;
885 data
->iwcd_EventHandlerNode
.ehn_Object
= self
;
886 data
->iwcd_EventHandlerNode
.ehn_Class
= CLASS
;
887 data
->iwcd_EventHandlerNode
.ehn_Events
= IDCMP_DISKINSERTED
| IDCMP_DISKREMOVED
;
889 DoMethod(_win(self
), MUIM_Window_AddEventHandler
, &data
->iwcd_EventHandlerNode
);
893 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Couldnt add IDCMP EventHandler!\n"));
898 /* Setup notification on the directory -------------------------------- */
899 STRPTR directory_path
= NULL
;
900 GET(self
, MUIA_IconDrawerList_Drawer
, &directory_path
);
902 if (directory_path
!= NULL
)
904 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
906 if (drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
!= NULL
)
908 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
= directory_path
;
909 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Flags
= NRF_SEND_MESSAGE
;
910 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_UserData
= self
;
912 if (StartNotify(&drawerlist_data
->iwdcd_DrawerNotifyRequest
))
914 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Drawer-notification setup on '%s'\n", drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
));
918 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: FAILED to setup Drawer-notification!\n"));
919 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
= NULL
;
925 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Setup complete!\n"));
931 ///IconWindowIconList__MUIM_Cleanup()
932 IPTR IconWindowIconList__MUIM_Cleanup
934 Class
*CLASS
, Object
*self
, Msg message
939 Object
*prefs
= NULL
;
941 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup()\n"));
942 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
948 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_IconListMode
, (IPTR
)self
953 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_Mode
, (IPTR
)self
958 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MaxLineLen
, (IPTR
)self
963 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLine
, (IPTR
)self
968 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLineOnFocus
, (IPTR
)self
973 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_HorizontalSpacing
, (IPTR
)self
978 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_VerticalSpacing
, (IPTR
)self
983 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_ImageSpacing
, (IPTR
)self
988 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_HorizontalPadding
, (IPTR
)self
993 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_VerticalPadding
, (IPTR
)self
998 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderWidth
, (IPTR
)self
1003 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderHeight
, (IPTR
)self
1007 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
1014 MUIM_KillNotifyObj
, MUIA_IconWindowExt_NetworkBrowser_Show
, (IPTR
) self
1017 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup: (ROOT WINDOW) Removing our Disk Event Handler\n"));
1018 DoMethod(_win(self
), MUIM_Window_RemEventHandler
, &data
->iwcd_EventHandlerNode
);
1022 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
1023 if (drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
!= NULL
)
1025 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup: (DRAWER WINDOW) Removing our Drawer Notification Request\n"));
1026 EndNotify(&drawerlist_data
->iwdcd_DrawerNotifyRequest
);
1030 return DoSuperMethodA(CLASS
, self
, message
);
1034 ///IconWindowIconList__MUIM_HandleEvent()
1035 IPTR IconWindowIconList__MUIM_HandleEvent
1037 Class
*CLASS
, Object
*self
, struct MUIP_HandleEvent
*message
1042 struct IntuiMessage
*imsg
= message
->imsg
;
1044 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent()\n"));
1046 if(imsg
->Class
== IDCMP_DISKINSERTED
)
1048 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent: IDCMP_DISKINSERTED\n"));
1049 DoMethod(self
, MUIM_IconList_Update
);
1050 DoMethod(self
, MUIM_IconList_Sort
);
1051 return(MUI_EventHandlerRC_Eat
);
1053 else if (imsg
->Class
== IDCMP_DISKREMOVED
)
1055 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent: IDCMP_DISKREMOVED\n"));
1056 DoMethod(self
, MUIM_IconList_Update
);
1057 DoMethod(self
, MUIM_IconList_Sort
);
1058 return(MUI_EventHandlerRC_Eat
);
1064 ///IconWindowIconList__MUIM_DrawBackground()
1065 IPTR IconWindowIconList__MUIM_DrawBackground
1067 Class
*CLASS
, Object
*self
, struct MUIP_DrawBackground
*message
1072 IPTR retVal
= (IPTR
)TRUE
;
1074 struct RastPort
*DrawBackGround_RastPort
;
1075 struct IconWindowBackFillMsg DrawBackGround_BackFillMsg
;
1077 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground()\n"));
1079 if ((iconwindow_BackFill_Active
== NULL
) ||
1080 (data
->iwcd_IconWindow
== NULL
))
1082 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: No Backfill support/Window not set .. causing parent class to render\n"));
1083 goto iwc_ParentBackground
;
1086 DrawBackGround_RastPort
= _rp(self
);
1088 if ((data
->iwcd_RastPort
!= NULL
) && (DrawBackGround_RastPort
!= data
->iwcd_RastPort
))
1090 DrawBackGround_RastPort
= data
->iwcd_RastPort
;
1092 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= 0;
1093 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= 0;
1094 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= _mwidth(self
);
1095 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= _mheight(self
);
1097 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
- _mleft(self
);
1098 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
- _mtop(self
);
1099 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= message
->width
;
1100 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= message
->height
;
1104 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= _mleft(self
);
1105 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= _mtop(self
);
1106 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= (_mleft(self
) + _mwidth(self
));
1107 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= (_mtop(self
) + _mheight(self
));
1109 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
;
1110 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
;
1111 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= (message
->left
+ message
->width
);
1112 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= (message
->top
+ message
->height
);
1115 DrawBackGround_BackFillMsg
.Layer
= DrawBackGround_RastPort
->Layer
;
1117 /* Offset into source image (ala scroll bar position) */
1118 DrawBackGround_BackFillMsg
.OffsetX
= message
->xoffset
;
1119 DrawBackGround_BackFillMsg
.OffsetY
= message
->yoffset
;
1121 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: RastPort @ 0x%p\n", DrawBackGround_RastPort
));
1123 if ((retVal
= DoMethod(data
->iwcd_IconWindow
, MUIM_IconWindow_BackFill_DrawBackground
, XGET(data
->iwcd_IconWindow
, MUIA_IconWindow_BackFillData
), &DrawBackGround_BackFillMsg
, DrawBackGround_RastPort
)) == (IPTR
)TRUE
)
1125 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: Backfill module rendered background ..\n"));
1128 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: Backfill module failed to render background ..\n"));
1130 iwc_ParentBackground
:
1132 clip
= (IPTR
)MUI_AddClipping(muiRenderInfo(self
), message
->left
, message
->top
, message
->width
, message
->height
);
1134 message
->width
= _mwidth(self
);
1135 message
->height
= _mheight(self
);
1136 message
->left
= _mleft(self
);
1137 message
->top
= _mtop(self
);
1139 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
1141 MUI_RemoveClipping(muiRenderInfo(self
), (APTR
)clip
);
1147 ///IconWindowIconList__MUIM_IconList_Update()
1148 IPTR IconWindowIconList__MUIM_IconList_Update
1150 Class
*CLASS
, Object
*self
, struct MUIP_IconList_Update
*message
1155 IPTR retVal
= (IPTR
)TRUE
;
1157 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
1159 struct IconList_Entry
*icon_entry
= (IPTR
)MUIV_IconList_NextIcon_Start
;
1160 Object
*prefs
= NULL
;
1161 BOOL sort_list
= FALSE
;
1163 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: (ROOT WINDOW) Causing parent to update\n"));
1164 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
1166 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: Checking for '.backdrop' files\n"));
1169 DoMethod(self
, MUIM_IconList_NextIcon
, MUIV_IconList_NextIcon_Visible
, (IPTR
)&icon_entry
);
1171 ((IPTR
)icon_entry
!= MUIV_IconList_NextIcon_End
) &&
1172 ((icon_entry
->type
== ST_ROOT
) && !(icon_entry
->flags
& ICONENTRY_VOL_OFFLINE
))
1175 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: checking entry '%s'\n", icon_entry
->label
));
1176 if (IconWindowIconList__Func_ParseBackdrop(CLASS
, self
, icon_entry
->label
))
1185 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: Check if we should show NetworkBrowser Icon ..\n"));
1187 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
1191 struct IconWindowIconVolumeList_DATA
*volumel_data
= (struct IconWindowIconVolumeList_DATA
*)data
;
1193 GET(prefs
, MUIA_IconWindowExt_NetworkBrowser_Show
, &volumel_data
->iwvcd_ShowNetworkBrowser
);
1195 #if defined(DEBUG_NETWORKBROWSER)
1196 volumel_data
->iwvcd_ShowNetworkBrowser
= TRUE
;
1199 if (volumel_data
->iwvcd_ShowNetworkBrowser
)
1201 struct DiskObject
*_nb_dob
= NULL
;
1202 _nb_dob
= GetIconTags
1204 "ENV:SYS/def_NetworkHost",
1205 ICONGETA_FailIfUnavailable
, FALSE
,
1206 ICONGETA_Label
, (IPTR
)"Network Access..",
1210 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: NetworkBrowser Icon DOB @ 0x%p\n", _nb_dob
));
1214 struct Node
*this_entry
= NULL
;
1215 if ((this_entry
= (struct Node
*)DoMethod(self
, MUIM_IconList_CreateEntry
, (IPTR
)"?wanderer.networkbrowse?", (IPTR
)"Network Access..", (IPTR
)NULL
, (IPTR
)_nb_dob
, 0, (IPTR
)NULL
)))
1217 this_entry
->ln_Pri
= 3; /// Network Access gets Priority 3 so its displayed after special dirs
1219 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: NetworkBrowser Icon Entry @ 0x%p\n", this_entry
));
1224 GET(prefs
, MUIA_IconWindowExt_UserFiles_ShowFilesFolder
, &volumel_data
->iwvcd_ShowUserFolder
);
1226 #if defined(DEBUG_SHOWUSERFILES)
1227 volumel_data
->iwvcd_ShowUserFolder
= TRUE
;
1229 if (volumel_data
->iwvcd_ShowUserFolder
)
1231 if (GetVar("SYS/Wanderer/userfiles.prefs", __icwc_intern_TxtBuff
, TXTBUFF_LEN
, GVF_GLOBAL_ONLY
) != -1)
1233 char * userfiles_path
= NULL
;
1235 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: SYS/UserFilesLocation = '%s'\n", __icwc_intern_TxtBuff
));
1237 if ((userfiles_path
= AllocVec(strlen(__icwc_intern_TxtBuff
) + 1, MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
1239 struct DiskObject
*_nb_dob
= NULL
;
1241 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: UserFilesLocation Path storage @ 0x%p\n", userfiles_path
));
1243 strcpy(userfiles_path
, __icwc_intern_TxtBuff
);
1245 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: UserFilesLocation Path storage contains '%s'\n", userfiles_path
));
1247 _nb_dob
= GetIconTags
1249 "ENV:SYS/def_UserHome",
1250 ICONGETA_FailIfUnavailable
, FALSE
,
1251 ICONGETA_Label
, (IPTR
)"User Files..",
1255 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: UserFiles Icon DOB @ 0x%p\n", _nb_dob
));
1259 struct Node
*this_entry
= NULL
;
1260 if ((this_entry
= (struct Node
*)DoMethod(self
, MUIM_IconList_CreateEntry
, userfiles_path
, (IPTR
)"User Files..", (IPTR
)NULL
, (IPTR
)_nb_dob
, 0, (IPTR
)NULL
)))
1262 this_entry
->ln_Pri
= 5; /// Special dirs get Priority 5
1269 if (sort_list
) DoMethod(self
, MUIM_IconList_Sort
);
1275 DoMethod(self
, MUIM_IconList_Clear
);
1281 /*** Setup ******************************************************************/
1283 ICONWINDOWICONDRAWERLIST_CUSTOMCLASS
1285 IconWindowIconDrawerList
, IconWindowIconList
, NULL
, MUIC_IconDrawerList
, NULL
,
1286 OM_NEW
, struct opSet
*,
1287 OM_SET
, struct opSet
*,
1288 OM_GET
, struct opGet
*,
1291 MUIM_DrawBackground
, Msg
1294 ICONWINDOWICONVOLUMELIST_CUSTOMCLASS
1296 IconWindowIconVolumeList
, IconWindowIconList
, NULL
, MUIC_IconVolumeList
, NULL
,
1297 OM_NEW
, struct opSet
*,
1298 OM_SET
, struct opSet
*,
1299 OM_GET
, struct opGet
*,
1302 MUIM_DrawBackground
, Msg
,
1303 MUIM_HandleEvent
, Msg
,
1304 MUIM_IconList_Update
, struct MUIP_IconList_Update
*
1307 ICONWINDOWICONNETWORKBROWSERLIST_CUSTOMCLASS
1309 IconWindowIconNetworkBrowserList
, IconWindowIconList
, NULL
, MUIC_IconList
, NULL
,
1310 OM_NEW
, struct opSet
*,
1311 OM_SET
, struct opSet
*,
1312 OM_GET
, struct opGet
*,
1315 MUIM_DrawBackground
, Msg
,
1316 MUIM_HandleEvent
, Msg
,
1317 MUIM_IconList_Update
, struct MUIP_IconList_Update
*
1321 ICONWINDOWICONDRAWERLIST_CUSTOMCLASS
1323 IconWindowIconDrawerList
, IconWindowIconList
, NULL
, NULL
, IconDrawerList_Class
,
1324 OM_NEW
, struct opSet
*,
1325 OM_SET
, struct opSet
*,
1326 OM_GET
, struct opGet
*,
1329 MUIM_DrawBackground
, Msg
1332 ICONWINDOWICONVOLUMELIST_CUSTOMCLASS
1334 IconWindowIconVolumeList
, IconWindowIconList
, NULL
, NULL
, IconVolumeList_Class
,
1335 OM_NEW
, struct opSet
*,
1336 OM_SET
, struct opSet
*,
1337 OM_GET
, struct opGet
*,
1340 MUIM_DrawBackground
, Msg
,
1341 MUIM_HandleEvent
, Msg
,
1342 MUIM_IconList_Update
, struct MUIP_IconList_Update
*
1345 ICONWINDOWICONNETWORKBROWSERLIST_CUSTOMCLASS
1347 IconWindowIconNetworkBrowserList
, IconWindowIconList
, NULL
, NULL
, IconList_Class
,
1348 OM_NEW
, struct opSet
*,
1349 OM_SET
, struct opSet
*,
1350 OM_GET
, struct opGet
*,
1353 MUIM_DrawBackground
, Msg
,
1354 MUIM_HandleEvent
, Msg
,
1355 MUIM_IconList_Update
, struct MUIP_IconList_Update
*