diff --git a/src/DockingFeature/Window.h b/src/DockingFeature/Window.h index 6bfd6bd..e1f6ff4 100644 --- a/src/DockingFeature/Window.h +++ b/src/DockingFeature/Window.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2022 Don HO +// Copyright (C)2024 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 diff --git a/src/Notepad_plus_msgs.h b/src/Notepad_plus_msgs.h index 6f71c9f..aa3636a 100644 --- a/src/Notepad_plus_msgs.h +++ b/src/Notepad_plus_msgs.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2022 Don HO +// Copyright (C)2024 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 @@ -15,6 +15,11 @@ // along with this program. If not, see . + +// For more comprehensive information on plugin communication, please refer to the following resource: +// https://npp-user-manual.org/docs/plugin-communication/ + + #pragma once #include @@ -32,7 +37,8 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ 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_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,\ + L_TYPESCRIPT, L_JSON5, L_MSSQL, L_GDSCRIPT, L_HOLLYWOOD,\ // Don't use L_JS, use L_JAVASCRIPT instead // The end of enumated language type, so it should be always at the end L_EXTERNAL}; @@ -46,159 +52,357 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #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 (NPPMSG + 8) + // BOOL NPPM_GETOPENFILENAMES(TCHAR** fileNames, int nbFileNames) + // Get the open files full paths of both views. 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_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, TCHAR* 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) + // NPPM_GETSESSIONFILES (TCHAR** sessionFileArray, TCHAR* 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) - #define NPPM_SAVECURRENTSESSION (NPPMSG + 16) - struct sessionInfo { - TCHAR* sessionFilePathName; - int nbFile; - TCHAR** files; + TCHAR* sessionFilePathName; // Full session file path name to be saved + int nbFile; // Size of "files" array - number of files to be saved in session + TCHAR** 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_SAVECURRENTSESSION (NPPMSG + 16) + // TCHAR* NPPM_SAVECURRENTSESSION(0, TCHAR* 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 (NPPMSG + 17) + // BOOL NPPM_GETOPENFILENAMESPRIMARY(TCHAR** fileNames, int nbFileNames) + // 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 (NPPMSG + 18) + // BOOL NPPM_GETOPENFILENAMESSECOND(TCHAR** fileNames, int nbFileNames) + // 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 createed 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, TCHAR *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(TCHAR * dir2Search, TCHAR * 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 regeistered 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 regeistered 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 informations which needs to be filled out are hClient, pszName, dlgID, uMask and pszModuleName. + // Notice that rcFloatand 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, TCHAR* 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, TCHAR* 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, TCHAR *filePathName2Reload) + // Reload the document which matches with the given filePathName2switch. + // wParam: 0 (not used) + // lParam[in]: filePathName2Reload is the full file path of document to reload + // Return TRUE #define NPPM_SWITCHTOFILE (NPPMSG + 37) - //BOOL NPPM_SWITCHTOFILE(0, TCHAR *filePathName2switch) + // BOOL NPPM_SWITCHTOFILE(0, TCHAR* 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_DEPRECATED (NPPMSG + 41) - //void NPPM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons iconHandles) -- DEPRECATED : use NPPM_ADDTOOLBARICON_FORDARKMODE instead - //2 formats of icon are needed: .ico & .bmp - //Both handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users 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 begining 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 TCHAR *windowName, const TCHAR *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) - //INT NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str) + // int NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str) // Get user's plugin config directory path. It's useful if plugins want to save/load parameters for the current user - // Returns the number of TCHAR copied/to copy. - // Users should call it with "str" be NULL to get the required number of TCHAR (not including the terminating nul character), - // allocate "str" buffer with the return value + 1, then call it again to get the path. + // 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 TCHAR (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 TCHAR 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 TCHAR * srcModuleName; // the complete module name (with the extesion .dll) of caller (plugin X). + void* info; // defined by plugin, the informations 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(TCHAR *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(BOOL ADD_ZERO_PADDING, 0) - // Get Notepad++ version + // 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 // @@ -225,290 +429,438 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #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(UINT_PTR bufferID, INT priorityView) - // Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing - // if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly + // 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(UINT_PTR bufferID, TCHAR *fullFilePath) - // Get full path file name from a bufferID. + // int NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, TCHAR* fullFilePath) + // Get full path file name from a bufferID (the pointer of buffer). + // wParam[in]: bufferID + // lParam[out]: fullFilePath - 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 // 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 #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(UINT_PTR bufferID, BOOL alert) - // 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(UINT_PTR 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(UINT_PTR 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(UINT_PTR 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(UINT_PTR 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(UINT_PTR bufferID, 0) - // wParam: BufferID to get EolType format from - // lParam: 0 - // returns as int, see EolType format. -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, otherwize EolType format: + // 0: Windows (CRLF) + // 1: Macos (CR) + // 2: Unix (LF) + // 3. Unknown #define NPPM_SETBUFFERFORMAT (NPPMSG + 69) - // BOOL NPPM_SETBUFFERFORMAT(UINT_PTR bufferID, INT format) - // wParam: BufferID to set EolType 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 EolType format - #define NPPM_HIDETOOLBAR (NPPMSG + 70) // BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot) - // if hideOrNot is set as TRUE then tool bar will be hidden - // 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 shortcut 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 TCHAR* 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 TCHAR* 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 encoding + // 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 iten 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: if a plugin need to add a marker on Notepad++'s Scintilla marker margin, + // 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. - // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful + // 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 programming language name from the given language type (LangType) + // int NPPM_GETLANGUAGENAME(LangType langType, TCHAR* 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 recieve 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 programming language short description from the given language type (LangType) + // 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 recieve 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_SHOWDOCLIST (NPPMSG + 85) - // VOID NPPM_SHOWDOCLIST(0, BOOL toShowOrNot) - // Send this message to show or hide Document List. - // if toShowOrNot is TRUE then show Document List, otherwise hide it. + // 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_ISDOCLISTSHOWN (NPPMSG + 86) // BOOL NPPM_ISDOCLISTSHOWN(0, 0) - // Check to see if Document List is shown. + // 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%\..\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_DOCLISTDISABLEEXTCOLUMN (NPPMSG + 89) - // VOID NPPM_DOCLISTDISABLEEXTCOLUMN(0, BOOL disableOrNot) + // 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) - // VOID NPPM_DOCLISTDISABLEPATHCOLUMN(0, BOOL disableOrNot) + // 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 TCHAR *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_REMOVESHORTCUTASSIGNMENT(int cmdID) - // removes the assigned shortcut mapped to cmdID - // returned value : TRUE if function call is successful, otherwise FALSE + // 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, TCHAR *pluginRootPath) - // Get plugin home root path. It's useful if plugins want to get its own path - // by appending which is the name of plugin without extension part. - // Returns the number of TCHAR copied/to copy. - // Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character), - // allocate pluginRootPath buffer with the return value + 1, then call it again to get the path. + // int NPPM_GETPLUGINHOMEPATH(size_t strLen, TCHAR* pluginRootPath) + // Get plugin home root path. It's useful if plugins want to get its own path by appending which is the name of plugin without extension part. + // 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 TCHAR (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 TCHAR copied/to copy, 0 on copy failed #define NPPM_GETSETTINGSONCLOUDPATH (NPPMSG + 98) - // INT NPPM_GETSETTINGSCLOUDPATH(size_t strLen, TCHAR *settingsOnCloudPath) + // int NPPM_GETSETTINGSCLOUDPATH(size_t strLen, TCHAR *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 TCHAR (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 TCHAR 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. - // Users should call it with settingsCloudPath be NULL to get the required number of TCHAR (not including the terminating nul character), - // allocate settingsCloudPath buffer with the return value + 1, then call it again to get the path. #define NPPM_SETLINENUMBERWIDTHMODE (NPPMSG + 99) #define LINENUMWIDTH_DYNAMIC 0 #define LINENUMWIDTH_CONSTANT 1 - // BOOL NPPM_SETLINENUMBERWIDTHMODE(0, INT widthMode) + // 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++ - // If calling is successful return TRUE, otherwise return FALSE. + // 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) + // 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) - // VOID NPPM_ADDTOOLBARICON_FORDARKMODE(UINT funcItem[X]._cmdID, toolbarIconsWithDarkMode iconHandles) - // Use NPPM_ADDTOOLBARICON_FORDARKMODE instead obsolete NPPM_ADDTOOLBARICON which doesn't support the dark mode - // 2 formats / 3 icons are needed: 1 * BMP + 2 * ICO - // 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 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 TCHAR *languageName, ExternalLexerAutoIndentMode &autoIndentMode) + // BOOL NPPM_GETEXTERNALLEXERAUTOINDENTMODE(const TCHAR* languageName, ExternalLexerAutoIndentMode* autoIndentMode) // Get ExternalLexerAutoIndentMode for an installed external programming language. - // - Standard means Notepad++ will keep the same TAB indentation between lines; - // - C_Like means Notepad++ will perform a C-Language style indentation for the selected external language; - // - Custom means a Plugin will be controlling auto-indentation for the current language. + // wParam[in]: languageName is external language name to search + // lParam[out]: autoIndentMode could recieve 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 TCHAR *languageName, ExternalLexerAutoIndentMode autoIndentMode) + // BOOL NPPM_SETEXTERNALLEXERAUTOINDENTMODE(const TCHAR* languageName, ExternalLexerAutoIndentMode autoIndentMode) // Set ExternalLexerAutoIndentMode for an installed external programming language. - // - Standard means Notepad++ will keep the same TAB indentation between lines; - // - C_Like means Notepad++ will perform a C-Language style indentation for the selected external language; - // - Custom means a Plugin will be controlling auto-indentation for the current language. - // returned value: TRUE if function call was successful, otherwise FALSE. + // wParam[in]: languageName is external language name to set + // lParam[in]: autoIndentMode could recieve 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) - // Returns the current Use Auto-Indentation setting in Notepad++ Preferences. + // 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) - // Gets current enum class MacroStatus { Idle - means macro is not in use and it's empty, RecordInProgress, RecordingStopped, PlayingBack } + // 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) - // Returns true when Notepad++ Dark Mode is enable, false when it is not. + // 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) - // - cbSize must be filled with sizeof(NppDarkMode::Colors). - // - returnColors must be a pre-allocated NppDarkMode::Colors struct. - // Returns true when successful, false otherwise. + // 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 @@ -534,20 +886,82 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; // 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, TCHAR *commandLineStr) + // int NPPM_GETCURRENTCMDLINE(size_t strLen, TCHAR *commandLineStr) // Get the Current Command Line string. - // Returns the number of TCHAR copied/to copy. // Users should call it with commandLineStr as NULL to get the required number of TCHAR (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 recieves all copied command line string + // Return the number of TCHAR copied/to copy + #define NPPM_CREATELEXER (NPPMSG + 110) - // void* NPPN_CREATELEXER(0, const TCHAR *lexer_name) - // Returns the ILexer pointer created by Lexilla + // void* NPPM_CREATELEXER(0, const TCHAR* 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) - // void* NPPM_GETBOOKMARKID(0, 0) - // Returns the bookmark ID + // int NPPM_GETBOOKMARKID(0, 0) + // Get the bookmark ID - use this API to get bookmark ID dynamically that garantees 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 succesful 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. // For RUNCOMMAND_USER @@ -574,22 +988,30 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; #define NPPM_GETEXTPART (RUNCOMMAND_USER + EXT_PART) #define NPPM_GETCURRENTWORD (RUNCOMMAND_USER + CURRENT_WORD) #define NPPM_GETNPPDIRECTORY (RUNCOMMAND_USER + NPP_DIRECTORY) + #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, 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 + // Get XXX string operations. + // wParam[in]: strLen is the allocated array size + // lParam[out]: str is the allocated TCHAR array + // The return value is TRUE when get generic_string 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 NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH) // Notification code @@ -745,3 +1167,8 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 }; //scnNotification->nmhdr.code = NPPN_CMDLINEPLUGINMSG; //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = pluginMessage; //where pluginMessage is pointer of type wchar_t + + #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 diff --git a/src/PluginInterface.h b/src/PluginInterface.h index a247bca..416a362 100644 --- a/src/PluginInterface.h +++ b/src/PluginInterface.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2022 Don HO +// Copyright (C)2024 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 @@ -15,12 +15,15 @@ // along with this program. If not, see . + +// For more comprehensive information on plugin communication, please refer to the following resource: +// https://npp-user-manual.org/docs/plugin-communication/ + #pragma once #include "Scintilla.h" #include "Notepad_plus_msgs.h" -const int nbChar = 64; typedef const TCHAR * (__cdecl * PFUNCGETNAME)(); @@ -45,9 +48,11 @@ struct ShortcutKey UCHAR _key = 0; }; +const int menuItemSize = 64; + struct FuncItem { - TCHAR _itemName[nbChar] = { '\0' }; + TCHAR _itemName[menuItemSize] = { '\0' }; PFUNCPLUGINCMD _pFunc = nullptr; int _cmdID = 0; bool _init2Check = false; diff --git a/src/Sci_Position.h b/src/Sci_Position.h index d2afb7f..88ad513 100644 --- a/src/Sci_Position.h +++ b/src/Sci_Position.h @@ -17,9 +17,8 @@ typedef ptrdiff_t Sci_Position; // Unsigned variant used for ILexer::Lex and ILexer::Fold typedef size_t Sci_PositionU; -// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) -// Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs -// typedef long Sci_PositionCR; +// 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 diff --git a/src/Scintilla.h b/src/Scintilla.h index c7c87e6..95fcf9b 100644 --- a/src/Scintilla.h +++ b/src/Scintilla.h @@ -63,6 +63,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_SELECTALL 2013 #define SCI_SETSAVEPOINT 2014 #define SCI_GETSTYLEDTEXT 2015 +#define SCI_GETSTYLEDTEXTFULL 2778 #define SCI_CANREDO 2016 #define SCI_MARKERLINEFROMHANDLE 2017 #define SCI_MARKERDELETEHANDLE 2018 @@ -491,16 +492,14 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCFIND_POSIX 0x00400000 #define SCFIND_CXX11REGEX 0x00800000 -// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) +// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) // Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs -// #define SCI_FINDTEXT 2150 - +//#define SCI_FINDTEXT 2150 #define SCI_FINDTEXTFULL 2196 -// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) +// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) // Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs -// #define SCI_FORMATRANGE 2151 - +//#define SCI_FORMATRANGE 2151 #define SCI_FORMATRANGEFULL 2777 #define SC_CHANGE_HISTORY_DISABLED 0 #define SC_CHANGE_HISTORY_ENABLED 1 @@ -520,10 +519,9 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SCI_SETSEL 2160 #define SCI_GETSELTEXT 2161 -// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) +// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) // Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs -// #define SCI_GETTEXTRANGE 2162 - +//#define SCI_GETTEXTRANGE 2162 #define SCI_GETTEXTRANGEFULL 2039 #define SCI_HIDESELECTION 2163 #define SCI_GETSELECTIONHIDDEN 2088 @@ -569,6 +567,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #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 @@ -885,7 +884,9 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #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 @@ -1031,6 +1032,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #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 @@ -1252,6 +1254,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #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 @@ -1305,42 +1308,45 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP /* 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. */ + +// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) +// Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs /* - * Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) - * Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs - * struct Sci_CharacterRange { Sci_PositionCR cpMin; Sci_PositionCR cpMax; }; */ + struct Sci_CharacterRangeFull { Sci_Position cpMin; Sci_Position cpMax; }; + +// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) +// Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs /* - * Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) - * Please use Sci_Position, 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; }; + +// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) +// Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs /* - * Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) - * Please use Sci_Position, 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; @@ -1358,10 +1364,10 @@ 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. */ + +// Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) +// Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs /* - * Deprecated by Notepad++ 2GB+ support via new scintilla interfaces from 5.2.3 (see https://www.scintilla.org/ScintillaHistory.html) - * Please use Sci_Position, SCI_GETTEXTRANGEFULL, SCI_FINDTEXTFULL, and SCI_FORMATRANGEFULL and corresponding defines/structs - * struct Sci_RangeToFormat { Sci_SurfaceID hdc; Sci_SurfaceID hdcTarget; @@ -1370,6 +1376,7 @@ struct Sci_RangeToFormat { struct Sci_CharacterRange chrg; }; */ + struct Sci_RangeToFormatFull { Sci_SurfaceID hdc; Sci_SurfaceID hdcTarget; diff --git a/src/menuCmdID.h b/src/menuCmdID.h index 22bfb9a..58a2a39 100644 --- a/src/menuCmdID.h +++ b/src/menuCmdID.h @@ -1,5 +1,5 @@ // This file is part of Notepad++ project -// Copyright (C)2022 Don HO +// Copyright (C)2024 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 @@ -170,6 +170,17 @@ #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_AUTOCOMPLETE (50000 + 0) #define IDM_EDIT_AUTOCOMPLETE_CURRENTFILE (50000 + 1) @@ -250,6 +261,10 @@ #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_DOCLIST_FILESCLOSE (IDM_MISC + 1) #define IDM_DOCLIST_FILESCLOSEOTHERS (IDM_MISC + 2) @@ -373,12 +388,18 @@ #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) @@ -534,7 +555,11 @@ #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_EXTERNAL (IDM_LANG + 165) #define IDM_LANG_EXTERNAL_LIMIT (IDM_LANG + 179) @@ -585,6 +610,12 @@ #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)