2012-04-15 16:54:38 +00:00
// This file is part of Notepad++ project
2021-01-23 03:23:47 +00:00
// Copyright (C)2021 Don HO <don.h@free.fr>
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// at your option any later version.
2009-04-24 23:34:47 +00:00
//
2012-04-15 16:54:38 +00:00
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
2021-01-23 03:23:47 +00:00
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2012-04-15 16:54:38 +00:00
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
2021-01-23 03:23:47 +00:00
// along with this program. If not, see <https://www.gnu.org/licenses/>.
2017-03-13 01:10:34 +00:00
2015-08-14 19:47:47 +00:00
# pragma once
2009-04-24 23:34:47 +00:00
# include "tinyxmlA.h"
# include "tinyxml.h"
# include "Scintilla.h"
# include "ScintillaRef.h"
# include "ToolBar.h"
# include "UserDefineLangReference.h"
# include "colors.h"
# include "shortcut.h"
# include "ContextMenu.h"
2014-02-11 00:26:24 +00:00
# include "dpiManager.h"
2021-02-22 13:55:45 +00:00
# include "NppDarkMode.h"
2015-05-31 13:57:17 +00:00
# include <assert.h>
2012-09-28 21:04:16 +00:00
# include <tchar.h>
2021-06-27 01:05:14 +00:00
# include <map>
2022-04-03 01:52:51 +00:00
# include "ILexer.h"
# include "Lexilla.h"
2012-09-28 21:04:16 +00:00
2021-04-22 03:20:54 +00:00
# ifdef _WIN64
# ifdef _M_ARM64
# define ARCH_TYPE IMAGE_FILE_MACHINE_ARM64
# else
# define ARCH_TYPE IMAGE_FILE_MACHINE_AMD64
# endif
# else
# define ARCH_TYPE IMAGE_FILE_MACHINE_I386
# endif
2022-06-23 22:33:45 +00:00
# define CMD_INTERPRETER TEXT("%COMSPEC%")
2021-08-30 23:38:55 +00:00
2011-01-19 21:05:40 +00:00
class NativeLangSpeaker ;
2009-04-24 23:34:47 +00:00
const bool POS_VERTICAL = true ;
const bool POS_HORIZOTAL = false ;
2015-08-14 19:47:47 +00:00
const int UDD_SHOW = 1 ; // 0000 0001
2009-04-24 23:34:47 +00:00
const int UDD_DOCKED = 2 ; // 0000 0010
// 0 : 0000 0000 hide & undocked
// 1 : 0000 0001 show & undocked
// 2 : 0000 0010 hide & docked
// 3 : 0000 0011 show & docked
2016-09-11 09:45:56 +00:00
const int TAB_DRAWTOPBAR = 1 ; //0000 0000 0001
const int TAB_DRAWINACTIVETAB = 2 ; //0000 0000 0010
const int TAB_DRAGNDROP = 4 ; //0000 0000 0100
const int TAB_REDUCE = 8 ; //0000 0000 1000
const int TAB_CLOSEBUTTON = 16 ; //0000 0001 0000
const int TAB_DBCLK2CLOSE = 32 ; //0000 0010 0000
const int TAB_VERTICAL = 64 ; //0000 0100 0000
const int TAB_MULTILINE = 128 ; //0000 1000 0000
const int TAB_HIDE = 256 ; //0001 0000 0000
const int TAB_QUITONEMPTY = 512 ; //0010 0000 0000
2020-09-19 12:37:53 +00:00
const int TAB_ALTICONS = 1024 ; //0100 0000 0000
2009-04-24 23:34:47 +00:00
2015-08-14 12:57:19 +00:00
2015-10-27 14:35:19 +00:00
enum class EolType : std : : uint8_t
2015-08-14 12:57:19 +00:00
{
windows ,
macos ,
unix ,
// special values
unknown , // can not be the first value for legacy code
osdefault = windows ,
} ;
/*!
* * \ brief Convert an int into a FormatType
* * \ param value An arbitrary int
* * \ param defvalue The default value to use if an invalid value is provided
*/
2015-10-27 14:35:19 +00:00
EolType convertIntToFormatType ( int value , EolType defvalue = EolType : : osdefault ) ;
2015-08-14 12:57:19 +00:00
2009-04-29 18:07:30 +00:00
enum UniMode { uni8Bit = 0 , uniUTF8 = 1 , uni16BE = 2 , uni16LE = 3 , uniCookie = 4 , uni7Bit = 5 , uni16BE_NoBOM = 6 , uni16LE_NoBOM = 7 , uniEnd } ;
2019-03-17 20:19:20 +00:00
enum ChangeDetect { cdDisabled = 0x0 , cdEnabledOld = 0x01 , cdEnabledNew = 0x02 , cdAutoUpdate = 0x04 , cdGo2end = 0x08 } ;
2009-04-24 23:34:47 +00:00
enum BackupFeature { bak_none = 0 , bak_simple = 1 , bak_verbose = 2 } ;
enum OpenSaveDirSetting { dir_followCurrent = 0 , dir_last = 1 , dir_userDef = 2 } ;
2013-07-17 22:35:34 +00:00
enum MultiInstSetting { monoInst = 0 , multiInstOnSession = 1 , multiInst = 2 } ;
Add an option to improve rendering special Unicode characters
... by using Scintilla's DirectWrite technology.
It allows ligature support if the font needed (for exemple "Fira Code") is installed.
Fix #2287, close #8326
Fix #442, fix #675, fix #813, fix #870, fix #1621, fix #3458, fix #4056, fix #4086, fix #4490, fix #8305
2020-05-27 12:17:23 +00:00
enum writeTechnologyEngine { defaultTechnology = 0 , directWriteTechnology = 1 } ;
2020-08-15 11:21:01 +00:00
enum urlMode { urlDisable = 0 , urlNoUnderLineFg , urlUnderLineFg , urlNoUnderLineBg , urlUnderLineBg ,
urlMin = urlDisable ,
urlMax = urlUnderLineBg } ;
2009-04-24 23:34:47 +00:00
const int LANG_INDEX_INSTR = 0 ;
const int LANG_INDEX_INSTR2 = 1 ;
const int LANG_INDEX_TYPE = 2 ;
const int LANG_INDEX_TYPE2 = 3 ;
const int LANG_INDEX_TYPE3 = 4 ;
const int LANG_INDEX_TYPE4 = 5 ;
const int LANG_INDEX_TYPE5 = 6 ;
2019-08-21 15:20:24 +00:00
const int LANG_INDEX_TYPE6 = 7 ;
const int LANG_INDEX_TYPE7 = 8 ;
2009-04-24 23:34:47 +00:00
const int COPYDATA_PARAMS = 0 ;
const int COPYDATA_FILENAMESA = 1 ;
const int COPYDATA_FILENAMESW = 2 ;
2022-04-27 02:32:24 +00:00
const int COPYDATA_FULL_CMDLINE = 3 ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
# define PURE_LC_NONE 0
# define PURE_LC_BOL 1
# define PURE_LC_WSP 2
2013-01-27 01:03:53 +00:00
2015-08-14 19:47:47 +00:00
# define DECSEP_DOT 0
# define DECSEP_COMMA 1
# define DECSEP_BOTH 2
2013-01-27 01:03:53 +00:00
2014-06-02 07:02:46 +00:00
# define DROPBOX_AVAILABLE 1
# define ONEDRIVE_AVAILABLE 2
# define GOOGLEDRIVE_AVAILABLE 4
2012-08-12 00:09:35 +00:00
const TCHAR fontSizeStrs [ ] [ 3 ] = { TEXT ( " " ) , TEXT ( " 5 " ) , TEXT ( " 6 " ) , TEXT ( " 7 " ) , TEXT ( " 8 " ) , TEXT ( " 9 " ) , TEXT ( " 10 " ) , TEXT ( " 11 " ) , TEXT ( " 12 " ) , TEXT ( " 14 " ) , TEXT ( " 16 " ) , TEXT ( " 18 " ) , TEXT ( " 20 " ) , TEXT ( " 22 " ) , TEXT ( " 24 " ) , TEXT ( " 26 " ) , TEXT ( " 28 " ) } ;
2009-04-24 23:34:47 +00:00
const TCHAR localConfFile [ ] = TEXT ( " doLocalConf.xml " ) ;
const TCHAR notepadStyleFile [ ] = TEXT ( " asNotepad.xml " ) ;
Fix saving file and false alert on network drive issues
And add log ability for debugging network drive file status detection issue.
To activate log, user should:
1. Add an empty "nppLogNetworkDriveIssue.xml" file beside of notepad++.exe, or if user has no admin previlege, he/she can add this file into %APPDATA%\Notepad++\.
2. Create "C:\temp\" directory, if it doesn't exist yet.
3. Start notepad++.exe, and wait for the file status (timestamp) detection error from the network drive. If the errors occur, there should be some trace in "C:\temp\nppLogNetworkDriveIssue.log".
People who have had the network drive file status detection issue in #10688, #10753, #10757, #10751 & #10787 are welcome to download the binary and provide the generated log in order to fix this issue.
Fix #10751, fix #10688, fix #10753, fix #10757, fix #10751, fix #10787, close #10847
2021-11-28 01:00:31 +00:00
2021-12-02 02:55:24 +00:00
// issue xml/log file name
Fix saving file and false alert on network drive issues
And add log ability for debugging network drive file status detection issue.
To activate log, user should:
1. Add an empty "nppLogNetworkDriveIssue.xml" file beside of notepad++.exe, or if user has no admin previlege, he/she can add this file into %APPDATA%\Notepad++\.
2. Create "C:\temp\" directory, if it doesn't exist yet.
3. Start notepad++.exe, and wait for the file status (timestamp) detection error from the network drive. If the errors occur, there should be some trace in "C:\temp\nppLogNetworkDriveIssue.log".
People who have had the network drive file status detection issue in #10688, #10753, #10757, #10751 & #10787 are welcome to download the binary and provide the generated log in order to fix this issue.
Fix #10751, fix #10688, fix #10753, fix #10757, fix #10751, fix #10787, close #10847
2021-11-28 01:00:31 +00:00
const TCHAR nppLogNetworkDriveIssue [ ] = TEXT ( " nppLogNetworkDriveIssue " ) ;
2021-12-02 02:55:24 +00:00
const TCHAR nppLogNulContentCorruptionIssue [ ] = TEXT ( " nppLogNulContentCorruptionIssue " ) ;
2009-04-24 23:34:47 +00:00
2015-05-31 20:40:07 +00:00
void cutString ( const TCHAR * str2cut , std : : vector < generic_string > & patternVect ) ;
Add Notepad++ compatible versions in plugin list
Implement: https://github.com/notepad-plus-plus/nppPluginList/issues/416
While PluginAdmin loading nppPluginList.dll, it will check an attribute "npp-compatible-versions" (optional),
in order to determinate if plugin is compatible to the current version of Notepad++. If plugin is not compatible,
then this plugin will be ignored, therefore it won't be shown on the PluginAdmin's plugin list.
Note that it's only about pluginsAdmin's plugin list:
it prevent from Notepad++ install/update a plugin non-compatible to current version of Notepad++,
but it still allows Notepad++ load this plugin in question, if it's already installed.
Here is the attribite "npp-compatible-versions" looks like in plugin list json file:
```
{
"name": "npp-pluginList",
"version": "1.4.7",
"arch": "32",
"npp-plugins": [
{
"folder-name": "demoPluginA",
"display-name": "Demo Plugin A",
"version": "1.8.7",
"npp-compatible-versions": "[4.2,6.6.6]",
"id": "9c566a9083ef66a0ce93a3ce5f55977faea559b5b0993e37a1461b87f4aeb6f0",
...
},
{
"folder-name": "demoPluginB",
"display-name": "Demo Plugin B",
"version": "1.1.8.7",
"id": "8a6b9dadbf2ec37d5c60a12a5445f0eec2ef00e6eaa80452925789fd73950193",
...
},
...
}
}
```
It's optional. In the case of its absence, it's considered compatible to all versions of Notepad++.
The format of value for "npp-compatible-versions" is following (no white space is allowed):
"6.9" : exact version 6.9
"[4.2,6.6.6]" : from version 4.2 to 6.6.6 inclusive
"[8.3,]" : any version from 8.3 to the latest one
"[,8.2.1]" : 8.2.1 and any previous version
Fix #11338, close #11334
2022-03-04 03:52:46 +00:00
void cutStringBy ( const TCHAR * str2cut , std : : vector < generic_string > & patternVect , char byChar , bool allowEmptyStr ) ;
2013-04-20 23:10:07 +00:00
2009-04-24 23:34:47 +00:00
struct Position
2015-08-14 19:47:47 +00:00
{
2022-02-21 17:11:28 +00:00
intptr_t _firstVisibleLine = 0 ;
intptr_t _startPos = 0 ;
intptr_t _endPos = 0 ;
intptr_t _xOffset = 0 ;
intptr_t _selMode = 0 ;
intptr_t _scrollWidth = 1 ;
intptr_t _offset = 0 ;
intptr_t _wrapCount = 0 ;
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 19:47:47 +00:00
2017-03-13 01:10:34 +00:00
struct MapPosition
{
2022-02-09 03:40:16 +00:00
private :
intptr_t _maxPeekLenInKB = 512 ; // 512 KB
public :
2022-01-16 02:05:25 +00:00
intptr_t _firstVisibleDisplayLine = - 1 ;
2017-04-25 07:28:24 +00:00
2022-01-16 02:05:25 +00:00
intptr_t _firstVisibleDocLine = - 1 ; // map
intptr_t _lastVisibleDocLine = - 1 ; // map
intptr_t _nbLine = - 1 ; // map
intptr_t _higherPos = - 1 ; // map
intptr_t _width = - 1 ;
intptr_t _height = - 1 ;
intptr_t _wrapIndentMode = - 1 ;
2017-05-17 08:01:28 +00:00
2022-01-16 02:05:25 +00:00
intptr_t _KByteInDoc = _maxPeekLenInKB ;
2017-05-17 08:01:28 +00:00
2017-04-17 23:31:41 +00:00
bool _isWrap = false ;
2017-05-17 08:01:28 +00:00
bool isValid ( ) const { return ( _firstVisibleDisplayLine ! = - 1 ) ; } ;
bool canScroll ( ) const { return ( _KByteInDoc < _maxPeekLenInKB ) ; } ; // _nbCharInDoc < _maxPeekLen : Don't scroll the document for the performance issue
2017-03-13 01:10:34 +00:00
} ;
2015-08-14 19:47:47 +00:00
struct sessionFileInfo : public Position
{
2019-03-26 16:43:13 +00:00
sessionFileInfo ( const TCHAR * fn , const TCHAR * ln , int encoding , bool userReadOnly , const Position & pos , const TCHAR * backupFilePath , FILETIME originalFileLastModifTimestamp , const MapPosition & mapPos ) :
_isUserReadOnly ( userReadOnly ) , _encoding ( encoding ) , Position ( pos ) , _originalFileLastModifTimestamp ( originalFileLastModifTimestamp ) , _mapPos ( mapPos )
2015-08-14 19:47:47 +00:00
{
2009-04-24 23:34:47 +00:00
if ( fn ) _fileName = fn ;
if ( ln ) _langName = ln ;
2014-03-31 01:01:54 +00:00
if ( backupFilePath ) _backupFilePath = backupFilePath ;
2015-08-14 19:47:47 +00:00
}
sessionFileInfo ( generic_string fn ) : _fileName ( fn ) { }
2009-04-24 23:34:47 +00:00
generic_string _fileName ;
generic_string _langName ;
2015-05-31 20:40:07 +00:00
std : : vector < size_t > _marks ;
std : : vector < size_t > _foldStates ;
2015-08-14 19:47:47 +00:00
int _encoding = - 1 ;
2019-03-26 16:43:13 +00:00
bool _isUserReadOnly = false ;
bool _isMonitoring = false ;
2014-03-31 01:01:54 +00:00
generic_string _backupFilePath ;
2018-05-31 13:32:44 +00:00
FILETIME _originalFileLastModifTimestamp = { } ;
2017-03-13 01:10:34 +00:00
MapPosition _mapPos ;
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 19:47:47 +00:00
struct Session
{
2009-04-24 23:34:47 +00:00
size_t nbMainFiles ( ) const { return _mainViewFiles . size ( ) ; } ;
size_t nbSubFiles ( ) const { return _subViewFiles . size ( ) ; } ;
2015-08-14 19:47:47 +00:00
size_t _activeView = 0 ;
size_t _activeMainIndex = 0 ;
size_t _activeSubIndex = 0 ;
Add "save Folder as Workspace in session" option in save session dialog
Save FileBrowser root folders if it is visible.
When loading a session file (from menu or via the command line),
launch a FileBrowser from scratch and add folders from the file to it.
When loading an auto-saved session, ignore saved FileBrowser folders.
Store roots and selected item of FileBrowser in a Session class.
Add "FileBrowser" node to session XML.
It containts "latestSelectedItem" attribute and "root" child nodes.
This structure corresponds to the one from "config.xml".
Current save session behavior for Folder as Workspace (FaW) is like this:
1. FaW isn't opened, checkbox is greyed-out -> FaW info is not saved in session
2. FaW is opened, checkbox isn't checked -> FaW info isn't saved in session
3. FaW is opened, checkbox is checked -> FaW info is saved in session
Load session behavior:
1. FaW isn't open, session without FaW info -> FaW isn't shown after loading
2. FaW isn't open, session with FaW info -> FaW is shown after loading
3. FaW is open, session without FaW info -> FaW is kept as is without changes
4. FaW is open, session with FaW info -> FaW is shown with new directories from session
Fix #9165, close #9286
2020-12-31 10:26:49 +00:00
bool _includeFileBrowser = false ;
generic_string _fileBrowserSelectedItem ;
2015-05-31 20:40:07 +00:00
std : : vector < sessionFileInfo > _mainViewFiles ;
std : : vector < sessionFileInfo > _subViewFiles ;
Add "save Folder as Workspace in session" option in save session dialog
Save FileBrowser root folders if it is visible.
When loading a session file (from menu or via the command line),
launch a FileBrowser from scratch and add folders from the file to it.
When loading an auto-saved session, ignore saved FileBrowser folders.
Store roots and selected item of FileBrowser in a Session class.
Add "FileBrowser" node to session XML.
It containts "latestSelectedItem" attribute and "root" child nodes.
This structure corresponds to the one from "config.xml".
Current save session behavior for Folder as Workspace (FaW) is like this:
1. FaW isn't opened, checkbox is greyed-out -> FaW info is not saved in session
2. FaW is opened, checkbox isn't checked -> FaW info isn't saved in session
3. FaW is opened, checkbox is checked -> FaW info is saved in session
Load session behavior:
1. FaW isn't open, session without FaW info -> FaW isn't shown after loading
2. FaW isn't open, session with FaW info -> FaW is shown after loading
3. FaW is open, session without FaW info -> FaW is kept as is without changes
4. FaW is open, session with FaW info -> FaW is shown with new directories from session
Fix #9165, close #9286
2020-12-31 10:26:49 +00:00
std : : vector < generic_string > _fileBrowserRoots ;
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 19:47:47 +00:00
struct CmdLineParams
{
bool _isNoPlugin = false ;
bool _isReadOnly = false ;
bool _isNoSession = false ;
bool _isNoTab = false ;
bool _isPreLaunch = false ;
bool _showLoadingTime = false ;
bool _alwaysOnTop = false ;
2022-02-21 17:11:28 +00:00
intptr_t _line2go = - 1 ;
intptr_t _column2go = - 1 ;
intptr_t _pos2go = - 1 ;
2015-08-14 19:47:47 +00:00
2022-02-09 15:41:56 +00:00
POINT _point = { } ;
2015-08-14 19:47:47 +00:00
bool _isPointXValid = false ;
bool _isPointYValid = false ;
bool _isSessionFile = false ;
bool _isRecursive = false ;
2019-06-25 11:37:48 +00:00
bool _openFoldersAsWorkspace = false ;
2022-04-16 03:51:58 +00:00
bool _monitorFiles = false ;
2015-08-14 19:47:47 +00:00
2022-04-01 17:17:18 +00:00
LangType _langType = L_EXTERNAL ;
2013-07-25 17:41:25 +00:00
generic_string _localizationPath ;
2021-07-04 02:29:27 +00:00
generic_string _udlName ;
2022-04-27 02:32:24 +00:00
generic_string _pluginMessage ;
2020-12-21 02:40:43 +00:00
2015-01-10 23:41:49 +00:00
generic_string _easterEggName ;
2021-09-12 13:22:56 +00:00
unsigned char _quoteType = 0 ;
2018-03-10 10:30:55 +00:00
int _ghostTypingSpeed = - 1 ; // -1: initial value 1: slow 2: fast 3: speed of light
2015-08-14 19:47:47 +00:00
CmdLineParams ( )
{
_point . x = 0 ;
_point . y = 0 ;
}
bool isPointValid ( ) const
{
return _isPointXValid & & _isPointYValid ;
}
2009-04-24 23:34:47 +00:00
} ;
2018-07-02 18:48:40 +00:00
// A POD class to send CmdLineParams through WM_COPYDATA and to Notepad_plus::loadCommandlineParams
struct CmdLineParamsDTO
{
2019-06-25 11:37:48 +00:00
bool _isReadOnly = false ;
bool _isNoSession = false ;
bool _isSessionFile = false ;
bool _isRecursive = false ;
bool _openFoldersAsWorkspace = false ;
2022-04-16 03:51:58 +00:00
bool _monitorFiles = false ;
2018-07-02 18:48:40 +00:00
2022-02-21 17:11:28 +00:00
intptr_t _line2go = 0 ;
intptr_t _column2go = 0 ;
intptr_t _pos2go = 0 ;
2018-07-02 18:48:40 +00:00
2022-04-01 17:17:18 +00:00
LangType _langType = L_EXTERNAL ;
2022-05-16 15:03:09 +00:00
wchar_t _udlName [ MAX_PATH ] ;
2022-04-27 02:32:24 +00:00
wchar_t _pluginMessage [ MAX_PATH ] ;
2018-07-02 18:48:40 +00:00
static CmdLineParamsDTO FromCmdLineParams ( const CmdLineParams & params )
{
CmdLineParamsDTO dto ;
dto . _isReadOnly = params . _isReadOnly ;
dto . _isNoSession = params . _isNoSession ;
dto . _isSessionFile = params . _isSessionFile ;
dto . _isRecursive = params . _isRecursive ;
2019-06-25 11:37:48 +00:00
dto . _openFoldersAsWorkspace = params . _openFoldersAsWorkspace ;
2022-04-16 03:51:58 +00:00
dto . _monitorFiles = params . _monitorFiles ;
2018-07-02 18:48:40 +00:00
dto . _line2go = params . _line2go ;
dto . _column2go = params . _column2go ;
dto . _pos2go = params . _pos2go ;
2022-05-16 15:03:09 +00:00
2018-07-02 18:48:40 +00:00
dto . _langType = params . _langType ;
2022-05-16 15:03:09 +00:00
wcsncpy ( dto . _udlName , params . _udlName . c_str ( ) , MAX_PATH ) ;
2022-04-27 02:32:24 +00:00
wcsncpy ( dto . _pluginMessage , params . _pluginMessage . c_str ( ) , MAX_PATH ) ;
2018-07-02 18:48:40 +00:00
return dto ;
}
} ;
2015-08-14 19:47:47 +00:00
struct FloatingWindowInfo
{
2021-09-12 13:22:56 +00:00
int _cont = 0 ;
2022-02-09 15:41:56 +00:00
RECT _pos = { } ;
2015-08-14 19:47:47 +00:00
FloatingWindowInfo ( int cont , int x , int y , int w , int h )
: _cont ( cont )
{
2009-04-24 23:34:47 +00:00
_pos . left = x ;
_pos . top = y ;
_pos . right = w ;
_pos . bottom = h ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 19:47:47 +00:00
struct PluginDlgDockingInfo final
{
2009-08-03 00:37:30 +00:00
generic_string _name ;
2015-08-14 19:47:47 +00:00
int _internalID = - 1 ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
int _currContainer = - 1 ;
int _prevContainer = - 1 ;
bool _isVisible = false ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
PluginDlgDockingInfo ( const TCHAR * pluginName , int id , int curr , int prev , bool isVis )
: _internalID ( id ) , _currContainer ( curr ) , _prevContainer ( prev ) , _isVisible ( isVis ) , _name ( pluginName )
{ }
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
bool operator = = ( const PluginDlgDockingInfo & rhs ) const
{
return _internalID = = rhs . _internalID and _name = = rhs . _name ;
}
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 19:47:47 +00:00
struct ContainerTabInfo final
{
int _cont = 0 ;
int _activeTab = 0 ;
2009-04-24 23:34:47 +00:00
ContainerTabInfo ( int cont , int activeTab ) : _cont ( cont ) , _activeTab ( activeTab ) { } ;
} ;
2015-08-14 19:47:47 +00:00
struct DockingManagerData final
{
int _leftWidth = 200 ;
int _rightWidth = 200 ;
int _topHeight = 200 ;
int _bottomHight = 200 ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
std : : vector < FloatingWindowInfo > _flaotingWindowInfo ;
std : : vector < PluginDlgDockingInfo > _pluginDockInfo ;
std : : vector < ContainerTabInfo > _containerTabInfo ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
bool getFloatingRCFrom ( int floatCont , RECT & rc ) const
{
2013-07-08 00:12:50 +00:00
for ( size_t i = 0 , fwiLen = _flaotingWindowInfo . size ( ) ; i < fwiLen ; + + i )
2009-04-24 23:34:47 +00:00
{
if ( _flaotingWindowInfo [ i ] . _cont = = floatCont )
2015-08-14 19:47:47 +00:00
{
rc . left = _flaotingWindowInfo [ i ] . _pos . left ;
rc . top = _flaotingWindowInfo [ i ] . _pos . top ;
rc . right = _flaotingWindowInfo [ i ] . _pos . right ;
rc . bottom = _flaotingWindowInfo [ i ] . _pos . bottom ;
2011-09-21 01:05:24 +00:00
return true ;
2015-08-14 19:47:47 +00:00
}
2011-09-21 01:05:24 +00:00
}
return false ;
2009-04-24 23:34:47 +00:00
}
} ;
2015-08-14 19:47:47 +00:00
2012-09-28 21:04:16 +00:00
const int FONTSTYLE_NONE = 0 ;
2009-04-24 23:34:47 +00:00
const int FONTSTYLE_BOLD = 1 ;
const int FONTSTYLE_ITALIC = 2 ;
const int FONTSTYLE_UNDERLINE = 4 ;
2012-11-06 01:34:40 +00:00
const int STYLE_NOT_USED = - 1 ;
2009-04-24 23:34:47 +00:00
const int COLORSTYLE_FOREGROUND = 0x01 ;
const int COLORSTYLE_BACKGROUND = 0x02 ;
const int COLORSTYLE_ALL = COLORSTYLE_FOREGROUND | COLORSTYLE_BACKGROUND ;
2015-08-14 19:47:47 +00:00
2021-08-31 18:58:12 +00:00
struct Style final
2009-04-24 23:34:47 +00:00
{
2021-08-31 18:58:12 +00:00
int _styleID = STYLE_NOT_USED ;
generic_string _styleDesc ;
2015-08-14 19:47:47 +00:00
COLORREF _fgColor = COLORREF ( STYLE_NOT_USED ) ;
COLORREF _bgColor = COLORREF ( STYLE_NOT_USED ) ;
int _colorStyle = COLORSTYLE_ALL ;
2022-06-13 16:23:17 +00:00
bool _isFontEnabled = false ;
2021-08-31 18:58:12 +00:00
generic_string _fontName ;
2015-08-14 19:47:47 +00:00
int _fontStyle = FONTSTYLE_NONE ;
int _fontSize = STYLE_NOT_USED ;
2022-06-13 16:23:17 +00:00
2015-08-14 19:47:47 +00:00
int _nesting = FONTSTYLE_NONE ;
int _keywordClass = STYLE_NOT_USED ;
2021-08-31 18:58:12 +00:00
generic_string _keywords ;
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 19:47:47 +00:00
struct GlobalOverride final
2009-04-24 23:34:47 +00:00
{
2015-08-14 19:47:47 +00:00
bool isEnable ( ) const { return ( enableFg | | enableBg | | enableFont | | enableFontSize | | enableBold | | enableItalic | | enableUnderLine ) ; }
bool enableFg = false ;
bool enableBg = false ;
bool enableFont = false ;
bool enableFontSize = false ;
bool enableBold = false ;
bool enableItalic = false ;
bool enableUnderLine = false ;
2009-04-24 23:34:47 +00:00
} ;
struct StyleArray
{
2022-07-02 15:19:17 +00:00
auto begin ( ) { return _styleVect . begin ( ) ; } ;
auto end ( ) { return _styleVect . end ( ) ; } ;
void clear ( ) { _styleVect . clear ( ) ; } ;
2009-04-24 23:34:47 +00:00
2022-07-02 15:19:17 +00:00
Style & getStyler ( size_t index ) {
2021-08-31 18:58:12 +00:00
assert ( index < _styleVect . size ( ) ) ;
2021-08-30 23:38:55 +00:00
return _styleVect [ index ] ;
2022-07-02 15:19:17 +00:00
} ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
void addStyler ( int styleID , TiXmlNode * styleNode ) ;
2009-04-24 23:34:47 +00:00
2022-07-02 15:19:17 +00:00
void addStyler ( int styleID , const generic_string & styleName ) {
2021-08-31 18:58:12 +00:00
_styleVect . emplace_back ( ) ;
2022-07-02 15:19:17 +00:00
Style & s = _styleVect . back ( ) ;
2021-08-31 18:58:12 +00:00
s . _styleID = styleID ;
s . _styleDesc = styleName ;
s . _fgColor = black ;
s . _bgColor = white ;
2022-07-02 15:19:17 +00:00
} ;
2009-04-24 23:34:47 +00:00
2022-07-02 15:19:17 +00:00
Style * findByID ( int id ) {
for ( size_t i = 0 ; i < _styleVect . size ( ) ; + + i )
2015-08-14 19:47:47 +00:00
{
2021-08-30 23:38:55 +00:00
if ( _styleVect [ i ] . _styleID = = id )
2021-08-31 18:58:12 +00:00
return & ( _styleVect [ i ] ) ;
2015-08-14 19:47:47 +00:00
}
2021-08-31 18:58:12 +00:00
return nullptr ;
2022-07-02 15:19:17 +00:00
} ;
2009-04-24 23:34:47 +00:00
2022-07-02 15:19:17 +00:00
Style * findByName ( const generic_string & name ) {
for ( size_t i = 0 ; i < _styleVect . size ( ) ; + + i )
2015-08-14 19:47:47 +00:00
{
2021-08-31 18:58:12 +00:00
if ( _styleVect [ i ] . _styleDesc = = name )
return & ( _styleVect [ i ] ) ;
2015-08-14 19:47:47 +00:00
}
2021-08-31 18:58:12 +00:00
return nullptr ;
2022-07-02 15:19:17 +00:00
} ;
2009-04-24 23:34:47 +00:00
protected :
2021-08-31 18:58:12 +00:00
std : : vector < Style > _styleVect ;
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 19:47:47 +00:00
2009-04-24 23:34:47 +00:00
struct LexerStyler : public StyleArray
{
2015-08-14 19:47:47 +00:00
public :
LexerStyler & operator = ( const LexerStyler & ls )
{
if ( this ! = & ls )
{
2016-07-10 00:21:15 +00:00
* ( static_cast < StyleArray * > ( this ) ) = ls ;
2015-08-14 19:47:47 +00:00
this - > _lexerName = ls . _lexerName ;
2009-08-03 00:37:30 +00:00
this - > _lexerDesc = ls . _lexerDesc ;
this - > _lexerUserExt = ls . _lexerUserExt ;
2015-08-14 19:47:47 +00:00
}
return * this ;
}
void setLexerName ( const TCHAR * lexerName )
{
_lexerName = lexerName ;
}
void setLexerDesc ( const TCHAR * lexerDesc )
{
_lexerDesc = lexerDesc ;
}
2009-04-24 23:34:47 +00:00
void setLexerUserExt ( const TCHAR * lexerUserExt ) {
2015-08-14 19:47:47 +00:00
_lexerUserExt = lexerUserExt ;
} ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
const TCHAR * getLexerName ( ) const { return _lexerName . c_str ( ) ; } ;
2009-08-03 00:37:30 +00:00
const TCHAR * getLexerDesc ( ) const { return _lexerDesc . c_str ( ) ; } ;
2015-08-14 19:47:47 +00:00
const TCHAR * getLexerUserExt ( ) const { return _lexerUserExt . c_str ( ) ; } ;
2009-04-24 23:34:47 +00:00
private :
2009-08-03 00:37:30 +00:00
generic_string _lexerName ;
generic_string _lexerDesc ;
generic_string _lexerUserExt ;
2009-04-24 23:34:47 +00:00
} ;
2022-04-09 14:58:54 +00:00
struct SortLexersInAlphabeticalOrder {
bool operator ( ) ( LexerStyler & l , LexerStyler & r ) {
2022-04-20 08:52:00 +00:00
if ( ! lstrcmp ( l . getLexerDesc ( ) , TEXT ( " Search result " ) ) )
return false ;
if ( ! lstrcmp ( r . getLexerDesc ( ) , TEXT ( " Search result " ) ) )
return true ;
2022-04-09 14:58:54 +00:00
return lstrcmp ( l . getLexerDesc ( ) , r . getLexerDesc ( ) ) < 0 ;
}
} ;
2015-08-14 19:47:47 +00:00
2009-04-24 23:34:47 +00:00
struct LexerStylerArray
{
2021-08-31 18:58:12 +00:00
size_t getNbLexer ( ) const { return _lexerStylerVect . size ( ) ; }
void clear ( ) { _lexerStylerVect . clear ( ) ; }
2015-08-14 19:47:47 +00:00
2021-08-31 18:58:12 +00:00
LexerStyler & getLexerFromIndex ( size_t index )
2015-08-14 19:47:47 +00:00
{
2021-08-31 18:58:12 +00:00
assert ( index < _lexerStylerVect . size ( ) ) ;
2021-08-30 23:38:55 +00:00
return _lexerStylerVect [ index ] ;
2015-08-14 19:47:47 +00:00
} ;
2021-08-31 18:58:12 +00:00
const TCHAR * getLexerNameFromIndex ( size_t index ) const { return _lexerStylerVect [ index ] . getLexerName ( ) ; }
const TCHAR * getLexerDescFromIndex ( size_t index ) const { return _lexerStylerVect [ index ] . getLexerDesc ( ) ; }
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
LexerStyler * getLexerStylerByName ( const TCHAR * lexerName ) {
2021-08-31 18:58:12 +00:00
if ( ! lexerName ) return nullptr ;
for ( size_t i = 0 ; i < _lexerStylerVect . size ( ) ; + + i )
2015-08-14 19:47:47 +00:00
{
2021-08-30 23:38:55 +00:00
if ( ! lstrcmp ( _lexerStylerVect [ i ] . getLexerName ( ) , lexerName ) )
return & ( _lexerStylerVect [ i ] ) ;
2015-08-14 19:47:47 +00:00
}
2021-08-31 18:58:12 +00:00
return nullptr ;
2015-08-14 19:47:47 +00:00
} ;
2022-04-09 14:58:54 +00:00
2015-08-14 19:47:47 +00:00
void addLexerStyler ( const TCHAR * lexerName , const TCHAR * lexerDesc , const TCHAR * lexerUserExt , TiXmlNode * lexerNode ) ;
2021-08-31 18:58:12 +00:00
2022-04-09 14:58:54 +00:00
void sort ( ) {
std : : sort ( _lexerStylerVect . begin ( ) , _lexerStylerVect . end ( ) , SortLexersInAlphabeticalOrder ( ) ) ;
} ;
2009-04-24 23:34:47 +00:00
private :
2021-08-31 18:58:12 +00:00
std : : vector < LexerStyler > _lexerStylerVect ;
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 12:57:19 +00:00
struct NewDocDefaultSettings final
2009-04-24 23:34:47 +00:00
{
2015-10-27 14:35:19 +00:00
EolType _format = EolType : : osdefault ;
2015-08-14 12:57:19 +00:00
UniMode _unicodeMode = uniCookie ;
bool _openAnsiAsUtf8 = true ;
LangType _lang = L_TEXT ;
int _codepage = - 1 ; // -1 when not using
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 12:57:19 +00:00
2017-01-01 17:28:25 +00:00
struct LangMenuItem final
2015-08-14 12:57:19 +00:00
{
2021-09-12 13:22:56 +00:00
LangType _langType = L_TEXT ;
int _cmdID = - 1 ;
2009-04-24 23:34:47 +00:00
generic_string _langName ;
2019-06-13 15:54:42 +00:00
LangMenuItem ( LangType lt , int cmdID = 0 , const generic_string & langName = TEXT ( " " ) ) :
2009-04-24 23:34:47 +00:00
_langType ( lt ) , _cmdID ( cmdID ) , _langName ( langName ) { } ;
} ;
2017-01-01 17:28:25 +00:00
struct PrintSettings final {
bool _printLineNumber = true ;
int _printOption = SC_PRINT_COLOURONWHITE ;
2015-08-14 19:47:47 +00:00
2009-04-24 23:34:47 +00:00
generic_string _headerLeft ;
generic_string _headerMiddle ;
generic_string _headerRight ;
generic_string _headerFontName ;
2017-01-01 17:28:25 +00:00
int _headerFontStyle = 0 ;
int _headerFontSize = 0 ;
2015-08-14 19:47:47 +00:00
2009-04-24 23:34:47 +00:00
generic_string _footerLeft ;
generic_string _footerMiddle ;
generic_string _footerRight ;
generic_string _footerFontName ;
2017-01-01 17:28:25 +00:00
int _footerFontStyle = 0 ;
int _footerFontSize = 0 ;
2009-04-24 23:34:47 +00:00
2022-02-09 15:41:56 +00:00
RECT _marge = { } ;
2009-04-24 23:34:47 +00:00
2017-01-01 17:28:25 +00:00
PrintSettings ( ) {
_marge . left = 0 ; _marge . top = 0 ; _marge . right = 0 ; _marge . bottom = 0 ;
} ;
2009-04-24 23:34:47 +00:00
bool isHeaderPresent ( ) const {
return ( ( _headerLeft ! = TEXT ( " " ) ) | | ( _headerMiddle ! = TEXT ( " " ) ) | | ( _headerRight ! = TEXT ( " " ) ) ) ;
} ;
bool isFooterPresent ( ) const {
return ( ( _footerLeft ! = TEXT ( " " ) ) | | ( _footerMiddle ! = TEXT ( " " ) ) | | ( _footerRight ! = TEXT ( " " ) ) ) ;
} ;
bool isUserMargePresent ( ) const {
return ( ( _marge . left ! = 0 ) | | ( _marge . top ! = 0 ) | | ( _marge . right ! = 0 ) | | ( _marge . bottom ! = 0 ) ) ;
} ;
} ;
2015-08-14 19:47:47 +00:00
class Date final
{
2009-08-12 01:13:29 +00:00
public :
2015-08-14 19:47:47 +00:00
Date ( ) = default ;
Date ( unsigned long year , unsigned long month , unsigned long day )
: _year ( year )
, _month ( month )
, _day ( day )
{
assert ( year > 0 & & year < = 9999 ) ; // I don't think Notepad++ will last till AD 10000 :)
assert ( month > 0 & & month < = 12 ) ;
assert ( day > 0 & & day < = 31 ) ;
assert ( ! ( month = = 2 & & day > 29 ) & &
! ( month = = 4 & & day > 30 ) & &
! ( month = = 6 & & day > 30 ) & &
! ( month = = 9 & & day > 30 ) & &
! ( month = = 11 & & day > 30 ) ) ;
}
2016-07-18 00:08:29 +00:00
explicit Date ( const TCHAR * dateStr ) ;
2015-08-14 19:47:47 +00:00
// The constructor which makes the date of number of days from now
// nbDaysFromNow could be negative if user want to make a date in the past
// if the value of nbDaysFromNow is 0 then the date will be now
2015-05-31 13:57:17 +00:00
Date ( int nbDaysFromNow ) ;
2009-08-12 01:13:29 +00:00
2015-08-14 19:47:47 +00:00
void now ( ) ;
generic_string toString ( ) const // Return Notepad++ date format : YYYYMMDD
{
TCHAR dateStr [ 16 ] ;
wsprintf ( dateStr , TEXT ( " %04u%02u%02u " ) , _year , _month , _day ) ;
return dateStr ;
}
bool operator < ( const Date & compare ) const
{
if ( this - > _year ! = compare . _year )
return ( this - > _year < compare . _year ) ;
if ( this - > _month ! = compare . _month )
return ( this - > _month < compare . _month ) ;
return ( this - > _day < compare . _day ) ;
}
bool operator > ( const Date & compare ) const
{
if ( this - > _year ! = compare . _year )
return ( this - > _year > compare . _year ) ;
if ( this - > _month ! = compare . _month )
return ( this - > _month > compare . _month ) ;
return ( this - > _day > compare . _day ) ;
}
bool operator = = ( const Date & compare ) const
{
if ( this - > _year ! = compare . _year )
return false ;
if ( this - > _month ! = compare . _month )
return false ;
return ( this - > _day = = compare . _day ) ;
}
bool operator ! = ( const Date & compare ) const
{
if ( this - > _year ! = compare . _year )
return true ;
if ( this - > _month ! = compare . _month )
return true ;
return ( this - > _day ! = compare . _day ) ;
}
2009-08-12 01:13:29 +00:00
private :
2015-08-14 19:47:47 +00:00
unsigned long _year = 2008 ;
unsigned long _month = 4 ;
unsigned long _day = 26 ;
2009-08-12 01:13:29 +00:00
} ;
2015-08-14 19:47:47 +00:00
class MatchedPairConf final
{
public :
bool hasUserDefinedPairs ( ) const { return _matchedPairs . size ( ) ! = 0 ; }
bool hasDefaultPairs ( ) const { return _doParentheses | | _doBrackets | | _doCurlyBrackets | | _doQuotes | | _doDoubleQuotes | | _doHtmlXmlTag ; }
bool hasAnyPairsPair ( ) const { return hasUserDefinedPairs ( ) | | hasDefaultPairs ( ) ; }
public :
std : : vector < std : : pair < char , char > > _matchedPairs ;
std : : vector < std : : pair < char , char > > _matchedPairsInit ; // used only on init
bool _doHtmlXmlTag = false ;
bool _doParentheses = false ;
bool _doBrackets = false ;
bool _doCurlyBrackets = false ;
bool _doQuotes = false ;
bool _doDoubleQuotes = false ;
2013-09-02 09:05:37 +00:00
} ;
2021-07-09 01:51:48 +00:00
struct DarkModeConf final
{
bool _isEnabled = false ;
2022-06-05 01:51:34 +00:00
bool _isEnabledPlugin = true ;
2021-07-09 01:51:48 +00:00
NppDarkMode : : ColorTone _colorTone = NppDarkMode : : blackTone ;
2021-07-11 19:26:48 +00:00
NppDarkMode : : Colors _customColors = NppDarkMode : : getDarkModeDefaultColors ( ) ;
2021-07-09 01:51:48 +00:00
} ;
2015-08-14 19:47:47 +00:00
struct NppGUI final
2009-04-24 23:34:47 +00:00
{
2015-08-14 19:47:47 +00:00
NppGUI ( )
{
2009-04-24 23:34:47 +00:00
_appPos . left = 0 ;
_appPos . top = 0 ;
2016-10-23 01:50:41 +00:00
_appPos . right = 1100 ;
_appPos . bottom = 700 ;
2009-04-24 23:34:47 +00:00
2020-01-28 14:15:54 +00:00
_findWindowPos . left = 0 ;
_findWindowPos . top = 0 ;
_findWindowPos . right = 0 ;
_findWindowPos . bottom = 0 ;
2009-04-24 23:34:47 +00:00
_defaultDir [ 0 ] = 0 ;
_defaultDirExp [ 0 ] = 0 ;
2015-08-14 19:47:47 +00:00
}
2016-10-23 01:50:41 +00:00
toolBarStatusType _toolBarStatus = TB_STANDARD ;
2015-08-14 19:47:47 +00:00
bool _toolbarShow = true ;
bool _statusBarShow = true ;
bool _menuBarShow = true ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
// 1st bit : draw top bar;
2009-04-24 23:34:47 +00:00
// 2nd bit : draw inactive tabs
// 3rd bit : enable drag & drop
// 4th bit : reduce the height
// 5th bit : enable vertical
// 6th bit : enable multiline
// 0:don't draw; 1:draw top bar 2:draw inactive tabs 3:draw both 7:draw both+drag&drop
2016-10-23 01:50:41 +00:00
int _tabStatus = ( TAB_DRAWTOPBAR | TAB_DRAWINACTIVETAB | TAB_DRAGNDROP | TAB_REDUCE | TAB_CLOSEBUTTON ) ;
2009-04-24 23:34:47 +00:00
2016-10-23 01:50:41 +00:00
bool _splitterPos = POS_VERTICAL ;
2015-08-14 19:47:47 +00:00
int _userDefineDlgStatus = UDD_DOCKED ;
2009-04-24 23:34:47 +00:00
2016-10-23 01:50:41 +00:00
int _tabSize = 4 ;
2015-08-14 19:47:47 +00:00
bool _tabReplacedBySpace = false ;
2020-08-07 19:38:21 +00:00
bool _finderLinesAreCurrentlyWrapped = false ;
2021-03-14 00:02:54 +00:00
bool _finderPurgeBeforeEverySearch = false ;
2022-06-17 03:45:33 +00:00
bool _finderShowOnlyOneEntryPerFoundLine = true ;
2009-04-24 23:34:47 +00:00
2019-03-17 20:19:20 +00:00
int _fileAutoDetection = cdEnabledNew ;
2019-03-17 17:02:06 +00:00
2016-10-23 01:50:41 +00:00
bool _checkHistoryFiles = false ;
2009-04-24 23:34:47 +00:00
2022-02-09 15:41:56 +00:00
RECT _appPos = { } ;
2009-04-24 23:34:47 +00:00
2022-02-09 15:41:56 +00:00
RECT _findWindowPos = { } ;
2022-07-20 21:05:11 +00:00
bool _findWindowLessMode = false ;
2020-01-28 14:15:54 +00:00
2015-08-14 19:47:47 +00:00
bool _isMaximized = false ;
bool _isMinimizedToTray = false ;
bool _rememberLastSession = true ; // remember next session boolean will be written in the settings
bool _isCmdlineNosessionActivated = false ; // used for if -nosession is indicated on the launch time
bool _detectEncoding = true ;
2021-06-06 07:42:36 +00:00
bool _saveAllConfirm = true ;
2021-01-01 01:54:54 +00:00
bool _setSaveDlgExtFiltToAllTypes = false ;
2015-08-14 19:47:47 +00:00
bool _doTaskList = true ;
bool _maitainIndent = true ;
bool _enableSmartHilite = true ;
2016-10-13 00:01:09 +00:00
2015-08-14 19:47:47 +00:00
bool _smartHiliteCaseSensitive = false ;
2016-10-13 00:01:09 +00:00
bool _smartHiliteWordOnly = true ;
bool _smartHiliteUseFindSettings = false ;
2016-10-28 09:47:36 +00:00
bool _smartHiliteOnAnotherView = false ;
2016-09-09 17:31:46 +00:00
2021-04-24 20:56:06 +00:00
bool _markAllCaseSensitive = false ;
bool _markAllWordOnly = true ;
2015-08-14 19:47:47 +00:00
bool _disableSmartHiliteTmp = false ;
bool _enableTagsMatchHilite = true ;
bool _enableTagAttrsHilite = true ;
bool _enableHiliteNonHTMLZone = false ;
bool _styleMRU = true ;
char _leftmostDelimiter = ' ( ' ;
char _rightmostDelimiter = ' ) ' ;
bool _delimiterSelectionOnEntireDocument = false ;
bool _backSlashIsEscapeCharacterForSql = true ;
2019-12-25 08:32:40 +00:00
bool _stopFillingFindField = false ;
2019-10-19 07:30:34 +00:00
bool _monospacedFontFindDlg = false ;
2020-07-31 20:43:03 +00:00
bool _findDlgAlwaysVisible = false ;
2020-08-13 12:33:25 +00:00
bool _confirmReplaceInAllOpenDocs = true ;
2021-04-26 00:49:27 +00:00
bool _replaceStopsWithoutFindingNext = false ;
2021-02-14 15:00:33 +00:00
bool _muteSounds = false ;
2022-05-19 14:45:17 +00:00
bool _enableFoldCmdToggable = false ;
Add an option to improve rendering special Unicode characters
... by using Scintilla's DirectWrite technology.
It allows ligature support if the font needed (for exemple "Fira Code") is installed.
Fix #2287, close #8326
Fix #442, fix #675, fix #813, fix #870, fix #1621, fix #3458, fix #4056, fix #4086, fix #4490, fix #8305
2020-05-27 12:17:23 +00:00
writeTechnologyEngine _writeTechnologyEngine = defaultTechnology ;
2017-01-15 21:16:17 +00:00
bool _isWordCharDefault = true ;
std : : string _customWordChars ;
2020-08-15 11:21:01 +00:00
urlMode _styleURL = urlUnderLineFg ;
2020-12-06 15:38:53 +00:00
generic_string _uriSchemes = TEXT ( " svn:// cvs:// git:// imap:// irc:// irc6:// ircs:// ldap:// ldaps:// news: telnet:// gopher:// ssh:// sftp:// smb:// skype: snmp:// spotify: steam:// sms: slack:// chrome:// bitcoin: " ) ;
2009-04-24 23:34:47 +00:00
NewDocDefaultSettings _newDocDefaultSettings ;
2015-08-14 19:47:47 +00:00
2021-08-31 17:48:24 +00:00
generic_string _dateTimeFormat = TEXT ( " yyyy-MM-dd HH:mm:ss " ) ;
2021-08-28 00:10:20 +00:00
bool _dateTimeReverseDefaultOrder = false ;
2015-08-14 19:47:47 +00:00
2009-04-24 23:34:47 +00:00
void setTabReplacedBySpace ( bool b ) { _tabReplacedBySpace = b ; } ;
const NewDocDefaultSettings & getNewDocDefaultSettings ( ) const { return _newDocDefaultSettings ; } ;
2015-05-31 20:40:07 +00:00
std : : vector < LangMenuItem > _excludedLangList ;
2017-01-17 01:08:54 +00:00
bool _isLangMenuCompact = true ;
2009-04-24 23:34:47 +00:00
PrintSettings _printSettings ;
2022-02-08 01:10:23 +00:00
BackupFeature _backup = bak_none ;
2015-08-14 19:47:47 +00:00
bool _useDir = false ;
2009-08-03 00:37:30 +00:00
generic_string _backupDir ;
2009-04-24 23:34:47 +00:00
DockingManagerData _dockingData ;
GlobalOverride _globalOverride ;
2014-02-16 02:13:05 +00:00
enum AutocStatus { autoc_none , autoc_func , autoc_word , autoc_both } ;
2015-08-14 19:47:47 +00:00
AutocStatus _autocStatus = autoc_both ;
size_t _autocFromLen = 1 ;
2016-10-07 13:17:55 +00:00
bool _autocIgnoreNumbers = true ;
2022-02-06 22:45:04 +00:00
bool _autocInsertSelectedUseENTER = true ;
Auto-completion currently use both ENTER and TAB to insert the selected item,
in some circumstance people have to ENTER twice to have 1 newline feed.
In this commit, 2 options (ENTER & TAB) are given in Auto-completion settings, so users can choose one of these 2 keystrokes (or both, or none). By default ENTER is disabled and TAB is enabled.
If auto-completion is disabled and completion is triggered manually, then the settings of ENTER & TAB won't be considered, both ENTER & TAB will be able to insert the selection.
Fix #4799, fix #4631, fix #8389, fix #10915, close #11016
2022-01-10 00:05:46 +00:00
bool _autocInsertSelectedUseTAB = true ;
2017-02-18 01:04:59 +00:00
bool _funcParams = true ;
2013-09-02 09:05:37 +00:00
MatchedPairConf _matchedPairConf ;
2009-04-24 23:34:47 +00:00
generic_string _definedSessionExt ;
2015-06-13 15:10:02 +00:00
generic_string _definedWorkspaceExt ;
2009-04-24 23:34:47 +00:00
2022-06-23 22:33:45 +00:00
generic_string _commandLineInterpreter = CMD_INTERPRETER ;
2019-08-06 10:01:04 +00:00
2015-08-14 19:47:47 +00:00
struct AutoUpdateOptions
{
2016-10-23 01:50:41 +00:00
bool _doAutoUpdate = true ;
int _intervalDays = 15 ;
2015-08-14 19:47:47 +00:00
Date _nextUpdateDate ;
2016-10-23 01:50:41 +00:00
AutoUpdateOptions ( ) : _nextUpdateDate ( Date ( ) ) { } ;
2015-08-14 19:47:47 +00:00
}
_autoUpdateOpt ;
bool _doesExistUpdater = false ;
2017-02-18 01:04:59 +00:00
int _caretBlinkRate = 600 ;
2015-08-14 19:47:47 +00:00
int _caretWidth = 1 ;
bool _enableMultiSelection = false ;
bool _shortTitlebar = false ;
OpenSaveDirSetting _openSaveDir = dir_followCurrent ;
2009-04-24 23:34:47 +00:00
TCHAR _defaultDir [ MAX_PATH ] ;
TCHAR _defaultDirExp [ MAX_PATH ] ; //expanded environment variables
generic_string _themeName ;
2015-08-14 19:47:47 +00:00
MultiInstSetting _multiInstSetting = monoInst ;
2021-09-11 10:29:14 +00:00
bool _fileSwitcherWithoutExtColumn = true ;
int _fileSwitcherExtWidth = 50 ;
bool _fileSwitcherWithoutPathColumn = true ;
int _fileSwitcherPathWidth = 50 ;
2014-05-17 15:35:09 +00:00
bool isSnapshotMode ( ) const { return _isSnapshotMode & & _rememberLastSession & & ! _isCmdlineNosessionActivated ; } ;
2015-08-14 19:47:47 +00:00
bool _isSnapshotMode = true ;
size_t _snapshotBackupTiming = 7000 ;
2015-07-06 17:06:46 +00:00
generic_string _cloudPath ; // this option will never be read/written from/to config.xml
2015-08-14 19:47:47 +00:00
unsigned char _availableClouds = ' \0 ' ; // this option will never be read/written from/to config.xml
2016-08-28 22:13:28 +00:00
2019-02-19 12:05:02 +00:00
enum SearchEngineChoice { se_custom = 0 , se_duckDuckGo = 1 , se_google = 2 , se_bing = 3 , se_yahoo = 4 , se_stackoverflow = 5 } ;
2016-08-28 22:13:28 +00:00
SearchEngineChoice _searchEngineChoice = se_google ;
generic_string _searchEngineCustom ;
2016-09-13 21:12:36 +00:00
bool _isFolderDroppedOpenFiles = false ;
2017-04-27 11:03:31 +00:00
2017-06-11 14:52:03 +00:00
bool _isDocPeekOnTab = false ;
2017-05-14 18:26:23 +00:00
bool _isDocPeekOnMap = false ;
2021-02-22 13:55:45 +00:00
2022-03-28 12:54:31 +00:00
// function list should be sorted by default on new file open
bool _shouldSortFunctionList = false ;
2021-07-09 01:51:48 +00:00
DarkModeConf _darkmode ;
2022-05-22 08:18:23 +00:00
DarkModeConf _darkmodeplugins ;
2009-04-24 23:34:47 +00:00
} ;
struct ScintillaViewParams
{
2015-11-26 18:09:40 +00:00
bool _lineNumberMarginShow = true ;
2020-12-06 15:38:53 +00:00
bool _lineNumberMarginDynamicWidth = true ;
2015-11-26 18:09:40 +00:00
bool _bookMarkMarginShow = true ;
folderStyle _folderStyle = FOLDER_STYLE_BOX ; //"simple", "arrow", "circle", "box" and "none"
lineWrapMethod _lineWrapMethod = LINEWRAP_ALIGNED ;
bool _foldMarginShow = true ;
bool _indentGuideLineShow = true ;
2022-04-14 01:00:50 +00:00
lineHiliteMode _currentLineHiliteMode = LINEHILITE_HILITE ;
unsigned char _currentLineFrameWidth = 1 ; // 1-6 pixel
2015-11-26 18:09:40 +00:00
bool _wrapSymbolShow = false ;
bool _doWrap = false ;
2020-04-17 14:20:34 +00:00
bool _isEdgeBgMode = false ;
2020-04-04 02:55:45 +00:00
std : : vector < size_t > _edgeMultiColumnPos ;
2022-01-16 02:05:25 +00:00
intptr_t _zoom = 0 ;
intptr_t _zoom2 = 0 ;
2015-11-26 18:09:40 +00:00
bool _whiteSpaceShow = false ;
2017-08-01 17:02:01 +00:00
bool _eolShow = false ;
2022-06-09 02:42:10 +00:00
enum crlfMode { plainText = 0 , roundedRectangleText = 1 , plainTextCustomColor = 2 , roundedRectangleTextCustomColor = 3 } ;
crlfMode _eolMode = roundedRectangleText ;
2015-11-26 18:09:40 +00:00
int _borderWidth = 2 ;
2022-03-30 01:02:13 +00:00
bool _virtualSpace = false ;
2020-12-06 15:38:53 +00:00
bool _scrollBeyondLastLine = true ;
2020-07-15 00:12:20 +00:00
bool _rightClickKeepsSelection = false ;
2015-11-26 18:09:40 +00:00
bool _disableAdvancedScrolling = false ;
bool _doSmoothFont = false ;
2015-12-04 18:01:28 +00:00
bool _showBorderEdge = true ;
2021-04-09 17:55:55 +00:00
unsigned char _paddingLeft = 0 ; // 0-9 pixel
unsigned char _paddingRight = 0 ; // 0-9 pixel
// distractionFreeDivPart is used for divising the fullscreen pixel width.
// the result of division will be the left & right padding in Distraction Free mode
2021-04-11 17:59:30 +00:00
unsigned char _distractionFreeDivPart = 4 ; // 3-9 parts
int getDistractionFreePadding ( int editViewWidth ) const {
const int defaultDiviser = 4 ;
int diviser = _distractionFreeDivPart > 2 ? _distractionFreeDivPart : defaultDiviser ;
int paddingLen = editViewWidth / diviser ;
if ( paddingLen < = 0 )
paddingLen = editViewWidth / defaultDiviser ;
return paddingLen ;
} ;
2009-04-24 23:34:47 +00:00
} ;
const int NB_LIST = 20 ;
const int NB_MAX_LRF_FILE = 30 ;
const int NB_MAX_USER_LANG = 30 ;
const int NB_MAX_EXTERNAL_LANG = 30 ;
2010-05-24 01:03:51 +00:00
const int NB_MAX_IMPORTED_UDL = 50 ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
const int NB_MAX_FINDHISTORY_FIND = 30 ;
2009-04-24 23:34:47 +00:00
const int NB_MAX_FINDHISTORY_REPLACE = 30 ;
2015-08-14 19:47:47 +00:00
const int NB_MAX_FINDHISTORY_PATH = 30 ;
2009-04-24 23:34:47 +00:00
const int NB_MAX_FINDHISTORY_FILTER = 20 ;
2009-08-08 13:30:13 +00:00
const int MASK_ReplaceBySpc = 0x80 ;
const int MASK_TabSize = 0x7F ;
2015-08-14 19:47:47 +00:00
struct Lang final
2009-04-24 23:34:47 +00:00
{
2015-08-14 19:47:47 +00:00
LangType _langID = L_TEXT ;
2009-08-03 00:37:30 +00:00
generic_string _langName ;
2021-09-12 13:22:56 +00:00
const TCHAR * _defaultExtList = nullptr ;
const TCHAR * _langKeyWordList [ NB_LIST ] ;
const TCHAR * _pCommentLineSymbol = nullptr ;
const TCHAR * _pCommentStart = nullptr ;
const TCHAR * _pCommentEnd = nullptr ;
2015-08-14 19:47:47 +00:00
bool _isTabReplacedBySpace = false ;
int _tabSize = - 1 ;
Lang ( )
{
2013-07-08 00:12:50 +00:00
for ( int i = 0 ; i < NB_LIST ; _langKeyWordList [ i ] = NULL , + + i ) ;
2015-08-14 19:47:47 +00:00
}
2015-10-11 19:04:22 +00:00
Lang ( LangType langID , const TCHAR * name ) : _langID ( langID ) , _langName ( name ? name : TEXT ( " " ) )
2015-08-14 19:47:47 +00:00
{
for ( int i = 0 ; i < NB_LIST ; _langKeyWordList [ i ] = NULL , + + i ) ;
}
~ Lang ( ) = default ;
2009-04-24 23:34:47 +00:00
void setDefaultExtList ( const TCHAR * extLst ) {
_defaultExtList = extLst ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
void setCommentLineSymbol ( const TCHAR * commentLine ) {
_pCommentLineSymbol = commentLine ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
void setCommentStart ( const TCHAR * commentStart ) {
_pCommentStart = commentStart ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
void setCommentEnd ( const TCHAR * commentEnd ) {
_pCommentEnd = commentEnd ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
void setTabInfo ( int tabInfo )
{
if ( tabInfo ! = - 1 & & tabInfo & MASK_TabSize )
{
_isTabReplacedBySpace = ( tabInfo & MASK_ReplaceBySpc ) ! = 0 ;
_tabSize = tabInfo & MASK_TabSize ;
}
}
2009-08-08 13:30:13 +00:00
2009-04-24 23:34:47 +00:00
const TCHAR * getDefaultExtList ( ) const {
return _defaultExtList ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
void setWords ( const TCHAR * words , int index ) {
_langKeyWordList [ index ] = words ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
const TCHAR * getWords ( int index ) const {
return _langKeyWordList [ index ] ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
LangType getLangID ( ) const { return _langID ; } ;
2009-08-03 00:37:30 +00:00
const TCHAR * getLangName ( ) const { return _langName . c_str ( ) ; } ;
2009-08-08 13:30:13 +00:00
2015-08-14 19:47:47 +00:00
int getTabInfo ( ) const
{
if ( _tabSize = = - 1 ) return - 1 ;
return ( _isTabReplacedBySpace ? 0x80 : 0x00 ) | _tabSize ;
}
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 19:47:47 +00:00
class UserLangContainer final
{
public :
2021-09-12 13:22:56 +00:00
UserLangContainer ( ) : _name ( TEXT ( " new user define " ) ) , _ext ( TEXT ( " " ) ) , _udlVersion ( TEXT ( " " ) ) {
for ( int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; + + i ) * _keywordLists [ i ] = ' \0 ' ;
2015-08-14 19:47:47 +00:00
}
2021-08-06 20:59:40 +00:00
UserLangContainer ( const TCHAR * name , const TCHAR * ext , bool isDarkModeTheme , const TCHAR * udlVer ) :
2021-09-12 13:22:56 +00:00
_name ( name ) , _ext ( ext ) , _isDarkModeTheme ( isDarkModeTheme ) , _udlVersion ( udlVer ) {
for ( int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; + + i ) * _keywordLists [ i ] = ' \0 ' ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
UserLangContainer & operator = ( const UserLangContainer & ulc )
{
2009-04-24 23:34:47 +00:00
if ( this ! = & ulc )
2015-08-14 19:47:47 +00:00
{
2009-04-24 23:34:47 +00:00
this - > _name = ulc . _name ;
this - > _ext = ulc . _ext ;
2021-08-06 20:59:40 +00:00
this - > _isDarkModeTheme = ulc . _isDarkModeTheme ;
2012-09-28 21:04:16 +00:00
this - > _udlVersion = ulc . _udlVersion ;
2009-04-24 23:34:47 +00:00
this - > _isCaseIgnored = ulc . _isCaseIgnored ;
2021-08-30 23:38:55 +00:00
this - > _styles = ulc . _styles ;
2012-09-28 21:04:16 +00:00
this - > _allowFoldOfComments = ulc . _allowFoldOfComments ;
2013-01-27 01:03:53 +00:00
this - > _forcePureLC = ulc . _forcePureLC ;
this - > _decimalSeparator = ulc . _decimalSeparator ;
2012-09-28 21:04:16 +00:00
this - > _foldCompact = ulc . _foldCompact ;
2021-08-31 18:58:12 +00:00
for ( Style & st : this - > _styles )
2009-04-24 23:34:47 +00:00
{
if ( st . _bgColor = = COLORREF ( - 1 ) )
st . _bgColor = white ;
if ( st . _fgColor = = COLORREF ( - 1 ) )
st . _fgColor = black ;
}
2015-08-14 19:47:47 +00:00
2013-07-08 00:12:50 +00:00
for ( int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; + + i )
2019-02-11 01:07:04 +00:00
wcscpy_s ( this - > _keywordLists [ i ] , ulc . _keywordLists [ i ] ) ;
2013-01-27 01:03:53 +00:00
2013-07-08 00:12:50 +00:00
for ( int i = 0 ; i < SCE_USER_TOTAL_KEYWORD_GROUPS ; + + i )
2015-08-14 19:47:47 +00:00
_isPrefix [ i ] = ulc . _isPrefix [ i ] ;
2009-04-24 23:34:47 +00:00
}
return * this ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
const TCHAR * getName ( ) { return _name . c_str ( ) ; } ;
const TCHAR * getExtention ( ) { return _ext . c_str ( ) ; } ;
2012-09-28 21:04:16 +00:00
const TCHAR * getUdlVersion ( ) { return _udlVersion . c_str ( ) ; } ;
2009-04-24 23:34:47 +00:00
private :
2021-08-30 23:38:55 +00:00
StyleArray _styles ;
2009-04-24 23:34:47 +00:00
generic_string _name ;
generic_string _ext ;
2012-09-28 21:04:16 +00:00
generic_string _udlVersion ;
2021-08-06 20:59:40 +00:00
bool _isDarkModeTheme = false ;
2009-04-24 23:34:47 +00:00
2012-09-28 21:04:16 +00:00
TCHAR _keywordLists [ SCE_USER_KWLIST_TOTAL ] [ max_char ] ;
2021-09-12 13:22:56 +00:00
bool _isPrefix [ SCE_USER_TOTAL_KEYWORD_GROUPS ] = { false } ;
2009-04-24 23:34:47 +00:00
2021-09-12 13:22:56 +00:00
bool _isCaseIgnored = false ;
bool _allowFoldOfComments = false ;
int _forcePureLC = PURE_LC_NONE ;
int _decimalSeparator = DECSEP_DOT ;
bool _foldCompact = false ;
2015-08-14 19:47:47 +00:00
// nakama zone
friend class Notepad_plus ;
friend class ScintillaEditView ;
friend class NppParameters ;
friend class SharedParametersDialog ;
friend class FolderStyleDialog ;
friend class KeyWordsStyleDialog ;
friend class CommentStyleDialog ;
friend class SymbolsStyleDialog ;
friend class UserDefineDialog ;
friend class StylerDlg ;
2009-04-24 23:34:47 +00:00
} ;
2022-04-03 01:52:51 +00:00
# define MAX_EXTERNAL_LEXER_NAME_LEN 128
2022-04-01 17:17:18 +00:00
class ExternalLangContainer final
{
public :
2022-04-03 01:52:51 +00:00
// Mandatory for Lexilla
std : : string _name ;
Lexilla : : CreateLexerFn fnCL = nullptr ;
//Lexilla::GetLibraryPropertyNamesFn fnGLPN = nullptr;
//Lexilla::SetLibraryPropertyFn fnSLP = nullptr;
2022-04-01 17:17:18 +00:00
2022-04-03 01:52:51 +00:00
// For Notepad++
ExternalLexerAutoIndentMode _autoIndentMode = ExternalLexerAutoIndentMode : : Standard ;
2022-04-01 17:17:18 +00:00
} ;
2015-08-14 19:47:47 +00:00
struct FindHistory final
{
2009-04-24 23:34:47 +00:00
enum searchMode { normal , extended , regExpr } ;
enum transparencyMode { none , onLossingFocus , persistant } ;
2018-02-01 09:09:24 +00:00
bool _isSearch2ButtonsMode = false ;
2015-08-14 19:47:47 +00:00
int _nbMaxFindHistoryPath = 10 ;
int _nbMaxFindHistoryFilter = 10 ;
int _nbMaxFindHistoryFind = 10 ;
int _nbMaxFindHistoryReplace = 10 ;
std : : vector < generic_string > _findHistoryPaths ;
2015-05-31 20:40:07 +00:00
std : : vector < generic_string > _findHistoryFilters ;
std : : vector < generic_string > _findHistoryFinds ;
std : : vector < generic_string > _findHistoryReplaces ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
bool _isMatchWord = false ;
bool _isMatchCase = false ;
bool _isWrap = true ;
bool _isDirectionDown = true ;
bool _dotMatchesNewline = false ;
bool _isFifRecuisive = true ;
bool _isFifInHiddenFolder = false ;
2021-02-18 01:54:59 +00:00
bool _isFifProjectPanel_1 = false ;
bool _isFifProjectPanel_2 = false ;
bool _isFifProjectPanel_3 = false ;
2015-08-14 19:47:47 +00:00
searchMode _searchMode = normal ;
transparencyMode _transparencyMode = onLossingFocus ;
int _transparency = 150 ;
bool _isFilterFollowDoc = false ;
bool _isFolderFollowDoc = false ;
2020-06-04 22:56:25 +00:00
// Allow regExpr backward search: this option is not present in UI, only to modify in config.xml
bool _regexBackward4PowerUser = false ;
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 19:47:47 +00:00
class LocalizationSwitcher final
{
friend class NppParameters ;
public :
struct LocalizationDefinition
{
2021-09-12 13:22:56 +00:00
const wchar_t * _langName = nullptr ;
const wchar_t * _xmlFileName = nullptr ;
2009-04-24 23:34:47 +00:00
} ;
2019-06-13 15:54:42 +00:00
bool addLanguageFromXml ( const std : : wstring & xmlFullPath ) ;
2015-05-31 20:40:07 +00:00
std : : wstring getLangFromXmlFileName ( const wchar_t * fn ) const ;
2009-04-24 23:34:47 +00:00
2015-05-31 20:40:07 +00:00
std : : wstring getXmlFilePathFromLangName ( const wchar_t * langName ) const ;
2018-02-05 14:27:32 +00:00
bool switchToLang ( const wchar_t * lang2switch ) const ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
size_t size ( ) const
{
2009-04-24 23:34:47 +00:00
return _localizationList . size ( ) ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
std : : pair < std : : wstring , std : : wstring > getElementFromIndex ( size_t index ) const
{
2009-04-24 23:34:47 +00:00
if ( index > = _localizationList . size ( ) )
2015-08-14 19:47:47 +00:00
return std : : pair < std : : wstring , std : : wstring > ( std : : wstring ( ) , std : : wstring ( ) ) ;
2009-04-24 23:34:47 +00:00
return _localizationList [ index ] ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
void setFileName ( const char * fn )
{
if ( fn )
_fileName = fn ;
}
2009-12-04 00:27:29 +00:00
2015-08-14 19:47:47 +00:00
std : : string getFileName ( ) const
{
return _fileName ;
}
2009-12-04 00:27:29 +00:00
2015-08-14 19:47:47 +00:00
private :
2015-05-31 20:40:07 +00:00
std : : vector < std : : pair < std : : wstring , std : : wstring > > _localizationList ;
std : : wstring _nativeLangPath ;
std : : string _fileName ;
2009-04-24 23:34:47 +00:00
} ;
2015-08-14 19:47:47 +00:00
class ThemeSwitcher final
{
friend class NppParameters ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
public :
2021-06-27 01:05:14 +00:00
void addThemeFromXml ( const generic_string & xmlFullPath ) {
2015-05-31 20:40:07 +00:00
_themeList . push_back ( std : : pair < generic_string , generic_string > ( getThemeFromXmlFileName ( xmlFullPath . c_str ( ) ) , xmlFullPath ) ) ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2021-06-27 01:05:14 +00:00
void addDefaultThemeFromXml ( const generic_string & xmlFullPath ) {
2021-05-10 02:06:27 +00:00
_themeList . push_back ( std : : pair < generic_string , generic_string > ( _defaultThemeLabel , xmlFullPath ) ) ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
generic_string getThemeFromXmlFileName ( const TCHAR * fn ) const ;
2021-06-27 01:05:14 +00:00
generic_string getXmlFilePathFromThemeName ( const TCHAR * themeName ) const {
2009-04-24 23:34:47 +00:00
if ( ! themeName | | themeName [ 0 ] )
2015-08-14 19:47:47 +00:00
return generic_string ( ) ;
2009-04-24 23:34:47 +00:00
generic_string themePath = _stylesXmlPath ;
return themePath ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2021-06-27 01:05:14 +00:00
bool themeNameExists ( const TCHAR * themeName ) {
2013-07-08 00:12:50 +00:00
for ( size_t i = 0 ; i < _themeList . size ( ) ; + + i )
2009-04-24 23:34:47 +00:00
{
2021-06-27 01:05:14 +00:00
auto themeNameOnList = getElementFromIndex ( i ) . first ;
if ( lstrcmp ( themeName , themeNameOnList . c_str ( ) ) = = 0 )
2015-08-14 19:47:47 +00:00
return true ;
2009-04-24 23:34:47 +00:00
}
return false ;
}
2021-06-27 01:05:14 +00:00
size_t size ( ) const { return _themeList . size ( ) ; }
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
std : : pair < generic_string , generic_string > & getElementFromIndex ( size_t index )
{
assert ( index < _themeList . size ( ) ) ;
2009-04-24 23:34:47 +00:00
return _themeList [ index ] ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2021-05-10 02:06:27 +00:00
void setThemeDirPath ( generic_string themeDirPath ) { _themeDirPath = themeDirPath ; }
generic_string getThemeDirPath ( ) const { return _themeDirPath ; }
generic_string getDefaultThemeLabel ( ) const { return _defaultThemeLabel ; }
2021-06-27 01:05:14 +00:00
generic_string getSavePathFrom ( const generic_string & path ) const {
const auto iter = _themeStylerSavePath . find ( path ) ;
if ( iter = = _themeStylerSavePath . end ( ) )
{
return TEXT ( " " ) ;
}
else
{
return iter - > second ;
}
} ;
void addThemeStylerSavePath ( generic_string key , generic_string val ) {
_themeStylerSavePath [ key ] = val ;
} ;
2015-08-14 19:47:47 +00:00
private :
std : : vector < std : : pair < generic_string , generic_string > > _themeList ;
2021-06-27 01:05:14 +00:00
std : : map < generic_string , generic_string > _themeStylerSavePath ;
2021-05-10 02:06:27 +00:00
generic_string _themeDirPath ;
const generic_string _defaultThemeLabel = TEXT ( " Default (stylers.xml) " ) ;
2009-04-24 23:34:47 +00:00
generic_string _stylesXmlPath ;
} ;
2015-08-14 19:47:47 +00:00
2019-02-07 22:40:17 +00:00
struct UdlXmlFileState final {
TiXmlDocument * _udlXmlDoc = nullptr ;
bool _isDirty = false ;
std : : pair < unsigned char , unsigned char > _indexRange ;
UdlXmlFileState ( TiXmlDocument * doc , bool isDirty , std : : pair < unsigned char , unsigned char > range ) : _udlXmlDoc ( doc ) , _isDirty ( isDirty ) , _indexRange ( range ) { } ;
} ;
Add new languages support
Connect Scintilla Lexers to npp : SCLEX_ASN1 (Abstract Syntax Notation One), SCLEX_AVS (AviSynth), SCLEX_BLITZBASIC, SCLEX_PUREBASIC, SCLEX_FREEBASIC, SCLEX_CSOUND, SCLEX_ERLANG, SCLEX_ESCRIPT, SCLEX_FORTH, SCLEX_LATEX, SCLEX_MMIXAL, SCLEX_NIMROD, SCLEX_NNCRONTAB, SCLEX_OSCRIPT, SCLEX_REBOL, SCLEX_REGISTRY, SCLEX_RUST, SCLEX_SPICE, SCLEX_TXT2TAGS
Connect Scintilla Lexers to npp :
asn1 (Abstract Syntax Notation One) : https://fr.wikipedia.org/wiki/ASN.1#Exemple
avs (AviSynth) : http://avisynth.nl/index.php/Script_examples
blitzbasic : http://www.blitzbasic.com/bmdocs/command.php?name=Mid&ref=2d_cat
http://www.blitzbasic.com/codearcs/codearcs.php?cat=8"
csound : http://www.csounds.com/manual/html/PrefaceGettingStarted.html
erlang : http://erlang.org/doc/man/file.html
http://erlang.org/documentation/doc-5.3.6.13/doc/getting_started/getting_started.html"
escript : http://erlang.org/doc/man/escript.html
forth : http://wiki.c2.com/?ExampleForthCode
freebasic : http://www.freebasic.net/
latex : http://physics.clarku.edu/sip/tutorials/TeX/intro.html (Sample LaTeX file)
mmixal : http://mmix.cs.hm.edu/examples/hello.html
nimrod : http://www.csse.monash.edu.au/~nimrod/nimrodportal/manual/planfileexamples.shtml
nncrontab : http://www.nncron.ru/help/EN/working/cron-format.htm
oscript : http://www.oscriptadventures.com/
purebasic : https://www.purebasic.com/documentation/reference/ide_form.html
rebol : http://www.rebol.net/cookbook/recipes/0031.html
registry : windows registry file
rust : http://rustbyexample.com/std_misc/file/open.html
spice : http://www.seas.upenn.edu/~jan/spice/spice.overview.html
txt2tags : https://github.com/txt2tags/txt2tags/blob/master/samples/sample.t2t
2016-11-13 18:42:23 +00:00
const int NB_LANG = 100 ;
2009-04-24 23:34:47 +00:00
2011-06-26 02:09:56 +00:00
const int RECENTFILES_SHOWFULLPATH = - 1 ;
const int RECENTFILES_SHOWONLYFILENAME = 0 ;
2015-08-14 19:47:47 +00:00
class NppParameters final
2009-04-24 23:34:47 +00:00
{
2019-10-05 18:51:29 +00:00
private :
static NppParameters * getInstancePointer ( ) {
static NppParameters * instance = new NppParameters ;
return instance ;
} ;
2009-04-24 23:34:47 +00:00
public :
2019-08-14 20:13:24 +00:00
static NppParameters & getInstance ( ) {
2019-10-05 18:51:29 +00:00
return * getInstancePointer ( ) ;
2019-08-10 21:53:59 +00:00
} ;
2019-10-05 18:51:29 +00:00
2009-04-24 23:34:47 +00:00
static LangType getLangIDFromStr ( const TCHAR * langName ) ;
2013-07-25 17:41:25 +00:00
static generic_string getLocPathFromStr ( const generic_string & localizationCode ) ;
2015-08-14 19:47:47 +00:00
2009-04-24 23:34:47 +00:00
bool load ( ) ;
bool reloadLang ( ) ;
2021-05-10 02:06:27 +00:00
bool reloadStylers ( const TCHAR * stylePath = nullptr ) ;
2015-08-14 19:47:47 +00:00
void destroyInstance ( ) ;
2014-06-02 07:02:46 +00:00
generic_string getSettingsFolder ( ) ;
2009-04-24 23:34:47 +00:00
2016-10-23 01:50:41 +00:00
bool _isTaskListRBUTTONUP_Active = false ;
2022-04-01 17:17:18 +00:00
int L_END ;
2009-04-24 23:34:47 +00:00
2021-04-16 00:37:05 +00:00
NppGUI & getNppGUI ( ) {
2015-08-14 19:47:47 +00:00
return _nppGUI ;
}
const TCHAR * getWordList ( LangType langID , int typeIndex ) const
{
Lang * pLang = getLangFromID ( langID ) ;
if ( ! pLang ) return nullptr ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
return pLang - > getWords ( typeIndex ) ;
}
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
Lang * getLangFromID ( LangType langID ) const
{
2013-07-08 00:12:50 +00:00
for ( int i = 0 ; i < _nbLang ; + + i )
2009-04-24 23:34:47 +00:00
{
2017-06-14 09:33:35 +00:00
if ( _langList [ i ] & & _langList [ i ] - > _langID = = langID )
2009-04-24 23:34:47 +00:00
return _langList [ i ] ;
}
2015-08-14 19:47:47 +00:00
return nullptr ;
}
2009-04-24 23:34:47 +00:00
2016-06-05 18:29:21 +00:00
Lang * getLangFromIndex ( size_t i ) const {
return ( i < size_t ( _nbLang ) ) ? _langList [ i ] : nullptr ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
int getNbLang ( ) const { return _nbLang ; } ;
2015-08-14 19:47:47 +00:00
2009-11-26 01:34:25 +00:00
LangType getLangFromExt ( const TCHAR * ext ) ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
const TCHAR * getLangExtFromName ( const TCHAR * langName ) const
{
2013-07-08 00:12:50 +00:00
for ( int i = 0 ; i < _nbLang ; + + i )
2009-04-24 23:34:47 +00:00
{
2009-08-03 00:37:30 +00:00
if ( _langList [ i ] - > _langName = = langName )
2009-04-24 23:34:47 +00:00
return _langList [ i ] - > _defaultExtList ;
}
2015-08-14 19:47:47 +00:00
return nullptr ;
}
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
const TCHAR * getLangExtFromLangType ( LangType langType ) const
{
2013-07-08 00:12:50 +00:00
for ( int i = 0 ; i < _nbLang ; + + i )
2009-04-24 23:34:47 +00:00
{
if ( _langList [ i ] - > _langID = = langType )
return _langList [ i ] - > _defaultExtList ;
}
2015-08-14 19:47:47 +00:00
return nullptr ;
}
2009-04-24 23:34:47 +00:00
2011-06-26 02:09:56 +00:00
int getNbLRFile ( ) const { return _nbRecentFile ; } ;
2009-04-24 23:34:47 +00:00
generic_string * getLRFile ( int index ) const {
return _LRFileList [ index ] ;
} ;
2011-06-26 02:09:56 +00:00
void setNbMaxRecentFile ( int nb ) {
_nbMaxRecentFile = nb ;
} ;
int getNbMaxRecentFile ( ) const { return _nbMaxRecentFile ; } ;
void setPutRecentFileInSubMenu ( bool doSubmenu ) {
_putRecentFileInSubMenu = doSubmenu ;
2015-08-14 19:47:47 +00:00
}
2011-06-26 02:09:56 +00:00
2011-06-27 01:23:58 +00:00
bool putRecentFileInSubMenu ( ) const { return _putRecentFileInSubMenu ; } ;
2011-06-26 02:09:56 +00:00
void setRecentFileCustomLength ( int len ) {
_recentFileCustomLength = len ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2011-06-26 02:09:56 +00:00
int getRecentFileCustomLength ( ) const { return _recentFileCustomLength ; } ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
const ScintillaViewParams & getSVP ( ) const {
return _svp ;
}
2009-04-24 23:34:47 +00:00
2011-06-27 01:23:58 +00:00
bool writeRecentFileHistorySettings ( int nbMaxFile = - 1 ) const ;
2009-04-24 23:34:47 +00:00
bool writeHistory ( const TCHAR * fullpath ) ;
2011-09-25 01:33:34 +00:00
bool writeProjectPanelsSettings ( ) const ;
2016-02-02 18:06:23 +00:00
bool writeFileBrowserSettings ( const std : : vector < generic_string > & rootPath , const generic_string & latestSelectedItemPath ) const ;
2011-09-25 01:33:34 +00:00
2015-08-14 19:47:47 +00:00
TiXmlNode * getChildElementByAttribut ( TiXmlNode * pere , const TCHAR * childName , const TCHAR * attributName , const TCHAR * attributVal ) const ;
2009-04-24 23:34:47 +00:00
2016-10-23 01:50:41 +00:00
bool writeScintillaParams ( ) ;
void createXmlTreeFromGUIParams ( ) ;
2009-04-24 23:34:47 +00:00
2021-06-27 01:05:14 +00:00
generic_string writeStyles ( LexerStylerArray & lexersStylers , StyleArray & globalStylers ) ; // return "" if saving file succeeds, otherwise return the new saved file path
2015-08-14 19:47:47 +00:00
bool insertTabInfo ( const TCHAR * langName , int tabInfo ) ;
2009-04-24 23:34:47 +00:00
2021-08-30 23:38:55 +00:00
LexerStylerArray & getLStylerArray ( ) { return _lexerStylerVect ; } ;
2015-08-14 19:47:47 +00:00
StyleArray & getGlobalStylers ( ) { return _widgetStyleArray ; } ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
StyleArray & getMiscStylerArray ( ) { return _widgetStyleArray ; } ;
2009-04-24 23:34:47 +00:00
GlobalOverride & getGlobalOverrideStyle ( ) { return _nppGUI . _globalOverride ; } ;
2015-08-14 19:47:47 +00:00
COLORREF getCurLineHilitingColour ( ) ;
void setCurLineHilitingColour ( COLORREF colour2Set ) ;
2009-04-24 23:34:47 +00:00
void setFontList ( HWND hWnd ) ;
2019-06-13 15:54:42 +00:00
bool isInFontList ( const generic_string & fontName2Search ) const ;
2015-08-14 19:47:47 +00:00
const std : : vector < generic_string > & getFontList ( ) const { return _fontlist ; }
2021-02-22 13:55:45 +00:00
HFONT getDefaultUIFont ( ) ;
2015-08-14 19:47:47 +00:00
int getNbUserLang ( ) const { return _nbUserLang ; }
2016-06-05 18:29:21 +00:00
UserLangContainer & getULCFromIndex ( size_t i ) { return * _userLangArray [ i ] ; } ;
2015-08-14 19:47:47 +00:00
UserLangContainer * getULCFromName ( const TCHAR * userLangName ) ;
2022-04-01 17:17:18 +00:00
int getNbExternalLang ( ) const { return _nbExternalLang ; } ;
int getExternalLangIndexFromName ( const TCHAR * externalLangName ) const ;
ExternalLangContainer & getELCFromIndex ( int i ) { return * _externalLangArray [ i ] ; } ;
bool ExternalLangHasRoom ( ) const { return _nbExternalLang < NB_MAX_EXTERNAL_LANG ; } ;
2022-04-09 14:58:54 +00:00
void getExternalLexerFromXmlTree ( TiXmlDocument * externalLexerDoc ) ;
2022-04-01 17:17:18 +00:00
std : : vector < TiXmlDocument * > * getExternalLexerDoc ( ) { return & _pXmlExternalLexerDoc ; } ;
2019-02-07 22:40:17 +00:00
void writeDefaultUDL ( ) ;
void writeNonDefaultUDL ( ) ;
void writeNeed2SaveUDL ( ) ;
2009-04-24 23:34:47 +00:00
void writeShortcuts ( ) ;
void writeSession ( const Session & session , const TCHAR * fileName = NULL ) ;
bool writeFindHistory ( ) ;
2015-08-14 19:47:47 +00:00
bool isExistingUserLangName ( const TCHAR * newName ) const
{
2009-04-24 23:34:47 +00:00
if ( ( ! newName ) | | ( ! newName [ 0 ] ) )
return true ;
2013-07-08 00:12:50 +00:00
for ( int i = 0 ; i < _nbUserLang ; + + i )
2009-04-24 23:34:47 +00:00
{
if ( ! lstrcmp ( _userLangArray [ i ] - > _name . c_str ( ) , newName ) )
return true ;
}
return false ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
const TCHAR * getUserDefinedLangNameFromExt ( TCHAR * ext , TCHAR * fullName ) const ;
2009-04-24 23:34:47 +00:00
int addUserLangToEnd ( const UserLangContainer & userLang , const TCHAR * newName ) ;
2016-06-05 18:29:21 +00:00
void removeUserLang ( size_t index ) ;
2009-04-24 23:34:47 +00:00
2022-04-03 01:52:51 +00:00
bool isExistingExternalLangName ( const char * newName ) const ;
2022-04-01 17:17:18 +00:00
int addExternalLangToEnd ( ExternalLangContainer * externalLang ) ;
2009-04-24 23:34:47 +00:00
TiXmlDocumentA * getNativeLangA ( ) const { return _pXmlNativeLangDocA ; } ;
2022-05-24 15:57:38 +00:00
TiXmlDocument * getCustomizedToolIcons ( ) const { return _pXmlToolIconsDoc ; } ;
2009-04-24 23:34:47 +00:00
bool isTransparentAvailable ( ) const {
return ( _transparentFuncAddr ! = NULL ) ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2012-01-30 00:00:50 +00:00
// 0 <= percent < 256
// if (percent == 255) then opacq
2015-08-14 19:47:47 +00:00
void SetTransparent ( HWND hwnd , int percent ) ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
void removeTransparent ( HWND hwnd ) ;
2009-04-24 23:34:47 +00:00
2018-07-02 18:48:40 +00:00
void setCmdlineParam ( const CmdLineParamsDTO & cmdLineParams )
2015-08-14 19:47:47 +00:00
{
2009-04-24 23:34:47 +00:00
_cmdLineParams = cmdLineParams ;
2015-08-14 19:47:47 +00:00
}
2022-04-27 02:32:24 +00:00
2018-07-02 18:48:40 +00:00
const CmdLineParamsDTO & getCmdLineParams ( ) const { return _cmdLineParams ; } ;
2009-04-24 23:34:47 +00:00
2021-03-06 10:14:24 +00:00
const generic_string & getCmdLineString ( ) const { return _cmdLineString ; }
void setCmdLineString ( const generic_string & str ) { _cmdLineString = str ; }
2009-04-24 23:34:47 +00:00
void setFileSaveDlgFilterIndex ( int ln ) { _fileSaveDlgFilterIndex = ln ; } ;
int getFileSaveDlgFilterIndex ( ) const { return _fileSaveDlgFilterIndex ; } ;
bool isRemappingShortcut ( ) const { return _shortcuts . size ( ) ! = 0 ; } ;
2015-05-31 20:40:07 +00:00
std : : vector < CommandShortcut > & getUserShortcuts ( ) { return _shortcuts ; } ;
2016-07-23 09:37:58 +00:00
std : : vector < size_t > & getUserModifiedShortcuts ( ) { return _customizedShortcuts ; } ;
void addUserModifiedIndex ( size_t index ) ;
2009-04-24 23:34:47 +00:00
2015-05-31 20:40:07 +00:00
std : : vector < MacroShortcut > & getMacroList ( ) { return _macros ; } ;
std : : vector < UserCommand > & getUserCommandList ( ) { return _userCommands ; } ;
std : : vector < PluginCmdShortcut > & getPluginCommandList ( ) { return _pluginCommands ; } ;
2016-07-23 09:37:58 +00:00
std : : vector < size_t > & getPluginModifiedKeyIndices ( ) { return _pluginCustomizedCmds ; } ;
void addPluginModifiedIndex ( size_t index ) ;
2009-04-24 23:34:47 +00:00
2015-05-31 20:40:07 +00:00
std : : vector < ScintillaKeyMap > & getScintillaKeyList ( ) { return _scintillaKeyCommands ; } ;
std : : vector < int > & getScintillaModifiedKeyIndices ( ) { return _scintillaModifiedKeyIndices ; } ;
2009-04-24 23:34:47 +00:00
void addScintillaModifiedIndex ( int index ) ;
2015-05-31 20:40:07 +00:00
std : : vector < MenuItemUnit > & getContextMenuItems ( ) { return _contextMenuItems ; } ;
2009-04-24 23:34:47 +00:00
const Session & getSession ( ) const { return _session ; } ;
2013-02-18 23:13:18 +00:00
2009-04-24 23:34:47 +00:00
bool hasCustomContextMenu ( ) const { return ! _contextMenuItems . empty ( ) ; } ;
void setAccelerator ( Accelerator * pAccel ) { _pAccelerator = pAccel ; } ;
Accelerator * getAccelerator ( ) { return _pAccelerator ; } ;
void setScintillaAccelerator ( ScintillaAccelerator * pScintAccel ) { _pScintAccelerator = pScintAccel ; } ;
2015-08-14 19:47:47 +00:00
ScintillaAccelerator * getScintillaAccelerator ( ) { return _pScintAccelerator ; } ;
2009-04-24 23:34:47 +00:00
2009-08-03 00:37:30 +00:00
generic_string getNppPath ( ) const { return _nppPath ; } ;
2015-08-14 19:47:47 +00:00
generic_string getContextMenuPath ( ) const { return _contextMenuPath ; } ;
2009-08-11 23:55:57 +00:00
const TCHAR * getAppDataNppDir ( ) const { return _appdataNppDir . c_str ( ) ; } ;
2018-11-07 21:39:36 +00:00
const TCHAR * getPluginRootDir ( ) const { return _pluginRootDir . c_str ( ) ; } ;
2018-12-04 12:38:25 +00:00
const TCHAR * getPluginConfDir ( ) const { return _pluginConfDir . c_str ( ) ; } ;
const TCHAR * getUserPluginConfDir ( ) const { return _userPluginConfDir . c_str ( ) ; } ;
2009-08-11 23:55:57 +00:00
const TCHAR * getWorkingDir ( ) const { return _currentDirectory . c_str ( ) ; } ;
2016-02-02 18:06:23 +00:00
const TCHAR * getWorkSpaceFilePath ( int i ) const {
2015-08-14 19:47:47 +00:00
if ( i < 0 | | i > 2 ) return nullptr ;
2011-09-25 01:33:34 +00:00
return _workSpaceFilePathes [ i ] . c_str ( ) ;
2018-11-07 21:39:36 +00:00
} ;
2016-02-02 18:06:23 +00:00
const std : : vector < generic_string > getFileBrowserRoots ( ) const { return _fileBrowserRoot ; } ;
2020-09-18 22:36:03 +00:00
generic_string getFileBrowserSelectedItemPath ( ) const { return _fileBrowserSelectedItemPath ; } ;
2015-08-14 19:47:47 +00:00
void setWorkSpaceFilePath ( int i , const TCHAR * wsFile ) ;
2011-09-25 01:33:34 +00:00
2009-04-24 23:34:47 +00:00
void setWorkingDir ( const TCHAR * newPath ) ;
2019-06-13 15:54:42 +00:00
void setStartWithLocFileName ( const generic_string & locPath ) {
2013-07-25 17:41:25 +00:00
_startWithLocFileName = locPath ;
2017-08-05 22:03:18 +00:00
} ;
void setFunctionListExportBoolean ( bool doIt ) {
_doFunctionListExport = doIt ;
} ;
bool doFunctionListExport ( ) const {
return _doFunctionListExport ;
} ;
2013-07-25 17:41:25 +00:00
2017-08-06 22:01:12 +00:00
void setPrintAndExitBoolean ( bool doIt ) {
_doPrintAndExit = doIt ;
} ;
bool doPrintAndExit ( ) const {
return _doPrintAndExit ;
} ;
2009-04-24 23:34:47 +00:00
bool loadSession ( Session & session , const TCHAR * sessionFileName ) ;
2021-12-22 18:32:55 +00:00
void setLoadedSessionFilePath ( const generic_string & loadedSessionFilePath ) {
_loadedSessionFullFilePath = loadedSessionFilePath ;
} ;
generic_string getLoadedSessionFilePath ( ) {
return _loadedSessionFullFilePath ;
} ;
2009-04-24 23:34:47 +00:00
int langTypeToCommandID ( LangType lt ) const ;
WNDPROC getEnableThemeDlgTexture ( ) const { return _enableThemeDialogTextureFuncAddr ; } ;
2011-01-19 21:05:40 +00:00
2016-02-02 18:06:23 +00:00
struct FindDlgTabTitiles final {
2009-04-24 23:34:47 +00:00
generic_string _find ;
generic_string _replace ;
generic_string _findInFiles ;
2021-02-18 01:54:59 +00:00
generic_string _findInProjects ;
2011-01-19 21:05:40 +00:00
generic_string _mark ;
2009-04-24 23:34:47 +00:00
} ;
FindDlgTabTitiles & getFindDlgTabTitiles ( ) { return _findDlgTabTitiles ; } ;
bool asNotepadStyle ( ) const { return _asNotepadStyle ; } ;
2016-02-02 18:06:23 +00:00
bool reloadPluginCmds ( ) {
2009-04-24 23:34:47 +00:00
return getPluginCmdsFromXmlTree ( ) ;
}
2010-10-30 15:38:51 +00:00
bool getContextMenuFromXmlTree ( HMENU mainMenuHadle , HMENU pluginsMenu ) ;
bool reloadContextMenuFromXmlTree ( HMENU mainMenuHadle , HMENU pluginsMenu ) ;
2015-12-06 22:20:14 +00:00
winVer getWinVersion ( ) const { return _winVersion ; } ;
generic_string getWinVersionStr ( ) const ;
2017-02-10 11:49:04 +00:00
generic_string getWinVerBitStr ( ) const ;
2009-04-24 23:34:47 +00:00
FindHistory & getFindHistory ( ) { return _findHistory ; } ;
2016-10-23 01:50:41 +00:00
bool _isFindReplacing = false ; // an on the fly variable for find/replace functions
2010-11-01 16:08:43 +00:00
void safeWow64EnableWow64FsRedirection ( BOOL Wow64FsEnableRedirection ) ;
2015-08-14 19:47:47 +00:00
2009-04-24 23:34:47 +00:00
LocalizationSwitcher & getLocalizationSwitcher ( ) {
return _localizationSwitcher ;
2015-08-14 19:47:47 +00:00
}
2014-07-16 11:20:58 +00:00
2009-04-24 23:34:47 +00:00
ThemeSwitcher & getThemeSwitcher ( ) {
return _themeSwitcher ;
2015-08-14 19:47:47 +00:00
}
2009-04-24 23:34:47 +00:00
2015-05-31 20:40:07 +00:00
std : : vector < generic_string > & getBlackList ( ) { return _blacklist ; } ;
2015-08-14 19:47:47 +00:00
bool isInBlackList ( TCHAR * fn ) const
{
for ( auto & element : _blacklist )
{
if ( element = = fn )
return true ;
}
return false ;
}
2019-06-13 15:54:42 +00:00
bool importUDLFromFile ( const generic_string & sourceFile ) ;
bool exportUDLToFile ( size_t langIndex2export , const generic_string & fileName2save ) ;
2015-08-14 19:47:47 +00:00
NativeLangSpeaker * getNativeLangSpeaker ( ) {
2011-01-22 23:53:35 +00:00
return _pNativeLangSpeaker ;
2015-08-14 19:47:47 +00:00
}
2011-01-22 23:53:35 +00:00
void setNativeLangSpeaker ( NativeLangSpeaker * nls ) {
_pNativeLangSpeaker = nls ;
2015-08-14 19:47:47 +00:00
}
2009-10-02 18:47:27 +00:00
2011-11-16 23:24:11 +00:00
bool isLocal ( ) const {
return _isLocal ;
} ;
2015-08-14 19:47:47 +00:00
void saveConfig_xml ( ) ;
2012-08-23 22:43:07 +00:00
2013-01-18 01:48:30 +00:00
generic_string getUserPath ( ) const {
return _userPath ;
2015-08-14 19:47:47 +00:00
}
2013-01-18 01:48:30 +00:00
2019-11-21 01:24:57 +00:00
generic_string getUserDefineLangFolderPath ( ) const {
return _userDefineLangsFolderPath ;
}
generic_string getUserDefineLangPath ( ) const {
return _userDefineLangPath ;
}
2015-07-06 17:06:46 +00:00
bool writeSettingsFilesOnCloudForThe1stTime ( const generic_string & cloudSettingsPath ) ;
void setCloudChoice ( const TCHAR * pathChoice ) ;
void removeCloudChoice ( ) ;
bool isCloudPathChanged ( ) const ;
2021-04-22 03:20:54 +00:00
int archType ( ) const { return ARCH_TYPE ; } ;
2014-07-16 11:20:58 +00:00
COLORREF getCurrentDefaultBgColor ( ) const {
return _currentDefaultBgColor ;
2015-08-14 19:47:47 +00:00
}
2014-07-16 11:20:58 +00:00
COLORREF getCurrentDefaultFgColor ( ) const {
return _currentDefaultFgColor ;
2015-08-14 19:47:47 +00:00
}
2014-07-16 11:20:58 +00:00
void setCurrentDefaultBgColor ( COLORREF c ) {
_currentDefaultBgColor = c ;
2015-08-14 19:47:47 +00:00
}
2014-07-16 11:20:58 +00:00
void setCurrentDefaultFgColor ( COLORREF c ) {
_currentDefaultFgColor = c ;
2015-08-14 19:47:47 +00:00
}
2014-07-16 11:20:58 +00:00
2020-12-21 02:40:43 +00:00
void setCmdSettingsDir ( const generic_string & settingsDir ) {
_cmdSettingsDir = settingsDir ;
} ;
2021-03-24 15:01:09 +00:00
void setTitleBarAdd ( const generic_string & titleAdd )
{
_titleBarAdditional = titleAdd ;
}
const generic_string & getTitleBarAdd ( ) const
{
return _titleBarAdditional ;
}
2014-02-11 00:26:24 +00:00
DPIManager _dpiManager ;
2017-02-09 23:08:29 +00:00
generic_string static getSpecialFolderLocation ( int folderKind ) ;
2019-02-07 22:40:17 +00:00
void setUdlXmlDirtyFromIndex ( size_t i ) ;
void setUdlXmlDirtyFromXmlDoc ( const TiXmlDocument * xmlDoc ) ;
void removeIndexFromXmlUdls ( size_t i ) ;
2022-07-02 15:19:17 +00:00
bool isStylerDocLoaded ( ) const { return _pXmlUserStylerDoc ! = nullptr ; } ;
2015-08-14 19:47:47 +00:00
2009-04-24 23:34:47 +00:00
private :
2015-08-14 19:47:47 +00:00
NppParameters ( ) ;
2009-04-24 23:34:47 +00:00
~ NppParameters ( ) ;
2019-08-11 03:28:28 +00:00
// No copy ctor and assignment
NppParameters ( const NppParameters & ) = delete ;
NppParameters & operator = ( const NppParameters & ) = delete ;
// No move ctor and assignment
NppParameters ( NppParameters & & ) = delete ;
NppParameters & operator = ( NppParameters & & ) = delete ;
2019-10-03 12:05:50 +00:00
2022-04-09 14:58:54 +00:00
TiXmlDocument * _pXmlDoc = nullptr ; // langs.xml
TiXmlDocument * _pXmlUserDoc = nullptr ; // config.xml
TiXmlDocument * _pXmlUserStylerDoc = nullptr ; // stylers.xml
TiXmlDocument * _pXmlUserLangDoc = nullptr ; // userDefineLang.xml
std : : vector < UdlXmlFileState > _pXmlUserLangsDoc ; // userDefineLang customized XMLs
TiXmlDocument * _pXmlToolIconsDoc = nullptr ; // toolbarIcons.xml
TiXmlDocument * _pXmlShortcutDoc = nullptr ; // shortcuts.xml
TiXmlDocument * _pXmlBlacklistDoc = nullptr ; // not implemented
2016-10-23 01:50:41 +00:00
2022-04-09 14:58:54 +00:00
TiXmlDocumentA * _pXmlNativeLangDocA = nullptr ; // nativeLang.xml
TiXmlDocumentA * _pXmlContextMenuDocA = nullptr ; // contextMenu.xml
2009-04-24 23:34:47 +00:00
2022-04-09 14:58:54 +00:00
std : : vector < TiXmlDocument * > _pXmlExternalLexerDoc ; // External lexer plugins' XMLs
2022-04-01 17:17:18 +00:00
2009-04-24 23:34:47 +00:00
NppGUI _nppGUI ;
2010-07-27 15:59:20 +00:00
ScintillaViewParams _svp ;
2021-09-12 13:22:56 +00:00
Lang * _langList [ NB_LANG ] = { nullptr } ;
2016-10-23 01:50:41 +00:00
int _nbLang = 0 ;
2009-04-24 23:34:47 +00:00
2011-06-26 02:09:56 +00:00
// Recent File History
2021-09-12 13:22:56 +00:00
generic_string * _LRFileList [ NB_MAX_LRF_FILE ] = { nullptr } ;
2016-10-23 01:50:41 +00:00
int _nbRecentFile = 0 ;
int _nbMaxRecentFile = 10 ;
bool _putRecentFileInSubMenu = false ;
int _recentFileCustomLength = RECENTFILES_SHOWFULLPATH ; // <0: Full File Path Name
// =0: Only File Name
// >0: Custom Entry Length
2009-04-24 23:34:47 +00:00
FindHistory _findHistory ;
2021-09-12 13:22:56 +00:00
UserLangContainer * _userLangArray [ NB_MAX_USER_LANG ] = { nullptr } ;
2019-02-07 22:40:17 +00:00
unsigned char _nbUserLang = 0 ; // won't be exceeded to 255;
2019-11-21 01:24:57 +00:00
generic_string _userDefineLangsFolderPath ;
2009-08-11 23:55:57 +00:00
generic_string _userDefineLangPath ;
2022-04-01 17:17:18 +00:00
ExternalLangContainer * _externalLangArray [ NB_MAX_EXTERNAL_LANG ] = { nullptr } ;
2016-10-23 01:50:41 +00:00
int _nbExternalLang = 0 ;
2009-04-24 23:34:47 +00:00
2018-07-02 18:48:40 +00:00
CmdLineParamsDTO _cmdLineParams ;
2021-03-06 10:14:24 +00:00
generic_string _cmdLineString ;
2009-04-24 23:34:47 +00:00
2016-10-23 01:50:41 +00:00
int _fileSaveDlgFilterIndex = - 1 ;
2009-04-24 23:34:47 +00:00
2015-08-14 19:47:47 +00:00
// All Styles (colours & fonts)
2021-08-30 23:38:55 +00:00
LexerStylerArray _lexerStylerVect ;
2015-08-14 19:47:47 +00:00
StyleArray _widgetStyleArray ;
2009-04-24 23:34:47 +00:00
2015-05-31 20:40:07 +00:00
std : : vector < generic_string > _fontlist ;
std : : vector < generic_string > _blacklist ;
2009-04-24 23:34:47 +00:00
2016-10-23 01:50:41 +00:00
HMODULE _hUXTheme = nullptr ;
2009-04-24 23:34:47 +00:00
2016-10-23 01:50:41 +00:00
WNDPROC _transparentFuncAddr = nullptr ;
WNDPROC _enableThemeDialogTextureFuncAddr = nullptr ;
2021-09-12 13:22:56 +00:00
bool _isLocal = false ;
2016-06-16 23:10:32 +00:00
bool _isx64 = false ; // by default 32-bit
2009-04-24 23:34:47 +00:00
2020-12-21 02:40:43 +00:00
generic_string _cmdSettingsDir ;
2021-03-24 15:01:09 +00:00
generic_string _titleBarAdditional ;
2021-12-22 18:32:55 +00:00
generic_string _loadedSessionFullFilePath ;
2015-08-29 19:49:49 +00:00
public :
void setShortcutDirty ( ) { _isAnyShortcutModified = true ; } ;
2019-12-26 19:35:16 +00:00
void setAdminMode ( bool isAdmin ) { _isAdminMode = isAdmin ; }
bool isAdmin ( ) const { return _isAdminMode ; }
2020-06-04 22:56:25 +00:00
bool regexBackward4PowerUser ( ) const { return _findHistory . _regexBackward4PowerUser ; }
2021-05-01 18:02:09 +00:00
bool isSelectFgColorEnabled ( ) const { return _isSelectFgColorEnabled ; } ;
2019-12-26 19:35:16 +00:00
2015-08-29 19:49:49 +00:00
private :
bool _isAnyShortcutModified = false ;
2015-05-31 20:40:07 +00:00
std : : vector < CommandShortcut > _shortcuts ; //main menu shortuts. Static size
2016-07-23 09:37:58 +00:00
std : : vector < size_t > _customizedShortcuts ; //altered main menu shortcuts. Indices static. Needed when saving alterations
2015-05-31 20:40:07 +00:00
std : : vector < MacroShortcut > _macros ; //macro shortcuts, dynamic size, defined on loading macros and adding/deleting them
std : : vector < UserCommand > _userCommands ; //run shortcuts, dynamic size, defined on loading run commands and adding/deleting them
std : : vector < PluginCmdShortcut > _pluginCommands ; //plugin commands, dynamic size, defined on loading plugins
2016-07-23 09:37:58 +00:00
std : : vector < size_t > _pluginCustomizedCmds ; //plugincommands that have been altered. Indices determined after loading ALL plugins. Needed when saving alterations
2009-04-24 23:34:47 +00:00
2015-05-31 20:40:07 +00:00
std : : vector < ScintillaKeyMap > _scintillaKeyCommands ; //scintilla keycommands. Static size
std : : vector < int > _scintillaModifiedKeyIndices ; //modified scintilla keys. Indices static, determined by searching for commandId. Needed when saving alterations
2013-07-25 17:41:25 +00:00
2009-04-24 23:34:47 +00:00
LocalizationSwitcher _localizationSwitcher ;
2013-07-25 17:41:25 +00:00
generic_string _startWithLocFileName ;
2017-08-05 22:03:18 +00:00
bool _doFunctionListExport = false ;
2017-08-06 22:01:12 +00:00
bool _doPrintAndExit = false ;
2013-07-25 17:41:25 +00:00
2009-04-24 23:34:47 +00:00
ThemeSwitcher _themeSwitcher ;
//vector<generic_string> _noMenuCmdNames;
2015-05-31 20:40:07 +00:00
std : : vector < MenuItemUnit > _contextMenuItems ;
2009-04-24 23:34:47 +00:00
Session _session ;
2009-08-11 23:55:57 +00:00
generic_string _shortcutsPath ;
generic_string _contextMenuPath ;
generic_string _sessionPath ;
2009-08-03 00:37:30 +00:00
generic_string _nppPath ;
2009-08-11 23:55:57 +00:00
generic_string _userPath ;
generic_string _stylerPath ;
generic_string _appdataNppDir ; // sentinel of the absence of "doLocalConf.xml" : (_appdataNppDir == TEXT(""))?"doLocalConf.xml present":"doLocalConf.xml absent"
2018-12-04 12:38:25 +00:00
generic_string _pluginRootDir ; // plugins root where all the plugins are installed
generic_string _pluginConfDir ; // plugins config dir where the plugin list is installed
generic_string _userPluginConfDir ; // plugins config dir for per user where the plugin parameters are saved / loaded
2009-08-11 23:55:57 +00:00
generic_string _currentDirectory ;
2011-09-25 01:33:34 +00:00
generic_string _workSpaceFilePathes [ 3 ] ;
2009-04-24 23:34:47 +00:00
2016-02-02 18:06:23 +00:00
std : : vector < generic_string > _fileBrowserRoot ;
2020-09-18 22:36:03 +00:00
generic_string _fileBrowserSelectedItemPath ;
2016-02-02 18:06:23 +00:00
2021-09-12 13:22:56 +00:00
Accelerator * _pAccelerator = nullptr ;
ScintillaAccelerator * _pScintAccelerator = nullptr ;
2009-04-24 23:34:47 +00:00
FindDlgTabTitiles _findDlgTabTitiles ;
2016-10-23 01:50:41 +00:00
bool _asNotepadStyle = false ;
2009-04-24 23:34:47 +00:00
2021-09-12 13:22:56 +00:00
winVer _winVersion = WV_UNKNOWN ;
Platform _platForm = PF_UNKNOWN ;
2009-04-24 23:34:47 +00:00
2016-10-23 01:50:41 +00:00
NativeLangSpeaker * _pNativeLangSpeaker = nullptr ;
2011-01-19 21:05:40 +00:00
2021-09-12 13:22:56 +00:00
COLORREF _currentDefaultBgColor = RGB ( 0xFF , 0xFF , 0xFF ) ;
COLORREF _currentDefaultFgColor = RGB ( 0x00 , 0x00 , 0x00 ) ;
2014-07-16 11:20:58 +00:00
2015-07-06 17:06:46 +00:00
generic_string _initialCloudChoice ;
2018-09-13 21:07:22 +00:00
generic_string _wingupFullPath ;
generic_string _wingupParams ;
generic_string _wingupDir ;
2018-11-24 15:26:24 +00:00
bool _isElevationRequired = false ;
2019-12-26 19:35:16 +00:00
bool _isAdminMode = false ;
2018-09-13 21:07:22 +00:00
2021-05-01 18:02:09 +00:00
bool _isSelectFgColorEnabled = false ;
Fix saving file and false alert on network drive issues
And add log ability for debugging network drive file status detection issue.
To activate log, user should:
1. Add an empty "nppLogNetworkDriveIssue.xml" file beside of notepad++.exe, or if user has no admin previlege, he/she can add this file into %APPDATA%\Notepad++\.
2. Create "C:\temp\" directory, if it doesn't exist yet.
3. Start notepad++.exe, and wait for the file status (timestamp) detection error from the network drive. If the errors occur, there should be some trace in "C:\temp\nppLogNetworkDriveIssue.log".
People who have had the network drive file status detection issue in #10688, #10753, #10757, #10751 & #10787 are welcome to download the binary and provide the generated log in order to fix this issue.
Fix #10751, fix #10688, fix #10753, fix #10757, fix #10751, fix #10787, close #10847
2021-11-28 01:00:31 +00:00
bool _doNppLogNetworkDriveIssue = false ;
2021-12-02 02:55:24 +00:00
bool _doNppLogNulContentCorruptionIssue = false ;
bool _isQueryEndSessionStarted = false ;
2018-09-13 21:07:22 +00:00
public :
generic_string getWingupFullPath ( ) const { return _wingupFullPath ; } ;
generic_string getWingupParams ( ) const { return _wingupParams ; } ;
generic_string getWingupDir ( ) const { return _wingupDir ; } ;
2018-11-24 15:26:24 +00:00
bool shouldDoUAC ( ) const { return _isElevationRequired ; } ;
2018-09-13 21:07:22 +00:00
void setWingupFullPath ( const generic_string & val2set ) { _wingupFullPath = val2set ; } ;
void setWingupParams ( const generic_string & val2set ) { _wingupParams = val2set ; } ;
void setWingupDir ( const generic_string & val2set ) { _wingupDir = val2set ; } ;
2018-11-24 15:26:24 +00:00
void setElevationRequired ( bool val2set ) { _isElevationRequired = val2set ; } ;
2018-09-13 21:07:22 +00:00
Fix saving file and false alert on network drive issues
And add log ability for debugging network drive file status detection issue.
To activate log, user should:
1. Add an empty "nppLogNetworkDriveIssue.xml" file beside of notepad++.exe, or if user has no admin previlege, he/she can add this file into %APPDATA%\Notepad++\.
2. Create "C:\temp\" directory, if it doesn't exist yet.
3. Start notepad++.exe, and wait for the file status (timestamp) detection error from the network drive. If the errors occur, there should be some trace in "C:\temp\nppLogNetworkDriveIssue.log".
People who have had the network drive file status detection issue in #10688, #10753, #10757, #10751 & #10787 are welcome to download the binary and provide the generated log in order to fix this issue.
Fix #10751, fix #10688, fix #10753, fix #10757, fix #10751, fix #10787, close #10847
2021-11-28 01:00:31 +00:00
bool doNppLogNetworkDriveIssue ( ) { return _doNppLogNetworkDriveIssue ; } ;
2021-12-02 02:55:24 +00:00
bool doNppLogNulContentCorruptionIssue ( ) { return _doNppLogNulContentCorruptionIssue ; } ;
void queryEndSessionStart ( ) { _isQueryEndSessionStarted = true ; } ;
bool isQueryEndSessionStarted ( ) { return _isQueryEndSessionStarted ; } ;
Fix saving file and false alert on network drive issues
And add log ability for debugging network drive file status detection issue.
To activate log, user should:
1. Add an empty "nppLogNetworkDriveIssue.xml" file beside of notepad++.exe, or if user has no admin previlege, he/she can add this file into %APPDATA%\Notepad++\.
2. Create "C:\temp\" directory, if it doesn't exist yet.
3. Start notepad++.exe, and wait for the file status (timestamp) detection error from the network drive. If the errors occur, there should be some trace in "C:\temp\nppLogNetworkDriveIssue.log".
People who have had the network drive file status detection issue in #10688, #10753, #10757, #10751 & #10787 are welcome to download the binary and provide the generated log in order to fix this issue.
Fix #10751, fix #10688, fix #10753, fix #10757, fix #10751, fix #10787, close #10847
2021-11-28 01:00:31 +00:00
2018-09-13 21:07:22 +00:00
private :
2009-04-24 23:34:47 +00:00
void getLangKeywordsFromXmlTree ( ) ;
bool getUserParametersFromXmlTree ( ) ;
bool getUserStylersFromXmlTree ( ) ;
2019-02-07 22:40:17 +00:00
std : : pair < unsigned char , unsigned char > addUserDefineLangsFromXmlTree ( TiXmlDocument * tixmldoc ) ;
2010-05-08 22:44:45 +00:00
2009-04-24 23:34:47 +00:00
bool getShortcutsFromXmlTree ( ) ;
bool getMacrosFromXmlTree ( ) ;
bool getUserCmdsFromXmlTree ( ) ;
bool getPluginCmdsFromXmlTree ( ) ;
bool getScintKeysFromXmlTree ( ) ;
2021-01-17 18:47:45 +00:00
bool getSessionFromXmlTree ( TiXmlDocument * pSessionDoc , Session & session ) ;
2015-08-14 19:47:47 +00:00
bool getBlackListFromXmlTree ( ) ;
2009-04-24 23:34:47 +00:00
void feedGUIParameters ( TiXmlNode * node ) ;
void feedKeyWordsParameters ( TiXmlNode * node ) ;
void feedFileListParameters ( TiXmlNode * node ) ;
2015-08-14 19:47:47 +00:00
void feedScintillaParam ( TiXmlNode * node ) ;
2009-04-24 23:34:47 +00:00
void feedDockingManager ( TiXmlNode * node ) ;
2020-11-11 01:23:24 +00:00
void duplicateDockingManager ( TiXmlNode * dockMngNode , TiXmlElement * dockMngElmt2Clone ) ;
2009-04-24 23:34:47 +00:00
void feedFindHistoryParameters ( TiXmlNode * node ) ;
2011-09-25 01:33:34 +00:00
void feedProjectPanelsParameters ( TiXmlNode * node ) ;
2016-02-02 18:06:23 +00:00
void feedFileBrowserParameters ( TiXmlNode * node ) ;
2009-04-24 23:34:47 +00:00
bool feedStylerArray ( TiXmlNode * node ) ;
2019-02-07 22:40:17 +00:00
std : : pair < unsigned char , unsigned char > feedUserLang ( TiXmlNode * node ) ;
2009-04-24 23:34:47 +00:00
void feedUserStyles ( TiXmlNode * node ) ;
void feedUserKeywordList ( TiXmlNode * node ) ;
void feedUserSettings ( TiXmlNode * node ) ;
void feedShortcut ( TiXmlNode * node ) ;
void feedMacros ( TiXmlNode * node ) ;
void feedUserCmds ( TiXmlNode * node ) ;
void feedPluginCustomizedCmds ( TiXmlNode * node ) ;
void feedScintKeys ( TiXmlNode * node ) ;
2015-08-14 19:47:47 +00:00
bool feedBlacklist ( TiXmlNode * node ) ;
2009-04-24 23:34:47 +00:00
void getActions ( TiXmlNode * node , Macro & macro ) ;
bool getShortcuts ( TiXmlNode * node , Shortcut & sc ) ;
2015-08-14 19:47:47 +00:00
2021-08-31 18:58:12 +00:00
void writeStyle2Element ( const Style & style2Write , Style & style2Sync , TiXmlElement * element ) ;
2009-04-24 23:34:47 +00:00
void insertUserLang2Tree ( TiXmlNode * node , UserLangContainer * userLang ) ;
void insertCmd ( TiXmlNode * cmdRoot , const CommandShortcut & cmd ) ;
void insertMacro ( TiXmlNode * macrosRoot , const MacroShortcut & macro ) ;
void insertUserCmd ( TiXmlNode * userCmdRoot , const UserCommand & userCmd ) ;
void insertScintKey ( TiXmlNode * scintKeyRoot , const ScintillaKeyMap & scintKeyMap ) ;
void insertPluginCmd ( TiXmlNode * pluginCmdRoot , const PluginCmdShortcut & pluginCmd ) ;
TiXmlElement * insertGUIConfigBoolNode ( TiXmlNode * r2w , const TCHAR * name , bool bVal ) ;
void insertDockingParamNode ( TiXmlNode * GUIRoot ) ;
void writeExcludedLangList ( TiXmlElement * element ) ;
void writePrintSetting ( TiXmlElement * element ) ;
void initMenuKeys ( ) ; //initialise menu keys and scintilla keys. Other keys are initialized on their own
void initScintillaKeys ( ) ; //these functions have to be called first before any modifications are loaded
2019-06-13 15:54:42 +00:00
int getCmdIdFromMenuEntryItemName ( HMENU mainMenuHadle , const generic_string & menuEntryName , const generic_string & menuItemName ) ; // return -1 if not found
int getPluginCmdIdFromMenuEntryItemName ( HMENU pluginsMenu , const generic_string & pluginName , const generic_string & pluginCmdName ) ; // return -1 if not found
2017-02-10 11:49:04 +00:00
winVer getWindowsVersion ( ) ;
2018-09-13 21:07:22 +00:00
2009-04-24 23:34:47 +00:00
} ;