Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions NppPlugin/include/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ const bool dirDown = false;
#define generic_sscanf swscanf
#define generic_fopen _wfopen
#define generic_fgets fgetws
#define generic_stat _wstat
#define COPYDATA_FILENAMES COPYDATA_FILENAMESW
#define NPP_INTERNAL_FUCTION_STR TEXT("Notepad++::InternalFunction")

typedef std::basic_string<TCHAR> generic_string;
typedef std::basic_stringstream<TCHAR> generic_stringstream;
Expand Down Expand Up @@ -126,7 +126,7 @@ class WcharMbcsConvertor final
class StringBuffer final
{
public:
~StringBuffer() { if(_allocLen) delete[] _str; }
~StringBuffer() { if (_allocLen) delete[] _str; }

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

bool isCertificateValidated(const generic_string & fullFilePath, const generic_string & subjectName2check);
bool isAssoCommandExisting(LPCTSTR FullPathName);

std::wstring s2ws(const std::string& str);
std::string ws2s(const std::wstring& wstr);

bool deleteFileOrFolder(const generic_string& f2delete);

void getFilesInFolder(std::vector<generic_string>& files, const generic_string& extTypeFilter, const generic_string& inFolder);
16 changes: 14 additions & 2 deletions NppPlugin/include/Notepad_plus_msgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 };
//BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0)

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

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

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

#define NPPM_GETCURRENTVIEW (NPPMSG + 88)
// INT NPPM_GETCURRENTVIEW(0, 0)
Expand Down Expand Up @@ -419,6 +423,14 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 };
// removes the assigned shortcut mapped to cmdID
// returned 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 <pluginFolderName> 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.

#define RUNCOMMAND_USER (WM_USER + 3000)
#define NPPM_GETFULLCURRENTPATH (RUNCOMMAND_USER + FULL_CURRENT_PATH)
#define NPPM_GETCURRENTDIRECTORY (RUNCOMMAND_USER + CURRENT_DIRECTORY)
Expand Down
Loading