From 862ed3fc915af8f10a6c4dfcfe862d4e81d8936e Mon Sep 17 00:00:00 2001 From: dail8859 Date: Sun, 30 Jun 2019 09:32:31 -0400 Subject: [PATCH] Update to Scintilla v4.1.4 files, fix PA zip Closes #11 --- README.md | 3 +- SurroundSelection.sln | 4 +- appveyor.yml | 6 +- src/Main.cpp | 4 +- src/Npp/Notepad_plus_msgs.h | 89 ++- src/Npp/Sci_Position.h | 29 + src/Npp/Scintilla.h | 178 +++-- src/Npp/menuCmdID.h | 121 ++- src/{ScintillaGateway.h => ScintillaEditor.h} | 704 +++++++++++------- src/SurroundSelection.vcxproj | 10 +- src/SurroundSelection.vcxproj.filters | 2 +- src/Version.h | 8 +- 12 files changed, 763 insertions(+), 395 deletions(-) create mode 100644 src/Npp/Sci_Position.h rename src/{ScintillaGateway.h => ScintillaEditor.h} (82%) diff --git a/README.md b/README.md index 4574517..c981c01 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,9 @@ to use `*`, `-` and `_` to act as surround characters as the above examples do. ## Installation Use the built in Plugin Admin to automatically install the plugin. + ## Development -The code has been developed using Visual Studio 2017. Building the code will generate the DLL which can be used by Notepad++. For convenience, MSVC copies the DLL into the Notepad++ plugin directory. +The code is developed using Visual Studio 2017. Building the code will generate a DLL which can be used by Notepad++. For convenience, Visual Studio copies the DLL into the Notepad++ plugin directory. ## License This code is released under the [GNU General Public License version 2](http://www.gnu.org/licenses/gpl-2.0.txt). diff --git a/SurroundSelection.sln b/SurroundSelection.sln index 0056513..7d13fc5 100644 --- a/SurroundSelection.sln +++ b/SurroundSelection.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.645 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SurroundSelection", "src\SurroundSelection.vcxproj", "{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}" EndProject diff --git a/appveyor.yml b/appveyor.yml index 45087f6..90e01aa 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 1.3.0.{build} +version: 1.3.1.{build} image: Visual Studio 2017 platform: @@ -35,15 +35,13 @@ after_build: Push-AppveyorArtifact "$($BuildPath)\SurroundSelection.dll" -FileName SurroundSelection.dll if ($($env:APPVEYOR_REPO_TAG) -eq "true" -and $env:CONFIGURATION -eq "Release") { - mkdir SurroundSelection - Move-Item -Path "$($BuildPath)\SurroundSelection.dll" -Destination .\SurroundSelection if ($env:BUILD_PLATFORM -eq "x64"){ $ZipFileName = "SurroundSelection_$($env:APPVEYOR_REPO_TAG_NAME)_x64.zip" } if ($env:BUILD_PLATFORM -eq "Win32"){ $ZipFileName = "SurroundSelection_$($env:APPVEYOR_REPO_TAG_NAME).zip" } - 7z a $ZipFileName .\SurroundSelection + 7z a $ZipFileName "$($BuildPath)\SurroundSelection.dll" } artifacts: diff --git a/src/Main.cpp b/src/Main.cpp index 757dc3e..6572a14 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -17,7 +17,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "PluginInterface.h" -#include "ScintillaGateway.h" +#include "ScintillaEditor.h" #include "resource.h" #include "AboutDialog.h" @@ -31,7 +31,7 @@ static NppData nppData; static HHOOK hook = NULL; static HKL keyboardLayout = NULL; static bool hasFocus = true; -static ScintillaGateway editor; +static ScintillaEditor editor; static LPWORD kbBuff = (LPWORD)new byte[buffChars]; static PBYTE kbState = new byte[256]; TCHAR addChars[1024]; diff --git a/src/Npp/Notepad_plus_msgs.h b/src/Npp/Notepad_plus_msgs.h index 46d2288..2eacd79 100644 --- a/src/Npp/Notepad_plus_msgs.h +++ b/src/Npp/Notepad_plus_msgs.h @@ -39,12 +39,18 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ L_ASM, L_DIFF, L_PROPS, L_PS, L_RUBY, L_SMALLTALK, L_VHDL, L_KIX, L_AU3,\ L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO, L_SEARCHRESULT,\ L_CMAKE, L_YAML, L_COBOL, L_GUI4CLI, L_D, L_POWERSHELL, L_R, L_JSP,\ - L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77,\ + L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77, L_BAANC, L_SREC,\ + L_IHEX, L_TEHEX, L_SWIFT,\ + L_ASN1, L_AVS, L_BLITZBASIC, L_PUREBASIC, L_FREEBASIC, \ + L_CSOUND, L_ERLANG, L_ESCRIPT, L_FORTH, L_LATEX, \ + L_MMIXAL, L_NIMROD, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \ + L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,\ // Don't use L_JS, use L_JAVASCRIPT instead // The end of enumated language type, so it should be always at the end L_EXTERNAL}; enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10}; +enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; @@ -174,7 +180,11 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W //BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0) #define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46) - //void NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str) + //INT NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str) + // Get user's plugin config directory path. It's useful if plugins want to save/load parameters for the current user + // Returns the number of TCHAR copied/to copy. + // Users should call it with "str" be NULL to get the required number of TCHAR (not including the terminating nul character), + // allocate "str" buffer with the return value + 1, then call it again to get the path. #define NPPM_MSGTOPLUGIN (NPPMSG + 47) //BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info) @@ -213,7 +223,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W // returned value : TRUE if tab bar is hidden, otherwise FALSE #define NPPM_GETPOSFROMBUFFERID (NPPMSG + 57) - // INT NPPM_GETPOSFROMBUFFERID(INT bufferID, INT priorityView) + // INT NPPM_GETPOSFROMBUFFERID(UINT_PTR bufferID, INT priorityView) // Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing // if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly // @@ -223,11 +233,11 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W // SUB_VIEW 1 #define NPPM_GETFULLPATHFROMBUFFERID (NPPMSG + 58) - // INT NPPM_GETFULLPATHFROMBUFFERID(INT bufferID, TCHAR *fullFilePath) + // INT NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, TCHAR *fullFilePath) // Get full path file name from a bufferID. // Return -1 if the bufferID non existing, otherwise the number of TCHAR copied/to copy // User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character), - // allocate fullFilePath with the return values + 1, then call it again to get full path file name + // allocate fullFilePath with the return values + 1, then call it again to get full path file name #define NPPM_GETBUFFERIDFROMPOS (NPPMSG + 59) // LRESULT NPPM_GETBUFFERIDFROMPOS(INT index, INT iView) @@ -240,20 +250,20 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W // Returns active Buffer #define NPPM_RELOADBUFFERID (NPPMSG + 61) - // VOID NPPM_RELOADBUFFERID(0, 0) + // VOID NPPM_RELOADBUFFERID(UINT_PTR bufferID, BOOL alert) // Reloads Buffer // wParam: Buffer to reload // lParam: 0 if no alert, else alert #define NPPM_GETBUFFERLANGTYPE (NPPMSG + 64) - // INT NPPM_GETBUFFERLANGTYPE(INT bufferID, 0) + // INT NPPM_GETBUFFERLANGTYPE(UINT_PTR bufferID, 0) // wParam: BufferID to get LangType from // lParam: 0 // Returns as int, see LangType. -1 on error #define NPPM_SETBUFFERLANGTYPE (NPPMSG + 65) - // BOOL NPPM_SETBUFFERLANGTYPE(INT bufferID, INT langType) + // BOOL NPPM_SETBUFFERLANGTYPE(UINT_PTR bufferID, INT langType) // wParam: BufferID to set LangType of // lParam: LangType // Returns TRUE on success, FALSE otherwise @@ -261,13 +271,13 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W // L_USER and L_EXTERNAL are not supported #define NPPM_GETBUFFERENCODING (NPPMSG + 66) - // INT NPPM_GETBUFFERENCODING(INT bufferID, 0) + // INT NPPM_GETBUFFERENCODING(UINT_PTR bufferID, 0) // wParam: BufferID to get encoding from // lParam: 0 // returns as int, see UniMode. -1 on error #define NPPM_SETBUFFERENCODING (NPPMSG + 67) - // BOOL NPPM_SETBUFFERENCODING(INT bufferID, INT encoding) + // BOOL NPPM_SETBUFFERENCODING(UINT_PTR bufferID, INT encoding) // wParam: BufferID to set encoding of // lParam: encoding // Returns TRUE on success, FALSE otherwise @@ -275,29 +285,18 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W // Can only be done on new, unedited files #define NPPM_GETBUFFERFORMAT (NPPMSG + 68) - // INT NPPM_GETBUFFERFORMAT(INT bufferID, 0) - // wParam: BufferID to get format from + // INT NPPM_GETBUFFERFORMAT(UINT_PTR bufferID, 0) + // wParam: BufferID to get EolType format from // lParam: 0 - // returns as int, see formatType. -1 on error + // returns as int, see EolType format. -1 on error #define NPPM_SETBUFFERFORMAT (NPPMSG + 69) - // BOOL NPPM_SETBUFFERFORMAT(INT bufferID, INT format) - // wParam: BufferID to set format of + // BOOL NPPM_SETBUFFERFORMAT(UINT_PTR bufferID, INT format) + // wParam: BufferID to set EolType format of // lParam: format // Returns TRUE on success, FALSE otherwise - // use int, see formatType - -/* - #define NPPM_ADDREBAR (NPPMSG + 57) - // BOOL NPPM_ADDREBAR(0, REBARBANDINFO *) - // Returns assigned ID in wID value of struct pointer - #define NPPM_UPDATEREBAR (NPPMSG + 58) - // BOOL NPPM_ADDREBAR(INT ID, REBARBANDINFO *) - //Use ID assigned with NPPM_ADDREBAR - #define NPPM_REMOVEREBAR (NPPMSG + 59) - // BOOL NPPM_ADDREBAR(INT ID, 0) - //Use ID assigned with NPPM_ADDREBAR -*/ + // use int, see EolType format + #define NPPM_HIDETOOLBAR (NPPMSG + 70) // BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot) @@ -333,7 +332,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W // BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey *sk) // get your plugin command current mapped shortcut into sk via cmdID // You may need it after getting NPPN_READY notification - // returned value : TRUE if this function call is successful and shorcut is enable, otherwise FALSE + // returned value : TRUE if this function call is successful and shortcut is enable, otherwise FALSE #define NPPM_DOOPEN (NPPMSG + 77) // BOOL NPPM_DOOPEN(0, const TCHAR *fullPathName2Open) @@ -345,7 +344,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W #define NPPM_GETCURRENTNATIVELANGENCODING (NPPMSG + 79) // INT NPPM_GETCURRENTNATIVELANGENCODING(0, 0) - // returned value : the current native language enconding + // returned value : the current native language encoding #define NPPM_ALLOCATESUPPORTED (NPPMSG + 80) // returns TRUE if NPPM_ALLOCATECMDID is supported @@ -364,7 +363,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W #define NPPM_GETLANGUAGENAME (NPPMSG + 83) // INT NPPM_GETLANGUAGENAME(int langType, TCHAR *langName) - // Get programing language name from the given language type (LangType) + // Get programming language name from the given language type (LangType) // Return value is the number of copied character / number of character to copy (\0 is not included) // You should call this function 2 times - the first time you pass langName as NULL to get the number of characters to copy. // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGENAME function the 2nd time @@ -372,7 +371,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W #define NPPM_GETLANGUAGEDESC (NPPMSG + 84) // INT NPPM_GETLANGUAGEDESC(int langType, TCHAR *langDesc) - // Get programing language short description from the given language type (LangType) + // Get programming language short description from the given language type (LangType) // Return value is the number of copied character / number of character to copy (\0 is not included) // You should call this function 2 times - the first time you pass langDesc as NULL to get the number of characters to copy. // You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time @@ -389,7 +388,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W #define NPPM_GETAPPDATAPLUGINSALLOWED (NPPMSG + 87) // BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0) - // Check to see if loading plugins from "%APPDATA%\Notepad++\plugins" is allowed. + // Check to see if loading plugins from "%APPDATA%\..\Local\Notepad++\plugins" is allowed. #define NPPM_GETCURRENTVIEW (NPPMSG + 88) // INT NPPM_GETCURRENTVIEW(0, 0) @@ -419,6 +418,19 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W #define NPPM_DISABLEAUTOUPDATE (NPPMSG + 95) // 2119 in decimal // VOID NPPM_DISABLEAUTOUPDATE(0, 0) + #define NPPM_REMOVESHORTCUTBYCMDID (NPPMSG + 96) // 2120 in decimal + // BOOL NPPM_REMOVESHORTCUTASSIGNMENT(int cmdID) + // removes the assigned shortcut mapped to cmdID + // returned value : TRUE if function call is successful, otherwise FALSE + + #define NPPM_GETPLUGINHOMEPATH (NPPMSG + 97) + // INT NPPM_GETPLUGINHOMEPATH(size_t strLen, TCHAR *pluginRootPath) + // Get plugin home root path. It's useful if plugins want to get its own path + // by appending which is the name of plugin without extension part. + // Returns the number of TCHAR copied/to copy. + // Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character), + // allocate pluginRootPath buffer with the return value + 1, then call it again to get the path. + #define RUNCOMMAND_USER (WM_USER + 3000) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) @@ -427,6 +439,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W #define NPPM_GETEXTPART (RUNCOMMAND_USER + EXT_PART) #define NPPM_GETCURRENTWORD (RUNCOMMAND_USER + CURRENT_WORD) #define NPPM_GETNPPDIRECTORY (RUNCOMMAND_USER + NPP_DIRECTORY) + #define NPPM_GETFILENAMEATCURSOR (RUNCOMMAND_USER + GETFILENAMEATCURSOR) // BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str) // where str is the allocated TCHAR array, // strLen is the allocated array size @@ -440,6 +453,8 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W // INT NPPM_GETCURRENTCOLUMN(0, 0) // return the caret current position column + #define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH) + #define VAR_NOT_RECOGNIZED 0 #define FULL_CURRENT_PATH 1 #define CURRENT_DIRECTORY 2 @@ -450,6 +465,8 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W #define NPP_DIRECTORY 7 #define CURRENT_LINE 8 #define CURRENT_COLUMN 9 + #define NPP_FULL_FILE_PATH 10 + #define GETFILENAMEATCURSOR 11 // Notification code @@ -541,10 +558,10 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W //scnNotification->nmhdr.hwndFrom = bufferID; //scnNotification->nmhdr.idFrom = docStatus; // where bufferID is BufferID - // docStatus can be combined by DOCSTAUS_READONLY and DOCSTAUS_BUFFERDIRTY + // docStatus can be combined by DOCSTATUS_READONLY and DOCSTATUS_BUFFERDIRTY - #define DOCSTAUS_READONLY 1 - #define DOCSTAUS_BUFFERDIRTY 2 + #define DOCSTATUS_READONLY 1 + #define DOCSTATUS_BUFFERDIRTY 2 #define NPPN_DOCORDERCHANGED (NPPN_FIRST + 17) // To notify plugins that document order is changed //scnNotification->nmhdr.code = NPPN_DOCORDERCHANGED; diff --git a/src/Npp/Sci_Position.h b/src/Npp/Sci_Position.h new file mode 100644 index 0000000..abd0f34 --- /dev/null +++ b/src/Npp/Sci_Position.h @@ -0,0 +1,29 @@ +// Scintilla source code edit control +/** @file Sci_Position.h + ** Define the Sci_Position type used in Scintilla's external interfaces. + ** These need to be available to clients written in C so are not in a C++ namespace. + **/ +// Copyright 2015 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef SCI_POSITION_H +#define SCI_POSITION_H + +#include + +// Basic signed type used throughout interface +typedef ptrdiff_t Sci_Position; + +// Unsigned variant used for ILexer::Lex and ILexer::Fold +typedef size_t Sci_PositionU; + +// For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE +typedef long Sci_PositionCR; + +#ifdef _WIN32 + #define SCI_METHOD __stdcall +#else + #define SCI_METHOD +#endif + +#endif diff --git a/src/Npp/Scintilla.h b/src/Npp/Scintilla.h index 079e3a4..d43bdf0 100644 --- a/src/Npp/Scintilla.h +++ b/src/Npp/Scintilla.h @@ -26,19 +26,15 @@ int Scintilla_LinkLexers(void); } #endif -/* 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. */ -#if defined(_WIN32) -#include -#endif -#ifdef MAXULONG_PTR -typedef ULONG_PTR uptr_t; -typedef LONG_PTR sptr_t; -#else -typedef unsigned long uptr_t; -typedef long sptr_t; -#endif +// Include header that defines basic numeric types. +#include + +// Define uptr_t, an unsigned integer type large enough to hold a pointer. +typedef uintptr_t uptr_t; +// Define sptr_t, a signed integer large enough to hold a pointer. +typedef intptr_t sptr_t; + +#include "Sci_Position.h" typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); @@ -71,8 +67,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCWS_INVISIBLE 0 #define SCWS_VISIBLEALWAYS 1 #define SCWS_VISIBLEAFTERINDENT 2 +#define SCWS_VISIBLEONLYININDENT 3 #define SCI_GETVIEWWS 2020 #define SCI_SETVIEWWS 2021 +#define SCTD_LONGARROW 0 +#define SCTD_STRIKEOUT 1 +#define SCI_GETTABDRAWMODE 2698 +#define SCI_SETTABDRAWMODE 2699 #define SCI_POSITIONFROMPOINT 2022 #define SCI_POSITIONFROMPOINTCLOSE 2023 #define SCI_GOTOLINE 2024 @@ -164,6 +165,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MARGIN_FORE 3 #define SC_MARGIN_TEXT 4 #define SC_MARGIN_RTEXT 5 +#define SC_MARGIN_COLOUR 6 #define SCI_SETMARGINTYPEN 2240 #define SCI_GETMARGINTYPEN 2241 #define SCI_SETMARGINWIDTHN 2242 @@ -174,6 +176,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETMARGINSENSITIVEN 2247 #define SCI_SETMARGINCURSORN 2248 #define SCI_GETMARGINCURSORN 2249 +#define SCI_SETMARGINBACKN 2250 +#define SCI_GETMARGINBACKN 2251 +#define SCI_SETMARGINS 2252 +#define SCI_GETMARGINS 2253 #define STYLE_DEFAULT 32 #define STYLE_LINENUMBER 33 #define STYLE_BRACELIGHT 34 @@ -181,6 +187,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define STYLE_CONTROLCHAR 36 #define STYLE_INDENTGUIDE 37 #define STYLE_CALLTIP 38 +#define STYLE_FOLDDISPLAYTEXT 39 #define STYLE_LASTPREDEFINED 39 #define STYLE_MAX 255 #define SC_CHARSET_ANSI 0 @@ -194,6 +201,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_CHARSET_MAC 77 #define SC_CHARSET_OEM 255 #define SC_CHARSET_RUSSIAN 204 +#define SC_CHARSET_OEM866 866 #define SC_CHARSET_CYRILLIC 1251 #define SC_CHARSET_SHIFTJIS 128 #define SC_CHARSET_SYMBOL 2 @@ -217,6 +225,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_CASE_MIXED 0 #define SC_CASE_UPPER 1 #define SC_CASE_LOWER 2 +#define SC_CASE_CAMEL 3 #define SCI_STYLEGETFORE 2481 #define SCI_STYLEGETBACK 2482 #define SCI_STYLEGETBOLD 2483 @@ -277,6 +286,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define INDIC_COMPOSITIONTHIN 15 #define INDIC_FULLBOX 16 #define INDIC_TEXTFORE 17 +#define INDIC_POINT 18 +#define INDIC_POINTCHARACTER 19 +#define INDIC_GRADIENT 20 +#define INDIC_GRADIENTCENTRE 21 #define INDIC_IME 32 #define INDIC_IME_MAX 35 #define INDIC_MAX 35 @@ -304,8 +317,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETWHITESPACEBACK 2085 #define SCI_SETWHITESPACESIZE 2086 #define SCI_GETWHITESPACESIZE 2087 -#define SCI_SETSTYLEBITS 2090 -#define SCI_GETSTYLEBITS 2091 #define SCI_SETLINESTATE 2092 #define SCI_GETLINESTATE 2093 #define SCI_GETMAXLINESTATE 2094 @@ -313,6 +324,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETCARETLINEVISIBLE 2096 #define SCI_GETCARETLINEBACK 2097 #define SCI_SETCARETLINEBACK 2098 +#define SCI_GETCARETLINEFRAME 2704 +#define SCI_SETCARETLINEFRAME 2705 #define SCI_STYLESETCHANGEABLE 2099 #define SCI_AUTOCSHOW 2100 #define SCI_AUTOCCANCEL 2101 @@ -352,6 +365,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETLINEINDENTPOSITION 2128 #define SCI_GETCOLUMN 2129 #define SCI_COUNTCHARACTERS 2633 +#define SCI_COUNTCODEUNITS 2715 #define SCI_SETHSCROLLBAR 2130 #define SCI_GETHSCROLLBAR 2131 #define SC_IV_NONE 0 @@ -379,6 +393,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_PRINT_BLACKONWHITE 2 #define SC_PRINT_COLOURONWHITE 3 #define SC_PRINT_COLOURONWHITEDEFAULTBG 4 +#define SC_PRINT_SCREENCOLOURS 5 #define SCI_SETPRINTCOLOURMODE 2148 #define SCI_GETPRINTCOLOURMODE 2149 #define SCFIND_WHOLEWORD 0x2 @@ -434,6 +449,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETTARGETEND 2193 #define SCI_SETTARGETRANGE 2686 #define SCI_GETTARGETTEXT 2687 +#define SCI_TARGETFROMSELECTION 2287 +#define SCI_TARGETWHOLEDOCUMENT 2690 #define SCI_REPLACETARGET 2194 #define SCI_REPLACETARGETRE 2195 #define SCI_SEARCHINTARGET 2197 @@ -468,6 +485,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETFOLDEXPANDED 2229 #define SCI_GETFOLDEXPANDED 2230 #define SCI_TOGGLEFOLD 2231 +#define SCI_TOGGLEFOLDSHOWTEXT 2700 +#define SC_FOLDDISPLAYTEXT_HIDDEN 0 +#define SC_FOLDDISPLAYTEXT_STANDARD 1 +#define SC_FOLDDISPLAYTEXT_BOXED 2 +#define SCI_FOLDDISPLAYTEXTSETSTYLE 2701 #define SC_FOLDACTION_CONTRACT 0 #define SC_FOLDACTION_EXPAND 1 #define SC_FOLDACTION_TOGGLE 2 @@ -498,6 +520,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETMOUSEDWELLTIME 2265 #define SCI_WORDSTARTPOSITION 2266 #define SCI_WORDENDPOSITION 2267 +#define SCI_ISRANGEWORD 2691 +#define SC_IDLESTYLING_NONE 0 +#define SC_IDLESTYLING_TOVISIBLE 1 +#define SC_IDLESTYLING_AFTERVISIBLE 2 +#define SC_IDLESTYLING_ALL 3 +#define SCI_SETIDLESTYLING 2692 +#define SCI_GETIDLESTYLING 2693 #define SC_WRAP_NONE 0 #define SC_WRAP_WORD 1 #define SC_WRAP_CHAR 2 @@ -520,6 +549,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_WRAPINDENT_FIXED 0 #define SC_WRAPINDENT_SAME 1 #define SC_WRAPINDENT_INDENT 2 +#define SC_WRAPINDENT_DEEPINDENT 3 #define SCI_SETWRAPINDENTMODE 2472 #define SCI_GETWRAPINDENTMODE 2473 #define SC_CACHE_NONE 0 @@ -539,8 +569,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETVSCROLLBAR 2280 #define SCI_GETVSCROLLBAR 2281 #define SCI_APPENDTEXT 2282 -#define SCI_GETTWOPHASEDRAW 2283 -#define SCI_SETTWOPHASEDRAW 2284 #define SC_PHASES_ONE 0 #define SC_PHASES_TWO 1 #define SC_PHASES_MULTIPLE 2 @@ -559,11 +587,14 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETMULTIPASTE 2614 #define SCI_GETMULTIPASTE 2615 #define SCI_GETTAG 2616 -#define SCI_TARGETFROMSELECTION 2287 #define SCI_LINESJOIN 2288 #define SCI_LINESSPLIT 2289 #define SCI_SETFOLDMARGINCOLOUR 2290 #define SCI_SETFOLDMARGINHICOLOUR 2291 +#define SC_ACCESSIBILITY_DISABLED 0 +#define SC_ACCESSIBILITY_ENABLED 1 +#define SCI_SETACCESSIBILITY 2702 +#define SCI_GETACCESSIBILITY 2703 #define SCI_LINEDOWN 2300 #define SCI_LINEDOWNEXTEND 2301 #define SCI_LINEUP 2302 @@ -605,6 +636,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_LINECUT 2337 #define SCI_LINEDELETE 2338 #define SCI_LINETRANSPOSE 2339 +#define SCI_LINEREVERSE 2354 #define SCI_LINEDUPLICATE 2404 #define SCI_LOWERCASE 2340 #define SCI_UPPERCASE 2341 @@ -637,24 +669,36 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define EDGE_NONE 0 #define EDGE_LINE 1 #define EDGE_BACKGROUND 2 +#define EDGE_MULTILINE 3 #define SCI_GETEDGECOLUMN 2360 #define SCI_SETEDGECOLUMN 2361 #define SCI_GETEDGEMODE 2362 #define SCI_SETEDGEMODE 2363 #define SCI_GETEDGECOLOUR 2364 #define SCI_SETEDGECOLOUR 2365 +#define SCI_MULTIEDGEADDLINE 2694 +#define SCI_MULTIEDGECLEARALL 2695 #define SCI_SEARCHANCHOR 2366 #define SCI_SEARCHNEXT 2367 #define SCI_SEARCHPREV 2368 #define SCI_LINESONSCREEN 2370 +#define SC_POPUP_NEVER 0 +#define SC_POPUP_ALL 1 +#define SC_POPUP_TEXT 2 #define SCI_USEPOPUP 2371 #define SCI_SELECTIONISRECTANGLE 2372 #define SCI_SETZOOM 2373 #define SCI_GETZOOM 2374 +#define SC_DOCUMENTOPTION_DEFAULT 0 +#define SC_DOCUMENTOPTION_STYLES_NONE 0x1 +#define SC_DOCUMENTOPTION_TEXT_LARGE 0x100 #define SCI_CREATEDOCUMENT 2375 #define SCI_ADDREFDOCUMENT 2376 #define SCI_RELEASEDOCUMENT 2377 +#define SCI_GETDOCUMENTOPTIONS 2379 #define SCI_GETMODEVENTMASK 2378 +#define SCI_SETCOMMANDEVENTS 2717 +#define SCI_GETCOMMANDEVENTS 2718 #define SCI_SETFOCUS 2380 #define SCI_GETFOCUS 2381 #define SC_STATUS_OK 0 @@ -666,6 +710,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETSTATUS 2383 #define SCI_SETMOUSEDOWNCAPTURES 2384 #define SCI_GETMOUSEDOWNCAPTURES 2385 +#define SCI_SETMOUSEWHEELCAPTURES 2696 +#define SCI_GETMOUSEWHEELCAPTURES 2697 #define SC_CURSORNORMAL -1 #define SC_CURSORARROW 2 #define SC_CURSORWAIT 4 @@ -710,6 +756,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_POSITIONBEFORE 2417 #define SCI_POSITIONAFTER 2418 #define SCI_POSITIONRELATIVE 2670 +#define SCI_POSITIONRELATIVECODEUNITS 2716 #define SCI_COPYRANGE 2419 #define SCI_COPYTEXT 2420 #define SC_SEL_STREAM 0 @@ -718,6 +765,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_SEL_THIN 3 #define SCI_SETSELECTIONMODE 2422 #define SCI_GETSELECTIONMODE 2423 +#define SCI_GETMOVEEXTENDSSELECTION 2706 #define SCI_GETLINESELSTARTPOSITION 2424 #define SCI_GETLINESELENDPOSITION 2425 #define SCI_LINEDOWNRECTEXTEND 2426 @@ -779,6 +827,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define CARETSTYLE_INVISIBLE 0 #define CARETSTYLE_LINE 1 #define CARETSTYLE_BLOCK 2 +#define CARETSTYLE_OVERSTRIKE_BAR 0 +#define CARETSTYLE_OVERSTRIKE_BLOCK 16 #define SCI_SETCARETSTYLE 2512 #define SCI_GETCARETSTYLE 2513 #define SCI_SETINDICATORCURRENT 2500 @@ -882,6 +932,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCVS_NONE 0 #define SCVS_RECTANGULARSELECTION 1 #define SCVS_USERACCESSIBLE 2 +#define SCVS_NOWRAPLINESTART 4 #define SCI_SETVIRTUALSPACEOPTIONS 2596 #define SCI_GETVIRTUALSPACEOPTIONS 2597 #define SCI_SETRECTANGULARSELECTIONMODIFIER 2598 @@ -894,6 +945,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETADDITIONALCARETFORE 2605 #define SCI_ROTATESELECTION 2606 #define SCI_SWAPMAINANCHORCARET 2607 +#define SCI_MULTIPLESELECTADDNEXT 2688 +#define SCI_MULTIPLESELECTADDEACH 2689 #define SCI_CHANGELEXERSTATE 2617 #define SCI_CONTRACTEDFOLDNEXT 2618 #define SCI_VERTICALCENTRECARET 2619 @@ -944,7 +997,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETPROPERTY 4008 #define SCI_GETPROPERTYEXPANDED 4009 #define SCI_GETPROPERTYINT 4010 -#define SCI_GETSTYLEBITSNEEDED 4011 #define SCI_GETLEXERLANGUAGE 4012 #define SCI_PRIVATELEXERCALL 4013 #define SCI_PROPERTYNAMES 4014 @@ -964,6 +1016,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETIDENTIFIERS 4024 #define SCI_DISTANCETOSECONDARYSTYLES 4025 #define SCI_GETSUBSTYLEBASES 4026 +#define SCI_GETNAMEDSTYLES 4029 +#define SCI_NAMEOFSTYLE 4030 +#define SCI_TAGSOFSTYLE 4031 +#define SCI_DESCRIPTIONOFSTYLE 4032 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 #define SC_MOD_CHANGESTYLE 0x4 @@ -1021,6 +1077,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCMOD_ALT 4 #define SCMOD_SUPER 8 #define SCMOD_META 16 +#define SC_AC_FILLUP 1 +#define SC_AC_DOUBLECLICK 2 +#define SC_AC_TAB 3 +#define SC_AC_NEWLINE 4 +#define SC_AC_COMMAND 5 #define SCN_STYLENEEDED 2000 #define SCN_CHARADDED 2001 #define SCN_SAVEPOINTREACHED 2002 @@ -1050,21 +1111,37 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCN_HOTSPOTRELEASECLICK 2027 #define SCN_FOCUSIN 2028 #define SCN_FOCUSOUT 2029 +#define SCN_AUTOCCOMPLETED 2030 +#define SCN_MARGINRIGHTCLICK 2031 +#define SCN_AUTOCSELECTIONCHANGE 2032 +#ifndef SCI_DISABLE_PROVISIONAL +#define SC_BIDIRECTIONAL_DISABLED 0 +#define SC_BIDIRECTIONAL_L2R 1 +#define SC_BIDIRECTIONAL_R2L 2 +#define SCI_GETBIDIRECTIONAL 2708 +#define SCI_SETBIDIRECTIONAL 2709 +#define SC_LINECHARACTERINDEX_NONE 0 +#define SC_LINECHARACTERINDEX_UTF32 1 +#define SC_LINECHARACTERINDEX_UTF16 2 +#define SCI_GETLINECHARACTERINDEX 2710 +#define SCI_ALLOCATELINECHARACTERINDEX 2711 +#define SCI_RELEASELINECHARACTERINDEX 2712 +#define SCI_LINEFROMINDEXPOSITION 2713 +#define SCI_INDEXPOSITIONFROMLINE 2714 +#endif + #define SCN_SCROLLED 2080 #define SCN_FOLDINGSTATECHANGED 2081 + /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ /* These structures are defined to be exactly the same shape as the Win32 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. * So older code that treats Scintilla as a RichEdit will work. */ -#if defined(__cplusplus) && defined(SCI_NAMESPACE) -namespace Scintilla { -#endif - struct Sci_CharacterRange { - long cpMin; - long cpMax; + Sci_PositionCR cpMin; + Sci_PositionCR cpMax; }; struct Sci_TextRange { @@ -1078,10 +1155,6 @@ struct Sci_TextToFind { struct Sci_CharacterRange chrgText; }; -#define CharacterRange Sci_CharacterRange -#define TextRange Sci_TextRange -#define TextToFind Sci_TextToFind - typedef void *Sci_SurfaceID; struct Sci_Rectangle { @@ -1102,7 +1175,12 @@ struct Sci_RangeToFormat { struct Sci_CharacterRange chrg; }; -#define RangeToFormat Sci_RangeToFormat +#ifndef __cplusplus +/* For the GTK+ platform, g-ir-scanner needs to have these typedefs. This + * is not required in C++ code and actually seems to break ScintillaEditPy */ +typedef struct Sci_NotifyHeader Sci_NotifyHeader; +typedef struct SCNotification SCNotification; +#endif struct Sci_NotifyHeader { /* Compatible with Windows NMHDR. @@ -1113,18 +1191,18 @@ struct Sci_NotifyHeader { unsigned int code; }; -#define NotifyHeader Sci_NotifyHeader - struct SCNotification { - struct Sci_NotifyHeader nmhdr; - int position; + Sci_NotifyHeader nmhdr; + Sci_Position position; /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */ /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */ /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */ /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */ - int ch; /* SCN_CHARADDED, SCN_KEY */ + int ch; + /* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */ + /* SCN_USERLISTSELECTION */ int modifiers; /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */ /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ @@ -1133,12 +1211,12 @@ struct SCNotification { const char *text; /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */ - int length; /* SCN_MODIFIED */ - int linesAdded; /* SCN_MODIFIED */ + Sci_Position length; /* SCN_MODIFIED */ + Sci_Position linesAdded; /* SCN_MODIFIED */ int message; /* SCN_MACRORECORD */ uptr_t wParam; /* SCN_MACRORECORD */ sptr_t lParam; /* SCN_MACRORECORD */ - int line; /* SCN_MODIFIED */ + Sci_Position line; /* SCN_MODIFIED */ int foldLevelNow; /* SCN_MODIFIED */ int foldLevelPrev; /* SCN_MODIFIED */ int margin; /* SCN_MARGINCLICK */ @@ -1146,8 +1224,10 @@ struct SCNotification { int x; /* SCN_DWELLSTART, SCN_DWELLEND */ int y; /* SCN_DWELLSTART, SCN_DWELLEND */ int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */ - int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */ + Sci_Position annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */ int updated; /* SCN_UPDATEUI */ + int listCompletionMethod; + /* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */ }; struct SearchResultMarking { @@ -1160,18 +1240,24 @@ struct SearchResultMarkings { SearchResultMarking *_markings; }; -#if defined(__cplusplus) && defined(SCI_NAMESPACE) -} -#endif - #ifdef INCLUDE_DEPRECATED_FEATURES -#define SC_CP_DBCS 1 -#define SCI_SETUSEPALETTE 2039 -#define SCI_GETUSEPALETTE 2139 #define SCI_SETKEYSUNICODE 2521 #define SCI_GETKEYSUNICODE 2522 +#define SCI_GETTWOPHASEDRAW 2283 +#define SCI_SETTWOPHASEDRAW 2284 + +#define CharacterRange Sci_CharacterRange +#define TextRange Sci_TextRange +#define TextToFind Sci_TextToFind +#define RangeToFormat Sci_RangeToFormat +#define NotifyHeader Sci_NotifyHeader + +#define SCI_SETSTYLEBITS 2090 +#define SCI_GETSTYLEBITS 2091 +#define SCI_GETSTYLEBITSNEEDED 4011 + #endif #endif diff --git a/src/Npp/menuCmdID.h b/src/Npp/menuCmdID.h index eb171bf..cea916b 100644 --- a/src/Npp/menuCmdID.h +++ b/src/Npp/menuCmdID.h @@ -56,10 +56,12 @@ #define IDM_FILE_OPEN_CMD (IDM_FILE + 20) #define IDM_FILE_RESTORELASTCLOSEDFILE (IDM_FILE + 21) #define IDM_FILE_OPENFOLDERASWORSPACE (IDM_FILE + 22) + #define IDM_FILE_OPEN_DEFAULT_VIEWER (IDM_FILE + 23) + #define IDM_FILE_CLOSEALL_UNCHANGED (IDM_FILE + 24) // IMPORTANT: If list above is modified, you have to change the following values: // To be updated if new menu item(s) is (are) added in menu "File" - #define IDM_FILEMENU_LASTONE IDM_FILE_OPENFOLDERASWORSPACE + #define IDM_FILEMENU_LASTONE IDM_FILE_CLOSEALL_UNCHANGED // 0 based position of command "Exit" including the bars in the file menu // and without counting "Recent files history" items @@ -68,25 +70,26 @@ // 1 Open... // 2 Open Containing Folder // 3 Open Folder as Workspace -// 4 Reload from Disk -// 5 Save -// 6 Save As... -// 7 Save a Copy As... -// 8 Save All -// 9 Rename... -//10 Close -//11 Close All -//12 Close More -//13 Move to Recycle Bin -//14 -------- -//15 Load Session... -//16 Save Session... -//17 -------- -//18 Print... -//19 Print Now -//20 -------- -//21 Exit - #define IDM_FILEMENU_EXISTCMDPOSITION 21 +// 4 Open in Default Viewer +// 5 Reload from Disk +// 6 Save +// 7 Save As... +// 8 Save a Copy As... +// 9 Save All +//10 Rename... +//11 Close +//12 Close All +//13 Close More +//14 Move to Recycle Bin +//15 -------- +//16 Load Session... +//17 Save Session... +//18 -------- +//19 Print... +//20 Print Now +//21 -------- +//22 Exit + #define IDM_FILEMENU_EXISTCMDPOSITION 22 #define IDM_EDIT (IDM + 2000) @@ -102,6 +105,7 @@ #define IDM_EDIT_INS_TAB (IDM_EDIT + 8) #define IDM_EDIT_RMV_TAB (IDM_EDIT + 9) #define IDM_EDIT_DUP_LINE (IDM_EDIT + 10) + #define IDM_EDIT_REMOVE_DUP_LINES (IDM_EDIT + 77) #define IDM_EDIT_TRANSPOSE_LINE (IDM_EDIT + 11) #define IDM_EDIT_SPLIT_LINES (IDM_EDIT + 12) #define IDM_EDIT_JOIN_LINES (IDM_EDIT + 13) @@ -109,6 +113,12 @@ #define IDM_EDIT_LINE_DOWN (IDM_EDIT + 15) #define IDM_EDIT_UPPERCASE (IDM_EDIT + 16) #define IDM_EDIT_LOWERCASE (IDM_EDIT + 17) + #define IDM_EDIT_PROPERCASE_FORCE (IDM_EDIT + 67) + #define IDM_EDIT_PROPERCASE_BLEND (IDM_EDIT + 68) + #define IDM_EDIT_SENTENCECASE_FORCE (IDM_EDIT + 69) + #define IDM_EDIT_SENTENCECASE_BLEND (IDM_EDIT + 70) + #define IDM_EDIT_INVERTCASE (IDM_EDIT + 71) + #define IDM_EDIT_RANDOMCASE (IDM_EDIT + 72) #define IDM_EDIT_REMOVEEMPTYLINES (IDM_EDIT + 55) #define IDM_EDIT_REMOVEEMPTYLINESWITHBLANK (IDM_EDIT + 56) #define IDM_EDIT_BLANKLINEABOVECURRENT (IDM_EDIT + 57) @@ -122,6 +132,11 @@ #define IDM_EDIT_SORTLINES_DECIMALDOT_ASCENDING (IDM_EDIT + 65) #define IDM_EDIT_SORTLINES_DECIMALDOT_DESCENDING (IDM_EDIT + 66) + #define IDM_EDIT_OPENASFILE (IDM_EDIT + 73) + #define IDM_EDIT_OPENINFOLDER (IDM_EDIT + 74) + #define IDM_EDIT_SEARCHONINTERNET (IDM_EDIT + 75) + #define IDM_EDIT_CHANGESEARCHENGINE (IDM_EDIT + 76) + // Menu macro #define IDM_MACRO_STARTRECORDINGMACRO (IDM_EDIT + 18) #define IDM_MACRO_STOPRECORDINGMACRO (IDM_EDIT + 19) @@ -312,6 +327,7 @@ #define IDM_VIEW_FILESWITCHER_PANEL (IDM_VIEW + 70) #define IDM_VIEW_SWITCHTO_OTHER_VIEW (IDM_VIEW + 72) + #define IDM_EXPORT_FUNC_LIST_AND_QUIT (IDM_VIEW + 73) #define IDM_VIEW_DOC_MAP (IDM_VIEW + 80) @@ -334,6 +350,12 @@ #define IDM_VIEW_TAB_NEXT (IDM_VIEW + 95) #define IDM_VIEW_TAB_PREV (IDM_VIEW + 96) #define IDM_VIEW_MONITORING (IDM_VIEW + 97) + #define IDM_VIEW_TAB_MOVEFORWARD (IDM_VIEW + 98) + #define IDM_VIEW_TAB_MOVEBACKWARD (IDM_VIEW + 99) + #define IDM_VIEW_IN_FIREFOX (IDM_VIEW + 100) + #define IDM_VIEW_IN_CHROME (IDM_VIEW + 101) + #define IDM_VIEW_IN_EDGE (IDM_VIEW + 102) + #define IDM_VIEW_IN_IE (IDM_VIEW + 103) #define IDM_VIEW_GOTO_ANOTHER_VIEW 10001 #define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002 @@ -375,12 +397,12 @@ #define IDM_FORMAT_ISO_8859_7 (IDM_FORMAT_ENCODE + 15) #define IDM_FORMAT_ISO_8859_8 (IDM_FORMAT_ENCODE + 16) #define IDM_FORMAT_ISO_8859_9 (IDM_FORMAT_ENCODE + 17) - #define IDM_FORMAT_ISO_8859_10 (IDM_FORMAT_ENCODE + 18) - #define IDM_FORMAT_ISO_8859_11 (IDM_FORMAT_ENCODE + 19) + //#define IDM_FORMAT_ISO_8859_10 (IDM_FORMAT_ENCODE + 18) + //#define IDM_FORMAT_ISO_8859_11 (IDM_FORMAT_ENCODE + 19) #define IDM_FORMAT_ISO_8859_13 (IDM_FORMAT_ENCODE + 20) #define IDM_FORMAT_ISO_8859_14 (IDM_FORMAT_ENCODE + 21) #define IDM_FORMAT_ISO_8859_15 (IDM_FORMAT_ENCODE + 22) - #define IDM_FORMAT_ISO_8859_16 (IDM_FORMAT_ENCODE + 23) + //#define IDM_FORMAT_ISO_8859_16 (IDM_FORMAT_ENCODE + 23) #define IDM_FORMAT_DOS_437 (IDM_FORMAT_ENCODE + 24) #define IDM_FORMAT_DOS_720 (IDM_FORMAT_ENCODE + 25) #define IDM_FORMAT_DOS_737 (IDM_FORMAT_ENCODE + 26) @@ -469,13 +491,39 @@ #define IDM_LANG_COFFEESCRIPT (IDM_LANG + 56) #define IDM_LANG_JSON (IDM_LANG + 57) #define IDM_LANG_FORTRAN_77 (IDM_LANG + 58) + #define IDM_LANG_BAANC (IDM_LANG + 59) + #define IDM_LANG_SREC (IDM_LANG + 60) + #define IDM_LANG_IHEX (IDM_LANG + 61) + #define IDM_LANG_TEHEX (IDM_LANG + 62) + #define IDM_LANG_SWIFT (IDM_LANG + 63) + #define IDM_LANG_ASN1 (IDM_LANG + 64) + #define IDM_LANG_AVS (IDM_LANG + 65) + #define IDM_LANG_BLITZBASIC (IDM_LANG + 66) + #define IDM_LANG_PUREBASIC (IDM_LANG + 67) + #define IDM_LANG_FREEBASIC (IDM_LANG + 68) + #define IDM_LANG_CSOUND (IDM_LANG + 69) + #define IDM_LANG_ERLANG (IDM_LANG + 70) + #define IDM_LANG_ESCRIPT (IDM_LANG + 71) + #define IDM_LANG_FORTH (IDM_LANG + 72) + #define IDM_LANG_LATEX (IDM_LANG + 73) + #define IDM_LANG_MMIXAL (IDM_LANG + 74) + #define IDM_LANG_NIMROD (IDM_LANG + 75) + #define IDM_LANG_NNCRONTAB (IDM_LANG + 76) + #define IDM_LANG_OSCRIPT (IDM_LANG + 77) + #define IDM_LANG_REBOL (IDM_LANG + 78) + #define IDM_LANG_REGISTRY (IDM_LANG + 79) + #define IDM_LANG_RUST (IDM_LANG + 80) + #define IDM_LANG_SPICE (IDM_LANG + 81) + #define IDM_LANG_TXT2TAGS (IDM_LANG + 82) + #define IDM_LANG_VISUALPROLOG (IDM_LANG + 83) + + #define IDM_LANG_EXTERNAL (IDM_LANG + 165) + #define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 179) + + #define IDM_LANG_USER (IDM_LANG + 180) //46180: Used for translation + #define IDM_LANG_USER_LIMIT (IDM_LANG + 210) //46210: Ajust with IDM_LANG_USER + #define IDM_LANG_USER_DLG (IDM_LANG + 250) //46250: Used for translation - #define IDM_LANG_EXTERNAL (IDM_LANG + 65) - #define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 79) - - #define IDM_LANG_USER (IDM_LANG + 80) //46080 - #define IDM_LANG_USER_LIMIT (IDM_LANG + 110) //46110 - #define IDM_LANG_USER_DLG (IDM_LANG + 150) @@ -484,7 +532,7 @@ #define IDM_PROJECTPAGE (IDM_ABOUT + 2) #define IDM_ONLINEHELP (IDM_ABOUT + 3) #define IDM_FORUM (IDM_ABOUT + 4) - #define IDM_PLUGINSHOME (IDM_ABOUT + 5) + //#define IDM_PLUGINSHOME (IDM_ABOUT + 5) #define IDM_UPDATE_NPP (IDM_ABOUT + 6) #define IDM_WIKIFAQ (IDM_ABOUT + 7) #define IDM_HELP (IDM_ABOUT + 8) @@ -504,12 +552,21 @@ #define IDM_SETTING_TRAYICON (IDM_SETTING + 8) #define IDM_SETTING_SHORTCUT_MAPPER (IDM_SETTING + 9) #define IDM_SETTING_REMEMBER_LAST_SESSION (IDM_SETTING + 10) - #define IDM_SETTING_PREFERECE (IDM_SETTING + 11) -// #define IDM_SETTING_AUTOCNBCHAR (IDM_SETTING + 15) + #define IDM_SETTING_PREFERENCE (IDM_SETTING + 11) + #define IDM_SETTING_OPENPLUGINSDIR (IDM_SETTING + 14) + #define IDM_SETTING_PLUGINADM (IDM_SETTING + 15) #define IDM_SETTING_SHORTCUT_MAPPER_MACRO (IDM_SETTING + 16) #define IDM_SETTING_SHORTCUT_MAPPER_RUN (IDM_SETTING + 17) #define IDM_SETTING_EDITCONTEXTMENU (IDM_SETTING + 18) +#define IDM_TOOL (IDM + 8500) + #define IDM_TOOL_MD5_GENERATE (IDM_TOOL + 1) + #define IDM_TOOL_MD5_GENERATEFROMFILE (IDM_TOOL + 2) + #define IDM_TOOL_MD5_GENERATEINTOCLIPBOARD (IDM_TOOL + 3) + #define IDM_TOOL_SHA256_GENERATE (IDM_TOOL + 4) + #define IDM_TOOL_SHA256_GENERATEFROMFILE (IDM_TOOL + 5) + #define IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD (IDM_TOOL + 6) + #define IDM_EXECUTE (IDM + 9000) #define IDM_SYSTRAYPOPUP (IDM + 3100) diff --git a/src/ScintillaGateway.h b/src/ScintillaEditor.h similarity index 82% rename from src/ScintillaGateway.h rename to src/ScintillaEditor.h index 90621bc..220faf8 100644 --- a/src/ScintillaGateway.h +++ b/src/ScintillaEditor.h @@ -1,17 +1,17 @@ -// This file is part of SurroundSelection. -// -// Copyright (C)2017 Justin Dailey -// -// SurroundSelection is free software; you can redistribute it and/or +// This file is part of {{ cookiecutter.plugin_name }}. +// +// Copyright (C){% now 'utc', '%Y' %} {{ cookiecutter.full_name }} <{{ cookiecutter.email }}> +// +// {{ cookiecutter.plugin_name }} is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -32,7 +32,7 @@ typedef struct { typedef int Colour; typedef int KeyModifier; -class ScintillaGateway final { +class ScintillaEditor final { private: HWND scintilla = nullptr; SciFnDirect directFunction = nullptr; @@ -42,16 +42,10 @@ class ScintillaGateway final { while (s.length() > 0 && s.back() == '\0') s.pop_back(); } - template - inline sptr_t Call(unsigned int message, T wParam = 0, U lParam = 0) const { - sptr_t retVal = directFunction(directPointer, message, (uptr_t)wParam, (sptr_t)lParam); - return retVal; - } - public: - ScintillaGateway() {} + ScintillaEditor() {} - explicit ScintillaGateway(HWND scintilla) { + explicit ScintillaEditor(HWND scintilla) { SetScintillaInstance(scintilla); } @@ -65,6 +59,12 @@ class ScintillaGateway final { return scintilla; } + template + inline sptr_t Call(unsigned int message, T wParam = 0, U lParam = 0) const { + sptr_t retVal = directFunction(directPointer, message, (uptr_t)wParam, (sptr_t)lParam); + return retVal; + } + /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ void AddText(int length, const char* text) const { @@ -99,8 +99,8 @@ class ScintillaGateway final { Call(SCI_CLEARALL, SCI_UNUSED, SCI_UNUSED); } - void DeleteRange(int pos, int deleteLength) const { - Call(SCI_DELETERANGE, pos, deleteLength); + void DeleteRange(int start, int lengthDelete) const { + Call(SCI_DELETERANGE, start, lengthDelete); } void ClearDocumentStyle() const { @@ -158,13 +158,13 @@ class ScintillaGateway final { return res != 0; } - int MarkerLineFromHandle(int handle) const { - sptr_t res = Call(SCI_MARKERLINEFROMHANDLE, handle, SCI_UNUSED); + int MarkerLineFromHandle(int markerHandle) const { + sptr_t res = Call(SCI_MARKERLINEFROMHANDLE, markerHandle, SCI_UNUSED); return static_cast(res); } - void MarkerDeleteHandle(int handle) const { - Call(SCI_MARKERDELETEHANDLE, handle, SCI_UNUSED); + void MarkerDeleteHandle(int markerHandle) const { + Call(SCI_MARKERDELETEHANDLE, markerHandle, SCI_UNUSED); } bool GetUndoCollection() const { @@ -181,6 +181,15 @@ class ScintillaGateway final { Call(SCI_SETVIEWWS, viewWS, SCI_UNUSED); } + int GetTabDrawMode() const { + sptr_t res = Call(SCI_GETTABDRAWMODE, SCI_UNUSED, SCI_UNUSED); + return static_cast(res); + } + + void SetTabDrawMode(int tabDrawMode) const { + Call(SCI_SETTABDRAWMODE, tabDrawMode, SCI_UNUSED); + } + int PositionFromPoint(int x, int y) const { sptr_t res = Call(SCI_POSITIONFROMPOINT, x, y); return static_cast(res); @@ -195,12 +204,12 @@ class ScintillaGateway final { Call(SCI_GOTOLINE, line, SCI_UNUSED); } - void GotoPos(int pos) const { - Call(SCI_GOTOPOS, pos, SCI_UNUSED); + void GotoPos(int caret) const { + Call(SCI_GOTOPOS, caret, SCI_UNUSED); } - void SetAnchor(int posAnchor) const { - Call(SCI_SETANCHOR, posAnchor, SCI_UNUSED); + void SetAnchor(int anchor) const { + Call(SCI_SETANCHOR, anchor, SCI_UNUSED); } int GetCurLine(int length, char* text) const { @@ -234,8 +243,8 @@ class ScintillaGateway final { Call(SCI_SETEOLMODE, eolMode, SCI_UNUSED); } - void StartStyling(int pos, int mask) const { - Call(SCI_STARTSTYLING, pos, mask); + void StartStyling(int start, int unused) const { + Call(SCI_STARTSTYLING, start, unused); } void SetStyling(int length, int style) const { @@ -342,8 +351,8 @@ class ScintillaGateway final { Call(SCI_MARKERDEFINEPIXMAP, markerNumber, pixmap.c_str()); } - void MarkerAddSet(int line, int set) const { - Call(SCI_MARKERADDSET, line, set); + void MarkerAddSet(int line, int markerSet) const { + Call(SCI_MARKERADDSET, line, markerSet); } void MarkerSetAlpha(int markerNumber, int alpha) const { @@ -395,6 +404,24 @@ class ScintillaGateway final { return static_cast(res); } + void SetMarginBackN(int margin, Colour back) const { + Call(SCI_SETMARGINBACKN, margin, back); + } + + Colour GetMarginBackN(int margin) const { + sptr_t res = Call(SCI_GETMARGINBACKN, margin, SCI_UNUSED); + return static_cast(res); + } + + void SetMargins(int margins) const { + Call(SCI_SETMARGINS, margins, SCI_UNUSED); + } + + int GetMargins() const { + sptr_t res = Call(SCI_GETMARGINS, SCI_UNUSED, SCI_UNUSED); + return static_cast(res); + } + void StyleClearAll() const { Call(SCI_STYLECLEARALL, SCI_UNUSED, SCI_UNUSED); } @@ -427,8 +454,8 @@ class ScintillaGateway final { Call(SCI_STYLESETFONT, style, fontName.c_str()); } - void StyleSetEOLFilled(int style, bool filled) const { - Call(SCI_STYLESETEOLFILLED, style, filled); + void StyleSetEOLFilled(int style, bool eolFilled) const { + Call(SCI_STYLESETEOLFILLED, style, eolFilled); } void StyleResetDefault() const { @@ -512,12 +539,12 @@ class ScintillaGateway final { return res != 0; } - void StyleSetCase(int style, int caseForce) const { - Call(SCI_STYLESETCASE, style, caseForce); + void StyleSetCase(int style, int caseVisible) const { + Call(SCI_STYLESETCASE, style, caseVisible); } - void StyleSetSizeFractional(int style, int caseForce) const { - Call(SCI_STYLESETSIZEFRACTIONAL, style, caseForce); + void StyleSetSizeFractional(int style, int sizeHundredthPoints) const { + Call(SCI_STYLESETSIZEFRACTIONAL, style, sizeHundredthPoints); } int StyleGetSizeFractional(int style) const { @@ -572,12 +599,12 @@ class ScintillaGateway final { Call(SCI_SETCARETFORE, fore, SCI_UNUSED); } - void AssignCmdKey(KeyModifier km, int msg) const { - Call(SCI_ASSIGNCMDKEY, km, msg); + void AssignCmdKey(KeyModifier keyDefinition, int sciCommand) const { + Call(SCI_ASSIGNCMDKEY, keyDefinition, sciCommand); } - void ClearCmdKey(KeyModifier km) const { - Call(SCI_CLEARCMDKEY, km, SCI_UNUSED); + void ClearCmdKey(KeyModifier keyDefinition) const { + Call(SCI_CLEARCMDKEY, keyDefinition, SCI_UNUSED); } void ClearAllCmdKeys() const { @@ -634,57 +661,57 @@ class ScintillaGateway final { Call(SCI_ENDUNDOACTION, SCI_UNUSED, SCI_UNUSED); } - void IndicSetStyle(int indic, int style) const { - Call(SCI_INDICSETSTYLE, indic, style); + void IndicSetStyle(int indicator, int indicatorStyle) const { + Call(SCI_INDICSETSTYLE, indicator, indicatorStyle); } - int IndicGetStyle(int indic) const { - sptr_t res = Call(SCI_INDICGETSTYLE, indic, SCI_UNUSED); + int IndicGetStyle(int indicator) const { + sptr_t res = Call(SCI_INDICGETSTYLE, indicator, SCI_UNUSED); return static_cast(res); } - void IndicSetFore(int indic, Colour fore) const { - Call(SCI_INDICSETFORE, indic, fore); + void IndicSetFore(int indicator, Colour fore) const { + Call(SCI_INDICSETFORE, indicator, fore); } - Colour IndicGetFore(int indic) const { - sptr_t res = Call(SCI_INDICGETFORE, indic, SCI_UNUSED); + Colour IndicGetFore(int indicator) const { + sptr_t res = Call(SCI_INDICGETFORE, indicator, SCI_UNUSED); return static_cast(res); } - void IndicSetUnder(int indic, bool under) const { - Call(SCI_INDICSETUNDER, indic, under); + void IndicSetUnder(int indicator, bool under) const { + Call(SCI_INDICSETUNDER, indicator, under); } - bool IndicGetUnder(int indic) const { - sptr_t res = Call(SCI_INDICGETUNDER, indic, SCI_UNUSED); + bool IndicGetUnder(int indicator) const { + sptr_t res = Call(SCI_INDICGETUNDER, indicator, SCI_UNUSED); return res != 0; } - void IndicSetHoverStyle(int indic, int style) const { - Call(SCI_INDICSETHOVERSTYLE, indic, style); + void IndicSetHoverStyle(int indicator, int indicatorStyle) const { + Call(SCI_INDICSETHOVERSTYLE, indicator, indicatorStyle); } - int IndicGetHoverStyle(int indic) const { - sptr_t res = Call(SCI_INDICGETHOVERSTYLE, indic, SCI_UNUSED); + int IndicGetHoverStyle(int indicator) const { + sptr_t res = Call(SCI_INDICGETHOVERSTYLE, indicator, SCI_UNUSED); return static_cast(res); } - void IndicSetHoverFore(int indic, Colour fore) const { - Call(SCI_INDICSETHOVERFORE, indic, fore); + void IndicSetHoverFore(int indicator, Colour fore) const { + Call(SCI_INDICSETHOVERFORE, indicator, fore); } - Colour IndicGetHoverFore(int indic) const { - sptr_t res = Call(SCI_INDICGETHOVERFORE, indic, SCI_UNUSED); + Colour IndicGetHoverFore(int indicator) const { + sptr_t res = Call(SCI_INDICGETHOVERFORE, indicator, SCI_UNUSED); return static_cast(res); } - void IndicSetFlags(int indic, int flags) const { - Call(SCI_INDICSETFLAGS, indic, flags); + void IndicSetFlags(int indicator, int flags) const { + Call(SCI_INDICSETFLAGS, indicator, flags); } - int IndicGetFlags(int indic) const { - sptr_t res = Call(SCI_INDICGETFLAGS, indic, SCI_UNUSED); + int IndicGetFlags(int indicator) const { + sptr_t res = Call(SCI_INDICGETFLAGS, indicator, SCI_UNUSED); return static_cast(res); } @@ -705,15 +732,6 @@ class ScintillaGateway final { return static_cast(res); } - void SetStyleBits(int bits) const { - Call(SCI_SETSTYLEBITS, bits, SCI_UNUSED); - } - - int GetStyleBits() const { - sptr_t res = Call(SCI_GETSTYLEBITS, SCI_UNUSED, SCI_UNUSED); - return static_cast(res); - } - void SetLineState(int line, int state) const { Call(SCI_SETLINESTATE, line, state); } @@ -746,16 +764,25 @@ class ScintillaGateway final { Call(SCI_SETCARETLINEBACK, back, SCI_UNUSED); } + int GetCaretLineFrame() const { + sptr_t res = Call(SCI_GETCARETLINEFRAME, SCI_UNUSED, SCI_UNUSED); + return static_cast(res); + } + + void SetCaretLineFrame(int width) const { + Call(SCI_SETCARETLINEFRAME, width, SCI_UNUSED); + } + void StyleSetChangeable(int style, bool changeable) const { Call(SCI_STYLESETCHANGEABLE, style, changeable); } - void AutoCShow(int lenEntered, const char* itemList) const { - Call(SCI_AUTOCSHOW, lenEntered, itemList); + void AutoCShow(int lengthEntered, const char* itemList) const { + Call(SCI_AUTOCSHOW, lengthEntered, itemList); } - void AutoCShow(int lenEntered, const std::string& itemList) const { - Call(SCI_AUTOCSHOW, lenEntered, itemList.c_str()); + void AutoCShow(int lengthEntered, const std::string& itemList) const { + Call(SCI_AUTOCSHOW, lengthEntered, itemList.c_str()); } void AutoCCancel() const { @@ -793,12 +820,12 @@ class ScintillaGateway final { return static_cast(res); } - void AutoCSelect(const char* text) const { - Call(SCI_AUTOCSELECT, SCI_UNUSED, text); + void AutoCSelect(const char* select) const { + Call(SCI_AUTOCSELECT, SCI_UNUSED, select); } - void AutoCSelect(const std::string& text) const { - Call(SCI_AUTOCSELECT, SCI_UNUSED, text.c_str()); + void AutoCSelect(const std::string& select) const { + Call(SCI_AUTOCSELECT, SCI_UNUSED, select.c_str()); } void AutoCSetCancelAtStart(bool cancel) const { @@ -919,8 +946,8 @@ class ScintillaGateway final { return res != 0; } - void SetLineIndentation(int line, int indentSize) const { - Call(SCI_SETLINEINDENTATION, line, indentSize); + void SetLineIndentation(int line, int indentation) const { + Call(SCI_SETLINEINDENTATION, line, indentation); } int GetLineIndentation(int line) const { @@ -938,13 +965,18 @@ class ScintillaGateway final { return static_cast(res); } - int CountCharacters(int startPos, int endPos) const { - sptr_t res = Call(SCI_COUNTCHARACTERS, startPos, endPos); + int CountCharacters(int start, int end) const { + sptr_t res = Call(SCI_COUNTCHARACTERS, start, end); return static_cast(res); } - void SetHScrollBar(bool show) const { - Call(SCI_SETHSCROLLBAR, show, SCI_UNUSED); + int CountCodeUnits(int start, int end) const { + sptr_t res = Call(SCI_COUNTCODEUNITS, start, end); + return static_cast(res); + } + + void SetHScrollBar(bool visible) const { + Call(SCI_SETHSCROLLBAR, visible, SCI_UNUSED); } bool GetHScrollBar() const { @@ -990,12 +1022,12 @@ class ScintillaGateway final { return res != 0; } - void SetCurrentPos(int pos) const { - Call(SCI_SETCURRENTPOS, pos, SCI_UNUSED); + void SetCurrentPos(int caret) const { + Call(SCI_SETCURRENTPOS, caret, SCI_UNUSED); } - void SetSelectionStart(int pos) const { - Call(SCI_SETSELECTIONSTART, pos, SCI_UNUSED); + void SetSelectionStart(int anchor) const { + Call(SCI_SETSELECTIONSTART, anchor, SCI_UNUSED); } int GetSelectionStart() const { @@ -1003,8 +1035,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetSelectionEnd(int pos) const { - Call(SCI_SETSELECTIONEND, pos, SCI_UNUSED); + void SetSelectionEnd(int caret) const { + Call(SCI_SETSELECTIONEND, caret, SCI_UNUSED); } int GetSelectionEnd() const { @@ -1012,8 +1044,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetEmptySelection(int pos) const { - Call(SCI_SETEMPTYSELECTION, pos, SCI_UNUSED); + void SetEmptySelection(int caret) const { + Call(SCI_SETEMPTYSELECTION, caret, SCI_UNUSED); } void SetPrintMagnification(int magnification) const { @@ -1034,8 +1066,8 @@ class ScintillaGateway final { return static_cast(res); } - int FindText(int flags, Sci_TextToFind* ft) const { - sptr_t res = Call(SCI_FINDTEXT, flags, ft); + int FindText(int searchFlags, Sci_TextToFind* ft) const { + sptr_t res = Call(SCI_FINDTEXT, searchFlags, ft); return static_cast(res); } @@ -1090,8 +1122,8 @@ class ScintillaGateway final { return res != 0; } - void SetSel(int start, int end) const { - Call(SCI_SETSEL, start, end); + void SetSel(int anchor, int caret) const { + Call(SCI_SETSEL, anchor, caret); } int GetSelText(char* text) const { @@ -1112,8 +1144,8 @@ class ScintillaGateway final { return static_cast(res); } - void HideSelection(bool normal) const { - Call(SCI_HIDESELECTION, normal, SCI_UNUSED); + void HideSelection(bool hide) const { + Call(SCI_HIDESELECTION, hide, SCI_UNUSED); } int PointXFromPosition(int pos) const { @@ -1225,17 +1257,15 @@ class ScintillaGateway final { } sptr_t GetDirectFunction() const { - sptr_t res = Call(SCI_GETDIRECTFUNCTION, SCI_UNUSED, SCI_UNUSED); - return res; + return Call(SCI_GETDIRECTFUNCTION, SCI_UNUSED, SCI_UNUSED); } sptr_t GetDirectPointer() const { - sptr_t res = Call(SCI_GETDIRECTPOINTER, SCI_UNUSED, SCI_UNUSED); - return res; + return Call(SCI_GETDIRECTPOINTER, SCI_UNUSED, SCI_UNUSED); } - void SetOvertype(bool overtype) const { - Call(SCI_SETOVERTYPE, overtype, SCI_UNUSED); + void SetOvertype(bool overType) const { + Call(SCI_SETOVERTYPE, overType, SCI_UNUSED); } bool GetOvertype() const { @@ -1252,8 +1282,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetTargetStart(int pos) const { - Call(SCI_SETTARGETSTART, pos, SCI_UNUSED); + void SetTargetStart(int start) const { + Call(SCI_SETTARGETSTART, start, SCI_UNUSED); } int GetTargetStart() const { @@ -1261,8 +1291,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetTargetEnd(int pos) const { - Call(SCI_SETTARGETEND, pos, SCI_UNUSED); + void SetTargetEnd(int end) const { + Call(SCI_SETTARGETEND, end, SCI_UNUSED); } int GetTargetEnd() const { @@ -1274,17 +1304,25 @@ class ScintillaGateway final { Call(SCI_SETTARGETRANGE, start, end); } - int GetTargetText(char* characters) const { - sptr_t res = Call(SCI_GETTARGETTEXT, SCI_UNUSED, characters); + int GetTargetText(char* text) const { + sptr_t res = Call(SCI_GETTARGETTEXT, SCI_UNUSED, text); return static_cast(res); } std::string GetTargetText() const { auto size = Call(SCI_GETTARGETTEXT, SCI_UNUSED, NULL); - std::string characters(size + 1, '\0'); - Call(SCI_GETTARGETTEXT, SCI_UNUSED, &characters[0]); - trim(characters); - return characters; + std::string text(size + 1, '\0'); + Call(SCI_GETTARGETTEXT, SCI_UNUSED, &text[0]); + trim(text); + return text; + } + + void TargetFromSelection() const { + Call(SCI_TARGETFROMSELECTION, SCI_UNUSED, SCI_UNUSED); + } + + void TargetWholeDocument() const { + Call(SCI_TARGETWHOLEDOCUMENT, SCI_UNUSED, SCI_UNUSED); } int ReplaceTarget(int length, const char* text) const { @@ -1317,8 +1355,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetSearchFlags(int flags) const { - Call(SCI_SETSEARCHFLAGS, flags, SCI_UNUSED); + void SetSearchFlags(int searchFlags) const { + Call(SCI_SETSEARCHFLAGS, searchFlags, SCI_UNUSED); } int GetSearchFlags() const { @@ -1352,8 +1390,8 @@ class ScintillaGateway final { Call(SCI_CALLTIPSETPOSSTART, posStart, SCI_UNUSED); } - void CallTipSetHlt(int start, int end) const { - Call(SCI_CALLTIPSETHLT, start, end); + void CallTipSetHlt(int highlightStart, int highlightEnd) const { + Call(SCI_CALLTIPSETHLT, highlightStart, highlightEnd); } void CallTipSetBack(Colour back) const { @@ -1376,18 +1414,18 @@ class ScintillaGateway final { Call(SCI_CALLTIPSETPOSITION, above, SCI_UNUSED); } - int VisibleFromDocLine(int line) const { - sptr_t res = Call(SCI_VISIBLEFROMDOCLINE, line, SCI_UNUSED); + int VisibleFromDocLine(int docLine) const { + sptr_t res = Call(SCI_VISIBLEFROMDOCLINE, docLine, SCI_UNUSED); return static_cast(res); } - int DocLineFromVisible(int lineDisplay) const { - sptr_t res = Call(SCI_DOCLINEFROMVISIBLE, lineDisplay, SCI_UNUSED); + int DocLineFromVisible(int displayLine) const { + sptr_t res = Call(SCI_DOCLINEFROMVISIBLE, displayLine, SCI_UNUSED); return static_cast(res); } - int WrapCount(int line) const { - sptr_t res = Call(SCI_WRAPCOUNT, line, SCI_UNUSED); + int WrapCount(int docLine) const { + sptr_t res = Call(SCI_WRAPCOUNT, docLine, SCI_UNUSED); return static_cast(res); } @@ -1441,6 +1479,18 @@ class ScintillaGateway final { Call(SCI_TOGGLEFOLD, line, SCI_UNUSED); } + void ToggleFoldShowText(int line, const char* text) const { + Call(SCI_TOGGLEFOLDSHOWTEXT, line, text); + } + + void ToggleFoldShowText(int line, const std::string& text) const { + Call(SCI_TOGGLEFOLDSHOWTEXT, line, text.c_str()); + } + + void FoldDisplayTextSetStyle(int style) const { + Call(SCI_FOLDDISPLAYTEXTSETSTYLE, style, SCI_UNUSED); + } + void FoldLine(int line, int action) const { Call(SCI_FOLDLINE, line, action); } @@ -1515,8 +1565,22 @@ class ScintillaGateway final { return static_cast(res); } - void SetWrapMode(int mode) const { - Call(SCI_SETWRAPMODE, mode, SCI_UNUSED); + bool IsRangeWord(int start, int end) const { + sptr_t res = Call(SCI_ISRANGEWORD, start, end); + return res != 0; + } + + void SetIdleStyling(int idleStyling) const { + Call(SCI_SETIDLESTYLING, idleStyling, SCI_UNUSED); + } + + int GetIdleStyling() const { + sptr_t res = Call(SCI_GETIDLESTYLING, SCI_UNUSED, SCI_UNUSED); + return static_cast(res); + } + + void SetWrapMode(int wrapMode) const { + Call(SCI_SETWRAPMODE, wrapMode, SCI_UNUSED); } int GetWrapMode() const { @@ -1551,8 +1615,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetWrapIndentMode(int mode) const { - Call(SCI_SETWRAPINDENTMODE, mode, SCI_UNUSED); + void SetWrapIndentMode(int wrapIndentMode) const { + Call(SCI_SETWRAPINDENTMODE, wrapIndentMode, SCI_UNUSED); } int GetWrapIndentMode() const { @@ -1560,8 +1624,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetLayoutCache(int mode) const { - Call(SCI_SETLAYOUTCACHE, mode, SCI_UNUSED); + void SetLayoutCache(int cacheMode) const { + Call(SCI_SETLAYOUTCACHE, cacheMode, SCI_UNUSED); } int GetLayoutCache() const { @@ -1611,8 +1675,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetVScrollBar(bool show) const { - Call(SCI_SETVSCROLLBAR, show, SCI_UNUSED); + void SetVScrollBar(bool visible) const { + Call(SCI_SETVSCROLLBAR, visible, SCI_UNUSED); } bool GetVScrollBar() const { @@ -1628,15 +1692,6 @@ class ScintillaGateway final { Call(SCI_APPENDTEXT, text.length(), text.c_str()); } - bool GetTwoPhaseDraw() const { - sptr_t res = Call(SCI_GETTWOPHASEDRAW, SCI_UNUSED, SCI_UNUSED); - return res != 0; - } - - void SetTwoPhaseDraw(bool twoPhase) const { - Call(SCI_SETTWOPHASEDRAW, twoPhase, SCI_UNUSED); - } - int GetPhasesDraw() const { sptr_t res = Call(SCI_GETPHASESDRAW, SCI_UNUSED, SCI_UNUSED); return static_cast(res); @@ -1655,8 +1710,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetFirstVisibleLine(int lineDisplay) const { - Call(SCI_SETFIRSTVISIBLELINE, lineDisplay, SCI_UNUSED); + void SetFirstVisibleLine(int displayLine) const { + Call(SCI_SETFIRSTVISIBLELINE, displayLine, SCI_UNUSED); } void SetMultiPaste(int multiPaste) const { @@ -1681,10 +1736,6 @@ class ScintillaGateway final { return tagValue; } - void TargetFromSelection() const { - Call(SCI_TARGETFROMSELECTION, SCI_UNUSED, SCI_UNUSED); - } - void LinesJoin() const { Call(SCI_LINESJOIN, SCI_UNUSED, SCI_UNUSED); } @@ -1701,6 +1752,15 @@ class ScintillaGateway final { Call(SCI_SETFOLDMARGINHICOLOUR, useSetting, fore); } + void SetAccessibility(int accessibility) const { + Call(SCI_SETACCESSIBILITY, accessibility, SCI_UNUSED); + } + + int GetAccessibility() const { + sptr_t res = Call(SCI_GETACCESSIBILITY, SCI_UNUSED, SCI_UNUSED); + return static_cast(res); + } + void LineDown() const { Call(SCI_LINEDOWN, SCI_UNUSED, SCI_UNUSED); } @@ -1865,6 +1925,10 @@ class ScintillaGateway final { Call(SCI_LINETRANSPOSE, SCI_UNUSED, SCI_UNUSED); } + void LineReverse() const { + Call(SCI_LINEREVERSE, SCI_UNUSED, SCI_UNUSED); + } + void LineDuplicate() const { Call(SCI_LINEDUPLICATE, SCI_UNUSED, SCI_UNUSED); } @@ -1942,24 +2006,24 @@ class ScintillaGateway final { return static_cast(res); } - void BraceHighlight(int pos1, int pos2) const { - Call(SCI_BRACEHIGHLIGHT, pos1, pos2); + void BraceHighlight(int posA, int posB) const { + Call(SCI_BRACEHIGHLIGHT, posA, posB); } - void BraceHighlightIndicator(bool useBraceHighlightIndicator, int indicator) const { - Call(SCI_BRACEHIGHLIGHTINDICATOR, useBraceHighlightIndicator, indicator); + void BraceHighlightIndicator(bool useSetting, int indicator) const { + Call(SCI_BRACEHIGHLIGHTINDICATOR, useSetting, indicator); } void BraceBadLight(int pos) const { Call(SCI_BRACEBADLIGHT, pos, SCI_UNUSED); } - void BraceBadLightIndicator(bool useBraceBadLightIndicator, int indicator) const { - Call(SCI_BRACEBADLIGHTINDICATOR, useBraceBadLightIndicator, indicator); + void BraceBadLightIndicator(bool useSetting, int indicator) const { + Call(SCI_BRACEBADLIGHTINDICATOR, useSetting, indicator); } - int BraceMatch(int pos) const { - sptr_t res = Call(SCI_BRACEMATCH, pos, SCI_UNUSED); + int BraceMatch(int pos, int maxReStyle) const { + sptr_t res = Call(SCI_BRACEMATCH, pos, maxReStyle); return static_cast(res); } @@ -1973,16 +2037,15 @@ class ScintillaGateway final { } sptr_t GetDocPointer() const { - sptr_t res = Call(SCI_GETDOCPOINTER, SCI_UNUSED, SCI_UNUSED); - return res; + return Call(SCI_GETDOCPOINTER, SCI_UNUSED, SCI_UNUSED); } - void SetDocPointer(sptr_t pointer) const { - Call(SCI_SETDOCPOINTER, SCI_UNUSED, pointer); + void SetDocPointer(sptr_t doc) const { + Call(SCI_SETDOCPOINTER, SCI_UNUSED, doc); } - void SetModEventMask(int mask) const { - Call(SCI_SETMODEVENTMASK, mask, SCI_UNUSED); + void SetModEventMask(int eventMask) const { + Call(SCI_SETMODEVENTMASK, eventMask, SCI_UNUSED); } int GetEdgeColumn() const { @@ -1999,8 +2062,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetEdgeMode(int mode) const { - Call(SCI_SETEDGEMODE, mode, SCI_UNUSED); + void SetEdgeMode(int edgeMode) const { + Call(SCI_SETEDGEMODE, edgeMode, SCI_UNUSED); } Colour GetEdgeColour() const { @@ -2012,27 +2075,35 @@ class ScintillaGateway final { Call(SCI_SETEDGECOLOUR, edgeColour, SCI_UNUSED); } + void MultiEdgeAddLine(int column, Colour edgeColour) const { + Call(SCI_MULTIEDGEADDLINE, column, edgeColour); + } + + void MultiEdgeClearAll() const { + Call(SCI_MULTIEDGECLEARALL, SCI_UNUSED, SCI_UNUSED); + } + void SearchAnchor() const { Call(SCI_SEARCHANCHOR, SCI_UNUSED, SCI_UNUSED); } - int SearchNext(int flags, const char* text) const { - sptr_t res = Call(SCI_SEARCHNEXT, flags, text); + int SearchNext(int searchFlags, const char* text) const { + sptr_t res = Call(SCI_SEARCHNEXT, searchFlags, text); return static_cast(res); } - int SearchNext(int flags, const std::string& text) const { - sptr_t res = Call(SCI_SEARCHNEXT, flags, text.c_str()); + int SearchNext(int searchFlags, const std::string& text) const { + sptr_t res = Call(SCI_SEARCHNEXT, searchFlags, text.c_str()); return static_cast(res); } - int SearchPrev(int flags, const char* text) const { - sptr_t res = Call(SCI_SEARCHPREV, flags, text); + int SearchPrev(int searchFlags, const char* text) const { + sptr_t res = Call(SCI_SEARCHPREV, searchFlags, text); return static_cast(res); } - int SearchPrev(int flags, const std::string& text) const { - sptr_t res = Call(SCI_SEARCHPREV, flags, text.c_str()); + int SearchPrev(int searchFlags, const std::string& text) const { + sptr_t res = Call(SCI_SEARCHPREV, searchFlags, text.c_str()); return static_cast(res); } @@ -2041,8 +2112,8 @@ class ScintillaGateway final { return static_cast(res); } - void UsePopUp(bool allowPopUp) const { - Call(SCI_USEPOPUP, allowPopUp, SCI_UNUSED); + void UsePopUp(int popUpMode) const { + Call(SCI_USEPOPUP, popUpMode, SCI_UNUSED); } bool SelectionIsRectangle() const { @@ -2050,8 +2121,8 @@ class ScintillaGateway final { return res != 0; } - void SetZoom(int zoom) const { - Call(SCI_SETZOOM, zoom, SCI_UNUSED); + void SetZoom(int zoomInPoints) const { + Call(SCI_SETZOOM, zoomInPoints, SCI_UNUSED); } int GetZoom() const { @@ -2059,9 +2130,8 @@ class ScintillaGateway final { return static_cast(res); } - sptr_t CreateDocument() const { - sptr_t res = Call(SCI_CREATEDOCUMENT, SCI_UNUSED, SCI_UNUSED); - return res; + sptr_t CreateDocument(int bytes, int documentOptions) const { + return Call(SCI_CREATEDOCUMENT, bytes, documentOptions); } void AddRefDocument(sptr_t doc) const { @@ -2072,11 +2142,25 @@ class ScintillaGateway final { Call(SCI_RELEASEDOCUMENT, SCI_UNUSED, doc); } + int GetDocumentOptions() const { + sptr_t res = Call(SCI_GETDOCUMENTOPTIONS, SCI_UNUSED, SCI_UNUSED); + return static_cast(res); + } + int GetModEventMask() const { sptr_t res = Call(SCI_GETMODEVENTMASK, SCI_UNUSED, SCI_UNUSED); return static_cast(res); } + void SetCommandEvents(bool commandEvents) const { + Call(SCI_SETCOMMANDEVENTS, commandEvents, SCI_UNUSED); + } + + bool GetCommandEvents() const { + sptr_t res = Call(SCI_GETCOMMANDEVENTS, SCI_UNUSED, SCI_UNUSED); + return res != 0; + } + void SetFocus(bool focus) const { Call(SCI_SETFOCUS, focus, SCI_UNUSED); } @@ -2086,8 +2170,8 @@ class ScintillaGateway final { return res != 0; } - void SetStatus(int statusCode) const { - Call(SCI_SETSTATUS, statusCode, SCI_UNUSED); + void SetStatus(int status) const { + Call(SCI_SETSTATUS, status, SCI_UNUSED); } int GetStatus() const { @@ -2104,6 +2188,15 @@ class ScintillaGateway final { return res != 0; } + void SetMouseWheelCaptures(bool captures) const { + Call(SCI_SETMOUSEWHEELCAPTURES, captures, SCI_UNUSED); + } + + bool GetMouseWheelCaptures() const { + sptr_t res = Call(SCI_GETMOUSEWHEELCAPTURES, SCI_UNUSED, SCI_UNUSED); + return res != 0; + } + void SetCursor(int cursorType) const { Call(SCI_SETCURSOR, cursorType, SCI_UNUSED); } @@ -2150,8 +2243,8 @@ class ScintillaGateway final { Call(SCI_DELLINERIGHT, SCI_UNUSED, SCI_UNUSED); } - void SetXOffset(int newOffset) const { - Call(SCI_SETXOFFSET, newOffset, SCI_UNUSED); + void SetXOffset(int xOffset) const { + Call(SCI_SETXOFFSET, xOffset, SCI_UNUSED); } int GetXOffset() const { @@ -2175,8 +2268,8 @@ class ScintillaGateway final { Call(SCI_SETYCARETPOLICY, caretPolicy, caretSlop); } - void SetPrintWrapMode(int mode) const { - Call(SCI_SETPRINTWRAPMODE, mode, SCI_UNUSED); + void SetPrintWrapMode(int wrapMode) const { + Call(SCI_SETPRINTWRAPMODE, wrapMode, SCI_UNUSED); } int GetPrintWrapMode() const { @@ -2251,6 +2344,11 @@ class ScintillaGateway final { return static_cast(res); } + int PositionRelativeCodeUnits(int pos, int relative) const { + sptr_t res = Call(SCI_POSITIONRELATIVECODEUNITS, pos, relative); + return static_cast(res); + } + void CopyRange(int start, int end) const { Call(SCI_COPYRANGE, start, end); } @@ -2263,8 +2361,8 @@ class ScintillaGateway final { Call(SCI_COPYTEXT, text.length(), text.c_str()); } - void SetSelectionMode(int mode) const { - Call(SCI_SETSELECTIONMODE, mode, SCI_UNUSED); + void SetSelectionMode(int selectionMode) const { + Call(SCI_SETSELECTIONMODE, selectionMode, SCI_UNUSED); } int GetSelectionMode() const { @@ -2272,6 +2370,11 @@ class ScintillaGateway final { return static_cast(res); } + bool GetMoveExtendsSelection() const { + sptr_t res = Call(SCI_GETMOVEEXTENDSSELECTION, SCI_UNUSED, SCI_UNUSED); + return res != 0; + } + int GetLineSelStartPosition(int line) const { sptr_t res = Call(SCI_GETLINESELSTARTPOSITION, line, SCI_UNUSED); return static_cast(res); @@ -2401,17 +2504,17 @@ class ScintillaGateway final { return static_cast(res); } - int AutoCGetCurrentText(char* s) const { - sptr_t res = Call(SCI_AUTOCGETCURRENTTEXT, SCI_UNUSED, s); + int AutoCGetCurrentText(char* text) const { + sptr_t res = Call(SCI_AUTOCGETCURRENTTEXT, SCI_UNUSED, text); return static_cast(res); } std::string AutoCGetCurrentText() const { auto size = Call(SCI_AUTOCGETCURRENTTEXT, SCI_UNUSED, NULL); - std::string s(size + 1, '\0'); - Call(SCI_AUTOCGETCURRENTTEXT, SCI_UNUSED, &s[0]); - trim(s); - return s; + std::string text(size + 1, '\0'); + Call(SCI_AUTOCGETCURRENTTEXT, SCI_UNUSED, &text[0]); + trim(text); + return text; } void AutoCSetCaseInsensitiveBehaviour(int behaviour) const { @@ -2542,31 +2645,31 @@ class ScintillaGateway final { return static_cast(res); } - void IndicatorFillRange(int position, int fillLength) const { - Call(SCI_INDICATORFILLRANGE, position, fillLength); + void IndicatorFillRange(int start, int lengthFill) const { + Call(SCI_INDICATORFILLRANGE, start, lengthFill); } - void IndicatorClearRange(int position, int clearLength) const { - Call(SCI_INDICATORCLEARRANGE, position, clearLength); + void IndicatorClearRange(int start, int lengthClear) const { + Call(SCI_INDICATORCLEARRANGE, start, lengthClear); } - int IndicatorAllOnFor(int position) const { - sptr_t res = Call(SCI_INDICATORALLONFOR, position, SCI_UNUSED); + int IndicatorAllOnFor(int pos) const { + sptr_t res = Call(SCI_INDICATORALLONFOR, pos, SCI_UNUSED); return static_cast(res); } - int IndicatorValueAt(int indicator, int position) const { - sptr_t res = Call(SCI_INDICATORVALUEAT, indicator, position); + int IndicatorValueAt(int indicator, int pos) const { + sptr_t res = Call(SCI_INDICATORVALUEAT, indicator, pos); return static_cast(res); } - int IndicatorStart(int indicator, int position) const { - sptr_t res = Call(SCI_INDICATORSTART, indicator, position); + int IndicatorStart(int indicator, int pos) const { + sptr_t res = Call(SCI_INDICATORSTART, indicator, pos); return static_cast(res); } - int IndicatorEnd(int indicator, int position) const { - sptr_t res = Call(SCI_INDICATOREND, indicator, position); + int IndicatorEnd(int indicator, int pos) const { + sptr_t res = Call(SCI_INDICATOREND, indicator, pos); return static_cast(res); } @@ -2588,8 +2691,8 @@ class ScintillaGateway final { return reinterpret_cast(res); } - const char* GetRangePointer(int position, int rangeLength) const { - sptr_t res = Call(SCI_GETRANGEPOINTER, position, rangeLength); + const char* GetRangePointer(int start, int lengthRange) const { + sptr_t res = Call(SCI_GETRANGEPOINTER, start, lengthRange); return reinterpret_cast(res); } @@ -2849,8 +2952,8 @@ class ScintillaGateway final { return res != 0; } - void SetAdditionalCaretsVisible(bool additionalCaretsBlink) const { - Call(SCI_SETADDITIONALCARETSVISIBLE, additionalCaretsBlink, SCI_UNUSED); + void SetAdditionalCaretsVisible(bool additionalCaretsVisible) const { + Call(SCI_SETADDITIONALCARETSVISIBLE, additionalCaretsVisible, SCI_UNUSED); } bool GetAdditionalCaretsVisible() const { @@ -2872,14 +2975,12 @@ class ScintillaGateway final { Call(SCI_CLEARSELECTIONS, SCI_UNUSED, SCI_UNUSED); } - int SetSelection(int caret, int anchor) const { - sptr_t res = Call(SCI_SETSELECTION, caret, anchor); - return static_cast(res); + void SetSelection(int caret, int anchor) const { + Call(SCI_SETSELECTION, caret, anchor); } - int AddSelection(int caret, int anchor) const { - sptr_t res = Call(SCI_ADDSELECTION, caret, anchor); - return static_cast(res); + void AddSelection(int caret, int anchor) const { + Call(SCI_ADDSELECTION, caret, anchor); } void DropSelectionN(int selection) const { @@ -2895,8 +2996,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetSelectionNCaret(int selection, int pos) const { - Call(SCI_SETSELECTIONNCARET, selection, pos); + void SetSelectionNCaret(int selection, int caret) const { + Call(SCI_SETSELECTIONNCARET, selection, caret); } int GetSelectionNCaret(int selection) const { @@ -2904,8 +3005,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetSelectionNAnchor(int selection, int posAnchor) const { - Call(SCI_SETSELECTIONNANCHOR, selection, posAnchor); + void SetSelectionNAnchor(int selection, int anchor) const { + Call(SCI_SETSELECTIONNANCHOR, selection, anchor); } int GetSelectionNAnchor(int selection) const { @@ -2931,8 +3032,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetSelectionNStart(int selection, int pos) const { - Call(SCI_SETSELECTIONNSTART, selection, pos); + void SetSelectionNStart(int selection, int anchor) const { + Call(SCI_SETSELECTIONNSTART, selection, anchor); } int GetSelectionNStart(int selection) const { @@ -2940,8 +3041,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetSelectionNEnd(int selection, int pos) const { - Call(SCI_SETSELECTIONNEND, selection, pos); + void SetSelectionNEnd(int selection, int caret) const { + Call(SCI_SETSELECTIONNEND, selection, caret); } int GetSelectionNEnd(int selection) const { @@ -2949,8 +3050,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetRectangularSelectionCaret(int pos) const { - Call(SCI_SETRECTANGULARSELECTIONCARET, pos, SCI_UNUSED); + void SetRectangularSelectionCaret(int caret) const { + Call(SCI_SETRECTANGULARSELECTIONCARET, caret, SCI_UNUSED); } int GetRectangularSelectionCaret() const { @@ -2958,8 +3059,8 @@ class ScintillaGateway final { return static_cast(res); } - void SetRectangularSelectionAnchor(int posAnchor) const { - Call(SCI_SETRECTANGULARSELECTIONANCHOR, posAnchor, SCI_UNUSED); + void SetRectangularSelectionAnchor(int anchor) const { + Call(SCI_SETRECTANGULARSELECTIONANCHOR, anchor, SCI_UNUSED); } int GetRectangularSelectionAnchor() const { @@ -3037,6 +3138,14 @@ class ScintillaGateway final { Call(SCI_SWAPMAINANCHORCARET, SCI_UNUSED, SCI_UNUSED); } + void MultipleSelectAddNext() const { + Call(SCI_MULTIPLESELECTADDNEXT, SCI_UNUSED, SCI_UNUSED); + } + + void MultipleSelectAddEach() const { + Call(SCI_MULTIPLESELECTADDEACH, SCI_UNUSED, SCI_UNUSED); + } + int ChangeLexerState(int start, int end) const { sptr_t res = Call(SCI_CHANGELEXERSTATE, start, end); return static_cast(res); @@ -3113,8 +3222,8 @@ class ScintillaGateway final { return static_cast(res); } - int CreateLoader(int bytes) const { - sptr_t res = Call(SCI_CREATELOADER, bytes, SCI_UNUSED); + int CreateLoader(int bytes, int documentOptions) const { + sptr_t res = Call(SCI_CREATELOADER, bytes, documentOptions); return static_cast(res); } @@ -3219,12 +3328,12 @@ class ScintillaGateway final { Call(SCI_SETPROPERTY, key.c_str(), value.c_str()); } - void SetKeyWords(int keywordSet, const char* keyWords) const { - Call(SCI_SETKEYWORDS, keywordSet, keyWords); + void SetKeyWords(int keyWordSet, const char* keyWords) const { + Call(SCI_SETKEYWORDS, keyWordSet, keyWords); } - void SetKeyWords(int keywordSet, const std::string& keyWords) const { - Call(SCI_SETKEYWORDS, keywordSet, keyWords.c_str()); + void SetKeyWords(int keyWordSet, const std::string& keyWords) const { + Call(SCI_SETKEYWORDS, keyWordSet, keyWords.c_str()); } void SetLexerLanguage(const char* language) const { @@ -3243,58 +3352,53 @@ class ScintillaGateway final { Call(SCI_LOADLEXERLIBRARY, SCI_UNUSED, path.c_str()); } - int GetProperty(const char* key, char* buf) const { - sptr_t res = Call(SCI_GETPROPERTY, key, buf); + int GetProperty(const char* key, char* value) const { + sptr_t res = Call(SCI_GETPROPERTY, key, value); return static_cast(res); } std::string GetProperty(const std::string& key) const { auto size = Call(SCI_GETPROPERTY, key.c_str(), NULL); - std::string buf(size + 1, '\0'); - Call(SCI_GETPROPERTY, key.c_str(), &buf[0]); - trim(buf); - return buf; + std::string value(size + 1, '\0'); + Call(SCI_GETPROPERTY, key.c_str(), &value[0]); + trim(value); + return value; } - int GetPropertyExpanded(const char* key, char* buf) const { - sptr_t res = Call(SCI_GETPROPERTYEXPANDED, key, buf); + int GetPropertyExpanded(const char* key, char* value) const { + sptr_t res = Call(SCI_GETPROPERTYEXPANDED, key, value); return static_cast(res); } std::string GetPropertyExpanded(const std::string& key) const { auto size = Call(SCI_GETPROPERTYEXPANDED, key.c_str(), NULL); - std::string buf(size + 1, '\0'); - Call(SCI_GETPROPERTYEXPANDED, key.c_str(), &buf[0]); - trim(buf); - return buf; + std::string value(size + 1, '\0'); + Call(SCI_GETPROPERTYEXPANDED, key.c_str(), &value[0]); + trim(value); + return value; } - int GetPropertyInt(const char* key) const { - sptr_t res = Call(SCI_GETPROPERTYINT, key, SCI_UNUSED); + int GetPropertyInt(const char* key, int defaultValue) const { + sptr_t res = Call(SCI_GETPROPERTYINT, key, defaultValue); return static_cast(res); } - int GetPropertyInt(const std::string& key) const { - sptr_t res = Call(SCI_GETPROPERTYINT, key.c_str(), SCI_UNUSED); + int GetPropertyInt(const std::string& key, int defaultValue) const { + sptr_t res = Call(SCI_GETPROPERTYINT, key.c_str(), defaultValue); return static_cast(res); } - int GetStyleBitsNeeded() const { - sptr_t res = Call(SCI_GETSTYLEBITSNEEDED, SCI_UNUSED, SCI_UNUSED); - return static_cast(res); - } - - int GetLexerLanguage(char* text) const { - sptr_t res = Call(SCI_GETLEXERLANGUAGE, SCI_UNUSED, text); + int GetLexerLanguage(char* language) const { + sptr_t res = Call(SCI_GETLEXERLANGUAGE, SCI_UNUSED, language); return static_cast(res); } std::string GetLexerLanguage() const { auto size = Call(SCI_GETLEXERLANGUAGE, SCI_UNUSED, NULL); - std::string text(size + 1, '\0'); - Call(SCI_GETLEXERLANGUAGE, SCI_UNUSED, &text[0]); - trim(text); - return text; + std::string language(size + 1, '\0'); + Call(SCI_GETLEXERLANGUAGE, SCI_UNUSED, &language[0]); + trim(language); + return language; } int PrivateLexerCall(int operation, sptr_t pointer) const { @@ -3411,5 +3515,81 @@ class ScintillaGateway final { return styles; } + int GetNamedStyles() const { + sptr_t res = Call(SCI_GETNAMEDSTYLES, SCI_UNUSED, SCI_UNUSED); + return static_cast(res); + } + + int NameOfStyle(int style, char* name) const { + sptr_t res = Call(SCI_NAMEOFSTYLE, style, name); + return static_cast(res); + } + + std::string NameOfStyle(int style) const { + auto size = Call(SCI_NAMEOFSTYLE, style, NULL); + std::string name(size + 1, '\0'); + Call(SCI_NAMEOFSTYLE, style, &name[0]); + trim(name); + return name; + } + + int TagsOfStyle(int style, char* tags) const { + sptr_t res = Call(SCI_TAGSOFSTYLE, style, tags); + return static_cast(res); + } + + std::string TagsOfStyle(int style) const { + auto size = Call(SCI_TAGSOFSTYLE, style, NULL); + std::string tags(size + 1, '\0'); + Call(SCI_TAGSOFSTYLE, style, &tags[0]); + trim(tags); + return tags; + } + + int DescriptionOfStyle(int style, char* description) const { + sptr_t res = Call(SCI_DESCRIPTIONOFSTYLE, style, description); + return static_cast(res); + } + + std::string DescriptionOfStyle(int style) const { + auto size = Call(SCI_DESCRIPTIONOFSTYLE, style, NULL); + std::string description(size + 1, '\0'); + Call(SCI_DESCRIPTIONOFSTYLE, style, &description[0]); + trim(description); + return description; + } + + int GetBidirectional() const { + sptr_t res = Call(SCI_GETBIDIRECTIONAL, SCI_UNUSED, SCI_UNUSED); + return static_cast(res); + } + + void SetBidirectional(int bidirectional) const { + Call(SCI_SETBIDIRECTIONAL, bidirectional, SCI_UNUSED); + } + + int GetLineCharacterIndex() const { + sptr_t res = Call(SCI_GETLINECHARACTERINDEX, SCI_UNUSED, SCI_UNUSED); + return static_cast(res); + } + + void AllocateLineCharacterIndex(int lineCharacterIndex) const { + Call(SCI_ALLOCATELINECHARACTERINDEX, lineCharacterIndex, SCI_UNUSED); + } + + void ReleaseLineCharacterIndex(int lineCharacterIndex) const { + Call(SCI_RELEASELINECHARACTERINDEX, lineCharacterIndex, SCI_UNUSED); + } + + int LineFromIndexPosition(int pos, int lineCharacterIndex) const { + sptr_t res = Call(SCI_LINEFROMINDEXPOSITION, pos, lineCharacterIndex); + return static_cast(res); + } + + int IndexPositionFromLine(int line, int lineCharacterIndex) const { + sptr_t res = Call(SCI_INDEXPOSITIONFROMLINE, line, lineCharacterIndex); + return static_cast(res); + } + /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ }; diff --git a/src/SurroundSelection.vcxproj b/src/SurroundSelection.vcxproj index e0b61cd..a2336c1 100644 --- a/src/SurroundSelection.vcxproj +++ b/src/SurroundSelection.vcxproj @@ -27,23 +27,23 @@ DynamicLibrary Unicode - v140_xp + v141 DynamicLibrary Unicode - v140_xp + v141 DynamicLibrary Unicode - v140_xp + v141 true DynamicLibrary Unicode - v140_xp + v141 true @@ -224,7 +224,7 @@ - + diff --git a/src/SurroundSelection.vcxproj.filters b/src/SurroundSelection.vcxproj.filters index bf7dd75..3155139 100644 --- a/src/SurroundSelection.vcxproj.filters +++ b/src/SurroundSelection.vcxproj.filters @@ -50,7 +50,7 @@ Header Files - + Header Files diff --git a/src/Version.h b/src/Version.h index fa16001..ee157b2 100644 --- a/src/Version.h +++ b/src/Version.h @@ -16,8 +16,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#define VERSION_NUM 1,3,0,0 -#define VERSION_LINEAR 1300 -#define VERSION_LINEAR_TEXT TEXT("1300") -#define VERSION_TEXT TEXT("1.3") // This must match the tag pushed on the server minus the "v" +#define VERSION_NUM 1,3,1,0 +#define VERSION_LINEAR 1310 +#define VERSION_LINEAR_TEXT TEXT("1310") +#define VERSION_TEXT TEXT("1.3.1") // This must match the tag pushed on the server minus the "v" #define VERSION_STAGE TEXT("") // "alpha", "beta", ""