added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / classes / gadgets / texteditor / mcp / private.h
blob5790087fed1dd82e21baf9d0e7f671c80a9d28e0
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 #ifndef TEXTEDITOR_MCP_PRIV_H
24 #define TEXTEDITOR_MCP_PRIV_H
26 #include "TextEditor_mcp.h"
28 #include <mcc_common.h>
30 #include "Debug.h"
32 #define PREFSIMAGEOBJECT \
33 BitmapObject,\
34 MUIA_Bitmap_Bitmap, (UBYTE *)&image_bitmap,\
35 MUIA_Bitmap_Height, IMAGE_HEIGHT,\
36 MUIA_Bitmap_Precision, 0,\
37 MUIA_Bitmap_SourceColors, (ULONG *)image_palette,\
38 MUIA_Bitmap_Transparent, 0,\
39 MUIA_Bitmap_Width, IMAGE_WIDTH,\
40 MUIA_FixHeight, IMAGE_HEIGHT,\
41 MUIA_FixWidth, IMAGE_WIDTH,\
42 End
44 #define MCPMAXRAWBUF 64
46 #define IEQUALIFIER_SHIFT 0x0200
47 #define IEQUALIFIER_ALT 0x0400
48 #define IEQUALIFIER_COMMAND 0x0800
50 // proper RAWKEY_ defines were first introduced in OS4 and MorphOS
51 // and unfortunately they are also a bit different, so lets
52 // prepare an alternate table for it
53 #if defined(__amigaos4__)
54 #include <proto/keymap.h>
56 #define RAWKEY_NUMLOCK 0x79
58 #elif defined(__MORPHOS__)
59 #include <devices/rawkeycodes.h>
61 #define RAWKEY_CRSRUP RAWKEY_UP
62 #define RAWKEY_CRSRDOWN RAWKEY_DOWN
63 #define RAWKEY_CRSRRIGHT RAWKEY_RIGHT
64 #define RAWKEY_CRSRLEFT RAWKEY_LEFT
65 #define RAWKEY_PRINTSCR RAWKEY_PRTSCREEN
66 #define RAWKEY_BREAK RAWKEY_PAUSE
68 #define RAWKEY_AUD_STOP RAWKEY_CDTV_STOP
69 #define RAWKEY_AUD_PLAY_PAUSE RAWKEY_CDTV_PLAY
70 #define RAWKEY_AUD_PREV_TRACK RAWKEY_CDTV_PREV
71 #define RAWKEY_AUD_NEXT_TRACK RAWKEY_CDTV_NEXT
72 #define RAWKEY_AUD_SHUFFLE RAWKEY_CDTV_REW
73 #define RAWKEY_AUD_REPEAT RAWKEY_CDTV_FF
75 #else
77 #define RAWKEY_INSERT 0x47 /* Not on classic keyboards */
78 #define RAWKEY_PAGEUP 0x48 /* Not on classic keyboards */
79 #define RAWKEY_PAGEDOWN 0x49 /* Not on classic keyboards */
80 #define RAWKEY_F11 0x4B /* Not on classic keyboards */
81 #define RAWKEY_CRSRUP 0x4C
82 #define RAWKEY_CRSRDOWN 0x4D
83 #define RAWKEY_CRSRRIGHT 0x4E
84 #define RAWKEY_CRSRLEFT 0x4F
85 #define RAWKEY_F1 0x50
86 #define RAWKEY_F2 0x51
87 #define RAWKEY_F3 0x52
88 #define RAWKEY_F4 0x53
89 #define RAWKEY_F5 0x54
90 #define RAWKEY_F6 0x55
91 #define RAWKEY_F7 0x56
92 #define RAWKEY_F8 0x57
93 #define RAWKEY_F9 0x58
94 #define RAWKEY_F10 0x59
95 #define RAWKEY_HELP 0x5F
96 #define RAWKEY_SCRLOCK 0x6B /* Not on classic keyboards */
97 #define RAWKEY_PRINTSCR 0x6D /* Not on classic keyboards */
98 #define RAWKEY_BREAK 0x6E /* Not on classic keyboards */
99 #define RAWKEY_F12 0x6F /* Not on classic keyboards */
100 #define RAWKEY_HOME 0x70 /* Not on classic keyboards */
101 #define RAWKEY_END 0x71 /* Not on classic keyboards */
103 #define RAWKEY_AUD_STOP 0x72
104 #define RAWKEY_AUD_PLAY_PAUSE 0x73
105 #define RAWKEY_AUD_PREV_TRACK 0x74
106 #define RAWKEY_AUD_NEXT_TRACK 0x75
107 #define RAWKEY_AUD_SHUFFLE 0x76
108 #define RAWKEY_AUD_REPEAT 0x77
110 #define RAWKEY_NUMLOCK 0x79
112 #endif
114 enum
116 mUp, mDown, mLeft, mRight, mPreviousPage, mNextPage,
117 mStartOfLine, mEndOfLine, mTop, mBottom, mPreviousWord,
118 mNextWord, mPreviousLine, mNextLine, mPreviousSentence,
119 mNextSentence, kSuggestWord, kBackspace, kDelete, kReturn,
120 kTab, kCut, kCopy, kPaste, kUndo, kRedo,
121 kDelBOL, kDelEOL, kDelBOW, kDelEOW,
122 kNextGadget, kGotoBookmark1, kGotoBookmark2, kGotoBookmark3,
123 kSetBookmark1, kSetBookmark2, kSetBookmark3, kDelLine,
124 mKey_LAST
127 struct InstData_MCP
129 Object *editpopup;
130 Object *obj;
131 Object *hotkey;
132 Object *keyfunctions;
133 Object *keyfunctions_txt;
134 Object *insertkey;
135 Object *deletekey;
136 Object *cursorwidth;
137 Object *blinkspeed;
138 Object *background;
139 Object *frame;
140 Object *textcolor;
141 Object *highlightcolor;
142 Object *cursorcolor;
143 Object *markedcolor;
144 Object *blockqual;
145 Object *smooth;
146 Object *tabsize;
147 Object *normalfont;
148 Object *fixedfont;
149 Object *undosize;
150 Object *typenspell;
151 Object *lookupcmd;
152 Object *suggestcmd;
153 Object *keybindings;
154 Object *SuggestExeType;
155 Object *LookupExeType;
156 Object *CheckWord;
157 Object *separatorshine;
158 Object *separatorshadow;
159 Object *CfgObj;
161 char *gTitles[5];
162 char *functions[39];
163 char *execution[3];
164 char *cycleentries[5];
166 struct Catalog *catalog;
169 struct KeyAction
171 BOOL vanilla;
172 unsigned int key;
173 ULONG qualifier;
174 UWORD action;
177 #include "amiga-align.h"
179 struct te_key
181 UWORD code;
182 ULONG qual;
183 UWORD act;
186 #include "default-align.h"
188 extern struct MUI_CustomClass *widthslider_mcc;
189 extern struct MUI_CustomClass *speedslider_mcc;
190 extern struct MUI_CustomClass *text_mcc;
192 extern const struct te_key *keybindings[];
194 Object *CreatePrefsGroup(struct InstData_MCP *data);
195 void ImportKeys(void *, struct InstData_MCP *data);
196 void ExportKeys(void *, struct InstData_MCP *);
197 void AddKeyBinding (STRPTR keystring, UWORD action, struct KeyAction *storage);
198 void ConvertKeyString (STRPTR keystring, UWORD action, struct KeyAction *storage);
199 void KeyToString(STRPTR buffer, struct KeyAction *ka);
200 char *FunctionName(UWORD func);
201 #ifndef __AROS__
202 BOOL CreateSubClasses(void);
203 void DeleteSubClasses(void);
204 #endif
206 // main class methods
207 ULONG New(REG(a0, struct IClass *cl), REG(a2, Object *obj), REG(a1, struct opSet *msg));
208 ULONG Dispose(REG(a0, struct IClass *cl), REG(a2, Object *obj), REG(a1, Msg msg));
209 ULONG GadgetsToConfig(REG(a0, struct IClass *cl), REG(a2, Object *obj), REG(a1, struct MUIP_Settingsgroup_GadgetsToConfig *msg));
210 ULONG ConfigToGadgets(REG(a0, struct IClass *cl), REG(a2, Object *obj), REG(a1, struct MUIP_Settingsgroup_ConfigToGadgets *msg));
212 #endif /* MUI_NLISTVIEWS_priv_MCP_H */