@@ -32,14 +32,15 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
3232 L_ASN1 , L_AVS , L_BLITZBASIC , L_PUREBASIC , L_FREEBASIC , \
3333 L_CSOUND , L_ERLANG , L_ESCRIPT , L_FORTH , L_LATEX , \
3434 L_MMIXAL , L_NIM , L_NNCRONTAB , L_OSCRIPT , L_REBOL , \
35- L_REGISTRY , L_RUST , L_SPICE , L_TXT2TAGS , L_VISUALPROLOG , L_TYPESCRIPT ,\
35+ L_REGISTRY , L_RUST , L_SPICE , L_TXT2TAGS , L_VISUALPROLOG ,\
36+ L_TYPESCRIPT , L_JSON5 , L_MSSQL , L_GDSCRIPT , L_HOLLYWOOD ,\
3637 // Don't use L_JS, use L_JAVASCRIPT instead
3738 // The end of enumated language type, so it should be always at the end
3839 L_EXTERNAL };
3940enum class ExternalLexerAutoIndentMode { Standard, C_Like, Custom };
4041enum class MacroStatus { Idle, RecordInProgress, RecordingStopped, PlayingBack };
4142
42- 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 };
43+ 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 };
4344enum Platform { PF_UNKNOWN , PF_X86 , PF_X64 , PF_IA64 , PF_ARM64 };
4445
4546
@@ -167,8 +168,8 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
167168 #define NPPM_MAKECURRENTBUFFERDIRTY (NPPMSG + 44 )
168169 // BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0)
169170
170- #define NPPM_GETENABLETHEMETEXTUREFUNC (NPPMSG + 45)
171- //BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0)
171+ #define NPPM_GETENABLETHEMETEXTUREFUNC_DEPRECATED (NPPMSG + 45 )
172+ // BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0) -- DEPRECATED : use EnableThemeDialogTexture from uxtheme.h instead
172173
173174 #define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46 )
174175 // INT NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str)
@@ -367,7 +368,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
367368
368369 #define NPPM_ALLOCATEMARKER (NPPMSG + 82 )
369370 // BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber)
370- // sets startNumber to the initial command ID if successful
371+ // sets startNumber to the initial marker ID if successful
371372 // Allocates a marker number to a plugin: if a plugin need to add a marker on Notepad++'s Scintilla marker margin,
372373 // it has to use this message to get marker number, in order to prevent from the conflict with the other plugins.
373374 // Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful
@@ -541,24 +542,79 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
541542 // allocate commandLineStr buffer with the return value + 1, then call it again to get the current command line string.
542543
543544 #define NPPM_CREATELEXER (NPPMSG + 110 )
544- // void* NPPN_CREATELEXER (0, const TCHAR *lexer_name)
545+ // void* NPPM_CREATELEXER (0, const TCHAR *lexer_name)
545546 // Returns the ILexer pointer created by Lexilla
546547
547- #define VAR_NOT_RECOGNIZED 0
548- #define FULL_CURRENT_PATH 1
549- #define CURRENT_DIRECTORY 2
550- #define FILE_NAME 3
551- #define NAME_PART 4
552- #define EXT_PART 5
553- #define CURRENT_WORD 6
554- #define NPP_DIRECTORY 7
555- #define CURRENT_LINE 8
556- #define CURRENT_COLUMN 9
557- #define NPP_FULL_FILE_PATH 10
558- #define GETFILENAMEATCURSOR 11
559- #define CURRENT_LINESTR 12
560-
561- #define RUNCOMMAND_USER (WM_USER + 3000)
548+ #define NPPM_GETBOOKMARKID (NPPMSG + 111 )
549+ // void* NPPM_GETBOOKMARKID(0, 0)
550+ // Returns the bookmark ID
551+
552+ #define NPPM_DARKMODESUBCLASSANDTHEME (NPPMSG + 112 )
553+ // ULONG NPPM_DARKMODESUBCLASSANDTHEME(ULONG dmFlags, HWND hwnd)
554+ // Add support for generic dark mode.
555+ //
556+ // Docking panels don't need to call NPPM_DARKMODESUBCLASSANDTHEME for main hwnd.
557+ // Subclassing is applied automatically unless DWS_USEOWNDARKMODE flag is used.
558+ //
559+ // Might not work properly in C# plugins.
560+ //
561+ // Returns succesful combinations of flags.
562+ //
563+
564+ namespace NppDarkMode
565+ {
566+ // Standard flags for main parent after its children are initialized.
567+ constexpr ULONG dmfInit = 0x0000000BUL ;
568+
569+ // Standard flags for main parent usually used in NPPN_DARKMODECHANGED.
570+ constexpr ULONG dmfHandleChange = 0x0000000CUL ;
571+ };
572+
573+ // Examples:
574+ //
575+ // - after controls initializations in WM_INITDIALOG, in WM_CREATE or after CreateWindow:
576+ //
577+ // auto success = static_cast<ULONG>(::SendMessage(nppData._nppHandle, NPPM_DARKMODESUBCLASSANDTHEME, static_cast<WPARAM>(NppDarkMode::dmfInit), reinterpret_cast<LPARAM>(mainHwnd)));
578+ //
579+ // - handling dark mode change:
580+ //
581+ // extern "C" __declspec(dllexport) void beNotified(SCNotification * notifyCode)
582+ // {
583+ // switch (notifyCode->nmhdr.code)
584+ // {
585+ // case NPPN_DARKMODECHANGED:
586+ // {
587+ // ::SendMessage(nppData._nppHandle, NPPM_DARKMODESUBCLASSANDTHEME, static_cast<WPARAM>(dmfHandleChange), reinterpret_cast<LPARAM>(mainHwnd));
588+ // ::SetWindowPos(mainHwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); // to redraw titlebar and window
589+ // break;
590+ // }
591+ // }
592+ // }
593+
594+ #define NPPM_ALLOCATEINDICATOR (NPPMSG + 113 )
595+ // BOOL NPPM_ALLOCATEINDICATOR(int numberRequested, int* startNumber)
596+ // sets startNumber to the initial indicator ID if successful
597+ // Allocates an indicator number to a plugin: if a plugin needs to add an indicator,
598+ // it has to use this message to get the indicator number, in order to prevent a conflict with the other plugins.
599+ // Returns: TRUE if successful, FALSE otherwise.
600+
601+ // For RUNCOMMAND_USER
602+ #define VAR_NOT_RECOGNIZED 0
603+ #define FULL_CURRENT_PATH 1
604+ #define CURRENT_DIRECTORY 2
605+ #define FILE_NAME 3
606+ #define NAME_PART 4
607+ #define EXT_PART 5
608+ #define CURRENT_WORD 6
609+ #define NPP_DIRECTORY 7
610+ #define CURRENT_LINE 8
611+ #define CURRENT_COLUMN 9
612+ #define NPP_FULL_FILE_PATH 10
613+ #define GETFILENAMEATCURSOR 11
614+ #define CURRENT_LINESTR 12
615+
616+ #define RUNCOMMAND_USER (WM_USER + 3000 )
617+
562618 #define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH )
563619 #define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY )
564620 #define NPPM_GETFILENAME (RUNCOMMAND_USER + FILE_NAME )
@@ -737,3 +793,8 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
737793 // scnNotification->nmhdr.code = NPPN_CMDLINEPLUGINMSG;
738794 // scnNotification->nmhdr.hwndFrom = hwndNpp;
739795 // scnNotification->nmhdr.idFrom = pluginMessage; //where pluginMessage is pointer of type wchar_t
796+
797+ #define NPPN_EXTERNALLEXERBUFFER (NPPN_FIRST + 29 ) // To notify lexer plugins that the buffer (in idFrom) is just applied to a external lexer
798+ // scnNotification->nmhdr.code = NPPN_EXTERNALLEXERBUFFER;
799+ // scnNotification->nmhdr.hwndFrom = hwndNpp;
800+ // scnNotification->nmhdr.idFrom = BufferID; //where pluginMessage is pointer of type wchar_t
0 commit comments