Skip to content

Commit a2aebbe

Browse files
committed
Update to Notepad++ 7.7 API
1 parent fbcd2d5 commit a2aebbe

7 files changed

+331
-135
lines changed

src/NppAPI/DockingDlgInterface.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,9 @@
3232

3333
#include <assert.h>
3434
#include <shlwapi.h>
35-
#include <string>
3635
#include "StaticDialog.h"
3736

3837

39-
typedef std::basic_string<TCHAR> generic_string;
40-
41-
4238
class DockingDlgInterface : public StaticDialog
4339
{
4440
public:

src/NppAPI/Notepad_plus_msgs.h

Lines changed: 53 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,18 @@ enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\
3939
L_ASM, L_DIFF, L_PROPS, L_PS, L_RUBY, L_SMALLTALK, L_VHDL, L_KIX, L_AU3,\
4040
L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO, L_SEARCHRESULT,\
4141
L_CMAKE, L_YAML, L_COBOL, L_GUI4CLI, L_D, L_POWERSHELL, L_R, L_JSP,\
42-
L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77,\
42+
L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77, L_BAANC, L_SREC,\
43+
L_IHEX, L_TEHEX, L_SWIFT,\
44+
L_ASN1, L_AVS, L_BLITZBASIC, L_PUREBASIC, L_FREEBASIC, \
45+
L_CSOUND, L_ERLANG, L_ESCRIPT, L_FORTH, L_LATEX, \
46+
L_MMIXAL, L_NIMROD, L_NNCRONTAB, L_OSCRIPT, L_REBOL, \
47+
L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,\
4348
// Don't use L_JS, use L_JAVASCRIPT instead
4449
// The end of enumated language type, so it should be always at the end
4550
L_EXTERNAL};
4651

4752
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};
53+
enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 };
4854

4955

5056

@@ -174,7 +180,11 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
174180
//BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0)
175181

176182
#define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46)
177-
//void NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str)
183+
//INT NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str)
184+
// Get user's plugin config directory path. It's useful if plugins want to save/load parameters for the current user
185+
// Returns the number of TCHAR copied/to copy.
186+
// Users should call it with "str" be NULL to get the required number of TCHAR (not including the terminating nul character),
187+
// allocate "str" buffer with the return value + 1, then call it again to get the path.
178188

179189
#define NPPM_MSGTOPLUGIN (NPPMSG + 47)
180190
//BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info)
@@ -213,7 +223,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
213223
// returned value : TRUE if tab bar is hidden, otherwise FALSE
214224

215225
#define NPPM_GETPOSFROMBUFFERID (NPPMSG + 57)
216-
// INT NPPM_GETPOSFROMBUFFERID(INT bufferID, INT priorityView)
226+
// INT NPPM_GETPOSFROMBUFFERID(UINT_PTR bufferID, INT priorityView)
217227
// Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing
218228
// if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly
219229
//
@@ -223,11 +233,11 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
223233
// SUB_VIEW 1
224234

225235
#define NPPM_GETFULLPATHFROMBUFFERID (NPPMSG + 58)
226-
// INT NPPM_GETFULLPATHFROMBUFFERID(INT bufferID, TCHAR *fullFilePath)
236+
// INT NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, TCHAR *fullFilePath)
227237
// Get full path file name from a bufferID.
228238
// Return -1 if the bufferID non existing, otherwise the number of TCHAR copied/to copy
229239
// User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character),
230-
// allocate fullFilePath with the return values + 1, then call it again to get full path file name
240+
// allocate fullFilePath with the return values + 1, then call it again to get full path file name
231241

232242
#define NPPM_GETBUFFERIDFROMPOS (NPPMSG + 59)
233243
// LRESULT NPPM_GETBUFFERIDFROMPOS(INT index, INT iView)
@@ -240,64 +250,53 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
240250
// Returns active Buffer
241251

242252
#define NPPM_RELOADBUFFERID (NPPMSG + 61)
243-
// VOID NPPM_RELOADBUFFERID(0, 0)
253+
// VOID NPPM_RELOADBUFFERID(UINT_PTR bufferID, BOOL alert)
244254
// Reloads Buffer
245255
// wParam: Buffer to reload
246256
// lParam: 0 if no alert, else alert
247257

248258

249259
#define NPPM_GETBUFFERLANGTYPE (NPPMSG + 64)
250-
// INT NPPM_GETBUFFERLANGTYPE(INT bufferID, 0)
260+
// INT NPPM_GETBUFFERLANGTYPE(UINT_PTR bufferID, 0)
251261
// wParam: BufferID to get LangType from
252262
// lParam: 0
253263
// Returns as int, see LangType. -1 on error
254264

255265
#define NPPM_SETBUFFERLANGTYPE (NPPMSG + 65)
256-
// BOOL NPPM_SETBUFFERLANGTYPE(INT bufferID, INT langType)
266+
// BOOL NPPM_SETBUFFERLANGTYPE(UINT_PTR bufferID, INT langType)
257267
// wParam: BufferID to set LangType of
258268
// lParam: LangType
259269
// Returns TRUE on success, FALSE otherwise
260270
// use int, see LangType for possible values
261271
// L_USER and L_EXTERNAL are not supported
262272

263273
#define NPPM_GETBUFFERENCODING (NPPMSG + 66)
264-
// INT NPPM_GETBUFFERENCODING(INT bufferID, 0)
274+
// INT NPPM_GETBUFFERENCODING(UINT_PTR bufferID, 0)
265275
// wParam: BufferID to get encoding from
266276
// lParam: 0
267277
// returns as int, see UniMode. -1 on error
268278

269279
#define NPPM_SETBUFFERENCODING (NPPMSG + 67)
270-
// BOOL NPPM_SETBUFFERENCODING(INT bufferID, INT encoding)
280+
// BOOL NPPM_SETBUFFERENCODING(UINT_PTR bufferID, INT encoding)
271281
// wParam: BufferID to set encoding of
272282
// lParam: encoding
273283
// Returns TRUE on success, FALSE otherwise
274284
// use int, see UniMode
275285
// Can only be done on new, unedited files
276286

277287
#define NPPM_GETBUFFERFORMAT (NPPMSG + 68)
278-
// INT NPPM_GETBUFFERFORMAT(INT bufferID, 0)
279-
// wParam: BufferID to get format from
288+
// INT NPPM_GETBUFFERFORMAT(UINT_PTR bufferID, 0)
289+
// wParam: BufferID to get EolType format from
280290
// lParam: 0
281-
// returns as int, see formatType. -1 on error
291+
// returns as int, see EolType format. -1 on error
282292

283293
#define NPPM_SETBUFFERFORMAT (NPPMSG + 69)
284-
// BOOL NPPM_SETBUFFERFORMAT(INT bufferID, INT format)
285-
// wParam: BufferID to set format of
294+
// BOOL NPPM_SETBUFFERFORMAT(UINT_PTR bufferID, INT format)
295+
// wParam: BufferID to set EolType format of
286296
// lParam: format
287297
// Returns TRUE on success, FALSE otherwise
288-
// use int, see formatType
289-
290-
/*
291-
#define NPPM_ADDREBAR (NPPMSG + 57)
292-
// BOOL NPPM_ADDREBAR(0, REBARBANDINFO *)
293-
// Returns assigned ID in wID value of struct pointer
294-
#define NPPM_UPDATEREBAR (NPPMSG + 58)
295-
// BOOL NPPM_ADDREBAR(INT ID, REBARBANDINFO *)
296-
//Use ID assigned with NPPM_ADDREBAR
297-
#define NPPM_REMOVEREBAR (NPPMSG + 59)
298-
// BOOL NPPM_ADDREBAR(INT ID, 0)
299-
//Use ID assigned with NPPM_ADDREBAR
300-
*/
298+
// use int, see EolType format
299+
301300

302301
#define NPPM_HIDETOOLBAR (NPPMSG + 70)
303302
// BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot)
@@ -333,7 +332,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
333332
// BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey *sk)
334333
// get your plugin command current mapped shortcut into sk via cmdID
335334
// You may need it after getting NPPN_READY notification
336-
// returned value : TRUE if this function call is successful and shorcut is enable, otherwise FALSE
335+
// returned value : TRUE if this function call is successful and shortcut is enable, otherwise FALSE
337336

338337
#define NPPM_DOOPEN (NPPMSG + 77)
339338
// BOOL NPPM_DOOPEN(0, const TCHAR *fullPathName2Open)
@@ -345,7 +344,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
345344

346345
#define NPPM_GETCURRENTNATIVELANGENCODING (NPPMSG + 79)
347346
// INT NPPM_GETCURRENTNATIVELANGENCODING(0, 0)
348-
// returned value : the current native language enconding
347+
// returned value : the current native language encoding
349348

350349
#define NPPM_ALLOCATESUPPORTED (NPPMSG + 80)
351350
// returns TRUE if NPPM_ALLOCATECMDID is supported
@@ -364,15 +363,15 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
364363

365364
#define NPPM_GETLANGUAGENAME (NPPMSG + 83)
366365
// INT NPPM_GETLANGUAGENAME(int langType, TCHAR *langName)
367-
// Get programing language name from the given language type (LangType)
366+
// Get programming language name from the given language type (LangType)
368367
// Return value is the number of copied character / number of character to copy (\0 is not included)
369368
// You should call this function 2 times - the first time you pass langName as NULL to get the number of characters to copy.
370369
// You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGENAME function the 2nd time
371370
// by passing allocated buffer as argument langName
372371

373372
#define NPPM_GETLANGUAGEDESC (NPPMSG + 84)
374373
// INT NPPM_GETLANGUAGEDESC(int langType, TCHAR *langDesc)
375-
// Get programing language short description from the given language type (LangType)
374+
// Get programming language short description from the given language type (LangType)
376375
// Return value is the number of copied character / number of character to copy (\0 is not included)
377376
// You should call this function 2 times - the first time you pass langDesc as NULL to get the number of characters to copy.
378377
// You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time
@@ -389,7 +388,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
389388

390389
#define NPPM_GETAPPDATAPLUGINSALLOWED (NPPMSG + 87)
391390
// BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0)
392-
// Check to see if loading plugins from "%APPDATA%\Notepad++\plugins" is allowed.
391+
// Check to see if loading plugins from "%APPDATA%\..\Local\Notepad++\plugins" is allowed.
393392

394393
#define NPPM_GETCURRENTVIEW (NPPMSG + 88)
395394
// INT NPPM_GETCURRENTVIEW(0, 0)
@@ -419,6 +418,19 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
419418
#define NPPM_DISABLEAUTOUPDATE (NPPMSG + 95) // 2119 in decimal
420419
// VOID NPPM_DISABLEAUTOUPDATE(0, 0)
421420

421+
#define NPPM_REMOVESHORTCUTBYCMDID (NPPMSG + 96) // 2120 in decimal
422+
// BOOL NPPM_REMOVESHORTCUTASSIGNMENT(int cmdID)
423+
// removes the assigned shortcut mapped to cmdID
424+
// returned value : TRUE if function call is successful, otherwise FALSE
425+
426+
#define NPPM_GETPLUGINHOMEPATH (NPPMSG + 97)
427+
// INT NPPM_GETPLUGINHOMEPATH(size_t strLen, TCHAR *pluginRootPath)
428+
// Get plugin home root path. It's useful if plugins want to get its own path
429+
// by appending <pluginFolderName> which is the name of plugin without extension part.
430+
// Returns the number of TCHAR copied/to copy.
431+
// Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character),
432+
// allocate pluginRootPath buffer with the return value + 1, then call it again to get the path.
433+
422434
#define RUNCOMMAND_USER (WM_USER + 3000)
423435
#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
424436
#define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)
@@ -427,6 +439,7 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
427439
#define NPPM_GETEXTPART (RUNCOMMAND_USER + EXT_PART)
428440
#define NPPM_GETCURRENTWORD (RUNCOMMAND_USER + CURRENT_WORD)
429441
#define NPPM_GETNPPDIRECTORY (RUNCOMMAND_USER + NPP_DIRECTORY)
442+
#define NPPM_GETFILENAMEATCURSOR (RUNCOMMAND_USER + GETFILENAMEATCURSOR)
430443
// BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str)
431444
// where str is the allocated TCHAR array,
432445
// strLen is the allocated array size
@@ -440,6 +453,8 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
440453
// INT NPPM_GETCURRENTCOLUMN(0, 0)
441454
// return the caret current position column
442455

456+
#define NPPM_GETNPPFULLFILEPATH (RUNCOMMAND_USER + NPP_FULL_FILE_PATH)
457+
443458
#define VAR_NOT_RECOGNIZED 0
444459
#define FULL_CURRENT_PATH 1
445460
#define CURRENT_DIRECTORY 2
@@ -450,6 +465,8 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
450465
#define NPP_DIRECTORY 7
451466
#define CURRENT_LINE 8
452467
#define CURRENT_COLUMN 9
468+
#define NPP_FULL_FILE_PATH 10
469+
#define GETFILENAMEATCURSOR 11
453470

454471

455472
// Notification code
@@ -541,10 +558,10 @@ enum winVer{ WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, W
541558
//scnNotification->nmhdr.hwndFrom = bufferID;
542559
//scnNotification->nmhdr.idFrom = docStatus;
543560
// where bufferID is BufferID
544-
// docStatus can be combined by DOCSTAUS_READONLY and DOCSTAUS_BUFFERDIRTY
561+
// docStatus can be combined by DOCSTATUS_READONLY and DOCSTATUS_BUFFERDIRTY
545562

546-
#define DOCSTAUS_READONLY 1
547-
#define DOCSTAUS_BUFFERDIRTY 2
563+
#define DOCSTATUS_READONLY 1
564+
#define DOCSTATUS_BUFFERDIRTY 2
548565

549566
#define NPPN_DOCORDERCHANGED (NPPN_FIRST + 17) // To notify plugins that document order is changed
550567
//scnNotification->nmhdr.code = NPPN_DOCORDERCHANGED;

src/NppAPI/Sci_Position.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Scintilla source code edit control
2+
/** @file Sci_Position.h
3+
** Define the Sci_Position type used in Scintilla's external interfaces.
4+
** These need to be available to clients written in C so are not in a C++ namespace.
5+
**/
6+
// Copyright 2015 by Neil Hodgson <neilh@scintilla.org>
7+
// The License.txt file describes the conditions under which this software may be distributed.
8+
9+
#ifndef SCI_POSITION_H
10+
#define SCI_POSITION_H
11+
12+
#include <stddef.h>
13+
14+
// Basic signed type used throughout interface
15+
typedef ptrdiff_t Sci_Position;
16+
17+
// Unsigned variant used for ILexer::Lex and ILexer::Fold
18+
typedef size_t Sci_PositionU;
19+
20+
// For Sci_CharacterRange which is defined as long to be compatible with Win32 CHARRANGE
21+
typedef long Sci_PositionCR;
22+
23+
#ifdef _WIN32
24+
#define SCI_METHOD __stdcall
25+
#else
26+
#define SCI_METHOD
27+
#endif
28+
29+
#endif

0 commit comments

Comments
 (0)