]> git.saurik.com Git - wxWidgets.git/blame - include/wx/stc/stc.h
fix memory leak as Dimitri suggested
[wxWidgets.git] / include / wx / stc / stc.h
CommitLineData
9ce192d4
RD
1////////////////////////////////////////////////////////////////////////////
2// Name: stc.h
3// Purpose: A wxWindows implementation of Scintilla. This class is the
4// one meant to be used directly by wx applications. It does not
5// derive directly from the Scintilla classes, and in fact there
6// is no mention of Scintilla classes at all in this header.
7// This class delegates all method calls and events to the
8// Scintilla objects and so forth. This allows the use of
9// Scintilla without polluting the namespace with all the
10// classes and itentifiers from Scintilla.
11//
12// Author: Robin Dunn
13//
14// Created: 13-Jan-2000
15// RCS-ID: $Id$
16// Copyright: (c) 2000 by Total Control Software
17// Licence: wxWindows license
18/////////////////////////////////////////////////////////////////////////////
19
20#ifndef __stc_h__
21#define __stc_h__
22
23
24#include <wx/wx.h>
a29a241f 25#include <wx/dnd.h>
9ce192d4 26
402ce755
RD
27#ifndef SWIG
28/*
29 * If we're using wx in Dynamic Library format do we
30 * want wxStyledTextCtrl to be in DLL form as well?
31 */
32#if defined(WXUSINGDLL) && \
33 (defined(WXMAKING_STC_DLL) || defined(WXUSING_STC_DLL))
34
35#if defined(WXMAKING_STC_DLL)
36 // When building the DLL WXSTC_DECLSPEC exports classes
37# define WXSTC_DECLSPEC WXEXPORT
38#elif defined(WXUSING_STC_DLL)
39 // When using the DLL WXSTC_DECLSPEC imports classes
40# define WXSTC_DECLSPEC WXIMPORT
41#endif // defined(WXBUILD_STC_DLL)
42
2b5f62a0 43#else
402ce755
RD
44// When building the static library nullify the effect of WXSTC_DECLSPEC
45#define WXSTC_DECLSPEC
46#endif // WXUSINGDLL && (WXMAKING_STC_DLL || WXUSING_STC_DLL)
47
48#endif // SWIG
49
2b5f62a0 50
9c46ea66
RD
51//----------------------------------------------------------------------
52
53// Should a wxPopupWindow be used for the call tips and autocomplete windows?
54#ifndef wxSTC_USE_POPUP
55#define wxSTC_USE_POPUP 1
56#endif
57
9ce192d4 58//----------------------------------------------------------------------
4370573a
RD
59// BEGIN generated section. The following code is automatically generated
60// by gen_iface.py. Do not edit this file. Edit stc.h.in instead
61// and regenerate
62
63#define wxSTC_INVALID_POSITION -1
d25f5fbb
RD
64
65// Define start of Scintilla messages to be greater than all edit (EM_*) messages
66// as many EM_ messages can be used although that use is deprecated.
4370573a
RD
67#define wxSTC_START 2000
68#define wxSTC_OPTIONAL_START 3000
69#define wxSTC_LEXER_START 4000
4370573a
RD
70#define wxSTC_WS_INVISIBLE 0
71#define wxSTC_WS_VISIBLEALWAYS 1
72#define wxSTC_WS_VISIBLEAFTERINDENT 2
73#define wxSTC_EOL_CRLF 0
74#define wxSTC_EOL_CR 1
75#define wxSTC_EOL_LF 2
76
77// The SC_CP_UTF8 value can be used to enter Unicode mode.
78// This is the same value as CP_UTF8 in Windows
79#define wxSTC_CP_UTF8 65001
80#define wxSTC_MARKER_MAX 31
81#define wxSTC_MARK_CIRCLE 0
82#define wxSTC_MARK_ROUNDRECT 1
83#define wxSTC_MARK_ARROW 2
84#define wxSTC_MARK_SMALLRECT 3
85#define wxSTC_MARK_SHORTARROW 4
86#define wxSTC_MARK_EMPTY 5
87#define wxSTC_MARK_ARROWDOWN 6
88#define wxSTC_MARK_MINUS 7
89#define wxSTC_MARK_PLUS 8
65ec6247 90
a834585d 91// Shapes used for outlining column.
65ec6247
RD
92#define wxSTC_MARK_VLINE 9
93#define wxSTC_MARK_LCORNER 10
94#define wxSTC_MARK_TCORNER 11
95#define wxSTC_MARK_BOXPLUS 12
96#define wxSTC_MARK_BOXPLUSCONNECTED 13
97#define wxSTC_MARK_BOXMINUS 14
98#define wxSTC_MARK_BOXMINUSCONNECTED 15
99#define wxSTC_MARK_LCORNERCURVE 16
100#define wxSTC_MARK_TCORNERCURVE 17
101#define wxSTC_MARK_CIRCLEPLUS 18
102#define wxSTC_MARK_CIRCLEPLUSCONNECTED 19
103#define wxSTC_MARK_CIRCLEMINUS 20
104#define wxSTC_MARK_CIRCLEMINUSCONNECTED 21
1a2fb4cd 105
a834585d 106// Invisible mark that only sets the line background color.
1a2fb4cd 107#define wxSTC_MARK_BACKGROUND 22
f114b858
RD
108#define wxSTC_MARK_DOTDOTDOT 23
109#define wxSTC_MARK_ARROWS 24
b8b0e402 110#define wxSTC_MARK_CHARACTER 10000
65ec6247 111
a834585d 112// Markers used for outlining column.
65ec6247
RD
113#define wxSTC_MARKNUM_FOLDEREND 25
114#define wxSTC_MARKNUM_FOLDEROPENMID 26
115#define wxSTC_MARKNUM_FOLDERMIDTAIL 27
116#define wxSTC_MARKNUM_FOLDERTAIL 28
117#define wxSTC_MARKNUM_FOLDERSUB 29
4370573a
RD
118#define wxSTC_MARKNUM_FOLDER 30
119#define wxSTC_MARKNUM_FOLDEROPEN 31
1a2fb4cd 120#define wxSTC_MASK_FOLDERS 0xFE000000
4370573a
RD
121#define wxSTC_MARGIN_SYMBOL 0
122#define wxSTC_MARGIN_NUMBER 1
b8b0e402
RD
123
124// Styles in range 32..37 are predefined for parts of the UI and are not used as normal styles.
125// Styles 38 and 39 are for future use.
4370573a
RD
126#define wxSTC_STYLE_DEFAULT 32
127#define wxSTC_STYLE_LINENUMBER 33
128#define wxSTC_STYLE_BRACELIGHT 34
129#define wxSTC_STYLE_BRACEBAD 35
130#define wxSTC_STYLE_CONTROLCHAR 36
131#define wxSTC_STYLE_INDENTGUIDE 37
b8b0e402 132#define wxSTC_STYLE_LASTPREDEFINED 39
4370573a
RD
133#define wxSTC_STYLE_MAX 127
134
135// Character set identifiers are used in StyleSetCharacterSet.
136// The values are the same as the Windows *_CHARSET values.
137#define wxSTC_CHARSET_ANSI 0
138#define wxSTC_CHARSET_DEFAULT 1
139#define wxSTC_CHARSET_BALTIC 186
140#define wxSTC_CHARSET_CHINESEBIG5 136
141#define wxSTC_CHARSET_EASTEUROPE 238
142#define wxSTC_CHARSET_GB2312 134
143#define wxSTC_CHARSET_GREEK 161
144#define wxSTC_CHARSET_HANGUL 129
145#define wxSTC_CHARSET_MAC 77
146#define wxSTC_CHARSET_OEM 255
147#define wxSTC_CHARSET_RUSSIAN 204
148#define wxSTC_CHARSET_SHIFTJIS 128
149#define wxSTC_CHARSET_SYMBOL 2
150#define wxSTC_CHARSET_TURKISH 162
151#define wxSTC_CHARSET_JOHAB 130
152#define wxSTC_CHARSET_HEBREW 177
153#define wxSTC_CHARSET_ARABIC 178
154#define wxSTC_CHARSET_VIETNAMESE 163
155#define wxSTC_CHARSET_THAI 222
65ec6247
RD
156#define wxSTC_CASE_MIXED 0
157#define wxSTC_CASE_UPPER 1
158#define wxSTC_CASE_LOWER 2
4370573a
RD
159#define wxSTC_INDIC_MAX 7
160#define wxSTC_INDIC_PLAIN 0
161#define wxSTC_INDIC_SQUIGGLE 1
162#define wxSTC_INDIC_TT 2
163#define wxSTC_INDIC_DIAGONAL 3
164#define wxSTC_INDIC_STRIKE 4
1a2fb4cd
RD
165#define wxSTC_INDIC0_MASK 0x20
166#define wxSTC_INDIC1_MASK 0x40
167#define wxSTC_INDIC2_MASK 0x80
168#define wxSTC_INDICS_MASK 0xE0
4370573a
RD
169
170// PrintColourMode - use same colours as screen.
171#define wxSTC_PRINT_NORMAL 0
172
173// PrintColourMode - invert the light value of each style for printing.
174#define wxSTC_PRINT_INVERTLIGHT 1
175
176// PrintColourMode - force black text on white background for printing.
177#define wxSTC_PRINT_BLACKONWHITE 2
65ec6247
RD
178
179// PrintColourMode - text stays coloured, but all background is forced to be white for printing.
180#define wxSTC_PRINT_COLOURONWHITE 3
181
182// PrintColourMode - only the default-background is forced to be white for printing.
183#define wxSTC_PRINT_COLOURONWHITEDEFAULTBG 4
4370573a
RD
184#define wxSTC_FIND_WHOLEWORD 2
185#define wxSTC_FIND_MATCHCASE 4
186#define wxSTC_FIND_WORDSTART 0x00100000
4370573a 187#define wxSTC_FIND_REGEXP 0x00200000
4370573a
RD
188#define wxSTC_FOLDLEVELBASE 0x400
189#define wxSTC_FOLDLEVELWHITEFLAG 0x1000
190#define wxSTC_FOLDLEVELHEADERFLAG 0x2000
191#define wxSTC_FOLDLEVELNUMBERMASK 0x0FFF
65ec6247 192#define wxSTC_TIME_FOREVER 10000000
1a2fb4cd
RD
193#define wxSTC_WRAP_NONE 0
194#define wxSTC_WRAP_WORD 1
195#define wxSTC_CACHE_NONE 0
196#define wxSTC_CACHE_CARET 1
197#define wxSTC_CACHE_PAGE 2
198#define wxSTC_CACHE_DOCUMENT 3
4370573a
RD
199#define wxSTC_EDGE_NONE 0
200#define wxSTC_EDGE_LINE 1
201#define wxSTC_EDGE_BACKGROUND 2
a834585d
RD
202#define wxSTC_CURSORNORMAL -1
203#define wxSTC_CURSORWAIT 3
4370573a 204
a834585d
RD
205// Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
206#define wxSTC_VISIBLE_SLOP 0x01
207#define wxSTC_VISIBLE_STRICT 0x04
4370573a 208
a834585d
RD
209// Caret policy, used by SetXCaretPolicy and SetYCaretPolicy.
210// If CARET_SLOP is set, we can define a slop value: caretSlop.
211// This value defines an unwanted zone (UZ) where the caret is... unwanted.
212// This zone is defined as a number of pixels near the vertical margins,
213// and as a number of lines near the horizontal margins.
214// By keeping the caret away from the edges, it is seen within its context,
215// so it is likely that the identifier that the caret is on can be completely seen,
216// and that the current line is seen with some of the lines following it which are
217// often dependent on that line.
218#define wxSTC_CARET_SLOP 0x01
4370573a 219
a834585d
RD
220// If CARET_STRICT is set, the policy is enforced... strictly.
221// The caret is centred on the display if slop is not set,
222// and cannot go in the UZ if slop is set.
4370573a
RD
223#define wxSTC_CARET_STRICT 0x04
224
a834585d
RD
225// If CARET_JUMPS is set, the display is moved more energetically
226// so the caret can move in the same direction longer before the policy is applied again.
227#define wxSTC_CARET_JUMPS 0x10
65ec6247 228
a834585d
RD
229// If CARET_EVEN is not set, instead of having symmetrical UZs,
230// the left and bottom UZs are extended up to right and top UZs respectively.
231// This way, we favour the displaying of useful information: the begining of lines,
232// where most code reside, and the lines after the caret, eg. the body of a function.
233#define wxSTC_CARET_EVEN 0x08
65ec6247 234
4370573a 235// Notifications
a834585d 236// Type of modification and the action which caused the modification.
4370573a
RD
237// These are defined as a bit mask to make it easy to specify which notifications are wanted.
238// One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
239#define wxSTC_MOD_INSERTTEXT 0x1
240#define wxSTC_MOD_DELETETEXT 0x2
241#define wxSTC_MOD_CHANGESTYLE 0x4
242#define wxSTC_MOD_CHANGEFOLD 0x8
243#define wxSTC_PERFORMED_USER 0x10
244#define wxSTC_PERFORMED_UNDO 0x20
245#define wxSTC_PERFORMED_REDO 0x40
246#define wxSTC_LASTSTEPINUNDOREDO 0x100
247#define wxSTC_MOD_CHANGEMARKER 0x200
248#define wxSTC_MOD_BEFOREINSERT 0x400
249#define wxSTC_MOD_BEFOREDELETE 0x800
250#define wxSTC_MODEVENTMASKALL 0xF77
251
a834585d
RD
252// Symbolic key codes and modifier flags.
253// ASCII and other printable characters below 256.
254// Extended keys above 300.
4370573a
RD
255#define wxSTC_KEY_DOWN 300
256#define wxSTC_KEY_UP 301
257#define wxSTC_KEY_LEFT 302
258#define wxSTC_KEY_RIGHT 303
259#define wxSTC_KEY_HOME 304
260#define wxSTC_KEY_END 305
261#define wxSTC_KEY_PRIOR 306
262#define wxSTC_KEY_NEXT 307
263#define wxSTC_KEY_DELETE 308
264#define wxSTC_KEY_INSERT 309
265#define wxSTC_KEY_ESCAPE 7
266#define wxSTC_KEY_BACK 8
267#define wxSTC_KEY_TAB 9
268#define wxSTC_KEY_RETURN 13
269#define wxSTC_KEY_ADD 310
270#define wxSTC_KEY_SUBTRACT 311
271#define wxSTC_KEY_DIVIDE 312
272#define wxSTC_SCMOD_SHIFT 1
273#define wxSTC_SCMOD_CTRL 2
274#define wxSTC_SCMOD_ALT 4
275
276// For SciLexer.h
277#define wxSTC_LEX_CONTAINER 0
278#define wxSTC_LEX_NULL 1
279#define wxSTC_LEX_PYTHON 2
280#define wxSTC_LEX_CPP 3
281#define wxSTC_LEX_HTML 4
282#define wxSTC_LEX_XML 5
283#define wxSTC_LEX_PERL 6
284#define wxSTC_LEX_SQL 7
285#define wxSTC_LEX_VB 8
286#define wxSTC_LEX_PROPERTIES 9
287#define wxSTC_LEX_ERRORLIST 10
288#define wxSTC_LEX_MAKEFILE 11
289#define wxSTC_LEX_BATCH 12
290#define wxSTC_LEX_XCODE 13
291#define wxSTC_LEX_LATEX 14
292#define wxSTC_LEX_LUA 15
293#define wxSTC_LEX_DIFF 16
65ec6247
RD
294#define wxSTC_LEX_CONF 17
295#define wxSTC_LEX_PASCAL 18
296#define wxSTC_LEX_AVE 19
297#define wxSTC_LEX_ADA 20
298#define wxSTC_LEX_LISP 21
299#define wxSTC_LEX_RUBY 22
300#define wxSTC_LEX_EIFFEL 23
301#define wxSTC_LEX_EIFFELKW 24
302#define wxSTC_LEX_TCL 25
b8b0e402 303#define wxSTC_LEX_NNCRONTAB 26
1a2fb4cd
RD
304#define wxSTC_LEX_BULLANT 27
305#define wxSTC_LEX_VBSCRIPT 28
306#define wxSTC_LEX_ASP 29
307#define wxSTC_LEX_PHP 30
308#define wxSTC_LEX_BAAN 31
309#define wxSTC_LEX_MATLAB 32
a834585d 310#define wxSTC_LEX_SCRIPTOL 33
65ec6247
RD
311
312// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
313// value assigned in sequence from SCLEX_AUTOMATIC+1.
314#define wxSTC_LEX_AUTOMATIC 1000
4370573a
RD
315
316// Lexical states for SCLEX_PYTHON
317#define wxSTC_P_DEFAULT 0
318#define wxSTC_P_COMMENTLINE 1
319#define wxSTC_P_NUMBER 2
320#define wxSTC_P_STRING 3
321#define wxSTC_P_CHARACTER 4
322#define wxSTC_P_WORD 5
323#define wxSTC_P_TRIPLE 6
324#define wxSTC_P_TRIPLEDOUBLE 7
325#define wxSTC_P_CLASSNAME 8
326#define wxSTC_P_DEFNAME 9
327#define wxSTC_P_OPERATOR 10
328#define wxSTC_P_IDENTIFIER 11
329#define wxSTC_P_COMMENTBLOCK 12
330#define wxSTC_P_STRINGEOL 13
331
1a2fb4cd 332// Lexical states for SCLEX_CPP
4370573a
RD
333#define wxSTC_C_DEFAULT 0
334#define wxSTC_C_COMMENT 1
335#define wxSTC_C_COMMENTLINE 2
336#define wxSTC_C_COMMENTDOC 3
337#define wxSTC_C_NUMBER 4
338#define wxSTC_C_WORD 5
339#define wxSTC_C_STRING 6
340#define wxSTC_C_CHARACTER 7
341#define wxSTC_C_UUID 8
342#define wxSTC_C_PREPROCESSOR 9
343#define wxSTC_C_OPERATOR 10
344#define wxSTC_C_IDENTIFIER 11
345#define wxSTC_C_STRINGEOL 12
346#define wxSTC_C_VERBATIM 13
65ec6247
RD
347#define wxSTC_C_REGEX 14
348#define wxSTC_C_COMMENTLINEDOC 15
349#define wxSTC_C_WORD2 16
b8b0e402
RD
350#define wxSTC_C_COMMENTDOCKEYWORD 17
351#define wxSTC_C_COMMENTDOCKEYWORDERROR 18
4370573a
RD
352
353// Lexical states for SCLEX_HTML, SCLEX_XML
354#define wxSTC_H_DEFAULT 0
355#define wxSTC_H_TAG 1
356#define wxSTC_H_TAGUNKNOWN 2
357#define wxSTC_H_ATTRIBUTE 3
358#define wxSTC_H_ATTRIBUTEUNKNOWN 4
359#define wxSTC_H_NUMBER 5
360#define wxSTC_H_DOUBLESTRING 6
361#define wxSTC_H_SINGLESTRING 7
362#define wxSTC_H_OTHER 8
363#define wxSTC_H_COMMENT 9
364#define wxSTC_H_ENTITY 10
365
366// XML and ASP
367#define wxSTC_H_TAGEND 11
368#define wxSTC_H_XMLSTART 12
369#define wxSTC_H_XMLEND 13
370#define wxSTC_H_SCRIPT 14
371#define wxSTC_H_ASP 15
372#define wxSTC_H_ASPAT 16
373#define wxSTC_H_CDATA 17
374#define wxSTC_H_QUESTION 18
375
376// More HTML
377#define wxSTC_H_VALUE 19
378
65ec6247
RD
379// X-Code
380#define wxSTC_H_XCCOMMENT 20
381
382// SGML
b8b0e402
RD
383#define wxSTC_H_SGML_DEFAULT 21
384#define wxSTC_H_SGML_COMMAND 22
385#define wxSTC_H_SGML_1ST_PARAM 23
386#define wxSTC_H_SGML_DOUBLESTRING 24
387#define wxSTC_H_SGML_SIMPLESTRING 25
388#define wxSTC_H_SGML_ERROR 26
389#define wxSTC_H_SGML_SPECIAL 27
390#define wxSTC_H_SGML_ENTITY 28
391#define wxSTC_H_SGML_COMMENT 29
392#define wxSTC_H_SGML_1ST_PARAM_COMMENT 30
393#define wxSTC_H_SGML_BLOCK_DEFAULT 31
65ec6247 394
4370573a
RD
395// Embedded Javascript
396#define wxSTC_HJ_START 40
397#define wxSTC_HJ_DEFAULT 41
398#define wxSTC_HJ_COMMENT 42
399#define wxSTC_HJ_COMMENTLINE 43
400#define wxSTC_HJ_COMMENTDOC 44
401#define wxSTC_HJ_NUMBER 45
402#define wxSTC_HJ_WORD 46
403#define wxSTC_HJ_KEYWORD 47
404#define wxSTC_HJ_DOUBLESTRING 48
405#define wxSTC_HJ_SINGLESTRING 49
406#define wxSTC_HJ_SYMBOLS 50
407#define wxSTC_HJ_STRINGEOL 51
65ec6247 408#define wxSTC_HJ_REGEX 52
4370573a
RD
409
410// ASP Javascript
411#define wxSTC_HJA_START 55
412#define wxSTC_HJA_DEFAULT 56
413#define wxSTC_HJA_COMMENT 57
414#define wxSTC_HJA_COMMENTLINE 58
415#define wxSTC_HJA_COMMENTDOC 59
416#define wxSTC_HJA_NUMBER 60
417#define wxSTC_HJA_WORD 61
418#define wxSTC_HJA_KEYWORD 62
419#define wxSTC_HJA_DOUBLESTRING 63
420#define wxSTC_HJA_SINGLESTRING 64
421#define wxSTC_HJA_SYMBOLS 65
422#define wxSTC_HJA_STRINGEOL 66
65ec6247 423#define wxSTC_HJA_REGEX 67
4370573a
RD
424
425// Embedded VBScript
426#define wxSTC_HB_START 70
427#define wxSTC_HB_DEFAULT 71
428#define wxSTC_HB_COMMENTLINE 72
429#define wxSTC_HB_NUMBER 73
430#define wxSTC_HB_WORD 74
431#define wxSTC_HB_STRING 75
432#define wxSTC_HB_IDENTIFIER 76
433#define wxSTC_HB_STRINGEOL 77
434
435// ASP VBScript
436#define wxSTC_HBA_START 80
437#define wxSTC_HBA_DEFAULT 81
438#define wxSTC_HBA_COMMENTLINE 82
439#define wxSTC_HBA_NUMBER 83
440#define wxSTC_HBA_WORD 84
441#define wxSTC_HBA_STRING 85
442#define wxSTC_HBA_IDENTIFIER 86
443#define wxSTC_HBA_STRINGEOL 87
444
445// Embedded Python
446#define wxSTC_HP_START 90
447#define wxSTC_HP_DEFAULT 91
448#define wxSTC_HP_COMMENTLINE 92
449#define wxSTC_HP_NUMBER 93
450#define wxSTC_HP_STRING 94
451#define wxSTC_HP_CHARACTER 95
452#define wxSTC_HP_WORD 96
453#define wxSTC_HP_TRIPLE 97
454#define wxSTC_HP_TRIPLEDOUBLE 98
455#define wxSTC_HP_CLASSNAME 99
456#define wxSTC_HP_DEFNAME 100
457#define wxSTC_HP_OPERATOR 101
458#define wxSTC_HP_IDENTIFIER 102
459
460// ASP Python
461#define wxSTC_HPA_START 105
462#define wxSTC_HPA_DEFAULT 106
463#define wxSTC_HPA_COMMENTLINE 107
464#define wxSTC_HPA_NUMBER 108
465#define wxSTC_HPA_STRING 109
466#define wxSTC_HPA_CHARACTER 110
467#define wxSTC_HPA_WORD 111
468#define wxSTC_HPA_TRIPLE 112
469#define wxSTC_HPA_TRIPLEDOUBLE 113
470#define wxSTC_HPA_CLASSNAME 114
471#define wxSTC_HPA_DEFNAME 115
472#define wxSTC_HPA_OPERATOR 116
473#define wxSTC_HPA_IDENTIFIER 117
474
475// PHP
476#define wxSTC_HPHP_DEFAULT 118
477#define wxSTC_HPHP_HSTRING 119
478#define wxSTC_HPHP_SIMPLESTRING 120
479#define wxSTC_HPHP_WORD 121
480#define wxSTC_HPHP_NUMBER 122
481#define wxSTC_HPHP_VARIABLE 123
482#define wxSTC_HPHP_COMMENT 124
483#define wxSTC_HPHP_COMMENTLINE 125
65ec6247
RD
484#define wxSTC_HPHP_HSTRING_VARIABLE 126
485#define wxSTC_HPHP_OPERATOR 127
4370573a
RD
486
487// Lexical states for SCLEX_PERL
488#define wxSTC_PL_DEFAULT 0
65ec6247 489#define wxSTC_PL_ERROR 1
4370573a
RD
490#define wxSTC_PL_COMMENTLINE 2
491#define wxSTC_PL_POD 3
492#define wxSTC_PL_NUMBER 4
493#define wxSTC_PL_WORD 5
494#define wxSTC_PL_STRING 6
495#define wxSTC_PL_CHARACTER 7
496#define wxSTC_PL_PUNCTUATION 8
497#define wxSTC_PL_PREPROCESSOR 9
498#define wxSTC_PL_OPERATOR 10
499#define wxSTC_PL_IDENTIFIER 11
500#define wxSTC_PL_SCALAR 12
501#define wxSTC_PL_ARRAY 13
502#define wxSTC_PL_HASH 14
503#define wxSTC_PL_SYMBOLTABLE 15
4370573a
RD
504#define wxSTC_PL_REGEX 17
505#define wxSTC_PL_REGSUBST 18
506#define wxSTC_PL_LONGQUOTE 19
507#define wxSTC_PL_BACKTICKS 20
508#define wxSTC_PL_DATASECTION 21
65ec6247
RD
509#define wxSTC_PL_HERE_DELIM 22
510#define wxSTC_PL_HERE_Q 23
511#define wxSTC_PL_HERE_QQ 24
512#define wxSTC_PL_HERE_QX 25
513#define wxSTC_PL_STRING_Q 26
514#define wxSTC_PL_STRING_QQ 27
515#define wxSTC_PL_STRING_QX 28
516#define wxSTC_PL_STRING_QR 29
517#define wxSTC_PL_STRING_QW 30
4370573a 518
a834585d
RD
519// Lexical states for SCLEX_VB, SCLEX_VBSCRIPT
520#define wxSTC_B_DEFAULT 0
521#define wxSTC_B_COMMENT 1
522#define wxSTC_B_NUMBER 2
523#define wxSTC_B_KEYWORD 3
524#define wxSTC_B_STRING 4
525#define wxSTC_B_PREPROCESSOR 5
526#define wxSTC_B_OPERATOR 6
527#define wxSTC_B_IDENTIFIER 7
528#define wxSTC_B_DATE 8
529
530// Lexical states for SCLEX_PROPERTIES
531#define wxSTC_PROPS_DEFAULT 0
532#define wxSTC_PROPS_COMMENT 1
533#define wxSTC_PROPS_SECTION 2
534#define wxSTC_PROPS_ASSIGNMENT 3
535#define wxSTC_PROPS_DEFVAL 4
536
4370573a
RD
537// Lexical states for SCLEX_LATEX
538#define wxSTC_L_DEFAULT 0
539#define wxSTC_L_COMMAND 1
540#define wxSTC_L_TAG 2
541#define wxSTC_L_MATH 3
542#define wxSTC_L_COMMENT 4
543
544// Lexical states for SCLEX_LUA
545#define wxSTC_LUA_DEFAULT 0
546#define wxSTC_LUA_COMMENT 1
547#define wxSTC_LUA_COMMENTLINE 2
548#define wxSTC_LUA_COMMENTDOC 3
549#define wxSTC_LUA_NUMBER 4
550#define wxSTC_LUA_WORD 5
551#define wxSTC_LUA_STRING 6
552#define wxSTC_LUA_CHARACTER 7
553#define wxSTC_LUA_LITERALSTRING 8
554#define wxSTC_LUA_PREPROCESSOR 9
555#define wxSTC_LUA_OPERATOR 10
556#define wxSTC_LUA_IDENTIFIER 11
557#define wxSTC_LUA_STRINGEOL 12
1a2fb4cd
RD
558#define wxSTC_LUA_WORD2 13
559#define wxSTC_LUA_WORD3 14
560#define wxSTC_LUA_WORD4 15
561#define wxSTC_LUA_WORD5 16
562#define wxSTC_LUA_WORD6 17
65ec6247
RD
563
564// Lexical states for SCLEX_ERRORLIST
4370573a
RD
565#define wxSTC_ERR_DEFAULT 0
566#define wxSTC_ERR_PYTHON 1
567#define wxSTC_ERR_GCC 2
568#define wxSTC_ERR_MS 3
569#define wxSTC_ERR_CMD 4
570#define wxSTC_ERR_BORLAND 5
571#define wxSTC_ERR_PERL 6
65ec6247
RD
572#define wxSTC_ERR_NET 7
573#define wxSTC_ERR_LUA 8
a834585d 574#define wxSTC_ERR_CTAG 9
65ec6247
RD
575#define wxSTC_ERR_DIFF_CHANGED 10
576#define wxSTC_ERR_DIFF_ADDITION 11
577#define wxSTC_ERR_DIFF_DELETION 12
578#define wxSTC_ERR_DIFF_MESSAGE 13
579
580// Lexical states for SCLEX_BATCH
581#define wxSTC_BAT_DEFAULT 0
582#define wxSTC_BAT_COMMENT 1
583#define wxSTC_BAT_WORD 2
584#define wxSTC_BAT_LABEL 3
585#define wxSTC_BAT_HIDE 4
586#define wxSTC_BAT_COMMAND 5
587#define wxSTC_BAT_IDENTIFIER 6
588#define wxSTC_BAT_OPERATOR 7
589
590// Lexical states for SCLEX_MAKEFILE
591#define wxSTC_MAKE_DEFAULT 0
592#define wxSTC_MAKE_COMMENT 1
593#define wxSTC_MAKE_PREPROCESSOR 2
594#define wxSTC_MAKE_IDENTIFIER 3
595#define wxSTC_MAKE_OPERATOR 4
596#define wxSTC_MAKE_TARGET 5
597#define wxSTC_MAKE_IDEOL 9
598
a834585d
RD
599// Lexical states for SCLEX_DIFF
600#define wxSTC_DIFF_DEFAULT 0
601#define wxSTC_DIFF_COMMENT 1
602#define wxSTC_DIFF_COMMAND 2
603#define wxSTC_DIFF_HEADER 3
604#define wxSTC_DIFF_POSITION 4
605#define wxSTC_DIFF_DELETED 5
606#define wxSTC_DIFF_ADDED 6
607
608// Lexical states for SCLEX_CONF (Apache Configuration Files Lexer)
65ec6247
RD
609#define wxSTC_CONF_DEFAULT 0
610#define wxSTC_CONF_COMMENT 1
611#define wxSTC_CONF_NUMBER 2
612#define wxSTC_CONF_IDENTIFIER 3
613#define wxSTC_CONF_EXTENSION 4
614#define wxSTC_CONF_PARAMETER 5
615#define wxSTC_CONF_STRING 6
616#define wxSTC_CONF_OPERATOR 7
617#define wxSTC_CONF_IP 8
618#define wxSTC_CONF_DIRECTIVE 9
619
a834585d 620// Lexical states for SCLEX_AVE, Avenue
65ec6247
RD
621#define wxSTC_AVE_DEFAULT 0
622#define wxSTC_AVE_COMMENT 1
623#define wxSTC_AVE_NUMBER 2
624#define wxSTC_AVE_WORD 3
625#define wxSTC_AVE_KEYWORD 4
626#define wxSTC_AVE_STATEMENT 5
627#define wxSTC_AVE_STRING 6
628#define wxSTC_AVE_ENUM 7
629#define wxSTC_AVE_STRINGEOL 8
630#define wxSTC_AVE_IDENTIFIER 9
631#define wxSTC_AVE_OPERATOR 10
632
633// Lexical states for SCLEX_ADA
634#define wxSTC_ADA_DEFAULT 0
635#define wxSTC_ADA_COMMENT 1
636#define wxSTC_ADA_NUMBER 2
637#define wxSTC_ADA_WORD 3
638#define wxSTC_ADA_STRING 4
639#define wxSTC_ADA_CHARACTER 5
640#define wxSTC_ADA_OPERATOR 6
641#define wxSTC_ADA_IDENTIFIER 7
642#define wxSTC_ADA_STRINGEOL 8
643
1a2fb4cd
RD
644// Lexical states for SCLEX_BAAN
645#define wxSTC_BAAN_DEFAULT 0
646#define wxSTC_BAAN_COMMENT 1
647#define wxSTC_BAAN_COMMENTDOC 2
648#define wxSTC_BAAN_NUMBER 3
649#define wxSTC_BAAN_WORD 4
650#define wxSTC_BAAN_STRING 5
651#define wxSTC_BAAN_PREPROCESSOR 6
652#define wxSTC_BAAN_OPERATOR 7
653#define wxSTC_BAAN_IDENTIFIER 8
654#define wxSTC_BAAN_STRINGEOL 9
655#define wxSTC_BAAN_WORD2 10
656
65ec6247
RD
657// Lexical states for SCLEX_LISP
658#define wxSTC_LISP_DEFAULT 0
659#define wxSTC_LISP_COMMENT 1
660#define wxSTC_LISP_NUMBER 2
661#define wxSTC_LISP_KEYWORD 3
662#define wxSTC_LISP_STRING 6
663#define wxSTC_LISP_STRINGEOL 8
664#define wxSTC_LISP_IDENTIFIER 9
665#define wxSTC_LISP_OPERATOR 10
666
667// Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW
668#define wxSTC_EIFFEL_DEFAULT 0
669#define wxSTC_EIFFEL_COMMENTLINE 1
670#define wxSTC_EIFFEL_NUMBER 2
671#define wxSTC_EIFFEL_WORD 3
672#define wxSTC_EIFFEL_STRING 4
673#define wxSTC_EIFFEL_CHARACTER 5
674#define wxSTC_EIFFEL_OPERATOR 6
675#define wxSTC_EIFFEL_IDENTIFIER 7
676#define wxSTC_EIFFEL_STRINGEOL 8
4370573a 677
a834585d 678// Lexical states for SCLEX_NNCRONTAB (nnCron crontab Lexer)
b8b0e402
RD
679#define wxSTC_NNCRONTAB_DEFAULT 0
680#define wxSTC_NNCRONTAB_COMMENT 1
681#define wxSTC_NNCRONTAB_TASK 2
682#define wxSTC_NNCRONTAB_SECTION 3
683#define wxSTC_NNCRONTAB_KEYWORD 4
684#define wxSTC_NNCRONTAB_MODIFIER 5
685#define wxSTC_NNCRONTAB_ASTERISK 6
686#define wxSTC_NNCRONTAB_NUMBER 7
687#define wxSTC_NNCRONTAB_STRING 8
688#define wxSTC_NNCRONTAB_ENVIRONMENT 9
689#define wxSTC_NNCRONTAB_IDENTIFIER 10
690
1a2fb4cd
RD
691// Lexical states for SCLEX_MATLAB
692#define wxSTC_MATLAB_DEFAULT 0
693#define wxSTC_MATLAB_COMMENT 1
694#define wxSTC_MATLAB_COMMAND 2
695#define wxSTC_MATLAB_NUMBER 3
696#define wxSTC_MATLAB_KEYWORD 4
697#define wxSTC_MATLAB_STRING 5
698#define wxSTC_MATLAB_OPERATOR 6
699#define wxSTC_MATLAB_IDENTIFIER 7
9ce192d4 700
a834585d
RD
701// Lexical states for SCLEX_SCRIPTOL
702#define wxSTC_SCRIPTOL_DEFAULT 0
703#define wxSTC_SCRIPTOL_COMMENT 1
704#define wxSTC_SCRIPTOL_COMMENTLINE 2
705#define wxSTC_SCRIPTOL_COMMENTDOC 3
706#define wxSTC_SCRIPTOL_NUMBER 4
707#define wxSTC_SCRIPTOL_WORD 5
708#define wxSTC_SCRIPTOL_STRING 6
709#define wxSTC_SCRIPTOL_CHARACTER 7
710#define wxSTC_SCRIPTOL_UUID 8
711#define wxSTC_SCRIPTOL_PREPROCESSOR 9
712#define wxSTC_SCRIPTOL_OPERATOR 10
713#define wxSTC_SCRIPTOL_IDENTIFIER 11
714#define wxSTC_SCRIPTOL_STRINGEOL 12
715#define wxSTC_SCRIPTOL_VERBATIM 13
716#define wxSTC_SCRIPTOL_REGEX 14
717#define wxSTC_SCRIPTOL_COMMENTLINEDOC 15
718#define wxSTC_SCRIPTOL_WORD2 16
719#define wxSTC_SCRIPTOL_COMMENTDOCKEYWORD 17
720#define wxSTC_SCRIPTOL_COMMENTDOCKEYWORDERROR 18
721#define wxSTC_SCRIPTOL_COMMENTBASIC 19
722
2b5f62a0
VZ
723
724//-----------------------------------------
725// Commands that can be bound to keystrokes
726
727// Redoes the next action on the undo history.
728#define wxSTC_CMD_REDO 2011
729
730// Select all the text in the document.
731#define wxSTC_CMD_SELECTALL 2013
732
733// Undo one action in the undo history.
734#define wxSTC_CMD_UNDO 2176
735
736// Cut the selection to the clipboard.
737#define wxSTC_CMD_CUT 2177
738
739// Copy the selection to the clipboard.
740#define wxSTC_CMD_COPY 2178
741
742// Paste the contents of the clipboard into the document replacing the selection.
743#define wxSTC_CMD_PASTE 2179
744
745// Clear the selection.
746#define wxSTC_CMD_CLEAR 2180
747
748// Move caret down one line.
749#define wxSTC_CMD_LINEDOWN 2300
750
751// Move caret down one line extending selection to new caret position.
752#define wxSTC_CMD_LINEDOWNEXTEND 2301
753
754// Move caret up one line.
755#define wxSTC_CMD_LINEUP 2302
756
757// Move caret up one line extending selection to new caret position.
758#define wxSTC_CMD_LINEUPEXTEND 2303
759
760// Move caret left one character.
761#define wxSTC_CMD_CHARLEFT 2304
762
763// Move caret left one character extending selection to new caret position.
764#define wxSTC_CMD_CHARLEFTEXTEND 2305
765
766// Move caret right one character.
767#define wxSTC_CMD_CHARRIGHT 2306
768
769// Move caret right one character extending selection to new caret position.
770#define wxSTC_CMD_CHARRIGHTEXTEND 2307
771
772// Move caret left one word.
773#define wxSTC_CMD_WORDLEFT 2308
774
775// Move caret left one word extending selection to new caret position.
776#define wxSTC_CMD_WORDLEFTEXTEND 2309
777
778// Move caret right one word.
779#define wxSTC_CMD_WORDRIGHT 2310
780
781// Move caret right one word extending selection to new caret position.
782#define wxSTC_CMD_WORDRIGHTEXTEND 2311
783
784// Move caret to first position on line.
785#define wxSTC_CMD_HOME 2312
786
787// Move caret to first position on line extending selection to new caret position.
788#define wxSTC_CMD_HOMEEXTEND 2313
789
790// Move caret to last position on line.
791#define wxSTC_CMD_LINEEND 2314
792
793// Move caret to last position on line extending selection to new caret position.
794#define wxSTC_CMD_LINEENDEXTEND 2315
795
796// Move caret to first position in document.
797#define wxSTC_CMD_DOCUMENTSTART 2316
798
799// Move caret to first position in document extending selection to new caret position.
800#define wxSTC_CMD_DOCUMENTSTARTEXTEND 2317
801
802// Move caret to last position in document.
803#define wxSTC_CMD_DOCUMENTEND 2318
804
805// Move caret to last position in document extending selection to new caret position.
806#define wxSTC_CMD_DOCUMENTENDEXTEND 2319
807
808// Move caret one page up.
809#define wxSTC_CMD_PAGEUP 2320
810
811// Move caret one page up extending selection to new caret position.
812#define wxSTC_CMD_PAGEUPEXTEND 2321
813
814// Move caret one page down.
815#define wxSTC_CMD_PAGEDOWN 2322
816
817// Move caret one page down extending selection to new caret position.
818#define wxSTC_CMD_PAGEDOWNEXTEND 2323
819
820// Switch from insert to overtype mode or the reverse.
821#define wxSTC_CMD_EDITTOGGLEOVERTYPE 2324
822
823// Cancel any modes such as call tip or auto-completion list display.
824#define wxSTC_CMD_CANCEL 2325
825
826// Delete the selection or if no selection, the character before the caret.
827#define wxSTC_CMD_DELETEBACK 2326
828
829// If selection is empty or all on one line replace the selection with a tab character.
830// If more than one line selected, indent the lines.
831#define wxSTC_CMD_TAB 2327
832
833// Dedent the selected lines.
834#define wxSTC_CMD_BACKTAB 2328
835
836// Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
837#define wxSTC_CMD_NEWLINE 2329
838
839// Insert a Form Feed character.
840#define wxSTC_CMD_FORMFEED 2330
841
842// Move caret to before first visible character on line.
843// If already there move to first character on line.
844#define wxSTC_CMD_VCHOME 2331
845
846// Like VCHome but extending selection to new caret position.
847#define wxSTC_CMD_VCHOMEEXTEND 2332
848
849// Magnify the displayed text by increasing the sizes by 1 point.
850#define wxSTC_CMD_ZOOMIN 2333
851
852// Make the displayed text smaller by decreasing the sizes by 1 point.
853#define wxSTC_CMD_ZOOMOUT 2334
854
855// Delete the word to the left of the caret.
856#define wxSTC_CMD_DELWORDLEFT 2335
857
858// Delete the word to the right of the caret.
859#define wxSTC_CMD_DELWORDRIGHT 2336
860
861// Cut the line containing the caret.
862#define wxSTC_CMD_LINECUT 2337
863
864// Delete the line containing the caret.
865#define wxSTC_CMD_LINEDELETE 2338
866
867// Switch the current line with the previous.
868#define wxSTC_CMD_LINETRANSPOSE 2339
869
870// Transform the selection to lower case.
871#define wxSTC_CMD_LOWERCASE 2340
872
873// Transform the selection to upper case.
874#define wxSTC_CMD_UPPERCASE 2341
875
876// Scroll the document down, keeping the caret visible.
877#define wxSTC_CMD_LINESCROLLDOWN 2342
878
879// Scroll the document up, keeping the caret visible.
880#define wxSTC_CMD_LINESCROLLUP 2343
881
882// Delete the selection or if no selection, the character before the caret.
883// Will not delete the character before at the start of a line.
884#define wxSTC_CMD_DELETEBACKNOTLINE 2344
885
886// Move caret to first position on display line.
887#define wxSTC_CMD_HOMEDISPLAY 2345
888
889// Move caret to first position on display line extending selection to
890// new caret position.
891#define wxSTC_CMD_HOMEDISPLAYEXTEND 2346
892
893// Move caret to last position on display line.
894#define wxSTC_CMD_LINEENDDISPLAY 2347
895
896// Move caret to last position on display line extending selection to new
897// caret position.
898#define wxSTC_CMD_LINEENDDISPLAYEXTEND 2348
899
900// Move to the previous change in capitalisation.
901#define wxSTC_CMD_WORDPARTLEFT 2390
902
903// Move to the previous change in capitalisation extending selection
904// to new caret position.
905#define wxSTC_CMD_WORDPARTLEFTEXTEND 2391
906
907// Move to the change next in capitalisation.
908#define wxSTC_CMD_WORDPARTRIGHT 2392
909
910// Move to the next change in capitalisation extending selection
911// to new caret position.
912#define wxSTC_CMD_WORDPARTRIGHTEXTEND 2393
913
914// Delete back from the current position to the start of the line.
915#define wxSTC_CMD_DELLINELEFT 2395
916
917// Delete forwards from the current position to the end of the line.
918#define wxSTC_CMD_DELLINERIGHT 2396
919
920
1a2fb4cd 921// END of generated section
4370573a 922//----------------------------------------------------------------------
9ce192d4
RD
923
924class ScintillaWX; // forward declare
925class WordList;
926struct SCNotification;
927
2b5f62a0 928#ifndef SWIG
402ce755
RD
929extern WXSTC_DECLSPEC const wxChar* wxSTCNameStr;
930class WXSTC_DECLSPEC wxStyledTextCtrl;
931class WXSTC_DECLSPEC wxStyledTextEvent;
2b5f62a0 932#endif
9ce192d4
RD
933
934//----------------------------------------------------------------------
935
936class wxStyledTextCtrl : public wxControl {
937public:
938
f6bcfd97
BP
939#ifdef SWIG
940 wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
941 const wxPoint& pos = wxDefaultPosition,
942 const wxSize& size = wxDefaultSize, long style = 0,
137b5242 943 const wxString& name = wxPySTCNameStr);
0122b7e3
RD
944 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
945
f6bcfd97 946#else
9ce192d4
RD
947 wxStyledTextCtrl(wxWindow *parent, wxWindowID id,
948 const wxPoint& pos = wxDefaultPosition,
949 const wxSize& size = wxDefaultSize, long style = 0,
950 const wxString& name = wxSTCNameStr);
f6bcfd97
BP
951#endif
952
9ce192d4 953
f6bcfd97
BP
954#ifndef SWIG
955 ~wxStyledTextCtrl();
956#endif
9ce192d4 957
4370573a
RD
958//----------------------------------------------------------------------
959// BEGIN generated section. The following code is automatically generated
960// by gen_iface.py. Do not edit this file. Edit stc.h.in instead
961// and regenerate
9ce192d4 962
4370573a 963
a834585d 964 // Add text to the document.
4370573a
RD
965 void AddText(const wxString& text);
966
a834585d 967 // Add array of cells to document.
10ef30eb 968 void AddStyledText(const wxMemoryBuffer& data);
4370573a 969
a834585d 970 // Insert string at a position.
4370573a
RD
971 void InsertText(int pos, const wxString& text);
972
a834585d 973 // Delete all text in the document.
4370573a
RD
974 void ClearAll();
975
a834585d 976 // Set all style bytes to 0, remove all folding information.
4370573a
RD
977 void ClearDocumentStyle();
978
a834585d 979 // The number of characters in the document.
4370573a
RD
980 int GetLength();
981
a834585d 982 // Returns the character byte at the position.
4370573a
RD
983 int GetCharAt(int pos);
984
a834585d 985 // Returns the position of the caret.
4370573a
RD
986 int GetCurrentPos();
987
a834585d 988 // Returns the position of the opposite end of the selection to the caret.
4370573a
RD
989 int GetAnchor();
990
a834585d 991 // Returns the style byte at the position.
4370573a
RD
992 int GetStyleAt(int pos);
993
a834585d 994 // Redoes the next action on the undo history.
4370573a
RD
995 void Redo();
996
997 // Choose between collecting actions into the undo
998 // history and discarding them.
999 void SetUndoCollection(bool collectUndo);
1000
1001 // Select all the text in the document.
1002 void SelectAll();
1003
1004 // Remember the current position in the undo history as the position
1005 // at which the document was saved.
1006 void SetSavePoint();
1007
1008 // Retrieve a buffer of cells.
10ef30eb 1009 wxMemoryBuffer GetStyledText(int startPos, int endPos);
4370573a 1010
a834585d 1011 // Are there any redoable actions in the undo history?
4370573a
RD
1012 bool CanRedo();
1013
a834585d 1014 // Retrieve the line number at which a particular marker is located.
4370573a
RD
1015 int MarkerLineFromHandle(int handle);
1016
1017 // Delete a marker.
1018 void MarkerDeleteHandle(int handle);
1019
1020 // Is undo history being collected?
1021 bool GetUndoCollection();
1022
1023 // Are white space characters currently visible?
1024 // Returns one of SCWS_* constants.
1025 int GetViewWhiteSpace();
1026
1027 // Make white space characters invisible, always visible or visible outside indentation.
1028 void SetViewWhiteSpace(int viewWS);
1029
1030 // Find the position from a point within the window.
1031 int PositionFromPoint(wxPoint pt);
1032
65ec6247
RD
1033 // Find the position from a point within the window but return
1034 // INVALID_POSITION if not close to text.
1035 int PositionFromPointClose(int x, int y);
1036
4370573a
RD
1037 // Set caret to start of a line and ensure it is visible.
1038 void GotoLine(int line);
1039
1040 // Set caret to a position and ensure it is visible.
1041 void GotoPos(int pos);
1042
1043 // Set the selection anchor to a position. The anchor is the opposite
1044 // end of the selection from the caret.
1045 void SetAnchor(int posAnchor);
1046
1047 // Retrieve the text of the line containing the caret.
1048 // Returns the index of the caret on the line.
8de28db9
RD
1049 #ifdef SWIG
1050 wxString GetCurLine(int* OUTPUT);
1051#else
1052 wxString GetCurLine(int* linePos=NULL);
1053#endif
4370573a
RD
1054
1055 // Retrieve the position of the last correctly styled character.
1056 int GetEndStyled();
1057
65ec6247
RD
1058 // Convert all line endings in the document to one mode.
1059 void ConvertEOLs(int eolMode);
4370573a
RD
1060
1061 // Retrieve the current end of line mode - one of CRLF, CR, or LF.
1062 int GetEOLMode();
1063
1064 // Set the current end of line mode.
1065 void SetEOLMode(int eolMode);
1066
1067 // Set the current styling position to pos and the styling mask to mask.
a834585d 1068 // The styling mask can be used to protect some bits in each styling byte from modification.
4370573a
RD
1069 void StartStyling(int pos, int mask);
1070
1071 // Change style from current styling position for length characters to a style
1072 // and move the current styling position to after this newly styled segment.
1073 void SetStyling(int length, int style);
1074
a834585d 1075 // Is drawing done first into a buffer or direct to the screen?
4370573a
RD
1076 bool GetBufferedDraw();
1077
1078 // If drawing is buffered then each line of text is drawn into a bitmap buffer
1079 // before drawing it to the screen to avoid flicker.
1080 void SetBufferedDraw(bool buffered);
1081
a834585d 1082 // Change the visible size of a tab to be a multiple of the width of a space character.
4370573a
RD
1083 void SetTabWidth(int tabWidth);
1084
1085 // Retrieve the visible size of a tab.
1086 int GetTabWidth();
1087
1088 // Set the code page used to interpret the bytes of the document as characters.
4370573a
RD
1089 void SetCodePage(int codePage);
1090
1091 // Set the symbol used for a particular marker number,
1a2fb4cd 1092 // and optionally the fore and background colours.
4370573a
RD
1093 void MarkerDefine(int markerNumber, int markerSymbol,
1094 const wxColour& foreground = wxNullColour,
1095 const wxColour& background = wxNullColour);
1096
1097 // Set the foreground colour used for a particular marker number.
1098 void MarkerSetForeground(int markerNumber, const wxColour& fore);
1099
1100 // Set the background colour used for a particular marker number.
1101 void MarkerSetBackground(int markerNumber, const wxColour& back);
1102
1a2fb4cd
RD
1103 // Add a marker to a line, returning an ID which can be used to find or delete the marker.
1104 int MarkerAdd(int line, int markerNumber);
4370573a 1105
a834585d 1106 // Delete a marker from a line.
4370573a
RD
1107 void MarkerDelete(int line, int markerNumber);
1108
a834585d 1109 // Delete all markers with a particular number from all lines.
4370573a
RD
1110 void MarkerDeleteAll(int markerNumber);
1111
1112 // Get a bit mask of all the markers set on a line.
1113 int MarkerGet(int line);
1114
1115 // Find the next line after lineStart that includes a marker in mask.
1116 int MarkerNext(int lineStart, int markerMask);
1117
1118 // Find the previous line before lineStart that includes a marker in mask.
1119 int MarkerPrevious(int lineStart, int markerMask);
1120
1121 // Set a margin to be either numeric or symbolic.
1122 void SetMarginType(int margin, int marginType);
1123
1124 // Retrieve the type of a margin.
1125 int GetMarginType(int margin);
1126
1127 // Set the width of a margin to a width expressed in pixels.
9ce192d4 1128 void SetMarginWidth(int margin, int pixelWidth);
4370573a
RD
1129
1130 // Retrieve the width of a margin in pixels.
1131 int GetMarginWidth(int margin);
1132
1133 // Set a mask that determines which markers are displayed in a margin.
9ce192d4 1134 void SetMarginMask(int margin, int mask);
4370573a
RD
1135
1136 // Retrieve the marker mask of a margin.
1137 int GetMarginMask(int margin);
1138
1139 // Make a margin sensitive or insensitive to mouse clicks.
9ce192d4 1140 void SetMarginSensitive(int margin, bool sensitive);
4370573a
RD
1141
1142 // Retrieve the mouse click sensitivity of a margin.
9ce192d4
RD
1143 bool GetMarginSensitive(int margin);
1144
4370573a
RD
1145 // Clear all the styles and make equivalent to the global default style.
1146 void StyleClearAll();
1147
1148 // Set the foreground colour of a style.
1149 void StyleSetForeground(int style, const wxColour& fore);
1150
1151 // Set the background colour of a style.
1152 void StyleSetBackground(int style, const wxColour& back);
1153
1154 // Set a style to be bold or not.
1155 void StyleSetBold(int style, bool bold);
1156
1157 // Set a style to be italic or not.
1158 void StyleSetItalic(int style, bool italic);
1159
1160 // Set the size of characters of a style.
1161 void StyleSetSize(int style, int sizePoints);
1162
1163 // Set the font of a style.
1164 void StyleSetFaceName(int style, const wxString& fontName);
1165
1166 // Set a style to have its end of line filled or not.
1167 void StyleSetEOLFilled(int style, bool filled);
1168
1169 // Reset the default style to its state at startup
1170 void StyleResetDefault();
1171
1172 // Set a style to be underlined or not.
1173 void StyleSetUnderline(int style, bool underline);
1174
65ec6247
RD
1175 // Set a style to be mixed case, or to force upper or lower case.
1176 void StyleSetCase(int style, int caseForce);
1177
10ef30eb
RD
1178 // Set the character set of the font in a style.
1179 void StyleSetCharacterSet(int style, int characterSet);
1180
4370573a
RD
1181 // Set the foreground colour of the selection and whether to use this setting.
1182 void SetSelForeground(bool useSetting, const wxColour& fore);
1183
1184 // Set the background colour of the selection and whether to use this setting.
1185 void SetSelBackground(bool useSetting, const wxColour& back);
1186
1187 // Set the foreground colour of the caret.
1188 void SetCaretForeground(const wxColour& fore);
1189
1190 // When key+modifier combination km is pressed perform msg.
1191 void CmdKeyAssign(int key, int modifiers, int cmd);
1192
1193 // When key+modifier combination km do nothing.
1194 void CmdKeyClear(int key, int modifiers);
1195
1196 // Drop all key mappings.
1197 void CmdKeyClearAll();
1198
1199 // Set the styles for a segment of the document.
1200 void SetStyleBytes(int length, char* styleBytes);
1201
1202 // Set a style to be visible or not.
1203 void StyleSetVisible(int style, bool visible);
1204
1205 // Get the time in milliseconds that the caret is on and off.
1206 int GetCaretPeriod();
1207
1208 // Get the time in milliseconds that the caret is on and off. 0 = steady on.
1209 void SetCaretPeriod(int periodMilliseconds);
1210
a834585d 1211 // Set the set of characters making up words for when moving or selecting by word.
4370573a
RD
1212 void SetWordChars(const wxString& characters);
1213
1214 // Start a sequence of actions that is undone and redone as a unit.
1215 // May be nested.
1216 void BeginUndoAction();
1217
1218 // End a sequence of actions that is undone and redone as a unit.
1219 void EndUndoAction();
1220
1221 // Set an indicator to plain, squiggle or TT.
1222 void IndicatorSetStyle(int indic, int style);
1223
1224 // Retrieve the style of an indicator.
1225 int IndicatorGetStyle(int indic);
1226
1227 // Set the foreground colour of an indicator.
1228 void IndicatorSetForeground(int indic, const wxColour& fore);
1229
1230 // Retrieve the foreground colour of an indicator.
1231 wxColour IndicatorGetForeground(int indic);
1232
f114b858
RD
1233 // Set the foreground colour of all whitespace and whether to use this setting.
1234 void SetWhitespaceForeground(bool useSetting, const wxColour& fore);
1235
1236 // Set the background colour of all whitespace and whether to use this setting.
1237 void SetWhitespaceBackground(bool useSetting, const wxColour& back);
1238
a834585d
RD
1239 // Divide each styling byte into lexical class bits (default: 5) and indicator
1240 // bits (default: 3). If a lexer requires more than 32 lexical states, then this
4370573a
RD
1241 // is used to expand the possible states.
1242 void SetStyleBits(int bits);
1243
1244 // Retrieve number of bits in style bytes used to hold the lexical state.
1245 int GetStyleBits();
1246
1247 // Used to hold extra styling information for each line.
1248 void SetLineState(int line, int state);
1249
1250 // Retrieve the extra styling information for a line.
1251 int GetLineState(int line);
1252
1253 // Retrieve the last line number that has line state.
1254 int GetMaxLineState();
1255
65ec6247
RD
1256 // Is the background of the line containing the caret in a different colour?
1257 bool GetCaretLineVisible();
1258
a834585d 1259 // Display the background of the line containing the caret in a different colour.
65ec6247
RD
1260 void SetCaretLineVisible(bool show);
1261
1262 // Get the colour of the background of the line containing the caret.
1263 wxColour GetCaretLineBack();
1264
1265 // Set the colour of the background of the line containing the caret.
1266 void SetCaretLineBack(const wxColour& back);
1267
1a2fb4cd
RD
1268 // Set a style to be changeable or not (read only).
1269 // Experimental feature, currently buggy.
1270 void StyleSetChangeable(int style, bool changeable);
1271
4370573a
RD
1272 // Display a auto-completion list.
1273 // The lenEntered parameter indicates how many characters before
1274 // the caret should be used to provide context.
1275 void AutoCompShow(int lenEntered, const wxString& itemList);
1276
1277 // Remove the auto-completion list from the screen.
1278 void AutoCompCancel();
1279
1280 // Is there an auto-completion list visible?
1281 bool AutoCompActive();
1282
a834585d 1283 // Retrieve the position of the caret when the auto-completion list was displayed.
4370573a
RD
1284 int AutoCompPosStart();
1285
1286 // User has selected an item so remove the list and insert the selection.
1287 void AutoCompComplete();
1288
1289 // Define a set of character that when typed cancel the auto-completion list.
1290 void AutoCompStops(const wxString& characterSet);
1291
a834585d
RD
1292 // Change the separator character in the string setting up an auto-completion list.
1293 // Default is space but can be changed if items contain space.
4370573a
RD
1294 void AutoCompSetSeparator(int separatorCharacter);
1295
1296 // Retrieve the auto-completion list separator character.
1297 int AutoCompGetSeparator();
1298
1299 // Select the item in the auto-completion list that starts with a string.
1300 void AutoCompSelect(const wxString& text);
1301
1302 // Should the auto-completion list be cancelled if the user backspaces to a
1303 // position before where the box was created.
1304 void AutoCompSetCancelAtStart(bool cancel);
1305
1306 // Retrieve whether auto-completion cancelled by backspacing before start.
1307 bool AutoCompGetCancelAtStart();
1308
1a2fb4cd
RD
1309 // Define a set of characters that when typed will cause the autocompletion to
1310 // choose the selected item.
4370573a
RD
1311 void AutoCompSetFillUps(const wxString& characterSet);
1312
1313 // Should a single item auto-completion list automatically choose the item.
1314 void AutoCompSetChooseSingle(bool chooseSingle);
1315
1316 // Retrieve whether a single item auto-completion list automatically choose the item.
1317 bool AutoCompGetChooseSingle();
1318
1319 // Set whether case is significant when performing auto-completion searches.
1320 void AutoCompSetIgnoreCase(bool ignoreCase);
1321
1322 // Retrieve state of ignore case flag.
1323 bool AutoCompGetIgnoreCase();
1324
65ec6247
RD
1325 // Display a list of strings and send notification when user chooses one.
1326 void UserListShow(int listType, const wxString& itemList);
1327
a834585d 1328 // Set whether or not autocompletion is hidden automatically when nothing matches.
65ec6247
RD
1329 void AutoCompSetAutoHide(bool autoHide);
1330
a834585d 1331 // Retrieve whether or not autocompletion is hidden automatically when nothing matches.
65ec6247
RD
1332 bool AutoCompGetAutoHide();
1333
a834585d
RD
1334 // Set whether or not autocompletion deletes any word characters
1335 // after the inserted text upon completion.
1a2fb4cd
RD
1336 void AutoCompSetDropRestOfWord(bool dropRestOfWord);
1337
a834585d
RD
1338 // Retrieve whether or not autocompletion deletes any word characters
1339 // after the inserted text upon completion.
1a2fb4cd
RD
1340 bool AutoCompGetDropRestOfWord();
1341
4370573a
RD
1342 // Set the number of spaces used for one level of indentation.
1343 void SetIndent(int indentSize);
1344
1345 // Retrieve indentation size.
1346 int GetIndent();
1347
1348 // Indentation will only use space characters if useTabs is false, otherwise
1349 // it will use a combination of tabs and spaces.
1350 void SetUseTabs(bool useTabs);
1351
1352 // Retrieve whether tabs will be used in indentation.
1353 bool GetUseTabs();
1354
1355 // Change the indentation of a line to a number of columns.
1356 void SetLineIndentation(int line, int indentSize);
9ce192d4 1357
4370573a
RD
1358 // Retrieve the number of columns that a line is indented.
1359 int GetLineIndentation(int line);
1360
1361 // Retrieve the position before the first non indentation character on a line.
1362 int GetLineIndentPosition(int line);
1363
1364 // Retrieve the column number of a position, taking tab width into account.
1365 int GetColumn(int pos);
1366
1367 // Show or hide the horizontal scroll bar.
1368 void SetUseHorizontalScrollBar(bool show);
1369
1370 // Is the horizontal scroll bar visible?
1371 bool GetUseHorizontalScrollBar();
1372
1373 // Show or hide indentation guides.
1374 void SetIndentationGuides(bool show);
1375
1376 // Are the indentation guides visible?
1377 bool GetIndentationGuides();
1378
1379 // Set the highlighted indentation guide column.
1380 // 0 = no highlighted guide.
1381 void SetHighlightGuide(int column);
1382
1383 // Get the highlighted indentation guide column.
1384 int GetHighlightGuide();
1385
1386 // Get the position after the last visible characters on a line.
1387 int GetLineEndPosition(int line);
1388
1389 // Get the code page used to interpret the bytes of the document as characters.
1390 int GetCodePage();
1391
1392 // Get the foreground colour of the caret.
1393 wxColour GetCaretForeground();
1394
1395 // In read-only mode?
1396 bool GetReadOnly();
1397
1398 // Sets the position of the caret.
1399 void SetCurrentPos(int pos);
1400
1401 // Sets the position that starts the selection - this becomes the anchor.
1402 void SetSelectionStart(int pos);
1403
1404 // Returns the position at the start of the selection.
1405 int GetSelectionStart();
1406
1407 // Sets the position that ends the selection - this becomes the currentPosition.
1408 void SetSelectionEnd(int pos);
1409
1410 // Returns the position at the end of the selection.
1411 int GetSelectionEnd();
1412
1413 // Sets the print magnification added to the point size of each style for printing.
1414 void SetPrintMagnification(int magnification);
1415
1416 // Returns the print magnification.
1417 int GetPrintMagnification();
1418
1419 // Modify colours when printing for clearer printed text.
1420 void SetPrintColourMode(int mode);
1421
1422 // Returns the print colour mode.
1423 int GetPrintColourMode();
1424
1425 // Find some text in the document.
c13219d6 1426 int FindText(int minPos, int maxPos, const wxString& text, int flags=0);
4370573a 1427
a834585d 1428 // On Windows, will draw the document into a display context such as a printer.
4370573a
RD
1429 int FormatRange(bool doDraw,
1430 int startPos,
1431 int endPos,
1432 wxDC* draw,
1433 wxDC* target, // Why does it use two? Can they be the same?
1434 wxRect renderRect,
1435 wxRect pageRect);
1436
1437 // Retrieve the line at the top of the display.
1438 int GetFirstVisibleLine();
1439
1440 // Retrieve the contents of a line.
1441 wxString GetLine(int line);
1442
1443 // Returns the number of lines in the document. There is always at least one.
1444 int GetLineCount();
1445
1446 // Sets the size in pixels of the left margin.
65ec6247 1447 void SetMarginLeft(int pixelWidth);
4370573a
RD
1448
1449 // Returns the size in pixels of the left margin.
1450 int GetMarginLeft();
1451
1452 // Sets the size in pixels of the right margin.
65ec6247 1453 void SetMarginRight(int pixelWidth);
4370573a
RD
1454
1455 // Returns the size in pixels of the right margin.
1456 int GetMarginRight();
1457
1458 // Is the document different from when it was last saved?
1459 bool GetModify();
1460
1461 // Select a range of text.
1462 void SetSelection(int start, int end);
1463
1464 // Retrieve the selected text.
1465 wxString GetSelectedText();
1466
1467 // Retrieve a range of text.
1468 wxString GetTextRange(int startPos, int endPos);
1469
1470 // Draw the selection in normal style or with selection highlighted.
1471 void HideSelection(bool normal);
1472
1473 // Retrieve the line containing a position.
1474 int LineFromPosition(int pos);
1475
1476 // Retrieve the position at the start of a line.
1477 int PositionFromLine(int line);
1478
1479 // Scroll horizontally and vertically.
1480 void LineScroll(int columns, int lines);
1481
1482 // Ensure the caret is visible.
1483 void EnsureCaretVisible();
1484
1485 // Replace the selected text with the argument text.
1486 void ReplaceSelection(const wxString& text);
1487
1488 // Set to read only or read write.
1489 void SetReadOnly(bool readOnly);
1490
1491 // Will a paste succeed?
1492 bool CanPaste();
1493
a834585d 1494 // Are there any undoable actions in the undo history?
4370573a
RD
1495 bool CanUndo();
1496
1497 // Delete the undo history.
1498 void EmptyUndoBuffer();
1499
1500 // Undo one action in the undo history.
1501 void Undo();
1502
1503 // Cut the selection to the clipboard.
1504 void Cut();
1505
1506 // Copy the selection to the clipboard.
1507 void Copy();
1508
1509 // Paste the contents of the clipboard into the document replacing the selection.
1510 void Paste();
1511
1512 // Clear the selection.
1513 void Clear();
1514
1515 // Replace the contents of the document with the argument text.
1516 void SetText(const wxString& text);
1517
1518 // Retrieve all the text in the document.
1519 wxString GetText();
1520
1521 // Retrieve the number of characters in the document.
1522 int GetTextLength();
1523
a834585d 1524 // Set to overtype (true) or insert mode.
4370573a
RD
1525 void SetOvertype(bool overtype);
1526
1527 // Returns true if overtype mode is active otherwise false is returned.
1528 bool GetOvertype();
1529
a834585d 1530 // Set the width of the insert mode caret.
65ec6247
RD
1531 void SetCaretWidth(int pixelWidth);
1532
a834585d 1533 // Returns the width of the insert mode caret.
65ec6247
RD
1534 int GetCaretWidth();
1535
1536 // Sets the position that starts the target which is used for updating the
1537 // document without affecting the scroll position.
1538 void SetTargetStart(int pos);
1539
1540 // Get the position that starts the target.
1541 int GetTargetStart();
1542
1543 // Sets the position that ends the target which is used for updating the
1544 // document without affecting the scroll position.
1545 void SetTargetEnd(int pos);
1546
1547 // Get the position that ends the target.
1548 int GetTargetEnd();
1549
1550 // Replace the target text with the argument text.
b8b0e402 1551 // Text is counted so it can contain nulls.
65ec6247
RD
1552 // Returns the length of the replacement text.
1553 int ReplaceTarget(const wxString& text);
1554
1555 // Replace the target text with the argument text after \d processing.
b8b0e402 1556 // Text is counted so it can contain nulls.
65ec6247
RD
1557 // Looks for \d where d is between 1 and 9 and replaces these with the strings
1558 // matched in the last search operation which were surrounded by \( and \).
1559 // Returns the length of the replacement text including any change
1560 // caused by processing the \d patterns.
1561 int ReplaceTargetRE(const wxString& text);
1562
1563 // Search for a counted string in the target and set the target to the found
b8b0e402 1564 // range. Text is counted so it can contain nulls.
65ec6247
RD
1565 // Returns length of range or -1 for failure in which case target is not moved.
1566 int SearchInTarget(const wxString& text);
1567
a834585d 1568 // Set the search flags used by SearchInTarget.
65ec6247
RD
1569 void SetSearchFlags(int flags);
1570
a834585d 1571 // Get the search flags used by SearchInTarget.
65ec6247
RD
1572 int GetSearchFlags();
1573
4370573a
RD
1574 // Show a call tip containing a definition near position pos.
1575 void CallTipShow(int pos, const wxString& definition);
1576
1577 // Remove the call tip from the screen.
1578 void CallTipCancel();
1579
1580 // Is there an active call tip?
1581 bool CallTipActive();
1582
1583 // Retrieve the position where the caret was before displaying the call tip.
1584 int CallTipPosAtStart();
1585
1586 // Highlight a segment of the definition.
1587 void CallTipSetHighlight(int start, int end);
1588
1589 // Set the background colour for the call tip.
1590 void CallTipSetBackground(const wxColour& back);
1591
1592 // Find the display line of a document line taking hidden lines into account.
1593 int VisibleFromDocLine(int line);
1594
1595 // Find the document line of a display line taking hidden lines into account.
1596 int DocLineFromVisible(int lineDisplay);
1597
1598 // Set the fold level of a line.
1599 // This encodes an integer level along with flags indicating whether the
1600 // line is a header and whether it is effectively white space.
1601 void SetFoldLevel(int line, int level);
1602
1603 // Retrieve the fold level of a line.
1604 int GetFoldLevel(int line);
1605
1606 // Find the last child line of a header line.
1607 int GetLastChild(int line, int level);
1608
1609 // Find the parent line of a child line.
1610 int GetFoldParent(int line);
1611
1612 // Make a range of lines visible.
1613 void ShowLines(int lineStart, int lineEnd);
1614
1615 // Make a range of lines invisible.
1616 void HideLines(int lineStart, int lineEnd);
1617
1618 // Is a line visible?
1619 bool GetLineVisible(int line);
1620
1621 // Show the children of a header line.
1622 void SetFoldExpanded(int line, bool expanded);
1623
1624 // Is a header line expanded?
1625 bool GetFoldExpanded(int line);
1626
1627 // Switch a header line between expanded and contracted.
1628 void ToggleFold(int line);
1629
1630 // Ensure a particular line is visible by expanding any header line hiding it.
1631 void EnsureVisible(int line);
1632
a834585d 1633 // Set some debugging options for folding.
4370573a
RD
1634 void SetFoldFlags(int flags);
1635
65ec6247
RD
1636 // Ensure a particular line is visible by expanding any header line hiding it.
1637 // Use the currently set visibility policy to determine which range to display.
1638 void EnsureVisibleEnforcePolicy(int line);
1639
a834585d 1640 // Sets whether a tab pressed when caret is within indentation indents.
65ec6247
RD
1641 void SetTabIndents(bool tabIndents);
1642
1643 // Does a tab pressed when caret is within indentation indent?
1644 bool GetTabIndents();
1645
a834585d 1646 // Sets whether a backspace pressed when caret is within indentation unindents.
65ec6247
RD
1647 void SetBackSpaceUnIndents(bool bsUnIndents);
1648
1649 // Does a backspace pressed when caret is within indentation unindent?
1650 bool GetBackSpaceUnIndents();
1651
a834585d 1652 // Sets the time the mouse must sit still to generate a mouse dwell event.
65ec6247
RD
1653 void SetMouseDwellTime(int periodMilliseconds);
1654
a834585d 1655 // Retrieve the time the mouse must sit still to generate a mouse dwell event.
65ec6247
RD
1656 int GetMouseDwellTime();
1657
a834585d 1658 // Get position of start of word.
1a2fb4cd
RD
1659 int WordStartPosition(int pos, bool onlyWordCharacters);
1660
a834585d 1661 // Get position of end of word.
1a2fb4cd
RD
1662 int WordEndPosition(int pos, bool onlyWordCharacters);
1663
a834585d 1664 // Sets whether text is word wrapped.
1a2fb4cd
RD
1665 void SetWrapMode(int mode);
1666
a834585d 1667 // Retrieve whether text is word wrapped.
1a2fb4cd
RD
1668 int GetWrapMode();
1669
a834585d 1670 // Sets the degree of caching of layout information.
1a2fb4cd
RD
1671 void SetLayoutCache(int mode);
1672
a834585d 1673 // Retrieve the degree of caching of layout information.
1a2fb4cd
RD
1674 int GetLayoutCache();
1675
a834585d
RD
1676 // Sets the document width assumed for scrolling.
1677 void SetScrollWidth(int pixelWidth);
1678
1679 // Retrieve the document width assumed for scrolling.
1680 int GetScrollWidth();
1681
1682 // Measure the pixel width of some text in a particular style.
1683 // Nul terminated text argument.
1684 // Does not handle tab or control characters.
1685 int TextWidth(int style, const wxString& text);
1686
1687 // Sets the scroll range so that maximum scroll position has
1688 // the last line at the bottom of the view (default).
1689 // Setting this to false allows scrolling one page below the last line.
1690 void SetEndAtLastLine(bool endAtLastLine);
1691
1692 // Retrieve whether the maximum scroll position has the last
1693 // line at the bottom of the view.
1694 int GetEndAtLastLine();
1695
1696 // Retrieve the height of a particular line of text in pixels.
1697 int TextHeight(int line);
1698
f114b858
RD
1699 // Move caret to first position on display line.
1700 void HomeDisplay();
1701
2b5f62a0 1702 // Move caret to first position on display line extending selection to
f114b858
RD
1703 // new caret position.
1704 void HomeDisplayExtend();
1705
1706 // Move caret to last position on display line.
1707 void LineEndDisplay();
1708
2b5f62a0 1709 // Move caret to last position on display line extending selection to new
f114b858
RD
1710 // caret position.
1711 void LineEndDisplayExtend();
1712
a834585d 1713 // Move the caret inside current view if it's not there already.
65ec6247
RD
1714 void MoveCaretInsideView();
1715
a834585d 1716 // How many characters are on a line, not including end of line characters?
4370573a
RD
1717 int LineLength(int line);
1718
1719 // Highlight the characters at two positions.
1720 void BraceHighlight(int pos1, int pos2);
1721
1722 // Highlight the character at a position indicating there is no matching brace.
1723 void BraceBadLight(int pos);
1724
1725 // Find the position of a matching brace or INVALID_POSITION if no match.
1726 int BraceMatch(int pos);
1727
a834585d 1728 // Are the end of line characters visible?
4370573a
RD
1729 bool GetViewEOL();
1730
a834585d 1731 // Make the end of line characters visible or invisible.
4370573a
RD
1732 void SetViewEOL(bool visible);
1733
1734 // Retrieve a pointer to the document object.
1735 void* GetDocPointer();
1736
1737 // Change the document object used.
1738 void SetDocPointer(void* docPointer);
1739
1740 // Set which document modification events are sent to the container.
1741 void SetModEventMask(int mask);
1742
1743 // Retrieve the column number which text should be kept within.
1744 int GetEdgeColumn();
1745
1746 // Set the column number of the edge.
1747 // If text goes past the edge then it is highlighted.
1748 void SetEdgeColumn(int column);
1749
1750 // Retrieve the edge highlight mode.
1751 int GetEdgeMode();
1752
1753 // The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
1754 // goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
1755 void SetEdgeMode(int mode);
1756
1757 // Retrieve the colour used in edge indication.
9ce192d4 1758 wxColour GetEdgeColour();
9ce192d4 1759
4370573a
RD
1760 // Change the colour used in edge indication.
1761 void SetEdgeColour(const wxColour& edgeColour);
1762
1763 // Sets the current caret position to be the search anchor.
1764 void SearchAnchor();
1765
1766 // Find some text starting at the search anchor.
65ec6247 1767 // Does not ensure the selection is visible.
4370573a
RD
1768 int SearchNext(int flags, const wxString& text);
1769
1770 // Find some text starting at the search anchor and moving backwards.
65ec6247 1771 // Does not ensure the selection is visible.
4370573a
RD
1772 int SearchPrev(int flags, const wxString& text);
1773
4370573a
RD
1774 // Retrieves the number of lines completely visible.
1775 int LinesOnScreen();
1776
1777 // Set whether a pop up menu is displayed automatically when the user presses
1778 // the wrong mouse button.
1779 void UsePopUp(bool allowPopUp);
1780
a834585d 1781 // Is the selection rectangular? The alternative is the more common stream selection.
4370573a
RD
1782 bool SelectionIsRectangle();
1783
1784 // Set the zoom level. This number of points is added to the size of all fonts.
1785 // It may be positive to magnify or negative to reduce.
1786 void SetZoom(int zoom);
1787
1788 // Retrieve the zoom level.
1789 int GetZoom();
1790
1791 // Create a new document object.
1792 // Starts with reference count of 1 and not selected into editor.
1793 void* CreateDocument();
9ce192d4 1794
4370573a
RD
1795 // Extend life of document.
1796 void AddRefDocument(void* docPointer);
9ce192d4 1797
4370573a
RD
1798 // Release a reference to the document, deleting document if it fades to black.
1799 void ReleaseDocument(void* docPointer);
1800
1801 // Get which document modification events are sent to the container.
1802 int GetModEventMask();
1803
a834585d 1804 // Change internal focus flag.
8de28db9 1805 void SetSTCFocus(bool focus);
65ec6247 1806
a834585d 1807 // Get internal focus flag.
8de28db9 1808 bool GetSTCFocus();
65ec6247 1809
a834585d 1810 // Change error status - 0 = OK.
65ec6247
RD
1811 void SetStatus(int statusCode);
1812
a834585d 1813 // Get error status.
65ec6247
RD
1814 int GetStatus();
1815
a834585d 1816 // Set whether the mouse is captured when its button is pressed.
65ec6247
RD
1817 void SetMouseDownCaptures(bool captures);
1818
a834585d 1819 // Get whether mouse gets captured.
65ec6247
RD
1820 bool GetMouseDownCaptures();
1821
a834585d 1822 // Sets the cursor to one of the SC_CURSOR* values.
65ec6247
RD
1823 void SetCursor(int cursorType);
1824
a834585d 1825 // Get cursor type.
65ec6247
RD
1826 int GetCursor();
1827
1a2fb4cd 1828 // Change the way control characters are displayed:
a834585d 1829 // If symbol is < 32, keep the drawn way, else, use the given character.
1a2fb4cd
RD
1830 void SetControlCharSymbol(int symbol);
1831
a834585d 1832 // Get the way control characters are displayed.
1a2fb4cd
RD
1833 int GetControlCharSymbol();
1834
a834585d 1835 // Move to the previous change in capitalisation.
65ec6247
RD
1836 void WordPartLeft();
1837
a834585d
RD
1838 // Move to the previous change in capitalisation extending selection
1839 // to new caret position.
65ec6247
RD
1840 void WordPartLeftExtend();
1841
a834585d 1842 // Move to the change next in capitalisation.
65ec6247
RD
1843 void WordPartRight();
1844
a834585d
RD
1845 // Move to the next change in capitalisation extending selection
1846 // to new caret position.
65ec6247
RD
1847 void WordPartRightExtend();
1848
a834585d
RD
1849 // Set the way the display area is determined when a particular line
1850 // is to be moved to by Find, FindNext, GotoLine, etc.
65ec6247
RD
1851 void SetVisiblePolicy(int visiblePolicy, int visibleSlop);
1852
a834585d 1853 // Delete back from the current position to the start of the line.
65ec6247
RD
1854 void DelLineLeft();
1855
a834585d 1856 // Delete forwards from the current position to the end of the line.
65ec6247
RD
1857 void DelLineRight();
1858
a834585d 1859 // Get and Set the xOffset (ie, horizonal scroll position).
1a2fb4cd
RD
1860 void SetXOffset(int newOffset);
1861 int GetXOffset();
1862
a834585d
RD
1863 // Set the way the caret is kept visible when going sideway.
1864 // The exclusion zone is given in pixels.
1865 void SetXCaretPolicy(int caretPolicy, int caretSlop);
1866
1867 // Set the way the line the caret is on is kept visible.
1868 // The exclusion zone is given in lines.
1869 void SetYCaretPolicy(int caretPolicy, int caretSlop);
1870
4370573a
RD
1871 // Start notifying the container of all key presses and commands.
1872 void StartRecord();
1873
1874 // Stop notifying the container of all key presses and commands.
1875 void StopRecord();
1876
1877 // Set the lexing language of the document.
1878 void SetLexer(int lexer);
1879
1880 // Retrieve the lexing language of the document.
1881 int GetLexer();
1882
1883 // Colourise a segment of the document using the current lexing language.
1884 void Colourise(int start, int end);
1885
1886 // Set up a value that may be used by a lexer for some optional feature.
1887 void SetProperty(const wxString& key, const wxString& value);
1888
1889 // Set up the key words used by the lexer.
1890 void SetKeyWords(int keywordSet, const wxString& keyWords);
1891
65ec6247
RD
1892 // Set the lexing language of the document based on string name.
1893 void SetLexerLanguage(const wxString& language);
1894
4370573a
RD
1895// END of generated section
1896//----------------------------------------------------------------------
1897// Others...
1898
1899
1900 // Returns the line number of the line with the caret.
1901 int GetCurrentLine();
1902
1903 // Extract style settings from a spec-string which is composed of one or
1904 // more of the following comma separated elements:
1905 //
1906 // bold turns on bold
1907 // italic turns on italics
1908 // fore:#RRGGBB sets the foreground colour
1909 // back:#RRGGBB sets the background colour
1910 // face:[facename] sets the font face name to use
1911 // size:[num] sets the font size in points
1912 // eol turns on eol filling
1913 // underline turns on underlining
1914 //
1915 void StyleSetSpec(int styleNum, const wxString& spec);
1916
1917
1918
1919 // Set style size, face, bold, italic, and underline attributes from
1920 // a wxFont's attributes.
1921 void StyleSetFont(int styleNum, wxFont& font);
1922
1923
1924
1925 // Set all font style attributes at once.
1926 void StyleSetFontAttr(int styleNum, int size,
1927 const wxString& faceName,
1928 bool bold, bool italic,
1929 bool underline);
1930
1931
1932
1933 // Perform one of the operations defined by the wxSTC_CMD_* constants.
1934 void CmdKeyExecute(int cmd);
1935
1936
1937
1938 // Set the left and right margin in the edit area, measured in pixels.
1939 void SetMargins(int left, int right);
1940
1941
1942 // Retrieve the start and end positions of the current selection.
1943#ifdef SWIG
1944 void GetSelection(int* OUTPUT, int* OUTPUT);
1945#else
1946 void GetSelection(int* startPos, int* endPos);
1947#endif
1948
1949 // Retrieve the point in the window where a position is displayed.
1950 wxPoint PointFromPosition(int pos);
1951
f97d84a6
RD
1952
1953 // Scroll enough to make the given line visible
1954 void ScrollToLine(int line);
1955
1956
1957 // Scroll enough to make the given column visible
1958 void ScrollToColumn(int column);
1959
65ec6247
RD
1960
1961 // Send a message to Scintilla
1962 long SendMsg(int msg, long wp=0, long lp=0);
1963
5fa4613c
RD
1964
1965 // Set the vertical scrollbar to use instead of the ont that's built-in.
1966 void SetVScrollBar(wxScrollBar* bar) { m_vScrollBar = bar; }
1967
1968
1969 // Set the horizontal scrollbar to use instead of the ont that's built-in.
1970 void SetHScrollBar(wxScrollBar* bar) { m_hScrollBar = bar; }
1971
0b9dfbc0
RD
1972 // Can be used to prevent the EVT_CHAR handler from adding the char
1973 bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; }
1974 void SetLastKeydownProcessed(bool val) { m_lastKeyDownConsumed = val; }
1975
1976
4370573a 1977//----------------------------------------------------------------------
9ce192d4
RD
1978
1979
f6bcfd97 1980#ifndef SWIG
9ce192d4
RD
1981private:
1982 // Event handlers
1983 void OnPaint(wxPaintEvent& evt);
1984 void OnScrollWin(wxScrollWinEvent& evt);
5fa4613c 1985 void OnScroll(wxScrollEvent& evt);
9ce192d4
RD
1986 void OnSize(wxSizeEvent& evt);
1987 void OnMouseLeftDown(wxMouseEvent& evt);
1988 void OnMouseMove(wxMouseEvent& evt);
1989 void OnMouseLeftUp(wxMouseEvent& evt);
ddf2da08 1990 void OnMouseRightUp(wxMouseEvent& evt);
2b5f62a0 1991 void OnMouseMiddleUp(wxMouseEvent& evt);
65ec6247 1992 void OnContextMenu(wxContextMenuEvent& evt);
37d62433 1993 void OnMouseWheel(wxMouseEvent& evt);
9ce192d4 1994 void OnChar(wxKeyEvent& evt);
f6bcfd97 1995 void OnKeyDown(wxKeyEvent& evt);
9ce192d4
RD
1996 void OnLoseFocus(wxFocusEvent& evt);
1997 void OnGainFocus(wxFocusEvent& evt);
1998 void OnSysColourChanged(wxSysColourChangedEvent& evt);
1999 void OnEraseBackground(wxEraseEvent& evt);
2000 void OnMenu(wxCommandEvent& evt);
f6bcfd97 2001 void OnListBox(wxCommandEvent& evt);
9ce192d4
RD
2002
2003
2004 // Turn notifications from Scintilla into events
2005 void NotifyChange();
2006 void NotifyParent(SCNotification* scn);
2007
a29a241f 2008
9ce192d4
RD
2009private:
2010 DECLARE_EVENT_TABLE()
f6bcfd97 2011 DECLARE_CLASS(wxStyledTextCtrl)
9ce192d4
RD
2012
2013 ScintillaWX* m_swx;
2014 wxStopWatch m_stopWatch;
5fa4613c
RD
2015 wxScrollBar* m_vScrollBar;
2016 wxScrollBar* m_hScrollBar;
9ce192d4 2017
d6582821 2018 bool m_lastKeyDownConsumed;
9ce192d4
RD
2019
2020 friend class ScintillaWX;
2021 friend class Platform;
f6bcfd97 2022#endif
9ce192d4
RD
2023};
2024
2025//----------------------------------------------------------------------
2026
2b5f62a0 2027// SWIG can't handle "#if" type of conditionals, only "#ifdef"
92bbd64f
RD
2028#ifdef SWIG
2029#define STC_USE_DND 1
2030#else
2031#if wxUSE_DRAG_AND_DROP
2032#define STC_USE_DND 1
2033#endif
2034#endif
2035
9ce192d4
RD
2036class wxStyledTextEvent : public wxCommandEvent {
2037public:
f6bcfd97 2038 wxStyledTextEvent(wxEventType commandType=0, int id=0);
4161723f
RD
2039#ifndef SWIG
2040 wxStyledTextEvent(const wxStyledTextEvent& event);
2041#endif
9ce192d4
RD
2042 ~wxStyledTextEvent() {}
2043
a29a241f
RD
2044 void SetPosition(int pos) { m_position = pos; }
2045 void SetKey(int k) { m_key = k; }
2046 void SetModifiers(int m) { m_modifiers = m; }
2047 void SetModificationType(int t) { m_modificationType = t; }
10ef30eb 2048 void SetText(const wxString& t) { m_text = t; }
a29a241f
RD
2049 void SetLength(int len) { m_length = len; }
2050 void SetLinesAdded(int num) { m_linesAdded = num; }
2051 void SetLine(int val) { m_line = val; }
2052 void SetFoldLevelNow(int val) { m_foldLevelNow = val; }
2053 void SetFoldLevelPrev(int val) { m_foldLevelPrev = val; }
2054 void SetMargin(int val) { m_margin = val; }
2055 void SetMessage(int val) { m_message = val; }
2056 void SetWParam(int val) { m_wParam = val; }
2057 void SetLParam(int val) { m_lParam = val; }
2058 void SetListType(int val) { m_listType = val; }
2059 void SetX(int val) { m_x = val; }
2060 void SetY(int val) { m_y = val; }
2061 void SetDragText(const wxString& val) { m_dragText = val; }
2062 void SetDragAllowMove(bool val) { m_dragAllowMove = val; }
92bbd64f 2063#ifdef STC_USE_DND
a29a241f 2064 void SetDragResult(wxDragResult val) { m_dragResult = val; }
92bbd64f 2065#endif
9ce192d4
RD
2066
2067 int GetPosition() const { return m_position; }
2068 int GetKey() const { return m_key; }
2069 int GetModifiers() const { return m_modifiers; }
2070 int GetModificationType() const { return m_modificationType; }
2071 wxString GetText() const { return m_text; }
2072 int GetLength() const { return m_length; }
2073 int GetLinesAdded() const { return m_linesAdded; }
2074 int GetLine() const { return m_line; }
2075 int GetFoldLevelNow() const { return m_foldLevelNow; }
2076 int GetFoldLevelPrev() const { return m_foldLevelPrev; }
2077 int GetMargin() const { return m_margin; }
2078 int GetMessage() const { return m_message; }
2079 int GetWParam() const { return m_wParam; }
2080 int GetLParam() const { return m_lParam; }
65ec6247
RD
2081 int GetListType() const { return m_listType; }
2082 int GetX() const { return m_x; }
2083 int GetY() const { return m_y; }
a29a241f
RD
2084 wxString GetDragText() { return m_dragText; }
2085 bool GetDragAllowMove() { return m_dragAllowMove; }
92bbd64f 2086#ifdef STC_USE_DND
a29a241f 2087 wxDragResult GetDragResult() { return m_dragResult; }
92bbd64f 2088#endif
9ce192d4
RD
2089
2090 bool GetShift() const;
2091 bool GetControl() const;
2092 bool GetAlt() const;
2093
41286fd1 2094 virtual wxEvent* Clone() const { return new wxStyledTextEvent(*this); }
9ce192d4 2095
f6bcfd97 2096#ifndef SWIG
9ce192d4 2097private:
f6bcfd97
BP
2098 DECLARE_DYNAMIC_CLASS(wxStyledTextEvent)
2099
9ce192d4
RD
2100 int m_position;
2101 int m_key;
2102 int m_modifiers;
2103
2104 int m_modificationType; // wxEVT_STC_MODIFIED
2105 wxString m_text;
2106 int m_length;
2107 int m_linesAdded;
2108 int m_line;
2109 int m_foldLevelNow;
2110 int m_foldLevelPrev;
2111
2112 int m_margin; // wxEVT_STC_MARGINCLICK
2113
2114 int m_message; // wxEVT_STC_MACRORECORD
2115 int m_wParam;
2116 int m_lParam;
65ec6247
RD
2117
2118 int m_listType;
2119 int m_x;
2120 int m_y;
a29a241f
RD
2121
2122 wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP
2123 bool m_dragAllowMove; // wxEVT_STC_START_DRAG
2124
92bbd64f 2125#if wxUSE_DRAG_AND_DROP
a29a241f 2126 wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP
f6bcfd97 2127#endif
92bbd64f 2128#endif
9ce192d4
RD
2129};
2130
d25f5fbb
RD
2131#ifndef SWIG
2132BEGIN_DECLARE_EVENT_TYPES()
65ec6247
RD
2133 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE, 1650)
2134 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_STYLENEEDED, 1651)
2135 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHARADDED, 1652)
2136 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTREACHED, 1653)
2137 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTLEFT, 1654)
2138 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ROMODIFYATTEMPT, 1655)
2139 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_KEY, 1656)
2140 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DOUBLECLICK, 1657)
2141 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_UPDATEUI, 1658)
2142 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MODIFIED, 1659)
2143 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MACRORECORD, 1660)
2144 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MARGINCLICK, 1661)
2145 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_NEEDSHOWN, 1662)
2146 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_POSCHANGED, 1663)
2147 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_PAINTED, 1664)
2148 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_USERLISTSELECTION, 1665)
2149 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666)
2150 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667)
2151 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND, 1668)
a29a241f
RD
2152 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_START_DRAG, 1669)
2153 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
2154 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
a834585d 2155 DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM, 1672)
d25f5fbb
RD
2156END_DECLARE_EVENT_TYPES()
2157#else
2158 enum {
2159 wxEVT_STC_CHANGE,
2160 wxEVT_STC_STYLENEEDED,
2161 wxEVT_STC_CHARADDED,
d25f5fbb
RD
2162 wxEVT_STC_SAVEPOINTREACHED,
2163 wxEVT_STC_SAVEPOINTLEFT,
2164 wxEVT_STC_ROMODIFYATTEMPT,
65ec6247 2165 wxEVT_STC_KEY,
d25f5fbb 2166 wxEVT_STC_DOUBLECLICK,
65ec6247 2167 wxEVT_STC_UPDATEUI,
d25f5fbb 2168 wxEVT_STC_MODIFIED,
d25f5fbb
RD
2169 wxEVT_STC_MACRORECORD,
2170 wxEVT_STC_MARGINCLICK,
2171 wxEVT_STC_NEEDSHOWN,
65ec6247
RD
2172 wxEVT_STC_POSCHANGED,
2173 wxEVT_STC_PAINTED,
2174 wxEVT_STC_USERLISTSELECTION,
2175 wxEVT_STC_URIDROPPED,
2176 wxEVT_STC_DWELLSTART,
2177 wxEVT_STC_DWELLEND,
a29a241f
RD
2178 wxEVT_STC_START_DRAG,
2179 wxEVT_STC_DRAG_OVER,
2180 wxEVT_STC_DO_DROP,
a834585d 2181 wxEVT_STC_ZOOM,
d25f5fbb
RD
2182 };
2183#endif
9ce192d4 2184
9ce192d4 2185
f6bcfd97
BP
2186
2187#ifndef SWIG
9ce192d4
RD
2188typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
2189
65ec6247
RD
2190#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2191#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2192#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2193#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2194#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2195#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2196#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2197#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2198#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2199#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2200#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2201#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2202#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2203#define EVT_STC_POSCHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2204#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2205#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2206#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2207#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2208#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
a29a241f
RD
2209#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2210#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
2211#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
a834585d 2212#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
1bc32508 2213#endif
9ce192d4
RD
2214
2215//----------------------------------------------------------------------
0c5b83b0
RD
2216// Utility functions used within wxSTC
2217
2218#ifndef SWIG
2219
2220inline wxString stc2wx(const char* str) {
2221#if wxUSE_UNICODE
2222 return wxString(str, wxConvUTF8);
2223#else
2224 return wxString(str);
2225#endif
2226}
2227
2228inline wxString stc2wx(const char* str, size_t len) {
2229#if wxUSE_UNICODE
2230 return wxString(str, wxConvUTF8, len);
2231#else
2232 return wxString(str, len);
2233#endif
2234}
2235
2236#if wxUSE_UNICODE
2237inline const wxWX2MBbuf wx2stc(const wxString& str) {
2238 return str.mb_str(wxConvUTF8);
2239}
2240#else
2241inline const wxWX2MBbuf wx2stc(const wxString& str) {
2242 return str.mbc_str();
2243}
2244#endif
2245
2246#endif
2247
2248
9ce192d4
RD
2249//----------------------------------------------------------------------
2250#endif
2251
2252