diff --git a/external/npp/Docking.h b/external/npp/Docking.h index 334b496..0a3918b 100644 --- a/external/npp/Docking.h +++ b/external/npp/Docking.h @@ -1,24 +1,23 @@ -/* -this file is part of Function List Plugin for Notepad++ -Copyright (C)2005 Jens Lorenz +// This file is part of Notepad++ project +// Copyright (C)2025 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 3 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, see . -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 -#ifndef DOCKING_H -#define DOCKING_H +#include // ATTENTION : It's a part of interface header, so don't include the others header here @@ -37,6 +36,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define DWS_ICONTAB 0x00000001 // Icon for tabs are available #define DWS_ICONBAR 0x00000002 // Icon for icon bar are available (currently not supported) #define DWS_ADDINFO 0x00000004 // Additional information are in use +#define DWS_USEOWNDARKMODE 0x00000008 // Use plugin's own dark mode #define DWS_PARAMSALL (DWS_ICONTAB|DWS_ICONBAR|DWS_ADDINFO) // default docking values for first call of plugin @@ -47,31 +47,29 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define DWS_DF_FLOATING 0x80000000 // default state is floating -typedef struct { - HWND hClient; // client Window Handle - 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 +struct tTbData { + HWND hClient = nullptr; // client Window Handle + const wchar_t* pszName = nullptr; // name of plugin (shown in window) + int dlgID = 0; // 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 + UINT uMask = 0; // mask params: look to above defines + HICON hIconTab = nullptr; // icon for tabs + const wchar_t* pszAddInfo = nullptr; // for plugin to display additional information // 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; + RECT rcFloat = {}; // floating position + int iPrevCont = 0; // stores the privious container (toggling between float and dock) + const wchar_t* pszModuleName = nullptr; // it's the plugin file name. It's used to identify the plugin +}; -typedef struct { - HWND hWnd; // the docking manager wnd - RECT rcRegion[DOCKCONT_MAX]; // position of docked dialogs -} tDockMgr; +struct tDockMgr { + HWND hWnd = nullptr; // the docking manager wnd + RECT rcRegion[DOCKCONT_MAX] = {{}}; // position of docked dialogs +}; #define HIT_TEST_THICKNESS 20 #define SPLITTER_WIDTH 4 - -#endif // DOCKING_H diff --git a/external/npp/DockingDlgInterface.h b/external/npp/DockingDlgInterface.h index ce447cc..5970b1c 100644 --- a/external/npp/DockingDlgInterface.h +++ b/external/npp/DockingDlgInterface.h @@ -1,120 +1,131 @@ -/* -this file is part of Function List Plugin for Notepad++ -Copyright (C)2005 Jens Lorenz +// This file is part of Notepad++ project +// 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 3 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, see . -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. -*/ #pragma once -#include "StaticDialog.h" #include "dockingResource.h" #include "Docking.h" + +#include #include +#include +#include "StaticDialog.h" + class DockingDlgInterface : public StaticDialog { public: - DockingDlgInterface() : StaticDialog() {}; - DockingDlgInterface(int dlgID) : StaticDialog(), _dlgID(dlgID) {}; + DockingDlgInterface() = default; + explicit DockingDlgInterface(int dlgID): _dlgID(dlgID) {} - virtual void init(HINSTANCE hInst, HWND parent) - { + virtual void init(HINSTANCE hInst, HWND parent) { StaticDialog::init(hInst, parent); - ::GetModuleFileName((HMODULE)hInst, _moduleName, MAX_PATH); - lstrcpy(_moduleName, PathFindFileName(_moduleName)); + TCHAR temp[MAX_PATH]; + ::GetModuleFileName(reinterpret_cast(hInst), temp, MAX_PATH); + _moduleName = ::PathFindFileName(temp); } - void create(tTbData * data, bool isRTL = false) - { + void create(tTbData* data, bool isRTL = false) { + assert(data != nullptr); StaticDialog::create(_dlgID, isRTL); - ::GetWindowText(_hSelf, _pluginName, _countof(_pluginName)); + TCHAR temp[MAX_PATH]; + ::GetWindowText(_hSelf, temp, MAX_PATH); + _pluginName = temp; - // user information + // user information data->hClient = _hSelf; - data->pszName = _pluginName; + data->pszName = _pluginName.c_str(); // supported features by plugin data->uMask = 0; // additional info data->pszAddInfo = NULL; - _data = data; + } + virtual void updateDockingDlg() { + ::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, reinterpret_cast(_hSelf)); } - virtual void updateDockingDlg(void) - { - ::SendMessage(_hParent, NPPM_DMMUPDATEDISPINFO, 0, (LPARAM)_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)); } - virtual void destroy() {} + bool isClosed() const { + return _isClosed; + } - virtual void display(bool toShow = true) const - { - ::SendMessage(_hParent, toShow ? NPPM_DMMSHOW : NPPM_DMMHIDE, 0, (LPARAM)_hSelf); + void setClosed(bool toClose) { + _isClosed = toClose; } - const TCHAR * getPluginFileName() const { return _moduleName; } + const TCHAR * getPluginFileName() const { + return _moduleName.c_str(); + } -protected: - virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM /*wParam*/, LPARAM lParam) - { - switch (message) - { +protected : + int _dlgID = -1; + bool _isFloating = true; + int _iDockedPos = 0; + std::wstring _moduleName; + std::wstring _pluginName; + bool _isClosed = false; - case WM_NOTIFY: + virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM, LPARAM lParam) { + switch (message) { - LPNMHDR pnmh = (LPNMHDR)lParam; - - if (pnmh->hwndFrom == _hParent) + case WM_NOTIFY: { - switch (LOWORD(pnmh->code)) - { - case DMN_CLOSE: - { - break; - } - case DMN_FLOAT: - { - _isFloating = true; - break; - } - case DMN_DOCK: + LPNMHDR pnmh = reinterpret_cast(lParam); + + if (pnmh->hwndFrom == _hParent) { - _isFloating = false; - break; - } - default: - break; + 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; } - break; - } - default: - break; + default: + break; } return FALSE; }; - - // Handles - HWND _HSource = nullptr; - tTbData* _data = nullptr; - int _dlgID = 0; - bool _isFloating = false; - TCHAR _moduleName[MAX_PATH] = {}; - TCHAR _pluginName[MAX_PATH] = {}; }; diff --git a/external/npp/Notepad_plus_msgs.h b/external/npp/Notepad_plus_msgs.h index 46d2288..dc7f5cd 100644 --- a/external/npp/Notepad_plus_msgs.h +++ b/external/npp/Notepad_plus_msgs.h @@ -1,425 +1,1060 @@ // 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. +// Copyright (C)2025 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 3 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 +// 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. +// along with this program. If not, see . + -#ifndef NOTEPAD_PLUS_MSGS_H -#define NOTEPAD_PLUS_MSGS_H +// For more comprehensive information on plugin communication, please refer to the following resource: +// https://npp-user-manual.org/docs/plugin-communication/ + + +#pragma once #include -#include 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_ASP, L_SQL, L_VB, L_JS_EMBEDDED, 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_COBOL, L_GUI4CLI, L_D, L_POWERSHELL, L_R, L_JSP,\ - L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77,\ - // Don't use L_JS, use L_JAVASCRIPT instead - // The end of enumated language type, so it should be always at the end + 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_NIM, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \ + L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,\ + L_TYPESCRIPT, L_JSON5, L_MSSQL, L_GDSCRIPT, L_HOLLYWOOD,\ + L_GOLANG, L_RAKU, L_TOML, L_SAS, L_ERRORLIST, \ + // Don't use L_JS_EMBEDDED, use L_JAVASCRIPT instead + // The end of enumerated language type, so it should be always at the end L_EXTERNAL}; +enum class ExternalLexerAutoIndentMode { Standard, C_Like, Custom }; +enum class MacroStatus { Idle, RecordInProgress, RecordingStopped, PlayingBack }; -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 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, WV_WIN11 }; +enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; -//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) - #define NPPM_GETCURRENTLANGTYPE (NPPMSG + 5) - #define NPPM_SETCURRENTLANGTYPE (NPPMSG + 6) - - #define NPPM_GETNBOPENFILES (NPPMSG + 7) - #define ALL_OPEN_FILES 0 - #define PRIMARY_VIEW 1 - #define SECOND_VIEW 2 - - #define NPPM_GETOPENFILENAMES (NPPMSG + 8) - - - #define NPPM_MODELESSDIALOG (NPPMSG + 12) - #define MODELESSDIALOGADD 0 - #define MODELESSDIALOGREMOVE 1 + #define NPPM_GETCURRENTSCINTILLA (NPPMSG + 4) + // BOOL NPPM_GETCURRENTSCINTILLA(0, int* iScintillaView) + // Get current Scintilla view. + // wParam: 0 (not used) + // lParam[out]: iScintillaView could be 0 (Main View) or 1 (Sub View) + // return TRUE + + #define NPPM_GETCURRENTLANGTYPE (NPPMSG + 5) + // BOOL NPPM_GETCURRENTLANGTYPE(0, int* langType) + // Get the programming language type from the current used document. + // wParam: 0 (not used) + // lParam[out]: langType - see "enum LangType" for all valid values + // return TRUE + + #define NPPM_SETCURRENTLANGTYPE (NPPMSG + 6) + // BOOL NPPM_SETCURRENTLANGTYPE(0, int langType) + // Set a new programming language type to the current used document. + // wParam: 0 (not used) + // lParam[in]: langType - see "enum LangType" for all valid values + // return TRUE + + #define NPPM_GETNBOPENFILES (NPPMSG + 7) + #define ALL_OPEN_FILES 0 + #define PRIMARY_VIEW 1 + #define SECOND_VIEW 2 + // int NPPM_GETNBOPENFILES(0, int iViewType) + // Get the number of files currently open. + // wParam: 0 (not used) + // lParam[in]: iViewType - could be PRIMARY_VIEW (value 1), SECOND_VIEW (value 2) or ALL_OPEN_FILES (value 0) + // return the number of opened files + + #define NPPM_GETOPENFILENAMES_DEPRECATED (NPPMSG + 8) + // BOOL NPPM_GETOPENFILENAMES_DEPRECATED(wchar_t** fileNames, int nbFileNames) - DEPRECATED: It is kept for the compatibility. Use NPPM_GETBUFFERIDFROMPOS & NPPM_GETFULLPATHFROMBUFFERID instead. + // Get the open files full paths of both views. User is responsible to allocate a big enough fileNames array by using NPPM_GETNBOPENFILES. + // wParam[out]: fileNames - array of file path + // lParam[in]: nbFileNames is the number of file path. + // return value: The number of files copied into fileNames array + + #define NPPM_MODELESSDIALOG (NPPMSG + 12) + #define MODELESSDIALOGADD 0 + #define MODELESSDIALOGREMOVE 1 + // HWND NPPM_MODELESSDIALOG(int action, HWND hDlg) + // Register (or unregister) plugin's dialog handle. + // For each created dialog in your plugin, you should register it (and unregister while destroy it) to Notepad++ by using this message. + // If this message is ignored, then your dialog won't react with the key stroke messages such as TAB, Ctrl-C or Ctrl-V key. + // For the good functioning of your plugin dialog, you're recommended to not ignore this message. + // wParam[in]: action is MODELESSDIALOGADD (for registering your hDlg) or MODELESSDIALOGREMOVE (for unregistering your hDlg) + // lParam[in]: hDlg is the handle of dialog to register/unregister + // return hDlg (HWND) on success, NULL on failure #define NPPM_GETNBSESSIONFILES (NPPMSG + 13) + // int NPPM_GETNBSESSIONFILES (BOOL* pbIsValidXML, wchar_t* sessionFileName) + // Get the number of files to load in the session sessionFileName. sessionFileName should be a full path name of an xml file. + // wParam[out]: pbIsValidXML, if the lParam pointer is null, then this parameter will be ignored. TRUE if XML is valid, otherwise FALSE. + // lParam[in]: sessionFileName is XML session full path + // return value: The number of files in XML session file + #define NPPM_GETSESSIONFILES (NPPMSG + 14) - #define NPPM_SAVESESSION (NPPMSG + 15) - #define NPPM_SAVECURRENTSESSION (NPPMSG + 16) + // BOOL NPPM_GETSESSIONFILES (wchar_t** sessionFileArray, wchar_t* sessionFileName) + // the files' full path name from a session file. + // wParam[out]: sessionFileArray is the array in which the files' full path of the same group are written. To allocate the array with the proper size, send message NPPM_GETNBSESSIONFILES. + // lParam[in]: sessionFileName is XML session full path + // Return FALSE on failure, TRUE on success + #define NPPM_SAVESESSION (NPPMSG + 15) struct sessionInfo { - TCHAR* sessionFilePathName; - int nbFile; - TCHAR** files; + wchar_t* sessionFilePathName; // Full session file path name to be saved + int nbFile; // Size of "files" array - number of files to be saved in session + wchar_t** files; // Array of file name (full path) to be saved in session }; + // NPPM_SAVESESSION(0, sessionInfo* si) + // Creates an session file for a defined set of files. + // Contrary to NPPM_SAVECURRENTSESSION (see below), which saves the current opened files, this call can be used to freely define any file which should be part of a session. + // wParam: 0 (not used) + // lParam[in]: si is a pointer to sessionInfo structure + // Returns sessionFileName on success, NULL otherwise - #define NPPM_GETOPENFILENAMESPRIMARY (NPPMSG + 17) - #define NPPM_GETOPENFILENAMESSECOND (NPPMSG + 18) + #define NPPM_SAVECURRENTSESSION (NPPMSG + 16) + // wchar_t* NPPM_SAVECURRENTSESSION(0, wchar_t* sessionFileName) + // Saves the current opened files in Notepad++ as a group of files (session) as an xml file. + // wParam: 0 (not used) + // lParam[in]: sessionFileName is the xml full path name + // Returns sessionFileName on success, NULL otherwise + + + #define NPPM_GETOPENFILENAMESPRIMARY_DEPRECATED (NPPMSG + 17) + // BOOL NPPM_GETOPENFILENAMESPRIMARY_DEPRECATED(wchar_t** fileNames, int nbFileNames) - DEPRECATED: It is kept for the compatibility. Use NPPM_GETBUFFERIDFROMPOS & NPPM_GETFULLPATHFROMBUFFERID instead. + // Get the open files full paths of main view. User is responsible to allocate an big enough fileNames array by using NPPM_GETNBOPENFILES. + // wParam[out]: fileNames - array of file path + // lParam[in]: nbFileNames is the number of file path. + // return value: The number of files copied into fileNames array + + #define NPPM_GETOPENFILENAMESSECOND_DEPRECATED (NPPMSG + 18) + // BOOL NPPM_GETOPENFILENAMESSECOND_DEPRECATED(wchar_t** fileNames, int nbFileNames) - DEPRECATED: It is kept for the compatibility. Use NPPM_GETBUFFERIDFROMPOS & NPPM_GETFULLPATHFROMBUFFERID instead. + // Get the open files full paths of sub-view. User is responsible to allocate an big enough fileNames array by using NPPM_GETNBOPENFILES. + // wParam[out]: fileNames - array of file path + // lParam[in]: nbFileNames is the number of file path. + // return value: The number of files copied into fileNames array #define NPPM_CREATESCINTILLAHANDLE (NPPMSG + 20) - #define NPPM_DESTROYSCINTILLAHANDLE (NPPMSG + 21) + // HWND NPPM_CREATESCINTILLAHANDLE(0, HWND hParent) + // A plugin can create a Scintilla for its usage by sending this message to Notepad++. + // wParam: 0 (not used) + // lParam[in]: hParent - If set (non NULL), it will be the parent window of this created Scintilla handle, otherwise the parent window is Notepad++ + // return the handle of created Scintilla handle + + #define NPPM_DESTROYSCINTILLAHANDLE_DEPRECATED (NPPMSG + 21) + // BOOL NPPM_DESTROYSCINTILLAHANDLE_DEPRECATED(0, HWND hScintilla) - DEPRECATED: It is kept for the compatibility. + // Notepad++ will deallocate every created Scintilla control on exit, this message returns TRUE but does nothing. + // wParam: 0 (not used) + // lParam[in]: hScintilla is Scintilla handle + // Return TRUE + #define NPPM_GETNBUSERLANG (NPPMSG + 22) + // int NPPM_GETNBUSERLANG(0, int* udlID) + // Get the number of user defined languages and, optionally, the starting menu id. + // wParam: 0 (not used) + // lParam[out]: udlID is optional, if not used set it to 0, otherwise an integer pointer is needed to retrieve the menu identifier. + // Return the number of user defined languages identified #define NPPM_GETCURRENTDOCINDEX (NPPMSG + 23) #define MAIN_VIEW 0 #define SUB_VIEW 1 + // int NPPM_GETCURRENTDOCINDEX(0, int inView) + // Get the current index of the given view. + // wParam: 0 (not used) + // lParam[in]: inView, should be 0 (main view) or 1 (sub-view) + // Return -1 if the view is invisible (hidden), otherwise is the current index. #define NPPM_SETSTATUSBAR (NPPMSG + 24) - #define STATUSBAR_DOC_TYPE 0 - #define STATUSBAR_DOC_SIZE 1 - #define STATUSBAR_CUR_POS 2 - #define STATUSBAR_EOF_FORMAT 3 + #define STATUSBAR_DOC_TYPE 0 + #define STATUSBAR_DOC_SIZE 1 + #define STATUSBAR_CUR_POS 2 + #define STATUSBAR_EOF_FORMAT 3 #define STATUSBAR_UNICODE_TYPE 4 - #define STATUSBAR_TYPING_MODE 5 + #define STATUSBAR_TYPING_MODE 5 + // BOOL NPPM_SETSTATUSBAR(int whichPart, wchar_t *str2set) + // Set string in the specified field of a statusbar. + // wParam[in]: whichPart for indicating the statusbar part you want to set. It can be only the above value (0 - 5) + // lParam[in]: str2set is the string you want to write to the part of statusbar. + // Return FALSE on failure, TRUE on success #define NPPM_GETMENUHANDLE (NPPMSG + 25) #define NPPPLUGINMENU 0 #define NPPMAINMENU 1 - // INT NPPM_GETMENUHANDLE(INT menuChoice, 0) + // int NPPM_GETMENUHANDLE(int menuChoice, 0) + // Get menu handle (HMENU) of choice. + // wParam[in]: menuChoice could be main menu (NPPMAINMENU) or Plugin menu (NPPPLUGINMENU) + // lParam: 0 (not used) // 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 + // int NPPM_ENCODESCI(int inView, 0) + // Changes current buffer in view to UTF-8. + // wParam[in]: inView - main view (0) or sub-view (1) + // lParam: 0 (not used) + // return new UniMode, with the following value: + // 0: ANSI + // 1: UTF-8 with BOM + // 2: UTF-16 Big Ending with BOM + // 3: UTF-16 Little Ending with BOM + // 4: UTF-8 without BOM + // 5: uni7Bit + // 6: UTF-16 Big Ending without BOM + // 7: UTF-16 Little Ending without BOM #define NPPM_DECODESCI (NPPMSG + 27) - //unicode file to ascii - //int NPPM_DECODESCI(MAIN_VIEW/SUB_VIEW, 0) - //return old unicodeMode + // int NPPM_DECODESCI(int inView, 0) + // Changes current buffer in view to ANSI. + // wParam[in]: inView - main view (0) or sub-view (1) + // lParam: 0 (not used) + // return old UniMode - see above #define NPPM_ACTIVATEDOC (NPPMSG + 28) - //void NPPM_ACTIVATEDOC(int view, int index2Activate) + // BOOL NPPM_ACTIVATEDOC(int inView, int index2Activate) + // Switch to the document by the given view and index. + // wParam[in]: inView - main view (0) or sub-view (1) + // lParam[in]: index2Activate - index (in the view indicated above) where is the document to be activated + // Return TRUE #define NPPM_LAUNCHFINDINFILESDLG (NPPMSG + 29) - //void NPPM_LAUNCHFINDINFILESDLG(TCHAR * dir2Search, TCHAR * filtre) + // BOOL NPPM_LAUNCHFINDINFILESDLG(wchar_t * dir2Search, wchar_t * filtre) + // Launch Find in Files dialog and set "Find in" directory and filters with the given arguments. + // wParam[in]: if dir2Search is not NULL, it will be set as working directory in which Notepad++ will search + // lParam[in]: if filtre is not NULL, filtre string will be set into filter field + // Return TRUE #define NPPM_DMMSHOW (NPPMSG + 30) - //void NPPM_DMMSHOW(0, tTbData->hClient) + // BOOL NPPM_DMMSHOW(0, HWND hDlg) + // Show the dialog which was previously registered by NPPM_DMMREGASDCKDLG. + // wParam: 0 (not used) + // lParam[in]: hDlg is the handle of dialog to show + // Return TRUE #define NPPM_DMMHIDE (NPPMSG + 31) - //void NPPM_DMMHIDE(0, tTbData->hClient) + // BOOL NPPM_DMMHIDE(0, HWND hDlg) + // Hide the dialog which was previously registered by NPPM_DMMREGASDCKDLG. + // wParam: 0 (not used) + // lParam[in]: hDlg is the handle of dialog to hide + // Return TRUE #define NPPM_DMMUPDATEDISPINFO (NPPMSG + 32) - //void NPPM_DMMUPDATEDISPINFO(0, tTbData->hClient) + // BOOL NPPM_DMMUPDATEDISPINFO(0, HWND hDlg) + // Redraw the dialog. + // wParam: 0 (not used) + // lParam[in]: hDlg is the handle of dialog to redraw + // Return TRUE #define NPPM_DMMREGASDCKDLG (NPPMSG + 33) - //void NPPM_DMMREGASDCKDLG(0, &tTbData) + // BOOL NPPM_DMMREGASDCKDLG(0, tTbData* pData) + // Pass the necessary dockingData to Notepad++ in order to make your dialog dockable. + // wParam: 0 (not used) + // lParam[in]: pData is the pointer of tTbData. Please check tTbData structure in "Docking.h" + // Minimum information which needs to be filled out are hClient, pszName, dlgID, uMask and pszModuleName. + // Notice that rcFloat and iPrevCont shouldn't be filled. They are used internally. + // Return TRUE #define NPPM_LOADSESSION (NPPMSG + 34) - //void NPPM_LOADSESSION(0, const TCHAR* file name) + // BOOL NPPM_LOADSESSION(0, wchar_t* sessionFileName) + // Open all files of same session in Notepad++ via a xml format session file sessionFileName. + // wParam: 0 (not used) + // lParam[in]: sessionFileName is the full file path of session file to reload + // Return TRUE #define NPPM_DMMVIEWOTHERTAB (NPPMSG + 35) - //void WM_DMM_VIEWOTHERTAB(0, tTbData->pszName) + // BOOL WM_DMM_VIEWOTHERTAB(0, wchar_t* name) + // Show the plugin dialog (switch to plugin tab) with the given name. + // wParam: 0 (not used) + // lParam[in]: name should be the same value as previously used to register the dialog (pszName of tTbData) + // Return TRUE #define NPPM_RELOADFILE (NPPMSG + 36) - //BOOL NPPM_RELOADFILE(BOOL withAlert, TCHAR *filePathName2Reload) + // BOOL NPPM_RELOADFILE(BOOL withAlert, wchar_t *filePathName2Reload) + // Reload the document which matches with the given filePathName2Reload. + // wParam: 0 (not used) + // lParam[in]: filePathName2Reload is the full file path of document to reload + // Return TRUE if reloading file succeeds, otherwise FALSE #define NPPM_SWITCHTOFILE (NPPMSG + 37) - //BOOL NPPM_SWITCHTOFILE(0, TCHAR *filePathName2switch) + // BOOL NPPM_SWITCHTOFILE(0, wchar_t* filePathName2switch) + // Switch to the document which matches with the given filePathName2switch. + // wParam: 0 (not used) + // lParam[in]: filePathName2switch is the full file path of document to switch + // Return TRUE #define NPPM_SAVECURRENTFILE (NPPMSG + 38) - //BOOL NPPM_SAVECURRENTFILE(0, 0) + // BOOL NPPM_SAVECURRENTFILE(0, 0) + // Save current activated document. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return TRUE if file is saved, otherwise FALSE (the file doesn't need to be saved, or other reasons). #define NPPM_SAVEALLFILES (NPPMSG + 39) - //BOOL NPPM_SAVEALLFILES(0, 0) + // BOOL NPPM_SAVEALLFILES(0, 0) + // Save all opened document. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return FALSE when no file needs to be saved, else TRUE if there is at least one file saved. #define NPPM_SETMENUITEMCHECK (NPPMSG + 40) - //void WM_PIMENU_CHECK(UINT funcItem[X]._cmdID, TRUE/FALSE) + // BOOL NPPM_SETMENUITEMCHECK(UINT pluginCmdID, BOOL doCheck) + // Set or remove the check on a item of plugin menu and tool bar (if any). + // wParam[in]: pluginCmdID is the plugin command ID which corresponds to the menu item: funcItem[X]._cmdID + // lParam[in]: if doCheck value is TRUE, item will be checked, FALSE makes item unchecked. + // Return TRUE - #define NPPM_ADDTOOLBARICON (NPPMSG + 41) - //void WM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons icon) + #define NPPM_ADDTOOLBARICON_DEPRECATED (NPPMSG + 41) struct toolbarIcons { HBITMAP hToolbarBmp; HICON hToolbarIcon; }; + // BOOL NPPM_ADDTOOLBARICON_DEPRECATED(UINT pluginCmdID, toolbarIcons* iconHandles) -- DEPRECATED: use NPPM_ADDTOOLBARICON_FORDARKMODE instead + // Add an icon to the toolbar. + // wParam[in]: pluginCmdID is the plugin command ID which corresponds to the menu item: funcItem[X]._cmdID + // lParam[in]: iconHandles of toolbarIcons structure. 2 formats ".ico" & ".bmp" are needed + // Both handles should be set so the icon will be displayed correctly if toolbar icon sets are changed by users + // Return TRUE + #define NPPM_GETWINDOWSVERSION (NPPMSG + 42) - //winVer NPPM_GETWINDOWSVERSION(0, 0) + // winVer NPPM_GETWINDOWSVERSION(0, 0) + // Get OS (Windows) version. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return enum winVer, which is defined at the beginning of this file #define NPPM_DMMGETPLUGINHWNDBYNAME (NPPMSG + 43) - //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 + // HWND NPPM_DMMGETPLUGINHWNDBYNAME(const wchar_t *windowName, const wchar_t *moduleName) + // Retrieve the dialog handle corresponds to the windowName and moduleName. You may need this message if you want to communicate with another plugin "dockable" dialog. + // wParam[in]: windowName - if windowName is NULL, then the first found window handle which matches with the moduleName will be returned + // lParam[in] : moduleName - if moduleName is NULL, then return value is NULL + // Return NULL if moduleName 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) - - #define NPPM_GETENABLETHEMETEXTUREFUNC (NPPMSG + 45) - //BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0) + // BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0) + // Make the current document dirty, aka set the save state to unsaved. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return TRUE + + #define NPPM_GETENABLETHEMETEXTUREFUNC_DEPRECATED (NPPMSG + 45) + // THEMEAPI NPPM_GETENABLETHEMETEXTUREFUNC(0, 0) -- DEPRECATED: plugin can use EnableThemeDialogTexture directly from uxtheme.h instead + // Get "EnableThemeDialogTexture" function address. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return a proc address or NULL #define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46) - //void NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str) + // int NPPM_GETPLUGINSCONFIGDIR(int strLen, wchar_t *str) + // Get user's plugin config directory path. It's useful if plugins want to save/load parameters for the current user + // wParam[in]: strLen is length of allocated buffer in which directory path is copied + // lParam[out] : str is the allocated buffere. User should call this message twice - + // The 1st call with "str" be NULL to get the required number of wchar_t (not including the terminating nul character) + // The 2nd call to allocate "str" buffer with the 1st call's return value + 1, then call it again to get the path + // Return value: The 1st call - the number of wchar_t to copy. + // The 2nd call - FALSE on failure, TRUE on success #define NPPM_MSGTOPLUGIN (NPPMSG + 47) - //BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info) - // return value is TRUE when the message arrive to the destination plugins. - // if destModule or info is NULL, then return value is FALSE struct CommunicationInfo { - long internalMsg; - const TCHAR * srcModuleName; - void * info; // defined by plugin + long internalMsg; // an integer defined by plugin Y, known by plugin X, identifying the message being sent. + const wchar_t * srcModuleName; // the complete module name (with the extension .dll) of caller (plugin X). + void* info; // defined by plugin, the information to be exchanged between X and Y. It's a void pointer so it should be defined by plugin Y and known by plugin X. }; + // BOOL NPPM_MSGTOPLUGIN(wchar_t *destModuleName, CommunicationInfo *info) + // Send a private information to a plugin with given plugin name. This message allows the communication between 2 plugins. + // For example, plugin X can execute a command of plugin Y if plugin X knows the command ID and the file name of plugin Y. + // wParam[in]: destModuleName is the destination complete module file name (with the file extension ".dll") + // lParam[in]: info - See above "CommunicationInfo" structure + // The returned value is TRUE if Notepad++ found the plugin by its module name (destModuleName), and pass the info (communicationInfo) to the module. + // The returned value is FALSE if no plugin with such name is found. #define NPPM_MENUCOMMAND (NPPMSG + 48) - //void NPPM_MENUCOMMAND(0, int cmdID) - // 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 + // BOOL NPPM_MENUCOMMAND(0, int cmdID) + // Run Notepad++ command with the given command ID. + // wParam: 0 (not used) + // lParam[in]: cmdID - See "menuCmdID.h" for all the Notepad++ menu command items + // Return TRUE #define NPPM_TRIGGERTABBARCONTEXTMENU (NPPMSG + 49) - //void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate) + // BOOL NPPM_TRIGGERTABBARCONTEXTMENU(int inView, int index2Activate) + // Switch to the document by the given view and index and trigger the context menu + // wParam[in]: inView - main view (0) or sub-view (1) + // lParam[in]: index2Activate - index (in the view indicated above) where is the document to have the context menu + // Return TRUE #define NPPM_GETNPPVERSION (NPPMSG + 50) - // int NPPM_GETNPPVERSION(0, 0) - // return version - // ex : v4.6 - // HIWORD(version) == 4 - // LOWORD(version) == 6 + // int NPPM_GETNPPVERSION(BOOL ADD_ZERO_PADDING, 0) + // Get Notepad++ version. + // wParam[in]: ADD_ZERO_PADDING (see below) + // lParam: 0 (not used) + // return value: + // HIWORD(returned_value) is major part of version: the 1st number + // LOWORD(returned_value) is minor part of version: the 3 last numbers + // + // ADD_ZERO_PADDING == TRUE + // + // version | HIWORD | LOWORD + //------------------------------ + // 8.9.6.4 | 8 | 964 + // 9 | 9 | 0 + // 6.9 | 6 | 900 + // 6.6.6 | 6 | 660 + // 13.6.6.6 | 13 | 666 + // + // + // ADD_ZERO_PADDING == FALSE + // + // version | HIWORD | LOWORD + //------------------------------ + // 8.9.6.4 | 8 | 964 + // 9 | 9 | 0 + // 6.9 | 6 | 9 + // 6.6.6 | 6 | 66 + // 13.6.6.6 | 13 | 666 #define NPPM_HIDETABBAR (NPPMSG + 51) // BOOL NPPM_HIDETABBAR(0, BOOL hideOrNot) - // if hideOrNot is set as TRUE then tab bar will be hidden - // otherwise it'll be shown. - // return value : the old status value + // Hide (or show) tab bar. + // wParam: 0 (not used) + // lParam[in]: if hideOrNot is set as TRUE then tab bar will be hidden, otherwise it'll be shown. + // return value: the old status value #define NPPM_ISTABBARHIDDEN (NPPMSG + 52) // BOOL NPPM_ISTABBARHIDDEN(0, 0) - // returned value : TRUE if tab bar is hidden, otherwise FALSE + // Get tab bar status. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if tool bar is hidden, otherwise FALSE #define NPPM_GETPOSFROMBUFFERID (NPPMSG + 57) - // INT NPPM_GETPOSFROMBUFFERID(INT 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 + // int NPPM_GETPOSFROMBUFFERID(UINT_PTR bufferID, int priorityView) + // Get document position (VIEW and INDEX) from a buffer ID, according priorityView. + // wParam[in]: BufferID of document + // lParam[in]: priorityView is the target VIEW. However, if the given bufferID cannot be found in the target VIEW, the other VIEW will be searched. + // Return -1 if the bufferID non existing, else return value contains VIEW & INDEX: // // VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits) - // Here's the values for the view : + // Here's the values for the view: // MAIN_VIEW 0 // SUB_VIEW 1 + // + // if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly #define NPPM_GETFULLPATHFROMBUFFERID (NPPMSG + 58) - // INT NPPM_GETFULLPATHFROMBUFFERID(INT 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 + // int NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, wchar_t* fullFilePath) + // Get full path file name from a bufferID (the pointer of buffer). + // wParam[in]: bufferID + // lParam[out]: fullFilePath - User should call it with fullFilePath be NULL to get the number of wchar_t (not including the nul character), + // allocate fullFilePath with the return values + 1, then call it again to get full path file name + // Return -1 if the bufferID non existing, otherwise the number of wchar_t copied/to copy #define NPPM_GETBUFFERIDFROMPOS (NPPMSG + 59) - // LRESULT NPPM_GETBUFFERIDFROMPOS(INT index, INT iView) - // wParam: Position of document - // lParam: View to use, 0 = Main, 1 = Secondary - // Returns 0 if invalid + // UINT_PTR NPPM_GETBUFFERIDFROMPOS(int index, int iView) + // Get the document bufferID from the given position (iView & index). + // wParam[in]: Position (0 based) of document + // lParam[in]: Main or sub View in which document is, 0 = Main, 1 = Sub + // Returns NULL if invalid, otherwise bufferID #define NPPM_GETCURRENTBUFFERID (NPPMSG + 60) - // LRESULT NPPM_GETCURRENTBUFFERID(0, 0) - // Returns active Buffer + // UINT_PTR NPPM_GETCURRENTBUFFERID(0, 0) + // Get active document BufferID. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return active document BufferID #define NPPM_RELOADBUFFERID (NPPMSG + 61) - // VOID NPPM_RELOADBUFFERID(0, 0) - // Reloads Buffer - // wParam: Buffer to reload - // lParam: 0 if no alert, else alert - + // BOOL NPPM_RELOADBUFFERID(UINT_PTR bufferID, BOOL alert) + // Reloads document with the given BufferID + // wParam[in]: BufferID of document to reload + // lParam[in]: set TRUE to let user confirm or reject the reload; setting FALSE will reload with no alert. + // Returns TRUE on success, FALSE otherwise #define NPPM_GETBUFFERLANGTYPE (NPPMSG + 64) - // INT NPPM_GETBUFFERLANGTYPE(INT bufferID, 0) - // wParam: BufferID to get LangType from - // lParam: 0 + // int NPPM_GETBUFFERLANGTYPE(UINT_PTR bufferID, 0) + // Retrieves the language type of the document with the given bufferID. + // wParam[in]: BufferID of document to get LangType from + // lParam: 0 (not used) // Returns as int, see LangType. -1 on error #define NPPM_SETBUFFERLANGTYPE (NPPMSG + 65) - // BOOL NPPM_SETBUFFERLANGTYPE(INT bufferID, INT langType) - // wParam: BufferID to set LangType of - // lParam: LangType + // BOOL NPPM_SETBUFFERLANGTYPE(UINT_PTR bufferID, int langType) + // Set the language type of the document based on the given bufferID. + // wParam[in]: BufferID to set LangType of + // lParam[in]: langType as int, enum LangType for valid values (L_USER and L_EXTERNAL are not supported) // 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) - // INT NPPM_GETBUFFERENCODING(INT bufferID, 0) - // wParam: BufferID to get encoding from - // lParam: 0 - // returns as int, see UniMode. -1 on error + // int NPPM_GETBUFFERENCODING(UINT_PTR bufferID, 0) + // Get encoding from the document with the given bufferID + // wParam[in]: BufferID to get encoding from + // lParam: 0 (not used) + // returns -1 on error, otherwise UniMode, with the following value: + // 0: ANSI + // 1: UTF-8 with BOM + // 2: UTF-16 Big Ending with BOM + // 3: UTF-16 Little Ending with BOM + // 4: UTF-8 without BOM + // 5: uni7Bit + // 6: UTF-16 Big Ending without BOM + // 7: UTF-16 Little Ending without BOM #define NPPM_SETBUFFERENCODING (NPPMSG + 67) - // BOOL NPPM_SETBUFFERENCODING(INT bufferID, INT encoding) + // BOOL NPPM_SETBUFFERENCODING(UINT_PTR bufferID, int encoding) + // Set encoding to the document with the given bufferID // wParam: BufferID to set encoding of - // lParam: encoding + // lParam: encoding, see UniMode value in NPPM_GETBUFFERENCODING (above) // Returns TRUE on success, FALSE otherwise - // use int, see UniMode // Can only be done on new, unedited files #define NPPM_GETBUFFERFORMAT (NPPMSG + 68) - // INT NPPM_GETBUFFERFORMAT(INT bufferID, 0) - // wParam: BufferID to get format from - // lParam: 0 - // returns as int, see formatType. -1 on error + // int NPPM_GETBUFFERFORMAT(UINT_PTR bufferID, 0) + // Get the EOL format of the document with given bufferID. + // wParam[in]: BufferID to get EolType format from + // lParam: 0 (not used) + // Returned value is -1 on error, otherwise EolType format: + // 0: Windows (CRLF) + // 1: Macos (CR) + // 2: Unix (LF) + // 3. Unknown #define NPPM_SETBUFFERFORMAT (NPPMSG + 69) - // BOOL NPPM_SETBUFFERFORMAT(INT bufferID, INT format) - // wParam: BufferID to set format of - // lParam: format + // BOOL NPPM_SETBUFFERFORMAT(UINT_PTR bufferID, int format) + // Set the EOL format to the document with given bufferID. + // wParam[in]: BufferID to set EolType format of + // lParam[in]: EolType format. For EolType format value, see NPPM_GETBUFFERFORMAT (above) // 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 -*/ #define NPPM_HIDETOOLBAR (NPPMSG + 70) // BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot) - // if hideOrNot is set as TRUE then tool bar will be hidden - // otherwise it'll be shown. - // return value : the old status value + // Hide (or show) the toolbar. + // wParam: 0 (not used) + // lParam[in]: if hideOrNot is set as TRUE then tool bar will be hidden, otherwise it'll be shown. + // return value: the old status value #define NPPM_ISTOOLBARHIDDEN (NPPMSG + 71) // BOOL NPPM_ISTOOLBARHIDDEN(0, 0) - // returned value : TRUE if tool bar is hidden, otherwise FALSE + // Get toolbar status. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if tool bar is hidden, otherwise FALSE #define NPPM_HIDEMENU (NPPMSG + 72) // BOOL NPPM_HIDEMENU(0, BOOL hideOrNot) - // if hideOrNot is set as TRUE then menu will be hidden - // otherwise it'll be shown. - // return value : the old status value + // Hide (or show) menu bar. + // wParam: 0 (not used) + // lParam[in]: if hideOrNot is set as TRUE then menu will be hidden, otherwise it'll be shown. + // return value: the old status value #define NPPM_ISMENUHIDDEN (NPPMSG + 73) // BOOL NPPM_ISMENUHIDDEN(0, 0) - // returned value : TRUE if menu is hidden, otherwise FALSE + // Get menu bar status. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if menu bar is hidden, otherwise FALSE #define NPPM_HIDESTATUSBAR (NPPMSG + 74) // BOOL NPPM_HIDESTATUSBAR(0, BOOL hideOrNot) - // if hideOrNot is set as TRUE then STATUSBAR will be hidden - // otherwise it'll be shown. - // return value : the old status value + // Hide (or show) status bar. + // wParam: 0 (not used) + // lParam[in]: if hideOrNot is set as TRUE then status bar will be hidden, otherwise it'll be shown. + // return value: the old status value #define NPPM_ISSTATUSBARHIDDEN (NPPMSG + 75) // BOOL NPPM_ISSTATUSBARHIDDEN(0, 0) - // returned value : TRUE if STATUSBAR is hidden, otherwise FALSE + // Get status bar status. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if status bar is hidden, otherwise FALSE #define NPPM_GETSHORTCUTBYCMDID (NPPMSG + 76) - // 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 + // BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey* sk) + // Get your plugin command current mapped shortcut into sk via cmdID. + // wParam[in]: cmdID is your plugin command ID + // lParam[out]: sk is a pointer of ShortcutKey strcture which will receive the requested CMD shortcut. It should be allocated in the plugin before being used. + // For ShortcutKey strcture, see in "PluginInterface.h". You may need it after getting NPPN_READY notification. + // return 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). + // BOOL NPPM_DOOPEN(0, const wchar_t* fullPathName2Open) + // Open a file with given fullPathName2Open. + // If fullPathName2Open has been already opened in Notepad++, the it will be activated and becomes the current document. + // wParam: 0 (not used) + // lParam[in]: fullPathName2Open indicates the full file path name to be opened + // The return value is TRUE if the operation is successful, otherwise FALSE #define NPPM_SAVECURRENTFILEAS (NPPMSG + 78) - // BOOL NPPM_SAVECURRENTFILEAS (BOOL asCopy, const TCHAR* filename) + // BOOL NPPM_SAVECURRENTFILEAS (BOOL saveAsCopy, const wchar_t* filename) + // Save the current activated document. + // wParam[in]: saveAsCopy must be either FALSE to save, or TRUE to save a copy of the current filename ("Save a Copy As..." action) + // lParam[in]: filename indicates the full file path name to be saved + // The return value is TRUE if the operation is successful, otherwise FALSE #define NPPM_GETCURRENTNATIVELANGENCODING (NPPMSG + 79) - // INT NPPM_GETCURRENTNATIVELANGENCODING(0, 0) - // returned value : the current native language enconding + // int NPPM_GETCURRENTNATIVELANGENCODING(0, 0) + // Get the code page associated with the current localisation of Notepad++. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: the current native language encoding + + #define NPPM_ALLOCATESUPPORTED_DEPRECATED (NPPMSG + 80) + // DEPRECATED: the message has been made (since 2010 AD) for checking if NPPM_ALLOCATECMDID is supported. This message is no more needed. + // BOOL NPPM_ALLOCATESUPPORTED_DEPRECATED(0, 0) + // Get NPPM_ALLOCATECMDID supported status. Use to identify if subclassing is necessary + // wParam: 0 (not used) + // lParam: 0 (not used) + // returns TRUE if NPPM_ALLOCATECMDID is supported - #define NPPM_ALLOCATESUPPORTED (NPPMSG + 80) - // returns TRUE if NPPM_ALLOCATECMDID is supported - // Use to identify if subclassing is necessary #define NPPM_ALLOCATECMDID (NPPMSG + 81) - // BOOL NPPM_ALLOCATECMDID(int numberRequested, int* startNumber) - // sets startNumber to the initial command ID if successful - // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // BOOL NPPM_ALLOCATECMDID(int numberRequested, int* startNumber) + // Obtain a number of consecutive menu item IDs for creating menus dynamically, with the guarantee of these IDs not clashing with any other plugins. + // wParam[in]: numberRequested is the number of ID you request for the reservation + // lParam[out]: startNumber will be set to the initial command ID if successful + // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // + // Example: If a plugin needs 4 menu item ID, the following code can be used: + // + // int idBegin; + // BOOL isAllocatedSuccessful = ::SendMessage(nppData._nppHandle, NPPM_ALLOCATECMDID, 4, &idBegin); + // + // if isAllocatedSuccessful is TRUE, and value of idBegin is 46581 + // then menu item ID 46581, 46582, 46583 and 46584 are preserved by Notepad++, and they are safe to be used by the plugin. #define NPPM_ALLOCATEMARKER (NPPMSG + 82) // BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber) - // sets startNumber to the initial command ID if successful - // Allocates a marker number to a plugin - // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // Allocate a number of consecutive marker IDs to a plugin: if a plugin need to add a marker on Notepad++'s Scintilla marker margin, + // it has to use this message to get marker number, in order to prevent from the conflict with the other plugins. + // wParam[in]: numberRequested is the number of ID you request for the reservation + // lParam[out]: startNumber will be set to the initial command ID if successful + // Return TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // + // Example: If a plugin needs 3 marker ID, the following code can be used: + // + // int idBegin; + // BOOL isAllocatedSuccessful = ::SendMessage(nppData._nppHandle, NPPM_ALLOCATEMARKER, 3, &idBegin); + // + // if isAllocatedSuccessful is TRUE, and value of idBegin is 16 + // then marker ID 16, 17 and 18 are preserved by Notepad++, and they are safe to be used by the plugin. #define NPPM_GETLANGUAGENAME (NPPMSG + 83) - // INT NPPM_GETLANGUAGENAME(int langType, TCHAR *langName) - // Get programing language name from the given language type (LangType) + // int NPPM_GETLANGUAGENAME(LangType langType, wchar_t* langName) + // Get programming language name from the given language type (enum LangType). + // wParam[in]: langType is the number of LangType + // lParam[out]: langName is the buffer to receive the language name string // 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 programing language short description from the given language type (LangType) + // INT NPPM_GETLANGUAGEDESC(int langType, wchar_t *langDesc) + // Get programming language short description from the given language type (enum LangType) + // wParam[in]: langType is the number of LangType + // lParam[out]: langDesc is the buffer to receive the language description string // 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_SHOWDOCLIST (NPPMSG + 85) + // BOOL NPPM_SHOWDOCLIST(0, BOOL toShowOrNot) + // Show or hide the Document List panel. + // wParam: 0 (not used) + // lParam[in]: toShowOrNot - if toShowOrNot is TRUE, the Document List panel is shown otherwise it is hidden. + // Return TRUE - #define NPPM_ISDOCSWITCHERSHOWN (NPPMSG + 86) - // BOOL NPPM_ISDOCSWITCHERSHOWN(0, 0) - // Check to see if doc switcher is shown. + #define NPPM_ISDOCLISTSHOWN (NPPMSG + 86) + // BOOL NPPM_ISDOCLISTSHOWN(0, 0) + // Checks the visibility of the Document List panel. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if the Document List panel is currently shown, FALSE otherwise #define NPPM_GETAPPDATAPLUGINSALLOWED (NPPMSG + 87) // BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0) - // Check to see if loading plugins from "%APPDATA%\Notepad++\plugins" is allowed. + // Check to see if loading plugins from "%APPDATA%\..\Local\Notepad++\plugins" is allowed. + // wParam: 0 (not used) + // lParam: 0 (not used) + // return value: TRUE if loading plugins from %APPDATA% is allowed, FALSE otherwise #define NPPM_GETCURRENTVIEW (NPPMSG + 88) - // INT NPPM_GETCURRENTVIEW(0, 0) + // int NPPM_GETCURRENTVIEW(0, 0) + // Get the current used view. + // wParam: 0 (not used) + // lParam: 0 (not used) // 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_DOCLISTDISABLEEXTCOLUMN (NPPMSG + 89) + // BOOL NPPM_DOCLISTDISABLEEXTCOLUMN(0, BOOL disableOrNot) + // Disable or enable extension column of Document List + // wParam: 0 (not used) + // lParam[in]: disableOrNot - if disableOrNot is TRUE, extension column is hidden otherwise it is visible. + // Return TRUE + + #define NPPM_DOCLISTDISABLEPATHCOLUMN (NPPMSG + 102) + // BOOL NPPM_DOCLISTDISABLEPATHCOLUMN(0, BOOL disableOrNot) + // Disable or enable path column of Document List + // wParam: 0 (not used) + // lParam[in]: disableOrNot - if disableOrNot is TRUE, extension column is hidden otherwise it is visible. + // Return TRUE #define NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR (NPPMSG + 90) - // INT NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0) - // Return: current editor default foreground color. You should convert the returned value in COLORREF + // int NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0) + // Get the current editor default foreground color. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return: the color as integer with hex format being 0x00bbggrr #define NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR (NPPMSG + 91) - // INT NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR(0, 0) - // Return: current editor default background color. You should convert the returned value in COLORREF + // int NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR(0, 0) + // Get the current editor default background color. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return: the color as integer with hex format being 0x00bbggrr #define NPPM_SETSMOOTHFONT (NPPMSG + 92) - // VOID NPPM_SETSMOOTHFONT(0, BOOL setSmoothFontOrNot) + // BOOL NPPM_SETSMOOTHFONT(0, BOOL setSmoothFontOrNot) + // Set (or remove) smooth font. The API uses underlying Scintilla command SCI_SETFONTQUALITY to manage the font quality. + // wParam: 0 (not used) + // lParam[in]: setSmoothFontOrNot - if value is TRUE, this message sets SC_EFF_QUALITY_LCD_OPTIMIZED else SC_EFF_QUALITY_DEFAULT + // Return TRUE #define NPPM_SETEDITORBORDEREDGE (NPPMSG + 93) - // VOID NPPM_SETEDITORBORDEREDGE(0, BOOL withEditorBorderEdgeOrNot) + // BOOL NPPM_SETEDITORBORDEREDGE(0, BOOL withEditorBorderEdgeOrNot) + // Add (or remove) an additional sunken edge style to the Scintilla window else it removes the extended style from the window. + // wParam: 0 (not used) + // lParam[in]: withEditorBorderEdgeOrNot - TRUE for adding border edge on Scintilla window, FALSE for removing it + // Return TRUE #define NPPM_SAVEFILE (NPPMSG + 94) - // VOID NPPM_SAVEFILE(0, const TCHAR *fileNameToSave) + // BOOL NPPM_SAVEFILE(0, const wchar_t *fileNameToSave) + // Save the file (opened in Notepad++) with the given full file name path. + // wParam: 0 (not used) + // lParam[in]: fileNameToSave must be the full file path for the file to be saved. + // Return TRUE on success, FALSE on fileNameToSave is not found #define NPPM_DISABLEAUTOUPDATE (NPPMSG + 95) // 2119 in decimal - // VOID NPPM_DISABLEAUTOUPDATE(0, 0) + // BOOL NPPM_DISABLEAUTOUPDATE(0, 0) + // Disable Notepad++ auto-update. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return TRUE + + #define NPPM_REMOVESHORTCUTBYCMDID (NPPMSG + 96) // 2120 in decimal + // BOOL NPPM_REMOVESHORTCUTBYCMDID(int pluginCmdID, 0) + // Remove the assigned shortcut mapped to pluginCmdID + // wParam[in]: pluginCmdID + // lParam: 0 (not used) + // return value: TRUE if function call is successful, otherwise FALSE + + #define NPPM_GETPLUGINHOMEPATH (NPPMSG + 97) + // int NPPM_GETPLUGINHOMEPATH(size_t strLen, wchar_t* pluginRootPath) + // Get plugin home root path. It's useful if plugins want to get its own path by appending which is the name of plugin without extension part. + // wParam[in]: strLen - size of allocated buffer "pluginRootPath" + // lParam[out]: pluginRootPath - Users should call it with pluginRootPath be NULL to get the required number of wchar_t (not including the terminating nul character), + // allocate pluginRootPath buffer with the return value + 1, then call it again to get the path. + // Return the number of wchar_t copied/to copy, 0 on copy failed + + #define NPPM_GETSETTINGSONCLOUDPATH (NPPMSG + 98) + // int NPPM_GETSETTINGSCLOUDPATH(size_t strLen, wchar_t *settingsOnCloudPath) + // Get settings on cloud path. It's useful if plugins want to store its settings on Cloud, if this path is set. + // wParam[in]: strLen - size of allocated buffer "settingsOnCloudPath" + // lParam[out]: settingsOnCloudPath - Users should call it with settingsOnCloudPath be NULL to get the required number of wchar_t (not including the terminating nul character), + // allocate settingsOnCloudPath buffer with the return value + 1, then call it again to get the path. + // Returns the number of wchar_t copied/to copy. If the return value is 0, then this path is not set, or the "strLen" is not enough to copy the path. + + #define NPPM_SETLINENUMBERWIDTHMODE (NPPMSG + 99) + #define LINENUMWIDTH_DYNAMIC 0 + #define LINENUMWIDTH_CONSTANT 1 + // BOOL NPPM_SETLINENUMBERWIDTHMODE(0, int widthMode) + // Set line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT) + // It may help some plugins to disable non-dynamic line number margins width to have a smoothly visual effect while vertical scrolling the content in Notepad++ + // wParam: 0 (not used) + // lParam[in]: widthMode should be LINENUMWIDTH_DYNAMIC or LINENUMWIDTH_CONSTANT + // return TRUE if calling is successful, otherwise return FALSE + + #define NPPM_GETLINENUMBERWIDTHMODE (NPPMSG + 100) + // int NPPM_GETLINENUMBERWIDTHMODE(0, 0) + // Get line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT) + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return current line number margin width mode (LINENUMWIDTH_DYNAMIC or LINENUMWIDTH_CONSTANT) + + #define NPPM_ADDTOOLBARICON_FORDARKMODE (NPPMSG + 101) + struct toolbarIconsWithDarkMode { + HBITMAP hToolbarBmp; + HICON hToolbarIcon; + HICON hToolbarIconDarkMode; + }; + // BOOL NPPM_ADDTOOLBARICON_FORDARKMODE(UINT pluginCmdID, toolbarIconsWithDarkMode* iconHandles) + // Use NPPM_ADDTOOLBARICON_FORDARKMODE instead obsolete NPPM_ADDTOOLBARICON (DEPRECATED) which doesn't support the dark mode + // wParam[in]: pluginCmdID + // lParam[in]: iconHandles is the pointer of toolbarIconsWithDarkMode structure + // All 3 handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users, also in dark mode + // Return TRUE + + #define NPPM_GETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 103) + // BOOL NPPM_GETEXTERNALLEXERAUTOINDENTMODE(const wchar_t* languageName, ExternalLexerAutoIndentMode* autoIndentMode) + // Get ExternalLexerAutoIndentMode for an installed external programming language. + // wParam[in]: languageName is external language name to search + // lParam[out]: autoIndentMode could receive one of three following values + // - Standard (0) means Notepad++ will keep the same TAB indentation between lines; + // - C_Like (1) means Notepad++ will perform a C-Language style indentation for the selected external language; + // - Custom (2) means a Plugin will be controlling auto-indentation for the current language. + // returned values: TRUE for successful searches, otherwise FALSE. + + #define NPPM_SETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 104) + // BOOL NPPM_SETEXTERNALLEXERAUTOINDENTMODE(const wchar_t* languageName, ExternalLexerAutoIndentMode autoIndentMode) + // Set ExternalLexerAutoIndentMode for an installed external programming language. + // wParam[in]: languageName is external language name to set + // lParam[in]: autoIndentMode could receive one of three following values + // - Standard (0) means Notepad++ will keep the same TAB indentation between lines; + // - C_Like (1) means Notepad++ will perform a C-Language style indentation for the selected external language; + // - Custom (2) means a Plugin will be controlling auto-indentation for the current language. + // return value: TRUE if function call was successful, otherwise FALSE. + + #define NPPM_ISAUTOINDENTON (NPPMSG + 105) + // BOOL NPPM_ISAUTOINDENTON(0, 0) + // Get the current use Auto-Indentation setting in Notepad++ Preferences. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return TRUE if Auto-Indentation is on, FALSE otherwise + + #define NPPM_GETCURRENTMACROSTATUS (NPPMSG + 106) + // MacroStatus NPPM_GETCURRENTMACROSTATUS(0, 0) + // Get current enum class MacroStatus { Idle, RecordInProgress, RecordingStopped, PlayingBack } + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return MacroStatus as int: + // 0: Idle - macro is not in use and it's empty + // 1: RecordInProgress - macro is currently being recorded + // 2: RecordingStopped - macro recording has been stopped + // 3: PlayingBack - macro is currently being played back + + #define NPPM_ISDARKMODEENABLED (NPPMSG + 107) + // BOOL NPPM_ISDARKMODEENABLED(0, 0) + // Get Notepad++ Dark Mode status (ON or OFF). + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return TRUE if Dark Mode is enable, otherwise FALSE + + #define NPPM_GETDARKMODECOLORS (NPPMSG + 108) + // BOOL NPPM_GETDARKMODECOLORS (size_t cbSize, NppDarkMode::Colors* returnColors) + // Get the colors used in Dark Mode. + // wParam[in]: cbSize must be filled with sizeof(NppDarkMode::Colors). + // lParam[out]: returnColors must be a pre-allocated NppDarkMode::Colors struct. + // Return TRUE when successful, FALSE otherwise. + // You need to uncomment the following code to use NppDarkMode::Colors structure: + // + // namespace NppDarkMode + // { + // struct Colors + // { + // COLORREF background = 0; + // COLORREF softerBackground = 0; + // COLORREF hotBackground = 0; + // COLORREF pureBackground = 0; + // COLORREF errorBackground = 0; + // COLORREF text = 0; + // COLORREF darkerText = 0; + // COLORREF disabledText = 0; + // COLORREF linkText = 0; + // COLORREF edge = 0; + // COLORREF hotEdge = 0; + // COLORREF disabledEdge = 0; + // }; + // } + // + // Note: in the case of calling failure ("false" is returned), you may need to change NppDarkMode::Colors structure to: + // https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/NppDarkMode.h#L32 + + #define NPPM_GETCURRENTCMDLINE (NPPMSG + 109) + // int NPPM_GETCURRENTCMDLINE(size_t strLen, wchar_t *commandLineStr) + // Get the Current Command Line string. + // Users should call it with commandLineStr as NULL to get the required number of wchar_t (not including the terminating nul character), + // allocate commandLineStr buffer with the return value + 1, then call it again to get the current command line string. + // wParam[in]: strLen is "commandLineStr" buffer length + // lParam[out]: commandLineStr receives all copied command line string + // Return the number of wchar_t copied/to copy + + + #define NPPM_CREATELEXER (NPPMSG + 110) + // void* NPPM_CREATELEXER(0, const wchar_t* lexer_name) + // Get the ILexer pointer created by Lexilla. Call the lexilla "CreateLexer()" function to allow plugins to set the lexer for a Scintilla instance created by NPPM_CREATESCINTILLAHANDLE. + // wParam: 0 (not used) + // lParam[in]: lexer_name is the name of the lexer + // Return the ILexer pointer + + #define NPPM_GETBOOKMARKID (NPPMSG + 111) + // int NPPM_GETBOOKMARKID(0, 0) + // Get the bookmark ID - use this API to get bookmark ID dynamically that guarantees you get always the right bookmark ID even it's been changed through the different versions. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return bookmark ID + + #define NPPM_DARKMODESUBCLASSANDTHEME (NPPMSG + 112) + namespace NppDarkMode + { + // Standard flags for main parent after its children are initialized. + constexpr ULONG dmfInit = 0x0000000BUL; + + // Standard flags for main parent usually used in NPPN_DARKMODECHANGED. + constexpr ULONG dmfHandleChange = 0x0000000CUL; + }; + + // ULONG NPPM_DARKMODESUBCLASSANDTHEME(ULONG dmFlags, HWND hwnd) + // Add support for generic dark mode to plugin dialog. Subclassing is applied automatically unless DWS_USEOWNDARKMODE flag is used. + // Might not work properly in C# plugins. + // wParam[in]: dmFlags has 2 possible value dmfInit (0x0000000BUL) & dmfHandleChange (0x0000000CUL) - see above definition + // lParam[in]: hwnd is the dialog handle of plugin - Docking panels don't need to call NPPM_DARKMODESUBCLASSANDTHEME + // Returns successful combinations of flags. + + // Examples: + // + // - after controls initializations in WM_INITDIALOG, in WM_CREATE or after CreateWindow: + // + //auto success = static_cast(::SendMessage(nppData._nppHandle, NPPM_DARKMODESUBCLASSANDTHEME, static_cast(NppDarkMode::dmfInit), reinterpret_cast(mainHwnd))); + // + // - handling dark mode change: + // + //extern "C" __declspec(dllexport) void beNotified(SCNotification * notifyCode) + //{ + // switch (notifyCode->nmhdr.code) + // { + // case NPPN_DARKMODECHANGED: + // { + // ::SendMessage(nppData._nppHandle, NPPM_DARKMODESUBCLASSANDTHEME, static_cast(dmfHandleChange), reinterpret_cast(mainHwnd)); + // ::SetWindowPos(mainHwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); // to redraw titlebar and window + // break; + // } + // } + //} + + #define NPPM_ALLOCATEINDICATOR (NPPMSG + 113) + // BOOL NPPM_ALLOCATEINDICATOR(int numberRequested, int* startNumber) + // Allocates an indicator number to a plugin: if a plugin needs to add an indicator, + // it has to use this message to get the indicator number, in order to prevent a conflict with the other plugins. + // wParam[in]: numberRequested is the number of ID you request for the reservation + // lParam[out]: startNumber will be set to the initial command ID if successful + // Return TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // + // Example: If a plugin needs 1 indicator ID, the following code can be used : + // + // int idBegin; + // BOOL isAllocatedSuccessful = ::SendMessage(nppData._nppHandle, NPPM_ALLOCATEINDICATOR, 1, &idBegin); + // + // if isAllocatedSuccessful is TRUE, and value of idBegin is 7 + // then indicator ID 7 is preserved by Notepad++, and it is safe to be used by the plugin. + + #define NPPM_GETTABCOLORID (NPPMSG + 114) + // int NPPM_GETTABCOLORID(int view, int tabIndex) + // Get the tab color ID with given tab index and view. + // wParam[in]: view - main view (0) or sub-view (1) or -1 (active view) + // lParam[in]: tabIndex - index (in the view indicated above). -1 for currently active tab + // Return tab color ID which contains the following values: 0 (yellow), 1 (green), 2 (blue), 3 (orange), 4 (pink) or -1 (no color) + // + // Note: there's no symmetric command NPPM_SETTABCOLORID. Plugins can use NPPM_MENUCOMMAND to set current tab color with the desired tab color ID. + + #define NPPM_SETUNTITLEDNAME (NPPMSG + 115) + // BOOL NPPM_SETUNTITLEDNAME(BufferID id, const wchar_t* newName) + // Rename the tab name for an untitled tab. + // wParam[in]: id - BufferID of the tab. -1 for currently active tab + // lParam[in]: newName - the desired new name of the tab + // Return TRUE upon success; FALSE upon failure + + #define NPPM_GETNATIVELANGFILENAME (NPPMSG + 116) + // int NPPM_GETNATIVELANGFILENAME(size_t strLen, char* nativeLangFileName) + // Get the Current native language file name string. Use it after getting NPPN_READY notification to find out which native language is used. + // Users should call it with nativeLangFileName as NULL to get the required number of char (not including the terminating nul character), + // allocate language file name string buffer with the return value + 1, then call it again to get the current native language file name string. + // If there's no localization file applied, the returned value is 0. + // wParam[in]: strLen is "language file name string" buffer length + // lParam[out]: language file name string receives all copied native language file name string + // Return the number of char copied/to copy + + #define NPPM_ADDSCNMODIFIEDFLAGS (NPPMSG + 117) + // BOOL NPPM_ADDSCNMODIFIEDFLAGS(0, unsigned long scnModifiedFlags2Add) + // Add the necessary SCN_MODIFIED flags so that your plugin will receive the SCN_MODIFIED notification for these events, enabling your specific treatments. + // By default, Notepad++ only forwards SCN_MODIFIED with the following 5 flags/events: + // SC_MOD_DELETETEXT | SC_MOD_INSERTTEXT | SC_PERFORMED_UNDO | SC_PERFORMED_REDO | SC_MOD_CHANGEINDICATOR to plugins. + // If your plugin needs to process other SCN_MODIFIED events, you should add the required flags by sending this message to Notepad++. You can send it immediately after receiving NPPN_READY, + // or only when your plugin needs to listen to specific events (to avoid penalizing Notepad++'s performance). Just ensure that the message is sent only once. + // wParam: 0 (not used) + // lParam[in]: scnModifiedFlags2Add - Scintilla SCN_MODIFIED flags to add. + // Return TRUE + // + // Example: + // + // extern "C" __declspec(dllexport) void beNotified(SCNotification* notifyCode) + // { + // switch (notifyCode->nmhdr.code) + // { + // case NPPN_READY: + // { + // // Add SC_MOD_BEFOREDELETE and SC_MOD_BEFOREINSERT to listen to the 2 events of SCN_MODIFIED + // ::SendMessage(nppData._nppHandle, NPPM_ADDSCNMODIFIEDFLAGS, 0, SC_MOD_BEFOREDELETE | SC_MOD_BEFOREINSERT); + // } + // break; + // ... + // } + // ... + // } + + #define NPPM_GETTOOLBARICONSETCHOICE (NPPMSG + 118) + // BOOL NPPM_GETTOOLBARICONSETCHOICE(0, 0) + // Get Notepad++ toolbar icon set choice (Fluent UI: small, Fluent UI: large, Filled Fluent UI: small, Filled Fluent UI: large and Standard icons: small. + // wParam: 0 (not used) + // lParam: 0 (not used) + // Return toolbar icon set choice as an integer value. Here are 5 possible values: + // 0 (Fluent UI: small), 1 (Fluent UI: large), 2 (Filled Fluent UI: small), 3 (Filled Fluent UI: large) and 4 (Standard icons: small). + + #define NPPM_GETNPPSETTINGSDIRPATH (NPPMSG + 119) + // int NPPM_GETNPPSETTINGSDIRPATH(size_t strLen, wchar_t *settingsDirPath) + // Get path for the active Notepad++ settings: it will use -settingsDir path if that's defined; if not, it will use Cloud directory if that's defined; + // if not, it will use the AppData settings directory, or finally the installation path. This allows plugins to have one interface to find out + // where the active Notepad++ settings are stored, whichever location they are currently set to. + // wParam[in]: strLen - size of allocated buffer "settingsDirPath" + // lParam[out]: settingsDirPath - Users should call it with settingsDirPath be NULL to get the required number of wchar_t (not including the terminating nul character), + // allocate settingsDirPath buffer with the return value + 1, then call it again to get the path. + // Returns the number of wchar_t copied/to copy. If the return value is 0, then the "strLen" is not enough to copy the path, or the settings path could not be determined. + // + // Note: This message is for the active Notepad++ configuration location. If you are looking for the settings directory for plugins (...\Plugins\Config\), + // use NPPM_GETPLUGINSCONFIGDIR instead. + +// For RUNCOMMAND_USER + #define VAR_NOT_RECOGNIZED 0 + #define FULL_CURRENT_PATH 1 + #define CURRENT_DIRECTORY 2 + #define FILE_NAME 3 + #define NAME_PART 4 + #define EXT_PART 5 + #define CURRENT_WORD 6 + #define NPP_DIRECTORY 7 + #define CURRENT_LINE 8 + #define CURRENT_COLUMN 9 + #define NPP_FULL_FILE_PATH 10 + #define GETFILENAMEATCURSOR 11 + #define CURRENT_LINESTR 12 + + #define RUNCOMMAND_USER (WM_USER + 3000) -#define RUNCOMMAND_USER (WM_USER + 3000) #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH) #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY) #define NPPM_GETFILENAME (RUNCOMMAND_USER + FILE_NAME) @@ -427,40 +1062,41 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W #define NPPM_GETEXTPART (RUNCOMMAND_USER + EXT_PART) #define NPPM_GETCURRENTWORD (RUNCOMMAND_USER + CURRENT_WORD) #define NPPM_GETNPPDIRECTORY (RUNCOMMAND_USER + NPP_DIRECTORY) - // BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str) - // where str is the allocated TCHAR array, - // strLen is the allocated array size - // The return value is TRUE when get generic_string operation success - // Otherwise (allocated array size is too small) FALSE + #define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH) + #define NPPM_GETFILENAMEATCURSOR (RUNCOMMAND_USER + GETFILENAMEATCURSOR) + #define NPPM_GETCURRENTLINESTR (RUNCOMMAND_USER + CURRENT_LINESTR) + // BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, wchar_t *str) + // Get XXX string operations. + // wParam[in]: strLen is the allocated array size + // lParam[out]: str is the allocated wchar_t array + // The return value is TRUE when get std::wstring operation success, otherwise FALSE (allocated array size is too small) + #define NPPM_GETCURRENTLINE (RUNCOMMAND_USER + CURRENT_LINE) - // INT NPPM_GETCURRENTLINE(0, 0) + // int NPPM_GETCURRENTLINE(0, 0) + // Get current line number. + // wParam: 0 (not used) + // lParam: 0 (not used) // return the caret current position line + #define NPPM_GETCURRENTCOLUMN (RUNCOMMAND_USER + CURRENT_COLUMN) - // INT NPPM_GETCURRENTCOLUMN(0, 0) + // int NPPM_GETCURRENTCOLUMN(0, 0) + // Get current column number. + // wParam: 0 (not used) + // lParam: 0 (not used) // return the caret current position column - #define VAR_NOT_RECOGNIZED 0 - #define FULL_CURRENT_PATH 1 - #define CURRENT_DIRECTORY 2 - #define FILE_NAME 3 - #define NAME_PART 4 - #define EXT_PART 5 - #define CURRENT_WORD 6 - #define NPP_DIRECTORY 7 - #define CURRENT_LINE 8 - #define CURRENT_COLUMN 9 // Notification code #define NPPN_FIRST 1000 - #define NPPN_READY (NPPN_FIRST + 1) // To notify plugins that all the procedures of launchment of notepad++ are done. + #define NPPN_READY (NPPN_FIRST + 1) // To notify plugins that all the initialization for launching Notepad++ is complete. //scnNotification->nmhdr.code = NPPN_READY; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = 0; #define NPPN_TBMODIFICATION (NPPN_FIRST + 2) // To notify plugins that toolbar icons can be registered - //scnNotification->nmhdr.code = NPPN_TB_MODIFICATION; + //scnNotification->nmhdr.code = NPPN_TBMODIFICATION; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = 0; @@ -485,7 +1121,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W //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.code = NPPN_FILEBEFORESAVE; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; @@ -515,7 +1151,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W //scnNotification->nmhdr.idFrom = currentBufferID; #define NPPN_SHORTCUTREMAPPED (NPPN_FIRST + 13) // To notify plugins that plugin command shortcut is remapped. - //scnNotification->nmhdr.code = NPPN_SHORTCUTSREMAPPED; + //scnNotification->nmhdr.code = NPPN_SHORTCUTREMAPPED; //scnNotification->nmhdr.hwndFrom = ShortcutKeyStructurePointer; //scnNotification->nmhdr.idFrom = cmdID; //where ShortcutKeyStructurePointer is pointer of struct ShortcutKey: @@ -527,12 +1163,12 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W //}; #define NPPN_FILEBEFORELOAD (NPPN_FIRST + 14) // To notify plugins that the current file is about to be loaded - //scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN; + //scnNotification->nmhdr.code = NPPN_FILEBEFORELOAD; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = NULL; #define NPPN_FILELOADFAILED (NPPN_FIRST + 15) // To notify plugins that file open operation failed - //scnNotification->nmhdr.code = NPPN_FILEOPENFAILED; + //scnNotification->nmhdr.code = NPPN_FILELOADFAILED; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; @@ -541,10 +1177,10 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W //scnNotification->nmhdr.hwndFrom = bufferID; //scnNotification->nmhdr.idFrom = docStatus; // where bufferID is BufferID - // docStatus can be combined by DOCSTAUS_READONLY and DOCSTAUS_BUFFERDIRTY + // docStatus can be combined by DOCSTATUS_READONLY and DOCSTATUS_BUFFERDIRTY - #define DOCSTAUS_READONLY 1 - #define DOCSTAUS_BUFFERDIRTY 2 + #define DOCSTATUS_READONLY 1 + #define DOCSTATUS_BUFFERDIRTY 2 #define NPPN_DOCORDERCHANGED (NPPN_FIRST + 17) // To notify plugins that document order is changed //scnNotification->nmhdr.code = NPPN_DOCORDERCHANGED; @@ -596,4 +1232,57 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; -#endif //NOTEPAD_PLUS_MSGS_H + #define NPPN_DARKMODECHANGED (NPPN_FIRST + 27) // To notify plugins that Dark Mode was enabled/disabled + //scnNotification->nmhdr.code = NPPN_DARKMODECHANGED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = 0; + + #define NPPN_CMDLINEPLUGINMSG (NPPN_FIRST + 28) // To notify plugins that there are plugin arguments pluginMessage (wchar_t*) is available + //scnNotification->nmhdr.code = NPPN_CMDLINEPLUGINMSG; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = pluginMessage; //where pluginMessage is pointer of type wchar_t + // + // User can pass arguments to plugins via command line argument using: + // -pluginMessage="PLUGIN1_ARG1=V1;PLUGIN1_ARG2=V2;PLUGIN2_ARG=V;..." + // + // The full string (wchar_t*) will be delivered to all plugins via the NPPN_CMDLINEPLUGINMSG notification. Each plugins can parse and extract the arguments relevant to itself. + // + // To avoid the collisions among plugins, the following protocol should be followed: + // 1. Each plugin must use its unique namespace (its folder name in plugins directory) as a prefix for its argument names. + // 2. The symbol ';' must be used as the delimiter between arguments when there are 2 or more arguments in the pluginMessage string. + // 3. The symbol '=' must be used as delimiter between argument names and their values. + // + // Example (via the command line): + // -pluginMessage="NppExecScriptPath=C:\Program Files\Notepad++\plugins\NppExec\init.py;NppExecArg2=arg2Value;mimeToolsSettings=disable;pluginYInfo=show" + // + // Interpretation: + // - Plugin "NppExec" processes: NppExecScriptPath=C:\Program Files\Notepad++\plugins\NppExec\init.py & NppExecArg2=arg2Value + // - Plugin "mimeTools" processes: mimeToolsSettings=disable + // - Plugin "pluginY" processes: pluginYInfo=show + + #define NPPN_EXTERNALLEXERBUFFER (NPPN_FIRST + 29) // To notify lexer plugins that the buffer (in idFrom) is just applied to a external lexer + //scnNotification->nmhdr.code = NPPN_EXTERNALLEXERBUFFER; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; //where pluginMessage is pointer of type wchar_t + + #define NPPN_GLOBALMODIFIED (NPPN_FIRST + 30) // To notify plugins that the current document is just modified by Replace All action. + // For solving the performance issue (from v8.6.4), Notepad++ doesn't trigger SCN_MODIFIED during Replace All action anymore. + // As a result, the plugins which monitor SCN_MODIFIED should also monitor NPPN_GLOBALMODIFIED. + // This notification is implemented in Notepad++ v8.6.5. + //scnNotification->nmhdr.code = NPPN_GLOBALMODIFIED; + //scnNotification->nmhdr.hwndFrom = BufferID; + //scnNotification->nmhdr.idFrom = 0; // preserved for the future use, must be zero + + #define NPPN_NATIVELANGCHANGED (NPPN_FIRST + 31) // To notify plugins that the current native language is just changed to another one. + // Use NPPM_GETNATIVELANGFILENAME to get current native language file name. + // Use NPPM_GETMENUHANDLE(NPPPLUGINMENU, 0) to get submenu "Plugins" handle (HMENU) + //scnNotification->nmhdr.code = NPPN_NATIVELANGCHANGED; + //scnNotification->nmhdr.hwndFrom = hwndNpp + //scnNotification->nmhdr.idFrom = 0; // preserved for the future use, must be zero + + #define NPPN_TOOLBARICONSETCHANGED (NPPN_FIRST + 32) // To notify plugins that toolbar icon set selection has changed + //scnNotification->nmhdr.code = NPPN_TOOLBARICONSETCHANGED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = iconSetChoice; + // where iconSetChoice could be 1 of 5 possible values: + // 0 (Fluent UI: small), 1 (Fluent UI: large), 2 (Filled Fluent UI: small), 3 (Filled Fluent UI: large) and 4 (Standard icons: small). diff --git a/external/npp/PluginInterface.h b/external/npp/PluginInterface.h index a636c0e..0a95422 100644 --- a/external/npp/PluginInterface.h +++ b/external/npp/PluginInterface.h @@ -1,51 +1,37 @@ // 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. +// Copyright (C)2025 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 3 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 +// 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. +// along with this program. If not, see . -#ifndef PLUGININTERFACE_H -#define PLUGININTERFACE_H -#ifndef SCINTILLA_H -#include "Scintilla.h" -#endif //SCINTILLA_H +// For more comprehensive information on plugin communication, please refer to the following resource: +// https://npp-user-manual.org/docs/plugin-communication/ -#ifndef NOTEPAD_PLUS_MSGS_H +#pragma once + +#include "Scintilla.h" #include "Notepad_plus_msgs.h" -#endif //NOTEPAD_PLUS_MSGS_H -const int nbChar = 64; -typedef const TCHAR * (__cdecl * PFUNCGETNAME)(); +typedef const wchar_t * (__cdecl * PFUNCGETNAME)(); struct NppData { - HWND _nppHandle; - HWND _scintillaMainHandle; - HWND _scintillaSecondHandle; + HWND _nppHandle = nullptr; + HWND _scintillaMainHandle = nullptr; + HWND _scintillaSecondHandle = nullptr; }; typedef void (__cdecl * PFUNCSETINFO)(NppData); @@ -56,26 +42,28 @@ typedef LRESULT (__cdecl * PMESSAGEPROC)(UINT Message, WPARAM wParam, LPARAM lPa struct ShortcutKey { - bool _isCtrl; - bool _isAlt; - bool _isShift; - UCHAR _key; + bool _isCtrl = false; + bool _isAlt = false; + bool _isShift = false; + UCHAR _key = 0; }; +const int menuItemSize = 64; + struct FuncItem { - TCHAR _itemName[nbChar]; - PFUNCPLUGINCMD _pFunc; - int _cmdID; - bool _init2Check; - ShortcutKey *_pShKey; + wchar_t _itemName[menuItemSize] = { '\0' }; + PFUNCPLUGINCMD _pFunc = nullptr; + int _cmdID = 0; + bool _init2Check = false; + ShortcutKey *_pShKey = nullptr; }; typedef FuncItem * (__cdecl * PFUNCGETFUNCSARRAY)(int *); // You should implement (or define an empty function body) those functions which are called by Notepad++ plugin manager extern "C" __declspec(dllexport) void setInfo(NppData); -extern "C" __declspec(dllexport) const TCHAR * getName(); +extern "C" __declspec(dllexport) const wchar_t * getName(); 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); @@ -83,5 +71,3 @@ extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam // This API return always true now, since Notepad++ isn't compiled in ANSI mode anymore extern "C" __declspec(dllexport) BOOL isUnicode(); - -#endif //PLUGININTERFACE_H diff --git a/external/npp/Sci_Position.h b/external/npp/Sci_Position.h new file mode 100644 index 0000000..88ad513 --- /dev/null +++ b/external/npp/Sci_Position.h @@ -0,0 +1,29 @@ +// Scintilla source code edit control +/** @file Sci_Position.h + ** Define the Sci_Position type used in Scintilla's external interfaces. + ** These need to be available to clients written in C so are not in a C++ namespace. + **/ +// Copyright 2015 by Neil Hodgson +// The License.txt file describes the conditions under which this software may be distributed. + +#ifndef SCI_POSITION_H +#define SCI_POSITION_H + +#include + +// Basic signed type used throughout interface +typedef ptrdiff_t Sci_Position; + +// Unsigned variant used for ILexer::Lex and ILexer::Fold +typedef size_t Sci_PositionU; + +// For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE +typedef intptr_t Sci_PositionCR; + +#ifdef _WIN32 + #define SCI_METHOD __stdcall +#else + #define SCI_METHOD +#endif + +#endif diff --git a/external/npp/Scintilla.h b/external/npp/Scintilla.h index 079e3a4..db768a8 100644 --- a/external/npp/Scintilla.h +++ b/external/npp/Scintilla.h @@ -20,27 +20,25 @@ extern "C" { int Scintilla_RegisterClasses(void *hInstance); int Scintilla_ReleaseResources(void); #endif -int Scintilla_LinkLexers(void); #ifdef __cplusplus } #endif -/* Here should be placed typedefs for uptr_t, an unsigned integer type large enough to - * hold a pointer and sptr_t, a signed integer large enough to hold a pointer. - * May need to be changed for 64 bit platforms. */ -#if defined(_WIN32) -#include -#endif -#ifdef MAXULONG_PTR -typedef ULONG_PTR uptr_t; -typedef LONG_PTR sptr_t; -#else -typedef unsigned long uptr_t; -typedef long sptr_t; -#endif +// Include header that defines basic numeric types. +#include + +// Define uptr_t, an unsigned integer type large enough to hold a pointer. +typedef uintptr_t uptr_t; +// Define sptr_t, a signed integer large enough to hold a pointer. +typedef intptr_t sptr_t; + +#include "Sci_Position.h" typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam); +typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, sptr_t lParam, int *pStatus); + +#ifndef SCI_DISABLE_AUTOGENERATED /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ #define INVALID_POSITION -1 @@ -59,20 +57,31 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETCURRENTPOS 2008 #define SCI_GETANCHOR 2009 #define SCI_GETSTYLEAT 2010 +#define SCI_GETSTYLEINDEXAT 2038 #define SCI_REDO 2011 #define SCI_SETUNDOCOLLECTION 2012 #define SCI_SELECTALL 2013 #define SCI_SETSAVEPOINT 2014 -#define SCI_GETSTYLEDTEXT 2015 +//deprecated by N++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html), +//please use SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL,SCI_GETSTYLEDTEXTFULL and SCI_FORMATRANGEFULL and corresponding defines/structs +//#define SCI_GETSTYLEDTEXT 2015 +#define SCI_GETSTYLEDTEXTFULL 2778 #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 +#define SCI_MARKERHANDLEFROMLINE 2732 +#define SCI_MARKERNUMBERFROMLINE 2733 #define SCI_GETUNDOCOLLECTION 2019 #define SCWS_INVISIBLE 0 #define SCWS_VISIBLEALWAYS 1 #define SCWS_VISIBLEAFTERINDENT 2 +#define SCWS_VISIBLEONLYININDENT 3 #define SCI_GETVIEWWS 2020 #define SCI_SETVIEWWS 2021 +#define SCTD_LONGARROW 0 +#define SCTD_STRIKEOUT 1 +#define SCI_GETTABDRAWMODE 2698 +#define SCI_SETTABDRAWMODE 2699 #define SCI_POSITIONFROMPOINT 2022 #define SCI_POSITIONFROMPOINTCLOSE 2023 #define SCI_GOTOLINE 2024 @@ -92,15 +101,26 @@ 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_SETTABMINIMUMWIDTH 2724 +#define SCI_GETTABMINIMUMWIDTH 2725 #define SCI_CLEARTABSTOPS 2675 #define SCI_ADDTABSTOP 2676 #define SCI_GETNEXTTABSTOP 2677 #define SC_CP_UTF8 65001 #define SCI_SETCODEPAGE 2037 +#define SCI_SETFONTLOCALE 2760 +#define SCI_GETFONTLOCALE 2761 #define SC_IME_WINDOWED 0 #define SC_IME_INLINE 1 #define SCI_GETIMEINTERACTION 2678 #define SCI_SETIMEINTERACTION 2679 +#define SC_ALPHA_TRANSPARENT 0 +#define SC_ALPHA_OPAQUE 255 +#define SC_ALPHA_NOALPHA 256 +#define SC_CURSORNORMAL -1 +#define SC_CURSORARROW 2 +#define SC_CURSORWAIT 4 +#define SC_CURSORREVERSEARROW 7 #define MARKER_MAX 31 #define SC_MARK_CIRCLE 0 #define SC_MARK_ROUNDRECT 1 @@ -134,7 +154,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MARK_UNDERLINE 29 #define SC_MARK_RGBAIMAGE 30 #define SC_MARK_BOOKMARK 31 +#define SC_MARK_VERTICALBOOKMARK 32 +#define SC_MARK_BAR 33 #define SC_MARK_CHARACTER 10000 +#define SC_MARKNUM_HISTORY_REVERTED_TO_ORIGIN 21 +#define SC_MARKNUM_HISTORY_SAVED 22 +#define SC_MARKNUM_HISTORY_MODIFIED 23 +#define SC_MARKNUM_HISTORY_REVERTED_TO_MODIFIED 24 #define SC_MARKNUM_FOLDEREND 25 #define SC_MARKNUM_FOLDEROPENMID 26 #define SC_MARKNUM_FOLDERMIDTAIL 27 @@ -142,11 +168,16 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MARKNUM_FOLDERSUB 29 #define SC_MARKNUM_FOLDER 30 #define SC_MARKNUM_FOLDEROPEN 31 +#define SC_MASK_HISTORY 0x01E00000 #define SC_MASK_FOLDERS 0xFE000000 #define SCI_MARKERDEFINE 2040 #define SCI_MARKERSETFORE 2041 #define SCI_MARKERSETBACK 2042 #define SCI_MARKERSETBACKSELECTED 2292 +#define SCI_MARKERSETFORETRANSLUCENT 2294 +#define SCI_MARKERSETBACKTRANSLUCENT 2295 +#define SCI_MARKERSETBACKSELECTEDTRANSLUCENT 2296 +#define SCI_MARKERSETSTROKEWIDTH 2297 #define SCI_MARKERENABLEHIGHLIGHT 2293 #define SCI_MARKERADD 2043 #define SCI_MARKERDELETE 2044 @@ -157,6 +188,8 @@ 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 SCI_MARKERGETLAYER 2734 +#define SCI_MARKERSETLAYER 2735 #define SC_MAX_MARGIN 4 #define SC_MARGIN_SYMBOL 0 #define SC_MARGIN_NUMBER 1 @@ -164,6 +197,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MARGIN_FORE 3 #define SC_MARGIN_TEXT 4 #define SC_MARGIN_RTEXT 5 +#define SC_MARGIN_COLOUR 6 #define SCI_SETMARGINTYPEN 2240 #define SCI_GETMARGINTYPEN 2241 #define SCI_SETMARGINWIDTHN 2242 @@ -174,6 +208,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETMARGINSENSITIVEN 2247 #define SCI_SETMARGINCURSORN 2248 #define SCI_GETMARGINCURSORN 2249 +#define SCI_SETMARGINBACKN 2250 +#define SCI_GETMARGINBACKN 2251 +#define SCI_SETMARGINS 2252 +#define SCI_GETMARGINS 2253 #define STYLE_DEFAULT 32 #define STYLE_LINENUMBER 33 #define STYLE_BRACELIGHT 34 @@ -181,6 +219,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define STYLE_CONTROLCHAR 36 #define STYLE_INDENTGUIDE 37 #define STYLE_CALLTIP 38 +#define STYLE_FOLDDISPLAYTEXT 39 #define STYLE_LASTPREDEFINED 39 #define STYLE_MAX 255 #define SC_CHARSET_ANSI 0 @@ -194,6 +233,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_CHARSET_MAC 77 #define SC_CHARSET_OEM 255 #define SC_CHARSET_RUSSIAN 204 +#define SC_CHARSET_OEM866 866 #define SC_CHARSET_CYRILLIC 1251 #define SC_CHARSET_SHIFTJIS 128 #define SC_CHARSET_SYMBOL 2 @@ -217,6 +257,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_CASE_MIXED 0 #define SC_CASE_UPPER 1 #define SC_CASE_LOWER 2 +#define SC_CASE_CAMEL 3 #define SCI_STYLEGETFORE 2481 #define SCI_STYLEGETBACK 2482 #define SCI_STYLEGETBOLD 2483 @@ -241,12 +282,65 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_STYLEGETWEIGHT 2064 #define SCI_STYLESETCHARACTERSET 2066 #define SCI_STYLESETHOTSPOT 2409 +#define SCI_STYLESETCHECKMONOSPACED 2254 +#define SCI_STYLEGETCHECKMONOSPACED 2255 +#define SC_STRETCH_ULTRA_CONDENSED 1 +#define SC_STRETCH_EXTRA_CONDENSED 2 +#define SC_STRETCH_CONDENSED 3 +#define SC_STRETCH_SEMI_CONDENSED 4 +#define SC_STRETCH_NORMAL 5 +#define SC_STRETCH_SEMI_EXPANDED 6 +#define SC_STRETCH_EXPANDED 7 +#define SC_STRETCH_EXTRA_EXPANDED 8 +#define SC_STRETCH_ULTRA_EXPANDED 9 +#define SCI_STYLESETSTRETCH 2258 +#define SCI_STYLEGETSTRETCH 2259 +#define SCI_STYLESETINVISIBLEREPRESENTATION 2256 +#define SCI_STYLEGETINVISIBLEREPRESENTATION 2257 +#define SC_ELEMENT_LIST 0 +#define SC_ELEMENT_LIST_BACK 1 +#define SC_ELEMENT_LIST_SELECTED 2 +#define SC_ELEMENT_LIST_SELECTED_BACK 3 +#define SC_ELEMENT_SELECTION_TEXT 10 +#define SC_ELEMENT_SELECTION_BACK 11 +#define SC_ELEMENT_SELECTION_ADDITIONAL_TEXT 12 +#define SC_ELEMENT_SELECTION_ADDITIONAL_BACK 13 +#define SC_ELEMENT_SELECTION_SECONDARY_TEXT 14 +#define SC_ELEMENT_SELECTION_SECONDARY_BACK 15 +#define SC_ELEMENT_SELECTION_INACTIVE_TEXT 16 +#define SC_ELEMENT_SELECTION_INACTIVE_BACK 17 +#define SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT 18 +#define SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK 19 +#define SC_ELEMENT_CARET 40 +#define SC_ELEMENT_CARET_ADDITIONAL 41 +#define SC_ELEMENT_CARET_LINE_BACK 50 +#define SC_ELEMENT_WHITE_SPACE 60 +#define SC_ELEMENT_WHITE_SPACE_BACK 61 +#define SC_ELEMENT_HOT_SPOT_ACTIVE 70 +#define SC_ELEMENT_HOT_SPOT_ACTIVE_BACK 71 +#define SC_ELEMENT_FOLD_LINE 80 +#define SC_ELEMENT_HIDDEN_LINE 81 +#define SCI_SETELEMENTCOLOUR 2753 +#define SCI_GETELEMENTCOLOUR 2754 +#define SCI_RESETELEMENTCOLOUR 2755 +#define SCI_GETELEMENTISSET 2756 +#define SCI_GETELEMENTALLOWSTRANSLUCENT 2757 +#define SCI_GETELEMENTBASECOLOUR 2758 #define SCI_SETSELFORE 2067 #define SCI_SETSELBACK 2068 #define SCI_GETSELALPHA 2477 #define SCI_SETSELALPHA 2478 #define SCI_GETSELEOLFILLED 2479 #define SCI_SETSELEOLFILLED 2480 +#define SC_LAYER_BASE 0 +#define SC_LAYER_UNDER_TEXT 1 +#define SC_LAYER_OVER_TEXT 2 +#define SCI_GETSELECTIONLAYER 2762 +#define SCI_SETSELECTIONLAYER 2763 +#define SCI_GETCARETLINELAYER 2764 +#define SCI_SETCARETLINELAYER 2765 +#define SCI_GETCARETLINEHIGHLIGHTSUBLINE 2773 +#define SCI_SETCARETLINEHIGHLIGHTSUBLINE 2774 #define SCI_SETCARETFORE 2069 #define SCI_ASSIGNCMDKEY 2070 #define SCI_CLEARCMDKEY 2071 @@ -257,8 +351,25 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETCARETPERIOD 2076 #define SCI_SETWORDCHARS 2077 #define SCI_GETWORDCHARS 2646 +#define SCI_SETCHARACTERCATEGORYOPTIMIZATION 2720 +#define SCI_GETCHARACTERCATEGORYOPTIMIZATION 2721 #define SCI_BEGINUNDOACTION 2078 #define SCI_ENDUNDOACTION 2079 +#define SCI_GETUNDOSEQUENCE 2799 +#define SCI_GETUNDOACTIONS 2790 +#define SCI_SETUNDOSAVEPOINT 2791 +#define SCI_GETUNDOSAVEPOINT 2792 +#define SCI_SETUNDODETACH 2793 +#define SCI_GETUNDODETACH 2794 +#define SCI_SETUNDOTENTATIVE 2795 +#define SCI_GETUNDOTENTATIVE 2796 +#define SCI_SETUNDOCURRENT 2797 +#define SCI_GETUNDOCURRENT 2798 +#define SCI_PUSHUNDOACTIONTYPE 2800 +#define SCI_CHANGELASTUNDOACTIONTEXT 2801 +#define SCI_GETUNDOACTIONTYPE 2802 +#define SCI_GETUNDOACTIONPOSITION 2803 +#define SCI_GETUNDOACTIONTEXT 2804 #define INDIC_PLAIN 0 #define INDIC_SQUIGGLE 1 #define INDIC_TT 2 @@ -277,14 +388,28 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define INDIC_COMPOSITIONTHIN 15 #define INDIC_FULLBOX 16 #define INDIC_TEXTFORE 17 +#define INDIC_POINT 18 +#define INDIC_POINTCHARACTER 19 +#define INDIC_GRADIENT 20 +#define INDIC_GRADIENTCENTRE 21 +#define INDIC_POINT_TOP 22 +#define INDIC_EXPLORERLINK 23 +#define INDIC_CONTAINER 8 #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 -#define INDIC2_MASK 0x80 -#define INDICS_MASK 0xE0 +#define INDICATOR_CONTAINER 8 +#define INDICATOR_IME 32 +#define INDICATOR_IME_MAX 35 +#define INDICATOR_HISTORY_REVERTED_TO_ORIGIN_INSERTION 36 +#define INDICATOR_HISTORY_REVERTED_TO_ORIGIN_DELETION 37 +#define INDICATOR_HISTORY_SAVED_INSERTION 38 +#define INDICATOR_HISTORY_SAVED_DELETION 39 +#define INDICATOR_HISTORY_MODIFIED_INSERTION 40 +#define INDICATOR_HISTORY_MODIFIED_DELETION 41 +#define INDICATOR_HISTORY_REVERTED_TO_MODIFIED_INSERTION 42 +#define INDICATOR_HISTORY_REVERTED_TO_MODIFIED_DELETION 43 +#define INDICATOR_MAX 43 #define SCI_INDICSETSTYLE 2080 #define SCI_INDICGETSTYLE 2081 #define SCI_INDICSETFORE 2082 @@ -297,15 +422,16 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDICGETHOVERFORE 2683 #define SC_INDICVALUEBIT 0x1000000 #define SC_INDICVALUEMASK 0xFFFFFF +#define SC_INDICFLAG_NONE 0 #define SC_INDICFLAG_VALUEFORE 1 #define SCI_INDICSETFLAGS 2684 #define SCI_INDICGETFLAGS 2685 +#define SCI_INDICSETSTROKEWIDTH 2751 +#define SCI_INDICGETSTROKEWIDTH 2752 #define SCI_SETWHITESPACEFORE 2084 #define SCI_SETWHITESPACEBACK 2085 #define SCI_SETWHITESPACESIZE 2086 #define SCI_GETWHITESPACESIZE 2087 -#define SCI_SETSTYLEBITS 2090 -#define SCI_GETSTYLEBITS 2091 #define SCI_SETLINESTATE 2092 #define SCI_GETLINESTATE 2093 #define SCI_GETMAXLINESTATE 2094 @@ -313,6 +439,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETCARETLINEVISIBLE 2096 #define SCI_GETCARETLINEBACK 2097 #define SCI_SETCARETLINEBACK 2098 +#define SCI_GETCARETLINEFRAME 2704 +#define SCI_SETCARETLINEFRAME 2705 #define SCI_STYLESETCHANGEABLE 2099 #define SCI_AUTOCSHOW 2100 #define SCI_AUTOCCANCEL 2101 @@ -333,6 +461,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_USERLISTSHOW 2117 #define SCI_AUTOCSETAUTOHIDE 2118 #define SCI_AUTOCGETAUTOHIDE 2119 +#define SC_AUTOCOMPLETE_NORMAL 0 +#define SC_AUTOCOMPLETE_FIXED_SIZE 1 +#define SC_AUTOCOMPLETE_SELECT_FIRST_ITEM 2 +#define SCI_AUTOCSETOPTIONS 2638 +#define SCI_AUTOCGETOPTIONS 2639 #define SCI_AUTOCSETDROPRESTOFWORD 2270 #define SCI_AUTOCGETDROPRESTOFWORD 2271 #define SCI_REGISTERIMAGE 2405 @@ -343,6 +476,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_AUTOCGETMAXWIDTH 2209 #define SCI_AUTOCSETMAXHEIGHT 2210 #define SCI_AUTOCGETMAXHEIGHT 2211 +#define SCI_AUTOCSETSTYLE 2109 +#define SCI_AUTOCGETSTYLE 2120 +#define SCI_AUTOCSETIMAGESCALE 2815 +#define SCI_AUTOCGETIMAGESCALE 2816 #define SCI_SETINDENT 2122 #define SCI_GETINDENT 2123 #define SCI_SETUSETABS 2124 @@ -352,6 +489,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETLINEINDENTPOSITION 2128 #define SCI_GETCOLUMN 2129 #define SCI_COUNTCHARACTERS 2633 +#define SCI_COUNTCODEUNITS 2715 #define SCI_SETHSCROLLBAR 2130 #define SCI_GETHSCROLLBAR 2131 #define SC_IV_NONE 0 @@ -379,19 +517,41 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_PRINT_BLACKONWHITE 2 #define SC_PRINT_COLOURONWHITE 3 #define SC_PRINT_COLOURONWHITEDEFAULTBG 4 +#define SC_PRINT_SCREENCOLOURS 5 #define SCI_SETPRINTCOLOURMODE 2148 #define SCI_GETPRINTCOLOURMODE 2149 +#define SCFIND_NONE 0x0 #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 +//deprecated by N++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html), +//please use SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL,SCI_GETSTYLEDTEXTFULL and SCI_FORMATRANGEFULL and corresponding defines/structs +//#define SCI_FINDTEXT 2150 +#define SCI_FINDTEXTFULL 2196 +//deprecated by N++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html), +//please use SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL,SCI_GETSTYLEDTEXTFULL and SCI_FORMATRANGEFULL and corresponding defines/structs +//#define SCI_FORMATRANGE 2151 +#define SCI_FORMATRANGEFULL 2777 +#define SC_CHANGE_HISTORY_DISABLED 0 +#define SC_CHANGE_HISTORY_ENABLED 1 +#define SC_CHANGE_HISTORY_MARKERS 2 +#define SC_CHANGE_HISTORY_INDICATORS 4 +#define SCI_SETCHANGEHISTORY 2780 +#define SCI_GETCHANGEHISTORY 2781 +#define SC_UNDO_SELECTION_HISTORY_DISABLED 0 +#define SC_UNDO_SELECTION_HISTORY_ENABLED 1 +#define SC_UNDO_SELECTION_HISTORY_SCROLL 2 +#define SCI_SETUNDOSELECTIONHISTORY 2782 +#define SCI_GETUNDOSELECTIONHISTORY 2783 +#define SCI_SETSELECTIONSERIALIZED 2784 +#define SCI_GETSELECTIONSERIALIZED 2785 #define SCI_GETFIRSTVISIBLELINE 2152 #define SCI_GETLINE 2153 #define SCI_GETLINECOUNT 2154 +#define SCI_ALLOCATELINES 2089 #define SCI_SETMARGINLEFT 2155 #define SCI_GETMARGINLEFT 2156 #define SCI_SETMARGINRIGHT 2157 @@ -399,13 +559,18 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETMODIFY 2159 #define SCI_SETSEL 2160 #define SCI_GETSELTEXT 2161 -#define SCI_GETTEXTRANGE 2162 +//deprecated by N++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html), +//please use SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL,SCI_GETSTYLEDTEXTFULL and SCI_FORMATRANGEFULL and corresponding defines/structs +//#define SCI_GETTEXTRANGE 2162 +#define SCI_GETTEXTRANGEFULL 2039 #define SCI_HIDESELECTION 2163 +#define SCI_GETSELECTIONHIDDEN 2088 #define SCI_POINTXFROMPOSITION 2164 #define SCI_POINTYFROMPOSITION 2165 #define SCI_LINEFROMPOSITION 2166 #define SCI_POSITIONFROMLINE 2167 #define SCI_LINESCROLL 2168 +#define SCI_SCROLLVERTICAL 2817 #define SCI_SCROLLCARET 2169 #define SCI_SCROLLRANGE 2569 #define SCI_REPLACESEL 2170 @@ -423,6 +588,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETTEXT 2182 #define SCI_GETTEXTLENGTH 2183 #define SCI_GETDIRECTFUNCTION 2184 +#define SCI_GETDIRECTSTATUSFUNCTION 2772 #define SCI_GETDIRECTPOINTER 2185 #define SCI_SETOVERTYPE 2186 #define SCI_GETOVERTYPE 2187 @@ -430,12 +596,19 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETCARETWIDTH 2189 #define SCI_SETTARGETSTART 2190 #define SCI_GETTARGETSTART 2191 +#define SCI_SETTARGETSTARTVIRTUALSPACE 2728 +#define SCI_GETTARGETSTARTVIRTUALSPACE 2729 #define SCI_SETTARGETEND 2192 #define SCI_GETTARGETEND 2193 +#define SCI_SETTARGETENDVIRTUALSPACE 2730 +#define SCI_GETTARGETENDVIRTUALSPACE 2731 #define SCI_SETTARGETRANGE 2686 #define SCI_GETTARGETTEXT 2687 +#define SCI_TARGETFROMSELECTION 2287 +#define SCI_TARGETWHOLEDOCUMENT 2690 #define SCI_REPLACETARGET 2194 #define SCI_REPLACETARGETRE 2195 +#define SCI_REPLACETARGETMINIMAL 2779 #define SCI_SEARCHINTARGET 2197 #define SCI_SETSEARCHFLAGS 2198 #define SCI_GETSEARCHFLAGS 2199 @@ -453,6 +626,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_VISIBLEFROMDOCLINE 2220 #define SCI_DOCLINEFROMVISIBLE 2221 #define SCI_WRAPCOUNT 2235 +#define SC_FOLDLEVELNONE 0x0 #define SC_FOLDLEVELBASE 0x400 #define SC_FOLDLEVELWHITEFLAG 0x1000 #define SC_FOLDLEVELHEADERFLAG 0x2000 @@ -468,19 +642,30 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETFOLDEXPANDED 2229 #define SCI_GETFOLDEXPANDED 2230 #define SCI_TOGGLEFOLD 2231 +#define SCI_TOGGLEFOLDSHOWTEXT 2700 +#define SC_FOLDDISPLAYTEXT_HIDDEN 0 +#define SC_FOLDDISPLAYTEXT_STANDARD 1 +#define SC_FOLDDISPLAYTEXT_BOXED 2 +#define SCI_FOLDDISPLAYTEXTSETSTYLE 2701 +#define SCI_FOLDDISPLAYTEXTGETSTYLE 2707 +#define SCI_SETDEFAULTFOLDDISPLAYTEXT 2722 +#define SCI_GETDEFAULTFOLDDISPLAYTEXT 2723 #define SC_FOLDACTION_CONTRACT 0 #define SC_FOLDACTION_EXPAND 1 #define SC_FOLDACTION_TOGGLE 2 +#define SC_FOLDACTION_CONTRACT_EVERY_LEVEL 4 #define SCI_FOLDLINE 2237 #define SCI_FOLDCHILDREN 2238 #define SCI_EXPANDCHILDREN 2239 #define SCI_FOLDALL 2662 #define SCI_ENSUREVISIBLE 2232 +#define SC_AUTOMATICFOLD_NONE 0x0000 #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_NONE 0x0000 #define SC_FOLDFLAG_LINEBEFORE_EXPANDED 0x0002 #define SC_FOLDFLAG_LINEBEFORE_CONTRACTED 0x0004 #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 @@ -498,6 +683,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETMOUSEDWELLTIME 2265 #define SCI_WORDSTARTPOSITION 2266 #define SCI_WORDENDPOSITION 2267 +#define SCI_ISRANGEWORD 2691 +#define SC_IDLESTYLING_NONE 0 +#define SC_IDLESTYLING_TOVISIBLE 1 +#define SC_IDLESTYLING_AFTERVISIBLE 2 +#define SC_IDLESTYLING_ALL 3 +#define SCI_SETIDLESTYLING 2692 +#define SCI_GETIDLESTYLING 2693 #define SC_WRAP_NONE 0 #define SC_WRAP_WORD 1 #define SC_WRAP_CHAR 2 @@ -520,6 +712,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_WRAPINDENT_FIXED 0 #define SC_WRAPINDENT_SAME 1 #define SC_WRAPINDENT_INDENT 2 +#define SC_WRAPINDENT_DEEPINDENT 3 #define SCI_SETWRAPINDENTMODE 2472 #define SCI_GETWRAPINDENTMODE 2473 #define SC_CACHE_NONE 0 @@ -539,8 +732,6 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETVSCROLLBAR 2280 #define SCI_GETVSCROLLBAR 2281 #define SCI_APPENDTEXT 2282 -#define SCI_GETTWOPHASEDRAW 2283 -#define SCI_SETTWOPHASEDRAW 2284 #define SC_PHASES_ONE 0 #define SC_PHASES_TWO 1 #define SC_PHASES_MULTIPLE 2 @@ -559,11 +750,14 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETMULTIPASTE 2614 #define SCI_GETMULTIPASTE 2615 #define SCI_GETTAG 2616 -#define SCI_TARGETFROMSELECTION 2287 #define SCI_LINESJOIN 2288 #define SCI_LINESSPLIT 2289 #define SCI_SETFOLDMARGINCOLOUR 2290 #define SCI_SETFOLDMARGINHICOLOUR 2291 +#define SC_ACCESSIBILITY_DISABLED 0 +#define SC_ACCESSIBILITY_ENABLED 1 +#define SCI_SETACCESSIBILITY 2702 +#define SCI_GETACCESSIBILITY 2703 #define SCI_LINEDOWN 2300 #define SCI_LINEDOWNEXTEND 2301 #define SCI_LINEUP 2302 @@ -592,7 +786,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CANCEL 2325 #define SCI_DELETEBACK 2326 #define SCI_TAB 2327 +#define SCI_LINEINDENT 2813 #define SCI_BACKTAB 2328 +#define SCI_LINEDEDENT 2814 #define SCI_NEWLINE 2329 #define SCI_FORMFEED 2330 #define SCI_VCHOME 2331 @@ -605,6 +801,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_LINECUT 2337 #define SCI_LINEDELETE 2338 #define SCI_LINETRANSPOSE 2339 +#define SCI_LINEREVERSE 2354 #define SCI_LINEDUPLICATE 2404 #define SCI_LOWERCASE 2340 #define SCI_UPPERCASE 2341 @@ -629,6 +826,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_BRACEBADLIGHT 2352 #define SCI_BRACEBADLIGHTINDICATOR 2499 #define SCI_BRACEMATCH 2353 +#define SCI_BRACEMATCHNEXT 2369 #define SCI_GETVIEWEOL 2355 #define SCI_SETVIEWEOL 2356 #define SCI_GETDOCPOINTER 2357 @@ -637,24 +835,37 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define EDGE_NONE 0 #define EDGE_LINE 1 #define EDGE_BACKGROUND 2 +#define EDGE_MULTILINE 3 #define SCI_GETEDGECOLUMN 2360 #define SCI_SETEDGECOLUMN 2361 #define SCI_GETEDGEMODE 2362 #define SCI_SETEDGEMODE 2363 #define SCI_GETEDGECOLOUR 2364 #define SCI_SETEDGECOLOUR 2365 +#define SCI_MULTIEDGEADDLINE 2694 +#define SCI_MULTIEDGECLEARALL 2695 +#define SCI_GETMULTIEDGECOLUMN 2749 #define SCI_SEARCHANCHOR 2366 #define SCI_SEARCHNEXT 2367 #define SCI_SEARCHPREV 2368 #define SCI_LINESONSCREEN 2370 +#define SC_POPUP_NEVER 0 +#define SC_POPUP_ALL 1 +#define SC_POPUP_TEXT 2 #define SCI_USEPOPUP 2371 #define SCI_SELECTIONISRECTANGLE 2372 #define SCI_SETZOOM 2373 #define SCI_GETZOOM 2374 +#define SC_DOCUMENTOPTION_DEFAULT 0 +#define SC_DOCUMENTOPTION_STYLES_NONE 0x1 +#define SC_DOCUMENTOPTION_TEXT_LARGE 0x100 #define SCI_CREATEDOCUMENT 2375 #define SCI_ADDREFDOCUMENT 2376 #define SCI_RELEASEDOCUMENT 2377 +#define SCI_GETDOCUMENTOPTIONS 2379 #define SCI_GETMODEVENTMASK 2378 +#define SCI_SETCOMMANDEVENTS 2717 +#define SCI_GETCOMMANDEVENTS 2718 #define SCI_SETFOCUS 2380 #define SCI_GETFOCUS 2381 #define SC_STATUS_OK 0 @@ -666,10 +877,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETSTATUS 2383 #define SCI_SETMOUSEDOWNCAPTURES 2384 #define SCI_GETMOUSEDOWNCAPTURES 2385 -#define SC_CURSORNORMAL -1 -#define SC_CURSORARROW 2 -#define SC_CURSORWAIT 4 -#define SC_CURSORREVERSEARROW 7 +#define SCI_SETMOUSEWHEELCAPTURES 2696 +#define SCI_GETMOUSEWHEELCAPTURES 2697 #define SCI_SETCURSOR 2386 #define SCI_GETCURSOR 2387 #define SCI_SETCONTROLCHARSYMBOL 2388 @@ -710,6 +919,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_POSITIONBEFORE 2417 #define SCI_POSITIONAFTER 2418 #define SCI_POSITIONRELATIVE 2670 +#define SCI_POSITIONRELATIVECODEUNITS 2716 #define SCI_COPYRANGE 2419 #define SCI_COPYTEXT 2420 #define SC_SEL_STREAM 0 @@ -717,7 +927,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_SEL_LINES 2 #define SC_SEL_THIN 3 #define SCI_SETSELECTIONMODE 2422 +#define SCI_CHANGESELECTIONMODE 2659 #define SCI_GETSELECTIONMODE 2423 +#define SCI_SETMOVEEXTENDSSELECTION 2719 +#define SCI_GETMOVEEXTENDSSELECTION 2706 #define SCI_GETLINESELSTARTPOSITION 2424 #define SCI_GETLINESELENDPOSITION 2425 #define SCI_LINEDOWNRECTEXTEND 2426 @@ -762,23 +975,26 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETLENGTHFORENCODE 2448 #define SCI_ENCODEDFROMUTF8 2449 #define SCI_FINDCOLUMN 2456 -#define SCI_GETCARETSTICKY 2457 -#define SCI_SETCARETSTICKY 2458 #define SC_CARETSTICKY_OFF 0 #define SC_CARETSTICKY_ON 1 #define SC_CARETSTICKY_WHITESPACE 2 +#define SCI_GETCARETSTICKY 2457 +#define SCI_SETCARETSTICKY 2458 #define SCI_TOGGLECARETSTICKY 2459 #define SCI_SETPASTECONVERTENDINGS 2467 #define SCI_GETPASTECONVERTENDINGS 2468 +#define SCI_REPLACERECTANGULAR 2771 #define SCI_SELECTIONDUPLICATE 2469 -#define SC_ALPHA_TRANSPARENT 0 -#define SC_ALPHA_OPAQUE 255 -#define SC_ALPHA_NOALPHA 256 #define SCI_SETCARETLINEBACKALPHA 2470 #define SCI_GETCARETLINEBACKALPHA 2471 #define CARETSTYLE_INVISIBLE 0 #define CARETSTYLE_LINE 1 #define CARETSTYLE_BLOCK 2 +#define CARETSTYLE_OVERSTRIKE_BAR 0 +#define CARETSTYLE_OVERSTRIKE_BLOCK 0x10 +#define CARETSTYLE_CURSES 0x20 +#define CARETSTYLE_INS_MASK 0xF +#define CARETSTYLE_BLOCK_AFTER 0x100 #define SCI_SETCARETSTYLE 2512 #define SCI_GETCARETSTYLE 2513 #define SCI_SETINDICATORCURRENT 2500 @@ -793,7 +1009,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_INDICATOREND 2509 #define SCI_SETPOSITIONCACHE 2514 #define SCI_GETPOSITIONCACHE 2515 +#define SCI_SETLAYOUTTHREADS 2775 +#define SCI_GETLAYOUTTHREADS 2776 #define SCI_COPYALLOWLINE 2519 +#define SCI_CUTALLOWLINE 2810 +#define SCI_SETCOPYSEPARATOR 2811 +#define SCI_GETCOPYSEPARATOR 2812 #define SCI_GETCHARACTERPOINTER 2520 #define SCI_GETRANGEPOINTER 2643 #define SCI_GETGAPPOSITION 2644 @@ -837,6 +1058,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_ANNOTATIONGETSTYLEOFFSET 2551 #define SCI_RELEASEALLEXTENDEDSTYLES 2552 #define SCI_ALLOCATEEXTENDEDSTYLES 2553 +#define UNDO_NONE 0 #define UNDO_MAY_COALESCE 1 #define SCI_ADDUNDOACTION 2560 #define SCI_CHARPOSITIONFROMPOINT 2561 @@ -856,6 +1078,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_CLEARSELECTIONS 2571 #define SCI_SETSELECTION 2572 #define SCI_ADDSELECTION 2573 +#define SCI_SELECTIONFROMPOINT 2474 #define SCI_DROPSELECTIONN 2671 #define SCI_SETMAINSELECTION 2574 #define SCI_GETMAINSELECTION 2575 @@ -869,7 +1092,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETSELECTIONNANCHORVIRTUALSPACE 2583 #define SCI_SETSELECTIONNSTART 2584 #define SCI_GETSELECTIONNSTART 2585 +#define SCI_GETSELECTIONNSTARTVIRTUALSPACE 2726 #define SCI_SETSELECTIONNEND 2586 +#define SCI_GETSELECTIONNENDVIRTUALSPACE 2727 #define SCI_GETSELECTIONNEND 2587 #define SCI_SETRECTANGULARSELECTIONCARET 2588 #define SCI_GETRECTANGULARSELECTIONCARET 2589 @@ -882,6 +1107,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCVS_NONE 0 #define SCVS_RECTANGULARSELECTION 1 #define SCVS_USERACCESSIBLE 2 +#define SCVS_NOWRAPLINESTART 4 #define SCI_SETVIRTUALSPACEOPTIONS 2596 #define SCI_GETVIRTUALSPACEOPTIONS 2597 #define SCI_SETRECTANGULARSELECTIONMODIFIER 2598 @@ -894,6 +1120,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_GETADDITIONALCARETFORE 2605 #define SCI_ROTATESELECTION 2606 #define SCI_SWAPMAINANCHORCARET 2607 +#define SCI_MULTIPLESELECTADDNEXT 2688 +#define SCI_MULTIPLESELECTADDEACH 2689 #define SCI_CHANGELEXERSTATE 2617 #define SCI_CONTRACTEDFOLDNEXT 2618 #define SCI_VERTICALCENTRECARET 2619 @@ -912,6 +1140,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_TECHNOLOGY_DIRECTWRITE 1 #define SC_TECHNOLOGY_DIRECTWRITERETAIN 2 #define SC_TECHNOLOGY_DIRECTWRITEDC 3 +#define SC_TECHNOLOGY_DIRECT_WRITE_1 4 #define SCI_SETTECHNOLOGY 2630 #define SCI_GETTECHNOLOGY 2631 #define SCI_CREATELOADER 2632 @@ -930,21 +1159,60 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETREPRESENTATION 2665 #define SCI_GETREPRESENTATION 2666 #define SCI_CLEARREPRESENTATION 2667 +#define SCI_CLEARALLREPRESENTATIONS 2770 +#define SC_REPRESENTATION_PLAIN 0 +#define SC_REPRESENTATION_BLOB 1 +#define SC_REPRESENTATION_COLOUR 0x10 +#define SCI_SETREPRESENTATIONAPPEARANCE 2766 +#define SCI_GETREPRESENTATIONAPPEARANCE 2767 +#define SCI_SETREPRESENTATIONCOLOUR 2768 +#define SCI_GETREPRESENTATIONCOLOUR 2769 +#define SCI_EOLANNOTATIONSETTEXT 2740 +#define SCI_EOLANNOTATIONGETTEXT 2741 +#define SCI_EOLANNOTATIONSETSTYLE 2742 +#define SCI_EOLANNOTATIONGETSTYLE 2743 +#define SCI_EOLANNOTATIONCLEARALL 2744 +#define EOLANNOTATION_HIDDEN 0x0 +#define EOLANNOTATION_STANDARD 0x1 +#define EOLANNOTATION_BOXED 0x2 +#define EOLANNOTATION_STADIUM 0x100 +#define EOLANNOTATION_FLAT_CIRCLE 0x101 +#define EOLANNOTATION_ANGLE_CIRCLE 0x102 +#define EOLANNOTATION_CIRCLE_FLAT 0x110 +#define EOLANNOTATION_FLATS 0x111 +#define EOLANNOTATION_ANGLE_FLAT 0x112 +#define EOLANNOTATION_CIRCLE_ANGLE 0x120 +#define EOLANNOTATION_FLAT_ANGLE 0x121 +#define EOLANNOTATION_ANGLES 0x122 +#define SCI_EOLANNOTATIONSETVISIBLE 2745 +#define SCI_EOLANNOTATIONGETVISIBLE 2746 +#define SCI_EOLANNOTATIONSETSTYLEOFFSET 2747 +#define SCI_EOLANNOTATIONGETSTYLEOFFSET 2748 +#define SC_SUPPORTS_LINE_DRAWS_FINAL 0 +#define SC_SUPPORTS_PIXEL_DIVISIONS 1 +#define SC_SUPPORTS_FRACTIONAL_STROKE_WIDTH 2 +#define SC_SUPPORTS_TRANSLUCENT_STROKE 3 +#define SC_SUPPORTS_PIXEL_MODIFICATION 4 +#define SC_SUPPORTS_THREAD_SAFE_MEASURE_WIDTHS 5 +#define SCI_SUPPORTSFEATURE 2750 +#define SC_LINECHARACTERINDEX_NONE 0 +#define SC_LINECHARACTERINDEX_UTF32 1 +#define SC_LINECHARACTERINDEX_UTF16 2 +#define SCI_GETLINECHARACTERINDEX 2710 +#define SCI_ALLOCATELINECHARACTERINDEX 2711 +#define SCI_RELEASELINECHARACTERINDEX 2712 +#define SCI_LINEFROMINDEXPOSITION 2713 +#define SCI_INDEXPOSITIONFROMLINE 2714 #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 30 #define SCI_SETKEYWORDS 4005 -#define SCI_SETLEXERLANGUAGE 4006 -#define SCI_LOADLEXERLIBRARY 4007 #define SCI_GETPROPERTY 4008 #define SCI_GETPROPERTYEXPANDED 4009 #define SCI_GETPROPERTYINT 4010 -#define SCI_GETSTYLEBITSNEEDED 4011 #define SCI_GETLEXERLANGUAGE 4012 #define SCI_PRIVATELEXERCALL 4013 #define SCI_PROPERTYNAMES 4014 @@ -964,6 +1232,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCI_SETIDENTIFIERS 4024 #define SCI_DISTANCETOSECONDARYSTYLES 4025 #define SCI_GETSUBSTYLEBASES 4026 +#define SCI_GETNAMEDSTYLES 4029 +#define SCI_NAMEOFSTYLE 4030 +#define SCI_TAGSOFSTYLE 4031 +#define SCI_DESCRIPTIONOFSTYLE 4032 +#define SCI_SETILEXER 4033 +#define SC_MOD_NONE 0x0 #define SC_MOD_INSERTTEXT 0x1 #define SC_MOD_DELETETEXT 0x2 #define SC_MOD_CHANGESTYLE 0x4 @@ -986,8 +1260,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_MOD_LEXERSTATE 0x80000 #define SC_MOD_INSERTCHECK 0x100000 #define SC_MOD_CHANGETABSTOPS 0x200000 -#define SC_MODEVENTMASKALL 0x3FFFFF -#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 1024 +#define SC_MOD_CHANGEEOLANNOTATION 0x400000 +#define SC_MODEVENTMASKALL 0x7FFFFF +#define SC_UPDATE_NONE 0x0 #define SC_UPDATE_CONTENT 0x1 #define SC_UPDATE_SELECTION 0x2 #define SC_UPDATE_V_SCROLL 0x4 @@ -1021,6 +1296,15 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCMOD_ALT 4 #define SCMOD_SUPER 8 #define SCMOD_META 16 +#define SC_AC_FILLUP 1 +#define SC_AC_DOUBLECLICK 2 +#define SC_AC_TAB 3 +#define SC_AC_NEWLINE 4 +#define SC_AC_COMMAND 5 +#define SC_AC_SINGLE_CHOICE 6 +#define SC_CHARACTERSOURCE_DIRECT_INPUT 0 +#define SC_CHARACTERSOURCE_TENTATIVE_INPUT 1 +#define SC_CHARACTERSOURCE_IME_RESULT 2 #define SCN_STYLENEEDED 2000 #define SCN_CHARADDED 2001 #define SCN_SAVEPOINTREACHED 2002 @@ -1050,38 +1334,66 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SCN_HOTSPOTRELEASECLICK 2027 #define SCN_FOCUSIN 2028 #define SCN_FOCUSOUT 2029 -#define SCN_SCROLLED 2080 +#define SCN_AUTOCCOMPLETED 2030 +#define SCN_MARGINRIGHTCLICK 2031 +#define SCN_AUTOCSELECTIONCHANGE 2032 +#ifndef SCI_DISABLE_PROVISIONAL +#define SC_BIDIRECTIONAL_DISABLED 0 +#define SC_BIDIRECTIONAL_L2R 1 +#define SC_BIDIRECTIONAL_R2L 2 +#define SCI_GETBIDIRECTIONAL 2708 +#define SCI_SETBIDIRECTIONAL 2709 +#endif + +#define SC_SEARCHRESULT_LINEBUFFERMAXLENGTH 2048 +#define SCI_GETBOOSTREGEXERRMSG 5000 #define SCN_FOLDINGSTATECHANGED 2081 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ +#endif + /* These structures are defined to be exactly the same shape as the Win32 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs. * So older code that treats Scintilla as a RichEdit will work. */ -#if defined(__cplusplus) && defined(SCI_NAMESPACE) -namespace Scintilla { -#endif +//deprecated by N++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html), +//please use SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs +//struct Sci_CharacterRange { +// Sci_PositionCR cpMin; +// Sci_PositionCR cpMax; +//}; -struct Sci_CharacterRange { - long cpMin; - long cpMax; +struct Sci_CharacterRangeFull { + Sci_Position cpMin; + Sci_Position cpMax; }; -struct Sci_TextRange { - struct Sci_CharacterRange chrg; +//deprecated by N++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html), +//please use SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs +//struct Sci_TextRange { +// struct Sci_CharacterRange chrg; +// char *lpstrText; +//}; + +struct Sci_TextRangeFull { + struct Sci_CharacterRangeFull chrg; char *lpstrText; }; -struct Sci_TextToFind { - struct Sci_CharacterRange chrg; +//deprecated by N++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html), +//please use SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs +//struct Sci_TextToFind { +// struct Sci_CharacterRange chrg; +// const char *lpstrText; +// struct Sci_CharacterRange chrgText; +//}; + +struct Sci_TextToFindFull { + struct Sci_CharacterRangeFull chrg; const char *lpstrText; - struct Sci_CharacterRange chrgText; + struct Sci_CharacterRangeFull chrgText; }; -#define CharacterRange Sci_CharacterRange -#define TextRange Sci_TextRange -#define TextToFind Sci_TextToFind - typedef void *Sci_SurfaceID; struct Sci_Rectangle { @@ -1094,15 +1406,30 @@ struct Sci_Rectangle { /* This structure is used in printing and requires some of the graphics types * from Platform.h. Not needed by most client code. */ -struct Sci_RangeToFormat { +//deprecated by N++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html), +//please use SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs +//struct Sci_RangeToFormat { +// Sci_SurfaceID hdc; +// Sci_SurfaceID hdcTarget; +// struct Sci_Rectangle rc; +// struct Sci_Rectangle rcPage; +// struct Sci_CharacterRange chrg; +//}; + +struct Sci_RangeToFormatFull { Sci_SurfaceID hdc; Sci_SurfaceID hdcTarget; struct Sci_Rectangle rc; struct Sci_Rectangle rcPage; - struct Sci_CharacterRange chrg; + struct Sci_CharacterRangeFull chrg; }; -#define RangeToFormat Sci_RangeToFormat +#ifndef __cplusplus +/* For the GTK+ platform, g-ir-scanner needs to have these typedefs. This + * is not required in C++ code and has caused problems in the past. */ +typedef struct Sci_NotifyHeader Sci_NotifyHeader; +typedef struct SCNotification SCNotification; +#endif struct Sci_NotifyHeader { /* Compatible with Windows NMHDR. @@ -1113,65 +1440,82 @@ struct Sci_NotifyHeader { unsigned int code; }; -#define NotifyHeader Sci_NotifyHeader - struct SCNotification { - struct Sci_NotifyHeader nmhdr; - int position; + Sci_NotifyHeader nmhdr; + Sci_Position position; /* SCN_STYLENEEDED, SCN_DOUBLECLICK, SCN_MODIFIED, SCN_MARGINCLICK, */ - /* SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, SCN_CALLTIPCLICK, */ + /* SCN_MARGINRIGHTCLICK, SCN_NEEDSHOWN, SCN_DWELLSTART, SCN_DWELLEND, */ + /* SCN_CALLTIPCLICK, */ /* SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, SCN_HOTSPOTRELEASECLICK, */ /* SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ - /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTION */ + /* SCN_USERLISTSELECTION, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */ + /* SCN_AUTOCSELECTIONCHANGE */ - int ch; /* SCN_CHARADDED, SCN_KEY */ + int ch; + /* SCN_CHARADDED, SCN_KEY, SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, */ + /* SCN_USERLISTSELECTION */ int modifiers; /* SCN_KEY, SCN_DOUBLECLICK, SCN_HOTSPOTCLICK, SCN_HOTSPOTDOUBLECLICK, */ /* SCN_HOTSPOTRELEASECLICK, SCN_INDICATORCLICK, SCN_INDICATORRELEASE, */ + /* SCN_MARGINCLICK, SCN_MARGINRIGHTCLICK */ int modificationType; /* SCN_MODIFIED */ const char *text; - /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_AUTOCSELECTION, SCN_URIDROPPED */ + /* SCN_MODIFIED, SCN_USERLISTSELECTION, SCN_URIDROPPED, */ + /* SCN_AUTOCCOMPLETED, SCN_AUTOCSELECTION, SCN_AUTOCSELECTIONCHANGE */ - int length; /* SCN_MODIFIED */ - int linesAdded; /* SCN_MODIFIED */ + Sci_Position length; /* SCN_MODIFIED */ + Sci_Position linesAdded; /* SCN_MODIFIED */ int message; /* SCN_MACRORECORD */ uptr_t wParam; /* SCN_MACRORECORD */ sptr_t lParam; /* SCN_MACRORECORD */ - int line; /* SCN_MODIFIED */ + Sci_Position line; /* SCN_MODIFIED */ int foldLevelNow; /* SCN_MODIFIED */ int foldLevelPrev; /* SCN_MODIFIED */ - int margin; /* SCN_MARGINCLICK */ - int listType; /* SCN_USERLISTSELECTION */ + int margin; /* SCN_MARGINCLICK, SCN_MARGINRIGHTCLICK */ + int listType; /* SCN_USERLISTSELECTION, SCN_AUTOCSELECTIONCHANGE */ int x; /* SCN_DWELLSTART, SCN_DWELLEND */ int y; /* SCN_DWELLSTART, SCN_DWELLEND */ int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */ - int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */ + Sci_Position annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */ int updated; /* SCN_UPDATEUI */ + int listCompletionMethod; + /* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION */ + int characterSource; /* SCN_CHARADDED */ }; -struct SearchResultMarking { - long _start; - long _end; +#include +struct SearchResultMarkingLine { // each line could have several segments if user want to see only 1 found line which contains several results + std::vector> _segmentPostions; // a vector of pair of start & end of occurrence for colourizing }; struct SearchResultMarkings { - long _length; - SearchResultMarking *_markings; + intptr_t _length; + SearchResultMarkingLine *_markings; }; - -#if defined(__cplusplus) && defined(SCI_NAMESPACE) -} -#endif - #ifdef INCLUDE_DEPRECATED_FEATURES -#define SC_CP_DBCS 1 -#define SCI_SETUSEPALETTE 2039 -#define SCI_GETUSEPALETTE 2139 #define SCI_SETKEYSUNICODE 2521 #define SCI_GETKEYSUNICODE 2522 +#define SCI_GETTWOPHASEDRAW 2283 +#define SCI_SETTWOPHASEDRAW 2284 + +#define CharacterRange Sci_CharacterRange +#define TextRange Sci_TextRange +#define TextToFind Sci_TextToFind +#define RangeToFormat Sci_RangeToFormat +#define NotifyHeader Sci_NotifyHeader + +#define SCI_SETSTYLEBITS 2090 +#define SCI_GETSTYLEBITS 2091 +#define SCI_GETSTYLEBITSNEEDED 4011 + +#define INDIC0_MASK 0x20 +#define INDIC1_MASK 0x40 +#define INDIC2_MASK 0x80 +#define INDICS_MASK 0xE0 + #endif #endif diff --git a/external/npp/StaticDialog.cpp b/external/npp/StaticDialog.cpp index 2bf17df..9140bf3 100644 --- a/external/npp/StaticDialog.cpp +++ b/external/npp/StaticDialog.cpp @@ -1,23 +1,56 @@ -//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 file is part of Notepad++ project +// Copyright (C)2022 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 3 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. +// 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. +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . #include +#include +#include #include "StaticDialog.h" +StaticDialog::~StaticDialog() +{ + if (isCreated()) + { + // Prevent run_dlgProc from doing anything, since its virtual + ::SetWindowLongPtr(_hSelf, GWLP_USERDATA, NULL); + 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; @@ -33,6 +66,111 @@ void StaticDialog::goToCenter() ::SetWindowPos(_hSelf, HWND_TOP, x, y, _rc.right - _rc.left, _rc.bottom - _rc.top, SWP_SHOWWINDOW); } +void StaticDialog::display(bool toShow, bool enhancedPositioningCheckWhenShowing) const +{ + if (toShow) + { + if (enhancedPositioningCheckWhenShowing) + { + RECT testPositionRc, candidateRc; + + getWindowRect(testPositionRc); + + candidateRc = getViewablePositionRect(testPositionRc); + + if ((testPositionRc.left != candidateRc.left) || (testPositionRc.top != candidateRc.top)) + { + ::MoveWindow(_hSelf, candidateRc.left, candidateRc.top, + candidateRc.right - candidateRc.left, candidateRc.bottom - candidateRc.top, TRUE); + } + } + else + { + // 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); +} + +RECT StaticDialog::getViewablePositionRect(RECT testPositionRc) const +{ + HMONITOR hMon = ::MonitorFromRect(&testPositionRc, MONITOR_DEFAULTTONULL); + + MONITORINFO mi; + mi.cbSize = sizeof(MONITORINFO); + + bool rectPosViewableWithoutChange = false; + + if (hMon != NULL) + { + // rect would be at least partially visible on a monitor + + ::GetMonitorInfo(hMon, &mi); + + int margin = ::GetSystemMetrics(SM_CYBORDER) + ::GetSystemMetrics(SM_CYSIZEFRAME) + ::GetSystemMetrics(SM_CYCAPTION); + + // require that the title bar of the window be in a viewable place so the user can see it to grab it with the mouse + if ((testPositionRc.top >= mi.rcWork.top) && (testPositionRc.top + margin <= mi.rcWork.bottom) && + // require that some reasonable amount of width of the title bar be in the viewable area: + (testPositionRc.right - (margin * 2) > mi.rcWork.left) && (testPositionRc.left + (margin * 2) < mi.rcWork.right)) + { + rectPosViewableWithoutChange = true; + } + } + else + { + // rect would not have been visible on a monitor; get info about the nearest monitor to it + + hMon = ::MonitorFromRect(&testPositionRc, MONITOR_DEFAULTTONEAREST); + + ::GetMonitorInfo(hMon, &mi); + } + + RECT returnRc = testPositionRc; + + if (!rectPosViewableWithoutChange) + { + // reposition rect so that it would be viewable on current/nearest monitor, centering if reasonable + + LONG testRectWidth = testPositionRc.right - testPositionRc.left; + LONG testRectHeight = testPositionRc.bottom - testPositionRc.top; + LONG monWidth = mi.rcWork.right - mi.rcWork.left; + LONG monHeight = mi.rcWork.bottom - mi.rcWork.top; + + returnRc.left = mi.rcWork.left; + if (testRectWidth < monWidth) returnRc.left += (monWidth - testRectWidth) / 2; + returnRc.right = returnRc.left + testRectWidth; + + returnRc.top = mi.rcWork.top; + if (testRectHeight < monHeight) returnRc.top += (monHeight - testRectHeight) / 2; + returnRc.bottom = returnRc.top + testRectHeight; + } + + return returnRc; +} + HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplate) { // Get Dlg Template resource @@ -44,32 +182,49 @@ HGLOBAL StaticDialog::makeRTLResource(int dialogID, DLGTEMPLATE **ppMyDlgTemplat if (!hDlgTemplate) return NULL; - DLGTEMPLATE *pDlgTemplate = reinterpret_cast(::LockResource(hDlgTemplate)); + 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); - if (hMyDlgTemplate) - { - *ppMyDlgTemplate = reinterpret_cast(::GlobalLock(hMyDlgTemplate)); - if (*ppMyDlgTemplate) - { - ::memcpy(*ppMyDlgTemplate, pDlgTemplate, sizeDlg); - - DLGTEMPLATEEX *pMyDlgTemplateEx = reinterpret_cast(*ppMyDlgTemplate); - if (pMyDlgTemplateEx->signature == 0xFFFF) - pMyDlgTemplateEx->exStyle |= WS_EX_LAYOUTRTL; - else - (*ppMyDlgTemplate)->dwExtendedStyle |= WS_EX_LAYOUTRTL; - } - } + *ppMyDlgTemplate = static_cast(::GlobalLock(hMyDlgTemplate)); + + ::memcpy(*ppMyDlgTemplate, pDlgTemplate, sizeDlg); + + DLGTEMPLATEEX *pMyDlgTemplateEx = reinterpret_cast(*ppMyDlgTemplate); + if (pMyDlgTemplateEx->signature == 0xFFFF) + pMyDlgTemplateEx->exStyle |= WS_EX_LAYOUTRTL; + else + (*ppMyDlgTemplate)->dwExtendedStyle |= WS_EX_LAYOUTRTL; return hMyDlgTemplate; } -void StaticDialog::create(int dialogID, bool isRTL) +std::wstring GetLastErrorAsString(DWORD errorCode) +{ + std::wstring errorMsg(L""); + // 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; +} + +void StaticDialog::create(int dialogID, bool isRTL, bool msgDestParent) { if (isRTL) { @@ -83,15 +238,14 @@ void StaticDialog::create(int dialogID, bool isRTL) if (!_hSelf) { - DWORD err = ::GetLastError(); - char errMsg[256] {}; - sprintf_s(errMsg, "CreateDialogParam() return NULL.\rGetLastError() == %lu", err); - ::MessageBoxA(NULL, errMsg, "In StaticDialog::create()", MB_OK); + std::wstring errMsg = TEXT("CreateDialogParam() return NULL.\rGetLastError(): "); + errMsg += GetLastErrorAsString(0); + ::MessageBox(NULL, errMsg.c_str(), TEXT("In StaticDialog::create()"), MB_OK); return; } // if the destination of message NPPM_MODELESSDIALOG is not its parent, then it's the grand-parent - ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGADD, reinterpret_cast(_hSelf)); + ::SendMessage(msgDestParent ? _hParent : (::GetParent(_hParent)), NPPM_MODELESSDIALOG, MODELESSDIALOGADD, reinterpret_cast(_hSelf)); } INT_PTR CALLBACK StaticDialog::dlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -157,4 +311,3 @@ void StaticDialog::alignWith(HWND handle, HWND handle2Align, PosAlign pos, POINT ::ScreenToClient(_hSelf, &point); } - diff --git a/external/npp/StaticDialog.h b/external/npp/StaticDialog.h index 72b5264..2ae0097 100644 --- a/external/npp/StaticDialog.h +++ b/external/npp/StaticDialog.h @@ -1,70 +1,77 @@ -//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 file is part of Notepad++ project +// Copyright (C)2022 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 3 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. +// 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. - +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . #pragma once - -#include "Window.h" #include "Notepad_plus_msgs.h" -typedef HRESULT(WINAPI* ETDTProc) (HWND, DWORD); +#include "Window.h" + +typedef HRESULT (WINAPI * ETDTProc) (HWND, DWORD); enum class PosAlign { left, right, top, bottom }; -struct DLGTEMPLATEEX { +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() : Window() {}; - ~StaticDialog(){ - if (isCreated()) { - ::SetWindowLongPtr(_hSelf, GWLP_USERDATA, (long)NULL); //Prevent run_dlgProc from doing anything, since its virtual - destroy(); - } - }; - virtual void create(int dialogID, bool isRTL = false); + virtual ~StaticDialog(); + + virtual void create(int dialogID, bool isRTL = false, bool msgDestParent = true); virtual bool isCreated() const { return (_hSelf != NULL); - }; + } void goToCenter(); - void destroy() { - ::SendMessage(_hParent, NPPM_MODELESSDIALOG, MODELESSDIALOGREMOVE, (WPARAM)_hSelf); - ::DestroyWindow(_hSelf); - }; -protected : - RECT _rc{}; + void display(bool toShow = true, bool enhancedPositioningCheckWhenShowing = false) const; + + RECT getViewablePositionRect(RECT testRc) 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)); + } + + void setChecked(int checkControlID, bool checkOrNot = true) const + { + ::SendDlgItemMessage(_hSelf, checkControlID, BM_SETCHECK, checkOrNot ? BST_CHECKED : BST_UNCHECKED, 0); + } + + virtual void destroy() override; + +protected: + RECT _rc; 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); }; - diff --git a/external/npp/URLCtrl.cpp b/external/npp/URLCtrl.cpp deleted file mode 100644 index 573db6f..0000000 --- a/external/npp/URLCtrl.cpp +++ /dev/null @@ -1,262 +0,0 @@ -// 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. - - -#include "URLCtrl.h" - -void URLCtrl::create(HWND itemHandle, const TCHAR* link, COLORREF linkColor) -{ - // turn on notify style - ::SetWindowLongPtr(itemHandle, GWL_STYLE, ::GetWindowLongPtr(itemHandle, GWL_STYLE) | SS_NOTIFY); - - // set the URL text (not the display text) - if (link) - _URL = link; - - // set the hyperlink colour - _linkColor = linkColor; - - // set the visited colour - _visitedColor = RGB(128, 0, 128); - - // subclass the static control - _oldproc = reinterpret_cast(::SetWindowLongPtr(itemHandle, GWLP_WNDPROC, reinterpret_cast(URLCtrlProc))); - - // associate the URL structure with the static control - ::SetWindowLongPtr(itemHandle, GWLP_USERDATA, reinterpret_cast(this)); - - // save hwnd - _hSelf = itemHandle; -} -void URLCtrl::create(HWND itemHandle, int cmd, HWND msgDest) -{ - // turn on notify style - ::SetWindowLongPtr(itemHandle, GWL_STYLE, ::GetWindowLongPtr(itemHandle, GWL_STYLE) | SS_NOTIFY); - - _cmdID = cmd; - _msgDest = msgDest; - - // set the hyperlink colour - _linkColor = RGB(0, 0, 255); - - // subclass the static control - _oldproc = reinterpret_cast(::SetWindowLongPtr(itemHandle, GWLP_WNDPROC, reinterpret_cast(URLCtrlProc))); - - // associate the URL structure with the static control - ::SetWindowLongPtr(itemHandle, GWLP_USERDATA, reinterpret_cast(this)); - - // save hwnd - _hSelf = itemHandle; -} - -void URLCtrl::destroy() -{ - if (_hfUnderlined) - ::DeleteObject(_hfUnderlined); - if (_hCursor) - ::DestroyCursor(_hCursor); -} - -void URLCtrl::action() -{ - if (_cmdID) - { - ::SendMessage(_msgDest ? _msgDest : _hParent, WM_COMMAND, _cmdID, 0); - } - else - { - _linkColor = _visitedColor; - - ::InvalidateRect(_hSelf, 0, 0); - ::UpdateWindow(_hSelf); - - // Open a browser - if (_URL != TEXT("")) - { - ::ShellExecute(NULL, TEXT("open"), _URL.c_str(), NULL, NULL, SW_SHOWNORMAL); - } - else - { - TCHAR szWinText[MAX_PATH]; - ::GetWindowText(_hSelf, szWinText, MAX_PATH); - ::ShellExecute(NULL, TEXT("open"), szWinText, NULL, NULL, SW_SHOWNORMAL); - } - } -} - -COLORREF URLCtrl::getCtrlBgColor(HWND hWnd) -{ - COLORREF crRet = CLR_INVALID; - if (hWnd && IsWindow(hWnd)) - { - RECT rc; - if (GetClientRect(hWnd, &rc)) - { - HDC hDC = GetDC(hWnd); - if (hDC) - { - HDC hdcMem = CreateCompatibleDC(hDC); - if (hdcMem) - { - HBITMAP hBmp = CreateCompatibleBitmap(hDC, - rc.right, rc.bottom); - if (hBmp) - { - HGDIOBJ hOld = SelectObject(hdcMem, hBmp); - if (hOld) - { - if (SendMessage(hWnd, WM_ERASEBKGND, reinterpret_cast(hdcMem), 0)) - { - crRet = GetPixel(hdcMem, 2, 2); // 0, 0 is usually on the border - } - SelectObject(hdcMem, hOld); - } - DeleteObject(hBmp); - } - DeleteDC(hdcMem); - } - ReleaseDC(hWnd, hDC); - } - } - } - return crRet; -} - -LRESULT URLCtrl::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) -{ - switch (Message) - { - // Free up the structure we allocated - case WM_NCDESTROY: - //HeapFree(GetProcessHeap(), 0, url); - break; - - // Paint the static control using our custom - // colours, and with an underline text style - case WM_PAINT: - { - DWORD dwStyle = static_cast(::GetWindowLongPtr(hwnd, GWL_STYLE)); - DWORD dwDTStyle = DT_SINGLELINE; - - //Test if centered horizontally or vertically - if (dwStyle & SS_CENTER) dwDTStyle |= DT_CENTER; - if (dwStyle & SS_RIGHT) dwDTStyle |= DT_RIGHT; - if (dwStyle & SS_CENTERIMAGE) dwDTStyle |= DT_VCENTER; - - RECT rect; - ::GetClientRect(hwnd, &rect); - - PAINTSTRUCT ps; - HDC hdc = ::BeginPaint(hwnd, &ps); - - ::SetTextColor(hdc, _linkColor); - - ::SetBkColor(hdc, getCtrlBgColor(GetParent(hwnd))); ///*::GetSysColor(COLOR_3DFACE)*/); - - // Create an underline font - if (_hfUnderlined == 0) - { - // Get the default GUI font - LOGFONT lf; - HFONT hf = (HFONT)::GetStockObject(DEFAULT_GUI_FONT); - - // Add UNDERLINE attribute - GetObject(hf, sizeof lf, &lf); - lf.lfUnderline = TRUE; - - // Create a new font - _hfUnderlined = ::CreateFontIndirect(&lf); - } - - HANDLE hOld = SelectObject(hdc, _hfUnderlined); - - // Draw the text! - TCHAR szWinText[MAX_PATH]; - ::GetWindowText(hwnd, szWinText, MAX_PATH); - ::DrawText(hdc, szWinText, -1, &rect, dwDTStyle); - - ::SelectObject(hdc, hOld); - - ::EndPaint(hwnd, &ps); - - return 0; - } - - case WM_SETTEXT: - { - LRESULT ret = ::CallWindowProc(_oldproc, hwnd, Message, wParam, lParam); - ::InvalidateRect(hwnd, 0, 0); - return ret; - } - // Provide a hand cursor when the mouse moves over us - case WM_SETCURSOR: - case WM_MOUSEMOVE: - { - if (_hCursor == 0) - _hCursor = LoadCursor(NULL, IDC_HAND); - - SetCursor(_hCursor); - return TRUE; - } - - case WM_LBUTTONDOWN: - _clicking = true; - break; - - case WM_LBUTTONUP: - if (_clicking) - { - _clicking = false; - - action(); - } - - break; - - //Support using space to activate this object - case WM_KEYDOWN: - if (wParam == VK_SPACE) - _clicking = true; - break; - - case WM_KEYUP: - if (wParam == VK_SPACE && _clicking) - { - _clicking = false; - - action(); - } - break; - - // A standard static control returns HTTRANSPARENT here, which - // prevents us from receiving any mouse messages. So, return - // HTCLIENT instead. - case WM_NCHITTEST: - return HTCLIENT; - } - return ::CallWindowProc(_oldproc, hwnd, Message, wParam, lParam); -} diff --git a/external/npp/URLCtrl.h b/external/npp/URLCtrl.h deleted file mode 100644 index 2fe6169..0000000 --- a/external/npp/URLCtrl.h +++ /dev/null @@ -1,66 +0,0 @@ -// 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. - - -#pragma once - -#include "Window.h" -#include - -class URLCtrl : public Window -{ -public: - URLCtrl() = default; - - void create(HWND itemHandle, const TCHAR* link, COLORREF linkColor = RGB(0, 0, 255)); - void create(HWND itemHandle, int cmd, HWND msgDest = NULL); - void destroy(); - -private: - void action(); - COLORREF getCtrlBgColor(HWND hWnd); - -protected: - std::wstring _URL = TEXT(""); - HFONT _hfUnderlined = nullptr; - HCURSOR _hCursor = nullptr; - HWND _msgDest = nullptr; - unsigned long _cmdID = 0; - - WNDPROC _oldproc = nullptr; - COLORREF _linkColor; - COLORREF _visitedColor; - bool _clicking = false; - - static LRESULT CALLBACK URLCtrlProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) - { - return (reinterpret_cast(::GetWindowLongPtr(hwnd, GWLP_USERDATA)))->runProc(hwnd, Message, wParam, lParam); - } - - LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam); -}; - diff --git a/external/npp/Window.h b/external/npp/Window.h index e3dd14e..6bfd6bd 100644 --- a/external/npp/Window.h +++ b/external/npp/Window.h @@ -1,30 +1,33 @@ -//this file is part of notepad++ -//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 file is part of Notepad++ project +// Copyright (C)2022 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 3 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. +// 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. +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . -#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) { @@ -34,81 +37,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(bool forceUpdate = false) const { - ::InvalidateRect(_hSelf, NULL, TRUE); + virtual void redraw(bool forceUpdate = false) const + { + ::InvalidateRect(_hSelf, nullptr, TRUE); if (forceUpdate) ::UpdateWindow(_hSelf); - }; - - virtual void getClientRect(RECT & rc) const { + } + + + 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 { - //assert(_hSelf); + 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/external/npp/dockingResource.h b/external/npp/dockingResource.h index 3d6831b..e593faa 100644 --- a/external/npp/dockingResource.h +++ b/external/npp/dockingResource.h @@ -1,22 +1,26 @@ -//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. +// This file is part of Notepad++ project +// 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 3 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. +// 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. +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// Contribution by Don HO +// Date of Contribution: 2025-05-14 +// Description of Contribution: Minor change + +#pragma once -#ifndef DOCKING_RESOURCE_H -#define DOCKING_RESOURCE_H +#define DM_NOFOCUSWHILECLICKINGCAPTION L"NOFOCUSWHILECLICKINGCAPTION" #define IDD_PLUGIN_DLG 103 #define IDC_EDIT1 1000 @@ -31,33 +35,25 @@ #define IDC_BTN_CAPTION 1050 #define DMM_MSG 0x5000 - #define DMM_CLOSE (DMM_MSG + 1) - #define DMM_DOCK (DMM_MSG + 2) - #define DMM_FLOAT (DMM_MSG + 3) - #define DMM_DOCKALL (DMM_MSG + 4) - #define DMM_FLOATALL (DMM_MSG + 5) - #define DMM_MOVE (DMM_MSG + 6) - #define DMM_UPDATEDISPINFO (DMM_MSG + 7) - #define DMM_GETIMAGELIST (DMM_MSG + 8) - #define DMM_GETICONPOS (DMM_MSG + 9) - #define DMM_DROPDATA (DMM_MSG + 10) - #define DMM_MOVE_SPLITTER (DMM_MSG + 11) - #define DMM_CANCEL_MOVE (DMM_MSG + 12) - #define DMM_LBUTTONUP (DMM_MSG + 13) + #define DMM_CLOSE (DMM_MSG + 1) + #define DMM_DOCK (DMM_MSG + 2) + #define DMM_FLOAT (DMM_MSG + 3) + #define DMM_DOCKALL (DMM_MSG + 4) + #define DMM_FLOATALL (DMM_MSG + 5) + #define DMM_MOVE (DMM_MSG + 6) + #define DMM_UPDATEDISPINFO (DMM_MSG + 7) + //#define DMM_GETIMAGELIST (DMM_MSG + 8) + //#define DMM_GETICONPOS (DMM_MSG + 9) + #define DMM_DROPDATA (DMM_MSG + 10) + #define DMM_MOVE_SPLITTER (DMM_MSG + 11) + #define DMM_CANCEL_MOVE (DMM_MSG + 12) + #define DMM_LBUTTONUP (DMM_MSG + 13) #define DMN_FIRST 1050 - #define DMN_CLOSE (DMN_FIRST + 1) - //nmhdr.code = DWORD(DMN_CLOSE, 0)); - //nmhdr.hwndFrom = hwndNpp; - //nmhdr.idFrom = ctrlIdNpp; - - #define DMN_DOCK (DMN_FIRST + 2) - #define DMN_FLOAT (DMN_FIRST + 3) - //nmhdr.code = DWORD(DMN_XXX, int newContainer); - //nmhdr.hwndFrom = hwndNpp; - //nmhdr.idFrom = ctrlIdNpp; - - - -#endif //DOCKING_RESOURCE_H + #define DMN_CLOSE (DMN_FIRST + 1) + #define DMN_DOCK (DMN_FIRST + 2) + #define DMN_FLOAT (DMN_FIRST + 3) + #define DMN_SWITCHIN (DMN_FIRST + 4) + #define DMN_SWITCHOFF (DMN_FIRST + 5) + #define DMN_FLOATDROPPED (DMN_FIRST + 6) diff --git a/external/npp/menuCmdID.h b/external/npp/menuCmdID.h index eb171bf..8bc7492 100644 --- a/external/npp/menuCmdID.h +++ b/external/npp/menuCmdID.h @@ -1,65 +1,57 @@ // 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. +// Copyright (C)2025 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 3 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 +// 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. +// along with this program. If not, see . -#ifndef MENUCMDID_H -#define MENUCMDID_H +#pragma once #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) - #define IDM_FILE_CLOSEALL (IDM_FILE + 4) - #define IDM_FILE_CLOSEALL_BUT_CURRENT (IDM_FILE + 5) - #define IDM_FILE_SAVE (IDM_FILE + 6) - #define IDM_FILE_SAVEALL (IDM_FILE + 7) - #define IDM_FILE_SAVEAS (IDM_FILE + 8) - #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) - #define IDM_FILE_LOADSESSION (IDM_FILE + 12) - #define IDM_FILE_SAVESESSION (IDM_FILE + 13) - #define IDM_FILE_RELOAD (IDM_FILE + 14) - #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_NEW (IDM_FILE + 1) + #define IDM_FILE_OPEN (IDM_FILE + 2) + #define IDM_FILE_CLOSE (IDM_FILE + 3) + #define IDM_FILE_CLOSEALL (IDM_FILE + 4) + #define IDM_FILE_CLOSEALL_BUT_CURRENT (IDM_FILE + 5) + #define IDM_FILE_SAVE (IDM_FILE + 6) + #define IDM_FILE_SAVEALL (IDM_FILE + 7) + #define IDM_FILE_SAVEAS (IDM_FILE + 8) + #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) + #define IDM_FILE_LOADSESSION (IDM_FILE + 12) + #define IDM_FILE_SAVESESSION (IDM_FILE + 13) + #define IDM_FILE_RELOAD (IDM_FILE + 14) + #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_OPENFOLDERASWORKSPACE (IDM_FILE + 22) + #define IDM_FILE_OPEN_DEFAULT_VIEWER (IDM_FILE + 23) + #define IDM_FILE_CLOSEALL_UNCHANGED (IDM_FILE + 24) + #define IDM_FILE_CONTAININGFOLDERASWORKSPACE (IDM_FILE + 25) + #define IDM_FILE_CLOSEALL_BUT_PINNED (IDM_FILE + 26) // IMPORTANT: If list above is modified, you have to change the following values: // To be updated if new menu item(s) is (are) added in menu "File" - #define IDM_FILEMENU_LASTONE IDM_FILE_OPENFOLDERASWORSPACE + #define IDM_FILEMENU_LASTONE IDM_FILE_CLOSEALL_BUT_PINNED // 0 based position of command "Exit" including the bars in the file menu // and without counting "Recent files history" items @@ -68,114 +60,140 @@ // 1 Open... // 2 Open Containing Folder // 3 Open Folder as Workspace -// 4 Reload from Disk -// 5 Save -// 6 Save As... -// 7 Save a Copy As... -// 8 Save All -// 9 Rename... -//10 Close -//11 Close All -//12 Close More -//13 Move to Recycle Bin -//14 -------- -//15 Load Session... -//16 Save Session... -//17 -------- -//18 Print... -//19 Print Now -//20 -------- -//21 Exit - #define IDM_FILEMENU_EXISTCMDPOSITION 21 +// 4 Open in Default Viewer +// 5 Reload from Disk +// 6 Save +// 7 Save As... +// 8 Save a Copy As... +// 9 Save All +//10 Rename... +//11 Close +//12 Close All +//13 Close Multiple Documents +//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) - #define IDM_EDIT_UNDO (IDM_EDIT + 3) - #define IDM_EDIT_REDO (IDM_EDIT + 4) - #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) - #define IDM_EDIT_DUP_LINE (IDM_EDIT + 10) - #define IDM_EDIT_TRANSPOSE_LINE (IDM_EDIT + 11) - #define IDM_EDIT_SPLIT_LINES (IDM_EDIT + 12) - #define IDM_EDIT_JOIN_LINES (IDM_EDIT + 13) - #define IDM_EDIT_LINE_UP (IDM_EDIT + 14) - #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_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) - -// Menu macro - #define IDM_MACRO_STARTRECORDINGMACRO (IDM_EDIT + 18) - #define IDM_MACRO_STOPRECORDINGMACRO (IDM_EDIT + 19) - #define IDM_MACRO_PLAYBACKRECORDEDMACRO (IDM_EDIT + 21) -//----------- - - #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) -//----------- - - #define IDM_EDIT_RTL (IDM_EDIT + 26) - #define IDM_EDIT_LTR (IDM_EDIT + 27) - #define IDM_EDIT_SETREADONLY (IDM_EDIT + 28) - #define IDM_EDIT_FULLPATHTOCLIP (IDM_EDIT + 29) - #define IDM_EDIT_FILENAMETOCLIP (IDM_EDIT + 30) - #define IDM_EDIT_CURRENTDIRTOCLIP (IDM_EDIT + 31) - -// Menu macro - #define IDM_MACRO_RUNMULTIMACRODLG (IDM_EDIT + 32) -//----------- - - #define IDM_EDIT_CLEARREADONLY (IDM_EDIT + 33) - #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_EDIT_CUT (IDM_EDIT + 1) + #define IDM_EDIT_COPY (IDM_EDIT + 2) + #define IDM_EDIT_UNDO (IDM_EDIT + 3) + #define IDM_EDIT_REDO (IDM_EDIT + 4) + #define IDM_EDIT_PASTE (IDM_EDIT + 5) + #define IDM_EDIT_DELETE (IDM_EDIT + 6) + #define IDM_EDIT_SELECTALL (IDM_EDIT + 7) + #define IDM_EDIT_INS_TAB (IDM_EDIT + 8) + #define IDM_EDIT_RMV_TAB (IDM_EDIT + 9) + #define IDM_EDIT_DUP_LINE (IDM_EDIT + 10) + #define IDM_EDIT_TRANSPOSE_LINE (IDM_EDIT + 11) + #define IDM_EDIT_SPLIT_LINES (IDM_EDIT + 12) + #define IDM_EDIT_JOIN_LINES (IDM_EDIT + 13) + #define IDM_EDIT_LINE_UP (IDM_EDIT + 14) + #define IDM_EDIT_LINE_DOWN (IDM_EDIT + 15) + #define IDM_EDIT_UPPERCASE (IDM_EDIT + 16) + #define IDM_EDIT_LOWERCASE (IDM_EDIT + 17) + #define IDM_MACRO_STARTRECORDINGMACRO (IDM_EDIT + 18) + #define IDM_MACRO_STOPRECORDINGMACRO (IDM_EDIT + 19) + #define IDM_EDIT_BEGINENDSELECT (IDM_EDIT + 20) + #define IDM_MACRO_PLAYBACKRECORDEDMACRO (IDM_EDIT + 21) + #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_MACRO_SAVECURRENTMACRO (IDM_EDIT + 25) + #define IDM_EDIT_RTL (IDM_EDIT + 26) + #define IDM_EDIT_LTR (IDM_EDIT + 27) + #define IDM_EDIT_TOGGLEREADONLY (IDM_EDIT + 28) + #define IDM_EDIT_FULLPATHTOCLIP (IDM_EDIT + 29) + #define IDM_EDIT_FILENAMETOCLIP (IDM_EDIT + 30) + #define IDM_EDIT_CURRENTDIRTOCLIP (IDM_EDIT + 31) + #define IDM_MACRO_RUNMULTIMACRODLG (IDM_EDIT + 32) + #define IDM_EDIT_TOGGLESYSTEMREADONLY (IDM_EDIT + 33) + #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_OPEN_ALL_RECENT_FILE (IDM_EDIT + 40) + #define IDM_CLEAN_RECENT_FILE_LIST (IDM_EDIT + 41) + #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_STREAM_UNCOMMENT (IDM_EDIT + 47) + #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_SW2TAB_LEADING (IDM_EDIT + 53) + #define IDM_EDIT_SW2TAB_ALL (IDM_EDIT + 54) + #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_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_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) + #define IDM_EDIT_REMOVE_CONSECUTIVE_DUP_LINES (IDM_EDIT + 77) + #define IDM_EDIT_SORTLINES_RANDOMLY (IDM_EDIT + 78) + #define IDM_EDIT_REMOVE_ANY_DUP_LINES (IDM_EDIT + 79) + #define IDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_ASCENDING (IDM_EDIT + 80) + #define IDM_EDIT_SORTLINES_LEXICO_CASE_INSENS_DESCENDING (IDM_EDIT + 81) + #define IDM_EDIT_COPY_LINK (IDM_EDIT + 82) + #define IDM_EDIT_SORTLINES_REVERSE_ORDER (IDM_EDIT + 83) + #define IDM_EDIT_INSERT_DATETIME_SHORT (IDM_EDIT + 84) + #define IDM_EDIT_INSERT_DATETIME_LONG (IDM_EDIT + 85) + #define IDM_EDIT_INSERT_DATETIME_CUSTOMIZED (IDM_EDIT + 86) + #define IDM_EDIT_COPY_ALL_NAMES (IDM_EDIT + 87) + #define IDM_EDIT_COPY_ALL_PATHS (IDM_EDIT + 88) + #define IDM_EDIT_BEGINENDSELECT_COLUMNMODE (IDM_EDIT + 89) + #define IDM_EDIT_MULTISELECTALL (IDM_EDIT + 90) + #define IDM_EDIT_MULTISELECTALLMATCHCASE (IDM_EDIT + 91) + #define IDM_EDIT_MULTISELECTALLWHOLEWORD (IDM_EDIT + 92) + #define IDM_EDIT_MULTISELECTALLMATCHCASEWHOLEWORD (IDM_EDIT + 93) + #define IDM_EDIT_MULTISELECTNEXT (IDM_EDIT + 94) + #define IDM_EDIT_MULTISELECTNEXTMATCHCASE (IDM_EDIT + 95) + #define IDM_EDIT_MULTISELECTNEXTWHOLEWORD (IDM_EDIT + 96) + #define IDM_EDIT_MULTISELECTNEXTMATCHCASEWHOLEWORD (IDM_EDIT + 97) + #define IDM_EDIT_MULTISELECTUNDO (IDM_EDIT + 98) + #define IDM_EDIT_MULTISELECTSSKIP (IDM_EDIT + 99) + #define IDM_EDIT_SORTLINES_LOCALE_ASCENDING (IDM_EDIT + 100) + #define IDM_EDIT_SORTLINES_LOCALE_DESCENDING (IDM_EDIT + 101) + #define IDM_EDIT_SETREADONLYFORALLDOCS (IDM_EDIT + 102) + #define IDM_EDIT_CLEARREADONLYFORALLDOCS (IDM_EDIT + 103) + + #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) + #define IDM_EDIT_FUNCCALLTIP_PREVIOUS (50000 + 10) + #define IDM_EDIT_FUNCCALLTIP_NEXT (50000 + 11) + #define IDM_SEARCH (IDM + 3000) #define IDM_SEARCH_FIND (IDM_SEARCH + 1) @@ -223,52 +241,72 @@ #define IDM_SEARCH_GONEXTMARKER_DEF (IDM_SEARCH + 44) #define IDM_FOCUS_ON_FOUND_RESULTS (IDM_SEARCH + 45) - #define IDM_SEARCH_GOTONEXTFOUND (IDM_SEARCH + 46) - #define IDM_SEARCH_GOTOPREVFOUND (IDM_SEARCH + 47) + #define IDM_SEARCH_GOTONEXTFOUND (IDM_SEARCH + 46) + #define IDM_SEARCH_GOTOPREVFOUND (IDM_SEARCH + 47) #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_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_SEARCH_STYLE1TOCLIP (IDM_SEARCH + 55) + #define IDM_SEARCH_STYLE2TOCLIP (IDM_SEARCH + 56) + #define IDM_SEARCH_STYLE3TOCLIP (IDM_SEARCH + 57) + #define IDM_SEARCH_STYLE4TOCLIP (IDM_SEARCH + 58) + #define IDM_SEARCH_STYLE5TOCLIP (IDM_SEARCH + 59) + #define IDM_SEARCH_ALLSTYLESTOCLIP (IDM_SEARCH + 60) + #define IDM_SEARCH_MARKEDTOCLIP (IDM_SEARCH + 61) + + #define IDM_SEARCH_MARKONEEXT1 (IDM_SEARCH + 62) + #define IDM_SEARCH_MARKONEEXT2 (IDM_SEARCH + 63) + #define IDM_SEARCH_MARKONEEXT3 (IDM_SEARCH + 64) + #define IDM_SEARCH_MARKONEEXT4 (IDM_SEARCH + 65) + #define IDM_SEARCH_MARKONEEXT5 (IDM_SEARCH + 66) + + #define IDM_SEARCH_CHANGED_NEXT (IDM_SEARCH + 67) + #define IDM_SEARCH_CHANGED_PREV (IDM_SEARCH + 68) + #define IDM_SEARCH_CLEAR_CHANGE_HISTORY (IDM_SEARCH + 69) + #define IDM_MISC (IDM + 3500) - #define IDM_FILESWITCHER_FILESCLOSE (IDM_MISC + 1) - #define IDM_FILESWITCHER_FILESCLOSEOTHERS (IDM_MISC + 2) + #define IDM_DOCLIST_FILESCLOSE (IDM_MISC + 1) + #define IDM_DOCLIST_FILESCLOSEOTHERS (IDM_MISC + 2) + #define IDM_DOCLIST_COPYNAMES (IDM_MISC + 3) + #define IDM_DOCLIST_COPYPATHS (IDM_MISC + 4) #define IDM_VIEW (IDM + 4000) //#define IDM_VIEW_TOOLBAR_HIDE (IDM_VIEW + 1) - #define IDM_VIEW_TOOLBAR_REDUCE (IDM_VIEW + 2) - #define IDM_VIEW_TOOLBAR_ENLARGE (IDM_VIEW + 3) - #define IDM_VIEW_TOOLBAR_STANDARD (IDM_VIEW + 4) - #define IDM_VIEW_REDUCETABBAR (IDM_VIEW + 5) - #define IDM_VIEW_LOCKTABBAR (IDM_VIEW + 6) - #define IDM_VIEW_DRAWTABBAR_TOPBAR (IDM_VIEW + 7) - #define IDM_VIEW_DRAWTABBAR_INACIVETAB (IDM_VIEW + 8) + //#define IDM_VIEW_TOOLBAR_REDUCE (IDM_VIEW + 2) + //#define IDM_VIEW_TOOLBAR_ENLARGE (IDM_VIEW + 3) + //#define IDM_VIEW_TOOLBAR_STANDARD (IDM_VIEW + 4) + //#define IDM_VIEW_REDUCETABBAR (IDM_VIEW + 5) + //#define IDM_VIEW_LOCKTABBAR (IDM_VIEW + 6) + //#define IDM_VIEW_DRAWTABBAR_TOPBAR (IDM_VIEW + 7) + //#define IDM_VIEW_DRAWTABBAR_INACTIVETAB (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_LINENUMBER (IDM_VIEW + 12) - #define IDM_VIEW_SYMBOLMARGIN (IDM_VIEW + 13) - #define IDM_VIEW_FOLDERMAGIN (IDM_VIEW + 14) - #define IDM_VIEW_FOLDERMAGIN_SIMPLE (IDM_VIEW + 15) - #define IDM_VIEW_FOLDERMAGIN_ARROW (IDM_VIEW + 16) - #define IDM_VIEW_FOLDERMAGIN_CIRCLE (IDM_VIEW + 17) - #define IDM_VIEW_FOLDERMAGIN_BOX (IDM_VIEW + 18) + #define IDM_VIEW_FOLDALL (IDM_VIEW + 10) + #define IDM_VIEW_DISTRACTIONFREE (IDM_VIEW + 11) + //#define IDM_VIEW_LINENUMBER (IDM_VIEW + 12) + //#define IDM_VIEW_SYMBOLMARGIN (IDM_VIEW + 13) + //#define IDM_VIEW_FOLDERMARGIN (IDM_VIEW + 14) + //#define IDM_VIEW_FOLDERMARGIN_SIMPLE (IDM_VIEW + 15) + //#define IDM_VIEW_FOLDERMARGIN_ARROW (IDM_VIEW + 16) + //#define IDM_VIEW_FOLDERMARGIN_CIRCLE (IDM_VIEW + 17) + //#define IDM_VIEW_FOLDERMARGIN_BOX (IDM_VIEW + 18) #define IDM_VIEW_ALL_CHARACTERS (IDM_VIEW + 19) #define IDM_VIEW_INDENT_GUIDE (IDM_VIEW + 20) - #define IDM_VIEW_CURLINE_HILITING (IDM_VIEW + 21) + //#define IDM_VIEW_CURLINE_HILITING (IDM_VIEW + 21) #define IDM_VIEW_WRAP (IDM_VIEW + 22) #define IDM_VIEW_ZOOMIN (IDM_VIEW + 23) #define IDM_VIEW_ZOOMOUT (IDM_VIEW + 24) #define IDM_VIEW_TAB_SPACE (IDM_VIEW + 25) #define IDM_VIEW_EOL (IDM_VIEW + 26) - #define IDM_VIEW_EDGELINE (IDM_VIEW + 27) - #define IDM_VIEW_EDGEBACKGROUND (IDM_VIEW + 28) - #define IDM_VIEW_TOGGLE_UNFOLDALL (IDM_VIEW + 29) + //#define IDM_VIEW_TOOLBAR_REDUCE_SET2 (IDM_VIEW + 27) + //#define IDM_VIEW_TOOLBAR_ENLARGE_SET2 (IDM_VIEW + 28) + #define IDM_VIEW_UNFOLDALL (IDM_VIEW + 29) #define IDM_VIEW_FOLD_CURRENT (IDM_VIEW + 30) #define IDM_VIEW_UNFOLD_CURRENT (IDM_VIEW + 31) #define IDM_VIEW_FULLSCREENTOGGLE (IDM_VIEW + 32) @@ -276,19 +314,19 @@ #define IDM_VIEW_ALWAYSONTOP (IDM_VIEW + 34) #define IDM_VIEW_SYNSCROLLV (IDM_VIEW + 35) #define IDM_VIEW_SYNSCROLLH (IDM_VIEW + 36) - #define IDM_VIEW_EDGENONE (IDM_VIEW + 37) - #define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38) - #define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39) - #define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40) + //#define IDM_VIEW_EDGENONE (IDM_VIEW + 37) + //#define IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN (IDM_VIEW + 38) + //#define IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE (IDM_VIEW + 39) + //#define IDM_VIEW_REFRESHTABAR (IDM_VIEW + 40) #define IDM_VIEW_WRAP_SYMBOL (IDM_VIEW + 41) #define IDM_VIEW_HIDELINES (IDM_VIEW + 42) - #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_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_PINTAB (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) @@ -310,36 +348,63 @@ #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_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_DOCLIST (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_IN_FIREFOX (IDM_VIEW + 100) + #define IDM_VIEW_IN_CHROME (IDM_VIEW + 101) + #define IDM_VIEW_IN_EDGE (IDM_VIEW + 102) + #define IDM_VIEW_IN_IE (IDM_VIEW + 103) + + #define IDM_VIEW_SWITCHTO_PROJECT_PANEL_1 (IDM_VIEW + 104) + #define IDM_VIEW_SWITCHTO_PROJECT_PANEL_2 (IDM_VIEW + 105) + #define IDM_VIEW_SWITCHTO_PROJECT_PANEL_3 (IDM_VIEW + 106) + #define IDM_VIEW_SWITCHTO_FILEBROWSER (IDM_VIEW + 107) + #define IDM_VIEW_SWITCHTO_FUNC_LIST (IDM_VIEW + 108) + #define IDM_VIEW_SWITCHTO_DOCLIST (IDM_VIEW + 109) + + #define IDM_VIEW_TAB_COLOUR_NONE (IDM_VIEW + 110) + #define IDM_VIEW_TAB_COLOUR_1 (IDM_VIEW + 111) + #define IDM_VIEW_TAB_COLOUR_2 (IDM_VIEW + 112) + #define IDM_VIEW_TAB_COLOUR_3 (IDM_VIEW + 113) + #define IDM_VIEW_TAB_COLOUR_4 (IDM_VIEW + 114) + #define IDM_VIEW_TAB_COLOUR_5 (IDM_VIEW + 115) + #define IDM_VIEW_TAB_START (IDM_VIEW + 116) + #define IDM_VIEW_TAB_END (IDM_VIEW + 117) + + #define IDM_VIEW_NPC (IDM_VIEW + 130) + #define IDM_VIEW_NPC_CCUNIEOL (IDM_VIEW + 131) #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_GOTO_START 10005 + #define IDM_VIEW_GOTO_END 10006 #define IDM_FORMAT (IDM + 5000) #define IDM_FORMAT_TODOS (IDM_FORMAT + 1) @@ -347,14 +412,14 @@ #define IDM_FORMAT_TOMAC (IDM_FORMAT + 3) #define IDM_FORMAT_ANSI (IDM_FORMAT + 4) #define IDM_FORMAT_UTF_8 (IDM_FORMAT + 5) - #define IDM_FORMAT_UCS_2BE (IDM_FORMAT + 6) - #define IDM_FORMAT_UCS_2LE (IDM_FORMAT + 7) + #define IDM_FORMAT_UTF_16BE (IDM_FORMAT + 6) + #define IDM_FORMAT_UTF_16LE (IDM_FORMAT + 7) #define IDM_FORMAT_AS_UTF_8 (IDM_FORMAT + 8) #define IDM_FORMAT_CONV2_ANSI (IDM_FORMAT + 9) #define IDM_FORMAT_CONV2_AS_UTF_8 (IDM_FORMAT + 10) #define IDM_FORMAT_CONV2_UTF_8 (IDM_FORMAT + 11) - #define IDM_FORMAT_CONV2_UCS_2BE (IDM_FORMAT + 12) - #define IDM_FORMAT_CONV2_UCS_2LE (IDM_FORMAT + 13) + #define IDM_FORMAT_CONV2_UTF_16BE (IDM_FORMAT + 12) + #define IDM_FORMAT_CONV2_UTF_16LE (IDM_FORMAT + 13) #define IDM_FORMAT_ENCODE (IDM_FORMAT + 20) #define IDM_FORMAT_WIN_1250 (IDM_FORMAT_ENCODE + 0) @@ -375,14 +440,14 @@ #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_DOS_437 (IDM_FORMAT_ENCODE + 24) - #define IDM_FORMAT_DOS_720 (IDM_FORMAT_ENCODE + 25) + //#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) #define IDM_FORMAT_DOS_775 (IDM_FORMAT_ENCODE + 27) #define IDM_FORMAT_DOS_850 (IDM_FORMAT_ENCODE + 28) @@ -408,7 +473,6 @@ #define IDM_FORMAT_KOI8R_CYRILLIC (IDM_FORMAT_ENCODE + 48) #define IDM_FORMAT_ENCODE_END IDM_FORMAT_KOI8R_CYRILLIC - //#define IDM_FORMAT_CONVERT 200 #define IDM_LANG (IDM + 6000) #define IDM_LANGSTYLE_CONFIG_DLG (IDM_LANG + 1) @@ -466,49 +530,101 @@ #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_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_NIM (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_TYPESCRIPT (IDM_LANG + 84) + #define IDM_LANG_JSON5 (IDM_LANG + 85) + #define IDM_LANG_MSSQL (IDM_LANG + 86) + #define IDM_LANG_GDSCRIPT (IDM_LANG + 87) + #define IDM_LANG_HOLLYWOOD (IDM_LANG + 88) + #define IDM_LANG_GOLANG (IDM_LANG + 89) + #define IDM_LANG_RAKU (IDM_LANG + 90) + #define IDM_LANG_TOML (IDM_LANG + 91) + #define IDM_LANG_SAS (IDM_LANG + 92) + #define IDM_LANG_ERRORLIST (IDM_LANG + 93) + + #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: Adjust with IDM_LANG_USER + #define IDM_LANG_USER_DLG (IDM_LANG + 250) //46250: Used for translation + #define IDM_LANG_OPENUDLDIR (IDM_LANG + 300) + #define IDM_LANG_UDLCOLLECTION_PROJECT_SITE (IDM_LANG + 301) - #define IDM_LANG_EXTERNAL (IDM_LANG + 65) - #define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 79) - #define IDM_LANG_USER (IDM_LANG + 80) //46080 - #define IDM_LANG_USER_LIMIT (IDM_LANG + 110) //46110 - #define IDM_LANG_USER_DLG (IDM_LANG + 150) - - #define IDM_ABOUT (IDM + 7000) #define IDM_HOMESWEETHOME (IDM_ABOUT + 1) #define IDM_PROJECTPAGE (IDM_ABOUT + 2) - #define IDM_ONLINEHELP (IDM_ABOUT + 3) + #define IDM_ONLINEDOCUMENT (IDM_ABOUT + 3) #define IDM_FORUM (IDM_ABOUT + 4) - #define IDM_PLUGINSHOME (IDM_ABOUT + 5) + //#define IDM_PLUGINSHOME (IDM_ABOUT + 5) #define IDM_UPDATE_NPP (IDM_ABOUT + 6) - #define IDM_WIKIFAQ (IDM_ABOUT + 7) - #define IDM_HELP (IDM_ABOUT + 8) - #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_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_REPLACESPACE (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_IMPORTSTYLETHEMES (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_SHORTCUT_MAPPER_MACRO (IDM_SETTING + 16) - #define IDM_SETTING_SHORTCUT_MAPPER_RUN (IDM_SETTING + 17) - #define IDM_SETTING_EDITCONTEXTMENU (IDM_SETTING + 18) + #define IDM_SETTING_PREFERENCE (IDM_SETTING + 11) + #define IDM_SETTING_OPENPLUGINSDIR (IDM_SETTING + 14) + #define IDM_SETTING_PLUGINADM (IDM_SETTING + 15) + #define IDM_SETTING_SHORTCUT_MAPPER_MACRO (IDM_SETTING + 16) + #define IDM_SETTING_SHORTCUT_MAPPER_RUN (IDM_SETTING + 17) + #define IDM_SETTING_EDITCONTEXTMENU (IDM_SETTING + 18) + +#define IDM_TOOL (IDM + 8500) + #define IDM_TOOL_MD5_GENERATE (IDM_TOOL + 1) + #define IDM_TOOL_MD5_GENERATEFROMFILE (IDM_TOOL + 2) + #define IDM_TOOL_MD5_GENERATEINTOCLIPBOARD (IDM_TOOL + 3) + #define IDM_TOOL_SHA256_GENERATE (IDM_TOOL + 4) + #define IDM_TOOL_SHA256_GENERATEFROMFILE (IDM_TOOL + 5) + #define IDM_TOOL_SHA256_GENERATEINTOCLIPBOARD (IDM_TOOL + 6) + #define IDM_TOOL_SHA1_GENERATE (IDM_TOOL + 7) + #define IDM_TOOL_SHA1_GENERATEFROMFILE (IDM_TOOL + 8) + #define IDM_TOOL_SHA1_GENERATEINTOCLIPBOARD (IDM_TOOL + 9) + #define IDM_TOOL_SHA512_GENERATE (IDM_TOOL + 10) + #define IDM_TOOL_SHA512_GENERATEFROMFILE (IDM_TOOL + 11) + #define IDM_TOOL_SHA512_GENERATEINTOCLIPBOARD (IDM_TOOL + 12) #define IDM_EXECUTE (IDM + 9000) @@ -519,4 +635,23 @@ #define IDM_SYSTRAYPOPUP_OPENFILE (IDM_SYSTRAYPOPUP + 4) #define IDM_SYSTRAYPOPUP_CLOSE (IDM_SYSTRAYPOPUP + 5) -#endif //MENUCMDID_H +#define IDR_WINDOWS_MENU 11000 + #define IDM_WINDOW_WINDOWS (IDR_WINDOWS_MENU + 1) + #define IDM_WINDOW_SORT_FN_ASC (IDR_WINDOWS_MENU + 2) + #define IDM_WINDOW_SORT_FN_DSC (IDR_WINDOWS_MENU + 3) + #define IDM_WINDOW_SORT_FP_ASC (IDR_WINDOWS_MENU + 4) + #define IDM_WINDOW_SORT_FP_DSC (IDR_WINDOWS_MENU + 5) + #define IDM_WINDOW_SORT_FT_ASC (IDR_WINDOWS_MENU + 6) + #define IDM_WINDOW_SORT_FT_DSC (IDR_WINDOWS_MENU + 7) + #define IDM_WINDOW_SORT_FS_ASC (IDR_WINDOWS_MENU + 8) + #define IDM_WINDOW_SORT_FS_DSC (IDR_WINDOWS_MENU + 9) + #define IDM_WINDOW_SORT_FD_ASC (IDR_WINDOWS_MENU + 10) + #define IDM_WINDOW_SORT_FD_DSC (IDR_WINDOWS_MENU + 11) + #define IDM_WINDOW_MRU_FIRST (IDR_WINDOWS_MENU + 20) + #define IDM_WINDOW_MRU_LIMIT (IDR_WINDOWS_MENU + 59) + #define IDM_WINDOW_COPY_NAME (IDM_WINDOW_MRU_LIMIT + 1) + #define IDM_WINDOW_COPY_PATH (IDM_WINDOW_MRU_LIMIT + 2) + +#define IDR_DROPLIST_MENU 14000 + #define IDM_DROPLIST_LIST (IDR_DROPLIST_MENU + 1) + #define IDM_DROPLIST_MRU_FIRST (IDR_DROPLIST_MENU + 20) diff --git a/src/NppJsonViewer/NPPJSONViewer.vcxproj b/src/NppJsonViewer/NPPJSONViewer.vcxproj index b163c86..bf618b9 100644 --- a/src/NppJsonViewer/NPPJSONViewer.vcxproj +++ b/src/NppJsonViewer/NPPJSONViewer.vcxproj @@ -115,7 +115,7 @@ EditAndContinue - shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies) + shlwapi.lib;comctl32.lib;Version.lib;uxtheme.lib;%(AdditionalDependencies) true Windows MachineX64 @@ -130,7 +130,7 @@ ProgramDatabase - shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies) + shlwapi.lib;comctl32.lib;Version.lib;uxtheme.lib;%(AdditionalDependencies) true Windows @@ -141,7 +141,7 @@ ProgramDatabase - shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies) + shlwapi.lib;comctl32.lib;Version.lib;uxtheme.lib;%(AdditionalDependencies) DebugFull Windows MachineX64 @@ -153,7 +153,7 @@ ProgramDatabase - shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies) + shlwapi.lib;comctl32.lib;Version.lib;uxtheme.lib;%(AdditionalDependencies) DebugFull Windows @@ -164,7 +164,7 @@ ProgramDatabase - shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies) + shlwapi.lib;comctl32.lib;Version.lib;uxtheme.lib;%(AdditionalDependencies) DebugFull Windows MachineX86 @@ -179,7 +179,7 @@ EditAndContinue - shlwapi.lib;comctl32.lib;Version.lib;%(AdditionalDependencies) + shlwapi.lib;comctl32.lib;Version.lib;uxtheme.lib;%(AdditionalDependencies) true Windows MachineX86 @@ -188,7 +188,7 @@ - + @@ -208,6 +208,7 @@ + diff --git a/src/NppJsonViewer/NPPJSONViewer.vcxproj.filters b/src/NppJsonViewer/NPPJSONViewer.vcxproj.filters index 46c553a..af07d4f 100644 --- a/src/NppJsonViewer/NPPJSONViewer.vcxproj.filters +++ b/src/NppJsonViewer/NPPJSONViewer.vcxproj.filters @@ -21,7 +21,7 @@ - + Source Files @@ -128,6 +128,9 @@ ThirdParty\npp + + ThirdParty\npp + ThirdParty\npp diff --git a/src/NppJsonViewer/NppJsonPlugin.cpp b/src/NppJsonViewer/NppJsonPlugin.cpp index 16439b9..f251481 100644 --- a/src/NppJsonViewer/NppJsonPlugin.cpp +++ b/src/NppJsonViewer/NppJsonPlugin.cpp @@ -103,11 +103,12 @@ void NppJsonPlugin::SetMenuIcon() { if (m_hMenuIcon.hToolbarIcon || m_hMenuIcon.hToolbarBmp) { - toolbarIcons tbIcon {}; + toolbarIconsWithDarkMode tbIcon {}; tbIcon.hToolbarBmp = m_hMenuIcon.hToolbarBmp; tbIcon.hToolbarIcon = m_hMenuIcon.hToolbarIcon; + tbIcon.hToolbarIconDarkMode = m_hMenuIcon.hToolbarIcon; auto nCommandId = m_shortcutCommands.GetCommandID(CallBackID::SHOW_DOC_PANEL); - ::SendMessage(m_NppData._nppHandle, NPPM_ADDTOOLBARICON, reinterpret_cast(nCommandId), reinterpret_cast(&tbIcon)); + ::SendMessage(m_NppData._nppHandle, NPPM_ADDTOOLBARICON_FORDARKMODE, reinterpret_cast(nCommandId), reinterpret_cast(&tbIcon)); } } diff --git a/src/NppJsonViewer/SettingsDlg.cpp b/src/NppJsonViewer/SettingsDlg.cpp index d821eec..9bd1a7d 100644 --- a/src/NppJsonViewer/SettingsDlg.cpp +++ b/src/NppJsonViewer/SettingsDlg.cpp @@ -42,9 +42,7 @@ INT_PTR SettingsDlg::run_dlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { ::SetWindowLongPtr(_hSelf, DWLP_USER, lParam); - auto enable_dlg_theme = reinterpret_cast(::SendMessage(_hParent, NPPM_GETENABLETHEMETEXTUREFUNC, 0, 0)); - if (enable_dlg_theme != nullptr) - enable_dlg_theme(_hSelf, ETDT_ENABLETAB); + EnableThemeDialogTexture(_hSelf, ETDT_ENABLETAB); InitDlg();