From 65ec6247df6af7b6489257b1ac04ca2242dc14ec Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 1 Sep 2001 03:06:33 +0000 Subject: [PATCH] Upgraded to version 1.39 of Scintilla, and upated wxStyledTextCtrl accordingly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11533 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/stc/stc.h | 429 ++- contrib/src/stc/PlatWX.cpp | 37 +- contrib/src/stc/ScintillaWX.cpp | 39 +- contrib/src/stc/ScintillaWX.h | 4 +- contrib/src/stc/gen_iface.py | 50 +- contrib/src/stc/scintilla/README.txt | 2 +- contrib/src/stc/scintilla/include/Accessor.h | 23 +- contrib/src/stc/scintilla/include/KeyWords.h | 50 +- contrib/src/stc/scintilla/include/Platform.h | 117 +- contrib/src/stc/scintilla/include/PosRegExp.h | 138 - contrib/src/stc/scintilla/include/PropSet.h | 220 +- contrib/src/stc/scintilla/include/SString.h | 255 ++ contrib/src/stc/scintilla/include/SciLexer.h | 106 +- contrib/src/stc/scintilla/include/Scintilla.h | 145 +- .../src/stc/scintilla/include/Scintilla.iface | 320 +- .../stc/scintilla/include/ScintillaWidget.h | 23 +- contrib/src/stc/scintilla/include/WinDefs.h | 18 +- .../stc/scintilla/include/WindowAccessor.h | 13 +- .../src/stc/scintilla/src/AutoComplete.cxx | 53 +- contrib/src/stc/scintilla/src/AutoComplete.h | 44 +- contrib/src/stc/scintilla/src/CallTip.cxx | 18 +- contrib/src/stc/scintilla/src/CallTip.h | 17 +- contrib/src/stc/scintilla/src/CellBuffer.cxx | 67 +- contrib/src/stc/scintilla/src/CellBuffer.h | 103 +- .../stc/scintilla/src/ContractionState.cxx | 6 +- .../src/stc/scintilla/src/ContractionState.h | 15 +- contrib/src/stc/scintilla/src/Document.cxx | 591 +++- contrib/src/stc/scintilla/src/Document.h | 99 +- .../stc/scintilla/src/DocumentAccessor.cxx | 35 +- .../src/stc/scintilla/src/DocumentAccessor.h | 21 +- contrib/src/stc/scintilla/src/Editor.cxx | 1109 +++++-- contrib/src/stc/scintilla/src/Editor.h | 93 +- contrib/src/stc/scintilla/src/Indicator.cxx | 6 +- contrib/src/stc/scintilla/src/Indicator.h | 8 +- contrib/src/stc/scintilla/src/KeyMap.cxx | 12 +- contrib/src/stc/scintilla/src/KeyMap.h | 11 +- contrib/src/stc/scintilla/src/KeyWords.cxx | 149 +- contrib/src/stc/scintilla/src/LexAVE.cxx | 188 ++ contrib/src/stc/scintilla/src/LexAda.cxx | 198 ++ contrib/src/stc/scintilla/src/LexCPP.cxx | 566 ++-- contrib/src/stc/scintilla/src/LexConf.cxx | 177 ++ contrib/src/stc/scintilla/src/LexEiffel.cxx | 321 ++ contrib/src/stc/scintilla/src/LexHTML.cxx | 383 ++- contrib/src/stc/scintilla/src/LexLisp.cxx | 195 ++ contrib/src/stc/scintilla/src/LexLua.cxx | 521 ++-- contrib/src/stc/scintilla/src/LexOthers.cxx | 422 ++- contrib/src/stc/scintilla/src/LexPascal.cxx | 222 ++ contrib/src/stc/scintilla/src/LexPerl.cxx | 534 ++-- contrib/src/stc/scintilla/src/LexPython.cxx | 333 +- contrib/src/stc/scintilla/src/LexRuby.cxx | 355 +++ contrib/src/stc/scintilla/src/LexSQL.cxx | 22 +- contrib/src/stc/scintilla/src/LexVB.cxx | 80 +- contrib/src/stc/scintilla/src/LineMarker.cxx | 152 +- contrib/src/stc/scintilla/src/LineMarker.h | 8 +- contrib/src/stc/scintilla/src/PosRegExp.cxx | 1181 ------- contrib/src/stc/scintilla/src/PropSet.cxx | 818 +++-- contrib/src/stc/scintilla/src/RESearch.cxx | 865 ++++++ contrib/src/stc/scintilla/src/RESearch.h | 60 + contrib/src/stc/scintilla/src/SVector.h | 42 +- .../src/stc/scintilla/src/ScintillaBase.cxx | 206 +- contrib/src/stc/scintilla/src/ScintillaBase.h | 21 +- contrib/src/stc/scintilla/src/Style.cxx | 75 +- contrib/src/stc/scintilla/src/Style.h | 21 +- .../src/stc/scintilla/src/UniConversion.cxx | 7 +- contrib/src/stc/scintilla/src/UniConversion.h | 7 +- contrib/src/stc/scintilla/src/ViewStyle.cxx | 42 +- contrib/src/stc/scintilla/src/ViewStyle.h | 25 +- .../src/stc/scintilla/src/WindowAccessor.cxx | 8 +- contrib/src/stc/stc.cpp | 460 ++- contrib/src/stc/stc.cpp.in | 204 +- contrib/src/stc/stc.h.in | 96 +- include/wx/stc/stc.h | 429 ++- src/stc/PlatWX.cpp | 37 +- src/stc/ScintillaWX.cpp | 39 +- src/stc/ScintillaWX.h | 4 +- src/stc/gen_iface.py | 50 +- src/stc/scintilla/README.txt | 2 +- src/stc/scintilla/include/Accessor.h | 23 +- src/stc/scintilla/include/KeyWords.h | 50 +- src/stc/scintilla/include/Platform.h | 117 +- src/stc/scintilla/include/PosRegExp.h | 138 - src/stc/scintilla/include/PropSet.h | 220 +- src/stc/scintilla/include/SString.h | 255 ++ src/stc/scintilla/include/SciLexer.h | 106 +- src/stc/scintilla/include/Scintilla.h | 145 +- src/stc/scintilla/include/Scintilla.iface | 320 +- src/stc/scintilla/include/ScintillaWidget.h | 23 +- src/stc/scintilla/include/WinDefs.h | 18 +- src/stc/scintilla/include/WindowAccessor.h | 13 +- src/stc/scintilla/src/AutoComplete.cxx | 53 +- src/stc/scintilla/src/AutoComplete.h | 44 +- src/stc/scintilla/src/CallTip.cxx | 18 +- src/stc/scintilla/src/CallTip.h | 17 +- src/stc/scintilla/src/CellBuffer.cxx | 67 +- src/stc/scintilla/src/CellBuffer.h | 103 +- src/stc/scintilla/src/ContractionState.cxx | 6 +- src/stc/scintilla/src/ContractionState.h | 15 +- src/stc/scintilla/src/Document.cxx | 591 +++- src/stc/scintilla/src/Document.h | 99 +- src/stc/scintilla/src/DocumentAccessor.cxx | 35 +- src/stc/scintilla/src/DocumentAccessor.h | 21 +- src/stc/scintilla/src/Editor.cxx | 1109 +++++-- src/stc/scintilla/src/Editor.h | 93 +- src/stc/scintilla/src/Indicator.cxx | 6 +- src/stc/scintilla/src/Indicator.h | 8 +- src/stc/scintilla/src/KeyMap.cxx | 12 +- src/stc/scintilla/src/KeyMap.h | 11 +- src/stc/scintilla/src/KeyWords.cxx | 149 +- src/stc/scintilla/src/LexAVE.cxx | 188 ++ src/stc/scintilla/src/LexAda.cxx | 198 ++ src/stc/scintilla/src/LexCPP.cxx | 566 ++-- src/stc/scintilla/src/LexConf.cxx | 177 ++ src/stc/scintilla/src/LexEiffel.cxx | 321 ++ src/stc/scintilla/src/LexHTML.cxx | 383 ++- src/stc/scintilla/src/LexLisp.cxx | 195 ++ src/stc/scintilla/src/LexLua.cxx | 521 ++-- src/stc/scintilla/src/LexOthers.cxx | 422 ++- src/stc/scintilla/src/LexPascal.cxx | 222 ++ src/stc/scintilla/src/LexPerl.cxx | 534 ++-- src/stc/scintilla/src/LexPython.cxx | 333 +- src/stc/scintilla/src/LexRuby.cxx | 355 +++ src/stc/scintilla/src/LexSQL.cxx | 22 +- src/stc/scintilla/src/LexVB.cxx | 80 +- src/stc/scintilla/src/LineMarker.cxx | 152 +- src/stc/scintilla/src/LineMarker.h | 8 +- src/stc/scintilla/src/PosRegExp.cxx | 1181 ------- src/stc/scintilla/src/PropSet.cxx | 818 +++-- src/stc/scintilla/src/RESearch.cxx | 865 ++++++ src/stc/scintilla/src/RESearch.h | 60 + src/stc/scintilla/src/SVector.h | 42 +- src/stc/scintilla/src/ScintillaBase.cxx | 206 +- src/stc/scintilla/src/ScintillaBase.h | 21 +- src/stc/scintilla/src/Style.cxx | 75 +- src/stc/scintilla/src/Style.h | 21 +- src/stc/scintilla/src/UniConversion.cxx | 7 +- src/stc/scintilla/src/UniConversion.h | 7 +- src/stc/scintilla/src/ViewStyle.cxx | 42 +- src/stc/scintilla/src/ViewStyle.h | 25 +- src/stc/scintilla/src/WindowAccessor.cxx | 8 +- src/stc/stc.cpp | 460 ++- src/stc/stc.cpp.in | 204 +- src/stc/stc.h.in | 96 +- wxPython/CHANGES.txt | 3 +- wxPython/contrib/stc/stc_.cpp | 2764 +++++++++++++---- wxPython/contrib/stc/stc_.i | 71 +- wxPython/contrib/stc/stc_.py | 365 ++- wxPython/demo/data/stc.h | 1396 --------- wxPython/demo/data/stc.h.html | 2589 ++++++++------- wxPython/demo/wxStyledTextCtrl_1.py | 3 +- wxPython/demo/wxStyledTextCtrl_2.py | 2 +- 150 files changed, 22461 insertions(+), 11254 deletions(-) delete mode 100644 contrib/src/stc/scintilla/include/PosRegExp.h create mode 100644 contrib/src/stc/scintilla/include/SString.h create mode 100644 contrib/src/stc/scintilla/src/LexAVE.cxx create mode 100644 contrib/src/stc/scintilla/src/LexAda.cxx create mode 100644 contrib/src/stc/scintilla/src/LexConf.cxx create mode 100644 contrib/src/stc/scintilla/src/LexEiffel.cxx create mode 100644 contrib/src/stc/scintilla/src/LexLisp.cxx create mode 100644 contrib/src/stc/scintilla/src/LexPascal.cxx create mode 100644 contrib/src/stc/scintilla/src/LexRuby.cxx delete mode 100644 contrib/src/stc/scintilla/src/PosRegExp.cxx create mode 100644 contrib/src/stc/scintilla/src/RESearch.cxx create mode 100644 contrib/src/stc/scintilla/src/RESearch.h delete mode 100644 src/stc/scintilla/include/PosRegExp.h create mode 100644 src/stc/scintilla/include/SString.h create mode 100644 src/stc/scintilla/src/LexAVE.cxx create mode 100644 src/stc/scintilla/src/LexAda.cxx create mode 100644 src/stc/scintilla/src/LexConf.cxx create mode 100644 src/stc/scintilla/src/LexEiffel.cxx create mode 100644 src/stc/scintilla/src/LexLisp.cxx create mode 100644 src/stc/scintilla/src/LexPascal.cxx create mode 100644 src/stc/scintilla/src/LexRuby.cxx delete mode 100644 src/stc/scintilla/src/PosRegExp.cxx create mode 100644 src/stc/scintilla/src/RESearch.cxx create mode 100644 src/stc/scintilla/src/RESearch.h delete mode 100644 wxPython/demo/data/stc.h diff --git a/contrib/include/wx/stc/stc.h b/contrib/include/wx/stc/stc.h index f9b26bdb8a..8dfe9a92f4 100644 --- a/contrib/include/wx/stc/stc.h +++ b/contrib/include/wx/stc/stc.h @@ -57,6 +57,28 @@ #define wxSTC_MARK_ARROWDOWN 6 #define wxSTC_MARK_MINUS 7 #define wxSTC_MARK_PLUS 8 + +// Shapes used for outlining column +#define wxSTC_MARK_VLINE 9 +#define wxSTC_MARK_LCORNER 10 +#define wxSTC_MARK_TCORNER 11 +#define wxSTC_MARK_BOXPLUS 12 +#define wxSTC_MARK_BOXPLUSCONNECTED 13 +#define wxSTC_MARK_BOXMINUS 14 +#define wxSTC_MARK_BOXMINUSCONNECTED 15 +#define wxSTC_MARK_LCORNERCURVE 16 +#define wxSTC_MARK_TCORNERCURVE 17 +#define wxSTC_MARK_CIRCLEPLUS 18 +#define wxSTC_MARK_CIRCLEPLUSCONNECTED 19 +#define wxSTC_MARK_CIRCLEMINUS 20 +#define wxSTC_MARK_CIRCLEMINUSCONNECTED 21 + +// Markers used for outlining column +#define wxSTC_MARKNUM_FOLDEREND 25 +#define wxSTC_MARKNUM_FOLDEROPENMID 26 +#define wxSTC_MARKNUM_FOLDERMIDTAIL 27 +#define wxSTC_MARKNUM_FOLDERTAIL 28 +#define wxSTC_MARKNUM_FOLDERSUB 29 #define wxSTC_MARKNUM_FOLDER 30 #define wxSTC_MARKNUM_FOLDEROPEN 31 #define wxSTC_MARGIN_SYMBOL 0 @@ -90,6 +112,9 @@ #define wxSTC_CHARSET_ARABIC 178 #define wxSTC_CHARSET_VIETNAMESE 163 #define wxSTC_CHARSET_THAI 222 +#define wxSTC_CASE_MIXED 0 +#define wxSTC_CASE_UPPER 1 +#define wxSTC_CASE_LOWER 2 #define wxSTC_INDIC_MAX 7 #define wxSTC_INDIC_PLAIN 0 #define wxSTC_INDIC_SQUIGGLE 1 @@ -109,12 +134,15 @@ // PrintColourMode - force black text on white background for printing. #define wxSTC_PRINT_BLACKONWHITE 2 -#define wxSTC_FIND_DOWN 1 + +// PrintColourMode - text stays coloured, but all background is forced to be white for printing. +#define wxSTC_PRINT_COLOURONWHITE 3 + +// PrintColourMode - only the default-background is forced to be white for printing. +#define wxSTC_PRINT_COLOURONWHITEDEFAULTBG 4 #define wxSTC_FIND_WHOLEWORD 2 #define wxSTC_FIND_MATCHCASE 4 #define wxSTC_FIND_WORDSTART 0x00100000 - -// SCFIND_REGEXP is not yet implemented. #define wxSTC_FIND_REGEXP 0x00200000 #define wxSTC_CMD_UNDO 2176 #define wxSTC_CMD_CUT 2177 @@ -124,6 +152,7 @@ #define wxSTC_FOLDLEVELWHITEFLAG 0x1000 #define wxSTC_FOLDLEVELHEADERFLAG 0x2000 #define wxSTC_FOLDLEVELNUMBERMASK 0x0FFF +#define wxSTC_TIME_FOREVER 10000000 #define wxSTC_CMD_LINEDOWN 2300 #define wxSTC_CMD_LINEDOWNEXTEND 2301 #define wxSTC_CMD_LINEUP 2302 @@ -173,15 +202,31 @@ #define wxSTC_EDGE_BACKGROUND 2 // Show caret within N lines of edge when it's scrolled to view +// If CARET_SLOP not set then centre caret on screen when it's +// scrolled to view #define wxSTC_CARET_SLOP 0x01 -// Center caret on screen when it's scrolled to view +// Value not used #define wxSTC_CARET_CENTER 0x02 -// OR this with CARET_CENTER to reposition even when visible, or -// OR this with CARET_SLOP to reposition whenever outside slop border +// If CARET_SLOP also set then reposition whenever outside slop border +// If CARET_SLOP not set then recentre even when visible #define wxSTC_CARET_STRICT 0x04 +// If CARET_XEVEN set then both left and right margins are given equal weight +// rather than favouring left following behaviour. +#define wxSTC_CARET_XEVEN 0x08 + +// If CARET_XJUMPS set then when caret reaches the margin the display jumps +// enough to leave the caret solidly within the display. +#define wxSTC_CARET_XJUMPS 0x10 +#define wxSTC_CURSORNORMAL -1 +#define wxSTC_CURSORWAIT 3 + +// Constants for use with SetVisiblePolicy, similar to SetCaretPolicy +#define wxSTC_VISIBLE_SLOP 0x01 +#define wxSTC_VISIBLE_STRICT 0x04 + // Notifications // Type of modification and the action which caused the modification // These are defined as a bit mask to make it easy to specify which notifications are wanted. @@ -241,6 +286,19 @@ #define wxSTC_LEX_LATEX 14 #define wxSTC_LEX_LUA 15 #define wxSTC_LEX_DIFF 16 +#define wxSTC_LEX_CONF 17 +#define wxSTC_LEX_PASCAL 18 +#define wxSTC_LEX_AVE 19 +#define wxSTC_LEX_ADA 20 +#define wxSTC_LEX_LISP 21 +#define wxSTC_LEX_RUBY 22 +#define wxSTC_LEX_EIFFEL 23 +#define wxSTC_LEX_EIFFELKW 24 +#define wxSTC_LEX_TCL 25 + +// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a +// value assigned in sequence from SCLEX_AUTOMATIC+1. +#define wxSTC_LEX_AUTOMATIC 1000 // Lexical states for SCLEX_PYTHON #define wxSTC_P_DEFAULT 0 @@ -273,6 +331,9 @@ #define wxSTC_C_IDENTIFIER 11 #define wxSTC_C_STRINGEOL 12 #define wxSTC_C_VERBATIM 13 +#define wxSTC_C_REGEX 14 +#define wxSTC_C_COMMENTLINEDOC 15 +#define wxSTC_C_WORD2 16 // Lexical states for SCLEX_HTML, SCLEX_XML #define wxSTC_H_DEFAULT 0 @@ -300,6 +361,12 @@ // More HTML #define wxSTC_H_VALUE 19 +// X-Code +#define wxSTC_H_XCCOMMENT 20 + +// SGML +#define wxSTC_H_SGML 21 + // Embedded Javascript #define wxSTC_HJ_START 40 #define wxSTC_HJ_DEFAULT 41 @@ -313,6 +380,7 @@ #define wxSTC_HJ_SINGLESTRING 49 #define wxSTC_HJ_SYMBOLS 50 #define wxSTC_HJ_STRINGEOL 51 +#define wxSTC_HJ_REGEX 52 // ASP Javascript #define wxSTC_HJA_START 55 @@ -327,6 +395,7 @@ #define wxSTC_HJA_SINGLESTRING 64 #define wxSTC_HJA_SYMBOLS 65 #define wxSTC_HJA_STRINGEOL 66 +#define wxSTC_HJA_REGEX 67 // Embedded VBScript #define wxSTC_HB_START 70 @@ -387,11 +456,12 @@ #define wxSTC_HPHP_VARIABLE 123 #define wxSTC_HPHP_COMMENT 124 #define wxSTC_HPHP_COMMENTLINE 125 -#define wxSTC_HPHP_STRINGEOL 126 +#define wxSTC_HPHP_HSTRING_VARIABLE 126 +#define wxSTC_HPHP_OPERATOR 127 // Lexical states for SCLEX_PERL #define wxSTC_PL_DEFAULT 0 -#define wxSTC_PL_HERE 1 +#define wxSTC_PL_ERROR 1 #define wxSTC_PL_COMMENTLINE 2 #define wxSTC_PL_POD 3 #define wxSTC_PL_NUMBER 4 @@ -406,12 +476,20 @@ #define wxSTC_PL_ARRAY 13 #define wxSTC_PL_HASH 14 #define wxSTC_PL_SYMBOLTABLE 15 -#define wxSTC_PL_REF 16 #define wxSTC_PL_REGEX 17 #define wxSTC_PL_REGSUBST 18 #define wxSTC_PL_LONGQUOTE 19 #define wxSTC_PL_BACKTICKS 20 #define wxSTC_PL_DATASECTION 21 +#define wxSTC_PL_HERE_DELIM 22 +#define wxSTC_PL_HERE_Q 23 +#define wxSTC_PL_HERE_QQ 24 +#define wxSTC_PL_HERE_QX 25 +#define wxSTC_PL_STRING_Q 26 +#define wxSTC_PL_STRING_QQ 27 +#define wxSTC_PL_STRING_QX 28 +#define wxSTC_PL_STRING_QR 29 +#define wxSTC_PL_STRING_QW 30 // Lexical states for SCLEX_LATEX #define wxSTC_L_DEFAULT 0 @@ -434,6 +512,8 @@ #define wxSTC_LUA_OPERATOR 10 #define wxSTC_LUA_IDENTIFIER 11 #define wxSTC_LUA_STRINGEOL 12 + +// Lexical states for SCLEX_ERRORLIST #define wxSTC_ERR_DEFAULT 0 #define wxSTC_ERR_PYTHON 1 #define wxSTC_ERR_GCC 2 @@ -441,6 +521,88 @@ #define wxSTC_ERR_CMD 4 #define wxSTC_ERR_BORLAND 5 #define wxSTC_ERR_PERL 6 +#define wxSTC_ERR_NET 7 +#define wxSTC_ERR_LUA 8 +#define wxSTC_ERR_DIFF_CHANGED 10 +#define wxSTC_ERR_DIFF_ADDITION 11 +#define wxSTC_ERR_DIFF_DELETION 12 +#define wxSTC_ERR_DIFF_MESSAGE 13 + +// Lexical states for SCLEX_BATCH +#define wxSTC_BAT_DEFAULT 0 +#define wxSTC_BAT_COMMENT 1 +#define wxSTC_BAT_WORD 2 +#define wxSTC_BAT_LABEL 3 +#define wxSTC_BAT_HIDE 4 +#define wxSTC_BAT_COMMAND 5 +#define wxSTC_BAT_IDENTIFIER 6 +#define wxSTC_BAT_OPERATOR 7 + +// Lexical states for SCLEX_MAKEFILE +#define wxSTC_MAKE_DEFAULT 0 +#define wxSTC_MAKE_COMMENT 1 +#define wxSTC_MAKE_PREPROCESSOR 2 +#define wxSTC_MAKE_IDENTIFIER 3 +#define wxSTC_MAKE_OPERATOR 4 +#define wxSTC_MAKE_TARGET 5 +#define wxSTC_MAKE_IDEOL 9 + +// Lexical states for the SCLEX_CONF (Apache Configuration Files Lexer) +#define wxSTC_CONF_DEFAULT 0 +#define wxSTC_CONF_COMMENT 1 +#define wxSTC_CONF_NUMBER 2 +#define wxSTC_CONF_IDENTIFIER 3 +#define wxSTC_CONF_EXTENSION 4 +#define wxSTC_CONF_PARAMETER 5 +#define wxSTC_CONF_STRING 6 +#define wxSTC_CONF_OPERATOR 7 +#define wxSTC_CONF_IP 8 +#define wxSTC_CONF_DIRECTIVE 9 + +// Avenue +#define wxSTC_AVE_DEFAULT 0 +#define wxSTC_AVE_COMMENT 1 +#define wxSTC_AVE_NUMBER 2 +#define wxSTC_AVE_WORD 3 +#define wxSTC_AVE_KEYWORD 4 +#define wxSTC_AVE_STATEMENT 5 +#define wxSTC_AVE_STRING 6 +#define wxSTC_AVE_ENUM 7 +#define wxSTC_AVE_STRINGEOL 8 +#define wxSTC_AVE_IDENTIFIER 9 +#define wxSTC_AVE_OPERATOR 10 + +// Lexical states for SCLEX_ADA +#define wxSTC_ADA_DEFAULT 0 +#define wxSTC_ADA_COMMENT 1 +#define wxSTC_ADA_NUMBER 2 +#define wxSTC_ADA_WORD 3 +#define wxSTC_ADA_STRING 4 +#define wxSTC_ADA_CHARACTER 5 +#define wxSTC_ADA_OPERATOR 6 +#define wxSTC_ADA_IDENTIFIER 7 +#define wxSTC_ADA_STRINGEOL 8 + +// Lexical states for SCLEX_LISP +#define wxSTC_LISP_DEFAULT 0 +#define wxSTC_LISP_COMMENT 1 +#define wxSTC_LISP_NUMBER 2 +#define wxSTC_LISP_KEYWORD 3 +#define wxSTC_LISP_STRING 6 +#define wxSTC_LISP_STRINGEOL 8 +#define wxSTC_LISP_IDENTIFIER 9 +#define wxSTC_LISP_OPERATOR 10 + +// Lexical states for SCLEX_EIFFEL and SCLEX_EIFFELKW +#define wxSTC_EIFFEL_DEFAULT 0 +#define wxSTC_EIFFEL_COMMENTLINE 1 +#define wxSTC_EIFFEL_NUMBER 2 +#define wxSTC_EIFFEL_WORD 3 +#define wxSTC_EIFFEL_STRING 4 +#define wxSTC_EIFFEL_CHARACTER 5 +#define wxSTC_EIFFEL_OPERATOR 6 +#define wxSTC_EIFFEL_IDENTIFIER 7 +#define wxSTC_EIFFEL_STRINGEOL 8 // END of generated section //---------------------------------------------------------------------- @@ -556,6 +718,10 @@ public: // Find the position from a point within the window. int PositionFromPoint(wxPoint pt); + // Find the position from a point within the window but return + // INVALID_POSITION if not close to text. + int PositionFromPointClose(int x, int y); + // Set caret to start of a line and ensure it is visible. void GotoLine(int line); @@ -573,8 +739,8 @@ public: // Retrieve the position of the last correctly styled character. int GetEndStyled(); - // Convert all line endings in the document to use the current mode. - void ConvertEOLs(); + // Convert all line endings in the document to one mode. + void ConvertEOLs(int eolMode); // Retrieve the current end of line mode - one of CRLF, CR, or LF. int GetEOLMode(); @@ -693,6 +859,9 @@ public: // Set a style to be underlined or not. void StyleSetUnderline(int style, bool underline); + // Set a style to be mixed case, or to force upper or lower case. + void StyleSetCase(int style, int caseForce); + // Set the foreground colour of the selection and whether to use this setting. void SetSelForeground(bool useSetting, const wxColour& fore); @@ -763,6 +932,18 @@ public: // Retrieve the last line number that has line state. int GetMaxLineState(); + // Is the background of the line containing the caret in a different colour? + bool GetCaretLineVisible(); + + // Display the background of the line containing the caret in a different colour. + void SetCaretLineVisible(bool show); + + // Get the colour of the background of the line containing the caret. + wxColour GetCaretLineBack(); + + // Set the colour of the background of the line containing the caret. + void SetCaretLineBack(const wxColour& back); + // Display a auto-completion list. // The lenEntered parameter indicates how many characters before // the caret should be used to provide context. @@ -816,6 +997,15 @@ public: // Retrieve state of ignore case flag. bool AutoCompGetIgnoreCase(); + // Display a list of strings and send notification when user chooses one. + void UserListShow(int listType, const wxString& itemList); + + // Set whether or not autocompletion is hidden automatically when nothing matches + void AutoCompSetAutoHide(bool autoHide); + + // Retrieve whether or not autocompletion is hidden automatically when nothing matches + bool AutoCompGetAutoHide(); + // Set the number of spaces used for one level of indentation. void SetIndent(int indentSize); @@ -923,13 +1113,13 @@ public: int GetLineCount(); // Sets the size in pixels of the left margin. - void SetMarginLeft(int width); + void SetMarginLeft(int pixelWidth); // Returns the size in pixels of the left margin. int GetMarginLeft(); // Sets the size in pixels of the right margin. - void SetMarginRight(int width); + void SetMarginRight(int pixelWidth); // Returns the size in pixels of the right margin. int GetMarginRight(); @@ -1006,6 +1196,48 @@ public: // Returns true if overtype mode is active otherwise false is returned. bool GetOvertype(); + // Set the width of the insert mode caret + void SetCaretWidth(int pixelWidth); + + // Returns the width of the insert mode caret + int GetCaretWidth(); + + // Sets the position that starts the target which is used for updating the + // document without affecting the scroll position. + void SetTargetStart(int pos); + + // Get the position that starts the target. + int GetTargetStart(); + + // Sets the position that ends the target which is used for updating the + // document without affecting the scroll position. + void SetTargetEnd(int pos); + + // Get the position that ends the target. + int GetTargetEnd(); + + // Replace the target text with the argument text. + // Returns the length of the replacement text. + int ReplaceTarget(const wxString& text); + + // Replace the target text with the argument text after \d processing. + // Looks for \d where d is between 1 and 9 and replaces these with the strings + // matched in the last search operation which were surrounded by \( and \). + // Returns the length of the replacement text including any change + // caused by processing the \d patterns. + int ReplaceTargetRE(const wxString& text); + + // Search for a counted string in the target and set the target to the found + // range. + // Returns length of range or -1 for failure in which case target is not moved. + int SearchInTarget(const wxString& text); + + // Set the search flags used by SearchInTarget + void SetSearchFlags(int flags); + + // Get the search flags used by SearchInTarget + int GetSearchFlags(); + // Show a call tip containing a definition near position pos. void CallTipShow(int pos, const wxString& definition); @@ -1068,6 +1300,31 @@ public: // Set some debugging options for folding void SetFoldFlags(int flags); + // Ensure a particular line is visible by expanding any header line hiding it. + // Use the currently set visibility policy to determine which range to display. + void EnsureVisibleEnforcePolicy(int line); + + // Sets whether a tab pressed when caret is within indentation indents + void SetTabIndents(bool tabIndents); + + // Does a tab pressed when caret is within indentation indent? + bool GetTabIndents(); + + // Sets whether a backspace pressed when caret is within indentation unindents + void SetBackSpaceUnIndents(bool bsUnIndents); + + // Does a backspace pressed when caret is within indentation unindent? + bool GetBackSpaceUnIndents(); + + // Sets the time the mouse must sit still to generate a mouse dwell event + void SetMouseDwellTime(int periodMilliseconds); + + // Retrieve the time the mouse must sit still to generate a mouse dwell event + int GetMouseDwellTime(); + + // Move the caret inside current view if it's not there already + void MoveCaretInsideView(); + // How many characters are on a line, not including end of line characters. int LineLength(int line); @@ -1119,9 +1376,11 @@ public: void SearchAnchor(); // Find some text starting at the search anchor. + // Does not ensure the selection is visible. int SearchNext(int flags, const wxString& text); // Find some text starting at the search anchor and moving backwards. + // Does not ensure the selection is visible. int SearchPrev(int flags, const wxString& text); // Set the way the line the caret is on is kept visible. @@ -1157,6 +1416,51 @@ public: // Get which document modification events are sent to the container. int GetModEventMask(); + // Change internal focus flag + void SetFocus(bool focus); + + // Get internal focus flag + bool GetFocus(); + + // Change error status - 0 = OK + void SetStatus(int statusCode); + + // Get error status + int GetStatus(); + + // Set whether the mouse is captured when its button is pressed + void SetMouseDownCaptures(bool captures); + + // Get whether mouse gets captured + bool GetMouseDownCaptures(); + + // Sets the cursor to one of the SC_CURSOR* values + void SetCursor(int cursorType); + + // Get cursor type + int GetCursor(); + + // Move to the previous change in capitalistion + void WordPartLeft(); + + // Move to the previous change in capitalistion extending selection to new caret position. + void WordPartLeftExtend(); + + // Move to the change next in capitalistion + void WordPartRight(); + + // Move to the next change in capitalistion extending selection to new caret position. + void WordPartRightExtend(); + + // Set the way the display area is determined when a particular line is to be moved to. + void SetVisiblePolicy(int visiblePolicy, int visibleSlop); + + // Delete back from the current position to the start of the line + void DelLineLeft(); + + // Delete forwards from the current position to the end of the line + void DelLineRight(); + // Start notifying the container of all key presses and commands. void StartRecord(); @@ -1178,6 +1482,9 @@ public: // Set up the key words used by the lexer. void SetKeyWords(int keywordSet, const wxString& keyWords); + // Set the lexing language of the document based on string name. + void SetLexerLanguage(const wxString& language); + // END of generated section //---------------------------------------------------------------------- // Others... @@ -1243,6 +1550,10 @@ public: // Scroll enough to make the given column visible void ScrollToColumn(int column); + + // Send a message to Scintilla + long SendMsg(int msg, long wp=0, long lp=0); + //---------------------------------------------------------------------- @@ -1255,7 +1566,7 @@ private: void OnMouseLeftDown(wxMouseEvent& evt); void OnMouseMove(wxMouseEvent& evt); void OnMouseLeftUp(wxMouseEvent& evt); - void OnMouseRightUp(wxMouseEvent& evt); + void OnContextMenu(wxContextMenuEvent& evt); void OnMouseWheel(wxMouseEvent& evt); void OnChar(wxKeyEvent& evt); void OnKeyDown(wxKeyEvent& evt); @@ -1271,8 +1582,6 @@ private: void NotifyChange(); void NotifyParent(SCNotification* scn); - long SendMsg(int msg, long wp=0, long lp=0); - private: DECLARE_EVENT_TABLE() DECLARE_CLASS(wxStyledTextCtrl) @@ -1307,6 +1616,9 @@ public: void SetMessage(int val) { m_message = val; } void SetWParam(int val) { m_wParam = val; } void SetLParam(int val) { m_lParam = val; } + void SetListType(int val) { m_listType = val; } + void SetX(int val) { m_x = val; } + void SetY(int val) { m_y = val; } int GetPosition() const { return m_position; } int GetKey() const { return m_key; } @@ -1322,6 +1634,9 @@ public: int GetMessage() const { return m_message; } int GetWParam() const { return m_wParam; } int GetLParam() const { return m_lParam; } + int GetListType() const { return m_listType; } + int GetX() const { return m_x; } + int GetY() const { return m_y; } bool GetShift() const; bool GetControl() const; @@ -1350,42 +1665,56 @@ private: int m_message; // wxEVT_STC_MACRORECORD int m_wParam; int m_lParam; + + int m_listType; + int m_x; + int m_y; #endif }; #ifndef SWIG BEGIN_DECLARE_EVENT_TYPES() - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE, 1650) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_STYLENEEDED, 1651) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHARADDED, 1652) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_UPDATEUI, 1653) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTREACHED, 1654) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTLEFT, 1655) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ROMODIFYATTEMPT, 1656) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DOUBLECLICK, 1657) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MODIFIED, 1658) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_KEY, 1659) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MACRORECORD, 1660) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MARGINCLICK, 1661) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_NEEDSHOWN, 1662) - DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_POSCHANGED, 1663) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE, 1650) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_STYLENEEDED, 1651) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHARADDED, 1652) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTREACHED, 1653) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_SAVEPOINTLEFT, 1654) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ROMODIFYATTEMPT, 1655) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_KEY, 1656) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DOUBLECLICK, 1657) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_UPDATEUI, 1658) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MODIFIED, 1659) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MACRORECORD, 1660) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_MARGINCLICK, 1661) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_NEEDSHOWN, 1662) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_POSCHANGED, 1663) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_PAINTED, 1664) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_USERLISTSELECTION, 1665) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667) + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND, 1668) END_DECLARE_EVENT_TYPES() #else enum { wxEVT_STC_CHANGE, wxEVT_STC_STYLENEEDED, wxEVT_STC_CHARADDED, - wxEVT_STC_UPDATEUI, wxEVT_STC_SAVEPOINTREACHED, wxEVT_STC_SAVEPOINTLEFT, wxEVT_STC_ROMODIFYATTEMPT, + wxEVT_STC_KEY, wxEVT_STC_DOUBLECLICK, + wxEVT_STC_UPDATEUI, wxEVT_STC_MODIFIED, - wxEVT_STC_KEY, wxEVT_STC_MACRORECORD, wxEVT_STC_MARGINCLICK, wxEVT_STC_NEEDSHOWN, - wxEVT_STC_POSCHANGED + wxEVT_STC_POSCHANGED, + wxEVT_STC_PAINTED, + wxEVT_STC_USERLISTSELECTION, + wxEVT_STC_URIDROPPED, + wxEVT_STC_DWELLSTART, + wxEVT_STC_DWELLEND, }; #endif @@ -1394,20 +1723,26 @@ END_DECLARE_EVENT_TYPES() #ifndef SWIG typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); -#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#define EVT_STC_POSCHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_POSCHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_POSCHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), +#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), + #endif diff --git a/contrib/src/stc/PlatWX.cpp b/contrib/src/stc/PlatWX.cpp index 2b478141af..862d16456d 100644 --- a/contrib/src/stc/PlatWX.cpp +++ b/contrib/src/stc/PlatWX.cpp @@ -112,6 +112,8 @@ Font::~Font() { } void Font::Create(const char *faceName, int characterSet, int size, bool bold, bool italic) { + // TODO: what to do about the characterSet? + Release(); id = new wxFont(size, wxDEFAULT, @@ -161,13 +163,11 @@ void Surface::Init() { Release(); hdc = new wxMemoryDC(); hdcOwned = true; - // **** ::SetTextAlign(hdc, TA_BASELINE); } void Surface::Init(SurfaceID hdc_) { Release(); hdc = hdc_; - // **** ::SetTextAlign(hdc, TA_BASELINE); } void Surface::InitPixMap(int width, int height, Surface *surface_) { @@ -176,7 +176,6 @@ void Surface::InitPixMap(int width, int height, Surface *surface_) { hdcOwned = true; bitmap = new wxBitmap(width, height); ((wxMemoryDC*)hdc)->SelectObject(*bitmap); - // **** ::SetTextAlign(hdc, TA_BASELINE); } void Surface::PenColour(Colour fore) { @@ -353,7 +352,7 @@ int Surface::AverageCharWidth(Font &font) { } int Surface::SetPalette(Palette *pal, bool inBackGround) { - return 0; // **** figure out what to do with palettes... + return 0; } void Surface::SetClip(PRectangle rc) { @@ -697,6 +696,36 @@ void Platform::DebugPrintf(const char *format, ...) { #endif } + +static bool assertionPopUps = true; + +bool Platform::ShowAssertionPopUps(bool assertionPopUps_) { + bool ret = assertionPopUps; + assertionPopUps = assertionPopUps_; + return ret; +} + +void Platform::Assert(const char *c, const char *file, int line) { + char buffer[2000]; + sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line); + if (assertionPopUps) { + int idButton = wxMessageBox(buffer, "Assertion failure", + wxICON_HAND | wxOK); +// if (idButton == IDRETRY) { +// ::DebugBreak(); +// } else if (idButton == IDIGNORE) { +// // all OK +// } else { +// abort(); +// } + } else { + strcat(buffer, "\r\n"); + Platform::DebugDisplay(buffer); + abort(); + } +} + + int Platform::Clamp(int val, int minVal, int maxVal) { if (val > maxVal) val = maxVal; diff --git a/contrib/src/stc/ScintillaWX.cpp b/contrib/src/stc/ScintillaWX.cpp index 30a896b903..127c172a90 100644 --- a/contrib/src/stc/ScintillaWX.cpp +++ b/contrib/src/stc/ScintillaWX.cpp @@ -93,7 +93,6 @@ END_EVENT_TABLE() ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) { capturedMouse = false; wMain = win; - wDraw = win; stc = win; wheelRotation = 0; Initialise(); @@ -170,8 +169,8 @@ bool ScintillaWX::HaveMouseCapture() { void ScintillaWX::ScrollText(int linesToMove) { int dy = vs.lineHeight * (linesToMove); - // TODO: calculate the rectangle to refreshed... wMain.GetID()->ScrollWindow(0, dy); + wMain.GetID()->Update(); } void ScintillaWX::SetVerticalScrollPos() { @@ -261,7 +260,7 @@ bool ScintillaWX::CanPaste() { } void ScintillaWX::CreateCallTipWindow(PRectangle) { - ct.wCallTip = new wxSTCCallTip(wDraw.GetID(), -1, &ct); + ct.wCallTip = new wxSTCCallTip(wMain.GetID(), -1, &ct); ct.wDraw = ct.wCallTip; } @@ -365,17 +364,27 @@ void ScintillaWX::DoVScroll(int type, int pos) { } -void ScintillaWX::DoMouseWheel(int rotation, int delta, int linesPerAction) { +void ScintillaWX::DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown) { int topLineNew = topLine; int lines; - wheelRotation += rotation; - lines = wheelRotation / delta; - wheelRotation -= lines * delta; - if (lines != 0) { - lines *= linesPerAction; - topLineNew -= lines; - ScrollTo(topLineNew); + if (ctrlDown) { // Zoom the fonts if Ctrl key down + if (rotation < 0) { + KeyCommand(SCI_ZOOMIN); + } + else { + KeyCommand(SCI_ZOOMOUT); + } + } + else { // otherwise just scroll the window + wheelRotation += rotation; + lines = wheelRotation / delta; + wheelRotation -= lines * delta; + if (lines != 0) { + lines *= linesPerAction; + topLineNew -= lines; + ScrollTo(topLineNew); + } } } @@ -387,11 +396,11 @@ void ScintillaWX::DoSize(int width, int height) { } void ScintillaWX::DoLoseFocus(){ - DropCaret(); + SetFocusState(false); } void ScintillaWX::DoGainFocus(){ - ShowCaretAtCurrentPosition(); + SetFocusState(true); } void ScintillaWX::DoSysColourChange() { @@ -418,7 +427,7 @@ void ScintillaWX::DoAddChar(char ch) { // AutoCompleteChanged(ch); } -int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt) { +int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed) { switch (key) { case WXK_DOWN: key = SCK_DOWN; break; case WXK_UP: key = SCK_UP; break; @@ -442,7 +451,7 @@ int ScintillaWX::DoKeyDown(int key, bool shift, bool ctrl, bool alt) { case WXK_SHIFT: key = 0; break; } - return KeyDown(key, shift, ctrl, alt); + return KeyDown(key, shift, ctrl, alt, consumed); } diff --git a/contrib/src/stc/ScintillaWX.h b/contrib/src/stc/ScintillaWX.h index fdd4f98dbd..00528bcd0a 100644 --- a/contrib/src/stc/ScintillaWX.h +++ b/contrib/src/stc/ScintillaWX.h @@ -119,9 +119,9 @@ public: void DoButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt); void DoButtonUp(Point pt, unsigned int curTime, bool ctrl); void DoButtonMove(Point pt); - void DoMouseWheel(int rotation, int delta, int linesPerAction); + void DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown); void DoAddChar(char ch); - int DoKeyDown(int key, bool shift, bool ctrl, bool alt); + int DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed); void DoTick() { Tick(); } bool DoDropText(long x, long y, const wxString& data); diff --git a/contrib/src/stc/gen_iface.py b/contrib/src/stc/gen_iface.py index eba0f3c586..e198bdc6e0 100644 --- a/contrib/src/stc/gen_iface.py +++ b/contrib/src/stc/gen_iface.py @@ -12,15 +12,15 @@ #---------------------------------------------------------------------------- -import sys, string, re +import sys, string, re, os from fileinput import FileInput -IFACE = './scintilla/include/Scintilla.iface' -H_TEMPLATE = './stc.h.in' -CPP_TEMPLATE = './stc.cpp.in' -H_DEST = '../../include/wx/stc/stc.h' -CPP_DEST = './stc.cpp' +IFACE = os.path.abspath('./scintilla/include/Scintilla.iface') +H_TEMPLATE = os.path.abspath('./stc.h.in') +CPP_TEMPLATE = os.path.abspath('./stc.cpp.in') +H_DEST = os.path.abspath('../../include/wx/stc/stc.h') +CPP_DEST = os.path.abspath('./stc.cpp') # Value prefixes to convert @@ -215,6 +215,9 @@ methodOverrideMap = { 'AutoCGetChooseSingle' : ('AutoCompGetChooseSingle', 0, 0, 0), 'AutoCSetIgnoreCase' : ('AutoCompSetIgnoreCase', 0, 0, 0), 'AutoCGetIgnoreCase' : ('AutoCompGetIgnoreCase', 0, 0, 0), + 'AutoCSetAutoHide' : ('AutoCompSetAutoHide', 0, 0, 0), + 'AutoCGetAutoHide' : ('AutoCompGetAutoHide', 0, 0, 0), + 'SetHScrollBar' : ('SetUseHorizontalScrollBar', 0, 0, 0), 'GetHScrollBar' : ('GetUseHorizontalScrollBar', 0, 0, 0), @@ -360,6 +363,38 @@ methodOverrideMap = { 'CallTipSetBack' : ('CallTipSetBackground', 0, 0, 0), + 'ReplaceTarget' : (0, + 'int %s(const wxString& text);', + + ''' + int %s(const wxString& text) { + return SendMsg(%s, text.Len(), (long)text.c_str()); + ''', + + 0), + + 'ReplaceTargetRE' : (0, + 'int %s(const wxString& text);', + + ''' + int %s(const wxString& text) { + return SendMsg(%s, text.Len(), (long)text.c_str()); + ''', + + 0), + + 'SearchInTarget' : (0, + 'int %s(const wxString& text);', + + ''' + int %s(const wxString& text) { + return SendMsg(%s, text.Len(), (long)text.c_str()); + ''', + + 0), + + + # Remove all methods that are key commands since they can be # executed with CmdKeyExecute 'LineDown' : (None, 0, 0, 0), @@ -417,7 +452,7 @@ methodOverrideMap = { 'SetDocPointer' : (0, 'void %s(void* docPointer);', '''void %s(void* docPointer) { - SendMsg(%s, (long)docPointer);''', + SendMsg(%s, 0, (long)docPointer);''', 0), 'CreateDocument' : (0, @@ -685,4 +720,3 @@ if __name__ == '__main__': #---------------------------------------------------------------------------- - diff --git a/contrib/src/stc/scintilla/README.txt b/contrib/src/stc/scintilla/README.txt index b88d57495c..598da70f58 100644 --- a/contrib/src/stc/scintilla/README.txt +++ b/contrib/src/stc/scintilla/README.txt @@ -3,5 +3,5 @@ scintilla/include directories from the Scintilla/SCiTE source distribution. All other code needed to implement Scintilla on top of wxWindows is located in the directory above this one. -The current version of the Scintilla code is 1.32 +The current version of the Scintilla code is 1.39 diff --git a/contrib/src/stc/scintilla/include/Accessor.h b/contrib/src/stc/scintilla/include/Accessor.h index b4b7e62ecf..17c9510672 100644 --- a/contrib/src/stc/scintilla/include/Accessor.h +++ b/contrib/src/stc/scintilla/include/Accessor.h @@ -1,6 +1,8 @@ -// SciTE - Scintilla based Text Editor -// Accessor.h - rapid easy access to contents of a Scintilla -// Copyright 1998-2000 by Neil Hodgson +// Scintilla source code edit control +/** @file Accessor.h + ** Rapid easy access to contents of a Scintilla. + **/ +// Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. enum { wsSpace = 1, wsTab = 2, wsSpaceTab = 4, wsInconsistent=8}; @@ -9,12 +11,16 @@ class Accessor; typedef bool (*PFNIsCommentLeader)(Accessor &styler, int pos, int len); -// Interface to data in a Scintilla +/** + * Interface to data in a Scintilla. + */ class Accessor { protected: enum {extremePosition=0x7FFFFFFF}; - // bufferSize is a trade off between time taken to copy the characters and retrieval overhead - // slopSize positions the buffer before the desired position in case there is some backtracking + /** @a bufferSize is a trade off between time taken to copy the characters + * and retrieval overhead. + * @a slopSize positions the buffer before the desired position + * in case there is some backtracking. */ enum {bufferSize=4000, slopSize=bufferSize/8}; char buf[bufferSize+1]; int startPos; @@ -23,6 +29,7 @@ protected: virtual bool InternalIsLeadByte(char ch)=0; virtual void Fill(int position)=0; + public: Accessor() : startPos(extremePosition), endPos(0), codePage(0) {} virtual ~Accessor() {} @@ -32,8 +39,8 @@ public: } return buf[position - startPos]; } + /** Safe version of operator[], returning a defined value for invalid position. */ char SafeGetCharAt(int position, char chDefault=' ') { - // Safe version of operator[], returning a defined value for invalid position if (position < startPos || position >= endPos) { Fill(position); if (position < startPos || position >= endPos) { @@ -57,6 +64,7 @@ public: virtual int GetLineState(int line)=0; virtual int SetLineState(int line, int state)=0; virtual int GetPropertyInt(const char *key, int defaultValue=0)=0; + virtual char *GetProperties()=0; // Style setting virtual void StartAt(unsigned int start, char chMask=31)=0; @@ -67,4 +75,3 @@ public: virtual void SetLevel(int line, int level)=0; virtual int IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader = 0)=0; }; - diff --git a/contrib/src/stc/scintilla/include/KeyWords.h b/contrib/src/stc/scintilla/include/KeyWords.h index 3159dcc1b4..869b59d267 100644 --- a/contrib/src/stc/scintilla/include/KeyWords.h +++ b/contrib/src/stc/scintilla/include/KeyWords.h @@ -1,32 +1,59 @@ -// SciTE - Scintilla based Text Editor -// KeyWords.h - colourise for particular languages -// Copyright 1998-2000 by Neil Hodgson +// Scintilla source code edit control +/** @file KeyWords.h + ** Colourise for particular languages. + **/ +// Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. typedef void (*LexerFunction)(unsigned int startPos, int lengthDoc, int initStyle, WordList *keywordlists[], Accessor &styler); +/** + * A LexerModule is responsible for lexing and folding a particular language. + * The class maintains a list of LexerModules which can be searched to find a + * module appropriate to a particular language. + */ class LexerModule { - static LexerModule *base; +protected: LexerModule *next; int language; - LexerFunction fn; + const char *languageName; + LexerFunction fnLexer; + LexerFunction fnFolder; + + static LexerModule *base; + static int nextLanguage; + public: - LexerModule(int language_, LexerFunction fn_); - static void Colourise(unsigned int startPos, int lengthDoc, int initStyle, - int language, WordList *keywordlists[], Accessor &styler); + LexerModule(int language_, LexerFunction fnLexer_, + const char *languageName_=0, LexerFunction fnFolder_=0); + int GetLanguage() { return language; } + virtual void Lex(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler); + virtual void Fold(unsigned int startPos, int lengthDoc, int initStyle, + WordList *keywordlists[], Accessor &styler); + static LexerModule *Find(int language); + static LexerModule *Find(const char *languageName); }; +/** + * Check if a character is a space. + * This is ASCII specific but is safe with chars >= 0x80. + */ +inline bool isspacechar(unsigned char ch) { + return (ch == ' ') || ((ch >= 0x09) && (ch <= 0x0d)); +} + inline bool iswordchar(char ch) { - return isalnum(ch) || ch == '.' || ch == '_'; + return isascii(ch) && (isalnum(ch) || ch == '.' || ch == '_'); } inline bool iswordstart(char ch) { - return isalnum(ch) || ch == '_'; + return isascii(ch) && (isalnum(ch) || ch == '_'); } inline bool isoperator(char ch) { - if (isalnum(ch)) + if (isascii(ch) && isalnum(ch)) return false; // '.' left out as it is used to make up numbers if (ch == '%' || ch == '^' || ch == '&' || ch == '*' || @@ -38,4 +65,3 @@ inline bool isoperator(char ch) { return true; return false; } - diff --git a/contrib/src/stc/scintilla/include/Platform.h b/contrib/src/stc/scintilla/include/Platform.h index de9cf202a1..74de63174f 100644 --- a/contrib/src/stc/scintilla/include/Platform.h +++ b/contrib/src/stc/scintilla/include/Platform.h @@ -1,18 +1,21 @@ // Scintilla source code edit control -// Platform.h - interface to platform facilities -// Also includes some basic utilities -// Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows -// Copyright 1998-2000 by Neil Hodgson +/** @file Platform.h + ** Interface to platform facilities. Also includes some basic utilities. + ** Implemented in PlatGTK.cxx for GTK+/Linux, PlatWin.cxx for Windows, and PlatWX.cxx for wxWindows. + **/ +// Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef PLATFORM_H #define PLATFORM_H -// PLAT_GTK = GTK+ on Linux, PLAT_WIN = Win32 API on Win32 OS +// PLAT_GTK = GTK+ on Linux or Win32 +// PLAT_GTK_WIN32 is defined additionally when running PLAT_GTK under Win32 +// PLAT_WIN = Win32 API on Win32 OS // PLAT_WX is wxWindows on any supported platform -// Could also have PLAT_GTKWIN = GTK+ on Win32 OS in future #define PLAT_GTK 0 +#define PLAT_GTK_WIN32 0 #define PLAT_WIN 0 #define PLAT_WX 0 @@ -24,6 +27,11 @@ #undef PLAT_GTK #define PLAT_GTK 1 +#ifdef _MSC_VER +#undef PLAT_GTK_WIN32 +#define PLAT_GTK_WIN32 1 +#endif + #else #undef PLAT_WIN #define PLAT_WIN 1 @@ -34,6 +42,9 @@ // Include the main header for each platform #if PLAT_GTK +#ifdef _MSC_VER +#pragma warning(disable: 4505 4514 4710 4800) +#endif #include #include #endif @@ -42,7 +53,7 @@ #define _WIN32_WINNT 0x0400 // Otherwise some required stuff gets ifdef'd out // Vassili Bourdo: shut up annoying Visual C++ warnings: #ifdef _MSC_VER -#pragma warning(disable: 4800 4244 4309) +#pragma warning(disable: 4244 4309 4710 4800) #endif #include #include @@ -80,23 +91,28 @@ typedef wxWindow* WindowID; typedef wxMenu* MenuID; #endif -// Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably - +/** + * A geometric point class. + * Point is exactly the same as the Win32 POINT and GTK+ GdkPoint so can be used interchangeably. + */ class Point { public: int x; int y; - + Point(int x_=0, int y_=0) : x(x_), y(y_) { } // Other automatically defined methods (assignment, copy constructor, destructor) are fine - + static Point FromLong(long lpoint); }; -// PRectangle is exactly the same as the Win32 RECT so can be used interchangeably -// PRectangles contain their top and left sides, but not their right and bottom sides +/** + * A geometric rectangle class. + * PRectangle is exactly the same as the Win32 RECT so can be used interchangeably. + * PRectangles contain their top and left sides, but not their right and bottom sides. + */ class PRectangle { public: int left; @@ -110,6 +126,10 @@ public: // Other automatically defined methods (assignment, copy constructor, destructor) are fine + bool operator==(PRectangle &rc) { + return (rc.left == left) && (rc.right == right) && + (rc.top == top) && (rc.bottom == bottom); + } bool Contains(Point pt) { return (pt.x >= left) && (pt.x <= right) && (pt.y >= top) && (pt.y <= bottom); @@ -131,6 +151,9 @@ wxRect wxRectFromPRectangle(PRectangle prc); PRectangle PRectangleFromwxRect(wxRect rc); #endif +/** + * A colour class. + */ class Colour { ColourID co; public: @@ -141,15 +164,17 @@ public: unsigned int GetRed(); unsigned int GetGreen(); unsigned int GetBlue(); - + friend class Surface; friend class Palette; }; -// Colour pairs hold a desired colour and the colour that the graphics engine -// allocates to approximate the desired colour. -// To make palette management more automatic, ColourPairs could register at -// construction time with a palette management object. +/** + * Colour pairs hold a desired colour and the colour that the graphics engine + * allocates to approximate the desired colour. + * To make palette management more automatic, ColourPairs could register at + * construction time with a palette management object. + */ struct ColourPair { Colour desired; Colour allocated; @@ -162,6 +187,9 @@ struct ColourPair { class Window; // Forward declaration for Palette +/** + * Colour palette management. + */ class Palette { int used; enum {numEntries = 100}; @@ -176,22 +204,27 @@ class Palette { #endif public: bool allowRealization; - + Palette(); ~Palette(); void Release(); - - // 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. + + /** + * 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 WantFind(ColourPair &cp, bool want); void Allocate(Window &w); - + friend class Surface; }; +/** + * Font management. + */ class Font { protected: FontID id; @@ -214,7 +247,9 @@ public: friend class Surface; }; -// A surface abstracts a place to draw +/** + * A surface abstracts a place to draw. + */ class Surface { private: bool unicodeMode; @@ -256,7 +291,7 @@ private: public: Surface(); ~Surface(); - + void Init(); void Init(SurfaceID hdc_); void InitPixMap(int width, int height, Surface *surface_); @@ -287,7 +322,7 @@ public: int ExternalLeading(Font &font_); int Height(Font &font_); int AverageCharWidth(Font &font_); - + int SetPalette(Palette *pal, bool inBackGround); void SetClip(PRectangle rc); void FlushCachedState(); @@ -297,8 +332,10 @@ public: } }; -// Class to hide the details of window manipulation -// Does not own the window which will normally have a longer life than this object +/** + * Class to hide the details of window manipulation. + * Does not own the window which will normally have a longer life than this object. + */ class Window { friend class ListBox; protected: @@ -333,6 +370,9 @@ public: #endif }; +/** + * Listbox management. + */ class ListBox : public Window { #if PLAT_GTK WindowID list; @@ -360,6 +400,9 @@ public: void Sort(); }; +/** + * Menu management. + */ class Menu { MenuID id; public: @@ -370,8 +413,10 @@ public: void Show(Point pt, Window &w); }; -// Platform class used to retrieve system wide parameters such as double click speed -// and chrome colour. Not a creatable object, more of a module with several functions. +/** + * Platform class used to retrieve system wide parameters such as double click speed + * and chrome colour. Not a creatable object, more of a module with several functions. + */ class Platform { // Private so Platform objects can not be copied Platform(const Platform &) {} @@ -390,7 +435,7 @@ public: static bool IsKeyDown(int key); static long SendScintilla( WindowID w, unsigned int msg, unsigned long wParam=0, long lParam=0); - + // These are utility functions not really tied to a platform static int Minimum(int a, int b); static int Maximum(int a, int b); @@ -405,7 +450,15 @@ public: return static_cast(x & 0xffff); } static void DebugPrintf(const char *format, ...); + static bool ShowAssertionPopUps(bool assertionPopUps_); + static void Assert(const char *c, const char *file, int line); static int Clamp(int val, int minVal, int maxVal); }; +#ifdef NDEBUG +#define PLATFORM_ASSERT(c) ((void)0) +#else +#define PLATFORM_ASSERT(c) ((c) ? (void)(0) : Platform::Assert(#c, __FILE__, __LINE__)) +#endif + #endif diff --git a/contrib/src/stc/scintilla/include/PosRegExp.h b/contrib/src/stc/scintilla/include/PosRegExp.h deleted file mode 100644 index b915b1ed49..0000000000 --- a/contrib/src/stc/scintilla/include/PosRegExp.h +++ /dev/null @@ -1,138 +0,0 @@ -#ifndef POSREGEXP_H -#define POSREGEXP_H - -#define MatchesNum 0x10 - -enum EOps -{ - ReBlockOps = 0x1000, - ReMul, // * - RePlus, // + - ReQuest, // ? - ReNGMul, // *? - ReNGPlus, // +? - ReNGQuest, // ?? - ReRangeN, // {n,} - ReRangeNM, // {n,m} - ReNGRangeN, // {n,}? - ReNGRangeNM, // {n,m}? - ReOr, // | - ReBehind = 0x1100, // ?#n - ReNBehind = 0x1200, // ?~n - ReAhead = 0x1300, // ?= - ReNAhead = 0x1400, // ?! - - ReSymbolOps = 0x2000, - ReEmpty, - ReSymb, // a b \W \s ... - ReEnum, // [] - ReNEnum, // [^] - ReBrackets, // (...) - ReBkTrace = 0x2100, // \yN - ReBkBrack = 0x2200 // \N -}; - -enum ESymbols -{ - ReAnyChr = 0x4000, // . - ReSoL, // ^ - ReEoL, // $ - ReDigit, // \d - ReNDigit, // \D - ReWordSymb, // \w - ReNWordSymb, // \W - ReWSpace, // \s - ReNWSpace, // \S - ReUCase, // \u - ReNUCase , // \l - ReWBound, // \b - ReNWBound, // \B - RePreNW, // \c - ReStart, // \m - ReEnd, // \M - - ReChr = 0x0 // Char in Lower Byte -}; -enum ETempSymb -{ - ReTemp = 0x7000, - ReLBrack, ReRBrack, - ReEnumS, ReEnumE, ReNEnumS, - ReRangeS, ReRangeE, ReNGRangeE, ReFrToEnum -}; - -#define BackSlash '\\' - -typedef union SCharData -{ - int IArr[8]; - char CArr[32]; - void SetBit(unsigned char Bit); - void ClearBit(unsigned char Bit); - bool GetBit(unsigned char Bit); -} *PCharData; - -typedef struct SRegInfo -{ - SRegInfo(); - ~SRegInfo(); - - EOps Op; - union{ - SRegInfo *Param; - int Symb; - PCharData ChrClass; - }un; - int s,e; - SRegInfo *Parent; - SRegInfo *Next; -} *PRegInfo; - -typedef struct SMatches -{ - int s[MatchesNum]; - int e[MatchesNum]; - int CurMatch; -} *PMatches; - -typedef class PosRegExp -{ - PRegInfo Info; - PMatches BkTrace; - bool NoCase,Extend,NoMoves; - bool Error; - int *Exprn; - int posParse; - int posEnd,posStart; - int posBkStr; - int FirstChar; - - bool SetExprLow(const char *Expr); - bool SetStructs(PRegInfo &Info,int st,int end); - void Optimize(); - bool CheckSymb(int Symb,bool Inc); - bool LowParse(PRegInfo Re); - bool LowParseRe(PRegInfo &Next); - bool LowCheckNext(PRegInfo Re); - bool ParseRe(int posStr); - bool QuickCheck(); -public: - PMatches Matches; - int Ok, CurMatch; - - void *param; - char (*CharAt)(int pos, void *param); - - PosRegExp(); - ~PosRegExp(); - - bool isok(); - bool SetNoMoves(bool Moves); - bool SetBkTrace(int posStr,PMatches Trace); - bool SetExpr(const char *Expr); - bool Parse(int posStr, int posStop, PMatches Mtch); - bool Parse(int posStr,int posSol, int posEol, PMatches Mtch, int Moves = -1); - bool Evaluate(char *Expr, int posStr, PMatches Mtch, char **Res); -} *PPosRegExp; - -#endif /* POSREGEXP_H */ diff --git a/contrib/src/stc/scintilla/include/PropSet.h b/contrib/src/stc/scintilla/include/PropSet.h index 025174f8ab..6f6bf410f1 100644 --- a/contrib/src/stc/scintilla/include/PropSet.h +++ b/contrib/src/stc/scintilla/include/PropSet.h @@ -1,188 +1,17 @@ -// SciTE - Scintilla based Text Editor -// PropSet.h - a java style properties file module -// Copyright 1998-2000 by Neil Hodgson +// Scintilla source code edit control +/** @file PropSet.h + ** A Java style properties file module. + **/ +// Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. #ifndef PROPSET_H #define PROPSET_H +#include "SString.h" bool EqualCaseInsensitive(const char *a, const char *b); -#if PLAT_WIN -#define strcasecmp stricmp -#define strncasecmp strnicmp -#endif - -#ifdef __WXMSW__ -#define strcasecmp stricmp -#define strncasecmp strnicmp -#endif - -// Define another string class. -// While it would be 'better' to use std::string, that doubles the executable size. - -inline char *StringDup(const char *s, int len=-1) { - if (!s) - return 0; - if (len == -1) - len = strlen(s); - char *sNew = new char[len + 1]; - if (sNew) { - strncpy(sNew, s, len); - sNew[len] = '\0'; - } - return sNew; -} - -class SString { - char *s; - int ssize; -public: - typedef const char* const_iterator; - typedef int size_type; - static size_type npos; - const char* begin(void) const { - return s; - } - const char* end(void) const { - return &s[ssize]; - } - size_type size(void) const { - if (s) - return ssize; - else - return 0; - } - SString &assign(const char* sother, int size_ = -1) { - char *t = s; - s = StringDup(sother,size_); - ssize = (s) ? strlen(s) : 0; - delete []t; - return *this; - } - SString &assign(const SString& sother, int size_ = -1) { - return assign(sother.s,size_); - } - SString &assign(const_iterator ibeg, const_iterator iend) { - return assign(ibeg,iend - ibeg); - } - SString() { - s = 0; - ssize = 0; - } - SString(const SString &source) { - s = StringDup(source.s); - ssize = (s) ? strlen(s) : 0; - } - SString(const char *s_) { - s = StringDup(s_); - ssize = (s) ? strlen(s) : 0; - } - SString(int i) { - char number[100]; - sprintf(number, "%0d", i); - s = StringDup(number); - ssize = (s) ? strlen(s) : 0; - } - ~SString() { - delete []s; - s = 0; - ssize = 0; - } - SString &operator=(const SString &source) { - if (this != &source) { - delete []s; - s = StringDup(source.s); - ssize = (s) ? strlen(s) : 0; - } - return *this; - } - bool operator==(const SString &other) const { - if ((s == 0) && (other.s == 0)) - return true; - if ((s == 0) || (other.s == 0)) - return false; - return strcmp(s, other.s) == 0; - } - bool operator!=(const SString &other) const { - return !operator==(other); - } - bool operator==(const char *sother) const { - if ((s == 0) && (sother == 0)) - return true; - if ((s == 0) || (sother == 0)) - return false; - return strcmp(s, sother) == 0; - } - bool operator!=(const char *sother) const { - return !operator==(sother); - } - const char *c_str() const { - if (s) - return s; - else - return ""; - } - int length() const { - if (s) - return strlen(s); - else - return 0; - } - char operator[](int i) const { - if (s) - return s[i]; - else - return '\0'; - } - SString &operator +=(const char *sother) { - return append(sother,-1); - } - SString &operator +=(const SString &sother) { - return append(sother.s,sother.ssize); - } - SString &operator +=(char ch) { - return append(&ch,1); - } - SString &append(const char* sother, int lenOther) { - int len = length(); - if(lenOther < 0) - lenOther = strlen(sother); - char *sNew = new char[len + lenOther + 1]; - if (sNew) { - if (s) - memcpy(sNew, s, len); - strncpy(&sNew[len], sother, lenOther); - sNew[len + lenOther] = '\0'; - delete []s; - s = sNew; - ssize = (s) ? strlen(s) : 0; - } - return *this; - } - int value() const { - if (s) - return atoi(s); - else - return 0; - } - void substitute(char find, char replace) { - char *t = s; - while (t) { - t = strchr(t, find); - if (t) - *t = replace; - } - } - // I don't think this really belongs here -- Neil - void correctPath() { -#ifdef unix - substitute('\\', '/'); -#else - substitute('/', '\\'); -#endif - } -}; +bool isprefix(const char *target, const char *prefix); struct Property { unsigned int hash; @@ -192,53 +21,66 @@ struct Property { Property() : hash(0), key(0), val(0), next(0) {} }; +/** + */ class PropSet { private: enum { hashRoots=31 }; Property *props[hashRoots]; + Property *enumnext; + int enumhash; public: PropSet *superPS; PropSet(); ~PropSet(); - void Set(const char *key, const char *val); - void Set(char *keyval); + void Set(const char *key, const char *val, int lenKey=-1, int lenVal=-1); + void Set(const char *keyVal); + void SetMultiple(const char *s); SString Get(const char *key); SString GetExpanded(const char *key); - SString Expand(const char *withvars); + SString Expand(const char *withVars); int GetInt(const char *key, int defaultValue=0); SString GetWild(const char *keybase, const char *filename); SString GetNewExpand(const char *keybase, const char *filename); void Clear(); - void ReadFromMemory(const char *data, int len, const char *directoryForImports=0); - void Read(const char *filename, const char *directoryForImports); + char *ToString(); // Caller must delete[] the return value + bool GetFirst(char **key, char **val); + bool GetNext(char **key, char **val); }; +/** + */ class WordList { public: - // Each word contains at least one character - a empty word acts as sentinal at the end. + // Each word contains at least one character - a empty word acts as sentinel at the end. char **words; char **wordsNoCase; char *list; int len; - bool onlyLineEnds; // Delimited by any white space or only line ends + bool onlyLineEnds; ///< Delimited by any white space or only line ends bool sorted; int starts[256]; - WordList(bool onlyLineEnds_ = false) : + WordList(bool onlyLineEnds_ = false) : words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_), sorted(false) {} ~WordList() { Clear(); } - operator bool() { return words ? true : false; } - const char *operator[](int ind) { return words[ind]; } + operator bool() { return len ? true : false; } + char *operator[](int ind) { return words[ind]; } void Clear(); void Set(const char *s); char *Allocate(int size); void SetFromAllocated(); bool InList(const char *s); const char *GetNearestWord(const char *wordStart, int searchLen = -1, bool ignoreCase = false); - char *GetNearestWords(const char *wordStart, int searchLen = -1, bool ignoreCase = false); + char *GetNearestWords(const char *wordStart, int searchLen=-1, + bool ignoreCase=false, char otherSeparator='\0'); }; inline bool nonFuncChar(char ch) { return strchr("\t\n\r !\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~", ch) != NULL; } +inline bool IsAlphabetic(unsigned int ch) { + return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z')); +} + #endif diff --git a/contrib/src/stc/scintilla/include/SString.h b/contrib/src/stc/scintilla/include/SString.h new file mode 100644 index 0000000000..aeb5940502 --- /dev/null +++ b/contrib/src/stc/scintilla/include/SString.h @@ -0,0 +1,255 @@ +// SciTE - Scintilla based Text Editor +/** @file SString.h + ** A simple string class. + **/ +// Copyright 1998-2001 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef SSTRING_H +#define SSTRING_H + +// These functions are implemented because each platform calls them something different +int CompareCaseInsensitive(const char *a, const char *b); +int CompareNCaseInsensitive(const char *a, const char *b, int len); +bool EqualCaseInsensitive(const char *a, const char *b); + +// Define another string class. +// While it would be 'better' to use std::string, that doubles the executable size. +// An SString may contain embedded nul characters. + +/** + * Duplicate a C string. + * Allocate memory of the given size, or big enough to fit the string if length isn't given; + * then copy the given string in the allocated memory. + * @return the pointer to the new string + */ +inline char *StringDup( + const char *s, ///< The string to duplicate + int len=-1) ///< The length of memory to allocate. Optional. +{ + if (!s) + return 0; + if (len == -1) + len = strlen(s); + char *sNew = new char[len + 1]; + if (sNew) { + strncpy(sNew, s, len); + sNew[len] = '\0'; + } + return sNew; +} + +/** + * @brief A simple string class. + * Hold the length of the string for quick operations, + * can have a buffer bigger than the string to avoid too many memory allocations and copies. + * May have embedded zeroes as a result of @a substitute, but rely too heavily on C string + * functions to allow reliable manipulations of these strings. + **/ +class SString { + char *s; ///< The C string + int sSize; ///< The size of the buffer, less 1: ie. the maximum size of the string + int sLen; ///< The size of the string in s + int sizeGrowth; ///< Minimum growth size when appending strings + enum { sizeGrowthDefault = 64 }; + +public: + typedef int size_type; + + SString() : s(0), sSize(0), sLen(0), sizeGrowth(sizeGrowthDefault) { + } + SString(const SString &source) : sizeGrowth(sizeGrowthDefault) { + s = StringDup(source.s); + sSize = sLen = (s) ? strlen(s) : 0; + } + SString(const char *s_) : sizeGrowth(sizeGrowthDefault) { + s = StringDup(s_); + sSize = sLen = (s) ? strlen(s) : 0; + } + SString(const char *s_, int first, int last) : sizeGrowth(sizeGrowthDefault) { + s = StringDup(s_ + first, last - first); + sSize = sLen = (s) ? strlen(s) : 0; + } + SString(int i) : sizeGrowth(sizeGrowthDefault) { + char number[32]; + sprintf(number, "%0d", i); + s = StringDup(number); + sSize = sLen = (s) ? strlen(s) : 0; + } + ~SString() { + delete []s; + s = 0; + sSize = 0; + sLen = 0; + } + void clear(void) { + if (s) { + *s = '\0'; + } + sLen = 0; + } + /** Size of buffer. */ + size_type size(void) const { ///< + if (s) + return sSize; + else + return 0; + } + /** Size of string in buffer. */ + int length() const { + return sLen; + } + SString &assign(const char* sOther, int sSize_ = -1) { + if (!sOther) { + sSize_ = 0; + } + if (sSize_ < 0) { + sSize_ = strlen(sOther); + } + if (sSize > 0 && sSize_ <= sSize) { // Does not allocate new buffer if the current is big enough + if (s && sSize_) { + strncpy(s, sOther, sSize_); + } + s[sSize_] = '\0'; + sLen = sSize_; + } else { + delete []s; + s = StringDup(sOther, sSize_); + if (s) { + sSize = sSize_; // Allow buffer bigger than real string, thus providing space to grow + sLen = strlen(s); + } else { + sSize = sLen = 0; + } + } + return *this; + } + SString &assign(const SString& sOther, int sSize_ = -1) { + return assign(sOther.s, sSize_); + } + SString &operator=(const char *source) { + return assign(source); + } + SString &operator=(const SString &source) { + if (this != &source) { + assign(source.c_str()); + } + return *this; + } + bool operator==(const SString &sOther) const { + if ((s == 0) && (sOther.s == 0)) + return true; + if ((s == 0) || (sOther.s == 0)) + return false; + return strcmp(s, sOther.s) == 0; + } + bool operator!=(const SString &sOther) const { + return !operator==(sOther); + } + bool operator==(const char *sOther) const { + if ((s == 0) && (sOther == 0)) + return true; + if ((s == 0) || (sOther == 0)) + return false; + return strcmp(s, sOther) == 0; + } + bool operator!=(const char *sOther) const { + return !operator==(sOther); + } + bool contains(char ch) { + if (s && *s) + return strchr(s, ch) != 0; + else + return false; + } + void setsizegrowth(int sizeGrowth_) { + sizeGrowth = sizeGrowth_; + } + const char *c_str() const { + if (s) + return s; + else + return ""; + } + /** Give ownership of buffer to caller which must use delete[] to free buffer. */ + char *detach() { + char *sRet = s; + s = 0; + sSize = 0; + sLen = 0; + return sRet; + } + char operator[](int i) const { + if (s && i < sSize) // Or < sLen? Depends on the use, both are OK + return s[i]; + else + return '\0'; + } + SString &append(const char* sOther, int sLenOther=-1, char sep=0) { + if (sLenOther < 0) + sLenOther = strlen(sOther); + int lenSep = 0; + if (sLen && sep) // Only add a separator if not empty + lenSep = 1; + int lenNew = sLen + sLenOther + lenSep; + if (lenNew + 1 < sSize) { + // Conservative about growing the buffer: don't do it, unless really needed + if (lenSep) { + s[sLen] = sep; + sLen++; + } + strncpy(&s[sLen], sOther, sLenOther); + s[sLen + sLenOther] = '\0'; + sLen += sLenOther; + } else { + // Grow the buffer bigger than really needed, to have room for other appends + char *sNew = new char[lenNew + sizeGrowth + 1]; + if (sNew) { + if (s) { + memcpy(sNew, s, sLen); + delete []s; + } + s = sNew; + sSize = lenNew + sizeGrowth; + if (lenSep) { + s[sLen] = sep; + sLen++; + } + strncpy(&s[sLen], sOther, sLenOther); + sNew[sLen + sLenOther] = '\0'; + sLen += sLenOther; + } + } + return *this; + } + SString &operator +=(const char *sOther) { + return append(sOther, -1); + } + SString &operator +=(const SString &sOther) { + return append(sOther.s, sOther.sSize); + } + SString &operator +=(char ch) { + return append(&ch, 1); + } + SString &appendwithseparator(const char* sOther, char sep) { + return append(sOther, strlen(sOther), sep); + } + int value() const { + if (s) + return atoi(s); + else + return 0; + } + void substitute(char find, char replace) { + char *t = s; + while (t) { + t = strchr(t, find); + if (t) { + *t = replace; + t++; + } + } + } +}; + +#endif diff --git a/contrib/src/stc/scintilla/include/SciLexer.h b/contrib/src/stc/scintilla/include/SciLexer.h index 69402ab9ab..591bd06aa1 100644 --- a/contrib/src/stc/scintilla/include/SciLexer.h +++ b/contrib/src/stc/scintilla/include/SciLexer.h @@ -1,6 +1,8 @@ // Scintilla source code edit control -// SciLexer - interface to the added lexer functions in the SciLexer version of the edit control -// Copyright 1998-2000 by Neil Hodgson +/** @file SciLexer.h + ** Interface to the added lexer functions in the SciLexer version of the edit control. + **/ +// Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. // Most of this file is automatically generated from the Scintilla.iface interface definition @@ -29,6 +31,16 @@ #define SCLEX_LATEX 14 #define SCLEX_LUA 15 #define SCLEX_DIFF 16 +#define SCLEX_CONF 17 +#define SCLEX_PASCAL 18 +#define SCLEX_AVE 19 +#define SCLEX_ADA 20 +#define SCLEX_LISP 21 +#define SCLEX_RUBY 22 +#define SCLEX_EIFFEL 23 +#define SCLEX_EIFFELKW 24 +#define SCLEX_TCL 25 +#define SCLEX_AUTOMATIC 1000 #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 @@ -57,6 +69,9 @@ #define SCE_C_IDENTIFIER 11 #define SCE_C_STRINGEOL 12 #define SCE_C_VERBATIM 13 +#define SCE_C_REGEX 14 +#define SCE_C_COMMENTLINEDOC 15 +#define SCE_C_WORD2 16 #define SCE_H_DEFAULT 0 #define SCE_H_TAG 1 #define SCE_H_TAGUNKNOWN 2 @@ -77,6 +92,8 @@ #define SCE_H_CDATA 17 #define SCE_H_QUESTION 18 #define SCE_H_VALUE 19 +#define SCE_H_XCCOMMENT 20 +#define SCE_H_SGML 21 #define SCE_HJ_START 40 #define SCE_HJ_DEFAULT 41 #define SCE_HJ_COMMENT 42 @@ -89,6 +106,7 @@ #define SCE_HJ_SINGLESTRING 49 #define SCE_HJ_SYMBOLS 50 #define SCE_HJ_STRINGEOL 51 +#define SCE_HJ_REGEX 52 #define SCE_HJA_START 55 #define SCE_HJA_DEFAULT 56 #define SCE_HJA_COMMENT 57 @@ -101,6 +119,7 @@ #define SCE_HJA_SINGLESTRING 64 #define SCE_HJA_SYMBOLS 65 #define SCE_HJA_STRINGEOL 66 +#define SCE_HJA_REGEX 67 #define SCE_HB_START 70 #define SCE_HB_DEFAULT 71 #define SCE_HB_COMMENTLINE 72 @@ -151,9 +170,10 @@ #define SCE_HPHP_VARIABLE 123 #define SCE_HPHP_COMMENT 124 #define SCE_HPHP_COMMENTLINE 125 -#define SCE_HPHP_STRINGEOL 126 +#define SCE_HPHP_HSTRING_VARIABLE 126 +#define SCE_HPHP_OPERATOR 127 #define SCE_PL_DEFAULT 0 -#define SCE_PL_HERE 1 +#define SCE_PL_ERROR 1 #define SCE_PL_COMMENTLINE 2 #define SCE_PL_POD 3 #define SCE_PL_NUMBER 4 @@ -168,12 +188,20 @@ #define SCE_PL_ARRAY 13 #define SCE_PL_HASH 14 #define SCE_PL_SYMBOLTABLE 15 -#define SCE_PL_REF 16 #define SCE_PL_REGEX 17 #define SCE_PL_REGSUBST 18 #define SCE_PL_LONGQUOTE 19 #define SCE_PL_BACKTICKS 20 #define SCE_PL_DATASECTION 21 +#define SCE_PL_HERE_DELIM 22 +#define SCE_PL_HERE_Q 23 +#define SCE_PL_HERE_QQ 24 +#define SCE_PL_HERE_QX 25 +#define SCE_PL_STRING_Q 26 +#define SCE_PL_STRING_QQ 27 +#define SCE_PL_STRING_QX 28 +#define SCE_PL_STRING_QR 29 +#define SCE_PL_STRING_QW 30 #define SCE_L_DEFAULT 0 #define SCE_L_COMMAND 1 #define SCE_L_TAG 2 @@ -199,6 +227,74 @@ #define SCE_ERR_CMD 4 #define SCE_ERR_BORLAND 5 #define SCE_ERR_PERL 6 +#define SCE_ERR_NET 7 +#define SCE_ERR_LUA 8 +#define SCE_ERR_DIFF_CHANGED 10 +#define SCE_ERR_DIFF_ADDITION 11 +#define SCE_ERR_DIFF_DELETION 12 +#define SCE_ERR_DIFF_MESSAGE 13 +#define SCE_BAT_DEFAULT 0 +#define SCE_BAT_COMMENT 1 +#define SCE_BAT_WORD 2 +#define SCE_BAT_LABEL 3 +#define SCE_BAT_HIDE 4 +#define SCE_BAT_COMMAND 5 +#define SCE_BAT_IDENTIFIER 6 +#define SCE_BAT_OPERATOR 7 +#define SCE_MAKE_DEFAULT 0 +#define SCE_MAKE_COMMENT 1 +#define SCE_MAKE_PREPROCESSOR 2 +#define SCE_MAKE_IDENTIFIER 3 +#define SCE_MAKE_OPERATOR 4 +#define SCE_MAKE_TARGET 5 +#define SCE_MAKE_IDEOL 9 +#define SCE_CONF_DEFAULT 0 +#define SCE_CONF_COMMENT 1 +#define SCE_CONF_NUMBER 2 +#define SCE_CONF_IDENTIFIER 3 +#define SCE_CONF_EXTENSION 4 +#define SCE_CONF_PARAMETER 5 +#define SCE_CONF_STRING 6 +#define SCE_CONF_OPERATOR 7 +#define SCE_CONF_IP 8 +#define SCE_CONF_DIRECTIVE 9 +#define SCE_AVE_DEFAULT 0 +#define SCE_AVE_COMMENT 1 +#define SCE_AVE_NUMBER 2 +#define SCE_AVE_WORD 3 +#define SCE_AVE_KEYWORD 4 +#define SCE_AVE_STATEMENT 5 +#define SCE_AVE_STRING 6 +#define SCE_AVE_ENUM 7 +#define SCE_AVE_STRINGEOL 8 +#define SCE_AVE_IDENTIFIER 9 +#define SCE_AVE_OPERATOR 10 +#define SCE_ADA_DEFAULT 0 +#define SCE_ADA_COMMENT 1 +#define SCE_ADA_NUMBER 2 +#define SCE_ADA_WORD 3 +#define SCE_ADA_STRING 4 +#define SCE_ADA_CHARACTER 5 +#define SCE_ADA_OPERATOR 6 +#define SCE_ADA_IDENTIFIER 7 +#define SCE_ADA_STRINGEOL 8 +#define SCE_LISP_DEFAULT 0 +#define SCE_LISP_COMMENT 1 +#define SCE_LISP_NUMBER 2 +#define SCE_LISP_KEYWORD 3 +#define SCE_LISP_STRING 6 +#define SCE_LISP_STRINGEOL 8 +#define SCE_LISP_IDENTIFIER 9 +#define SCE_LISP_OPERATOR 10 +#define SCE_EIFFEL_DEFAULT 0 +#define SCE_EIFFEL_COMMENTLINE 1 +#define SCE_EIFFEL_NUMBER 2 +#define SCE_EIFFEL_WORD 3 +#define SCE_EIFFEL_STRING 4 +#define SCE_EIFFEL_CHARACTER 5 +#define SCE_EIFFEL_OPERATOR 6 +#define SCE_EIFFEL_IDENTIFIER 7 +#define SCE_EIFFEL_STRINGEOL 8 //--Autogenerated -- end of section automatically generated from Scintilla.iface #endif diff --git a/contrib/src/stc/scintilla/include/Scintilla.h b/contrib/src/stc/scintilla/include/Scintilla.h index ca81d135bd..0185d3e5be 100644 --- a/contrib/src/stc/scintilla/include/Scintilla.h +++ b/contrib/src/stc/scintilla/include/Scintilla.h @@ -1,6 +1,8 @@ // Scintilla source code edit control -// Scintilla.h - interface to the edit control -// Copyright 1998-2000 by Neil Hodgson +/** @file Scintilla.h + ** Interface to the edit control. + **/ +// Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. // Most of this file is automatically generated from the Scintilla.iface interface definition @@ -18,7 +20,13 @@ void Scintilla_RegisterClasses(HINSTANCE hInstance); #endif #endif -typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wParam, long lParam); +// Here should be placed typedefs for uptr_t, an unsigned integer type large enough to +// hold a pointer and sptr_t, a signed integer large enough to hold a pointer. +// May need to be changed for 64 bit platforms. +typedef unsigned long uptr_t; +typedef long sptr_t; + +typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); //++Autogenerated -- start of section automatically generated from Scintilla.iface #define INVALID_POSITION -1 @@ -50,15 +58,16 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SCI_GETVIEWWS 2020 #define SCI_SETVIEWWS 2021 #define SCI_POSITIONFROMPOINT 2022 +#define SCI_POSITIONFROMPOINTCLOSE 2023 #define SCI_GOTOLINE 2024 #define SCI_GOTOPOS 2025 #define SCI_SETANCHOR 2026 #define SCI_GETCURLINE 2027 #define SCI_GETENDSTYLED 2028 -#define SCI_CONVERTEOLS 2029 #define SC_EOL_CRLF 0 #define SC_EOL_CR 1 #define SC_EOL_LF 2 +#define SCI_CONVERTEOLS 2029 #define SCI_GETEOLMODE 2030 #define SCI_SETEOLMODE 2031 #define SCI_STARTSTYLING 2032 @@ -80,6 +89,24 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SC_MARK_ARROWDOWN 6 #define SC_MARK_MINUS 7 #define SC_MARK_PLUS 8 +#define SC_MARK_VLINE 9 +#define SC_MARK_LCORNER 10 +#define SC_MARK_TCORNER 11 +#define SC_MARK_BOXPLUS 12 +#define SC_MARK_BOXPLUSCONNECTED 13 +#define SC_MARK_BOXMINUS 14 +#define SC_MARK_BOXMINUSCONNECTED 15 +#define SC_MARK_LCORNERCURVE 16 +#define SC_MARK_TCORNERCURVE 17 +#define SC_MARK_CIRCLEPLUS 18 +#define SC_MARK_CIRCLEPLUSCONNECTED 19 +#define SC_MARK_CIRCLEMINUS 20 +#define SC_MARK_CIRCLEMINUSCONNECTED 21 +#define SC_MARKNUM_FOLDEREND 25 +#define SC_MARKNUM_FOLDEROPENMID 26 +#define SC_MARKNUM_FOLDERMIDTAIL 27 +#define SC_MARKNUM_FOLDERTAIL 28 +#define SC_MARKNUM_FOLDERSUB 29 #define SC_MARKNUM_FOLDER 30 #define SC_MARKNUM_FOLDEROPEN 31 #define SCI_MARKERDEFINE 2040 @@ -137,6 +164,10 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SCI_STYLESETEOLFILLED 2057 #define SCI_STYLERESETDEFAULT 2058 #define SCI_STYLESETUNDERLINE 2059 +#define SC_CASE_MIXED 0 +#define SC_CASE_UPPER 1 +#define SC_CASE_LOWER 2 +#define SCI_STYLESETCASE 2060 #define SCI_STYLESETCHARACTERSET 2066 #define SCI_SETSELFORE 2067 #define SCI_SETSELBACK 2068 @@ -170,6 +201,10 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SCI_SETLINESTATE 2092 #define SCI_GETLINESTATE 2093 #define SCI_GETMAXLINESTATE 2094 +#define SCI_GETCARETLINEVISIBLE 2095 +#define SCI_SETCARETLINEVISIBLE 2096 +#define SCI_GETCARETLINEBACK 2097 +#define SCI_SETCARETLINEBACK 2098 #define SCI_AUTOCSHOW 2100 #define SCI_AUTOCCANCEL 2101 #define SCI_AUTOCACTIVE 2102 @@ -186,6 +221,9 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SCI_AUTOCGETCHOOSESINGLE 2114 #define SCI_AUTOCSETIGNORECASE 2115 #define SCI_AUTOCGETIGNORECASE 2116 +#define SCI_USERLISTSHOW 2117 +#define SCI_AUTOCSETAUTOHIDE 2118 +#define SCI_AUTOCGETAUTOHIDE 2119 #define SCI_SETINDENT 2122 #define SCI_GETINDENT 2123 #define SCI_SETUSETABS 2124 @@ -215,9 +253,10 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SC_PRINT_NORMAL 0 #define SC_PRINT_INVERTLIGHT 1 #define SC_PRINT_BLACKONWHITE 2 +#define SC_PRINT_COLOURONWHITE 3 +#define SC_PRINT_COLOURONWHITEDEFAULTBG 4 #define SCI_SETPRINTCOLOURMODE 2148 #define SCI_GETPRINTCOLOURMODE 2149 -#define SCFIND_DOWN 1 #define SCFIND_WHOLEWORD 2 #define SCFIND_MATCHCASE 4 #define SCFIND_WORDSTART 0x00100000 @@ -260,6 +299,17 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SCI_GETDIRECTPOINTER 2185 #define SCI_SETOVERTYPE 2186 #define SCI_GETOVERTYPE 2187 +#define SCI_SETCARETWIDTH 2188 +#define SCI_GETCARETWIDTH 2189 +#define SCI_SETTARGETSTART 2190 +#define SCI_GETTARGETSTART 2191 +#define SCI_SETTARGETEND 2192 +#define SCI_GETTARGETEND 2193 +#define SCI_REPLACETARGET 2194 +#define SCI_REPLACETARGETRE 2195 +#define SCI_SEARCHINTARGET 2197 +#define SCI_SETSEARCHFLAGS 2198 +#define SCI_GETSEARCHFLAGS 2199 #define SCI_CALLTIPSHOW 2200 #define SCI_CALLTIPCANCEL 2201 #define SCI_CALLTIPACTIVE 2202 @@ -284,6 +334,14 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SCI_TOGGLEFOLD 2231 #define SCI_ENSUREVISIBLE 2232 #define SCI_SETFOLDFLAGS 2233 +#define SCI_ENSUREVISIBLEENFORCEPOLICY 2234 +#define SCI_SETTABINDENTS 2260 +#define SCI_GETTABINDENTS 2261 +#define SCI_SETBACKSPACEUNINDENTS 2262 +#define SCI_GETBACKSPACEUNINDENTS 2263 +#define SC_TIME_FOREVER 10000000 +#define SCI_SETMOUSEDWELLTIME 2264 +#define SCI_GETMOUSEDWELLTIME 2265 #define SCI_LINEDOWN 2300 #define SCI_LINEDOWNEXTEND 2301 #define SCI_LINEUP 2302 @@ -328,6 +386,7 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SCI_UPPERCASE 2341 #define SCI_LINESCROLLDOWN 2342 #define SCI_LINESCROLLUP 2343 +#define SCI_MOVECARETINSIDEVIEW 2401 #define SCI_LINELENGTH 2350 #define SCI_BRACEHIGHLIGHT 2351 #define SCI_BRACEBADLIGHT 2352 @@ -352,6 +411,8 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define CARET_SLOP 0x01 #define CARET_CENTER 0x02 #define CARET_STRICT 0x04 +#define CARET_XEVEN 0x08 +#define CARET_XJUMPS 0x10 #define SCI_SETCARETPOLICY 2369 #define SCI_LINESONSCREEN 2370 #define SCI_USEPOPUP 2371 @@ -362,6 +423,25 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SCI_ADDREFDOCUMENT 2376 #define SCI_RELEASEDOCUMENT 2377 #define SCI_GETMODEVENTMASK 2378 +#define SCI_SETFOCUS 2380 +#define SCI_GETFOCUS 2381 +#define SCI_SETSTATUS 2382 +#define SCI_GETSTATUS 2383 +#define SCI_SETMOUSEDOWNCAPTURES 2384 +#define SCI_GETMOUSEDOWNCAPTURES 2385 +#define SC_CURSORNORMAL -1 +#define SC_CURSORWAIT 3 +#define SCI_SETCURSOR 2386 +#define SCI_GETCURSOR 2387 +#define SCI_WORDPARTLEFT 2390 +#define SCI_WORDPARTLEFTEXTEND 2391 +#define SCI_WORDPARTRIGHT 2392 +#define SCI_WORDPARTRIGHTEXTEND 2393 +#define VISIBLE_SLOP 0x01 +#define VISIBLE_STRICT 0x04 +#define SCI_SETVISIBLEPOLICY 2394 +#define SCI_DELLINELEFT 2395 +#define SCI_DELLINERIGHT 2396 #define SCI_GRABFOCUS 2400 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 @@ -370,6 +450,7 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SCI_COLOURISE 4003 #define SCI_SETPROPERTY 4004 #define SCI_SETKEYWORDS 4005 +#define SCI_SETLEXERLANGUAGE 4006 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 #define SC_MOD_CHANGESTYLE 0x4 @@ -419,6 +500,11 @@ typedef long (*SciFnDirect)(long ptr, unsigned int iMessage, unsigned long wPara #define SCN_MARGINCLICK 2010 #define SCN_NEEDSHOWN 2011 #define SCN_POSCHANGED 2012 +#define SCN_PAINTED 2013 +#define SCN_USERLISTSELECTION 2014 +#define SCN_URIDROPPED 2015 +#define SCN_DWELLSTART 2016 +#define SCN_DWELLEND 2017 //--Autogenerated -- end of section automatically generated from Scintilla.iface // Optional module for macro recording @@ -437,14 +523,14 @@ struct CharacterRange { }; struct TextRange { - CharacterRange chrg; + struct CharacterRange chrg; char *lpstrText; }; struct TextToFind { - CharacterRange chrg; + struct CharacterRange chrg; char *lpstrText; - CharacterRange chrgText; + struct CharacterRange chrgText; }; #ifdef PLATFORM_H @@ -463,8 +549,8 @@ struct RangeToFormat { #endif struct NotifyHeader { - // hwndFrom is really an environment specifc window handle or pointer - // but most clients of Scintilla.h do not have this type visible. + // hwndFrom is really an environment specifc window handle or pointer + // but most clients of Scintilla.h do not have this type visible. //WindowID hwndFrom; void *hwndFrom; unsigned int idFrom; @@ -472,26 +558,35 @@ struct NotifyHeader { }; struct SCNotification { - NotifyHeader nmhdr; - int position; // SCN_STYLENEEDED, SCN_MODIFIED - int ch; // SCN_CHARADDED, SCN_KEY - int modifiers; // SCN_KEY - int modificationType; // SCN_MODIFIED - const char *text; // SCN_MODIFIED - int length; // SCN_MODIFIED - int linesAdded; // SCN_MODIFIED + struct NotifyHeader nmhdr; + int position; // SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART, SCN_DWELLEND + int ch; // SCN_CHARADDED, SCN_KEY + int modifiers; // SCN_KEY + int modificationType; // SCN_MODIFIED + const char *text; // SCN_MODIFIED + int length; // SCN_MODIFIED + int linesAdded; // SCN_MODIFIED #ifdef MACRO_SUPPORT int message; // SCN_MACRORECORD - int wParam; // SCN_MACRORECORD - int lParam; // SCN_MACRORECORD + uptr_t wParam; // SCN_MACRORECORD + sptr_t lParam; // SCN_MACRORECORD #endif - int line; // SCN_MODIFIED + int line; // SCN_MODIFIED int foldLevelNow; // SCN_MODIFIED int foldLevelPrev; // SCN_MODIFIED - int margin; // SCN_MARGINCLICK + int margin; // SCN_MARGINCLICK + int listType; // SCN_USERLISTSELECTION + int x; // SCN_DWELLSTART, SCN_DWELLEND + int y; // SCN_DWELLSTART, SCN_DWELLEND }; -#define SC_MASK_FOLDERS ((1<