added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / prefs / wanderer / wpeditor.c
blob3b04315653a8178085b237532cc32de80d226f8a
1 /*
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.
6 $Id$
7 */
9 #define MUIMASTER_YES_INLINE_STDARG
11 #define DEBUG 0
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>
46 #include <stdio.h>
47 #include <string.h>
49 #include "locale.h"
50 #include "wpeditor.h"
51 #include "entryelements.h"
53 #warning "TODO: Include the wandererprefs definitions in a better way .."
54 #include "../../system/Wanderer/wandererprefs.h"
55 #include "../../libs/muimaster/classes/iconlist_attributes.h"
56 #include "../../system/Wanderer/iconwindow_attributes.h"
58 struct TagItem32 {
59 ULONG ti_Tag;
60 ULONG ti_Data;
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;
72 IPTR *wpedbo_Type;
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,
121 #endif
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;
138 struct WPEditor_DATA
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)
154 *wped_s_screentitle,
155 #endif
156 *wped_toolbarpreview,
157 #if defined(DEBUG_NETWORKBROWSER)
158 *wped_cm_EnableNetworkBrowser,
159 #endif
160 #if defined(DEBUG_SHOWUSERFILES)
161 *wped_cm_EnableUserFiles,
162 #endif
163 *wped_toolbarGroup;
165 struct Hook wped_Hook_CloseAdvancedOptions;
168 //static struct Hook navichangehook;
169 static STRPTR _wpeditor_intern_NavigationModes[3];
171 static STRPTR _wpeditor_intern_IconListModeNames[iconlist_ListViewModesCount + 1];
172 static ULONG _wpeditor_intern_IconListModeIDs[iconlist_ListViewModesCount + 1];
174 static STRPTR _wpeditor_intern_IconTextRenderModeNames[iconlist_LabelRenderModesCount + 1];
175 static ULONG _wpeditor_intern_IconTextRenderModeIDs[iconlist_LabelRenderModesCount + 1];
177 static STRPTR _wpeditor_intern_MainPageNames[4];
179 static Class *_wpeditor_intern_CLASS = NULL;
180 static struct List _wpeditor_intern_ViewSettings;
182 /*** Macros *****************************************************************/
183 #define SETUP_WPEDITOR_INST_DATA struct WPEditor_DATA *data = INST_DATA(CLASS, self)
185 /*** Misc Helper functions **************************************************/
186 /* 32bit replacements for utility.library tag funcs */
187 struct TagItem32 * NextTag32Item(struct TagItem32 ** tagListPtr)
189 if(!(*tagListPtr)) return NULL;
191 while (TRUE)
193 switch ((*tagListPtr)->ti_Tag)
195 case TAG_IGNORE:
196 break;
198 case TAG_END:
199 (*tagListPtr) = NULL;
200 return NULL;
202 case TAG_SKIP:
203 (*tagListPtr) += (*tagListPtr)->ti_Data + 1;
204 continue;
206 default:
207 /* Use post-increment (return will return the current value and
208 then tagListPtr will be incremented) */
209 return (struct TagItem32 *)(*tagListPtr)++;
212 (*tagListPtr) ++;
216 struct TagItem32 * FindTag32Item(ULONG tagValue, struct TagItem32 *tagList)
218 struct TagItem32 *tag;
219 const struct TagItem32 *tagptr = tagList;
221 while((tag = NextTag32Item(&tagptr)))
223 if(tag->ti_Tag == tagValue) return tag;
226 return NULL;
230 IPTR GetTag32Data(ULONG tagValue, ULONG defaultVal, struct TagItem32 *tagList)
232 struct TagItem32 *ti = NULL;
234 if ((tagList != NULL) && (ti = FindTag32Item(tagValue, tagList)))
235 return ti->ti_Data;
237 return defaultVal;
240 IPTR GetRenderModePage(char *rendermode_name, STRPTR __RenderModeNames[], IPTR __DrawModePages[])
242 int i = 0;
244 for (i = 0; i < WP_MAX_RENDER_MODES; i++)
246 if (strcmp(__RenderModeNames[i], rendermode_name) == 0)
248 return __DrawModePages[i];
251 return -1;
254 IPTR SetViewSettingTag32(struct TagItem32 *this_Taglist, ULONG Tag_ID, ULONG newTag_Value)
256 int i = 0;
259 if (this_Taglist[i].ti_Tag == TAG_DONE)
260 break;
261 else if (this_Taglist[i].ti_Tag == Tag_ID)
263 if (this_Taglist[i].ti_Data == newTag_Value) return TRUE;
264 this_Taglist[i].ti_Data = newTag_Value;
265 return TRUE;
267 i ++;
268 }while(i < WP_MAX_BG_TAG_COUNT);
270 return FALSE;
273 /*** Hook functions *********************************************************/
275 AROS_UFH3(
276 void, WandererPrefs_Hook_OpenAdvancedOptionsFunc,
277 AROS_UFHA(struct Hook *, hook, A0),
278 AROS_UFHA(APTR *, obj, A2),
279 AROS_UFHA(APTR, param, A1)
282 AROS_USERFUNC_INIT
284 Object *self= (Object *)obj;
285 struct WPEditor_ViewSettingsObject *_viewSettings_Current = *(struct WPEditor_ViewSettingsObject **)param;
286 Class *CLASS = _wpeditor_intern_CLASS;
287 UBYTE *ImageSelector_Spec = NULL;
288 char *Image_Spec = NULL;
290 struct WPEditor_DATA *data = INST_DATA(CLASS, self);
292 data->wped_ViewSettings_Current = _viewSettings_Current;
294 GET(_viewSettings_Current->wpedbo_ImageSpecObject, MUIA_Imagedisplay_Spec, &ImageSelector_Spec);
296 Image_Spec = AllocVec(strlen(ImageSelector_Spec) + 1, MEMF_ANY|MEMF_CLEAR);
297 if (Image_Spec)
299 strcpy(Image_Spec, ImageSelector_Spec);
300 SET(_viewSettings_Current->wpedbo_ImageSpecObject, MUIA_Imagedisplay_Spec, Image_Spec);
302 struct WPEditor_ViewSettingsObject *_viewSettings_Node = NULL;
304 ForeachNode(&_wpeditor_intern_ViewSettings, _viewSettings_Node)
306 GET(_viewSettings_Node->wpedbo_AdvancedOptionsObject,
307 MUIA_Disabled,
308 &_viewSettings_Node->wpedbo_state_AdvancedDisabled);
310 SET(_viewSettings_Node->wpedbo_ImageSpecObject, MUIA_Disabled, TRUE);//1_Disable
311 SET(_viewSettings_Node->wpedbo_AdvancedOptionsObject, MUIA_Disabled, TRUE);//2_Disable
312 if (_viewSettings_Node == _viewSettings_Current)
314 D(bug("[WPEditor] WandererPrefs_Hook_OpenAdvancedOptionsFunc: Found ViewSettings chunk for node we are editing\n"));
315 if (XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_BackgroundGrpObj, MUIA_ShowMe) == TRUE)
317 ULONG current_RenderMode = GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGRenderMode, IconWindowExt_ImageBackFill_RenderMode_Tiled, _viewSettings_Node->wpedbo_Options);
318 IPTR current_RenderMode_entry = NULL;
319 int i;
321 for (i = 0; i < data->wped_ViewSettings_Current->wpedbo_BFRenderModeCount; i++)
323 if ((ULONG)GetEntryElementID(data->wped_ViewSettings_Current->wpedbo_BFRenderModeEntries[i]) == current_RenderMode)
325 current_RenderMode_entry = data->wped_ViewSettings_Current->wpedbo_BFRenderModeEntries[i];
328 (Object *)data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeObj,
329 MUIA_Cycle_Active, i
333 (Object *)data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModePageObj,
334 MUIA_Group_ActivePage, data->wped_ViewSettings_Current->wpedbo_BFRenderModePages[i]
339 //D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: Render Mode '%s'\n", data->wped_ViewSettings_Current->wpedbo_BFRenderModeNames[current_rendermodepage]));
341 if (current_RenderMode == IconWindowExt_ImageBackFill_RenderMode_Tiled)
344 ULONG current_TileMode = GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGTileMode, IconWindowExt_ImageBackFill_TileMode_Float, _viewSettings_Node->wpedbo_Options);
345 IPTR current_rendermode_entry = NULL;
347 for (i = 0; i < data->wped_ViewSettings_Current->wpedbo_BFTileModeCount; i++)
349 if ((ULONG)GetEntryElementID(data->wped_ViewSettings_Current->wpedbo_BFTileModeEntries[i]) == current_TileMode)
351 current_RenderMode_entry = data->wped_ViewSettings_Current->wpedbo_BFRenderModeEntries[i];
354 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_TileModeObj,
355 MUIA_Cycle_Active, i
362 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_XOffsetObj, MUIA_String_Integer, GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGXOffset, 0, _viewSettings_Current->wpedbo_Options));
363 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_YOffsetObj, MUIA_String_Integer, GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGYOffset, 0, _viewSettings_Current->wpedbo_Options));
365 #if defined(DEBUG_PERVIEWFONTS)
366 // SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_LabelFont,
367 // SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_InfoFont,
368 #endif
369 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_Icon_ListMode, MUIA_Cycle_Active, GetTag32Data(MUIA_IconList_IconListMode, ICON_LISTMODE_GRID, _viewSettings_Current->wpedbo_Options));
370 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_Icon_TextMode, MUIA_Cycle_Active, GetTag32Data(MUIA_IconList_LabelText_Mode, ICON_TEXTMODE_OUTLINE, _viewSettings_Current->wpedbo_Options));
371 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));
372 #if defined(DEBUG_MULTLINE)
373 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineonFocus, MUIA_Selected, GetTag32Data(MUIA_IconList_LabelText_MultiLineOnFocus, FALSE, _viewSettings_Current->wpedbo_Options));
374 LONG MultiLineNo = GetTag32Data(MUIA_IconList_LabelText_MultiLine, 1, _viewSettings_Current->wpedbo_Options);
375 if (MultiLineNo < 1) MultiLineNo = 1;
376 if (MultiLineNo > 1)
378 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_TextMultiLine, MUIA_Selected, TRUE);
379 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineNo, MUIA_Disabled, FALSE);
381 else
383 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_TextMultiLine, MUIA_Selected, FALSE);
384 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineNo, MUIA_Disabled, TRUE);
386 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineNo, MUIA_String_Integer, MultiLineNo);
387 #endif
388 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));
389 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));
390 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));
391 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));
392 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));
393 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));
394 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));
398 /*Enable this and remove *_Disable instructions over
399 when discovered the zune refresh problem...*/
400 //SET(data->wped_ViewSettings_GroupObj, MUIA_Disabled, TRUE);
402 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_WindowObj, MUIA_Window_Open, TRUE);
403 FreeVec(Image_Spec);
406 AROS_USERFUNC_EXIT
409 AROS_UFH3(
410 void, WandererPrefs_Hook_CloseAdvancedOptionsFunc,
411 AROS_UFHA(struct Hook *, hook, A0),
412 AROS_UFHA(APTR *, obj, A2),
413 AROS_UFHA(APTR, param, A1)
416 AROS_USERFUNC_INIT
418 Object *self = ( Object *)obj;
419 BOOL use_settings = (BOOL) *( IPTR *)param;
420 struct WPEditor_ViewSettingsObject *_viewSettings_Node = NULL;
421 Class *CLASS = _wpeditor_intern_CLASS;
422 BOOL settings_changed = FALSE;
423 BOOL success = FALSE;
425 SETUP_WPEDITOR_INST_DATA;
427 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc()\n"));
429 /*Enable this and remove *_Enable instructions under
430 when discovered the zune refresh problem...*/
431 //SET(data->wped_ViewSettings_GroupObj, MUIA_Disabled, FALSE);
433 ForeachNode(&_wpeditor_intern_ViewSettings, _viewSettings_Node)
435 SET(_viewSettings_Node->wpedbo_ImageSpecObject, MUIA_Disabled, FALSE);
436 SET(_viewSettings_Node->wpedbo_AdvancedOptionsObject, MUIA_Disabled, _viewSettings_Node->wpedbo_state_AdvancedDisabled);
439 if ((use_settings) && (data->wped_ViewSettings_Current))
441 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: Updating tags for Background ..\n"));
442 IPTR current_rendermodepage = 0;
443 ULONG current_rendermode;
445 GET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeObj, MUIA_Cycle_Active, &current_rendermodepage);
446 IPTR current_rendermode_entry = data->wped_ViewSettings_Current->wpedbo_BFRenderModeEntries[current_rendermodepage];
448 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: Render Mode '%s'\n", data->wped_ViewSettings_Current->wpedbo_BFRenderModeNames[current_rendermodepage]));
449 current_rendermode = (ULONG)GetEntryElementID(current_rendermode_entry);
450 if (current_rendermode == -1)
452 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: ERROR: Unknown Render mode string!?!?!\n"));
454 else
456 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconWindowExt_ImageBackFill_BGRenderMode, current_rendermode);
457 if (success == FALSE)
459 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconWindowExt_ImageBackFill_BGRenderMode TAG - Adding ..\n"));
460 #warning "TODO: Allocate extra storage for our tags.."
462 else if (success == TRUE)
464 settings_changed = TRUE;
467 switch (current_rendermode)
469 case IconWindowExt_ImageBackFill_RenderMode_Scale:
470 break;
472 case IconWindowExt_ImageBackFill_RenderMode_Tiled:
473 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconWindowExt_ImageBackFill_BGXOffset, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_XOffsetObj, MUIA_String_Integer));
474 if (success == FALSE)
476 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconWindowExt_ImageBackFill_BGXOffset TAG - Adding ..\n"));
477 #warning "TODO: Allocate extra storage for our tags.."
479 else if (success == TRUE)
481 settings_changed = TRUE;
484 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconWindowExt_ImageBackFill_BGYOffset, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_YOffsetObj, MUIA_String_Integer));
485 if (success == FALSE)
487 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconWindowExt_ImageBackFill_BGYOffset TAG - Adding ..\n"));
488 #warning "TODO: Allocate extra storage for our tags.."
490 else if (success == TRUE)
492 settings_changed = TRUE;
495 IPTR current_tilemodeno = 0;
496 ULONG current_tilemode = 0;
498 GET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_TileModeObj, MUIA_Cycle_Active, &current_tilemodeno);
499 IPTR current_tilemode_entry = data->wped_ViewSettings_Current->wpedbo_BFTileModeEntries[current_tilemodeno];
501 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: Tile Mode '%s'\n", data->wped_ViewSettings_Current->wpedbo_BFTileModeNames[current_tilemodeno]));
502 current_tilemode = (ULONG)GetEntryElementID(current_tilemode_entry);
504 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconWindowExt_ImageBackFill_BGTileMode, current_tilemode);
505 if (success == FALSE)
507 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconWindowExt_ImageBackFill_BGTileMode TAG - Adding ..\n"));
508 #warning "TODO: Allocate extra storage for our tags.."
510 else if (success == TRUE)
512 settings_changed = TRUE;
514 break;
518 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_IconListMode, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_Icon_ListMode, MUIA_Cycle_Active));
519 if (success == FALSE)
521 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_IconListMode TAG - Adding ..\n"));
522 #warning "TODO: Allocate extra storage for our tags.."
524 else if (success == TRUE)
526 settings_changed = TRUE;
529 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_LabelText_Mode, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_Icon_TextMode, MUIA_Cycle_Active));
530 if (success == FALSE)
532 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_Mode TAG - Adding ..\n"));
533 #warning "TODO: Allocate extra storage for our tags.."
535 else if (success == TRUE)
537 settings_changed = TRUE;
540 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_LabelText_MaxLineLen, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MaxLineLen, MUIA_String_Integer));
541 if (success == FALSE)
543 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_MaxLineLen TAG - Adding ..\n"));
544 #warning "TODO: Allocate extra storage for our tags.."
546 else if (success == TRUE)
548 settings_changed = TRUE;
551 #if defined(DEBUG_MULTLINE)
552 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_LabelText_MultiLineOnFocus, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineonFocus, MUIA_Selected));
553 if (success == FALSE)
555 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_MultiLineOnFocus TAG - Adding ..\n"));
556 #warning "TODO: Allocate extra storage for our tags.."
558 else if (success == TRUE)
560 settings_changed = TRUE;
563 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_LabelText_MultiLine, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineNo, MUIA_String_Integer));
564 if (success == FALSE)
566 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_MultiLine TAG - Adding ..\n"));
567 #warning "TODO: Allocate extra storage for our tags.."
569 else if (success == TRUE)
571 settings_changed = TRUE;
573 #endif
574 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_Icon_HorizontalSpacing, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_Icon_HorSpacing, MUIA_String_Integer));
575 if (success == FALSE)
577 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_Icon_HorizontalSpacing TAG - Adding ..\n"));
578 #warning "TODO: Allocate extra storage for our tags.."
580 else if (success == TRUE)
582 settings_changed = TRUE;
585 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_Icon_VerticalSpacing, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_Icon_VertSpacing, MUIA_String_Integer));
586 if (success == FALSE)
588 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_Icon_VerticalSpacing TAG - Adding ..\n"));
589 #warning "TODO: Allocate extra storage for our tags.."
591 else if (success == TRUE)
593 settings_changed = TRUE;
596 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_Icon_ImageSpacing, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_Icon_ImageSpacing, MUIA_String_Integer));
597 if (success == FALSE)
599 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_Icon_ImageSpacing TAG - Adding ..\n"));
600 #warning "TODO: Allocate extra storage for our tags.."
602 else if (success == TRUE)
604 settings_changed = TRUE;
607 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_LabelText_HorizontalPadding, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_HorPadd, MUIA_String_Integer));
608 if (success == FALSE)
610 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_HorizontalPadding TAG - Adding ..\n"));
611 #warning "TODO: Allocate extra storage for our tags.."
613 else if (success == TRUE)
615 settings_changed = TRUE;
618 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_LabelText_VerticalPadding, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_VertPadd, MUIA_String_Integer));
619 if (success == FALSE)
621 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_VerticalPadding TAG - Adding ..\n"));
622 #warning "TODO: Allocate extra storage for our tags.."
624 else if (success == TRUE)
626 settings_changed = TRUE;
629 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_LabelText_BorderWidth, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_BorderWidth, MUIA_String_Integer));
630 if (success == FALSE)
632 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_BorderWidth TAG - Adding ..\n"));
633 #warning "TODO: Allocate extra storage for our tags.."
635 else if (success == TRUE)
637 settings_changed = TRUE;
640 success = SetViewSettingTag32(data->wped_ViewSettings_Current->wpedbo_Options, MUIA_IconList_LabelText_BorderHeight, XGET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_BorderHeight, MUIA_String_Integer));
641 if (success == FALSE)
643 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: No MUIA_IconList_LabelText_BorderHeight TAG - Adding ..\n"));
644 #warning "TODO: Allocate extra storage for our tags.."
646 else if (success == TRUE)
648 settings_changed = TRUE;
651 if (settings_changed) SET(self, MUIA_PrefsEditor_Changed, TRUE);
653 else
655 D(bug("[WPEditor] WandererPrefs_Hook_CloseAdvancedOptionsFunc: Cancel selected\n"));
658 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_WindowObj, MUIA_Window_Open, FALSE);
660 AROS_USERFUNC_EXIT
664 AROS_UFH3(
665 void, WandererPrefs_Hook_DrawModeChangeFunc,
666 AROS_UFHA(struct Hook *, hook, A0),
667 AROS_UFHA(APTR *, obj, A2),
668 AROS_UFHA(APTR, param, A1)
671 AROS_USERFUNC_INIT
673 Object *self = ( Object *)obj;
674 Class *CLASS = *( Class **)param;
676 SETUP_WPEDITOR_INST_DATA;
678 D(bug("[WPEditor] WandererPrefs_Hook_DrawModeChangeFunc()\n"));
680 if (data->wped_ViewSettings_Current)
682 IPTR active_cycleentry = 0;
683 GET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeObj, MUIA_Cycle_Active, &active_cycleentry);
685 D(bug("[WPEditor] WandererPrefs_Hook_DrawModeChangeFunc: RenderMode Cycle Active = %d, Page = %d\n", active_cycleentry, data->wped_ViewSettings_Current->wpedbo_BFRenderModePages[active_cycleentry]));
687 IPTR active_page = 0;
688 GET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModePageObj, MUIA_Group_ActivePage, &active_page);
690 if (active_page != data->wped_ViewSettings_Current->wpedbo_BFRenderModePages[active_cycleentry])
694 (Object *)data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModePageObj,
695 MUIA_Group_ActivePage, data->wped_ViewSettings_Current->wpedbo_BFRenderModePages[active_cycleentry]
697 D(bug("[WPEditor] WandererPrefs_Hook_DrawModeChangeFunc: Changing Active Page to %d\n", data->wped_ViewSettings_Current->wpedbo_BFRenderModePages[active_cycleentry]));
702 AROS_USERFUNC_EXIT
705 AROS_UFH3(
706 void, WandererPrefs_Hook_CheckImageFunc,
707 AROS_UFHA(struct Hook *, hook, A0),
708 AROS_UFHA(APTR *, obj, A2),
709 AROS_UFHA(APTR, param, A1)
712 AROS_USERFUNC_INIT
714 Object *self = (Object *) obj;
715 struct WPEditor_ViewSettingsObject *_viewSettings_Current = *( struct WPEditor_ViewSettingsObject **)param;
716 Class *CLASS = _wpeditor_intern_CLASS;
718 SETUP_WPEDITOR_INST_DATA;
720 UBYTE *ImageSelector_Spec = NULL;
722 GET(_viewSettings_Current->wpedbo_ImageSpecObject, MUIA_Imagedisplay_Spec, &ImageSelector_Spec);
724 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Object @ 0x%p reports image spec '%s'\n", _viewSettings_Current->wpedbo_ImageSpecObject, (char *)ImageSelector_Spec));
726 IPTR this_Background_type = (IPTR)(ImageSelector_Spec[0] - 48);
728 _viewSettings_Current->wpedbo_Type = (IPTR) this_Background_type;
729 data->wped_ViewSettings_Current = _viewSettings_Current;
731 if (_viewSettings_Current->wpedbo_AdvancedOptionsObject)
733 struct TagItem32 newVS_Options[WP_MAX_BG_TAG_COUNT];
734 IPTR newVS_OptionCount = 0, BFTileModeCount = 0;
735 IPTR newBG_RenderModeCount = 0;
736 IPTR newBG_RenderModePages[WP_DRAWMODE_COUNT];
737 STRPTR newBG_RenderModes[WP_DRAWMODE_COUNT];
739 if ((_viewSettings_Current->wpedbo_Type == 5)||(_viewSettings_Current->wpedbo_Type == 0))
741 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Image-type spec (%d) - Enabling Advanced Image options ..\n", _viewSettings_Current->wpedbo_Type));
742 #if defined(DEBUG_ADVANCEDIMAGEOPTIONS)
743 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_BackgroundGrpObj, MUIA_ShowMe, TRUE);
744 #endif
746 for (newVS_OptionCount = 0; newVS_OptionCount < WP_MAX_BG_TAG_COUNT; newVS_OptionCount++)
748 newVS_Options[newVS_OptionCount].ti_Tag = TAG_DONE;
750 newVS_OptionCount = 0;
752 if (_viewSettings_Current->wpedbo_Options)
754 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Existing options @ 0x%p\n", _viewSettings_Current->wpedbo_Options));
757 switch ((int)_viewSettings_Current->wpedbo_Type)
759 IPTR DRAWMODEENTRY = NULL;
761 case 5:
763 if ((strcmp(_viewSettings_Current->wpedbo_ViewName, "Workbench")) == 0)
765 DRAWMODEENTRY = EntryElementFindNode(&data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_AdvancedViewRenderModes, IconWindowExt_ImageBackFill_RenderMode_Scale);
766 newBG_RenderModes[newBG_RenderModeCount] = GetEntryElementName(DRAWMODEENTRY);
767 newBG_RenderModePages[newBG_RenderModeCount++] = 0;
769 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: DrawMode %d = '%s'\n", newBG_RenderModeCount -1, newBG_RenderModes[newBG_RenderModeCount-1]));
772 case 0:
774 DRAWMODEENTRY = EntryElementFindNode(&data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_AdvancedViewRenderModes, IconWindowExt_ImageBackFill_RenderMode_Tiled);
775 newBG_RenderModes[newBG_RenderModeCount] = GetEntryElementName(DRAWMODEENTRY);
776 newBG_RenderModePages[newBG_RenderModeCount++] = 1;
778 IPTR old_bg_tilemodes = (IPTR)data->wped_ViewSettings_Current->wpedbo_BFTileModeNames;
779 IPTR old_bg_tilemodeentries = (IPTR)data->wped_ViewSettings_Current->wpedbo_BFTileModeEntries;
781 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Old TileModes @ 0x%p, Entries @ 0x%p\n", old_bg_tilemodes, old_bg_tilemodeentries));
783 data->wped_ViewSettings_Current->wpedbo_BFTileModeNames = NULL;
784 data->wped_ViewSettings_Current->wpedbo_BFTileModeEntries = NULL;
786 data->wped_ViewSettings_Current->wpedbo_BFTileModeCount = EntryElementCount(&data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_AdvancedViewTileModes);
788 data->wped_ViewSettings_Current->wpedbo_BFTileModeNames = AllocVec((sizeof(STRPTR) * (data->wped_ViewSettings_Current->wpedbo_BFTileModeCount + 1)), MEMF_ANY|MEMF_CLEAR);
789 data->wped_ViewSettings_Current->wpedbo_BFTileModeEntries = AllocVec((sizeof(IPTR) * data->wped_ViewSettings_Current->wpedbo_BFTileModeCount), MEMF_ANY|MEMF_CLEAR);
791 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));
792 struct Node *tilelist_entry = NULL;
794 ForeachNode(&data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_AdvancedViewTileModes, tilelist_entry)
796 data->wped_ViewSettings_Current->wpedbo_BFTileModeNames[BFTileModeCount] = GetEntryElementName(tilelist_entry);
797 data->wped_ViewSettings_Current->wpedbo_BFTileModeEntries[BFTileModeCount] = tilelist_entry;
798 BFTileModeCount++;
801 Object *new_TileModeObj = NULL;
803 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Creating TileModes Cycle gadget\n"));
804 new_TileModeObj = MUI_MakeObject(MUIO_Cycle,
805 NULL,
806 data->wped_ViewSettings_Current->wpedbo_BFTileModeNames
809 if (new_TileModeObj)
811 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Object @ 0x%p\n", new_TileModeObj));
812 if (DoMethod(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_TileModeObjContainer, MUIM_Group_InitChange))
814 DoMethod(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_TileModeObjContainer, OM_REMMEMBER, data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_TileModeObj);
815 DoMethod(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_TileModeObjContainer, OM_ADDMEMBER, new_TileModeObj);
816 DoMethod(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_TileModeObjContainer, MUIM_Group_ExitChange);
818 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_TileModeObj = new_TileModeObj;
822 if (old_bg_tilemodes)
823 FreeVec((IPTR)old_bg_tilemodes);
825 if (old_bg_tilemodeentries)
826 FreeVec((IPTR)old_bg_tilemodeentries);
828 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconWindowExt_ImageBackFill_BGRenderMode;
829 if (_viewSettings_Current->wpedbo_Options)
830 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGRenderMode, IconWindowExt_ImageBackFill_RenderMode_Tiled, _viewSettings_Current->wpedbo_Options);
831 else
832 newVS_Options[newVS_OptionCount++].ti_Data = IconWindowExt_ImageBackFill_RenderMode_Tiled;
834 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconWindowExt_ImageBackFill_BGTileMode;
835 if (_viewSettings_Current->wpedbo_Options)
836 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGTileMode, IconWindowExt_ImageBackFill_TileMode_Float, _viewSettings_Current->wpedbo_Options);
837 else
838 newVS_Options[newVS_OptionCount++].ti_Data = IconWindowExt_ImageBackFill_TileMode_Float;
840 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconWindowExt_ImageBackFill_BGXOffset;
841 if (_viewSettings_Current->wpedbo_Options)
842 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGXOffset, 0, _viewSettings_Current->wpedbo_Options);
843 else
844 newVS_Options[newVS_OptionCount++].ti_Data = 0;
846 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconWindowExt_ImageBackFill_BGYOffset;
847 if (_viewSettings_Current->wpedbo_Options)
848 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGYOffset, 0, _viewSettings_Current->wpedbo_Options);
849 else
850 newVS_Options[newVS_OptionCount++].ti_Data = 0;
852 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: DrawMode %d = '%s'\n", newBG_RenderModeCount -1, newBG_RenderModes[newBG_RenderModeCount-1]));
854 break;
858 else
860 SET(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_BackgroundGrpObj, MUIA_ShowMe, FALSE);
863 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_IconListMode;
864 if (_viewSettings_Current->wpedbo_Options)
865 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_IconListMode, ICON_LISTMODE_GRID, _viewSettings_Current->wpedbo_Options);
866 else
867 newVS_Options[newVS_OptionCount++].ti_Data = ICON_LISTMODE_GRID;
869 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_LabelText_Mode;
870 if (_viewSettings_Current->wpedbo_Options)
871 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_LabelText_Mode, ICON_TEXTMODE_OUTLINE, _viewSettings_Current->wpedbo_Options);
872 else
873 newVS_Options[newVS_OptionCount++].ti_Data = ICON_TEXTMODE_OUTLINE;
875 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_LabelText_MaxLineLen;
876 if (_viewSettings_Current->wpedbo_Options)
877 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_LabelText_MaxLineLen, ILC_ICONLABEL_MAXLINELEN_DEFAULT, _viewSettings_Current->wpedbo_Options);
878 else
879 newVS_Options[newVS_OptionCount++].ti_Data = ILC_ICONLABEL_MAXLINELEN_DEFAULT;
881 #if defined(DEBUG_MULTLINE)
882 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_LabelText_MultiLine;
883 if (_viewSettings_Current->wpedbo_Options)
884 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_LabelText_MultiLine, 1, _viewSettings_Current->wpedbo_Options);
885 else
886 newVS_Options[newVS_OptionCount++].ti_Data = 1;
888 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_LabelText_MultiLineOnFocus;
889 if (_viewSettings_Current->wpedbo_Options)
890 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_LabelText_MultiLineOnFocus, FALSE, _viewSettings_Current->wpedbo_Options);
891 else
892 newVS_Options[newVS_OptionCount++].ti_Data = FALSE;
893 #endif
895 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_Icon_HorizontalSpacing;
896 if (_viewSettings_Current->wpedbo_Options)
897 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_Icon_HorizontalSpacing, ILC_ICON_HORIZONTALMARGIN_DEFAULT, _viewSettings_Current->wpedbo_Options);
898 else
899 newVS_Options[newVS_OptionCount++].ti_Data = ILC_ICON_HORIZONTALMARGIN_DEFAULT;
901 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_Icon_VerticalSpacing;
902 if (_viewSettings_Current->wpedbo_Options)
903 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_Icon_VerticalSpacing, ILC_ICON_VERTICALMARGIN_DEFAULT, _viewSettings_Current->wpedbo_Options);
904 else
905 newVS_Options[newVS_OptionCount++].ti_Data = ILC_ICON_VERTICALMARGIN_DEFAULT;
907 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_Icon_ImageSpacing;
908 if (_viewSettings_Current->wpedbo_Options)
909 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_Icon_ImageSpacing, ILC_ICONLABEL_IMAGEMARGIN_DEFAULT, _viewSettings_Current->wpedbo_Options);
910 else
911 newVS_Options[newVS_OptionCount++].ti_Data = ILC_ICONLABEL_IMAGEMARGIN_DEFAULT;
913 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_LabelText_HorizontalPadding;
914 if (_viewSettings_Current->wpedbo_Options)
915 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_LabelText_HorizontalPadding, ILC_ICONLABEL_HORIZONTALTEXTMARGIN_DEFAULT, _viewSettings_Current->wpedbo_Options);
916 else
917 newVS_Options[newVS_OptionCount++].ti_Data = ILC_ICONLABEL_HORIZONTALTEXTMARGIN_DEFAULT;
919 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_LabelText_VerticalPadding;
920 if (_viewSettings_Current->wpedbo_Options)
921 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_LabelText_VerticalPadding, ILC_ICONLABEL_VERTICALTEXTMARGIN_DEFAULT, _viewSettings_Current->wpedbo_Options);
922 else
923 newVS_Options[newVS_OptionCount++].ti_Data = ILC_ICONLABEL_VERTICALTEXTMARGIN_DEFAULT;
925 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_LabelText_BorderWidth;
926 if (_viewSettings_Current->wpedbo_Options)
927 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_LabelText_BorderWidth, ILC_ICONLABEL_BORDERWIDTH_DEFAULT, _viewSettings_Current->wpedbo_Options);
928 else
929 newVS_Options[newVS_OptionCount++].ti_Data = ILC_ICONLABEL_BORDERWIDTH_DEFAULT;
931 newVS_Options[newVS_OptionCount].ti_Tag = MUIA_IconList_LabelText_BorderHeight;
932 if (_viewSettings_Current->wpedbo_Options)
933 newVS_Options[newVS_OptionCount++].ti_Data = GetTag32Data(MUIA_IconList_LabelText_BorderHeight, ILC_ICONLABEL_BORDERHEIGHT_DEFAULT, _viewSettings_Current->wpedbo_Options);
934 else
935 newVS_Options[newVS_OptionCount++].ti_Data = ILC_ICONLABEL_BORDERHEIGHT_DEFAULT;
937 if (newVS_OptionCount > 0)
939 IPTR old_bg_options = (IPTR) _viewSettings_Current->wpedbo_Options,
940 VSOptionCountCount = 0;
942 _viewSettings_Current->wpedbo_Options = NULL;
944 _viewSettings_Current->wpedbo_Options = AllocVec((sizeof(struct TagItem32) * (newVS_OptionCount + 1)), MEMF_ANY|MEMF_CLEAR);
945 for (VSOptionCountCount = 0; VSOptionCountCount < newVS_OptionCount; VSOptionCountCount++)
947 _viewSettings_Current->wpedbo_Options[VSOptionCountCount].ti_Tag = newVS_Options[VSOptionCountCount].ti_Tag;
948 _viewSettings_Current->wpedbo_Options[VSOptionCountCount].ti_Data = newVS_Options[VSOptionCountCount].ti_Data;
951 if (old_bg_options)
952 FreeVec((struct TagItem32 *)old_bg_options);
955 if (newBG_RenderModeCount > 0)
957 IPTR old_bg_drawmodes = (IPTR)data->wped_ViewSettings_Current->wpedbo_BFRenderModeNames;
958 IPTR old_bg_drawpages = (IPTR)data->wped_ViewSettings_Current->wpedbo_BFRenderModePages;
959 IPTR BFRenderModeCount = 0;
961 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Old RenderModes @ 0x%p, pages @ 0x%p\n", old_bg_drawmodes, old_bg_drawpages));
963 data->wped_ViewSettings_Current->wpedbo_BFRenderModeNames = NULL;
964 data->wped_ViewSettings_Current->wpedbo_BFRenderModePages = NULL;
965 data->wped_ViewSettings_Current->wpedbo_BFRenderModeEntries = NULL;
967 data->wped_ViewSettings_Current->wpedbo_BFRenderModeNames = AllocVec((sizeof(STRPTR) * (newBG_RenderModeCount + 1)), MEMF_ANY|MEMF_CLEAR);
968 data->wped_ViewSettings_Current->wpedbo_BFRenderModePages = AllocVec((sizeof(IPTR) * newBG_RenderModeCount), MEMF_ANY|MEMF_CLEAR);
969 data->wped_ViewSettings_Current->wpedbo_BFRenderModeEntries = AllocVec((sizeof(IPTR) * newBG_RenderModeCount), MEMF_ANY|MEMF_CLEAR);
970 data->wped_ViewSettings_Current->wpedbo_BFRenderModeCount = newBG_RenderModeCount;
972 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));
974 for (BFRenderModeCount = 0; BFRenderModeCount < data->wped_ViewSettings_Current->wpedbo_BFRenderModeCount; BFRenderModeCount++)
976 data->wped_ViewSettings_Current->wpedbo_BFRenderModeNames[BFRenderModeCount] = newBG_RenderModes[BFRenderModeCount];
977 data->wped_ViewSettings_Current->wpedbo_BFRenderModePages[BFRenderModeCount] = newBG_RenderModePages[BFRenderModeCount];
978 data->wped_ViewSettings_Current->wpedbo_BFRenderModeEntries[BFRenderModeCount] = EntryElementFindNamedNode(&data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_AdvancedViewRenderModes, newBG_RenderModes[BFRenderModeCount]);
981 Object *new_RenderModeObj = NULL;
983 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Creating RenderModes Cycle gadget\n"));
984 new_RenderModeObj = MUI_MakeObject(MUIO_Cycle,
985 NULL,
986 data->wped_ViewSettings_Current->wpedbo_BFRenderModeNames
988 if (new_RenderModeObj)
990 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: Object @ 0x%p\n", new_RenderModeObj));
991 if (DoMethod(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeGrpObj, MUIM_Group_InitChange))
993 DoMethod(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeGrpObj, OM_REMMEMBER, data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeObj);
994 DoMethod(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeGrpObj, OM_ADDMEMBER, new_RenderModeObj);
995 DoMethod(data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeGrpObj, MUIM_Group_ExitChange);
997 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeObj = new_RenderModeObj;
999 DoMethod (
1000 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeObj,
1001 MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime,
1002 (IPTR)self, 3, MUIM_CallHook,
1003 &data->wped_AdvancedViewSettings_WindowData->wpedabwd_Hook_DrawModeChage, CLASS
1008 if (old_bg_drawmodes)
1009 FreeVec((IPTR)old_bg_drawmodes);
1011 if (old_bg_drawpages)
1012 FreeVec((IPTR)old_bg_drawpages);
1015 else
1017 D(bug("[WPEditor] WandererPrefs_Hook_CheckImageFunc: xxxxxxx - Disabling Advanced options ..\n"));
1018 SET(_viewSettings_Current->wpedbo_AdvancedOptionsObject, MUIA_Disabled, TRUE);
1020 SET(self, MUIA_PrefsEditor_Changed, TRUE);
1022 AROS_USERFUNC_EXIT
1025 struct WPEditor_ViewSettingsObject *WPEditor__FindViewSettingObjects(char * this_Name)
1027 struct WPEditor_ViewSettingsObject *_viewSettings_Current = NULL;
1029 ForeachNode(&_wpeditor_intern_ViewSettings, _viewSettings_Current)
1031 if ((strcmp(_viewSettings_Current->wpedbo_ViewName, this_Name)) == 0) return _viewSettings_Current;
1033 return NULL;
1036 /*WPEditor__NewViewSettingObjects(): Add new ViewSetting object to
1037 *scrollgroup in left part of Appearance page;
1038 *It wants the name of new ViewSetting object, and if this
1039 *ViewSetting object supports a backfill;
1040 *The function creates a new 50x50 MUIC_Popimage (a private class
1041 *which is composed by an imagebutton connected to a setting
1042 *window) which has "MSG_SELECT_WORKBENCH_BACKGROUND" as window
1043 *title;
1044 *Image contained in MUIC_Popimage is going to inserted by a call
1045 *WPEditor__MUIM_PrefsEditor_ImportFH() during the initialization
1046 *of WPEditor Zune object and when these objects must be repainted;
1047 *If backfillsupport is TRUE a button labelled "Advanced" is
1048 *created and hooked to WandererPrefs_Hook_CheckImageFunc();
1049 *The new MUIC_Popimage and eventually an "Advanced" button
1050 *are added as attributes to a ViewSetting object, and this last one
1051 *is added as node to the global struct _wpeditor_intern_ViewSettings;
1052 *The function returns the new ViewSetting object or NULL if
1053 *it failed;
1055 struct WPEditor_ViewSettingsObject *WPEditor__NewViewSettingObjects(char * this_Name, BOOL backfillsupport)
1057 struct WPEditor_ViewSettingsObject *_viewSettings_Current = NULL;
1059 D(bug("[WPEditor] WPEditor__NewViewSettingObjects('%s')\n", this_Name));
1060 _viewSettings_Current = AllocMem(sizeof(struct WPEditor_ViewSettingsObject), MEMF_ANY|MEMF_CLEAR);
1061 if (_viewSettings_Current)
1063 _viewSettings_Current->wpedbo_ViewName = AllocVec(strlen(this_Name) + 1, MEMF_ANY|MEMF_CLEAR);
1064 if (_viewSettings_Current->wpedbo_ViewName)
1066 strcpy(_viewSettings_Current->wpedbo_ViewName, this_Name);
1068 _viewSettings_Current->wpedbo_ImageSpecObject = PopimageObject,
1069 MUIA_FixWidth, 50,
1070 MUIA_FixHeight, 50,
1071 MUIA_Window_Title, __(MSG_SELECT_WORKBENCH_BACKGROUND),
1072 MUIA_Imageadjust_Type, MUIV_Imageadjust_Type_Background,
1073 MUIA_CycleChain, 1,
1074 End;
1076 if (_viewSettings_Current->wpedbo_ImageSpecObject)
1078 if (backfillsupport)
1079 _viewSettings_Current->wpedbo_AdvancedOptionsObject = SimpleButton("Advanced");
1081 _viewSettings_Current->wpedbo_Hook_CheckImage.h_Entry = ( HOOKFUNC )WandererPrefs_Hook_CheckImageFunc;
1082 AddTail(&_wpeditor_intern_ViewSettings, &_viewSettings_Current->wpedbo_Node);
1083 D(bug("[WPEditor] WPEditor__NewViewSettingObjects: Successfully created\n"));
1084 return _viewSettings_Current;
1086 FreeVec(_viewSettings_Current->wpedbo_ViewName);
1089 FreeMem(_viewSettings_Current, sizeof(struct WPEditor_ViewSettingsObject));
1090 _viewSettings_Current = NULL;
1092 D(bug("[WPEditor] WPEditor__NewViewSettingObjects: Failed to create objects\n"));
1094 return NULL;
1097 /*** Methods ****************************************************************/
1098 Object *WPEditor__OM_NEW(Class *CLASS, Object *self, struct opSet *message)
1100 struct WPEditor_DATA *data = NULL;
1101 struct WPEditor_AdvancedBackgroundWindow_DATA *advancedView_data = NULL;
1103 Object *_WP_Navigation_HGrp1 = NULL,
1104 *_WP_Navigation_InnerHGrp1 = NULL,
1105 *_WP_Navigation_TypeObj = NULL,
1106 *_WP_Navigation_InnerHGrp2 = NULL,
1107 #if defined(DEBUG_CHANGESCREENTITLE)
1108 *_WP_Navigation_HGrp2 =NULL,
1109 *_WP_Navigation_InnerHGrp3 = NULL,
1110 *_WP_Navigator_ScreenTitleObj = NULL,
1111 #endif
1112 *_WP_NavigationObj = NULL,
1113 *_WP_Appearance_GroupObj = NULL,
1114 *_WP_ViewSettings_GroupObj = NULL,
1115 *_WP_ViewSettings_SpacerObj = NULL,
1116 *_WP_ViewSettings_VirtGrpObj = NULL,
1117 *_WP_ViewSettings_ScrollGrpObj = NULL,
1118 #if defined(DEBUG_NETWORKBROWSER)
1119 *_WP_NetworkBrowser_EnabledObj = NULL,
1120 #endif
1121 #if defined(DEBUG_SHOWUSERFILES)
1122 *_WP_UserFiles_ShowFileFolderObj = NULL,
1123 #endif
1124 *_WP_Toolbar_EnabledObj = NULL,
1125 *_WP_Toolbar_GroupObj = NULL,
1126 *_WP_Toolbar_InnerGroupObj1 = NULL,
1127 *_WP_Toolbar_InnerGroupObj2 = NULL,
1128 *_WP_Toolbar_InnerGroupObj3 = NULL,
1129 *_WP_Toolbar_InnerGroupObj4 = NULL,
1130 *_WP_Toolbar_PreviewObj = NULL,
1131 *_WP_Toolbar_PreviewDirUpObj = NULL,
1132 *_WP_Toolbar_PreviewSearchObj = NULL,
1133 *_WP_Prefs_PageGroupObj = NULL;
1135 Object *_WP_AdvancedViewWindow = NULL,
1136 *_WP_AdvancedViewWindowVGrp = NULL,
1137 *_WP_AdvancedViewBackgroundGrpObj = NULL,
1138 *_WP_AdvancedViewRenderModeGrpObj = NULL,
1139 *_WP_AdvancedViewRenderModeObj = NULL,
1140 *_WP_AdvancedView_RenderModePageObj = NULL,
1141 *_WP_AdvancedView_ScaleModeGrpObj = NULL,
1142 *_WP_AdvancedView_TileModeGrpObj = NULL,
1143 *_WP_AdvancedView_TileModeObjContainer = NULL,
1144 *_WP_AdvancedView_TileModeObj = NULL,
1145 *_WP_AdvancedView_X_OffsetObj = NULL,
1146 *_WP_AdvancedView_Y_OffsetObj = NULL,
1147 *_WP_AdvancedView_IconRenderGrpObj = NULL,
1148 *_WP_AdvancedView_Icon_ListModeObj = NULL,
1149 *_WP_AdvancedView_Icon_TextModeObj = NULL,
1150 *_WP_AdvancedView_Icon_HorSpacingObj = NULL,
1151 *_WP_AdvancedView_Icon_VertSpacingObj = NULL,
1152 *_WP_AdvancedView_Icon_ImageSpacingObj = NULL,
1153 *_WP_AdvancedView_IconLabel_LabelFontObj = NULL,
1154 *_WP_AdvancedView_IconLabel_InfoFontObj = NULL,
1155 *_WP_AdvancedView_IconLabel_MaxLineLenObj = NULL,
1156 #if defined(DEBUG_MULTLINE)
1157 *_WP_AdvancedView_IconLabel_TextMultiLineObj = NULL,
1158 *_WP_AdvancedView_IconLabel_MultiLineonFocusObj = NULL,
1159 *_WP_AdvancedView_IconLabel_MultiLineNoObj = NULL,
1160 #endif
1161 *_WP_AdvancedView_IconLabel_HorPaddObj = NULL,
1162 *_WP_AdvancedView_IconLabel_VertPaddObj = NULL,
1163 *_WP_AdvancedView_IconLabel_BorderWidthObj = NULL,
1164 *_WP_AdvancedView_IconLabel_BorderHeightObj = NULL,
1165 *_WP_AdvancedView_ButtonGrpObj = NULL,
1166 *_WP_AdvancedView_ButtonObj_Use = NULL,
1167 *_WP_AdvancedView_ButtonObj_Cancel = NULL;
1169 /**/
1170 D(bug("[WPEditor] WPEditor__OM_NEW()\n"));
1172 //Object *cm_searchenabled;
1174 /*main window----------------------------------------------------------------*/
1175 /*self : Window?-------------------------------------------------------------*/
1177 self = (Object *) DoSuperNewTags
1179 CLASS, self, NULL,
1180 MUIA_PrefsEditor_Name, __(MSG_NAME),
1181 MUIA_PrefsEditor_Path, (IPTR) "SYS/Wanderer.prefs",
1182 TAG_DONE
1185 /*END self-------------------------------------------------------------------*/
1187 /*_WP_Prefs_PageGroupObj = Object for handling multi (3) page groups---------*/
1188 _wpeditor_intern_MainPageNames[WPD_GENERAL] = (STRPTR)_(MSG_GENERAL);
1189 _wpeditor_intern_MainPageNames[WPD_APPEARANCE] = (STRPTR)_(MSG_APPEARANCE);
1190 _wpeditor_intern_MainPageNames[WPD_TOOLBAR] = (STRPTR)_(MSG_TOOLBAR);
1192 _WP_Prefs_PageGroupObj = RegisterObject,
1193 MUIA_Register_Titles, (IPTR) _wpeditor_intern_MainPageNames,
1194 End;
1195 /*END _WP_Prefs_PageGroupObj-------------------------------------------------*/
1197 /*_WP_NavigationObj: "Navigation" page group---------------------------------*/
1199 _WP_NavigationObj = GroupObject, End;
1201 _WP_Navigation_HGrp1 = HGroup, // general
1202 MUIA_FrameTitle, __(MSG_NAVIGATION),
1203 MUIA_Group_SameSize, TRUE,
1204 MUIA_Frame, MUIV_Frame_Group,
1205 MUIA_Group_Columns, 2,
1206 End;
1208 _WP_Navigation_InnerHGrp1 = HGroup,
1209 MUIA_Group_Columns, 2,
1210 MUIA_Group_SameSize, FALSE,
1211 Child, (IPTR) Label1(_(MSG_METHOD)),
1212 End;
1214 /*Navigation cycle button--------------------*/
1215 _wpeditor_intern_NavigationModes[WPD_NAVIGATION_CLASSIC] = (STRPTR)_(MSG_CLASSIC);
1216 _wpeditor_intern_NavigationModes[WPD_NAVIGATION_ENHANCED] = (STRPTR)_(MSG_ENHANCED);
1217 _WP_Navigation_TypeObj = MUI_MakeObject(MUIO_Cycle, NULL, _wpeditor_intern_NavigationModes);
1219 /*END Navigation cycle button----------------*/
1220 _WP_Navigation_InnerHGrp2 = HGroup,
1221 MUIA_Group_Columns, 2,
1222 MUIA_Group_SameSize, FALSE,
1223 End;
1225 #if defined(DEBUG_SHOWUSERFILES)
1226 _WP_UserFiles_ShowFileFolderObj = MUI_MakeObject(MUIO_Checkmark,NULL);
1227 #endif
1229 #if defined(DEBUG_CHANGESCREENTITLE)
1230 _WP_Navigation_HGrp2 = HGroup,
1231 MUIA_FrameTitle, "Wanderer ScreenTitle",
1232 MUIA_Group_SameSize, TRUE,
1233 MUIA_Frame, MUIV_Frame_Group,
1234 End;
1236 _WP_Navigation_InnerHGrp3 = HGroup, End;
1238 _WP_Navigator_ScreenTitleObj = StringObject,
1239 StringFrame,
1240 MUIA_String_MaxLen, 256,
1241 //MUIA_String_Contents, (IPTR)" ",
1242 End;
1243 #endif
1244 /*END _WP_NavigationObj------------------------------------------------------*/
1246 /*_WP_Appearance_GroupObj: "Appearance" page group---------------------------*/
1248 _WP_Appearance_GroupObj= GroupObject, // appearance
1249 MUIA_Group_SameSize, FALSE,
1250 MUIA_Group_Horiz, TRUE,
1251 End;
1253 /*Left part of Appearance*/
1254 _WP_ViewSettings_ScrollGrpObj = ScrollgroupObject,
1255 MUIA_Group_SameSize, FALSE,
1256 MUIA_Scrollgroup_FreeHoriz, FALSE,
1257 MUIA_Scrollgroup_FreeVert, TRUE,
1258 MUIA_Scrollgroup_Contents,
1259 (IPTR) (_WP_ViewSettings_VirtGrpObj = VirtgroupObject,
1260 MUIA_FrameTitle, (IPTR)"View Settings",
1261 MUIA_Frame, MUIV_Frame_ReadList,
1262 MUIA_Virtgroup_Input, FALSE,
1263 End),
1264 End;
1266 /*_WP_ViewSettings_GroupObj is going to contain nodes
1267 of list called _wpeditor_intern_ViewSettings,
1268 it's created after in this function...;
1270 _WP_ViewSettings_GroupObj = GroupObject,
1271 MUIA_Background, MUII_SHINE,
1272 Child, (IPTR) (_WP_ViewSettings_SpacerObj = HVSpace),
1273 End;
1274 /**/
1276 /*END _WP_Appearance_GroupObj------------------------------------------------*/
1278 /*_WP_Toolbar_GroupObj: "Toolbar" page group---------------------------------*/
1280 _WP_Toolbar_GroupObj = GroupObject, // toolbar
1281 MUIA_Group_SameSize, FALSE,
1282 End;
1284 _WP_Toolbar_InnerGroupObj1 = HGroup,
1285 MUIA_FrameTitle, __(MSG_OBJECTS),
1286 MUIA_Group_SameSize, TRUE,
1287 MUIA_Frame, MUIV_Frame_Group,
1288 MUIA_Group_Columns, 2,
1289 End;
1291 _WP_Toolbar_InnerGroupObj2 = HGroup,
1292 MUIA_Group_Columns, 2,
1293 MUIA_Group_SameSize, FALSE,
1294 Child, (IPTR)Label1(_(MSG_TOOLBAR_ENABLED)),
1295 End;
1297 _WP_Toolbar_EnabledObj = MUI_MakeObject(MUIO_Checkmark, NULL);
1299 _WP_Toolbar_InnerGroupObj3 = HGroup,
1300 MUIA_Group_Columns, 2,
1301 MUIA_Group_SameSize, FALSE,
1302 Child, (IPTR) HVSpace,
1303 Child, (IPTR) HVSpace,
1304 Child, (IPTR) HVSpace,
1305 Child, (IPTR) HVSpace,
1306 End;
1308 _WP_Toolbar_PreviewObj = HGroup,
1309 MUIA_FrameTitle, __(MSG_PREVIEW),
1310 MUIA_Frame, MUIV_Frame_Group,
1311 MUIA_Group_SameSize, FALSE,
1312 End;
1314 _WP_Toolbar_InnerGroupObj4 = HGroup,
1315 MUIA_HorizWeight, 0,
1316 MUIA_Group_SameSize, TRUE,
1317 End;
1319 _WP_Toolbar_PreviewDirUpObj = ImageButton("", "THEME:Images/Gadgets/Prefs/Revert");
1320 _WP_Toolbar_PreviewSearchObj = ImageButton("", "THEME:Images/Gadgets/Prefs/Test");
1321 /*END _WP_Toolbar_GroupObj---------------------------------------------------*/
1323 /*Add main objects to main window (self?)------------------------------------*/
1325 /*Add navigation Objects to Navigation page*/
1327 DoMethod(_WP_Navigation_InnerHGrp1, OM_ADDMEMBER,_WP_Navigation_TypeObj);
1328 DoMethod(_WP_Navigation_InnerHGrp1, OM_ADDMEMBER,HVSpace);
1329 DoMethod(_WP_Navigation_InnerHGrp1, OM_ADDMEMBER,HVSpace);
1330 #if defined(DEBUG_NETWORKBROWSER)
1331 _WP_NetworkBrowser_EnabledObj = MUI_MakeObject(MUIO_Checkmark, NULL);
1332 DoMethod(_WP_Navigation_InnerHGrp2, OM_ADDMEMBER,Label1("Network Browser on Workbench"));
1333 DoMethod(_WP_Navigation_InnerHGrp2, OM_ADDMEMBER,_WP_NetworkBrowser_EnabledObj);
1334 #else
1335 DoMethod(_WP_Navigation_InnerHGrp2, OM_ADDMEMBER,HVSpace);
1336 DoMethod(_WP_Navigation_InnerHGrp2, OM_ADDMEMBER,HVSpace);
1337 #endif
1338 #if defined(DEBUG_SHOWUSERFILES)
1339 DoMethod(_WP_Navigation_InnerHGrp2, OM_ADDMEMBER,Label1("User Files Folder on Workbench"));
1340 DoMethod(_WP_Navigation_InnerHGrp2, OM_ADDMEMBER,_WP_UserFiles_ShowFileFolderObj);
1341 #else
1342 DoMethod(_WP_Navigation_InnerHGrp2, OM_ADDMEMBER,HVSpace);
1343 DoMethod(_WP_Navigation_InnerHGrp2, OM_ADDMEMBER,HVSpace);
1344 #endif
1345 DoMethod(_WP_Navigation_InnerHGrp2, OM_ADDMEMBER,HVSpace);
1346 DoMethod(_WP_Navigation_InnerHGrp2, OM_ADDMEMBER,HVSpace);
1348 #if defined(DEBUG_CHANGESCREENTITLE)
1349 DoMethod(_WP_Navigator_ScreenTitleObj,MUIM_Set, MUIA_ShortHelp,_(MSG_BUBBLESCREENTITLE));
1350 DoMethod(_WP_Navigation_InnerHGrp3, OM_ADDMEMBER,_WP_Navigator_ScreenTitleObj);
1351 DoMethod(_WP_Navigation_HGrp2, OM_ADDMEMBER,_WP_Navigation_InnerHGrp3);
1352 #endif
1354 DoMethod(_WP_Navigation_HGrp1, OM_ADDMEMBER,_WP_Navigation_InnerHGrp1);
1355 DoMethod(_WP_Navigation_HGrp1, OM_ADDMEMBER,_WP_Navigation_InnerHGrp2);
1357 DoMethod(_WP_NavigationObj, OM_ADDMEMBER,_WP_Navigation_HGrp1);
1358 #if defined(DEBUG_CHANGESCREENTITLE)
1359 DoMethod(_WP_NavigationObj, OM_ADDMEMBER,_WP_Navigation_HGrp2);
1360 #endif
1361 /**/
1363 /*Add appearance Objects to Appearance page*/
1364 /*Add objects which are contain into right part*/
1365 /*Add objects which are contain into left part*/
1366 DoMethod(_WP_ViewSettings_VirtGrpObj, OM_ADDMEMBER,_WP_ViewSettings_GroupObj);
1367 /**/
1369 DoMethod(_WP_Appearance_GroupObj, OM_ADDMEMBER,_WP_ViewSettings_ScrollGrpObj);
1370 /**/
1372 /*Add toolbar Objects to Toolbar page*/
1373 DoMethod(_WP_Toolbar_InnerGroupObj4, OM_ADDMEMBER,_WP_Toolbar_PreviewDirUpObj);
1374 DoMethod(_WP_Toolbar_InnerGroupObj4, OM_ADDMEMBER,_WP_Toolbar_PreviewSearchObj);
1376 DoMethod(_WP_Toolbar_PreviewObj, OM_ADDMEMBER,HVSpace);
1377 DoMethod(_WP_Toolbar_PreviewObj, OM_ADDMEMBER, _WP_Toolbar_InnerGroupObj4);
1379 DoMethod(_WP_Toolbar_InnerGroupObj2 , OM_ADDMEMBER,_WP_Toolbar_EnabledObj);
1380 DoMethod(_WP_Toolbar_InnerGroupObj2 , OM_ADDMEMBER,HVSpace);
1381 DoMethod(_WP_Toolbar_InnerGroupObj2 , OM_ADDMEMBER,HVSpace);
1383 DoMethod(_WP_Toolbar_InnerGroupObj1 , OM_ADDMEMBER,_WP_Toolbar_InnerGroupObj2);
1384 DoMethod(_WP_Toolbar_InnerGroupObj1 , OM_ADDMEMBER,_WP_Toolbar_InnerGroupObj3);
1387 DoMethod(_WP_Toolbar_GroupObj, OM_ADDMEMBER,_WP_Toolbar_InnerGroupObj1);
1388 DoMethod(_WP_Toolbar_GroupObj, OM_ADDMEMBER,_WP_Toolbar_PreviewObj);
1389 /**/
1391 DoMethod(_WP_Prefs_PageGroupObj, OM_ADDMEMBER,_WP_NavigationObj);/*add Navigation page to pagesGroup*/
1392 DoMethod(_WP_Prefs_PageGroupObj, OM_ADDMEMBER,_WP_Appearance_GroupObj);/*add Appearance page to pagesGroup*/
1393 DoMethod(_WP_Prefs_PageGroupObj, OM_ADDMEMBER,_WP_Toolbar_GroupObj);/*add Toolbar page to pagesGroup*/
1395 DoMethod(self, OM_ADDMEMBER,_WP_Prefs_PageGroupObj);/*add pagesGroup to self*/
1396 /*END Add main objects to main window (self?)--------------------------------*/
1398 //SET( _WP_Prefs_PageGroupObj, MUIA_Group_ActivePage, 1); //Goto the Appearance page by default..
1400 /*END main window------------------------------------------------------------*/
1402 /*AdvancedViewWindow---------------------------------------------------------*/
1404 /*Window-------------------------------------------------------------*/
1405 _WP_AdvancedViewWindow = WindowObject,
1406 MUIA_Window_CloseGadget, FALSE,
1407 MUIA_Window_Title, (IPTR)"Advanced Options ..",
1408 WindowContents, (IPTR) (_WP_AdvancedViewWindowVGrp = VGroup, End),
1409 End;
1411 /*Draw Mode Group----------------------------------------------------*/
1412 _WP_AdvancedViewBackgroundGrpObj = VGroup,
1413 MUIA_FrameTitle, "Background Options ..",
1414 MUIA_Frame, MUIV_Frame_Group,
1415 End;
1417 _WP_AdvancedViewRenderModeGrpObj = HGroup,
1418 Child, (IPTR) Label1("Draw Mode : "), End;
1420 /*AdvancedViewRenderMode cycle button------------------------*/
1421 _WP_AdvancedViewRenderModeObj = HVSpace;
1423 /*END AdvancedViewRenderMode cycle button------------------------*/
1424 /*END Draw Mode Group------------------------------------------------*/
1426 /*Scale Mode/Tile Mode Group-----------------------------------------*/
1427 _WP_AdvancedView_RenderModePageObj = GroupObject,
1428 MUIA_Group_PageMode, TRUE,
1429 End;
1431 _WP_AdvancedView_ScaleModeGrpObj = GroupObject,
1432 MUIA_Group_SameSize, FALSE,
1433 MUIA_FrameTitle, "Scale Mode Options ..",
1434 MUIA_Frame, MUIV_Frame_Group,
1435 Child, HVSpace,
1436 End;
1438 /*AdvancedView_TileModeNames cicle button--------------------*/
1439 _WP_AdvancedView_TileModeObj = HVSpace;
1440 _WP_AdvancedView_TileModeObjContainer = HGroup, Child, (IPTR)_WP_AdvancedView_TileModeObj, End;
1441 /*END AdvancedView_TileModeNames cicle button----------------*/
1443 _WP_AdvancedView_TileModeGrpObj = GroupObject,
1444 MUIA_Group_SameSize, FALSE,
1445 MUIA_FrameTitle, "Tile Mode Options ..",
1446 MUIA_Frame, MUIV_Frame_Group,
1447 MUIA_Group_Columns, 2,
1448 End;
1450 _WP_AdvancedView_X_OffsetObj = StringObject,
1451 StringFrame,
1452 MUIA_String_MaxLen, 3,
1453 MUIA_String_Accept, "0123456789",
1454 End;
1456 _WP_AdvancedView_Y_OffsetObj = StringObject,
1457 StringFrame,
1458 MUIA_String_MaxLen, 3,
1459 MUIA_String_Accept, "0123456789",
1460 End;
1462 /*END Scale Mode/Tile Mode Group-------------------------------------*/
1463 /*Icon List Mode Cycle button------------------------*/
1464 _wpeditor_intern_IconListModeNames[WPD_ICONLISTMODE_GRID] = (STRPTR)_(MSG_ICONLISTMODE_GRID);
1465 _wpeditor_intern_IconListModeIDs[WPD_ICONLISTMODE_GRID] = WPD_ICONLISTMODE_GRID;
1466 _wpeditor_intern_IconListModeNames[WPD_ICONLISTMODE_PLAIN] = (STRPTR)_(MSG_ICONLISTMODE_PLAIN);
1467 _wpeditor_intern_IconListModeIDs[WPD_ICONLISTMODE_PLAIN] = WPD_ICONLISTMODE_PLAIN;
1468 _WP_AdvancedView_Icon_ListModeObj = MUI_MakeObject(MUIO_Cycle, NULL, _wpeditor_intern_IconListModeNames);
1470 _wpeditor_intern_IconTextRenderModeNames[WPD_ICONTEXTMODE_OUTLINE] = (STRPTR)_(MSG_ICONTEXTMODE_OUTLINE);
1471 _wpeditor_intern_IconTextRenderModeIDs[WPD_ICONTEXTMODE_OUTLINE] = WPD_ICONTEXTMODE_OUTLINE;
1472 _wpeditor_intern_IconTextRenderModeNames[WPD_ICONTEXTMODE_PLAIN] = (STRPTR)_(MSG_ICONTEXTMODE_PLAIN);
1473 _wpeditor_intern_IconTextRenderModeIDs[WPD_ICONTEXTMODE_PLAIN] = WPD_ICONTEXTMODE_PLAIN;
1474 _wpeditor_intern_IconTextRenderModeNames[ICON_TEXTMODE_DROPSHADOW] = (STRPTR)"Drop Shadow";
1475 _wpeditor_intern_IconTextRenderModeIDs[ICON_TEXTMODE_DROPSHADOW] = ICON_TEXTMODE_DROPSHADOW;
1477 _WP_AdvancedView_Icon_TextModeObj = MUI_MakeObject(MUIO_Cycle, NULL, _wpeditor_intern_IconTextRenderModeNames);
1479 /*END Icon List Mode Cycle button--------------------*/
1481 _WP_AdvancedView_IconLabel_MaxLineLenObj = StringObject,
1482 StringFrame,
1483 MUIA_String_MaxLen, 3,
1484 MUIA_String_Format, MUIV_String_Format_Right,
1485 MUIA_String_Accept, (IPTR)"0123456789",
1486 End;
1488 _WP_AdvancedView_Icon_HorSpacingObj = StringObject,
1489 StringFrame,
1490 MUIA_String_MaxLen, 3,
1491 MUIA_String_Format, MUIV_String_Format_Right,
1492 MUIA_String_Accept, (IPTR)"0123456789",
1493 End;
1495 _WP_AdvancedView_Icon_VertSpacingObj = StringObject,
1496 StringFrame,
1497 MUIA_String_MaxLen, 3,
1498 MUIA_String_Format, MUIV_String_Format_Right,
1499 MUIA_String_Accept, (IPTR)"0123456789",
1500 End;
1502 _WP_AdvancedView_Icon_ImageSpacingObj = StringObject,
1503 StringFrame,
1504 MUIA_String_MaxLen, 3,
1505 MUIA_String_Format, MUIV_String_Format_Right,
1506 MUIA_String_Accept, (IPTR)"0123456789",
1507 End;
1509 _WP_AdvancedView_IconLabel_LabelFontObj = StringObject,
1510 StringFrame,
1511 MUIA_String_MaxLen, 3,
1512 MUIA_String_Format, MUIV_String_Format_Right,
1513 End;
1515 _WP_AdvancedView_IconLabel_InfoFontObj = StringObject,
1516 StringFrame,
1517 MUIA_String_MaxLen, 3,
1518 MUIA_String_Format, MUIV_String_Format_Right,
1519 End;
1521 #if defined(DEBUG_MULTLINE)
1522 _WP_AdvancedView_IconLabel_MultiLineNoObj = StringObject,
1523 StringFrame,
1524 MUIA_String_MaxLen, 2,
1525 MUIA_String_Format, MUIV_String_Format_Right,
1526 MUIA_String_Accept, (IPTR)"0123456789",
1527 End;
1529 _WP_AdvancedView_IconLabel_TextMultiLineObj = MUI_MakeObject(MUIO_Checkmark, NULL);
1530 _WP_AdvancedView_IconLabel_MultiLineonFocusObj = MUI_MakeObject(MUIO_Checkmark, NULL);
1531 #endif
1532 _WP_AdvancedView_IconLabel_HorPaddObj = StringObject,
1533 StringFrame,
1534 MUIA_String_MaxLen, 3,
1535 MUIA_String_Format, MUIV_String_Format_Right,
1536 MUIA_String_Accept, (IPTR)"0123456789",
1537 End;
1539 _WP_AdvancedView_IconLabel_VertPaddObj = StringObject,
1540 StringFrame,
1541 MUIA_String_MaxLen, 3,
1542 MUIA_String_Format, MUIV_String_Format_Right,
1543 MUIA_String_Accept, (IPTR)"0123456789",
1544 End;
1546 _WP_AdvancedView_IconLabel_BorderWidthObj = StringObject,
1547 StringFrame,
1548 MUIA_String_MaxLen, 3,
1549 MUIA_String_Format, MUIV_String_Format_Right,
1550 MUIA_String_Accept, (IPTR)"0123456789",
1551 End;
1553 _WP_AdvancedView_IconLabel_BorderHeightObj = StringObject,
1554 StringFrame,
1555 MUIA_String_MaxLen, 3,
1556 MUIA_String_Format, MUIV_String_Format_Right,
1557 MUIA_String_Accept, (IPTR)"0123456789",
1558 End;
1560 _WP_AdvancedView_IconRenderGrpObj = GroupObject,
1561 MUIA_Group_SameSize, FALSE,
1562 MUIA_FrameTitle, __(MSG_ICONSPREFS),
1563 MUIA_Frame, MUIV_Frame_Group,
1564 MUIA_Group_Columns, 2,
1565 End;
1566 /*Button Group-------------------------------------------------------*/
1567 _WP_AdvancedView_ButtonGrpObj = HGroup,
1568 Child, _WP_AdvancedView_ButtonObj_Use = ImageButton("Use", "THEME:Images/Gadgets/Prefs/Use"),
1569 Child, _WP_AdvancedView_ButtonObj_Cancel = ImageButton("Cancel", "THEME:Images/Gadgets/Prefs/Cancel"),
1570 End;
1571 /*END Button Group--------------------------------------------------*/
1573 /*END Window--------------------------------------------------------*/
1576 /*Add advanced view objects to AdvancedViewWindow object--------------------*/
1577 DoMethod(_WP_AdvancedViewRenderModeGrpObj, OM_ADDMEMBER,_WP_AdvancedViewRenderModeObj);
1579 DoMethod(_WP_AdvancedView_TileModeGrpObj, OM_ADDMEMBER, Label1("Tile Mode : "));
1580 DoMethod(_WP_AdvancedView_TileModeGrpObj, OM_ADDMEMBER, _WP_AdvancedView_TileModeObjContainer);
1581 DoMethod(_WP_AdvancedView_TileModeGrpObj, OM_ADDMEMBER, Label1("X Offset : "));
1582 DoMethod(_WP_AdvancedView_TileModeGrpObj, OM_ADDMEMBER, _WP_AdvancedView_X_OffsetObj);
1583 DoMethod(_WP_AdvancedView_TileModeGrpObj, OM_ADDMEMBER, Label1("Y Offset : "));
1584 DoMethod(_WP_AdvancedView_TileModeGrpObj, OM_ADDMEMBER, _WP_AdvancedView_Y_OffsetObj);
1586 DoMethod(_WP_AdvancedView_RenderModePageObj, OM_ADDMEMBER, _WP_AdvancedView_ScaleModeGrpObj);
1587 DoMethod(_WP_AdvancedView_RenderModePageObj, OM_ADDMEMBER, _WP_AdvancedView_TileModeGrpObj);
1589 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER,HVSpace);
1590 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER,HVSpace);
1592 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1(_(MSG_ICONLISTMODE)));
1593 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_Icon_ListModeObj);
1594 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, HVSpace);
1595 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, HVSpace);
1596 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1(_(MSG_ICONTEXTMODE)));
1597 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_Icon_TextModeObj);
1599 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER,HVSpace);
1600 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER,HVSpace);
1602 #warning "TODO: Replace with propper font selectors"
1603 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Icon Label Font .."));
1604 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_IconLabel_LabelFontObj);
1605 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Icon Info Font .."));
1606 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_IconLabel_InfoFontObj);
1608 #if !defined(DEBUG_PERVIEWFONTS)
1609 SET(_WP_AdvancedView_IconLabel_LabelFontObj, MUIA_Disabled, TRUE);
1610 SET(_WP_AdvancedView_IconLabel_InfoFontObj, MUIA_Disabled, TRUE);
1611 #endif
1613 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER,HVSpace);
1614 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER,HVSpace);
1616 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Max. Label line length .."));
1617 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_IconLabel_MaxLineLenObj);
1618 #if defined(DEBUG_MULTLINE)
1619 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Use MultiLine Labels "));
1620 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_IconLabel_TextMultiLineObj);
1621 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Only show for Focus(ed) Icon "));
1622 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_IconLabel_MultiLineonFocusObj);
1623 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("No. of lines to display .."));
1624 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_IconLabel_MultiLineNoObj);
1625 #endif
1626 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER,HVSpace);
1627 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER,HVSpace);
1629 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Horizontal Spacing between Icons"));
1630 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_Icon_HorSpacingObj);
1632 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Vertical Spacing between Icons"));
1633 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_Icon_VertSpacingObj);
1635 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Padding between Icon Image and Label"));
1636 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_Icon_ImageSpacingObj);
1638 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Horizontal Padding between Label Frame and Text"));
1639 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_IconLabel_HorPaddObj);
1641 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Vertical Padding between Label Frame and Text"));
1642 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_IconLabel_VertPaddObj);
1644 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Label Frame Width"));
1645 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_IconLabel_BorderWidthObj);
1647 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, Label1("Label Frame Height"));
1648 DoMethod(_WP_AdvancedView_IconRenderGrpObj, OM_ADDMEMBER, _WP_AdvancedView_IconLabel_BorderHeightObj);
1650 DoMethod(_WP_AdvancedViewBackgroundGrpObj, OM_ADDMEMBER,_WP_AdvancedViewRenderModeGrpObj);
1651 DoMethod(_WP_AdvancedViewBackgroundGrpObj, OM_ADDMEMBER,_WP_AdvancedView_RenderModePageObj);
1653 DoMethod(_WP_AdvancedViewWindowVGrp, OM_ADDMEMBER,_WP_AdvancedViewBackgroundGrpObj);
1654 DoMethod(_WP_AdvancedViewWindowVGrp, OM_ADDMEMBER,_WP_AdvancedView_IconRenderGrpObj);
1655 DoMethod(_WP_AdvancedViewWindowVGrp, OM_ADDMEMBER,_WP_AdvancedView_ButtonGrpObj);
1656 /*END Add advanced view objects to AdvancedViewWindow object-----------------*/
1657 /*END AdvancedViewWindow-----------------------------------------------------*/
1659 /*-------------------*/
1660 if ((self != NULL) && (_WP_AdvancedViewWindow != NULL ))
1662 _wpeditor_intern_CLASS = CLASS;
1663 data = INST_DATA(CLASS, self);
1665 D(bug("[WPEditor] WPEditor__OM_NEW: Prefs Object (self) @ 0x%p\n", self));
1667 if ((advancedView_data = AllocMem(sizeof(struct WPEditor_AdvancedBackgroundWindow_DATA), MEMF_CLEAR|MEMF_ANY)) != NULL)
1669 advancedView_data->wpedabwd_Hook_DrawModeChage.h_Entry = (HOOKFUNC) WandererPrefs_Hook_DrawModeChangeFunc;
1671 advancedView_data->wpedabwd_Window_WindowObj = _WP_AdvancedViewWindow;
1672 advancedView_data->wpedabwd_Window_BackgroundGrpObj = _WP_AdvancedViewBackgroundGrpObj;
1673 advancedView_data->wpedabwd_Window_RenderModeGrpObj = _WP_AdvancedViewRenderModeGrpObj ;
1674 advancedView_data->wpedabwd_Window_RenderModeObj = _WP_AdvancedViewRenderModeObj;
1675 advancedView_data->wpedabwd_Window_RenderModePageObj = _WP_AdvancedView_RenderModePageObj;
1676 advancedView_data->wpedabwd_Window_TileModeObjContainer = _WP_AdvancedView_TileModeObjContainer;
1677 advancedView_data->wpedabwd_Window_TileModeObj = _WP_AdvancedView_TileModeObj;
1678 advancedView_data->wpedabwd_Window_XOffsetObj = _WP_AdvancedView_X_OffsetObj;
1679 advancedView_data->wpedabwd_Window_YOffsetObj = _WP_AdvancedView_Y_OffsetObj;
1681 advancedView_data->wpedabwd_Window_Icon_ListMode = _WP_AdvancedView_Icon_ListModeObj;
1682 advancedView_data->wpedabwd_Window_Icon_TextMode = _WP_AdvancedView_Icon_TextModeObj;
1684 advancedView_data->wpedabwd_Window_Icon_HorSpacing = _WP_AdvancedView_Icon_HorSpacingObj;
1685 advancedView_data->wpedabwd_Window_Icon_VertSpacing = _WP_AdvancedView_Icon_VertSpacingObj;
1686 advancedView_data->wpedabwd_Window_Icon_ImageSpacing = _WP_AdvancedView_Icon_ImageSpacingObj;
1688 advancedView_data->wpedabwd_Window_IconLabel_LabelFont = _WP_AdvancedView_IconLabel_LabelFontObj;
1689 advancedView_data->wpedabwd_Window_IconLabel_InfoFont = _WP_AdvancedView_IconLabel_InfoFontObj;
1691 advancedView_data->wpedabwd_Window_IconLabel_MaxLineLen = _WP_AdvancedView_IconLabel_MaxLineLenObj;
1693 #if defined(DEBUG_MULTLINE)
1694 advancedView_data->wpedabwd_Window_IconLabel_TextMultiLine = _WP_AdvancedView_IconLabel_TextMultiLineObj;
1695 advancedView_data->wpedabwd_Window_IconLabel_MultiLineonFocus = _WP_AdvancedView_IconLabel_MultiLineonFocusObj;
1696 advancedView_data->wpedabwd_Window_IconLabel_MultiLineNo = _WP_AdvancedView_IconLabel_MultiLineNoObj;
1697 #endif
1698 advancedView_data->wpedabwd_Window_IconLabel_HorPadd = _WP_AdvancedView_IconLabel_HorPaddObj;
1699 advancedView_data->wpedabwd_Window_IconLabel_VertPadd = _WP_AdvancedView_IconLabel_VertPaddObj;
1700 advancedView_data->wpedabwd_Window_IconLabel_BorderWidth = _WP_AdvancedView_IconLabel_BorderWidthObj;
1701 advancedView_data->wpedabwd_Window_IconLabel_BorderHeight = _WP_AdvancedView_IconLabel_BorderHeightObj;
1703 advancedView_data->wpedabwd_Window_UseObj = _WP_AdvancedView_ButtonObj_Use;
1704 advancedView_data->wpedabwd_Window_CancelObj = _WP_AdvancedView_ButtonObj_Cancel;
1706 NewList(&advancedView_data->wpedabwd_Window_AdvancedViewRenderModes);
1707 EntryElementRegister(&advancedView_data->wpedabwd_Window_AdvancedViewRenderModes, IconWindowExt_ImageBackFill_RenderMode_Tiled, "Tiled");
1708 EntryElementRegister(&advancedView_data->wpedabwd_Window_AdvancedViewRenderModes, IconWindowExt_ImageBackFill_RenderMode_Scale, "Scaled");
1710 NewList(&advancedView_data->wpedabwd_Window_AdvancedViewTileModes);
1711 EntryElementRegister(&advancedView_data->wpedabwd_Window_AdvancedViewTileModes, IconWindowExt_ImageBackFill_TileMode_Float, "Floating");
1712 EntryElementRegister(&advancedView_data->wpedabwd_Window_AdvancedViewTileModes, IconWindowExt_ImageBackFill_TileMode_Fixed, "Fixed");
1714 D(bug("[WPEditor] WPEditor__OM_NEW: 'Advanced' Window Object @ 0x%p\n", advancedView_data->wpedabwd_Window_WindowObj));
1716 data->wped_AdvancedViewSettings_WindowData = advancedView_data;
1718 data->wped_ViewSettings_GroupObj = _WP_ViewSettings_GroupObj;
1719 data->wped_ViewSettings_SpacerObj = _WP_ViewSettings_SpacerObj;
1721 data->wped_c_NavigationMethod = _WP_Navigation_TypeObj;
1722 data->wped_cm_ToolbarEnabled = _WP_Toolbar_EnabledObj;
1723 #if defined(DEBUG_CHANGESCREENTITLE)
1724 data->wped_s_screentitle =_WP_Navigator_ScreenTitleObj;
1725 #endif
1726 #if defined(DEBUG_NETWORKBROWSER)
1727 data->wped_cm_EnableNetworkBrowser = _WP_NetworkBrowser_EnabledObj;
1728 #endif
1729 #if defined(DEBUG_SHOWUSERFILES)
1730 data->wped_cm_EnableUserFiles = _WP_UserFiles_ShowFileFolderObj;
1731 #endif
1733 data->wped_toolbarpreview = _WP_Toolbar_PreviewObj;
1735 data->wped_toolbarGroup = _WP_Toolbar_GroupObj;
1736 data->wped_Hook_CloseAdvancedOptions.h_Entry = ( HOOKFUNC )WandererPrefs_Hook_CloseAdvancedOptionsFunc;
1738 //-- Setup notifications -------------------------------------------
1739 #warning "TODO: The toolbar class will become an external module to wanderer with its own prefs"
1740 #if defined(DEBUG_TOOLBARINTERNAL)
1741 /* Enhanced navigation depends on the toolbar class for
1742 control - so we disable it if the toolbar isnt available! */
1743 DoMethod
1745 data->wped_cm_ToolbarEnabled, MUIM_Notify, MUIA_Selected, FALSE,
1746 (IPTR)data->wped_c_NavigationMethod, 3, MUIM_Set, MUIA_Cycle_Active, 0
1749 DoMethod
1751 data->wped_cm_ToolbarEnabled, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
1752 (IPTR)data->wped_c_NavigationMethod, 3, MUIM_Set, MUIA_Disabled, MUIV_NotTriggerValue
1755 /* Only enable the preview if the toolbar is enabled */
1756 DoMethod
1758 data->wped_cm_ToolbarEnabled, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
1759 (IPTR)data->wped_toolbarpreview, 3, MUIM_Set, MUIA_Disabled, MUIV_NotTriggerValue
1762 DoMethod
1764 data->wped_cm_ToolbarEnabled, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
1765 (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
1768 DoMethod
1770 data->wped_c_NavigationMethod, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime,
1771 (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
1774 #endif
1775 #if defined(DEBUG_NETWORKBROWSER)
1776 DoMethod
1778 data->wped_cm_EnableNetworkBrowser, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
1779 (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
1781 #endif
1782 #if defined(DEBUG_SHOWUSERFILES)
1783 DoMethod
1785 data->wped_cm_EnableUserFiles, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
1786 (IPTR)self, 3, MUIM_Set, MUIA_PrefsEditor_Changed, TRUE
1788 #endif
1790 if (data->wped_AdvancedViewSettings_WindowData)
1792 DoMethod
1794 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineNo, MUIM_Notify, MUIA_Disabled, TRUE,
1795 (IPTR)data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineNo, 3, MUIM_Set, MUIA_String_Integer, 1
1798 DoMethod
1800 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineNo, MUIM_Notify, MUIA_Disabled, FALSE,
1801 (IPTR)data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineNo, 3, MUIM_Set, MUIA_String_Integer, 2
1804 DoMethod
1806 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_TextMultiLine, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
1807 (IPTR)data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_IconLabel_MultiLineNo, 3, MUIM_Set, MUIA_Disabled, MUIV_NotTriggerValue
1811 /*--------------------*/
1813 /*Initialization and setup of _wpeditor_intern_ViewSettings----------*/
1814 /*_wpeditor_intern_ViewSettings is a
1815 list of objects attached to
1816 _WP_ViewSettings_GroupObj;
1818 NewList(&_wpeditor_intern_ViewSettings);
1820 WPEditor__NewViewSettingObjects("Workbench", TRUE);//add a setting node
1821 WPEditor__NewViewSettingObjects("Drawer", TRUE);//add a setting node
1822 #if defined(DEBUG_NEWVIEWSETTINGS)
1823 WPEditor__NewViewSettingObjects("Screen", TRUE);//add a setting node
1824 WPEditor__NewViewSettingObjects("Toolbar", FALSE);//add a setting node
1825 #endif
1827 struct WPEditor_ViewSettingsObject *_viewSettings_Node = NULL;
1829 ForeachNode(&_wpeditor_intern_ViewSettings, _viewSettings_Node)
1831 Object *thisViewImspecGrp = NULL;
1832 Object *thisViewAdvancedGrp = NULL;
1834 D(bug("[WPEditor] WPEditor__OM_NEW: Adding ViewSetting Objects for '%s' to Prefs GUI ..\n", _viewSettings_Node->wpedbo_ViewName));
1836 thisViewImspecGrp = GroupObject,
1837 MUIA_Group_SameSize, FALSE,
1838 MUIA_Frame, MUIV_Frame_None,
1839 MUIA_Group_Columns, 2,
1840 Child, (IPTR) HVSpace,
1841 Child, (IPTR) HVSpace,
1842 Child, (IPTR) Label1(_viewSettings_Node->wpedbo_ViewName),
1843 Child, (IPTR) _viewSettings_Node->wpedbo_ImageSpecObject,
1844 Child, (IPTR) HVSpace,
1845 Child, (IPTR) HVSpace,
1846 End;
1848 if ((thisViewImspecGrp) && (data->wped_FirstBGImSpecObj == NULL))
1849 data->wped_FirstBGImSpecObj = thisViewImspecGrp;
1851 if (_viewSettings_Node->wpedbo_AdvancedOptionsObject)
1853 thisViewAdvancedGrp = GroupObject,
1854 MUIA_Group_SameSize, FALSE,
1855 MUIA_Frame, MUIV_Frame_None,
1856 MUIA_Group_Columns, 2,
1857 Child, (IPTR) HVSpace,
1858 Child, (IPTR) _viewSettings_Node->wpedbo_AdvancedOptionsObject,
1859 End;
1861 if ((thisViewAdvancedGrp) && (data->wped_FirstBGAdvancedObj == NULL))
1862 data->wped_FirstBGAdvancedObj = thisViewAdvancedGrp;
1865 if ((thisViewImspecGrp) &&
1866 ((!(_viewSettings_Node->wpedbo_AdvancedOptionsObject)) ||
1867 ((_viewSettings_Node->wpedbo_AdvancedOptionsObject) && (thisViewAdvancedGrp))))
1869 D(bug("[WPEditor] WPEditor__OM_NEW: GUI Objects Created ..\n"));
1871 if (DoMethod(_WP_ViewSettings_GroupObj, MUIM_Group_InitChange))
1873 DoMethod(_WP_ViewSettings_GroupObj, OM_ADDMEMBER, thisViewImspecGrp);
1875 if (_viewSettings_Node->wpedbo_AdvancedOptionsObject)
1876 DoMethod(_WP_ViewSettings_GroupObj, OM_ADDMEMBER, thisViewAdvancedGrp);
1878 DoMethod(_WP_ViewSettings_GroupObj, MUIM_Group_ExitChange);
1881 D(bug("[WPEditor] WPEditor__OM_NEW: GUI Objects inserted in Prefs GUI ..\n"));
1882 /* Set our ViewSetting(s) notifications */
1883 DoMethod
1885 _viewSettings_Node->wpedbo_ImageSpecObject,
1886 MUIM_Notify, MUIA_Imagedisplay_Spec, MUIV_EveryTime,
1887 (IPTR)self, 3, MUIM_CallHook,
1888 &_viewSettings_Node->wpedbo_Hook_CheckImage, _viewSettings_Node
1891 if (_viewSettings_Node->wpedbo_AdvancedOptionsObject)
1893 _viewSettings_Node->wpedbo_Hook_OpenAdvancedOptions.h_Entry = ( HOOKFUNC )WandererPrefs_Hook_OpenAdvancedOptionsFunc;
1895 DoMethod
1897 _viewSettings_Node->wpedbo_AdvancedOptionsObject, MUIM_Notify, MUIA_Pressed, FALSE,
1898 (IPTR)self, 3, MUIM_CallHook, &_viewSettings_Node->wpedbo_Hook_OpenAdvancedOptions, _viewSettings_Node
1901 D(bug("[WPEditor] WPEditor__OM_NEW: GUI Objects Notifications set ..\n"));
1903 else
1905 D(bug("[WPEditor] WPEditor__OM_NEW: Failed to create objects ..\n"));
1906 if (thisViewAdvancedGrp) DoMethod(thisViewAdvancedGrp, OM_DISPOSE);
1908 if (thisViewImspecGrp) DoMethod(thisViewImspecGrp, OM_DISPOSE);
1912 else
1914 D(bug("[WPEditor] WPEditor__OM_NEW: Failed to create GUI ..\n"));
1915 if (advancedView_data->wpedabwd_Window_WindowObj) DoMethod(advancedView_data->wpedabwd_Window_WindowObj, OM_DISPOSE);
1916 if (self) DoMethod(self, OM_DISPOSE);
1918 self = NULL;
1920 /*--------------*/
1922 return self;
1926 /*BOOL WPEditor_ProccessGlobalChunk(): read a TagItem global_chunk (from global setting)
1927 *and memorize its value into correspondent attribute of an object of the gui...;
1929 BOOL WPEditor_ProccessGlobalChunk(Class *CLASS, Object *self, struct TagItem32 *global_chunk, IPTR chunk_size)
1931 SETUP_WPEDITOR_INST_DATA;
1933 int i = 0, tag_count = (chunk_size / sizeof(struct TagItem32));
1934 BOOL cont = TRUE;
1935 //BOOL state = FALSE;
1937 D(bug("[WPEditor] WPEditor_ProccessGlobalChunk(%d tags)\n", tag_count));
1939 for (i = 0; i < tag_count; i++)
1941 if (cont)
1943 /* prefs file is stored in little endian */
1944 switch ((int)AROS_LE2LONG(global_chunk[i].ti_Tag))
1946 case MUIA_IconWindowExt_Toolbar_Enabled:
1948 D(bug("[WPEditor] WPEditor_ProccessGlobalChunk: Tag %d = MUIA_IconWindowExt_Toolbar_Enabled, val = %d\n", i, AROS_LE2LONG(global_chunk[i].ti_Data)));
1949 SET(data->wped_cm_ToolbarEnabled, MUIA_Selected, (BOOL)AROS_LE2LONG(global_chunk[i].ti_Data));
1950 break;
1952 case MUIA_IconWindowExt_Toolbar_NavigationMethod:
1954 D(bug("[WPEditor] WPEditor_ProccessGlobalChunk: Tag %d = MUIA_IconWindowExt_Toolbar_NavigationMethod, val = %d\n", i, AROS_LE2LONG(global_chunk[i].ti_Data)));
1955 SET(data->wped_c_NavigationMethod, MUIA_Cycle_Active, (IPTR)AROS_LE2LONG(global_chunk[i].ti_Data));
1956 break;
1958 #if defined(DEBUG_SHOWUSERFILES)
1959 case MUIA_IconWindowExt_UserFiles_ShowFilesFolder:
1961 D(bug("[WPEditor] WPEditor_ProccessGlobalChunk: Tag %d = MUIA_IconWindowExt_UserFiles_ShowFilesFolder, val = %d\n", i, AROS_LE2LONG(global_chunk[i].ti_Data)));
1962 SET(data->wped_cm_EnableUserFiles, MUIA_Selected, (BOOL)AROS_LE2LONG(global_chunk[i].ti_Data));
1963 break;
1965 #endif
1966 case TAG_DONE:
1968 D(bug("[WPEditor] WPEditor_ProccessGlobalChunk: Tag %d = TAG_DONE!!\n", i));
1969 cont = FALSE;
1970 break;
1976 return TRUE;
1979 #if defined(DEBUG_NETWORKBROWSER)
1980 BOOL WPEditor_ProccessNetworkChunk(Class *CLASS, Object *self, UBYTE *_viewSettings_Chunk)
1982 SETUP_WPEDITOR_INST_DATA;
1984 struct TagItem32 *network_tags = _viewSettings_Chunk;
1985 SET(data->wped_cm_EnableNetworkBrowser, MUIA_Selected, AROS_LE2LONG(network_tags[0].ti_Data));
1987 return TRUE;
1989 #endif
1991 #if defined(DEBUG_CHANGESCREENTITLE)
1992 BOOL WPEditor_ProccessScreenTitleChunk(Class *CLASS, Object *self, UBYTE *_ScreenTitle_Chunk)
1994 SETUP_WPEDITOR_INST_DATA;
1997 D(bug("[WPEditor] WPEditor_ProccessScreenTitleChunk: string readed = %s\n", _ScreenTitle_Chunk));
1998 SET(data->wped_s_screentitle, MUIA_String_Contents, _ScreenTitle_Chunk);
1999 D(bug("[WPEditor] WPEditor_ProccessScreenTitleChunk: string setted = %s\n", _ScreenTitle_Chunk));
2001 return TRUE;
2003 #endif
2005 /*Renabled WPEditor_ProccessViewSettingsChunk() as Nic Andrews (nicja@yahoo.com) has asked...;
2006 *Please report here what do it do this function ;)
2009 BOOL WPEditor_ProccessViewSettingsChunk(Class *CLASS, Object *self, char *_viewSettings_Name, UBYTE *_viewSettings_Chunk, IPTR chunk_size)
2011 SETUP_WPEDITOR_INST_DATA;
2013 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk('%s')\n", _viewSettings_Name));
2014 //BOOL _viewSettings_NodeFound = FALSE;//unused
2015 struct WPEditor_ViewSettingsObject *_viewSettings_Node = NULL;
2017 _viewSettings_Node = WPEditor__FindViewSettingObjects(_viewSettings_Name);
2019 if (_viewSettings_Node)
2021 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Updating Existing node @ 0x%p\n", _viewSettings_Node));
2023 else
2025 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Creating new Objects for '%s'\n", _viewSettings_Name));
2026 if (((strcmp(_viewSettings_Name, "Workbench")) == 0) ||
2027 ((strcmp(_viewSettings_Name, "Drawer")) == 0) ||
2028 ((strcmp(_viewSettings_Name, "Screen")) == 0))
2029 _viewSettings_Node = WPEditor__NewViewSettingObjects(_viewSettings_Name, TRUE);
2030 else
2031 _viewSettings_Node = WPEditor__NewViewSettingObjects(_viewSettings_Name, FALSE);
2033 Object *thisViewImspecGrp = NULL;
2034 Object *thisViewAdvancedGrp = NULL;
2036 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Adding ViewSetting Objects for '%s' to Prefs GUI ..\n", _viewSettings_Node->wpedbo_ViewName));
2038 thisViewImspecGrp = GroupObject,
2039 MUIA_Group_SameSize, FALSE,
2040 MUIA_Frame, MUIV_Frame_None,
2041 MUIA_Group_Columns, 2,
2043 Child, (IPTR) HVSpace,
2044 Child, (IPTR) HVSpace,
2046 Child, (IPTR) Label1(_viewSettings_Node->wpedbo_ViewName),
2047 Child, (IPTR) _viewSettings_Node->wpedbo_ImageSpecObject,
2048 Child, (IPTR) HVSpace,
2049 Child, (IPTR) HVSpace,
2050 End;
2052 if (_viewSettings_Node->wpedbo_AdvancedOptionsObject)
2053 thisViewAdvancedGrp = GroupObject,
2054 MUIA_Group_SameSize, FALSE,
2055 MUIA_Frame, MUIV_Frame_None,
2056 MUIA_Group_Columns, 2,
2058 Child, (IPTR) HVSpace,
2059 Child, (IPTR) _viewSettings_Node->wpedbo_AdvancedOptionsObject,
2060 End;
2062 if ((thisViewImspecGrp) &&
2063 ((!(_viewSettings_Node->wpedbo_AdvancedOptionsObject)) ||
2064 ((_viewSettings_Node->wpedbo_AdvancedOptionsObject) && (thisViewAdvancedGrp))))
2066 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: GUI Objects Created ..\n"));
2068 if (DoMethod(data->wped_ViewSettings_GroupObj, MUIM_Group_InitChange))
2070 DoMethod(data->wped_ViewSettings_GroupObj, OM_ADDMEMBER, thisViewImspecGrp);
2072 if (_viewSettings_Node->wpedbo_AdvancedOptionsObject)
2073 DoMethod(data->wped_ViewSettings_GroupObj, OM_ADDMEMBER, thisViewAdvancedGrp);
2075 DoMethod(data->wped_ViewSettings_GroupObj, MUIM_Group_ExitChange);
2078 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: GUI Objects inserted in Prefs GUI ..\n"));
2080 DoMethod (
2081 _viewSettings_Node->wpedbo_ImageSpecObject,
2082 MUIM_Notify, MUIA_Imagedisplay_Spec, MUIV_EveryTime,
2083 (IPTR)self, 3, MUIM_CallHook,
2084 &_viewSettings_Node->wpedbo_Hook_CheckImage, _viewSettings_Node
2087 if (_viewSettings_Node->wpedbo_AdvancedOptionsObject)
2088 DoMethod (
2089 _viewSettings_Node->wpedbo_AdvancedOptionsObject, MUIM_Notify, MUIA_Pressed, FALSE,
2090 (IPTR)data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_WindowObj, 3, MUIM_Set, MUIA_Window_Open, TRUE
2093 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: GUI Objects Notifications set ..\n"));
2095 else
2097 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Failed to create objects ..\n"));
2098 if (thisViewAdvancedGrp) DoMethod(thisViewAdvancedGrp, OM_DISPOSE);
2100 if (thisViewImspecGrp) DoMethod(thisViewImspecGrp, OM_DISPOSE);
2104 if ((_viewSettings_Node->wpedbo_AdvancedOptionsObject) && (chunk_size > (strlen(_viewSettings_Chunk) + 1)))
2106 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Chunk has options Tag data ..\n"));
2107 UBYTE _viewSettings_TagOffset = ((strlen(_viewSettings_Chunk) + 1)/4);
2109 if ((_viewSettings_TagOffset * 4) != (strlen(_viewSettings_Chunk) + 1))
2111 _viewSettings_TagOffset = (_viewSettings_TagOffset + 1) * 4;
2112 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: String length unalined - rounding up (length %d, rounded %d) \n", strlen(_viewSettings_Chunk) + 1, _viewSettings_TagOffset ));
2114 else
2116 _viewSettings_TagOffset = _viewSettings_TagOffset * 4;
2117 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: String length doesnt need aligned (length %d) \n", strlen(_viewSettings_Chunk) + 1));
2120 if (_viewSettings_Node->wpedbo_Options)
2122 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Freeing old ViewSetting Tag data @ 0x%p\n", _viewSettings_Node->wpedbo_Options));
2123 FreeVec(_viewSettings_Node->wpedbo_Options);
2126 int tag_count = (chunk_size - _viewSettings_TagOffset)/sizeof(struct TagItem32);
2128 _viewSettings_Node->wpedbo_Options = AllocVec((tag_count + 1) * sizeof(struct TagItem32),
2129 MEMF_ANY|MEMF_CLEAR
2131 if (_viewSettings_Node->wpedbo_Options)
2133 D(bug("[WPEditor] WPEditor_ProccessViewSettingsChunk: Allocated new Tag storage @ 0x%p [%d bytes] \n", _viewSettings_Node->wpedbo_Options, chunk_size - _viewSettings_TagOffset));
2134 CopyMem(_viewSettings_Chunk + _viewSettings_TagOffset, _viewSettings_Node->wpedbo_Options, tag_count * sizeof(struct TagItem32));
2135 _viewSettings_Node->wpedbo_Options[tag_count].ti_Tag = TAG_DONE;
2139 SET(_viewSettings_Node->wpedbo_ImageSpecObject, MUIA_Imagedisplay_Spec, _viewSettings_Chunk);
2141 return TRUE;
2145 /*IPTR WPEditor__MUIM_PrefsEditor_ImportFH(): definition of an abstract function from
2146 *MUIC_PrefsEditor; This function basically read the iff prefs file and show in
2147 *Wanderer prefs window the data readed...;
2149 IPTR WPEditor__MUIM_PrefsEditor_ImportFH
2151 Class *CLASS, Object *self,
2152 struct MUIP_PrefsEditor_ImportFH *message
2155 //SETUP_WPEDITOR_INST_DATA;//unused
2157 struct ContextNode *context;
2158 struct IFFHandle *handle;
2159 BOOL success = TRUE;
2160 LONG error;
2161 IPTR iff_parse_mode = IFFPARSE_SCAN;
2162 UBYTE chunk_buffer[WP_IFF_CHUNK_BUFFER_SIZE];
2164 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH()\n"));
2166 if (!(handle = AllocIFF()))
2167 return FALSE;
2169 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Iff current handle 0x%p, msg handle 0x%p\n", handle->iff_Stream, message->fh));
2171 handle->iff_Stream = (IPTR) message->fh;
2172 InitIFFasDOS(handle);
2174 if ((error = OpenIFF(handle, IFFF_READ)) == 0)
2176 if ((error = StopChunk(handle, ID_PREF, ID_WANDR)) == 0)
2180 if ((error = ParseIFF(handle, iff_parse_mode)) == 0)
2182 context = CurrentChunk(handle);
2183 iff_parse_mode = IFFPARSE_STEP;
2185 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Context 0x%p\n", context));
2187 if ((error = ReadChunkBytes(handle, chunk_buffer, WP_IFF_CHUNK_BUFFER_SIZE)))
2189 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: ReadChunkBytes() Chunk matches Prefs Header size ..\n"));
2190 struct WandererPrefsIFFChunkHeader *this_header = (struct WandererPrefsIFFChunkHeader *) chunk_buffer;
2191 char *this_chunk_name = NULL;
2192 /* prefs file is stored in little endian */
2193 IPTR this_chunk_size = AROS_LE2LONG(this_header->wpIFFch_ChunkSize);
2196 if ((this_chunk_name = AllocVec(strlen(this_header->wpIFFch_ChunkType) +1, MEMF_ANY|MEMF_CLEAR)))
2198 strcpy(this_chunk_name, this_header->wpIFFch_ChunkType);
2199 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Prefs Header for '%s' data size %d bytes\n", this_chunk_name, this_chunk_size));
2201 if ((error = ParseIFF(handle, IFFPARSE_STEP)) == IFFERR_EOC)
2203 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: End of header chunk ..\n"));
2205 if ((error = ParseIFF(handle, IFFPARSE_STEP)) == 0)
2207 context = CurrentChunk(handle);
2209 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Context 0x%p\n", context));
2211 error = ReadChunkBytes(
2212 handle,
2213 chunk_buffer,
2214 this_chunk_size
2217 if (error == this_chunk_size)
2219 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: ReadChunkBytes() Chunk matches Prefs Data size .. (%d)\n", error));
2220 if ((strcmp(this_chunk_name, "wanderer:global")) == 0)
2222 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Process data for wanderer global config chunk ..\n"));
2223 WPEditor_ProccessGlobalChunk(CLASS, self,(struct TagItem32 *) chunk_buffer, this_chunk_size);
2225 #if defined(DEBUG_NETWORKBROWSER)
2226 else if ((strcmp(this_chunk_name, "wanderer:network")) == 0)
2228 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Process data for wanderer network config chunk ..\n"));
2229 WPEditor_ProccessNetworkChunk(CLASS, self, chunk_buffer);
2231 #endif
2233 #if defined(DEBUG_CHANGESCREENTITLE)
2234 else if ((strcmp(this_chunk_name, "wanderer:screentitle")) == 0)
2236 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Process data for wanderer screentitle config chunk ..\n"));
2237 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Chunk screentitle Data size .. (%d)\n", error));
2238 WPEditor_ProccessScreenTitleChunk(CLASS, self, chunk_buffer);
2239 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Data for wanderer screentitle config chunk PROCESSED..\n"));
2241 #endif
2242 else if ((strncmp(this_chunk_name, "wanderer:viewsettings", strlen("wanderer:viewsettings"))) == 0)
2244 char *view_name = this_chunk_name + strlen("wanderer:viewsettings") + 1;
2245 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: Process data for wanderer background config chunk '%s'..\n", view_name));
2246 WPEditor_ProccessViewSettingsChunk(CLASS, self, view_name, chunk_buffer, this_chunk_size);
2249 }//END if (error == this_chunk_size)
2251 if ((error = ParseIFF(handle, IFFPARSE_STEP)) == IFFERR_EOC)
2253 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: End of Data chunk ..\n"));
2255 }//END if ((error = ParseIFF(handle, IFFPARSE_STEP)) == 0)
2256 }//END if ((error = ParseIFF(handle, IFFPARSE_STEP)) == IFFERR_EOC)
2257 }//END if (this_chunk_name)
2258 }//END if ((error = ReadChunkBytes(handle, chunk_buffer, WP_IFF_CHUNK_BUFFER_SIZE)))
2259 }//END if ((error = ParseIFF(handle, iff_parse_mode)) == 0)
2260 else
2262 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: ParseIFF() failed, returncode %ld!\n", error));
2263 //success = FALSE;// this brokes cancel button
2264 //break;
2267 } while (error != IFFERR_EOF);
2271 else
2273 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ImportFH: StopChunk() failed, returncode %ld!\n", error));
2274 success = FALSE;// this brokes cancel button
2275 }//END if ((error = StopChunk(handle, ID_PREF, ID_WANDR)) == 0)
2277 CloseIFF(handle);
2279 else
2281 D(bug("[WPEditor] Failed to open stream!, returncode %ld!\n", error));
2282 //ShowError(_(MSG_CANT_OPEN_STREAM));
2283 success = FALSE;
2284 }//END if ((error = OpenIFF(handle, IFFF_READ)) == 0)
2286 //Close((APTR)handle->iff_Stream);
2287 FreeIFF(handle);
2289 return success;
2292 /*IPTR WPEditor__MUIM_PrefsEditor_ExportFH(): definition of an abstract function from
2293 *MUIC_PrefsEditor; This function basically memorized in the correspondent iff prefs file
2294 *of Wanderer prefs the changes made with Wanderer prefs window...;
2296 IPTR WPEditor__MUIM_PrefsEditor_ExportFH
2298 Class *CLASS, Object *self,
2299 struct MUIP_PrefsEditor_ExportFH *message
2302 SETUP_WPEDITOR_INST_DATA;
2304 struct IFFHandle *handle;
2305 struct PrefHeader header = { 0 };
2306 struct WandererPrefsIFFChunkHeader wanderer_chunkdata = { };
2307 BOOL success = TRUE;
2308 LONG error = 0;
2309 int positionTemp =0;
2311 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH()\n"));
2313 if ((handle = AllocIFF()))
2315 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Current IFF handle 0x%p, msg handle 0x%p\n", handle->iff_Stream, message->fh));
2317 handle->iff_Stream = (IPTR) message->fh;
2319 InitIFFasDOS(handle);
2321 if (!(error = OpenIFF(handle, IFFF_WRITE))) /* NULL = successful! */
2323 //BYTE i = 0;
2325 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write IFF FORM Header Chunk ... \n")); /* FIXME: IFFSIZE_UNKNOWN? */
2326 if ((error = PushChunk(handle, ID_PREF, ID_FORM, IFFSIZE_UNKNOWN)) != 0)
2328 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: IFF FORM Header Chunk : Error! %d \n", error));
2329 goto exportFH_CloseIFF;
2332 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write Preference File Header Chunk ... \n")); /* FIXME: IFFSIZE_UNKNOWN? */
2333 if ((error = PushChunk(handle, ID_PREF, ID_PRHD, IFFSIZE_UNKNOWN)) == 0)
2335 header.ph_Version = PHV_CURRENT;
2336 header.ph_Type = 0;
2338 WriteChunkBytes(handle, &header, sizeof(struct PrefHeader));
2340 if ((error = PopChunk(handle)) != 0)
2342 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Preference File Header PopChunk() = %ld\n", error));
2343 goto exportFH_CloseFORM;
2346 else
2348 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Preference File Header Chunk : Error! %d \n", error));
2349 goto exportFH_CloseFORM;
2352 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Prepare 'global' Wanderer Prefs Data Chunk Data ... \n"));
2353 /* save toolbar state*/
2354 struct TagItem32 *_wp_GlobalTags = AllocVec((256 * sizeof(struct TagItem32)), MEMF_ANY|MEMF_CLEAR);
2355 ULONG _wp_GlobalTagCounter = 0;
2356 /* helper to convert to little endian */
2357 STACKED IPTR ti_Data;
2359 _wp_GlobalTags[_wp_GlobalTagCounter].ti_Tag = AROS_LONG2LE(MUIA_IconWindowExt_Toolbar_Enabled);
2360 GET(data->wped_cm_ToolbarEnabled, MUIA_Selected, &ti_Data);
2361 _wp_GlobalTags[_wp_GlobalTagCounter].ti_Data = AROS_LONG2LE(ti_Data);
2362 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' MUIA_IconWindowExt_Toolbar_Enabled @ Tag %d, data = %d\n", _wp_GlobalTagCounter, ti_Data));
2363 _wp_GlobalTagCounter += 1;
2365 if ((BOOL)ti_Data == TRUE)
2367 /* save navigation bahaviour */
2368 _wp_GlobalTags[_wp_GlobalTagCounter].ti_Tag = AROS_LONG2LE(MUIA_IconWindowExt_Toolbar_NavigationMethod);
2369 GET(data->wped_c_NavigationMethod, MUIA_Cycle_Active, &ti_Data);
2370 _wp_GlobalTags[_wp_GlobalTagCounter].ti_Data = AROS_LONG2LE(ti_Data);
2371 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' MUIA_IconWindowExt_Toolbar_NavigationMethod @ Tag %d, data = %d\n", _wp_GlobalTagCounter, ti_Data));
2372 _wp_GlobalTagCounter += 1;
2375 #if defined(DEBUG_SHOWUSERFILES)
2376 _wp_GlobalTags[_wp_GlobalTagCounter].ti_Tag = AROS_LONG2LE(MUIA_IconWindowExt_UserFiles_ShowFilesFolder);
2377 GET(data->wped_cm_EnableUserFiles, MUIA_Selected, &ti_Data);
2378 _wp_GlobalTags[_wp_GlobalTagCounter].ti_Data = AROS_LONG2LE(ti_Data);
2379 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' MUIA_IconWindowExt_UserFiles_ShowFilesFolder @ Tag %d, data = %d\n", _wp_GlobalTagCounter, ti_Data));
2380 _wp_GlobalTagCounter += 1;
2381 #endif
2383 _wp_GlobalTags[_wp_GlobalTagCounter].ti_Tag = AROS_LONG2LE(TAG_DONE);
2384 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' Marked Tag %d as TAG_DONE\n", _wp_GlobalTagCounter));
2386 ULONG globaldatasize = (_wp_GlobalTagCounter + 1) * sizeof(struct TagItem32);
2388 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'global' Wanderer Prefs Header Chunk ... \n"));
2389 if ((error = PushChunk(handle, ID_PREF, ID_WANDR, sizeof(struct WandererPrefsIFFChunkHeader))) == 0)
2391 sprintf(wanderer_chunkdata.wpIFFch_ChunkType, "%s" , "wanderer:global");
2392 wanderer_chunkdata.wpIFFch_ChunkSize = AROS_LONG2LE(globaldatasize);
2394 WriteChunkBytes(handle, &wanderer_chunkdata, sizeof(struct WandererPrefsIFFChunkHeader));
2396 if ((error = PopChunk(handle)) != 0)
2398 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' Header PopChunk() = %ld\n", error));
2399 goto exportFH_CloseFORM;
2402 else
2404 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' Wanderer Prefs Header Chunk : Error! %d \n", error));
2405 goto exportFH_CloseFORM;
2408 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'global' Wanderer Prefs Data Chunk ... \n"));
2409 if ((error = PushChunk(handle, ID_PREF, ID_WANDR, globaldatasize)) == 0)
2411 error = WriteChunkBytes(handle, _wp_GlobalTags, globaldatasize);
2412 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' Data Chunk | Wrote %d bytes (data size = %d bytes)\n", error, globaldatasize));
2413 if ((error = PopChunk(handle)) != 0)
2415 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' PopChunk() = %ld\n", error));
2416 goto exportFH_CloseFORM;
2418 FreeVec(_wp_GlobalTags);
2420 else
2422 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'global' PushChunk() = %ld failed\n", error));
2423 goto exportFH_CloseFORM;
2426 #if defined(DEBUG_NETWORKBROWSER)
2427 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'network' Wanderer Prefs Header Chunk ... \n"));
2428 if ((error = PushChunk(handle, ID_PREF, ID_WANDR, sizeof(struct WandererPrefsIFFChunkHeader))) == 0)
2430 sprintf(wanderer_chunkdata.wpIFFch_ChunkType, "%s" , "wanderer:network");
2431 wanderer_chunkdata.wpIFFch_ChunkSize = AROS_LONG2LE(sizeof(struct TagItem));
2433 WriteChunkBytes(handle, &wanderer_chunkdata, sizeof(struct WandererPrefsIFFChunkHeader));
2435 if ((error = PopChunk(handle)) != 0)
2437 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'network' Header PopChunk() = %ld\n", error));
2438 goto exportFH_CloseFORM;
2441 else
2443 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'network' Wanderer Prefs Header Chunk : Error! %d \n", error));
2444 goto exportFH_CloseFORM;
2447 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'network' Wanderer Prefs Data Chunk ... \n"));
2448 if ((error = PushChunk(handle, ID_PREF, ID_WANDR, sizeof(struct TagItem))) == 0)
2450 struct TagItem32 __wp_networkconfig[2];
2452 /* save network options*/
2453 __wp_networkconfig[0].ti_Tag = MUIA_IconWindowExt_NetworkBrowser_Show;
2454 GET(data->wped_cm_EnableNetworkBrowser, MUIA_Selected, &ti_Data);
2455 __wp_networkconfig[0].ti_Data = AROS_LONG2LE(ti_Data);
2457 error = WriteChunkBytes(handle, __wp_networkconfig, sizeof(struct TagItem32));
2458 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'network' Data Chunk | Wrote %d bytes (data size = %d bytes)\n", error, sizeof(struct TagItem)));
2459 if ((error = PopChunk(handle)) != 0)
2461 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'network' PopChunk() = %ld\n", error));
2462 goto exportFH_CloseFORM;
2465 else
2467 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'network' PushChunk() = %ld failed\n", error));
2468 goto exportFH_CloseFORM;
2470 #endif
2472 #if defined(DEBUG_CHANGESCREENTITLE)
2473 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'screentitle' Wanderer Prefs Header Chunk ... \n"));
2474 if ((error = PushChunk(handle, ID_PREF, ID_WANDR, sizeof(struct WandererPrefsIFFChunkHeader))) == 0)
2476 sprintf(wanderer_chunkdata.wpIFFch_ChunkType, "%s" , "wanderer:screentitle");
2477 UBYTE *screentitlestr = NULL;
2479 GET(data->wped_s_screentitle, MUIA_String_Contents, &screentitlestr);
2481 wanderer_chunkdata.wpIFFch_ChunkSize = AROS_LONG2LE(strlen(screentitlestr) + 1);
2483 WriteChunkBytes(handle, &wanderer_chunkdata, sizeof(struct WandererPrefsIFFChunkHeader));
2485 if ((error = PopChunk(handle)) != 0)
2487 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' Header PopChunk() = %ld\n", error));
2488 goto exportFH_CloseFORM;
2491 else
2493 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' Wanderer Prefs Header Chunk : Error! %d \n", error));
2494 goto exportFH_CloseFORM;
2497 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'screentitle' Wanderer Prefs Data Chunk ... \n"));
2498 if ((error = PushChunk(handle, ID_PREF, ID_WANDR, IFFSIZE_UNKNOWN)) == 0)
2500 // save screentitle options
2501 UBYTE *screentitlestr = NULL;
2503 GET(data->wped_s_screentitle, MUIA_String_Contents, &screentitlestr);
2504 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' string to write %s\n", screentitlestr));
2505 error = WriteChunkBytes(handle, screentitlestr, strlen(screentitlestr) + 1);
2506 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' string written %s\n", screentitlestr));
2507 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' Data Chunk | Wrote %d bytes\n", error));
2508 if ((error = PopChunk(handle)) != 0)
2510 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' PopChunk() = %ld\n", error));
2511 goto exportFH_CloseFORM;
2514 else
2516 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'screentitle' PushChunk() = %ld failed\n", error));
2517 goto exportFH_CloseFORM;
2519 #endif
2521 struct WPEditor_ViewSettingsObject *_viewSettings_Node = NULL;
2522 ForeachNode(&_wpeditor_intern_ViewSettings, _viewSettings_Node)
2524 IPTR _viewSettings_ChunkSize = 0, _viewSettings_TagCount = 0;
2525 struct TagItem32 _viewSettings_TagList[WP_MAX_BG_TAG_COUNT];
2527 sprintf(wanderer_chunkdata.wpIFFch_ChunkType, "%s.%s" , "wanderer:viewsettings", _viewSettings_Node->wpedbo_ViewName);
2529 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'ViewSettings' Wanderer Prefs Header Chunk for '%s' ... \n", _viewSettings_Node->wpedbo_ViewName));
2531 char *background_value = NULL;
2532 GET(_viewSettings_Node->wpedbo_ImageSpecObject, MUIA_Imagedisplay_Spec, &background_value);
2534 if (background_value)
2536 PushChunk(handle, ID_PREF, ID_WANDR, sizeof(struct WandererPrefsIFFChunkHeader));
2538 UBYTE _viewSettings_TagOffset = ((strlen(background_value) + 1)/4);
2540 if ((_viewSettings_TagOffset * 4) != (strlen(background_value) + 1))
2542 _viewSettings_TagOffset = (_viewSettings_TagOffset + 1) * 4;
2543 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 ));
2545 else
2547 _viewSettings_TagOffset = _viewSettings_TagOffset * 4;
2548 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'ViewSettings' String length doesnt need aligned (length %d) \n", strlen(background_value) + 1));
2551 _viewSettings_ChunkSize += _viewSettings_TagOffset;
2553 if (((_viewSettings_Node->wpedbo_AdvancedOptionsObject)) && (_viewSettings_Node->wpedbo_Options))
2555 //UBYTE *background_typepointer = background_value;
2556 UBYTE background_type = background_value[0] - 48;
2558 const struct TagItem32 *tstate = _viewSettings_Node->wpedbo_Options;
2559 struct TagItem32 *tag = NULL;
2561 switch (background_type)
2563 case 5:
2565 //Picture type -> store appropriate tags ..
2567 case 0:
2569 //Pattern type -> store appropriate tags ..
2570 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = MUIA_IconWindowExt_ImageBackFill_BGRenderMode;
2571 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = GetTag32Data(MUIA_IconWindowExt_ImageBackFill_BGRenderMode, IconWindowExt_ImageBackFill_RenderMode_Tiled, tstate);
2572 _viewSettings_TagCount += 1;
2574 while ((tag = NextTag32Item(&tstate)) != NULL)
2576 switch (tag->ti_Tag)
2578 case MUIA_IconWindowExt_ImageBackFill_BGTileMode:
2579 case MUIA_IconWindowExt_ImageBackFill_BGXOffset:
2580 case MUIA_IconWindowExt_ImageBackFill_BGYOffset:
2581 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = tag->ti_Tag;
2582 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = tag->ti_Data;
2583 _viewSettings_TagCount += 1;
2584 break;
2585 default:
2586 break;
2589 break;
2591 default:
2592 break;
2595 /* save the icon listing method */
2596 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_IconListMode);
2597 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_IconListMode, ICON_LISTMODE_GRID, _viewSettings_Node->wpedbo_Options));
2598 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_IconList_IconListMode @ Tag %d, data = %d\n", _viewSettings_TagCount, _viewSettings_TagList[_viewSettings_TagCount].ti_Data));
2599 _viewSettings_TagCount += 1;
2601 /* save the icon text mode */
2602 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_LabelText_Mode);
2603 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_Mode, ICON_TEXTMODE_OUTLINE, _viewSettings_Node->wpedbo_Options));
2604 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));
2605 _viewSettings_TagCount += 1;
2607 /* save the max length of icons */
2608 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_LabelText_MaxLineLen);
2609 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_MaxLineLen, ILC_ICONLABEL_MAXLINELEN_DEFAULT, _viewSettings_Node->wpedbo_Options));
2610 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));
2611 _viewSettings_TagCount += 1;
2613 #if defined(DEBUG_MULTLINE)
2614 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_LabelText_MultiLine);
2615 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_MultiLine, 1, _viewSettings_Node->wpedbo_Options));
2616 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));
2617 _viewSettings_TagCount += 1;
2619 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_LabelText_MultiLineOnFocus);
2620 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_MultiLineOnFocus, FALSE, _viewSettings_Node->wpedbo_Options));
2621 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));
2622 _viewSettings_TagCount += 1;
2623 #endif
2625 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_Icon_HorizontalSpacing);
2626 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_Icon_HorizontalSpacing, ILC_ICON_HORIZONTALMARGIN_DEFAULT, _viewSettings_Node->wpedbo_Options));
2627 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));
2628 _viewSettings_TagCount += 1;
2630 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_Icon_VerticalSpacing);
2631 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_Icon_VerticalSpacing, ILC_ICON_VERTICALMARGIN_DEFAULT, _viewSettings_Node->wpedbo_Options));
2632 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));
2633 _viewSettings_TagCount += 1;
2635 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_Icon_ImageSpacing);
2636 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_Icon_ImageSpacing, ILC_ICONLABEL_IMAGEMARGIN_DEFAULT, _viewSettings_Node->wpedbo_Options));
2637 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));
2638 _viewSettings_TagCount += 1;
2640 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_LabelText_HorizontalPadding);
2641 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_HorizontalPadding, ILC_ICONLABEL_HORIZONTALTEXTMARGIN_DEFAULT, _viewSettings_Node->wpedbo_Options));
2642 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));
2643 _viewSettings_TagCount += 1;
2645 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_LabelText_VerticalPadding);
2646 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_VerticalPadding, ILC_ICONLABEL_VERTICALTEXTMARGIN_DEFAULT, _viewSettings_Node->wpedbo_Options));
2647 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));
2648 _viewSettings_TagCount += 1;
2650 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_LabelText_BorderWidth);
2651 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_BorderWidth, ILC_ICONLABEL_BORDERWIDTH_DEFAULT, _viewSettings_Node->wpedbo_Options));
2652 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));
2653 _viewSettings_TagCount += 1;
2655 _viewSettings_TagList[_viewSettings_TagCount].ti_Tag = AROS_LONG2LE(MUIA_IconList_LabelText_BorderHeight);
2656 _viewSettings_TagList[_viewSettings_TagCount].ti_Data = AROS_LONG2LE(GetTag32Data(MUIA_IconList_LabelText_BorderHeight, ILC_ICONLABEL_BORDERHEIGHT_DEFAULT, _viewSettings_Node->wpedbo_Options));
2657 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));
2658 _viewSettings_TagCount += 1;
2661 _viewSettings_ChunkSize += (_viewSettings_TagCount * sizeof(struct TagItem32));
2663 wanderer_chunkdata.wpIFFch_ChunkSize = AROS_LONG2LE(_viewSettings_ChunkSize);
2665 WriteChunkBytes(handle, &wanderer_chunkdata, sizeof(struct WandererPrefsIFFChunkHeader));
2667 PopChunk(handle);
2669 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Write 'ViewSettings' Wanderer Prefs Data Chunk for '%s' ... \n", _viewSettings_Node->wpedbo_ViewName));
2671 if ((error = PushChunk(handle, ID_PREF, ID_WANDR, _viewSettings_ChunkSize)) == 0)
2673 UBYTE *_viewSettings_ChunkData = AllocMem(_viewSettings_ChunkSize, MEMF_ANY|MEMF_CLEAR);
2674 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Chunk Data storage @ 0x%p, %d bytes\n", _viewSettings_ChunkData, _viewSettings_ChunkSize));
2676 sprintf(_viewSettings_ChunkData, "%s", background_value);
2677 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' MUIA_Background = '%s'\n", _viewSettings_ChunkData));
2678 if ((_viewSettings_Node->wpedbo_AdvancedOptionsObject) && ((_viewSettings_Node->wpedbo_Options)&&(_viewSettings_TagCount > 0)))
2680 struct TagItem32 *dest_tag = (struct TagItem32 *)(_viewSettings_ChunkData + _viewSettings_TagOffset);
2681 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Writing data for %d Tags @ 0x%p\n", _viewSettings_TagCount, dest_tag));
2684 dest_tag[_viewSettings_TagCount - 1].ti_Tag = AROS_LONG2LE(_viewSettings_TagList[_viewSettings_TagCount - 1].ti_Tag);
2685 dest_tag[_viewSettings_TagCount - 1].ti_Data = AROS_LONG2LE(_viewSettings_TagList[_viewSettings_TagCount - 1].ti_Data);
2686 _viewSettings_TagCount -= 1;
2687 }while(_viewSettings_TagCount > 0);
2690 error = WriteChunkBytes(handle, _viewSettings_ChunkData, _viewSettings_ChunkSize);
2691 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Data Chunk | Wrote %d bytes (data size = %d bytes)\n", error, _viewSettings_ChunkSize));
2692 if ((error = PopChunk(handle)) != 0) // TODO: We need some error checking here!
2694 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Data PopChunk() = %ld\n", error));
2697 else
2699 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Data PushChunk() = %ld failed\n", error));
2702 else
2704 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: 'ViewSettings' Skipping (no value set) ... \n"));
2708 exportFH_CloseFORM:
2710 /* Terminate the FORM */
2711 PopChunk(handle);
2713 else
2715 //ShowError(_(MSG_CANT_OPEN_STREAM));
2716 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Can't open stream!\n"));
2717 success = FALSE;
2720 exportFH_CloseIFF:
2722 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Closing Handles ..\n"));
2724 CloseIFF(handle);
2725 FreeIFF(handle);
2727 else // AllocIFF()
2729 // Do something more here - if IFF allocation has failed, something isn't right
2730 //ShowError(_(MSG_CANT_ALLOCATE_IFFPTR));
2731 success = FALSE;
2734 D(bug("[WPEditor] WPEditor__MUIM_PrefsEditor_ExportFH: Export Finished\n"));
2736 return success;
2740 IPTR WPEditor__MUIM_Setup
2742 Class *CLASS, Object *self, Msg message
2745 SETUP_WPEDITOR_INST_DATA;
2747 D(bug("[WPEditor] WPEditor__MUIM_Setup()\n"));
2749 if (!DoSuperMethodA(CLASS, self, message)) return FALSE;
2751 #if defined(DEBUG_ADVANCEDIMAGEOPTIONS)
2752 DoMethod(
2753 _app(self),
2754 OM_ADDMEMBER,
2755 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_WindowObj
2757 #endif
2758 DoMethod (
2759 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_RenderModeObj,
2760 MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime,
2761 (IPTR)self, 3,
2762 MUIM_CallHook,
2763 &data->wped_AdvancedViewSettings_WindowData->wpedabwd_Hook_DrawModeChage,
2764 CLASS
2767 DoMethod (
2768 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_UseObj,
2769 MUIM_Notify, MUIA_Pressed, FALSE,
2770 (IPTR)self, 3,
2771 MUIM_CallHook,
2772 &data->wped_Hook_CloseAdvancedOptions,
2773 TRUE
2776 DoMethod (
2777 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_CancelObj,
2778 MUIM_Notify, MUIA_Pressed, FALSE,
2779 (IPTR)self, 3,
2780 MUIM_CallHook,
2781 &data->wped_Hook_CloseAdvancedOptions,
2782 FALSE
2785 DoMethod (
2786 data->wped_AdvancedViewSettings_WindowData->wpedabwd_Window_WindowObj,
2787 MUIM_Notify, MUIA_Window_CloseRequest, TRUE,
2788 (IPTR)self, 3,
2789 MUIM_CallHook,
2790 &data->wped_Hook_CloseAdvancedOptions,
2791 FALSE
2794 return TRUE;
2797 IPTR WPEditor__MUIM_Show
2799 Class *CLASS, Object *self, Msg message
2802 //SETUP_WPEDITOR_INST_DATA;
2804 D(bug("[WPEditor] WPEditor__MUIM_Show()\n"));
2806 if (!DoSuperMethodA(CLASS, self, message)) return FALSE;
2808 #if defined(DEBUG_FORCEWINSIZE)
2809 Object *this_Win = _win(self);
2810 if ((this_Win) && (data->wped_DimensionsSet == NULL))
2812 LONG thisWin_Width = 0,
2813 thisWin_Height = 0,
2814 thisWin_X = 0,
2815 thisWin_Y = 0;
2817 LONG viewsettingsbox_Height = 0;
2819 struct Window *thisWin_Window = NULL;
2821 GET(this_Win, MUIA_Window_Width, &thisWin_Width);
2822 GET(this_Win, MUIA_Window_Height, &thisWin_Height);
2823 GET(this_Win, MUIA_Window_TopEdge, &thisWin_X);
2824 GET(this_Win, MUIA_Window_LeftEdge, &thisWin_Y);
2826 GET(this_Win, MUIA_Window_Window, &thisWin_Window);
2828 GET(data->wped_ViewSettings_GroupObj, MUIA_Height, &viewsettingsbox_Height);
2830 D(bug("[WPEditor] WPEditor__MUIM_Show: WindowObj @ 0x%p, Real Window @ 0x%p, %d, %d [%d x %d]\n",
2831 this_Win,
2832 thisWin_Window,
2833 thisWin_X, thisWin_Y,
2834 thisWin_Width, thisWin_Height));
2836 D(bug("[WPEditor] WPEditor__MUIM_Show: ViewSettings Group height = %d\n", viewsettingsbox_Height));
2838 if ((thisWin_Window) && (viewsettingsbox_Height > 0))
2840 LONG NEWHEIGHT = 0,
2841 ImgSpec_Height = 0,
2842 Advanced_Height = 0;
2844 if (data->wped_FirstBGImSpecObj) GET(data->wped_FirstBGImSpecObj, MUIA_Height, &ImgSpec_Height);
2845 if (data->wped_FirstBGAdvancedObj) GET(data->wped_FirstBGAdvancedObj, MUIA_Height, &Advanced_Height);
2847 if ((ImgSpec_Height > 0) && (Advanced_Height > 0))
2849 NEWHEIGHT = ImgSpec_Height + Advanced_Height;
2850 if ((2 * NEWHEIGHT) < viewsettingsbox_Height)
2852 thisWin_Height = (thisWin_Height - viewsettingsbox_Height) + (2 * NEWHEIGHT);
2853 thisWin_Y = thisWin_Y + ((viewsettingsbox_Height - (2 * NEWHEIGHT))/2);
2855 D(bug("[WPEditor] WPEditor__MUIM_Show: Changing windows dimensions to %d, %d [%d x %d]\n",
2856 thisWin_X, thisWin_Y,
2857 thisWin_Width, thisWin_Height));
2859 ChangeWindowBox(thisWin_Window, thisWin_X, thisWin_Y, thisWin_Width, thisWin_Height);
2860 data->wped_DimensionsSet = TRUE;
2865 #endif
2866 return TRUE;
2869 /*** Setup ******************************************************************/
2870 ZUNE_CUSTOMCLASS_5
2872 WPEditor, NULL, MUIC_PrefsEditor, NULL,
2873 OM_NEW, struct opSet *,
2874 MUIM_Setup, Msg,
2875 MUIM_Show, Msg,
2876 MUIM_PrefsEditor_ImportFH, struct MUIP_PrefsEditor_ImportFH *,
2877 MUIM_PrefsEditor_ExportFH, struct MUIP_PrefsEditor_ExportFH *