2 Copyright 2004-2007, The AROS Development Team. All rights reserved.
3 This file is part of the Wanderer Preferences program, which is distributed
4 under the terms of version 2 of the GNU General Public License.
9 #define MUIMASTER_YES_INLINE_STDARG
13 #define WP_MAX_BG_TAG_COUNT 20
14 #define WP_IFF_CHUNK_BUFFER_SIZE 1024
15 #define WP_MAX_RENDER_MODES 4
16 #define WP_MAX_TILE_MODES 4
17 #define WP_DRAWMODE_COUNT 2
19 #define DEBUG_ADVANCEDIMAGEOPTIONS
20 #define DEBUG_TOOLBARINTERNAL
21 #define DEBUG_SHOWUSERFILES
22 //#define DEBUG_FORCEWINSIZE
23 //#define DEBUG_NEWVIEWSETTINGS
24 //#define DEBUG_NETWORKBROWSER
25 //#define DEBUG_PERVIEWFONTS
26 #define DEBUG_MULTLINE
27 #define DEBUG_CHANGESCREENTITLE
29 #include <exec/types.h>
30 #include <utility/tagitem.h>
31 #include <libraries/mui.h>
32 #include <zune/customclasses.h>
33 #include <zune/prefseditor.h>
35 #include <proto/exec.h>
36 #include <proto/intuition.h>
37 #include <proto/utility.h>
38 #include <proto/muimaster.h>
39 #include <proto/dos.h>
40 #include <proto/iffparse.h>
42 #include <prefs/prefhdr.h>
43 #include <prefs/wanderer.h>
45 #include <clib/alib_protos.h>
51 #include "entryelements.h"
53 #warning "TODO: Include the wandererprefs definitions in a better way .."
54 #include "../../system/Wanderer/wandererprefs.h"
55 #include "../../system/Wanderer/Classes/iconlist_attributes.h"
56 #include "../../system/Wanderer/iconwindow_attributes.h"
63 /*** Private Methods ********************************************************/
65 /*** Instance Data **********************************************************/
66 struct WPEditor_ViewSettingsObject
68 struct Node wpedbo_Node
;
69 char *wpedbo_ViewName
;
70 Object
*wpedbo_ImageSpecObject
;
71 Object
*wpedbo_AdvancedOptionsObject
;
74 #warning "TODO: Replace _wpeditor_intern_IconTextRenderModeNames and co. with per view list"
75 IPTR
*wpedbo_LabelRenderModeNames
;
76 IPTR
*wpedbo_LabelRenderModeEntries
;
77 IPTR wpedbo_LabelRenderModeCount
;
79 #warning "TODO: Replace _wpeditor_intern_IconListModeNames and co. with per view list"
80 IPTR
*wpedbo_ListModeNames
;
81 IPTR
*wpedbo_ListModeEntries
;
82 IPTR wpedbo_ListModeCount
;
84 IPTR
*wpedbo_BFRenderModeNames
;
85 IPTR
*wpedbo_BFRenderModeEntries
;
86 IPTR
*wpedbo_BFRenderModePages
;
87 IPTR wpedbo_BFRenderModeCount
;
89 IPTR
*wpedbo_BFTileModeNames
;
90 IPTR
*wpedbo_BFTileModeEntries
;
91 IPTR wpedbo_BFTileModeCount
;
93 struct TagItem32
*wpedbo_Options
;
94 struct Hook wpedbo_Hook_CheckImage
;
95 struct Hook wpedbo_Hook_OpenAdvancedOptions
;
96 IPTR wpedbo_state_AdvancedDisabled
;
99 struct WPEditor_AdvancedBackgroundWindow_DATA
101 Object
*wpedabwd_Window_WindowObj
,
102 *wpedabwd_Window_UseObj
,
103 *wpedabwd_Window_CancelObj
,
104 *wpedabwd_Window_BackgroundGrpObj
,
105 *wpedabwd_Window_RenderModeGrpObj
,
106 *wpedabwd_Window_RenderModeObj
,
107 *wpedabwd_Window_RenderModePageObj
,
108 *wpedabwd_Window_TileModeObjContainer
,
109 *wpedabwd_Window_TileModeObj
,
110 *wpedabwd_Window_XOffsetObj
,
111 *wpedabwd_Window_YOffsetObj
,
112 *wpedabwd_Window_IconLabel_LabelFont
,
113 *wpedabwd_Window_IconLabel_InfoFont
,
114 *wpedabwd_Window_Icon_ListMode
,
115 *wpedabwd_Window_Icon_TextMode
,
116 *wpedabwd_Window_IconLabel_MaxLineLen
,
117 #if defined(DEBUG_MULTLINE)
118 *wpedabwd_Window_IconLabel_TextMultiLine
,
119 *wpedabwd_Window_IconLabel_MultiLineonFocus
,
120 *wpedabwd_Window_IconLabel_MultiLineNo
,
122 *wpedabwd_Window_Icon_HorSpacing
,
123 *wpedabwd_Window_Icon_VertSpacing
,
124 *wpedabwd_Window_Icon_ImageSpacing
,
125 *wpedabwd_Window_IconLabel_HorPadd
,
126 *wpedabwd_Window_IconLabel_VertPadd
,
127 *wpedabwd_Window_IconLabel_BorderWidth
,
128 *wpedabwd_Window_IconLabel_BorderHeight
;
130 struct List wpedabwd_Window_AdvancedViewRenderModes
;
131 struct List wpedabwd_Window_AdvancedViewTileModes
;
132 struct List wpedabwd_Window_AdvancedViewIconListModes
;
133 struct List wpedabwd_Window_AdvancedViewIconTextRenderModes
;
135 struct Hook wpedabwd_Hook_DrawModeChage
;
140 struct WPEditor_AdvancedBackgroundWindow_DATA
*wped_AdvancedViewSettings_WindowData
;
142 struct WPEditor_ViewSettingsObject
*wped_ViewSettings_Current
;
144 Object
*wped_FirstBGImSpecObj
,
145 *wped_FirstBGAdvancedObj
;
147 ULONG wped_DimensionsSet
;
149 Object
*wped_ViewSettings_GroupObj
,
150 *wped_ViewSettings_SpacerObj
,
151 *wped_c_NavigationMethod
,
152 *wped_cm_ToolbarEnabled
,
153 #if defined(DEBUG_CHANGESCREENTITLE)
156 *wped_toolbarpreview
,
157 #if defined(DEBUG_NETWORKBROWSER)
158 *wped_cm_EnableNetworkBrowser
,
160 #if defined(DEBUG_SHOWUSERFILES)
161 *wped_cm_EnableUserFiles
,
164 struct Hook wped_Hook_CloseAdvancedOptions
;
167 //static struct Hook navichangehook;
168 static STRPTR _wpeditor_intern_NavigationModes
[3];
170 static STRPTR _wpeditor_intern_IconListModeNames
[iconlist_ListViewModesCount
+ 1];
171 static ULONG _wpeditor_intern_IconListModeIDs
[iconlist_ListViewModesCount
+ 1];
173 static STRPTR _wpeditor_intern_IconTextRenderModeNames
[iconlist_LabelRenderModesCount
+ 1];
174 static ULONG _wpeditor_intern_IconTextRenderModeIDs
[iconlist_LabelRenderModesCount
+ 1];
176 static STRPTR _wpeditor_intern_MainPageNames
[4];
178 static Class
*_wpeditor_intern_CLASS
= NULL
;
179 static struct List _wpeditor_intern_ViewSettings
;
181 /*** Macros *****************************************************************/
182 #define SETUP_WPEDITOR_INST_DATA struct WPEditor_DATA *data = INST_DATA(CLASS, self)
184 /*** Misc Helper functions **************************************************/
185 /* 32bit replacements for utility.library tag funcs */
186 struct TagItem32
* NextTag32Item(struct TagItem32
** tagListPtr
)
188 if(!(*tagListPtr
)) return NULL
;
192 switch ((*tagListPtr
)->ti_Tag
)
198 (*tagListPtr
) = NULL
;
202 (*tagListPtr
) += (*tagListPtr
)->ti_Data
+ 1;
206 /* Use post-increment (return will return the current value and
207 then tagListPtr will be incremented) */
208 return (struct TagItem32
*)(*tagListPtr
)++;
215 struct TagItem32
* FindTag32Item(ULONG tagValue
, struct TagItem32
*tagList
)
217 struct TagItem32
*tag
;
218 const struct TagItem32
*tagptr
= tagList
;
220 while((tag
= NextTag32Item(&tagptr
)))
222 if(tag
->ti_Tag
== tagValue
) return tag
;
229 IPTR
GetTag32Data(ULONG tagValue
, ULONG defaultVal
, struct TagItem32
*tagList
)
231 struct TagItem32
*ti
= NULL
;
233 if ((tagList
!= NULL
) && (ti
= FindTag32Item(tagValue
, tagList
)))
239 IPTR
GetRenderModePage(char *rendermode_name
, STRPTR __RenderModeNames
[], IPTR __DrawModePages
[])
243 for (i
= 0; i
< WP_MAX_RENDER_MODES
; i
++)
245 if (strcmp(__RenderModeNames
[i
], rendermode_name
) == 0)
247 return __DrawModePages
[i
];
253 IPTR
SetViewSettingTag32(struct TagItem32
*this_Taglist
, ULONG Tag_ID
, ULONG newTag_Value
)
258 if (this_Taglist
[i
].ti_Tag
== TAG_DONE
)
260 else if (this_Taglist
[i
].ti_Tag
== Tag_ID
)
262 if (this_Taglist
[i
].ti_Data
== newTag_Value
) return TRUE
;
263 this_Taglist
[i
].ti_Data
= newTag_Value
;
267 }while(i
< WP_MAX_BG_TAG_COUNT
);
272 /*** Hook functions *********************************************************/
275 void, WandererPrefs_Hook_OpenAdvancedOptionsFunc
,
276 AROS_UFHA(struct Hook
*, hook
, A0
),
277 AROS_UFHA(APTR
*, obj
, A2
),
278 AROS_UFHA(APTR
, param
, A1
)
283 Object
*self
= (Object
*)obj
;
284 struct WPEditor_ViewSettingsObject
*_viewSettings_Current
= *(struct WPEditor_ViewSettingsObject
**)param
;
285 Class
*CLASS
= _wpeditor_intern_CLASS
;
286 UBYTE
*ImageSelector_Spec
= NULL
;
287 char *Image_Spec
= NULL
;
289 struct WPEditor_DATA
*data
= INST_DATA(CLASS
, self
);
291 data
->wped_ViewSettings_Current
= _viewSettings_Current
;
293 GET(_viewSettings_Current
->wpedbo_ImageSpecObject
, MUIA_Imagedisplay_Spec
, &ImageSelector_Spec
);
295 Image_Spec
= AllocVec(strlen(ImageSelector_Spec
) + 1, MEMF_ANY
|MEMF_CLEAR
);
298 strcpy(Image_Spec
, ImageSelector_Spec
);
299 SET(_viewSettings_Current
->wpedbo_ImageSpecObject
, MUIA_Imagedisplay_Spec
, Image_Spec
);
301 struct WPEditor_ViewSettingsObject
*_viewSettings_Node
= NULL
;
303 ForeachNode(&_wpeditor_intern_ViewSettings
, _viewSettings_Node
)
305 GET(_viewSettings_Node
->wpedbo_AdvancedOptionsObject
,
307 &_viewSettings_Node
->wpedbo_state_AdvancedDisabled
);
309 SET(_viewSettings_Node
->wpedbo_ImageSpecObject
, MUIA_Disabled
, TRUE
);//1_Disable
310 SET(_viewSettings_Node
->wpedbo_AdvancedOptionsObject
, MUIA_Disabled
, TRUE
);//2_Disable
311 if (_viewSettings_Node
== _viewSettings_Current
)
313 D(bug("[WPEditor] WandererPrefs_Hook_OpenAdvancedOptionsFunc: Found ViewSettings chunk for node we are editing\n"));
314 if (XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_BackgroundGrpObj
, MUIA_ShowMe
) == TRUE
)
316 ULONG current_RenderMode
= GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGRenderMode
, IconWindowExt_ImageBackFill_RenderMode_Tiled
, _viewSettings_Node
->wpedbo_Options
);
317 IPTR current_RenderMode_entry
= 0;
320 for (i
= 0; i
< data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeCount
; i
++)
322 if ((ULONG
)GetEntryElementID(data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeEntries
[i
]) == current_RenderMode
)
324 current_RenderMode_entry
= data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeEntries
[i
];
327 (Object
*)data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeObj
,
332 (Object
*)data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModePageObj
,
333 MUIA_Group_ActivePage
, data
->wped_ViewSettings_Current
->wpedbo_BFRenderModePages
[i
]
338 //D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: Render Mode '%s'\n", data->wped_ViewSettings_Current->wpedbo_BFRenderModeNames[current_rendermodepage]));
340 if (current_RenderMode
== IconWindowExt_ImageBackFill_RenderMode_Tiled
)
343 ULONG current_TileMode
= GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGTileMode
, IconWindowExt_ImageBackFill_TileMode_Float
, _viewSettings_Node
->wpedbo_Options
);
345 for (i
= 0; i
< data
->wped_ViewSettings_Current
->wpedbo_BFTileModeCount
; i
++)
347 if ((ULONG
)GetEntryElementID(data
->wped_ViewSettings_Current
->wpedbo_BFTileModeEntries
[i
]) == current_TileMode
)
349 current_RenderMode_entry
= data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeEntries
[i
];
352 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_TileModeObj
,
360 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_XOffsetObj
, MUIA_String_Integer
, GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGXOffset
, 0, _viewSettings_Current
->wpedbo_Options
));
361 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_YOffsetObj
, MUIA_String_Integer
, GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGYOffset
, 0, _viewSettings_Current
->wpedbo_Options
));
363 #if defined(DEBUG_PERVIEWFONTS)
364 // SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_LabelFont,
365 // SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_InfoFont,
367 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_Icon_ListMode
, MUIA_Cycle_Active
, GetTag32Data(MUIA_IconList_IconListMode
, ICON_LISTMODE_GRID
, _viewSettings_Current
->wpedbo_Options
));
368 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_Icon_TextMode
, MUIA_Cycle_Active
, GetTag32Data(MUIA_IconList_LabelText_Mode
, ICON_TEXTMODE_OUTLINE
, _viewSettings_Current
->wpedbo_Options
));
369 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MaxLineLen
, MUIA_String_Integer
, GetTag32Data(MUIA_IconList_LabelText_MaxLineLen
, ILC_ICONLABEL_MAXLINELEN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
));
370 #if defined(DEBUG_MULTLINE)
371 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineonFocus
, MUIA_Selected
, GetTag32Data(MUIA_IconList_LabelText_MultiLineOnFocus
, FALSE
, _viewSettings_Current
->wpedbo_Options
));
372 LONG MultiLineNo
= GetTag32Data(MUIA_IconList_LabelText_MultiLine
, 1, _viewSettings_Current
->wpedbo_Options
);
373 if (MultiLineNo
< 1) MultiLineNo
= 1;
376 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_TextMultiLine
, MUIA_Selected
, TRUE
);
377 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineNo
, MUIA_Disabled
, FALSE
);
381 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_TextMultiLine
, MUIA_Selected
, FALSE
);
382 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineNo
, MUIA_Disabled
, TRUE
);
384 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineNo
, MUIA_String_Integer
, MultiLineNo
);
386 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_Icon_HorSpacing
, MUIA_String_Integer
, GetTag32Data(MUIA_IconList_Icon_HorizontalSpacing
, ILC_ICON_HORIZONTALMARGIN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
));
387 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_Icon_VertSpacing
, MUIA_String_Integer
, GetTag32Data(MUIA_IconList_Icon_VerticalSpacing
, ILC_ICON_VERTICALMARGIN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
));
388 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_Icon_ImageSpacing
, MUIA_String_Integer
, GetTag32Data(MUIA_IconList_Icon_ImageSpacing
, ILC_ICONLABEL_IMAGEMARGIN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
));
389 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_HorPadd
, MUIA_String_Integer
, GetTag32Data(MUIA_IconList_LabelText_HorizontalPadding
, ILC_ICONLABEL_HORIZONTALTEXTMARGIN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
));
390 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_VertPadd
, MUIA_String_Integer
, GetTag32Data(MUIA_IconList_LabelText_VerticalPadding
, ILC_ICONLABEL_VERTICALTEXTMARGIN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
));
391 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_BorderWidth
, MUIA_String_Integer
, GetTag32Data(MUIA_IconList_LabelText_BorderWidth
, ILC_ICONLABEL_BORDERWIDTH_DEFAULT
, _viewSettings_Current
->wpedbo_Options
));
392 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_BorderHeight
, MUIA_String_Integer
, GetTag32Data(MUIA_IconList_LabelText_BorderHeight
, ILC_ICONLABEL_BORDERHEIGHT_DEFAULT
, _viewSettings_Current
->wpedbo_Options
));
396 /*Enable this and remove *_Disable instructions over
397 when discovered the zune refresh problem...*/
398 //SET(data->wped_ViewSettings_GroupObj, MUIA_Disabled, TRUE);
400 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_WindowObj
, MUIA_Window_Open
, TRUE
);
408 void, WandererPrefs_Hook_CloseAdvancedOptionsFunc
,
409 AROS_UFHA(struct Hook
*, hook
, A0
),
410 AROS_UFHA(APTR
*, obj
, A2
),
411 AROS_UFHA(APTR
, param
, A1
)
416 Object
*self
= ( Object
*)obj
;
417 BOOL use_settings
= (BOOL
) *( IPTR
*)param
;
418 struct WPEditor_ViewSettingsObject
*_viewSettings_Node
= NULL
;
419 Class
*CLASS
= _wpeditor_intern_CLASS
;
420 BOOL settings_changed
= FALSE
;
421 BOOL success
= FALSE
;
423 SETUP_WPEDITOR_INST_DATA
;
425 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc()\n"));
427 /*Enable this and remove *_Enable instructions under
428 when discovered the zune refresh problem...*/
429 //SET(data->wped_ViewSettings_GroupObj, MUIA_Disabled, FALSE);
431 ForeachNode(&_wpeditor_intern_ViewSettings
, _viewSettings_Node
)
433 SET(_viewSettings_Node
->wpedbo_ImageSpecObject
, MUIA_Disabled
, FALSE
);
434 SET(_viewSettings_Node
->wpedbo_AdvancedOptionsObject
, MUIA_Disabled
, _viewSettings_Node
->wpedbo_state_AdvancedDisabled
);
437 if ((use_settings
) && (data
->wped_ViewSettings_Current
))
439 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: Updating tags for Background ..\n"));
440 IPTR current_rendermodepage
= 0;
441 ULONG current_rendermode
;
443 GET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeObj
, MUIA_Cycle_Active
, ¤t_rendermodepage
);
444 IPTR current_rendermode_entry
= data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeEntries
[current_rendermodepage
];
446 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: Render Mode '%s'\n", data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeNames
[current_rendermodepage
]));
447 current_rendermode
= (ULONG
)GetEntryElementID(current_rendermode_entry
);
448 if (current_rendermode
== -1)
450 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: ERROR: Unknown Render mode string!?!?!\n"));
454 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconWindowExt_ImageBackFill_BGRenderMode
, current_rendermode
);
455 if (success
== FALSE
)
457 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconWindowExt_ImageBackFill_BGRenderMode TAG - Adding ..\n"));
458 #warning "TODO: Allocate extra storage for our tags.."
460 else if (success
== TRUE
)
462 settings_changed
= TRUE
;
465 switch (current_rendermode
)
467 case IconWindowExt_ImageBackFill_RenderMode_Scale
:
470 case IconWindowExt_ImageBackFill_RenderMode_Tiled
:
471 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconWindowExt_ImageBackFill_BGXOffset
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_XOffsetObj
, MUIA_String_Integer
));
472 if (success
== FALSE
)
474 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconWindowExt_ImageBackFill_BGXOffset TAG - Adding ..\n"));
475 #warning "TODO: Allocate extra storage for our tags.."
477 else if (success
== TRUE
)
479 settings_changed
= TRUE
;
482 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconWindowExt_ImageBackFill_BGYOffset
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_YOffsetObj
, MUIA_String_Integer
));
483 if (success
== FALSE
)
485 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconWindowExt_ImageBackFill_BGYOffset TAG - Adding ..\n"));
486 #warning "TODO: Allocate extra storage for our tags.."
488 else if (success
== TRUE
)
490 settings_changed
= TRUE
;
493 IPTR current_tilemodeno
= 0;
494 ULONG current_tilemode
= 0;
496 GET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_TileModeObj
, MUIA_Cycle_Active
, ¤t_tilemodeno
);
497 IPTR current_tilemode_entry
= data
->wped_ViewSettings_Current
->wpedbo_BFTileModeEntries
[current_tilemodeno
];
499 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: Tile Mode '%s'\n", data
->wped_ViewSettings_Current
->wpedbo_BFTileModeNames
[current_tilemodeno
]));
500 current_tilemode
= (ULONG
)GetEntryElementID(current_tilemode_entry
);
502 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconWindowExt_ImageBackFill_BGTileMode
, current_tilemode
);
503 if (success
== FALSE
)
505 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconWindowExt_ImageBackFill_BGTileMode TAG - Adding ..\n"));
506 #warning "TODO: Allocate extra storage for our tags.."
508 else if (success
== TRUE
)
510 settings_changed
= TRUE
;
516 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_IconListMode
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_Icon_ListMode
, MUIA_Cycle_Active
));
517 if (success
== FALSE
)
519 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_IconListMode TAG - Adding ..\n"));
520 #warning "TODO: Allocate extra storage for our tags.."
522 else if (success
== TRUE
)
524 settings_changed
= TRUE
;
527 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_LabelText_Mode
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_Icon_TextMode
, MUIA_Cycle_Active
));
528 if (success
== FALSE
)
530 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_Mode TAG - Adding ..\n"));
531 #warning "TODO: Allocate extra storage for our tags.."
533 else if (success
== TRUE
)
535 settings_changed
= TRUE
;
538 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_LabelText_MaxLineLen
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MaxLineLen
, MUIA_String_Integer
));
539 if (success
== FALSE
)
541 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_MaxLineLen TAG - Adding ..\n"));
542 #warning "TODO: Allocate extra storage for our tags.."
544 else if (success
== TRUE
)
546 settings_changed
= TRUE
;
549 #if defined(DEBUG_MULTLINE)
550 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_LabelText_MultiLineOnFocus
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineonFocus
, MUIA_Selected
));
551 if (success
== FALSE
)
553 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_MultiLineOnFocus TAG - Adding ..\n"));
554 #warning "TODO: Allocate extra storage for our tags.."
556 else if (success
== TRUE
)
558 settings_changed
= TRUE
;
561 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_LabelText_MultiLine
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineNo
, MUIA_String_Integer
));
562 if (success
== FALSE
)
564 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_MultiLine TAG - Adding ..\n"));
565 #warning "TODO: Allocate extra storage for our tags.."
567 else if (success
== TRUE
)
569 settings_changed
= TRUE
;
572 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_Icon_HorizontalSpacing
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_Icon_HorSpacing
, MUIA_String_Integer
));
573 if (success
== FALSE
)
575 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_Icon_HorizontalSpacing TAG - Adding ..\n"));
576 #warning "TODO: Allocate extra storage for our tags.."
578 else if (success
== TRUE
)
580 settings_changed
= TRUE
;
583 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_Icon_VerticalSpacing
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_Icon_VertSpacing
, MUIA_String_Integer
));
584 if (success
== FALSE
)
586 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_Icon_VerticalSpacing TAG - Adding ..\n"));
587 #warning "TODO: Allocate extra storage for our tags.."
589 else if (success
== TRUE
)
591 settings_changed
= TRUE
;
594 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_Icon_ImageSpacing
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_Icon_ImageSpacing
, MUIA_String_Integer
));
595 if (success
== FALSE
)
597 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_Icon_ImageSpacing TAG - Adding ..\n"));
598 #warning "TODO: Allocate extra storage for our tags.."
600 else if (success
== TRUE
)
602 settings_changed
= TRUE
;
605 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_LabelText_HorizontalPadding
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_HorPadd
, MUIA_String_Integer
));
606 if (success
== FALSE
)
608 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_HorizontalPadding TAG - Adding ..\n"));
609 #warning "TODO: Allocate extra storage for our tags.."
611 else if (success
== TRUE
)
613 settings_changed
= TRUE
;
616 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_LabelText_VerticalPadding
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_VertPadd
, MUIA_String_Integer
));
617 if (success
== FALSE
)
619 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_VerticalPadding TAG - Adding ..\n"));
620 #warning "TODO: Allocate extra storage for our tags.."
622 else if (success
== TRUE
)
624 settings_changed
= TRUE
;
627 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_LabelText_BorderWidth
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_BorderWidth
, MUIA_String_Integer
));
628 if (success
== FALSE
)
630 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_BorderWidth TAG - Adding ..\n"));
631 #warning "TODO: Allocate extra storage for our tags.."
633 else if (success
== TRUE
)
635 settings_changed
= TRUE
;
638 success
= SetViewSettingTag32(data
->wped_ViewSettings_Current
->wpedbo_Options
, MUIA_IconList_LabelText_BorderHeight
, XGET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_BorderHeight
, MUIA_String_Integer
));
639 if (success
== FALSE
)
641 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_BorderHeight TAG - Adding ..\n"));
642 #warning "TODO: Allocate extra storage for our tags.."
644 else if (success
== TRUE
)
646 settings_changed
= TRUE
;
649 if (settings_changed
) SET(self
, MUIA_PrefsEditor_Changed
, TRUE
);
653 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: Cancel selected\n"));
656 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_WindowObj
, MUIA_Window_Open
, FALSE
);
663 void, WandererPrefs_Hook_DrawModeChangeFunc
,
664 AROS_UFHA(struct Hook
*, hook
, A0
),
665 AROS_UFHA(APTR
*, obj
, A2
),
666 AROS_UFHA(APTR
, param
, A1
)
671 Object
*self
= ( Object
*)obj
;
672 Class
*CLASS
= *( Class
**)param
;
674 SETUP_WPEDITOR_INST_DATA
;
676 D(bug("[WPEditor] WandererPrefs_Hook_DrawModeChangeFunc()\n"));
678 if (data
->wped_ViewSettings_Current
)
680 IPTR active_cycleentry
= 0;
681 GET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeObj
, MUIA_Cycle_Active
, &active_cycleentry
);
683 D(bug("[WPEditor] WandererPrefs_Hook_DrawModeChangeFunc: RenderMode Cycle Active = %d, Page = %d\n", active_cycleentry
, data
->wped_ViewSettings_Current
->wpedbo_BFRenderModePages
[active_cycleentry
]));
685 IPTR active_page
= 0;
686 GET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModePageObj
, MUIA_Group_ActivePage
, &active_page
);
688 if (active_page
!= data
->wped_ViewSettings_Current
->wpedbo_BFRenderModePages
[active_cycleentry
])
692 (Object
*)data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModePageObj
,
693 MUIA_Group_ActivePage
, data
->wped_ViewSettings_Current
->wpedbo_BFRenderModePages
[active_cycleentry
]
695 D(bug("[WPEditor] WandererPrefs_Hook_DrawModeChangeFunc: Changing Active Page to %d\n", data
->wped_ViewSettings_Current
->wpedbo_BFRenderModePages
[active_cycleentry
]));
704 void, WandererPrefs_Hook_CheckImageFunc
,
705 AROS_UFHA(struct Hook
*, hook
, A0
),
706 AROS_UFHA(APTR
*, obj
, A2
),
707 AROS_UFHA(APTR
, param
, A1
)
712 Object
*self
= (Object
*) obj
;
713 struct WPEditor_ViewSettingsObject
*_viewSettings_Current
= *( struct WPEditor_ViewSettingsObject
**)param
;
714 Class
*CLASS
= _wpeditor_intern_CLASS
;
716 SETUP_WPEDITOR_INST_DATA
;
718 UBYTE
*ImageSelector_Spec
= NULL
;
720 GET(_viewSettings_Current
->wpedbo_ImageSpecObject
, MUIA_Imagedisplay_Spec
, &ImageSelector_Spec
);
722 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Object @ 0x%p reports image spec '%s'\n", _viewSettings_Current
->wpedbo_ImageSpecObject
, (char *)ImageSelector_Spec
));
724 IPTR this_Background_type
= (IPTR
)(ImageSelector_Spec
[0] - 48);
726 _viewSettings_Current
->wpedbo_Type
= (APTR
) this_Background_type
;
727 data
->wped_ViewSettings_Current
= _viewSettings_Current
;
729 if (_viewSettings_Current
->wpedbo_AdvancedOptionsObject
)
731 struct TagItem32 newVS_Options
[WP_MAX_BG_TAG_COUNT
];
732 IPTR newVS_OptionCount
= 0, BFTileModeCount
= 0;
733 IPTR newBG_RenderModeCount
= 0;
734 IPTR newBG_RenderModePages
[WP_DRAWMODE_COUNT
];
735 STRPTR newBG_RenderModes
[WP_DRAWMODE_COUNT
];
737 if ((_viewSettings_Current
->wpedbo_Type
== 5)||(_viewSettings_Current
->wpedbo_Type
== 0))
739 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Image-type spec (%d) - Enabling Advanced Image options ..\n", _viewSettings_Current
->wpedbo_Type
));
740 #if defined(DEBUG_ADVANCEDIMAGEOPTIONS)
741 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_BackgroundGrpObj
, MUIA_ShowMe
, TRUE
);
744 for (newVS_OptionCount
= 0; newVS_OptionCount
< WP_MAX_BG_TAG_COUNT
; newVS_OptionCount
++)
746 newVS_Options
[newVS_OptionCount
].ti_Tag
= TAG_DONE
;
748 newVS_OptionCount
= 0;
750 if (_viewSettings_Current
->wpedbo_Options
)
752 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Existing options @ 0x%p\n", _viewSettings_Current
->wpedbo_Options
));
755 switch ((int)_viewSettings_Current
->wpedbo_Type
)
757 IPTR DRAWMODEENTRY
= 0;
761 if ((strcmp(_viewSettings_Current
->wpedbo_ViewName
, "Workbench")) == 0)
763 DRAWMODEENTRY
= EntryElementFindNode(&data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_AdvancedViewRenderModes
, IconWindowExt_ImageBackFill_RenderMode_Scale
);
764 newBG_RenderModes
[newBG_RenderModeCount
] = GetEntryElementName(DRAWMODEENTRY
);
765 newBG_RenderModePages
[newBG_RenderModeCount
++] = 0;
767 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: DrawMode %d = '%s'\n", newBG_RenderModeCount
-1, newBG_RenderModes
[newBG_RenderModeCount
-1]));
772 DRAWMODEENTRY
= EntryElementFindNode(&data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_AdvancedViewRenderModes
, IconWindowExt_ImageBackFill_RenderMode_Tiled
);
773 newBG_RenderModes
[newBG_RenderModeCount
] = GetEntryElementName(DRAWMODEENTRY
);
774 newBG_RenderModePages
[newBG_RenderModeCount
++] = 1;
776 IPTR old_bg_tilemodes
= (IPTR
)data
->wped_ViewSettings_Current
->wpedbo_BFTileModeNames
;
777 IPTR old_bg_tilemodeentries
= (IPTR
)data
->wped_ViewSettings_Current
->wpedbo_BFTileModeEntries
;
779 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Old TileModes @ 0x%p, Entries @ 0x%p\n", old_bg_tilemodes
, old_bg_tilemodeentries
));
781 data
->wped_ViewSettings_Current
->wpedbo_BFTileModeNames
= NULL
;
782 data
->wped_ViewSettings_Current
->wpedbo_BFTileModeEntries
= NULL
;
784 data
->wped_ViewSettings_Current
->wpedbo_BFTileModeCount
= EntryElementCount(&data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_AdvancedViewTileModes
);
786 data
->wped_ViewSettings_Current
->wpedbo_BFTileModeNames
= AllocVec((sizeof(STRPTR
) * (data
->wped_ViewSettings_Current
->wpedbo_BFTileModeCount
+ 1)), MEMF_ANY
|MEMF_CLEAR
);
787 data
->wped_ViewSettings_Current
->wpedbo_BFTileModeEntries
= AllocVec((sizeof(IPTR
) * data
->wped_ViewSettings_Current
->wpedbo_BFTileModeCount
), MEMF_ANY
|MEMF_CLEAR
);
789 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Allocated %d TileModes - Array @ 0x%p, Entries @ 0x%p\n", data
->wped_ViewSettings_Current
->wpedbo_BFTileModeCount
, data
->wped_ViewSettings_Current
->wpedbo_BFTileModeNames
, data
->wped_ViewSettings_Current
->wpedbo_BFTileModeEntries
));
790 struct Node
*tilelist_entry
= NULL
;
792 ForeachNode(&data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_AdvancedViewTileModes
, tilelist_entry
)
794 data
->wped_ViewSettings_Current
->wpedbo_BFTileModeNames
[BFTileModeCount
] = GetEntryElementName(tilelist_entry
);
795 data
->wped_ViewSettings_Current
->wpedbo_BFTileModeEntries
[BFTileModeCount
] = tilelist_entry
;
799 Object
*new_TileModeObj
= NULL
;
801 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Creating TileModes Cycle gadget\n"));
802 new_TileModeObj
= MUI_MakeObject(MUIO_Cycle
,
804 data
->wped_ViewSettings_Current
->wpedbo_BFTileModeNames
809 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Object @ 0x%p\n", new_TileModeObj
));
810 if (DoMethod(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_TileModeObjContainer
, MUIM_Group_InitChange
))
812 DoMethod(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_TileModeObjContainer
, OM_REMMEMBER
, data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_TileModeObj
);
813 DoMethod(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_TileModeObjContainer
, OM_ADDMEMBER
, new_TileModeObj
);
814 DoMethod(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_TileModeObjContainer
, MUIM_Group_ExitChange
);
816 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_TileModeObj
= new_TileModeObj
;
820 if (old_bg_tilemodes
)
821 FreeVec((APTR
)old_bg_tilemodes
);
823 if (old_bg_tilemodeentries
)
824 FreeVec((APTR
)old_bg_tilemodeentries
);
826 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconWindowExt_ImageBackFill_BGRenderMode
;
827 if (_viewSettings_Current
->wpedbo_Options
)
828 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGRenderMode
, IconWindowExt_ImageBackFill_RenderMode_Tiled
, _viewSettings_Current
->wpedbo_Options
);
830 newVS_Options
[newVS_OptionCount
++].ti_Data
= IconWindowExt_ImageBackFill_RenderMode_Tiled
;
832 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconWindowExt_ImageBackFill_BGTileMode
;
833 if (_viewSettings_Current
->wpedbo_Options
)
834 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGTileMode
, IconWindowExt_ImageBackFill_TileMode_Float
, _viewSettings_Current
->wpedbo_Options
);
836 newVS_Options
[newVS_OptionCount
++].ti_Data
= IconWindowExt_ImageBackFill_TileMode_Float
;
838 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconWindowExt_ImageBackFill_BGXOffset
;
839 if (_viewSettings_Current
->wpedbo_Options
)
840 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGXOffset
, 0, _viewSettings_Current
->wpedbo_Options
);
842 newVS_Options
[newVS_OptionCount
++].ti_Data
= 0;
844 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconWindowExt_ImageBackFill_BGYOffset
;
845 if (_viewSettings_Current
->wpedbo_Options
)
846 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGYOffset
, 0, _viewSettings_Current
->wpedbo_Options
);
848 newVS_Options
[newVS_OptionCount
++].ti_Data
= 0;
850 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: DrawMode %d = '%s'\n", newBG_RenderModeCount
-1, newBG_RenderModes
[newBG_RenderModeCount
-1]));
858 SET(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_BackgroundGrpObj
, MUIA_ShowMe
, FALSE
);
861 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_IconListMode
;
862 if (_viewSettings_Current
->wpedbo_Options
)
863 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_IconListMode
, ICON_LISTMODE_GRID
, _viewSettings_Current
->wpedbo_Options
);
865 newVS_Options
[newVS_OptionCount
++].ti_Data
= ICON_LISTMODE_GRID
;
867 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_LabelText_Mode
;
868 if (_viewSettings_Current
->wpedbo_Options
)
869 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_LabelText_Mode
, ICON_TEXTMODE_OUTLINE
, _viewSettings_Current
->wpedbo_Options
);
871 newVS_Options
[newVS_OptionCount
++].ti_Data
= ICON_TEXTMODE_OUTLINE
;
873 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_LabelText_MaxLineLen
;
874 if (_viewSettings_Current
->wpedbo_Options
)
875 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_LabelText_MaxLineLen
, ILC_ICONLABEL_MAXLINELEN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
);
877 newVS_Options
[newVS_OptionCount
++].ti_Data
= ILC_ICONLABEL_MAXLINELEN_DEFAULT
;
879 #if defined(DEBUG_MULTLINE)
880 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_LabelText_MultiLine
;
881 if (_viewSettings_Current
->wpedbo_Options
)
882 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_LabelText_MultiLine
, 1, _viewSettings_Current
->wpedbo_Options
);
884 newVS_Options
[newVS_OptionCount
++].ti_Data
= 1;
886 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_LabelText_MultiLineOnFocus
;
887 if (_viewSettings_Current
->wpedbo_Options
)
888 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_LabelText_MultiLineOnFocus
, FALSE
, _viewSettings_Current
->wpedbo_Options
);
890 newVS_Options
[newVS_OptionCount
++].ti_Data
= FALSE
;
893 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_Icon_HorizontalSpacing
;
894 if (_viewSettings_Current
->wpedbo_Options
)
895 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_Icon_HorizontalSpacing
, ILC_ICON_HORIZONTALMARGIN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
);
897 newVS_Options
[newVS_OptionCount
++].ti_Data
= ILC_ICON_HORIZONTALMARGIN_DEFAULT
;
899 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_Icon_VerticalSpacing
;
900 if (_viewSettings_Current
->wpedbo_Options
)
901 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_Icon_VerticalSpacing
, ILC_ICON_VERTICALMARGIN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
);
903 newVS_Options
[newVS_OptionCount
++].ti_Data
= ILC_ICON_VERTICALMARGIN_DEFAULT
;
905 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_Icon_ImageSpacing
;
906 if (_viewSettings_Current
->wpedbo_Options
)
907 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_Icon_ImageSpacing
, ILC_ICONLABEL_IMAGEMARGIN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
);
909 newVS_Options
[newVS_OptionCount
++].ti_Data
= ILC_ICONLABEL_IMAGEMARGIN_DEFAULT
;
911 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_LabelText_HorizontalPadding
;
912 if (_viewSettings_Current
->wpedbo_Options
)
913 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_LabelText_HorizontalPadding
, ILC_ICONLABEL_HORIZONTALTEXTMARGIN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
);
915 newVS_Options
[newVS_OptionCount
++].ti_Data
= ILC_ICONLABEL_HORIZONTALTEXTMARGIN_DEFAULT
;
917 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_LabelText_VerticalPadding
;
918 if (_viewSettings_Current
->wpedbo_Options
)
919 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_LabelText_VerticalPadding
, ILC_ICONLABEL_VERTICALTEXTMARGIN_DEFAULT
, _viewSettings_Current
->wpedbo_Options
);
921 newVS_Options
[newVS_OptionCount
++].ti_Data
= ILC_ICONLABEL_VERTICALTEXTMARGIN_DEFAULT
;
923 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_LabelText_BorderWidth
;
924 if (_viewSettings_Current
->wpedbo_Options
)
925 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_LabelText_BorderWidth
, ILC_ICONLABEL_BORDERWIDTH_DEFAULT
, _viewSettings_Current
->wpedbo_Options
);
927 newVS_Options
[newVS_OptionCount
++].ti_Data
= ILC_ICONLABEL_BORDERWIDTH_DEFAULT
;
929 newVS_Options
[newVS_OptionCount
].ti_Tag
= MUIA_IconList_LabelText_BorderHeight
;
930 if (_viewSettings_Current
->wpedbo_Options
)
931 newVS_Options
[newVS_OptionCount
++].ti_Data
= GetTag32Data(MUIA_IconList_LabelText_BorderHeight
, ILC_ICONLABEL_BORDERHEIGHT_DEFAULT
, _viewSettings_Current
->wpedbo_Options
);
933 newVS_Options
[newVS_OptionCount
++].ti_Data
= ILC_ICONLABEL_BORDERHEIGHT_DEFAULT
;
935 if (newVS_OptionCount
> 0)
937 IPTR old_bg_options
= (IPTR
) _viewSettings_Current
->wpedbo_Options
,
938 VSOptionCountCount
= 0;
940 _viewSettings_Current
->wpedbo_Options
= NULL
;
942 _viewSettings_Current
->wpedbo_Options
= AllocVec((sizeof(struct TagItem32
) * (newVS_OptionCount
+ 1)), MEMF_ANY
|MEMF_CLEAR
);
943 for (VSOptionCountCount
= 0; VSOptionCountCount
< newVS_OptionCount
; VSOptionCountCount
++)
945 _viewSettings_Current
->wpedbo_Options
[VSOptionCountCount
].ti_Tag
= newVS_Options
[VSOptionCountCount
].ti_Tag
;
946 _viewSettings_Current
->wpedbo_Options
[VSOptionCountCount
].ti_Data
= newVS_Options
[VSOptionCountCount
].ti_Data
;
950 FreeVec((struct TagItem32
*)old_bg_options
);
953 if (newBG_RenderModeCount
> 0)
955 IPTR old_bg_drawmodes
= (IPTR
)data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeNames
;
956 IPTR old_bg_drawpages
= (IPTR
)data
->wped_ViewSettings_Current
->wpedbo_BFRenderModePages
;
957 IPTR BFRenderModeCount
= 0;
959 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Old RenderModes @ 0x%p, pages @ 0x%p\n", old_bg_drawmodes
, old_bg_drawpages
));
961 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeNames
= NULL
;
962 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModePages
= NULL
;
963 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeEntries
= NULL
;
965 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeNames
= AllocVec((sizeof(STRPTR
) * (newBG_RenderModeCount
+ 1)), MEMF_ANY
|MEMF_CLEAR
);
966 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModePages
= AllocVec((sizeof(IPTR
) * newBG_RenderModeCount
), MEMF_ANY
|MEMF_CLEAR
);
967 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeEntries
= AllocVec((sizeof(IPTR
) * newBG_RenderModeCount
), MEMF_ANY
|MEMF_CLEAR
);
968 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeCount
= newBG_RenderModeCount
;
970 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Allocated %d RenderModes - Array @ 0x%p, page mappings @ 0x%p\n", data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeCount
, data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeNames
, data
->wped_ViewSettings_Current
->wpedbo_BFRenderModePages
));
972 for (BFRenderModeCount
= 0; BFRenderModeCount
< data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeCount
; BFRenderModeCount
++)
974 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeNames
[BFRenderModeCount
] = newBG_RenderModes
[BFRenderModeCount
];
975 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModePages
[BFRenderModeCount
] = newBG_RenderModePages
[BFRenderModeCount
];
976 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeEntries
[BFRenderModeCount
] = EntryElementFindNamedNode(&data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_AdvancedViewRenderModes
, newBG_RenderModes
[BFRenderModeCount
]);
979 Object
*new_RenderModeObj
= NULL
;
981 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Creating RenderModes Cycle gadget\n"));
982 new_RenderModeObj
= MUI_MakeObject(MUIO_Cycle
,
984 data
->wped_ViewSettings_Current
->wpedbo_BFRenderModeNames
986 if (new_RenderModeObj
)
988 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Object @ 0x%p\n", new_RenderModeObj
));
989 if (DoMethod(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeGrpObj
, MUIM_Group_InitChange
))
991 DoMethod(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeGrpObj
, OM_REMMEMBER
, data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeObj
);
992 DoMethod(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeGrpObj
, OM_ADDMEMBER
, new_RenderModeObj
);
993 DoMethod(data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeGrpObj
, MUIM_Group_ExitChange
);
995 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeObj
= new_RenderModeObj
;
998 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeObj
,
999 MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1000 (IPTR
)self
, 3, MUIM_CallHook
,
1001 &data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Hook_DrawModeChage
, CLASS
1006 if (old_bg_drawmodes
)
1007 FreeVec((APTR
)old_bg_drawmodes
);
1009 if (old_bg_drawpages
)
1010 FreeVec((APTR
)old_bg_drawpages
);
1015 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: xxxxxxx - Disabling Advanced options ..\n"));
1016 SET(_viewSettings_Current
->wpedbo_AdvancedOptionsObject
, MUIA_Disabled
, TRUE
);
1018 SET(self
, MUIA_PrefsEditor_Changed
, TRUE
);
1023 struct WPEditor_ViewSettingsObject
*WPEditor__FindViewSettingObjects(char * this_Name
)
1025 struct WPEditor_ViewSettingsObject
*_viewSettings_Current
= NULL
;
1027 ForeachNode(&_wpeditor_intern_ViewSettings
, _viewSettings_Current
)
1029 if ((strcmp(_viewSettings_Current
->wpedbo_ViewName
, this_Name
)) == 0) return _viewSettings_Current
;
1034 /*WPEditor__NewViewSettingObjects(): Add new ViewSetting object to
1035 *scrollgroup in left part of Appearance page;
1036 *It wants the name of new ViewSetting object, and if this
1037 *ViewSetting object supports a backfill;
1038 *The function creates a new 50x50 MUIC_Popimage (a private class
1039 *which is composed by an imagebutton connected to a setting
1040 *window) which has "MSG_SELECT_WORKBENCH_BACKGROUND" as window
1042 *Image contained in MUIC_Popimage is going to inserted by a call
1043 *WPEditor__MUIM_PrefsEditor_ImportFH() during the initialization
1044 *of WPEditor Zune object and when these objects must be repainted;
1045 *If backfillsupport is TRUE a button labelled "Advanced" is
1046 *created and hooked to WandererPrefs_Hook_CheckImageFunc();
1047 *The new MUIC_Popimage and eventually an "Advanced" button
1048 *are added as attributes to a ViewSetting object, and this last one
1049 *is added as node to the global struct _wpeditor_intern_ViewSettings;
1050 *The function returns the new ViewSetting object or NULL if
1053 struct WPEditor_ViewSettingsObject
*WPEditor__NewViewSettingObjects(char * this_Name
, BOOL backfillsupport
)
1055 struct WPEditor_ViewSettingsObject
*_viewSettings_Current
= NULL
;
1057 D(bug("[WPEditor] WPEditor__NewViewSettingObjects('%s')\n", this_Name
));
1058 _viewSettings_Current
= AllocMem(sizeof(struct WPEditor_ViewSettingsObject
), MEMF_ANY
|MEMF_CLEAR
);
1059 if (_viewSettings_Current
)
1061 _viewSettings_Current
->wpedbo_ViewName
= AllocVec(strlen(this_Name
) + 1, MEMF_ANY
|MEMF_CLEAR
);
1062 if (_viewSettings_Current
->wpedbo_ViewName
)
1064 strcpy(_viewSettings_Current
->wpedbo_ViewName
, this_Name
);
1066 _viewSettings_Current
->wpedbo_ImageSpecObject
= (Object
*)PopimageObject
,
1069 MUIA_Window_Title
, __(MSG_SELECT_WORKBENCH_BACKGROUND
),
1070 MUIA_Imageadjust_Type
, MUIV_Imageadjust_Type_Background
,
1074 if (_viewSettings_Current
->wpedbo_ImageSpecObject
)
1076 if (backfillsupport
)
1077 _viewSettings_Current
->wpedbo_AdvancedOptionsObject
= SimpleButton("Advanced");
1079 _viewSettings_Current
->wpedbo_Hook_CheckImage
.h_Entry
= ( HOOKFUNC
)WandererPrefs_Hook_CheckImageFunc
;
1080 AddTail(&_wpeditor_intern_ViewSettings
, &_viewSettings_Current
->wpedbo_Node
);
1081 D(bug("[WPEditor] WPEditor__NewViewSettingObjects: Successfully created\n"));
1082 return _viewSettings_Current
;
1084 FreeVec(_viewSettings_Current
->wpedbo_ViewName
);
1087 FreeMem(_viewSettings_Current
, sizeof(struct WPEditor_ViewSettingsObject
));
1088 _viewSettings_Current
= NULL
;
1090 D(bug("[WPEditor] WPEditor__NewViewSettingObjects: Failed to create objects\n"));
1095 /*** Methods ****************************************************************/
1096 Object
*WPEditor__OM_NEW(Class
*CLASS
, Object
*self
, struct opSet
*message
)
1098 struct WPEditor_DATA
*data
= NULL
;
1099 struct WPEditor_AdvancedBackgroundWindow_DATA
*advancedView_data
= NULL
;
1101 Object
*_WP_Navigation_HGrp1
= NULL
,
1102 *_WP_Navigation_InnerHGrp1
= NULL
,
1103 *_WP_Navigation_TypeObj
= NULL
,
1104 *_WP_Navigation_InnerHGrp2
= NULL
,
1105 #if defined(DEBUG_CHANGESCREENTITLE)
1106 *_WP_Navigation_HGrp2
=NULL
,
1107 *_WP_Navigation_InnerHGrp3
= NULL
,
1108 *_WP_Navigator_ScreenTitleObj
= NULL
,
1110 *_WP_NavigationObj
= NULL
,
1111 *_WP_Appearance_GroupObj
= NULL
,
1112 *_WP_ViewSettings_GroupObj
= NULL
,
1113 *_WP_ViewSettings_SpacerObj
= NULL
,
1114 *_WP_ViewSettings_VirtGrpObj
= NULL
,
1115 *_WP_ViewSettings_ScrollGrpObj
= NULL
,
1116 #if defined(DEBUG_NETWORKBROWSER)
1117 *_WP_NetworkBrowser_EnabledObj
= NULL
,
1119 #if defined(DEBUG_SHOWUSERFILES)
1120 *_WP_UserFiles_ShowFileFolderObj
= NULL
,
1122 *_WP_Toolbar_EnabledObj
= NULL
,
1123 *_WP_Toolbar_GroupObj
= NULL
,
1124 *_WP_Toolbar_InnerGroupObj1
= NULL
,
1125 *_WP_Toolbar_InnerGroupObj2
= NULL
,
1126 *_WP_Toolbar_InnerGroupObj3
= NULL
,
1127 *_WP_Toolbar_InnerGroupObj4
= NULL
,
1128 *_WP_Toolbar_PreviewObj
= NULL
,
1129 *_WP_Toolbar_PreviewDirUpObj
= NULL
,
1130 *_WP_Toolbar_PreviewSearchObj
= NULL
,
1131 *_WP_Prefs_PageGroupObj
= NULL
;
1133 Object
*_WP_AdvancedViewWindow
= NULL
,
1134 *_WP_AdvancedViewWindowVGrp
= NULL
,
1135 *_WP_AdvancedViewBackgroundGrpObj
= NULL
,
1136 *_WP_AdvancedViewRenderModeGrpObj
= NULL
,
1137 *_WP_AdvancedViewRenderModeObj
= NULL
,
1138 *_WP_AdvancedView_RenderModePageObj
= NULL
,
1139 *_WP_AdvancedView_ScaleModeGrpObj
= NULL
,
1140 *_WP_AdvancedView_TileModeGrpObj
= NULL
,
1141 *_WP_AdvancedView_TileModeObjContainer
= NULL
,
1142 *_WP_AdvancedView_TileModeObj
= NULL
,
1143 *_WP_AdvancedView_X_OffsetObj
= NULL
,
1144 *_WP_AdvancedView_Y_OffsetObj
= NULL
,
1145 *_WP_AdvancedView_IconRenderGrpObj
= NULL
,
1146 *_WP_AdvancedView_Icon_ListModeObj
= NULL
,
1147 *_WP_AdvancedView_Icon_TextModeObj
= NULL
,
1148 *_WP_AdvancedView_Icon_HorSpacingObj
= NULL
,
1149 *_WP_AdvancedView_Icon_VertSpacingObj
= NULL
,
1150 *_WP_AdvancedView_Icon_ImageSpacingObj
= NULL
,
1151 *_WP_AdvancedView_IconLabel_LabelFontObj
= NULL
,
1152 *_WP_AdvancedView_IconLabel_InfoFontObj
= NULL
,
1153 *_WP_AdvancedView_IconLabel_MaxLineLenObj
= NULL
,
1154 #if defined(DEBUG_MULTLINE)
1155 *_WP_AdvancedView_IconLabel_TextMultiLineObj
= NULL
,
1156 *_WP_AdvancedView_IconLabel_MultiLineonFocusObj
= NULL
,
1157 *_WP_AdvancedView_IconLabel_MultiLineNoObj
= NULL
,
1159 *_WP_AdvancedView_IconLabel_HorPaddObj
= NULL
,
1160 *_WP_AdvancedView_IconLabel_VertPaddObj
= NULL
,
1161 *_WP_AdvancedView_IconLabel_BorderWidthObj
= NULL
,
1162 *_WP_AdvancedView_IconLabel_BorderHeightObj
= NULL
,
1163 *_WP_AdvancedView_ButtonGrpObj
= NULL
,
1164 *_WP_AdvancedView_ButtonObj_Use
= NULL
,
1165 *_WP_AdvancedView_ButtonObj_Cancel
= NULL
;
1168 D(bug("[WPEditor] WPEditor__OM_NEW()\n"));
1170 //Object *cm_searchenabled;
1172 /*main window----------------------------------------------------------------*/
1173 /*self : Window?-------------------------------------------------------------*/
1175 self
= (Object
*) DoSuperNewTags
1178 MUIA_PrefsEditor_Name
, __(MSG_NAME
),
1179 MUIA_PrefsEditor_Path
, (IPTR
) "SYS/Wanderer/global.prefs",
1183 /*END self-------------------------------------------------------------------*/
1185 /*_WP_Prefs_PageGroupObj = Object for handling multi (3) page groups---------*/
1186 _wpeditor_intern_MainPageNames
[WPD_GENERAL
] = (STRPTR
)_(MSG_GENERAL
);
1187 _wpeditor_intern_MainPageNames
[WPD_APPEARANCE
] = (STRPTR
)_(MSG_APPEARANCE
);
1188 _wpeditor_intern_MainPageNames
[WPD_TOOLBAR
] = (STRPTR
)_(MSG_TOOLBAR
);
1190 _WP_Prefs_PageGroupObj
= (Object
*)RegisterObject
,
1191 MUIA_Register_Titles
, (IPTR
) _wpeditor_intern_MainPageNames
,
1193 /*END _WP_Prefs_PageGroupObj-------------------------------------------------*/
1195 /*_WP_NavigationObj: "Navigation" page group---------------------------------*/
1197 _WP_NavigationObj
= (Object
*)GroupObject
, End
;
1199 _WP_Navigation_HGrp1
= (Object
*)HGroup
, // general
1200 MUIA_FrameTitle
, __(MSG_NAVIGATION
),
1201 MUIA_Group_SameSize
, TRUE
,
1202 MUIA_Frame
, MUIV_Frame_Group
,
1203 MUIA_Group_Columns
, 2,
1206 _WP_Navigation_InnerHGrp1
= (Object
*)HGroup
,
1207 MUIA_Group_Columns
, 2,
1208 MUIA_Group_SameSize
, FALSE
,
1209 Child
, (IPTR
) Label1(_(MSG_METHOD
)),
1212 /*Navigation cycle button--------------------*/
1213 _wpeditor_intern_NavigationModes
[WPD_NAVIGATION_CLASSIC
] = (STRPTR
)_(MSG_CLASSIC
);
1214 _wpeditor_intern_NavigationModes
[WPD_NAVIGATION_ENHANCED
] = (STRPTR
)_(MSG_ENHANCED
);
1215 _WP_Navigation_TypeObj
= MUI_MakeObject(MUIO_Cycle
, NULL
, _wpeditor_intern_NavigationModes
);
1217 /*END Navigation cycle button----------------*/
1218 _WP_Navigation_InnerHGrp2
= (Object
*)HGroup
,
1219 MUIA_Group_Columns
, 2,
1220 MUIA_Group_SameSize
, FALSE
,
1223 #if defined(DEBUG_SHOWUSERFILES)
1224 _WP_UserFiles_ShowFileFolderObj
= MUI_MakeObject(MUIO_Checkmark
,NULL
);
1227 #if defined(DEBUG_CHANGESCREENTITLE)
1228 _WP_Navigation_HGrp2
= (Object
*)HGroup
,
1229 MUIA_FrameTitle
, (IPTR
)"Wanderer ScreenTitle",
1230 MUIA_Group_SameSize
, TRUE
,
1231 MUIA_Frame
, MUIV_Frame_Group
,
1234 _WP_Navigation_InnerHGrp3
= (Object
*)HGroup
, End
;
1236 _WP_Navigator_ScreenTitleObj
= (Object
*)StringObject
,
1238 MUIA_String_MaxLen
, 256,
1239 //MUIA_String_Contents, (IPTR)" ",
1242 /*END _WP_NavigationObj------------------------------------------------------*/
1244 /*_WP_Appearance_GroupObj: "Appearance" page group---------------------------*/
1246 _WP_Appearance_GroupObj
= (Object
*)GroupObject
, // appearance
1247 MUIA_Group_SameSize
, FALSE
,
1248 MUIA_Group_Horiz
, TRUE
,
1251 /*Left part of Appearance*/
1252 _WP_ViewSettings_ScrollGrpObj
= (Object
*)ScrollgroupObject
,
1253 MUIA_Group_SameSize
, FALSE
,
1254 MUIA_Scrollgroup_FreeHoriz
, FALSE
,
1255 MUIA_Scrollgroup_FreeVert
, TRUE
,
1256 MUIA_Scrollgroup_Contents
,
1257 (IPTR
) (_WP_ViewSettings_VirtGrpObj
= (Object
*)VirtgroupObject
,
1258 MUIA_FrameTitle
, (IPTR
)"View Settings",
1259 MUIA_Frame
, MUIV_Frame_ReadList
,
1260 MUIA_Virtgroup_Input
, FALSE
,
1264 /*_WP_ViewSettings_GroupObj is going to contain nodes
1265 of list called _wpeditor_intern_ViewSettings,
1266 it's created after in this function...;
1268 _WP_ViewSettings_GroupObj
= (Object
*)GroupObject
,
1269 MUIA_Background
, MUII_SHINE
,
1270 Child
, (IPTR
) (_WP_ViewSettings_SpacerObj
= HVSpace
),
1274 /*END _WP_Appearance_GroupObj------------------------------------------------*/
1276 /*_WP_Toolbar_GroupObj: "Toolbar" page group---------------------------------*/
1278 _WP_Toolbar_GroupObj
= (Object
*)GroupObject
, // toolbar
1279 MUIA_Group_SameSize
, FALSE
,
1282 _WP_Toolbar_InnerGroupObj1
= (Object
*)HGroup
,
1283 MUIA_FrameTitle
, __(MSG_OBJECTS
),
1284 MUIA_Group_SameSize
, TRUE
,
1285 MUIA_Frame
, MUIV_Frame_Group
,
1286 MUIA_Group_Columns
, 2,
1289 _WP_Toolbar_InnerGroupObj2
= (Object
*)HGroup
,
1290 MUIA_Group_Columns
, 2,
1291 MUIA_Group_SameSize
, FALSE
,
1292 Child
, (IPTR
)Label1(_(MSG_TOOLBAR_ENABLED
)),
1295 _WP_Toolbar_EnabledObj
= MUI_MakeObject(MUIO_Checkmark
, NULL
);
1297 _WP_Toolbar_InnerGroupObj3
= (Object
*)HGroup
,
1298 MUIA_Group_Columns
, 2,
1299 MUIA_Group_SameSize
, FALSE
,
1300 Child
, (IPTR
) HVSpace
,
1301 Child
, (IPTR
) HVSpace
,
1302 Child
, (IPTR
) HVSpace
,
1303 Child
, (IPTR
) HVSpace
,
1306 _WP_Toolbar_PreviewObj
= (Object
*)HGroup
,
1307 MUIA_FrameTitle
, __(MSG_PREVIEW
),
1308 MUIA_Frame
, MUIV_Frame_Group
,
1309 MUIA_Group_SameSize
, FALSE
,
1312 _WP_Toolbar_InnerGroupObj4
= (Object
*)HGroup
,
1313 MUIA_HorizWeight
, 0,
1314 MUIA_Group_SameSize
, TRUE
,
1317 _WP_Toolbar_PreviewDirUpObj
= ImageButton("", "THEME:Images/Gadgets/Prefs/Revert");
1318 _WP_Toolbar_PreviewSearchObj
= ImageButton("", "THEME:Images/Gadgets/Prefs/Test");
1319 /*END _WP_Toolbar_GroupObj---------------------------------------------------*/
1321 /*Add main objects to main window (self?)------------------------------------*/
1323 /*Add navigation Objects to Navigation page*/
1325 DoMethod(_WP_Navigation_InnerHGrp1
, OM_ADDMEMBER
,_WP_Navigation_TypeObj
);
1326 DoMethod(_WP_Navigation_InnerHGrp1
, OM_ADDMEMBER
,HVSpace
);
1327 DoMethod(_WP_Navigation_InnerHGrp1
, OM_ADDMEMBER
,HVSpace
);
1328 #if defined(DEBUG_NETWORKBROWSER)
1329 _WP_NetworkBrowser_EnabledObj
= MUI_MakeObject(MUIO_Checkmark
, NULL
);
1330 DoMethod(_WP_Navigation_InnerHGrp2
, OM_ADDMEMBER
,Label1("Network Browser on Workbench"));
1331 DoMethod(_WP_Navigation_InnerHGrp2
, OM_ADDMEMBER
,_WP_NetworkBrowser_EnabledObj
);
1333 DoMethod(_WP_Navigation_InnerHGrp2
, OM_ADDMEMBER
,HVSpace
);
1334 DoMethod(_WP_Navigation_InnerHGrp2
, OM_ADDMEMBER
,HVSpace
);
1336 #if defined(DEBUG_SHOWUSERFILES)
1337 DoMethod(_WP_Navigation_InnerHGrp2
, OM_ADDMEMBER
,Label1("User Files Folder on Workbench"));
1338 DoMethod(_WP_Navigation_InnerHGrp2
, OM_ADDMEMBER
,_WP_UserFiles_ShowFileFolderObj
);
1340 DoMethod(_WP_Navigation_InnerHGrp2
, OM_ADDMEMBER
,HVSpace
);
1341 DoMethod(_WP_Navigation_InnerHGrp2
, OM_ADDMEMBER
,HVSpace
);
1343 DoMethod(_WP_Navigation_InnerHGrp2
, OM_ADDMEMBER
,HVSpace
);
1344 DoMethod(_WP_Navigation_InnerHGrp2
, OM_ADDMEMBER
,HVSpace
);
1346 #if defined(DEBUG_CHANGESCREENTITLE)
1347 DoMethod(_WP_Navigator_ScreenTitleObj
,MUIM_Set
, MUIA_ShortHelp
,_(MSG_BUBBLESCREENTITLE
));
1348 DoMethod(_WP_Navigation_InnerHGrp3
, OM_ADDMEMBER
,_WP_Navigator_ScreenTitleObj
);
1349 DoMethod(_WP_Navigation_HGrp2
, OM_ADDMEMBER
,_WP_Navigation_InnerHGrp3
);
1352 DoMethod(_WP_Navigation_HGrp1
, OM_ADDMEMBER
,_WP_Navigation_InnerHGrp1
);
1353 DoMethod(_WP_Navigation_HGrp1
, OM_ADDMEMBER
,_WP_Navigation_InnerHGrp2
);
1355 DoMethod(_WP_NavigationObj
, OM_ADDMEMBER
,_WP_Navigation_HGrp1
);
1356 #if defined(DEBUG_CHANGESCREENTITLE)
1357 DoMethod(_WP_NavigationObj
, OM_ADDMEMBER
,_WP_Navigation_HGrp2
);
1361 /*Add appearance Objects to Appearance page*/
1362 /*Add objects which are contain into right part*/
1363 /*Add objects which are contain into left part*/
1364 DoMethod(_WP_ViewSettings_VirtGrpObj
, OM_ADDMEMBER
,_WP_ViewSettings_GroupObj
);
1367 DoMethod(_WP_Appearance_GroupObj
, OM_ADDMEMBER
,_WP_ViewSettings_ScrollGrpObj
);
1370 /*Add toolbar Objects to Toolbar page*/
1371 DoMethod(_WP_Toolbar_InnerGroupObj4
, OM_ADDMEMBER
,_WP_Toolbar_PreviewDirUpObj
);
1372 DoMethod(_WP_Toolbar_InnerGroupObj4
, OM_ADDMEMBER
,_WP_Toolbar_PreviewSearchObj
);
1374 DoMethod(_WP_Toolbar_PreviewObj
, OM_ADDMEMBER
,HVSpace
);
1375 DoMethod(_WP_Toolbar_PreviewObj
, OM_ADDMEMBER
, _WP_Toolbar_InnerGroupObj4
);
1377 DoMethod(_WP_Toolbar_InnerGroupObj2
, OM_ADDMEMBER
,_WP_Toolbar_EnabledObj
);
1378 DoMethod(_WP_Toolbar_InnerGroupObj2
, OM_ADDMEMBER
,HVSpace
);
1379 DoMethod(_WP_Toolbar_InnerGroupObj2
, OM_ADDMEMBER
,HVSpace
);
1381 DoMethod(_WP_Toolbar_InnerGroupObj1
, OM_ADDMEMBER
,_WP_Toolbar_InnerGroupObj2
);
1382 DoMethod(_WP_Toolbar_InnerGroupObj1
, OM_ADDMEMBER
,_WP_Toolbar_InnerGroupObj3
);
1385 DoMethod(_WP_Toolbar_GroupObj
, OM_ADDMEMBER
,_WP_Toolbar_InnerGroupObj1
);
1386 DoMethod(_WP_Toolbar_GroupObj
, OM_ADDMEMBER
,_WP_Toolbar_PreviewObj
);
1389 DoMethod(_WP_Prefs_PageGroupObj
, OM_ADDMEMBER
,_WP_NavigationObj
);/*add Navigation page to pagesGroup*/
1390 DoMethod(_WP_Prefs_PageGroupObj
, OM_ADDMEMBER
,_WP_Appearance_GroupObj
);/*add Appearance page to pagesGroup*/
1391 DoMethod(_WP_Prefs_PageGroupObj
, OM_ADDMEMBER
,_WP_Toolbar_GroupObj
);/*add Toolbar page to pagesGroup*/
1393 DoMethod(self
, OM_ADDMEMBER
,_WP_Prefs_PageGroupObj
);/*add pagesGroup to self*/
1394 /*END Add main objects to main window (self?)--------------------------------*/
1396 //SET( _WP_Prefs_PageGroupObj, MUIA_Group_ActivePage, 1); //Goto the Appearance page by default..
1398 /*END main window------------------------------------------------------------*/
1400 /*AdvancedViewWindow---------------------------------------------------------*/
1402 /*Window-------------------------------------------------------------*/
1403 _WP_AdvancedViewWindow
= (Object
*)WindowObject
,
1404 MUIA_Window_CloseGadget
, FALSE
,
1405 MUIA_Window_Title
, (IPTR
)"Advanced Options ..",
1406 WindowContents
, (IPTR
) (_WP_AdvancedViewWindowVGrp
= (Object
*)VGroup
, End
),
1409 /*Draw Mode Group----------------------------------------------------*/
1410 _WP_AdvancedViewBackgroundGrpObj
= (Object
*)VGroup
,
1411 MUIA_FrameTitle
, (IPTR
)"Background Options ..",
1412 MUIA_Frame
, MUIV_Frame_Group
,
1415 _WP_AdvancedViewRenderModeGrpObj
= (Object
*)HGroup
,
1416 Child
, (IPTR
) Label1("Draw Mode : "), End
;
1418 /*AdvancedViewRenderMode cycle button------------------------*/
1419 _WP_AdvancedViewRenderModeObj
= HVSpace
;
1421 /*END AdvancedViewRenderMode cycle button------------------------*/
1422 /*END Draw Mode Group------------------------------------------------*/
1424 /*Scale Mode/Tile Mode Group-----------------------------------------*/
1425 _WP_AdvancedView_RenderModePageObj
= (Object
*)GroupObject
,
1426 MUIA_Group_PageMode
, TRUE
,
1429 _WP_AdvancedView_ScaleModeGrpObj
= (Object
*)GroupObject
,
1430 MUIA_Group_SameSize
, FALSE
,
1431 MUIA_FrameTitle
, (IPTR
)"Scale Mode Options ..",
1432 MUIA_Frame
, MUIV_Frame_Group
,
1433 Child
, (IPTR
)HVSpace
,
1436 /*AdvancedView_TileModeNames cicle button--------------------*/
1437 _WP_AdvancedView_TileModeObj
= HVSpace
;
1438 _WP_AdvancedView_TileModeObjContainer
= (Object
*)HGroup
, Child
, (IPTR
)_WP_AdvancedView_TileModeObj
, End
;
1439 /*END AdvancedView_TileModeNames cicle button----------------*/
1441 _WP_AdvancedView_TileModeGrpObj
= (Object
*)GroupObject
,
1442 MUIA_Group_SameSize
, FALSE
,
1443 MUIA_FrameTitle
, (IPTR
)"Tile Mode Options ..",
1444 MUIA_Frame
, MUIV_Frame_Group
,
1445 MUIA_Group_Columns
, 2,
1448 _WP_AdvancedView_X_OffsetObj
= (Object
*)StringObject
,
1450 MUIA_String_MaxLen
, 3,
1451 MUIA_String_Accept
, (IPTR
)"0123456789",
1454 _WP_AdvancedView_Y_OffsetObj
= (Object
*)StringObject
,
1456 MUIA_String_MaxLen
, 3,
1457 MUIA_String_Accept
, (IPTR
)"0123456789",
1460 /*END Scale Mode/Tile Mode Group-------------------------------------*/
1461 /*Icon List Mode Cycle button------------------------*/
1462 _wpeditor_intern_IconListModeNames
[WPD_ICONLISTMODE_GRID
] = (STRPTR
)_(MSG_ICONLISTMODE_GRID
);
1463 _wpeditor_intern_IconListModeIDs
[WPD_ICONLISTMODE_GRID
] = WPD_ICONLISTMODE_GRID
;
1464 _wpeditor_intern_IconListModeNames
[WPD_ICONLISTMODE_PLAIN
] = (STRPTR
)_(MSG_ICONLISTMODE_PLAIN
);
1465 _wpeditor_intern_IconListModeIDs
[WPD_ICONLISTMODE_PLAIN
] = WPD_ICONLISTMODE_PLAIN
;
1466 _WP_AdvancedView_Icon_ListModeObj
= MUI_MakeObject(MUIO_Cycle
, NULL
, _wpeditor_intern_IconListModeNames
);
1468 _wpeditor_intern_IconTextRenderModeNames
[WPD_ICONTEXTMODE_OUTLINE
] = (STRPTR
)_(MSG_ICONTEXTMODE_OUTLINE
);
1469 _wpeditor_intern_IconTextRenderModeIDs
[WPD_ICONTEXTMODE_OUTLINE
] = WPD_ICONTEXTMODE_OUTLINE
;
1470 _wpeditor_intern_IconTextRenderModeNames
[WPD_ICONTEXTMODE_PLAIN
] = (STRPTR
)_(MSG_ICONTEXTMODE_PLAIN
);
1471 _wpeditor_intern_IconTextRenderModeIDs
[WPD_ICONTEXTMODE_PLAIN
] = WPD_ICONTEXTMODE_PLAIN
;
1472 _wpeditor_intern_IconTextRenderModeNames
[ICON_TEXTMODE_DROPSHADOW
] = (STRPTR
)"Drop Shadow";
1473 _wpeditor_intern_IconTextRenderModeIDs
[ICON_TEXTMODE_DROPSHADOW
] = ICON_TEXTMODE_DROPSHADOW
;
1475 _WP_AdvancedView_Icon_TextModeObj
= MUI_MakeObject(MUIO_Cycle
, NULL
, _wpeditor_intern_IconTextRenderModeNames
);
1477 /*END Icon List Mode Cycle button--------------------*/
1479 _WP_AdvancedView_IconLabel_MaxLineLenObj
= (Object
*)StringObject
,
1481 MUIA_String_MaxLen
, 3,
1482 MUIA_String_Format
, MUIV_String_Format_Right
,
1483 MUIA_String_Accept
, (IPTR
)"0123456789",
1486 _WP_AdvancedView_Icon_HorSpacingObj
= (Object
*)StringObject
,
1488 MUIA_String_MaxLen
, 3,
1489 MUIA_String_Format
, MUIV_String_Format_Right
,
1490 MUIA_String_Accept
, (IPTR
)"0123456789",
1493 _WP_AdvancedView_Icon_VertSpacingObj
= (Object
*)StringObject
,
1495 MUIA_String_MaxLen
, 3,
1496 MUIA_String_Format
, MUIV_String_Format_Right
,
1497 MUIA_String_Accept
, (IPTR
)"0123456789",
1500 _WP_AdvancedView_Icon_ImageSpacingObj
= (Object
*)StringObject
,
1502 MUIA_String_MaxLen
, 3,
1503 MUIA_String_Format
, MUIV_String_Format_Right
,
1504 MUIA_String_Accept
, (IPTR
)"0123456789",
1507 _WP_AdvancedView_IconLabel_LabelFontObj
= (Object
*)StringObject
,
1509 MUIA_String_MaxLen
, 3,
1510 MUIA_String_Format
, MUIV_String_Format_Right
,
1513 _WP_AdvancedView_IconLabel_InfoFontObj
= (Object
*)StringObject
,
1515 MUIA_String_MaxLen
, 3,
1516 MUIA_String_Format
, MUIV_String_Format_Right
,
1519 #if defined(DEBUG_MULTLINE)
1520 _WP_AdvancedView_IconLabel_MultiLineNoObj
= (Object
*)StringObject
,
1522 MUIA_String_MaxLen
, 2,
1523 MUIA_String_Format
, MUIV_String_Format_Right
,
1524 MUIA_String_Accept
, (IPTR
)"0123456789",
1527 _WP_AdvancedView_IconLabel_TextMultiLineObj
= MUI_MakeObject(MUIO_Checkmark
, NULL
);
1528 _WP_AdvancedView_IconLabel_MultiLineonFocusObj
= MUI_MakeObject(MUIO_Checkmark
, NULL
);
1530 _WP_AdvancedView_IconLabel_HorPaddObj
= (Object
*)StringObject
,
1532 MUIA_String_MaxLen
, 3,
1533 MUIA_String_Format
, MUIV_String_Format_Right
,
1534 MUIA_String_Accept
, (IPTR
)"0123456789",
1537 _WP_AdvancedView_IconLabel_VertPaddObj
= (Object
*)StringObject
,
1539 MUIA_String_MaxLen
, 3,
1540 MUIA_String_Format
, MUIV_String_Format_Right
,
1541 MUIA_String_Accept
, (IPTR
)"0123456789",
1544 _WP_AdvancedView_IconLabel_BorderWidthObj
= (Object
*)StringObject
,
1546 MUIA_String_MaxLen
, 3,
1547 MUIA_String_Format
, MUIV_String_Format_Right
,
1548 MUIA_String_Accept
, (IPTR
)"0123456789",
1551 _WP_AdvancedView_IconLabel_BorderHeightObj
= (Object
*)StringObject
,
1553 MUIA_String_MaxLen
, 3,
1554 MUIA_String_Format
, MUIV_String_Format_Right
,
1555 MUIA_String_Accept
, (IPTR
)"0123456789",
1558 _WP_AdvancedView_IconRenderGrpObj
= (Object
*)GroupObject
,
1559 MUIA_Group_SameSize
, FALSE
,
1560 MUIA_FrameTitle
, __(MSG_ICONSPREFS
),
1561 MUIA_Frame
, MUIV_Frame_Group
,
1562 MUIA_Group_Columns
, 2,
1564 /*Button Group-------------------------------------------------------*/
1565 _WP_AdvancedView_ButtonGrpObj
= (Object
*)HGroup
,
1566 Child
, (IPTR
)(_WP_AdvancedView_ButtonObj_Use
= ImageButton("Use", "THEME:Images/Gadgets/Prefs/Use")),
1567 Child
, (IPTR
)(_WP_AdvancedView_ButtonObj_Cancel
= ImageButton("Cancel", "THEME:Images/Gadgets/Prefs/Cancel")),
1569 /*END Button Group--------------------------------------------------*/
1571 /*END Window--------------------------------------------------------*/
1574 /*Add advanced view objects to AdvancedViewWindow object--------------------*/
1575 DoMethod(_WP_AdvancedViewRenderModeGrpObj
, OM_ADDMEMBER
,_WP_AdvancedViewRenderModeObj
);
1577 DoMethod(_WP_AdvancedView_TileModeGrpObj
, OM_ADDMEMBER
, Label1("Tile Mode : "));
1578 DoMethod(_WP_AdvancedView_TileModeGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_TileModeObjContainer
);
1579 DoMethod(_WP_AdvancedView_TileModeGrpObj
, OM_ADDMEMBER
, Label1("X Offset : "));
1580 DoMethod(_WP_AdvancedView_TileModeGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_X_OffsetObj
);
1581 DoMethod(_WP_AdvancedView_TileModeGrpObj
, OM_ADDMEMBER
, Label1("Y Offset : "));
1582 DoMethod(_WP_AdvancedView_TileModeGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_Y_OffsetObj
);
1584 DoMethod(_WP_AdvancedView_RenderModePageObj
, OM_ADDMEMBER
, _WP_AdvancedView_ScaleModeGrpObj
);
1585 DoMethod(_WP_AdvancedView_RenderModePageObj
, OM_ADDMEMBER
, _WP_AdvancedView_TileModeGrpObj
);
1587 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
,HVSpace
);
1588 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
,HVSpace
);
1590 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1(_(MSG_ICONLISTMODE
)));
1591 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_Icon_ListModeObj
);
1592 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, HVSpace
);
1593 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, HVSpace
);
1594 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1(_(MSG_ICONTEXTMODE
)));
1595 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_Icon_TextModeObj
);
1597 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
,HVSpace
);
1598 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
,HVSpace
);
1600 #warning "TODO: Replace with propper font selectors"
1601 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Icon Label Font .."));
1602 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_IconLabel_LabelFontObj
);
1603 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Icon Info Font .."));
1604 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_IconLabel_InfoFontObj
);
1606 #if !defined(DEBUG_PERVIEWFONTS)
1607 SET(_WP_AdvancedView_IconLabel_LabelFontObj
, MUIA_Disabled
, TRUE
);
1608 SET(_WP_AdvancedView_IconLabel_InfoFontObj
, MUIA_Disabled
, TRUE
);
1611 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
,HVSpace
);
1612 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
,HVSpace
);
1614 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Max. Label line length .."));
1615 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_IconLabel_MaxLineLenObj
);
1616 #if defined(DEBUG_MULTLINE)
1617 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Use MultiLine Labels "));
1618 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_IconLabel_TextMultiLineObj
);
1619 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Only show for Focus(ed) Icon "));
1620 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_IconLabel_MultiLineonFocusObj
);
1621 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("No. of lines to display .."));
1622 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_IconLabel_MultiLineNoObj
);
1624 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
,HVSpace
);
1625 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
,HVSpace
);
1627 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Horizontal Spacing between Icons"));
1628 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_Icon_HorSpacingObj
);
1630 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Vertical Spacing between Icons"));
1631 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_Icon_VertSpacingObj
);
1633 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Padding between Icon Image and Label"));
1634 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_Icon_ImageSpacingObj
);
1636 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Horizontal Padding between Label Frame and Text"));
1637 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_IconLabel_HorPaddObj
);
1639 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Vertical Padding between Label Frame and Text"));
1640 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_IconLabel_VertPaddObj
);
1642 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Label Frame Width"));
1643 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_IconLabel_BorderWidthObj
);
1645 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, Label1("Label Frame Height"));
1646 DoMethod(_WP_AdvancedView_IconRenderGrpObj
, OM_ADDMEMBER
, _WP_AdvancedView_IconLabel_BorderHeightObj
);
1648 DoMethod(_WP_AdvancedViewBackgroundGrpObj
, OM_ADDMEMBER
,_WP_AdvancedViewRenderModeGrpObj
);
1649 DoMethod(_WP_AdvancedViewBackgroundGrpObj
, OM_ADDMEMBER
,_WP_AdvancedView_RenderModePageObj
);
1651 DoMethod(_WP_AdvancedViewWindowVGrp
, OM_ADDMEMBER
,_WP_AdvancedViewBackgroundGrpObj
);
1652 DoMethod(_WP_AdvancedViewWindowVGrp
, OM_ADDMEMBER
,_WP_AdvancedView_IconRenderGrpObj
);
1653 DoMethod(_WP_AdvancedViewWindowVGrp
, OM_ADDMEMBER
,_WP_AdvancedView_ButtonGrpObj
);
1654 /*END Add advanced view objects to AdvancedViewWindow object-----------------*/
1655 /*END AdvancedViewWindow-----------------------------------------------------*/
1657 /*-------------------*/
1658 if ((self
!= NULL
) && (_WP_AdvancedViewWindow
!= NULL
))
1660 _wpeditor_intern_CLASS
= CLASS
;
1661 data
= INST_DATA(CLASS
, self
);
1663 D(bug("[WPEditor] WPEditor__OM_NEW: Prefs Object (self) @ 0x%p\n", self
));
1665 if ((advancedView_data
= AllocMem(sizeof(struct WPEditor_AdvancedBackgroundWindow_DATA
), MEMF_CLEAR
|MEMF_ANY
)) != NULL
)
1667 advancedView_data
->wpedabwd_Hook_DrawModeChage
.h_Entry
= (HOOKFUNC
) WandererPrefs_Hook_DrawModeChangeFunc
;
1669 advancedView_data
->wpedabwd_Window_WindowObj
= _WP_AdvancedViewWindow
;
1670 advancedView_data
->wpedabwd_Window_BackgroundGrpObj
= _WP_AdvancedViewBackgroundGrpObj
;
1671 advancedView_data
->wpedabwd_Window_RenderModeGrpObj
= _WP_AdvancedViewRenderModeGrpObj
;
1672 advancedView_data
->wpedabwd_Window_RenderModeObj
= _WP_AdvancedViewRenderModeObj
;
1673 advancedView_data
->wpedabwd_Window_RenderModePageObj
= _WP_AdvancedView_RenderModePageObj
;
1674 advancedView_data
->wpedabwd_Window_TileModeObjContainer
= _WP_AdvancedView_TileModeObjContainer
;
1675 advancedView_data
->wpedabwd_Window_TileModeObj
= _WP_AdvancedView_TileModeObj
;
1676 advancedView_data
->wpedabwd_Window_XOffsetObj
= _WP_AdvancedView_X_OffsetObj
;
1677 advancedView_data
->wpedabwd_Window_YOffsetObj
= _WP_AdvancedView_Y_OffsetObj
;
1679 advancedView_data
->wpedabwd_Window_Icon_ListMode
= _WP_AdvancedView_Icon_ListModeObj
;
1680 advancedView_data
->wpedabwd_Window_Icon_TextMode
= _WP_AdvancedView_Icon_TextModeObj
;
1682 advancedView_data
->wpedabwd_Window_Icon_HorSpacing
= _WP_AdvancedView_Icon_HorSpacingObj
;
1683 advancedView_data
->wpedabwd_Window_Icon_VertSpacing
= _WP_AdvancedView_Icon_VertSpacingObj
;
1684 advancedView_data
->wpedabwd_Window_Icon_ImageSpacing
= _WP_AdvancedView_Icon_ImageSpacingObj
;
1686 advancedView_data
->wpedabwd_Window_IconLabel_LabelFont
= _WP_AdvancedView_IconLabel_LabelFontObj
;
1687 advancedView_data
->wpedabwd_Window_IconLabel_InfoFont
= _WP_AdvancedView_IconLabel_InfoFontObj
;
1689 advancedView_data
->wpedabwd_Window_IconLabel_MaxLineLen
= _WP_AdvancedView_IconLabel_MaxLineLenObj
;
1691 #if defined(DEBUG_MULTLINE)
1692 advancedView_data
->wpedabwd_Window_IconLabel_TextMultiLine
= _WP_AdvancedView_IconLabel_TextMultiLineObj
;
1693 advancedView_data
->wpedabwd_Window_IconLabel_MultiLineonFocus
= _WP_AdvancedView_IconLabel_MultiLineonFocusObj
;
1694 advancedView_data
->wpedabwd_Window_IconLabel_MultiLineNo
= _WP_AdvancedView_IconLabel_MultiLineNoObj
;
1696 advancedView_data
->wpedabwd_Window_IconLabel_HorPadd
= _WP_AdvancedView_IconLabel_HorPaddObj
;
1697 advancedView_data
->wpedabwd_Window_IconLabel_VertPadd
= _WP_AdvancedView_IconLabel_VertPaddObj
;
1698 advancedView_data
->wpedabwd_Window_IconLabel_BorderWidth
= _WP_AdvancedView_IconLabel_BorderWidthObj
;
1699 advancedView_data
->wpedabwd_Window_IconLabel_BorderHeight
= _WP_AdvancedView_IconLabel_BorderHeightObj
;
1701 advancedView_data
->wpedabwd_Window_UseObj
= _WP_AdvancedView_ButtonObj_Use
;
1702 advancedView_data
->wpedabwd_Window_CancelObj
= _WP_AdvancedView_ButtonObj_Cancel
;
1704 NewList(&advancedView_data
->wpedabwd_Window_AdvancedViewRenderModes
);
1705 EntryElementRegister(&advancedView_data
->wpedabwd_Window_AdvancedViewRenderModes
, IconWindowExt_ImageBackFill_RenderMode_Tiled
, "Tiled");
1706 EntryElementRegister(&advancedView_data
->wpedabwd_Window_AdvancedViewRenderModes
, IconWindowExt_ImageBackFill_RenderMode_Scale
, "Scaled");
1708 NewList(&advancedView_data
->wpedabwd_Window_AdvancedViewTileModes
);
1709 EntryElementRegister(&advancedView_data
->wpedabwd_Window_AdvancedViewTileModes
, IconWindowExt_ImageBackFill_TileMode_Float
, "Floating");
1710 EntryElementRegister(&advancedView_data
->wpedabwd_Window_AdvancedViewTileModes
, IconWindowExt_ImageBackFill_TileMode_Fixed
, "Fixed");
1712 D(bug("[WPEditor] WPEditor__OM_NEW: 'Advanced' Window Object @ 0x%p\n", advancedView_data
->wpedabwd_Window_WindowObj
));
1714 data
->wped_AdvancedViewSettings_WindowData
= advancedView_data
;
1716 data
->wped_ViewSettings_GroupObj
= _WP_ViewSettings_GroupObj
;
1717 data
->wped_ViewSettings_SpacerObj
= _WP_ViewSettings_SpacerObj
;
1719 data
->wped_c_NavigationMethod
= _WP_Navigation_TypeObj
;
1720 data
->wped_cm_ToolbarEnabled
= _WP_Toolbar_EnabledObj
;
1721 #if defined(DEBUG_CHANGESCREENTITLE)
1722 data
->wped_s_screentitle
=_WP_Navigator_ScreenTitleObj
;
1724 #if defined(DEBUG_NETWORKBROWSER)
1725 data
->wped_cm_EnableNetworkBrowser
= _WP_NetworkBrowser_EnabledObj
;
1727 #if defined(DEBUG_SHOWUSERFILES)
1728 data
->wped_cm_EnableUserFiles
= _WP_UserFiles_ShowFileFolderObj
;
1731 data
->wped_toolbarpreview
= _WP_Toolbar_PreviewObj
;
1733 data
->wped_toolbarGroup
= _WP_Toolbar_GroupObj
;
1734 data
->wped_Hook_CloseAdvancedOptions
.h_Entry
= ( HOOKFUNC
)WandererPrefs_Hook_CloseAdvancedOptionsFunc
;
1736 //-- Setup notifications -------------------------------------------
1737 #warning "TODO: The toolbar class will become an external module to wanderer with its own prefs"
1738 #if defined(DEBUG_TOOLBARINTERNAL)
1739 /* Enhanced navigation depends on the toolbar class for
1740 control - so we disable it if the toolbar isnt available! */
1743 data
->wped_cm_ToolbarEnabled
, MUIM_Notify
, MUIA_Selected
, FALSE
,
1744 (IPTR
)data
->wped_c_NavigationMethod
, 3, MUIM_Set
, MUIA_Cycle_Active
, 0
1749 data
->wped_cm_ToolbarEnabled
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1750 (IPTR
)data
->wped_c_NavigationMethod
, 3, MUIM_Set
, MUIA_Disabled
, MUIV_NotTriggerValue
1753 /* Only enable the preview if the toolbar is enabled */
1756 data
->wped_cm_ToolbarEnabled
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1757 (IPTR
)data
->wped_toolbarpreview
, 3, MUIM_Set
, MUIA_Disabled
, MUIV_NotTriggerValue
1762 data
->wped_cm_ToolbarEnabled
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1763 (IPTR
)self
, 3, MUIM_Set
, MUIA_PrefsEditor_Changed
, TRUE
1768 data
->wped_c_NavigationMethod
, MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
1769 (IPTR
)self
, 3, MUIM_Set
, MUIA_PrefsEditor_Changed
, TRUE
1773 #if defined(DEBUG_NETWORKBROWSER)
1776 data
->wped_cm_EnableNetworkBrowser
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1777 (IPTR
)self
, 3, MUIM_Set
, MUIA_PrefsEditor_Changed
, TRUE
1780 #if defined(DEBUG_SHOWUSERFILES)
1783 data
->wped_cm_EnableUserFiles
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1784 (IPTR
)self
, 3, MUIM_Set
, MUIA_PrefsEditor_Changed
, TRUE
1788 if (data
->wped_AdvancedViewSettings_WindowData
)
1792 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineNo
, MUIM_Notify
, MUIA_Disabled
, TRUE
,
1793 (IPTR
)data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineNo
, 3, MUIM_Set
, MUIA_String_Integer
, 1
1798 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineNo
, MUIM_Notify
, MUIA_Disabled
, FALSE
,
1799 (IPTR
)data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineNo
, 3, MUIM_Set
, MUIA_String_Integer
, 2
1804 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_TextMultiLine
, MUIM_Notify
, MUIA_Selected
, MUIV_EveryTime
,
1805 (IPTR
)data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_IconLabel_MultiLineNo
, 3, MUIM_Set
, MUIA_Disabled
, MUIV_NotTriggerValue
1809 /*--------------------*/
1811 /*Initialization and setup of _wpeditor_intern_ViewSettings----------*/
1812 /*_wpeditor_intern_ViewSettings is a
1813 list of objects attached to
1814 _WP_ViewSettings_GroupObj;
1816 NewList(&_wpeditor_intern_ViewSettings
);
1818 WPEditor__NewViewSettingObjects("Workbench", TRUE
);//add a setting node
1819 WPEditor__NewViewSettingObjects("Drawer", TRUE
);//add a setting node
1820 #if defined(DEBUG_NEWVIEWSETTINGS)
1821 WPEditor__NewViewSettingObjects("Screen", TRUE
);//add a setting node
1822 WPEditor__NewViewSettingObjects("Toolbar", FALSE
);//add a setting node
1825 struct WPEditor_ViewSettingsObject
*_viewSettings_Node
= NULL
;
1827 ForeachNode(&_wpeditor_intern_ViewSettings
, _viewSettings_Node
)
1829 Object
*thisViewImspecGrp
= NULL
;
1830 Object
*thisViewAdvancedGrp
= NULL
;
1832 D(bug("[WPEditor] WPEditor__OM_NEW: Adding ViewSetting Objects for '%s' to Prefs GUI ..\n", _viewSettings_Node
->wpedbo_ViewName
));
1834 thisViewImspecGrp
= (Object
*)GroupObject
,
1835 MUIA_Group_SameSize
, FALSE
,
1836 MUIA_Frame
, MUIV_Frame_None
,
1837 MUIA_Group_Columns
, 2,
1838 Child
, (IPTR
) HVSpace
,
1839 Child
, (IPTR
) HVSpace
,
1840 Child
, (IPTR
) Label1(_viewSettings_Node
->wpedbo_ViewName
),
1841 Child
, (IPTR
) _viewSettings_Node
->wpedbo_ImageSpecObject
,
1842 Child
, (IPTR
) HVSpace
,
1843 Child
, (IPTR
) HVSpace
,
1846 if ((thisViewImspecGrp
) && (data
->wped_FirstBGImSpecObj
== NULL
))
1847 data
->wped_FirstBGImSpecObj
= thisViewImspecGrp
;
1849 if (_viewSettings_Node
->wpedbo_AdvancedOptionsObject
)
1851 thisViewAdvancedGrp
= (Object
*)GroupObject
,
1852 MUIA_Group_SameSize
, FALSE
,
1853 MUIA_Frame
, MUIV_Frame_None
,
1854 MUIA_Group_Columns
, 2,
1855 Child
, (IPTR
) HVSpace
,
1856 Child
, (IPTR
) _viewSettings_Node
->wpedbo_AdvancedOptionsObject
,
1859 if ((thisViewAdvancedGrp
) && (data
->wped_FirstBGAdvancedObj
== NULL
))
1860 data
->wped_FirstBGAdvancedObj
= thisViewAdvancedGrp
;
1863 if ((thisViewImspecGrp
) &&
1864 ((!(_viewSettings_Node
->wpedbo_AdvancedOptionsObject
)) ||
1865 ((_viewSettings_Node
->wpedbo_AdvancedOptionsObject
) && (thisViewAdvancedGrp
))))
1867 D(bug("[WPEditor] WPEditor__OM_NEW: GUI Objects Created ..\n"));
1869 if (DoMethod(_WP_ViewSettings_GroupObj
, MUIM_Group_InitChange
))
1871 DoMethod(_WP_ViewSettings_GroupObj
, OM_ADDMEMBER
, thisViewImspecGrp
);
1873 if (_viewSettings_Node
->wpedbo_AdvancedOptionsObject
)
1874 DoMethod(_WP_ViewSettings_GroupObj
, OM_ADDMEMBER
, thisViewAdvancedGrp
);
1876 DoMethod(_WP_ViewSettings_GroupObj
, MUIM_Group_ExitChange
);
1879 D(bug("[WPEditor] WPEditor__OM_NEW: GUI Objects inserted in Prefs GUI ..\n"));
1880 /* Set our ViewSetting(s) notifications */
1883 _viewSettings_Node
->wpedbo_ImageSpecObject
,
1884 MUIM_Notify
, MUIA_Imagedisplay_Spec
, MUIV_EveryTime
,
1885 (IPTR
)self
, 3, MUIM_CallHook
,
1886 &_viewSettings_Node
->wpedbo_Hook_CheckImage
, _viewSettings_Node
1889 if (_viewSettings_Node
->wpedbo_AdvancedOptionsObject
)
1891 _viewSettings_Node
->wpedbo_Hook_OpenAdvancedOptions
.h_Entry
= ( HOOKFUNC
)WandererPrefs_Hook_OpenAdvancedOptionsFunc
;
1895 _viewSettings_Node
->wpedbo_AdvancedOptionsObject
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
1896 (IPTR
)self
, 3, MUIM_CallHook
, &_viewSettings_Node
->wpedbo_Hook_OpenAdvancedOptions
, _viewSettings_Node
1899 D(bug("[WPEditor] WPEditor__OM_NEW: GUI Objects Notifications set ..\n"));
1903 D(bug("[WPEditor] WPEditor__OM_NEW: Failed to create objects ..\n"));
1904 if (thisViewAdvancedGrp
) DoMethod(thisViewAdvancedGrp
, OM_DISPOSE
);
1906 if (thisViewImspecGrp
) DoMethod(thisViewImspecGrp
, OM_DISPOSE
);
1912 D(bug("[WPEditor] WPEditor__OM_NEW: Failed to create GUI ..\n"));
1913 if (advancedView_data
->wpedabwd_Window_WindowObj
) DoMethod(advancedView_data
->wpedabwd_Window_WindowObj
, OM_DISPOSE
);
1914 if (self
) DoMethod(self
, OM_DISPOSE
);
1924 /*BOOL WPEditor_ProccessGlobalChunk(): read a TagItem global_chunk (from global setting)
1925 *and memorize its value into correspondent attribute of an object of the gui...;
1927 BOOL
WPEditor_ProccessGlobalChunk(Class
*CLASS
, Object
*self
, struct TagItem32
*global_chunk
, IPTR chunk_size
)
1929 SETUP_WPEDITOR_INST_DATA
;
1931 int i
= 0, tag_count
= (chunk_size
/ sizeof(struct TagItem32
));
1933 //BOOL state = FALSE;
1935 D(bug("[WPEditor] WPEditor_ProccessGlobalChunk(%d tags)\n", tag_count
));
1937 for (i
= 0; i
< tag_count
; i
++)
1941 /* prefs file is stored in little endian */
1942 switch ((int)AROS_LE2LONG(global_chunk
[i
].ti_Tag
))
1944 case MUIA_IconWindow_WindowNavigationMethod
:
1946 D(bug("[WPEditor] WPEditor_ProccessGlobalChunk: Tag %d = MUIA_IconWindow_WindowNavigationMethod, val = %d\n", i
, AROS_LE2LONG(global_chunk
[i
].ti_Data
)));
1947 SET(data
->wped_c_NavigationMethod
, MUIA_Cycle_Active
, (IPTR
)AROS_LE2LONG(global_chunk
[i
].ti_Data
));
1950 #if defined(DEBUG_SHOWUSERFILES)
1951 case MUIA_IconWindowExt_UserFiles_ShowFilesFolder
:
1953 D(bug("[WPEditor] WPEditor_ProccessGlobalChunk: Tag %d = MUIA_IconWindowExt_UserFiles_ShowFilesFolder, val = %d\n", i
, AROS_LE2LONG(global_chunk
[i
].ti_Data
)));
1954 SET(data
->wped_cm_EnableUserFiles
, MUIA_Selected
, (BOOL
)AROS_LE2LONG(global_chunk
[i
].ti_Data
));
1960 D(bug("[WPEditor] WPEditor_ProccessGlobalChunk: Tag %d = TAG_DONE!!\n", i
));
1971 #if defined(DEBUG_NETWORKBROWSER)
1972 BOOL
WPEditor_ProccessNetworkChunk(Class
*CLASS
, Object
*self
, UBYTE
*_viewSettings_Chunk
)
1974 SETUP_WPEDITOR_INST_DATA
;
1976 struct TagItem32
*network_tags
= _viewSettings_Chunk
;
1977 SET(data
->wped_cm_EnableNetworkBrowser
, MUIA_Selected
, AROS_LE2LONG(network_tags
[0].ti_Data
));
1983 #if defined(DEBUG_CHANGESCREENTITLE)
1984 BOOL
WPEditor_ProccessScreenTitleChunk(Class
*CLASS
, Object
*self
, UBYTE
*_ScreenTitle_Chunk
)
1986 SETUP_WPEDITOR_INST_DATA
;
1989 D(bug("[WPEditor] WPEditor_ProccessScreenTitleChunk: string readed = %s\n", _ScreenTitle_Chunk
));
1990 SET(data
->wped_s_screentitle
, MUIA_String_Contents
, _ScreenTitle_Chunk
);
1991 D(bug("[WPEditor] WPEditor_ProccessScreenTitleChunk: string setted = %s\n", _ScreenTitle_Chunk
));
1997 /*Renabled WPEditor_ProccessViewSettingsChunk() as Nic Andrews (nicja@yahoo.com) has asked...;
1998 *Please report here what do it do this function ;)
2001 BOOL
WPEditor_ProccessViewSettingsChunk(Class
*CLASS
, Object
*self
, char *_viewSettings_Name
, UBYTE
*_viewSettings_Chunk
, IPTR chunk_size
)
2003 SETUP_WPEDITOR_INST_DATA
;
2005 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk('%s')\n", _viewSettings_Name
));
2006 //BOOL _viewSettings_NodeFound = FALSE;//unused
2007 struct WPEditor_ViewSettingsObject
*_viewSettings_Node
= NULL
;
2009 _viewSettings_Node
= WPEditor__FindViewSettingObjects(_viewSettings_Name
);
2011 if (_viewSettings_Node
)
2013 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Updating Existing node @ 0x%p\n", _viewSettings_Node
));
2017 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Creating new Objects for '%s'\n", _viewSettings_Name
));
2018 if (((strcmp(_viewSettings_Name
, "Workbench")) == 0) ||
2019 ((strcmp(_viewSettings_Name
, "Drawer")) == 0) ||
2020 ((strcmp(_viewSettings_Name
, "Screen")) == 0))
2021 _viewSettings_Node
= WPEditor__NewViewSettingObjects(_viewSettings_Name
, TRUE
);
2023 _viewSettings_Node
= WPEditor__NewViewSettingObjects(_viewSettings_Name
, FALSE
);
2025 Object
*thisViewImspecGrp
= NULL
;
2026 Object
*thisViewAdvancedGrp
= NULL
;
2028 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Adding ViewSetting Objects for '%s' to Prefs GUI ..\n", _viewSettings_Node
->wpedbo_ViewName
));
2030 thisViewImspecGrp
= (Object
*)GroupObject
,
2031 MUIA_Group_SameSize
, FALSE
,
2032 MUIA_Frame
, MUIV_Frame_None
,
2033 MUIA_Group_Columns
, 2,
2035 Child
, (IPTR
) HVSpace
,
2036 Child
, (IPTR
) HVSpace
,
2038 Child
, (IPTR
) Label1(_viewSettings_Node
->wpedbo_ViewName
),
2039 Child
, (IPTR
) _viewSettings_Node
->wpedbo_ImageSpecObject
,
2040 Child
, (IPTR
) HVSpace
,
2041 Child
, (IPTR
) HVSpace
,
2044 if (_viewSettings_Node
->wpedbo_AdvancedOptionsObject
)
2045 thisViewAdvancedGrp
= (Object
*)GroupObject
,
2046 MUIA_Group_SameSize
, FALSE
,
2047 MUIA_Frame
, MUIV_Frame_None
,
2048 MUIA_Group_Columns
, 2,
2050 Child
, (IPTR
) HVSpace
,
2051 Child
, (IPTR
) _viewSettings_Node
->wpedbo_AdvancedOptionsObject
,
2054 if ((thisViewImspecGrp
) &&
2055 ((!(_viewSettings_Node
->wpedbo_AdvancedOptionsObject
)) ||
2056 ((_viewSettings_Node
->wpedbo_AdvancedOptionsObject
) && (thisViewAdvancedGrp
))))
2058 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: GUI Objects Created ..\n"));
2060 if (DoMethod(data
->wped_ViewSettings_GroupObj
, MUIM_Group_InitChange
))
2062 DoMethod(data
->wped_ViewSettings_GroupObj
, OM_ADDMEMBER
, thisViewImspecGrp
);
2064 if (_viewSettings_Node
->wpedbo_AdvancedOptionsObject
)
2065 DoMethod(data
->wped_ViewSettings_GroupObj
, OM_ADDMEMBER
, thisViewAdvancedGrp
);
2067 DoMethod(data
->wped_ViewSettings_GroupObj
, MUIM_Group_ExitChange
);
2070 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: GUI Objects inserted in Prefs GUI ..\n"));
2073 _viewSettings_Node
->wpedbo_ImageSpecObject
,
2074 MUIM_Notify
, MUIA_Imagedisplay_Spec
, MUIV_EveryTime
,
2075 (IPTR
)self
, 3, MUIM_CallHook
,
2076 &_viewSettings_Node
->wpedbo_Hook_CheckImage
, _viewSettings_Node
2079 if (_viewSettings_Node
->wpedbo_AdvancedOptionsObject
)
2081 _viewSettings_Node
->wpedbo_AdvancedOptionsObject
, MUIM_Notify
, MUIA_Pressed
, FALSE
,
2082 (IPTR
)data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_WindowObj
, 3, MUIM_Set
, MUIA_Window_Open
, TRUE
2085 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: GUI Objects Notifications set ..\n"));
2089 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Failed to create objects ..\n"));
2090 if (thisViewAdvancedGrp
) DoMethod(thisViewAdvancedGrp
, OM_DISPOSE
);
2092 if (thisViewImspecGrp
) DoMethod(thisViewImspecGrp
, OM_DISPOSE
);
2096 if ((_viewSettings_Node
->wpedbo_AdvancedOptionsObject
) && (chunk_size
> (strlen(_viewSettings_Chunk
) + 1)))
2098 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Chunk has options Tag data ..\n"));
2099 UBYTE _viewSettings_TagOffset
= ((strlen(_viewSettings_Chunk
) + 1)/4);
2101 if ((_viewSettings_TagOffset
* 4) != (strlen(_viewSettings_Chunk
) + 1))
2103 _viewSettings_TagOffset
= (_viewSettings_TagOffset
+ 1) * 4;
2104 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: String length unalined - rounding up (length %d, rounded %d) \n", strlen(_viewSettings_Chunk
) + 1, _viewSettings_TagOffset
));
2108 _viewSettings_TagOffset
= _viewSettings_TagOffset
* 4;
2109 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: String length doesnt need aligned (length %d) \n", strlen(_viewSettings_Chunk
) + 1));
2112 if (_viewSettings_Node
->wpedbo_Options
)
2114 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Freeing old ViewSetting Tag data @ 0x%p\n", _viewSettings_Node
->wpedbo_Options
));
2115 FreeVec(_viewSettings_Node
->wpedbo_Options
);
2118 int tag_count
= (chunk_size
- _viewSettings_TagOffset
)/sizeof(struct TagItem32
);
2120 _viewSettings_Node
->wpedbo_Options
= AllocVec((tag_count
+ 1) * sizeof(struct TagItem32
),
2123 if (_viewSettings_Node
->wpedbo_Options
)
2125 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Allocated new Tag storage @ 0x%p [%d bytes] \n", _viewSettings_Node
->wpedbo_Options
, chunk_size
- _viewSettings_TagOffset
));
2126 CopyMem(_viewSettings_Chunk
+ _viewSettings_TagOffset
, _viewSettings_Node
->wpedbo_Options
, tag_count
* sizeof(struct TagItem32
));
2127 _viewSettings_Node
->wpedbo_Options
[tag_count
].ti_Tag
= TAG_DONE
;
2131 SET(_viewSettings_Node
->wpedbo_ImageSpecObject
, MUIA_Imagedisplay_Spec
, _viewSettings_Chunk
);
2137 /*IPTR WPEditor__MUIM_PrefsEditor_ImportFH(): definition of an abstract function from
2138 *MUIC_PrefsEditor; This function basically read the iff prefs file and show in
2139 *Wanderer prefs window the data readed...;
2141 IPTR WPEditor__MUIM_PrefsEditor_ImportFH
2143 Class
*CLASS
, Object
*self
,
2144 struct MUIP_PrefsEditor_ImportFH
*message
2147 //SETUP_WPEDITOR_INST_DATA;//unused
2149 struct ContextNode
*context
;
2150 struct IFFHandle
*handle
;
2151 BOOL success
= TRUE
;
2153 IPTR iff_parse_mode
= IFFPARSE_SCAN
;
2154 UBYTE chunk_buffer
[WP_IFF_CHUNK_BUFFER_SIZE
];
2156 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH()\n"));
2158 if (!(handle
= AllocIFF()))
2161 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Iff current handle 0x%p, msg handle 0x%p\n", handle
->iff_Stream
, message
->fh
));
2163 handle
->iff_Stream
= (IPTR
) message
->fh
;
2164 InitIFFasDOS(handle
);
2166 if ((error
= OpenIFF(handle
, IFFF_READ
)) == 0)
2168 if ((error
= StopChunk(handle
, ID_PREF
, ID_WANDR
)) == 0)
2172 if ((error
= ParseIFF(handle
, iff_parse_mode
)) == 0)
2174 context
= CurrentChunk(handle
);
2175 iff_parse_mode
= IFFPARSE_STEP
;
2177 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Context 0x%p\n", context
));
2179 if ((error
= ReadChunkBytes(handle
, chunk_buffer
, WP_IFF_CHUNK_BUFFER_SIZE
)))
2181 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: ReadChunkBytes() Chunk matches Prefs Header size ..\n"));
2182 struct WandererPrefsIFFChunkHeader
*this_header
= (struct WandererPrefsIFFChunkHeader
*) chunk_buffer
;
2183 char *this_chunk_name
= NULL
;
2184 /* prefs file is stored in little endian */
2185 IPTR this_chunk_size
= AROS_LE2LONG(this_header
->wpIFFch_ChunkSize
);
2188 if ((this_chunk_name
= AllocVec(strlen(this_header
->wpIFFch_ChunkType
) +1, MEMF_ANY
|MEMF_CLEAR
)))
2190 strcpy(this_chunk_name
, this_header
->wpIFFch_ChunkType
);
2191 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Prefs Header for '%s' data size %d bytes\n", this_chunk_name
, this_chunk_size
));
2193 if ((error
= ParseIFF(handle
, IFFPARSE_STEP
)) == IFFERR_EOC
)
2195 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: End of header chunk ..\n"));
2197 if ((error
= ParseIFF(handle
, IFFPARSE_STEP
)) == 0)
2199 context
= CurrentChunk(handle
);
2201 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Context 0x%p\n", context
));
2203 error
= ReadChunkBytes(
2209 if (error
== this_chunk_size
)
2211 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: ReadChunkBytes() Chunk matches Prefs Data size .. (%d)\n", error
));
2212 if ((strcmp(this_chunk_name
, "wanderer:global")) == 0)
2214 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Process data for wanderer global config chunk ..\n"));
2215 WPEditor_ProccessGlobalChunk(CLASS
, self
,(struct TagItem32
*) chunk_buffer
, this_chunk_size
);
2217 #if defined(DEBUG_NETWORKBROWSER)
2218 else if ((strcmp(this_chunk_name
, "wanderer:network")) == 0)
2220 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Process data for wanderer network config chunk ..\n"));
2221 WPEditor_ProccessNetworkChunk(CLASS
, self
, chunk_buffer
);
2225 #if defined(DEBUG_CHANGESCREENTITLE)
2226 else if ((strcmp(this_chunk_name
, "wanderer:screentitle")) == 0)
2228 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Process data for wanderer screentitle config chunk ..\n"));
2229 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Chunk screentitle Data size .. (%d)\n", error
));
2230 WPEditor_ProccessScreenTitleChunk(CLASS
, self
, chunk_buffer
);
2231 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Data for wanderer screentitle config chunk PROCESSED..\n"));
2234 else if ((strncmp(this_chunk_name
, "wanderer:viewsettings", strlen("wanderer:viewsettings"))) == 0)
2236 char *view_name
= this_chunk_name
+ strlen("wanderer:viewsettings") + 1;
2237 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Process data for wanderer background config chunk '%s'..\n", view_name
));
2238 WPEditor_ProccessViewSettingsChunk(CLASS
, self
, view_name
, chunk_buffer
, this_chunk_size
);
2241 }//END if (error == this_chunk_size)
2243 if ((error
= ParseIFF(handle
, IFFPARSE_STEP
)) == IFFERR_EOC
)
2245 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: End of Data chunk ..\n"));
2247 }//END if ((error = ParseIFF(handle, IFFPARSE_STEP)) == 0)
2248 }//END if ((error = ParseIFF(handle, IFFPARSE_STEP)) == IFFERR_EOC)
2249 }//END if (this_chunk_name)
2250 }//END if ((error = ReadChunkBytes(handle, chunk_buffer, WP_IFF_CHUNK_BUFFER_SIZE)))
2251 }//END if ((error = ParseIFF(handle, iff_parse_mode)) == 0)
2254 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: ParseIFF() failed, returncode %ld!\n", error
));
2255 //success = FALSE;// this brokes cancel button
2259 } while (error
!= IFFERR_EOF
);
2265 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: StopChunk() failed, returncode %ld!\n", error
));
2266 success
= FALSE
;// this brokes cancel button
2267 }//END if ((error = StopChunk(handle, ID_PREF, ID_WANDR)) == 0)
2273 D(bug("[WPEditor] Failed to open stream!, returncode %ld!\n", error
));
2274 //ShowError(_(MSG_CANT_OPEN_STREAM));
2276 }//END if ((error = OpenIFF(handle, IFFF_READ)) == 0)
2278 //Close((APTR)handle->iff_Stream);
2284 /*IPTR WPEditor__MUIM_PrefsEditor_ExportFH(): definition of an abstract function from
2285 *MUIC_PrefsEditor; This function basically memorized in the correspondent iff prefs file
2286 *of Wanderer prefs the changes made with Wanderer prefs window...;
2288 IPTR WPEditor__MUIM_PrefsEditor_ExportFH
2290 Class
*CLASS
, Object
*self
,
2291 struct MUIP_PrefsEditor_ExportFH
*message
2294 SETUP_WPEDITOR_INST_DATA
;
2296 struct IFFHandle
*handle
;
2297 struct PrefHeader header
= { 0 };
2298 struct WandererPrefsIFFChunkHeader wanderer_chunkdata
= { };
2299 BOOL success
= TRUE
;
2302 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH()\n"));
2304 if ((handle
= AllocIFF()))
2306 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Current IFF handle 0x%p, msg handle 0x%p\n", handle
->iff_Stream
, message
->fh
));
2308 handle
->iff_Stream
= (IPTR
) message
->fh
;
2310 InitIFFasDOS(handle
);
2312 if (!(error
= OpenIFF(handle
, IFFF_WRITE
))) /* NULL = successful! */
2316 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write IFF FORM Header Chunk ... \n")); /* FIXME: IFFSIZE_UNKNOWN? */
2317 if ((error
= PushChunk(handle
, ID_PREF
, ID_FORM
, IFFSIZE_UNKNOWN
)) != 0)
2319 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: IFF FORM Header Chunk : Error! %d \n", error
));
2320 goto exportFH_CloseIFF
;
2323 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write Preference File Header Chunk ... \n")); /* FIXME: IFFSIZE_UNKNOWN? */
2324 if ((error
= PushChunk(handle
, ID_PREF
, ID_PRHD
, IFFSIZE_UNKNOWN
)) == 0)
2326 header
.ph_Version
= PHV_CURRENT
;
2329 WriteChunkBytes(handle
, &header
, sizeof(struct PrefHeader
));
2331 if ((error
= PopChunk(handle
)) != 0)
2333 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Preference File Header PopChunk() = %ld\n", error
));
2334 goto exportFH_CloseFORM
;
2339 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Preference File Header Chunk : Error! %d \n", error
));
2340 goto exportFH_CloseFORM
;
2343 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Prepare 'global' Wanderer Prefs Data Chunk Data ... \n"));
2344 /* save toolbar state*/
2345 struct TagItem32
*_wp_GlobalTags
= AllocVec((256 * sizeof(struct TagItem32
)), MEMF_ANY
|MEMF_CLEAR
);
2346 ULONG _wp_GlobalTagCounter
= 0;
2347 /* helper to convert to little endian */
2348 STACKED IPTR ti_Data
;
2350 // save navigation bahaviour
2351 _wp_GlobalTags
[_wp_GlobalTagCounter
].ti_Tag
= AROS_LONG2LE(MUIA_IconWindow_WindowNavigationMethod
);
2352 GET(data
->wped_c_NavigationMethod
, MUIA_Cycle_Active
, &ti_Data
);
2353 _wp_GlobalTags
[_wp_GlobalTagCounter
].ti_Data
= AROS_LONG2LE(ti_Data
);
2354 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' MUIA_IconWindow_WindowNavigationMethod @ Tag %d, data = %d\n", _wp_GlobalTagCounter
, ti_Data
));
2355 _wp_GlobalTagCounter
+= 1;
2357 #if defined(DEBUG_SHOWUSERFILES)
2358 _wp_GlobalTags
[_wp_GlobalTagCounter
].ti_Tag
= AROS_LONG2LE(MUIA_IconWindowExt_UserFiles_ShowFilesFolder
);
2359 GET(data
->wped_cm_EnableUserFiles
, MUIA_Selected
, &ti_Data
);
2360 _wp_GlobalTags
[_wp_GlobalTagCounter
].ti_Data
= AROS_LONG2LE(ti_Data
);
2361 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' MUIA_IconWindowExt_UserFiles_ShowFilesFolder @ Tag %d, data = %d\n", _wp_GlobalTagCounter
, ti_Data
));
2362 _wp_GlobalTagCounter
+= 1;
2365 _wp_GlobalTags
[_wp_GlobalTagCounter
].ti_Tag
= AROS_LONG2LE(TAG_DONE
);
2366 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' Marked Tag %d as TAG_DONE\n", _wp_GlobalTagCounter
));
2368 ULONG globaldatasize
= (_wp_GlobalTagCounter
+ 1) * sizeof(struct TagItem32
);
2370 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'global' Wanderer Prefs Header Chunk ... \n"));
2371 if ((error
= PushChunk(handle
, ID_PREF
, ID_WANDR
, sizeof(struct WandererPrefsIFFChunkHeader
))) == 0)
2373 sprintf(wanderer_chunkdata
.wpIFFch_ChunkType
, "%s" , "wanderer:global");
2374 wanderer_chunkdata
.wpIFFch_ChunkSize
= AROS_LONG2LE(globaldatasize
);
2376 WriteChunkBytes(handle
, &wanderer_chunkdata
, sizeof(struct WandererPrefsIFFChunkHeader
));
2378 if ((error
= PopChunk(handle
)) != 0)
2380 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' Header PopChunk() = %ld\n", error
));
2381 goto exportFH_CloseFORM
;
2386 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' Wanderer Prefs Header Chunk : Error! %d \n", error
));
2387 goto exportFH_CloseFORM
;
2390 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'global' Wanderer Prefs Data Chunk ... \n"));
2391 if ((error
= PushChunk(handle
, ID_PREF
, ID_WANDR
, globaldatasize
)) == 0)
2393 error
= WriteChunkBytes(handle
, _wp_GlobalTags
, globaldatasize
);
2394 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' Data Chunk | Wrote %d bytes (data size = %d bytes)\n", error
, globaldatasize
));
2395 if ((error
= PopChunk(handle
)) != 0)
2397 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' PopChunk() = %ld\n", error
));
2398 goto exportFH_CloseFORM
;
2400 FreeVec(_wp_GlobalTags
);
2404 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' PushChunk() = %ld failed\n", error
));
2405 goto exportFH_CloseFORM
;
2408 #if defined(DEBUG_NETWORKBROWSER)
2409 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'network' Wanderer Prefs Header Chunk ... \n"));
2410 if ((error
= PushChunk(handle
, ID_PREF
, ID_WANDR
, sizeof(struct WandererPrefsIFFChunkHeader
))) == 0)
2412 sprintf(wanderer_chunkdata
.wpIFFch_ChunkType
, "%s" , "wanderer:network");
2413 wanderer_chunkdata
.wpIFFch_ChunkSize
= AROS_LONG2LE(sizeof(struct TagItem
));
2415 WriteChunkBytes(handle
, &wanderer_chunkdata
, sizeof(struct WandererPrefsIFFChunkHeader
));
2417 if ((error
= PopChunk(handle
)) != 0)
2419 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'network' Header PopChunk() = %ld\n", error
));
2420 goto exportFH_CloseFORM
;
2425 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'network' Wanderer Prefs Header Chunk : Error! %d \n", error
));
2426 goto exportFH_CloseFORM
;
2429 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'network' Wanderer Prefs Data Chunk ... \n"));
2430 if ((error
= PushChunk(handle
, ID_PREF
, ID_WANDR
, sizeof(struct TagItem
))) == 0)
2432 struct TagItem32 __wp_networkconfig
[2];
2434 /* save network options*/
2435 __wp_networkconfig
[0].ti_Tag
= MUIA_IconWindowExt_NetworkBrowser_Show
;
2436 GET(data
->wped_cm_EnableNetworkBrowser
, MUIA_Selected
, &ti_Data
);
2437 __wp_networkconfig
[0].ti_Data
= AROS_LONG2LE(ti_Data
);
2439 error
= WriteChunkBytes(handle
, __wp_networkconfig
, sizeof(struct TagItem32
));
2440 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'network' Data Chunk | Wrote %d bytes (data size = %d bytes)\n", error
, sizeof(struct TagItem
)));
2441 if ((error
= PopChunk(handle
)) != 0)
2443 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'network' PopChunk() = %ld\n", error
));
2444 goto exportFH_CloseFORM
;
2449 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'network' PushChunk() = %ld failed\n", error
));
2450 goto exportFH_CloseFORM
;
2454 #if defined(DEBUG_CHANGESCREENTITLE)
2455 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'screentitle' Wanderer Prefs Header Chunk ... \n"));
2456 if ((error
= PushChunk(handle
, ID_PREF
, ID_WANDR
, sizeof(struct WandererPrefsIFFChunkHeader
))) == 0)
2458 sprintf(wanderer_chunkdata
.wpIFFch_ChunkType
, "%s" , "wanderer:screentitle");
2459 UBYTE
*screentitlestr
= NULL
;
2461 GET(data
->wped_s_screentitle
, MUIA_String_Contents
, &screentitlestr
);
2463 wanderer_chunkdata
.wpIFFch_ChunkSize
= AROS_LONG2LE(strlen(screentitlestr
) + 1);
2465 WriteChunkBytes(handle
, &wanderer_chunkdata
, sizeof(struct WandererPrefsIFFChunkHeader
));
2467 if ((error
= PopChunk(handle
)) != 0)
2469 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' Header PopChunk() = %ld\n", error
));
2470 goto exportFH_CloseFORM
;
2475 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' Wanderer Prefs Header Chunk : Error! %d \n", error
));
2476 goto exportFH_CloseFORM
;
2479 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'screentitle' Wanderer Prefs Data Chunk ... \n"));
2480 if ((error
= PushChunk(handle
, ID_PREF
, ID_WANDR
, IFFSIZE_UNKNOWN
)) == 0)
2482 // save screentitle options
2483 UBYTE
*screentitlestr
= NULL
;
2485 GET(data
->wped_s_screentitle
, MUIA_String_Contents
, &screentitlestr
);
2486 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' string to write %s\n", screentitlestr
));
2487 error
= WriteChunkBytes(handle
, screentitlestr
, strlen(screentitlestr
) + 1);
2488 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' string written %s\n", screentitlestr
));
2489 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' Data Chunk | Wrote %d bytes\n", error
));
2490 if ((error
= PopChunk(handle
)) != 0)
2492 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' PopChunk() = %ld\n", error
));
2493 goto exportFH_CloseFORM
;
2498 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' PushChunk() = %ld failed\n", error
));
2499 goto exportFH_CloseFORM
;
2503 struct WPEditor_ViewSettingsObject
*_viewSettings_Node
= NULL
;
2504 ForeachNode(&_wpeditor_intern_ViewSettings
, _viewSettings_Node
)
2506 IPTR _viewSettings_ChunkSize
= 0, _viewSettings_TagCount
= 0;
2507 struct TagItem32 _viewSettings_TagList
[WP_MAX_BG_TAG_COUNT
];
2509 sprintf(wanderer_chunkdata
.wpIFFch_ChunkType
, "%s.%s" , "wanderer:viewsettings", _viewSettings_Node
->wpedbo_ViewName
);
2511 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'ViewSettings' Wanderer Prefs Header Chunk for '%s' ... \n", _viewSettings_Node
->wpedbo_ViewName
));
2513 char *background_value
= NULL
;
2514 GET(_viewSettings_Node
->wpedbo_ImageSpecObject
, MUIA_Imagedisplay_Spec
, &background_value
);
2516 if (background_value
)
2518 PushChunk(handle
, ID_PREF
, ID_WANDR
, sizeof(struct WandererPrefsIFFChunkHeader
));
2520 UBYTE _viewSettings_TagOffset
= ((strlen(background_value
) + 1)/4);
2522 if ((_viewSettings_TagOffset
* 4) != (strlen(background_value
) + 1))
2524 _viewSettings_TagOffset
= (_viewSettings_TagOffset
+ 1) * 4;
2525 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'ViewSettings' String length unalined - rounding up (length %d, rounded %d) \n", strlen(background_value
) + 1, _viewSettings_TagOffset
));
2529 _viewSettings_TagOffset
= _viewSettings_TagOffset
* 4;
2530 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'ViewSettings' String length doesnt need aligned (length %d) \n", strlen(background_value
) + 1));
2533 _viewSettings_ChunkSize
+= _viewSettings_TagOffset
;
2535 if (((_viewSettings_Node
->wpedbo_AdvancedOptionsObject
)) && (_viewSettings_Node
->wpedbo_Options
))
2537 //UBYTE *background_typepointer = background_value;
2538 UBYTE background_type
= background_value
[0] - 48;
2540 const struct TagItem32
*tstate
= _viewSettings_Node
->wpedbo_Options
;
2541 struct TagItem32
*tag
= NULL
;
2543 switch (background_type
)
2547 //Picture type -> store appropriate tags ..
2551 //Pattern type -> store appropriate tags ..
2552 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= MUIA_IconWindowExt_ImageBackFill_BGRenderMode
;
2553 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGRenderMode
, IconWindowExt_ImageBackFill_RenderMode_Tiled
, tstate
);
2554 _viewSettings_TagCount
+= 1;
2556 while ((tag
= NextTag32Item(&tstate
)) != NULL
)
2558 switch (tag
->ti_Tag
)
2560 case MUIA_IconWindowExt_ImageBackFill_BGTileMode
:
2561 case MUIA_IconWindowExt_ImageBackFill_BGXOffset
:
2562 case MUIA_IconWindowExt_ImageBackFill_BGYOffset
:
2563 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= tag
->ti_Tag
;
2564 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= tag
->ti_Data
;
2565 _viewSettings_TagCount
+= 1;
2577 /* save the icon listing method */
2578 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_IconListMode
);
2579 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_IconListMode
, ICON_LISTMODE_GRID
, _viewSettings_Node
->wpedbo_Options
));
2580 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_IconListMode @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2581 _viewSettings_TagCount
+= 1;
2583 /* save the icon text mode */
2584 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_LabelText_Mode
);
2585 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_Mode
, ICON_TEXTMODE_OUTLINE
, _viewSettings_Node
->wpedbo_Options
));
2586 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_LabelText_Mode @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2587 _viewSettings_TagCount
+= 1;
2589 /* save the max length of icons */
2590 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_LabelText_MaxLineLen
);
2591 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_MaxLineLen
, ILC_ICONLABEL_MAXLINELEN_DEFAULT
, _viewSettings_Node
->wpedbo_Options
));
2592 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_LabelText_MaxLineLen @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2593 _viewSettings_TagCount
+= 1;
2595 #if defined(DEBUG_MULTLINE)
2596 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_LabelText_MultiLine
);
2597 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_MultiLine
, 1, _viewSettings_Node
->wpedbo_Options
));
2598 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_LabelText_MultiLine @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2599 _viewSettings_TagCount
+= 1;
2601 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_LabelText_MultiLineOnFocus
);
2602 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_MultiLineOnFocus
, FALSE
, _viewSettings_Node
->wpedbo_Options
));
2603 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_LabelText_MultiLineOnFocus @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2604 _viewSettings_TagCount
+= 1;
2607 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_Icon_HorizontalSpacing
);
2608 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_Icon_HorizontalSpacing
, ILC_ICON_HORIZONTALMARGIN_DEFAULT
, _viewSettings_Node
->wpedbo_Options
));
2609 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_Icon_HorizontalSpacing @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2610 _viewSettings_TagCount
+= 1;
2612 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_Icon_VerticalSpacing
);
2613 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_Icon_VerticalSpacing
, ILC_ICON_VERTICALMARGIN_DEFAULT
, _viewSettings_Node
->wpedbo_Options
));
2614 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_Icon_VerticalSpacing @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2615 _viewSettings_TagCount
+= 1;
2617 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_Icon_ImageSpacing
);
2618 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_Icon_ImageSpacing
, ILC_ICONLABEL_IMAGEMARGIN_DEFAULT
, _viewSettings_Node
->wpedbo_Options
));
2619 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_Icon_ImageSpacing @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2620 _viewSettings_TagCount
+= 1;
2622 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_LabelText_HorizontalPadding
);
2623 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_HorizontalPadding
, ILC_ICONLABEL_HORIZONTALTEXTMARGIN_DEFAULT
, _viewSettings_Node
->wpedbo_Options
));
2624 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_LabelText_HorizontalPadding @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2625 _viewSettings_TagCount
+= 1;
2627 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_LabelText_VerticalPadding
);
2628 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_VerticalPadding
, ILC_ICONLABEL_VERTICALTEXTMARGIN_DEFAULT
, _viewSettings_Node
->wpedbo_Options
));
2629 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_LabelText_VerticalPadding @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2630 _viewSettings_TagCount
+= 1;
2632 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_LabelText_BorderWidth
);
2633 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_BorderWidth
, ILC_ICONLABEL_BORDERWIDTH_DEFAULT
, _viewSettings_Node
->wpedbo_Options
));
2634 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_LabelText_BorderWidth @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2635 _viewSettings_TagCount
+= 1;
2637 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Tag
= AROS_LONG2LE(MUIA_IconList_LabelText_BorderHeight
);
2638 _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
= AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_BorderHeight
, ILC_ICONLABEL_BORDERHEIGHT_DEFAULT
, _viewSettings_Node
->wpedbo_Options
));
2639 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_LabelText_BorderHeight @ Tag %d, data = %d\n", _viewSettings_TagCount
, _viewSettings_TagList
[_viewSettings_TagCount
].ti_Data
));
2640 _viewSettings_TagCount
+= 1;
2643 _viewSettings_ChunkSize
+= (_viewSettings_TagCount
* sizeof(struct TagItem32
));
2645 wanderer_chunkdata
.wpIFFch_ChunkSize
= AROS_LONG2LE(_viewSettings_ChunkSize
);
2647 WriteChunkBytes(handle
, &wanderer_chunkdata
, sizeof(struct WandererPrefsIFFChunkHeader
));
2651 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'ViewSettings' Wanderer Prefs Data Chunk for '%s' ... \n", _viewSettings_Node
->wpedbo_ViewName
));
2653 if ((error
= PushChunk(handle
, ID_PREF
, ID_WANDR
, _viewSettings_ChunkSize
)) == 0)
2655 UBYTE
*_viewSettings_ChunkData
= AllocMem(_viewSettings_ChunkSize
, MEMF_ANY
|MEMF_CLEAR
);
2656 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Chunk Data storage @ 0x%p, %d bytes\n", _viewSettings_ChunkData
, _viewSettings_ChunkSize
));
2658 sprintf(_viewSettings_ChunkData
, "%s", background_value
);
2659 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_Background = '%s'\n", _viewSettings_ChunkData
));
2660 if ((_viewSettings_Node
->wpedbo_AdvancedOptionsObject
) && ((_viewSettings_Node
->wpedbo_Options
)&&(_viewSettings_TagCount
> 0)))
2662 struct TagItem32
*dest_tag
= (struct TagItem32
*)(_viewSettings_ChunkData
+ _viewSettings_TagOffset
);
2663 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Writing data for %d Tags @ 0x%p\n", _viewSettings_TagCount
, dest_tag
));
2666 dest_tag
[_viewSettings_TagCount
- 1].ti_Tag
= AROS_LONG2LE(_viewSettings_TagList
[_viewSettings_TagCount
- 1].ti_Tag
);
2667 dest_tag
[_viewSettings_TagCount
- 1].ti_Data
= AROS_LONG2LE(_viewSettings_TagList
[_viewSettings_TagCount
- 1].ti_Data
);
2668 _viewSettings_TagCount
-= 1;
2669 }while(_viewSettings_TagCount
> 0);
2672 error
= WriteChunkBytes(handle
, _viewSettings_ChunkData
, _viewSettings_ChunkSize
);
2673 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Data Chunk | Wrote %d bytes (data size = %d bytes)\n", error
, _viewSettings_ChunkSize
));
2674 if ((error
= PopChunk(handle
)) != 0) // TODO: We need some error checking here!
2676 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Data PopChunk() = %ld\n", error
));
2681 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Data PushChunk() = %ld failed\n", error
));
2686 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Skipping (no value set) ... \n"));
2692 /* Terminate the FORM */
2697 //ShowError(_(MSG_CANT_OPEN_STREAM));
2698 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Can't open stream!\n"));
2704 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Closing Handles ..\n"));
2711 // Do something more here - if IFF allocation has failed, something isn't right
2712 //ShowError(_(MSG_CANT_ALLOCATE_IFFPTR));
2716 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Export Finished\n"));
2722 IPTR WPEditor__MUIM_Setup
2724 Class
*CLASS
, Object
*self
, Msg message
2727 SETUP_WPEDITOR_INST_DATA
;
2729 D(bug("[WPEditor] WPEditor__MUIM_Setup()\n"));
2731 if (!DoSuperMethodA(CLASS
, self
, message
)) return FALSE
;
2733 #if defined(DEBUG_ADVANCEDIMAGEOPTIONS)
2737 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_WindowObj
2741 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_RenderModeObj
,
2742 MUIM_Notify
, MUIA_Cycle_Active
, MUIV_EveryTime
,
2745 &data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Hook_DrawModeChage
,
2750 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_UseObj
,
2751 MUIM_Notify
, MUIA_Pressed
, FALSE
,
2754 &data
->wped_Hook_CloseAdvancedOptions
,
2759 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_CancelObj
,
2760 MUIM_Notify
, MUIA_Pressed
, FALSE
,
2763 &data
->wped_Hook_CloseAdvancedOptions
,
2768 data
->wped_AdvancedViewSettings_WindowData
->wpedabwd_Window_WindowObj
,
2769 MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
2772 &data
->wped_Hook_CloseAdvancedOptions
,
2779 IPTR WPEditor__MUIM_Show
2781 Class
*CLASS
, Object
*self
, Msg message
2784 //SETUP_WPEDITOR_INST_DATA;
2786 D(bug("[WPEditor] WPEditor__MUIM_Show()\n"));
2788 if (!DoSuperMethodA(CLASS
, self
, message
)) return FALSE
;
2790 #if defined(DEBUG_FORCEWINSIZE)
2791 Object
*this_Win
= _win(self
);
2792 if ((this_Win
) && (data
->wped_DimensionsSet
== NULL
))
2794 LONG thisWin_Width
= 0,
2799 LONG viewsettingsbox_Height
= 0;
2801 struct Window
*thisWin_Window
= NULL
;
2803 GET(this_Win
, MUIA_Window_Width
, &thisWin_Width
);
2804 GET(this_Win
, MUIA_Window_Height
, &thisWin_Height
);
2805 GET(this_Win
, MUIA_Window_TopEdge
, &thisWin_X
);
2806 GET(this_Win
, MUIA_Window_LeftEdge
, &thisWin_Y
);
2808 GET(this_Win
, MUIA_Window_Window
, &thisWin_Window
);
2810 GET(data
->wped_ViewSettings_GroupObj
, MUIA_Height
, &viewsettingsbox_Height
);
2812 D(bug("[WPEditor] WPEditor__MUIM_Show: WindowObj @ 0x%p, Real Window @ 0x%p, %d, %d [%d x %d]\n",
2815 thisWin_X
, thisWin_Y
,
2816 thisWin_Width
, thisWin_Height
));
2818 D(bug("[WPEditor] WPEditor__MUIM_Show: ViewSettings Group height = %d\n", viewsettingsbox_Height
));
2820 if ((thisWin_Window
) && (viewsettingsbox_Height
> 0))
2824 Advanced_Height
= 0;
2826 if (data
->wped_FirstBGImSpecObj
) GET(data
->wped_FirstBGImSpecObj
, MUIA_Height
, &ImgSpec_Height
);
2827 if (data
->wped_FirstBGAdvancedObj
) GET(data
->wped_FirstBGAdvancedObj
, MUIA_Height
, &Advanced_Height
);
2829 if ((ImgSpec_Height
> 0) && (Advanced_Height
> 0))
2831 NEWHEIGHT
= ImgSpec_Height
+ Advanced_Height
;
2832 if ((2 * NEWHEIGHT
) < viewsettingsbox_Height
)
2834 thisWin_Height
= (thisWin_Height
- viewsettingsbox_Height
) + (2 * NEWHEIGHT
);
2835 thisWin_Y
= thisWin_Y
+ ((viewsettingsbox_Height
- (2 * NEWHEIGHT
))/2);
2837 D(bug("[WPEditor] WPEditor__MUIM_Show: Changing windows dimensions to %d, %d [%d x %d]\n",
2838 thisWin_X
, thisWin_Y
,
2839 thisWin_Width
, thisWin_Height
));
2841 ChangeWindowBox(thisWin_Window
, thisWin_X
, thisWin_Y
, thisWin_Width
, thisWin_Height
);
2842 data
->wped_DimensionsSet
= TRUE
;
2851 /*** Setup ******************************************************************/
2854 WPEditor
, NULL
, MUIC_PrefsEditor
, NULL
,
2855 OM_NEW
, struct opSet
*,
2858 MUIM_PrefsEditor_ImportFH
, struct MUIP_PrefsEditor_ImportFH
*,
2859 MUIM_PrefsEditor_ExportFH
, struct MUIP_PrefsEditor_ExportFH
*