Define _CRT_NONSTDC_NO_WARNINGS for zlib compilation with MSVC.
[wxWidgets.git] / samples / stc / prefs.cpp
1 //////////////////////////////////////////////////////////////////////////////
2 // File: contrib/samples/stc/prefs.cpp
3 // Purpose: STC test Preferences initialization
4 // Maintainer: Wyo
5 // Created: 2003-09-01
6 // Copyright: (c) wxGuide
7 // Licence: wxWindows licence
8 //////////////////////////////////////////////////////////////////////////////
9
10 //----------------------------------------------------------------------------
11 // headers
12 //----------------------------------------------------------------------------
13
14 // For compilers that support precompilation, includes "wx/wx.h".
15 #include "wx/wxprec.h"
16
17 #ifdef __BORLANDC__
18 #pragma hdrstop
19 #endif
20
21 // for all others, include the necessary headers (this file is usually all you
22 // need because it includes almost all 'standard' wxWidgets headers)
23 #ifndef WX_PRECOMP
24 #include "wx/wx.h"
25 #endif
26
27 //! wxWidgets headers
28
29 //! wxWidgets/contrib headers
30
31 //! application headers
32 #include "defsext.h" // Additional definitions
33 #include "prefs.h" // Preferences
34
35
36 //============================================================================
37 // declarations
38 //============================================================================
39
40 //----------------------------------------------------------------------------
41 //! language types
42 const CommonInfo g_CommonPrefs = {
43 // editor functionality prefs
44 true, // syntaxEnable
45 true, // foldEnable
46 true, // indentEnable
47 // display defaults prefs
48 false, // overTypeInitial
49 false, // readOnlyInitial
50 false, // wrapModeInitial
51 false, // displayEOLEnable
52 false, // IndentGuideEnable
53 true, // lineNumberEnable
54 false, // longLineOnEnable
55 false, // whiteSpaceEnable
56 };
57
58 //----------------------------------------------------------------------------
59 // keywordlists
60 // C++
61 const char* CppWordlist1 =
62 "asm auto bool break case catch char class const const_cast "
63 "continue default delete do double dynamic_cast else enum explicit "
64 "export extern false float for friend goto if inline int long "
65 "mutable namespace new operator private protected public register "
66 "reinterpret_cast return short signed sizeof static static_cast "
67 "struct switch template this throw true try typedef typeid "
68 "typename union unsigned using virtual void volatile wchar_t "
69 "while";
70 const char* CppWordlist2 =
71 "file";
72 const char* CppWordlist3 =
73 "a addindex addtogroup anchor arg attention author b brief bug c "
74 "class code date def defgroup deprecated dontinclude e em endcode "
75 "endhtmlonly endif endlatexonly endlink endverbatim enum example "
76 "exception f$ f[ f] file fn hideinitializer htmlinclude "
77 "htmlonly if image include ingroup internal invariant interface "
78 "latexonly li line link mainpage name namespace nosubgrouping note "
79 "overload p page par param post pre ref relates remarks return "
80 "retval sa section see showinitializer since skip skipline struct "
81 "subsection test throw todo typedef union until var verbatim "
82 "verbinclude version warning weakgroup $ @ \"\" & < > # { }";
83
84 // Python
85 const char* PythonWordlist1 =
86 "and assert break class continue def del elif else except exec "
87 "finally for from global if import in is lambda None not or pass "
88 "print raise return try while yield";
89 const char* PythonWordlist2 =
90 "ACCELERATORS ALT AUTO3STATE AUTOCHECKBOX AUTORADIOBUTTON BEGIN "
91 "BITMAP BLOCK BUTTON CAPTION CHARACTERISTICS CHECKBOX CLASS "
92 "COMBOBOX CONTROL CTEXT CURSOR DEFPUSHBUTTON DIALOG DIALOGEX "
93 "DISCARDABLE EDITTEXT END EXSTYLE FONT GROUPBOX ICON LANGUAGE "
94 "LISTBOX LTEXT MENU MENUEX MENUITEM MESSAGETABLE POPUP PUSHBUTTON "
95 "RADIOBUTTON RCDATA RTEXT SCROLLBAR SEPARATOR SHIFT STATE3 "
96 "STRINGTABLE STYLE TEXTINCLUDE VALUE VERSION VERSIONINFO VIRTKEY";
97
98
99 //----------------------------------------------------------------------------
100 //! languages
101 const LanguageInfo g_LanguagePrefs [] = {
102 // C++
103 {"C++",
104 "*.c;*.cc;*.cpp;*.cxx;*.cs;*.h;*.hh;*.hpp;*.hxx;*.sma",
105 wxSTC_LEX_CPP,
106 {{mySTC_TYPE_DEFAULT, NULL},
107 {mySTC_TYPE_COMMENT, NULL},
108 {mySTC_TYPE_COMMENT_LINE, NULL},
109 {mySTC_TYPE_COMMENT_DOC, NULL},
110 {mySTC_TYPE_NUMBER, NULL},
111 {mySTC_TYPE_WORD1, CppWordlist1}, // KEYWORDS
112 {mySTC_TYPE_STRING, NULL},
113 {mySTC_TYPE_CHARACTER, NULL},
114 {mySTC_TYPE_UUID, NULL},
115 {mySTC_TYPE_PREPROCESSOR, NULL},
116 {mySTC_TYPE_OPERATOR, NULL},
117 {mySTC_TYPE_IDENTIFIER, NULL},
118 {mySTC_TYPE_STRING_EOL, NULL},
119 {mySTC_TYPE_DEFAULT, NULL}, // VERBATIM
120 {mySTC_TYPE_REGEX, NULL},
121 {mySTC_TYPE_COMMENT_SPECIAL, NULL}, // DOXY
122 {mySTC_TYPE_WORD2, CppWordlist2}, // EXTRA WORDS
123 {mySTC_TYPE_WORD3, CppWordlist3}, // DOXY KEYWORDS
124 {mySTC_TYPE_ERROR, NULL}, // KEYWORDS ERROR
125 {-1, NULL},
126 {-1, NULL},
127 {-1, NULL},
128 {-1, NULL},
129 {-1, NULL},
130 {-1, NULL},
131 {-1, NULL},
132 {-1, NULL},
133 {-1, NULL},
134 {-1, NULL},
135 {-1, NULL},
136 {-1, NULL},
137 {-1, NULL}},
138 mySTC_FOLD_COMMENT | mySTC_FOLD_COMPACT | mySTC_FOLD_PREPROC},
139 // Python
140 {"Python",
141 "*.py;*.pyw",
142 wxSTC_LEX_PYTHON,
143 {{mySTC_TYPE_DEFAULT, NULL},
144 {mySTC_TYPE_COMMENT_LINE, NULL},
145 {mySTC_TYPE_NUMBER, NULL},
146 {mySTC_TYPE_STRING, NULL},
147 {mySTC_TYPE_CHARACTER, NULL},
148 {mySTC_TYPE_WORD1, PythonWordlist1}, // KEYWORDS
149 {mySTC_TYPE_DEFAULT, NULL}, // TRIPLE
150 {mySTC_TYPE_DEFAULT, NULL}, // TRIPLEDOUBLE
151 {mySTC_TYPE_DEFAULT, NULL}, // CLASSNAME
152 {mySTC_TYPE_DEFAULT, PythonWordlist2}, // DEFNAME
153 {mySTC_TYPE_OPERATOR, NULL},
154 {mySTC_TYPE_IDENTIFIER, NULL},
155 {mySTC_TYPE_DEFAULT, NULL}, // COMMENT_BLOCK
156 {mySTC_TYPE_STRING_EOL, NULL},
157 {-1, NULL},
158 {-1, NULL},
159 {-1, NULL},
160 {-1, NULL},
161 {-1, NULL},
162 {-1, NULL},
163 {-1, NULL},
164 {-1, NULL},
165 {-1, NULL},
166 {-1, NULL},
167 {-1, NULL},
168 {-1, NULL},
169 {-1, NULL},
170 {-1, NULL},
171 {-1, NULL},
172 {-1, NULL},
173 {-1, NULL},
174 {-1, NULL}},
175 mySTC_FOLD_COMMENTPY | mySTC_FOLD_QUOTESPY},
176 // * (any)
177 {wxTRANSLATE(DEFAULT_LANGUAGE),
178 "*.*",
179 wxSTC_LEX_PROPERTIES,
180 {{mySTC_TYPE_DEFAULT, NULL},
181 {mySTC_TYPE_DEFAULT, NULL},
182 {mySTC_TYPE_DEFAULT, NULL},
183 {mySTC_TYPE_DEFAULT, NULL},
184 {mySTC_TYPE_DEFAULT, NULL},
185 {-1, NULL},
186 {-1, NULL},
187 {-1, NULL},
188 {-1, NULL},
189 {-1, NULL},
190 {-1, NULL},
191 {-1, NULL},
192 {-1, NULL},
193 {-1, NULL},
194 {-1, NULL},
195 {-1, NULL},
196 {-1, NULL},
197 {-1, NULL},
198 {-1, NULL},
199 {-1, NULL},
200 {-1, NULL},
201 {-1, NULL},
202 {-1, NULL},
203 {-1, NULL},
204 {-1, NULL},
205 {-1, NULL},
206 {-1, NULL},
207 {-1, NULL},
208 {-1, NULL},
209 {-1, NULL},
210 {-1, NULL},
211 {-1, NULL}},
212 0},
213 };
214
215 const int g_LanguagePrefsSize = WXSIZEOF(g_LanguagePrefs);
216
217 //----------------------------------------------------------------------------
218 //! style types
219 const StyleInfo g_StylePrefs [] = {
220 // mySTC_TYPE_DEFAULT
221 {wxT("Default"),
222 wxT("BLACK"), wxT("WHITE"),
223 wxT(""), 10, 0, 0},
224
225 // mySTC_TYPE_WORD1
226 {wxT("Keyword1"),
227 wxT("BLUE"), wxT("WHITE"),
228 wxT(""), 10, mySTC_STYLE_BOLD, 0},
229
230 // mySTC_TYPE_WORD2
231 {wxT("Keyword2"),
232 wxT("MIDNIGHT BLUE"), wxT("WHITE"),
233 wxT(""), 10, 0, 0},
234
235 // mySTC_TYPE_WORD3
236 {wxT("Keyword3"),
237 wxT("CORNFLOWER BLUE"), wxT("WHITE"),
238 wxT(""), 10, 0, 0},
239
240 // mySTC_TYPE_WORD4
241 {wxT("Keyword4"),
242 wxT("CYAN"), wxT("WHITE"),
243 wxT(""), 10, 0, 0},
244
245 // mySTC_TYPE_WORD5
246 {wxT("Keyword5"),
247 wxT("DARK GREY"), wxT("WHITE"),
248 wxT(""), 10, 0, 0},
249
250 // mySTC_TYPE_WORD6
251 {wxT("Keyword6"),
252 wxT("GREY"), wxT("WHITE"),
253 wxT(""), 10, 0, 0},
254
255 // mySTC_TYPE_COMMENT
256 {wxT("Comment"),
257 wxT("FOREST GREEN"), wxT("WHITE"),
258 wxT(""), 10, 0, 0},
259
260 // mySTC_TYPE_COMMENT_DOC
261 {wxT("Comment (Doc)"),
262 wxT("FOREST GREEN"), wxT("WHITE"),
263 wxT(""), 10, 0, 0},
264
265 // mySTC_TYPE_COMMENT_LINE
266 {wxT("Comment line"),
267 wxT("FOREST GREEN"), wxT("WHITE"),
268 wxT(""), 10, 0, 0},
269
270 // mySTC_TYPE_COMMENT_SPECIAL
271 {wxT("Special comment"),
272 wxT("FOREST GREEN"), wxT("WHITE"),
273 wxT(""), 10, mySTC_STYLE_ITALIC, 0},
274
275 // mySTC_TYPE_CHARACTER
276 {wxT("Character"),
277 wxT("KHAKI"), wxT("WHITE"),
278 wxT(""), 10, 0, 0},
279
280 // mySTC_TYPE_CHARACTER_EOL
281 {wxT("Character (EOL)"),
282 wxT("KHAKI"), wxT("WHITE"),
283 wxT(""), 10, 0, 0},
284
285 // mySTC_TYPE_STRING
286 {wxT("String"),
287 wxT("BROWN"), wxT("WHITE"),
288 wxT(""), 10, 0, 0},
289
290 // mySTC_TYPE_STRING_EOL
291 {wxT("String (EOL)"),
292 wxT("BROWN"), wxT("WHITE"),
293 wxT(""), 10, 0, 0},
294
295 // mySTC_TYPE_DELIMITER
296 {wxT("Delimiter"),
297 wxT("ORANGE"), wxT("WHITE"),
298 wxT(""), 10, 0, 0},
299
300 // mySTC_TYPE_PUNCTUATION
301 {wxT("Punctuation"),
302 wxT("ORANGE"), wxT("WHITE"),
303 wxT(""), 10, 0, 0},
304
305 // mySTC_TYPE_OPERATOR
306 {wxT("Operator"),
307 wxT("BLACK"), wxT("WHITE"),
308 wxT(""), 10, mySTC_STYLE_BOLD, 0},
309
310 // mySTC_TYPE_BRACE
311 {wxT("Label"),
312 wxT("VIOLET"), wxT("WHITE"),
313 wxT(""), 10, 0, 0},
314
315 // mySTC_TYPE_COMMAND
316 {wxT("Command"),
317 wxT("BLUE"), wxT("WHITE"),
318 wxT(""), 10, 0, 0},
319
320 // mySTC_TYPE_IDENTIFIER
321 {wxT("Identifier"),
322 wxT("BLACK"), wxT("WHITE"),
323 wxT(""), 10, 0, 0},
324
325 // mySTC_TYPE_LABEL
326 {wxT("Label"),
327 wxT("VIOLET"), wxT("WHITE"),
328 wxT(""), 10, 0, 0},
329
330 // mySTC_TYPE_NUMBER
331 {wxT("Number"),
332 wxT("SIENNA"), wxT("WHITE"),
333 wxT(""), 10, 0, 0},
334
335 // mySTC_TYPE_PARAMETER
336 {wxT("Parameter"),
337 wxT("VIOLET"), wxT("WHITE"),
338 wxT(""), 10, mySTC_STYLE_ITALIC, 0},
339
340 // mySTC_TYPE_REGEX
341 {wxT("Regular expression"),
342 wxT("ORCHID"), wxT("WHITE"),
343 wxT(""), 10, 0, 0},
344
345 // mySTC_TYPE_UUID
346 {wxT("UUID"),
347 wxT("ORCHID"), wxT("WHITE"),
348 wxT(""), 10, 0, 0},
349
350 // mySTC_TYPE_VALUE
351 {wxT("Value"),
352 wxT("ORCHID"), wxT("WHITE"),
353 wxT(""), 10, mySTC_STYLE_ITALIC, 0},
354
355 // mySTC_TYPE_PREPROCESSOR
356 {wxT("Preprocessor"),
357 wxT("GREY"), wxT("WHITE"),
358 wxT(""), 10, 0, 0},
359
360 // mySTC_TYPE_SCRIPT
361 {wxT("Script"),
362 wxT("DARK GREY"), wxT("WHITE"),
363 wxT(""), 10, 0, 0},
364
365 // mySTC_TYPE_ERROR
366 {wxT("Error"),
367 wxT("RED"), wxT("WHITE"),
368 wxT(""), 10, 0, 0},
369
370 // mySTC_TYPE_UNDEFINED
371 {wxT("Undefined"),
372 wxT("ORANGE"), wxT("WHITE"),
373 wxT(""), 10, 0, 0}
374
375 };
376
377 const int g_StylePrefsSize = WXSIZEOF(g_StylePrefs);