Remove ambiguous symbols (part 5)

Relace TCHAR, generic_string & TEXT("") par wchar_t, wstring & L"" respectively.
Follow up: 94af271

Close #15379
This commit is contained in:
Don Ho 2024-06-30 19:21:26 +02:00
parent 4d8ef955e2
commit 3c897f892a
10 changed files with 722 additions and 725 deletions

View File

@ -85,7 +85,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// return the number of opened files
#define NPPM_GETOPENFILENAMES (NPPMSG + 8)
// BOOL NPPM_GETOPENFILENAMES(TCHAR** fileNames, int nbFileNames)
// BOOL NPPM_GETOPENFILENAMES(wchar_t** 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.
@ -104,14 +104,14 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// return hDlg (HWND) on success, NULL on failure
#define NPPM_GETNBSESSIONFILES (NPPMSG + 13)
// int NPPM_GETNBSESSIONFILES (BOOL* pbIsValidXML, TCHAR* sessionFileName)
// int NPPM_GETNBSESSIONFILES (BOOL* pbIsValidXML, wchar_t* 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)
// NPPM_GETSESSIONFILES (wchar_t** sessionFileArray, wchar_t* 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
@ -119,9 +119,9 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
#define NPPM_SAVESESSION (NPPMSG + 15)
struct sessionInfo {
TCHAR* sessionFilePathName; // Full session file path name to be saved
wchar_t* 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
wchar_t** 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.
@ -131,7 +131,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// Returns sessionFileName on success, NULL otherwise
#define NPPM_SAVECURRENTSESSION (NPPMSG + 16)
// TCHAR* NPPM_SAVECURRENTSESSION(0, TCHAR* sessionFileName)
// wchar_t* NPPM_SAVECURRENTSESSION(0, wchar_t* 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
@ -139,14 +139,14 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
#define NPPM_GETOPENFILENAMESPRIMARY (NPPMSG + 17)
// BOOL NPPM_GETOPENFILENAMESPRIMARY(TCHAR** fileNames, int nbFileNames)
// BOOL NPPM_GETOPENFILENAMESPRIMARY(wchar_t** 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)
// BOOL NPPM_GETOPENFILENAMESSECOND(wchar_t** 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.
@ -189,7 +189,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
#define STATUSBAR_EOF_FORMAT 3
#define STATUSBAR_UNICODE_TYPE 4
#define STATUSBAR_TYPING_MODE 5
// BOOL NPPM_SETSTATUSBAR(int whichPart, TCHAR *str2set)
// BOOL NPPM_SETSTATUSBAR(int whichPart, wchar_t *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.
@ -234,7 +234,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// Return TRUE
#define NPPM_LAUNCHFINDINFILESDLG (NPPMSG + 29)
// BOOL NPPM_LAUNCHFINDINFILESDLG(TCHAR * dir2Search, TCHAR * filtre)
// BOOL NPPM_LAUNCHFINDINFILESDLG(wchar_t * dir2Search, wchar_t * 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
@ -271,28 +271,28 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// Return TRUE
#define NPPM_LOADSESSION (NPPMSG + 34)
// BOOL NPPM_LOADSESSION(0, TCHAR* sessionFileName)
// BOOL NPPM_LOADSESSION(0, wchar_t* 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)
// BOOL WM_DMM_VIEWOTHERTAB(0, TCHAR* name)
// BOOL WM_DMM_VIEWOTHERTAB(0, wchar_t* 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, wchar_t *filePathName2Reload)
// Reload the document which matches with the given filePathName2Reload.
// wParam: 0 (not used)
// lParam[in]: filePathName2Reload is the full file path of document to reload
// Return TRUE if reloading file succeeds, otherwise FALSE
#define NPPM_SWITCHTOFILE (NPPMSG + 37)
// BOOL NPPM_SWITCHTOFILE(0, TCHAR* filePathName2switch)
// BOOL NPPM_SWITCHTOFILE(0, wchar_t* 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
@ -340,7 +340,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// Return enum winVer, which is defined at the begining of this file
#define NPPM_DMMGETPLUGINHWNDBYNAME (NPPMSG + 43)
// HWND NPPM_DMMGETPLUGINHWNDBYNAME(const TCHAR *windowName, const TCHAR *moduleName)
// HWND NPPM_DMMGETPLUGINHWNDBYNAME(const wchar_t *windowName, const wchar_t *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
@ -361,22 +361,22 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// Return a proc address or NULL
#define NPPM_GETPLUGINSCONFIGDIR (NPPMSG + 46)
// int NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str)
// int NPPM_GETPLUGINSCONFIGDIR(int strLen, wchar_t *str)
// Get user's plugin config directory path. It's useful if plugins want to save/load parameters for the current user
// 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 1st call with "str" be NULL to get the required number of wchar_t (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.
// Return value: The 1st call - the number of wchar_t to copy.
// The 2nd call - FALSE on failure, TRUE on success
#define NPPM_MSGTOPLUGIN (NPPMSG + 47)
struct CommunicationInfo {
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).
const wchar_t * 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)
// BOOL NPPM_MSGTOPLUGIN(wchar_t *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")
@ -457,12 +457,12 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// 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)
// int NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, wchar_t* 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),
// lParam[out]: fullFilePath - User should call it with fullFilePath be NULL to get the number of wchar_t (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
// Return -1 if the bufferID non existing, otherwise the number of wchar_t copied/to copy
#define NPPM_GETBUFFERIDFROMPOS (NPPMSG + 59)
// UINT_PTR NPPM_GETBUFFERIDFROMPOS(int index, int iView)
@ -591,7 +591,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// 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)
// BOOL NPPM_DOOPEN(0, const wchar_t* 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)
@ -599,7 +599,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// The return value is TRUE if the operation is successful, otherwise FALSE
#define NPPM_SAVECURRENTFILEAS (NPPMSG + 78)
// BOOL NPPM_SAVECURRENTFILEAS (BOOL saveAsCopy, const TCHAR* filename)
// BOOL NPPM_SAVECURRENTFILEAS (BOOL saveAsCopy, const wchar_t* 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
@ -653,7 +653,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// 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(LangType langType, TCHAR* langName)
// int NPPM_GETLANGUAGENAME(LangType langType, wchar_t* 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
@ -664,7 +664,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// by passing allocated buffer as argument langName
#define NPPM_GETLANGUAGEDESC (NPPMSG + 84)
// INT NPPM_GETLANGUAGEDESC(int langType, TCHAR *langDesc)
// INT NPPM_GETLANGUAGEDESC(int langType, wchar_t *langDesc)
// 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
@ -745,7 +745,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// Return TRUE
#define NPPM_SAVEFILE (NPPMSG + 94)
// BOOL NPPM_SAVEFILE(0, const TCHAR *fileNameToSave)
// BOOL NPPM_SAVEFILE(0, const wchar_t *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.
@ -766,20 +766,20 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// return value: TRUE if function call is successful, otherwise FALSE
#define NPPM_GETPLUGINHOMEPATH (NPPMSG + 97)
// int NPPM_GETPLUGINHOMEPATH(size_t strLen, TCHAR* pluginRootPath)
// int NPPM_GETPLUGINHOMEPATH(size_t strLen, wchar_t* 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.
// 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),
// lParam[out]: pluginRootPath - Users should call it with pluginRootPath be NULL to get the required number of wchar_t (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
// Return the number of wchar_t 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, wchar_t *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),
// lParam[out]: settingsOnCloudPath - Users should call it with settingsOnCloudPath be NULL to get the required number of wchar_t (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.
// Returns the number of wchar_t 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.
#define NPPM_SETLINENUMBERWIDTHMODE (NPPMSG + 99)
#define LINENUMWIDTH_DYNAMIC 0
@ -812,7 +812,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// Return TRUE
#define NPPM_GETEXTERNALLEXERAUTOINDENTMODE (NPPMSG + 103)
// BOOL NPPM_GETEXTERNALLEXERAUTOINDENTMODE(const TCHAR* languageName, ExternalLexerAutoIndentMode* autoIndentMode)
// BOOL NPPM_GETEXTERNALLEXERAUTOINDENTMODE(const wchar_t* languageName, ExternalLexerAutoIndentMode* autoIndentMode)
// Get ExternalLexerAutoIndentMode for an installed external programming language.
// wParam[in]: languageName is external language name to search
// lParam[out]: autoIndentMode could recieve one of three following values
@ -822,7 +822,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// 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 wchar_t* languageName, ExternalLexerAutoIndentMode autoIndentMode)
// Set ExternalLexerAutoIndentMode for an installed external programming language.
// wParam[in]: languageName is external language name to set
// lParam[in]: autoIndentMode could recieve one of three following values
@ -887,17 +887,17 @@ 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, wchar_t *commandLineStr)
// Get the Current Command Line string.
// Users should call it with commandLineStr as NULL to get the required number of TCHAR (not including the terminating nul character),
// Users should call it with commandLineStr as NULL to get the required number of wchar_t (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
// Return the number of wchar_t copied/to copy
#define NPPM_CREATELEXER (NPPMSG + 110)
// void* NPPM_CREATELEXER(0, const TCHAR* lexer_name)
// void* NPPM_CREATELEXER(0, const wchar_t* 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
@ -974,7 +974,7 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
// Note: there's no symetric command NPPM_SETTABCOLORID. Plugins can use NPPM_MENUCOMMAND to set current tab color with the desired tab color ID.
#define NPPM_SETUNTITLEDNAME (NPPMSG + 115)
// int NPPM_SETUNTITLEDNAME(BufferID id, const TCHAR* newName)
// int NPPM_SETUNTITLEDNAME(BufferID id, const wchar_t* newName)
// Rename the tab name for an untitled tab.
// wParam[in]: id - BufferID of the tab. -1 for currently active tab
// lParam[in]: newName - the desired new name of the tab
@ -1007,11 +1007,11 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64, PF_ARM64 };
#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)
// BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, wchar_t *str)
// 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)
// lParam[out]: str is the allocated wchar_t array
// The return value is TRUE when get std::wstring operation success, otherwise FALSE (allocated array size is too small)
#define NPPM_GETCURRENTLINE (RUNCOMMAND_USER + CURRENT_LINE)

View File

@ -18,10 +18,8 @@
#include <shlwapi.h>
#include "Notepad_plus_Window.h"
const TCHAR Notepad_plus_Window::_className[32] = TEXT("Notepad++");
HWND Notepad_plus_Window::gNppHWND = NULL;
namespace // anonymous
{
@ -49,6 +47,7 @@ namespace // anonymous
} // anonymous namespace
using namespace std;
void Notepad_plus_Window::setStartupBgColor(COLORREF BgColor)
{
@ -61,7 +60,7 @@ void Notepad_plus_Window::setStartupBgColor(COLORREF BgColor)
void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLine, CmdLineParams *cmdLineParams)
void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const wchar_t *cmdLine, CmdLineParams *cmdLineParams)
{
Window::init(hInst, parent);
WNDCLASS nppClass{};
@ -97,7 +96,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
_hSelf = ::CreateWindowEx(
WS_EX_ACCEPTFILES | (_notepad_plus_plus_core._nativeLangSpeaker.isRTL() ? WS_EX_LAYOUTRTL : 0),
_className,
TEXT("Notepad++"),
L"Notepad++",
(WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN),
// CreateWindowEx bug : set all 0 to walk around the pb
0, 0, 0, 0,
@ -189,22 +188,22 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
{
HICON icon = nullptr;
loadTrayIcon(_hInst, &icon);
_notepad_plus_plus_core._pTrayIco = new trayIconControler(_hSelf, IDI_M30ICON, NPPM_INTERNAL_MINIMIZED_TRAY, icon, TEXT(""));
_notepad_plus_plus_core._pTrayIco = new trayIconControler(_hSelf, IDI_M30ICON, NPPM_INTERNAL_MINIMIZED_TRAY, icon, L"");
_notepad_plus_plus_core._pTrayIco->doTrayIcon(ADD);
}
if(cmdLineParams->isPointValid() && NppDarkMode::isEnabled())
setStartupBgColor(NppDarkMode::getBackgroundColor()); //draw dark background when opening Npp through cmd with position data
std::vector<generic_string> fileNames;
std::vector<generic_string> patterns;
patterns.push_back(TEXT("*.xml"));
std::vector<wstring> fileNames;
std::vector<wstring> patterns;
patterns.push_back(L"*.xml");
generic_string nppDir = nppParams.getNppPath();
wstring nppDir = nppParams.getNppPath();
LocalizationSwitcher & localizationSwitcher = nppParams.getLocalizationSwitcher();
std::wstring localizationDir = nppDir;
pathAppend(localizationDir, TEXT("localization\\"));
pathAppend(localizationDir, L"localization\\");
_notepad_plus_plus_core.getMatchedFileNames(localizationDir.c_str(), 0, patterns, fileNames, false, false);
for (size_t i = 0, len = fileNames.size(); i < len; ++i)
@ -216,10 +215,10 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
// Get themes from both npp install themes dir and app data themes dir with the per user
// overriding default themes of the same name.
generic_string appDataThemeDir = nppParams.isCloud() ? nppParams.getUserPath() : nppParams.getAppDataNppDir();
wstring appDataThemeDir = nppParams.isCloud() ? nppParams.getUserPath() : nppParams.getAppDataNppDir();
if (!appDataThemeDir.empty())
{
pathAppend(appDataThemeDir, TEXT("themes\\"));
pathAppend(appDataThemeDir, L"themes\\");
_notepad_plus_plus_core.getMatchedFileNames(appDataThemeDir.c_str(), 0, patterns, fileNames, false, false);
for (size_t i = 0, len = fileNames.size() ; i < len ; ++i)
{
@ -229,8 +228,8 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
fileNames.clear();
generic_string nppThemeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy
pathAppend(nppThemeDir, TEXT("themes\\"));
wstring nppThemeDir = nppDir.c_str(); // <- should use the pointer to avoid the constructor of copy
pathAppend(nppThemeDir, L"themes\\");
// Set theme directory to their installation directory
themeSwitcher.setThemeDirPath(nppThemeDir);
@ -238,21 +237,21 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
_notepad_plus_plus_core.getMatchedFileNames(nppThemeDir.c_str(), 0, patterns, fileNames, false, false);
for (size_t i = 0, len = fileNames.size(); i < len ; ++i)
{
generic_string themeName( themeSwitcher.getThemeFromXmlFileName(fileNames[i].c_str()) );
wstring themeName( themeSwitcher.getThemeFromXmlFileName(fileNames[i].c_str()) );
if (!themeSwitcher.themeNameExists(themeName.c_str()))
{
themeSwitcher.addThemeFromXml(fileNames[i]);
if (!appDataThemeDir.empty())
{
generic_string appDataThemePath = appDataThemeDir;
wstring appDataThemePath = appDataThemeDir;
if (!::PathFileExists(appDataThemePath.c_str()))
{
::CreateDirectory(appDataThemePath.c_str(), NULL);
}
TCHAR* fn = PathFindFileName(fileNames[i].c_str());
wchar_t* fn = PathFindFileName(fileNames[i].c_str());
pathAppend(appDataThemePath, fn);
themeSwitcher.addThemeStylerSavePath(fileNames[i], appDataThemePath);
}
@ -261,14 +260,14 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
if (NppDarkMode::isWindowsModeEnabled())
{
generic_string themePath;
generic_string xmlFileName = NppDarkMode::getThemeName();
wstring themePath;
wstring xmlFileName = NppDarkMode::getThemeName();
if (!xmlFileName.empty())
{
if (!nppParams.isLocal() || nppParams.isCloud())
{
themePath = nppParams.getUserPath();
pathAppend(themePath, TEXT("themes\\"));
pathAppend(themePath, L"themes\\");
pathAppend(themePath, xmlFileName);
}
@ -297,7 +296,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
::SendMessage(_hSelf, WM_COMMAND, _notepad_plus_plus_core._internalFuncIDs[i], 0);
std::chrono::steady_clock::duration cmdlineParamsLoadingTime{};
std::vector<generic_string> fns;
std::vector<wstring> fns;
if (cmdLine)
{
std::chrono::steady_clock::time_point cmdlineParamsLoadingStartTP = std::chrono::steady_clock::now();
@ -309,7 +308,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
// To avoid dockable panel toggle problem.
if (cmdLineParams->_openFoldersAsWorkspace)
{
generic_string emptyStr;
wstring emptyStr;
_notepad_plus_plus_core.launchFileBrowser(fns, emptyStr, true);
}
::SendMessage(_hSelf, WM_ACTIVATE, WA_ACTIVE, 0);
@ -349,7 +348,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
_userQuote = cmdLineParams->_easterEggName;
_quoteParams.reset();
_quoteParams._quote = _userQuote.c_str();
_quoteParams._quoter = TEXT("Anonymous #999");
_quoteParams._quoter = L"Anonymous #999";
_quoteParams._shouldBeTrolling = false;
_quoteParams._lang = cmdLineParams->_langType;
if (cmdLineParams->_ghostTypingSpeed == 1)
@ -372,7 +371,7 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin
{
_quoteParams.reset();
_quoteParams._quote = _userQuote.c_str();
_quoteParams._quoter = TEXT("Anonymous #999");
_quoteParams._quoter = L"Anonymous #999";
_quoteParams._shouldBeTrolling = false;
_quoteParams._lang = cmdLineParams->_langType;
if (cmdLineParams->_ghostTypingSpeed == 1)

View File

@ -18,7 +18,7 @@
constexpr int splitterSize = 8;
const TCHAR COMMAND_ARG_HELP[] = TEXT("Usage :\r\
const wchar_t COMMAND_ARG_HELP[] = L"Usage :\r\
\r\
notepad++ [--help] [-multiInst] [-noPlugin] [-lLanguage] [-udl=\"My UDL Name\"] [-LlangCode] [-nLineNumber] [-cColumnNumber] [-pPosition] [-xLeftPos] [-yTopPos] [-monitor] [-nosession] [-notabbar] [-ro] [-systemtray] [-loadingTime] [-alwaysOnTop] [-openSession] [-r] [-qn=\"Easter egg name\" | -qt=\"a text to display.\" | -qf=\"D:\\my quote.txt\"] [-qSpeed1|2|3] [-quickPrint] [-settingsDir=\"d:\\your settings dir\\\"] [-openFoldersAsWorkspace] [-titleAdd=\"additional title bar text\"][filePath]\r\
\r\
@ -52,13 +52,13 @@ notepad++ [--help] [-multiInst] [-noPlugin] [-lLanguage] [-udl=\"My UDL Name\"]
-openFoldersAsWorkspace: open filePath of folder(s) as workspace\r\
-titleAdd=\"string\": add string to Notepad++ title bar\r\
filePath : file or folder name to open (absolute or relative path name)\r\
");
";
class Notepad_plus_Window : public Window
{
public:
void init(HINSTANCE, HWND, const TCHAR *cmdLine, CmdLineParams *cmdLineParams);
void init(HINSTANCE, HWND, const wchar_t *cmdLine, CmdLineParams *cmdLineParams);
bool isDlgsMsg(MSG *msg) const;
@ -66,7 +66,7 @@ public:
return _notepad_plus_plus_core.getAccTable();
};
bool emergency(const generic_string& emergencySavedDir) {
bool emergency(const std::wstring& emergencySavedDir) {
return _notepad_plus_plus_core.emergency(emergencySavedDir);
};
@ -78,7 +78,7 @@ public:
_isPrelaunch = val;
};
generic_string getPluginListVerStr() const {
std::wstring getPluginListVerStr() const {
return _notepad_plus_plus_core.getPluginListVerStr();
};
@ -88,7 +88,7 @@ public:
::DestroyWindow(_hSelf);
};
static const TCHAR * getClassName() {
static const wchar_t * getClassName() {
return _className;
};
@ -109,7 +109,7 @@ private:
static LRESULT CALLBACK Notepad_plus_Proc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
LRESULT runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam);
static const TCHAR _className[32];
static constexpr wchar_t _className[32] = L"Notepad++";
bool _isPrelaunch = false;
bool _disablePluginsManager = false;

View File

@ -69,11 +69,11 @@ bool SetOSAppRestart()
bool bRet = false;
bool bUnregister = nppParam.isRegForOSAppRestartDisabled();
generic_string nppIssueLog;
wstring nppIssueLog;
if (nppParam.doNppLogNulContentCorruptionIssue())
{
generic_string issueFn = nppLogNulContentCorruptionIssue;
issueFn += TEXT(".log");
wstring issueFn = nppLogNulContentCorruptionIssue;
issueFn += L".log";
nppIssueLog = nppParam.getUserPath();
pathAppend(nppIssueLog, issueFn);
}
@ -244,7 +244,7 @@ LRESULT Notepad_plus_Window::runProc(HWND hwnd, UINT message, WPARAM wParam, LPA
}
// Used by NPPM_GETFILENAMEATCURSOR
int CharacterIs(TCHAR c, const TCHAR *any)
int CharacterIs(wchar_t c, const wchar_t *any)
{
int i;
for (i = 0; any[i] != 0; i++)
@ -392,29 +392,29 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case WM_REMOVE_USERLANG:
{
TCHAR *userLangName = reinterpret_cast<TCHAR *>(lParam);
wchar_t *userLangName = reinterpret_cast<wchar_t *>(lParam);
if (!userLangName || !userLangName[0])
return FALSE;
generic_string name{userLangName};
wstring name{userLangName};
//loop through buffers and reset the language (L_USER, TEXT("")) if (L_USER, name)
//loop through buffers and reset the language (L_USER, L"")) if (L_USER, name)
for (size_t i = 0; i < MainFileManager.getNbBuffers(); ++i)
{
Buffer* buf = MainFileManager.getBufferByIndex(i);
if (buf->getLangType() == L_USER && name == buf->getUserDefineLangName())
buf->setLangType(L_USER, TEXT(""));
buf->setLangType(L_USER, L"");
}
return TRUE;
}
case WM_RENAME_USERLANG:
{
if (!lParam || !((reinterpret_cast<TCHAR *>(lParam))[0]) || !wParam || !((reinterpret_cast<TCHAR *>(wParam))[0]))
if (!lParam || !((reinterpret_cast<wchar_t *>(lParam))[0]) || !wParam || !((reinterpret_cast<wchar_t *>(wParam))[0]))
return FALSE;
generic_string oldName{ reinterpret_cast<TCHAR *>(lParam) };
generic_string newName{ reinterpret_cast<TCHAR *>(wParam) };
wstring oldName{ reinterpret_cast<wchar_t *>(lParam) };
wstring newName{ reinterpret_cast<wchar_t *>(wParam) };
//loop through buffers and reset the language (L_USER, newName) if (L_USER, oldName)
for (size_t i = 0; i < MainFileManager.getNbBuffers(); ++i)
@ -487,7 +487,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
// Find in files function code should be here due to the number of parameters (2) cannot be passed via WM_COMMAND
constexpr int strSize = FINDREPLACE_MAXLENGTH;
TCHAR str[strSize]{};
wchar_t str[strSize]{};
bool isFirstTime = !_findReplaceDlg.isCreated();
_findReplaceDlg.doDialog(FIND_DLG, _nativeLangSpeaker.isRTL());
@ -502,7 +502,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (isFirstTime)
_nativeLangSpeaker.changeFindReplaceDlgLang(_findReplaceDlg);
_findReplaceDlg.launchFindInFilesDlg();
setFindReplaceFolderFilter(reinterpret_cast<const TCHAR*>(wParam), reinterpret_cast<const TCHAR*>(lParam));
setFindReplaceFolderFilter(reinterpret_cast<const wchar_t*>(wParam), reinterpret_cast<const wchar_t*>(lParam));
return TRUE;
}
@ -510,7 +510,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_INTERNAL_FINDINPROJECTS:
{
constexpr int strSize = FINDREPLACE_MAXLENGTH;
TCHAR str[strSize]{};
wchar_t str[strSize]{};
bool isFirstTime = not _findReplaceDlg.isCreated();
_findReplaceDlg.doDialog(FIND_DLG, _nativeLangSpeaker.isRTL());
@ -527,7 +527,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_INTERNAL_FINDINFINDERDLG:
{
constexpr int strSize = FINDREPLACE_MAXLENGTH;
TCHAR str[strSize]{};
wchar_t str[strSize]{};
Finder *launcher = reinterpret_cast<Finder *>(wParam);
bool isFirstTime = !_findInFinderDlg.isCreated();
@ -547,7 +547,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_DOOPEN:
case WM_DOOPEN:
{
BufferID id = doOpen(reinterpret_cast<const TCHAR *>(lParam));
BufferID id = doOpen(reinterpret_cast<const wchar_t *>(lParam));
if (id != BUFFER_INVALID)
return switchToFile(id);
break;
@ -656,8 +656,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_RELOADFILE:
{
TCHAR longNameFullpath[MAX_PATH]{};
const TCHAR* pFilePath = reinterpret_cast<const TCHAR*>(lParam);
wchar_t longNameFullpath[MAX_PATH]{};
const wchar_t* pFilePath = reinterpret_cast<const wchar_t*>(lParam);
wcscpy_s(longNameFullpath, MAX_PATH, pFilePath);
if (wcschr(longNameFullpath, '~'))
{
@ -673,7 +673,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_SWITCHTOFILE :
{
BufferID id = MainFileManager.getBufferFromName(reinterpret_cast<const TCHAR *>(lParam));
BufferID id = MainFileManager.getBufferFromName(reinterpret_cast<const wchar_t *>(lParam));
if (id != BUFFER_INVALID)
return switchToFile(id);
return false;
@ -688,7 +688,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
BufferID currentBufferID = _pEditView->getCurrentBufferID();
bool asCopy = wParam == TRUE;
const TCHAR *filename = reinterpret_cast<const TCHAR *>(lParam);
const wchar_t *filename = reinterpret_cast<const wchar_t *>(lParam);
if (!filename) return FALSE;
return doSave(currentBufferID, filename, asCopy);
}
@ -700,7 +700,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_SAVEFILE:
{
return fileSaveSpecific(reinterpret_cast<const TCHAR *>(lParam));
return fileSaveSpecific(reinterpret_cast<const wchar_t *>(lParam));
}
case NPPM_GETCURRENTNATIVELANGENCODING:
@ -821,7 +821,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (sizeof(CmdLineParamsDTO) == cmdLineParamsSize) // make sure the structure is the same
{
nppParam.setCmdlineParam(*cmdLineParam);
generic_string pluginMessage { nppParam.getCmdLineParams()._pluginMessage };
wstring pluginMessage { nppParam.getCmdLineParams()._pluginMessage };
if (!pluginMessage.empty())
{
SCNotification scnN{};
@ -834,7 +834,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
else
{
#ifdef DEBUG
printStr(TEXT("sizeof(CmdLineParams) != cmdLineParamsSize\rCmdLineParams is formed by an instance of another version,\rwhereas your CmdLineParams has been modified in this instance."));
printStr(L"sizeof(CmdLineParams) != cmdLineParamsSize\rCmdLineParams is formed by an instance of another version,\rwhereas your CmdLineParams has been modified in this instance.");
#endif
}
@ -952,10 +952,10 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETNAMEPART:
case NPPM_GETEXTPART:
{
TCHAR str[MAX_PATH] = { '\0' };
wchar_t str[MAX_PATH] = { '\0' };
// par defaut : NPPM_GETCURRENTDIRECTORY
wcscpy_s(str, _pEditView->getCurrentBuffer()->getFullPathName());
TCHAR* fileStr = str;
wchar_t* fileStr = str;
if (message == NPPM_GETCURRENTDIRECTORY)
PathRemoveFileSpec(str);
@ -969,8 +969,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
else if (message == NPPM_GETEXTPART)
fileStr = PathFindExtension(str);
// For the compability reason, if wParam is 0, then we assume the size of generic_string buffer (lParam) is large enough.
// otherwise we check if the generic_string buffer size is enough for the generic_string to copy.
// For the compability reason, if wParam is 0, then we assume the size of wstring buffer (lParam) is large enough.
// otherwise we check if the wstring buffer size is enough for the wstring to copy.
if (wParam != 0)
{
if (lstrlen(fileStr) >= int(wParam))
@ -979,7 +979,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
}
}
lstrcpy(reinterpret_cast<TCHAR *>(lParam), fileStr);
lstrcpy(reinterpret_cast<wchar_t *>(lParam), fileStr);
return TRUE;
}
@ -987,16 +987,16 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETCURRENTLINESTR:
{
const int strSize = CURRENTWORD_MAXLENGTH;
TCHAR str[strSize] = { '\0' };
TCHAR *pTchar = reinterpret_cast<TCHAR *>(lParam);
wchar_t str[strSize] = { '\0' };
wchar_t *pTchar = reinterpret_cast<wchar_t *>(lParam);
if (message == NPPM_GETCURRENTWORD)
_pEditView->getGenericSelectedText(str, strSize);
else if (message == NPPM_GETCURRENTLINESTR)
_pEditView->getLine(_pEditView->getCurrentLineNumber(), str, strSize);
// For the compability reason, if wParam is 0, then we assume the size of generic_string buffer (lParam) is large enough.
// otherwise we check if the generic_string buffer size is enough for the generic_string to copy.
// For the compability reason, if wParam is 0, then we assume the size of wstring buffer (lParam) is large enough.
// otherwise we check if the wstring buffer size is enough for the wstring to copy.
if (wParam != 0)
{
if (lstrlen(str) >= int(wParam)) //buffer too small
@ -1014,16 +1014,16 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
return TRUE;
}
case NPPM_GETFILENAMEATCURSOR: // wParam = buffer length, lParam = (TCHAR*)buffer
case NPPM_GETFILENAMEATCURSOR: // wParam = buffer length, lParam = (wchar_t*)buffer
{
constexpr int strSize = CURRENTWORD_MAXLENGTH;
TCHAR str[strSize]{};
wchar_t str[strSize]{};
int hasSlash = 0;
_pEditView->getGenericSelectedText(str, strSize); // this is either the selected text, or the word under the cursor if there is no selection
hasSlash = FALSE;
for (int i = 0; str[i] != 0; i++)
if (CharacterIs(str[i], TEXT("\\/")))
if (CharacterIs(str[i], L"\\/"))
hasSlash = TRUE;
if (hasSlash == FALSE)
@ -1031,8 +1031,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
// it's not a full file name so try to find the beginning and ending of it
intptr_t start = 0;
intptr_t end = 0;
const TCHAR *delimiters;
TCHAR strLine[strSize]{};
const wchar_t *delimiters;
wchar_t strLine[strSize]{};
size_t lineNumber = 0;
intptr_t col = 0;
@ -1042,7 +1042,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
// find the start
start = col;
delimiters = TEXT(" \t[(\"<>");
delimiters = L" \t[(\"<>";
while ((start > 0) && (CharacterIs(strLine[start], delimiters) == FALSE))
start--;
@ -1050,7 +1050,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
// find the end
end = col;
delimiters = TEXT(" \t:()[]<>\"\r\n");
delimiters = L" \t:()[]<>\"\r\n";
while ((strLine[end] != 0) && (CharacterIs(strLine[end], delimiters) == FALSE)) end++;
lstrcpyn(str, &strLine[start], static_cast<int>(end - start + 1));
@ -1062,7 +1062,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
}
else //buffer large enough, perform safe copy
{
TCHAR* pTchar = reinterpret_cast<TCHAR*>(lParam);
wchar_t* pTchar = reinterpret_cast<wchar_t*>(lParam);
lstrcpyn(pTchar, str, static_cast<int32_t>(wParam));
return TRUE;
}
@ -1072,15 +1072,15 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETNPPDIRECTORY:
{
constexpr int strSize = MAX_PATH;
TCHAR str[strSize]{};
wchar_t str[strSize]{};
::GetModuleFileName(NULL, str, strSize);
if (message == NPPM_GETNPPDIRECTORY)
PathRemoveFileSpec(str);
// For the compability reason, if wParam is 0, then we assume the size of generic_string buffer (lParam) is large enough.
// otherwise we check if the generic_string buffer size is enough for the generic_string to copy.
// For the compability reason, if wParam is 0, then we assume the size of wstring buffer (lParam) is large enough.
// otherwise we check if the wstring buffer size is enough for the wstring to copy.
if (wParam != 0)
{
if (lstrlen(str) >= int(wParam))
@ -1089,7 +1089,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
}
}
lstrcpy(reinterpret_cast<TCHAR *>(lParam), str);
lstrcpy(reinterpret_cast<wchar_t *>(lParam), str);
return TRUE;
}
@ -1148,7 +1148,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (!wParam)
return 0;
TCHAR** fileNames = reinterpret_cast<TCHAR**>(wParam);
wchar_t** fileNames = reinterpret_cast<wchar_t**>(wParam);
size_t nbFileNames = static_cast<size_t>(lParam);
size_t j = 0;
@ -1250,7 +1250,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETNBSESSIONFILES:
{
size_t nbSessionFiles = 0;
const TCHAR* sessionFileName = reinterpret_cast<const TCHAR*>(lParam);
const wchar_t* sessionFileName = reinterpret_cast<const wchar_t*>(lParam);
BOOL* pbIsValidXML = reinterpret_cast<BOOL*>(wParam);
if (pbIsValidXML)
*pbIsValidXML = false;
@ -1269,8 +1269,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETSESSIONFILES:
{
const TCHAR *sessionFileName = reinterpret_cast<const TCHAR *>(lParam);
TCHAR **sessionFileArray = reinterpret_cast<TCHAR **>(wParam);
const wchar_t *sessionFileName = reinterpret_cast<const wchar_t *>(lParam);
wchar_t **sessionFileArray = reinterpret_cast<wchar_t **>(wParam);
if ((!sessionFileName) || (sessionFileName[0] == '\0'))
return FALSE;
@ -1281,13 +1281,13 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
size_t i = 0;
for ( ; i < session2Load.nbMainFiles() ; )
{
const TCHAR *pFn = session2Load._mainViewFiles[i]._fileName.c_str();
const wchar_t *pFn = session2Load._mainViewFiles[i]._fileName.c_str();
lstrcpy(sessionFileArray[i++], pFn);
}
for (size_t j = 0, len = session2Load.nbSubFiles(); j < len ; ++j)
{
const TCHAR *pFn = session2Load._subViewFiles[j]._fileName.c_str();
const wchar_t *pFn = session2Load._subViewFiles[j]._fileName.c_str();
lstrcpy(sessionFileArray[i++], pFn);
}
return TRUE;
@ -1432,9 +1432,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
// 13.6.6.6 | 13 | 666
case NPPM_GETNPPVERSION:
{
const TCHAR* verStr = VERSION_INTERNAL_VALUE;
TCHAR mainVerStr[16]{};
TCHAR auxVerStr[16]{};
const wchar_t* verStr = VERSION_INTERNAL_VALUE;
wchar_t mainVerStr[16]{};
wchar_t auxVerStr[16]{};
bool isDot = false;
int j = 0;
int k = 0;
@ -1503,7 +1503,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETCURRENTCMDLINE:
{
generic_string cmdLineString = nppParam.getCmdLineString();
wstring cmdLineString = nppParam.getCmdLineString();
if (lParam != 0)
{
@ -1511,7 +1511,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
return 0;
}
lstrcpy(reinterpret_cast<TCHAR*>(lParam), cmdLineString.c_str());
lstrcpy(reinterpret_cast<wchar_t*>(lParam), cmdLineString.c_str());
}
return cmdLineString.length();
}
@ -1519,7 +1519,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_CREATELEXER:
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
const char* lexer_name = wmc.wchar2char(reinterpret_cast<TCHAR*>(lParam), CP_ACP);
const char* lexer_name = wmc.wchar2char(reinterpret_cast<wchar_t*>(lParam), CP_ACP);
return (LRESULT) CreateLexer(lexer_name);
}
@ -1659,7 +1659,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_SETSTATUSBAR:
{
TCHAR *str2set = reinterpret_cast<TCHAR *>(lParam);
wchar_t *str2set = reinterpret_cast<wchar_t *>(lParam);
if (!str2set || !str2set[0])
return FALSE;
@ -1690,13 +1690,13 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_LOADSESSION:
{
fileLoadSession(reinterpret_cast<const TCHAR *>(lParam));
fileLoadSession(reinterpret_cast<const wchar_t *>(lParam));
return TRUE;
}
case NPPM_SAVECURRENTSESSION:
{
return (LRESULT)fileSaveSession(0, NULL, reinterpret_cast<const TCHAR *>(lParam));
return (LRESULT)fileSaveSession(0, NULL, reinterpret_cast<const wchar_t *>(lParam));
}
case NPPM_SAVESESSION:
@ -2240,7 +2240,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETFULLPATHFROMBUFFERID:
{
return MainFileManager.getFileNameFromBuffer(reinterpret_cast<BufferID>(wParam), reinterpret_cast<TCHAR *>(lParam));
return MainFileManager.getFileNameFromBuffer(reinterpret_cast<BufferID>(wParam), reinterpret_cast<wchar_t *>(lParam));
}
case NPPM_INTERNAL_ENABLECHECKDOCOPT:
@ -2393,8 +2393,8 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
int answer = _nativeLangSpeaker.messageBox("WindowsSessionExit",
_pPublicInterface->getHSelf(),
TEXT("Windows session is about to be terminated but you have some data unsaved. Do you want to exit Notepad++ now?"),
TEXT("Notepad++ - Windows session exit"),
L"Windows session is about to be terminated but you have some data unsaved. Do you want to exit Notepad++ now?",
L"Notepad++ - Windows session exit",
MB_YESNO | MB_ICONQUESTION | MB_APPLMODAL);
if (answer == IDYES)
::PostMessage(_pPublicInterface->getHSelf(), WM_CLOSE, 0, 0);
@ -2464,9 +2464,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (nppParam.doNppLogNulContentCorruptionIssue())
{
generic_string issueFn = nppLogNulContentCorruptionIssue;
issueFn += TEXT(".log");
generic_string nppIssueLog = nppParam.getUserPath();
wstring issueFn = nppLogNulContentCorruptionIssue;
issueFn += L".log";
wstring nppIssueLog = nppParam.getUserPath();
pathAppend(nppIssueLog, issueFn);
string wmqesType = std::to_string(lParam);
@ -2570,9 +2570,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (nppParam.doNppLogNulContentCorruptionIssue())
{
generic_string issueFn = nppLogNulContentCorruptionIssue;
issueFn += TEXT(".log");
generic_string nppIssueLog = nppParam.getUserPath();
wstring issueFn = nppLogNulContentCorruptionIssue;
issueFn += L".log";
wstring nppIssueLog = nppParam.getUserPath();
pathAppend(nppIssueLog, issueFn);
writeLog(nppIssueLog.c_str(), strLog.c_str());
}
@ -2591,9 +2591,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (nppParam.doNppLogNulContentCorruptionIssue())
{
generic_string issueFn = nppLogNulContentCorruptionIssue;
issueFn += TEXT(".log");
generic_string nppIssueLog = nppParam.getUserPath();
wstring issueFn = nppLogNulContentCorruptionIssue;
issueFn += L".log";
wstring nppIssueLog = nppParam.getUserPath();
pathAppend(nppIssueLog, issueFn);
string wmesType = std::to_string(lParam);
@ -2646,9 +2646,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
if (nppParam.doNppLogNulContentCorruptionIssue() && nppParam.isEndSessionStarted() && (message == WM_CLOSE))
{
generic_string issueFn = nppLogNulContentCorruptionIssue;
issueFn += TEXT(".log");
generic_string nppIssueLog = nppParam.getUserPath();
wstring issueFn = nppLogNulContentCorruptionIssue;
issueFn += L".log";
wstring nppIssueLog = nppParam.getUserPath();
pathAppend(nppIssueLog, issueFn);
writeLog(nppIssueLog.c_str(), "WM_CLOSE (isEndSessionStarted == true)");
}
@ -2761,21 +2761,21 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
//
// saving session.xml into loaded session if a saved session is loaded and saveLoadedSessionOnExit option is enabled
//
generic_string loadedSessionFilePath = nppParam.getLoadedSessionFilePath();
wstring loadedSessionFilePath = nppParam.getLoadedSessionFilePath();
if (!loadedSessionFilePath.empty() && PathFileExists(loadedSessionFilePath.c_str()))
nppParam.writeSession(currentSession, loadedSessionFilePath.c_str());
}
// write settings on cloud if enabled, if the settings files don't exist
if (nppgui._cloudPath != TEXT("") && nppParam.isCloudPathChanged())
if (!nppgui._cloudPath.empty() && nppParam.isCloudPathChanged())
{
bool isOK = nppParam.writeSettingsFilesOnCloudForThe1stTime(nppgui._cloudPath);
if (!isOK)
{
_nativeLangSpeaker.messageBox("SettingsOnCloudError",
hwnd,
TEXT("It seems the path of settings on cloud is set on a read only drive,\ror on a folder needed privilege right for writing access.\rYour settings on cloud will be canceled. Please reset a coherent value via Preference dialog."),
TEXT("Settings on Cloud"),
L"It seems the path of settings on cloud is set on a read only drive,\ror on a folder needed privilege right for writing access.\rYour settings on cloud will be canceled. Please reset a coherent value via Preference dialog.",
L"Settings on Cloud",
MB_OK | MB_APPLMODAL);
nppParam.removeCloudChoice();
}
@ -2789,7 +2789,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (!nppParam.isEndSessionCritical())
{
generic_string updaterFullPath = nppParam.getWingupFullPath();
wstring updaterFullPath = nppParam.getWingupFullPath();
if (!updaterFullPath.empty())
{
Process updater(updaterFullPath.c_str(), nppParam.getWingupParams().c_str(), nppParam.getWingupDir().c_str());
@ -2805,9 +2805,9 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
if (nppParam.isEndSessionStarted() && nppParam.doNppLogNulContentCorruptionIssue())
{
generic_string issueFn = nppLogNulContentCorruptionIssue;
issueFn += TEXT(".log");
generic_string nppIssueLog = nppParam.getUserPath();
wstring issueFn = nppLogNulContentCorruptionIssue;
issueFn += L".log";
wstring nppIssueLog = nppParam.getUserPath();
pathAppend(nppIssueLog, issueFn);
writeLog(nppIssueLog.c_str(), "WM_DESTROY (isEndSessionStarted == true)");
}
@ -2839,7 +2839,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
HICON icon = nullptr;
Notepad_plus_Window::loadTrayIcon(_pPublicInterface->getHinst(), &icon);
_pTrayIco = new trayIconControler(hwnd, IDI_M30ICON, NPPM_INTERNAL_MINIMIZED_TRAY, icon, TEXT(""));
_pTrayIco = new trayIconControler(hwnd, IDI_M30ICON, NPPM_INTERNAL_MINIMIZED_TRAY, icon, L"");
}
_pTrayIco->doTrayIcon(ADD);
@ -2943,17 +2943,17 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_DMMVIEWOTHERTAB:
{
_dockingManager.showDockableDlg(reinterpret_cast<TCHAR *>(lParam), SW_SHOW);
_dockingManager.showDockableDlg(reinterpret_cast<wchar_t *>(lParam), SW_SHOW);
return TRUE;
}
case NPPM_DMMGETPLUGINHWNDBYNAME : //(const TCHAR *windowName, const TCHAR *moduleName)
case NPPM_DMMGETPLUGINHWNDBYNAME : //(const wchar_t *windowName, const wchar_t *moduleName)
{
if (!lParam)
return static_cast<LRESULT>(NULL);
TCHAR *moduleName = reinterpret_cast<TCHAR *>(lParam);
TCHAR *windowName = reinterpret_cast<TCHAR *>(wParam);
wchar_t *moduleName = reinterpret_cast<wchar_t *>(lParam);
wchar_t *windowName = reinterpret_cast<wchar_t *>(wParam);
std::vector<DockingCont *> dockContainer = _dockingManager.getContainerInfo();
for (size_t i = 0, len = dockContainer.size(); i < len ; ++i)
@ -3011,14 +3011,14 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETPLUGINSCONFIGDIR:
{
generic_string userPluginConfDir = nppParam.getUserPluginConfDir();
wstring userPluginConfDir = nppParam.getUserPluginConfDir();
if (lParam != 0)
{
if (userPluginConfDir.length() >= static_cast<size_t>(wParam))
{
return 0;
}
lstrcpy(reinterpret_cast<TCHAR *>(lParam), userPluginConfDir.c_str());
lstrcpy(reinterpret_cast<wchar_t *>(lParam), userPluginConfDir.c_str());
// For the retro-compatibility
return TRUE;
@ -3028,14 +3028,14 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETPLUGINHOMEPATH:
{
generic_string pluginHomePath = nppParam.getPluginRootDir();
wstring pluginHomePath = nppParam.getPluginRootDir();
if (lParam != 0)
{
if (pluginHomePath.length() >= static_cast<size_t>(wParam))
{
return 0;
}
lstrcpy(reinterpret_cast<TCHAR *>(lParam), pluginHomePath.c_str());
lstrcpy(reinterpret_cast<wchar_t *>(lParam), pluginHomePath.c_str());
}
return pluginHomePath.length();
}
@ -3043,14 +3043,14 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETSETTINGSONCLOUDPATH:
{
const NppGUI & nppGUI = nppParam.getNppGUI();
generic_string settingsOnCloudPath = nppGUI._cloudPath;
wstring settingsOnCloudPath = nppGUI._cloudPath;
if (lParam != 0)
{
if (settingsOnCloudPath.length() >= static_cast<size_t>(wParam))
{
return 0;
}
lstrcpy(reinterpret_cast<TCHAR *>(lParam), settingsOnCloudPath.c_str());
lstrcpy(reinterpret_cast<wchar_t *>(lParam), settingsOnCloudPath.c_str());
}
return settingsOnCloudPath.length();
}
@ -3358,7 +3358,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
command(IDM_LANGSTYLE_CONFIG_DLG);
// go into the section we need
_configStyleDlg.goToSection(TEXT("Global Styles:EOL custom color"));
_configStyleDlg.goToSection(L"Global Styles:EOL custom color");
return TRUE;
}
@ -3369,7 +3369,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
command(IDM_LANGSTYLE_CONFIG_DLG);
// go into the section we need
generic_string npcStr = L"Global Styles:";
wstring npcStr = L"Global Styles:";
npcStr += g_npcStyleName;
_configStyleDlg.goToSection(npcStr.c_str());
@ -3389,7 +3389,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_INTERNAL_DISABLEAUTOUPDATE:
{
//printStr(TEXT("you've got me"));
//printStr(L"you've got me"));
NppGUI & nppGUI = nppParam.getNppGUI();
nppGUI._autoUpdateOpt._doAutoUpdate = false;
return TRUE;
@ -3397,7 +3397,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETLANGUAGENAME:
{
generic_string langName = getLangDesc((LangType)wParam, true);
wstring langName = getLangDesc((LangType)wParam, true);
if (lParam)
lstrcpy((LPTSTR)lParam, langName.c_str());
return langName.length();
@ -3405,7 +3405,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETLANGUAGEDESC:
{
generic_string langDesc = getLangDesc((LangType)wParam, false);
wstring langDesc = getLangDesc((LangType)wParam, false);
if (lParam)
lstrcpy((LPTSTR)lParam, langDesc.c_str());
return langDesc.length();
@ -3413,7 +3413,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_GETEXTERNALLEXERAUTOINDENTMODE:
{
int index = nppParam.getExternalLangIndexFromName(reinterpret_cast<TCHAR*>(wParam));
int index = nppParam.getExternalLangIndexFromName(reinterpret_cast<wchar_t*>(wParam));
if (index < 0)
return FALSE;
@ -3423,7 +3423,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_SETEXTERNALLEXERAUTOINDENTMODE:
{
int index = nppParam.getExternalLangIndexFromName(reinterpret_cast<TCHAR*>(wParam));
int index = nppParam.getExternalLangIndexFromName(reinterpret_cast<wchar_t*>(wParam));
if (index < 0)
return FALSE;
@ -3533,7 +3533,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
// if doLocal - not allowed. Otherwise - allowed.
case NPPM_GETAPPDATAPLUGINSALLOWED:
{
const TCHAR *appDataNpp = nppParam.getAppDataNppDir();
const wchar_t *appDataNpp = nppParam.getAppDataNppDir();
if (appDataNpp[0]) // if not doLocal
{
return TRUE;
@ -3564,7 +3564,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
ScintillaViewParams &svp = const_cast<ScintillaViewParams &>(nppParam.getSVP());
COLORREF multiEdgeColor = liteGrey;
const Style * pStyle = NppParameters::getInstance().getMiscStylerArray().findByName(TEXT("Edge colour"));
const Style * pStyle = NppParameters::getInstance().getMiscStylerArray().findByName(L"Edge colour");
if (pStyle)
{
multiEdgeColor = pStyle->_fgColor;
@ -3722,7 +3722,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
case NPPM_INTERNAL_REFRESHWORKDIR:
{
const Buffer* buf = _pEditView->getCurrentBuffer();
generic_string path = buf ? buf->getFullPathName() : _T("");
wstring path = buf ? buf->getFullPathName() : L"";
PathRemoveFileSpec(path);
setWorkingDir(path.c_str());
return TRUE;

File diff suppressed because it is too large Load Diff

View File

@ -43,13 +43,13 @@ enum DIALOG_TYPE {FIND_DLG, REPLACE_DLG, FINDINFILES_DLG, FINDINPROJECTS_DLG, MA
enum InWhat{ALL_OPEN_DOCS, FILES_IN_DIR, CURRENT_DOC, CURR_DOC_SELECTION, FILES_IN_PROJECTS};
struct FoundInfo {
FoundInfo(intptr_t start, intptr_t end, size_t lineNumber, const TCHAR *fullPath)
FoundInfo(intptr_t start, intptr_t end, size_t lineNumber, const wchar_t *fullPath)
: _lineNumber(lineNumber), _fullPath(fullPath) {
_ranges.push_back(std::pair<intptr_t, intptr_t>(start, end));
};
std::vector<std::pair<intptr_t, intptr_t>> _ranges;
size_t _lineNumber = 0;
generic_string _fullPath;
std::wstring _fullPath;
};
struct TargetRange {
@ -72,10 +72,10 @@ struct FindOption
bool _doPurge = false;
bool _doMarkLine = false;
bool _isInSelection = false;
generic_string _str2Search;
generic_string _str4Replace;
generic_string _filters;
generic_string _directory;
std::wstring _str2Search;
std::wstring _str4Replace;
std::wstring _filters;
std::wstring _directory;
bool _isRecursive = true;
bool _isInHiddenDir = false;
bool _isProjectPanel_1 = false;
@ -88,7 +88,7 @@ struct FindOption
//This class contains generic search functions as static functions for easy access
class Searching {
public:
static int convertExtendedToString(const TCHAR * query, TCHAR * result, int length);
static int convertExtendedToString(const wchar_t * query, wchar_t * result, int length);
static TargetRange t;
static int buildSearchFlags(const FindOption * option) {
return (option->_isWholeWord ? SCFIND_WHOLEWORD : 0) |
@ -99,7 +99,7 @@ public:
static void displaySectionCentered(size_t posStart, size_t posEnd, ScintillaEditView * pEditView, bool isDownwards = true);
private:
static bool readBase(const TCHAR * str, int * value, int base, int size);
static bool readBase(const wchar_t * str, int * value, int base, int size);
};
@ -121,11 +121,11 @@ public:
_ppEditView = ppEditView;
};
void addSearchLine(const TCHAR *searchName);
void addFileNameTitle(const TCHAR * fileName);
void addSearchLine(const wchar_t *searchName);
void addFileNameTitle(const wchar_t * fileName);
void addFileHitCount(int count);
void addSearchResultInfo(int count, int countSearched, bool searchedEntireNotSelection, const FindOption *pFindOpt);
const char* foundLine(FoundInfo fi, SearchResultMarkingLine mi, const TCHAR* foundline, size_t totalLineNumber);
const char* foundLine(FoundInfo fi, SearchResultMarkingLine mi, const wchar_t* foundline, size_t totalLineNumber);
void setFinderStyle();
void setFinderStyleForNpc(bool onlyColor = false);
void removeAll();
@ -140,10 +140,10 @@ public:
void gotoNextFoundResult(int direction);
std::pair<intptr_t, intptr_t> gotoFoundLine(size_t nOccurrence = 0); // value 0 means this argument is not used
void deleteResult();
std::vector<generic_string> getResultFilePaths() const;
bool canFind(const TCHAR *fileName, size_t lineNumber, size_t* indexToStartFrom) const;
std::vector<std::wstring> getResultFilePaths() const;
bool canFind(const wchar_t *fileName, size_t lineNumber, size_t* indexToStartFrom) const;
void setVolatiled(bool val) { _canBeVolatiled = val; };
generic_string getHitsString(int count) const;
std::wstring getHitsString(int count) const;
LRESULT scintillaExecute(UINT msg, WPARAM wParam = 0, LPARAM lParam = 0) const {
return _scintView.execute(msg, wParam, lParam);
@ -182,14 +182,14 @@ private:
bool _longLinesAreWrapped = false;
bool _purgeBeforeEverySearch = false;
generic_string _prefixLineStr;
std::wstring _prefixLineStr;
void setFinderReadOnly(bool isReadOnly) {
_scintView.execute(SCI_SETREADONLY, isReadOnly);
};
bool isLineActualSearchResult(const generic_string & s) const;
generic_string & prepareStringForClipboard(generic_string & s) const;
bool isLineActualSearchResult(const std::wstring & s) const;
std::wstring & prepareStringForClipboard(std::wstring & s) const;
static FoundInfo EmptyFoundInfo;
static SearchResultMarkingLine EmptySearchResultMarking;
@ -209,8 +209,8 @@ enum FindNextType {
struct FindReplaceInfo
{
const TCHAR *_txt2find = nullptr;
const TCHAR *_txt2replace = nullptr;
const wchar_t *_txt2find = nullptr;
const wchar_t *_txt2replace = nullptr;
intptr_t _startRange = -1;
intptr_t _endRange = -1;
};
@ -219,7 +219,7 @@ struct FindersInfo
{
Finder *_pSourceFinder = nullptr;
Finder *_pDestFinder = nullptr;
const TCHAR *_pFileName = nullptr;
const wchar_t *_pFileName = nullptr;
FindOption _findOption;
};
@ -272,10 +272,10 @@ public :
void initOptionsFromDlg();
void doDialog(DIALOG_TYPE whichType, bool isRTL = false, bool toShow = true);
bool processFindNext(const TCHAR *txt2find, const FindOption *options = NULL, FindStatus *oFindStatus = NULL, FindNextType findNextType = FINDNEXTTYPE_FINDNEXT);
bool processReplace(const TCHAR *txt2find, const TCHAR *txt2replace, const FindOption *options = NULL);
bool processFindNext(const wchar_t *txt2find, const FindOption *options = NULL, FindStatus *oFindStatus = NULL, FindNextType findNextType = FINDNEXTTYPE_FINDNEXT);
bool processReplace(const wchar_t *txt2find, const wchar_t *txt2replace, const FindOption *options = NULL);
int markAll(const TCHAR *txt2find, int styleID);
int markAll(const wchar_t *txt2find, int styleID);
int markAllInc(const FindOption *opt);
@ -284,7 +284,7 @@ public :
void replaceAllInOpenedDocs();
void findAllIn(InWhat op);
void setSearchText(TCHAR * txt2find);
void setSearchText(wchar_t * txt2find);
void gotoNextFoundResult(int direction = 0) const {
if (_pFinder) _pFinder->gotoNextFoundResult(direction);
@ -293,10 +293,10 @@ public :
void putFindResult(int result) {
_findAllResult = result;
};
const TCHAR * getDir2Search() const {return _env->_directory.c_str();};
const wchar_t * getDir2Search() const {return _env->_directory.c_str();};
void getPatterns(std::vector<generic_string> & patternVect);
void getAndValidatePatterns(std::vector<generic_string> & patternVect);
void getPatterns(std::vector<std::wstring> & patternVect);
void getAndValidatePatterns(std::vector<std::wstring> & patternVect);
void launchFindInFilesDlg() {
doDialog(FINDINFILES_DLG);
@ -306,16 +306,16 @@ public :
doDialog(FINDINPROJECTS_DLG);
};
void setFindInFilesDirFilter(const TCHAR *dir, const TCHAR *filters);
void setFindInFilesDirFilter(const wchar_t *dir, const wchar_t *filters);
void setProjectCheckmarks(FindHistory *findHistory, int Msk);
void enableProjectCheckmarks();
generic_string getText2search() const {
std::wstring getText2search() const {
return _env->_str2Search;
};
const generic_string & getFilters() const {return _env->_filters;};
const generic_string & getDirectory() const {return _env->_directory;};
const std::wstring & getFilters() const {return _env->_filters;};
const std::wstring & getDirectory() const {return _env->_directory;};
const FindOption & getCurrentOptions() const {return *_env;};
bool isRecursive() const { return _env->_isRecursive; };
bool isInHiddenDir() const { return _env->_isInHiddenDir; };
@ -323,13 +323,13 @@ public :
bool isProjectPanel_2() const { return _env->_isProjectPanel_2; };
bool isProjectPanel_3() const { return _env->_isProjectPanel_3; };
void saveFindHistory();
void changeTabName(DIALOG_TYPE index, const TCHAR *name2change) {
void changeTabName(DIALOG_TYPE index, const wchar_t *name2change) {
TCITEM tie{};
tie.mask = TCIF_TEXT;
tie.pszText = (TCHAR *)name2change;
tie.pszText = (wchar_t *)name2change;
TabCtrl_SetItem(_tab.getHSelf(), index, &tie);
TCHAR label[MAX_PATH]{};
wchar_t label[MAX_PATH]{};
_tab.getCurrentTitle(label, MAX_PATH);
::SetWindowText(_hSelf, label);
}
@ -389,11 +389,11 @@ public :
}
};
void execSavedCommand(int cmd, uptr_t intValue, const generic_string& stringValue);
void execSavedCommand(int cmd, uptr_t intValue, const std::wstring& stringValue);
void clearMarks(const FindOption& opt);
void setStatusbarMessage(const std::wstring & msg, FindStatus staus, std::wstring tooltipMsg = L"");
void setStatusbarMessageWithRegExprErr(ScintillaEditView* pEditView);
generic_string getScopeInfoForStatusBar(FindOption const *pFindOpt) const;
std::wstring getScopeInfoForStatusBar(FindOption const *pFindOpt) const;
Finder * createFinder();
bool removeFinder(Finder *finder2remove);
DIALOG_TYPE getCurrentStatus() {return _currentStatus;};
@ -424,7 +424,7 @@ private:
ScintillaEditView** _ppEditView = nullptr;
Finder *_pFinder = nullptr;
generic_string _findResTitle;
std::wstring _findResTitle;
std::vector<Finder*> _findersOfFinder{};
@ -435,7 +435,7 @@ private:
bool _isRTL = false;
int _findAllResult = 0;
TCHAR _findAllResultStr[1024] = {'\0'};
wchar_t _findAllResultStr[1024] = {'\0'};
int _fileNameLenMax = 1024;
char *_uniFileName = nullptr;
@ -445,7 +445,7 @@ private:
StatusBar _statusBar;
FindStatus _statusbarFindStatus;
generic_string _statusbarTooltipMsg;
std::wstring _statusbarTooltipMsg;
HWND _statusbarTooltipWnd = nullptr;
HICON _statusbarTooltipIcon = nullptr;
int _statusbarTooltipIconSize = 0;
@ -491,8 +491,8 @@ private:
void updateCombos();
void updateCombo(int comboID);
void fillFindHistory();
void fillComboHistory(int id, const std::vector<generic_string> & strings);
int saveComboHistory(int id, int maxcount, std::vector<generic_string> & strings, bool saveEmpty);
void fillComboHistory(int id, const std::vector<std::wstring> & strings);
int saveComboHistory(int id, int maxcount, std::vector<std::wstring> & strings, bool saveEmpty);
static const int FR_OP_FIND = 1;
static const int FR_OP_REPLACE = 2;
static const int FR_OP_FIF = 4;
@ -500,7 +500,7 @@ private:
static const int FR_OP_FIP = 16;
void saveInMacro(size_t cmd, int cmdType);
void drawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
bool replaceInFilesConfirmCheck(generic_string directory, generic_string fileTypes);
bool replaceInFilesConfirmCheck(std::wstring directory, std::wstring fileTypes);
bool replaceInProjectsConfirmCheck();
bool replaceInOpenDocsConfirmCheck(void);
@ -523,7 +523,7 @@ public :
void destroy() override;
void display(bool toShow = true) const override;
void setSearchText(const TCHAR* txt2find, bool) {
void setSearchText(const wchar_t* txt2find, bool) {
::SendDlgItemMessage(_hSelf, IDC_INCFINDTEXT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(txt2find));
};
@ -557,7 +557,7 @@ public:
Progress(const Progress&) = delete;
const Progress& operator=(const Progress&) = delete;
HWND open(HWND hCallerWnd, const TCHAR* header = NULL);
HWND open(HWND hCallerWnd, const wchar_t* header = NULL);
void close();
bool isCancelled() const
@ -567,12 +567,12 @@ public:
return false;
}
void setPercent(unsigned percent, const TCHAR* fileName, int nbHitsSoFar) const;
void setInfo(const TCHAR* info, int nbHitsSoFar = -1) const;
void setPercent(unsigned percent, const wchar_t* fileName, int nbHitsSoFar) const;
void setInfo(const wchar_t* info, int nbHitsSoFar = -1) const;
private:
static const TCHAR cClassName[];
static const TCHAR cDefaultHeader[];
static const wchar_t cClassName[];
static const wchar_t cDefaultHeader[];
static const int cBackgroundColor;
static const SIZE _szClient;
@ -591,7 +591,7 @@ private:
HINSTANCE _hInst = nullptr;
volatile HWND _hwnd = nullptr;
HWND _hCallerWnd = nullptr;
TCHAR _header[128] = {'\0'};
wchar_t _header[128] = {'\0'};
HANDLE _hThread = nullptr;
HANDLE _hActiveState = nullptr;
HWND _hPathText = nullptr;

View File

@ -67,101 +67,101 @@ const int ScintillaEditView::_markersArray[][NB_FOLDER_STATE] = {
// The order of lang type (enum LangType) must be respected
LanguageNameInfo ScintillaEditView::_langNameInfoArray[L_EXTERNAL + 1] = {
//
// _langName _shortName _longName _langID _lexerID
// _langName _shortName _longName _langID _lexerID
//
{TEXT("normal"), TEXT("Normal text"), TEXT("Normal text file"), L_TEXT, "null"},
{TEXT("php"), TEXT("PHP"), TEXT("PHP Hypertext Preprocessor file"), L_PHP, "phpscript"},
{TEXT("c"), TEXT("C"), TEXT("C source file"), L_C, "cpp"},
{TEXT("cpp"), TEXT("C++"), TEXT("C++ source file"), L_CPP, "cpp"},
{TEXT("cs"), TEXT("C#"), TEXT("C# source file"), L_CS, "cpp"},
{TEXT("objc"), TEXT("Objective-C"), TEXT("Objective-C source file"), L_OBJC, "objc"},
{TEXT("java"), TEXT("Java"), TEXT("Java source file"), L_JAVA, "cpp"},
{TEXT("rc"), TEXT("RC"), TEXT("Windows Resource file"), L_RC, "cpp"},
{TEXT("html"), TEXT("HTML"), TEXT("Hyper Text Markup Language file"), L_HTML, "hypertext"},
{TEXT("xml"), TEXT("XML"), TEXT("eXtensible Markup Language file"), L_XML, "xml"},
{TEXT("makefile"), TEXT("Makefile"), TEXT("Makefile"), L_MAKEFILE, "makefile"},
{TEXT("pascal"), TEXT("Pascal"), TEXT("Pascal source file"), L_PASCAL, "pascal"},
{TEXT("batch"), TEXT("Batch"), TEXT("Batch file"), L_BATCH, "batch"},
{TEXT("ini"), TEXT("ini"), TEXT("MS ini file"), L_INI, "props"},
{TEXT("nfo"), TEXT("NFO"), TEXT("MSDOS Style/ASCII Art"), L_ASCII, "null"},
{TEXT("udf"), TEXT("udf"), TEXT("User Defined language file"), L_USER, "user"},
{TEXT("asp"), TEXT("ASP"), TEXT("Active Server Pages script file"), L_ASP, "hypertext"},
{TEXT("sql"), TEXT("SQL"), TEXT("Structured Query Language file"), L_SQL, "sql"},
{TEXT("vb"), TEXT("Visual Basic"), TEXT("Visual Basic file"), L_VB, "vb"},
{TEXT("javascript"), TEXT("JavaScript"), TEXT("JavaScript file"), L_JS, "cpp"},
{TEXT("css"), TEXT("CSS"), TEXT("Cascade Style Sheets File"), L_CSS, "css"},
{TEXT("perl"), TEXT("Perl"), TEXT("Perl source file"), L_PERL, "perl"},
{TEXT("python"), TEXT("Python"), TEXT("Python file"), L_PYTHON, "python"},
{TEXT("lua"), TEXT("Lua"), TEXT("Lua source File"), L_LUA, "lua"},
{TEXT("tex"), TEXT("TeX"), TEXT("TeX file"), L_TEX, "tex"},
{TEXT("fortran"), TEXT("Fortran free form"), TEXT("Fortran free form source file"), L_FORTRAN, "fortran"},
{TEXT("bash"), TEXT("Shell"), TEXT("Unix script file"), L_BASH, "bash"},
{TEXT("actionscript"), TEXT("ActionScript"), TEXT("Flash ActionScript file"), L_FLASH, "cpp"},
{TEXT("nsis"), TEXT("NSIS"), TEXT("Nullsoft Scriptable Install System script file"), L_NSIS, "nsis"},
{TEXT("tcl"), TEXT("TCL"), TEXT("Tool Command Language file"), L_TCL, "tcl"},
{TEXT("lisp"), TEXT("Lisp"), TEXT("List Processing language file"), L_LISP, "lisp"},
{TEXT("scheme"), TEXT("Scheme"), TEXT("Scheme file"), L_SCHEME, "lisp"},
{TEXT("asm"), TEXT("Assembly"), TEXT("Assembly language source file"), L_ASM, "asm"},
{TEXT("diff"), TEXT("Diff"), TEXT("Diff file"), L_DIFF, "diff"},
{TEXT("props"), TEXT("Properties file"), TEXT("Properties file"), L_PROPS, "props"},
{TEXT("postscript"), TEXT("PostScript"), TEXT("PostScript file"), L_PS, "ps"},
{TEXT("ruby"), TEXT("Ruby"), TEXT("Ruby file"), L_RUBY, "ruby"},
{TEXT("smalltalk"), TEXT("Smalltalk"), TEXT("Smalltalk file"), L_SMALLTALK, "smalltalk"},
{TEXT("vhdl"), TEXT("VHDL"), TEXT("VHSIC Hardware Description Language file"), L_VHDL, "vhdl"},
{TEXT("kix"), TEXT("KiXtart"), TEXT("KiXtart file"), L_KIX, "kix"},
{TEXT("autoit"), TEXT("AutoIt"), TEXT("AutoIt"), L_AU3, "au3"},
{TEXT("caml"), TEXT("CAML"), TEXT("Categorical Abstract Machine Language"), L_CAML, "caml"},
{TEXT("ada"), TEXT("Ada"), TEXT("Ada file"), L_ADA, "ada"},
{TEXT("verilog"), TEXT("Verilog"), TEXT("Verilog file"), L_VERILOG, "verilog"},
{TEXT("matlab"), TEXT("MATLAB"), TEXT("MATrix LABoratory"), L_MATLAB, "matlab"},
{TEXT("haskell"), TEXT("Haskell"), TEXT("Haskell"), L_HASKELL, "haskell"},
{TEXT("inno"), TEXT("Inno Setup"), TEXT("Inno Setup script"), L_INNO, "inno"},
{TEXT("searchResult"), TEXT("Internal Search"), TEXT("Internal Search"), L_SEARCHRESULT, "searchResult"},
{TEXT("cmake"), TEXT("CMake"), TEXT("CMake file"), L_CMAKE, "cmake"},
{TEXT("yaml"), TEXT("YAML"), TEXT("YAML Ain't Markup Language"), L_YAML, "yaml"},
{TEXT("cobol"), TEXT("COBOL"), TEXT("COmmon Business Oriented Language"), L_COBOL, "COBOL"},
{TEXT("gui4cli"), TEXT("Gui4Cli"), TEXT("Gui4Cli file"), L_GUI4CLI, "gui4cli"},
{TEXT("d"), TEXT("D"), TEXT("D programming language"), L_D, "d"},
{TEXT("powershell"), TEXT("PowerShell"), TEXT("Windows PowerShell"), L_POWERSHELL, "powershell"},
{TEXT("r"), TEXT("R"), TEXT("R programming language"), L_R, "r"},
{TEXT("jsp"), TEXT("JSP"), TEXT("JavaServer Pages script file"), L_JSP, "hypertext"},
{TEXT("coffeescript"), TEXT("CoffeeScript"), TEXT("CoffeeScript file"), L_COFFEESCRIPT, "coffeescript"},
{TEXT("json"), TEXT("json"), TEXT("JSON file"), L_JSON, "json"},
{TEXT("javascript.js"), TEXT("JavaScript"), TEXT("JavaScript file"), L_JAVASCRIPT, "cpp"},
{TEXT("fortran77"), TEXT("Fortran fixed form"), TEXT("Fortran fixed form source file"), L_FORTRAN_77, "f77"},
{TEXT("baanc"), TEXT("BaanC"), TEXT("BaanC File"), L_BAANC, "baan"},
{TEXT("srec"), TEXT("S-Record"), TEXT("Motorola S-Record binary data"), L_SREC, "srec"},
{TEXT("ihex"), TEXT("Intel HEX"), TEXT("Intel HEX binary data"), L_IHEX, "ihex"},
{TEXT("tehex"), TEXT("Tektronix extended HEX"), TEXT("Tektronix extended HEX binary data"), L_TEHEX, "tehex"},
{TEXT("swift"), TEXT("Swift"), TEXT("Swift file"), L_SWIFT, "cpp"},
{TEXT("asn1"), TEXT("ASN.1"), TEXT("Abstract Syntax Notation One file"), L_ASN1, "asn1"},
{TEXT("avs"), TEXT("AviSynth"), TEXT("AviSynth scripts files"), L_AVS, "avs"},
{TEXT("blitzbasic"), TEXT("BlitzBasic"), TEXT("BlitzBasic file"), L_BLITZBASIC, "blitzbasic"},
{TEXT("purebasic"), TEXT("PureBasic"), TEXT("PureBasic file"), L_PUREBASIC, "purebasic"},
{TEXT("freebasic"), TEXT("FreeBasic"), TEXT("FreeBasic file"), L_FREEBASIC, "freebasic"},
{TEXT("csound"), TEXT("Csound"), TEXT("Csound file"), L_CSOUND, "csound"},
{TEXT("erlang"), TEXT("Erlang"), TEXT("Erlang file"), L_ERLANG, "erlang"},
{TEXT("escript"), TEXT("ESCRIPT"), TEXT("ESCRIPT file"), L_ESCRIPT, "escript"},
{TEXT("forth"), TEXT("Forth"), TEXT("Forth file"), L_FORTH, "forth"},
{TEXT("latex"), TEXT("LaTeX"), TEXT("LaTeX file"), L_LATEX, "latex"},
{TEXT("mmixal"), TEXT("MMIXAL"), TEXT("MMIXAL file"), L_MMIXAL, "mmixal"},
{TEXT("nim"), TEXT("Nim"), TEXT("Nim file"), L_NIM, "nimrod"},
{TEXT("nncrontab"), TEXT("Nncrontab"), TEXT("extended crontab file"), L_NNCRONTAB, "nncrontab"},
{TEXT("oscript"), TEXT("OScript"), TEXT("OScript source file"), L_OSCRIPT, "oscript"},
{TEXT("rebol"), TEXT("REBOL"), TEXT("REBOL file"), L_REBOL, "rebol"},
{TEXT("registry"), TEXT("registry"), TEXT("registry file"), L_REGISTRY, "registry"},
{TEXT("rust"), TEXT("Rust"), TEXT("Rust file"), L_RUST, "rust"},
{TEXT("spice"), TEXT("Spice"), TEXT("spice file"), L_SPICE, "spice"},
{TEXT("txt2tags"), TEXT("txt2tags"), TEXT("txt2tags file"), L_TXT2TAGS, "txt2tags"},
{TEXT("visualprolog"), TEXT("Visual Prolog"), TEXT("Visual Prolog file"), L_VISUALPROLOG, "visualprolog"},
{TEXT("typescript"), TEXT("TypeScript"), TEXT("TypeScript file"), L_TYPESCRIPT, "cpp"},
{TEXT("json5"), TEXT("json5"), TEXT("JSON5 file"), L_JSON5, "json"},
{TEXT("mssql"), TEXT("mssql"), TEXT("Microsoft Transact-SQL (SQL Server) file"), L_MSSQL, "mssql"},
{TEXT("gdscript"), TEXT("GDScript"), TEXT("GDScript file"), L_GDSCRIPT, "gdscript"},
{TEXT("hollywood"), TEXT("Hollywood"), TEXT("Hollywood script"), L_HOLLYWOOD, "hollywood"},
{TEXT("go"), TEXT("Go"), TEXT("Go source file"), L_GOLANG, "cpp"},
{TEXT("raku"), TEXT("Raku"), TEXT("Raku source file"), L_RAKU, "raku"},
{TEXT("ext"), TEXT("External"), TEXT("External"), L_EXTERNAL, "null"}
{L"normal", L"Normal text", L"Normal text file", L_TEXT, "null"},
{L"php", L"PHP", L"PHP Hypertext Preprocessor file", L_PHP, "phpscript"},
{L"c", L"C", L"C source file", L_C, "cpp"},
{L"cpp", L"C++", L"C++ source file", L_CPP, "cpp"},
{L"cs", L"C#", L"C# source file", L_CS, "cpp"},
{L"objc", L"Objective-C", L"Objective-C source file", L_OBJC, "objc"},
{L"java", L"Java", L"Java source file", L_JAVA, "cpp"},
{L"rc", L"RC", L"Windows Resource file", L_RC, "cpp"},
{L"html", L"HTML", L"Hyper Text Markup Language file", L_HTML, "hypertext"},
{L"xml", L"XML", L"eXtensible Markup Language file", L_XML, "xml"},
{L"makefile", L"Makefile", L"Makefile", L_MAKEFILE, "makefile"},
{L"pascal", L"Pascal", L"Pascal source file", L_PASCAL, "pascal"},
{L"batch", L"Batch", L"Batch file", L_BATCH, "batch"},
{L"ini", L"ini", L"MS ini file", L_INI, "props"},
{L"nfo", L"NFO", L"MSDOS Style/ASCII Art", L_ASCII, "null"},
{L"udf", L"udf", L"User Defined language file", L_USER, "user"},
{L"asp", L"ASP", L"Active Server Pages script file", L_ASP, "hypertext"},
{L"sql", L"SQL", L"Structured Query Language file", L_SQL, "sql"},
{L"vb", L"Visual Basic", L"Visual Basic file", L_VB, "vb"},
{L"javascript", L"JavaScript", L"JavaScript file", L_JS, "cpp"},
{L"css", L"CSS", L"Cascade Style Sheets File", L_CSS, "css"},
{L"perl", L"Perl", L"Perl source file", L_PERL, "perl"},
{L"python", L"Python", L"Python file", L_PYTHON, "python"},
{L"lua", L"Lua", L"Lua source File", L_LUA, "lua"},
{L"tex", L"TeX", L"TeX file", L_TEX, "tex"},
{L"fortran", L"Fortran free form", L"Fortran free form source file", L_FORTRAN, "fortran"},
{L"bash", L"Shell", L"Unix script file", L_BASH, "bash"},
{L"actionscript", L"ActionScript", L"Flash ActionScript file", L_FLASH, "cpp"},
{L"nsis", L"NSIS", L"Nullsoft Scriptable Install System script file", L_NSIS, "nsis"},
{L"tcl", L"TCL", L"Tool Command Language file", L_TCL, "tcl"},
{L"lisp", L"Lisp", L"List Processing language file", L_LISP, "lisp"},
{L"scheme", L"Scheme", L"Scheme file", L_SCHEME, "lisp"},
{L"asm", L"Assembly", L"Assembly language source file", L_ASM, "asm"},
{L"diff", L"Diff", L"Diff file", L_DIFF, "diff"},
{L"props", L"Properties file", L"Properties file", L_PROPS, "props"},
{L"postscript", L"PostScript", L"PostScript file", L_PS, "ps"},
{L"ruby", L"Ruby", L"Ruby file", L_RUBY, "ruby"},
{L"smalltalk", L"Smalltalk", L"Smalltalk file", L_SMALLTALK, "smalltalk"},
{L"vhdl", L"VHDL", L"VHSIC Hardware Description Language file", L_VHDL, "vhdl"},
{L"kix", L"KiXtart", L"KiXtart file", L_KIX, "kix"},
{L"autoit", L"AutoIt", L"AutoIt", L_AU3, "au3"},
{L"caml", L"CAML", L"Categorical Abstract Machine Language", L_CAML, "caml"},
{L"ada", L"Ada", L"Ada file", L_ADA, "ada"},
{L"verilog", L"Verilog", L"Verilog file", L_VERILOG, "verilog"},
{L"matlab", L"MATLAB", L"MATrix LABoratory", L_MATLAB, "matlab"},
{L"haskell", L"Haskell", L"Haskell", L_HASKELL, "haskell"},
{L"inno", L"Inno Setup", L"Inno Setup script", L_INNO, "inno"},
{L"searchResult", L"Internal Search", L"Internal Search", L_SEARCHRESULT, "searchResult"},
{L"cmake", L"CMake", L"CMake file", L_CMAKE, "cmake"},
{L"yaml", L"YAML", L"YAML Ain't Markup Language", L_YAML, "yaml"},
{L"cobol", L"COBOL", L"COmmon Business Oriented Language", L_COBOL, "COBOL"},
{L"gui4cli", L"Gui4Cli", L"Gui4Cli file", L_GUI4CLI, "gui4cli"},
{L"d", L"D", L"D programming language", L_D, "d"},
{L"powershell", L"PowerShell", L"Windows PowerShell", L_POWERSHELL, "powershell"},
{L"r", L"R", L"R programming language", L_R, "r"},
{L"jsp", L"JSP", L"JavaServer Pages script file", L_JSP, "hypertext"},
{L"coffeescript", L"CoffeeScript", L"CoffeeScript file", L_COFFEESCRIPT, "coffeescript"},
{L"json", L"json", L"JSON file", L_JSON, "json"},
{L"javascript.js", L"JavaScript", L"JavaScript file", L_JAVASCRIPT, "cpp"},
{L"fortran77", L"Fortran fixed form", L"Fortran fixed form source file", L_FORTRAN_77, "f77"},
{L"baanc", L"BaanC", L"BaanC File", L_BAANC, "baan"},
{L"srec", L"S-Record", L"Motorola S-Record binary data", L_SREC, "srec"},
{L"ihex", L"Intel HEX", L"Intel HEX binary data", L_IHEX, "ihex"},
{L"tehex", L"Tektronix extended HEX", L"Tektronix extended HEX binary data", L_TEHEX, "tehex"},
{L"swift", L"Swift", L"Swift file", L_SWIFT, "cpp"},
{L"asn1", L"ASN.1", L"Abstract Syntax Notation One file", L_ASN1, "asn1"},
{L"avs", L"AviSynth", L"AviSynth scripts files", L_AVS, "avs"},
{L"blitzbasic", L"BlitzBasic", L"BlitzBasic file", L_BLITZBASIC, "blitzbasic"},
{L"purebasic", L"PureBasic", L"PureBasic file", L_PUREBASIC, "purebasic"},
{L"freebasic", L"FreeBasic", L"FreeBasic file", L_FREEBASIC, "freebasic"},
{L"csound", L"Csound", L"Csound file", L_CSOUND, "csound"},
{L"erlang", L"Erlang", L"Erlang file", L_ERLANG, "erlang"},
{L"escript", L"ESCRIPT", L"ESCRIPT file", L_ESCRIPT, "escript"},
{L"forth", L"Forth", L"Forth file", L_FORTH, "forth"},
{L"latex", L"LaTeX", L"LaTeX file", L_LATEX, "latex"},
{L"mmixal", L"MMIXAL", L"MMIXAL file", L_MMIXAL, "mmixal"},
{L"nim", L"Nim", L"Nim file", L_NIM, "nimrod"},
{L"nncrontab", L"Nncrontab", L"extended crontab file", L_NNCRONTAB, "nncrontab"},
{L"oscript", L"OScript", L"OScript source file", L_OSCRIPT, "oscript"},
{L"rebol", L"REBOL", L"REBOL file", L_REBOL, "rebol"},
{L"registry", L"registry", L"registry file", L_REGISTRY, "registry"},
{L"rust", L"Rust", L"Rust file", L_RUST, "rust"},
{L"spice", L"Spice", L"spice file", L_SPICE, "spice"},
{L"txt2tags", L"txt2tags", L"txt2tags file", L_TXT2TAGS, "txt2tags"},
{L"visualprolog", L"Visual Prolog", L"Visual Prolog file", L_VISUALPROLOG, "visualprolog"},
{L"typescript", L"TypeScript", L"TypeScript file", L_TYPESCRIPT, "cpp"},
{L"json5", L"json5", L"JSON5 file", L_JSON5, "json"},
{L"mssql", L"mssql", L"Microsoft Transact-SQL (SQL Server) file", L_MSSQL, "mssql"},
{L"gdscript", L"GDScript", L"GDScript file", L_GDSCRIPT, "gdscript"},
{L"hollywood", L"Hollywood", L"Hollywood script", L_HOLLYWOOD, "hollywood"},
{L"go", L"Go", L"Go source file", L_GOLANG, "cpp"},
{L"raku", L"Raku", L"Raku source file", L_RAKU, "raku"},
{L"ext", L"External", L"External", L_EXTERNAL, "null"}
};
@ -198,8 +198,8 @@ void ScintillaEditView::init(HINSTANCE hInst, HWND hPere)
Window::init(hInst, hPere);
_hSelf = ::CreateWindowEx(
0,\
TEXT("Scintilla"),\
TEXT("Notepad++"),\
L"Scintilla",\
L"Notepad++",\
WS_CHILD | WS_VSCROLL | WS_HSCROLL | WS_CLIPCHILDREN | WS_EX_RTLREADING,\
0, 0, 100, 100,\
_hParent,\
@ -467,7 +467,7 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
{
// convert the selection to Unicode, and store it at the end of the structure.
// Beware: For a Unicode IME, dwStrLen , dwCompStrLen, and dwTargetStrLen
// are TCHAR values, that is, character counts. The members dwStrOffset,
// are wchar_t values, that is, character counts. The members dwStrOffset,
// dwCompStrOffset, and dwTargetStrOffset specify byte counts.
textLength = ::MultiByteToWideChar( codepage, 0,
@ -738,7 +738,7 @@ void ScintillaEditView::setStyle(Style styleToSet)
if (go.isEnable())
{
const Style * pStyle = NppParameters::getInstance().getMiscStylerArray().findByName(TEXT("Global override"));
const Style * pStyle = NppParameters::getInstance().getMiscStylerArray().findByName(L"Global override");
if (pStyle)
{
if (go.enableFg)
@ -814,7 +814,7 @@ void ScintillaEditView::setXmlLexer(LangType type)
setLexerFromLangID(L_XML);
for (int i = 0 ; i < 4 ; ++i)
execute(SCI_SETKEYWORDS, i, reinterpret_cast<LPARAM>(TEXT("")));
execute(SCI_SETKEYWORDS, i, reinterpret_cast<LPARAM>(L""));
makeStyle(type);
@ -838,7 +838,7 @@ void ScintillaEditView::setXmlLexer(LangType type)
void ScintillaEditView::setHTMLLexer()
{
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
const wchar_t *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(L_HTML, pKwArray);
basic_string<char> keywordList("");
@ -853,7 +853,7 @@ void ScintillaEditView::setHTMLLexer()
void ScintillaEditView::setEmbeddedJSLexer()
{
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
const wchar_t *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(L_JS, pKwArray);
basic_string<char> keywordList("");
@ -873,7 +873,7 @@ void ScintillaEditView::setJsonLexer(bool isJson5)
{
setLexerFromLangID(isJson5 ? L_JSON5 : L_JSON);
const TCHAR *pKwArray[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
const wchar_t *pKwArray[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
makeStyle(L_JSON, pKwArray);
@ -905,7 +905,7 @@ void ScintillaEditView::setJsonLexer(bool isJson5)
void ScintillaEditView::setEmbeddedPhpLexer()
{
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
const wchar_t *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(L_PHP, pKwArray);
basic_string<char> keywordList("");
@ -923,7 +923,7 @@ void ScintillaEditView::setEmbeddedPhpLexer()
void ScintillaEditView::setEmbeddedAspLexer()
{
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
const wchar_t *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(L_ASP, pKwArray);
basic_string<char> keywordList("");
@ -940,7 +940,7 @@ void ScintillaEditView::setEmbeddedAspLexer()
execute(SCI_STYLESETEOLFILLED, SCE_HBA_DEFAULT, true);
}
void ScintillaEditView::setUserLexer(const TCHAR *userLangName)
void ScintillaEditView::setUserLexer(const wchar_t *userLangName)
{
int setKeywordsCounter = 0;
setLexerFromLangID(L_USER);
@ -1049,7 +1049,7 @@ void ScintillaEditView::setUserLexer(const TCHAR *userLangName)
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.decimalSeparator"), reinterpret_cast<LPARAM>(intBuffer));
// at the end (position SCE_USER_KWLIST_TOTAL) send id values
sprintf(intBuffer, "%" PRIuPTR, reinterpret_cast<uintptr_t>(userLangContainer->getName())); // use numeric value of TCHAR pointer
sprintf(intBuffer, "%" PRIuPTR, reinterpret_cast<uintptr_t>(userLangContainer->getName())); // use numeric value of wchar_t pointer
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("userDefine.udlName"), reinterpret_cast<LPARAM>(intBuffer));
sprintf(intBuffer, "%" PRIuPTR, reinterpret_cast<uintptr_t>(_currentBufferID)); // use numeric value of BufferID pointer
@ -1110,7 +1110,7 @@ void ScintillaEditView::setCppLexer(LangType langType)
const char *cppInstrs;
const char *cppTypes;
const char *cppGlobalclass;
const TCHAR *doxygenKeyWords = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
const wchar_t *doxygenKeyWords = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
setLexerFromLangID(L_CPP);
@ -1124,7 +1124,7 @@ void ScintillaEditView::setCppLexer(LangType langType)
}
}
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
const wchar_t *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(langType, pKwArray);
basic_string<char> keywordListInstruction("");
@ -1169,10 +1169,10 @@ void ScintillaEditView::setCppLexer(LangType langType)
void ScintillaEditView::setJsLexer()
{
const TCHAR *doxygenKeyWords = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
const wchar_t *doxygenKeyWords = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
setLexerFromLangID(L_JAVASCRIPT);
const TCHAR *pKwArray[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
const wchar_t *pKwArray[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
makeStyle(L_JAVASCRIPT, pKwArray);
if (doxygenKeyWords)
@ -1182,7 +1182,7 @@ void ScintillaEditView::setJsLexer()
execute(SCI_SETKEYWORDS, 2, reinterpret_cast<LPARAM>(doxygenKeyWords_char));
}
const TCHAR *newLexerName = ScintillaEditView::_langNameInfoArray[L_JAVASCRIPT]._langName;
const wchar_t *newLexerName = ScintillaEditView::_langNameInfoArray[L_JAVASCRIPT]._langName;
LexerStyler *pNewStyler = (NppParameters::getInstance().getLStylerArray()).getLexerStylerByName(newLexerName);
if (pNewStyler) // New js styler is available, so we can use it do more modern styling
{
@ -1222,7 +1222,7 @@ void ScintillaEditView::setJsLexer()
}
else // New js styler is not available, we use the old styling for the sake of retro-compatibility
{
const TCHAR *lexerName = ScintillaEditView::_langNameInfoArray[L_JS]._langName;
const wchar_t *lexerName = ScintillaEditView::_langNameInfoArray[L_JS]._langName;
LexerStyler *pOldStyler = (NppParameters::getInstance().getLStylerArray()).getLexerStylerByName(lexerName);
if (pOldStyler)
@ -1288,7 +1288,7 @@ void ScintillaEditView::setTclLexer()
setLexerFromLangID(L_TCL);
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
const wchar_t *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(L_TCL, pKwArray);
basic_string<char> keywordListInstruction("");
@ -1315,7 +1315,7 @@ void ScintillaEditView::setObjCLexer(LangType langType)
{
setLexerFromLangID(L_OBJC);
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
const wchar_t *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(langType, pKwArray);
@ -1351,7 +1351,7 @@ void ScintillaEditView::setObjCLexer(LangType langType)
basic_string<char> doxygenKeyWordsString("");
const TCHAR *doxygenKeyWordsW = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
const wchar_t *doxygenKeyWordsW = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
if (doxygenKeyWordsW)
{
doxygenKeyWordsString = wstring2string(doxygenKeyWordsW, CP_ACP);
@ -1374,7 +1374,7 @@ void ScintillaEditView::setObjCLexer(LangType langType)
void ScintillaEditView::setTypeScriptLexer()
{
const TCHAR* doxygenKeyWords = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
const wchar_t* doxygenKeyWords = NppParameters::getInstance().getWordList(L_CPP, LANG_INDEX_TYPE2);
setLexerFromLangID(L_TYPESCRIPT);
if (doxygenKeyWords)
@ -1384,7 +1384,7 @@ void ScintillaEditView::setTypeScriptLexer()
execute(SCI_SETKEYWORDS, 2, reinterpret_cast<LPARAM>(doxygenKeyWords_char));
}
const TCHAR* pKwArray[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
const wchar_t* pKwArray[10] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
makeStyle(L_TYPESCRIPT, pKwArray);
auto getKeywordList = [&pKwArray](const int i)
@ -1428,7 +1428,7 @@ void ScintillaEditView::setLexer(LangType langType, int whichList)
{
setLexerFromLangID(langType);
const TCHAR *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
const wchar_t *pKwArray[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
makeStyle(langType, pKwArray);
@ -1493,9 +1493,9 @@ void ScintillaEditView::setLexer(LangType langType, int whichList)
execute(SCI_SETPROPERTY, reinterpret_cast<WPARAM>("fold.comment"), reinterpret_cast<LPARAM>("1"));
}
void ScintillaEditView::makeStyle(LangType language, const TCHAR **keywordArray)
void ScintillaEditView::makeStyle(LangType language, const wchar_t **keywordArray)
{
const TCHAR * lexerName = ScintillaEditView::_langNameInfoArray[language]._langName;
const wchar_t * lexerName = ScintillaEditView::_langNameInfoArray[language]._langName;
LexerStyler *pStyler = (NppParameters::getInstance().getLStylerArray()).getLexerStylerByName(lexerName);
if (pStyler)
{
@ -1572,7 +1572,7 @@ void ScintillaEditView::setCRLF(long color)
if (color == -1)
{
StyleArray& stylers = nppParams.getMiscStylerArray();
Style* pStyle = stylers.findByName(TEXT("EOL custom color"));
Style* pStyle = stylers.findByName(L"EOL custom color");
if (pStyle)
{
eolCustomColor = pStyle->_fgColor;
@ -1786,7 +1786,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
setPropsLexer(false); break;
case L_USER : {
const TCHAR * langExt = _currentBuffer->getUserDefineLangName();
const wchar_t * langExt = _currentBuffer->getUserDefineLangName();
if (langExt[0])
setUserLexer(langExt);
else
@ -1795,16 +1795,16 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
case L_ASCII :
{
LexerStyler *pStyler = (NppParameters::getInstance().getLStylerArray()).getLexerStylerByName(TEXT("nfo"));
LexerStyler *pStyler = (NppParameters::getInstance().getLStylerArray()).getLexerStylerByName(L"nfo");
Style nfoStyle;
nfoStyle._styleID = STYLE_DEFAULT;
nfoStyle._fontName = TEXT("Lucida Console");
nfoStyle._fontName = L"Lucida Console";
nfoStyle._fontSize = 10;
if (pStyler)
{
const Style * pStyle = pStyler->findByName(TEXT("DEFAULT"));
const Style * pStyle = pStyler->findByName(L"DEFAULT");
if (pStyle)
{
nfoStyle._bgColor = pStyle->_bgColor;
@ -2543,43 +2543,43 @@ void ScintillaEditView::getText(char *dest, size_t start, size_t end) const
execute(SCI_GETTEXTRANGEFULL, 0, reinterpret_cast<LPARAM>(&tr));
}
generic_string ScintillaEditView::getGenericTextAsString(size_t start, size_t end) const
wstring ScintillaEditView::getGenericTextAsString(size_t start, size_t end) const
{
assert(end > start);
const size_t bufSize = end - start + 1;
TCHAR *buf = new TCHAR[bufSize];
wchar_t *buf = new wchar_t[bufSize];
getGenericText(buf, bufSize, start, end);
generic_string text = buf;
wstring text = buf;
delete[] buf;
return text;
}
void ScintillaEditView::getGenericText(TCHAR *dest, size_t destlen, size_t start, size_t end) const
void ScintillaEditView::getGenericText(wchar_t *dest, size_t destlen, size_t start, size_t end) const
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
char *destA = new char[end - start + 1];
getText(destA, start, end);
size_t cp = execute(SCI_GETCODEPAGE);
const TCHAR *destW = wmc.char2wchar(destA, cp);
const wchar_t *destW = wmc.char2wchar(destA, cp);
wcsncpy_s(dest, destlen, destW, _TRUNCATE);
delete [] destA;
}
// "mstart" and "mend" are pointers to indexes in the read string,
// which are converted to the corresponding indexes in the returned TCHAR string.
// which are converted to the corresponding indexes in the returned wchar_t string.
void ScintillaEditView::getGenericText(TCHAR *dest, size_t destlen, size_t start, size_t end, intptr_t* mstart, intptr_t* mend) const
void ScintillaEditView::getGenericText(wchar_t *dest, size_t destlen, size_t start, size_t end, intptr_t* mstart, intptr_t* mend) const
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
char *destA = new char[end - start + 1];
getText(destA, start, end);
size_t cp = execute(SCI_GETCODEPAGE) ;
const TCHAR *destW = wmc.char2wchar(destA, cp, mstart, mend);
const wchar_t *destW = wmc.char2wchar(destA, cp, mstart, mend);
wcsncpy_s(dest, destlen, destW, _TRUNCATE);
delete [] destA;
}
void ScintillaEditView::insertGenericTextFrom(size_t position, const TCHAR *text2insert) const
void ScintillaEditView::insertGenericTextFrom(size_t position, const wchar_t *text2insert) const
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
size_t cp = execute(SCI_GETCODEPAGE);
@ -2633,14 +2633,14 @@ char * ScintillaEditView::getWordOnCaretPos(char * txt, size_t size)
return getWordFromRange(txt, size, range.first, range.second);
}
TCHAR * ScintillaEditView::getGenericWordOnCaretPos(TCHAR * txt, int size)
wchar_t * ScintillaEditView::getGenericWordOnCaretPos(wchar_t * txt, int size)
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
size_t cp = execute(SCI_GETCODEPAGE);
char *txtA = new char[size + 1];
getWordOnCaretPos(txtA, size);
const TCHAR * txtW = wmc.char2wchar(txtA, cp);
const wchar_t * txtW = wmc.char2wchar(txtA, cp);
wcscpy_s(txt, size, txtW);
delete [] txtA;
return txt;
@ -2664,20 +2664,20 @@ char * ScintillaEditView::getSelectedText(char * txt, size_t size, bool expand)
return getWordFromRange(txt, size, range.cpMin, range.cpMax);
}
TCHAR * ScintillaEditView::getGenericSelectedText(TCHAR * txt, int size, bool expand)
wchar_t * ScintillaEditView::getGenericSelectedText(wchar_t * txt, int size, bool expand)
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
size_t cp = execute(SCI_GETCODEPAGE);
char *txtA = new char[size + 1];
getSelectedText(txtA, size, expand);
const TCHAR * txtW = wmc.char2wchar(txtA, cp);
const wchar_t * txtW = wmc.char2wchar(txtA, cp);
wcscpy_s(txt, size, txtW);
delete [] txtA;
return txt;
}
intptr_t ScintillaEditView::searchInTarget(const TCHAR * text2Find, size_t lenOfText2Find, size_t fromPos, size_t toPos) const
intptr_t ScintillaEditView::searchInTarget(const wchar_t * text2Find, size_t lenOfText2Find, size_t fromPos, size_t toPos) const
{
execute(SCI_SETTARGETRANGE, fromPos, toPos);
@ -2689,7 +2689,7 @@ intptr_t ScintillaEditView::searchInTarget(const TCHAR * text2Find, size_t lenOf
return execute(SCI_SEARCHINTARGET, len, reinterpret_cast<LPARAM>(text2FindA));
}
void ScintillaEditView::appandGenericText(const TCHAR * text2Append) const
void ScintillaEditView::appandGenericText(const wchar_t * text2Append) const
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
size_t cp = execute(SCI_GETCODEPAGE);
@ -2697,7 +2697,7 @@ void ScintillaEditView::appandGenericText(const TCHAR * text2Append) const
execute(SCI_APPENDTEXT, strlen(text2AppendA), reinterpret_cast<LPARAM>(text2AppendA));
}
void ScintillaEditView::addGenericText(const TCHAR * text2Append) const
void ScintillaEditView::addGenericText(const wchar_t * text2Append) const
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
size_t cp = execute(SCI_GETCODEPAGE);
@ -2705,7 +2705,7 @@ void ScintillaEditView::addGenericText(const TCHAR * text2Append) const
execute(SCI_ADDTEXT, strlen(text2AppendA), reinterpret_cast<LPARAM>(text2AppendA));
}
void ScintillaEditView::addGenericText(const TCHAR * text2Append, intptr_t* mstart, intptr_t* mend) const
void ScintillaEditView::addGenericText(const wchar_t * text2Append, intptr_t* mstart, intptr_t* mend) const
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
size_t cp = execute(SCI_GETCODEPAGE);
@ -2713,7 +2713,7 @@ void ScintillaEditView::addGenericText(const TCHAR * text2Append, intptr_t* msta
execute(SCI_ADDTEXT, strlen(text2AppendA), reinterpret_cast<LPARAM>(text2AppendA));
}
intptr_t ScintillaEditView::replaceTarget(const TCHAR * str2replace, intptr_t fromTargetPos, intptr_t toTargetPos) const
intptr_t ScintillaEditView::replaceTarget(const wchar_t * str2replace, intptr_t fromTargetPos, intptr_t toTargetPos) const
{
if (fromTargetPos != -1 || toTargetPos != -1)
{
@ -2725,7 +2725,7 @@ intptr_t ScintillaEditView::replaceTarget(const TCHAR * str2replace, intptr_t fr
return execute(SCI_REPLACETARGET, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(str2replaceA));
}
intptr_t ScintillaEditView::replaceTargetRegExMode(const TCHAR * re, intptr_t fromTargetPos, intptr_t toTargetPos) const
intptr_t ScintillaEditView::replaceTargetRegExMode(const wchar_t * re, intptr_t fromTargetPos, intptr_t toTargetPos) const
{
if (fromTargetPos != -1 || toTargetPos != -1)
{
@ -2737,7 +2737,7 @@ intptr_t ScintillaEditView::replaceTargetRegExMode(const TCHAR * re, intptr_t fr
return execute(SCI_REPLACETARGETRE, static_cast<WPARAM>(-1), reinterpret_cast<LPARAM>(reA));
}
void ScintillaEditView::showAutoComletion(size_t lenEntered, const TCHAR* list)
void ScintillaEditView::showAutoComletion(size_t lenEntered, const wchar_t* list)
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
size_t cp = execute(SCI_GETCODEPAGE);
@ -2746,7 +2746,7 @@ void ScintillaEditView::showAutoComletion(size_t lenEntered, const TCHAR* list)
NppDarkMode::setDarkAutoCompletion();
}
void ScintillaEditView::showCallTip(size_t startPos, const TCHAR * def)
void ScintillaEditView::showCallTip(size_t startPos, const wchar_t * def)
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
size_t cp = execute(SCI_GETCODEPAGE);
@ -2754,16 +2754,16 @@ void ScintillaEditView::showCallTip(size_t startPos, const TCHAR * def)
execute(SCI_CALLTIPSHOW, startPos, reinterpret_cast<LPARAM>(defA));
}
generic_string ScintillaEditView::getLine(size_t lineNumber)
wstring ScintillaEditView::getLine(size_t lineNumber)
{
size_t lineLen = execute(SCI_LINELENGTH, lineNumber);
const size_t bufSize = lineLen + 1;
std::unique_ptr<TCHAR[]> buf = std::make_unique<TCHAR[]>(bufSize);
std::unique_ptr<wchar_t[]> buf = std::make_unique<wchar_t[]>(bufSize);
getLine(lineNumber, buf.get(), bufSize);
return buf.get();
}
void ScintillaEditView::getLine(size_t lineNumber, TCHAR * line, size_t lineBufferLen)
void ScintillaEditView::getLine(size_t lineNumber, wchar_t * line, size_t lineBufferLen)
{
// make sure the buffer length is enough to get the whole line
size_t lineLen = execute(SCI_LINELENGTH, lineNumber);
@ -2777,7 +2777,7 @@ void ScintillaEditView::getLine(size_t lineNumber, TCHAR * line, size_t lineBuff
memset(lineA, 0x0, sizeof(char) * lineBufferLen);
execute(SCI_GETLINE, lineNumber, reinterpret_cast<LPARAM>(lineA));
const TCHAR *lineW = wmc.char2wchar(lineA, cp);
const wchar_t *lineW = wmc.char2wchar(lineA, cp);
lstrcpyn(line, lineW, static_cast<int>(lineBufferLen));
delete [] lineA;
}
@ -2941,7 +2941,7 @@ void ScintillaEditView::performGlobalStyles()
if (svp._currentLineHiliteMode != LINEHILITE_NONE)
{
pStyle = stylers.findByName(TEXT("Current line background colour"));
pStyle = stylers.findByName(L"Current line background colour");
if (pStyle)
{
setElementColour(SC_ELEMENT_CARET_LINE_BACK, pStyle->_bgColor);
@ -2952,7 +2952,7 @@ void ScintillaEditView::performGlobalStyles()
COLORREF selectColorBack = grey;
COLORREF selectColorFore = black;
pStyle = stylers.findByName(TEXT("Selected text colour"));
pStyle = stylers.findByName(L"Selected text colour");
if (pStyle)
{
selectColorBack = pStyle->_bgColor;
@ -2964,7 +2964,7 @@ void ScintillaEditView::performGlobalStyles()
COLORREF selectMultiSelectColorBack = liteGrey;
pStyle = stylers.findByName(TEXT("Multi-selected text color"));
pStyle = stylers.findByName(L"Multi-selected text color");
if (pStyle)
{
selectMultiSelectColorBack = pStyle->_bgColor;
@ -2997,7 +2997,7 @@ void ScintillaEditView::performGlobalStyles()
setElementColour(SC_ELEMENT_CARET_ADDITIONAL, multiEditCaretColor);
COLORREF edgeColor = liteGrey;
pStyle = stylers.findByName(TEXT("Edge colour"));
pStyle = stylers.findByName(L"Edge colour");
if (pStyle)
{
edgeColor = pStyle->_fgColor;
@ -3007,7 +3007,7 @@ void ScintillaEditView::performGlobalStyles()
COLORREF foldMarginColor = grey;
COLORREF foldMarginHiColor = white;
pStyle = stylers.findByName(TEXT("Fold margin"));
pStyle = stylers.findByName(L"Fold margin");
if (pStyle)
{
foldMarginHiColor = pStyle->_fgColor;
@ -3017,10 +3017,10 @@ void ScintillaEditView::performGlobalStyles()
execute(SCI_SETFOLDMARGINHICOLOUR, true, foldMarginHiColor);
COLORREF bookmarkMarginColor = veryLiteGrey;
pStyle = stylers.findByName(TEXT("Bookmark margin"));
pStyle = stylers.findByName(L"Bookmark margin");
if (!pStyle)
{
pStyle = stylers.findByName(TEXT("Line number margin")); // "Line number margin" is used only for getting the bg color for _SC_MARGE_SYMBOL.
pStyle = stylers.findByName(L"Line number margin"); // "Line number margin" is used only for getting the bg color for _SC_MARGE_SYMBOL.
if (pStyle) // "Line number margin" has its own style (styleID="33") for setting its bg & fg color
{
bookmarkMarginColor = pStyle->_bgColor;
@ -3034,10 +3034,10 @@ void ScintillaEditView::performGlobalStyles()
execute(SCI_SETMARGINBACKN, _SC_MARGE_SYMBOL, bookmarkMarginColor);
COLORREF changeHistoryMarginColor = veryLiteGrey;
pStyle = stylers.findByName(TEXT("Change History margin"));
pStyle = stylers.findByName(L"Change History margin");
if (!pStyle)
{
pStyle = stylers.findByName(TEXT("Line number margin"));
pStyle = stylers.findByName(L"Line number margin");
if (pStyle)
{
changeHistoryMarginColor = pStyle->_bgColor;
@ -3052,7 +3052,7 @@ void ScintillaEditView::performGlobalStyles()
COLORREF changeModifiedfgColor = orange;
COLORREF changeModifiedbgColor = orange;
pStyle = stylers.findByName(TEXT("Change History modified"));
pStyle = stylers.findByName(L"Change History modified");
if (pStyle)
{
changeModifiedfgColor = pStyle->_fgColor;
@ -3065,7 +3065,7 @@ void ScintillaEditView::performGlobalStyles()
COLORREF changeRevertModifiedfgColor = yellowGreen;
COLORREF changeRevertModifiedbgColor = yellowGreen;
pStyle = stylers.findByName(TEXT("Change History revert modified"));
pStyle = stylers.findByName(L"Change History revert modified");
if (pStyle)
{
changeRevertModifiedfgColor = pStyle->_fgColor;
@ -3078,7 +3078,7 @@ void ScintillaEditView::performGlobalStyles()
COLORREF changeRevertOriginfgColor = darkCyan;
COLORREF changeRevertOriginbgColor = darkCyan;
pStyle = stylers.findByName(TEXT("Change History revert origin"));
pStyle = stylers.findByName(L"Change History revert origin");
if (pStyle)
{
changeRevertOriginfgColor = pStyle->_fgColor;
@ -3091,7 +3091,7 @@ void ScintillaEditView::performGlobalStyles()
COLORREF changeSavedfgColor = midGreen;
COLORREF changeSavedbgColor = midGreen;
pStyle = stylers.findByName(TEXT("Change History saved"));
pStyle = stylers.findByName(L"Change History saved");
if (pStyle)
{
changeSavedfgColor = pStyle->_fgColor;
@ -3103,7 +3103,7 @@ void ScintillaEditView::performGlobalStyles()
execute(SCI_INDICSETFORE, INDICATOR_HISTORY_SAVED_DELETION, changeSavedfgColor);
COLORREF urlHoveredFG = grey;
pStyle = stylers.findByName(TEXT("URL hovered"));
pStyle = stylers.findByName(L"URL hovered");
if (pStyle)
{
urlHoveredFG = pStyle->_fgColor;
@ -3119,7 +3119,7 @@ void ScintillaEditView::performGlobalStyles()
execute(SCI_MARKERENABLEHIGHLIGHT, true);
COLORREF wsSymbolFgColor = black;
pStyle = stylers.findByName(TEXT("White space symbol"));
pStyle = stylers.findByName(L"White space symbol");
if (pStyle)
{
wsSymbolFgColor = pStyle->_fgColor;
@ -3127,7 +3127,7 @@ void ScintillaEditView::performGlobalStyles()
execute(SCI_SETWHITESPACEFORE, true, wsSymbolFgColor);
COLORREF eolCustomColor = liteGrey;
pStyle = stylers.findByName(TEXT("EOL custom color"));
pStyle = stylers.findByName(L"EOL custom color");
if (pStyle)
{
eolCustomColor = pStyle->_fgColor;
@ -3365,7 +3365,7 @@ void ScintillaEditView::updateLineNumberWidth()
const char * ScintillaEditView::getCompleteKeywordList(std::basic_string<char> & kwl, LangType langType, int keywordIndex)
{
kwl += " ";
const TCHAR *defKwl_generic = NppParameters::getInstance().getWordList(langType, keywordIndex);
const wchar_t *defKwl_generic = NppParameters::getInstance().getWordList(langType, keywordIndex);
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
const char * defKwl = wmc.wchar2char(defKwl_generic, CP_ACP);
@ -3691,7 +3691,7 @@ ColumnModeInfos ScintillaEditView::getColumnModeSelectInfo()
return columnModeInfos;
}
void ScintillaEditView::columnReplace(ColumnModeInfos & cmi, const TCHAR *str)
void ScintillaEditView::columnReplace(ColumnModeInfos & cmi, const wchar_t *str)
{
intptr_t totalDiff = 0;
for (size_t i = 0, len = cmi.size(); i < len ; ++i)
@ -4151,7 +4151,7 @@ void ScintillaEditView::setTabSettings(Lang* lang)
void ScintillaEditView::insertNewLineAboveCurrentLine()
{
generic_string newline = getEOLString();
wstring newline = getEOLString();
const auto current_line = getCurrentLineNumber();
if (current_line == 0)
{
@ -4170,7 +4170,7 @@ void ScintillaEditView::insertNewLineAboveCurrentLine()
void ScintillaEditView::insertNewLineBelowCurrentLine()
{
generic_string newline = getEOLString();
wstring newline = getEOLString();
const auto line_count = execute(SCI_GETLINECOUNT);
const auto current_line = getCurrentLineNumber();
if (current_line == line_count - 1)
@ -4196,8 +4196,8 @@ void ScintillaEditView::sortLines(size_t fromLine, size_t toLine, ISorter* pSort
const auto startPos = execute(SCI_POSITIONFROMLINE, fromLine);
const auto endPos = execute(SCI_POSITIONFROMLINE, toLine) + execute(SCI_LINELENGTH, toLine);
const generic_string text = getGenericTextAsString(startPos, endPos);
std::vector<generic_string> splitText;
const wstring text = getGenericTextAsString(startPos, endPos);
std::vector<wstring> splitText;
stringSplit(text, getEOLString(), splitText);
const size_t lineCount = execute(SCI_GETLINECOUNT);
const bool sortEntireDocument = toLine == lineCount - 1;
@ -4210,7 +4210,7 @@ void ScintillaEditView::sortLines(size_t fromLine, size_t toLine, ISorter* pSort
}
assert(toLine - fromLine + 1 == splitText.size());
pSort->sort(splitText);
generic_string joined;
wstring joined;
stringJoin(splitText, getEOLString(), joined);
if (sortEntireDocument)
@ -4248,8 +4248,8 @@ void ScintillaEditView::changeTextDirection(bool isRTL)
{
(nppParamInst.getNativeLangSpeaker())->messageBox("RTLvsDirectWrite",
getHSelf(),
TEXT("RTL is not compatible with Direct Write mode. Please disable DirectWrite mode in MISC. section of Preferences dialog, and restart Notepad++."),
TEXT("Cannot run RTL"),
L"RTL is not compatible with Direct Write mode. Please disable DirectWrite mode in MISC. section of Preferences dialog, and restart Notepad++.",
L"Cannot run RTL",
MB_OK | MB_APPLMODAL);
theWarningIsGiven = true;
@ -4294,20 +4294,20 @@ void ScintillaEditView::changeTextDirection(bool isRTL)
buf->setRTL(isRTL);
}
generic_string ScintillaEditView::getEOLString() const
wstring ScintillaEditView::getEOLString() const
{
intptr_t eol_mode = execute(SCI_GETEOLMODE);
if (eol_mode == SC_EOL_CRLF)
{
return TEXT("\r\n");
return L"\r\n";
}
else if (eol_mode == SC_EOL_LF)
{
return TEXT("\n");
return L"\n";
}
else
{
return TEXT("\r");
return L"\r";
}
}
@ -4344,14 +4344,14 @@ void ScintillaEditView::getFoldColor(COLORREF& fgColor, COLORREF& bgColor, COLOR
{
StyleArray & stylers = NppParameters::getInstance().getMiscStylerArray();
const Style * pStyle = stylers.findByName(TEXT("Fold"));
const Style * pStyle = stylers.findByName(L"Fold");
if (pStyle)
{
fgColor = pStyle->_bgColor;
bgColor = pStyle->_fgColor;
}
pStyle = stylers.findByName(TEXT("Fold active"));
pStyle = stylers.findByName(L"Fold active");
if (pStyle)
{
activeFgColor = pStyle->_fgColor;
@ -4453,10 +4453,10 @@ void ScintillaEditView::markedTextToClipboard(int indiStyle, bool doAll /*= fals
}
// vector of pairs: starting position of styled text, and styled text
std::vector<std::pair<size_t, generic_string>> styledVect;
std::vector<std::pair<size_t, wstring>> styledVect;
const generic_string cr = TEXT("\r");
const generic_string lf = TEXT("\n");
const wstring cr = L"\r";
const wstring lf = L"\n";
bool textContainsLineEndingChar = false;
@ -4473,7 +4473,7 @@ void ScintillaEditView::markedTextToClipboard(int indiStyle, bool doAll /*= fals
{
if (atEndOfIndic)
{
generic_string styledText = getGenericTextAsString(prevPos, pos);
wstring styledText = getGenericTextAsString(prevPos, pos);
if (!textContainsLineEndingChar)
{
if (styledText.find(cr) != std::string::npos ||
@ -4499,11 +4499,11 @@ void ScintillaEditView::markedTextToClipboard(int indiStyle, bool doAll /*= fals
std::sort(styledVect.begin(), styledVect.end());
}
const generic_string delim =
const wstring delim =
(textContainsLineEndingChar && styledVect.size() > 1) ?
TEXT("\r\n----\r\n") : TEXT("\r\n");
L"\r\n----\r\n" : L"\r\n";
generic_string joined;
wstring joined;
for (auto& item : styledVect)
{
joined += delim + item.second;
@ -4511,7 +4511,7 @@ void ScintillaEditView::markedTextToClipboard(int indiStyle, bool doAll /*= fals
joined = joined.substr(delim.length());
if (styledVect.size() > 1)
{
joined += TEXT("\r\n");
joined += L"\r\n";
}
str2Clipboard(joined, NULL);
@ -4552,8 +4552,8 @@ void ScintillaEditView::removeAnyDuplicateLines()
const auto startPos = execute(SCI_POSITIONFROMLINE, fromLine);
const auto endPos = execute(SCI_POSITIONFROMLINE, toLine) + execute(SCI_LINELENGTH, toLine);
const generic_string text = getGenericTextAsString(startPos, endPos);
std::vector<generic_string> linesVect;
const wstring text = getGenericTextAsString(startPos, endPos);
std::vector<wstring> linesVect;
stringSplit(text, getEOLString(), linesVect);
const size_t lineCount = execute(SCI_GETLINECOUNT);
@ -4570,7 +4570,7 @@ void ScintillaEditView::removeAnyDuplicateLines()
size_t newSize = vecRemoveDuplicates(linesVect);
if (origSize != newSize)
{
generic_string joined;
wstring joined;
stringJoin(linesVect, getEOLString(), joined);
if (!doingEntireDocument)
{
@ -4590,7 +4590,7 @@ bool ScintillaEditView::pasteToMultiSelection() const
return false;
// "MSDEVColumnSelect" is column format from Scintilla
CLIPFORMAT cfColumnSelect = static_cast<CLIPFORMAT>(::RegisterClipboardFormat(TEXT("MSDEVColumnSelect")));
CLIPFORMAT cfColumnSelect = static_cast<CLIPFORMAT>(::RegisterClipboardFormat(L"MSDEVColumnSelect"));
if (!::IsClipboardFormatAvailable(cfColumnSelect) || !::OpenClipboard(NULL))
return false;
@ -4608,7 +4608,7 @@ bool ScintillaEditView::pasteToMultiSelection() const
return false;
}
wstring clipboardStr = static_cast<const TCHAR*>(clipboardDataPtr);
wstring clipboardStr = static_cast<const wchar_t*>(clipboardDataPtr);
::GlobalUnlock(clipboardData);
::CloseClipboard();

View File

@ -388,9 +388,9 @@ struct SortInPositionOrder {
typedef std::vector<ColumnModeInfo> ColumnModeInfos;
struct LanguageNameInfo {
const TCHAR* _langName = nullptr;
const TCHAR* _shortName = nullptr;
const TCHAR* _longName = nullptr;
const wchar_t* _langName = nullptr;
const wchar_t* _shortName = nullptr;
const wchar_t* _longName = nullptr;
LangType _langID = L_TEXT;
const char* _lexerID = nullptr;
};
@ -451,10 +451,10 @@ public:
void syncFoldStateWith(const std::vector<size_t> & lineStateVectorNew);
void getText(char *dest, size_t start, size_t end) const;
void getGenericText(TCHAR *dest, size_t destlen, size_t start, size_t end) const;
void getGenericText(TCHAR *dest, size_t deslen, size_t start, size_t end, intptr_t* mstart, intptr_t* mend) const;
generic_string getGenericTextAsString(size_t start, size_t end) const;
void insertGenericTextFrom(size_t position, const TCHAR *text2insert) const;
void getGenericText(wchar_t *dest, size_t destlen, size_t start, size_t end) const;
void getGenericText(wchar_t *dest, size_t deslen, size_t start, size_t end, intptr_t* mstart, intptr_t* mend) const;
std::wstring getGenericTextAsString(size_t start, size_t end) const;
void insertGenericTextFrom(size_t position, const wchar_t *text2insert) const;
void replaceSelWith(const char * replaceText);
intptr_t getSelectedTextCount() {
@ -466,18 +466,18 @@ public:
char * getWordFromRange(char * txt, size_t size, size_t pos1, size_t pos2);
char * getSelectedText(char * txt, size_t size, bool expand = true);
char * getWordOnCaretPos(char * txt, size_t size);
TCHAR * getGenericWordOnCaretPos(TCHAR * txt, int size);
TCHAR * getGenericSelectedText(TCHAR * txt, int size, bool expand = true);
intptr_t searchInTarget(const TCHAR * Text2Find, size_t lenOfText2Find, size_t fromPos, size_t toPos) const;
void appandGenericText(const TCHAR * text2Append) const;
void addGenericText(const TCHAR * text2Append) const;
void addGenericText(const TCHAR * text2Append, intptr_t* mstart, intptr_t* mend) const;
intptr_t replaceTarget(const TCHAR * str2replace, intptr_t fromTargetPos = -1, intptr_t toTargetPos = -1) const;
intptr_t replaceTargetRegExMode(const TCHAR * re, intptr_t fromTargetPos = -1, intptr_t toTargetPos = -1) const;
void showAutoComletion(size_t lenEntered, const TCHAR * list);
void showCallTip(size_t startPos, const TCHAR * def);
generic_string getLine(size_t lineNumber);
void getLine(size_t lineNumber, TCHAR * line, size_t lineBufferLen);
wchar_t * getGenericWordOnCaretPos(wchar_t * txt, int size);
wchar_t * getGenericSelectedText(wchar_t * txt, int size, bool expand = true);
intptr_t searchInTarget(const wchar_t * Text2Find, size_t lenOfText2Find, size_t fromPos, size_t toPos) const;
void appandGenericText(const wchar_t * text2Append) const;
void addGenericText(const wchar_t * text2Append) const;
void addGenericText(const wchar_t * text2Append, intptr_t* mstart, intptr_t* mend) const;
intptr_t replaceTarget(const wchar_t * str2replace, intptr_t fromTargetPos = -1, intptr_t toTargetPos = -1) const;
intptr_t replaceTargetRegExMode(const wchar_t * re, intptr_t fromTargetPos = -1, intptr_t toTargetPos = -1) const;
void showAutoComletion(size_t lenEntered, const wchar_t * list);
void showCallTip(size_t startPos, const wchar_t * def);
std::wstring getLine(size_t lineNumber);
void getLine(size_t lineNumber, wchar_t * line, size_t lineBufferLen);
void addText(size_t length, const char *buf);
void insertNewLineAboveCurrentLine();
@ -503,7 +503,7 @@ public:
return crange;
};
void getWordToCurrentPos(TCHAR * str, intptr_t strLen) const {
void getWordToCurrentPos(wchar_t * str, intptr_t strLen) const {
auto caretPos = execute(SCI_GETCURRENTPOS);
auto startPos = execute(SCI_WORDSTARTPOSITION, caretPos, true);
@ -765,7 +765,7 @@ public:
if ((NppParameters::getInstance()).isTransparentAvailable())
convertSelectedTextTo(caseToConvert);
else
::MessageBox(_hSelf, TEXT("This function needs a newer OS version."), TEXT("Change Case Error"), MB_OK | MB_ICONHAND);
::MessageBox(_hSelf, L"This function needs a newer OS version.", L"Change Case Error", MB_OK | MB_ICONHAND);
};
bool isFoldIndentationBased() const;
@ -782,7 +782,7 @@ public:
ColumnModeInfos getColumnModeSelectInfo();
void columnReplace(ColumnModeInfos & cmi, const TCHAR *str);
void columnReplace(ColumnModeInfos & cmi, const wchar_t *str);
void columnReplace(ColumnModeInfos & cmi, size_t initial, size_t incr, size_t repeat, UCHAR format, ColumnEditorParam::leadingChoice lead);
void clearIndicator(int indicatorNumber) {
@ -859,7 +859,7 @@ public:
(_codepage == CP_JAPANESE) || (_codepage == CP_KOREAN));
};
void scrollPosToCenter(size_t pos);
generic_string getEOLString() const;
std::wstring getEOLString() const;
void setBorderEdge(bool doWithBorderEdge);
void sortLines(size_t fromLine, size_t toLine, ISorter *pSort);
void changeTextDirection(bool isRTL);
@ -913,7 +913,7 @@ protected:
void setKeywords(LangType langType, const char *keywords, int index);
void setLexer(LangType langID, int whichList);
bool setLexerFromLangID(int langID);
void makeStyle(LangType langType, const TCHAR **keywordArray = NULL);
void makeStyle(LangType langType, const wchar_t **keywordArray = NULL);
void setStyle(Style styleToSet); //NOT by reference (style edited)
void setSpecialStyle(const Style & styleToSet); //by reference
void setSpecialIndicator(const Style & styleToSet) {
@ -927,7 +927,7 @@ protected:
void setJsLexer();
void setTclLexer();
void setObjCLexer(LangType type);
void setUserLexer(const TCHAR *userLangName = NULL);
void setUserLexer(const wchar_t *userLangName = NULL);
void setExternalLexer(LangType typeDoc);
void setEmbeddedJSLexer();
void setEmbeddedPhpLexer();
@ -1000,7 +1000,7 @@ protected:
void setTeXLexer() {
for (int i = 0 ; i < 4 ; ++i)
execute(SCI_SETKEYWORDS, i, reinterpret_cast<LPARAM>(TEXT("")));
execute(SCI_SETKEYWORDS, i, reinterpret_cast<LPARAM>(L""));
setLexer(L_TEX, LIST_NONE);
};

View File

@ -263,9 +263,9 @@ void StaticDialog::create(int dialogID, bool isRTL, bool msgDestParent)
if (!_hSelf)
{
generic_string errMsg = TEXT("CreateDialogParam() return NULL.\rGetLastError(): ");
std::wstring errMsg = L"CreateDialogParam() return NULL.\rGetLastError(): ";
errMsg += GetLastErrorAsString();
::MessageBox(NULL, errMsg.c_str(), TEXT("In StaticDialog::create()"), MB_OK);
::MessageBox(NULL, errMsg.c_str(), L"In StaticDialog::create()", MB_OK);
return;
}

View File

@ -266,7 +266,7 @@ void StatusBar::init(HINSTANCE hInst, HWND hPere, int nbParts)
_hSelf = ::CreateWindowEx(
0,
STATUSCLASSNAME,
TEXT(""),
L"",
WS_CHILD | SBARS_SIZEGRIP ,
0, 0, 0, 0,
_hParent, nullptr, _hInst, 0);
@ -344,7 +344,7 @@ void StatusBar::adjustParts(int clientWidth)
}
bool StatusBar::setText(const TCHAR* str, int whichPart)
bool StatusBar::setText(const wchar_t* str, int whichPart)
{
if ((size_t) whichPart < _partWidthArray.size())
{
@ -360,7 +360,7 @@ bool StatusBar::setText(const TCHAR* str, int whichPart)
}
bool StatusBar::setOwnerDrawText(const TCHAR* str)
bool StatusBar::setOwnerDrawText(const wchar_t* str)
{
if (str != nullptr)
_lastSetText = str;