diff --git a/NppPlugin/include/Common.h b/NppPlugin/include/Common.h index ec2604dc..7f130bdf 100644 --- a/NppPlugin/include/Common.h +++ b/NppPlugin/include/Common.h @@ -1,138 +1,194 @@ -//this file is part of notepad++ -//Copyright (C)2003 Don HO ( donho@altern.org ) +// This file is part of Notepad++ project +// Copyright (C)2003 Don HO // -//This program 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 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. +// Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. // -//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. - -#ifndef M30_IDE_COMMUN_H -#define M30_IDE_COMMUN_H - -#include -#include +// 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. +#pragma once #include -#include -#include - -#ifdef UNICODE -#include -#endif - -#define CP_ANSI_LATIN_1 1252 -#define CP_BIG5 950 - -#ifdef UNICODE - #define NppMainEntry wWinMain - #define generic_strtol wcstol - #define generic_strncpy wcsncpy - #define generic_stricmp wcsicmp - #define generic_strncmp wcsncmp - #define generic_strnicmp wcsnicmp - #define generic_strncat wcsncat - #define generic_strchr wcschr - #define generic_atoi _wtoi - #define generic_itoa _itow - #define generic_atof _wtof - #define generic_strtok wcstok - #define generic_strftime wcsftime - #define generic_fprintf fwprintf - #define generic_sscanf swscanf - #define generic_fopen _wfopen - #define generic_fgets fgetws - #define generic_stat _wstat - #define generic_string wstring - #define COPYDATA_FILENAMES COPYDATA_FILENAMESW -#else - #define NppMainEntry WinMain - #define generic_strtol strtol - #define generic_strncpy strncpy - #define generic_stricmp stricmp - #define generic_strncmp strncmp - #define generic_strnicmp strnicmp - #define generic_strncat strncat - #define generic_strchr strchr - #define generic_atoi atoi - #define generic_itoa itoa - #define generic_atof atof - #define generic_strtok strtok - #define generic_strftime strftime - #define generic_fprintf fprintf - #define generic_sscanf sscanf - #define generic_fopen fopen - #define generic_fgets fgets - #define generic_stat _stat - #define generic_string string - #define COPYDATA_FILENAMES COPYDATA_FILENAMESA -#endif - -void folderBrowser(HWND parent, int outputCtrlID, const TCHAR *defaultStr = NULL); - -// Set a call back with the handle after init to set the path. -// http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/callbackfunctions/browsecallbackproc.asp -static int __stdcall BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM, LPARAM pData) -{ - if (uMsg == BFFM_INITIALIZED) - ::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, pData); - return 0; -}; +#include +#include +#include +#include +#include + + +const bool dirUp = true; +const bool dirDown = false; + +#define NPP_CP_WIN_1252 1252 +#define NPP_CP_DOS_437 437 +#define NPP_CP_BIG5 950 + +#define LINKTRIGGERED WM_USER+555 + +#define BCKGRD_COLOR (RGB(255,102,102)) +#define TXT_COLOR (RGB(255,255,255)) + +#define generic_strtol wcstol +#define generic_strncpy wcsncpy +#define generic_stricmp wcsicmp +#define generic_strncmp wcsncmp +#define generic_strnicmp wcsnicmp +#define generic_strncat wcsncat +#define generic_strchr wcschr +#define generic_atoi _wtoi +#define generic_itoa _itow +#define generic_atof _wtof +#define generic_strtok wcstok +#define generic_strftime wcsftime +#define generic_fprintf fwprintf +#define generic_sprintf swprintf +#define generic_sscanf swscanf +#define generic_fopen _wfopen +#define generic_fgets fgetws +#define generic_stat _wstat +#define COPYDATA_FILENAMES COPYDATA_FILENAMESW + +typedef std::basic_string generic_string; +typedef std::basic_stringstream generic_stringstream; + +generic_string folderBrowser(HWND parent, const generic_string & title = TEXT(""), int outputCtrlID = 0, const TCHAR *defaultStr = NULL); +generic_string getFolderName(HWND parent, const TCHAR *defaultDir = NULL); -void systemMessage(const TCHAR *title); -//DWORD ShortToLongPathName(LPCTSTR lpszShortPath, LPTSTR lpszLongPath, DWORD cchBuffer); void printInt(int int2print); void printStr(const TCHAR *str2print); +generic_string commafyInt(size_t n); void writeLog(const TCHAR *logFileName, const char *log2write); int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep); -int getCpFromStringValue(const char * encodingStr); -std::generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand = false); -std::vector tokenizeString(const std::generic_string & tokenString, const char delim); +generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand = false); +std::vector tokenizeString(const generic_string & tokenString, const char delim); void ClientRectToScreenRect(HWND hWnd, RECT* rect); void ScreenRectToClientRect(HWND hWnd, RECT* rect); std::wstring string2wstring(const std::string & rString, UINT codepage); std::string wstring2string(const std::wstring & rwString, UINT codepage); +bool isInList(const TCHAR *token, const TCHAR *list); +generic_string BuildMenuFileName(int filenameLen, unsigned int pos, const generic_string &filename); -TCHAR *BuildMenuFileName(TCHAR *buffer, int len, int pos, const TCHAR *filename); +std::string getFileContent(const TCHAR *file2read); +generic_string relativeFilePathToFullFilePath(const TCHAR *relativeFilePath); +void writeFileContent(const TCHAR *file2write, const char *content2write); +bool matchInList(const TCHAR *fileName, const std::vector & patterns); -class WcharMbcsConvertor { +class WcharMbcsConvertor final +{ public: - static WcharMbcsConvertor * getInstance() {return _pSelf;}; - static void destroyInstance() {delete _pSelf;}; + static WcharMbcsConvertor * getInstance() {return _pSelf;} + static void destroyInstance() {delete _pSelf;} + + const wchar_t * char2wchar(const char *mbStr, UINT codepage, int lenIn=-1, int *pLenOut=NULL, int *pBytesNotProcessed=NULL); + const wchar_t * char2wchar(const char *mbcs2Convert, UINT codepage, int *mstart, int *mend); + const char * wchar2char(const wchar_t *wcStr, UINT codepage, int lenIn = -1, int *pLenOut = NULL); + const char * wchar2char(const wchar_t *wcStr, UINT codepage, long *mstart, long *mend); - const wchar_t * char2wchar(const char* mbStr, UINT codepage); - const wchar_t * char2wchar(const char * mbcs2Convert, UINT codepage, int *mstart, int *mend); - const char * wchar2char(const wchar_t* wcStr, UINT codepage); - const char * wchar2char(const wchar_t * wcStr, UINT codepage, long *mstart, long *mend); + const char * encode(UINT fromCodepage, UINT toCodepage, const char *txt2Encode, int lenIn=-1, int *pLenOut=NULL, int *pBytesNotProcessed=NULL) + { + int lenWc = 0; + const wchar_t * strW = char2wchar(txt2Encode, fromCodepage, lenIn, &lenWc, pBytesNotProcessed); + return wchar2char(strW, toCodepage, lenWc, pLenOut); + } protected: - WcharMbcsConvertor() : _multiByteStr(NULL), _wideCharStr(NULL), _multiByteAllocLen(0), _wideCharAllocLen(0), initSize(1024) { + WcharMbcsConvertor() {} + ~WcharMbcsConvertor() {} + + // Since there's no public ctor, we need to void the default assignment operator and copy ctor. + // Since these are marked as deleted does not matter under which access specifier are kept + WcharMbcsConvertor(const WcharMbcsConvertor&) = delete; + WcharMbcsConvertor& operator= (const WcharMbcsConvertor&) = delete; + + static WcharMbcsConvertor* _pSelf; + + template + class StringBuffer final + { + public: + ~StringBuffer() { if(_allocLen) delete[] _str; } + + void sizeTo(size_t size) + { + if (_allocLen < size) + { + if (_allocLen) + delete[] _str; + _allocLen = max(size, initSize); + _str = new T[_allocLen]; + } + } + + void empty() + { + static T nullStr = 0; // routines may return an empty string, with null terminator, without allocating memory; a pointer to this null character will be returned in that case + if (_allocLen == 0) + _str = &nullStr; + else + _str[0] = 0; + } + + operator T* () { return _str; } + operator const T* () const { return _str; } + + protected: + static const int initSize = 1024; + size_t _allocLen = 0; + T* _str = nullptr; }; - ~WcharMbcsConvertor() { - if (_multiByteStr) - delete [] _multiByteStr; - if (_wideCharStr) - delete [] _wideCharStr; - }; - static WcharMbcsConvertor * _pSelf; - - const int initSize; - char *_multiByteStr; - size_t _multiByteAllocLen; - wchar_t *_wideCharStr; - size_t _wideCharAllocLen; - + + StringBuffer _multiByteStr; + StringBuffer _wideCharStr; }; -#endif //M30_IDE_COMMUN_H + +#define MACRO_RECORDING_IN_PROGRESS 1 +#define MACRO_RECORDING_HAS_STOPPED 2 + +#define REBARBAND_SIZE sizeof(REBARBANDINFO) + +generic_string PathRemoveFileSpec(generic_string & path); +generic_string PathAppend(generic_string &strDest, const generic_string & str2append); +COLORREF getCtrlBgColor(HWND hWnd); +generic_string stringToUpper(generic_string strToConvert); +generic_string stringToLower(generic_string strToConvert); +generic_string stringReplace(generic_string subject, const generic_string& search, const generic_string& replace); +std::vector stringSplit(const generic_string& input, const generic_string& delimiter); +generic_string stringJoin(const std::vector& strings, const generic_string& separator); +generic_string stringTakeWhileAdmissable(const generic_string& input, const generic_string& admissable); +double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL); + +int OrdinalIgnoreCaseCompareStrings(LPCTSTR sz1, LPCTSTR sz2); + +bool str2Clipboard(const generic_string &str2cpy, HWND hwnd); + +generic_string GetLastErrorAsString(DWORD errorCode = 0); + +generic_string intToString(int val); +generic_string uintToString(unsigned int val); + +HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText); + +bool isCertificateValidated(const generic_string & fullFilePath, const generic_string & subjectName2check); +bool isAssoCommandExisting(LPCTSTR FullPathName); diff --git a/NppPlugin/include/Docking.h b/NppPlugin/include/Docking.h index 7af615d4..f4b2af49 100644 --- a/NppPlugin/include/Docking.h +++ b/NppPlugin/include/Docking.h @@ -1,24 +1,34 @@ -/* -this file is part of Function List Plugin for Notepad++ -Copyright (C)2005 Jens Lorenz - -This program 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. -*/ - -#ifndef DOCKING_H -#define DOCKING_H +// this file is part of Notepad++ +// Copyright (C)2005 Jens Lorenz +// +// This program 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. +// +// // Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. +// +// 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. + + +#pragma once + +#include // ATTENTION : It's a part of interface header, so don't include the others header here @@ -47,33 +57,29 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define DWS_DF_FLOATING 0x80000000 // default state is floating -struct tTbData -{ +typedef struct { HWND hClient; // client Window Handle - TCHAR *pszName; // name of plugin (shown in window) + const TCHAR *pszName; // name of plugin (shown in window) int dlgID; // a funcItem provides the function pointer to start a dialog. Please parse here these ID // user modifications UINT uMask; // mask params: look to above defines HICON hIconTab; // icon for tabs - TCHAR *pszAddInfo; // for plugin to display additional informations + const TCHAR *pszAddInfo; // for plugin to display additional informations // internal data, do not use !!! RECT rcFloat; // floating position int iPrevCont; // stores the privious container (toggling between float and dock) const TCHAR* pszModuleName; // it's the plugin file name. It's used to identify the plugin -}; +} tTbData; -struct tDockMgr -{ +typedef struct { HWND hWnd; // the docking manager wnd RECT rcRegion[DOCKCONT_MAX]; // position of docked dialogs -} ; +} tDockMgr; #define HIT_TEST_THICKNESS 20 #define SPLITTER_WIDTH 4 - -#endif // DOCKING_H diff --git a/NppPlugin/include/DockingDlgInterface.h b/NppPlugin/include/DockingDlgInterface.h index 47e23526..249a4706 100644 --- a/NppPlugin/include/DockingDlgInterface.h +++ b/NppPlugin/include/DockingDlgInterface.h @@ -1,54 +1,148 @@ -/* -this file is part of Function List Plugin for Notepad++ -Copyright (C)2005 Jens Lorenz +// this file is part of Function List Plugin for Notepad++ +// Copyright (C)2005 Jens Lorenz +// +// This program 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. +// +// Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. +// +// 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 -This program 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. +#pragma once -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. -*/ +#include "dockingResource.h" +#include "Docking.h" -#ifndef DOCKINGDLGINTERFACE_H -#define DOCKINGDLGINTERFACE_H - -#ifndef STATIC_DIALOG_H +#include +#include +#include "Common.h" #include "StaticDialog.h" -#endif -struct tTbData; + class DockingDlgInterface : public StaticDialog { public: - DockingDlgInterface(); - DockingDlgInterface(int dlgID); - - virtual void init(HINSTANCE hInst, HWND parent); - void create(tTbData * data, bool isRTL = false); - virtual void updateDockingDlg(); - virtual void display(bool toShow = true) const; - const TCHAR * getPluginFileName() const; + DockingDlgInterface() = default; + explicit DockingDlgInterface(int dlgID): _dlgID(dlgID) {} + + virtual void init(HINSTANCE hInst, HWND parent) + { + StaticDialog::init(hInst, parent); + TCHAR temp[MAX_PATH]; + ::GetModuleFileName(reinterpret_cast(hInst), temp, MAX_PATH); + _moduleName = ::PathFindFileName(temp); + } + + void create(tTbData * data, bool isRTL = false) + { + assert(data != nullptr); + StaticDialog::create(_dlgID, isRTL); + TCHAR temp[MAX_PATH]; + ::GetWindowText(_hSelf, temp, MAX_PATH); + _pluginName = temp; + + // user information + data->hClient = _hSelf; + data->pszName = _pluginName.c_str(); + + // supported features by plugin + data->uMask = 0; + + // additional info + data->pszAddInfo = NULL; + } + + virtual void updateDockingDlg() + { + ::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, reinterpret_cast(_hSelf)); + } + + virtual void destroy() {} + + virtual void setBackgroundColor(COLORREF) {} + virtual void setForegroundColor(COLORREF) {} + + virtual void display(bool toShow = true) const { + ::SendMessage(_hParent, toShow ? NPPM_DMMSHOW : NPPM_DMMHIDE, 0, reinterpret_cast(_hSelf)); + } + + bool isClosed() const { + return _isClosed; + } + + void setClosed(bool toClose) { + _isClosed = toClose; + } + + const TCHAR * getPluginFileName() const { + return _moduleName.c_str(); + } protected : - virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM, LPARAM lParam); + virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM, LPARAM lParam) + { + switch (message) + { + + case WM_NOTIFY: + { + LPNMHDR pnmh = reinterpret_cast(lParam); + + if (pnmh->hwndFrom == _hParent) + { + switch (LOWORD(pnmh->code)) + { + case DMN_CLOSE: + { + break; + } + case DMN_FLOAT: + { + _isFloating = true; + break; + } + case DMN_DOCK: + { + _iDockedPos = HIWORD(pnmh->code); + _isFloating = false; + break; + } + default: + break; + } + } + break; + } + default: + break; + } + return FALSE; + }; // Handles - HWND _HSource; - tTbData* _data; - int _dlgID; - bool _isFloating; - int _iDockedPos; - tstring _moduleName; - tstring _pluginName; + HWND _HSource = NULL; + int _dlgID = -1; + bool _isFloating = true; + int _iDockedPos = 0; + generic_string _moduleName; + generic_string _pluginName; + bool _isClosed = false; }; - -#endif // DOCKINGDLGINTERFACE_H diff --git a/NppPlugin/include/Notepad_plus_msgs.h b/NppPlugin/include/Notepad_plus_msgs.h index 312971ba..c5e5a2dd 100644 --- a/NppPlugin/include/Notepad_plus_msgs.h +++ b/NppPlugin/include/Notepad_plus_msgs.h @@ -1,40 +1,60 @@ -//this file is part of notepad++ -//Copyright (C)2003 Don HO ( donho@altern.org ) +// This file is part of Notepad++ project +// Copyright (C)2003 Don HO // -//This program 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 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. +// Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. // -//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. +// 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. + #ifndef NOTEPAD_PLUS_MSGS_H #define NOTEPAD_PLUS_MSGS_H -//#include "menuCmdID.h" +#include +#include -enum LangType {L_TXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ - L_HTML, L_XML, L_MAKEFILE, L_PASCAL, L_BATCH, L_INI, L_NFO, L_USER,\ - L_ASP, L_SQL, L_VB, L_JS, L_CSS, L_PERL, L_PYTHON, L_LUA,\ +enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ + L_HTML, L_XML, L_MAKEFILE, L_PASCAL, L_BATCH, L_INI, L_ASCII, L_USER,\ + L_ASP, L_SQL, L_VB, L_JS, L_CSS, L_PERL, L_PYTHON, L_LUA, \ L_TEX, L_FORTRAN, L_BASH, L_FLASH, L_NSIS, L_TCL, L_LISP, L_SCHEME,\ 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_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_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}; +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 }; -//#include "deprecatedSymbols.h" -//Here you can find how to use these messages : http://notepad-plus.sourceforge.net/uk/plugins-HOWTO.php + +//Here you can find how to use these messages : http://docs.notepad-plus-plus.org/index.php/Messages_And_Notifications #define NPPMSG (WM_USER + 1000) #define NPPM_GETCURRENTSCINTILLA (NPPMSG + 4) @@ -66,7 +86,7 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV #define NPPM_GETOPENFILENAMESPRIMARY (NPPMSG + 17) #define NPPM_GETOPENFILENAMESSECOND (NPPMSG + 18) - + #define NPPM_CREATESCINTILLAHANDLE (NPPMSG + 20) #define NPPM_DESTROYSCINTILLAHANDLE (NPPMSG + 21) #define NPPM_GETNBUSERLANG (NPPMSG + 22) @@ -85,12 +105,15 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV #define NPPM_GETMENUHANDLE (NPPMSG + 25) #define NPPPLUGINMENU 0 + #define NPPMAINMENU 1 + // INT NPPM_GETMENUHANDLE(INT menuChoice, 0) + // Return: menu handle (HMENU) of choice (plugin menu handle or Notepad++ main menu handle) #define NPPM_ENCODESCI (NPPMSG + 26) //ascii file to unicode //int NPPM_ENCODESCI(MAIN_VIEW/SUB_VIEW, 0) //return new unicodeMode - + #define NPPM_DECODESCI (NPPMSG + 27) //unicode file to ascii //int NPPM_DECODESCI(MAIN_VIEW/SUB_VIEW, 0) @@ -103,9 +126,13 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV //void NPPM_LAUNCHFINDINFILESDLG(TCHAR * dir2Search, TCHAR * filtre) #define NPPM_DMMSHOW (NPPMSG + 30) + //void NPPM_DMMSHOW(0, tTbData->hClient) + #define NPPM_DMMHIDE (NPPMSG + 31) + //void NPPM_DMMHIDE(0, tTbData->hClient) + #define NPPM_DMMUPDATEDISPINFO (NPPMSG + 32) - //void NPPM_DMMxxx(0, tTbData->hClient) + //void NPPM_DMMUPDATEDISPINFO(0, tTbData->hClient) #define NPPM_DMMREGASDCKDLG (NPPMSG + 33) //void NPPM_DMMREGASDCKDLG(0, &tTbData) @@ -123,7 +150,7 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV //BOOL NPPM_SWITCHTOFILE(0, TCHAR *filePathName2switch) #define NPPM_SAVECURRENTFILE (NPPMSG + 38) - //BOOL WM_SWITCHTOFILE(0, 0) + //BOOL NPPM_SAVECURRENTFILE(0, 0) #define NPPM_SAVEALLFILES (NPPMSG + 39) //BOOL NPPM_SAVEALLFILES(0, 0) @@ -145,7 +172,7 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV //HWND WM_DMM_GETPLUGINHWNDBYNAME(const TCHAR *windowName, const TCHAR *moduleName) // if moduleName is NULL, then return value is NULL // if windowName is NULL, then the first found window handle which matches with the moduleName will be returned - + #define NPPM_MAKECURRENTBUFFERDIRTY (NPPMSG + 44) //BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0) @@ -170,13 +197,13 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV // uncomment //#include "menuCmdID.h" // in the beginning of this file then use the command symbols defined in "menuCmdID.h" file // to access all the Notepad++ menu command items - + #define NPPM_TRIGGERTABBARCONTEXTMENU (NPPMSG + 49) //void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate) #define NPPM_GETNPPVERSION (NPPMSG + 50) // int NPPM_GETNPPVERSION(0, 0) - // return version + // return version // ex : v4.6 // HIWORD(version) == 4 // LOWORD(version) == 6 @@ -192,87 +219,81 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV // returned value : TRUE if tab bar is hidden, otherwise FALSE #define NPPM_GETPOSFROMBUFFERID (NPPMSG + 57) - // INT NPPM_GETPOSFROMBUFFERID(INT bufferID, 0) + // 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 // - // VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits) + // VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits) // Here's the values for the view : // MAIN_VIEW 0 // SUB_VIEW 1 #define NPPM_GETFULLPATHFROMBUFFERID (NPPMSG + 58) - // INT NPPM_GETFULLPATHFROMBUFFERID(INT bufferID, TCHAR *fullFilePath) - // Get full path file name from a bufferID. + // 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) - //wParam: Position of document - //lParam: View to use, 0 = Main, 1 = Secondary - //Returns 0 if invalid + // LRESULT NPPM_GETBUFFERIDFROMPOS(INT index, INT iView) + // wParam: Position of document + // lParam: View to use, 0 = Main, 1 = Secondary + // Returns 0 if invalid #define NPPM_GETCURRENTBUFFERID (NPPMSG + 60) - //Returns active Buffer + // LRESULT NPPM_GETCURRENTBUFFERID(0, 0) + // Returns active Buffer #define NPPM_RELOADBUFFERID (NPPMSG + 61) - //Reloads Buffer - //wParam: Buffer to reload - //lParam: 0 if no alert, else alert - - - #define NPPM_SETFILENAME (NPPMSG + 63) - // wParam: BufferID - // lParam: filename - // Returns: TRUE if successful (only for unnamed documents) + // 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) - //wParam: BufferID to get LangType from - //lParam: 0 - //Returns as int, see LangType. -1 on error + // 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) - //wParam: BufferID to set LangType of - //lParam: LangType - //Returns TRUE on success, FALSE otherwise - //use int, see LangType for possible values - //L_USER and L_EXTERNAL are not supported + // BOOL NPPM_SETBUFFERLANGTYPE(UINT_PTR bufferID, INT langType) + // wParam: BufferID to set LangType of + // lParam: LangType + // Returns TRUE on success, FALSE otherwise + // use int, see LangType for possible values + // L_USER and L_EXTERNAL are not supported #define NPPM_GETBUFFERENCODING (NPPMSG + 66) - //wParam: BufferID to get encoding from - //lParam: 0 - //returns as int, see UniMode. -1 on error + // 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) - //wParam: BufferID to set encoding of - //lParam: format - //Returns TRUE on success, FALSE otherwise - //use int, see UniMode - //Can only be done on new, unedited files + // BOOL NPPM_SETBUFFERENCODING(UINT_PTR bufferID, INT encoding) + // wParam: BufferID to set encoding of + // lParam: encoding + // Returns TRUE on success, FALSE otherwise + // use int, see UniMode + // Can only be done on new, unedited files #define NPPM_GETBUFFERFORMAT (NPPMSG + 68) - //wParam: BufferID to get format from - //lParam: 0 - //returns as int, see formatType. -1 on error + // INT NPPM_GETBUFFERFORMAT(UINT_PTR bufferID, 0) + // wParam: BufferID to get EolType format from + // lParam: 0 + // returns as int, see EolType format. -1 on error #define NPPM_SETBUFFERFORMAT (NPPMSG + 69) - //wParam: BufferID to set 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 -*/ + // 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 EolType format + + #define NPPM_HIDETOOLBAR (NPPMSG + 70) // BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot) // if hideOrNot is set as TRUE then tool bar will be hidden @@ -307,15 +328,19 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV // 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) // fullPathName2Open indicates the full file path name to be opened. // The return value is TRUE (1) if the operation is successful, otherwise FALSE (0). - + #define NPPM_SAVECURRENTFILEAS (NPPMSG + 78) - // BOOL NPPM_SAVECURRENTFILEAS (BOOL asCopy, const TCHAR* filename) + // BOOL NPPM_SAVECURRENTFILEAS (BOOL asCopy, const TCHAR* filename) + + #define NPPM_GETCURRENTNATIVELANGENCODING (NPPMSG + 79) + // INT NPPM_GETCURRENTNATIVELANGENCODING(0, 0) + // returned value : the current native language encoding #define NPPM_ALLOCATESUPPORTED (NPPMSG + 80) // returns TRUE if NPPM_ALLOCATECMDID is supported @@ -332,6 +357,63 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV // Allocates a marker number to a plugin // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + #define NPPM_GETLANGUAGENAME (NPPMSG + 83) + // INT NPPM_GETLANGUAGENAME(int langType, TCHAR *langName) + // 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 + // by passing allocated buffer as argument langName + + #define NPPM_GETLANGUAGEDESC (NPPMSG + 84) + // INT NPPM_GETLANGUAGEDESC(int langType, TCHAR *langDesc) + // 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 + // by passing allocated buffer as argument langDesc + + #define NPPM_SHOWDOCSWITCHER (NPPMSG + 85) + // VOID NPPM_ISDOCSWITCHERSHOWN(0, BOOL toShowOrNot) + // Send this message to show or hide doc switcher. + // if toShowOrNot is TRUE then show doc switcher, otherwise hide it. + + #define NPPM_ISDOCSWITCHERSHOWN (NPPMSG + 86) + // BOOL NPPM_ISDOCSWITCHERSHOWN(0, 0) + // Check to see if doc switcher is shown. + + #define NPPM_GETAPPDATAPLUGINSALLOWED (NPPMSG + 87) + // BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0) + // Check to see if loading plugins from "%APPDATA%\Notepad++\plugins" is allowed. + + #define NPPM_GETCURRENTVIEW (NPPMSG + 88) + // INT NPPM_GETCURRENTVIEW(0, 0) + // Return: current edit view of Notepad++. Only 2 possible values: 0 = Main, 1 = Secondary + + #define NPPM_DOCSWITCHERDISABLECOLUMN (NPPMSG + 89) + // VOID NPPM_DOCSWITCHERDISABLECOLUMN(0, BOOL disableOrNot) + // Disable or enable extension column of doc switcher + + #define NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR (NPPMSG + 90) + // INT NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0) + // Return: current editor default foreground color. You should convert the returned value in COLORREF + + #define NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR (NPPMSG + 91) + // INT NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR(0, 0) + // Return: current editor default background color. You should convert the returned value in COLORREF + + #define NPPM_SETSMOOTHFONT (NPPMSG + 92) + // VOID NPPM_SETSMOOTHFONT(0, BOOL setSmoothFontOrNot) + + #define NPPM_SETEDITORBORDEREDGE (NPPMSG + 93) + // VOID NPPM_SETEDITORBORDEREDGE(0, BOOL withEditorBorderEdgeOrNot) + + #define NPPM_SAVEFILE (NPPMSG + 94) + // VOID NPPM_SAVEFILE(0, const TCHAR *fileNameToSave) + + #define NPPM_DISABLEAUTOUPDATE (NPPMSG + 95) // 2119 in decimal + // VOID NPPM_DISABLEAUTOUPDATE(0, 0) + #define RUNCOMMAND_USER (WM_USER + 3000) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) @@ -340,6 +422,7 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV #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 @@ -353,6 +436,8 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV // 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 @@ -363,6 +448,8 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV #define NPP_DIRECTORY 7 #define CURRENT_LINE 8 #define CURRENT_COLUMN 9 + #define NPP_FULL_FILE_PATH 10 + #define GETFILENAMEATCURSOR 11 // Notification code @@ -396,14 +483,14 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; - + #define NPPN_FILEBEFORESAVE (NPPN_FIRST + 7) // To notify plugins that the current file is about to be saved //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; - + #define NPPN_FILESAVED (NPPN_FIRST + 8) // To notify plugins that the current file is just saved - //scnNotification->nmhdr.code = NPPN_FILECLOSED; + //scnNotification->nmhdr.code = NPPN_FILESAVED; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; @@ -454,9 +541,59 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV //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 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; + //scnNotification->nmhdr.hwndFrom = newIndex; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_SNAPSHOTDIRTYFILELOADED (NPPN_FIRST + 18) // To notify plugins that a snapshot dirty file is loaded on startup + //scnNotification->nmhdr.code = NPPN_SNAPSHOTDIRTYFILELOADED; + //scnNotification->nmhdr.hwndFrom = NULL; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_BEFORESHUTDOWN (NPPN_FIRST + 19) // To notify plugins that Npp shutdown has been triggered, files have not been closed yet + //scnNotification->nmhdr.code = NPPN_BEFORESHUTDOWN; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = 0; + + #define NPPN_CANCELSHUTDOWN (NPPN_FIRST + 20) // To notify plugins that Npp shutdown has been cancelled + //scnNotification->nmhdr.code = NPPN_CANCELSHUTDOWN; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = 0; + + #define NPPN_FILEBEFORERENAME (NPPN_FIRST + 21) // To notify plugins that file is to be renamed + //scnNotification->nmhdr.code = NPPN_FILEBEFORERENAME; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_FILERENAMECANCEL (NPPN_FIRST + 22) // To notify plugins that file rename has been cancelled + //scnNotification->nmhdr.code = NPPN_FILERENAMECANCEL; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; - #define DOCSTAUS_READONLY 1 - #define DOCSTAUS_BUFFERDIRTY 2 + #define NPPN_FILERENAMED (NPPN_FIRST + 23) // To notify plugins that file has been renamed + //scnNotification->nmhdr.code = NPPN_FILERENAMED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_FILEBEFOREDELETE (NPPN_FIRST + 24) // To notify plugins that file is to be deleted + //scnNotification->nmhdr.code = NPPN_FILEBEFOREDELETE; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_FILEDELETEFAILED (NPPN_FIRST + 25) // To notify plugins that file deletion has failed + //scnNotification->nmhdr.code = NPPN_FILEDELETEFAILED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_FILEDELETED (NPPN_FIRST + 26) // To notify plugins that file has been deleted + //scnNotification->nmhdr.code = NPPN_FILEDELETED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; #endif //NOTEPAD_PLUS_MSGS_H diff --git a/NppPlugin/include/PluginInterface.h b/NppPlugin/include/PluginInterface.h index 38e53e21..4ec81f37 100644 --- a/NppPlugin/include/PluginInterface.h +++ b/NppPlugin/include/PluginInterface.h @@ -1,30 +1,48 @@ -//this file is part of notepad++ -//Copyright (C)2003 Don HO ( donho@altern.org ) +// This file is part of Notepad++ project +// Copyright (C)2003 Don HO // -//This program 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 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. +// Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. // -//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. +// 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. + #ifndef PLUGININTERFACE_H #define PLUGININTERFACE_H -struct SCNotification; +#ifndef SCINTILLA_H +#include "Scintilla.h" +#endif //SCINTILLA_H + +#ifndef NOTEPAD_PLUS_MSGS_H +#include "Notepad_plus_msgs.h" +#endif //NOTEPAD_PLUS_MSGS_H const int nbChar = 64; typedef const TCHAR * (__cdecl * PFUNCGETNAME)(); -struct NppData { +struct NppData +{ HWND _nppHandle; HWND _scintillaMainHandle; HWND _scintillaSecondHandle; @@ -36,14 +54,16 @@ typedef void (__cdecl * PBENOTIFIED)(SCNotification *); typedef LRESULT (__cdecl * PMESSAGEPROC)(UINT Message, WPARAM wParam, LPARAM lParam); -struct ShortcutKey { +struct ShortcutKey +{ bool _isCtrl; bool _isAlt; bool _isShift; UCHAR _key; }; -struct FuncItem { +struct FuncItem +{ TCHAR _itemName[nbChar]; PFUNCPLUGINCMD _pFunc; int _cmdID; @@ -60,8 +80,8 @@ extern "C" __declspec(dllexport) FuncItem * getFuncsArray(int *); extern "C" __declspec(dllexport) void beNotified(SCNotification *); extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam); -#ifdef UNICODE +// This API return always true now, since Notepad++ isn't compiled in ANSI mode anymore extern "C" __declspec(dllexport) BOOL isUnicode(); -#endif //UNICODE + #endif //PLUGININTERFACE_H diff --git a/NppPlugin/include/PluginsManager.h b/NppPlugin/include/PluginsManager.h deleted file mode 100644 index 66770e09..00000000 --- a/NppPlugin/include/PluginsManager.h +++ /dev/null @@ -1,155 +0,0 @@ -//this file is part of notepad++ -//Copyright (C)2003 Don HO ( donho@altern.org ) -// -//This program 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. - -#ifndef PLUGINSMANAGER_H -#define PLUGINSMANAGER_H - -#include "resource.h" -#include "Parameters.h" -#include "PluginInterface.h" - -typedef BOOL (__cdecl * PFUNCISUNICODE)(); - -struct PluginCommand { - TCHAR _pluginName[64]; - int _funcID; - PFUNCPLUGINCMD _pFunc; - PluginCommand(const TCHAR *pluginName, int funcID, PFUNCPLUGINCMD pFunc): _funcID(funcID), _pFunc(pFunc){ - lstrcpy(_pluginName, pluginName); - }; -}; - -struct PluginInfo { - PluginInfo() :_hLib(NULL), _pluginMenu(NULL), _pFuncSetInfo(NULL),\ - _pFuncGetFuncsArray(NULL), _pFuncGetName(NULL), _funcItems(NULL),\ - _nbFuncItem(0){}; - ~PluginInfo(){ - if (_pluginMenu) - ::DestroyMenu(_pluginMenu); - - if (_hLib) - ::FreeLibrary(_hLib); - }; - - HINSTANCE _hLib; - HMENU _pluginMenu; - - PFUNCSETINFO _pFuncSetInfo; - PFUNCGETNAME _pFuncGetName; - PBENOTIFIED _pBeNotified; - PFUNCGETFUNCSARRAY _pFuncGetFuncsArray; - PMESSAGEPROC _pMessageProc; - PFUNCISUNICODE _pFuncIsUnicode; - - FuncItem *_funcItems; - int _nbFuncItem; - TCHAR _moduleName[64]; -}; - -class PluginsManager { -public: - PluginsManager() : _hPluginsMenu(NULL), _isDisabled(false) {}; - ~PluginsManager() { - - for (size_t i = 0 ; i < _pluginInfos.size() ; i++) - delete _pluginInfos[i]; - - if (_hPluginsMenu) - DestroyMenu(_hPluginsMenu); - }; - void init(const NppData & nppData) { - _nppData = nppData; - }; - bool loadPlugins(const TCHAR *dir = NULL); - - void runPluginCommand(size_t i) { - if (i < _pluginsCommands.size()) - if (_pluginsCommands[i]._pFunc != NULL) - _pluginsCommands[i]._pFunc(); - }; - - void runPluginCommand(const TCHAR *pluginName, int commandID) { - for (size_t i = 0 ; i < _pluginsCommands.size() ; i++) - { - if (!generic_stricmp(_pluginsCommands[i]._pluginName, pluginName)) - { - if (_pluginsCommands[i]._funcID == commandID) - _pluginsCommands[i]._pFunc(); - } - } - }; - - void setMenu(HMENU hMenu, const TCHAR *menuName); - bool getShortcutByCmdID(int cmdID, ShortcutKey *sk); - - void notify(SCNotification *notification) { - for (size_t i = 0 ; i < _pluginInfos.size() ; i++) - { - // To avoid the plugin change the data in SCNotification - // Each notification to pass to a plugin is a copy of SCNotification instance - SCNotification scNotif = *notification; - _pluginInfos[i]->_pBeNotified(&scNotif); - } - }; - - void relayNppMessages(UINT Message, WPARAM wParam, LPARAM lParam) { - for (size_t i = 0 ; i < _pluginInfos.size() ; i++) - { - _pluginInfos[i]->_pMessageProc(Message, wParam, lParam); - } - }; - - bool relayPluginMessages(UINT Message, WPARAM wParam, LPARAM lParam) { - const TCHAR * moduleName = (const TCHAR *)wParam; - if (!moduleName || !moduleName[0] || !lParam) - return false; - - for (size_t i = 0 ; i < _pluginInfos.size() ; i++) - { - if (generic_stricmp(_pluginInfos[i]->_moduleName, moduleName) == 0) - { - _pluginInfos[i]->_pMessageProc(Message, wParam, lParam); - return true; - } - } - return false; - }; - - HMENU getMenuHandle() { - return _hPluginsMenu; - }; - - void disable() {_isDisabled = true;}; - bool hasPlugins(){return (_pluginInfos.size()!= 0);}; - -private: - NppData _nppData; - HMENU _hPluginsMenu; - - vector _pluginInfos; - vector _pluginsCommands; - bool _isDisabled; -}; - -#define EXT_LEXER_DECL __stdcall - -// External Lexer function definitions... -typedef int (EXT_LEXER_DECL *GetLexerCountFn)(); -typedef void (EXT_LEXER_DECL *GetLexerNameFn)(unsigned int Index, char *name, int buflength); -typedef void (EXT_LEXER_DECL *GetLexerStatusTextFn)(unsigned int Index, TCHAR *desc, int buflength); - -#endif //PLUGINSMANAGER_H diff --git a/NppPlugin/include/SciLexer.h b/NppPlugin/include/SciLexer.h index 3aa2c385..7c3af6b8 100644 --- a/NppPlugin/include/SciLexer.h +++ b/NppPlugin/include/SciLexer.h @@ -112,7 +112,41 @@ #define SCLEX_SML 97 #define SCLEX_MARKDOWN 98 #define SCLEX_TXT2TAGS 99 +#define SCLEX_A68K 100 +#define SCLEX_MODULA 101 +#define SCLEX_COFFEESCRIPT 102 +#define SCLEX_TCMD 103 +#define SCLEX_AVS 104 +#define SCLEX_ECL 105 +#define SCLEX_OSCRIPT 106 +#define SCLEX_VISUALPROLOG 107 +#define SCLEX_LITERATEHASKELL 108 +#define SCLEX_STTXT 109 +#define SCLEX_KVIRC 110 +#define SCLEX_RUST 111 +#define SCLEX_DMAP 112 +#define SCLEX_AS 113 +#define SCLEX_DMIS 114 +#define SCLEX_REGISTRY 115 +#define SCLEX_BIBTEX 116 +#define SCLEX_SREC 117 +#define SCLEX_IHEX 118 +#define SCLEX_TEHEX 119 +#define SCLEX_SEARCHRESULT 150 +#define SCLEX_OBJC 151 +#define SCLEX_USER 152 #define SCLEX_AUTOMATIC 1000 +//For All lexer +#define SCE_UNIVERSAL_FOUND_STYLE 31 +#define SCE_UNIVERSAL_FOUND_STYLE_SMART 29 +#define SCE_UNIVERSAL_FOUND_STYLE_INC 28 +#define SCE_UNIVERSAL_TAGMATCH 27 +#define SCE_UNIVERSAL_TAGATTR 26 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT1 25 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT2 24 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT3 23 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT4 22 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT5 21 #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 @@ -149,6 +183,14 @@ #define SCE_C_COMMENTDOCKEYWORD 17 #define SCE_C_COMMENTDOCKEYWORDERROR 18 #define SCE_C_GLOBALCLASS 19 +#define SCE_C_STRINGRAW 20 +#define SCE_C_TRIPLEVERBATIM 21 +#define SCE_C_HASHQUOTEDSTRING 22 +#define SCE_C_PREPROCESSORCOMMENT 23 +#define SCE_C_PREPROCESSORCOMMENTDOC 24 +#define SCE_C_USERLITERAL 25 +#define SCE_C_TASKMARKER 26 +#define SCE_C_ESCAPESEQUENCE 27 #define SCE_D_DEFAULT 0 #define SCE_D_COMMENT 1 #define SCE_D_COMMENTLINE 2 @@ -172,6 +214,113 @@ #define SCE_D_WORD5 20 #define SCE_D_WORD6 21 #define SCE_D_WORD7 22 +#define SCE_SEARCHRESULT_DEFAULT 0 +#define SCE_SEARCHRESULT_SEARCH_HEADER 1 +#define SCE_SEARCHRESULT_FILE_HEADER 2 +#define SCE_SEARCHRESULT_LINE_NUMBER 3 +#define SCE_SEARCHRESULT_WORD2SEARCH 4 +#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 +#define SCE_SEARCHRESULT_CURRENT_LINE 6 +#define SCE_OBJC_DIRECTIVE 20 +#define SCE_OBJC_QUALIFIER 21 + +#define SCE_UDL_VERSION_MAJOR 2 +#define SCE_UDL_VERSION_MINOR 1 +#define SCE_UDL_VERSION_BUILD 0 +#define SCE_UDL_VERSION_REVISION 12 + +#define SCE_USER_KWLIST_COMMENTS 0 +#define SCE_USER_KWLIST_NUMBER_PREFIX1 1 +#define SCE_USER_KWLIST_NUMBER_PREFIX2 2 +#define SCE_USER_KWLIST_NUMBER_EXTRAS1 3 +#define SCE_USER_KWLIST_NUMBER_EXTRAS2 4 +#define SCE_USER_KWLIST_NUMBER_SUFFIX1 5 +#define SCE_USER_KWLIST_NUMBER_SUFFIX2 6 +#define SCE_USER_KWLIST_NUMBER_RANGE 7 +#define SCE_USER_KWLIST_OPERATORS1 8 +#define SCE_USER_KWLIST_OPERATORS2 9 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_OPEN 10 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_MIDDLE 11 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_CLOSE 12 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_OPEN 13 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_MIDDLE 14 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_CLOSE 15 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_OPEN 16 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_MIDDLE 17 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_CLOSE 18 +#define SCE_USER_KWLIST_KEYWORDS1 19 +#define SCE_USER_KWLIST_KEYWORDS2 20 +#define SCE_USER_KWLIST_KEYWORDS3 21 +#define SCE_USER_KWLIST_KEYWORDS4 22 +#define SCE_USER_KWLIST_KEYWORDS5 23 +#define SCE_USER_KWLIST_KEYWORDS6 24 +#define SCE_USER_KWLIST_KEYWORDS7 25 +#define SCE_USER_KWLIST_KEYWORDS8 26 +#define SCE_USER_KWLIST_DELIMITERS 27 +#define SCE_USER_KWLIST_TOTAL 28 // must always be <= KEYWORDSET_MAX + +#define SCE_USER_TOTAL_DELIMITERS 8 +#define SCE_USER_TOTAL_KEYWORD_GROUPS 8 +#define SCE_USER_TOTAL_FOLDERS 6 + +#define SCE_USER_STYLE_DEFAULT 0 +#define SCE_USER_STYLE_COMMENT 1 +#define SCE_USER_STYLE_COMMENTLINE 2 +#define SCE_USER_STYLE_NUMBER 3 +#define SCE_USER_STYLE_KEYWORD1 4 +#define SCE_USER_STYLE_KEYWORD2 5 +#define SCE_USER_STYLE_KEYWORD3 6 +#define SCE_USER_STYLE_KEYWORD4 7 +#define SCE_USER_STYLE_KEYWORD5 8 +#define SCE_USER_STYLE_KEYWORD6 9 +#define SCE_USER_STYLE_KEYWORD7 10 +#define SCE_USER_STYLE_KEYWORD8 11 +#define SCE_USER_STYLE_OPERATOR 12 +#define SCE_USER_STYLE_FOLDER_IN_CODE1 13 +#define SCE_USER_STYLE_FOLDER_IN_CODE2 14 +#define SCE_USER_STYLE_FOLDER_IN_COMMENT 15 +#define SCE_USER_STYLE_DELIMITER1 16 +#define SCE_USER_STYLE_DELIMITER2 17 +#define SCE_USER_STYLE_DELIMITER3 18 +#define SCE_USER_STYLE_DELIMITER4 19 +#define SCE_USER_STYLE_DELIMITER5 20 +#define SCE_USER_STYLE_DELIMITER6 21 +#define SCE_USER_STYLE_DELIMITER7 22 +#define SCE_USER_STYLE_DELIMITER8 23 +#define SCE_USER_STYLE_IDENTIFIER 24 +#define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER +#define SCE_USER_STYLE_MAPPER_TOTAL 17 +#define SCE_STYLE_ARRAY_SIZE 30 // must cover sizes of NppParameters::_lexerStyler and NppParameters::_widgetStyle + +#define SCE_USER_MASK_NESTING_NONE 0 +#define SCE_USER_MASK_NESTING_DELIMITER1 0x1 +#define SCE_USER_MASK_NESTING_DELIMITER2 0x2 +#define SCE_USER_MASK_NESTING_DELIMITER3 0x4 +#define SCE_USER_MASK_NESTING_DELIMITER4 0x8 +#define SCE_USER_MASK_NESTING_DELIMITER5 0x10 +#define SCE_USER_MASK_NESTING_DELIMITER6 0x20 +#define SCE_USER_MASK_NESTING_DELIMITER7 0x40 +#define SCE_USER_MASK_NESTING_DELIMITER8 0x80 +#define SCE_USER_MASK_NESTING_COMMENT 0x100 +#define SCE_USER_MASK_NESTING_COMMENT_LINE 0x200 +#define SCE_USER_MASK_NESTING_KEYWORD1 0x400 +#define SCE_USER_MASK_NESTING_KEYWORD2 0x800 +#define SCE_USER_MASK_NESTING_KEYWORD3 0x1000 +#define SCE_USER_MASK_NESTING_KEYWORD4 0x2000 +#define SCE_USER_MASK_NESTING_KEYWORD5 0x4000 +#define SCE_USER_MASK_NESTING_KEYWORD6 0x8000 +#define SCE_USER_MASK_NESTING_KEYWORD7 0x10000 +#define SCE_USER_MASK_NESTING_KEYWORD8 0x20000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_OPEN 0x40000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_MIDDLE 0x80000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_CLOSE 0x100000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_OPEN 0x200000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_MIDDLE 0x400000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_CLOSE 0x800000 +#define SCE_USER_MASK_NESTING_OPERATORS1 0x1000000 +#define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000 +#define SCE_USER_MASK_NESTING_NUMBERS 0x4000000 + #define SCE_TCL_DEFAULT 0 #define SCE_TCL_COMMENT 1 #define SCE_TCL_COMMENTLINE 2 @@ -340,6 +489,16 @@ #define SCE_PL_SUB_PROTOTYPE 40 #define SCE_PL_FORMAT_IDENT 41 #define SCE_PL_FORMAT 42 +#define SCE_PL_STRING_VAR 43 +#define SCE_PL_XLAT 44 +#define SCE_PL_REGEX_VAR 54 +#define SCE_PL_REGSUBST_VAR 55 +#define SCE_PL_BACKTICKS_VAR 57 +#define SCE_PL_HERE_QQ_VAR 61 +#define SCE_PL_HERE_QX_VAR 62 +#define SCE_PL_STRING_QQ_VAR 64 +#define SCE_PL_STRING_QX_VAR 65 +#define SCE_PL_STRING_QR_VAR 66 #define SCE_RB_DEFAULT 0 #define SCE_RB_ERROR 1 #define SCE_RB_COMMENTLINE 2 @@ -393,6 +552,10 @@ #define SCE_B_ERROR 16 #define SCE_B_HEXNUMBER 17 #define SCE_B_BINNUMBER 18 +#define SCE_B_COMMENTBLOCK 19 +#define SCE_B_DOCLINE 20 +#define SCE_B_DOCBLOCK 21 +#define SCE_B_DOCKEYWORD 22 #define SCE_PROPS_DEFAULT 0 #define SCE_PROPS_COMMENT 1 #define SCE_PROPS_SECTION 2 @@ -404,6 +567,14 @@ #define SCE_L_TAG 2 #define SCE_L_MATH 3 #define SCE_L_COMMENT 4 +#define SCE_L_TAG2 5 +#define SCE_L_MATH2 6 +#define SCE_L_COMMENT2 7 +#define SCE_L_VERBATIM 8 +#define SCE_L_SHORTCMD 9 +#define SCE_L_SPECIAL 10 +#define SCE_L_CMDOPT 11 +#define SCE_L_ERROR 12 #define SCE_LUA_DEFAULT 0 #define SCE_LUA_COMMENT 1 #define SCE_LUA_COMMENTLINE 2 @@ -424,6 +595,7 @@ #define SCE_LUA_WORD6 17 #define SCE_LUA_WORD7 18 #define SCE_LUA_WORD8 19 +#define SCE_LUA_LABEL 20 #define SCE_ERR_DEFAULT 0 #define SCE_ERR_PYTHON 1 #define SCE_ERR_GCC 2 @@ -446,6 +618,7 @@ #define SCE_ERR_TIDY 19 #define SCE_ERR_JAVA_STACK 20 #define SCE_ERR_VALUE 21 +#define SCE_ERR_GCC_INCLUDED_FROM 22 #define SCE_BAT_DEFAULT 0 #define SCE_BAT_COMMENT 1 #define SCE_BAT_WORD 2 @@ -454,6 +627,17 @@ #define SCE_BAT_COMMAND 5 #define SCE_BAT_IDENTIFIER 6 #define SCE_BAT_OPERATOR 7 +#define SCE_TCMD_DEFAULT 0 +#define SCE_TCMD_COMMENT 1 +#define SCE_TCMD_WORD 2 +#define SCE_TCMD_LABEL 3 +#define SCE_TCMD_HIDE 4 +#define SCE_TCMD_COMMAND 5 +#define SCE_TCMD_IDENTIFIER 6 +#define SCE_TCMD_OPERATOR 7 +#define SCE_TCMD_ENVIRONMENT 8 +#define SCE_TCMD_EXPANSION 9 +#define SCE_TCMD_CLABEL 10 #define SCE_MAKE_DEFAULT 0 #define SCE_MAKE_COMMENT 1 #define SCE_MAKE_PREPROCESSOR 2 @@ -601,6 +785,7 @@ #define SCE_ASM_CHARACTER 12 #define SCE_ASM_STRINGEOL 13 #define SCE_ASM_EXTINSTRUCTION 14 +#define SCE_ASM_COMMENTDIRECTIVE 15 #define SCE_F_DEFAULT 0 #define SCE_F_COMMENT 1 #define SCE_F_NUMBER 2 @@ -639,6 +824,7 @@ #define SCE_CSS_EXTENDED_PSEUDOCLASS 20 #define SCE_CSS_EXTENDED_PSEUDOELEMENT 21 #define SCE_CSS_MEDIA 22 +#define SCE_CSS_VARIABLE 23 #define SCE_POV_DEFAULT 0 #define SCE_POV_COMMENT 1 #define SCE_POV_COMMENTLINE 2 @@ -836,6 +1022,11 @@ #define SCE_V_IDENTIFIER 11 #define SCE_V_STRINGEOL 12 #define SCE_V_USER 19 +#define SCE_V_COMMENT_WORD 20 +#define SCE_V_INPUT 21 +#define SCE_V_OUTPUT 22 +#define SCE_V_INOUT 23 +#define SCE_V_PORT_CONNECT 24 #define SCE_KIX_DEFAULT 0 #define SCE_KIX_COMMENT 1 #define SCE_KIX_STRING1 2 @@ -846,6 +1037,7 @@ #define SCE_KIX_KEYWORD 7 #define SCE_KIX_FUNCTIONS 8 #define SCE_KIX_OPERATOR 9 +#define SCE_KIX_COMMENTSTREAM 10 #define SCE_KIX_IDENTIFIER 31 #define SCE_GC_DEFAULT 0 #define SCE_GC_COMMENTLINE 1 @@ -942,6 +1134,7 @@ #define SCE_VHDL_STDPACKAGE 12 #define SCE_VHDL_STDTYPE 13 #define SCE_VHDL_USERWORD 14 +#define SCE_VHDL_BLOCK_COMMENT 15 #define SCE_CAML_DEFAULT 0 #define SCE_CAML_IDENTIFIER 1 #define SCE_CAML_TAGNAME 2 @@ -975,6 +1168,12 @@ #define SCE_HA_COMMENTBLOCK 14 #define SCE_HA_COMMENTBLOCK2 15 #define SCE_HA_COMMENTBLOCK3 16 +#define SCE_HA_PRAGMA 17 +#define SCE_HA_PREPROCESSOR 18 +#define SCE_HA_STRINGEOL 19 +#define SCE_HA_RESERVED_OPERATOR 20 +#define SCE_HA_LITERATE_COMMENT 21 +#define SCE_HA_LITERATE_CODEDELIM 22 #define SCE_T3_DEFAULT 0 #define SCE_T3_X_DEFAULT 1 #define SCE_T3_PREPROCESSOR 2 @@ -1047,6 +1246,7 @@ #define SCE_SQL_USER3 21 #define SCE_SQL_USER4 22 #define SCE_SQL_QUOTEDIDENTIFIER 23 +#define SCE_SQL_QOPERATOR 24 #define SCE_ST_DEFAULT 0 #define SCE_ST_STRING 1 #define SCE_ST_NUMBER 2 @@ -1279,6 +1479,9 @@ #define SCE_POWERSHELL_FUNCTION 11 #define SCE_POWERSHELL_USER1 12 #define SCE_POWERSHELL_COMMENTSTREAM 13 +#define SCE_POWERSHELL_HERE_STRING 14 +#define SCE_POWERSHELL_HERE_CHARACTER 15 +#define SCE_POWERSHELL_COMMENTDOCKEYWORD 16 #define SCE_MYSQL_DEFAULT 0 #define SCE_MYSQL_COMMENT 1 #define SCE_MYSQL_COMMENTLINE 2 @@ -1301,6 +1504,7 @@ #define SCE_MYSQL_USER2 19 #define SCE_MYSQL_USER3 20 #define SCE_MYSQL_HIDDENCOMMAND 21 +#define SCE_MYSQL_PLACEHOLDER 22 #define SCE_PO_DEFAULT 0 #define SCE_PO_COMMENT 1 #define SCE_PO_MSGID 2 @@ -1310,6 +1514,13 @@ #define SCE_PO_MSGCTXT 6 #define SCE_PO_MSGCTXT_TEXT 7 #define SCE_PO_FUZZY 8 +#define SCE_PO_PROGRAMMER_COMMENT 9 +#define SCE_PO_REFERENCE 10 +#define SCE_PO_FLAGS 11 +#define SCE_PO_MSGID_TEXT_EOL 12 +#define SCE_PO_MSGSTR_TEXT_EOL 13 +#define SCE_PO_MSGCTXT_TEXT_EOL 14 +#define SCE_PO_ERROR 15 #define SCE_PAS_DEFAULT 0 #define SCE_PAS_IDENTIFIER 1 #define SCE_PAS_COMMENT 2 @@ -1415,6 +1626,269 @@ #define SCE_TXT2TAGS_OPTION 23 #define SCE_TXT2TAGS_PREPROC 24 #define SCE_TXT2TAGS_POSTPROC 25 +#define SCE_A68K_DEFAULT 0 +#define SCE_A68K_COMMENT 1 +#define SCE_A68K_NUMBER_DEC 2 +#define SCE_A68K_NUMBER_BIN 3 +#define SCE_A68K_NUMBER_HEX 4 +#define SCE_A68K_STRING1 5 +#define SCE_A68K_OPERATOR 6 +#define SCE_A68K_CPUINSTRUCTION 7 +#define SCE_A68K_EXTINSTRUCTION 8 +#define SCE_A68K_REGISTER 9 +#define SCE_A68K_DIRECTIVE 10 +#define SCE_A68K_MACRO_ARG 11 +#define SCE_A68K_LABEL 12 +#define SCE_A68K_STRING2 13 +#define SCE_A68K_IDENTIFIER 14 +#define SCE_A68K_MACRO_DECLARATION 15 +#define SCE_A68K_COMMENT_WORD 16 +#define SCE_A68K_COMMENT_SPECIAL 17 +#define SCE_A68K_COMMENT_DOXYGEN 18 +#define SCE_MODULA_DEFAULT 0 +#define SCE_MODULA_COMMENT 1 +#define SCE_MODULA_DOXYCOMM 2 +#define SCE_MODULA_DOXYKEY 3 +#define SCE_MODULA_KEYWORD 4 +#define SCE_MODULA_RESERVED 5 +#define SCE_MODULA_NUMBER 6 +#define SCE_MODULA_BASENUM 7 +#define SCE_MODULA_FLOAT 8 +#define SCE_MODULA_STRING 9 +#define SCE_MODULA_STRSPEC 10 +#define SCE_MODULA_CHAR 11 +#define SCE_MODULA_CHARSPEC 12 +#define SCE_MODULA_PROC 13 +#define SCE_MODULA_PRAGMA 14 +#define SCE_MODULA_PRGKEY 15 +#define SCE_MODULA_OPERATOR 16 +#define SCE_MODULA_BADSTR 17 +#define SCE_COFFEESCRIPT_DEFAULT 0 +#define SCE_COFFEESCRIPT_COMMENT 1 +#define SCE_COFFEESCRIPT_COMMENTLINE 2 +#define SCE_COFFEESCRIPT_COMMENTDOC 3 +#define SCE_COFFEESCRIPT_NUMBER 4 +#define SCE_COFFEESCRIPT_WORD 5 +#define SCE_COFFEESCRIPT_STRING 6 +#define SCE_COFFEESCRIPT_CHARACTER 7 +#define SCE_COFFEESCRIPT_UUID 8 +#define SCE_COFFEESCRIPT_PREPROCESSOR 9 +#define SCE_COFFEESCRIPT_OPERATOR 10 +#define SCE_COFFEESCRIPT_IDENTIFIER 11 +#define SCE_COFFEESCRIPT_STRINGEOL 12 +#define SCE_COFFEESCRIPT_VERBATIM 13 +#define SCE_COFFEESCRIPT_REGEX 14 +#define SCE_COFFEESCRIPT_COMMENTLINEDOC 15 +#define SCE_COFFEESCRIPT_WORD2 16 +#define SCE_COFFEESCRIPT_COMMENTDOCKEYWORD 17 +#define SCE_COFFEESCRIPT_COMMENTDOCKEYWORDERROR 18 +#define SCE_COFFEESCRIPT_GLOBALCLASS 19 +#define SCE_COFFEESCRIPT_STRINGRAW 20 +#define SCE_COFFEESCRIPT_TRIPLEVERBATIM 21 +#define SCE_COFFEESCRIPT_COMMENTBLOCK 22 +#define SCE_COFFEESCRIPT_VERBOSE_REGEX 23 +#define SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24 +#define SCE_AVS_DEFAULT 0 +#define SCE_AVS_COMMENTBLOCK 1 +#define SCE_AVS_COMMENTBLOCKN 2 +#define SCE_AVS_COMMENTLINE 3 +#define SCE_AVS_NUMBER 4 +#define SCE_AVS_OPERATOR 5 +#define SCE_AVS_IDENTIFIER 6 +#define SCE_AVS_STRING 7 +#define SCE_AVS_TRIPLESTRING 8 +#define SCE_AVS_KEYWORD 9 +#define SCE_AVS_FILTER 10 +#define SCE_AVS_PLUGIN 11 +#define SCE_AVS_FUNCTION 12 +#define SCE_AVS_CLIPPROP 13 +#define SCE_AVS_USERDFN 14 +#define SCE_ECL_DEFAULT 0 +#define SCE_ECL_COMMENT 1 +#define SCE_ECL_COMMENTLINE 2 +#define SCE_ECL_NUMBER 3 +#define SCE_ECL_STRING 4 +#define SCE_ECL_WORD0 5 +#define SCE_ECL_OPERATOR 6 +#define SCE_ECL_CHARACTER 7 +#define SCE_ECL_UUID 8 +#define SCE_ECL_PREPROCESSOR 9 +#define SCE_ECL_UNKNOWN 10 +#define SCE_ECL_IDENTIFIER 11 +#define SCE_ECL_STRINGEOL 12 +#define SCE_ECL_VERBATIM 13 +#define SCE_ECL_REGEX 14 +#define SCE_ECL_COMMENTLINEDOC 15 +#define SCE_ECL_WORD1 16 +#define SCE_ECL_COMMENTDOCKEYWORD 17 +#define SCE_ECL_COMMENTDOCKEYWORDERROR 18 +#define SCE_ECL_WORD2 19 +#define SCE_ECL_WORD3 20 +#define SCE_ECL_WORD4 21 +#define SCE_ECL_WORD5 22 +#define SCE_ECL_COMMENTDOC 23 +#define SCE_ECL_ADDED 24 +#define SCE_ECL_DELETED 25 +#define SCE_ECL_CHANGED 26 +#define SCE_ECL_MOVED 27 +#define SCE_OSCRIPT_DEFAULT 0 +#define SCE_OSCRIPT_LINE_COMMENT 1 +#define SCE_OSCRIPT_BLOCK_COMMENT 2 +#define SCE_OSCRIPT_DOC_COMMENT 3 +#define SCE_OSCRIPT_PREPROCESSOR 4 +#define SCE_OSCRIPT_NUMBER 5 +#define SCE_OSCRIPT_SINGLEQUOTE_STRING 6 +#define SCE_OSCRIPT_DOUBLEQUOTE_STRING 7 +#define SCE_OSCRIPT_CONSTANT 8 +#define SCE_OSCRIPT_IDENTIFIER 9 +#define SCE_OSCRIPT_GLOBAL 10 +#define SCE_OSCRIPT_KEYWORD 11 +#define SCE_OSCRIPT_OPERATOR 12 +#define SCE_OSCRIPT_LABEL 13 +#define SCE_OSCRIPT_TYPE 14 +#define SCE_OSCRIPT_FUNCTION 15 +#define SCE_OSCRIPT_OBJECT 16 +#define SCE_OSCRIPT_PROPERTY 17 +#define SCE_OSCRIPT_METHOD 18 +#define SCE_VISUALPROLOG_DEFAULT 0 +#define SCE_VISUALPROLOG_KEY_MAJOR 1 +#define SCE_VISUALPROLOG_KEY_MINOR 2 +#define SCE_VISUALPROLOG_KEY_DIRECTIVE 3 +#define SCE_VISUALPROLOG_COMMENT_BLOCK 4 +#define SCE_VISUALPROLOG_COMMENT_LINE 5 +#define SCE_VISUALPROLOG_COMMENT_KEY 6 +#define SCE_VISUALPROLOG_COMMENT_KEY_ERROR 7 +#define SCE_VISUALPROLOG_IDENTIFIER 8 +#define SCE_VISUALPROLOG_VARIABLE 9 +#define SCE_VISUALPROLOG_ANONYMOUS 10 +#define SCE_VISUALPROLOG_NUMBER 11 +#define SCE_VISUALPROLOG_OPERATOR 12 +#define SCE_VISUALPROLOG_CHARACTER 13 +#define SCE_VISUALPROLOG_CHARACTER_TOO_MANY 14 +#define SCE_VISUALPROLOG_CHARACTER_ESCAPE_ERROR 15 +#define SCE_VISUALPROLOG_STRING 16 +#define SCE_VISUALPROLOG_STRING_ESCAPE 17 +#define SCE_VISUALPROLOG_STRING_ESCAPE_ERROR 18 +#define SCE_VISUALPROLOG_STRING_EOL_OPEN 19 +#define SCE_VISUALPROLOG_STRING_VERBATIM 20 +#define SCE_VISUALPROLOG_STRING_VERBATIM_SPECIAL 21 +#define SCE_VISUALPROLOG_STRING_VERBATIM_EOL 22 +#define SCE_STTXT_DEFAULT 0 +#define SCE_STTXT_COMMENT 1 +#define SCE_STTXT_COMMENTLINE 2 +#define SCE_STTXT_KEYWORD 3 +#define SCE_STTXT_TYPE 4 +#define SCE_STTXT_FUNCTION 5 +#define SCE_STTXT_FB 6 +#define SCE_STTXT_NUMBER 7 +#define SCE_STTXT_HEXNUMBER 8 +#define SCE_STTXT_PRAGMA 9 +#define SCE_STTXT_OPERATOR 10 +#define SCE_STTXT_CHARACTER 11 +#define SCE_STTXT_STRING1 12 +#define SCE_STTXT_STRING2 13 +#define SCE_STTXT_STRINGEOL 14 +#define SCE_STTXT_IDENTIFIER 15 +#define SCE_STTXT_DATETIME 16 +#define SCE_STTXT_VARS 17 +#define SCE_STTXT_PRAGMAS 18 +#define SCE_KVIRC_DEFAULT 0 +#define SCE_KVIRC_COMMENT 1 +#define SCE_KVIRC_COMMENTBLOCK 2 +#define SCE_KVIRC_STRING 3 +#define SCE_KVIRC_WORD 4 +#define SCE_KVIRC_KEYWORD 5 +#define SCE_KVIRC_FUNCTION_KEYWORD 6 +#define SCE_KVIRC_FUNCTION 7 +#define SCE_KVIRC_VARIABLE 8 +#define SCE_KVIRC_NUMBER 9 +#define SCE_KVIRC_OPERATOR 10 +#define SCE_KVIRC_STRING_FUNCTION 11 +#define SCE_KVIRC_STRING_VARIABLE 12 +#define SCE_RUST_DEFAULT 0 +#define SCE_RUST_COMMENTBLOCK 1 +#define SCE_RUST_COMMENTLINE 2 +#define SCE_RUST_COMMENTBLOCKDOC 3 +#define SCE_RUST_COMMENTLINEDOC 4 +#define SCE_RUST_NUMBER 5 +#define SCE_RUST_WORD 6 +#define SCE_RUST_WORD2 7 +#define SCE_RUST_WORD3 8 +#define SCE_RUST_WORD4 9 +#define SCE_RUST_WORD5 10 +#define SCE_RUST_WORD6 11 +#define SCE_RUST_WORD7 12 +#define SCE_RUST_STRING 13 +#define SCE_RUST_STRINGR 14 +#define SCE_RUST_CHARACTER 15 +#define SCE_RUST_OPERATOR 16 +#define SCE_RUST_IDENTIFIER 17 +#define SCE_RUST_LIFETIME 18 +#define SCE_RUST_MACRO 19 +#define SCE_RUST_LEXERROR 20 +#define SCE_RUST_BYTESTRING 21 +#define SCE_RUST_BYTESTRINGR 22 +#define SCE_RUST_BYTECHARACTER 23 +#define SCE_DMAP_DEFAULT 0 +#define SCE_DMAP_COMMENT 1 +#define SCE_DMAP_NUMBER 2 +#define SCE_DMAP_STRING1 3 +#define SCE_DMAP_STRING2 4 +#define SCE_DMAP_STRINGEOL 5 +#define SCE_DMAP_OPERATOR 6 +#define SCE_DMAP_IDENTIFIER 7 +#define SCE_DMAP_WORD 8 +#define SCE_DMAP_WORD2 9 +#define SCE_DMAP_WORD3 10 +#define SCE_DMIS_DEFAULT 0 +#define SCE_DMIS_COMMENT 1 +#define SCE_DMIS_STRING 2 +#define SCE_DMIS_NUMBER 3 +#define SCE_DMIS_KEYWORD 4 +#define SCE_DMIS_MAJORWORD 5 +#define SCE_DMIS_MINORWORD 6 +#define SCE_DMIS_UNSUPPORTED_MAJOR 7 +#define SCE_DMIS_UNSUPPORTED_MINOR 8 +#define SCE_DMIS_LABEL 9 +#define SCE_REG_DEFAULT 0 +#define SCE_REG_COMMENT 1 +#define SCE_REG_VALUENAME 2 +#define SCE_REG_STRING 3 +#define SCE_REG_HEXDIGIT 4 +#define SCE_REG_VALUETYPE 5 +#define SCE_REG_ADDEDKEY 6 +#define SCE_REG_DELETEDKEY 7 +#define SCE_REG_ESCAPED 8 +#define SCE_REG_KEYPATH_GUID 9 +#define SCE_REG_STRING_GUID 10 +#define SCE_REG_PARAMETER 11 +#define SCE_REG_OPERATOR 12 +#define SCE_BIBTEX_DEFAULT 0 +#define SCE_BIBTEX_ENTRY 1 +#define SCE_BIBTEX_UNKNOWN_ENTRY 2 +#define SCE_BIBTEX_KEY 3 +#define SCE_BIBTEX_PARAMETER 4 +#define SCE_BIBTEX_VALUE 5 +#define SCE_BIBTEX_COMMENT 6 +#define SCE_HEX_DEFAULT 0 +#define SCE_HEX_RECSTART 1 +#define SCE_HEX_RECTYPE 2 +#define SCE_HEX_RECTYPE_UNKNOWN 3 +#define SCE_HEX_BYTECOUNT 4 +#define SCE_HEX_BYTECOUNT_WRONG 5 +#define SCE_HEX_NOADDRESS 6 +#define SCE_HEX_DATAADDRESS 7 +#define SCE_HEX_RECCOUNT 8 +#define SCE_HEX_STARTADDRESS 9 +#define SCE_HEX_ADDRESSFIELD_UNKNOWN 10 +#define SCE_HEX_EXTENDEDADDRESS 11 +#define SCE_HEX_DATA_ODD 12 +#define SCE_HEX_DATA_EVEN 13 +#define SCE_HEX_DATA_UNKNOWN 14 +#define SCE_HEX_DATA_EMPTY 15 +#define SCE_HEX_CHECKSUM 16 +#define SCE_HEX_CHECKSUM_WRONG 17 +#define SCE_HEX_GARBAGE 18 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif diff --git a/NppPlugin/include/Scintilla.h b/NppPlugin/include/Scintilla.h index c20a063f..079e3a4e 100644 --- a/NppPlugin/include/Scintilla.h +++ b/NppPlugin/include/Scintilla.h @@ -18,9 +18,9 @@ extern "C" { #if defined(_WIN32) /* Return false on failure: */ int Scintilla_RegisterClasses(void *hInstance); -int Scintilla_ReleaseResources(); +int Scintilla_ReleaseResources(void); #endif -int Scintilla_LinkLexers(); +int Scintilla_LinkLexers(void); #ifdef __cplusplus } @@ -50,7 +50,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_ADDTEXT 2001 #define SCI_ADDSTYLEDTEXT 2002 #define SCI_INSERTTEXT 2003 +#define SCI_CHANGEINSERTION 2672 #define SCI_CLEARALL 2004 +#define SCI_DELETERANGE 2645 #define SCI_CLEARDOCUMENTSTYLE 2005 #define SCI_GETLENGTH 2006 #define SCI_GETCHARAT 2007 @@ -90,9 +92,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETBUFFEREDDRAW 2035 #define SCI_SETTABWIDTH 2036 #define SCI_GETTABWIDTH 2121 +#define SCI_CLEARTABSTOPS 2675 +#define SCI_ADDTABSTOP 2676 +#define SCI_GETNEXTTABSTOP 2677 #define SC_CP_UTF8 65001 #define SCI_SETCODEPAGE 2037 -#define SCI_SETUSEPALETTE 2039 +#define SC_IME_WINDOWED 0 +#define SC_IME_INLINE 1 +#define SCI_GETIMEINTERACTION 2678 +#define SCI_SETIMEINTERACTION 2679 #define MARKER_MAX 31 #define SC_MARK_CIRCLE 0 #define SC_MARK_ROUNDRECT 1 @@ -124,6 +132,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MARK_LEFTRECT 27 #define SC_MARK_AVAILABLE 28 #define SC_MARK_UNDERLINE 29 +#define SC_MARK_RGBAIMAGE 30 +#define SC_MARK_BOOKMARK 31 #define SC_MARK_CHARACTER 10000 #define SC_MARKNUM_FOLDEREND 25 #define SC_MARKNUM_FOLDEROPENMID 26 @@ -136,6 +146,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_MARKERDEFINE 2040 #define SCI_MARKERSETFORE 2041 #define SCI_MARKERSETBACK 2042 +#define SCI_MARKERSETBACKSELECTED 2292 +#define SCI_MARKERENABLEHIGHLIGHT 2293 #define SCI_MARKERADD 2043 #define SCI_MARKERDELETE 2044 #define SCI_MARKERDELETEALL 2045 @@ -145,6 +157,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_MARKERDEFINEPIXMAP 2049 #define SCI_MARKERADDSET 2466 #define SCI_MARKERSETALPHA 2476 +#define SC_MAX_MARGIN 4 #define SC_MARGIN_SYMBOL 0 #define SC_MARGIN_NUMBER 1 #define SC_MARGIN_BACK 2 @@ -159,6 +172,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETMARGINMASKN 2245 #define SCI_SETMARGINSENSITIVEN 2246 #define SCI_GETMARGINSENSITIVEN 2247 +#define SCI_SETMARGINCURSORN 2248 +#define SCI_GETMARGINCURSORN 2249 #define STYLE_DEFAULT 32 #define STYLE_LINENUMBER 33 #define STYLE_BRACELIGHT 34 @@ -216,6 +231,14 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_STYLEGETCHANGEABLE 2492 #define SCI_STYLEGETHOTSPOT 2493 #define SCI_STYLESETCASE 2060 +#define SC_FONT_SIZE_MULTIPLIER 100 +#define SCI_STYLESETSIZEFRACTIONAL 2061 +#define SCI_STYLEGETSIZEFRACTIONAL 2062 +#define SC_WEIGHT_NORMAL 400 +#define SC_WEIGHT_SEMIBOLD 600 +#define SC_WEIGHT_BOLD 700 +#define SCI_STYLESETWEIGHT 2063 +#define SCI_STYLEGETWEIGHT 2064 #define SCI_STYLESETCHARACTERSET 2066 #define SCI_STYLESETHOTSPOT 2409 #define SCI_SETSELFORE 2067 @@ -233,6 +256,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETCARETPERIOD 2075 #define SCI_SETCARETPERIOD 2076 #define SCI_SETWORDCHARS 2077 +#define SCI_GETWORDCHARS 2646 #define SCI_BEGINUNDOACTION 2078 #define SCI_ENDUNDOACTION 2079 #define INDIC_PLAIN 0 @@ -243,7 +267,19 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define INDIC_HIDDEN 5 #define INDIC_BOX 6 #define INDIC_ROUNDBOX 7 -#define INDIC_MAX 31 +#define INDIC_STRAIGHTBOX 8 +#define INDIC_DASH 9 +#define INDIC_DOTS 10 +#define INDIC_SQUIGGLELOW 11 +#define INDIC_DOTBOX 12 +#define INDIC_SQUIGGLEPIXMAP 13 +#define INDIC_COMPOSITIONTHICK 14 +#define INDIC_COMPOSITIONTHIN 15 +#define INDIC_FULLBOX 16 +#define INDIC_TEXTFORE 17 +#define INDIC_IME 32 +#define INDIC_IME_MAX 35 +#define INDIC_MAX 35 #define INDIC_CONTAINER 8 #define INDIC0_MASK 0x20 #define INDIC1_MASK 0x40 @@ -255,6 +291,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDICGETFORE 2083 #define SCI_INDICSETUNDER 2510 #define SCI_INDICGETUNDER 2511 +#define SCI_INDICSETHOVERSTYLE 2680 +#define SCI_INDICGETHOVERSTYLE 2681 +#define SCI_INDICSETHOVERFORE 2682 +#define SCI_INDICGETHOVERFORE 2683 +#define SC_INDICVALUEBIT 0x1000000 +#define SC_INDICVALUEMASK 0xFFFFFF +#define SC_INDICFLAG_VALUEFORE 1 +#define SCI_INDICSETFLAGS 2684 +#define SCI_INDICGETFLAGS 2685 #define SCI_SETWHITESPACEFORE 2084 #define SCI_SETWHITESPACEBACK 2085 #define SCI_SETWHITESPACESIZE 2086 @@ -306,6 +351,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETLINEINDENTATION 2127 #define SCI_GETLINEINDENTPOSITION 2128 #define SCI_GETCOLUMN 2129 +#define SCI_COUNTCHARACTERS 2633 #define SCI_SETHSCROLLBAR 2130 #define SCI_GETHSCROLLBAR 2131 #define SC_IV_NONE 0 @@ -319,13 +365,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETLINEENDPOSITION 2136 #define SCI_GETCODEPAGE 2137 #define SCI_GETCARETFORE 2138 -#define SCI_GETUSEPALETTE 2139 #define SCI_GETREADONLY 2140 #define SCI_SETCURRENTPOS 2141 #define SCI_SETSELECTIONSTART 2142 #define SCI_GETSELECTIONSTART 2143 #define SCI_SETSELECTIONEND 2144 #define SCI_GETSELECTIONEND 2145 +#define SCI_SETEMPTYSELECTION 2556 #define SCI_SETPRINTMAGNIFICATION 2146 #define SCI_GETPRINTMAGNIFICATION 2147 #define SC_PRINT_NORMAL 0 @@ -335,11 +381,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_PRINT_COLOURONWHITEDEFAULTBG 4 #define SCI_SETPRINTCOLOURMODE 2148 #define SCI_GETPRINTCOLOURMODE 2149 -#define SCFIND_WHOLEWORD 2 -#define SCFIND_MATCHCASE 4 +#define SCFIND_WHOLEWORD 0x2 +#define SCFIND_MATCHCASE 0x4 #define SCFIND_WORDSTART 0x00100000 #define SCFIND_REGEXP 0x00200000 #define SCFIND_POSIX 0x00400000 +#define SCFIND_CXX11REGEX 0x00800000 #define SCI_FINDTEXT 2150 #define SCI_FORMATRANGE 2151 #define SCI_GETFIRSTVISIBLELINE 2152 @@ -360,6 +407,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_POSITIONFROMLINE 2167 #define SCI_LINESCROLL 2168 #define SCI_SCROLLCARET 2169 +#define SCI_SCROLLRANGE 2569 #define SCI_REPLACESEL 2170 #define SCI_SETREADONLY 2171 #define SCI_NULL 2172 @@ -384,6 +432,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETTARGETSTART 2191 #define SCI_SETTARGETEND 2192 #define SCI_GETTARGETEND 2193 +#define SCI_SETTARGETRANGE 2686 +#define SCI_GETTARGETTEXT 2687 #define SCI_REPLACETARGET 2194 #define SCI_REPLACETARGETRE 2195 #define SCI_SEARCHINTARGET 2197 @@ -393,11 +443,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CALLTIPCANCEL 2201 #define SCI_CALLTIPACTIVE 2202 #define SCI_CALLTIPPOSSTART 2203 +#define SCI_CALLTIPSETPOSSTART 2214 #define SCI_CALLTIPSETHLT 2204 #define SCI_CALLTIPSETBACK 2205 #define SCI_CALLTIPSETFORE 2206 #define SCI_CALLTIPSETFOREHLT 2207 #define SCI_CALLTIPUSESTYLE 2212 +#define SCI_CALLTIPSETPOSITION 2213 #define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_DOCLINEFROMVISIBLE 2221 #define SCI_WRAPCOUNT 2235 @@ -412,15 +464,29 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SHOWLINES 2226 #define SCI_HIDELINES 2227 #define SCI_GETLINEVISIBLE 2228 +#define SCI_GETALLLINESVISIBLE 2236 #define SCI_SETFOLDEXPANDED 2229 #define SCI_GETFOLDEXPANDED 2230 #define SCI_TOGGLEFOLD 2231 +#define SC_FOLDACTION_CONTRACT 0 +#define SC_FOLDACTION_EXPAND 1 +#define SC_FOLDACTION_TOGGLE 2 +#define SCI_FOLDLINE 2237 +#define SCI_FOLDCHILDREN 2238 +#define SCI_EXPANDCHILDREN 2239 +#define SCI_FOLDALL 2662 #define SCI_ENSUREVISIBLE 2232 +#define SC_AUTOMATICFOLD_SHOW 0x0001 +#define SC_AUTOMATICFOLD_CLICK 0x0002 +#define SC_AUTOMATICFOLD_CHANGE 0x0004 +#define SCI_SETAUTOMATICFOLD 2663 +#define SCI_GETAUTOMATICFOLD 2664 #define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 #define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 #define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 #define SC_FOLDFLAG_LEVELNUMBERS 0x0040 +#define SC_FOLDFLAG_LINESTATE 0x0080 #define SCI_SETFOLDFLAGS 2233 #define SCI_ENSUREVISIBLEENFORCEPOLICY 2234 #define SCI_SETTABINDENTS 2260 @@ -435,11 +501,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_WRAP_NONE 0 #define SC_WRAP_WORD 1 #define SC_WRAP_CHAR 2 +#define SC_WRAP_WHITESPACE 3 #define SCI_SETWRAPMODE 2268 #define SCI_GETWRAPMODE 2269 #define SC_WRAPVISUALFLAG_NONE 0x0000 #define SC_WRAPVISUALFLAG_END 0x0001 #define SC_WRAPVISUALFLAG_START 0x0002 +#define SC_WRAPVISUALFLAG_MARGIN 0x0004 #define SCI_SETWRAPVISUALFLAGS 2460 #define SCI_GETWRAPVISUALFLAGS 2461 #define SC_WRAPVISUALFLAGLOC_DEFAULT 0x0000 @@ -473,6 +541,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #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 +#define SCI_GETPHASESDRAW 2673 +#define SCI_SETPHASESDRAW 2674 #define SC_EFF_QUALITY_MASK 0xF #define SC_EFF_QUALITY_DEFAULT 0 #define SC_EFF_QUALITY_NON_ANTIALIASED 1 @@ -552,7 +625,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_MOVECARETINSIDEVIEW 2401 #define SCI_LINELENGTH 2350 #define SCI_BRACEHIGHLIGHT 2351 +#define SCI_BRACEHIGHLIGHTINDICATOR 2498 #define SCI_BRACEBADLIGHT 2352 +#define SCI_BRACEBADLIGHTINDICATOR 2499 #define SCI_BRACEMATCH 2353 #define SCI_GETVIEWEOL 2355 #define SCI_SETVIEWEOL 2356 @@ -585,12 +660,16 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_STATUS_OK 0 #define SC_STATUS_FAILURE 1 #define SC_STATUS_BADALLOC 2 +#define SC_STATUS_WARN_START 1000 +#define SC_STATUS_WARN_REGEX 1001 #define SCI_SETSTATUS 2382 #define SCI_GETSTATUS 2383 #define SCI_SETMOUSEDOWNCAPTURES 2384 #define SCI_GETMOUSEDOWNCAPTURES 2385 #define SC_CURSORNORMAL -1 +#define SC_CURSORARROW 2 #define SC_CURSORWAIT 4 +#define SC_CURSORREVERSEARROW 7 #define SCI_SETCURSOR 2386 #define SCI_GETCURSOR 2387 #define SCI_SETCONTROLCHARSYMBOL 2388 @@ -630,6 +709,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_PARAUPEXTEND 2416 #define SCI_POSITIONBEFORE 2417 #define SCI_POSITIONAFTER 2418 +#define SCI_POSITIONRELATIVE 2670 #define SCI_COPYRANGE 2419 #define SCI_COPYTEXT 2420 #define SC_SEL_STREAM 0 @@ -658,9 +738,25 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_WORDRIGHTEND 2441 #define SCI_WORDRIGHTENDEXTEND 2442 #define SCI_SETWHITESPACECHARS 2443 +#define SCI_GETWHITESPACECHARS 2647 +#define SCI_SETPUNCTUATIONCHARS 2648 +#define SCI_GETPUNCTUATIONCHARS 2649 #define SCI_SETCHARSDEFAULT 2444 #define SCI_AUTOCGETCURRENT 2445 #define SCI_AUTOCGETCURRENTTEXT 2610 +#define SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE 0 +#define SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1 +#define SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR 2634 +#define SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR 2635 +#define SC_MULTIAUTOC_ONCE 0 +#define SC_MULTIAUTOC_EACH 1 +#define SCI_AUTOCSETMULTI 2636 +#define SCI_AUTOCGETMULTI 2637 +#define SC_ORDER_PRESORTED 0 +#define SC_ORDER_PERFORMSORT 1 +#define SC_ORDER_CUSTOM 2 +#define SCI_AUTOCSETORDER 2660 +#define SCI_AUTOCGETORDER 2661 #define SCI_ALLOCATE 2446 #define SCI_TARGETASUTF8 2447 #define SCI_SETLENGTHFORENCODE 2448 @@ -699,10 +795,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETPOSITIONCACHE 2515 #define SCI_COPYALLOWLINE 2519 #define SCI_GETCHARACTERPOINTER 2520 -#define SCI_SETKEYSUNICODE 2521 -#define SCI_GETKEYSUNICODE 2522 +#define SCI_GETRANGEPOINTER 2643 +#define SCI_GETGAPPOSITION 2644 #define SCI_INDICSETALPHA 2523 #define SCI_INDICGETALPHA 2524 +#define SCI_INDICSETOUTLINEALPHA 2558 +#define SCI_INDICGETOUTLINEALPHA 2559 #define SCI_SETEXTRAASCENT 2525 #define SCI_GETEXTRAASCENT 2526 #define SCI_SETEXTRADESCENT 2527 @@ -717,6 +815,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_MARGINTEXTCLEARALL 2536 #define SCI_MARGINSETSTYLEOFFSET 2537 #define SCI_MARGINGETSTYLEOFFSET 2538 +#define SC_MARGINOPTION_NONE 0 +#define SC_MARGINOPTION_SUBLINESELECT 1 +#define SCI_SETMARGINOPTIONS 2539 +#define SCI_GETMARGINOPTIONS 2557 #define SCI_ANNOTATIONSETTEXT 2540 #define SCI_ANNOTATIONGETTEXT 2541 #define SCI_ANNOTATIONSETSTYLE 2542 @@ -728,14 +830,19 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define ANNOTATION_HIDDEN 0 #define ANNOTATION_STANDARD 1 #define ANNOTATION_BOXED 2 +#define ANNOTATION_INDENTED 3 #define SCI_ANNOTATIONSETVISIBLE 2548 #define SCI_ANNOTATIONGETVISIBLE 2549 #define SCI_ANNOTATIONSETSTYLEOFFSET 2550 #define SCI_ANNOTATIONGETSTYLEOFFSET 2551 +#define SCI_RELEASEALLEXTENDEDSTYLES 2552 +#define SCI_ALLOCATEEXTENDEDSTYLES 2553 #define UNDO_MAY_COALESCE 1 #define SCI_ADDUNDOACTION 2560 #define SCI_CHARPOSITIONFROMPOINT 2561 #define SCI_CHARPOSITIONFROMPOINTCLOSE 2562 +#define SCI_SETMOUSESELECTIONRECTANGULARSWITCH 2668 +#define SCI_GETMOUSESELECTIONRECTANGULARSWITCH 2669 #define SCI_SETMULTIPLESELECTION 2563 #define SCI_GETMULTIPLESELECTION 2564 #define SCI_SETADDITIONALSELECTIONTYPING 2565 @@ -745,9 +852,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETADDITIONALCARETSVISIBLE 2608 #define SCI_GETADDITIONALCARETSVISIBLE 2609 #define SCI_GETSELECTIONS 2570 +#define SCI_GETSELECTIONEMPTY 2650 #define SCI_CLEARSELECTIONS 2571 #define SCI_SETSELECTION 2572 #define SCI_ADDSELECTION 2573 +#define SCI_DROPSELECTIONN 2671 #define SCI_SETMAINSELECTION 2574 #define SCI_GETMAINSELECTION 2575 #define SCI_SETSELECTIONNCARET 2576 @@ -786,13 +895,49 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_ROTATESELECTION 2606 #define SCI_SWAPMAINANCHORCARET 2607 #define SCI_CHANGELEXERSTATE 2617 +#define SCI_CONTRACTEDFOLDNEXT 2618 +#define SCI_VERTICALCENTRECARET 2619 +#define SCI_MOVESELECTEDLINESUP 2620 +#define SCI_MOVESELECTEDLINESDOWN 2621 +#define SCI_SETIDENTIFIER 2622 +#define SCI_GETIDENTIFIER 2623 +#define SCI_RGBAIMAGESETWIDTH 2624 +#define SCI_RGBAIMAGESETHEIGHT 2625 +#define SCI_RGBAIMAGESETSCALE 2651 +#define SCI_MARKERDEFINERGBAIMAGE 2626 +#define SCI_REGISTERRGBAIMAGE 2627 +#define SCI_SCROLLTOSTART 2628 +#define SCI_SCROLLTOEND 2629 +#define SC_TECHNOLOGY_DEFAULT 0 +#define SC_TECHNOLOGY_DIRECTWRITE 1 +#define SC_TECHNOLOGY_DIRECTWRITERETAIN 2 +#define SC_TECHNOLOGY_DIRECTWRITEDC 3 +#define SCI_SETTECHNOLOGY 2630 +#define SCI_GETTECHNOLOGY 2631 +#define SCI_CREATELOADER 2632 +#define SCI_FINDINDICATORSHOW 2640 +#define SCI_FINDINDICATORFLASH 2641 +#define SCI_FINDINDICATORHIDE 2642 +#define SCI_VCHOMEDISPLAY 2652 +#define SCI_VCHOMEDISPLAYEXTEND 2653 +#define SCI_GETCARETLINEVISIBLEALWAYS 2654 +#define SCI_SETCARETLINEVISIBLEALWAYS 2655 +#define SC_LINE_END_TYPE_DEFAULT 0 +#define SC_LINE_END_TYPE_UNICODE 1 +#define SCI_SETLINEENDTYPESALLOWED 2656 +#define SCI_GETLINEENDTYPESALLOWED 2657 +#define SCI_GETLINEENDTYPESACTIVE 2658 +#define SCI_SETREPRESENTATION 2665 +#define SCI_GETREPRESENTATION 2666 +#define SCI_CLEARREPRESENTATION 2667 #define SCI_STARTRECORD 3001 #define SCI_STOPRECORD 3002 #define SCI_SETLEXER 4001 #define SCI_GETLEXER 4002 #define SCI_COLOURISE 4003 #define SCI_SETPROPERTY 4004 -#define KEYWORDSET_MAX 8 +// #define KEYWORDSET_MAX 8 +#define KEYWORDSET_MAX 30 #define SCI_SETKEYWORDS 4005 #define SCI_SETLEXERLANGUAGE 4006 #define SCI_LOADLEXERLIBRARY 4007 @@ -809,6 +954,16 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_PROPERTYTYPE 4015 #define SCI_DESCRIBEPROPERTY 4016 #define SCI_DESCRIBEKEYWORDSETS 4017 +#define SCI_GETLINEENDTYPESSUPPORTED 4018 +#define SCI_ALLOCATESUBSTYLES 4020 +#define SCI_GETSUBSTYLESSTART 4021 +#define SCI_GETSUBSTYLESLENGTH 4022 +#define SCI_GETSTYLEFROMSUBSTYLE 4027 +#define SCI_GETPRIMARYSTYLEFROMSTYLE 4028 +#define SCI_FREESUBSTYLES 4023 +#define SCI_SETIDENTIFIERS 4024 +#define SCI_DISTANCETOSECONDARYSTYLES 4025 +#define SCI_GETSUBSTYLEBASES 4026 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 #define SC_MOD_CHANGESTYLE 0x4 @@ -829,7 +984,14 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MOD_CHANGEANNOTATION 0x20000 #define SC_MOD_CONTAINER 0x40000 #define SC_MOD_LEXERSTATE 0x80000 -#define SC_MODEVENTMASKALL 0xFFFFF +#define SC_MOD_INSERTCHECK 0x100000 +#define SC_MOD_CHANGETABSTOPS 0x200000 +#define SC_MODEVENTMASKALL 0x3FFFFF +#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 1024 +#define SC_UPDATE_CONTENT 0x1 +#define SC_UPDATE_SELECTION 0x2 +#define SC_UPDATE_V_SCROLL 0x4 +#define SC_UPDATE_H_SCROLL 0x8 #define SCEN_CHANGE 768 #define SCEN_SETFOCUS 512 #define SCEN_KILLFOCUS 256 @@ -858,6 +1020,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCMOD_CTRL 2 #define SCMOD_ALT 4 #define SCMOD_SUPER 8 +#define SCMOD_META 16 #define SCN_STYLENEEDED 2000 #define SCN_CHARADDED 2001 #define SCN_SAVEPOINTREACHED 2002 @@ -884,13 +1047,18 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCN_INDICATORRELEASE 2024 #define SCN_AUTOCCANCELLED 2025 #define SCN_AUTOCCHARDELETED 2026 +#define SCN_HOTSPOTRELEASECLICK 2027 +#define SCN_FOCUSIN 2028 +#define SCN_FOCUSOUT 2029 +#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. */ -#ifdef SCI_NAMESPACE +#if defined(__cplusplus) && defined(SCI_NAMESPACE) namespace Scintilla { #endif @@ -906,7 +1074,7 @@ struct Sci_TextRange { struct Sci_TextToFind { struct Sci_CharacterRange chrg; - char *lpstrText; + const char *lpstrText; struct Sci_CharacterRange chrgText; }; @@ -949,11 +1117,22 @@ struct Sci_NotifyHeader { struct SCNotification { struct Sci_NotifyHeader nmhdr; - int position; /* SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART, SCN_DWELLEND */ + int 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 modifiers; /* SCN_KEY */ + int modifiers; + /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */ + /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ + int modificationType; /* SCN_MODIFIED */ - const char *text; /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */ + const char *text; + /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */ + int length; /* SCN_MODIFIED */ int linesAdded; /* SCN_MODIFIED */ int message; /* SCN_MACRORECORD */ @@ -967,16 +1146,31 @@ struct SCNotification { int x; /* SCN_DWELLSTART, SCN_DWELLEND */ int y; /* SCN_DWELLSTART, SCN_DWELLEND */ int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */ - int annotationLinesAdded; /* SC_MOD_CHANGEANNOTATION */ + int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */ + int updated; /* SCN_UPDATEUI */ }; -#ifdef SCI_NAMESPACE +struct SearchResultMarking { + long _start; + long _end; +}; + +struct SearchResultMarkings { + long _length; + 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 #endif diff --git a/NppPlugin/include/StaticDialog.h b/NppPlugin/include/StaticDialog.h index cc7dd600..7e912f0b 100644 --- a/NppPlugin/include/StaticDialog.h +++ b/NppPlugin/include/StaticDialog.h @@ -1,63 +1,81 @@ -//this file is part of notepad++ -//Copyright (C)2003 Don HO ( donho@altern.org ) +// This file is part of Notepad++ project +// Copyright (C)2003 Don HO // -//This program 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 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. +// Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. // -//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. - -#ifndef STATIC_DIALOG_H -#define STATIC_DIALOG_H - +// 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. +#pragma once +#include "Notepad_plus_msgs.h" #include "Window.h" -enum PosAlign{ALIGNPOS_LEFT, ALIGNPOS_RIGHT, ALIGNPOS_TOP, ALIGNPOS_BOTTOM}; +typedef HRESULT (WINAPI * ETDTProc) (HWND, DWORD); -struct DLGTEMPLATEEX { +enum class PosAlign { left, right, top, bottom }; + +struct DLGTEMPLATEEX +{ WORD dlgVer; WORD signature; DWORD helpID; DWORD exStyle; - DWORD style; + DWORD style; WORD cDlgItems; short x; - short y; + short y; short cx; short cy; // The structure has more fields but are variable length -} ; +}; class StaticDialog : public Window { public : - StaticDialog(){} - ~StaticDialog(); + virtual ~StaticDialog(); - virtual void create(int dialogID, bool isRTL = false); + virtual void create(int dialogID, bool isRTL = false, bool msgDestParent = true); virtual bool isCreated() const { return (_hSelf != NULL); } void goToCenter(); - void destroy(); -protected : + void display(bool toShow = true) const; + + POINT getTopPoint(HWND hwnd, bool isLeft = true) const; + + bool isCheckedOrNot(int checkControlID) const + { + return (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, checkControlID), BM_GETCHECK, 0, 0)); + } + + virtual void destroy() override; + +protected: RECT _rc; - static BOOL CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); - virtual BOOL CALLBACK run_dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) = 0; + static INT_PTR CALLBACK dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); + virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) = 0; void alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point); HGLOBAL makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate); }; - -#endif //STATIC_DIALOG_H diff --git a/NppPlugin/include/Window.h b/NppPlugin/include/Window.h index 16a0462e..e69e02f8 100644 --- a/NppPlugin/include/Window.h +++ b/NppPlugin/include/Window.h @@ -1,28 +1,44 @@ -//this file is part of notepad++ -//Copyright (C)2003 Don HO +// This file is part of Notepad++ project +// Copyright (C)2003 Don HO // -//This program 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 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. +// Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. // -//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. +// 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. + -#ifndef WINDOW_CONTROL_H -#define WINDOW_CONTROL_H +#pragma once +#include class Window { public: - Window(): _hInst(NULL), _hParent(NULL), _hSelf(NULL){}; - virtual ~Window() {}; + //! \name Constructors & Destructor + //@{ + Window() = default; + Window(const Window&) = delete; + virtual ~Window() = default; + //@} + virtual void init(HINSTANCE hInst, HWND parent) { @@ -32,86 +48,90 @@ class Window virtual void destroy() = 0; - virtual void display(bool toShow = true) const { - ::ShowWindow(_hSelf, toShow?SW_SHOW:SW_HIDE); - }; - + virtual void display(bool toShow = true) const + { + ::ShowWindow(_hSelf, toShow ? SW_SHOW : SW_HIDE); + } + + virtual void reSizeTo(RECT & rc) // should NEVER be const !!! - { + { ::MoveWindow(_hSelf, rc.left, rc.top, rc.right, rc.bottom, TRUE); redraw(); - }; + } + - virtual void reSizeToWH(RECT & rc) // should NEVER be const !!! - { + virtual void reSizeToWH(RECT& rc) // should NEVER be const !!! + { ::MoveWindow(_hSelf, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE); redraw(); - }; - - virtual void redraw() const { - ::InvalidateRect(_hSelf, NULL, TRUE); - ::UpdateWindow(_hSelf); - }; - - virtual void getClientRect(RECT & rc) const { + } + + + virtual void redraw(bool forceUpdate = false) const + { + ::InvalidateRect(_hSelf, nullptr, TRUE); + if (forceUpdate) + ::UpdateWindow(_hSelf); + } + + + virtual void getClientRect(RECT & rc) const + { ::GetClientRect(_hSelf, &rc); - }; + } - virtual void getWindowRect(RECT & rc) const { + virtual void getWindowRect(RECT & rc) const + { ::GetWindowRect(_hSelf, &rc); - }; + } - virtual int getWidth() const { + virtual int getWidth() const + { RECT rc; ::GetClientRect(_hSelf, &rc); return (rc.right - rc.left); - }; + } - virtual int getHeight() const { + virtual int getHeight() const + { RECT rc; ::GetClientRect(_hSelf, &rc); if (::IsWindowVisible(_hSelf) == TRUE) return (rc.bottom - rc.top); return 0; - }; + } - virtual bool isVisible() const { + virtual bool isVisible() const + { return (::IsWindowVisible(_hSelf)?true:false); - }; - - HWND getHSelf() const { - /* - if (!_hSelf) - { - ::MessageBox(NULL, TEXT("_hSelf == NULL"), TEXT("class Window"), MB_OK); - throw int(999); - } - */ + } + + HWND getHSelf() const + { return _hSelf; - }; + } HWND getHParent() const { return _hParent; - }; + } void getFocus() const { ::SetFocus(_hSelf); - }; - - HINSTANCE getHinst() const { - if (!_hInst) - { - ::MessageBox(NULL, TEXT("_hInst == NULL"), TEXT("class Window"), MB_OK); - throw int(1999); - } + } + + HINSTANCE getHinst() const + { + //assert(_hInst != 0); return _hInst; - }; -protected: - HINSTANCE _hInst; - HWND _hParent; - HWND _hSelf; -}; + } -#endif //WINDOW_CONTROL_H + Window& operator = (const Window&) = delete; + +protected: + HINSTANCE _hInst = NULL; + HWND _hParent = NULL; + HWND _hSelf = NULL; +}; \ No newline at end of file diff --git a/NppPlugin/include/dockingResource.h b/NppPlugin/include/dockingResource.h index 0d80683c..8b83f912 100644 --- a/NppPlugin/include/dockingResource.h +++ b/NppPlugin/include/dockingResource.h @@ -1,23 +1,36 @@ -//this file is part of docking functionality for Notepad++ -//Copyright (C)2006 Jens Lorenz +// this file is part of docking functionality for Notepad++ +// Copyright (C)2006 Jens Lorenz +// +// This program 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. +// +// Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. // -//This program 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. +// 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. + #ifndef DOCKING_RESOURCE_H #define DOCKING_RESOURCE_H +#define DM_NOFOCUSWHILECLICKINGCAPTION TEXT("NOFOCUSWHILECLICKINGCAPTION") + #define IDD_PLUGIN_DLG 103 #define IDC_EDIT1 1000 @@ -57,7 +70,12 @@ //nmhdr.hwndFrom = hwndNpp; //nmhdr.idFrom = ctrlIdNpp; - + #define DMN_SWITCHIN (DMN_FIRST + 4) + #define DMN_SWITCHOFF (DMN_FIRST + 5) + #define DMN_FLOATDROPPED (DMN_FIRST + 6) + //nmhdr.code = DWORD(DMN_XXX, 0); + //nmhdr.hwndFrom = DockingCont::_hself; + //nmhdr.idFrom = 0; #endif //DOCKING_RESOURCE_H diff --git a/NppPlugin/include/keys.h b/NppPlugin/include/keys.h index 17fd3ef4..9fc3abd7 100644 --- a/NppPlugin/include/keys.h +++ b/NppPlugin/include/keys.h @@ -1,3 +1,31 @@ +// This file is part of Notepad++ project +// Copyright (C)2003 Don HO +// +// This program 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. +// +// Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. +// +// 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. + + /* See winuser.h Altered list to support VK_0-9 and VK_A-Z @@ -175,4 +203,4 @@ Altered list to support VK_0-9 and VK_A-Z #define VK_ZOOM 0xFB #define VK_NONAME 0xFC #define VK_PA1 0xFD -#define VK_OEM_CLEAR 0xFE +#define VK_OEM_CLEAR 0xFE \ No newline at end of file diff --git a/NppPlugin/include/menuCmdID.h b/NppPlugin/include/menuCmdID.h index 5304c77c..6a6bd4a2 100644 --- a/NppPlugin/include/menuCmdID.h +++ b/NppPlugin/include/menuCmdID.h @@ -1,19 +1,30 @@ -//this file is part of notepad++ -//Copyright (C)2003 Don HO +// This file is part of Notepad++ project +// Copyright (C)2003 Don HO // -//This program 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 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. +// Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. // -//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. +// 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. + #ifndef MENUCMDID_H #define MENUCMDID_H @@ -21,6 +32,7 @@ #define IDM 40000 #define IDM_FILE (IDM + 1000) +// IMPORTANT: If list below is modified, you have to change the value of IDM_FILEMENU_LASTONE and IDM_FILEMENU_EXISTCMDPOSITION #define IDM_FILE_NEW (IDM_FILE + 1) #define IDM_FILE_OPEN (IDM_FILE + 2) #define IDM_FILE_CLOSE (IDM_FILE + 3) @@ -29,7 +41,7 @@ #define IDM_FILE_SAVE (IDM_FILE + 6) #define IDM_FILE_SAVEALL (IDM_FILE + 7) #define IDM_FILE_SAVEAS (IDM_FILE + 8) - //#define IDM_FILE_ASIAN_LANG (IDM_FILE + 9) + #define IDM_FILE_CLOSEALL_TOLEFT (IDM_FILE + 9) #define IDM_FILE_PRINT (IDM_FILE + 10) #define IDM_FILE_PRINTNOW 1001 #define IDM_FILE_EXIT (IDM_FILE + 11) @@ -39,10 +51,46 @@ #define IDM_FILE_SAVECOPYAS (IDM_FILE + 15) #define IDM_FILE_DELETE (IDM_FILE + 16) #define IDM_FILE_RENAME (IDM_FILE + 17) + #define IDM_FILE_CLOSEALL_TORIGHT (IDM_FILE + 18) + #define IDM_FILE_OPEN_FOLDER (IDM_FILE + 19) + #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) +// IMPORTANT: If list above is modified, you have to change the following values: - // A mettre à jour si on ajoute nouveau menu item dans le menu "File" - #define IDM_FILEMENU_LASTONE IDM_FILE_RENAME - +// To be updated if new menu item(s) is (are) added in menu "File" + #define IDM_FILEMENU_LASTONE IDM_FILE_OPEN_DEFAULT_VIEWER + +// 0 based position of command "Exit" including the bars in the file menu +// and without counting "Recent files history" items + +// 0 New +// 1 Open... +// 2 Open Containing Folder +// 3 Open Folder as Workspace +// 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) #define IDM_EDIT_CUT (IDM_EDIT + 1) #define IDM_EDIT_COPY (IDM_EDIT + 2) @@ -51,6 +99,7 @@ #define IDM_EDIT_PASTE (IDM_EDIT + 5) #define IDM_EDIT_DELETE (IDM_EDIT + 6) #define IDM_EDIT_SELECTALL (IDM_EDIT + 7) + #define IDM_EDIT_BEGINENDSELECT (IDM_EDIT + 20) #define IDM_EDIT_INS_TAB (IDM_EDIT + 8) #define IDM_EDIT_RMV_TAB (IDM_EDIT + 9) @@ -62,6 +111,29 @@ #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) + #define IDM_EDIT_BLANKLINEBELOWCURRENT (IDM_EDIT + 58) + #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_ASCENDING (IDM_EDIT + 59) + #define IDM_EDIT_SORTLINES_LEXICOGRAPHIC_DESCENDING (IDM_EDIT + 60) + #define IDM_EDIT_SORTLINES_INTEGER_ASCENDING (IDM_EDIT + 61) + #define IDM_EDIT_SORTLINES_INTEGER_DESCENDING (IDM_EDIT + 62) + #define IDM_EDIT_SORTLINES_DECIMALCOMMA_ASCENDING (IDM_EDIT + 63) + #define IDM_EDIT_SORTLINES_DECIMALCOMMA_DESCENDING (IDM_EDIT + 64) + #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) @@ -72,7 +144,15 @@ #define IDM_EDIT_BLOCK_COMMENT (IDM_EDIT + 22) #define IDM_EDIT_STREAM_COMMENT (IDM_EDIT + 23) #define IDM_EDIT_TRIMTRAILING (IDM_EDIT + 24) - + #define IDM_EDIT_TRIMLINEHEAD (IDM_EDIT + 42) + #define IDM_EDIT_TRIM_BOTH (IDM_EDIT + 43) + #define IDM_EDIT_EOL2WS (IDM_EDIT + 44) + #define IDM_EDIT_TRIMALL (IDM_EDIT + 45) + #define IDM_EDIT_TAB2SW (IDM_EDIT + 46) + #define IDM_EDIT_SW2TAB_LEADING (IDM_EDIT + 53) + #define IDM_EDIT_SW2TAB_ALL (IDM_EDIT + 54) + #define IDM_EDIT_STREAM_UNCOMMENT (IDM_EDIT + 47) + // Menu macro #define IDM_MACRO_SAVECURRENTMACRO (IDM_EDIT + 25) //----------- @@ -92,17 +172,25 @@ #define IDM_EDIT_COLUMNMODE (IDM_EDIT + 34) #define IDM_EDIT_BLOCK_COMMENT_SET (IDM_EDIT + 35) #define IDM_EDIT_BLOCK_UNCOMMENT (IDM_EDIT + 36) + #define IDM_EDIT_COLUMNMODETIP (IDM_EDIT + 37) + #define IDM_EDIT_PASTE_AS_HTML (IDM_EDIT + 38) + #define IDM_EDIT_PASTE_AS_RTF (IDM_EDIT + 39) + #define IDM_EDIT_COPY_BINARY (IDM_EDIT + 48) + #define IDM_EDIT_CUT_BINARY (IDM_EDIT + 49) + #define IDM_EDIT_PASTE_BINARY (IDM_EDIT + 50) + #define IDM_EDIT_CHAR_PANEL (IDM_EDIT + 51) + #define IDM_EDIT_CLIPBOARDHISTORY_PANEL (IDM_EDIT + 52) #define IDM_EDIT_AUTOCOMPLETE (50000 + 0) #define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000 + 1) #define IDM_EDIT_FUNCCALLTIP (50000 + 2) + #define IDM_EDIT_AUTOCOMPLETE_PATH (50000 + 6) //Belong to MENU FILE #define IDM_OPEN_ALL_RECENT_FILE (IDM_EDIT + 40) #define IDM_CLEAN_RECENT_FILE_LIST (IDM_EDIT + 41) #define IDM_SEARCH (IDM + 3000) - #define IDM_SEARCH_FIND (IDM_SEARCH + 1) #define IDM_SEARCH_FINDNEXT (IDM_SEARCH + 2) #define IDM_SEARCH_REPLACE (IDM_SEARCH + 3) @@ -153,7 +241,16 @@ #define IDM_SEARCH_SETANDFINDNEXT (IDM_SEARCH + 48) #define IDM_SEARCH_SETANDFINDPREV (IDM_SEARCH + 49) - + #define IDM_SEARCH_INVERSEMARKS (IDM_SEARCH + 50) + #define IDM_SEARCH_DELETEUNMARKEDLINES (IDM_SEARCH + 51) + #define IDM_SEARCH_FINDCHARINRANGE (IDM_SEARCH + 52) + #define IDM_SEARCH_SELECTMATCHINGBRACES (IDM_SEARCH + 53) + #define IDM_SEARCH_MARK (IDM_SEARCH + 54) + +#define IDM_MISC (IDM + 3500) + #define IDM_FILESWITCHER_FILESCLOSE (IDM_MISC + 1) + #define IDM_FILESWITCHER_FILESCLOSEOTHERS (IDM_MISC + 2) + #define IDM_VIEW (IDM + 4000) //#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1) @@ -166,7 +263,7 @@ #define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8) #define IDM_VIEW_POSTIT (IDM_VIEW + 9) #define IDM_VIEW_TOGGLE_FOLDALL (IDM_VIEW + 10) - #define IDM_VIEW_USER_DLG (IDM_VIEW + 11) + //#define IDM_VIEW_USER_DLG (IDM_VIEW + 11) #define IDM_VIEW_LINENUMBER (IDM_VIEW + 12) #define IDM_VIEW_SYMBOLMARGIN (IDM_VIEW + 13) #define IDM_VIEW_FOLDERMAGIN (IDM_VIEW + 14) @@ -201,6 +298,10 @@ #define IDM_VIEW_DRAWTABBAR_VERTICAL (IDM_VIEW + 43) #define IDM_VIEW_DRAWTABBAR_MULTILINE (IDM_VIEW + 44) #define IDM_VIEW_DOCCHANGEMARGIN (IDM_VIEW + 45) + #define IDM_VIEW_LWDEF (IDM_VIEW + 46) + #define IDM_VIEW_LWALIGN (IDM_VIEW + 47) + #define IDM_VIEW_LWINDENT (IDM_VIEW + 48) + #define IDM_VIEW_SUMMARY (IDM_VIEW + 49) #define IDM_VIEW_FOLD (IDM_VIEW + 50) #define IDM_VIEW_FOLD_1 (IDM_VIEW_FOLD + 1) @@ -212,7 +313,7 @@ #define IDM_VIEW_FOLD_7 (IDM_VIEW_FOLD + 7) #define IDM_VIEW_FOLD_8 (IDM_VIEW_FOLD + 8) - #define IDM_VIEW_UNFOLD (IDM_VIEW + 60) + #define IDM_VIEW_UNFOLD (IDM_VIEW + 60) #define IDM_VIEW_UNFOLD_1 (IDM_VIEW_UNFOLD + 1) #define IDM_VIEW_UNFOLD_2 (IDM_VIEW_UNFOLD + 2) #define IDM_VIEW_UNFOLD_3 (IDM_VIEW_UNFOLD + 3) @@ -221,14 +322,41 @@ #define IDM_VIEW_UNFOLD_6 (IDM_VIEW_UNFOLD + 6) #define IDM_VIEW_UNFOLD_7 (IDM_VIEW_UNFOLD + 7) #define IDM_VIEW_UNFOLD_8 (IDM_VIEW_UNFOLD + 8) - + + #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) + + #define IDM_VIEW_PROJECT_PANEL_1 (IDM_VIEW + 81) + #define IDM_VIEW_PROJECT_PANEL_2 (IDM_VIEW + 82) + #define IDM_VIEW_PROJECT_PANEL_3 (IDM_VIEW + 83) + + #define IDM_VIEW_FUNC_LIST (IDM_VIEW + 84) + #define IDM_VIEW_FILEBROWSER (IDM_VIEW + 85) + + #define IDM_VIEW_TAB1 (IDM_VIEW + 86) + #define IDM_VIEW_TAB2 (IDM_VIEW + 87) + #define IDM_VIEW_TAB3 (IDM_VIEW + 88) + #define IDM_VIEW_TAB4 (IDM_VIEW + 89) + #define IDM_VIEW_TAB5 (IDM_VIEW + 90) + #define IDM_VIEW_TAB6 (IDM_VIEW + 91) + #define IDM_VIEW_TAB7 (IDM_VIEW + 92) + #define IDM_VIEW_TAB8 (IDM_VIEW + 93) + #define IDM_VIEW_TAB9 (IDM_VIEW + 94) + #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_GOTO_ANOTHER_VIEW 10001 #define IDM_VIEW_CLONE_TO_ANOTHER_VIEW 10002 #define IDM_VIEW_GOTO_NEW_INSTANCE 10003 #define IDM_VIEW_LOAD_IN_NEW_INSTANCE 10004 - #define IDM_VIEW_SWITCHTO_OTHER_VIEW (IDM_VIEW + 72) - + #define IDM_FORMAT (IDM + 5000) #define IDM_FORMAT_TODOS (IDM_FORMAT + 1) #define IDM_FORMAT_TOUNIX (IDM_FORMAT + 2) @@ -263,12 +391,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) @@ -303,10 +431,10 @@ #define IDM_LANG_C (IDM_LANG + 2) #define IDM_LANG_CPP (IDM_LANG + 3) #define IDM_LANG_JAVA (IDM_LANG + 4) - #define IDM_LANG_HTML (IDM_LANG + 5) + #define IDM_LANG_HTML (IDM_LANG + 5) #define IDM_LANG_XML (IDM_LANG + 6) #define IDM_LANG_JS (IDM_LANG + 7) - #define IDM_LANG_PHP (IDM_LANG + 8) + #define IDM_LANG_PHP (IDM_LANG + 8) #define IDM_LANG_ASP (IDM_LANG + 9) #define IDM_LANG_CSS (IDM_LANG + 10) #define IDM_LANG_PASCAL (IDM_LANG + 11) @@ -354,12 +482,43 @@ #define IDM_LANG_POWERSHELL (IDM_LANG + 53) #define IDM_LANG_R (IDM_LANG + 54) #define IDM_LANG_JSP (IDM_LANG + 55) + #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_ABOUT (IDM + 7000) @@ -371,20 +530,33 @@ #define IDM_UPDATE_NPP (IDM_ABOUT + 6) #define IDM_WIKIFAQ (IDM_ABOUT + 7) #define IDM_HELP (IDM_ABOUT + 8) + #define IDM_CONFUPDATERPROXY (IDM_ABOUT + 9) + #define IDM_CMDLINEARGUMENTS (IDM_ABOUT + 10) + #define IDM_ONLINESUPPORT (IDM_ABOUT + 11) + #define IDM_DEBUGINFO (IDM_ABOUT + 12) #define IDM_SETTING (IDM + 8000) - #define IDM_SETTING_TAB_SIZE (IDM_SETTING + 1) - #define IDM_SETTING_TAB_REPLCESPACE (IDM_SETTING + 2) - #define IDM_SETTING_HISTORY_SIZE (IDM_SETTING + 3) - #define IDM_SETTING_EDGE_SIZE (IDM_SETTING + 4) +// #define IDM_SETTING_TAB_SIZE (IDM_SETTING + 1) +// #define IDM_SETTING_TAB_REPLCESPACE (IDM_SETTING + 2) +// #define IDM_SETTING_HISTORY_SIZE (IDM_SETTING + 3) +// #define IDM_SETTING_EDGE_SIZE (IDM_SETTING + 4) #define IDM_SETTING_IMPORTPLUGIN (IDM_SETTING + 5) #define IDM_SETTING_IMPORTSTYLETHEMS (IDM_SETTING + 6) #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_AUTOCNBCHAR (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_EXECUTE (IDM + 9000) diff --git a/NppPlugin/project/NppPlugin.vcxproj b/NppPlugin/project/NppPlugin.vcxproj index e7f58e7e..ec6d9b97 100644 --- a/NppPlugin/project/NppPlugin.vcxproj +++ b/NppPlugin/project/NppPlugin.vcxproj @@ -108,7 +108,6 @@ - Create @@ -124,7 +123,6 @@ - diff --git a/NppPlugin/project/NppPlugin.vcxproj.filters b/NppPlugin/project/NppPlugin.vcxproj.filters index a6a99ed7..e67e8660 100644 --- a/NppPlugin/project/NppPlugin.vcxproj.filters +++ b/NppPlugin/project/NppPlugin.vcxproj.filters @@ -35,9 +35,6 @@ Header Files - - Header Files - Header Files diff --git a/NppPlugin/src/DockingDlgInterface.cpp b/NppPlugin/src/DockingDlgInterface.cpp deleted file mode 100644 index d81e8b34..00000000 --- a/NppPlugin/src/DockingDlgInterface.cpp +++ /dev/null @@ -1,124 +0,0 @@ -//this file is part of notepad++ -//Copyright (C)2003 Don HO ( donho@altern.org ) -// -//This program 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. - -#include "stdafx.h" -#include "Notepad_plus_msgs.h" -#include "Docking.h" -#include "dockingResource.h" -#include "DockingDlgInterface.h" - -DockingDlgInterface::DockingDlgInterface(): - _HSource(NULL), - _data(NULL), - _dlgID(-1), - _isFloating(TRUE), - _iDockedPos(0), - _pluginName(TEXT("")) -{} - -DockingDlgInterface::DockingDlgInterface(int dlgID): - _HSource(NULL), - _data(NULL), - _dlgID(dlgID), - _isFloating(TRUE), - _iDockedPos(0), - _pluginName(TEXT("")) -{} - -void DockingDlgInterface::init(HINSTANCE hInst, HWND parent) -{ - StaticDialog::init(hInst, parent); - TCHAR temp[MAX_PATH]; - ::GetModuleFileName((HMODULE)hInst, temp, MAX_PATH); - _moduleName = PathFindFileName(temp); -} - -void DockingDlgInterface::create(tTbData * data, bool isRTL/* = false*/) -{ - StaticDialog::create(_dlgID, isRTL); - TCHAR temp[MAX_PATH]; - ::GetWindowText(_hSelf, temp, MAX_PATH); - _pluginName = temp; - // user information - data->hClient = _hSelf; - data->pszName = (TCHAR *)_pluginName.c_str(); - - // supported features by plugin - data->uMask = 0; - - // additional info - data->pszAddInfo = NULL; - - _data = data; - -} - -void DockingDlgInterface::updateDockingDlg() -{ - ::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, (LPARAM)_hSelf); -} - -void DockingDlgInterface::display(bool toShow /*= true*/) const -{ - ::SendMessage(_hParent, toShow?NPPM_DMMSHOW:NPPM_DMMHIDE, 0, (LPARAM)_hSelf); -} - -const TCHAR * DockingDlgInterface::getPluginFileName() const -{ - return _moduleName.c_str(); -} - -BOOL CALLBACK DockingDlgInterface::run_dlgProc(UINT message, WPARAM, LPARAM lParam) -{ - switch (message) - { - - case WM_NOTIFY: - { - LPNMHDR pnmh = (LPNMHDR)lParam; - - if (pnmh->hwndFrom == _hParent) - { - switch (LOWORD(pnmh->code)) - { - case DMN_CLOSE: - { - break; - } - case DMN_FLOAT: - { - _isFloating = true; - break; - } - case DMN_DOCK: - { - _iDockedPos = HIWORD(pnmh->code); - _isFloating = false; - break; - } - default: - break; - } - } - break; - } - default: - break; - } - return FALSE; -} - diff --git a/NppPlugin/src/StaticDialog.cpp b/NppPlugin/src/StaticDialog.cpp index 2a8e867f..b18ce0ce 100644 --- a/NppPlugin/src/StaticDialog.cpp +++ b/NppPlugin/src/StaticDialog.cpp @@ -1,45 +1,76 @@ -//this file is part of notepad++ -//Copyright (C)2003 Don HO ( donho@altern.org ) +// This file is part of Notepad++ project +// Copyright (C)2003 Don HO // -//This program 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 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. +// Note that the GPL places important restrictions on "derived works", yet +// it does not provide a detailed definition of that term. To avoid +// misunderstandings, we consider an application to constitute a +// "derivative work" for the purpose of this license if it does any of the +// following: +// 1. Integrates source code from Notepad++. +// 2. Integrates/includes/aggregates Notepad++ into a proprietary executable +// installer, such as those produced by InstallShield. +// 3. Links to a library or executes a program that does any of the above. // -//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. +// 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. #include "stdafx.h" +#include +#include #include "StaticDialog.h" -#include "SysMsg.h" -#include "Notepad_plus_msgs.h" - -#define WS_EX_LAYOUTRTL 0x00400000L +#include "Common.h" StaticDialog::~StaticDialog() { if (isCreated()) { + // Prevent run_dlgProc from doing anything, since its virtual ::SetWindowLongPtr(_hSelf, GWLP_USERDATA, NULL); - StaticDialog::destroy(); + destroy(); } } +void StaticDialog::destroy() +{ + ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, reinterpret_cast(_hSelf)); + ::DestroyWindow(_hSelf); +} + +POINT StaticDialog::getTopPoint(HWND hwnd, bool isLeft) const +{ + RECT rc; + ::GetWindowRect(hwnd, &rc); + + POINT p; + if (isLeft) + p.x = rc.left; + else + p.x = rc.right; + + p.y = rc.top; + ::ScreenToClient(_hSelf, &p); + return p; +} void StaticDialog::goToCenter() { - RECT rc; - ::GetClientRect(_hParent, &rc); - POINT center; - center.x = rc.left + (rc.right - rc.left)/2; - center.y = rc.top + (rc.bottom - rc.top)/2; - ::ClientToScreen(_hParent, ¢er); + RECT rc; + ::GetClientRect(_hParent, &rc); + POINT center; + center.x = rc.left + (rc.right - rc.left)/2; + center.y = rc.top + (rc.bottom - rc.top)/2; + ::ClientToScreen(_hParent, ¢er); int x = center.x - (_rc.right - _rc.left)/2; int y = center.y - (_rc.bottom - _rc.top)/2; @@ -47,21 +78,60 @@ void StaticDialog::goToCenter() ::SetWindowPos(_hSelf, HWND_TOP, x, y, _rc.right - _rc.left, _rc.bottom - _rc.top, SWP_SHOWWINDOW); } +void StaticDialog::display(bool toShow) const +{ + if (toShow) + { + // If the user has switched from a dual monitor to a single monitor since we last + // displayed the dialog, then ensure that it's still visible on the single monitor. + RECT workAreaRect = {0}; + RECT rc = {0}; + ::SystemParametersInfo(SPI_GETWORKAREA, 0, &workAreaRect, 0); + ::GetWindowRect(_hSelf, &rc); + int newLeft = rc.left; + int newTop = rc.top; + int margin = ::GetSystemMetrics(SM_CYSMCAPTION); + + if (newLeft > ::GetSystemMetrics(SM_CXVIRTUALSCREEN)-margin) + newLeft -= rc.right - workAreaRect.right; + if (newLeft + (rc.right - rc.left) < ::GetSystemMetrics(SM_XVIRTUALSCREEN)+margin) + newLeft = workAreaRect.left; + if (newTop > ::GetSystemMetrics(SM_CYVIRTUALSCREEN)-margin) + newTop -= rc.bottom - workAreaRect.bottom; + if (newTop + (rc.bottom - rc.top) < ::GetSystemMetrics(SM_YVIRTUALSCREEN)+margin) + newTop = workAreaRect.top; + + if ((newLeft != rc.left) || (newTop != rc.top)) // then the virtual screen size has shrunk + // Remember that MoveWindow wants width/height. + ::MoveWindow(_hSelf, newLeft, newTop, rc.right - rc.left, rc.bottom - rc.top, TRUE); + } + + Window::display(toShow); +} + HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate) { // Get Dlg Template resource HRSRC hDialogRC = ::FindResource(_hInst, MAKEINTRESOURCE(dialogID), RT_DIALOG); + if (!hDialogRC) + return NULL; + HGLOBAL hDlgTemplate = ::LoadResource(_hInst, hDialogRC); - DLGTEMPLATE *pDlgTemplate = (DLGTEMPLATE *)::LockResource(hDlgTemplate); - + if (!hDlgTemplate) + return NULL; + + DLGTEMPLATE *pDlgTemplate = static_cast(::LockResource(hDlgTemplate)); + if (!pDlgTemplate) + return NULL; + // Duplicate Dlg Template resource unsigned long sizeDlg = ::SizeofResource(_hInst, hDialogRC); HGLOBAL hMyDlgTemplate = ::GlobalAlloc(GPTR, sizeDlg); - *ppMyDlgTemplate = (DLGTEMPLATE *)::GlobalLock(hMyDlgTemplate); + *ppMyDlgTemplate = static_cast(::GlobalLock(hMyDlgTemplate)); ::memcpy(*ppMyDlgTemplate, pDlgTemplate, sizeDlg); - - DLGTEMPLATEEX *pMyDlgTemplateEx = (DLGTEMPLATEEX *)*ppMyDlgTemplate; + + DLGTEMPLATEEX *pMyDlgTemplateEx = reinterpret_cast(*ppMyDlgTemplate); if (pMyDlgTemplateEx->signature == 0xFFFF) pMyDlgTemplateEx->exStyle |= WS_EX_LAYOUTRTL; else @@ -70,89 +140,90 @@ HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplat return hMyDlgTemplate; } -void StaticDialog::create(int dialogID, bool isRTL) +void StaticDialog::create(int dialogID, bool isRTL, bool msgDestParent) { if (isRTL) { DLGTEMPLATE *pMyDlgTemplate = NULL; HGLOBAL hMyDlgTemplate = makeRTLResource(dialogID, &pMyDlgTemplate); - _hSelf = ::CreateDialogIndirectParam(_hInst, pMyDlgTemplate, _hParent, (DLGPROC)dlgProc, (LPARAM)this); + _hSelf = ::CreateDialogIndirectParam(_hInst, pMyDlgTemplate, _hParent, dlgProc, reinterpret_cast(this)); ::GlobalFree(hMyDlgTemplate); } else - _hSelf = ::CreateDialogParam(_hInst, MAKEINTRESOURCE(dialogID), _hParent, (DLGPROC)dlgProc, (LPARAM)this); + _hSelf = ::CreateDialogParam(_hInst, MAKEINTRESOURCE(dialogID), _hParent, dlgProc, reinterpret_cast(this)); if (!_hSelf) { - //systemMessage("StaticDialog"); - throw int(666); + generic_string errMsg = TEXT("CreateDialogParam() return NULL.\rGetLastError(): "); + errMsg += GetLastErrorAsString(); + ::MessageBox(NULL, errMsg.c_str(), TEXT("In StaticDialog::create()"), MB_OK); + return; } - ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGADD, (WPARAM)_hSelf); + // if the destination of message NPPM_MODELESSDIALOG is not its parent, then it's the grand-parent + ::SendMessage(msgDestParent ? _hParent : (::GetParent(_hParent)), NPPM_MODELESSDIALOG, MODELESSDIALOGADD, reinterpret_cast(_hSelf)); } -BOOL CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { - switch (message) + switch (message) { - case WM_INITDIALOG : + case WM_INITDIALOG: { - StaticDialog *pStaticDlg = (StaticDialog *)(lParam); + StaticDialog *pStaticDlg = reinterpret_cast(lParam); pStaticDlg->_hSelf = hwnd; - ::SetWindowLong(hwnd, GWL_USERDATA, (long)lParam); + ::SetWindowLongPtr(hwnd, GWLP_USERDATA, static_cast(lParam)); ::GetWindowRect(hwnd, &(pStaticDlg->_rc)); - pStaticDlg->run_dlgProc(hwnd, message, wParam, lParam); - + pStaticDlg->run_dlgProc(message, wParam, lParam); + return TRUE; } - default : + default: { StaticDialog *pStaticDlg = reinterpret_cast(::GetWindowLongPtr(hwnd, GWLP_USERDATA)); if (!pStaticDlg) return FALSE; - return pStaticDlg->run_dlgProc(hwnd, message, wParam, lParam); - + return pStaticDlg->run_dlgProc(message, wParam, lParam); } } } void StaticDialog::alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT & point) { - RECT rc, rc2; - ::GetWindowRect(handle, &rc); - - point.x = rc.left; - point.y = rc.top; - - switch (pos) - { - case ALIGNPOS_LEFT : - ::GetWindowRect(handle2Align, &rc2); - point.x -= rc2.right - rc2.left; - break; - - case ALIGNPOS_RIGHT : - ::GetWindowRect(handle, &rc2); - point.x += rc2.right - rc2.left; - break; - - case ALIGNPOS_TOP : - ::GetWindowRect(handle2Align, &rc2); - point.y -= rc2.bottom - rc2.top; - break; - - default : //ALIGNPOS_BOTTOM - ::GetWindowRect(handle, &rc2); - point.y += rc2.bottom - rc2.top; - break; - } - - ::ScreenToClient(_hSelf, &point); -} + RECT rc, rc2; + ::GetWindowRect(handle, &rc); -void StaticDialog::destroy() -{ - ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, (WPARAM)_hSelf); - ::DestroyWindow(_hSelf); -} \ No newline at end of file + point.x = rc.left; + point.y = rc.top; + + switch (pos) + { + case PosAlign::left: + { + ::GetWindowRect(handle2Align, &rc2); + point.x -= rc2.right - rc2.left; + break; + } + case PosAlign::right: + { + ::GetWindowRect(handle, &rc2); + point.x += rc2.right - rc2.left; + break; + } + case PosAlign::top: + { + ::GetWindowRect(handle2Align, &rc2); + point.y -= rc2.bottom - rc2.top; + break; + } + case PosAlign::bottom: + { + ::GetWindowRect(handle, &rc2); + point.y += rc2.bottom - rc2.top; + break; + } + } + + ::ScreenToClient(_hSelf, &point); +} diff --git a/NppPlugin/stdafx.cpp b/NppPlugin/stdafx.cpp index 1577c4e3..c0acfbdd 100644 --- a/NppPlugin/stdafx.cpp +++ b/NppPlugin/stdafx.cpp @@ -1 +1,27 @@ -#include "stdafx.h" \ No newline at end of file +#include "stdafx.h" + +//Added single function from N++ Common.cpp +#include "Common.h" +#include "tchar.h" + +generic_string GetLastErrorAsString(DWORD errorCode) +{ + generic_string errorMsg(_T("")); + // Get the error message, if any. + // If both error codes (passed error n GetLastError) are 0, then return empty + if (errorCode == 0) + errorCode = GetLastError(); + if (errorCode == 0) + return errorMsg; //No error message has been recorded + + LPWSTR messageBuffer = nullptr; + FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + nullptr, errorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&messageBuffer, 0, nullptr); + + errorMsg += messageBuffer; + + //Free the buffer. + LocalFree(messageBuffer); + + return errorMsg; +} \ No newline at end of file diff --git a/PythonScript/src/AboutDialog.h b/PythonScript/src/AboutDialog.h index c2a0c647..bcd25aa8 100644 --- a/PythonScript/src/AboutDialog.h +++ b/PythonScript/src/AboutDialog.h @@ -18,7 +18,7 @@ class AboutDialog : public StaticDialog void doDialog(); protected: - BOOL CALLBACK run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam); + INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); private: HBRUSH m_hbrBackground; diff --git a/PythonScript/src/AboutDialog2.cpp b/PythonScript/src/AboutDialog2.cpp index 1be5ae5b..e7e3d111 100644 --- a/PythonScript/src/AboutDialog2.cpp +++ b/PythonScript/src/AboutDialog2.cpp @@ -27,7 +27,7 @@ void AboutDialog::doDialog() } -BOOL CALLBACK AboutDialog::run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM /* lParam */) +INT_PTR CALLBACK AboutDialog::run_dlgProc(UINT Message, WPARAM wParam, LPARAM /* lParam */) { switch (Message) { @@ -44,8 +44,8 @@ BOOL CALLBACK AboutDialog::run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, L ++pos; } - ::SetWindowTextA(GetDlgItem(hWnd, IDC_COPYRIGHT), message.c_str()); - ::SetWindowText(GetDlgItem(hWnd, IDC_VERSION), _T(PYSCR_VERSION_STRING)); + ::SetWindowTextA(GetDlgItem(_hSelf, IDC_COPYRIGHT), message.c_str()); + ::SetWindowText(GetDlgItem(_hSelf, IDC_VERSION), _T(PYSCR_VERSION_STRING)); return TRUE; } diff --git a/PythonScript/src/ConsoleDialog.cpp b/PythonScript/src/ConsoleDialog.cpp index 2a0e5586..2584e20e 100644 --- a/PythonScript/src/ConsoleDialog.cpp +++ b/PythonScript/src/ConsoleDialog.cpp @@ -29,27 +29,6 @@ ConsoleDialog::ConsoleDialog() : m_historyIter = m_history.end(); } -//lint -e1554 Direct pointer copy of member 'name' within copy constructor: 'ConsoleDialog::ConsoleDialog(const ConsoleDialog &)') -// We indeed copy pointers, and it's okay. These are not allocated within the -// scope of this class but rather passed in and copied anyway. -ConsoleDialog::ConsoleDialog(const ConsoleDialog& other) : - DockingDlgInterface(other), - m_data(other.m_data ? new tTbData(*other.m_data) : NULL), - m_scintilla(other.m_scintilla), - m_hInput(other.m_hInput), - m_console(other.m_console), - m_prompt(other.m_prompt), - m_originalInputWndProc(NULL), - m_hTabIcon(NULL), - m_history(other.m_history), - m_historyIter(other.m_historyIter), - m_changes(other.m_changes), - m_currentHistory(other.m_currentHistory), - m_runButtonIsRun(other.m_runButtonIsRun), - m_hContext(NULL) -{ -} -//lint +e1554 ConsoleDialog::~ConsoleDialog() { @@ -120,13 +99,13 @@ void ConsoleDialog::initDialog(HINSTANCE hInst, NppData& nppData, ConsoleInterfa } -BOOL CALLBACK ConsoleDialog::run_dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK ConsoleDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_INITDIALOG: { - SetParent(m_scintilla, hWnd); + SetParent(m_scintilla, _hSelf); ShowWindow(m_scintilla, SW_SHOW); m_hInput = ::GetDlgItem(_hSelf, IDC_INPUT); HFONT hCourier = CreateFont(14,0,0,0,FW_DONTCARE,FALSE,FALSE,FALSE,DEFAULT_CHARSET,OUT_OUTLINE_PRECIS, @@ -471,8 +450,8 @@ void ConsoleDialog::createOutputWindow(HWND hParentWindow) { m_scintilla = (HWND)::SendMessage(_hParent, NPPM_CREATESCINTILLAHANDLE, 0, reinterpret_cast(hParentWindow)); - LONG currentStyle = GetWindowLong(m_scintilla, GWL_STYLE); - SetWindowLong(m_scintilla, GWL_STYLE, currentStyle | WS_TABSTOP); + LONG currentStyle = GetWindowLongPtr(m_scintilla, GWL_STYLE); + SetWindowLongPtr(m_scintilla, GWL_STYLE, currentStyle | WS_TABSTOP); callScintilla(SCI_SETREADONLY, 1, 0); @@ -623,8 +602,7 @@ void ConsoleDialog::doDialog() { // define the default docking behaviour m_data->uMask = DWS_DF_CONT_BOTTOM | DWS_ICONTAB; - m_data->pszName = new TCHAR[20]; - _tcscpy_s(m_data->pszName, 20, _T("Python")); + m_data->pszName = _T("Python"); RECT rc; rc.bottom = 0; diff --git a/PythonScript/src/ConsoleDialog.h b/PythonScript/src/ConsoleDialog.h index 0bc162d0..92012f58 100644 --- a/PythonScript/src/ConsoleDialog.h +++ b/PythonScript/src/ConsoleDialog.h @@ -18,7 +18,7 @@ class ConsoleDialog : public DockingDlgInterface { public: ConsoleDialog(); - ConsoleDialog(const ConsoleDialog& other); + ConsoleDialog(const ConsoleDialog& other) = delete; ~ConsoleDialog(); @@ -38,7 +38,7 @@ class ConsoleDialog : public DockingDlgInterface void runEnabled(bool enabled); protected: - BOOL CALLBACK run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam); + virtual INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); private: ConsoleDialog& operator = (const ConsoleDialog&); // assignment operator disabled diff --git a/PythonScript/src/Enums.h b/PythonScript/src/Enums.h index a109803d..0a3ff30d 100644 --- a/PythonScript/src/Enums.h +++ b/PythonScript/src/Enums.h @@ -1263,8 +1263,6 @@ enum ScintillaMessage PYSCR_SCI_GETCHARACTERPOINTER = SCI_GETCHARACTERPOINTER, PYSCR_SCI_GETRANGEPOINTER = SCI_GETRANGEPOINTER, PYSCR_SCI_GETGAPPOSITION = SCI_GETGAPPOSITION, - PYSCR_SCI_SETKEYSUNICODE = SCI_SETKEYSUNICODE, - PYSCR_SCI_GETKEYSUNICODE = SCI_GETKEYSUNICODE, PYSCR_SCI_INDICSETALPHA = SCI_INDICSETALPHA, PYSCR_SCI_INDICGETALPHA = SCI_INDICGETALPHA, PYSCR_SCI_INDICSETOUTLINEALPHA = SCI_INDICSETOUTLINEALPHA, diff --git a/PythonScript/src/EnumsWrapper.cpp b/PythonScript/src/EnumsWrapper.cpp index 5d47423d..fd88da7d 100644 --- a/PythonScript/src/EnumsWrapper.cpp +++ b/PythonScript/src/EnumsWrapper.cpp @@ -1196,8 +1196,6 @@ void export_enums() .value("SCI_GETCHARACTERPOINTER", PYSCR_SCI_GETCHARACTERPOINTER) .value("SCI_GETRANGEPOINTER", PYSCR_SCI_GETRANGEPOINTER) .value("SCI_GETGAPPOSITION", PYSCR_SCI_GETGAPPOSITION) - .value("SCI_SETKEYSUNICODE", PYSCR_SCI_SETKEYSUNICODE) - .value("SCI_GETKEYSUNICODE", PYSCR_SCI_GETKEYSUNICODE) .value("SCI_INDICSETALPHA", PYSCR_SCI_INDICSETALPHA) .value("SCI_INDICGETALPHA", PYSCR_SCI_INDICGETALPHA) .value("SCI_INDICSETOUTLINEALPHA", PYSCR_SCI_INDICSETOUTLINEALPHA) diff --git a/PythonScript/src/NotepadPlusWrapper.h b/PythonScript/src/NotepadPlusWrapper.h index 3d5cc418..bd7a00d5 100644 --- a/PythonScript/src/NotepadPlusWrapper.h +++ b/PythonScript/src/NotepadPlusWrapper.h @@ -219,7 +219,6 @@ enum MenuCommands NPPIDM_VIEW_DRAWTABBAR_INACIVETAB = IDM_VIEW_DRAWTABBAR_INACIVETAB, NPPIDM_VIEW_POSTIT = IDM_VIEW_POSTIT, NPPIDM_VIEW_TOGGLE_FOLDALL = IDM_VIEW_TOGGLE_FOLDALL, - NPPIDM_VIEW_USER_DLG = IDM_VIEW_USER_DLG, NPPIDM_VIEW_LINENUMBER = IDM_VIEW_LINENUMBER, NPPIDM_VIEW_SYMBOLMARGIN = IDM_VIEW_SYMBOLMARGIN, NPPIDM_VIEW_FOLDERMAGIN = IDM_VIEW_FOLDERMAGIN, @@ -309,12 +308,9 @@ enum MenuCommands NPPIDM_FORMAT_ISO_8859_7 = IDM_FORMAT_ISO_8859_7, NPPIDM_FORMAT_ISO_8859_8 = IDM_FORMAT_ISO_8859_8, NPPIDM_FORMAT_ISO_8859_9 = IDM_FORMAT_ISO_8859_9, - NPPIDM_FORMAT_ISO_8859_10 = IDM_FORMAT_ISO_8859_10, - NPPIDM_FORMAT_ISO_8859_11 = IDM_FORMAT_ISO_8859_11, NPPIDM_FORMAT_ISO_8859_13 = IDM_FORMAT_ISO_8859_13, NPPIDM_FORMAT_ISO_8859_14 = IDM_FORMAT_ISO_8859_14, NPPIDM_FORMAT_ISO_8859_15 = IDM_FORMAT_ISO_8859_15, - NPPIDM_FORMAT_ISO_8859_16 = IDM_FORMAT_ISO_8859_16, NPPIDM_FORMAT_DOS_437 = IDM_FORMAT_DOS_437, NPPIDM_FORMAT_DOS_720 = IDM_FORMAT_DOS_720, NPPIDM_FORMAT_DOS_737 = IDM_FORMAT_DOS_737, @@ -408,17 +404,12 @@ enum MenuCommands NPPIDM_UPDATE_NPP = IDM_UPDATE_NPP, NPPIDM_WIKIFAQ = IDM_WIKIFAQ, NPPIDM_HELP = IDM_HELP, - NPPIDM_SETTING_TAB_SIZE = IDM_SETTING_TAB_SIZE, - NPPIDM_SETTING_TAB_REPLCESPACE = IDM_SETTING_TAB_REPLCESPACE, - NPPIDM_SETTING_HISTORY_SIZE = IDM_SETTING_HISTORY_SIZE, - NPPIDM_SETTING_EDGE_SIZE = IDM_SETTING_EDGE_SIZE, NPPIDM_SETTING_IMPORTPLUGIN = IDM_SETTING_IMPORTPLUGIN, NPPIDM_SETTING_IMPORTSTYLETHEMS = IDM_SETTING_IMPORTSTYLETHEMS, NPPIDM_SETTING_TRAYICON = IDM_SETTING_TRAYICON, NPPIDM_SETTING_SHORTCUT_MAPPER = IDM_SETTING_SHORTCUT_MAPPER, NPPIDM_SETTING_REMEMBER_LAST_SESSION = IDM_SETTING_REMEMBER_LAST_SESSION, NPPIDM_SETTING_PREFERECE = IDM_SETTING_PREFERECE, - NPPIDM_SETTING_AUTOCNBCHAR = IDM_SETTING_AUTOCNBCHAR, NPPIDM_SYSTRAYPOPUP_ACTIVATE = IDM_SYSTRAYPOPUP_ACTIVATE, NPPIDM_SYSTRAYPOPUP_NEWDOC = IDM_SYSTRAYPOPUP_NEWDOC, NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE = IDM_SYSTRAYPOPUP_NEW_AND_PASTE, diff --git a/PythonScript/src/NotepadPython.cpp b/PythonScript/src/NotepadPython.cpp index 43b1628a..43091d60 100644 --- a/PythonScript/src/NotepadPython.cpp +++ b/PythonScript/src/NotepadPython.cpp @@ -91,7 +91,7 @@ void export_notepad() boost::python::enum_("LANGTYPE") - .value("TXT", L_TXT) + .value("TXT", L_TEXT) .value("PHP", L_PHP) .value("C", L_C) .value("CPP", L_CPP) @@ -105,7 +105,6 @@ void export_notepad() .value("PASCAL", L_PASCAL) .value("BATCH", L_BATCH) .value("INI", L_INI) - .value("NFO", L_NFO) .value("USER", L_USER) .value("ASP", L_ASP) .value("SQL", L_SQL) @@ -327,7 +326,6 @@ void export_notepad() .value("VIEW_DRAWTABBAR_INACIVETAB", NPPIDM_VIEW_DRAWTABBAR_INACIVETAB) .value("VIEW_POSTIT", NPPIDM_VIEW_POSTIT) .value("VIEW_TOGGLE_FOLDALL", NPPIDM_VIEW_TOGGLE_FOLDALL) - .value("VIEW_USER_DLG", NPPIDM_VIEW_USER_DLG) .value("VIEW_LINENUMBER", NPPIDM_VIEW_LINENUMBER) .value("VIEW_SYMBOLMARGIN", NPPIDM_VIEW_SYMBOLMARGIN) .value("VIEW_FOLDERMAGIN", NPPIDM_VIEW_FOLDERMAGIN) @@ -417,12 +415,9 @@ void export_notepad() .value("FORMAT_ISO_8859_7", NPPIDM_FORMAT_ISO_8859_7) .value("FORMAT_ISO_8859_8", NPPIDM_FORMAT_ISO_8859_8) .value("FORMAT_ISO_8859_9", NPPIDM_FORMAT_ISO_8859_9) - .value("FORMAT_ISO_8859_10", NPPIDM_FORMAT_ISO_8859_10) - .value("FORMAT_ISO_8859_11", NPPIDM_FORMAT_ISO_8859_11) .value("FORMAT_ISO_8859_13", NPPIDM_FORMAT_ISO_8859_13) .value("FORMAT_ISO_8859_14", NPPIDM_FORMAT_ISO_8859_14) .value("FORMAT_ISO_8859_15", NPPIDM_FORMAT_ISO_8859_15) - .value("FORMAT_ISO_8859_16", NPPIDM_FORMAT_ISO_8859_16) .value("FORMAT_DOS_437", NPPIDM_FORMAT_DOS_437) .value("FORMAT_DOS_720", NPPIDM_FORMAT_DOS_720) .value("FORMAT_DOS_737", NPPIDM_FORMAT_DOS_737) @@ -516,17 +511,12 @@ void export_notepad() .value("UPDATE_NPP", NPPIDM_UPDATE_NPP) .value("WIKIFAQ", NPPIDM_WIKIFAQ) .value("HELP", NPPIDM_HELP) - .value("SETTING_TAB_SIZE", NPPIDM_SETTING_TAB_SIZE) - .value("SETTING_TAB_REPLCESPACE", NPPIDM_SETTING_TAB_REPLCESPACE) - .value("SETTING_HISTORY_SIZE", NPPIDM_SETTING_HISTORY_SIZE) - .value("SETTING_EDGE_SIZE", NPPIDM_SETTING_EDGE_SIZE) .value("SETTING_IMPORTPLUGIN", NPPIDM_SETTING_IMPORTPLUGIN) .value("SETTING_IMPORTSTYLETHEMS", NPPIDM_SETTING_IMPORTSTYLETHEMS) .value("SETTING_TRAYICON", NPPIDM_SETTING_TRAYICON) .value("SETTING_SHORTCUT_MAPPER", NPPIDM_SETTING_SHORTCUT_MAPPER) .value("SETTING_REMEMBER_LAST_SESSION", NPPIDM_SETTING_REMEMBER_LAST_SESSION) .value("SETTING_PREFERECE", NPPIDM_SETTING_PREFERECE) - .value("SETTING_AUTOCNBCHAR", NPPIDM_SETTING_AUTOCNBCHAR) .value("SYSTRAYPOPUP_ACTIVATE", NPPIDM_SYSTRAYPOPUP_ACTIVATE) .value("SYSTRAYPOPUP_NEWDOC", NPPIDM_SYSTRAYPOPUP_NEWDOC) .value("SYSTRAYPOPUP_NEW_AND_PASTE", NPPIDM_SYSTRAYPOPUP_NEW_AND_PASTE) diff --git a/PythonScript/src/PromptDialog.cpp b/PythonScript/src/PromptDialog.cpp index 840e8a27..77e5b86a 100644 --- a/PythonScript/src/PromptDialog.cpp +++ b/PythonScript/src/PromptDialog.cpp @@ -38,13 +38,13 @@ BOOL CALLBACK PromptDialog::dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPAR { case WM_INITDIALOG: { - ::SetWindowLongPtr(hWnd, GWL_USERDATA, lParam); + ::SetWindowLongPtr(hWnd, GWLP_USERDATA, static_cast(lParam)); PromptDialog* dlg = reinterpret_cast(lParam); return dlg->runDlgProc(hWnd, message, wParam, lParam); } default: { - PromptDialog* dlg = reinterpret_cast(::GetWindowLongPtr(hWnd, GWL_USERDATA)); + PromptDialog* dlg = reinterpret_cast(::GetWindowLongPtr(hWnd, GWLP_USERDATA)); if (dlg) return dlg->runDlgProc(hWnd, message, wParam, lParam); else diff --git a/PythonScript/src/SciLexer.h b/PythonScript/src/SciLexer.h index b704e384..327b9153 100644 --- a/PythonScript/src/SciLexer.h +++ b/PythonScript/src/SciLexer.h @@ -125,7 +125,28 @@ #define SCLEX_KVIRC 110 #define SCLEX_RUST 111 #define SCLEX_DMAP 112 +#define SCLEX_AS 113 +#define SCLEX_DMIS 114 +#define SCLEX_REGISTRY 115 +#define SCLEX_BIBTEX 116 +#define SCLEX_SREC 117 +#define SCLEX_IHEX 118 +#define SCLEX_TEHEX 119 +#define SCLEX_SEARCHRESULT 150 +#define SCLEX_OBJC 151 +#define SCLEX_USER 152 #define SCLEX_AUTOMATIC 1000 +//For All lexer +#define SCE_UNIVERSAL_FOUND_STYLE 31 +#define SCE_UNIVERSAL_FOUND_STYLE_SMART 29 +#define SCE_UNIVERSAL_FOUND_STYLE_INC 28 +#define SCE_UNIVERSAL_TAGMATCH 27 +#define SCE_UNIVERSAL_TAGATTR 26 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT1 25 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT2 24 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT3 23 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT4 22 +#define SCE_UNIVERSAL_FOUND_STYLE_EXT5 21 #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 #define SCE_P_NUMBER 2 @@ -168,6 +189,8 @@ #define SCE_C_PREPROCESSORCOMMENT 23 #define SCE_C_PREPROCESSORCOMMENTDOC 24 #define SCE_C_USERLITERAL 25 +#define SCE_C_TASKMARKER 26 +#define SCE_C_ESCAPESEQUENCE 27 #define SCE_D_DEFAULT 0 #define SCE_D_COMMENT 1 #define SCE_D_COMMENTLINE 2 @@ -191,6 +214,113 @@ #define SCE_D_WORD5 20 #define SCE_D_WORD6 21 #define SCE_D_WORD7 22 +#define SCE_SEARCHRESULT_DEFAULT 0 +#define SCE_SEARCHRESULT_SEARCH_HEADER 1 +#define SCE_SEARCHRESULT_FILE_HEADER 2 +#define SCE_SEARCHRESULT_LINE_NUMBER 3 +#define SCE_SEARCHRESULT_WORD2SEARCH 4 +#define SCE_SEARCHRESULT_HIGHLIGHT_LINE 5 +#define SCE_SEARCHRESULT_CURRENT_LINE 6 +#define SCE_OBJC_DIRECTIVE 20 +#define SCE_OBJC_QUALIFIER 21 + +#define SCE_UDL_VERSION_MAJOR 2 +#define SCE_UDL_VERSION_MINOR 1 +#define SCE_UDL_VERSION_BUILD 0 +#define SCE_UDL_VERSION_REVISION 12 + +#define SCE_USER_KWLIST_COMMENTS 0 +#define SCE_USER_KWLIST_NUMBER_PREFIX1 1 +#define SCE_USER_KWLIST_NUMBER_PREFIX2 2 +#define SCE_USER_KWLIST_NUMBER_EXTRAS1 3 +#define SCE_USER_KWLIST_NUMBER_EXTRAS2 4 +#define SCE_USER_KWLIST_NUMBER_SUFFIX1 5 +#define SCE_USER_KWLIST_NUMBER_SUFFIX2 6 +#define SCE_USER_KWLIST_NUMBER_RANGE 7 +#define SCE_USER_KWLIST_OPERATORS1 8 +#define SCE_USER_KWLIST_OPERATORS2 9 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_OPEN 10 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_MIDDLE 11 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE1_CLOSE 12 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_OPEN 13 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_MIDDLE 14 +#define SCE_USER_KWLIST_FOLDERS_IN_CODE2_CLOSE 15 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_OPEN 16 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_MIDDLE 17 +#define SCE_USER_KWLIST_FOLDERS_IN_COMMENT_CLOSE 18 +#define SCE_USER_KWLIST_KEYWORDS1 19 +#define SCE_USER_KWLIST_KEYWORDS2 20 +#define SCE_USER_KWLIST_KEYWORDS3 21 +#define SCE_USER_KWLIST_KEYWORDS4 22 +#define SCE_USER_KWLIST_KEYWORDS5 23 +#define SCE_USER_KWLIST_KEYWORDS6 24 +#define SCE_USER_KWLIST_KEYWORDS7 25 +#define SCE_USER_KWLIST_KEYWORDS8 26 +#define SCE_USER_KWLIST_DELIMITERS 27 +#define SCE_USER_KWLIST_TOTAL 28 // must always be <= KEYWORDSET_MAX + +#define SCE_USER_TOTAL_DELIMITERS 8 +#define SCE_USER_TOTAL_KEYWORD_GROUPS 8 +#define SCE_USER_TOTAL_FOLDERS 6 + +#define SCE_USER_STYLE_DEFAULT 0 +#define SCE_USER_STYLE_COMMENT 1 +#define SCE_USER_STYLE_COMMENTLINE 2 +#define SCE_USER_STYLE_NUMBER 3 +#define SCE_USER_STYLE_KEYWORD1 4 +#define SCE_USER_STYLE_KEYWORD2 5 +#define SCE_USER_STYLE_KEYWORD3 6 +#define SCE_USER_STYLE_KEYWORD4 7 +#define SCE_USER_STYLE_KEYWORD5 8 +#define SCE_USER_STYLE_KEYWORD6 9 +#define SCE_USER_STYLE_KEYWORD7 10 +#define SCE_USER_STYLE_KEYWORD8 11 +#define SCE_USER_STYLE_OPERATOR 12 +#define SCE_USER_STYLE_FOLDER_IN_CODE1 13 +#define SCE_USER_STYLE_FOLDER_IN_CODE2 14 +#define SCE_USER_STYLE_FOLDER_IN_COMMENT 15 +#define SCE_USER_STYLE_DELIMITER1 16 +#define SCE_USER_STYLE_DELIMITER2 17 +#define SCE_USER_STYLE_DELIMITER3 18 +#define SCE_USER_STYLE_DELIMITER4 19 +#define SCE_USER_STYLE_DELIMITER5 20 +#define SCE_USER_STYLE_DELIMITER6 21 +#define SCE_USER_STYLE_DELIMITER7 22 +#define SCE_USER_STYLE_DELIMITER8 23 +#define SCE_USER_STYLE_IDENTIFIER 24 +#define SCE_USER_STYLE_TOTAL_STYLES SCE_USER_STYLE_IDENTIFIER +#define SCE_USER_STYLE_MAPPER_TOTAL 17 +#define SCE_STYLE_ARRAY_SIZE 30 // must cover sizes of NppParameters::_lexerStyler and NppParameters::_widgetStyle + +#define SCE_USER_MASK_NESTING_NONE 0 +#define SCE_USER_MASK_NESTING_DELIMITER1 0x1 +#define SCE_USER_MASK_NESTING_DELIMITER2 0x2 +#define SCE_USER_MASK_NESTING_DELIMITER3 0x4 +#define SCE_USER_MASK_NESTING_DELIMITER4 0x8 +#define SCE_USER_MASK_NESTING_DELIMITER5 0x10 +#define SCE_USER_MASK_NESTING_DELIMITER6 0x20 +#define SCE_USER_MASK_NESTING_DELIMITER7 0x40 +#define SCE_USER_MASK_NESTING_DELIMITER8 0x80 +#define SCE_USER_MASK_NESTING_COMMENT 0x100 +#define SCE_USER_MASK_NESTING_COMMENT_LINE 0x200 +#define SCE_USER_MASK_NESTING_KEYWORD1 0x400 +#define SCE_USER_MASK_NESTING_KEYWORD2 0x800 +#define SCE_USER_MASK_NESTING_KEYWORD3 0x1000 +#define SCE_USER_MASK_NESTING_KEYWORD4 0x2000 +#define SCE_USER_MASK_NESTING_KEYWORD5 0x4000 +#define SCE_USER_MASK_NESTING_KEYWORD6 0x8000 +#define SCE_USER_MASK_NESTING_KEYWORD7 0x10000 +#define SCE_USER_MASK_NESTING_KEYWORD8 0x20000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_OPEN 0x40000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_MIDDLE 0x80000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_CODE2_CLOSE 0x100000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_OPEN 0x200000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_MIDDLE 0x400000 +#define SCE_USER_MASK_NESTING_FOLDERS_IN_COMMENT_CLOSE 0x800000 +#define SCE_USER_MASK_NESTING_OPERATORS1 0x1000000 +#define SCE_USER_MASK_NESTING_OPERATORS2 0x2000000 +#define SCE_USER_MASK_NESTING_NUMBERS 0x4000000 + #define SCE_TCL_DEFAULT 0 #define SCE_TCL_COMMENT 1 #define SCE_TCL_COMMENTLINE 2 @@ -892,6 +1022,11 @@ #define SCE_V_IDENTIFIER 11 #define SCE_V_STRINGEOL 12 #define SCE_V_USER 19 +#define SCE_V_COMMENT_WORD 20 +#define SCE_V_INPUT 21 +#define SCE_V_OUTPUT 22 +#define SCE_V_INOUT 23 +#define SCE_V_PORT_CONNECT 24 #define SCE_KIX_DEFAULT 0 #define SCE_KIX_COMMENT 1 #define SCE_KIX_STRING1 2 @@ -902,6 +1037,7 @@ #define SCE_KIX_KEYWORD 7 #define SCE_KIX_FUNCTIONS 8 #define SCE_KIX_OPERATOR 9 +#define SCE_KIX_COMMENTSTREAM 10 #define SCE_KIX_IDENTIFIER 31 #define SCE_GC_DEFAULT 0 #define SCE_GC_COMMENTLINE 1 @@ -998,6 +1134,7 @@ #define SCE_VHDL_STDPACKAGE 12 #define SCE_VHDL_STDTYPE 13 #define SCE_VHDL_USERWORD 14 +#define SCE_VHDL_BLOCK_COMMENT 15 #define SCE_CAML_DEFAULT 0 #define SCE_CAML_IDENTIFIER 1 #define SCE_CAML_TAGNAME 2 @@ -1109,6 +1246,7 @@ #define SCE_SQL_USER3 21 #define SCE_SQL_USER4 22 #define SCE_SQL_QUOTEDIDENTIFIER 23 +#define SCE_SQL_QOPERATOR 24 #define SCE_ST_DEFAULT 0 #define SCE_ST_STRING 1 #define SCE_ST_NUMBER 2 @@ -1688,6 +1826,9 @@ #define SCE_RUST_LIFETIME 18 #define SCE_RUST_MACRO 19 #define SCE_RUST_LEXERROR 20 +#define SCE_RUST_BYTESTRING 21 +#define SCE_RUST_BYTESTRINGR 22 +#define SCE_RUST_BYTECHARACTER 23 #define SCE_DMAP_DEFAULT 0 #define SCE_DMAP_COMMENT 1 #define SCE_DMAP_NUMBER 2 @@ -1699,6 +1840,55 @@ #define SCE_DMAP_WORD 8 #define SCE_DMAP_WORD2 9 #define SCE_DMAP_WORD3 10 +#define SCE_DMIS_DEFAULT 0 +#define SCE_DMIS_COMMENT 1 +#define SCE_DMIS_STRING 2 +#define SCE_DMIS_NUMBER 3 +#define SCE_DMIS_KEYWORD 4 +#define SCE_DMIS_MAJORWORD 5 +#define SCE_DMIS_MINORWORD 6 +#define SCE_DMIS_UNSUPPORTED_MAJOR 7 +#define SCE_DMIS_UNSUPPORTED_MINOR 8 +#define SCE_DMIS_LABEL 9 +#define SCE_REG_DEFAULT 0 +#define SCE_REG_COMMENT 1 +#define SCE_REG_VALUENAME 2 +#define SCE_REG_STRING 3 +#define SCE_REG_HEXDIGIT 4 +#define SCE_REG_VALUETYPE 5 +#define SCE_REG_ADDEDKEY 6 +#define SCE_REG_DELETEDKEY 7 +#define SCE_REG_ESCAPED 8 +#define SCE_REG_KEYPATH_GUID 9 +#define SCE_REG_STRING_GUID 10 +#define SCE_REG_PARAMETER 11 +#define SCE_REG_OPERATOR 12 +#define SCE_BIBTEX_DEFAULT 0 +#define SCE_BIBTEX_ENTRY 1 +#define SCE_BIBTEX_UNKNOWN_ENTRY 2 +#define SCE_BIBTEX_KEY 3 +#define SCE_BIBTEX_PARAMETER 4 +#define SCE_BIBTEX_VALUE 5 +#define SCE_BIBTEX_COMMENT 6 +#define SCE_HEX_DEFAULT 0 +#define SCE_HEX_RECSTART 1 +#define SCE_HEX_RECTYPE 2 +#define SCE_HEX_RECTYPE_UNKNOWN 3 +#define SCE_HEX_BYTECOUNT 4 +#define SCE_HEX_BYTECOUNT_WRONG 5 +#define SCE_HEX_NOADDRESS 6 +#define SCE_HEX_DATAADDRESS 7 +#define SCE_HEX_RECCOUNT 8 +#define SCE_HEX_STARTADDRESS 9 +#define SCE_HEX_ADDRESSFIELD_UNKNOWN 10 +#define SCE_HEX_EXTENDEDADDRESS 11 +#define SCE_HEX_DATA_ODD 12 +#define SCE_HEX_DATA_EVEN 13 +#define SCE_HEX_DATA_UNKNOWN 14 +#define SCE_HEX_DATA_EMPTY 15 +#define SCE_HEX_CHECKSUM 16 +#define SCE_HEX_CHECKSUM_WRONG 17 +#define SCE_HEX_GARBAGE 18 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif diff --git a/PythonScript/src/Scintilla.h b/PythonScript/src/Scintilla.h index 49105157..c64443f4 100644 --- a/PythonScript/src/Scintilla.h +++ b/PythonScript/src/Scintilla.h @@ -18,9 +18,9 @@ extern "C" { #if defined(_WIN32) /* Return false on failure: */ int Scintilla_RegisterClasses(void *hInstance); -int Scintilla_ReleaseResources(); +int Scintilla_ReleaseResources(void); #endif -int Scintilla_LinkLexers(); +int Scintilla_LinkLexers(void); #ifdef __cplusplus } @@ -50,6 +50,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_ADDTEXT 2001 #define SCI_ADDSTYLEDTEXT 2002 #define SCI_INSERTTEXT 2003 +#define SCI_CHANGEINSERTION 2672 #define SCI_CLEARALL 2004 #define SCI_DELETERANGE 2645 #define SCI_CLEARDOCUMENTSTYLE 2005 @@ -91,8 +92,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETBUFFEREDDRAW 2035 #define SCI_SETTABWIDTH 2036 #define SCI_GETTABWIDTH 2121 +#define SCI_CLEARTABSTOPS 2675 +#define SCI_ADDTABSTOP 2676 +#define SCI_GETNEXTTABSTOP 2677 #define SC_CP_UTF8 65001 #define SCI_SETCODEPAGE 2037 +#define SC_IME_WINDOWED 0 +#define SC_IME_INLINE 1 +#define SCI_GETIMEINTERACTION 2678 +#define SCI_SETIMEINTERACTION 2679 #define MARKER_MAX 31 #define SC_MARK_CIRCLE 0 #define SC_MARK_ROUNDRECT 1 @@ -266,7 +274,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define INDIC_DOTBOX 12 #define INDIC_SQUIGGLEPIXMAP 13 #define INDIC_COMPOSITIONTHICK 14 -#define INDIC_MAX 31 +#define INDIC_COMPOSITIONTHIN 15 +#define INDIC_FULLBOX 16 +#define INDIC_TEXTFORE 17 +#define INDIC_IME 32 +#define INDIC_IME_MAX 35 +#define INDIC_MAX 35 #define INDIC_CONTAINER 8 #define INDIC0_MASK 0x20 #define INDIC1_MASK 0x40 @@ -278,6 +291,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDICGETFORE 2083 #define SCI_INDICSETUNDER 2510 #define SCI_INDICGETUNDER 2511 +#define SCI_INDICSETHOVERSTYLE 2680 +#define SCI_INDICGETHOVERSTYLE 2681 +#define SCI_INDICSETHOVERFORE 2682 +#define SCI_INDICGETHOVERFORE 2683 +#define SC_INDICVALUEBIT 0x1000000 +#define SC_INDICVALUEMASK 0xFFFFFF +#define SC_INDICFLAG_VALUEFORE 1 +#define SCI_INDICSETFLAGS 2684 +#define SCI_INDICGETFLAGS 2685 #define SCI_SETWHITESPACEFORE 2084 #define SCI_SETWHITESPACEBACK 2085 #define SCI_SETWHITESPACESIZE 2086 @@ -364,6 +386,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCFIND_WORDSTART 0x00100000 #define SCFIND_REGEXP 0x00200000 #define SCFIND_POSIX 0x00400000 +#define SCFIND_CXX11REGEX 0x00800000 #define SCI_FINDTEXT 2150 #define SCI_FORMATRANGE 2151 #define SCI_GETFIRSTVISIBLELINE 2152 @@ -409,6 +432,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETTARGETSTART 2191 #define SCI_SETTARGETEND 2192 #define SCI_GETTARGETEND 2193 +#define SCI_SETTARGETRANGE 2686 +#define SCI_GETTARGETTEXT 2687 #define SCI_REPLACETARGET 2194 #define SCI_REPLACETARGETRE 2195 #define SCI_SEARCHINTARGET 2197 @@ -461,6 +486,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 #define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 #define SC_FOLDFLAG_LEVELNUMBERS 0x0040 +#define SC_FOLDFLAG_LINESTATE 0x0080 #define SCI_SETFOLDFLAGS 2233 #define SCI_ENSUREVISIBLEENFORCEPOLICY 2234 #define SCI_SETTABINDENTS 2260 @@ -475,6 +501,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_WRAP_NONE 0 #define SC_WRAP_WORD 1 #define SC_WRAP_CHAR 2 +#define SC_WRAP_WHITESPACE 3 #define SCI_SETWRAPMODE 2268 #define SCI_GETWRAPMODE 2269 #define SC_WRAPVISUALFLAG_NONE 0x0000 @@ -514,6 +541,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #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 +#define SCI_GETPHASESDRAW 2673 +#define SCI_SETPHASESDRAW 2674 #define SC_EFF_QUALITY_MASK 0xF #define SC_EFF_QUALITY_DEFAULT 0 #define SC_EFF_QUALITY_NON_ANTIALIASED 1 @@ -628,6 +660,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_STATUS_OK 0 #define SC_STATUS_FAILURE 1 #define SC_STATUS_BADALLOC 2 +#define SC_STATUS_WARN_START 1000 +#define SC_STATUS_WARN_REGEX 1001 #define SCI_SETSTATUS 2382 #define SCI_GETSTATUS 2383 #define SCI_SETMOUSEDOWNCAPTURES 2384 @@ -714,6 +748,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1 #define SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR 2634 #define SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR 2635 +#define SC_MULTIAUTOC_ONCE 0 +#define SC_MULTIAUTOC_EACH 1 +#define SCI_AUTOCSETMULTI 2636 +#define SCI_AUTOCGETMULTI 2637 #define SC_ORDER_PRESORTED 0 #define SC_ORDER_PERFORMSORT 1 #define SC_ORDER_CUSTOM 2 @@ -759,8 +797,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETCHARACTERPOINTER 2520 #define SCI_GETRANGEPOINTER 2643 #define SCI_GETGAPPOSITION 2644 -#define SCI_SETKEYSUNICODE 2521 -#define SCI_GETKEYSUNICODE 2522 #define SCI_INDICSETALPHA 2523 #define SCI_INDICGETALPHA 2524 #define SCI_INDICSETOUTLINEALPHA 2558 @@ -794,6 +830,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define ANNOTATION_HIDDEN 0 #define ANNOTATION_STANDARD 1 #define ANNOTATION_BOXED 2 +#define ANNOTATION_INDENTED 3 #define SCI_ANNOTATIONSETVISIBLE 2548 #define SCI_ANNOTATIONGETVISIBLE 2549 #define SCI_ANNOTATIONSETSTYLEOFFSET 2550 @@ -873,6 +910,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SCROLLTOEND 2629 #define SC_TECHNOLOGY_DEFAULT 0 #define SC_TECHNOLOGY_DIRECTWRITE 1 +#define SC_TECHNOLOGY_DIRECTWRITERETAIN 2 +#define SC_TECHNOLOGY_DIRECTWRITEDC 3 #define SCI_SETTECHNOLOGY 2630 #define SCI_GETTECHNOLOGY 2631 #define SCI_CREATELOADER 2632 @@ -883,6 +922,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_VCHOMEDISPLAYEXTEND 2653 #define SCI_GETCARETLINEVISIBLEALWAYS 2654 #define SCI_SETCARETLINEVISIBLEALWAYS 2655 +#define SC_LINE_END_TYPE_DEFAULT 0 +#define SC_LINE_END_TYPE_UNICODE 1 +#define SCI_SETLINEENDTYPESALLOWED 2656 +#define SCI_GETLINEENDTYPESALLOWED 2657 +#define SCI_GETLINEENDTYPESACTIVE 2658 #define SCI_SETREPRESENTATION 2665 #define SCI_GETREPRESENTATION 2666 #define SCI_CLEARREPRESENTATION 2667 @@ -892,7 +936,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETLEXER 4002 #define SCI_COLOURISE 4003 #define SCI_SETPROPERTY 4004 -#define KEYWORDSET_MAX 8 +// #define KEYWORDSET_MAX 8 +#define KEYWORDSET_MAX 30 #define SCI_SETKEYWORDS 4005 #define SCI_SETLEXERLANGUAGE 4006 #define SCI_LOADLEXERLIBRARY 4007 @@ -909,6 +954,16 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_PROPERTYTYPE 4015 #define SCI_DESCRIBEPROPERTY 4016 #define SCI_DESCRIBEKEYWORDSETS 4017 +#define SCI_GETLINEENDTYPESSUPPORTED 4018 +#define SCI_ALLOCATESUBSTYLES 4020 +#define SCI_GETSUBSTYLESSTART 4021 +#define SCI_GETSUBSTYLESLENGTH 4022 +#define SCI_GETSTYLEFROMSUBSTYLE 4027 +#define SCI_GETPRIMARYSTYLEFROMSTYLE 4028 +#define SCI_FREESUBSTYLES 4023 +#define SCI_SETIDENTIFIERS 4024 +#define SCI_DISTANCETOSECONDARYSTYLES 4025 +#define SCI_GETSUBSTYLEBASES 4026 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 #define SC_MOD_CHANGESTYLE 0x4 @@ -929,7 +984,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MOD_CHANGEANNOTATION 0x20000 #define SC_MOD_CONTAINER 0x40000 #define SC_MOD_LEXERSTATE 0x80000 -#define SC_MODEVENTMASKALL 0xFFFFF +#define SC_MOD_INSERTCHECK 0x100000 +#define SC_MOD_CHANGETABSTOPS 0x200000 +#define SC_MODEVENTMASKALL 0x3FFFFF +#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 1024 #define SC_UPDATE_CONTENT 0x1 #define SC_UPDATE_SELECTION 0x2 #define SC_UPDATE_V_SCROLL 0x4 @@ -992,30 +1050,15 @@ 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 -#ifndef SCI_DISABLE_PROVISIONAL -#define SC_LINE_END_TYPE_DEFAULT 0 -#define SC_LINE_END_TYPE_UNICODE 1 -#define SCI_SETLINEENDTYPESALLOWED 2656 -#define SCI_GETLINEENDTYPESALLOWED 2657 -#define SCI_GETLINEENDTYPESACTIVE 2658 -#define SCI_GETLINEENDTYPESSUPPORTED 4018 -#define SCI_ALLOCATESUBSTYLES 4020 -#define SCI_GETSUBSTYLESSTART 4021 -#define SCI_GETSUBSTYLESLENGTH 4022 -#define SCI_GETSTYLEFROMSUBSTYLE 4027 -#define SCI_GETPRIMARYSTYLEFROMSTYLE 4028 -#define SCI_FREESUBSTYLES 4023 -#define SCI_SETIDENTIFIERS 4024 -#define SCI_DISTANCETOSECONDARYSTYLES 4025 -#define SCI_GETSUBSTYLEBASES 4026 -#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. */ -#ifdef SCI_NAMESPACE +#if defined(__cplusplus) && defined(SCI_NAMESPACE) namespace Scintilla { #endif @@ -1107,7 +1150,17 @@ struct SCNotification { int updated; /* SCN_UPDATEUI */ }; -#ifdef SCI_NAMESPACE +struct SearchResultMarking { + long _start; + long _end; +}; + +struct SearchResultMarkings { + long _length; + SearchResultMarking *_markings; +}; + +#if defined(__cplusplus) && defined(SCI_NAMESPACE) } #endif @@ -1116,6 +1169,8 @@ struct SCNotification { #define SC_CP_DBCS 1 #define SCI_SETUSEPALETTE 2039 #define SCI_GETUSEPALETTE 2139 +#define SCI_SETKEYSUNICODE 2521 +#define SCI_GETKEYSUNICODE 2522 #endif diff --git a/PythonScript/src/Scintilla.iface b/PythonScript/src/Scintilla.iface index 9001062c..78abcef1 100644 --- a/PythonScript/src/Scintilla.iface +++ b/PythonScript/src/Scintilla.iface @@ -72,11 +72,11 @@ ## Line numbers and positions start at 0. ## String arguments may contain NUL ('\0') characters where the calls provide a length -## argument and retrieve NUL characters. All retrieved strings except for those retrieved -## by GetLine also have a NUL appended but client code should calculate the size that -## will be returned rather than relying upon the NUL whenever possible. Allow for the -## extra NUL character when allocating buffers. The size to allocate for a stringresult -## can be determined by calling with a NULL (0) pointer. +## argument and retrieve NUL characters. APIs marked as NUL-terminated also have a +## NUL appended but client code should calculate the size that will be returned rather +## than relying upon the NUL whenever possible. Allow for the extra NUL character when +## allocating buffers. The size to allocate for a stringresult (not including NUL) can be +## determined by calling with a NULL (0) pointer. cat Basics @@ -98,6 +98,9 @@ fun void AddStyledText=2002(int length, cells c) # Insert string at a position. fun void InsertText=2003(position pos, string text) +# Change the text that is being inserted in response to SC_MOD_INSERTCHECK +fun void ChangeInsertion=2672(int length, string text) + # Delete all text in the document. fun void ClearAll=2004(,) @@ -183,6 +186,7 @@ set void SetAnchor=2026(position posAnchor,) # Retrieve the text of the line containing the caret. # Returns the index of the caret on the line. +# Result is NUL-terminated. fun int GetCurLine=2027(int length, stringresult text) # Retrieve the position of the last correctly styled character. @@ -223,6 +227,15 @@ set void SetTabWidth=2036(int tabWidth,) # Retrieve the visible size of a tab. get int GetTabWidth=2121(,) +# Clear explicit tabstops on a line. +fun void ClearTabStops=2675(int line,) + +# Add an explicit tab stop for a line. +fun void AddTabStop=2676(int line, int x) + +# Find the next explicit tab stop position on a line after a position. +fun int GetNextTabStop=2677(int line, int x) + # The SC_CP_UTF8 value can be used to enter Unicode mode. # This is the same value as CP_UTF8 in Windows val SC_CP_UTF8=65001 @@ -231,6 +244,16 @@ val SC_CP_UTF8=65001 # The SC_CP_UTF8 value can be used to enter Unicode mode. set void SetCodePage=2037(int codePage,) +enu IMEInteraction=SC_IME_ +val SC_IME_WINDOWED=0 +val SC_IME_INLINE=1 + +# Is the IME displayed in a winow or inline? +get int GetIMEInteraction=2678(,) + +# Choose to display the the IME in a winow or inline. +set void SetIMEInteraction=2679(int imeInteraction,) + enu MarkerSymbol=SC_MARK_ val MARKER_MAX=31 val SC_MARK_CIRCLE=0 @@ -457,6 +480,7 @@ get int StyleGetSize=2485(int style,) # Get the font of a style. # Returns the length of the fontName +# Result is NUL-terminated. get int StyleGetFont=2486(int style, stringresult fontName) # Get is a style to have its end of line filled or not. @@ -556,7 +580,7 @@ set void SetCaretPeriod=2076(int periodMilliseconds,) set void SetWordChars=2077(, string characters) # Get the set of characters making up words for when moving or selecting by word. -# Retuns the number of characters +# Returns the number of characters get int GetWordChars=2646(, stringresult characters) # Start a sequence of actions that is undone and redone as a unit. @@ -583,7 +607,12 @@ val INDIC_SQUIGGLELOW=11 val INDIC_DOTBOX=12 val INDIC_SQUIGGLEPIXMAP=13 val INDIC_COMPOSITIONTHICK=14 -val INDIC_MAX=31 +val INDIC_COMPOSITIONTHIN=15 +val INDIC_FULLBOX=16 +val INDIC_TEXTFORE=17 +val INDIC_IME=32 +val INDIC_IME_MAX=35 +val INDIC_MAX=35 val INDIC_CONTAINER=8 val INDIC0_MASK=0x20 val INDIC1_MASK=0x40 @@ -608,6 +637,30 @@ set void IndicSetUnder=2510(int indic, bool under) # Retrieve whether indicator drawn under or over text. get bool IndicGetUnder=2511(int indic,) +# Set a hover indicator to plain, squiggle or TT. +set void IndicSetHoverStyle=2680(int indic, int style) + +# Retrieve the hover style of an indicator. +get int IndicGetHoverStyle=2681(int indic,) + +# Set the foreground hover colour of an indicator. +set void IndicSetHoverFore=2682(int indic, colour fore) + +# Retrieve the foreground hover colour of an indicator. +get colour IndicGetHoverFore=2683(int indic,) + +val SC_INDICVALUEBIT=0x1000000 +val SC_INDICVALUEMASK=0xFFFFFF + +enu IndicFlag=SC_INDICFLAG_ +val SC_INDICFLAG_VALUEFORE=1 + +# Set the attributes of an indicator. +set void IndicSetFlags=2684(int indic, int flags) + +# Retrieve the attributes of an indicator. +get int IndicGetFlags=2685(int indic,) + # Set the foreground colour of all whitespace and whether to use this setting. fun void SetWhitespaceFore=2084(bool useSetting, colour fore) @@ -862,6 +915,7 @@ val SCFIND_MATCHCASE=0x4 val SCFIND_WORDSTART=0x00100000 val SCFIND_REGEXP=0x00200000 val SCFIND_POSIX=0x00400000 +val SCFIND_CXX11REGEX=0x00800000 # Find some text in the document. fun position FindText=2150(int flags, findtext ft) @@ -899,6 +953,7 @@ fun void SetSel=2160(position start, position end) # Retrieve the selected text. # Return the length of the text. +# Result is NUL-terminated. fun int GetSelText=2161(, stringresult text) # Retrieve a range of text. @@ -969,6 +1024,7 @@ fun void SetText=2181(, string text) # Retrieve all the text in the document. # Returns number of characters retrieved. +# Result is NUL-terminated. fun int GetText=2182(int length, stringresult text) # Retrieve the number of characters in the document. @@ -1007,6 +1063,12 @@ set void SetTargetEnd=2192(position pos,) # Get the position that ends the target. get position GetTargetEnd=2193(,) +# Sets both the start and end of the target in one call. +fun void SetTargetRange=2686(position start, position end) + +# Retrieve the text in the target. +get int GetTargetText=2687(, stringresult characters) + # Replace the target text with the argument text. # Text is counted so it can contain NULs. # Returns the length of the replacement text. @@ -1151,6 +1213,7 @@ val SC_FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004 val SC_FOLDFLAG_LINEAFTER_EXPANDED=0x0008 val SC_FOLDFLAG_LINEAFTER_CONTRACTED=0x0010 val SC_FOLDFLAG_LEVELNUMBERS=0x0040 +val SC_FOLDFLAG_LINESTATE=0x0080 # Set some style options for folding. set void SetFoldFlags=2233(int flags,) @@ -1189,6 +1252,7 @@ enu Wrap=SC_WRAP_ val SC_WRAP_NONE=0 val SC_WRAP_WORD=1 val SC_WRAP_CHAR=2 +val SC_WRAP_WHITESPACE=3 # Sets whether text is word wrapped. set void SetWrapMode=2268(int mode,) @@ -1286,13 +1350,27 @@ get bool GetVScrollBar=2281(,) # Append a string to the end of the document without changing the selection. fun void AppendText=2282(int length, string text) -# Is drawing done in two phases with backgrounds drawn before faoregrounds? +# Is drawing done in two phases with backgrounds drawn before foregrounds? get bool GetTwoPhaseDraw=2283(,) # In twoPhaseDraw mode, drawing is performed in two phases, first the background # and then the foreground. This avoids chopping off characters that overlap the next run. set void SetTwoPhaseDraw=2284(bool twoPhase,) +enu FontQuality=SC_PHASES_ +val SC_PHASES_ONE=0 +val SC_PHASES_TWO=1 +val SC_PHASES_MULTIPLE=2 + +# How many phases is drawing done in? +get int GetPhasesDraw=2673(,) + +# In one phase draw, text is drawn in a series of rectangular blocks with no overlap. +# In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally. +# In multiple phase draw, each element is drawn over the whole drawing area, allowing text +# to overlap from one line to the next. +set void SetPhasesDraw=2674(int phases,) + # Control font anti-aliasing. enu FontQuality=SC_EFF_ @@ -1322,6 +1400,7 @@ set void SetMultiPaste=2614(int multiPaste,) get int GetMultiPaste=2615(,) # Retrieve the value of a tag from a regular expression search. +# Result is NUL-terminated. get int GetTag=2616(int tagNumber, stringresult tagValue) # Make the target range start and end be the same as the selection range start and end. @@ -1623,6 +1702,8 @@ enu Status=SC_STATUS_ val SC_STATUS_OK=0 val SC_STATUS_FAILURE=1 val SC_STATUS_BADALLOC=2 +val SC_STATUS_WARN_START=1000 +val SC_STATUS_WARN_REGEX=1001 # Change error status - 0 = OK. set void SetStatus=2382(int statusCode,) @@ -1867,6 +1948,7 @@ get int AutoCGetCurrent=2445(,) # Get currently selected item text in the auto-completion list # Returns the length of the item text +# Result is NUL-terminated. get int AutoCGetCurrentText=2610(, stringresult s) enu CaseInsensitiveBehaviour=SC_CASEINSENSITIVEBEHAVIOUR_ @@ -1879,6 +1961,16 @@ set void AutoCSetCaseInsensitiveBehaviour=2634(int behaviour,) # Get auto-completion case insensitive behaviour. get int AutoCGetCaseInsensitiveBehaviour=2635(,) +enu MultiAutoComplete=SC_MULTIAUTOC_ +val SC_MULTIAUTOC_ONCE=0 +val SC_MULTIAUTOC_EACH=1 + +# Change the effect of autocompleting when there are multiple selections. +set void AutoCSetMulti=2636(int multi,) + +# Retrieve the effect of autocompleting when there are multiple selections.. +get int AutoCGetMulti=2637(,) + enu Ordering=SC_ORDER_ val SC_ORDER_PRESORTED=0 val SC_ORDER_PERFORMSORT=1 @@ -2006,12 +2098,6 @@ get int GetRangePointer=2643(int position, int rangeLength) # the range of a call to GetRangePointer. get position GetGapPosition=2644(,) -# Always interpret keyboard input as Unicode -set void SetKeysUnicode=2521(bool keysUnicode,) - -# Are keys always interpreted as Unicode? -get bool GetKeysUnicode=2522(,) - # Set the alpha fill colour of the given indicator. set void IndicSetAlpha=2523(int indicator, int alpha) @@ -2104,6 +2190,7 @@ enu AnnotationVisible=ANNOTATION_ val ANNOTATION_HIDDEN=0 val ANNOTATION_STANDARD=1 val ANNOTATION_BOXED=2 +val ANNOTATION_INDENTED=3 # Set the visibility for the annotations for a view set void AnnotationSetVisible=2548(int visible,) @@ -2311,6 +2398,8 @@ fun void ScrollToEnd=2629(,) val SC_TECHNOLOGY_DEFAULT=0 val SC_TECHNOLOGY_DIRECTWRITE=1 +val SC_TECHNOLOGY_DIRECTWRITERETAIN=2 +val SC_TECHNOLOGY_DIRECTWRITEDC=3 # Set the technology used. set void SetTechnology=2630(int technology,) @@ -2343,10 +2432,27 @@ get bool GetCaretLineVisibleAlways=2654(,) # Sets the caret line to always visible. set void SetCaretLineVisibleAlways=2655(bool alwaysVisible,) +# Line end types which may be used in addition to LF, CR, and CRLF +# SC_LINE_END_TYPE_UNICODE includes U+2028 Line Separator, +# U+2029 Paragraph Separator, and U+0085 Next Line +enu LineEndType=SC_LINE_END_TYPE_ +val SC_LINE_END_TYPE_DEFAULT=0 +val SC_LINE_END_TYPE_UNICODE=1 + +# Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding. +set void SetLineEndTypesAllowed=2656(int lineEndBitSet,) + +# Get the line end types currently allowed. +get int GetLineEndTypesAllowed=2657(,) + +# Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation. +get int GetLineEndTypesActive=2658(,) + # Set the way a character is drawn. set void SetRepresentation=2665(string encodedCharacter, string representation) # Set the way a character is drawn. +# Result is NUL-terminated. get int GetRepresentation=2666(string encodedCharacter, stringresult representation) # Remove a character representation. @@ -2383,10 +2489,12 @@ set void SetLexerLanguage=4006(, string language) fun void LoadLexerLibrary=4007(, string path) # Retrieve a "property" value previously set with SetProperty. +# Result is NUL-terminated. get int GetProperty=4008(string key, stringresult buf) # Retrieve a "property" value previously set with SetProperty, # with "$()" variable replacement on returned buffer. +# Result is NUL-terminated. get int GetPropertyExpanded=4009(string key, stringresult buf) # Retrieve a "property" value previously set with SetProperty, @@ -2398,12 +2506,14 @@ get int GetStyleBitsNeeded=4011(,) # Retrieve the name of the lexer. # Return the length of the text. +# Result is NUL-terminated. get int GetLexerLanguage=4012(, stringresult text) # For private communication between an application and a known lexer. fun int PrivateLexerCall=4013(int operation, int pointer) # Retrieve a '\n' separated list of properties understood by the current lexer. +# Result is NUL-terminated. fun int PropertyNames=4014(, stringresult names) enu TypeProperty=SC_TYPE_ @@ -2415,11 +2525,46 @@ val SC_TYPE_STRING=2 fun int PropertyType=4015(string name,) # Describe a property. +# Result is NUL-terminated. fun int DescribeProperty=4016(string name, stringresult description) # Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer. +# Result is NUL-terminated. fun int DescribeKeyWordSets=4017(, stringresult descriptions) +# Bit set of LineEndType enumertion for which line ends beyond the standard +# LF, CR, and CRLF are supported by the lexer. +get int GetLineEndTypesSupported=4018(,) + +# Allocate a set of sub styles for a particular base style, returning start of range +fun int AllocateSubStyles=4020(int styleBase, int numberStyles) + +# The starting style number for the sub styles associated with a base style +get int GetSubStylesStart=4021(int styleBase,) + +# The number of sub styles associated with a base style +get int GetSubStylesLength=4022(int styleBase,) + +# For a sub style, return the base style, else return the argument. +get int GetStyleFromSubStyle=4027(int subStyle,) + +# For a secondary style, return the primary style, else return the argument. +get int GetPrimaryStyleFromStyle=4028(int style,) + +# Free allocated sub styles +fun void FreeSubStyles=4023(,) + +# Set the identifiers that are shown in a particular style +set void SetIdentifiers=4024(int style, string identifiers) + +# Where styles are duplicated by a feature such as active/inactive code +# return the distance between the two types. +get int DistanceToSecondaryStyles=4025(,) + +# Get the set of base styles that can be extended with sub styles +# Result is NUL-terminated. +get int GetSubStyleBases=4026(, stringresult styles) + # 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. @@ -2445,7 +2590,9 @@ val SC_MOD_CHANGEMARGIN=0x10000 val SC_MOD_CHANGEANNOTATION=0x20000 val SC_MOD_CONTAINER=0x40000 val SC_MOD_LEXERSTATE=0x80000 -val SC_MODEVENTMASKALL=0xFFFFF +val SC_MOD_INSERTCHECK=0x100000 +val SC_MOD_CHANGETABSTOPS=0x200000 +val SC_MODEVENTMASKALL=0x3FFFFF enu Update=SC_UPDATE_ val SC_UPDATE_CONTENT=0x1 @@ -2609,6 +2756,13 @@ val SCLEX_STTXT=109 val SCLEX_KVIRC=110 val SCLEX_RUST=111 val SCLEX_DMAP=112 +val SCLEX_AS=113 +val SCLEX_DMIS=114 +val SCLEX_REGISTRY=115 +val SCLEX_BIBTEX=116 +val SCLEX_SREC=117 +val SCLEX_IHEX=118 +val SCLEX_TEHEX=119 # When a lexer specifies its language as SCLEX_AUTOMATIC it receives a # value assigned in sequence from SCLEX_AUTOMATIC+1. @@ -2661,6 +2815,8 @@ val SCE_C_HASHQUOTEDSTRING=22 val SCE_C_PREPROCESSORCOMMENT=23 val SCE_C_PREPROCESSORCOMMENTDOC=24 val SCE_C_USERLITERAL=25 +val SCE_C_TASKMARKER=26 +val SCE_C_ESCAPESEQUENCE=27 # Lexical states for SCLEX_D lex D=SCLEX_D SCE_D_ val SCE_D_DEFAULT=0 @@ -3198,8 +3354,9 @@ val SCE_SCRIPTOL_IDENTIFIER=12 val SCE_SCRIPTOL_TRIPLE=13 val SCE_SCRIPTOL_CLASSNAME=14 val SCE_SCRIPTOL_PREPROCESSOR=15 -# Lexical states for SCLEX_ASM +# Lexical states for SCLEX_ASM, SCLEX_AS lex Asm=SCLEX_ASM SCE_ASM_ +lex As=SCLEX_AS SCE_ASM_ val SCE_ASM_DEFAULT=0 val SCE_ASM_COMMENT=1 val SCE_ASM_NUMBER=2 @@ -3486,6 +3643,11 @@ val SCE_V_OPERATOR=10 val SCE_V_IDENTIFIER=11 val SCE_V_STRINGEOL=12 val SCE_V_USER=19 +val SCE_V_COMMENT_WORD=20 +val SCE_V_INPUT=21 +val SCE_V_OUTPUT=22 +val SCE_V_INOUT=23 +val SCE_V_PORT_CONNECT=24 # Lexical states for SCLEX_KIX lex Kix=SCLEX_KIX SCE_KIX_ val SCE_KIX_DEFAULT=0 @@ -3498,6 +3660,7 @@ val SCE_KIX_MACRO=6 val SCE_KIX_KEYWORD=7 val SCE_KIX_FUNCTIONS=8 val SCE_KIX_OPERATOR=9 +val SCE_KIX_COMMENTSTREAM=10 val SCE_KIX_IDENTIFIER=31 # Lexical states for SCLEX_GUI4CLI lex Gui4Cli=SCLEX_GUI4CLI SCE_GC_ @@ -3608,6 +3771,7 @@ val SCE_VHDL_STDFUNCTION=11 val SCE_VHDL_STDPACKAGE=12 val SCE_VHDL_STDTYPE=13 val SCE_VHDL_USERWORD=14 +val SCE_VHDL_BLOCK_COMMENT=15 # Lexical states for SCLEX_CAML lex Caml=SCLEX_CAML SCE_CAML_ val SCE_CAML_DEFAULT=0 @@ -3729,6 +3893,7 @@ val SCE_SQL_USER2=20 val SCE_SQL_USER3=21 val SCE_SQL_USER4=22 val SCE_SQL_QUOTEDIDENTIFIER=23 +val SCE_SQL_QOPERATOR=24 # Lexical states for SCLEX_SMALLTALK lex Smalltalk=SCLEX_SMALLTALK SCE_ST_ val SCE_ST_DEFAULT=0 @@ -4374,6 +4539,9 @@ val SCE_RUST_IDENTIFIER=17 val SCE_RUST_LIFETIME=18 val SCE_RUST_MACRO=19 val SCE_RUST_LEXERROR=20 +val SCE_RUST_BYTESTRING=21 +val SCE_RUST_BYTESTRINGR=22 +val SCE_RUST_BYTECHARACTER=23 # Lexical states for SCLEX_DMAP lex DMAP=SCLEX_DMAP SCE_DMAP_ val SCE_DMAP_DEFAULT=0 @@ -4387,6 +4555,67 @@ val SCE_DMAP_IDENTIFIER=7 val SCE_DMAP_WORD=8 val SCE_DMAP_WORD2=9 val SCE_DMAP_WORD3=10 +# Lexical states for SCLEX_DMIS +lex DMIS=SCLEX_DMIS SCE_DMIS_ +val SCE_DMIS_DEFAULT=0 +val SCE_DMIS_COMMENT=1 +val SCE_DMIS_STRING=2 +val SCE_DMIS_NUMBER=3 +val SCE_DMIS_KEYWORD=4 +val SCE_DMIS_MAJORWORD=5 +val SCE_DMIS_MINORWORD=6 +val SCE_DMIS_UNSUPPORTED_MAJOR=7 +val SCE_DMIS_UNSUPPORTED_MINOR=8 +val SCE_DMIS_LABEL=9 +# Lexical states for SCLEX_REGISTRY +lex REG=SCLEX_REGISTRY SCE_REG_ +val SCE_REG_DEFAULT=0 +val SCE_REG_COMMENT=1 +val SCE_REG_VALUENAME=2 +val SCE_REG_STRING=3 +val SCE_REG_HEXDIGIT=4 +val SCE_REG_VALUETYPE=5 +val SCE_REG_ADDEDKEY=6 +val SCE_REG_DELETEDKEY=7 +val SCE_REG_ESCAPED=8 +val SCE_REG_KEYPATH_GUID=9 +val SCE_REG_STRING_GUID=10 +val SCE_REG_PARAMETER=11 +val SCE_REG_OPERATOR=12 +# Lexical state for SCLEX_BIBTEX +lex BibTeX=SCLEX_BIBTEX SCE_BIBTEX_ +val SCE_BIBTEX_DEFAULT=0 +val SCE_BIBTEX_ENTRY=1 +val SCE_BIBTEX_UNKNOWN_ENTRY=2 +val SCE_BIBTEX_KEY=3 +val SCE_BIBTEX_PARAMETER=4 +val SCE_BIBTEX_VALUE=5 +val SCE_BIBTEX_COMMENT=6 +# Lexical state for SCLEX_SREC +lex Srec=SCLEX_SREC SCE_HEX_ +val SCE_HEX_DEFAULT=0 +val SCE_HEX_RECSTART=1 +val SCE_HEX_RECTYPE=2 +val SCE_HEX_RECTYPE_UNKNOWN=3 +val SCE_HEX_BYTECOUNT=4 +val SCE_HEX_BYTECOUNT_WRONG=5 +val SCE_HEX_NOADDRESS=6 +val SCE_HEX_DATAADDRESS=7 +val SCE_HEX_RECCOUNT=8 +val SCE_HEX_STARTADDRESS=9 +val SCE_HEX_ADDRESSFIELD_UNKNOWN=10 +val SCE_HEX_EXTENDEDADDRESS=11 +val SCE_HEX_DATA_ODD=12 +val SCE_HEX_DATA_EVEN=13 +val SCE_HEX_DATA_UNKNOWN=14 +val SCE_HEX_DATA_EMPTY=15 +val SCE_HEX_CHECKSUM=16 +val SCE_HEX_CHECKSUM_WRONG=17 +val SCE_HEX_GARBAGE=18 +# Lexical state for SCLEX_IHEX (shared with Srec) +lex IHex=SCLEX_IHEX SCE_HEX_ +# Lexical state for SCLEX_TEHEX (shared with Srec) +lex TEHex=SCLEX_TEHEX SCE_HEX_ # Events @@ -4421,55 +4650,9 @@ evt void HotSpotReleaseClick=2027(int modifiers, int position) evt void FocusIn=2028(void) evt void FocusOut=2029(void) -cat Provisional - -# Line end types which may be used in addition to LF, CR, and CRLF -# SC_LINE_END_TYPE_UNICODE includes U+2028 Line Separator, -# U+2029 Paragraph Separator, and U+0085 Next Line -enu LineEndType=SC_LINE_END_TYPE_ -val SC_LINE_END_TYPE_DEFAULT=0 -val SC_LINE_END_TYPE_UNICODE=1 - -# Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding. -set void SetLineEndTypesAllowed=2656(int lineEndBitSet,) - -# Get the line end types currently allowed. -get int GetLineEndTypesAllowed=2657(,) - -# Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation. -get int GetLineEndTypesActive=2658(,) - -# Bit set of LineEndType enumertion for which line ends beyond the standard -# LF, CR, and CRLF are supported by the lexer. -get int GetLineEndTypesSupported=4018(,) - -# Allocate a set of sub styles for a particular base style, returning start of range -fun int AllocateSubStyles=4020(int styleBase, int numberStyles) - -# The starting style number for the sub styles associated with a base style -get int GetSubStylesStart=4021(int styleBase,) +# There are no provisional features currently -# The number of sub styles associated with a base style -get int GetSubStylesLength=4022(int styleBase,) - -# For a sub style, return the base style, else return the argument. -get int GetStyleFromSubStyle=4027(int subStyle,) - -# For a secondary style, return the primary style, else return the argument. -get int GetPrimaryStyleFromStyle=4028(int style,) - -# Free allocated sub styles -fun void FreeSubStyles=4023(,) - -# Set the identifiers that are shown in a particular style -set void SetIdentifiers=4024(int style, string identifiers) - -# Where styles are duplicated by a feature such as active/inactive code -# return the distance between the two types. -get int DistanceToSecondaryStyles=4025(,) - -# Get the set of base styles that can be extended with sub styles -get int GetSubStyleBases=4026(, stringresult styles) +cat Provisional cat Deprecated @@ -4485,3 +4668,11 @@ get bool GetUsePalette=2139(,) # In palette mode, Scintilla uses the environment's palette calls to display # more colours. This may lead to ugly displays. set void SetUsePalette=2039(bool usePalette,) + +# Deprecated in 3.5.5 + +# Always interpret keyboard input as Unicode +set void SetKeysUnicode=2521(bool keysUnicode,) + +# Are keys always interpreted as Unicode? +get bool GetKeysUnicode=2522(,) diff --git a/PythonScript/src/ScintillaPython.cpp b/PythonScript/src/ScintillaPython.cpp index 0978e04c..60537c3f 100644 --- a/PythonScript/src/ScintillaPython.cpp +++ b/PythonScript/src/ScintillaPython.cpp @@ -618,8 +618,6 @@ BOOST_PYTHON_MODULE(Npp) .def("getPositionCache", &ScintillaWrapper::GetPositionCache, "How many entries are allocated to the position cache?") .def("copyAllowLine", &ScintillaWrapper::CopyAllowLine, "Copy the selection, if selection empty copy the line with the caret") .def("getGapPosition", &ScintillaWrapper::GetGapPosition, "Return a position which, to avoid performance costs, should not be within\nthe range of a call to GetRangePointer.") - .def("setKeysUnicode", &ScintillaWrapper::SetKeysUnicode, boost::python::args("keysUnicode"), "Always interpret keyboard input as Unicode") - .def("getKeysUnicode", &ScintillaWrapper::GetKeysUnicode, "Are keys always interpreted as Unicode?") .def("indicSetAlpha", &ScintillaWrapper::IndicSetAlpha, boost::python::args("indicator", "alpha"), "Set the alpha fill colour of the given indicator.") .def("indicGetAlpha", &ScintillaWrapper::IndicGetAlpha, boost::python::args("indicator"), "Get the alpha fill colour of the given indicator.") .def("indicSetOutlineAlpha", &ScintillaWrapper::IndicSetOutlineAlpha, boost::python::args("indicator", "alpha"), "Set the alpha outline colour of the given indicator.") diff --git a/PythonScript/src/ScintillaWrapper.h b/PythonScript/src/ScintillaWrapper.h index 277a0c4c..630e9680 100644 --- a/PythonScript/src/ScintillaWrapper.h +++ b/PythonScript/src/ScintillaWrapper.h @@ -2319,14 +2319,6 @@ class ScintillaWrapper : public PyProducerConsumer */ int GetGapPosition(); - /** Always interpret keyboard input as Unicode - */ - void SetKeysUnicode(bool keysUnicode); - - /** Are keys always interpreted as Unicode? - */ - bool GetKeysUnicode(); - /** Set the alpha fill colour of the given indicator. */ void IndicSetAlpha(int indicator, int alpha); diff --git a/PythonScript/src/ScintillaWrapperGenerated.cpp b/PythonScript/src/ScintillaWrapperGenerated.cpp index 8948ccc8..a11cb13c 100644 --- a/PythonScript/src/ScintillaWrapperGenerated.cpp +++ b/PythonScript/src/ScintillaWrapperGenerated.cpp @@ -4349,22 +4349,6 @@ int ScintillaWrapper::GetGapPosition() return callScintilla(SCI_GETGAPPOSITION); } -/** Always interpret keyboard input as Unicode - */ -void ScintillaWrapper::SetKeysUnicode(bool keysUnicode) -{ - DEBUG_TRACE(L"ScintillaWrapper::SetKeysUnicode\n"); - callScintilla(SCI_SETKEYSUNICODE, keysUnicode); -} - -/** Are keys always interpreted as Unicode? - */ -bool ScintillaWrapper::GetKeysUnicode() -{ - DEBUG_TRACE(L"ScintillaWrapper::GetKeysUnicode\n"); - return 0 != (callScintilla(SCI_GETKEYSUNICODE)); -} - /** Set the alpha fill colour of the given indicator. */ void ScintillaWrapper::IndicSetAlpha(int indicator, int alpha) diff --git a/PythonScript/src/ShortcutDlg.cpp b/PythonScript/src/ShortcutDlg.cpp index 0ae8c050..6f48fdb6 100644 --- a/PythonScript/src/ShortcutDlg.cpp +++ b/PythonScript/src/ShortcutDlg.cpp @@ -65,7 +65,7 @@ void ShortcutDlg::doDialog() } -BOOL CALLBACK ShortcutDlg::run_dlgProc(HWND /* hWnd */, UINT message, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK ShortcutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { diff --git a/PythonScript/src/ShortcutDlg.h b/PythonScript/src/ShortcutDlg.h index 3eb80bb4..43db712e 100644 --- a/PythonScript/src/ShortcutDlg.h +++ b/PythonScript/src/ShortcutDlg.h @@ -19,7 +19,7 @@ class ShortcutDlg : public StaticDialog void doDialog(); protected: - BOOL CALLBACK run_dlgProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam); + INT_PTR CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); private: ShortcutDlg(); // default constructor disabled