added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / classes / gadgets / texteditor / mcp / ObjectCreator.c
blob7b6ea2a6ea3545d316c26c507854451c5c5fe4e3
1 /***************************************************************************
3 TextEditor.mcc - Textediting MUI Custom Class
4 Copyright (C) 1997-2000 Allan Odgaard
5 Copyright (C) 2005 by TextEditor.mcc Open Source Team
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 TextEditor class Support Site: http://www.sf.net/projects/texteditor-mcc
19 $Id$
21 ***************************************************************************/
23 #include <string.h>
25 #include <clib/alib_protos.h>
26 #include <devices/inputevent.h>
27 #include <libraries/asl.h>
28 #include <libraries/mui.h>
29 #include <proto/exec.h>
30 #include <proto/intuition.h>
31 #include <proto/muimaster.h>
33 #include "locale.h"
34 #include "private.h"
35 #ifndef __AROS__
36 #include "muiextra.h"
37 #else
38 #define MUIM_Mccprefs_RegisterGadget 0x80424828 // V20
39 struct MUI_ImageSpec
41 char buf[64];
43 #endif
45 #include "TextEditor_mcc.h"
47 char *FunctionName (UWORD func)
49 char *name;
51 switch(func)
53 case mUp:
54 name = GetStr(MSG_Function_Up);
55 break;
57 case mDown:
58 name = GetStr(MSG_Function_Down);
59 break;
61 case mLeft:
62 name = GetStr(MSG_Function_Left);
63 break;
65 case mRight:
66 name = GetStr(MSG_Function_Right);
67 break;
69 case mPreviousPage:
70 name = GetStr(MSG_Function_PrvPage);
71 break;
73 case mNextPage:
74 name = GetStr(MSG_Function_NxtPage);
75 break;
77 case mStartOfLine:
78 name = GetStr(MSG_Function_BOL);
79 break;
81 case mEndOfLine:
82 name = GetStr(MSG_Function_EOL);
83 break;
85 case mTop:
86 name = GetStr(MSG_Function_Top);
87 break;
89 case mBottom:
90 name = GetStr(MSG_Function_Bottom);
91 break;
93 case mPreviousWord:
94 name = GetStr(MSG_Function_PrvWord);
95 break;
97 case mNextWord:
98 name = GetStr(MSG_Function_NxtWord);
99 break;
101 case mPreviousLine:
102 name = GetStr(MSG_Function_PrvPara);
103 break;
105 case mNextLine:
106 name = GetStr(MSG_Function_NxtPara);
107 break;
109 case mPreviousSentence:
110 name = GetStr(MSG_Function_PrvSent);
111 break;
113 case mNextSentence:
114 name = GetStr(MSG_Function_NxtSent);
115 break;
117 case kSuggestWord:
118 name = GetStr(MSG_Function_SuggestSpelling);
119 break;
121 case kBackspace:
122 name = GetStr(MSG_Function_Backspace);
123 break;
125 case kDelete:
126 name = GetStr(MSG_Function_Delete);
127 break;
129 case kReturn:
130 name = GetStr(MSG_Function_Return);
131 break;
133 case kTab:
134 name = GetStr(MSG_Function_Tab);
135 break;
137 case kCut:
138 name = GetStr(MSG_Function_Cut);
139 break;
141 case kCopy:
142 name = GetStr(MSG_Function_Copy);
143 break;
145 case kPaste:
146 name = GetStr(MSG_Function_Paste);
147 break;
149 case kUndo:
150 name = GetStr(MSG_Function_Undo);
151 break;
153 case kRedo:
154 name = GetStr(MSG_Function_Redo);
155 break;
157 case kDelEOL:
158 name = GetStr(MSG_Function_DelEOL);
159 break;
161 case kDelBOL:
162 name = GetStr(MSG_Function_DelBOL);
163 break;
165 case kDelEOW:
166 name = GetStr(MSG_Function_DelEOW);
167 break;
169 case kDelBOW:
170 name = GetStr(MSG_Function_DelBOW);
171 break;
173 case kDelLine:
174 name = GetStr(MSG_Function_DelLine);
175 break;
177 case kNextGadget:
178 name = GetStr(MSG_Function_NextGadget);
179 break;
181 case kGotoBookmark1:
182 name = GetStr(MSG_Function_GotoBookmark1);
183 break;
185 case kGotoBookmark2:
186 name = GetStr(MSG_Function_GotoBookmark2);
187 break;
189 case kGotoBookmark3:
190 name = GetStr(MSG_Function_GotoBookmark3);
191 break;
193 case kSetBookmark1:
194 name = GetStr(MSG_Function_SetBookmark1);
195 break;
197 case kSetBookmark2:
198 name = GetStr(MSG_Function_SetBookmark2);
199 break;
201 case kSetBookmark3:
202 name = GetStr(MSG_Function_SetBookmark3);
203 break;
205 default:
206 name = "";
208 return(name);
211 #define ARRAY_SIZE(X) (sizeof(X)/sizeof(X[0]))
212 /* compile time assert to cause a linker error. DO NOT CHANGE! */
213 void __FAIL_ON_ME(void);
214 #define _ASSERT(EXP) ((void) ((EXP) ? 0 : __FAIL_ON_ME()))
216 static Object *PrefsObject(struct InstData_MCP *data)
218 static const void *titles[] = {
219 MSG_Page_Settings,
220 MSG_Page_Keybindings,
221 MSG_Page_SpellChecker,
222 MSG_Page_Sample
224 static const void *functions[] = {
225 MSG_Function_Up,
226 MSG_Function_Down,
227 MSG_Function_Left,
228 MSG_Function_Right,
229 MSG_Function_PrvPage,
230 MSG_Function_NxtPage,
231 MSG_Function_BOL,
232 MSG_Function_EOL,
233 MSG_Function_Top,
234 MSG_Function_Bottom,
235 MSG_Function_PrvWord,
236 MSG_Function_NxtWord,
237 MSG_Function_PrvPara,
238 MSG_Function_NxtPara,
239 MSG_Function_PrvSent,
240 MSG_Function_NxtSent,
241 MSG_Function_SuggestSpelling,
242 MSG_Function_Backspace,
243 MSG_Function_Delete,
244 MSG_Function_Return,
245 MSG_Function_Tab,
246 MSG_Function_Cut,
247 MSG_Function_Copy,
248 MSG_Function_Paste,
249 MSG_Function_Undo,
250 MSG_Function_Redo,
251 MSG_Function_DelBOL,
252 MSG_Function_DelEOL,
253 MSG_Function_DelBOW,
254 MSG_Function_DelEOW,
255 MSG_Function_NextGadget,
256 MSG_Function_GotoBookmark1,
257 MSG_Function_GotoBookmark2,
258 MSG_Function_GotoBookmark3,
259 MSG_Function_SetBookmark1,
260 MSG_Function_SetBookmark2,
261 MSG_Function_SetBookmark3,
262 MSG_Function_DelLine
264 static const void *cycleentries[] = {
265 MSG_CycleItem_Shift,
266 MSG_CycleItem_Ctrl,
267 MSG_CycleItem_Alt,
268 MSG_CycleItem_Mouse
270 unsigned int i;
272 _ASSERT( ARRAY_SIZE(data->gTitles) == (ARRAY_SIZE(titles)+1) );
273 for(i=0; i<ARRAY_SIZE(titles); i++)
274 data->gTitles[i] = GetStr((APTR)titles[i]);
275 data->gTitles[ARRAY_SIZE(titles)] = NULL;
277 _ASSERT( ARRAY_SIZE(data->functions) == (ARRAY_SIZE(functions)+1) );
278 for(i=0; i<ARRAY_SIZE(functions); i++)
279 data->functions[i] = GetStr((APTR)functions[i]);
280 data->functions[ARRAY_SIZE(functions)] = NULL;
282 _ASSERT( ARRAY_SIZE(data->execution) == 3 );
283 data->execution[0] = GetStr(MSG_Execution_CLI);
284 data->execution[1] = GetStr(MSG_Execution_ARexx);
285 data->execution[2] = NULL;
287 _ASSERT( ARRAY_SIZE(data->cycleentries) == (ARRAY_SIZE(cycleentries)+1) );
288 for(i=0; i<ARRAY_SIZE(cycleentries); i++)
289 data->cycleentries[i] = GetStr((APTR)cycleentries[i]);
290 data->cycleentries[ARRAY_SIZE(cycleentries)] = NULL;
292 data->obj = CreatePrefsGroup(data);
293 if(data->obj)
295 set(data->normalfont, MUIA_String_AdvanceOnCR, TRUE);
296 set(data->fixedfont, MUIA_String_AdvanceOnCR, TRUE);
298 DoMethod(data->blockqual, MUIM_MultiSet, MUIA_CycleChain, TRUE,
299 data->blockqual, data->tabsize, data->smooth,
300 data->normalfont, data->fixedfont, data->textcolor, data->frame,
301 data->highlightcolor, data->background, data->cursorcolor,
302 data->markedcolor, data->cursorwidth, data->deletekey,
303 data->blinkspeed, data->suggestcmd, data->lookupcmd,
304 data->typenspell, data->undosize, data->LookupExeType,
305 data->SuggestExeType, data->CheckWord, data->insertkey,
306 data->separatorshadow, data->separatorshine, NULL);
309 return(data->obj);
312 ULONG New(REG(a0, struct IClass *cl), REG(a2, Object *obj), REG(a1, struct opSet *msg))
314 if((obj = (Object *)DoSuperMethodA(cl, obj, (Msg)msg)))
316 struct InstData_MCP *data = INST_DATA(cl, obj);
318 // create the main prefs object
319 Object *prefsobject = PrefsObject(data);
321 if((data->CfgObj = prefsobject))
323 DoMethod(obj, OM_ADDMEMBER, prefsobject);
325 if(MUIMasterBase->lib_Version >= 20)
327 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->LookupExeType, MUICFG_TextEditor_LookupCmd, 1, GetStr(MSG_Label_LookupCmd));
328 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->lookupcmd, MUICFG_TextEditor_LookupCmd, 1, GetStr(MSG_Label_LookupCmd));
329 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->SuggestExeType, MUICFG_TextEditor_SuggestCmd, 1, GetStr(MSG_Label_SuggestCmd));
330 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->suggestcmd, MUICFG_TextEditor_SuggestCmd, 1, GetStr(MSG_Label_SuggestCmd));
331 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->keybindings, MUICFG_TextEditor_Keybindings, 1, GetStr(MSG_Page_Keybindings));
332 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->frame, MUICFG_TextEditor_Frame, 1, GetStr(MSG_Label_Frame));
333 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->background, MUICFG_TextEditor_Background, 1, GetStr(MSG_Label_Background));
334 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->blinkspeed, MUICFG_TextEditor_BlinkSpeed, 1, GetStr(MSG_Label_BlinkSpeed));
335 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->blockqual, MUICFG_TextEditor_BlockQual, 1, GetStr(MSG_Label_BlkQual));
336 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->cursorcolor, MUICFG_TextEditor_CursorColor, 1, GetStr(MSG_Label_Cursor));
337 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->cursorwidth, MUICFG_TextEditor_CursorWidth, 1, GetStr(MSG_Label_Width));
338 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->fixedfont, MUICFG_TextEditor_FixedFont, 1, GetStr(MSG_Label_Fixed));
339 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->highlightcolor, MUICFG_TextEditor_HighlightColor, 1, GetStr(MSG_Label_Highlight));
340 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->markedcolor, MUICFG_TextEditor_MarkedColor, 1, GetStr(MSG_Label_Selected));
341 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->normalfont, MUICFG_TextEditor_NormalFont, 1, GetStr(MSG_Label_Normal));
342 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->smooth, MUICFG_TextEditor_Smooth, 1, GetStr(MSG_Label_Smooth));
343 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->typenspell, MUICFG_TextEditor_TypeNSpell, 1, GetStr(MSG_ConfigMenu_TypeNSpell));
344 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->CheckWord, MUICFG_TextEditor_CheckWord, 1, GetStr(MSG_ConfigMenu_CheckWord));
345 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->tabsize, MUICFG_TextEditor_TabSize, 1, GetStr(MSG_Label_TabSize));
346 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->undosize, MUICFG_TextEditor_UndoSize, 1, GetStr(MSG_Label_UndoLevel));
347 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->textcolor, MUICFG_TextEditor_TextColor, 1, GetStr(MSG_Label_Text));
348 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->separatorshine, MUICFG_TextEditor_SeparatorShine, 1, GetStr(MSG_Label_SeparatorShine));
349 DoMethod(obj, MUIM_Mccprefs_RegisterGadget, data->separatorshadow, MUICFG_TextEditor_SeparatorShadow, 1, GetStr(MSG_Label_SeparatorShadow));
351 else
352 set(data->frame, MUIA_Disabled, TRUE);
354 return((ULONG)obj);
357 CoerceMethod(cl, obj, OM_DISPOSE);
359 return(FALSE);
362 ULONG Dispose(REG(a0, struct IClass *cl), REG(a2, Object *obj), REG(a1, Msg msg))
364 struct InstData_MCP *data = INST_DATA(cl, obj);
365 Object *editpopup = data->editpopup;
367 if(data->CfgObj)
369 DoMethod(obj, OM_REMMEMBER, data->CfgObj);
370 MUI_DisposeObject(data->CfgObj);
373 if(editpopup)
374 MUI_DisposeObject(editpopup);
376 return(DoSuperMethodA(cl, obj, msg));
379 ULONG GadgetsToConfig(REG(a0, struct IClass *cl), REG(a2, Object *obj), REG(a1, struct MUIP_Settingsgroup_GadgetsToConfig *msg))
381 struct InstData_MCP *data = INST_DATA(cl, obj);
382 LONG cfg_data = 2;
384 // first save the config version
385 DoMethod(msg->configdata, MUIM_Dataspace_Add, &cfg_data, sizeof(LONG), MUICFG_TextEditor_ConfigVersion);
387 ExportKeys(msg->configdata, data);
389 get(data->frame, MUIA_Framedisplay_Spec, &cfg_data);
390 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, sizeof(struct MUI_FrameSpec), MUICFG_TextEditor_Frame);
392 get(data->background, MUIA_Imagedisplay_Spec, &cfg_data);
393 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, sizeof(struct MUI_ImageSpec), MUICFG_TextEditor_Background);
395 get(data->blinkspeed, MUIA_Numeric_Value, &cfg_data);
396 DoMethod(msg->configdata, MUIM_Dataspace_Add, &cfg_data, sizeof(LONG), MUICFG_TextEditor_BlinkSpeed);
398 get(data->blockqual, MUIA_Cycle_Active, &cfg_data);
399 DoMethod(msg->configdata, MUIM_Dataspace_Add, &cfg_data, sizeof(LONG), MUICFG_TextEditor_BlockQual);
401 get(data->cursorcolor, MUIA_Pendisplay_Spec, &cfg_data);
402 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, sizeof(struct MUI_PenSpec), MUICFG_TextEditor_CursorColor);
404 get(data->cursorwidth, MUIA_Numeric_Value, &cfg_data);
405 DoMethod(msg->configdata, MUIM_Dataspace_Add, &cfg_data, sizeof(LONG), MUICFG_TextEditor_CursorWidth);
407 get(data->fixedfont, MUIA_String_Contents, &cfg_data);
408 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, strlen((char *)cfg_data)+1, MUICFG_TextEditor_FixedFont);
410 get(data->frame, MUIA_Framedisplay_Spec, &cfg_data);
411 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, sizeof(struct MUI_FrameSpec), MUICFG_TextEditor_Frame);
413 get(data->highlightcolor, MUIA_Pendisplay_Spec, &cfg_data);
414 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, sizeof(struct MUI_PenSpec), MUICFG_TextEditor_HighlightColor);
416 get(data->markedcolor, MUIA_Pendisplay_Spec, &cfg_data);
417 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, sizeof(struct MUI_PenSpec), MUICFG_TextEditor_MarkedColor);
419 get(data->normalfont, MUIA_String_Contents, &cfg_data);
420 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, strlen((char *)cfg_data)+1, MUICFG_TextEditor_NormalFont);
423 ULONG buffer[260/4];
425 get(data->LookupExeType, MUIA_Cycle_Active, buffer);
426 get(data->lookupcmd, MUIA_String_Contents, &cfg_data);
427 CopyMem((APTR)cfg_data, &buffer[1], 256);
428 DoMethod(msg->configdata, MUIM_Dataspace_Add, buffer, strlen((char *)cfg_data)+5, MUICFG_TextEditor_LookupCmd);
430 get(data->SuggestExeType, MUIA_Cycle_Active, buffer);
431 get(data->suggestcmd, MUIA_String_Contents, &cfg_data);
432 CopyMem((APTR)cfg_data, &buffer[1], 256);
433 DoMethod(msg->configdata, MUIM_Dataspace_Add, buffer, strlen((char *)cfg_data)+5, MUICFG_TextEditor_SuggestCmd);
436 get(data->smooth, MUIA_Selected, &cfg_data);
437 DoMethod(msg->configdata, MUIM_Dataspace_Add, &cfg_data, sizeof(LONG), MUICFG_TextEditor_Smooth);
439 get(data->typenspell, MUIA_Selected, &cfg_data);
440 DoMethod(msg->configdata, MUIM_Dataspace_Add, &cfg_data, sizeof(LONG), MUICFG_TextEditor_TypeNSpell);
442 get(data->CheckWord, MUIA_Selected, &cfg_data);
443 DoMethod(msg->configdata, MUIM_Dataspace_Add, &cfg_data, sizeof(LONG), MUICFG_TextEditor_CheckWord);
445 get(data->tabsize, MUIA_Numeric_Value, &cfg_data);
446 DoMethod(msg->configdata, MUIM_Dataspace_Add, &cfg_data, sizeof(LONG), MUICFG_TextEditor_TabSize);
448 get(data->undosize, MUIA_Numeric_Value, &cfg_data);
449 DoMethod(msg->configdata, MUIM_Dataspace_Add, &cfg_data, sizeof(LONG), MUICFG_TextEditor_UndoSize);
451 get(data->textcolor, MUIA_Pendisplay_Spec, &cfg_data);
452 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, sizeof(struct MUI_PenSpec), MUICFG_TextEditor_TextColor);
454 get(data->separatorshine, MUIA_Pendisplay_Spec, &cfg_data);
455 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, sizeof(struct MUI_PenSpec), MUICFG_TextEditor_SeparatorShine);
457 get(data->separatorshadow, MUIA_Pendisplay_Spec, &cfg_data);
458 DoMethod(msg->configdata, MUIM_Dataspace_Add, cfg_data, sizeof(struct MUI_PenSpec), MUICFG_TextEditor_SeparatorShadow);
460 return(0);
463 ULONG ConfigToGadgets(REG(a0, struct IClass *cl), REG(a2, Object *obj), REG(a1, struct MUIP_Settingsgroup_ConfigToGadgets *msg))
465 struct InstData_MCP *data = INST_DATA(cl, obj);
466 APTR cfg_data;
468 /* if(cfg_data = (APTR)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_ConfigVersion))
469 kprintf("Config version: %ld\n", *((ULONG *)cfg_data));
470 else kprintf("Obsolete config\n");
472 ImportKeys(msg->configdata, data);
474 if((cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_LookupCmd)))
476 set(data->LookupExeType, MUIA_Cycle_Active, *(ULONG *)cfg_data);
477 set(data->lookupcmd, MUIA_String_Contents, (ULONG *)cfg_data+1);
479 else
481 set(data->LookupExeType, MUIA_Cycle_Active, 0);
482 set(data->lookupcmd, MUIA_String_Contents, "");
485 if((cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_SuggestCmd)))
487 set(data->SuggestExeType, MUIA_Cycle_Active, *(ULONG *)cfg_data);
488 set(data->suggestcmd, MUIA_String_Contents, (ULONG *)cfg_data+1);
490 else
492 set(data->SuggestExeType, MUIA_Cycle_Active, 1);
493 set(data->suggestcmd, MUIA_String_Contents, "\"Open('f', 'T:Matches', 'W');WriteLn('f', '%s');Close('f')");
496 set(data->frame, MUIA_Framedisplay_Spec, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_Frame)) ? cfg_data : "302200");
497 set(data->background, MUIA_Imagedisplay_Spec, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_Background)) ? cfg_data : "2:m2");
498 set(data->blinkspeed, MUIA_Numeric_Value, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_BlinkSpeed)) ? *(ULONG *)cfg_data : 0);
499 set(data->blockqual, MUIA_Cycle_Active, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_BlockQual)) ? *(ULONG *)cfg_data : 0);
500 set(data->cursorcolor, MUIA_Pendisplay_Spec, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_CursorColor)) ? cfg_data : "m0");
501 set(data->cursorwidth, MUIA_Numeric_Value, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_CursorWidth)) ? *(ULONG *)cfg_data : 6);
502 set(data->fixedfont, MUIA_String_Contents, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_FixedFont)) ? cfg_data : "");
503 set(data->highlightcolor, MUIA_Pendisplay_Spec, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_HighlightColor)) ? cfg_data : "m0");
504 set(data->markedcolor, MUIA_Pendisplay_Spec, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_MarkedColor)) ? cfg_data : "m6");
505 set(data->normalfont, MUIA_String_Contents, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_NormalFont)) ? cfg_data : "");
506 set(data->smooth, MUIA_Selected, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_Smooth)) ? *(ULONG *)cfg_data : TRUE);
507 set(data->typenspell, MUIA_Selected, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_TypeNSpell)) ? *(ULONG *)cfg_data : FALSE);
508 set(data->CheckWord, MUIA_Selected, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_CheckWord)) ? *(ULONG *)cfg_data : FALSE);
509 set(data->tabsize, MUIA_Numeric_Value, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_TabSize)) ? *(ULONG *)cfg_data : 4);
510 set(data->undosize, MUIA_Numeric_Value, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_UndoSize)) ? *(ULONG *)cfg_data : 500);
511 set(data->textcolor, MUIA_Pendisplay_Spec, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_TextColor)) ? cfg_data : "m5");
512 set(data->separatorshine, MUIA_Pendisplay_Spec, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_SeparatorShine)) ? cfg_data : "m1");
513 set(data->separatorshadow, MUIA_Pendisplay_Spec, (cfg_data = (void *)DoMethod(msg->configdata, MUIM_Dataspace_Find, MUICFG_TextEditor_SeparatorShadow)) ? cfg_data : "m3");
515 return(0);