Minimal tweaks and additions to get wxSTC compiling successfully again, with Scintilla 3.21

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2012-08-14 05:14:46 +00:00
parent 0926a31276
commit 9b01abb82d
8 changed files with 1147 additions and 178 deletions

View File

@@ -77,9 +77,6 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
// The SC_CP_UTF8 value can be used to enter Unicode mode. // The SC_CP_UTF8 value can be used to enter Unicode mode.
// This is the same value as CP_UTF8 in Windows // This is the same value as CP_UTF8 in Windows
#define wxSTC_CP_UTF8 65001 #define wxSTC_CP_UTF8 65001
// The SC_CP_DBCS value can be used to indicate a DBCS mode for GTK+.
#define wxSTC_CP_DBCS 1
#define wxSTC_MARKER_MAX 31 #define wxSTC_MARKER_MAX 31
#define wxSTC_MARK_CIRCLE 0 #define wxSTC_MARK_CIRCLE 0
#define wxSTC_MARK_ROUNDRECT 1 #define wxSTC_MARK_ROUNDRECT 1
@@ -106,7 +103,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_MARK_CIRCLEMINUS 20 #define wxSTC_MARK_CIRCLEMINUS 20
#define wxSTC_MARK_CIRCLEMINUSCONNECTED 21 #define wxSTC_MARK_CIRCLEMINUSCONNECTED 21
// Invisible mark that only sets the line background color. // Invisible mark that only sets the line background colour.
#define wxSTC_MARK_BACKGROUND 22 #define wxSTC_MARK_BACKGROUND 22
#define wxSTC_MARK_DOTDOTDOT 23 #define wxSTC_MARK_DOTDOTDOT 23
#define wxSTC_MARK_ARROWS 24 #define wxSTC_MARK_ARROWS 24
@@ -115,6 +112,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_MARK_LEFTRECT 27 #define wxSTC_MARK_LEFTRECT 27
#define wxSTC_MARK_AVAILABLE 28 #define wxSTC_MARK_AVAILABLE 28
#define wxSTC_MARK_UNDERLINE 29 #define wxSTC_MARK_UNDERLINE 29
#define wxSTC_MARK_RGBAIMAGE 30
#define wxSTC_MARK_CHARACTER 10000 #define wxSTC_MARK_CHARACTER 10000
// Markers used for outlining column. // Markers used for outlining column.
@@ -171,6 +169,10 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_CASE_MIXED 0 #define wxSTC_CASE_MIXED 0
#define wxSTC_CASE_UPPER 1 #define wxSTC_CASE_UPPER 1
#define wxSTC_CASE_LOWER 2 #define wxSTC_CASE_LOWER 2
#define wxSTC_FONT_SIZE_MULTIPLIER 100
#define wxSTC_WEIGHT_NORMAL 400
#define wxSTC_WEIGHT_SEMIBOLD 600
#define wxSTC_WEIGHT_BOLD 700
// Indicator style enumeration and some constants // Indicator style enumeration and some constants
#define wxSTC_INDIC_PLAIN 0 #define wxSTC_INDIC_PLAIN 0
@@ -181,6 +183,11 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_INDIC_HIDDEN 5 #define wxSTC_INDIC_HIDDEN 5
#define wxSTC_INDIC_BOX 6 #define wxSTC_INDIC_BOX 6
#define wxSTC_INDIC_ROUNDBOX 7 #define wxSTC_INDIC_ROUNDBOX 7
#define wxSTC_INDIC_STRAIGHTBOX 8
#define wxSTC_INDIC_DASH 9
#define wxSTC_INDIC_DOTS 10
#define wxSTC_INDIC_SQUIGGLELOW 11
#define wxSTC_INDIC_DOTBOX 12
#define wxSTC_INDIC_MAX 31 #define wxSTC_INDIC_MAX 31
#define wxSTC_INDIC_CONTAINER 8 #define wxSTC_INDIC_CONTAINER 8
#define wxSTC_INDIC0_MASK 0x20 #define wxSTC_INDIC0_MASK 0x20
@@ -227,6 +234,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_WRAPVISUALFLAG_NONE 0x0000 #define wxSTC_WRAPVISUALFLAG_NONE 0x0000
#define wxSTC_WRAPVISUALFLAG_END 0x0001 #define wxSTC_WRAPVISUALFLAG_END 0x0001
#define wxSTC_WRAPVISUALFLAG_START 0x0002 #define wxSTC_WRAPVISUALFLAG_START 0x0002
#define wxSTC_WRAPVISUALFLAG_MARGIN 0x0004
#define wxSTC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 #define wxSTC_WRAPVISUALFLAGLOC_DEFAULT 0x0000
#define wxSTC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 #define wxSTC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001
#define wxSTC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002 #define wxSTC_WRAPVISUALFLAGLOC_START_BY_TEXT 0x0002
@@ -244,6 +252,8 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_EFF_QUALITY_NON_ANTIALIASED 1 #define wxSTC_EFF_QUALITY_NON_ANTIALIASED 1
#define wxSTC_EFF_QUALITY_ANTIALIASED 2 #define wxSTC_EFF_QUALITY_ANTIALIASED 2
#define wxSTC_EFF_QUALITY_LCD_OPTIMIZED 3 #define wxSTC_EFF_QUALITY_LCD_OPTIMIZED 3
#define wxSTC_MULTIPASTE_ONCE 0
#define wxSTC_MULTIPASTE_EACH 1
#define wxSTC_EDGE_NONE 0 #define wxSTC_EDGE_NONE 0
#define wxSTC_EDGE_LINE 1 #define wxSTC_EDGE_LINE 1
#define wxSTC_EDGE_BACKGROUND 2 #define wxSTC_EDGE_BACKGROUND 2
@@ -251,7 +261,9 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_STATUS_FAILURE 1 #define wxSTC_STATUS_FAILURE 1
#define wxSTC_STATUS_BADALLOC 2 #define wxSTC_STATUS_BADALLOC 2
#define wxSTC_CURSORNORMAL -1 #define wxSTC_CURSORNORMAL -1
#define wxSTC_CURSORARROW 2
#define wxSTC_CURSORWAIT 4 #define wxSTC_CURSORWAIT 4
#define wxSTC_CURSORREVERSEARROW 7
// Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. // Constants for use with SetVisiblePolicy, similar to SetCaretPolicy.
#define wxSTC_VISIBLE_SLOP 0x01 #define wxSTC_VISIBLE_SLOP 0x01
@@ -286,12 +298,19 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_SEL_RECTANGLE 1 #define wxSTC_SEL_RECTANGLE 1
#define wxSTC_SEL_LINES 2 #define wxSTC_SEL_LINES 2
#define wxSTC_SEL_THIN 3 #define wxSTC_SEL_THIN 3
#define wxSTC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE 0
#define wxSTC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1
#define wxSTC_CARETSTICKY_OFF 0
#define wxSTC_CARETSTICKY_ON 1
#define wxSTC_CARETSTICKY_WHITESPACE 2
#define wxSTC_ALPHA_TRANSPARENT 0 #define wxSTC_ALPHA_TRANSPARENT 0
#define wxSTC_ALPHA_OPAQUE 255 #define wxSTC_ALPHA_OPAQUE 255
#define wxSTC_ALPHA_NOALPHA 256 #define wxSTC_ALPHA_NOALPHA 256
#define wxSTC_CARETSTYLE_INVISIBLE 0 #define wxSTC_CARETSTYLE_INVISIBLE 0
#define wxSTC_CARETSTYLE_LINE 1 #define wxSTC_CARETSTYLE_LINE 1
#define wxSTC_CARETSTYLE_BLOCK 2 #define wxSTC_CARETSTYLE_BLOCK 2
#define wxSTC_MARGINOPTION_NONE 0
#define wxSTC_MARGINOPTION_SUBLINESELECT 1
#define wxSTC_ANNOTATION_HIDDEN 0 #define wxSTC_ANNOTATION_HIDDEN 0
#define wxSTC_ANNOTATION_STANDARD 1 #define wxSTC_ANNOTATION_STANDARD 1
#define wxSTC_ANNOTATION_BOXED 2 #define wxSTC_ANNOTATION_BOXED 2
@@ -299,9 +318,14 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_SCVS_NONE 0 #define wxSTC_SCVS_NONE 0
#define wxSTC_SCVS_RECTANGULARSELECTION 1 #define wxSTC_SCVS_RECTANGULARSELECTION 1
#define wxSTC_SCVS_USERACCESSIBLE 2 #define wxSTC_SCVS_USERACCESSIBLE 2
#define wxSTC_TECHNOLOGY_DEFAULT 0
#define wxSTC_TECHNOLOGY_DIRECTWRITE 1
// Maximum value of keywordSet parameter of SetKeyWords. // Maximum value of keywordSet parameter of SetKeyWords.
#define wxSTC_KEYWORDSET_MAX 8 #define wxSTC_KEYWORDSET_MAX 8
#define wxSTC_TYPE_BOOLEAN 0
#define wxSTC_TYPE_INTEGER 1
#define wxSTC_TYPE_STRING 2
// Notifications // Notifications
// Type of modification and the action which caused the modification. // Type of modification and the action which caused the modification.
@@ -326,7 +350,12 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_MOD_CHANGEMARGIN 0x10000 #define wxSTC_MOD_CHANGEMARGIN 0x10000
#define wxSTC_MOD_CHANGEANNOTATION 0x20000 #define wxSTC_MOD_CHANGEANNOTATION 0x20000
#define wxSTC_MOD_CONTAINER 0x40000 #define wxSTC_MOD_CONTAINER 0x40000
#define wxSTC_MODEVENTMASKALL 0x7FFFF #define wxSTC_MOD_LEXERSTATE 0x80000
#define wxSTC_MODEVENTMASKALL 0xFFFFF
#define wxSTC_UPDATE_CONTENT 0x1
#define wxSTC_UPDATE_SELECTION 0x2
#define wxSTC_UPDATE_V_SCROLL 0x4
#define wxSTC_UPDATE_H_SCROLL 0x8
// Symbolic key codes and modifier flags. // Symbolic key codes and modifier flags.
// ASCII and other printable characters below 256. // ASCII and other printable characters below 256.
@@ -356,6 +385,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_SCMOD_CTRL 2 #define wxSTC_SCMOD_CTRL 2
#define wxSTC_SCMOD_ALT 4 #define wxSTC_SCMOD_ALT 4
#define wxSTC_SCMOD_SUPER 8 #define wxSTC_SCMOD_SUPER 8
#define wxSTC_SCMOD_META 16
// For SciLexer.h // For SciLexer.h
#define wxSTC_LEX_CONTAINER 0 #define wxSTC_LEX_CONTAINER 0
@@ -455,6 +485,15 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_LEX_NIMROD 96 #define wxSTC_LEX_NIMROD 96
#define wxSTC_LEX_SML 97 #define wxSTC_LEX_SML 97
#define wxSTC_LEX_MARKDOWN 98 #define wxSTC_LEX_MARKDOWN 98
#define wxSTC_LEX_TXT2TAGS 99
#define wxSTC_LEX_A68K 100
#define wxSTC_LEX_MODULA 101
#define wxSTC_LEX_COFFEESCRIPT 102
#define wxSTC_LEX_TCMD 103
#define wxSTC_LEX_AVS 104
#define wxSTC_LEX_ECL 105
#define wxSTC_LEX_OSCRIPT 106
#define wxSTC_LEX_VISUALPROLOG 107
// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a // When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
// value assigned in sequence from SCLEX_AUTOMATIC+1. // value assigned in sequence from SCLEX_AUTOMATIC+1.
@@ -499,6 +538,10 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_C_COMMENTDOCKEYWORD 17 #define wxSTC_C_COMMENTDOCKEYWORD 17
#define wxSTC_C_COMMENTDOCKEYWORDERROR 18 #define wxSTC_C_COMMENTDOCKEYWORDERROR 18
#define wxSTC_C_GLOBALCLASS 19 #define wxSTC_C_GLOBALCLASS 19
#define wxSTC_C_STRINGRAW 20
#define wxSTC_C_TRIPLEVERBATIM 21
#define wxSTC_C_HASHQUOTEDSTRING 22
#define wxSTC_C_PREPROCESSORCOMMENT 23
// Lexical states for SCLEX_D // Lexical states for SCLEX_D
#define wxSTC_D_DEFAULT 0 #define wxSTC_D_DEFAULT 0
@@ -722,6 +765,16 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_PL_SUB_PROTOTYPE 40 #define wxSTC_PL_SUB_PROTOTYPE 40
#define wxSTC_PL_FORMAT_IDENT 41 #define wxSTC_PL_FORMAT_IDENT 41
#define wxSTC_PL_FORMAT 42 #define wxSTC_PL_FORMAT 42
#define wxSTC_PL_STRING_VAR 43
#define wxSTC_PL_XLAT 44
#define wxSTC_PL_REGEX_VAR 54
#define wxSTC_PL_REGSUBST_VAR 55
#define wxSTC_PL_BACKTICKS_VAR 57
#define wxSTC_PL_HERE_QQ_VAR 61
#define wxSTC_PL_HERE_QX_VAR 62
#define wxSTC_PL_STRING_QQ_VAR 64
#define wxSTC_PL_STRING_QX_VAR 65
#define wxSTC_PL_STRING_QR_VAR 66
// Lexical states for SCLEX_RUBY // Lexical states for SCLEX_RUBY
#define wxSTC_RB_DEFAULT 0 #define wxSTC_RB_DEFAULT 0
@@ -794,6 +847,14 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_L_TAG 2 #define wxSTC_L_TAG 2
#define wxSTC_L_MATH 3 #define wxSTC_L_MATH 3
#define wxSTC_L_COMMENT 4 #define wxSTC_L_COMMENT 4
#define wxSTC_L_TAG2 5
#define wxSTC_L_MATH2 6
#define wxSTC_L_COMMENT2 7
#define wxSTC_L_VERBATIM 8
#define wxSTC_L_SHORTCMD 9
#define wxSTC_L_SPECIAL 10
#define wxSTC_L_CMDOPT 11
#define wxSTC_L_ERROR 12
// Lexical states for SCLEX_LUA // Lexical states for SCLEX_LUA
#define wxSTC_LUA_DEFAULT 0 #define wxSTC_LUA_DEFAULT 0
@@ -816,6 +877,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_LUA_WORD6 17 #define wxSTC_LUA_WORD6 17
#define wxSTC_LUA_WORD7 18 #define wxSTC_LUA_WORD7 18
#define wxSTC_LUA_WORD8 19 #define wxSTC_LUA_WORD8 19
#define wxSTC_LUA_LABEL 20
// Lexical states for SCLEX_ERRORLIST // Lexical states for SCLEX_ERRORLIST
#define wxSTC_ERR_DEFAULT 0 #define wxSTC_ERR_DEFAULT 0
@@ -851,6 +913,19 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_BAT_IDENTIFIER 6 #define wxSTC_BAT_IDENTIFIER 6
#define wxSTC_BAT_OPERATOR 7 #define wxSTC_BAT_OPERATOR 7
// Lexical states for SCLEX_TCMD
#define wxSTC_TCMD_DEFAULT 0
#define wxSTC_TCMD_COMMENT 1
#define wxSTC_TCMD_WORD 2
#define wxSTC_TCMD_LABEL 3
#define wxSTC_TCMD_HIDE 4
#define wxSTC_TCMD_COMMAND 5
#define wxSTC_TCMD_IDENTIFIER 6
#define wxSTC_TCMD_OPERATOR 7
#define wxSTC_TCMD_ENVIRONMENT 8
#define wxSTC_TCMD_EXPANSION 9
#define wxSTC_TCMD_CLABEL 10
// Lexical states for SCLEX_MAKEFILE // Lexical states for SCLEX_MAKEFILE
#define wxSTC_MAKE_DEFAULT 0 #define wxSTC_MAKE_DEFAULT 0
#define wxSTC_MAKE_COMMENT 1 #define wxSTC_MAKE_COMMENT 1
@@ -1025,6 +1100,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_ASM_CHARACTER 12 #define wxSTC_ASM_CHARACTER 12
#define wxSTC_ASM_STRINGEOL 13 #define wxSTC_ASM_STRINGEOL 13
#define wxSTC_ASM_EXTINSTRUCTION 14 #define wxSTC_ASM_EXTINSTRUCTION 14
#define wxSTC_ASM_COMMENTDIRECTIVE 15
// Lexical states for SCLEX_FORTRAN // Lexical states for SCLEX_FORTRAN
#define wxSTC_F_DEFAULT 0 #define wxSTC_F_DEFAULT 0
@@ -1066,6 +1142,8 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_CSS_EXTENDED_IDENTIFIER 19 #define wxSTC_CSS_EXTENDED_IDENTIFIER 19
#define wxSTC_CSS_EXTENDED_PSEUDOCLASS 20 #define wxSTC_CSS_EXTENDED_PSEUDOCLASS 20
#define wxSTC_CSS_EXTENDED_PSEUDOELEMENT 21 #define wxSTC_CSS_EXTENDED_PSEUDOELEMENT 21
#define wxSTC_CSS_MEDIA 22
#define wxSTC_CSS_VARIABLE 23
// Lexical states for SCLEX_POV // Lexical states for SCLEX_POV
#define wxSTC_POV_DEFAULT 0 #define wxSTC_POV_DEFAULT 0
@@ -1567,11 +1645,19 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_FS_DATE 16 #define wxSTC_FS_DATE 16
#define wxSTC_FS_STRINGEOL 17 #define wxSTC_FS_STRINGEOL 17
#define wxSTC_FS_CONSTANT 18 #define wxSTC_FS_CONSTANT 18
#define wxSTC_FS_ASM 19 #define wxSTC_FS_WORDOPERATOR 19
#define wxSTC_FS_LABEL 20 #define wxSTC_FS_DISABLEDCODE 20
#define wxSTC_FS_ERROR 21 #define wxSTC_FS_DEFAULT_C 21
#define wxSTC_FS_HEXNUMBER 22 #define wxSTC_FS_COMMENTDOC_C 22
#define wxSTC_FS_BINNUMBER 23 #define wxSTC_FS_COMMENTLINEDOC_C 23
#define wxSTC_FS_KEYWORD_C 24
#define wxSTC_FS_KEYWORD2_C 25
#define wxSTC_FS_NUMBER_C 26
#define wxSTC_FS_STRING_C 27
#define wxSTC_FS_PREPROCESSOR_C 28
#define wxSTC_FS_OPERATOR_C 29
#define wxSTC_FS_IDENTIFIER_C 30
#define wxSTC_FS_STRINGEOL_C 31
// Lexical states for SCLEX_CSOUND // Lexical states for SCLEX_CSOUND
#define wxSTC_CSOUND_DEFAULT 0 #define wxSTC_CSOUND_DEFAULT 0
@@ -1778,6 +1864,9 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_POWERSHELL_KEYWORD 8 #define wxSTC_POWERSHELL_KEYWORD 8
#define wxSTC_POWERSHELL_CMDLET 9 #define wxSTC_POWERSHELL_CMDLET 9
#define wxSTC_POWERSHELL_ALIAS 10 #define wxSTC_POWERSHELL_ALIAS 10
#define wxSTC_POWERSHELL_FUNCTION 11
#define wxSTC_POWERSHELL_USER1 12
#define wxSTC_POWERSHELL_COMMENTSTREAM 13
// Lexical state for SCLEX_MYSQL // Lexical state for SCLEX_MYSQL
#define wxSTC_MYSQL_DEFAULT 0 #define wxSTC_MYSQL_DEFAULT 0
@@ -1903,6 +1992,196 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar;
#define wxSTC_MARKDOWN_CODE2 20 #define wxSTC_MARKDOWN_CODE2 20
#define wxSTC_MARKDOWN_CODEBK 21 #define wxSTC_MARKDOWN_CODEBK 21
// Lexical state for SCLEX_TXT2TAGS
#define wxSTC_TXT2TAGS_DEFAULT 0
#define wxSTC_TXT2TAGS_LINE_BEGIN 1
#define wxSTC_TXT2TAGS_STRONG1 2
#define wxSTC_TXT2TAGS_STRONG2 3
#define wxSTC_TXT2TAGS_EM1 4
#define wxSTC_TXT2TAGS_EM2 5
#define wxSTC_TXT2TAGS_HEADER1 6
#define wxSTC_TXT2TAGS_HEADER2 7
#define wxSTC_TXT2TAGS_HEADER3 8
#define wxSTC_TXT2TAGS_HEADER4 9
#define wxSTC_TXT2TAGS_HEADER5 10
#define wxSTC_TXT2TAGS_HEADER6 11
#define wxSTC_TXT2TAGS_PRECHAR 12
#define wxSTC_TXT2TAGS_ULIST_ITEM 13
#define wxSTC_TXT2TAGS_OLIST_ITEM 14
#define wxSTC_TXT2TAGS_BLOCKQUOTE 15
#define wxSTC_TXT2TAGS_STRIKEOUT 16
#define wxSTC_TXT2TAGS_HRULE 17
#define wxSTC_TXT2TAGS_LINK 18
#define wxSTC_TXT2TAGS_CODE 19
#define wxSTC_TXT2TAGS_CODE2 20
#define wxSTC_TXT2TAGS_CODEBK 21
#define wxSTC_TXT2TAGS_COMMENT 22
#define wxSTC_TXT2TAGS_OPTION 23
#define wxSTC_TXT2TAGS_PREPROC 24
#define wxSTC_TXT2TAGS_POSTPROC 25
// Lexical states for SCLEX_A68K
#define wxSTC_A68K_DEFAULT 0
#define wxSTC_A68K_COMMENT 1
#define wxSTC_A68K_NUMBER_DEC 2
#define wxSTC_A68K_NUMBER_BIN 3
#define wxSTC_A68K_NUMBER_HEX 4
#define wxSTC_A68K_STRING1 5
#define wxSTC_A68K_OPERATOR 6
#define wxSTC_A68K_CPUINSTRUCTION 7
#define wxSTC_A68K_EXTINSTRUCTION 8
#define wxSTC_A68K_REGISTER 9
#define wxSTC_A68K_DIRECTIVE 10
#define wxSTC_A68K_MACRO_ARG 11
#define wxSTC_A68K_LABEL 12
#define wxSTC_A68K_STRING2 13
#define wxSTC_A68K_IDENTIFIER 14
#define wxSTC_A68K_MACRO_DECLARATION 15
#define wxSTC_A68K_COMMENT_WORD 16
#define wxSTC_A68K_COMMENT_SPECIAL 17
#define wxSTC_A68K_COMMENT_DOXYGEN 18
// Lexical states for SCLEX_MODULA
#define wxSTC_MODULA_DEFAULT 0
#define wxSTC_MODULA_COMMENT 1
#define wxSTC_MODULA_DOXYCOMM 2
#define wxSTC_MODULA_DOXYKEY 3
#define wxSTC_MODULA_KEYWORD 4
#define wxSTC_MODULA_RESERVED 5
#define wxSTC_MODULA_NUMBER 6
#define wxSTC_MODULA_BASENUM 7
#define wxSTC_MODULA_FLOAT 8
#define wxSTC_MODULA_STRING 9
#define wxSTC_MODULA_STRSPEC 10
#define wxSTC_MODULA_CHAR 11
#define wxSTC_MODULA_CHARSPEC 12
#define wxSTC_MODULA_PROC 13
#define wxSTC_MODULA_PRAGMA 14
#define wxSTC_MODULA_PRGKEY 15
#define wxSTC_MODULA_OPERATOR 16
#define wxSTC_MODULA_BADSTR 17
// Lexical states for SCLEX_COFFEESCRIPT
#define wxSTC_COFFEESCRIPT_DEFAULT 0
#define wxSTC_COFFEESCRIPT_COMMENT 1
#define wxSTC_COFFEESCRIPT_COMMENTLINE 2
#define wxSTC_COFFEESCRIPT_COMMENTDOC 3
#define wxSTC_COFFEESCRIPT_NUMBER 4
#define wxSTC_COFFEESCRIPT_WORD 5
#define wxSTC_COFFEESCRIPT_STRING 6
#define wxSTC_COFFEESCRIPT_CHARACTER 7
#define wxSTC_COFFEESCRIPT_UUID 8
#define wxSTC_COFFEESCRIPT_PREPROCESSOR 9
#define wxSTC_COFFEESCRIPT_OPERATOR 10
#define wxSTC_COFFEESCRIPT_IDENTIFIER 11
#define wxSTC_COFFEESCRIPT_STRINGEOL 12
#define wxSTC_COFFEESCRIPT_VERBATIM 13
#define wxSTC_COFFEESCRIPT_REGEX 14
#define wxSTC_COFFEESCRIPT_COMMENTLINEDOC 15
#define wxSTC_COFFEESCRIPT_WORD2 16
#define wxSTC_COFFEESCRIPT_COMMENTDOCKEYWORD 17
#define wxSTC_COFFEESCRIPT_COMMENTDOCKEYWORDERROR 18
#define wxSTC_COFFEESCRIPT_GLOBALCLASS 19
#define wxSTC_COFFEESCRIPT_STRINGRAW 20
#define wxSTC_COFFEESCRIPT_TRIPLEVERBATIM 21
#define wxSTC_COFFEESCRIPT_HASHQUOTEDSTRING 22
#define wxSTC_COFFEESCRIPT_COMMENTBLOCK 22
#define wxSTC_COFFEESCRIPT_VERBOSE_REGEX 23
#define wxSTC_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24
// Lexical states for SCLEX_AVS
#define wxSTC_AVS_DEFAULT 0
#define wxSTC_AVS_COMMENTBLOCK 1
#define wxSTC_AVS_COMMENTBLOCKN 2
#define wxSTC_AVS_COMMENTLINE 3
#define wxSTC_AVS_NUMBER 4
#define wxSTC_AVS_OPERATOR 5
#define wxSTC_AVS_IDENTIFIER 6
#define wxSTC_AVS_STRING 7
#define wxSTC_AVS_TRIPLESTRING 8
#define wxSTC_AVS_KEYWORD 9
#define wxSTC_AVS_FILTER 10
#define wxSTC_AVS_PLUGIN 11
#define wxSTC_AVS_FUNCTION 12
#define wxSTC_AVS_CLIPPROP 13
#define wxSTC_AVS_USERDFN 14
// Lexical states for SCLEX_ECL
#define wxSTC_ECL_DEFAULT 0
#define wxSTC_ECL_COMMENT 1
#define wxSTC_ECL_COMMENTLINE 2
#define wxSTC_ECL_NUMBER 3
#define wxSTC_ECL_STRING 4
#define wxSTC_ECL_WORD0 5
#define wxSTC_ECL_OPERATOR 6
#define wxSTC_ECL_CHARACTER 7
#define wxSTC_ECL_UUID 8
#define wxSTC_ECL_PREPROCESSOR 9
#define wxSTC_ECL_UNKNOWN 10
#define wxSTC_ECL_IDENTIFIER 11
#define wxSTC_ECL_STRINGEOL 12
#define wxSTC_ECL_VERBATIM 13
#define wxSTC_ECL_REGEX 14
#define wxSTC_ECL_COMMENTLINEDOC 15
#define wxSTC_ECL_WORD1 16
#define wxSTC_ECL_COMMENTDOCKEYWORD 17
#define wxSTC_ECL_COMMENTDOCKEYWORDERROR 18
#define wxSTC_ECL_WORD2 19
#define wxSTC_ECL_WORD3 20
#define wxSTC_ECL_WORD4 21
#define wxSTC_ECL_WORD5 22
#define wxSTC_ECL_COMMENTDOC 23
#define wxSTC_ECL_ADDED 24
#define wxSTC_ECL_DELETED 25
#define wxSTC_ECL_CHANGED 26
#define wxSTC_ECL_MOVED 27
// Lexical states for SCLEX_OSCRIPT
#define wxSTC_OSCRIPT_DEFAULT 0
#define wxSTC_OSCRIPT_LINE_COMMENT 1
#define wxSTC_OSCRIPT_BLOCK_COMMENT 2
#define wxSTC_OSCRIPT_DOC_COMMENT 3
#define wxSTC_OSCRIPT_PREPROCESSOR 4
#define wxSTC_OSCRIPT_NUMBER 5
#define wxSTC_OSCRIPT_SINGLEQUOTE_STRING 6
#define wxSTC_OSCRIPT_DOUBLEQUOTE_STRING 7
#define wxSTC_OSCRIPT_CONSTANT 8
#define wxSTC_OSCRIPT_IDENTIFIER 9
#define wxSTC_OSCRIPT_GLOBAL 10
#define wxSTC_OSCRIPT_KEYWORD 11
#define wxSTC_OSCRIPT_OPERATOR 12
#define wxSTC_OSCRIPT_LABEL 13
#define wxSTC_OSCRIPT_TYPE 14
#define wxSTC_OSCRIPT_FUNCTION 15
#define wxSTC_OSCRIPT_OBJECT 16
#define wxSTC_OSCRIPT_PROPERTY 17
#define wxSTC_OSCRIPT_METHOD 18
// Lexical states for SCLEX_VISUALPROLOG
#define wxSTC_VISUALPROLOG_DEFAULT 0
#define wxSTC_VISUALPROLOG_KEY_MAJOR 1
#define wxSTC_VISUALPROLOG_KEY_MINOR 2
#define wxSTC_VISUALPROLOG_KEY_DIRECTIVE 3
#define wxSTC_VISUALPROLOG_COMMENT_BLOCK 4
#define wxSTC_VISUALPROLOG_COMMENT_LINE 5
#define wxSTC_VISUALPROLOG_COMMENT_KEY 6
#define wxSTC_VISUALPROLOG_COMMENT_KEY_ERROR 7
#define wxSTC_VISUALPROLOG_IDENTIFIER 8
#define wxSTC_VISUALPROLOG_VARIABLE 9
#define wxSTC_VISUALPROLOG_ANONYMOUS 10
#define wxSTC_VISUALPROLOG_NUMBER 11
#define wxSTC_VISUALPROLOG_OPERATOR 12
#define wxSTC_VISUALPROLOG_CHARACTER 13
#define wxSTC_VISUALPROLOG_CHARACTER_TOO_MANY 14
#define wxSTC_VISUALPROLOG_CHARACTER_ESCAPE_ERROR 15
#define wxSTC_VISUALPROLOG_STRING 16
#define wxSTC_VISUALPROLOG_STRING_ESCAPE 17
#define wxSTC_VISUALPROLOG_STRING_ESCAPE_ERROR 18
#define wxSTC_VISUALPROLOG_STRING_EOL_OPEN 19
#define wxSTC_VISUALPROLOG_STRING_VERBATIM 20
#define wxSTC_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21
#define wxSTC_VISUALPROLOG_STRING_VERBATIM_EOL 22
//}}} //}}}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
@@ -2249,6 +2528,9 @@ public:
// Delete all text in the document. // Delete all text in the document.
void ClearAll(); void ClearAll();
// Delete a range of text in the document.
void DeleteRange(int pos, int deleteLength);
// Set all style bytes to 0, remove all folding information. // Set all style bytes to 0, remove all folding information.
void ClearDocumentStyle(); void ClearDocumentStyle();
@@ -2376,6 +2658,12 @@ public:
// Set the background colour used for a particular marker number. // Set the background colour used for a particular marker number.
void MarkerSetBackground(int markerNumber, const wxColour& back); void MarkerSetBackground(int markerNumber, const wxColour& back);
// Set the background colour used for a particular marker number when its folding block is selected.
void MarkerSetBackSelected(int markerNumber, const wxColour& back);
// Enable/disable highlight for current folding bloc (smallest one that contains the caret)
void MarkerEnableHighlight(bool enabled);
// Add a marker to a line, returning an ID which can be used to find or delete the marker. // Add a marker to a line, returning an ID which can be used to find or delete the marker.
int MarkerAdd(int line, int markerNumber); int MarkerAdd(int line, int markerNumber);
@@ -2388,7 +2676,8 @@ public:
// Get a bit mask of all the markers set on a line. // Get a bit mask of all the markers set on a line.
int MarkerGet(int line); int MarkerGet(int line);
// Find the next line after lineStart that includes a marker in mask. // Find the next line at or after lineStart that includes a marker in mask.
// Return -1 when no more lines.
int MarkerNext(int lineStart, int markerMask); int MarkerNext(int lineStart, int markerMask);
// Find the previous line before lineStart that includes a marker in mask. // Find the previous line before lineStart that includes a marker in mask.
@@ -2427,6 +2716,12 @@ public:
// Retrieve the mouse click sensitivity of a margin. // Retrieve the mouse click sensitivity of a margin.
bool GetMarginSensitive(int margin) const; bool GetMarginSensitive(int margin) const;
// Set the cursor shown when the mouse is inside a margin.
void SetMarginCursorN(int margin, int cursor);
// Retrieve the cursor shown in a margin.
int GetMarginCursorN(int margin) const;
// Clear all the styles and make equivalent to the global default style. // Clear all the styles and make equivalent to the global default style.
void StyleClearAll(); void StyleClearAll();
@@ -2500,6 +2795,18 @@ public:
// Set a style to be mixed case, or to force upper or lower case. // Set a style to be mixed case, or to force upper or lower case.
void StyleSetCase(int style, int caseForce); void StyleSetCase(int style, int caseForce);
// Set the size of characters of a style. Size is in points multiplied by 100.
void StyleSetSizeFractional(int style, int caseForce);
// Get the size of characters of a style in points multiplied by 100
int StyleGetSizeFractional(int style) const;
// Set the weight of characters of a style.
void StyleSetWeight(int style, int weight);
// Get the weight of characters of a style.
int StyleGetWeight(int style) const;
// Set a style to be a hotspot or not. // Set a style to be a hotspot or not.
void StyleSetHotSpot(int style, bool hotspot); void StyleSetHotSpot(int style, bool hotspot);
@@ -2549,6 +2856,9 @@ public:
// First sets defaults like SetCharsDefault. // First sets defaults like SetCharsDefault.
void SetWordChars(const wxString& characters); void SetWordChars(const wxString& characters);
// Get the set of characters making up words for when moving or selecting by word.
wxString GetWordChars() const;
// Start a sequence of actions that is undone and redone as a unit. // Start a sequence of actions that is undone and redone as a unit.
// May be nested. // May be nested.
void BeginUndoAction(); void BeginUndoAction();
@@ -2741,6 +3051,9 @@ public:
// Retrieve the column number of a position, taking tab width into account. // Retrieve the column number of a position, taking tab width into account.
int GetColumn(int pos) const; int GetColumn(int pos) const;
// Count characters between two positions.
int CountCharacters(int startPos, int endPos);
// Show or hide the horizontal scroll bar. // Show or hide the horizontal scroll bar.
void SetUseHorizontalScrollBar(bool show); void SetUseHorizontalScrollBar(bool show);
@@ -2787,6 +3100,9 @@ public:
// Returns the position at the end of the selection. // Returns the position at the end of the selection.
int GetSelectionEnd() const; int GetSelectionEnd() const;
// Set caret to a position, while removing any existing selection.
void SetEmptySelection(int pos);
// Sets the print magnification added to the point size of each style for printing. // Sets the print magnification added to the point size of each style for printing.
void SetPrintMagnification(int magnification); void SetPrintMagnification(int magnification);
@@ -2972,6 +3288,9 @@ public:
// Enable use of STYLE_CALLTIP and set call tip tab size in pixels. // Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
void CallTipUseStyle(int tabSize); void CallTipUseStyle(int tabSize);
// Set position of calltip, above or below text.
void CallTipSetPosition(bool above);
// Find the display line of a document line taking hidden lines into account. // Find the display line of a document line taking hidden lines into account.
int VisibleFromDocLine(int line); int VisibleFromDocLine(int line);
@@ -3004,6 +3323,9 @@ public:
// Is a line visible? // Is a line visible?
bool GetLineVisible(int line) const; bool GetLineVisible(int line) const;
// Are all lines visible?
bool GetAllLinesVisible() const;
// Show the children of a header line. // Show the children of a header line.
void SetFoldExpanded(int line, bool expanded); void SetFoldExpanded(int line, bool expanded);
@@ -3131,6 +3453,15 @@ public:
// Scroll so that a display line is at the top of the display. // Scroll so that a display line is at the top of the display.
void SetFirstVisibleLine(int lineDisplay); void SetFirstVisibleLine(int lineDisplay);
// Change the effect of pasting when there are multiple selections.
void SetMultiPaste(int multiPaste);
// Retrieve the effect of pasting when there are multiple selections..
int GetMultiPaste() const;
// Retrieve the value of a tag from a regular expression search.
wxString GetTag(int tagNumber) const;
// Make the target range start and end be the same as the selection range start and end. // Make the target range start and end be the same as the selection range start and end.
void TargetFromSelection(); void TargetFromSelection();
@@ -3327,9 +3658,15 @@ public:
// Highlight the characters at two positions. // Highlight the characters at two positions.
void BraceHighlight(int pos1, int pos2); void BraceHighlight(int pos1, int pos2);
// Use specified indicator to highlight matching braces instead of changing their style.
void BraceHighlightIndicator(bool useBraceHighlightIndicator, int indicator);
// Highlight the character at a position indicating there is no matching brace. // Highlight the character at a position indicating there is no matching brace.
void BraceBadLight(int pos); void BraceBadLight(int pos);
// Use specified indicator to highlight non matching brace instead of changing its style.
void BraceBadLightIndicator(bool useBraceBadLightIndicator, int indicator);
// Find the position of a matching brace or INVALID_POSITION if no match. // Find the position of a matching brace or INVALID_POSITION if no match.
int BraceMatch(int pos); int BraceMatch(int pos);
@@ -3464,14 +3801,14 @@ public:
// Delete forwards from the current position to the end of the line. // Delete forwards from the current position to the end of the line.
void DelLineRight(); void DelLineRight();
// Get and Set the xOffset (ie, horizonal scroll position). // Get and Set the xOffset (ie, horizontal scroll position).
void SetXOffset(int newOffset); void SetXOffset(int newOffset);
int GetXOffset() const; int GetXOffset() const;
// Set the last x chosen value to be the caret x position. // Set the last x chosen value to be the caret x position.
void ChooseCaretX(); void ChooseCaretX();
// Set the way the caret is kept visible when going sideway. // Set the way the caret is kept visible when going sideways.
// The exclusion zone is given in pixels. // The exclusion zone is given in pixels.
void SetXCaretPolicy(int caretPolicy, int caretSlop); void SetXCaretPolicy(int caretPolicy, int caretSlop);
@@ -3599,11 +3936,27 @@ public:
// Should be called after SetWordChars. // Should be called after SetWordChars.
void SetWhitespaceChars(const wxString& characters); void SetWhitespaceChars(const wxString& characters);
// Get the set of characters making up whitespace for when moving or selecting by word.
wxString GetWhitespaceChars() const;
// Set the set of characters making up punctuation characters
// Should be called after SetWordChars.
void SetPunctuationChars(const wxString& characters);
// Get the set of characters making up punctuation characters
wxString GetPunctuationChars() const;
// Reset the set of characters for whitespace and word characters to the defaults. // Reset the set of characters for whitespace and word characters to the defaults.
void SetCharsDefault(); void SetCharsDefault();
// Get currently selected item position in the auto-completion list // Get currently selected item position in the auto-completion list
int AutoCompGetCurrent(); int AutoCompGetCurrent() const;
// Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference.
void AutoCSetCaseInsensitiveBehaviour(int behaviour);
// Get auto-completion case insensitive behaviour.
int AutoCGetCaseInsensitiveBehaviour() const;
// Enlarge the document to a particular size of text bytes. // Enlarge the document to a particular size of text bytes.
void Allocate(int bytes); void Allocate(int bytes);
@@ -3613,10 +3966,10 @@ public:
int FindColumn(int line, int column); int FindColumn(int line, int column);
// Can the caret preferred x position only be changed by explicit movement commands? // Can the caret preferred x position only be changed by explicit movement commands?
bool GetCaretSticky() const; int GetCaretSticky() const;
// Stop the caret preferred x position changing when the user types. // Stop the caret preferred x position changing when the user types.
void SetCaretSticky(bool useCaretStickyBehaviour); void SetCaretSticky(int useCaretStickyBehaviour);
// Switch between sticky and non-sticky: meant to be bound to a key. // Switch between sticky and non-sticky: meant to be bound to a key.
void ToggleCaretSticky(); void ToggleCaretSticky();
@@ -3651,7 +4004,7 @@ public:
// Set the value used for IndicatorFillRange // Set the value used for IndicatorFillRange
void SetIndicatorValue(int value); void SetIndicatorValue(int value);
// Get the current indicator vaue // Get the current indicator value
int GetIndicatorValue() const; int GetIndicatorValue() const;
// Turn a indicator on over a range. // Turn a indicator on over a range.
@@ -3685,6 +4038,15 @@ public:
// characters in the document. // characters in the document.
const char* GetCharacterPointer(); const char* GetCharacterPointer();
// Return a read-only pointer to a range of characters in the document.
// May move the gap so that the range is contiguous, but will only move up
// to rangeLength bytes.
int GetRangePointer(int position, int rangeLength) const;
// Return a position which, to avoid performance costs, should not be within
// the range of a call to GetRangePointer.
int GetGapPosition() const;
// Always interpret keyboard input as Unicode // Always interpret keyboard input as Unicode
void SetKeysUnicode(bool keysUnicode); void SetKeysUnicode(bool keysUnicode);
@@ -3697,6 +4059,12 @@ public:
// Get the alpha fill colour of the given indicator. // Get the alpha fill colour of the given indicator.
int IndicatorGetAlpha(int indicator) const; int IndicatorGetAlpha(int indicator) const;
// Set the alpha outline colour of the given indicator.
void IndicSetOutlineAlpha(int indicator, int alpha);
// Get the alpha outline colour of the given indicator.
int IndicGetOutlineAlpha(int indicator) const;
// Set extra ascent for each line // Set extra ascent for each line
void SetExtraAscent(int extraAscent); void SetExtraAscent(int extraAscent);
@@ -3739,6 +4107,12 @@ public:
// Get the start of the range of style numbers used for margin text // Get the start of the range of style numbers used for margin text
int MarginGetStyleOffset() const; int MarginGetStyleOffset() const;
// Set the margin options.
void SetMarginOptions(int marginOptions);
// Get the margin options.
int GetMarginOptions() const;
// Set the annotation text for a line // Set the annotation text for a line
void AnnotationSetText(int line, const wxString& text); void AnnotationSetText(int line, const wxString& text);
@@ -3889,6 +4263,67 @@ public:
// Swap that caret and anchor of the main selection. // Swap that caret and anchor of the main selection.
void SwapMainAnchorCaret(); void SwapMainAnchorCaret();
// Indicate that the internal state of a lexer has changed over a range and therefore
// there may be a need to redraw.
int ChangeLexerState(int start, int end);
// Find the next line at or after lineStart that is a contracted fold header line.
// Return -1 when no more lines.
int ContractedFoldNext(int lineStart);
// Centre current line in window.
void VerticalCentreCaret();
// Move the selected lines up one line, shifting the line above after the selection
void MoveSelectedLinesUp();
// Move the selected lines down one line, shifting the line below before the selection
void MoveSelectedLinesDown();
// Set the identifier reported as idFrom in notification messages.
void SetIdentifier(int identifier);
// Get the identifier.
int GetIdentifier() const;
// Set the width for future RGBA image data.
void RGBAImageSetWidth(int width);
// Set the height for future RGBA image data.
void RGBAImageSetHeight(int height);
// Define a marker from RGBA data.
// It has the width and height from RGBAImageSetWidth/Height
void MarkerDefineRGBAImage(int markerNumber, const wxString& pixels);
// Register an RGBA image for use in autocompletion lists.
// It has the width and height from RGBAImageSetWidth/Height
void RegisterRGBAImage(int type, const wxString& pixels);
// Scroll to start of document.
void ScrollToStart();
// Scroll to end of document.
void ScrollToEnd();
// Set the technology used.
void SetTechnology(int technology);
// Get the tech.
int GetTechnology() const;
// Create an ILoader*.
int CreateLoader(int bytes);
// On OS X, show a find indicator.
void FindIndicatorShow(int start, int end);
// On OS X, flash a find indicator, then fade out.
void FindIndicatorFlash(int start, int end);
// On OS X, hide the find indicator.
void FindIndicatorHide();
// Start notifying the container of all key presses and commands. // Start notifying the container of all key presses and commands.
void StartRecord(); void StartRecord();
@@ -3927,6 +4362,21 @@ public:
// Retrieve the number of bits the current lexer needs for styling. // Retrieve the number of bits the current lexer needs for styling.
int GetStyleBitsNeeded() const; int GetStyleBitsNeeded() const;
// For private communication between an application and a known lexer.
int PrivateLexerCall(int operation, int pointer);
// Retrieve a '\n' separated list of properties understood by the current lexer.
wxString PropertyNames() const;
// Retrieve the type of a property.
int PropertyType(const wxString& name);
// Describe a property.
wxString DescribeProperty(const wxString& name) const;
// Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.
wxString DescribeKeyWordSets() const;
//}}} //}}}
//---------------------------------------------------------------------- //----------------------------------------------------------------------

View File

@@ -60,83 +60,19 @@ PRectangle PRectangleFromwxRect(wxRect rc) {
rc.GetRight()+1, rc.GetBottom()+1); rc.GetRight()+1, rc.GetBottom()+1);
} }
wxColour wxColourFromCA(const ColourAllocated& ca) { wxColour wxColourFromCD(ColourDesired& cd) {
ColourDesired cd(ca.AsLong());
return wxColour((unsigned char)cd.GetRed(), return wxColour((unsigned char)cd.GetRed(),
(unsigned char)cd.GetGreen(), (unsigned char)cd.GetGreen(),
(unsigned char)cd.GetBlue()); (unsigned char)cd.GetBlue());
} }
wxColour wxColourFromCAandAlpha(const ColourAllocated& ca, int alpha) { wxColour wxColourFromCDandAlpha(ColourDesired& cd, int alpha) {
ColourDesired cd(ca.AsLong());
return wxColour((unsigned char)cd.GetRed(), return wxColour((unsigned char)cd.GetRed(),
(unsigned char)cd.GetGreen(), (unsigned char)cd.GetGreen(),
(unsigned char)cd.GetBlue(), (unsigned char)cd.GetBlue(),
(unsigned char)alpha); (unsigned char)alpha);
} }
//----------------------------------------------------------------------
Palette::Palette() {
used = 0;
allowRealization = false;
size = 100;
entries = new ColourPair[size];
}
Palette::~Palette() {
Release();
wxDELETEA(entries);
}
void Palette::Release() {
used = 0;
delete [] entries;
size = 100;
entries = new ColourPair[size];
}
// This method either adds a colour to the list of wanted colours (want==true)
// or retrieves the allocated colour back to the ColourPair.
// This is one method to make it easier to keep the code for wanting and retrieving in sync.
void Palette::WantFind(ColourPair &cp, bool want) {
if (want) {
for (int i=0; i < used; i++) {
if (entries[i].desired == cp.desired)
return;
}
if (used >= size) {
int sizeNew = size * 2;
ColourPair *entriesNew = new ColourPair[sizeNew];
for (int j=0; j<size; j++) {
entriesNew[j] = entries[j];
}
delete []entries;
entries = entriesNew;
size = sizeNew;
}
entries[used].desired = cp.desired;
entries[used].allocated.Set(cp.desired.AsLong());
used++;
} else {
for (int i=0; i < used; i++) {
if (entries[i].desired == cp.desired) {
cp.allocated = entries[i].allocated;
return;
}
}
cp.allocated.Set(cp.desired.AsLong());
}
}
void Palette::Allocate(Window &) {
if (allowRealization) {
}
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
Font::Font() { Font::Font() {
@@ -147,28 +83,34 @@ Font::Font() {
Font::~Font() { Font::~Font() {
} }
void Font::Create(const char *faceName, int characterSet, void Font::Create(const FontParameters &fp) {
int size, bool bold, bool italic,
int WXUNUSED(extraFontFlag)) {
Release(); Release();
// The minus one is done because since Scintilla uses SC_SHARSET_DEFAULT // The minus one is done because since Scintilla uses SC_CHARSET_DEFAULT
// internally and we need to have wxFONENCODING_DEFAULT == SC_SHARSET_DEFAULT // internally and we need to have wxFONENCODING_DEFAULT == SC_SHARSET_DEFAULT
// so we adjust the encoding before passing it to Scintilla. See also // so we adjust the encoding before passing it to Scintilla. See also
// wxStyledTextCtrl::StyleSetCharacterSet // wxStyledTextCtrl::StyleSetCharacterSet
wxFontEncoding encoding = (wxFontEncoding)(characterSet-1); wxFontEncoding encoding = (wxFontEncoding)(fp.characterSet-1);
wxFontEncodingArray ea = wxEncodingConverter::GetPlatformEquivalents(encoding); wxFontEncodingArray ea = wxEncodingConverter::GetPlatformEquivalents(encoding);
if (ea.GetCount()) if (ea.GetCount())
encoding = ea[0]; encoding = ea[0];
wxFont* font = new wxFont(size, wxFontWeight weight;
wxDEFAULT, if (fp.weight <= 300)
italic ? wxITALIC : wxNORMAL, weight = wxFONTWEIGHT_LIGHT;
bold ? wxBOLD : wxNORMAL, else if (fp.weight >= 700)
false, weight = wxFONTWEIGHT_BOLD;
stc2wx(faceName), else
encoding); weight = wxFONTWEIGHT_NORMAL;
wxFont* font = new wxFont(fp.size,
wxFONTFAMILY_DEFAULT,
fp.italic ? wxFONTSTYLE_ITALIC : wxFONTSTYLE_NORMAL,
weight,
false,
stc2wx(fp.faceName),
encoding);
fid = font; fid = font;
} }
@@ -200,42 +142,43 @@ public:
virtual void Release(); virtual void Release();
virtual bool Initialised(); virtual bool Initialised();
virtual void PenColour(ColourAllocated fore); virtual void PenColour(ColourDesired fore);
virtual int LogPixelsY(); virtual int LogPixelsY();
virtual int DeviceHeightFont(int points); virtual int DeviceHeightFont(int points);
virtual void MoveTo(int x_, int y_); virtual void MoveTo(int x_, int y_);
virtual void LineTo(int x_, int y_); virtual void LineTo(int x_, int y_);
virtual void Polygon(Point *pts, int npts, ColourAllocated fore, ColourAllocated back); virtual void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back);
virtual void RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAllocated back); virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back);
virtual void FillRectangle(PRectangle rc, ColourAllocated back); virtual void FillRectangle(PRectangle rc, ColourDesired back);
virtual void FillRectangle(PRectangle rc, Surface &surfacePattern); virtual void FillRectangle(PRectangle rc, Surface &surfacePattern);
virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back); virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back);
virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill, virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill,
ColourAllocated outline, int alphaOutline, int flags); ColourDesired outline, int alphaOutline, int flags);
virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back); virtual void DrawRGBAImage(PRectangle rc, int width, int height,
const unsigned char *pixelsImage);
virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back);
virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource); virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource);
virtual void DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back); virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back);
virtual void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back); virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back);
virtual void DrawTextTransparent(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore); virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore);
virtual void MeasureWidths(Font &font_, const char *s, int len, int *positions); virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions);
virtual int WidthText(Font &font_, const char *s, int len); virtual XYPOSITION WidthText(Font &font_, const char *s, int len);
virtual int WidthChar(Font &font_, char ch); virtual XYPOSITION WidthChar(Font &font_, char ch);
virtual int Ascent(Font &font_); virtual XYPOSITION Ascent(Font &font_);
virtual int Descent(Font &font_); virtual XYPOSITION Descent(Font &font_);
virtual int InternalLeading(Font &font_); virtual XYPOSITION InternalLeading(Font &font_);
virtual int ExternalLeading(Font &font_); virtual XYPOSITION ExternalLeading(Font &font_);
virtual int Height(Font &font_); virtual XYPOSITION Height(Font &font_);
virtual int AverageCharWidth(Font &font_); virtual XYPOSITION AverageCharWidth(Font &font_);
virtual int SetPalette(Palette *pal, bool inBackGround);
virtual void SetClip(PRectangle rc); virtual void SetClip(PRectangle rc);
virtual void FlushCachedState(); virtual void FlushCachedState();
virtual void SetUnicodeMode(bool unicodeMode_); virtual void SetUnicodeMode(bool unicodeMode_);
virtual void SetDBCSMode(int codePage); virtual void SetDBCSMode(int codePage);
void BrushColour(ColourAllocated back); void BrushColour(ColourDesired back);
void SetFont(Font &font_); void SetFont(Font &font_);
}; };
@@ -298,12 +241,12 @@ bool SurfaceImpl::Initialised() {
} }
void SurfaceImpl::PenColour(ColourAllocated fore) { void SurfaceImpl::PenColour(ColourDesired fore) {
hdc->SetPen(wxPen(wxColourFromCA(fore))); hdc->SetPen(wxPen(wxColourFromCD(fore)));
} }
void SurfaceImpl::BrushColour(ColourAllocated back) { void SurfaceImpl::BrushColour(ColourDesired back) {
hdc->SetBrush(wxBrush(wxColourFromCA(back))); hdc->SetBrush(wxBrush(wxColourFromCD(back)));
} }
void SurfaceImpl::SetFont(Font &font_) { void SurfaceImpl::SetFont(Font &font_) {
@@ -331,19 +274,19 @@ void SurfaceImpl::LineTo(int x_, int y_) {
y = y_; y = y_;
} }
void SurfaceImpl::Polygon(Point *pts, int npts, ColourAllocated fore, ColourAllocated back) { void SurfaceImpl::Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back) {
PenColour(fore); PenColour(fore);
BrushColour(back); BrushColour(back);
hdc->DrawPolygon(npts, (wxPoint*)pts); hdc->DrawPolygon(npts, (wxPoint*)pts);
} }
void SurfaceImpl::RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAllocated back) { void SurfaceImpl::RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back) {
PenColour(fore); PenColour(fore);
BrushColour(back); BrushColour(back);
hdc->DrawRectangle(wxRectFromPRectangle(rc)); hdc->DrawRectangle(wxRectFromPRectangle(rc));
} }
void SurfaceImpl::FillRectangle(PRectangle rc, ColourAllocated back) { void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back) {
BrushColour(back); BrushColour(back);
hdc->SetPen(*wxTRANSPARENT_PEN); hdc->SetPen(*wxTRANSPARENT_PEN);
hdc->DrawRectangle(wxRectFromPRectangle(rc)); hdc->DrawRectangle(wxRectFromPRectangle(rc));
@@ -360,26 +303,26 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) {
hdc->DrawRectangle(wxRectFromPRectangle(rc)); hdc->DrawRectangle(wxRectFromPRectangle(rc));
} }
void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back) { void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) {
PenColour(fore); PenColour(fore);
BrushColour(back); BrushColour(back);
hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4); hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4);
} }
#ifdef __WXMSW__ #if defined(__WXMSW__) || defined(__WXMAC__)
#define wxPy_premultiply(p, a) ((p) * (a) / 0xff) #define wxPy_premultiply(p, a) ((p) * (a) / 0xff)
#else #else
#define wxPy_premultiply(p, a) (p) #define wxPy_premultiply(p, a) (p)
#endif #endif
void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize,
ColourAllocated fill, int alphaFill, ColourDesired fill, int alphaFill,
ColourAllocated outline, int alphaOutline, ColourDesired outline, int alphaOutline,
int /*flags*/) { int /*flags*/) {
#if wxUSE_GRAPHICS_CONTEXT #if wxUSE_GRAPHICS_CONTEXT
wxGCDC dc(*(wxMemoryDC*)hdc); wxGCDC dc(*(wxMemoryDC*)hdc);
wxColour penColour(wxColourFromCAandAlpha(outline, alphaOutline)); wxColour penColour(wxColourFromCDandAlpha(outline, alphaOutline));
wxColour brushColour(wxColourFromCAandAlpha(fill, alphaFill)); wxColour brushColour(wxColourFromCDandAlpha(fill, alphaFill));
dc.SetPen(wxPen(penColour)); dc.SetPen(wxPen(penColour));
dc.SetBrush(wxBrush(brushColour)); dc.SetBrush(wxBrush(brushColour));
dc.DrawRoundedRectangle(wxRectFromPRectangle(rc), cornerSize); dc.DrawRoundedRectangle(wxRectFromPRectangle(rc), cornerSize);
@@ -457,7 +400,46 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize,
#endif #endif
} }
void SurfaceImpl::Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back) { #ifdef wxHAS_RAW_BITMAP
wxBitmap BitmapFromRGBAImage(int width, int height, const unsigned char *pixelsImage)
{
int x, y;
wxBitmap bmp(width, height, 32);
wxAlphaPixelData pixData(bmp);
wxAlphaPixelData::Iterator p(pixData);
for (y=0; y<height; y++) {
p.MoveTo(pixData, 0, y);
for (x=0; x<width; x++) {
unsigned char red = *pixelsImage++;
unsigned char green = *pixelsImage++;
unsigned char blue = *pixelsImage++;
unsigned char alpha = *pixelsImage++;
p.Red() = wxPy_premultiply(red, alpha);
p.Green() = wxPy_premultiply(green, alpha);
p.Blue() = wxPy_premultiply(blue, alpha);
p.Alpha() = alpha;
++p;
}
}
return bmp;
}
#endif
void SurfaceImpl::DrawRGBAImage(PRectangle rc, int width, int height,
const unsigned char *pixelsImage)
{
#ifdef wxHAS_RAW_BITMAP
wxRect r = wxRectFromPRectangle(rc);
wxBitmap bmp = BitmapFromRGBAImage(width, height, pixelsImage);
hdc->DrawBitmap(bmp, r.x, r.y, true);
#endif
}
void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) {
PenColour(fore); PenColour(fore);
BrushColour(back); BrushColour(back);
hdc->DrawEllipse(wxRectFromPRectangle(rc)); hdc->DrawEllipse(wxRectFromPRectangle(rc));
@@ -470,12 +452,12 @@ void SurfaceImpl::Copy(PRectangle rc, Point from, Surface &surfaceSource) {
from.x, from.y, wxCOPY); from.x, from.y, wxCOPY);
} }
void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font, int ybase, void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font, XYPOSITION ybase,
const char *s, int len, const char *s, int len,
ColourAllocated fore, ColourAllocated back) { ColourDesired fore, ColourDesired back) {
SetFont(font); SetFont(font);
hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetTextForeground(wxColourFromCD(fore));
hdc->SetTextBackground(wxColourFromCA(back)); hdc->SetTextBackground(wxColourFromCD(back));
FillRectangle(rc, back); FillRectangle(rc, back);
// ybase is where the baseline should be, but wxWin uses the upper left // ybase is where the baseline should be, but wxWin uses the upper left
@@ -483,12 +465,12 @@ void SurfaceImpl::DrawTextNoClip(PRectangle rc, Font &font, int ybase,
hdc->DrawText(stc2wx(s, len), rc.left, ybase - font.ascent); hdc->DrawText(stc2wx(s, len), rc.left, ybase - font.ascent);
} }
void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font, int ybase, void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font, XYPOSITION ybase,
const char *s, int len, const char *s, int len,
ColourAllocated fore, ColourAllocated back) { ColourDesired fore, ColourDesired back) {
SetFont(font); SetFont(font);
hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetTextForeground(wxColourFromCD(fore));
hdc->SetTextBackground(wxColourFromCA(back)); hdc->SetTextBackground(wxColourFromCD(back));
FillRectangle(rc, back); FillRectangle(rc, back);
hdc->SetClippingRegion(wxRectFromPRectangle(rc)); hdc->SetClippingRegion(wxRectFromPRectangle(rc));
@@ -498,12 +480,12 @@ void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font, int ybase,
} }
void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font, int ybase, void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font, XYPOSITION ybase,
const char *s, int len, const char *s, int len,
ColourAllocated fore) { ColourDesired fore) {
SetFont(font); SetFont(font);
hdc->SetTextForeground(wxColourFromCA(fore)); hdc->SetTextForeground(wxColourFromCD(fore));
hdc->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); hdc->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT);
// ybase is where the baseline should be, but wxWin uses the upper left // ybase is where the baseline should be, but wxWin uses the upper left
@@ -514,7 +496,7 @@ void SurfaceImpl::DrawTextTransparent(PRectangle rc, Font &font, int ybase,
} }
void SurfaceImpl::MeasureWidths(Font &font, const char *s, int len, int *positions) { void SurfaceImpl::MeasureWidths(Font &font, const char *s, int len, XYPOSITION *positions) {
wxString str = stc2wx(s, len); wxString str = stc2wx(s, len);
wxArrayInt tpos; wxArrayInt tpos;
@@ -554,7 +536,7 @@ void SurfaceImpl::MeasureWidths(Font &font, const char *s, int len, int *positio
} }
int SurfaceImpl::WidthText(Font &font, const char *s, int len) { XYPOSITION SurfaceImpl::WidthText(Font &font, const char *s, int len) {
SetFont(font); SetFont(font);
int w; int w;
int h; int h;
@@ -564,7 +546,7 @@ int SurfaceImpl::WidthText(Font &font, const char *s, int len) {
} }
int SurfaceImpl::WidthChar(Font &font, char ch) { XYPOSITION SurfaceImpl::WidthChar(Font &font, char ch) {
SetFont(font); SetFont(font);
int w; int w;
int h; int h;
@@ -576,7 +558,7 @@ int SurfaceImpl::WidthChar(Font &font, char ch) {
#define EXTENT_TEST wxT(" `~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") #define EXTENT_TEST wxT(" `~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
int SurfaceImpl::Ascent(Font &font) { XYPOSITION SurfaceImpl::Ascent(Font &font) {
SetFont(font); SetFont(font);
int w, h, d, e; int w, h, d, e;
hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e);
@@ -584,38 +566,34 @@ int SurfaceImpl::Ascent(Font &font) {
return font.ascent; return font.ascent;
} }
int SurfaceImpl::Descent(Font &font) { XYPOSITION SurfaceImpl::Descent(Font &font) {
SetFont(font); SetFont(font);
int w, h, d, e; int w, h, d, e;
hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e);
return d; return d;
} }
int SurfaceImpl::InternalLeading(Font &WXUNUSED(font)) { XYPOSITION SurfaceImpl::InternalLeading(Font &WXUNUSED(font)) {
return 0; return 0;
} }
int SurfaceImpl::ExternalLeading(Font &font) { XYPOSITION SurfaceImpl::ExternalLeading(Font &font) {
SetFont(font); SetFont(font);
int w, h, d, e; int w, h, d, e;
hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e);
return e; return e;
} }
int SurfaceImpl::Height(Font &font) { XYPOSITION SurfaceImpl::Height(Font &font) {
SetFont(font); SetFont(font);
return hdc->GetCharHeight() + 1; return hdc->GetCharHeight() + 1;
} }
int SurfaceImpl::AverageCharWidth(Font &font) { XYPOSITION SurfaceImpl::AverageCharWidth(Font &font) {
SetFont(font); SetFont(font);
return hdc->GetCharWidth(); return hdc->GetCharWidth();
} }
int SurfaceImpl::SetPalette(Palette *WXUNUSED(pal), bool WXUNUSED(inBackGround)) {
return 0;
}
void SurfaceImpl::SetClip(PRectangle rc) { void SurfaceImpl::SetClip(PRectangle rc) {
hdc->SetClippingRegion(wxRectFromPRectangle(rc)); hdc->SetClippingRegion(wxRectFromPRectangle(rc));
} }
@@ -632,7 +610,7 @@ void SurfaceImpl::SetDBCSMode(int WXUNUSED(codePage)) {
} }
Surface *Surface::Allocate() { Surface *Surface::Allocate(int WXUNUSED(technology)) {
return new SurfaceImpl; return new SurfaceImpl;
} }
@@ -1125,9 +1103,10 @@ private:
public: public:
ListBoxImpl(); ListBoxImpl();
~ListBoxImpl(); ~ListBoxImpl();
static ListBox *Allocate();
virtual void SetFont(Font &font); virtual void SetFont(Font &font);
virtual void Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_); virtual void Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_, int technology_);
virtual void SetAverageCharWidth(int width); virtual void SetAverageCharWidth(int width);
virtual void SetVisibleRows(int rows); virtual void SetVisibleRows(int rows);
virtual int GetVisibleRows() const; virtual int GetVisibleRows() const;
@@ -1142,6 +1121,8 @@ public:
virtual int Find(const char *prefix); virtual int Find(const char *prefix);
virtual void GetValue(int n, char *value, int len); virtual void GetValue(int n, char *value, int len);
virtual void RegisterImage(int type, const char *xpm_data); virtual void RegisterImage(int type, const char *xpm_data);
void RegisterImageHelper(int type, wxBitmap& bmp);
virtual void RegisterRGBAImage(int type, int width, int height, const unsigned char *pixelsImage);
virtual void ClearRegisteredImages(); virtual void ClearRegisteredImages();
virtual void SetDoubleClickAction(CallBackAction, void *); virtual void SetDoubleClickAction(CallBackAction, void *);
virtual void SetList(const char* list, char separator, char typesep); virtual void SetList(const char* list, char separator, char typesep);
@@ -1166,7 +1147,7 @@ void ListBoxImpl::SetFont(Font &font) {
} }
void ListBoxImpl::Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_) { void ListBoxImpl::Create(Window &parent, int ctrlID, Point location_, int lineHeight_, bool unicodeMode_, int WXUNUSED(technology_)) {
location = location_; location = location_;
lineHeight = lineHeight_; lineHeight = lineHeight_;
unicodeMode = unicodeMode_; unicodeMode = unicodeMode_;
@@ -1311,12 +1292,8 @@ void ListBoxImpl::GetValue(int n, char *value, int len) {
value[len-1] = '\0'; value[len-1] = '\0';
} }
void ListBoxImpl::RegisterImageHelper(int type, wxBitmap& bmp)
void ListBoxImpl::RegisterImage(int type, const char *xpm_data) { {
wxMemoryInputStream stream(xpm_data, strlen(xpm_data)+1);
wxImage img(stream, wxBITMAP_TYPE_XPM);
wxBitmap bmp(img);
if (! imgList) { if (! imgList) {
// assumes all images are the same size // assumes all images are the same size
imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight(), true); imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight(), true);
@@ -1334,6 +1311,22 @@ void ListBoxImpl::RegisterImage(int type, const char *xpm_data) {
itm[type] = idx; itm[type] = idx;
} }
void ListBoxImpl::RegisterImage(int type, const char *xpm_data) {
wxMemoryInputStream stream(xpm_data, strlen(xpm_data)+1);
wxImage img(stream, wxBITMAP_TYPE_XPM);
wxBitmap bmp(img);
RegisterImageHelper(type, bmp);
}
void ListBoxImpl::RegisterRGBAImage(int type, int width, int height,
const unsigned char *pixelsImage)
{
wxBitmap bmp = BitmapFromRGBAImage(width, height, pixelsImage);
RegisterImageHelper(type, bmp);
}
void ListBoxImpl::ClearRegisteredImages() { void ListBoxImpl::ClearRegisteredImages() {
wxDELETE(imgList); wxDELETE(imgList);
wxDELETE(imgTypeMap); wxDELETE(imgTypeMap);

View File

@@ -4,5 +4,5 @@
wxRect wxRectFromPRectangle(PRectangle prc); wxRect wxRectFromPRectangle(PRectangle prc);
PRectangle PRectangleFromwxRect(wxRect rc); PRectangle PRectangleFromwxRect(wxRect rc);
wxColour wxColourFromCA(const ColourAllocated& ca); wxColour wxColourFromCD(const ColourDesired& ca);

View File

@@ -132,7 +132,7 @@ public:
void OnPaint(wxPaintEvent& WXUNUSED(evt)) void OnPaint(wxPaintEvent& WXUNUSED(evt))
{ {
wxAutoBufferedPaintDC dc(this); wxAutoBufferedPaintDC dc(this);
Surface* surfaceWindow = Surface::Allocate(); Surface* surfaceWindow = Surface::Allocate(0);
surfaceWindow->Init(&dc, m_ct->wDraw.GetID()); surfaceWindow->Init(&dc, m_ct->wDraw.GetID());
m_ct->PaintCT(surfaceWindow); m_ct->PaintCT(surfaceWindow);
surfaceWindow->Release(); surfaceWindow->Release();
@@ -671,6 +671,8 @@ sptr_t ScintillaWX::DefWndProc(unsigned int /*iMessage*/, uptr_t /*wParam*/, spt
sptr_t ScintillaWX::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { sptr_t ScintillaWX::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
switch (iMessage) { switch (iMessage) {
#if 0 // TODO: check this
case SCI_CALLTIPSHOW: { case SCI_CALLTIPSHOW: {
// NOTE: This is copied here from scintilla/src/ScintillaBase.cxx // NOTE: This is copied here from scintilla/src/ScintillaBase.cxx
// because of the little tweak that needs done below for wxGTK. // because of the little tweak that needs done below for wxGTK.
@@ -711,6 +713,7 @@ sptr_t ScintillaWX::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam)
ct.wCallTip.Show(); ct.wCallTip.Show();
break; break;
} }
#endif
#ifdef SCI_LEXER #ifdef SCI_LEXER
case SCI_LOADLEXERLIBRARY: case SCI_LOADLEXERLIBRARY:

View File

@@ -24,7 +24,10 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <vector>
#include <map>
// These are all Scintilla headers
#include "Platform.h" #include "Platform.h"
#include "SplitVector.h" #include "SplitVector.h"
#include "Partitioning.h" #include "Partitioning.h"
@@ -33,9 +36,12 @@
#include "ScintillaWidget.h" #include "ScintillaWidget.h"
#ifdef SCI_LEXER #ifdef SCI_LEXER
#include "SciLexer.h" #include "SciLexer.h"
#include "PropSet.h" #include "PropSetSimple.h"
#include "ILexer.h"
#include "LexerModule.h"
#include "LexAccessor.h"
#include "Accessor.h" #include "Accessor.h"
#include "KeyWords.h" #include "WordList.h"
#endif #endif
#include "ContractionState.h" #include "ContractionState.h"
#include "SVector.h" #include "SVector.h"

View File

@@ -735,6 +735,134 @@ methodOverrideMap = {
0), 0),
'GetWordChars' :
(0,
'wxString %s() const;',
'''wxString %s() const {
int msg = %s;
int len = SendMsg(msg, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);''',
('Get the set of characters making up words for when moving or selecting by word.',)),
'GetTag' :
(0,
'wxString %s(int tagNumber) const;',
'''wxString %s(int tagNumber) const {
int msg = %s;
int len = SendMsg(msg, tagNumber, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, tagNumber, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);''',
0),
'GetWhitespaceChars' :
(0,
'wxString %s() const;',
'''wxString %s() const {
int msg = %s;
int len = SendMsg(msg, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);''',
0),
'GetPunctuationChars' :
(0,
'wxString %s() const;',
'''wxString %s() const {
int msg = %s;
int len = SendMsg(msg, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);''',
0),
'PropertyNames' :
(0,
'wxString %s() const;',
'''wxString %s() const {
int msg = %s;
int len = SendMsg(msg, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);''',
0),
'DescribeProperty' :
(0,
'wxString %s(const wxString& name) const;',
'''wxString %s(const wxString& name) const {
int msg = %s;
int len = SendMsg(msg, (sptr_t)(const char*)wx2stc(name), NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)(const char*)wx2stc(name), (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);''',
0),
'DescribeKeyWordSets' :
(0,
'wxString %s() const;',
'''wxString %s() const {
int msg = %s;
int len = SendMsg(msg, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);''',
0),
'' : ('', 0, 0, 0), '' : ('', 0, 0, 0),
} }

View File

@@ -3,11 +3,11 @@ scintilla/include directories from the Scintilla source distribution.
All other code needed to implement Scintilla on top of wxWidgets is All other code needed to implement Scintilla on top of wxWidgets is
located in the directory above this one. located in the directory above this one.
The current version of the Scintilla code is 2.03 The current version of the Scintilla code is 3.21
These are the basic steps needed to update the version of Scintilla used by wxSTC. These are the basic steps needed to update the version of Scintilla used by wxSTC.
1. Copy include and src folders to src/stc/scintilla 1. Copy include, lexers, lexlib and src folders to src/stc/scintilla
2. Examine diffs between the new src/stc/scintilla/Scintilla.iface 2. Examine diffs between the new src/stc/scintilla/Scintilla.iface
file and the version in SVN. You should get familiar especially with file and the version in SVN. You should get familiar especially with

View File

@@ -278,6 +278,12 @@ void wxStyledTextCtrl::ClearAll()
SendMsg(2004, 0, 0); SendMsg(2004, 0, 0);
} }
// Delete a range of text in the document.
void wxStyledTextCtrl::DeleteRange(int pos, int deleteLength)
{
SendMsg(2645, pos, deleteLength);
}
// Set all style bytes to 0, remove all folding information. // Set all style bytes to 0, remove all folding information.
void wxStyledTextCtrl::ClearDocumentStyle() void wxStyledTextCtrl::ClearDocumentStyle()
{ {
@@ -544,6 +550,18 @@ void wxStyledTextCtrl::MarkerSetBackground(int markerNumber, const wxColour& bac
SendMsg(2042, markerNumber, wxColourAsLong(back)); SendMsg(2042, markerNumber, wxColourAsLong(back));
} }
// Set the background colour used for a particular marker number when its folding block is selected.
void wxStyledTextCtrl::MarkerSetBackSelected(int markerNumber, const wxColour& back)
{
SendMsg(2292, markerNumber, wxColourAsLong(back));
}
// Enable/disable highlight for current folding bloc (smallest one that contains the caret)
void wxStyledTextCtrl::MarkerEnableHighlight(bool enabled)
{
SendMsg(2293, enabled, 0);
}
// Add a marker to a line, returning an ID which can be used to find or delete the marker. // Add a marker to a line, returning an ID which can be used to find or delete the marker.
int wxStyledTextCtrl::MarkerAdd(int line, int markerNumber) int wxStyledTextCtrl::MarkerAdd(int line, int markerNumber)
{ {
@@ -568,7 +586,8 @@ int wxStyledTextCtrl::MarkerGet(int line)
return SendMsg(2046, line, 0); return SendMsg(2046, line, 0);
} }
// Find the next line after lineStart that includes a marker in mask. // Find the next line at or after lineStart that includes a marker in mask.
// Return -1 when no more lines.
int wxStyledTextCtrl::MarkerNext(int lineStart, int markerMask) int wxStyledTextCtrl::MarkerNext(int lineStart, int markerMask)
{ {
return SendMsg(2047, lineStart, markerMask); return SendMsg(2047, lineStart, markerMask);
@@ -657,6 +676,18 @@ bool wxStyledTextCtrl::GetMarginSensitive(int margin) const
return SendMsg(2247, margin, 0) != 0; return SendMsg(2247, margin, 0) != 0;
} }
// Set the cursor shown when the mouse is inside a margin.
void wxStyledTextCtrl::SetMarginCursorN(int margin, int cursor)
{
SendMsg(2248, margin, cursor);
}
// Retrieve the cursor shown in a margin.
int wxStyledTextCtrl::GetMarginCursorN(int margin) const
{
return SendMsg(2249, margin, 0);
}
// Clear all the styles and make equivalent to the global default style. // Clear all the styles and make equivalent to the global default style.
void wxStyledTextCtrl::StyleClearAll() void wxStyledTextCtrl::StyleClearAll()
{ {
@@ -810,6 +841,30 @@ void wxStyledTextCtrl::StyleSetCase(int style, int caseForce)
SendMsg(2060, style, caseForce); SendMsg(2060, style, caseForce);
} }
// Set the size of characters of a style. Size is in points multiplied by 100.
void wxStyledTextCtrl::StyleSetSizeFractional(int style, int caseForce)
{
SendMsg(2061, style, caseForce);
}
// Get the size of characters of a style in points multiplied by 100
int wxStyledTextCtrl::StyleGetSizeFractional(int style) const
{
return SendMsg(2062, style, 0);
}
// Set the weight of characters of a style.
void wxStyledTextCtrl::StyleSetWeight(int style, int weight)
{
SendMsg(2063, style, weight);
}
// Get the weight of characters of a style.
int wxStyledTextCtrl::StyleGetWeight(int style) const
{
return SendMsg(2064, style, 0);
}
// Set a style to be a hotspot or not. // Set a style to be a hotspot or not.
void wxStyledTextCtrl::StyleSetHotSpot(int style, bool hotspot) void wxStyledTextCtrl::StyleSetHotSpot(int style, bool hotspot)
{ {
@@ -904,6 +959,20 @@ void wxStyledTextCtrl::SetWordChars(const wxString& characters)
SendMsg(2077, 0, (sptr_t)(const char*)wx2stc(characters)); SendMsg(2077, 0, (sptr_t)(const char*)wx2stc(characters));
} }
// Get the set of characters making up words for when moving or selecting by word.
wxString wxStyledTextCtrl::GetWordChars() const {
int msg = 2646;
int len = SendMsg(msg, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);
}
// Start a sequence of actions that is undone and redone as a unit. // Start a sequence of actions that is undone and redone as a unit.
// May be nested. // May be nested.
void wxStyledTextCtrl::BeginUndoAction() void wxStyledTextCtrl::BeginUndoAction()
@@ -1286,6 +1355,12 @@ int wxStyledTextCtrl::GetColumn(int pos) const
return SendMsg(2129, pos, 0); return SendMsg(2129, pos, 0);
} }
// Count characters between two positions.
int wxStyledTextCtrl::CountCharacters(int startPos, int endPos)
{
return SendMsg(2633, startPos, endPos);
}
// Show or hide the horizontal scroll bar. // Show or hide the horizontal scroll bar.
void wxStyledTextCtrl::SetUseHorizontalScrollBar(bool show) void wxStyledTextCtrl::SetUseHorizontalScrollBar(bool show)
{ {
@@ -1378,6 +1453,12 @@ int wxStyledTextCtrl::GetSelectionEnd() const
return SendMsg(2145, 0, 0); return SendMsg(2145, 0, 0);
} }
// Set caret to a position, while removing any existing selection.
void wxStyledTextCtrl::SetEmptySelection(int pos)
{
SendMsg(2556, pos, 0);
}
// Sets the print magnification added to the point size of each style for printing. // Sets the print magnification added to the point size of each style for printing.
void wxStyledTextCtrl::SetPrintMagnification(int magnification) void wxStyledTextCtrl::SetPrintMagnification(int magnification)
{ {
@@ -1794,6 +1875,12 @@ void wxStyledTextCtrl::CallTipUseStyle(int tabSize)
SendMsg(2212, tabSize, 0); SendMsg(2212, tabSize, 0);
} }
// Set position of calltip, above or below text.
void wxStyledTextCtrl::CallTipSetPosition(bool above)
{
SendMsg(2213, above, 0);
}
// Find the display line of a document line taking hidden lines into account. // Find the display line of a document line taking hidden lines into account.
int wxStyledTextCtrl::VisibleFromDocLine(int line) int wxStyledTextCtrl::VisibleFromDocLine(int line)
{ {
@@ -1856,6 +1943,12 @@ bool wxStyledTextCtrl::GetLineVisible(int line) const
return SendMsg(2228, line, 0) != 0; return SendMsg(2228, line, 0) != 0;
} }
// Are all lines visible?
bool wxStyledTextCtrl::GetAllLinesVisible() const
{
return SendMsg(2236, 0, 0) != 0;
}
// Show the children of a header line. // Show the children of a header line.
void wxStyledTextCtrl::SetFoldExpanded(int line, bool expanded) void wxStyledTextCtrl::SetFoldExpanded(int line, bool expanded)
{ {
@@ -2103,6 +2196,32 @@ void wxStyledTextCtrl::SetFirstVisibleLine(int lineDisplay)
SendMsg(2613, lineDisplay, 0); SendMsg(2613, lineDisplay, 0);
} }
// Change the effect of pasting when there are multiple selections.
void wxStyledTextCtrl::SetMultiPaste(int multiPaste)
{
SendMsg(2614, multiPaste, 0);
}
// Retrieve the effect of pasting when there are multiple selections..
int wxStyledTextCtrl::GetMultiPaste() const
{
return SendMsg(2615, 0, 0);
}
// Retrieve the value of a tag from a regular expression search.
wxString wxStyledTextCtrl::GetTag(int tagNumber) const {
int msg = 2616;
int len = SendMsg(msg, tagNumber, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, tagNumber, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);
}
// Make the target range start and end be the same as the selection range start and end. // Make the target range start and end be the same as the selection range start and end.
void wxStyledTextCtrl::TargetFromSelection() void wxStyledTextCtrl::TargetFromSelection()
{ {
@@ -2497,12 +2616,24 @@ void wxStyledTextCtrl::BraceHighlight(int pos1, int pos2)
SendMsg(2351, pos1, pos2); SendMsg(2351, pos1, pos2);
} }
// Use specified indicator to highlight matching braces instead of changing their style.
void wxStyledTextCtrl::BraceHighlightIndicator(bool useBraceHighlightIndicator, int indicator)
{
SendMsg(2498, useBraceHighlightIndicator, indicator);
}
// Highlight the character at a position indicating there is no matching brace. // Highlight the character at a position indicating there is no matching brace.
void wxStyledTextCtrl::BraceBadLight(int pos) void wxStyledTextCtrl::BraceBadLight(int pos)
{ {
SendMsg(2352, pos, 0); SendMsg(2352, pos, 0);
} }
// Use specified indicator to highlight non matching brace instead of changing its style.
void wxStyledTextCtrl::BraceBadLightIndicator(bool useBraceBadLightIndicator, int indicator)
{
SendMsg(2499, useBraceBadLightIndicator, indicator);
}
// Find the position of a matching brace or INVALID_POSITION if no match. // Find the position of a matching brace or INVALID_POSITION if no match.
int wxStyledTextCtrl::BraceMatch(int pos) int wxStyledTextCtrl::BraceMatch(int pos)
{ {
@@ -2756,7 +2887,7 @@ void wxStyledTextCtrl::DelLineRight()
SendMsg(2396, 0, 0); SendMsg(2396, 0, 0);
} }
// Get and Set the xOffset (ie, horizonal scroll position). // Get and Set the xOffset (ie, horizontal scroll position).
void wxStyledTextCtrl::SetXOffset(int newOffset) void wxStyledTextCtrl::SetXOffset(int newOffset)
{ {
SendMsg(2397, newOffset, 0); SendMsg(2397, newOffset, 0);
@@ -2772,7 +2903,7 @@ void wxStyledTextCtrl::ChooseCaretX()
SendMsg(2399, 0, 0); SendMsg(2399, 0, 0);
} }
// Set the way the caret is kept visible when going sideway. // Set the way the caret is kept visible when going sideways.
// The exclusion zone is given in pixels. // The exclusion zone is given in pixels.
void wxStyledTextCtrl::SetXCaretPolicy(int caretPolicy, int caretSlop) void wxStyledTextCtrl::SetXCaretPolicy(int caretPolicy, int caretSlop)
{ {
@@ -3028,6 +3159,41 @@ void wxStyledTextCtrl::SetWhitespaceChars(const wxString& characters)
SendMsg(2443, 0, (sptr_t)(const char*)wx2stc(characters)); SendMsg(2443, 0, (sptr_t)(const char*)wx2stc(characters));
} }
// Get the set of characters making up whitespace for when moving or selecting by word.
wxString wxStyledTextCtrl::GetWhitespaceChars() const {
int msg = 2647;
int len = SendMsg(msg, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);
}
// Set the set of characters making up punctuation characters
// Should be called after SetWordChars.
void wxStyledTextCtrl::SetPunctuationChars(const wxString& characters)
{
SendMsg(2648, 0, (sptr_t)(const char*)wx2stc(characters));
}
// Get the set of characters making up punctuation characters
wxString wxStyledTextCtrl::GetPunctuationChars() const {
int msg = 2649;
int len = SendMsg(msg, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);
}
// Reset the set of characters for whitespace and word characters to the defaults. // Reset the set of characters for whitespace and word characters to the defaults.
void wxStyledTextCtrl::SetCharsDefault() void wxStyledTextCtrl::SetCharsDefault()
{ {
@@ -3035,11 +3201,23 @@ void wxStyledTextCtrl::SetCharsDefault()
} }
// Get currently selected item position in the auto-completion list // Get currently selected item position in the auto-completion list
int wxStyledTextCtrl::AutoCompGetCurrent() int wxStyledTextCtrl::AutoCompGetCurrent() const
{ {
return SendMsg(2445, 0, 0); return SendMsg(2445, 0, 0);
} }
// Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference.
void wxStyledTextCtrl::AutoCSetCaseInsensitiveBehaviour(int behaviour)
{
SendMsg(2634, behaviour, 0);
}
// Get auto-completion case insensitive behaviour.
int wxStyledTextCtrl::AutoCGetCaseInsensitiveBehaviour() const
{
return SendMsg(2635, 0, 0);
}
// Enlarge the document to a particular size of text bytes. // Enlarge the document to a particular size of text bytes.
void wxStyledTextCtrl::Allocate(int bytes) void wxStyledTextCtrl::Allocate(int bytes)
{ {
@@ -3054,13 +3232,13 @@ int wxStyledTextCtrl::FindColumn(int line, int column)
} }
// Can the caret preferred x position only be changed by explicit movement commands? // Can the caret preferred x position only be changed by explicit movement commands?
bool wxStyledTextCtrl::GetCaretSticky() const int wxStyledTextCtrl::GetCaretSticky() const
{ {
return SendMsg(2457, 0, 0) != 0; return SendMsg(2457, 0, 0);
} }
// Stop the caret preferred x position changing when the user types. // Stop the caret preferred x position changing when the user types.
void wxStyledTextCtrl::SetCaretSticky(bool useCaretStickyBehaviour) void wxStyledTextCtrl::SetCaretSticky(int useCaretStickyBehaviour)
{ {
SendMsg(2458, useCaretStickyBehaviour, 0); SendMsg(2458, useCaretStickyBehaviour, 0);
} }
@@ -3131,7 +3309,7 @@ void wxStyledTextCtrl::SetIndicatorValue(int value)
SendMsg(2502, value, 0); SendMsg(2502, value, 0);
} }
// Get the current indicator vaue // Get the current indicator value
int wxStyledTextCtrl::GetIndicatorValue() const int wxStyledTextCtrl::GetIndicatorValue() const
{ {
return SendMsg(2503, 0, 0); return SendMsg(2503, 0, 0);
@@ -3197,6 +3375,21 @@ const char* wxStyledTextCtrl::GetCharacterPointer() {
return (const char*)SendMsg(2520, 0, 0); return (const char*)SendMsg(2520, 0, 0);
} }
// Return a read-only pointer to a range of characters in the document.
// May move the gap so that the range is contiguous, but will only move up
// to rangeLength bytes.
int wxStyledTextCtrl::GetRangePointer(int position, int rangeLength) const
{
return SendMsg(2643, position, rangeLength);
}
// Return a position which, to avoid performance costs, should not be within
// the range of a call to GetRangePointer.
int wxStyledTextCtrl::GetGapPosition() const
{
return SendMsg(2644, 0, 0);
}
// Always interpret keyboard input as Unicode // Always interpret keyboard input as Unicode
void wxStyledTextCtrl::SetKeysUnicode(bool keysUnicode) void wxStyledTextCtrl::SetKeysUnicode(bool keysUnicode)
{ {
@@ -3221,6 +3414,18 @@ int wxStyledTextCtrl::IndicatorGetAlpha(int indicator) const
return SendMsg(2524, indicator, 0); return SendMsg(2524, indicator, 0);
} }
// Set the alpha outline colour of the given indicator.
void wxStyledTextCtrl::IndicSetOutlineAlpha(int indicator, int alpha)
{
SendMsg(2558, indicator, alpha);
}
// Get the alpha outline colour of the given indicator.
int wxStyledTextCtrl::IndicGetOutlineAlpha(int indicator) const
{
return SendMsg(2559, indicator, 0);
}
// Set extra ascent for each line // Set extra ascent for each line
void wxStyledTextCtrl::SetExtraAscent(int extraAscent) void wxStyledTextCtrl::SetExtraAscent(int extraAscent)
{ {
@@ -3319,6 +3524,18 @@ int wxStyledTextCtrl::MarginGetStyleOffset() const
return SendMsg(2538, 0, 0); return SendMsg(2538, 0, 0);
} }
// Set the margin options.
void wxStyledTextCtrl::SetMarginOptions(int marginOptions)
{
SendMsg(2539, marginOptions, 0);
}
// Get the margin options.
int wxStyledTextCtrl::GetMarginOptions() const
{
return SendMsg(2557, 0, 0);
}
// Set the annotation text for a line // Set the annotation text for a line
void wxStyledTextCtrl::AnnotationSetText(int line, const wxString& text) void wxStyledTextCtrl::AnnotationSetText(int line, const wxString& text)
{ {
@@ -3664,6 +3881,124 @@ void wxStyledTextCtrl::SwapMainAnchorCaret()
SendMsg(2607, 0, 0); SendMsg(2607, 0, 0);
} }
// Indicate that the internal state of a lexer has changed over a range and therefore
// there may be a need to redraw.
int wxStyledTextCtrl::ChangeLexerState(int start, int end)
{
return SendMsg(2617, start, end);
}
// Find the next line at or after lineStart that is a contracted fold header line.
// Return -1 when no more lines.
int wxStyledTextCtrl::ContractedFoldNext(int lineStart)
{
return SendMsg(2618, lineStart, 0);
}
// Centre current line in window.
void wxStyledTextCtrl::VerticalCentreCaret()
{
SendMsg(2619, 0, 0);
}
// Move the selected lines up one line, shifting the line above after the selection
void wxStyledTextCtrl::MoveSelectedLinesUp()
{
SendMsg(2620, 0, 0);
}
// Move the selected lines down one line, shifting the line below before the selection
void wxStyledTextCtrl::MoveSelectedLinesDown()
{
SendMsg(2621, 0, 0);
}
// Set the identifier reported as idFrom in notification messages.
void wxStyledTextCtrl::SetIdentifier(int identifier)
{
SendMsg(2622, identifier, 0);
}
// Get the identifier.
int wxStyledTextCtrl::GetIdentifier() const
{
return SendMsg(2623, 0, 0);
}
// Set the width for future RGBA image data.
void wxStyledTextCtrl::RGBAImageSetWidth(int width)
{
SendMsg(2624, width, 0);
}
// Set the height for future RGBA image data.
void wxStyledTextCtrl::RGBAImageSetHeight(int height)
{
SendMsg(2625, height, 0);
}
// Define a marker from RGBA data.
// It has the width and height from RGBAImageSetWidth/Height
void wxStyledTextCtrl::MarkerDefineRGBAImage(int markerNumber, const wxString& pixels)
{
SendMsg(2626, markerNumber, (sptr_t)(const char*)wx2stc(pixels));
}
// Register an RGBA image for use in autocompletion lists.
// It has the width and height from RGBAImageSetWidth/Height
void wxStyledTextCtrl::RegisterRGBAImage(int type, const wxString& pixels)
{
SendMsg(2627, type, (sptr_t)(const char*)wx2stc(pixels));
}
// Scroll to start of document.
void wxStyledTextCtrl::ScrollToStart()
{
SendMsg(2628, 0, 0);
}
// Scroll to end of document.
void wxStyledTextCtrl::ScrollToEnd()
{
SendMsg(2629, 0, 0);
}
// Set the technology used.
void wxStyledTextCtrl::SetTechnology(int technology)
{
SendMsg(2630, technology, 0);
}
// Get the tech.
int wxStyledTextCtrl::GetTechnology() const
{
return SendMsg(2631, 0, 0);
}
// Create an ILoader*.
int wxStyledTextCtrl::CreateLoader(int bytes)
{
return SendMsg(2632, bytes, 0);
}
// On OS X, show a find indicator.
void wxStyledTextCtrl::FindIndicatorShow(int start, int end)
{
SendMsg(2640, start, end);
}
// On OS X, flash a find indicator, then fade out.
void wxStyledTextCtrl::FindIndicatorFlash(int start, int end)
{
SendMsg(2641, start, end);
}
// On OS X, hide the find indicator.
void wxStyledTextCtrl::FindIndicatorHide()
{
SendMsg(2642, 0, 0);
}
// Start notifying the container of all key presses and commands. // Start notifying the container of all key presses and commands.
void wxStyledTextCtrl::StartRecord() void wxStyledTextCtrl::StartRecord()
{ {
@@ -3752,6 +4087,60 @@ int wxStyledTextCtrl::GetStyleBitsNeeded() const
return SendMsg(4011, 0, 0); return SendMsg(4011, 0, 0);
} }
// For private communication between an application and a known lexer.
int wxStyledTextCtrl::PrivateLexerCall(int operation, int pointer)
{
return SendMsg(4013, operation, pointer);
}
// Retrieve a '\n' separated list of properties understood by the current lexer.
wxString wxStyledTextCtrl::PropertyNames() const {
int msg = 4014;
int len = SendMsg(msg, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);
}
// Retrieve the type of a property.
int wxStyledTextCtrl::PropertyType(const wxString& name)
{
return SendMsg(4015, (sptr_t)(const char*)wx2stc(name), 0);
}
// Describe a property.
wxString wxStyledTextCtrl::DescribeProperty(const wxString& name) const {
int msg = 4016;
int len = SendMsg(msg, (sptr_t)(const char*)wx2stc(name), NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)(const char*)wx2stc(name), (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);
}
// Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.
wxString wxStyledTextCtrl::DescribeKeyWordSets() const {
int msg = 4017;
int len = SendMsg(msg, NULL);
if (!len) return wxEmptyString;
wxMemoryBuffer mbuf(len+1);
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(msg, (sptr_t)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);
}
//}}} //}}}
//---------------------------------------------------------------------- //----------------------------------------------------------------------