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 "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
;
139 char *iwvcd_UserFolderPath
;
142 struct IconWindowIconNetworkBrowserList_DATA
144 Object
*iwcd_IconWindow
;
145 struct RastPort
*iwcd_RastPort
;
146 struct MUI_EventHandlerNode iwcd_EventHandlerNode
;
148 struct Hook iwcd_ProcessIconListPrefs_hook
;
150 struct Hook
*iwcd_ProcessIconListPrefs_hook
;
153 IPTR iwcd_ViewPrefs_ID
;
154 Object
*iwcd_ViewPrefs_NotificationObject
;
155 struct Hook iwnbcd_UpdateNetworkPrefs_hook
;
156 struct List iwnbcd_NetworkClasses
;
159 static char __icwc_intern_TxtBuff
[TXTBUFF_LEN
];
161 /*** Macros *****************************************************************/
162 #define SETUP_INST_DATA struct IconWindowIconList_DATA *data = INST_DATA(CLASS, self)
164 /*** Hook functions *********************************************************/
165 ///IconWindowIconList__HookFunc_ProcessIconListPrefsFunc()
168 void, IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
,
169 AROS_UFHA(struct Hook
*, hook
, A0
),
170 AROS_UFHA(APTR
*, obj
, A2
),
171 AROS_UFHA(IPTR
*, param
, A1
)
175 HOOKPROTO(IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
, void, APTR
*obj
, IPTR
*param
)
180 /* Get our private data */
181 Object
*self
= ( Object
*)obj
;
182 IPTR CHANGED_ATTRIB
= *param
;
183 Class
*CLASS
= OCLASS(self
);
187 Object
*prefs
= NULL
;
189 D(bug("[IconWindowIconList] %s()\n", __PRETTY_FUNCTION__
));
191 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
195 IPTR attrib_Current
, attrib_Prefs
, prefs_Processing
= 0;
196 BOOL options_changed
= FALSE
;
198 D(bug("[IconWindowIconList] %s: Setting IconList options ..\n", __PRETTY_FUNCTION__
));
200 GET(prefs
, MUIA_WandererPrefs_Processing
, &prefs_Processing
);
202 switch (CHANGED_ATTRIB
)
204 case MUIA_IconList_IconListMode
:
205 GET(self
, MUIA_IconList_IconListMode
, &attrib_Current
);
207 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_IconListMode
)) != -1) &&
208 (attrib_Current
!= attrib_Prefs
))
210 D(bug("[IconWindowIconList] %s: IconList ListMode changed - updating ..\n", __PRETTY_FUNCTION__
));
211 options_changed
= TRUE
;
212 if (prefs_Processing
)
214 NNSET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
218 SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
223 case MUIA_IconList_LabelText_Mode
:
224 GET(self
, MUIA_IconList_LabelText_Mode
, &attrib_Current
);
226 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
)) != -1) &&
227 (attrib_Current
!= attrib_Prefs
))
229 D(bug("[IconWindowIconList] %s: IconList TextRenderMode changed - updating ..\n", __PRETTY_FUNCTION__
));
230 options_changed
= TRUE
;
231 if (prefs_Processing
)
233 NNSET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
237 SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
242 case MUIA_IconList_LabelText_MaxLineLen
:
243 GET(self
, MUIA_IconList_LabelText_MaxLineLen
, &attrib_Current
);
245 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
)) != -1) &&
246 (attrib_Current
!= attrib_Prefs
))
248 D(bug("[IconWindowIconList] %s: IconList Max Text Length changed - updating ..\n", __PRETTY_FUNCTION__
));
249 options_changed
= TRUE
;
250 if (prefs_Processing
)
252 NNSET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
256 SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
261 case MUIA_IconList_LabelText_MultiLine
:
262 GET(self
, MUIA_IconList_LabelText_MultiLine
, &attrib_Current
);
264 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
)) != -1) &&
265 (attrib_Current
!= attrib_Prefs
))
267 D(bug("[IconWindowIconList] %s: IconList Multi-Line changed - updating ..\n", __PRETTY_FUNCTION__
));
268 options_changed
= TRUE
;
269 if (prefs_Processing
)
271 NNSET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
275 SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
280 case MUIA_IconList_LabelText_MultiLineOnFocus
:
281 GET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, &attrib_Current
);
283 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
)) != -1) &&
284 (attrib_Current
!= attrib_Prefs
))
286 D(bug("[IconWindowIconList] %s: Multi-Line on Focus changed - updating ..\n", __PRETTY_FUNCTION__
));
287 options_changed
= TRUE
;
288 if (prefs_Processing
)
290 NNSET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
294 SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
299 case MUIA_IconList_Icon_HorizontalSpacing
:
300 GET(self
, MUIA_IconList_Icon_HorizontalSpacing
, &attrib_Current
);
302 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
)) != -1) &&
303 (attrib_Current
!= attrib_Prefs
))
305 D(bug("[IconWindowIconList] %s: Icon Horizontal Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
306 options_changed
= TRUE
;
307 if (prefs_Processing
)
309 NNSET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
313 SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
318 case MUIA_IconList_Icon_VerticalSpacing
:
319 GET(self
, MUIA_IconList_Icon_VerticalSpacing
, &attrib_Current
);
321 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
)) != -1) &&
322 (attrib_Current
!= attrib_Prefs
))
324 D(bug("[IconWindowIconList] %s: Icon Vertical Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
325 options_changed
= TRUE
;
326 if (prefs_Processing
)
328 NNSET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
332 SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
337 case MUIA_IconList_Icon_ImageSpacing
:
338 GET(self
, MUIA_IconList_Icon_ImageSpacing
, &attrib_Current
);
340 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
)) != -1) &&
341 (attrib_Current
!= attrib_Prefs
))
343 D(bug("[IconWindowIconList] %s: Icon Label Image Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
344 options_changed
= TRUE
;
345 if (prefs_Processing
)
347 NNSET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
351 SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
356 case MUIA_IconList_LabelText_HorizontalPadding
:
357 GET(self
, MUIA_IconList_LabelText_HorizontalPadding
, &attrib_Current
);
359 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
)) != -1) &&
360 (attrib_Current
!= attrib_Prefs
))
362 D(bug("[IconWindowIconList] %s: Icon Label Horizontal Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
363 options_changed
= TRUE
;
364 if (prefs_Processing
)
366 NNSET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
370 SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
375 case MUIA_IconList_LabelText_VerticalPadding
:
376 GET(self
, MUIA_IconList_LabelText_VerticalPadding
, &attrib_Current
);
378 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
)) != -1) &&
379 (attrib_Current
!= attrib_Prefs
))
381 D(bug("[IconWindowIconList] %s: Icon Label Vertical Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
382 options_changed
= TRUE
;
383 if (prefs_Processing
)
385 NNSET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
389 SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
394 case MUIA_IconList_LabelText_BorderWidth
:
395 GET(self
, MUIA_IconList_LabelText_BorderWidth
, &attrib_Current
);
397 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
)) != -1) &&
398 (attrib_Current
!= attrib_Prefs
))
400 D(bug("[IconWindowIconList] %s: Icon Label Border Width changed - updating ..\n", __PRETTY_FUNCTION__
));
401 options_changed
= TRUE
;
402 if (prefs_Processing
)
404 NNSET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
408 SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
413 case MUIA_IconList_LabelText_BorderHeight
:
414 GET(self
, MUIA_IconList_LabelText_BorderHeight
, &attrib_Current
);
416 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
)) != -1) &&
417 (attrib_Current
!= attrib_Prefs
))
419 D(bug("[IconWindowIconList] %s: Icon Label Border Height changed - updating ..\n", __PRETTY_FUNCTION__
));
420 options_changed
= TRUE
;
421 if (prefs_Processing
)
423 NNSET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
427 SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
433 D(bug("[IconWindowIconList] %s: Unhandled change\n", __PRETTY_FUNCTION__
));
439 if (!(prefs_Processing
))
441 D(bug("[IconWindowIconList] %s: IconList Options have changed, causing an update ..\n", __PRETTY_FUNCTION__
));
442 DoMethod(self
, MUIM_IconList_Update
);
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
);
517 else if (data
->iwcd_IconWindow
)
519 SET(data
->iwcd_IconWindow
, MUIA_IconWindow_Changed
, TRUE
);
525 MakeStaticHook(Hook_UpdateNetworkPrefsFunc
,IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
);
528 #define BDRPLINELEN_MAX 1024
529 BOOL
IconWindowIconList__Func_ParseBackdrop(Class
*CLASS
, Object
*self
, char *bdrp_dir
)
531 BPTR bdrp_lock
= (BPTR
)NULL
;
532 char *bdrp_file
= NULL
, *linebuf
= NULL
, *bdrp_fullfile
= NULL
, *bdrp_namepart
= NULL
;
533 struct DiskObject
*bdrp_currfile_dob
= NULL
;
536 if ((bdrp_dir
== NULL
) || (bdrp_dir
[strlen(bdrp_dir
) - 1] != ':'))
539 if ((bdrp_file
= AllocVec(strlen(bdrp_dir
) + 9 + 1, MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
541 sprintf(bdrp_file
, "%s.backdrop", bdrp_dir
);
542 if ((bdrp_lock
= Open(bdrp_file
, MODE_OLDFILE
)))
544 D(bug("[IconWindowIconList] IconWindowIconList__Func_ParseBackdrop: Loading backdrop file: '%s'\n", bdrp_file
));
546 if ((linebuf
= AllocMem(BDRPLINELEN_MAX
, MEMF_PUBLIC
)) != NULL
)
548 while (FGets(bdrp_lock
, linebuf
, BDRPLINELEN_MAX
))
554 linelen
= strlen(linebuf
) - 1; /* drop the newline char */
555 linebuf
[linelen
] = '\0';
557 if ((bdrp_fullfile
= AllocVec(linelen
+ strlen(bdrp_dir
), MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
559 sprintf(bdrp_fullfile
, "%s%s", bdrp_dir
, &linebuf
[1]);
560 bdrp_namepart
= FilePart(bdrp_fullfile
);
561 bdrp_currfile_dob
= GetIconTags
564 ICONGETA_FailIfUnavailable
, FALSE
,
565 ICONGETA_Label
, bdrp_namepart
,
569 D(bug("[IconWindowIconList] IconWindowIconList__Func_ParseBackdrop: LEAVEOUT Icon '%s' ('%s') DOB @ 0x%p\n", bdrp_fullfile
, bdrp_namepart
, bdrp_currfile_dob
));
571 if (bdrp_currfile_dob
)
573 struct IconEntry
*this_entry
= NULL
;
574 if ((this_entry
= (struct IconEntry
*)DoMethod(self
, MUIM_IconList_CreateEntry
, (IPTR
)bdrp_fullfile
, (IPTR
)bdrp_namepart
, (IPTR
)NULL
, (IPTR
)bdrp_currfile_dob
, 0)))
576 struct FileInfoBlock
*fib
= AllocDosObject(DOS_FIB
, NULL
);
579 BPTR fib_lock
= (BPTR
)NULL
;
580 if ((fib_lock
= Lock(bdrp_fullfile
, SHARED_LOCK
)) != NULL
)
582 if (Examine(fib_lock
, fib
))
584 if (fib
->fib_DirEntryType
== ST_FILE
)
586 this_entry
->ie_IconListEntry
.type
= ST_LINKFILE
;
587 D(bug("[IconWindowIconList] %s: LEAVEOUT ST_LINKFILE Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
589 else if (fib
->fib_DirEntryType
== ST_USERDIR
)
591 this_entry
->ie_IconListEntry
.type
= ST_LINKDIR
;
592 D(bug("[IconWindowIconList] %s: LEAVEOUT ST_LINKDIR Entry @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
596 D(bug("[IconWindowIconList] %s: LEAVEOUT Unknown Entry Type @ 0x%p\n", __PRETTY_FUNCTION__
, this_entry
));
601 FreeDosObject(DOS_FIB
, fib
);
608 FreeMem(linebuf
, BDRPLINELEN_MAX
);
618 /*** Methods ****************************************************************/
620 Object
*IconWindowIconList__OM_NEW(Class
*CLASS
, Object
*self
, struct opSet
*message
)
622 IPTR _newIconList__FSNotifyPort
= 0;
624 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW()\n"));
626 _newIconList__FSNotifyPort
= GetTagData(MUIA_Wanderer_FileSysNotifyPort
, (IPTR
) NULL
, message
->ops_AttrList
);
628 self
= (Object
*) DoSuperNewTags
632 TAG_MORE
, (IPTR
) message
->ops_AttrList
638 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW: SELF = 0x%p\n", self
));
641 data
->iwcd_ProcessIconListPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowIconList__HookFunc_ProcessIconListPrefsFunc
;
643 data
->iwcd_ProcessIconListPrefs_hook
= &Hook_ProcessIconListPrefsFunc
;
646 if (_newIconList__FSNotifyPort
!= 0)
648 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
649 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
= _newIconList__FSNotifyPort
;
650 D(bug("[IconWindowIconList] IconWindowIconList__OM_NEW: FS Notify Port @ 0x%p\n", _newIconList__FSNotifyPort
));
653 D(bug("[IconWindowIconList] obj = %ld\n", self
));
660 IPTR
IconWindowIconList__OM_SET(Class
*CLASS
, Object
*self
, struct opSet
*message
)
664 struct TagItem
*tstate
= message
->ops_AttrList
, *tag
;
666 while ((tag
= NextTagItem((const struct TagItem
**)&tstate
)) != NULL
)
670 case MUIA_Background
:
672 D(bug("[IconWindowIconList] %s: MUIA_Background\n", __PRETTY_FUNCTION__
));
675 case MUIA_IconWindow_Window
:
677 D(bug("[IconWindowIconList] %s: MUIA_IconWindow_Window @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
678 data
->iwcd_IconWindow
= (Object
*)tag
->ti_Data
;
681 case MUIA_IconList_BufferRastport
:
683 D(bug("[IconWindowIconList] %s: MUIA_IconList_BufferRastport @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
684 data
->iwcd_RastPort
= (struct RastPort
*)tag
->ti_Data
;
689 return DoSuperMethodA(CLASS
, self
, (Msg
) message
);
694 IPTR
IconWindowIconList__OM_GET(Class
*CLASS
, Object
*self
, struct opGet
*message
)
697 //IPTR *store = message->opg_Storage;
700 switch (message
->opg_AttrID
)
703 rv
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
710 ///IconWindowIconList__MUIM_Setup()
711 IPTR IconWindowIconList__MUIM_Setup
713 Class
*CLASS
, Object
*self
, Msg message
718 Object
*prefs
= NULL
;
720 if (!DoSuperMethodA(CLASS
, self
, message
)) return FALSE
;
722 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
726 /* Set our initial options */
729 GET(_win(self
), MUIA_IconWindow_BackgroundAttrib
, &data
->iwcd_ViewPrefs_ID
);
730 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Setup: Window Background = '%s'\n", data
->iwcd_ViewPrefs_ID
));
731 data
->iwcd_ViewPrefs_NotificationObject
= (Object
*)DoMethod(prefs
,
732 MUIM_WandererPrefs_ViewSettings_GetNotifyObject
,
733 data
->iwcd_ViewPrefs_ID
);
735 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Setup: Background Notification Obj @ 0x%p\n", data
->iwcd_ViewPrefs_NotificationObject
));
737 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_IconListMode
);
738 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_IconListMode
))) SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
740 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
);
741 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_Mode
))) SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
743 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
);
744 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MaxLineLen
))) SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
746 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
);
747 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLine
))) SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
749 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
);
750 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
))) SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
752 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
);
753 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_HorizontalSpacing
))) SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
755 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
);
756 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_VerticalSpacing
))) SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
758 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
);
759 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_ImageSpacing
))) SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
761 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
);
762 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_HorizontalPadding
))) SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
764 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
);
765 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_VerticalPadding
))) SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
767 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
);
768 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderWidth
))) SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
770 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwcd_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
);
771 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderHeight
))) SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
773 /* Configure notifications incase they get updated =) */
776 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_IconListMode
, MUIV_EveryTime
,
778 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_IconListMode
783 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_Mode
, MUIV_EveryTime
,
785 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_Mode
790 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MaxLineLen
, MUIV_EveryTime
,
792 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MaxLineLen
797 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLine
, MUIV_EveryTime
,
799 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLine
804 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLineOnFocus
, MUIV_EveryTime
,
806 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLineOnFocus
811 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_HorizontalSpacing
, MUIV_EveryTime
,
813 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_HorizontalSpacing
818 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_VerticalSpacing
, MUIV_EveryTime
,
820 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_VerticalSpacing
825 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_ImageSpacing
, MUIV_EveryTime
,
827 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_ImageSpacing
832 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_HorizontalPadding
, MUIV_EveryTime
,
834 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_HorizontalPadding
839 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_VerticalPadding
, MUIV_EveryTime
,
841 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_VerticalPadding
846 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderWidth
, MUIV_EveryTime
,
848 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderWidth
853 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderHeight
, MUIV_EveryTime
,
855 MUIM_CallHook
, &data
->iwcd_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderHeight
859 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
864 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowIconList__HookFunc_UpdateNetworkPrefsFunc
;
866 ((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
= &Hook_UpdateNetworkPrefsFunc
;
871 prefs
, MUIM_Notify
, MUIA_IconWindowExt_NetworkBrowser_Show
, MUIV_EveryTime
,
873 MUIM_CallHook
, &((struct IconWindowIconVolumeList_DATA
*)data
)->iwvcd_UpdateNetworkPrefs_hook
, (IPTR
)CLASS
877 if (muiRenderInfo(self
))
879 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Setting up EventHandler for (IDCMP_DISKINSERTED | IDCMP_DISKREMOVED)\n"));
881 data
->iwcd_EventHandlerNode
.ehn_Priority
= 1;
882 data
->iwcd_EventHandlerNode
.ehn_Flags
= MUI_EHF_GUIMODE
;
883 data
->iwcd_EventHandlerNode
.ehn_Object
= self
;
884 data
->iwcd_EventHandlerNode
.ehn_Class
= CLASS
;
885 data
->iwcd_EventHandlerNode
.ehn_Events
= IDCMP_DISKINSERTED
| IDCMP_DISKREMOVED
;
887 DoMethod(_win(self
), MUIM_Window_AddEventHandler
, &data
->iwcd_EventHandlerNode
);
891 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Couldnt add IDCMP EventHandler!\n"));
896 /* Setup notification on the directory -------------------------------- */
897 STRPTR directory_path
= NULL
;
898 GET(self
, MUIA_IconDrawerList_Drawer
, &directory_path
);
900 if (directory_path
!= NULL
)
902 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
904 if (drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
!= NULL
)
906 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
= directory_path
;
907 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Flags
= NRF_SEND_MESSAGE
;
908 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_UserData
= self
;
910 if (StartNotify(&drawerlist_data
->iwdcd_DrawerNotifyRequest
))
912 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Drawer-notification setup on '%s'\n", drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
));
916 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: FAILED to setup Drawer-notification!\n"));
917 drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
= NULL
;
923 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: Setup complete!\n"));
929 ///IconWindowIconList__MUIM_Cleanup()
930 IPTR IconWindowIconList__MUIM_Cleanup
932 Class
*CLASS
, Object
*self
, Msg message
937 Object
*prefs
= NULL
;
939 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup()\n"));
940 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
946 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_IconListMode
, (IPTR
)self
951 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_Mode
, (IPTR
)self
956 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MaxLineLen
, (IPTR
)self
961 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLine
, (IPTR
)self
966 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLineOnFocus
, (IPTR
)self
971 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_HorizontalSpacing
, (IPTR
)self
976 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_VerticalSpacing
, (IPTR
)self
981 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_ImageSpacing
, (IPTR
)self
986 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_HorizontalPadding
, (IPTR
)self
991 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_VerticalPadding
, (IPTR
)self
996 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderWidth
, (IPTR
)self
1001 data
->iwcd_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderHeight
, (IPTR
)self
1005 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
1012 MUIM_KillNotifyObj
, MUIA_IconWindowExt_NetworkBrowser_Show
, (IPTR
) self
1015 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup: (ROOT WINDOW) Removing our Disk Event Handler\n"));
1016 DoMethod(_win(self
), MUIM_Window_RemEventHandler
, &data
->iwcd_EventHandlerNode
);
1020 struct IconWindowIconDrawerList_DATA
*drawerlist_data
= (struct IconWindowIconDrawerList_DATA
*)data
;
1021 if (drawerlist_data
->iwdcd_DrawerNotifyRequest
.nr_Name
!= NULL
)
1023 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Cleanup: (DRAWER WINDOW) Removing our Drawer Notification Request\n"));
1024 EndNotify(&drawerlist_data
->iwdcd_DrawerNotifyRequest
);
1028 return DoSuperMethodA(CLASS
, self
, message
);
1032 ///IconWindowIconList__MUIM_HandleEvent()
1033 IPTR IconWindowIconList__MUIM_HandleEvent
1035 Class
*CLASS
, Object
*self
, struct MUIP_HandleEvent
*message
1040 struct IntuiMessage
*imsg
= message
->imsg
;
1042 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent()\n"));
1044 if(imsg
->Class
== IDCMP_DISKINSERTED
)
1046 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent: IDCMP_DISKINSERTED\n"));
1047 DoMethod(self
, MUIM_IconList_Update
);
1048 return(MUI_EventHandlerRC_Eat
);
1050 else if (imsg
->Class
== IDCMP_DISKREMOVED
)
1052 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_HandleEvent: IDCMP_DISKREMOVED\n"));
1053 DoMethod(self
, MUIM_IconList_Update
);
1054 return(MUI_EventHandlerRC_Eat
);
1060 ///IconWindowIconList__MUIM_DrawBackground()
1061 IPTR IconWindowIconList__MUIM_DrawBackground
1063 Class
*CLASS
, Object
*self
, struct MUIP_DrawBackground
*message
1068 IPTR retVal
= (IPTR
)TRUE
;
1070 struct RastPort
*DrawBackGround_RastPort
;
1071 struct IconWindowBackFillMsg DrawBackGround_BackFillMsg
;
1073 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground()\n"));
1075 if ((iconwindow_BackFill_Active
== NULL
) ||
1076 (data
->iwcd_IconWindow
== NULL
))
1078 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: No Backfill support/Window not set .. causing parent class to render\n"));
1079 goto iwc_ParentBackground
;
1082 DrawBackGround_RastPort
= _rp(self
);
1084 if ((data
->iwcd_RastPort
!= NULL
) && (DrawBackGround_RastPort
!= data
->iwcd_RastPort
))
1086 DrawBackGround_RastPort
= data
->iwcd_RastPort
;
1088 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= 0;
1089 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= 0;
1090 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= _mwidth(self
);
1091 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= _mheight(self
);
1093 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
- _mleft(self
);
1094 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
- _mtop(self
);
1095 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= message
->width
;
1096 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= message
->height
;
1100 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= _mleft(self
);
1101 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= _mtop(self
);
1102 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= (_mleft(self
) + _mwidth(self
));
1103 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= (_mtop(self
) + _mheight(self
));
1105 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
;
1106 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
;
1107 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= (message
->left
+ message
->width
);
1108 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= (message
->top
+ message
->height
);
1111 DrawBackGround_BackFillMsg
.Layer
= DrawBackGround_RastPort
->Layer
;
1113 /* Offset into source image (ala scroll bar position) */
1114 DrawBackGround_BackFillMsg
.OffsetX
= message
->xoffset
;
1115 DrawBackGround_BackFillMsg
.OffsetY
= message
->yoffset
;
1117 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: RastPort @ 0x%p\n", DrawBackGround_RastPort
));
1119 if ((retVal
= DoMethod(data
->iwcd_IconWindow
, MUIM_IconWindow_BackFill_DrawBackground
, XGET(data
->iwcd_IconWindow
, MUIA_IconWindow_BackFillData
), &DrawBackGround_BackFillMsg
, DrawBackGround_RastPort
)) == (IPTR
)TRUE
)
1121 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: Backfill module rendered background ..\n"));
1124 D(bug("[IconWindow] IconWindowIconList__MUIM_DrawBackground: Backfill module failed to render background ..\n"));
1126 iwc_ParentBackground
:
1128 clip
= (IPTR
)MUI_AddClipping(muiRenderInfo(self
), message
->left
, message
->top
, message
->width
, message
->height
);
1130 message
->width
= _mwidth(self
);
1131 message
->height
= _mheight(self
);
1132 message
->left
= _mleft(self
);
1133 message
->top
= _mtop(self
);
1135 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
1137 MUI_RemoveClipping(muiRenderInfo(self
), (APTR
)clip
);
1143 ///IconWindowIconList__MUIM_IconList_Update()
1144 IPTR IconWindowIconList__MUIM_IconList_Update
1146 Class
*CLASS
, Object
*self
, struct MUIP_IconList_Update
*message
1151 IPTR retVal
= (IPTR
)TRUE
;
1153 if ((BOOL
)XGET(_win(self
), MUIA_IconWindow_IsRoot
))
1155 struct IconList_Entry
*icon_entry
= (IPTR
)MUIV_IconList_NextIcon_Start
;
1156 Object
*prefs
= NULL
;
1157 BOOL sort_list
= FALSE
;
1159 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: (ROOT WINDOW) Causing parent to update\n"));
1160 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
1162 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: Checking for '.backdrop' files\n"));
1165 DoMethod(self
, MUIM_IconList_NextIcon
, MUIV_IconList_NextIcon_Visible
, (IPTR
)&icon_entry
);
1167 ((IPTR
)icon_entry
!= MUIV_IconList_NextIcon_End
) &&
1168 ((icon_entry
->type
== ST_ROOT
) && !(icon_entry
->flags
& ICONENTRY_VOL_OFFLINE
))
1171 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: checking entry '%s'\n", icon_entry
->label
));
1172 if (IconWindowIconList__Func_ParseBackdrop(CLASS
, self
, icon_entry
->label
))
1181 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: Check if we should show NetworkBrowser Icon ..\n"));
1183 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
1187 struct IconWindowIconVolumeList_DATA
*volumel_data
= (struct IconWindowIconVolumeList_DATA
*)data
;
1189 GET(prefs
, MUIA_IconWindowExt_NetworkBrowser_Show
, &volumel_data
->iwvcd_ShowNetworkBrowser
);
1191 #if defined(DEBUG_NETWORKBROWSER)
1192 volumel_data
->iwvcd_ShowNetworkBrowser
= TRUE
;
1195 if (volumel_data
->iwvcd_ShowNetworkBrowser
)
1197 struct DiskObject
*_nb_dob
= NULL
;
1198 _nb_dob
= GetIconTags
1200 "ENV:SYS/def_NetworkHost",
1201 ICONGETA_FailIfUnavailable
, FALSE
,
1202 ICONGETA_Label
, (IPTR
)"Network Access..",
1206 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: NetworkBrowser Icon DOB @ 0x%p\n", _nb_dob
));
1210 struct Node
*this_entry
= NULL
;
1211 if ((this_entry
= (struct Node
*)DoMethod(self
, MUIM_IconList_CreateEntry
, (IPTR
)"?wanderer.networkbrowse?", (IPTR
)"Network Access..", (IPTR
)NULL
, (IPTR
)_nb_dob
, 0)))
1213 this_entry
->ln_Pri
= 3; /// Network Access gets Priority 3 so its displayed after special dirs
1215 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: NetworkBrowser Icon Entry @ 0x%p\n", this_entry
));
1220 GET(prefs
, MUIA_IconWindowExt_UserFiles_ShowFilesFolder
, &volumel_data
->iwvcd_ShowUserFolder
);
1222 #if defined(DEBUG_SHOWUSERFILES)
1223 volumel_data
->iwvcd_ShowUserFolder
= TRUE
;
1225 if (volumel_data
->iwvcd_ShowUserFolder
)
1227 if (GetVar("SYS/Wanderer/userfiles.prefs", __icwc_intern_TxtBuff
, TXTBUFF_LEN
, GVF_GLOBAL_ONLY
) != -1)
1229 char * userfiles_path
= NULL
;
1231 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: SYS/UserFilesLocation = '%s'\n", __icwc_intern_TxtBuff
));
1233 if ((userfiles_path
= AllocVec(strlen(__icwc_intern_TxtBuff
) + 1, MEMF_CLEAR
|MEMF_PUBLIC
)) != NULL
)
1235 struct DiskObject
*_nb_dob
= NULL
;
1237 volumel_data
->iwvcd_UserFolderPath
= userfiles_path
;
1239 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: UserFilesLocation Path storage @ 0x%p\n", userfiles_path
));
1241 strcpy(userfiles_path
, __icwc_intern_TxtBuff
);
1243 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_IconList_Update: UserFilesLocation Path storage contains '%s'\n", userfiles_path
));
1245 _nb_dob
= GetIconTags
1247 "ENV:SYS/def_UserHome",
1248 ICONGETA_FailIfUnavailable
, FALSE
,
1249 ICONGETA_Label
, (IPTR
)"User Files..",
1253 D(bug("[IconWindowIconList] IconWindowIconList__MUIM_Window_Setup: UserFiles Icon DOB @ 0x%p\n", _nb_dob
));
1257 struct Node
*this_entry
= NULL
;
1258 if ((this_entry
= (struct Node
*)DoMethod(self
, MUIM_IconList_CreateEntry
, userfiles_path
, (IPTR
)"User Files..", (IPTR
)NULL
, (IPTR
)_nb_dob
, 0)))
1260 this_entry
->ln_Pri
= 5; /// Special dirs get Priority 5
1267 if (sort_list
) DoMethod(self
, MUIM_IconList_Sort
);
1273 DoMethod(self
, MUIM_IconList_Clear
);
1279 /*** Setup ******************************************************************/
1281 ICONWINDOWICONDRAWERLIST_CUSTOMCLASS
1283 IconWindowIconDrawerList
, IconWindowIconList
, NULL
, MUIC_IconDrawerList
, NULL
,
1284 OM_NEW
, struct opSet
*,
1285 OM_SET
, struct opSet
*,
1286 OM_GET
, struct opGet
*,
1289 MUIM_DrawBackground
, Msg
1292 ICONWINDOWICONVOLUMELIST_CUSTOMCLASS
1294 IconWindowIconVolumeList
, IconWindowIconList
, NULL
, MUIC_IconVolumeList
, NULL
,
1295 OM_NEW
, struct opSet
*,
1296 OM_SET
, struct opSet
*,
1297 OM_GET
, struct opGet
*,
1300 MUIM_DrawBackground
, Msg
,
1301 MUIM_HandleEvent
, Msg
,
1302 MUIM_IconList_Update
, struct MUIP_IconList_Update
*
1305 ICONWINDOWICONNETWORKBROWSERLIST_CUSTOMCLASS
1307 IconWindowIconNetworkBrowserList
, IconWindowIconList
, NULL
, MUIC_IconList
, NULL
,
1308 OM_NEW
, struct opSet
*,
1309 OM_SET
, struct opSet
*,
1310 OM_GET
, struct opGet
*,
1313 MUIM_DrawBackground
, Msg
,
1314 MUIM_HandleEvent
, Msg
,
1315 MUIM_IconList_Update
, struct MUIP_IconList_Update
*
1319 ICONWINDOWICONDRAWERLIST_CUSTOMCLASS
1321 IconWindowIconDrawerList
, IconWindowIconList
, NULL
, NULL
, IconDrawerList_Class
,
1322 OM_NEW
, struct opSet
*,
1323 OM_SET
, struct opSet
*,
1324 OM_GET
, struct opGet
*,
1327 MUIM_DrawBackground
, Msg
1330 ICONWINDOWICONVOLUMELIST_CUSTOMCLASS
1332 IconWindowIconVolumeList
, IconWindowIconList
, NULL
, NULL
, IconVolumeList_Class
,
1333 OM_NEW
, struct opSet
*,
1334 OM_SET
, struct opSet
*,
1335 OM_GET
, struct opGet
*,
1338 MUIM_DrawBackground
, Msg
,
1339 MUIM_HandleEvent
, Msg
,
1340 MUIM_IconList_Update
, struct MUIP_IconList_Update
*
1343 ICONWINDOWICONNETWORKBROWSERLIST_CUSTOMCLASS
1345 IconWindowIconNetworkBrowserList
, IconWindowIconList
, NULL
, NULL
, IconList_Class
,
1346 OM_NEW
, struct opSet
*,
1347 OM_SET
, struct opSet
*,
1348 OM_GET
, struct opGet
*,
1351 MUIM_DrawBackground
, Msg
,
1352 MUIM_HandleEvent
, Msg
,
1353 MUIM_IconList_Update
, struct MUIP_IconList_Update
*