Skip to content

Commit 4c34bfb

Browse files
authored
Npp 7.8 interface (#129)
* - updated n++ to v 7.7.1 with scintilla 4.2.0 - updated PlatformToolset to v141_xp * initially adapted and created interfaces n++ compile fixes * - added new notepad defines - added new scintilla notifications - added include of scintilla enums defines, open issue enum handling in methods - small first fixes for ScintillaWrapper.cpp - removed unused ScintillaWrapperGenerated.h * - replaced enums by int - corrected packages.config, VS projects for boost v141 * added new call NPPM_GETPLUGINHOMEPATH * added new N++ menu items * first adaptation of the python tests to reflected the changes from scintilla and N++, still open are 15 failing testcases which need to be checked * corrected typo in scintilla.iface * - fixed compiler warning (Link target) -> c:\projects\pythonscript\pythonscript\src\helpcontroller.cpp(29): warning C4706: assignment within conditional expression [C:\projects\pythonscript\PythonScript\project\PythonScript2010.vcxproj] - code formatting
1 parent c424611 commit 4c34bfb

39 files changed

+4408
-3578
lines changed

NppPlugin/include/Common.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ const bool dirDown = false;
6262
#define generic_sscanf swscanf
6363
#define generic_fopen _wfopen
6464
#define generic_fgets fgetws
65-
#define generic_stat _wstat
6665
#define COPYDATA_FILENAMES COPYDATA_FILENAMESW
66+
#define NPP_INTERNAL_FUCTION_STR TEXT("Notepad++::InternalFunction")
6767

6868
typedef std::basic_string<TCHAR> generic_string;
6969
typedef std::basic_stringstream<TCHAR> generic_stringstream;
@@ -126,7 +126,7 @@ class WcharMbcsConvertor final
126126
class StringBuffer final
127127
{
128128
public:
129-
~StringBuffer() { if(_allocLen) delete[] _str; }
129+
~StringBuffer() { if (_allocLen) delete[] _str; }
130130

131131
void sizeTo(size_t size)
132132
{
@@ -192,3 +192,10 @@ HWND CreateToolTip(int toolID, HWND hDlg, HINSTANCE hInst, const PTSTR pszText);
192192

193193
bool isCertificateValidated(const generic_string & fullFilePath, const generic_string & subjectName2check);
194194
bool isAssoCommandExisting(LPCTSTR FullPathName);
195+
196+
std::wstring s2ws(const std::string& str);
197+
std::string ws2s(const std::wstring& wstr);
198+
199+
bool deleteFileOrFolder(const generic_string& f2delete);
200+
201+
void getFilesInFolder(std::vector<generic_string>& files, const generic_string& extTypeFilter, const generic_string& inFolder);

NppPlugin/include/Notepad_plus_msgs.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 };
180180
//BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0)
181181

182182
#define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46)
183-
//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.
184188

185189
#define NPPM_MSGTOPLUGIN (NPPMSG + 47)
186190
//BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info)
@@ -384,7 +388,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 };
384388

385389
#define NPPM_GETAPPDATAPLUGINSALLOWED (NPPMSG + 87)
386390
// BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0)
387-
// 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.
388392

389393
#define NPPM_GETCURRENTVIEW (NPPMSG + 88)
390394
// INT NPPM_GETCURRENTVIEW(0, 0)
@@ -419,6 +423,14 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 };
419423
// removes the assigned shortcut mapped to cmdID
420424
// returned value : TRUE if function call is successful, otherwise FALSE
421425

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)

0 commit comments

Comments
 (0)