2 Copyright 2004-2009, The AROS Development Team. All rights reserved.
8 #include "portable_macros.h"
11 #define MUIMASTER_YES_INLINE_STDARG
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
;
86 #define BG_DRAWFLAG 0xf00dd00f
88 /*** Instance Data **********************************************************/
90 struct IconWindowDrawerList_DATA
92 Object
*iwidld_IconWindow
;
93 struct RastPort
*iwidld_RastPort
;
94 struct MUI_EventHandlerNode iwidld_EventHandlerNode
;
96 struct Hook iwidld_ProcessIconListPrefs_hook
;
98 struct Hook
*iwidld_ProcessIconListPrefs_hook
;
101 IPTR iwidld_ViewPrefs_ID
;
102 Object
*iwidld_ViewPrefs_NotificationObject
;
103 struct NotifyRequest iwidld_DrawerNotifyRequest
;
106 static char __icwc_intern_TxtBuff
[TXTBUFF_LEN
];
108 /*** Macros *****************************************************************/
109 #define SETUP_INST_DATA struct IconWindowDrawerList_DATA *data = INST_DATA(CLASS, self)
111 /*** Hook functions *********************************************************/
112 ///IconWindowDrawerList__HookFunc_ProcessIconListPrefsFunc()
115 void, IconWindowDrawerList__HookFunc_ProcessIconListPrefsFunc
,
116 AROS_UFHA(struct Hook
*, hook
, A0
),
117 AROS_UFHA(APTR
*, obj
, A2
),
118 AROS_UFHA(IPTR
*, param
, A1
)
122 HOOKPROTO(IconWindowDrawerList__HookFunc_ProcessIconListPrefsFunc
, void, APTR
*obj
, IPTR
*param
)
127 /* Get our private data */
128 Object
*self
= ( Object
*)obj
;
129 IPTR CHANGED_ATTRIB
= *param
;
130 Class
*CLASS
= OCLASS(self
);
134 Object
*prefs
= NULL
;
136 D(bug("[Wanderer:DrawerList]: %s()\n", __PRETTY_FUNCTION__
));
138 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
142 IPTR attrib_Current
, attrib_Prefs
, prefs_Processing
= 0;
143 BOOL options_changed
= FALSE
;
145 D(bug("[Wanderer:DrawerList] %s: Setting IconList options ..\n", __PRETTY_FUNCTION__
));
147 GET(prefs
, MUIA_WandererPrefs_Processing
, &prefs_Processing
);
149 switch (CHANGED_ATTRIB
)
151 case MUIA_IconList_IconListMode
:
152 GET(self
, MUIA_IconList_IconListMode
, &attrib_Current
);
154 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_IconListMode
)) != -1) &&
155 (attrib_Current
!= attrib_Prefs
))
157 D(bug("[Wanderer:DrawerList] %s: IconList ListMode changed - updating ..\n", __PRETTY_FUNCTION__
));
158 options_changed
= TRUE
;
159 if (prefs_Processing
)
161 NNSET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
165 SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
170 case MUIA_IconList_LabelText_Mode
:
171 GET(self
, MUIA_IconList_LabelText_Mode
, &attrib_Current
);
173 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
)) != -1) &&
174 (attrib_Current
!= attrib_Prefs
))
176 D(bug("[Wanderer:DrawerList] %s: IconList TextRenderMode changed - updating ..\n", __PRETTY_FUNCTION__
));
177 options_changed
= TRUE
;
178 if (prefs_Processing
)
180 NNSET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
184 SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
189 case MUIA_IconList_LabelText_MaxLineLen
:
190 GET(self
, MUIA_IconList_LabelText_MaxLineLen
, &attrib_Current
);
192 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
)) != -1) &&
193 (attrib_Current
!= attrib_Prefs
))
195 D(bug("[Wanderer:DrawerList] %s: IconList Max Text Length changed - updating ..\n", __PRETTY_FUNCTION__
));
196 options_changed
= TRUE
;
197 if (prefs_Processing
)
199 NNSET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
203 SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
208 case MUIA_IconList_LabelText_MultiLine
:
209 GET(self
, MUIA_IconList_LabelText_MultiLine
, &attrib_Current
);
211 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
)) != -1) &&
212 (attrib_Current
!= attrib_Prefs
))
214 D(bug("[Wanderer:DrawerList] %s: IconList Multi-Line changed - updating ..\n", __PRETTY_FUNCTION__
));
215 options_changed
= TRUE
;
216 if (prefs_Processing
)
218 NNSET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
222 SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
227 case MUIA_IconList_LabelText_MultiLineOnFocus
:
228 GET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, &attrib_Current
);
230 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
)) != -1) &&
231 (attrib_Current
!= attrib_Prefs
))
233 D(bug("[Wanderer:DrawerList] %s: Multi-Line on Focus changed - updating ..\n", __PRETTY_FUNCTION__
));
234 options_changed
= TRUE
;
235 if (prefs_Processing
)
237 NNSET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
241 SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
246 case MUIA_IconList_Icon_HorizontalSpacing
:
247 GET(self
, MUIA_IconList_Icon_HorizontalSpacing
, &attrib_Current
);
249 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
)) != -1) &&
250 (attrib_Current
!= attrib_Prefs
))
252 D(bug("[Wanderer:DrawerList] %s: Icon Horizontal Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
253 options_changed
= TRUE
;
254 if (prefs_Processing
)
256 NNSET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
260 SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
265 case MUIA_IconList_Icon_VerticalSpacing
:
266 GET(self
, MUIA_IconList_Icon_VerticalSpacing
, &attrib_Current
);
268 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
)) != -1) &&
269 (attrib_Current
!= attrib_Prefs
))
271 D(bug("[Wanderer:DrawerList] %s: Icon Vertical Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
272 options_changed
= TRUE
;
273 if (prefs_Processing
)
275 NNSET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
279 SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
284 case MUIA_IconList_Icon_ImageSpacing
:
285 GET(self
, MUIA_IconList_Icon_ImageSpacing
, &attrib_Current
);
287 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
)) != -1) &&
288 (attrib_Current
!= attrib_Prefs
))
290 D(bug("[Wanderer:DrawerList] %s: Icon Label Image Spacing changed - updating ..\n", __PRETTY_FUNCTION__
));
291 options_changed
= TRUE
;
292 if (prefs_Processing
)
294 NNSET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
298 SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
303 case MUIA_IconList_LabelText_HorizontalPadding
:
304 GET(self
, MUIA_IconList_LabelText_HorizontalPadding
, &attrib_Current
);
306 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
)) != -1) &&
307 (attrib_Current
!= attrib_Prefs
))
309 D(bug("[Wanderer:DrawerList] %s: Icon Label Horizontal Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
310 options_changed
= TRUE
;
311 if (prefs_Processing
)
313 NNSET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
317 SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
322 case MUIA_IconList_LabelText_VerticalPadding
:
323 GET(self
, MUIA_IconList_LabelText_VerticalPadding
, &attrib_Current
);
325 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
)) != -1) &&
326 (attrib_Current
!= attrib_Prefs
))
328 D(bug("[Wanderer:DrawerList] %s: Icon Label Vertical Padding changed - updating ..\n", __PRETTY_FUNCTION__
));
329 options_changed
= TRUE
;
330 if (prefs_Processing
)
332 NNSET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
336 SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
341 case MUIA_IconList_LabelText_BorderWidth
:
342 GET(self
, MUIA_IconList_LabelText_BorderWidth
, &attrib_Current
);
344 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
)) != -1) &&
345 (attrib_Current
!= attrib_Prefs
))
347 D(bug("[Wanderer:DrawerList] %s: Icon Label Border Width changed - updating ..\n", __PRETTY_FUNCTION__
));
348 options_changed
= TRUE
;
349 if (prefs_Processing
)
351 NNSET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
355 SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
360 case MUIA_IconList_LabelText_BorderHeight
:
361 GET(self
, MUIA_IconList_LabelText_BorderHeight
, &attrib_Current
);
363 if (((attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
)) != -1) &&
364 (attrib_Current
!= attrib_Prefs
))
366 D(bug("[Wanderer:DrawerList] %s: Icon Label Border Height changed - updating ..\n", __PRETTY_FUNCTION__
));
367 options_changed
= TRUE
;
368 if (prefs_Processing
)
370 NNSET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
374 SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
380 D(bug("[Wanderer:DrawerList] %s: Unhandled change\n", __PRETTY_FUNCTION__
));
386 if (!(prefs_Processing
))
388 D(bug("[Wanderer:DrawerList] %s: IconList Options have changed, causing an update ..\n", __PRETTY_FUNCTION__
));
389 DoMethod(self
, MUIM_IconList_Update
);
391 else if (data
->iwidld_IconWindow
)
393 SET(data
->iwidld_IconWindow
, MUIA_IconWindow_Changed
, TRUE
);
400 MakeStaticHook(Hook_ProcessIconListPrefsFunc
, IconWindowDrawerList__HookFunc_ProcessIconListPrefsFunc
);
405 /*** Methods ****************************************************************/
407 Object
*IconWindowDrawerList__OM_NEW(Class
*CLASS
, Object
*self
, struct opSet
*message
)
409 IPTR _newIconList__FSNotifyPort
= 0;
411 D(bug("[Wanderer:DrawerList]: %s()\n", __PRETTY_FUNCTION__
));
413 _newIconList__FSNotifyPort
= GetTagData(MUIA_Wanderer_FileSysNotifyPort
, (IPTR
) NULL
, message
->ops_AttrList
);
415 self
= (Object
*) DoSuperNewTags
419 TAG_MORE
, (IPTR
) message
->ops_AttrList
425 D(bug("[Wanderer:DrawerList] %s: SELF @ 0x%p\n", __PRETTY_FUNCTION__
, self
));
428 data
->iwidld_ProcessIconListPrefs_hook
.h_Entry
= ( HOOKFUNC
)IconWindowDrawerList__HookFunc_ProcessIconListPrefsFunc
;
430 data
->iwidld_ProcessIconListPrefs_hook
= &Hook_ProcessIconListPrefsFunc
;
433 if (_newIconList__FSNotifyPort
!= 0)
435 struct IconWindowDrawerList_DATA
*drawerlist_data
= (struct IconWindowDrawerList_DATA
*)data
;
436 drawerlist_data
->iwidld_DrawerNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
= _newIconList__FSNotifyPort
;
437 D(bug("[Wanderer:DrawerList] %s: FS Notify Port @ 0x%p\n", __PRETTY_FUNCTION__
, _newIconList__FSNotifyPort
));
446 IPTR
IconWindowDrawerList__OM_SET(Class
*CLASS
, Object
*self
, struct opSet
*message
)
450 struct TagItem
*tstate
= message
->ops_AttrList
, *tag
;
452 while ((tag
= NextTagItem((const struct TagItem
**)&tstate
)) != NULL
)
456 case MUIA_Background
:
458 D(bug("[Wanderer:DrawerList] %s: MUIA_Background\n", __PRETTY_FUNCTION__
));
461 case MUIA_IconWindow_Window
:
463 D(bug("[Wanderer:DrawerList] %s: MUIA_IconWindow_Window @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
464 data
->iwidld_IconWindow
= (Object
*)tag
->ti_Data
;
467 case MUIA_IconList_BufferRastport
:
469 D(bug("[Wanderer:DrawerList] %s: MUIA_IconList_BufferRastport @ %p\n", __PRETTY_FUNCTION__
, tag
->ti_Data
));
470 data
->iwidld_RastPort
= (struct RastPort
*)tag
->ti_Data
;
475 return DoSuperMethodA(CLASS
, self
, (Msg
) message
);
480 IPTR
IconWindowDrawerList__OM_GET(Class
*CLASS
, Object
*self
, struct opGet
*message
)
483 IPTR
*store
= message
->opg_Storage
;
486 switch (message
->opg_AttrID
)
489 *store
= (IPTR
)WIWDLVERS
;
493 *store
= (IPTR
)WIWDLREV
;
497 rv
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
504 ///IconWindowDrawerList__MUIM_Setup()
505 IPTR IconWindowDrawerList__MUIM_Setup
507 Class
*CLASS
, Object
*self
, Msg message
512 Object
*prefs
= NULL
;
514 if (!DoSuperMethodA(CLASS
, self
, message
)) return FALSE
;
516 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
520 /* Set our initial options */
523 GET(_win(self
), MUIA_IconWindow_BackgroundAttrib
, &data
->iwidld_ViewPrefs_ID
);
524 D(bug("[Wanderer:DrawerList] %s: Window Background = '%s'\n", __PRETTY_FUNCTION__
, data
->iwidld_ViewPrefs_ID
));
525 data
->iwidld_ViewPrefs_NotificationObject
= (Object
*)DoMethod(prefs
,
526 MUIM_WandererPrefs_ViewSettings_GetNotifyObject
,
527 data
->iwidld_ViewPrefs_ID
);
529 D(bug("[Wanderer:DrawerList] %s: Background Notification Obj @ 0x%p\n", __PRETTY_FUNCTION__
, data
->iwidld_ViewPrefs_NotificationObject
));
531 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_IconListMode
);
532 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_IconListMode
))) SET(self
, MUIA_IconList_IconListMode
, attrib_Prefs
);
534 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_Mode
);
535 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_Mode
))) SET(self
, MUIA_IconList_LabelText_Mode
, attrib_Prefs
);
537 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_MaxLineLen
);
538 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MaxLineLen
))) SET(self
, MUIA_IconList_LabelText_MaxLineLen
, attrib_Prefs
);
540 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLine
);
541 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLine
))) SET(self
, MUIA_IconList_LabelText_MultiLine
, attrib_Prefs
);
543 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_MultiLineOnFocus
);
544 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
))) SET(self
, MUIA_IconList_LabelText_MultiLineOnFocus
, attrib_Prefs
);
546 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_Icon_HorizontalSpacing
);
547 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_HorizontalSpacing
))) SET(self
, MUIA_IconList_Icon_HorizontalSpacing
, attrib_Prefs
);
549 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_Icon_VerticalSpacing
);
550 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_VerticalSpacing
))) SET(self
, MUIA_IconList_Icon_VerticalSpacing
, attrib_Prefs
);
552 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_Icon_ImageSpacing
);
553 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_Icon_ImageSpacing
))) SET(self
, MUIA_IconList_Icon_ImageSpacing
, attrib_Prefs
);
555 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_HorizontalPadding
);
556 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_HorizontalPadding
))) SET(self
, MUIA_IconList_LabelText_HorizontalPadding
, attrib_Prefs
);
558 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_VerticalPadding
);
559 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_VerticalPadding
))) SET(self
, MUIA_IconList_LabelText_VerticalPadding
, attrib_Prefs
);
561 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderWidth
);
562 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderWidth
))) SET(self
, MUIA_IconList_LabelText_BorderWidth
, attrib_Prefs
);
564 attrib_Prefs
= DoMethod(prefs
, MUIM_WandererPrefs_ViewSettings_GetAttribute
, data
->iwidld_ViewPrefs_ID
, MUIA_IconList_LabelText_BorderHeight
);
565 if ((attrib_Prefs
!= (IPTR
)-1) && (attrib_Prefs
!= XGET(self
, MUIA_IconList_LabelText_BorderHeight
))) SET(self
, MUIA_IconList_LabelText_BorderHeight
, attrib_Prefs
);
567 /* Configure notifications incase they get updated =) */
570 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_IconListMode
, MUIV_EveryTime
,
572 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_IconListMode
577 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_Mode
, MUIV_EveryTime
,
579 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_Mode
584 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MaxLineLen
, MUIV_EveryTime
,
586 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MaxLineLen
591 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLine
, MUIV_EveryTime
,
593 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLine
598 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_MultiLineOnFocus
, MUIV_EveryTime
,
600 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_MultiLineOnFocus
605 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_HorizontalSpacing
, MUIV_EveryTime
,
607 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_HorizontalSpacing
612 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_VerticalSpacing
, MUIV_EveryTime
,
614 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_VerticalSpacing
619 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_Icon_ImageSpacing
, MUIV_EveryTime
,
621 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_Icon_ImageSpacing
626 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_HorizontalPadding
, MUIV_EveryTime
,
628 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_HorizontalPadding
633 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_VerticalPadding
, MUIV_EveryTime
,
635 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_VerticalPadding
640 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderWidth
, MUIV_EveryTime
,
642 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderWidth
647 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_Notify
, MUIA_IconList_LabelText_BorderHeight
, MUIV_EveryTime
,
649 MUIM_CallHook
, &data
->iwidld_ProcessIconListPrefs_hook
, (IPTR
)MUIA_IconList_LabelText_BorderHeight
653 /* Setup notification on the directory -------------------------------- */
654 STRPTR directory_path
= NULL
;
655 GET(self
, MUIA_IconDrawerList_Drawer
, &directory_path
);
657 if (directory_path
!= NULL
)
659 struct IconWindowDrawerList_DATA
*drawerlist_data
= (struct IconWindowDrawerList_DATA
*)data
;
661 if (drawerlist_data
->iwidld_DrawerNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
!= NULL
)
663 drawerlist_data
->iwidld_DrawerNotifyRequest
.nr_Name
= directory_path
;
664 drawerlist_data
->iwidld_DrawerNotifyRequest
.nr_Flags
= NRF_SEND_MESSAGE
;
665 drawerlist_data
->iwidld_DrawerNotifyRequest
.nr_UserData
= self
;
667 if (StartNotify(&drawerlist_data
->iwidld_DrawerNotifyRequest
))
669 D(bug("[Wanderer:DrawerList] %s: Drawer-notification setup on '%s'\n", __PRETTY_FUNCTION__
, drawerlist_data
->iwidld_DrawerNotifyRequest
.nr_Name
));
673 D(bug("[Wanderer:DrawerList] %s: FAILED to setup Drawer-notification!\n", __PRETTY_FUNCTION__
));
674 drawerlist_data
->iwidld_DrawerNotifyRequest
.nr_Name
= NULL
;
679 D(bug("[Wanderer:DrawerList] %s: Setup complete!\n", __PRETTY_FUNCTION__
));
685 ///IconWindowDrawerList__MUIM_Cleanup()
686 IPTR IconWindowDrawerList__MUIM_Cleanup
688 Class
*CLASS
, Object
*self
, Msg message
693 Object
*prefs
= NULL
;
695 D(bug("[Wanderer:DrawerList]: %s()\n", __PRETTY_FUNCTION__
));
697 GET(_app(self
), MUIA_Wanderer_Prefs
, &prefs
);
703 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_IconListMode
, (IPTR
)self
708 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_Mode
, (IPTR
)self
713 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MaxLineLen
, (IPTR
)self
718 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLine
, (IPTR
)self
723 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_MultiLineOnFocus
, (IPTR
)self
728 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_HorizontalSpacing
, (IPTR
)self
733 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_VerticalSpacing
, (IPTR
)self
738 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_Icon_ImageSpacing
, (IPTR
)self
743 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_HorizontalPadding
, (IPTR
)self
748 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_VerticalPadding
, (IPTR
)self
753 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderWidth
, (IPTR
)self
758 data
->iwidld_ViewPrefs_NotificationObject
, MUIM_KillNotifyObj
, MUIA_IconList_LabelText_BorderHeight
, (IPTR
)self
762 struct IconWindowDrawerList_DATA
*drawerlist_data
= (struct IconWindowDrawerList_DATA
*)data
;
763 if (drawerlist_data
->iwidld_DrawerNotifyRequest
.nr_Name
!= NULL
)
765 D(bug("[Wanderer:DrawerList] %s: Removing Drawer FS Notification Request\n", __PRETTY_FUNCTION__
));
766 EndNotify(&drawerlist_data
->iwidld_DrawerNotifyRequest
);
769 return DoSuperMethodA(CLASS
, self
, message
);
773 ///IconWindowDrawerList__MUIM_DrawBackground()
774 IPTR IconWindowDrawerList__MUIM_DrawBackground
776 Class
*CLASS
, Object
*self
, struct MUIP_DrawBackground
*message
781 IPTR retVal
= (IPTR
)TRUE
;
783 struct RastPort
*DrawBackGround_RastPort
;
784 struct IconWindowBackFillMsg DrawBackGround_BackFillMsg
;
786 D(bug("[Wanderer:DrawerList]: %s()\n", __PRETTY_FUNCTION__
));
788 if ((iconwindow_BackFill_Active
== NULL
) ||
789 (data
->iwidld_IconWindow
== NULL
))
791 D(bug("[Wanderer:DrawerList] %s: No Backfill support/Window not set .. causing parent class to render\n", __PRETTY_FUNCTION__
));
792 goto iwc_ParentBackground
;
795 DrawBackGround_RastPort
= _rp(self
);
797 if ((data
->iwidld_RastPort
!= NULL
) && (DrawBackGround_RastPort
!= data
->iwidld_RastPort
))
799 DrawBackGround_RastPort
= data
->iwidld_RastPort
;
801 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= 0;
802 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= 0;
803 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= _mwidth(self
);
804 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= _mheight(self
);
806 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
- _mleft(self
);
807 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
- _mtop(self
);
808 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= message
->width
;
809 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= message
->height
;
813 DrawBackGround_BackFillMsg
.AreaBounds
.MinX
= _mleft(self
);
814 DrawBackGround_BackFillMsg
.AreaBounds
.MinY
= _mtop(self
);
815 DrawBackGround_BackFillMsg
.AreaBounds
.MaxX
= (_mleft(self
) + _mwidth(self
));
816 DrawBackGround_BackFillMsg
.AreaBounds
.MaxY
= (_mtop(self
) + _mheight(self
));
818 DrawBackGround_BackFillMsg
.DrawBounds
.MinX
= message
->left
;
819 DrawBackGround_BackFillMsg
.DrawBounds
.MinY
= message
->top
;
820 DrawBackGround_BackFillMsg
.DrawBounds
.MaxX
= (message
->left
+ message
->width
);
821 DrawBackGround_BackFillMsg
.DrawBounds
.MaxY
= (message
->top
+ message
->height
);
824 DrawBackGround_BackFillMsg
.Layer
= DrawBackGround_RastPort
->Layer
;
826 /* Offset into source image (ala scroll bar position) */
827 DrawBackGround_BackFillMsg
.OffsetX
= message
->xoffset
;
828 DrawBackGround_BackFillMsg
.OffsetY
= message
->yoffset
;
830 D(bug("[Wanderer:DrawerList] %s: RastPort @ 0x%p\n", __PRETTY_FUNCTION__
, DrawBackGround_RastPort
));
832 if ((retVal
= DoMethod(data
->iwidld_IconWindow
, MUIM_IconWindow_BackFill_DrawBackground
, XGET(data
->iwidld_IconWindow
, MUIA_IconWindow_BackFillData
), &DrawBackGround_BackFillMsg
, DrawBackGround_RastPort
)) == (IPTR
)TRUE
)
834 D(bug("[Wanderer:DrawerList] %s: Backfill module rendered background ..\n", __PRETTY_FUNCTION__
));
837 D(bug("[Wanderer:DrawerList] %s: Backfill module failed to render background ..\n", __PRETTY_FUNCTION__
));
839 iwc_ParentBackground
:
841 clip
= (IPTR
)MUI_AddClipping(muiRenderInfo(self
), message
->left
, message
->top
, message
->width
, message
->height
);
843 message
->width
= _mwidth(self
);
844 message
->height
= _mheight(self
);
845 message
->left
= _mleft(self
);
846 message
->top
= _mtop(self
);
848 retVal
= DoSuperMethodA(CLASS
, self
, (Msg
) message
);
850 MUI_RemoveClipping(muiRenderInfo(self
), (APTR
)clip
);
856 ///IconWindowDrawerList__MUIM_IconList_Update()
857 IPTR IconWindowDrawerList__MUIM_IconList_Update
859 Class
*CLASS
, Object
*self
, struct MUIP_IconList_Update
*message
864 IPTR retVal
= (IPTR
)TRUE
;
866 // DoMethod(self, MUIM_IconList_Clear);
871 /*** Setup ******************************************************************/
873 ICONWINDOWICONDRAWERLIST_CUSTOMCLASS
875 IconWindowDrawerList
, NULL
, MUIC_IconDrawerList
, NULL
,
876 OM_NEW
, struct opSet
*,
877 OM_SET
, struct opSet
*,
878 OM_GET
, struct opGet
*,
881 MUIM_DrawBackground
, Msg
884 ICONWINDOWICONDRAWERLIST_CUSTOMCLASS
886 IconWindowDrawerList
, NULL
, NULL
, IconDrawerList_Class
,
887 OM_NEW
, struct opSet
*,
888 OM_SET
, struct opSet
*,
889 OM_GET
, struct opGet
*,
892 MUIM_DrawBackground
, Msg