From 9b01abb82d79983cdc0e94f46e8f2ea99705aab2 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 14 Aug 2012 05:14:46 +0000 Subject: [PATCH] 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 --- include/wx/stc/stc.h | 484 +++++++++++++++++++++++++++++++++-- src/stc/PlatWX.cpp | 289 ++++++++++----------- src/stc/PlatWX.h | 2 +- src/stc/ScintillaWX.cpp | 5 +- src/stc/ScintillaWX.h | 10 +- src/stc/gen_iface.py | 128 +++++++++ src/stc/scintilla/README.txt | 4 +- src/stc/stc.cpp | 405 ++++++++++++++++++++++++++++- 8 files changed, 1148 insertions(+), 179 deletions(-) diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 0bddcfd8bd..7dc50fdd77 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -77,9 +77,6 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; // The SC_CP_UTF8 value can be used to enter Unicode mode. // This is the same value as CP_UTF8 in Windows #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_MARK_CIRCLE 0 #define wxSTC_MARK_ROUNDRECT 1 @@ -106,7 +103,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_MARK_CIRCLEMINUS 20 #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_DOTDOTDOT 23 #define wxSTC_MARK_ARROWS 24 @@ -115,6 +112,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_MARK_LEFTRECT 27 #define wxSTC_MARK_AVAILABLE 28 #define wxSTC_MARK_UNDERLINE 29 +#define wxSTC_MARK_RGBAIMAGE 30 #define wxSTC_MARK_CHARACTER 10000 // Markers used for outlining column. @@ -171,6 +169,10 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_CASE_MIXED 0 #define wxSTC_CASE_UPPER 1 #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 #define wxSTC_INDIC_PLAIN 0 @@ -181,6 +183,11 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_INDIC_HIDDEN 5 #define wxSTC_INDIC_BOX 6 #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_CONTAINER 8 #define wxSTC_INDIC0_MASK 0x20 @@ -227,6 +234,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_WRAPVISUALFLAG_NONE 0x0000 #define wxSTC_WRAPVISUALFLAG_END 0x0001 #define wxSTC_WRAPVISUALFLAG_START 0x0002 +#define wxSTC_WRAPVISUALFLAG_MARGIN 0x0004 #define wxSTC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 #define wxSTC_WRAPVISUALFLAGLOC_END_BY_TEXT 0x0001 #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_ANTIALIASED 2 #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_LINE 1 #define wxSTC_EDGE_BACKGROUND 2 @@ -251,7 +261,9 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_STATUS_FAILURE 1 #define wxSTC_STATUS_BADALLOC 2 #define wxSTC_CURSORNORMAL -1 +#define wxSTC_CURSORARROW 2 #define wxSTC_CURSORWAIT 4 +#define wxSTC_CURSORREVERSEARROW 7 // Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. #define wxSTC_VISIBLE_SLOP 0x01 @@ -286,12 +298,19 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_SEL_RECTANGLE 1 #define wxSTC_SEL_LINES 2 #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_OPAQUE 255 #define wxSTC_ALPHA_NOALPHA 256 #define wxSTC_CARETSTYLE_INVISIBLE 0 #define wxSTC_CARETSTYLE_LINE 1 #define wxSTC_CARETSTYLE_BLOCK 2 +#define wxSTC_MARGINOPTION_NONE 0 +#define wxSTC_MARGINOPTION_SUBLINESELECT 1 #define wxSTC_ANNOTATION_HIDDEN 0 #define wxSTC_ANNOTATION_STANDARD 1 #define wxSTC_ANNOTATION_BOXED 2 @@ -299,9 +318,14 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_SCVS_NONE 0 #define wxSTC_SCVS_RECTANGULARSELECTION 1 #define wxSTC_SCVS_USERACCESSIBLE 2 +#define wxSTC_TECHNOLOGY_DEFAULT 0 +#define wxSTC_TECHNOLOGY_DIRECTWRITE 1 // Maximum value of keywordSet parameter of SetKeyWords. #define wxSTC_KEYWORDSET_MAX 8 +#define wxSTC_TYPE_BOOLEAN 0 +#define wxSTC_TYPE_INTEGER 1 +#define wxSTC_TYPE_STRING 2 // Notifications // 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_CHANGEANNOTATION 0x20000 #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. // ASCII and other printable characters below 256. @@ -356,6 +385,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_SCMOD_CTRL 2 #define wxSTC_SCMOD_ALT 4 #define wxSTC_SCMOD_SUPER 8 +#define wxSTC_SCMOD_META 16 // For SciLexer.h #define wxSTC_LEX_CONTAINER 0 @@ -455,6 +485,15 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_LEX_NIMROD 96 #define wxSTC_LEX_SML 97 #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 // 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_COMMENTDOCKEYWORDERROR 18 #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 #define wxSTC_D_DEFAULT 0 @@ -722,6 +765,16 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_PL_SUB_PROTOTYPE 40 #define wxSTC_PL_FORMAT_IDENT 41 #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 #define wxSTC_RB_DEFAULT 0 @@ -794,6 +847,14 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_L_TAG 2 #define wxSTC_L_MATH 3 #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 #define wxSTC_LUA_DEFAULT 0 @@ -816,6 +877,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_LUA_WORD6 17 #define wxSTC_LUA_WORD7 18 #define wxSTC_LUA_WORD8 19 +#define wxSTC_LUA_LABEL 20 // Lexical states for SCLEX_ERRORLIST #define wxSTC_ERR_DEFAULT 0 @@ -851,6 +913,19 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_BAT_IDENTIFIER 6 #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 #define wxSTC_MAKE_DEFAULT 0 #define wxSTC_MAKE_COMMENT 1 @@ -1025,6 +1100,7 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_ASM_CHARACTER 12 #define wxSTC_ASM_STRINGEOL 13 #define wxSTC_ASM_EXTINSTRUCTION 14 +#define wxSTC_ASM_COMMENTDIRECTIVE 15 // Lexical states for SCLEX_FORTRAN #define wxSTC_F_DEFAULT 0 @@ -1066,6 +1142,8 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_CSS_EXTENDED_IDENTIFIER 19 #define wxSTC_CSS_EXTENDED_PSEUDOCLASS 20 #define wxSTC_CSS_EXTENDED_PSEUDOELEMENT 21 +#define wxSTC_CSS_MEDIA 22 +#define wxSTC_CSS_VARIABLE 23 // Lexical states for SCLEX_POV #define wxSTC_POV_DEFAULT 0 @@ -1567,11 +1645,19 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_FS_DATE 16 #define wxSTC_FS_STRINGEOL 17 #define wxSTC_FS_CONSTANT 18 -#define wxSTC_FS_ASM 19 -#define wxSTC_FS_LABEL 20 -#define wxSTC_FS_ERROR 21 -#define wxSTC_FS_HEXNUMBER 22 -#define wxSTC_FS_BINNUMBER 23 +#define wxSTC_FS_WORDOPERATOR 19 +#define wxSTC_FS_DISABLEDCODE 20 +#define wxSTC_FS_DEFAULT_C 21 +#define wxSTC_FS_COMMENTDOC_C 22 +#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 #define wxSTC_CSOUND_DEFAULT 0 @@ -1778,6 +1864,9 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_POWERSHELL_KEYWORD 8 #define wxSTC_POWERSHELL_CMDLET 9 #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 #define wxSTC_MYSQL_DEFAULT 0 @@ -1903,6 +1992,196 @@ class WXDLLIMPEXP_FWD_CORE wxScrollBar; #define wxSTC_MARKDOWN_CODE2 20 #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. 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. void ClearDocumentStyle(); @@ -2376,6 +2658,12 @@ public: // Set the background colour used for a particular marker number. 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. int MarkerAdd(int line, int markerNumber); @@ -2388,7 +2676,8 @@ public: // Get a bit mask of all the markers set on a 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); // 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. 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. void StyleClearAll(); @@ -2500,6 +2795,18 @@ public: // Set a style to be mixed case, or to force upper or lower case. 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. void StyleSetHotSpot(int style, bool hotspot); @@ -2549,6 +2856,9 @@ public: // First sets defaults like SetCharsDefault. 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. // May be nested. void BeginUndoAction(); @@ -2741,6 +3051,9 @@ public: // Retrieve the column number of a position, taking tab width into account. int GetColumn(int pos) const; + // Count characters between two positions. + int CountCharacters(int startPos, int endPos); + // Show or hide the horizontal scroll bar. void SetUseHorizontalScrollBar(bool show); @@ -2787,6 +3100,9 @@ public: // Returns the position at the end of the selection. 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. void SetPrintMagnification(int magnification); @@ -2972,6 +3288,9 @@ public: // Enable use of STYLE_CALLTIP and set call tip tab size in pixels. 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. int VisibleFromDocLine(int line); @@ -3004,6 +3323,9 @@ public: // Is a line visible? bool GetLineVisible(int line) const; + // Are all lines visible? + bool GetAllLinesVisible() const; + // Show the children of a header line. void SetFoldExpanded(int line, bool expanded); @@ -3131,6 +3453,15 @@ public: // Scroll so that a display line is at the top of the display. 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. void TargetFromSelection(); @@ -3327,9 +3658,15 @@ public: // Highlight the characters at two positions. 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. 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. int BraceMatch(int pos); @@ -3464,14 +3801,14 @@ public: // Delete forwards from the current position to the end of the line. void DelLineRight(); - // Get and Set the xOffset (ie, horizonal scroll position). + // Get and Set the xOffset (ie, horizontal scroll position). void SetXOffset(int newOffset); int GetXOffset() const; // Set the last x chosen value to be the caret x position. 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. void SetXCaretPolicy(int caretPolicy, int caretSlop); @@ -3599,11 +3936,27 @@ public: // Should be called after SetWordChars. 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. void SetCharsDefault(); // 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. void Allocate(int bytes); @@ -3613,10 +3966,10 @@ public: int FindColumn(int line, int column); // 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. - void SetCaretSticky(bool useCaretStickyBehaviour); + void SetCaretSticky(int useCaretStickyBehaviour); // Switch between sticky and non-sticky: meant to be bound to a key. void ToggleCaretSticky(); @@ -3651,7 +4004,7 @@ public: // Set the value used for IndicatorFillRange void SetIndicatorValue(int value); - // Get the current indicator vaue + // Get the current indicator value int GetIndicatorValue() const; // Turn a indicator on over a range. @@ -3685,6 +4038,15 @@ public: // characters in the document. 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 void SetKeysUnicode(bool keysUnicode); @@ -3697,6 +4059,12 @@ public: // Get the alpha fill colour of the given indicator. 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 void SetExtraAscent(int extraAscent); @@ -3739,6 +4107,12 @@ public: // Get the start of the range of style numbers used for margin text 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 void AnnotationSetText(int line, const wxString& text); @@ -3889,6 +4263,67 @@ public: // Swap that caret and anchor of the main selection. 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. void StartRecord(); @@ -3927,6 +4362,21 @@ public: // Retrieve the number of bits the current lexer needs for styling. 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; + //}}} //---------------------------------------------------------------------- diff --git a/src/stc/PlatWX.cpp b/src/stc/PlatWX.cpp index 917e4ea467..661b5207fe 100644 --- a/src/stc/PlatWX.cpp +++ b/src/stc/PlatWX.cpp @@ -60,83 +60,19 @@ PRectangle PRectangleFromwxRect(wxRect rc) { rc.GetRight()+1, rc.GetBottom()+1); } -wxColour wxColourFromCA(const ColourAllocated& ca) { - ColourDesired cd(ca.AsLong()); +wxColour wxColourFromCD(ColourDesired& cd) { return wxColour((unsigned char)cd.GetRed(), (unsigned char)cd.GetGreen(), (unsigned char)cd.GetBlue()); } -wxColour wxColourFromCAandAlpha(const ColourAllocated& ca, int alpha) { - ColourDesired cd(ca.AsLong()); +wxColour wxColourFromCDandAlpha(ColourDesired& cd, int alpha) { return wxColour((unsigned char)cd.GetRed(), (unsigned char)cd.GetGreen(), (unsigned char)cd.GetBlue(), (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= 700) + weight = wxFONTWEIGHT_BOLD; + else + 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; } @@ -200,42 +142,43 @@ public: virtual void Release(); virtual bool Initialised(); - virtual void PenColour(ColourAllocated fore); + virtual void PenColour(ColourDesired fore); virtual int LogPixelsY(); virtual int DeviceHeightFont(int points); virtual void MoveTo(int x_, int y_); virtual void LineTo(int x_, int y_); - virtual void Polygon(Point *pts, int npts, ColourAllocated fore, ColourAllocated back); - virtual void RectangleDraw(PRectangle rc, ColourAllocated fore, ColourAllocated back); - virtual void FillRectangle(PRectangle rc, ColourAllocated back); + virtual void Polygon(Point *pts, int npts, ColourDesired fore, ColourDesired back); + virtual void RectangleDraw(PRectangle rc, ColourDesired fore, ColourDesired back); + virtual void FillRectangle(PRectangle rc, ColourDesired back); virtual void FillRectangle(PRectangle rc, Surface &surfacePattern); - virtual void RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back); - virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourAllocated fill, int alphaFill, - ColourAllocated outline, int alphaOutline, int flags); - virtual void Ellipse(PRectangle rc, ColourAllocated fore, ColourAllocated back); + virtual void RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back); + virtual void AlphaRectangle(PRectangle rc, int cornerSize, ColourDesired fill, int alphaFill, + ColourDesired outline, int alphaOutline, int flags); + 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 DrawTextNoClip(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back); - virtual void DrawTextClipped(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore, ColourAllocated back); - virtual void DrawTextTransparent(PRectangle rc, Font &font_, int ybase, const char *s, int len, ColourAllocated fore); - virtual void MeasureWidths(Font &font_, const char *s, int len, int *positions); - virtual int WidthText(Font &font_, const char *s, int len); - virtual int WidthChar(Font &font_, char ch); - virtual int Ascent(Font &font_); - virtual int Descent(Font &font_); - virtual int InternalLeading(Font &font_); - virtual int ExternalLeading(Font &font_); - virtual int Height(Font &font_); - virtual int AverageCharWidth(Font &font_); - - virtual int SetPalette(Palette *pal, bool inBackGround); + 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_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back); + 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, XYPOSITION *positions); + virtual XYPOSITION WidthText(Font &font_, const char *s, int len); + virtual XYPOSITION WidthChar(Font &font_, char ch); + virtual XYPOSITION Ascent(Font &font_); + virtual XYPOSITION Descent(Font &font_); + virtual XYPOSITION InternalLeading(Font &font_); + virtual XYPOSITION ExternalLeading(Font &font_); + virtual XYPOSITION Height(Font &font_); + virtual XYPOSITION AverageCharWidth(Font &font_); + virtual void SetClip(PRectangle rc); virtual void FlushCachedState(); virtual void SetUnicodeMode(bool unicodeMode_); virtual void SetDBCSMode(int codePage); - void BrushColour(ColourAllocated back); + void BrushColour(ColourDesired back); void SetFont(Font &font_); }; @@ -298,12 +241,12 @@ bool SurfaceImpl::Initialised() { } -void SurfaceImpl::PenColour(ColourAllocated fore) { - hdc->SetPen(wxPen(wxColourFromCA(fore))); +void SurfaceImpl::PenColour(ColourDesired fore) { + hdc->SetPen(wxPen(wxColourFromCD(fore))); } -void SurfaceImpl::BrushColour(ColourAllocated back) { - hdc->SetBrush(wxBrush(wxColourFromCA(back))); +void SurfaceImpl::BrushColour(ColourDesired back) { + hdc->SetBrush(wxBrush(wxColourFromCD(back))); } void SurfaceImpl::SetFont(Font &font_) { @@ -331,19 +274,19 @@ void SurfaceImpl::LineTo(int x_, int 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); BrushColour(back); 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); BrushColour(back); hdc->DrawRectangle(wxRectFromPRectangle(rc)); } -void SurfaceImpl::FillRectangle(PRectangle rc, ColourAllocated back) { +void SurfaceImpl::FillRectangle(PRectangle rc, ColourDesired back) { BrushColour(back); hdc->SetPen(*wxTRANSPARENT_PEN); hdc->DrawRectangle(wxRectFromPRectangle(rc)); @@ -360,26 +303,26 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) { hdc->DrawRectangle(wxRectFromPRectangle(rc)); } -void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourAllocated fore, ColourAllocated back) { +void SurfaceImpl::RoundedRectangle(PRectangle rc, ColourDesired fore, ColourDesired back) { PenColour(fore); BrushColour(back); hdc->DrawRoundedRectangle(wxRectFromPRectangle(rc), 4); } -#ifdef __WXMSW__ +#if defined(__WXMSW__) || defined(__WXMAC__) #define wxPy_premultiply(p, a) ((p) * (a) / 0xff) #else #define wxPy_premultiply(p, a) (p) #endif void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, - ColourAllocated fill, int alphaFill, - ColourAllocated outline, int alphaOutline, + ColourDesired fill, int alphaFill, + ColourDesired outline, int alphaOutline, int /*flags*/) { #if wxUSE_GRAPHICS_CONTEXT wxGCDC dc(*(wxMemoryDC*)hdc); - wxColour penColour(wxColourFromCAandAlpha(outline, alphaOutline)); - wxColour brushColour(wxColourFromCAandAlpha(fill, alphaFill)); + wxColour penColour(wxColourFromCDandAlpha(outline, alphaOutline)); + wxColour brushColour(wxColourFromCDandAlpha(fill, alphaFill)); dc.SetPen(wxPen(penColour)); dc.SetBrush(wxBrush(brushColour)); dc.DrawRoundedRectangle(wxRectFromPRectangle(rc), cornerSize); @@ -457,7 +400,46 @@ void SurfaceImpl::AlphaRectangle(PRectangle rc, int cornerSize, #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; yDrawBitmap(bmp, r.x, r.y, true); +#endif +} + + +void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) { PenColour(fore); BrushColour(back); hdc->DrawEllipse(wxRectFromPRectangle(rc)); @@ -470,12 +452,12 @@ void SurfaceImpl::Copy(PRectangle rc, Point from, Surface &surfaceSource) { 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, - ColourAllocated fore, ColourAllocated back) { + ColourDesired fore, ColourDesired back) { SetFont(font); - hdc->SetTextForeground(wxColourFromCA(fore)); - hdc->SetTextBackground(wxColourFromCA(back)); + hdc->SetTextForeground(wxColourFromCD(fore)); + hdc->SetTextBackground(wxColourFromCD(back)); FillRectangle(rc, back); // 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); } -void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font, int ybase, +void SurfaceImpl::DrawTextClipped(PRectangle rc, Font &font, XYPOSITION ybase, const char *s, int len, - ColourAllocated fore, ColourAllocated back) { + ColourDesired fore, ColourDesired back) { SetFont(font); - hdc->SetTextForeground(wxColourFromCA(fore)); - hdc->SetTextBackground(wxColourFromCA(back)); + hdc->SetTextForeground(wxColourFromCD(fore)); + hdc->SetTextBackground(wxColourFromCD(back)); FillRectangle(rc, back); 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, - ColourAllocated fore) { + ColourDesired fore) { SetFont(font); - hdc->SetTextForeground(wxColourFromCA(fore)); + hdc->SetTextForeground(wxColourFromCD(fore)); hdc->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); // 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); 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); int w; 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); int w; int h; @@ -576,7 +558,7 @@ int SurfaceImpl::WidthChar(Font &font, char ch) { #define EXTENT_TEST wxT(" `~!@#$%^&*()-_=+\\|[]{};:\"\'<,>.?/1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") -int SurfaceImpl::Ascent(Font &font) { +XYPOSITION SurfaceImpl::Ascent(Font &font) { SetFont(font); int w, h, d, e; hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); @@ -584,38 +566,34 @@ int SurfaceImpl::Ascent(Font &font) { return font.ascent; } -int SurfaceImpl::Descent(Font &font) { +XYPOSITION SurfaceImpl::Descent(Font &font) { SetFont(font); int w, h, d, e; hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); return d; } -int SurfaceImpl::InternalLeading(Font &WXUNUSED(font)) { +XYPOSITION SurfaceImpl::InternalLeading(Font &WXUNUSED(font)) { return 0; } -int SurfaceImpl::ExternalLeading(Font &font) { +XYPOSITION SurfaceImpl::ExternalLeading(Font &font) { SetFont(font); int w, h, d, e; hdc->GetTextExtent(EXTENT_TEST, &w, &h, &d, &e); return e; } -int SurfaceImpl::Height(Font &font) { +XYPOSITION SurfaceImpl::Height(Font &font) { SetFont(font); return hdc->GetCharHeight() + 1; } -int SurfaceImpl::AverageCharWidth(Font &font) { +XYPOSITION SurfaceImpl::AverageCharWidth(Font &font) { SetFont(font); return hdc->GetCharWidth(); } -int SurfaceImpl::SetPalette(Palette *WXUNUSED(pal), bool WXUNUSED(inBackGround)) { - return 0; -} - void SurfaceImpl::SetClip(PRectangle 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; } @@ -1125,9 +1103,10 @@ private: public: ListBoxImpl(); ~ListBoxImpl(); + static ListBox *Allocate(); 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 SetVisibleRows(int rows); virtual int GetVisibleRows() const; @@ -1142,6 +1121,8 @@ public: virtual int Find(const char *prefix); virtual void GetValue(int n, char *value, int len); 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 SetDoubleClickAction(CallBackAction, void *); 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_; lineHeight = lineHeight_; unicodeMode = unicodeMode_; @@ -1311,12 +1292,8 @@ void ListBoxImpl::GetValue(int n, char *value, int len) { value[len-1] = '\0'; } - -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); - +void ListBoxImpl::RegisterImageHelper(int type, wxBitmap& bmp) +{ if (! imgList) { // assumes all images are the same size imgList = new wxImageList(bmp.GetWidth(), bmp.GetHeight(), true); @@ -1334,6 +1311,22 @@ void ListBoxImpl::RegisterImage(int type, const char *xpm_data) { 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() { wxDELETE(imgList); wxDELETE(imgTypeMap); diff --git a/src/stc/PlatWX.h b/src/stc/PlatWX.h index e658a67f65..ac762ddf8e 100644 --- a/src/stc/PlatWX.h +++ b/src/stc/PlatWX.h @@ -4,5 +4,5 @@ wxRect wxRectFromPRectangle(PRectangle prc); PRectangle PRectangleFromwxRect(wxRect rc); -wxColour wxColourFromCA(const ColourAllocated& ca); +wxColour wxColourFromCD(const ColourDesired& ca); diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 905bcec38c..153329c124 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -132,7 +132,7 @@ public: void OnPaint(wxPaintEvent& WXUNUSED(evt)) { wxAutoBufferedPaintDC dc(this); - Surface* surfaceWindow = Surface::Allocate(); + Surface* surfaceWindow = Surface::Allocate(0); surfaceWindow->Init(&dc, m_ct->wDraw.GetID()); m_ct->PaintCT(surfaceWindow); 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) { switch (iMessage) { +#if 0 // TODO: check this + case SCI_CALLTIPSHOW: { // NOTE: This is copied here from scintilla/src/ScintillaBase.cxx // 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(); break; } +#endif #ifdef SCI_LEXER case SCI_LOADLEXERLIBRARY: diff --git a/src/stc/ScintillaWX.h b/src/stc/ScintillaWX.h index 701f288169..a7ac8023e0 100644 --- a/src/stc/ScintillaWX.h +++ b/src/stc/ScintillaWX.h @@ -24,7 +24,10 @@ #include #include #include +#include +#include +// These are all Scintilla headers #include "Platform.h" #include "SplitVector.h" #include "Partitioning.h" @@ -33,9 +36,12 @@ #include "ScintillaWidget.h" #ifdef SCI_LEXER #include "SciLexer.h" -#include "PropSet.h" +#include "PropSetSimple.h" +#include "ILexer.h" +#include "LexerModule.h" +#include "LexAccessor.h" #include "Accessor.h" -#include "KeyWords.h" +#include "WordList.h" #endif #include "ContractionState.h" #include "SVector.h" diff --git a/src/stc/gen_iface.py b/src/stc/gen_iface.py index 831cf85fe4..29b745aee2 100755 --- a/src/stc/gen_iface.py +++ b/src/stc/gen_iface.py @@ -735,6 +735,134 @@ methodOverrideMap = { 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), } diff --git a/src/stc/scintilla/README.txt b/src/stc/scintilla/README.txt index 4ff79177ea..6db6698805 100644 --- a/src/stc/scintilla/README.txt +++ b/src/stc/scintilla/README.txt @@ -3,11 +3,11 @@ scintilla/include directories from the Scintilla source distribution. All other code needed to implement Scintilla on top of wxWidgets is 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. -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 file and the version in SVN. You should get familiar especially with diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 15f1fcac53..d1c07eb6b5 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -278,6 +278,12 @@ void wxStyledTextCtrl::ClearAll() 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. void wxStyledTextCtrl::ClearDocumentStyle() { @@ -544,6 +550,18 @@ void wxStyledTextCtrl::MarkerSetBackground(int markerNumber, const wxColour& bac 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. int wxStyledTextCtrl::MarkerAdd(int line, int markerNumber) { @@ -568,7 +586,8 @@ int wxStyledTextCtrl::MarkerGet(int line) 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) { return SendMsg(2047, lineStart, markerMask); @@ -657,6 +676,18 @@ bool wxStyledTextCtrl::GetMarginSensitive(int margin) const 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. void wxStyledTextCtrl::StyleClearAll() { @@ -810,6 +841,30 @@ void wxStyledTextCtrl::StyleSetCase(int style, int 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. 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)); } +// 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. // May be nested. void wxStyledTextCtrl::BeginUndoAction() @@ -1286,6 +1355,12 @@ int wxStyledTextCtrl::GetColumn(int pos) const 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. void wxStyledTextCtrl::SetUseHorizontalScrollBar(bool show) { @@ -1378,6 +1453,12 @@ int wxStyledTextCtrl::GetSelectionEnd() const 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. void wxStyledTextCtrl::SetPrintMagnification(int magnification) { @@ -1794,6 +1875,12 @@ void wxStyledTextCtrl::CallTipUseStyle(int tabSize) 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. int wxStyledTextCtrl::VisibleFromDocLine(int line) { @@ -1856,6 +1943,12 @@ bool wxStyledTextCtrl::GetLineVisible(int line) const 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. void wxStyledTextCtrl::SetFoldExpanded(int line, bool expanded) { @@ -2103,6 +2196,32 @@ void wxStyledTextCtrl::SetFirstVisibleLine(int lineDisplay) 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. void wxStyledTextCtrl::TargetFromSelection() { @@ -2497,12 +2616,24 @@ void wxStyledTextCtrl::BraceHighlight(int pos1, int 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. void wxStyledTextCtrl::BraceBadLight(int pos) { 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. int wxStyledTextCtrl::BraceMatch(int pos) { @@ -2756,7 +2887,7 @@ void wxStyledTextCtrl::DelLineRight() 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) { SendMsg(2397, newOffset, 0); @@ -2772,7 +2903,7 @@ void wxStyledTextCtrl::ChooseCaretX() 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. 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)); } +// 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. void wxStyledTextCtrl::SetCharsDefault() { @@ -3035,11 +3201,23 @@ void wxStyledTextCtrl::SetCharsDefault() } // Get currently selected item position in the auto-completion list -int wxStyledTextCtrl::AutoCompGetCurrent() +int wxStyledTextCtrl::AutoCompGetCurrent() const { 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. 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? -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. -void wxStyledTextCtrl::SetCaretSticky(bool useCaretStickyBehaviour) +void wxStyledTextCtrl::SetCaretSticky(int useCaretStickyBehaviour) { SendMsg(2458, useCaretStickyBehaviour, 0); } @@ -3131,7 +3309,7 @@ void wxStyledTextCtrl::SetIndicatorValue(int value) SendMsg(2502, value, 0); } -// Get the current indicator vaue +// Get the current indicator value int wxStyledTextCtrl::GetIndicatorValue() const { return SendMsg(2503, 0, 0); @@ -3197,6 +3375,21 @@ const char* wxStyledTextCtrl::GetCharacterPointer() { 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 void wxStyledTextCtrl::SetKeysUnicode(bool keysUnicode) { @@ -3221,6 +3414,18 @@ int wxStyledTextCtrl::IndicatorGetAlpha(int indicator) const 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 void wxStyledTextCtrl::SetExtraAscent(int extraAscent) { @@ -3319,6 +3524,18 @@ int wxStyledTextCtrl::MarginGetStyleOffset() const 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 void wxStyledTextCtrl::AnnotationSetText(int line, const wxString& text) { @@ -3664,6 +3881,124 @@ void wxStyledTextCtrl::SwapMainAnchorCaret() 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. void wxStyledTextCtrl::StartRecord() { @@ -3752,6 +4087,60 @@ int wxStyledTextCtrl::GetStyleBitsNeeded() const 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); +} + //}}} //---------------------------------------------------------------------- -- 2.47.2