diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 0000000..25c3ede
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,34 @@
+# CLAUDE.md
+
+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
+
+## Project Overview
+
+CSharpRegexTools4Npp is a Notepad++ plugin written in C# that provides regex tools using the .NET regex engine. Features include regex syntax highlighting (via AvalonEdit), match listing with groups/captures, select/extract/replace operations, C# scripting for replacements (via Roslyn/CS-Script), and Excel file support (via ClosedXML).
+
+## Build
+
+Open `CSharpRegexTools4Npp.slnx` in Visual Studio 2022+. Select platform (x86 or x64) matching your Notepad++ installation. Build with F5 — post-build targets automatically copy the DLL to the Notepad++ plugins directory and launch Notepad++.
+
+```
+msbuild CSharpRegexTools4Npp.slnx /p:Configuration=Debug /p:Platform=x64
+```
+
+Target framework: .NET Framework 4.8.1, C# 9. `AllowUnsafeBlocks` is enabled in the plugin project.
+
+There are no automated tests in this project.
+
+## Architecture
+
+Two assemblies in the solution:
+
+- **CSharpRegexTools4Npp** — Plugin entry point and Notepad++ integration layer. `Main.cs` registers menu commands and toolbar buttons. Uses the Plugin Infrastructure (`PluginInfrastructure/`) for IPC with Notepad++ via unmanaged DLL exports and gateway classes (`NotepadPPGateway`, `ScintillaGateway`). `Npp.cs` wraps common Notepad++ operations.
+
+- **RegexDialog** — Core UI and logic. `RegExToolDialog.xaml/.xaml.cs` is the main WPF dialog (large file, ~116KB code-behind). Contains models (`Model/`), services (`Sevices/` — note the typo), and utilities (`Utils/`). `Config.cs` manages settings via INI files. `RoslynService.cs` handles C# code compilation for script-based replacements.
+
+## Key Patterns
+
+- **Fody IL weaving**: `PropertyChanged.Fody` auto-implements `INotifyPropertyChanged` on model/viewmodel classes. `Costura.Fody` merges all dependencies into a single output DLL — this is required for the plugin to load in Notepad++.
+- **Dual UI frameworks**: The plugin uses both WPF (main dialog) and Windows Forms (legacy dialogs, Notepad++ interop).
+- **Platform-aware builds**: x86 and x64 configurations have separate output directories (`bin\Debug` vs `bin\Debug-x64`) and separate Notepad++ install paths for post-build copy.
+- **Keyboard shortcut**: Ctrl+Shift+H invokes the plugin.
diff --git a/CSharpRegexTools4Npp.sln b/CSharpRegexTools4Npp.sln
deleted file mode 100644
index 485e3e3..0000000
--- a/CSharpRegexTools4Npp.sln
+++ /dev/null
@@ -1,49 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28307.421
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpRegexTools4Npp", "CSharpRegexTools4Npp\CSharpRegexTools4Npp.csproj", "{DF71B291-10BE-4C52-973E-C7E209497329}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RegexDialog", "RegexDialog\RegexDialog.csproj", "{E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Debug|x64 = Debug|x64
- Debug|x86 = Debug|x86
- Release|Any CPU = Release|Any CPU
- Release|x64 = Release|x64
- Release|x86 = Release|x86
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DF71B291-10BE-4C52-973E-C7E209497329}.Debug|Any CPU.ActiveCfg = Debug|x86
- {DF71B291-10BE-4C52-973E-C7E209497329}.Debug|x64.ActiveCfg = Debug|x64
- {DF71B291-10BE-4C52-973E-C7E209497329}.Debug|x64.Build.0 = Debug|x64
- {DF71B291-10BE-4C52-973E-C7E209497329}.Debug|x86.ActiveCfg = Debug|x86
- {DF71B291-10BE-4C52-973E-C7E209497329}.Debug|x86.Build.0 = Debug|x86
- {DF71B291-10BE-4C52-973E-C7E209497329}.Release|Any CPU.ActiveCfg = Release|x86
- {DF71B291-10BE-4C52-973E-C7E209497329}.Release|x64.ActiveCfg = Release|x64
- {DF71B291-10BE-4C52-973E-C7E209497329}.Release|x64.Build.0 = Release|x64
- {DF71B291-10BE-4C52-973E-C7E209497329}.Release|x86.ActiveCfg = Release|x86
- {DF71B291-10BE-4C52-973E-C7E209497329}.Release|x86.Build.0 = Release|x86
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Debug|x64.ActiveCfg = Debug|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Debug|x64.Build.0 = Debug|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Debug|x86.ActiveCfg = Debug|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Debug|x86.Build.0 = Debug|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Release|Any CPU.Build.0 = Release|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Release|x64.ActiveCfg = Release|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Release|x64.Build.0 = Release|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Release|x86.ActiveCfg = Release|Any CPU
- {E9AB46E2-6CCF-4998-9EF4-28F7E8961C31}.Release|x86.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {5FD18A7C-CF42-415A-92F5-7B9AD4B6BCD8}
- EndGlobalSection
-EndGlobal
diff --git a/CSharpRegexTools4Npp.slnx b/CSharpRegexTools4Npp.slnx
new file mode 100644
index 0000000..77c16a3
--- /dev/null
+++ b/CSharpRegexTools4Npp.slnx
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CSharpRegexTools4Npp/BNpp.cs b/CSharpRegexTools4Npp/BNpp.cs
deleted file mode 100644
index 61479ba..0000000
--- a/CSharpRegexTools4Npp/BNpp.cs
+++ /dev/null
@@ -1,322 +0,0 @@
-using CSharpRegexTools4Npp.PluginInfrastructure;
-using System;
-using System.Text;
-
-namespace CSharpRegexTools4Npp
-{
- public static class BNpp
- {
- public static NotepadPPGateway NotepadPP { get; } = new NotepadPPGateway();
-
- public static ScintillaGateway Scintilla => new ScintillaGateway(PluginBase.GetCurrentScintilla());
-
- ///
- /// Récupère les caractères de fin de lignes courant
- /// !!! Attention pour le moment bug. !!! Enlève la coloration syntaxique du fichier courant
- ///
- public static string CurrentEOL
- {
- get
- {
- string eol = "\n";
- int value = Scintilla.GetEOLMode();
-
- switch ((SciMsg)value)
- {
- case SciMsg.SC_EOL_CRLF:
- eol = "\r\n";
- break;
- case SciMsg.SC_EOL_CR:
- eol = "\r";
- break;
- }
-
- return eol;
- }
- }
-
- ///
- /// Récupère ou attribue le texte complet du tab Notepad++ courant
- /// (Gère la conversion d'encodage Npp/C#)
- ///
- public static string Text
- {
- get
- {
- IScintillaGateway scintilla = new ScintillaGateway(PluginBase.GetCurrentScintilla());
- // Multiply by 2 to managed 2 bytes encoded chars
- return BEncoding.GetUtf8TextFromScintillaText(scintilla.GetText(scintilla.GetTextLength() * 2));
- }
-
- set
- {
- IScintillaGateway scintilla = new ScintillaGateway(PluginBase.GetCurrentScintilla());
- string text = BEncoding.GetScintillaTextFromUtf8Text(value, out _);
- scintilla.SetText(text);
- }
- }
-
- ///
- /// Récupère ou attribue le début de la sélection de texte
- /// (Gère la conversion d'encodage Npp/C#)
- ///
- public static int SelectionStart
- {
- get
- {
- return new ScintillaGateway(PluginBase.GetCurrentScintilla()).GetSelectionStart();
- }
-
- set
- {
- new ScintillaGateway(PluginBase.GetCurrentScintilla()).SetSelectionStart(new Position(value));
- }
- }
-
- ///
- /// Récupère ou attribue la fin de la sélection de texte
- /// si aucun texte n'est sélectionné SelectionEnd = SelectionStart
- /// (Gère la conversion d'encodage Npp/C#)
- ///
- public static int SelectionEnd
- {
- get
- {
- int curPos = (int)Win32.SendMessage(PluginBase.GetCurrentScintilla(), SciMsg.SCI_GETSELECTIONEND, 0, 0);
- IScintillaGateway scintilla = new ScintillaGateway(PluginBase.GetCurrentScintilla());
- string beginingText = scintilla.GetText(curPos);
- BEncoding.GetScintillaTextFromUtf8Text(beginingText, out int length);
- return length;
- }
-
- set
- {
- string allText = Text;
- int endToUse = value;
-
- if (value < 0)
- {
- endToUse = 0;
- }
- else if (value > allText.Length)
- {
- endToUse = allText.Length;
- }
-
- string afterText = allText.Substring(0, endToUse);
- BEncoding.GetScintillaTextFromUtf8Text(afterText, out int defaultEnd);
-
- Win32.SendMessage(PluginBase.GetCurrentScintilla(), SciMsg.SCI_SETSELECTIONEND, defaultEnd, 0);
- }
- }
-
- ///
- /// Récupère ou attribue la longueur de la sélection de texte
- /// Si aucun texte n'est sélectionné SelectionEnd = 0
- /// (Gère la conversion d'encodage Npp/C#)
- ///
- public static int SelectionLength
- {
- get
- {
- return SelectionEnd - SelectionStart;
- }
-
- set
- {
- SelectionEnd = SelectionStart + (value < 0 ? 0 : value);
- }
- }
-
- ///
- /// Récupère ou remplace le texte actuellement sélectionné
- /// (Gère la conversion d'encodage Npp/C#)
- ///
- public static string SelectedText
- {
- get
- {
- IScintillaGateway scintilla = new ScintillaGateway(PluginBase.GetCurrentScintilla());
- return BEncoding.GetUtf8TextFromScintillaText(scintilla.GetSelText());
- }
-
- set
- {
- IScintillaGateway scintilla = new ScintillaGateway(PluginBase.GetCurrentScintilla());
- string defaultNewText = BEncoding.GetScintillaTextFromUtf8Text(value);
- scintilla.ReplaceSel(defaultNewText);
- }
- }
-
- ///
- /// Sélectionne dans le tab Notepad++ courant le texte entre start et end
- /// et positionne le scroll pour voir la sélection.
- /// (Gère la conversion d'encodage Npp/C#)
- ///
- /// Position du début du texte à sélectionner dans le texte entier Si plus petit que 0 -> forcé à zéro Si plus grand que Text.Length -> forcé à Text.Length
- /// Position de fin du texte à sélectionner dans le texte entier Si plus petit que 0 -> forcé à zéro Si plus grand que Text.Length -> forcé à Text.Length Si plus petit que start -> forcé à start
- public static void SelectTextAndShow(int start, int end)
- {
- string allText = Text;
- int startToUse = start;
- int endToUse = end;
-
- if (start < 0)
- {
- startToUse = 0;
- }
- else if (start > allText.Length)
- {
- startToUse = allText.Length;
- }
-
- if (end < 0)
- {
- endToUse = 0;
- }
- else if (end > allText.Length)
- {
- endToUse = allText.Length;
- }
- else if (endToUse < startToUse)
- {
- endToUse = startToUse;
- }
-
- string beforeText = allText.Substring(0, startToUse);
- BEncoding.GetScintillaTextFromUtf8Text(beforeText, out int defaultStart);
- string endText = allText.Substring(0, endToUse);
- BEncoding.GetScintillaTextFromUtf8Text(endText, out int defaultEnd);
-
- Win32.SendMessage(PluginBase.GetCurrentScintilla(), SciMsg.SCI_GOTOPOS, defaultStart, 0);
- Win32.SendMessage(PluginBase.GetCurrentScintilla(), SciMsg.SCI_SETSELECTIONEND, defaultEnd, 0);
- }
-
- ///
- /// Si la sélection multiple est activée ajoute la sélection spécifié
- /// (Gère la conversion d'encodage Npp/C#)
- ///
- /// Position du début du texte à sélectionner dans le texte entier Si plus petit que 0 -> forcé à zéro Si plus grand que Text.Length -> forcé à Text.Length
- /// Position de fin du texte à sélectionner dans le texte entier Si plus petit que 0 -> forcé à zéro Si plus grand que Text.Length -> forcé à Text.Length Si plus petit que start -> forcé à start
-
- public static void AddSelection(int start, int end)
- {
- string allText = Text;
- int startToUse = start;
- int endToUse = end;
-
- if (start < 0)
- {
- startToUse = 0;
- }
- else if (start > allText.Length)
- {
- startToUse = allText.Length;
- }
-
- if (end < 0)
- {
- endToUse = 0;
- }
- else if (end > allText.Length)
- {
- endToUse = allText.Length;
- }
- else if (endToUse < startToUse)
- {
- endToUse = startToUse;
- }
-
- string beforeText = allText.Substring(0, startToUse);
- BEncoding.GetScintillaTextFromUtf8Text(beforeText, out int defaultStart);
- string endText = allText.Substring(0, endToUse);
- BEncoding.GetScintillaTextFromUtf8Text(endText, out int defaultEnd);
-
- Win32.SendMessage(PluginBase.GetCurrentScintilla(), SciMsg.SCI_ADDSELECTION, defaultStart, defaultEnd);
- }
-
- ///
- /// Récupère le texte de la ligne spécifiée
- ///
- /// Numéro de la ligne dont on veut récupérer le texte
- /// Le texte de la ligne spécifiée
- public static string GetLineText(int lineNb)
- {
- string result = "";
-
- try
- {
- result = Text.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.None)[lineNb - 1];
- }
- catch { }
-
- return result;
- }
- }
-
- ///
- /// Offre des fonctions simples pour convertir l'encodage d'un texte
- /// entre l'encodage du document courant dans Notepad++ et l'encodage en C# (UTF8)
- ///
- internal static class BEncoding
- {
- private static readonly Encoding utf8 = Encoding.UTF8;
-
- ///
- /// Convertit le texte spécifier de l'encodage du document Notepad++ courant à l'encodage C# (UTF8)
- ///
- public static string GetUtf8TextFromScintillaText(string scText)
- {
- switch ((int)Win32.SendMessage(PluginBase.nppData._nppHandle, SciMsg.SCI_GETCODEPAGE, 0, 0))
- {
- case 65001: // UTF8
- return utf8.GetString(Encoding.Default.GetBytes(scText));
- default:
- Encoding ANSI = Encoding.GetEncoding(1252);
-
- byte[] ansiBytes = ANSI.GetBytes(scText);
- byte[] utf8Bytes = Encoding.Convert(ANSI, Encoding.UTF8, ansiBytes);
-
- return Encoding.UTF8.GetString(utf8Bytes);
- }
- }
-
- ///
- /// Convertit le texte spécifier de l'encodage C# (UTF8) à l'encodage document Notepad++ courant
- ///
- public static string GetScintillaTextFromUtf8Text(string utf8Text)
- {
- switch ((int)Win32.SendMessage(PluginBase.nppData._nppHandle, SciMsg.SCI_GETCODEPAGE, 0, 0))
- {
- case 65001: // UTF8
- return Encoding.Default.GetString(utf8.GetBytes(utf8Text));
- default:
- Encoding ANSI = Encoding.GetEncoding(1252);
-
- byte[] utf8Bytes = utf8.GetBytes(utf8Text);
- byte[] ansiBytes = Encoding.Convert(Encoding.UTF8, ANSI, utf8Bytes);
-
- return ANSI.GetString(ansiBytes);
- }
- }
-
- ///
- /// Convertit le texte spécifier de l'encodage C# (UTF8) à l'encodage document Notepad++ courant
- ///
- public static string GetScintillaTextFromUtf8Text(string utf8Text, out int length)
- {
- byte[] utf8Bytes = utf8.GetBytes(utf8Text);
- length = utf8Bytes.Length;
-
- switch ((int)Win32.SendMessage(PluginBase.nppData._nppHandle, SciMsg.SCI_GETCODEPAGE, 0, 0))
- {
- case 65001: // UTF8
- return Encoding.Default.GetString(utf8.GetBytes(utf8Text));
- default:
- Encoding ANSI = Encoding.GetEncoding(1252);
- byte[] ansiBytes = Encoding.Convert(Encoding.UTF8, ANSI, utf8Bytes);
- return ANSI.GetString(ansiBytes);
- }
- }
- }
-}
diff --git a/CSharpRegexTools4Npp/CSharpRegexTools4Npp.csproj b/CSharpRegexTools4Npp/CSharpRegexTools4Npp.csproj
index 98f4373..fbfa356 100644
--- a/CSharpRegexTools4Npp/CSharpRegexTools4Npp.csproj
+++ b/CSharpRegexTools4Npp/CSharpRegexTools4Npp.csproj
@@ -1,159 +1,215 @@
-
-
+Debugx86
- {DF71B291-10BE-4C52-973E-C7E209497329}
+ 9.0.21022
+ 2.0
+ 9.0
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}LibraryPropertiesCSharpRegexTools4NppCSharpRegexTools4Npp
- bin\Debug\
- v4.6
+ v4.8.1
+ 3.5
+ {EB8FC3A3-93E8-457B-B281-FAFA5119611A}
-
- true
- DEBUG;TRACEfull
- promptfalsebin\Debug
+ DEBUG;TRACE
+ prompt
+ 4x86true
- false
+ True
- TRACE
+ nonetruebin\Release
- pdbonlyprompt
+ 4
+ 512x86
+ AllRules.rulesettrue
- false
+ Truetrue
- TRACE;DEBUG;X64full
- promptfalsebin\Debug-x64
+ DEBUG;TRACE
+ prompt
+ 4x64true
- false
+ True
- TRACE;X64
+ nonetruebin\Release-x64
- pdbonlyprompt
+ 4
+ 512x64
+ AllRules.rulesettrue
- false
+ True
-
+ $(ProgramW6432)\Notepad++
+ $(MSBuildProgramFiles32)\Notepad++Program
- $(ProgramW6432)\Notepad++\notepad++.exe
- $(MSBuildProgramFiles32)\Notepad++\notepad++.exe
+ $(NppPath64)\notepad++.exe
+ $(NppPath32)\notepad++.exe
+
+
+ $(MSBuildProjectDirectory)\packages
-
- ..\packages\Costura.Fody.4.1.0\lib\net40\Costura.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ all
+
-
-
+
+
+
+
-
-
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+ Resources.resx
+
+
+
+
+ TrueTrueResources.resx
+
+ True
+ True
+ Res.resx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
+
+
+
+
+
+
+
+
-
-
+
+ Designer
-
-
-
- Designer
-
+ PublicResXFileCodeGenerator
+ Resources1.Designer.cs
+
+
+ ResXFileCodeGenerator
+ Res.Designer.cs
+
-
- Designer
-
-
+
+
+
- {e9ab46e2-6ccf-4998-9ef4-28f7e8961c31}
+ {c2a3f803-5710-d6b9-f97b-4fbfde7e2af4}RegexDialog
-
-
-
- Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CSharpRegexTools4Npp/FodyWeavers.xml b/CSharpRegexTools4Npp/FodyWeavers.xml
deleted file mode 100644
index a5dcf04..0000000
--- a/CSharpRegexTools4Npp/FodyWeavers.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/CSharpRegexTools4Npp/FodyWeavers.xsd b/CSharpRegexTools4Npp/FodyWeavers.xsd
deleted file mode 100644
index 44a5374..0000000
--- a/CSharpRegexTools4Npp/FodyWeavers.xsd
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks
-
-
-
-
- A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks.
-
-
-
-
- A list of unmanaged 32 bit assembly names to include, delimited with line breaks.
-
-
-
-
- A list of unmanaged 64 bit assembly names to include, delimited with line breaks.
-
-
-
-
- The order of preloaded assemblies, delimited with line breaks.
-
-
-
-
-
- This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file.
-
-
-
-
- Controls if .pdbs for reference assemblies are also embedded.
-
-
-
-
- Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option.
-
-
-
-
- As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off.
-
-
-
-
- Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code.
-
-
-
-
- Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior.
-
-
-
-
- A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with |
-
-
-
-
- A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |.
-
-
-
-
- A list of unmanaged 32 bit assembly names to include, delimited with |.
-
-
-
-
- A list of unmanaged 64 bit assembly names to include, delimited with |.
-
-
-
-
- The order of preloaded assemblies, delimited with |.
-
-
-
-
-
-
-
- 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.
-
-
-
-
- A comma-separated list of error codes that can be safely ignored in assembly verification.
-
-
-
-
- 'false' to turn off automatic generation of the XML Schema file.
-
-
-
-
-
\ No newline at end of file
diff --git a/CSharpRegexTools4Npp/GlobalSuppressions.cs b/CSharpRegexTools4Npp/GlobalSuppressions.cs
new file mode 100644
index 0000000..2aea435
--- /dev/null
+++ b/CSharpRegexTools4Npp/GlobalSuppressions.cs
@@ -0,0 +1,10 @@
+// This file is used by Code Analysis to maintain SuppressMessage
+// attributes that are applied to this project.
+// Project-level suppressions either have no target or are given
+// a specific target and scoped to a namespace, type, member, etc.
+
+using System.Diagnostics.CodeAnalysis;
+
+
+[assembly: SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "", Scope = "namespaceanddescendants", Target = "~N:CSharpRegexTools4Npp")]
+[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "", Scope = "namespaceanddescendants", Target = "~N:CSharpRegexTools4Npp")]
diff --git a/CSharpRegexTools4Npp/Main.cs b/CSharpRegexTools4Npp/Main.cs
index fbbdea2..f27e563 100644
--- a/CSharpRegexTools4Npp/Main.cs
+++ b/CSharpRegexTools4Npp/Main.cs
@@ -1,21 +1,50 @@
-using CSharpRegexTools4Npp.PluginInfrastructure;
+// NPP plugin platform for .Net v0.91.57 by Kasper B. Graversen etc.
+using CSharpRegexTools4Npp.PluginInfrastructure;
+using CSharpRegexTools4Npp.Utils;
+using Newtonsoft.Json.Linq;
using RegexDialog;
using System;
+using System.Diagnostics;
using System.Drawing;
+using System.IO;
using System.Linq;
+using System.Net.Http;
+using System.Net;
+using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
-using System.Windows.Input;
using System.Windows.Interop;
namespace CSharpRegexTools4Npp
{
- public class Main
+ class Main
{
- internal const string PluginName = "C# Regex Tools 4 Npp";
+ internal const int UNDO_BUFFER_SIZE = 64;
private static int idMyDlg = 0;
- private static readonly Bitmap tbBmp = Resources.icon;
- //static RegExToolDialog dialog = null;
+ internal const string PluginName = "C# Regex Tools 4 Npp";
+ public static readonly string PluginConfigDirectory = Path.Combine(Npp.Notepad.GetConfigDirectory(), PluginName);
+ public const string PluginRepository = "https://github.com/codingseb/CSharpRegexTools4Npp";
+
+ private static readonly Bitmap tbBmp = Res.Icon;// Resources;
+
+ ///
+ /// This listens to the message that Notepad++ sends when its UI language is changed.
+ ///
+ private static NppListener nppListener = null;
+ ///
+ /// If the Notepad++ version is higher than 8.6.9, this boolean does not matter.
+ /// If this is true, and the Notepad++ version is 8.6.9 or lower, will be initialized.
+ /// SETTING THIS TO true COMES AT A REAL PERFORMANCE COST EVEN WHEN YOUR PLUGIN IS NOT IN USE (possibly up to 10% of all CPU usage associated with Notepad++)
+ /// Do NOT set this to true unless it is very important to you that your plugin's UI language can dynamically adjust to the Notepad++ UI language.
+ /// Note that translation will work even if this is false, so the only upside of this is that
+ /// the user doesn't need to close Notepad++ and restart it to see their new language preferences reflected in this plugin's UI.
+ ///
+ private const bool FOLLOW_NPP_UI_LANGUAGE = false;
+
+ public const int GWL_EXSTYLE = -20;
+ public const int WS_EX_LAYERED = 0x80000;
+ public const int LWA_ALPHA = 0x2;
+ public const int LWA_COLORKEY = 0x1;
//Import the FindWindow API to find our window
[DllImport("User32.dll", CharSet = CharSet.Auto)]
@@ -25,72 +54,36 @@ public class Main
[DllImport("User32.dll", CharSet = CharSet.Auto)]
private static extern IntPtr SetForegroundWindow(IntPtr hWnd);
- [DllImport("user32.dll", CharSet = CharSet.Auto)]
- private static extern IntPtr SetWindowLong(IntPtr hWnd, int windowLongFlags, IntPtr dwNewLong);
-
- [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
- private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
-
[DllImport("user32.dll", CharSet = CharSet.Auto)]
private static extern long SetLayeredWindowAttributes(IntPtr hwnd, uint crKey, byte bAlpha, uint dwFlags);
- public const int GWL_EXSTYLE = -20;
- public const int WS_EX_LAYERED = 0x80000;
- public const int LWA_ALPHA = 0x2;
- public const int LWA_COLORKEY = 0x1;
-
- private enum WindowLongFlags : int
- {
- GWL_EXSTYLE = -20,
- GWLP_HINSTANCE = -6,
- GWLP_HWNDPARENT = -8,
- GWL_ID = -12,
- GWL_STYLE = -16,
- GWL_USERDATA = -21,
- GWL_WNDPROC = -4,
- DWLP_USER = 0x8,
- DWLP_MSGRESULT = 0x0,
- DWLP_DLGPROC = 0x4,
- WS_EX_LAYERED = 0x80000
- }
-
- private enum LayeredWindowAttributesFlags : byte
- {
- LWA_COLORKEY = 0x1,
- LWA_ALPHA = 0x2
- }
-
- public static void OnNotification(ScNotification notification)
+ static internal void CommandMenuInit()
{
+ // first make it so that all references to any third-party dependencies point to the correct location
+ // see https://github.com/oleg-shilo/cs-script.npp/issues/66#issuecomment-1086657272 for more info
+ AppDomain.CurrentDomain.AssemblyResolve += LoadDependency;
- }
-
- internal static void CommandMenuInit()
- {
PluginBase.SetCommand(0, "C# Regex Tools", ShowTheDialog, new ShortcutKey(true, false, true, System.Windows.Forms.Keys.H));
- idMyDlg = 0;
- }
+ PluginBase.SetCommand(1, "&Documentation", Docs);
- internal static void SetToolBarIcon()
- {
- toolbarIcons tbIcons = new toolbarIcons
+
+ if (FOLLOW_NPP_UI_LANGUAGE && (Npp.nppVersion[0] < 8 || (Npp.nppVersion[0] == 8 && (Npp.nppVersion[1] < 6 || (Npp.nppVersion[1] == 6 && Npp.nppVersion[2] <= 9)))))
{
- hToolbarBmp = tbBmp.GetHbitmap()
- };
-
- IntPtr pTbIcons = Marshal.AllocHGlobal(Marshal.SizeOf(tbIcons));
- Marshal.StructureToPtr(tbIcons, pTbIcons, false);
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_ADDTOOLBARICON, PluginBase._funcItems.Items[idMyDlg]._cmdID, pTbIcons);
- Marshal.FreeHGlobal(pTbIcons);
+ // start listening to messages that aren't broadcast by the plugin manager (for versions of Notepad++ 8.6.9 or earlier, because later versions have NPPN_NATIVELANGCHANGED)
+ nppListener = new NppListener();
+ nppListener.AssignHandle(PluginBase.nppData._nppHandle);
+ }
}
public static void ShowTheDialog()
{
-
try
{
+ string dialogTitle = $"C# Regex Tools - {Assembly.GetExecutingAssembly().GetName().Version}";
- IntPtr hWnd = FindWindow(null, "C# Regex Tools");
+ AppDomain.CurrentDomain.SetupInformation.PrivateBinPath = @"plugins\CSharpRegexTools4Npp";
+
+ IntPtr hWnd = FindWindow(null, dialogTitle);
if (hWnd.ToInt64() > 0)
{
@@ -98,38 +91,41 @@ public static void ShowTheDialog()
}
else
{
- var dialog = new RegExToolDialog
+ RegExToolDialog dialog = null;
+
+ RegExToolDialog.InitIsOK = () => CheckUpdates(dialog);
+
+ dialog = new RegExToolDialog
{
- GetText = () => BNpp.Text,
+ GetText = () => Npp.Text,
SetText = text =>
{
- if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
- {
- BNpp.NotepadPP.FileNew();
- }
-
- BNpp.Text = text;
+ Npp.Text = text;
},
SetTextInNew = text =>
{
- BNpp.NotepadPP.FileNew();
+ Npp.Notepad.FileNew();
- BNpp.Text = text;
+ Npp.Text = text;
},
- GetSelectedText = () => BNpp.SelectedText,
+ SetSelectedText = text => Npp.SelectedText = text,
+
+ GetSelectedText = () => Npp.SelectedText,
+
+ SetPosition = (index, length) => Npp.SelectTextAndShow(index, index + length),
- SetPosition = (index, length) => BNpp.SelectTextAndShow(index, index + length),
+ SetSelection = (index, length) => Npp.AddSelection(index, index + length),
- SetSelection = (index, length) => BNpp.AddSelection(index, index + length),
+ GetSelectionStartIndex = () => Npp.SelectionStart,
- GetSelectionStartIndex = () => BNpp.SelectionStart,
+ GetSelectionLength = () => Npp.SelectionLength,
- GetSelectionLength = () => BNpp.SelectionLength,
+ SaveCurrentDocument = () => Npp.Notepad.SaveCurrentFile(),
- SaveCurrentDocument = () => BNpp.NotepadPP.SaveCurrentFile(),
+ SetCurrentTabInCSharpHighlighting = () => Npp.Notepad.SetCurrentLanguage(LangType.L_CS),
TryOpen = (fileName, onlyIfAlreadyOpen) =>
{
@@ -137,25 +133,25 @@ public static void ShowTheDialog()
{
bool result = false;
- if (BNpp.NotepadPP.CurrentFileName.Equals(fileName, StringComparison.OrdinalIgnoreCase))
+ if (Npp.Notepad.CurrentFileName.Equals(fileName, StringComparison.OrdinalIgnoreCase))
{
result = true;
}
- else if (BNpp.NotepadPP.GetAllOpenedDocuments.Any(s => s.Equals(fileName, StringComparison.OrdinalIgnoreCase)))
+ else if (Npp.Notepad.GetAllOpenedDocuments.Any(s => s.Equals(fileName, StringComparison.OrdinalIgnoreCase)))
{
- BNpp.NotepadPP.ShowTab(fileName);
+ Npp.Notepad.ShowTab(fileName);
result = true;
}
else if (!onlyIfAlreadyOpen)
{
- result = BNpp.NotepadPP.OpenFile(fileName);
+ result = Npp.Notepad.OpenFile(fileName);
}
else
{
result = false;
}
- hWnd = FindWindow(null, "C# Regex Tool");
+ hWnd = FindWindow(null, dialogTitle);
if (hWnd.ToInt64() > 0)
{
SetForegroundWindow(hWnd);
@@ -167,25 +163,133 @@ public static void ShowTheDialog()
{
return false;
}
-
},
- GetCurrentFileName = () => BNpp.NotepadPP.CurrentFileName
+ GetCurrentFileName = () => Npp.Notepad.CurrentFileName
};
-
+
dialog.Show();
- SetWindowLong(new WindowInteropHelper(dialog).Handle, (int)WindowLongFlags.GWLP_HWNDPARENT, PluginBase.nppData._nppHandle);
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.MODELESSDIALOGADD, (int)NppMsg.NPPM_MODELESSDIALOG, new WindowInteropHelper(dialog).Handle);
+ //SetWindowLong(new WindowInteropHelper(dialog).Handle, (int)WindowLongFlags.GWLP_HWNDPARENT, PluginBase.nppData._nppHandle);
SetLayeredWindowAttributes(new WindowInteropHelper(dialog).Handle, 0, 128, LWA_ALPHA);
-
}
}
catch (Exception exception)
{
MessageBox.Show(exception.Message + "\r\n" + exception.StackTrace, "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
}
+ }
+ private static Assembly LoadDependency(object sender, ResolveEventArgs args)
+ {
+ string assemblyFile = Path.Combine(Npp.pluginDllDirectory, new AssemblyName(args.Name).Name) + ".dll";
+ if (File.Exists(assemblyFile))
+ return Assembly.LoadFrom(assemblyFile);
+ return null;
+ }
+
+ public static void OnNotification(ScNotification notification)
+ {
+
+ }
+
+ static internal void PluginCleanUp()
+ {
+ }
+
+ internal static void SetToolBarIcon()
+ {
+ if (!string.IsNullOrEmpty(Npp.Notepad.NppBinVersion)
+ && int.TryParse(Npp.Notepad.NppBinVersion.Split('.')[0], out int majorVersion)
+ && majorVersion >= 8)
+ {
+ ToolbarIcons tbIcons = new()
+ {
+ hToolbarBmp = tbBmp.GetHbitmap(),
+ hToolbarIcon = tbBmp.GetHicon(),
+ hToolbarIconDarkMode = tbBmp.GetHicon()
+ };
+
+ IntPtr pTbIcons = Marshal.AllocHGlobal(Marshal.SizeOf(tbIcons));
+ Marshal.StructureToPtr(tbIcons, pTbIcons, false);
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_ADDTOOLBARICON_FORDARKMODE, PluginBase._funcItems.Items[idMyDlg]._cmdID, pTbIcons);
+ Marshal.FreeHGlobal(pTbIcons);
+ }
+ }
+
+ private static async void CheckUpdates(RegExToolDialog dialog)
+ {
+ double hoursFromLastCheck = Math.Abs((DateTime.Now - Config.Instance.LastUpdateCheck).TotalHours);
+
+ //if (hoursFromLastCheck > 8)
+ if (true)
+ {
+ ServicePointManager.ServerCertificateValidationCallback += (_, __, ___, ____) => true;
+ ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
+
+ try
+ {
+ HttpClient client = new();
+ client.DefaultRequestHeaders.Add("Accept-Language", "en-US;q=0.5,en;q=0.3");
+ client.DefaultRequestHeaders.Add("User-Agent", "C# App");
+
+ var response = await client.GetAsync("https://api.github.com/repos/codingseb/CSharpRegexTools4Npp/releases/latest").ConfigureAwait(true);
+ string responseText = await response.Content.ReadAsStringAsync();
+
+ var jsonResult = JObject.Parse(responseText);
+
+ int[] latestVersion = jsonResult["name"].ToString().Split('.').Select(digit => int.Parse(digit.Trim())).ToArray();
+ int[] currentVersion = typeof(RegExToolDialog).Assembly.GetName().Version.ToString().Split('.').Select(digit => int.Parse(digit.Trim())).ToArray();
+
+ Debug.WriteLine($"{string.Join(".", latestVersion)} - {string.Join(".", currentVersion)}");
+
+ for (int i = 0; i < latestVersion.Length && i < currentVersion.Length; i++)
+ {
+ if (latestVersion[i] > currentVersion[i])
+ {
+ Config.Instance.UpdateAvailable = true;
+ Config.Instance.UpdateURL = "https://github.com/codingseb/CSharpRegexTools4Npp/releases";
+ break;
+ }
+ else if (latestVersion[i] < currentVersion[i])
+ {
+ break;
+ }
+ }
+ }
+ catch
+ { }
+ }
+ }
+
+ ///
+ /// open GitHub repo with the web browser
+ ///
+ private static void Docs()
+ {
+ OpenUrlInWebBrowser(PluginRepository);
+ }
+
+ public static void OpenUrlInWebBrowser(string url)
+ {
+ try
+ {
+ var ps = new ProcessStartInfo(url)
+ {
+ UseShellExecute = true,
+ Verb = "open"
+ };
+ Process.Start(ps);
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(
+ $"While attempting to open URL {url} in web browser, got exception\r\n{ex}",
+ "Could not open url in web browser",
+ MessageBoxButton.OK, MessageBoxImage.Error);
+ }
}
}
-}
\ No newline at end of file
+}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/ClikeStringArray.cs b/CSharpRegexTools4Npp/PluginInfrastructure/ClikeStringArray.cs
index 5350a71..b4bb33b 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/ClikeStringArray.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/ClikeStringArray.cs
@@ -1,14 +1,15 @@
-// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
+using System.Reflection;
using System.Runtime.InteropServices;
+using System.Windows.Forms;
+using System;
namespace CSharpRegexTools4Npp.PluginInfrastructure
{
public class ClikeStringArray : IDisposable
{
- IntPtr _nativeArray;
- List _nativeItems;
+ private readonly IntPtr _nativeArray;
+ private readonly List _nativeItems;
bool _disposed = false;
public ClikeStringArray(int num, int stringCapacity)
@@ -17,7 +18,7 @@ public ClikeStringArray(int num, int stringCapacity)
_nativeItems = new List();
for (int i = 0; i < num; i++)
{
- IntPtr item = Marshal.AllocHGlobal(stringCapacity);
+ IntPtr item = Marshal.AllocHGlobal(stringCapacity * 2); // 2 bytes per character, because we're using wchar_t arrays
Marshal.WriteIntPtr(_nativeArray + (i * IntPtr.Size), item);
_nativeItems.Add(item);
}
@@ -52,16 +53,19 @@ List _getManagedItems(bool unicode)
public void Dispose()
{
- if (!_disposed)
+ try
{
- _disposed = true;
- try
+ if (!_disposed)
{
for (int i = 0; i < _nativeItems.Count; i++)
if (_nativeItems[i] != IntPtr.Zero) Marshal.FreeHGlobal(_nativeItems[i]);
if (_nativeArray != IntPtr.Zero) Marshal.FreeHGlobal(_nativeArray);
+ _disposed = true;
}
- catch { }
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(MethodBase.GetCurrentMethod().ToString() + ": " + e.Message, this.GetType().Name);
}
}
~ClikeStringArray()
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/DllExportAttribute.cs b/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/DllExportAttribute.cs
index 8c45277..926591e 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/DllExportAttribute.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/DllExportAttribute.cs
@@ -2,10 +2,17 @@
using System;
using System.Runtime.InteropServices;
-namespace NppPlugin.DllExport
+namespace RGiesecke.DllExport
{
+ ///
+ /// The fully qualified type name must be RGiesecke.DllExport.DllExportAttribute in order to work with the pre-configured task in UnmanagedExports.Repack.Upgrade.targets.
+ /// This implementation could be avoided if we referenced the RGiesecke.DllExport.Metadata assembly, but then it will look like a runtime dependency, and be copied to the build output directory.
+ ///
+ /// See
+ ///
+ ///
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
- public partial class DllExportAttribute : Attribute
+ partial class DllExportAttribute : Attribute
{
public DllExportAttribute()
{
@@ -26,4 +33,4 @@ public DllExportAttribute(string exportName, CallingConvention callingConvention
public string ExportName { get; set; }
}
-}
\ No newline at end of file
+}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/Mono.Cecil.dll b/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/Mono.Cecil.dll
deleted file mode 100644
index ffe9b57..0000000
Binary files a/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/Mono.Cecil.dll and /dev/null differ
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/NppPlugin.DllExport.MSBuild.dll b/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/NppPlugin.DllExport.MSBuild.dll
deleted file mode 100644
index c3c9de8..0000000
Binary files a/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/NppPlugin.DllExport.MSBuild.dll and /dev/null differ
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/NppPlugin.DllExport.dll b/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/NppPlugin.DllExport.dll
deleted file mode 100644
index f673ed5..0000000
Binary files a/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/NppPlugin.DllExport.dll and /dev/null differ
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/NppPlugin.DllExport.targets b/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/NppPlugin.DllExport.targets
deleted file mode 100644
index 4db958e..0000000
--- a/CSharpRegexTools4Npp/PluginInfrastructure/DllExport/NppPlugin.DllExport.targets
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-
-
-
- $(DevEnvDir)\..\..\VC\bin
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/GatewayDomain.cs b/CSharpRegexTools4Npp/PluginInfrastructure/GatewayDomain.cs
index dbdead9..580738b 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/GatewayDomain.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/GatewayDomain.cs
@@ -1,7 +1,6 @@
// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
using System;
using System.Runtime.InteropServices;
-using System.Text;
namespace CSharpRegexTools4Npp.PluginInfrastructure
{
@@ -16,25 +15,25 @@ public class Colour
public readonly int Red, Green, Blue;
public Colour(int rgb)
- {
- Red = rgb ^ 0xFF;
- Green = rgb ^ 0x00FF;
- Blue = rgb ^ 0x0000FF;
- }
+ {
+ Red = rgb & 0xFF;
+ Green = (rgb >> 8) & 0xFF;
+ Blue = (rgb >> 16) & 0xFF;
+ }
///
- ///
+ ///
///
/// a number 0-255
/// a number 0-255
/// a number 0-255
public Colour(int red, int green, int blue)
{
- if (red > 255 || red < 0)
+ if(red > 255 || red < 0)
throw new ArgumentOutOfRangeException("red", "must be 0-255");
- if (green > 255 || green < 0)
+ if(green > 255 || green < 0)
throw new ArgumentOutOfRangeException("green", "must be 0-255");
- if (blue > 255 || blue < 0)
+ if(blue > 255 || blue < 0)
throw new ArgumentOutOfRangeException("blue", "must be 0-255");
Red = red;
Green = green;
@@ -43,136 +42,7 @@ public Colour(int red, int green, int blue)
public int Value
{
- get { return Red | (Green << 8) | (Blue << 16); }
- }
- }
-
- ///
- /// Positions within the Scintilla document refer to a character or the gap before that character.
- /// The first character in a document is 0, the second 1 and so on. If a document contains nLen characters, the last character is numbered nLen-1. The caret exists between character positions and can be located from before the first character (0) to after the last character (nLen).
- ///
- /// There are places where the caret can not go where two character bytes make up one character.
- /// This occurs when a DBCS character from a language like Japanese is included in the document or when line ends are marked with the CP/M
- /// standard of a carriage return followed by a line feed.The INVALID_POSITION constant(-1) represents an invalid position within the document.
- ///
- /// All lines of text in Scintilla are the same height, and this height is calculated from the largest font in any current style.This restriction
- /// is for performance; if lines differed in height then calculations involving positioning of text would require the text to be styled first.
- ///
- /// If you use messages, there is nothing to stop you setting a position that is in the middle of a CRLF pair, or in the middle of a 2 byte character.
- /// However, keyboard commands will not move the caret into such positions.
- ///
- public class Position : IEquatable
- {
- private readonly int pos;
-
- public static Position From(int pos)
- {
- return new Position(pos);
- }
-
- public Position(int pos)
- {
- this.pos = pos;
- }
-
- public int Value
- {
- get { return pos; }
- }
-
- public static implicit operator Position(int pos)
- {
- return new Position(pos);
- }
-
- public static implicit operator int(Position pos)
- {
- return pos.Value;
- }
-
- public static Position operator +(Position a, int b)
- {
- return new Position(a.pos + b);
- }
-
- public static Position operator +(Position a, Position b)
- {
- return new Position(a.pos + b.pos);
- }
-
- public static Position operator -(Position a, int b)
- {
- return new Position(a.pos - b);
- }
-
- public static Position operator -(Position a, Position b)
- {
- return new Position(a.pos - b.pos);
- }
-
- public static bool operator ==(Position a, Position b)
- {
- if (ReferenceEquals(a, b))
- return true;
- if (ReferenceEquals(a, null))
- return false;
- if (ReferenceEquals(b, null))
- return false;
- return a.pos == b.pos;
- }
-
- public static bool operator !=(Position a, Position b)
- {
- return !(a == b);
- }
-
- public static bool operator >(Position a, Position b)
- {
- return a.Value > b.Value;
- }
-
- public static bool operator <(Position a, Position b)
- {
- return a.Value < b.Value;
- }
-
- public static Position Min(Position a, Position b)
- {
- if (a < b)
- return a;
- return b;
- }
-
- public static Position Max(Position a, Position b)
- {
- if (a > b)
- return a;
- return b;
- }
-
- public override string ToString()
- {
- return "Position: " + pos;
- }
-
- public bool Equals(Position other)
- {
- if (ReferenceEquals(null, other)) return false;
- if (ReferenceEquals(this, other)) return true;
- return pos == other.pos;
- }
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- if (obj.GetType() != this.GetType()) return false;
- return Equals((Position)obj);
- }
-
- public override int GetHashCode()
- {
- return pos;
+ get { return Red + (Green << 8) + (Blue << 16); }
}
}
@@ -202,7 +72,7 @@ public class KeyModifier
///
public KeyModifier(SciMsg SCK_KeyCode, SciMsg SCMOD_modifier)
{
- value = (int)SCK_KeyCode | ((int)SCMOD_modifier << 16);
+ value = (int) SCK_KeyCode | ((int) SCMOD_modifier << 16);
}
public int Value
@@ -214,12 +84,9 @@ public int Value
[StructLayout(LayoutKind.Sequential)]
public struct CharacterRange
{
- public CharacterRange(int cpmin, int cpmax)
- {
- cpMin = cpmin; cpMax = cpmax;
- }
- public int cpMin;
- public int cpMax;
+ public CharacterRange(int cpmin, int cpmax) { cpMin = new IntPtr(cpmin); cpMax = new IntPtr(cpmax); }
+ public IntPtr cpMin;
+ public IntPtr cpMax;
}
public class Cells
@@ -230,7 +97,6 @@ public Cells(char[] charactersAndStyles)
{
this.charactersAndStyles = charactersAndStyles;
}
-
public char[] Value { get { return charactersAndStyles; } }
}
@@ -247,8 +113,8 @@ public TextRange(CharacterRange chrRange, int stringCapacity)
}
public TextRange(int cpmin, int cpmax, int stringCapacity)
{
- _sciTextRange.chrg.cpMin = cpmin;
- _sciTextRange.chrg.cpMax = cpmax;
+ _sciTextRange.chrg.cpMin = new IntPtr(cpmin);
+ _sciTextRange.chrg.cpMax = new IntPtr(cpmax);
_sciTextRange.lpstrText = Marshal.AllocHGlobal(stringCapacity);
}
@@ -258,11 +124,8 @@ struct Sci_TextRange
public CharacterRange chrg;
public IntPtr lpstrText;
}
-
public IntPtr NativePointer { get { _initNativeStruct(); return _ptrSciTextRange; } }
-
public string lpstrText { get { _readNativeStruct(); return Marshal.PtrToStringAnsi(_sciTextRange.lpstrText); } }
-
public CharacterRange chrg { get { _readNativeStruct(); return _sciTextRange.chrg; } set { _sciTextRange.chrg = value; _initNativeStruct(); } }
void _initNativeStruct()
@@ -296,6 +159,728 @@ public void Dispose()
/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
+ /// Is undo history being collected? (Scintilla feature SCWS_)
+ public enum WhiteSpace
+ {
+ INVISIBLE = 0,
+ VISIBLEALWAYS = 1,
+ VISIBLEAFTERINDENT = 2,
+ VISIBLEONLYININDENT = 3
+ }
+ /// Make white space characters invisible, always visible or visible outside indentation. (Scintilla feature SCTD_)
+ public enum TabDrawMode
+ {
+ LONGARROW = 0,
+ STRIKEOUT = 1
+ }
+ /// Retrieve the position of the last correctly styled character. (Scintilla feature SC_EOL_)
+ public enum EndOfLine
+ {
+ CRLF = 0,
+ CR = 1,
+ LF = 2
+ }
+ ///
+ /// Set the code page used to interpret the bytes of the document as characters.
+ /// The SC_CP_UTF8 value can be used to enter Unicode mode.
+ /// (Scintilla feature SC_IME_)
+ ///
+ public enum IMEInteraction
+ {
+ WINDOWED = 0,
+ INLINE = 1
+ }
+ /// Choose to display the the IME in a winow or inline. (Scintilla feature SC_MARK_)
+ public enum MarkerSymbol
+ {
+ CIRCLE = 0,
+ ROUNDRECT = 1,
+ ARROW = 2,
+ SMALLRECT = 3,
+ SHORTARROW = 4,
+ EMPTY = 5,
+ ARROWDOWN = 6,
+ MINUS = 7,
+ PLUS = 8,
+ VLINE = 9,
+ LCORNER = 10,
+ TCORNER = 11,
+ BOXPLUS = 12,
+ BOXPLUSCONNECTED = 13,
+ BOXMINUS = 14,
+ BOXMINUSCONNECTED = 15,
+ LCORNERCURVE = 16,
+ TCORNERCURVE = 17,
+ CIRCLEPLUS = 18,
+ CIRCLEPLUSCONNECTED = 19,
+ CIRCLEMINUS = 20,
+ CIRCLEMINUSCONNECTED = 21,
+ BACKGROUND = 22,
+ DOTDOTDOT = 23,
+ ARROWS = 24,
+ PIXMAP = 25,
+ FULLRECT = 26,
+ LEFTRECT = 27,
+ AVAILABLE = 28,
+ UNDERLINE = 29,
+ RGBAIMAGE = 30,
+ BOOKMARK = 31,
+ VERTICALBOOKMARK = 32,
+ CHARACTER = 10000
+ }
+ /// Invisible mark that only sets the line background colour. (Scintilla feature SC_MARKNUM_)
+ public enum MarkerOutline
+ {
+ FOLDEREND = 25,
+ FOLDEROPENMID = 26,
+ FOLDERMIDTAIL = 27,
+ FOLDERTAIL = 28,
+ FOLDERSUB = 29,
+ FOLDER = 30,
+ FOLDEROPEN = 31
+ }
+ /// Set the alpha used for a marker that is drawn in the text area, not the margin. (Scintilla feature SC_MARGIN_)
+ public enum MarginType
+ {
+ SYMBOL = 0,
+ NUMBER = 1,
+ BACK = 2,
+ FORE = 3,
+ TEXT = 4,
+ RTEXT = 5,
+ COLOUR = 6
+ }
+ /// Styles in range 32..39 are predefined for parts of the UI and are not used as normal styles. (Scintilla feature STYLE_)
+ public enum StylesCommon
+ {
+ DEFAULT = 32,
+ LINENUMBER = 33,
+ BRACELIGHT = 34,
+ BRACEBAD = 35,
+ CONTROLCHAR = 36,
+ INDENTGUIDE = 37,
+ CALLTIP = 38,
+ FOLDDISPLAYTEXT = 39,
+ LASTPREDEFINED = 39,
+ MAX = 255
+ }
+ ///
+ /// Character set identifiers are used in StyleSetCharacterSet.
+ /// The values are the same as the Windows *_CHARSET values.
+ /// (Scintilla feature SC_CHARSET_)
+ ///
+ public enum CharacterSet
+ {
+ ANSI = 0,
+ DEFAULT = 1,
+ BALTIC = 186,
+ CHINESEBIG5 = 136,
+ EASTEUROPE = 238,
+ GB2312 = 134,
+ GREEK = 161,
+ HANGUL = 129,
+ MAC = 77,
+ OEM = 255,
+ RUSSIAN = 204,
+ OEM866 = 866,
+ CYRILLIC = 1251,
+ SHIFTJIS = 128,
+ SYMBOL = 2,
+ TURKISH = 162,
+ JOHAB = 130,
+ HEBREW = 177,
+ ARABIC = 178,
+ VIETNAMESE = 163,
+ THAI = 222,
+ _8859_15 = 1000
+ }
+ /// Set a style to be underlined or not. (Scintilla feature SC_CASE_)
+ public enum CaseVisible
+ {
+ MIXED = 0,
+ UPPER = 1,
+ LOWER = 2,
+ CAMEL = 3
+ }
+ /// Get the size of characters of a style in points multiplied by 100 (Scintilla feature SC_WEIGHT_)
+ public enum FontWeight
+ {
+ NORMAL = 400,
+ SEMIBOLD = 600,
+ BOLD = 700
+ }
+ /// Indicator style enumeration and some constants (Scintilla feature INDIC_)
+ public enum IndicatorStyle
+ {
+ PLAIN = 0,
+ SQUIGGLE = 1,
+ TT = 2,
+ DIAGONAL = 3,
+ STRIKE = 4,
+ HIDDEN = 5,
+ BOX = 6,
+ ROUNDBOX = 7,
+ STRAIGHTBOX = 8,
+ DASH = 9,
+ DOTS = 10,
+ SQUIGGLELOW = 11,
+ DOTBOX = 12,
+ SQUIGGLEPIXMAP = 13,
+ COMPOSITIONTHICK = 14,
+ COMPOSITIONTHIN = 15,
+ FULLBOX = 16,
+ TEXTFORE = 17,
+ POINT = 18,
+ POINTCHARACTER = 19,
+ GRADIENT = 20,
+ GRADIENTCENTRE = 21,
+ CONTAINER = 8,
+ IME = 32,
+ IME_MAX = 35,
+ MAX = 35
+ }
+ ///
+ /// INDIC_CONTAINER, INDIC_IME, INDIC_IME_MAX, and INDIC_MAX are indicator numbers,
+ /// not IndicatorStyles so should not really be in the INDIC_ enumeration.
+ /// They are redeclared in IndicatorNumbers INDICATOR_.
+ /// (Scintilla feature INDICATOR_)
+ ///
+ public enum IndicatorNumbers
+ {
+ CONTAINER = 8,
+ IME = 32,
+ IME_MAX = 35,
+ MAX = 35
+ }
+ /// Retrieve the foreground hover colour of an indicator. (Scintilla feature SC_INDICVALUE)
+ public enum IndicValue
+ {
+ BIT = 0x1000000,
+ MASK = 0xFFFFFF
+ }
+ /// Retrieve the foreground hover colour of an indicator. (Scintilla feature SC_INDICFLAG_)
+ public enum IndicFlag
+ {
+ VALUEFORE = 1
+ }
+ /// Is the horizontal scroll bar visible? (Scintilla feature SC_IV_)
+ public enum IndentView
+ {
+ NONE = 0,
+ REAL = 1,
+ LOOKFORWARD = 2,
+ LOOKBOTH = 3
+ }
+ /// Returns the print magnification. (Scintilla feature SC_PRINT_)
+ public enum PrintOption
+ {
+ NORMAL = 0,
+ INVERTLIGHT = 1,
+ BLACKONWHITE = 2,
+ COLOURONWHITE = 3,
+ COLOURONWHITEDEFAULTBG = 4,
+ SCREENCOLOURS = 5
+ }
+ /// Returns the print colour mode. (Scintilla feature SCFIND_)
+ public enum FindOption
+ {
+ NONE = 0x0,
+ WHOLEWORD = 0x2,
+ MATCHCASE = 0x4,
+ WORDSTART = 0x00100000,
+ REGEXP = 0x00200000,
+ POSIX = 0x00400000,
+ CXX11REGEX = 0x00800000
+ }
+ /// The number of display lines needed to wrap a document line (Scintilla feature SC_FOLDLEVEL)
+ public enum FoldLevel
+ {
+ BASE = 0x400,
+ WHITEFLAG = 0x1000,
+ HEADERFLAG = 0x2000,
+ NUMBERMASK = 0x0FFF
+ }
+ /// Switch a header line between expanded and contracted and show some text after the line. (Scintilla feature SC_FOLDDISPLAYTEXT_)
+ public enum FoldDisplayTextStyle
+ {
+ HIDDEN = 0,
+ STANDARD = 1,
+ BOXED = 2
+ }
+ /// Get the default fold display text. (Scintilla feature SC_FOLDACTION_)
+ public enum FoldAction
+ {
+ CONTRACT = 0,
+ EXPAND = 1,
+ TOGGLE = 2
+ }
+ /// Ensure a particular line is visible by expanding any header line hiding it. (Scintilla feature SC_AUTOMATICFOLD_)
+ public enum AutomaticFold
+ {
+ SHOW = 0x0001,
+ CLICK = 0x0002,
+ CHANGE = 0x0004
+ }
+ /// Get automatic folding behaviours. (Scintilla feature SC_FOLDFLAG_)
+ public enum FoldFlag
+ {
+ LINEBEFORE_EXPANDED = 0x0002,
+ LINEBEFORE_CONTRACTED = 0x0004,
+ LINEAFTER_EXPANDED = 0x0008,
+ LINEAFTER_CONTRACTED = 0x0010,
+ LEVELNUMBERS = 0x0040,
+ LINESTATE = 0x0080
+ }
+ /// Is the range start..end considered a word? (Scintilla feature SC_IDLESTYLING_)
+ public enum IdleStyling
+ {
+ NONE = 0,
+ TOVISIBLE = 1,
+ AFTERVISIBLE = 2,
+ ALL = 3
+ }
+ /// Retrieve the limits to idle styling. (Scintilla feature SC_WRAP_)
+ public enum Wrap
+ {
+ NONE = 0,
+ WORD = 1,
+ CHAR = 2,
+ WHITESPACE = 3
+ }
+ /// Retrieve whether text is word wrapped. (Scintilla feature SC_WRAPVISUALFLAG_)
+ public enum WrapVisualFlag
+ {
+ NONE = 0x0000,
+ END = 0x0001,
+ START = 0x0002,
+ MARGIN = 0x0004
+ }
+ /// Retrive the display mode of visual flags for wrapped lines. (Scintilla feature SC_WRAPVISUALFLAGLOC_)
+ public enum WrapVisualLocation
+ {
+ DEFAULT = 0x0000,
+ END_BY_TEXT = 0x0001,
+ START_BY_TEXT = 0x0002
+ }
+ /// Retrive the start indent for wrapped lines. (Scintilla feature SC_WRAPINDENT_)
+ public enum WrapIndentMode
+ {
+ FIXED = 0,
+ SAME = 1,
+ INDENT = 2,
+ DEEPINDENT = 3
+ }
+ /// Retrieve how wrapped sublines are placed. Default is fixed. (Scintilla feature SC_CACHE_)
+ public enum LineCache
+ {
+ NONE = 0,
+ CARET = 1,
+ PAGE = 2,
+ DOCUMENT = 3
+ }
+ /// Append a string to the end of the document without changing the selection. (Scintilla feature SC_PHASES_)
+ public enum PhasesDraw
+ {
+ ONE = 0,
+ TWO = 1,
+ MULTIPLE = 2
+ }
+ /// Control font anti-aliasing. (Scintilla feature SC_EFF_)
+ public enum FontQuality
+ {
+ QUALITY_MASK = 0xF,
+ QUALITY_DEFAULT = 0,
+ QUALITY_NON_ANTIALIASED = 1,
+ QUALITY_ANTIALIASED = 2,
+ QUALITY_LCD_OPTIMIZED = 3
+ }
+ /// Scroll so that a display line is at the top of the display. (Scintilla feature SC_MULTIPASTE_)
+ public enum MultiPaste
+ {
+ ONCE = 0,
+ EACH = 1
+ }
+ /// Set the other colour used as a chequerboard pattern in the fold margin (Scintilla feature SC_ACCESSIBILITY_)
+ public enum Accessibility
+ {
+ DISABLED = 0,
+ ENABLED = 1
+ }
+ /// Set which document modification events are sent to the container. (Scintilla feature EDGE_)
+ public enum EdgeVisualStyle
+ {
+ NONE = 0,
+ LINE = 1,
+ BACKGROUND = 2,
+ MULTILINE = 3
+ }
+ /// Retrieves the number of lines completely visible. (Scintilla feature SC_POPUP_)
+ public enum PopUp
+ {
+ NEVER = 0,
+ ALL = 1,
+ TEXT = 2
+ }
+ /// Retrieve the zoom level. (Scintilla feature SC_DOCUMENTOPTION_)
+ public enum DocumentOption
+ {
+ DEFAULT = 0,
+ STYLES_NONE = 0x1,
+ TEXT_LARGE = 0x100
+ }
+ /// Get internal focus flag. (Scintilla feature SC_STATUS_)
+ public enum Status
+ {
+ OK = 0,
+ FAILURE = 1,
+ BADALLOC = 2,
+ WARN_START = 1000,
+ WARN_REGEX = 1001
+ }
+ /// Get whether mouse wheel can be active outside the window. (Scintilla feature SC_CURSOR)
+ public enum CursorShape
+ {
+ NORMAL = -1,
+ ARROW = 2,
+ WAIT = 4,
+ REVERSEARROW = 7
+ }
+ /// Constants for use with SetVisiblePolicy, similar to SetCaretPolicy. (Scintilla feature VISIBLE_)
+ public enum VisiblePolicy
+ {
+ SLOP = 0x01,
+ STRICT = 0x04
+ }
+ /// Set the focus to this Scintilla widget. (Scintilla feature CARET_)
+ public enum CaretPolicy
+ {
+ SLOP = 0x01,
+ STRICT = 0x04,
+ JUMPS = 0x10,
+ EVEN = 0x08
+ }
+ /// Copy argument text to the clipboard. (Scintilla feature SC_SEL_)
+ public enum SelectionMode
+ {
+ STREAM = 0,
+ RECTANGLE = 1,
+ LINES = 2,
+ THIN = 3
+ }
+ ///
+ /// Get currently selected item text in the auto-completion list
+ /// Returns the length of the item text
+ /// Result is NUL-terminated.
+ /// (Scintilla feature SC_CASEINSENSITIVEBEHAVIOUR_)
+ ///
+ public enum CaseInsensitiveBehaviour
+ {
+ RESPECTCASE = 0,
+ IGNORECASE = 1
+ }
+ /// Get auto-completion case insensitive behaviour. (Scintilla feature SC_MULTIAUTOC_)
+ public enum MultiAutoComplete
+ {
+ ONCE = 0,
+ EACH = 1
+ }
+ /// Retrieve the effect of autocompleting when there are multiple selections. (Scintilla feature SC_ORDER_)
+ public enum Ordering
+ {
+ PRESORTED = 0,
+ PERFORMSORT = 1,
+ CUSTOM = 2
+ }
+ /// Stop the caret preferred x position changing when the user types. (Scintilla feature SC_CARETSTICKY_)
+ public enum CaretSticky
+ {
+ OFF = 0,
+ ON = 1,
+ WHITESPACE = 2
+ }
+ /// Duplicate the selection. If selection empty duplicate the line containing the caret. (Scintilla feature SC_ALPHA_)
+ public enum Alpha
+ {
+ TRANSPARENT = 0,
+ OPAQUE = 255,
+ NOALPHA = 256
+ }
+ /// Get the background alpha of the caret line. (Scintilla feature CARETSTYLE_)
+ public enum CaretStyle
+ {
+ INVISIBLE = 0,
+ LINE = 1,
+ BLOCK = 2,
+ OVERSTRIKE_BAR = 0,
+ OVERSTRIKE_BLOCK = 0x10,
+ INS_MASK = 0xF,
+ BLOCK_AFTER = 0x100
+ }
+ /// Get the start of the range of style numbers used for margin text (Scintilla feature SC_MARGINOPTION_)
+ public enum MarginOption
+ {
+ NONE = 0,
+ SUBLINESELECT = 1
+ }
+ /// Clear the annotations from all lines (Scintilla feature ANNOTATION_)
+ public enum AnnotationVisible
+ {
+ HIDDEN = 0,
+ STANDARD = 1,
+ BOXED = 2,
+ INDENTED = 3
+ }
+ /// Allocate some extended (>255) style numbers and return the start of the range (Scintilla feature UNDO_)
+ public enum UndoFlags
+ {
+ NONE = 0,
+ MAY_COALESCE = 1
+ }
+ /// Return the virtual space of the anchor of the rectangular selection. (Scintilla feature SCVS_)
+ public enum VirtualSpace
+ {
+ NONE = 0,
+ RECTANGULARSELECTION = 1,
+ USERACCESSIBLE = 2,
+ NOWRAPLINESTART = 4
+ }
+ /// Scroll to end of document. (Scintilla feature SC_TECHNOLOGY_)
+ public enum Technology
+ {
+ DEFAULT = 0,
+ DIRECTWRITE = 1,
+ DIRECTWRITERETAIN = 2,
+ DIRECTWRITEDC = 3
+ }
+ ///
+ /// Line end types which may be used in addition to LF, CR, and CRLF
+ /// SC_LINE_END_TYPE_UNICODE includes U+2028 Line Separator,
+ /// U+2029 Paragraph Separator, and U+0085 Next Line
+ /// (Scintilla feature SC_LINE_END_TYPE_)
+ ///
+ public enum LineEndType
+ {
+ DEFAULT = 0,
+ UNICODE = 1
+ }
+ ///
+ /// Retrieve a '\n' separated list of properties understood by the current lexer.
+ /// Result is NUL-terminated.
+ /// (Scintilla feature SC_TYPE_)
+ ///
+ public enum TypeProperty
+ {
+ BOOLEAN = 0,
+ INTEGER = 1,
+ STRING = 2
+ }
+ ///
+ /// Notifications
+ /// Type of modification and the action which caused the modification.
+ /// These are defined as a bit mask to make it easy to specify which notifications are wanted.
+ /// One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
+ /// (Scintilla feature SC_MOD_ SC_PERFORMED_ SC_MULTISTEPUNDOREDO SC_LASTSTEPINUNDOREDO SC_MULTILINEUNDOREDO SC_STARTACTION SC_MODEVENTMASKALL)
+ ///
+ public enum ModificationFlags
+ {
+ }
+ ///
+ /// Notifications
+ /// Type of modification and the action which caused the modification.
+ /// These are defined as a bit mask to make it easy to specify which notifications are wanted.
+ /// One bit is set from each of SC_MOD_* and SC_PERFORMED_*.
+ /// (Scintilla feature SC_UPDATE_)
+ ///
+ public enum Update
+ {
+ CONTENT = 0x1,
+ SELECTION = 0x2,
+ V_SCROLL = 0x4,
+ H_SCROLL = 0x8
+ }
+ ///
+ /// Symbolic key codes and modifier flags.
+ /// ASCII and other printable characters below 256.
+ /// Extended keys above 300.
+ /// (Scintilla feature SCMOD_)
+ ///
+ public enum KeyMod
+ {
+ NORM = 0,
+ SHIFT = 1,
+ CTRL = 2,
+ ALT = 4,
+ SUPER = 8,
+ META = 16
+ }
+ ///
+ /// Symbolic key codes and modifier flags.
+ /// ASCII and other printable characters below 256.
+ /// Extended keys above 300.
+ /// (Scintilla feature SC_AC_)
+ ///
+ public enum CompletionMethods
+ {
+ FILLUP = 1,
+ DOUBLECLICK = 2,
+ TAB = 3,
+ NEWLINE = 4,
+ COMMAND = 5
+ }
+ /// characterSource for SCN_CHARADDED (Scintilla feature SC_CHARACTERSOURCE_)
+ public enum CharacterSource
+ {
+ DIRECT_INPUT = 0,
+ TENTATIVE_INPUT = 1,
+ IME_RESULT = 2
+ }
+ /// For SciLexer.h (Scintilla feature SCLEX_)
+ public enum Lexer
+ {
+ CONTAINER = 0,
+ NULL = 1,
+ PYTHON = 2,
+ CPP = 3,
+ HTML = 4,
+ XML = 5,
+ PERL = 6,
+ SQL = 7,
+ VB = 8,
+ PROPERTIES = 9,
+ ERRORLIST = 10,
+ MAKEFILE = 11,
+ BATCH = 12,
+ XCODE = 13,
+ LATEX = 14,
+ LUA = 15,
+ DIFF = 16,
+ CONF = 17,
+ PASCAL = 18,
+ AVE = 19,
+ ADA = 20,
+ LISP = 21,
+ RUBY = 22,
+ EIFFEL = 23,
+ EIFFELKW = 24,
+ TCL = 25,
+ NNCRONTAB = 26,
+ BULLANT = 27,
+ VBSCRIPT = 28,
+ BAAN = 31,
+ MATLAB = 32,
+ SCRIPTOL = 33,
+ ASM = 34,
+ CPPNOCASE = 35,
+ FORTRAN = 36,
+ F77 = 37,
+ CSS = 38,
+ POV = 39,
+ LOUT = 40,
+ ESCRIPT = 41,
+ PS = 42,
+ NSIS = 43,
+ MMIXAL = 44,
+ CLW = 45,
+ CLWNOCASE = 46,
+ LOT = 47,
+ YAML = 48,
+ TEX = 49,
+ METAPOST = 50,
+ POWERBASIC = 51,
+ FORTH = 52,
+ ERLANG = 53,
+ OCTAVE = 54,
+ MSSQL = 55,
+ VERILOG = 56,
+ KIX = 57,
+ GUI4CLI = 58,
+ SPECMAN = 59,
+ AU3 = 60,
+ APDL = 61,
+ BASH = 62,
+ ASN1 = 63,
+ VHDL = 64,
+ CAML = 65,
+ BLITZBASIC = 66,
+ PUREBASIC = 67,
+ HASKELL = 68,
+ PHPSCRIPT = 69,
+ TADS3 = 70,
+ REBOL = 71,
+ SMALLTALK = 72,
+ FLAGSHIP = 73,
+ CSOUND = 74,
+ FREEBASIC = 75,
+ INNOSETUP = 76,
+ OPAL = 77,
+ SPICE = 78,
+ D = 79,
+ CMAKE = 80,
+ GAP = 81,
+ PLM = 82,
+ PROGRESS = 83,
+ ABAQUS = 84,
+ ASYMPTOTE = 85,
+ R = 86,
+ MAGIK = 87,
+ POWERSHELL = 88,
+ MYSQL = 89,
+ PO = 90,
+ TAL = 91,
+ COBOL = 92,
+ TACL = 93,
+ SORCUS = 94,
+ POWERPRO = 95,
+ NIMROD = 96,
+ SML = 97,
+ MARKDOWN = 98,
+ TXT2TAGS = 99,
+ A68K = 100,
+ MODULA = 101,
+ COFFEESCRIPT = 102,
+ TCMD = 103,
+ AVS = 104,
+ ECL = 105,
+ OSCRIPT = 106,
+ VISUALPROLOG = 107,
+ LITERATEHASKELL = 108,
+ STTXT = 109,
+ KVIRC = 110,
+ RUST = 111,
+ DMAP = 112,
+ AS = 113,
+ DMIS = 114,
+ REGISTRY = 115,
+ BIBTEX = 116,
+ SREC = 117,
+ IHEX = 118,
+ TEHEX = 119,
+ JSON = 120,
+ EDIFACT = 121,
+ INDENT = 122,
+ MAXIMA = 123,
+ STATA = 124,
+ SAS = 125,
+ NIM = 126,
+ CIL = 127,
+ X12 = 128,
+ DATAFLEX = 129,
+ AUTOMATIC = 1000
+ }
+ /// GTK Specific to work around focus and accelerator problems: (Scintilla feature SC_BIDIRECTIONAL_)
+ public enum Bidirectional
+ {
+ DISABLED = 0,
+ L2R = 1,
+ R2L = 2
+ }
+ /// Set bidirectional text display state. (Scintilla feature SC_LINECHARACTERINDEX_)
+ public enum LineCharacterIndexType
+ {
+ NONE = 0,
+ UTF32 = 1,
+ UTF16 = 2
+ }
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/GatewayDomain.cs.bak b/CSharpRegexTools4Npp/PluginInfrastructure/GatewayDomain.cs.bak
deleted file mode 100644
index d103c0d..0000000
--- a/CSharpRegexTools4Npp/PluginInfrastructure/GatewayDomain.cs.bak
+++ /dev/null
@@ -1,303 +0,0 @@
-// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
-using System;
-using System.Runtime.InteropServices;
-using System.Text;
-
-namespace CSharpRegexTools4Npp.PluginInfrastructure
-{
- ///
- /// Colours are set using the RGB format (Red, Green, Blue). The intensity of each colour is set in the range 0 to 255.
- /// If you have three such intensities, they are combined as: red | (green << 8) | (blue << 16).
- /// If you set all intensities to 255, the colour is white. If you set all intensities to 0, the colour is black.
- /// When you set a colour, you are making a request. What you will get depends on the capabilities of the system and the current screen mode.
- ///
- public class Colour
- {
- public readonly int Red, Green, Blue;
-
- public Colour(int rgb)
- {
- Red = rgb ^ 0xFF;
- Green = rgb ^ 0x00FF;
- Blue = rgb ^ 0x0000FF;
- }
-
- ///
- ///
- ///
- /// a number 0-255
- /// a number 0-255
- /// a number 0-255
- public Colour(int red, int green, int blue)
- {
- if(red > 255 || red < 0)
- throw new ArgumentOutOfRangeException("red", "must be 0-255");
- if(green > 255 || green < 0)
- throw new ArgumentOutOfRangeException("green", "must be 0-255");
- if(blue > 255 || blue < 0)
- throw new ArgumentOutOfRangeException("blue", "must be 0-255");
- Red = red;
- Green = green;
- Blue = blue;
- }
-
- public int Value
- {
- get { return Red | (Green << 8) | (Blue << 16); }
- }
- }
-
- ///
- /// Positions within the Scintilla document refer to a character or the gap before that character.
- /// The first character in a document is 0, the second 1 and so on. If a document contains nLen characters, the last character is numbered nLen-1. The caret exists between character positions and can be located from before the first character (0) to after the last character (nLen).
- ///
- /// There are places where the caret can not go where two character bytes make up one character.
- /// This occurs when a DBCS character from a language like Japanese is included in the document or when line ends are marked with the CP/M
- /// standard of a carriage return followed by a line feed.The INVALID_POSITION constant(-1) represents an invalid position within the document.
- ///
- /// All lines of text in Scintilla are the same height, and this height is calculated from the largest font in any current style.This restriction
- /// is for performance; if lines differed in height then calculations involving positioning of text would require the text to be styled first.
- ///
- /// If you use messages, there is nothing to stop you setting a position that is in the middle of a CRLF pair, or in the middle of a 2 byte character.
- /// However, keyboard commands will not move the caret into such positions.
- ///
- public class Position : IEquatable
- {
- private readonly int pos;
-
- public static Position From(int pos)
- {
- return new Position(pos);
- }
-
- public Position(int pos)
- {
- this.pos = pos;
- }
-
- public int Value
- {
- get { return pos; }
- }
-
- public static implicit operator Position(int pos)
- {
- return new Position(pos);
- }
-
- public static implicit operator int(Position pos)
- {
- return pos.Value;
- }
-
- public static Position operator +(Position a, int b)
- {
- return new Position(a.pos + b);
- }
-
- public static Position operator +(Position a, Position b)
- {
- return new Position(a.pos + b.pos);
- }
-
- public static Position operator -(Position a, int b)
- {
- return new Position(a.pos - b);
- }
-
- public static Position operator -(Position a, Position b)
- {
- return new Position(a.pos - b.pos);
- }
-
- public static bool operator ==(Position a, Position b)
- {
- if (ReferenceEquals(a, b))
- return true;
- if (ReferenceEquals(a, null))
- return false;
- if (ReferenceEquals(b, null))
- return false;
- return a.pos == b.pos;
- }
-
- public static bool operator !=(Position a, Position b)
- {
- return !(a == b);
- }
-
- public static bool operator >(Position a, Position b)
- {
- return a.Value > b.Value;
- }
-
- public static bool operator <(Position a, Position b)
- {
- return a.Value < b.Value;
- }
-
- public static Position Min(Position a, Position b)
- {
- if (a < b)
- return a;
- return b;
- }
-
- public static Position Max(Position a, Position b)
- {
- if (a > b)
- return a;
- return b;
- }
-
- public override string ToString()
- {
- return "Position: " + pos;
- }
-
- public bool Equals(Position other)
- {
- if (ReferenceEquals(null, other)) return false;
- if (ReferenceEquals(this, other)) return true;
- return pos == other.pos;
- }
-
- public override bool Equals(object obj)
- {
- if (ReferenceEquals(null, obj)) return false;
- if (ReferenceEquals(this, obj)) return true;
- if (obj.GetType() != this.GetType()) return false;
- return Equals((Position)obj);
- }
-
- public override int GetHashCode()
- {
- return pos;
- }
- }
-
- ///
- /// Class containing key and modifiers
- ///
- /// The key code is a visible or control character or a key from the SCK_* enumeration, which contains:
- /// SCK_ADD, SCK_BACK, SCK_DELETE, SCK_DIVIDE, SCK_DOWN, SCK_END, SCK_ESCAPE, SCK_HOME, SCK_INSERT, SCK_LEFT, SCK_MENU, SCK_NEXT(Page Down), SCK_PRIOR(Page Up), S
- /// CK_RETURN, SCK_RIGHT, SCK_RWIN, SCK_SUBTRACT, SCK_TAB, SCK_UP, and SCK_WIN.
- ///
- /// The modifiers are a combination of zero or more of SCMOD_ALT, SCMOD_CTRL, SCMOD_SHIFT, SCMOD_META, and SCMOD_SUPER.
- /// On OS X, the Command key is mapped to SCMOD_CTRL and the Control key to SCMOD_META.SCMOD_SUPER is only available on GTK+ which is commonly the Windows key.
- /// If you are building a table, you might want to use SCMOD_NORM, which has the value 0, to mean no modifiers.
- ///
- public class KeyModifier
- {
- private readonly int value;
-
- ///
- /// The key code is a visible or control character or a key from the SCK_* enumeration, which contains:
- /// SCK_ADD, SCK_BACK, SCK_DELETE, SCK_DIVIDE, SCK_DOWN, SCK_END, SCK_ESCAPE, SCK_HOME, SCK_INSERT, SCK_LEFT, SCK_MENU, SCK_NEXT(Page Down), SCK_PRIOR(Page Up),
- /// SCK_RETURN, SCK_RIGHT, SCK_RWIN, SCK_SUBTRACT, SCK_TAB, SCK_UP, and SCK_WIN.
- ///
- /// The modifiers are a combination of zero or more of SCMOD_ALT, SCMOD_CTRL, SCMOD_SHIFT, SCMOD_META, and SCMOD_SUPER.
- /// On OS X, the Command key is mapped to SCMOD_CTRL and the Control key to SCMOD_META.SCMOD_SUPER is only available on GTK+ which is commonly the Windows key.
- /// If you are building a table, you might want to use SCMOD_NORM, which has the value 0, to mean no modifiers.
- ///
- public KeyModifier(SciMsg SCK_KeyCode, SciMsg SCMOD_modifier)
- {
- value = (int) SCK_KeyCode | ((int) SCMOD_modifier << 16);
- }
-
- public int Value
- {
- get { return Value; }
- }
- }
-
- [StructLayout(LayoutKind.Sequential)]
- public struct CharacterRange
- {
- public CharacterRange(int cpmin, int cpmax)
- {
- cpMin = cpmin; cpMax = cpmax;
- }
-
- public int cpMin;
- public int cpMax;
- }
-
- public class Cells
- {
- char[] charactersAndStyles;
-
- public Cells(char[] charactersAndStyles)
- {
- this.charactersAndStyles = charactersAndStyles;
- }
-
- public char[] Value { get { return charactersAndStyles; } }
- }
-
- public class TextRange : IDisposable
- {
- Sci_TextRange _sciTextRange;
- IntPtr _ptrSciTextRange;
- bool _disposed = false;
-
- public TextRange(CharacterRange chrRange, int stringCapacity)
- {
- _sciTextRange.chrg = chrRange;
- _sciTextRange.lpstrText = Marshal.AllocHGlobal(stringCapacity);
- }
-
- public TextRange(int cpmin, int cpmax, int stringCapacity)
- {
- _sciTextRange.chrg.cpMin = cpmin;
- _sciTextRange.chrg.cpMax = cpmax;
- _sciTextRange.lpstrText = Marshal.AllocHGlobal(stringCapacity);
- }
-
- [StructLayout(LayoutKind.Sequential)]
- struct Sci_TextRange
- {
- public CharacterRange chrg;
- public IntPtr lpstrText;
- }
-
- public IntPtr NativePointer { get { _initNativeStruct(); return _ptrSciTextRange; } }
-
- public string lpstrText { get { _readNativeStruct(); return Marshal.PtrToStringAnsi(_sciTextRange.lpstrText); } }
-
- public CharacterRange chrg { get { _readNativeStruct(); return _sciTextRange.chrg; } set { _sciTextRange.chrg = value; _initNativeStruct(); } }
-
- void _initNativeStruct()
- {
- if (_ptrSciTextRange == IntPtr.Zero)
- _ptrSciTextRange = Marshal.AllocHGlobal(Marshal.SizeOf(_sciTextRange));
- Marshal.StructureToPtr(_sciTextRange, _ptrSciTextRange, false);
- }
-
- void _readNativeStruct()
- {
- if (_ptrSciTextRange != IntPtr.Zero)
- _sciTextRange = (Sci_TextRange)Marshal.PtrToStructure(_ptrSciTextRange, typeof(Sci_TextRange));
- }
-
- public void Dispose()
- {
- if (!_disposed)
- {
- if (_sciTextRange.lpstrText != IntPtr.Zero) Marshal.FreeHGlobal(_sciTextRange.lpstrText);
- if (_ptrSciTextRange != IntPtr.Zero) Marshal.FreeHGlobal(_ptrSciTextRange);
- _disposed = true;
- }
- }
-
- ~TextRange()
- {
- Dispose();
- }
- }
-
-
- /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
- /* --Autogenerated -- end of section automatically generated from Scintilla.iface */
-
-}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/IScintillaGateway.cs b/CSharpRegexTools4Npp/PluginInfrastructure/IScintillaGateway.cs
deleted file mode 100644
index 380703b..0000000
--- a/CSharpRegexTools4Npp/PluginInfrastructure/IScintillaGateway.cs
+++ /dev/null
@@ -1,2561 +0,0 @@
-// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
-using System;
-using static CSharpRegexTools4Npp.PluginInfrastructure.Win32;
-
-namespace CSharpRegexTools4Npp.PluginInfrastructure
-{
-
- ///
- /// This it the plugin-writers primary interface to Notepad++/Scintilla.
- /// It takes away all the complexity with command numbers and Int-pointer casting.
- ///
- /// See http://www.scintilla.org/ScintillaDoc.html for further details.
- ///
- public interface IScintillaGateway
- {
- int GetSelectionLength();
- void AppendTextAndMoveCursor(string text);
- void InsertTextAndMoveCursor(string text);
- void SelectCurrentLine();
- void ClearSelectionToCursor();
-
- ///
- /// Get the current line from the current position
- ///
- int GetCurrentLineNumber();
-
- ///
- /// Get the scroll information for the current Scintilla window.
- ///
- /// Arguments for the scroll information such as tracking
- /// Which scroll bar information are you looking for
- /// A ScrollInfo struct with information of the current scroll state
- ScrollInfo GetScrollInfo(ScrollInfoMask mask = ScrollInfoMask.SIF_ALL, ScrollInfoBar scrollBar = ScrollInfoBar.SB_BOTH);
-
- /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */
- /// Add text to the document at current position. (Scintilla feature 2001)
- unsafe void AddText(string text);
-
- /// Add array of cells to document. (Scintilla feature 2002)
- unsafe void AddStyledText(int length, Cells c);
-
- /// Insert string at a position. (Scintilla feature 2003)
- unsafe void InsertText(Position pos, string text);
-
- /// Change the text that is being inserted in response to SC_MOD_INSERTCHECK (Scintilla feature 2672)
- unsafe void ChangeInsertion(int length, string text);
-
- /// Delete all text in the document. (Scintilla feature 2004)
- void ClearAll();
-
- /// Delete a range of text in the document. (Scintilla feature 2645)
- void DeleteRange(Position pos, int deleteLength);
-
- /// Set all style bytes to 0, remove all folding information. (Scintilla feature 2005)
- void ClearDocumentStyle();
-
- /// Returns the number of bytes in the document. (Scintilla feature 2006)
- int GetLength();
-
- /// Returns the character byte at the position. (Scintilla feature 2007)
- int GetCharAt(Position pos);
-
- /// Returns the position of the caret. (Scintilla feature 2008)
- Position GetCurrentPos();
-
- /// Returns the position of the opposite end of the selection to the caret. (Scintilla feature 2009)
- Position GetAnchor();
-
- /// Returns the style byte at the position. (Scintilla feature 2010)
- int GetStyleAt(Position pos);
-
- /// Redoes the next action on the undo history. (Scintilla feature 2011)
- void Redo();
-
- ///
- /// Choose between collecting actions into the undo
- /// history and discarding them.
- /// (Scintilla feature 2012)
- ///
- void SetUndoCollection(bool collectUndo);
-
- /// Select all the text in the document. (Scintilla feature 2013)
- void SelectAll();
-
- ///
- /// Remember the current position in the undo history as the position
- /// at which the document was saved.
- /// (Scintilla feature 2014)
- ///
- void SetSavePoint();
-
- ///
- /// Retrieve a buffer of cells.
- /// Returns the number of bytes in the buffer not including terminating NULs.
- /// (Scintilla feature 2015)
- ///
- int GetStyledText(TextRange tr);
-
- /// Are there any redoable actions in the undo history? (Scintilla feature 2016)
- bool CanRedo();
-
- /// Retrieve the line number at which a particular marker is located. (Scintilla feature 2017)
- int MarkerLineFromHandle(int handle);
-
- /// Delete a marker. (Scintilla feature 2018)
- void MarkerDeleteHandle(int handle);
-
- /// Is undo history being collected? (Scintilla feature 2019)
- bool GetUndoCollection();
-
- ///
- /// Are white space characters currently visible?
- /// Returns one of SCWS_* constants.
- /// (Scintilla feature 2020)
- ///
- int GetViewWS();
-
- /// Make white space characters invisible, always visible or visible outside indentation. (Scintilla feature 2021)
- void SetViewWS(int viewWS);
-
- /// Find the position from a point within the window. (Scintilla feature 2022)
- Position PositionFromPoint(int x, int y);
-
- ///
- /// Find the position from a point within the window but return
- /// INVALID_POSITION if not close to text.
- /// (Scintilla feature 2023)
- ///
- Position PositionFromPointClose(int x, int y);
-
- /// Set caret to start of a line and ensure it is visible. (Scintilla feature 2024)
- void GotoLine(int line);
-
- /// Set caret to a position and ensure it is visible. (Scintilla feature 2025)
- void GotoPos(Position pos);
-
- ///
- /// Set the selection anchor to a position. The anchor is the opposite
- /// end of the selection from the caret.
- /// (Scintilla feature 2026)
- ///
- void SetAnchor(Position posAnchor);
-
- ///
- /// Retrieve the text of the line containing the caret.
- /// Returns the index of the caret on the line.
- /// Result is NUL-terminated.
- /// (Scintilla feature 2027)
- ///
- unsafe string GetCurLine(int length);
-
- /// Retrieve the position of the last correctly styled character. (Scintilla feature 2028)
- Position GetEndStyled();
-
- /// Convert all line endings in the document to one mode. (Scintilla feature 2029)
- void ConvertEOLs(int eolMode);
-
- /// Retrieve the current end of line mode - one of CRLF, CR, or LF. (Scintilla feature 2030)
- int GetEOLMode();
-
- /// Set the current end of line mode. (Scintilla feature 2031)
- void SetEOLMode(int eolMode);
-
- ///
- /// Set the current styling position to pos and the styling mask to mask.
- /// The styling mask can be used to protect some bits in each styling byte from modification.
- /// (Scintilla feature 2032)
- ///
- void StartStyling(Position pos, int mask);
-
- ///
- /// Change style from current styling position for length characters to a style
- /// and move the current styling position to after this newly styled segment.
- /// (Scintilla feature 2033)
- ///
- void SetStyling(int length, int style);
-
- /// Is drawing done first into a buffer or direct to the screen? (Scintilla feature 2034)
- bool GetBufferedDraw();
-
- ///
- /// If drawing is buffered then each line of text is drawn into a bitmap buffer
- /// before drawing it to the screen to avoid flicker.
- /// (Scintilla feature 2035)
- ///
- void SetBufferedDraw(bool buffered);
-
- /// Change the visible size of a tab to be a multiple of the width of a space character. (Scintilla feature 2036)
- void SetTabWidth(int tabWidth);
-
- /// Retrieve the visible size of a tab. (Scintilla feature 2121)
- int GetTabWidth();
-
- /// Clear explicit tabstops on a line. (Scintilla feature 2675)
- void ClearTabStops(int line);
-
- /// Add an explicit tab stop for a line. (Scintilla feature 2676)
- void AddTabStop(int line, int x);
-
- /// Find the next explicit tab stop position on a line after a position. (Scintilla feature 2677)
- int GetNextTabStop(int line, int x);
-
- ///
- /// Set the code page used to interpret the bytes of the document as characters.
- /// The SC_CP_UTF8 value can be used to enter Unicode mode.
- /// (Scintilla feature 2037)
- ///
- void SetCodePage(int codePage);
-
- /// Is the IME displayed in a winow or inline? (Scintilla feature 2678)
- int GetIMEInteraction();
-
- /// Choose to display the the IME in a winow or inline. (Scintilla feature 2679)
- void SetIMEInteraction(int imeInteraction);
-
- /// Set the symbol used for a particular marker number. (Scintilla feature 2040)
- void MarkerDefine(int markerNumber, int markerSymbol);
-
- /// Set the foreground colour used for a particular marker number. (Scintilla feature 2041)
- void MarkerSetFore(int markerNumber, Colour fore);
-
- /// Set the background colour used for a particular marker number. (Scintilla feature 2042)
- void MarkerSetBack(int markerNumber, Colour back);
-
- /// Set the background colour used for a particular marker number when its folding block is selected. (Scintilla feature 2292)
- void MarkerSetBackSelected(int markerNumber, Colour back);
-
- /// Enable/disable highlight for current folding bloc (smallest one that contains the caret) (Scintilla feature 2293)
- void MarkerEnableHighlight(bool enabled);
-
- /// Add a marker to a line, returning an ID which can be used to find or delete the marker. (Scintilla feature 2043)
- int MarkerAdd(int line, int markerNumber);
-
- /// Delete a marker from a line. (Scintilla feature 2044)
- void MarkerDelete(int line, int markerNumber);
-
- /// Delete all markers with a particular number from all lines. (Scintilla feature 2045)
- void MarkerDeleteAll(int markerNumber);
-
- /// Get a bit mask of all the markers set on a line. (Scintilla feature 2046)
- int MarkerGet(int line);
-
- ///
- /// Find the next line at or after lineStart that includes a marker in mask.
- /// Return -1 when no more lines.
- /// (Scintilla feature 2047)
- ///
- int MarkerNext(int lineStart, int markerMask);
-
- /// Find the previous line before lineStart that includes a marker in mask. (Scintilla feature 2048)
- int MarkerPrevious(int lineStart, int markerMask);
-
- /// Define a marker from a pixmap. (Scintilla feature 2049)
- unsafe void MarkerDefinePixmap(int markerNumber, string pixmap);
-
- /// Add a set of markers to a line. (Scintilla feature 2466)
- void MarkerAddSet(int line, int set);
-
- /// Set the alpha used for a marker that is drawn in the text area, not the margin. (Scintilla feature 2476)
- void MarkerSetAlpha(int markerNumber, int alpha);
-
- /// Set a margin to be either numeric or symbolic. (Scintilla feature 2240)
- void SetMarginTypeN(int margin, int marginType);
-
- /// Retrieve the type of a margin. (Scintilla feature 2241)
- int GetMarginTypeN(int margin);
-
- /// Set the width of a margin to a width expressed in pixels. (Scintilla feature 2242)
- void SetMarginWidthN(int margin, int pixelWidth);
-
- /// Retrieve the width of a margin in pixels. (Scintilla feature 2243)
- int GetMarginWidthN(int margin);
-
- /// Set a mask that determines which markers are displayed in a margin. (Scintilla feature 2244)
- void SetMarginMaskN(int margin, int mask);
-
- /// Retrieve the marker mask of a margin. (Scintilla feature 2245)
- int GetMarginMaskN(int margin);
-
- /// Make a margin sensitive or insensitive to mouse clicks. (Scintilla feature 2246)
- void SetMarginSensitiveN(int margin, bool sensitive);
-
- /// Retrieve the mouse click sensitivity of a margin. (Scintilla feature 2247)
- bool GetMarginSensitiveN(int margin);
-
- /// Set the cursor shown when the mouse is inside a margin. (Scintilla feature 2248)
- void SetMarginCursorN(int margin, int cursor);
-
- /// Retrieve the cursor shown in a margin. (Scintilla feature 2249)
- int GetMarginCursorN(int margin);
-
- /// Clear all the styles and make equivalent to the global default style. (Scintilla feature 2050)
- void StyleClearAll();
-
- /// Set the foreground colour of a style. (Scintilla feature 2051)
- void StyleSetFore(int style, Colour fore);
-
- /// Set the background colour of a style. (Scintilla feature 2052)
- void StyleSetBack(int style, Colour back);
-
- /// Set a style to be bold or not. (Scintilla feature 2053)
- void StyleSetBold(int style, bool bold);
-
- /// Set a style to be italic or not. (Scintilla feature 2054)
- void StyleSetItalic(int style, bool italic);
-
- /// Set the size of characters of a style. (Scintilla feature 2055)
- void StyleSetSize(int style, int sizePoints);
-
- /// Set the font of a style. (Scintilla feature 2056)
- unsafe void StyleSetFont(int style, string fontName);
-
- /// Set a style to have its end of line filled or not. (Scintilla feature 2057)
- void StyleSetEOLFilled(int style, bool filled);
-
- /// Reset the default style to its state at startup (Scintilla feature 2058)
- void StyleResetDefault();
-
- /// Set a style to be underlined or not. (Scintilla feature 2059)
- void StyleSetUnderline(int style, bool underline);
-
- /// Get the foreground colour of a style. (Scintilla feature 2481)
- Colour StyleGetFore(int style);
-
- /// Get the background colour of a style. (Scintilla feature 2482)
- Colour StyleGetBack(int style);
-
- /// Get is a style bold or not. (Scintilla feature 2483)
- bool StyleGetBold(int style);
-
- /// Get is a style italic or not. (Scintilla feature 2484)
- bool StyleGetItalic(int style);
-
- /// Get the size of characters of a style. (Scintilla feature 2485)
- int StyleGetSize(int style);
-
- ///
- /// Get the font of a style.
- /// Returns the length of the fontName
- /// Result is NUL-terminated.
- /// (Scintilla feature 2486)
- ///
- unsafe string StyleGetFont(int style);
-
- /// Get is a style to have its end of line filled or not. (Scintilla feature 2487)
- bool StyleGetEOLFilled(int style);
-
- /// Get is a style underlined or not. (Scintilla feature 2488)
- bool StyleGetUnderline(int style);
-
- /// Get is a style mixed case, or to force upper or lower case. (Scintilla feature 2489)
- int StyleGetCase(int style);
-
- /// Get the character get of the font in a style. (Scintilla feature 2490)
- int StyleGetCharacterSet(int style);
-
- /// Get is a style visible or not. (Scintilla feature 2491)
- bool StyleGetVisible(int style);
-
- ///
- /// Get is a style changeable or not (read only).
- /// Experimental feature, currently buggy.
- /// (Scintilla feature 2492)
- ///
- bool StyleGetChangeable(int style);
-
- /// Get is a style a hotspot or not. (Scintilla feature 2493)
- bool StyleGetHotSpot(int style);
-
- /// Set a style to be mixed case, or to force upper or lower case. (Scintilla feature 2060)
- void StyleSetCase(int style, int caseForce);
-
- /// Set the size of characters of a style. Size is in points multiplied by 100. (Scintilla feature 2061)
- void StyleSetSizeFractional(int style, int caseForce);
-
- /// Get the size of characters of a style in points multiplied by 100 (Scintilla feature 2062)
- int StyleGetSizeFractional(int style);
-
- /// Set the weight of characters of a style. (Scintilla feature 2063)
- void StyleSetWeight(int style, int weight);
-
- /// Get the weight of characters of a style. (Scintilla feature 2064)
- int StyleGetWeight(int style);
-
- /// Set the character set of the font in a style. (Scintilla feature 2066)
- void StyleSetCharacterSet(int style, int characterSet);
-
- /// Set a style to be a hotspot or not. (Scintilla feature 2409)
- void StyleSetHotSpot(int style, bool hotspot);
-
- /// Set the foreground colour of the main and additional selections and whether to use this setting. (Scintilla feature 2067)
- void SetSelFore(bool useSetting, Colour fore);
-
- /// Set the background colour of the main and additional selections and whether to use this setting. (Scintilla feature 2068)
- void SetSelBack(bool useSetting, Colour back);
-
- /// Get the alpha of the selection. (Scintilla feature 2477)
- int GetSelAlpha();
-
- /// Set the alpha of the selection. (Scintilla feature 2478)
- void SetSelAlpha(int alpha);
-
- /// Is the selection end of line filled? (Scintilla feature 2479)
- bool GetSelEOLFilled();
-
- /// Set the selection to have its end of line filled or not. (Scintilla feature 2480)
- void SetSelEOLFilled(bool filled);
-
- /// Set the foreground colour of the caret. (Scintilla feature 2069)
- void SetCaretFore(Colour fore);
-
- /// When key+modifier combination km is pressed perform msg. (Scintilla feature 2070)
- void AssignCmdKey(KeyModifier km, int msg);
-
- /// When key+modifier combination km is pressed do nothing. (Scintilla feature 2071)
- void ClearCmdKey(KeyModifier km);
-
- /// Drop all key mappings. (Scintilla feature 2072)
- void ClearAllCmdKeys();
-
- /// Set the styles for a segment of the document. (Scintilla feature 2073)
- unsafe void SetStylingEx(int length, string styles);
-
- /// Set a style to be visible or not. (Scintilla feature 2074)
- void StyleSetVisible(int style, bool visible);
-
- /// Get the time in milliseconds that the caret is on and off. (Scintilla feature 2075)
- int GetCaretPeriod();
-
- /// Get the time in milliseconds that the caret is on and off. 0 = steady on. (Scintilla feature 2076)
- void SetCaretPeriod(int periodMilliseconds);
-
- ///
- /// Set the set of characters making up words for when moving or selecting by word.
- /// First sets defaults like SetCharsDefault.
- /// (Scintilla feature 2077)
- ///
- unsafe void SetWordChars(string characters);
-
- ///
- /// Get the set of characters making up words for when moving or selecting by word.
- /// Returns the number of characters
- /// (Scintilla feature 2646)
- ///
- unsafe string GetWordChars();
-
- ///
- /// Start a sequence of actions that is undone and redone as a unit.
- /// May be nested.
- /// (Scintilla feature 2078)
- ///
- void BeginUndoAction();
-
- /// End a sequence of actions that is undone and redone as a unit. (Scintilla feature 2079)
- void EndUndoAction();
-
- /// Set an indicator to plain, squiggle or TT. (Scintilla feature 2080)
- void IndicSetStyle(int indic, int style);
-
- /// Retrieve the style of an indicator. (Scintilla feature 2081)
- int IndicGetStyle(int indic);
-
- /// Set the foreground colour of an indicator. (Scintilla feature 2082)
- void IndicSetFore(int indic, Colour fore);
-
- /// Retrieve the foreground colour of an indicator. (Scintilla feature 2083)
- Colour IndicGetFore(int indic);
-
- /// Set an indicator to draw under text or over(default). (Scintilla feature 2510)
- void IndicSetUnder(int indic, bool under);
-
- /// Retrieve whether indicator drawn under or over text. (Scintilla feature 2511)
- bool IndicGetUnder(int indic);
-
- /// Set a hover indicator to plain, squiggle or TT. (Scintilla feature 2680)
- void IndicSetHoverStyle(int indic, int style);
-
- /// Retrieve the hover style of an indicator. (Scintilla feature 2681)
- int IndicGetHoverStyle(int indic);
-
- /// Set the foreground hover colour of an indicator. (Scintilla feature 2682)
- void IndicSetHoverFore(int indic, Colour fore);
-
- /// Retrieve the foreground hover colour of an indicator. (Scintilla feature 2683)
- Colour IndicGetHoverFore(int indic);
-
- /// Set the attributes of an indicator. (Scintilla feature 2684)
- void IndicSetFlags(int indic, int flags);
-
- /// Retrieve the attributes of an indicator. (Scintilla feature 2685)
- int IndicGetFlags(int indic);
-
- /// Set the foreground colour of all whitespace and whether to use this setting. (Scintilla feature 2084)
- void SetWhitespaceFore(bool useSetting, Colour fore);
-
- /// Set the background colour of all whitespace and whether to use this setting. (Scintilla feature 2085)
- void SetWhitespaceBack(bool useSetting, Colour back);
-
- /// Set the size of the dots used to mark space characters. (Scintilla feature 2086)
- void SetWhitespaceSize(int size);
-
- /// Get the size of the dots used to mark space characters. (Scintilla feature 2087)
- int GetWhitespaceSize();
-
- ///
- /// Divide each styling byte into lexical class bits (default: 5) and indicator
- /// bits (default: 3). If a lexer requires more than 32 lexical states, then this
- /// is used to expand the possible states.
- /// (Scintilla feature 2090)
- ///
- void SetStyleBits(int bits);
-
- /// Retrieve number of bits in style bytes used to hold the lexical state. (Scintilla feature 2091)
- int GetStyleBits();
-
- /// Used to hold extra styling information for each line. (Scintilla feature 2092)
- void SetLineState(int line, int state);
-
- /// Retrieve the extra styling information for a line. (Scintilla feature 2093)
- int GetLineState(int line);
-
- /// Retrieve the last line number that has line state. (Scintilla feature 2094)
- int GetMaxLineState();
-
- /// Is the background of the line containing the caret in a different colour? (Scintilla feature 2095)
- bool GetCaretLineVisible();
-
- /// Display the background of the line containing the caret in a different colour. (Scintilla feature 2096)
- void SetCaretLineVisible(bool show);
-
- /// Get the colour of the background of the line containing the caret. (Scintilla feature 2097)
- Colour GetCaretLineBack();
-
- /// Set the colour of the background of the line containing the caret. (Scintilla feature 2098)
- void SetCaretLineBack(Colour back);
-
- ///
- /// Set a style to be changeable or not (read only).
- /// Experimental feature, currently buggy.
- /// (Scintilla feature 2099)
- ///
- void StyleSetChangeable(int style, bool changeable);
-
- ///
- /// Display a auto-completion list.
- /// The lenEntered parameter indicates how many characters before
- /// the caret should be used to provide context.
- /// (Scintilla feature 2100)
- ///
- unsafe void AutoCShow(int lenEntered, string itemList);
-
- /// Remove the auto-completion list from the screen. (Scintilla feature 2101)
- void AutoCCancel();
-
- /// Is there an auto-completion list visible? (Scintilla feature 2102)
- bool AutoCActive();
-
- /// Retrieve the position of the caret when the auto-completion list was displayed. (Scintilla feature 2103)
- Position AutoCPosStart();
-
- /// User has selected an item so remove the list and insert the selection. (Scintilla feature 2104)
- void AutoCComplete();
-
- /// Define a set of character that when typed cancel the auto-completion list. (Scintilla feature 2105)
- unsafe void AutoCStops(string characterSet);
-
- ///
- /// Change the separator character in the string setting up an auto-completion list.
- /// Default is space but can be changed if items contain space.
- /// (Scintilla feature 2106)
- ///
- void AutoCSetSeparator(int separatorCharacter);
-
- /// Retrieve the auto-completion list separator character. (Scintilla feature 2107)
- int AutoCGetSeparator();
-
- /// Select the item in the auto-completion list that starts with a string. (Scintilla feature 2108)
- unsafe void AutoCSelect(string text);
-
- ///
- /// Should the auto-completion list be cancelled if the user backspaces to a
- /// position before where the box was created.
- /// (Scintilla feature 2110)
- ///
- void AutoCSetCancelAtStart(bool cancel);
-
- /// Retrieve whether auto-completion cancelled by backspacing before start. (Scintilla feature 2111)
- bool AutoCGetCancelAtStart();
-
- ///
- /// Define a set of characters that when typed will cause the autocompletion to
- /// choose the selected item.
- /// (Scintilla feature 2112)
- ///
- unsafe void AutoCSetFillUps(string characterSet);
-
- /// Should a single item auto-completion list automatically choose the item. (Scintilla feature 2113)
- void AutoCSetChooseSingle(bool chooseSingle);
-
- /// Retrieve whether a single item auto-completion list automatically choose the item. (Scintilla feature 2114)
- bool AutoCGetChooseSingle();
-
- /// Set whether case is significant when performing auto-completion searches. (Scintilla feature 2115)
- void AutoCSetIgnoreCase(bool ignoreCase);
-
- /// Retrieve state of ignore case flag. (Scintilla feature 2116)
- bool AutoCGetIgnoreCase();
-
- /// Display a list of strings and send notification when user chooses one. (Scintilla feature 2117)
- unsafe void UserListShow(int listType, string itemList);
-
- /// Set whether or not autocompletion is hidden automatically when nothing matches. (Scintilla feature 2118)
- void AutoCSetAutoHide(bool autoHide);
-
- /// Retrieve whether or not autocompletion is hidden automatically when nothing matches. (Scintilla feature 2119)
- bool AutoCGetAutoHide();
-
- ///
- /// Set whether or not autocompletion deletes any word characters
- /// after the inserted text upon completion.
- /// (Scintilla feature 2270)
- ///
- void AutoCSetDropRestOfWord(bool dropRestOfWord);
-
- ///
- /// Retrieve whether or not autocompletion deletes any word characters
- /// after the inserted text upon completion.
- /// (Scintilla feature 2271)
- ///
- bool AutoCGetDropRestOfWord();
-
- /// Register an XPM image for use in autocompletion lists. (Scintilla feature 2405)
- unsafe void RegisterImage(int type, string xpmData);
-
- /// Clear all the registered XPM images. (Scintilla feature 2408)
- void ClearRegisteredImages();
-
- /// Retrieve the auto-completion list type-separator character. (Scintilla feature 2285)
- int AutoCGetTypeSeparator();
-
- ///
- /// Change the type-separator character in the string setting up an auto-completion list.
- /// Default is '?' but can be changed if items contain '?'.
- /// (Scintilla feature 2286)
- ///
- void AutoCSetTypeSeparator(int separatorCharacter);
-
- ///
- /// Set the maximum width, in characters, of auto-completion and user lists.
- /// Set to 0 to autosize to fit longest item, which is the default.
- /// (Scintilla feature 2208)
- ///
- void AutoCSetMaxWidth(int characterCount);
-
- /// Get the maximum width, in characters, of auto-completion and user lists. (Scintilla feature 2209)
- int AutoCGetMaxWidth();
-
- ///
- /// Set the maximum height, in rows, of auto-completion and user lists.
- /// The default is 5 rows.
- /// (Scintilla feature 2210)
- ///
- void AutoCSetMaxHeight(int rowCount);
-
- /// Set the maximum height, in rows, of auto-completion and user lists. (Scintilla feature 2211)
- int AutoCGetMaxHeight();
-
- /// Set the number of spaces used for one level of indentation. (Scintilla feature 2122)
- void SetIndent(int indentSize);
-
- /// Retrieve indentation size. (Scintilla feature 2123)
- int GetIndent();
-
- ///
- /// Indentation will only use space characters if useTabs is false, otherwise
- /// it will use a combination of tabs and spaces.
- /// (Scintilla feature 2124)
- ///
- void SetUseTabs(bool useTabs);
-
- /// Retrieve whether tabs will be used in indentation. (Scintilla feature 2125)
- bool GetUseTabs();
-
- /// Change the indentation of a line to a number of columns. (Scintilla feature 2126)
- void SetLineIndentation(int line, int indentSize);
-
- /// Retrieve the number of columns that a line is indented. (Scintilla feature 2127)
- int GetLineIndentation(int line);
-
- /// Retrieve the position before the first non indentation character on a line. (Scintilla feature 2128)
- Position GetLineIndentPosition(int line);
-
- /// Retrieve the column number of a position, taking tab width into account. (Scintilla feature 2129)
- int GetColumn(Position pos);
-
- /// Count characters between two positions. (Scintilla feature 2633)
- int CountCharacters(int startPos, int endPos);
-
- /// Show or hide the horizontal scroll bar. (Scintilla feature 2130)
- void SetHScrollBar(bool show);
-
- /// Is the horizontal scroll bar visible? (Scintilla feature 2131)
- bool GetHScrollBar();
-
- /// Show or hide indentation guides. (Scintilla feature 2132)
- void SetIndentationGuides(int indentView);
-
- /// Are the indentation guides visible? (Scintilla feature 2133)
- int GetIndentationGuides();
-
- ///
- /// Set the highlighted indentation guide column.
- /// 0 = no highlighted guide.
- /// (Scintilla feature 2134)
- ///
- void SetHighlightGuide(int column);
-
- /// Get the highlighted indentation guide column. (Scintilla feature 2135)
- int GetHighlightGuide();
-
- /// Get the position after the last visible characters on a line. (Scintilla feature 2136)
- Position GetLineEndPosition(int line);
-
- /// Get the code page used to interpret the bytes of the document as characters. (Scintilla feature 2137)
- int GetCodePage();
-
- /// Get the foreground colour of the caret. (Scintilla feature 2138)
- Colour GetCaretFore();
-
- /// In read-only mode? (Scintilla feature 2140)
- bool GetReadOnly();
-
- /// Sets the position of the caret. (Scintilla feature 2141)
- void SetCurrentPos(Position pos);
-
- /// Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2142)
- void SetSelectionStart(Position pos);
-
- /// Returns the position at the start of the selection. (Scintilla feature 2143)
- Position GetSelectionStart();
-
- /// Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2144)
- void SetSelectionEnd(Position pos);
-
- /// Returns the position at the end of the selection. (Scintilla feature 2145)
- Position GetSelectionEnd();
-
- /// Set caret to a position, while removing any existing selection. (Scintilla feature 2556)
- void SetEmptySelection(Position pos);
-
- /// Sets the print magnification added to the point size of each style for printing. (Scintilla feature 2146)
- void SetPrintMagnification(int magnification);
-
- /// Returns the print magnification. (Scintilla feature 2147)
- int GetPrintMagnification();
-
- /// Modify colours when printing for clearer printed text. (Scintilla feature 2148)
- void SetPrintColourMode(int mode);
-
- /// Returns the print colour mode. (Scintilla feature 2149)
- int GetPrintColourMode();
-
- /// Find some text in the document. (Scintilla feature 2150)
- Position FindText(int flags, TextToFind ft);
-
- /// Retrieve the display line at the top of the display. (Scintilla feature 2152)
- int GetFirstVisibleLine();
-
- ///
- /// Retrieve the contents of a line.
- /// Returns the length of the line.
- /// (Scintilla feature 2153)
- ///
- unsafe string GetLine(int line);
-
- /// Returns the number of lines in the document. There is always at least one. (Scintilla feature 2154)
- int GetLineCount();
-
- /// Sets the size in pixels of the left margin. (Scintilla feature 2155)
- void SetMarginLeft(int pixelWidth);
-
- /// Returns the size in pixels of the left margin. (Scintilla feature 2156)
- int GetMarginLeft();
-
- /// Sets the size in pixels of the right margin. (Scintilla feature 2157)
- void SetMarginRight(int pixelWidth);
-
- /// Returns the size in pixels of the right margin. (Scintilla feature 2158)
- int GetMarginRight();
-
- /// Is the document different from when it was last saved? (Scintilla feature 2159)
- bool GetModify();
-
- /// Select a range of text. (Scintilla feature 2160)
- void SetSel(Position start, Position end);
-
- ///
- /// Retrieve the selected text.
- /// Return the length of the text.
- /// Result is NUL-terminated.
- /// (Scintilla feature 2161)
- ///
- unsafe string GetSelText();
-
- ///
- /// Retrieve a range of text.
- /// Return the length of the text.
- /// (Scintilla feature 2162)
- ///
- int GetTextRange(TextRange tr);
-
- /// Draw the selection in normal style or with selection highlighted. (Scintilla feature 2163)
- void HideSelection(bool normal);
-
- /// Retrieve the x value of the point in the window where a position is displayed. (Scintilla feature 2164)
- int PointXFromPosition(Position pos);
-
- /// Retrieve the y value of the point in the window where a position is displayed. (Scintilla feature 2165)
- int PointYFromPosition(Position pos);
-
- /// Retrieve the line containing a position. (Scintilla feature 2166)
- int LineFromPosition(Position pos);
-
- /// Retrieve the position at the start of a line. (Scintilla feature 2167)
- Position PositionFromLine(int line);
-
- /// Scroll horizontally and vertically. (Scintilla feature 2168)
- void LineScroll(int columns, int lines);
-
- /// Ensure the caret is visible. (Scintilla feature 2169)
- void ScrollCaret();
-
- ///
- /// Scroll the argument positions and the range between them into view giving
- /// priority to the primary position then the secondary position.
- /// This may be used to make a search match visible.
- /// (Scintilla feature 2569)
- ///
- void ScrollRange(Position secondary, Position primary);
-
- /// Replace the selected text with the argument text. (Scintilla feature 2170)
- unsafe void ReplaceSel(string text);
-
- /// Set to read only or read write. (Scintilla feature 2171)
- void SetReadOnly(bool readOnly);
-
- /// Null operation. (Scintilla feature 2172)
- void Null();
-
- /// Will a paste succeed? (Scintilla feature 2173)
- bool CanPaste();
-
- /// Are there any undoable actions in the undo history? (Scintilla feature 2174)
- bool CanUndo();
-
- /// Delete the undo history. (Scintilla feature 2175)
- void EmptyUndoBuffer();
-
- /// Undo one action in the undo history. (Scintilla feature 2176)
- void Undo();
-
- /// Cut the selection to the clipboard. (Scintilla feature 2177)
- void Cut();
-
- /// Copy the selection to the clipboard. (Scintilla feature 2178)
- void Copy();
-
- /// Paste the contents of the clipboard into the document replacing the selection. (Scintilla feature 2179)
- void Paste();
-
- /// Clear the selection. (Scintilla feature 2180)
- void Clear();
-
- /// Replace the contents of the document with the argument text. (Scintilla feature 2181)
- unsafe void SetText(string text);
-
- ///
- /// Retrieve all the text in the document.
- /// Returns number of characters retrieved.
- /// Result is NUL-terminated.
- /// (Scintilla feature 2182)
- ///
- unsafe string GetText(int length);
-
- /// Retrieve the number of characters in the document. (Scintilla feature 2183)
- int GetTextLength();
-
- /// Retrieve a pointer to a function that processes messages for this Scintilla. (Scintilla feature 2184)
- IntPtr GetDirectFunction();
-
- ///
- /// Retrieve a pointer value to use as the first argument when calling
- /// the function returned by GetDirectFunction.
- /// (Scintilla feature 2185)
- ///
- IntPtr GetDirectPointer();
-
- /// Set to overtype (true) or insert mode. (Scintilla feature 2186)
- void SetOvertype(bool overtype);
-
- /// Returns true if overtype mode is active otherwise false is returned. (Scintilla feature 2187)
- bool GetOvertype();
-
- /// Set the width of the insert mode caret. (Scintilla feature 2188)
- void SetCaretWidth(int pixelWidth);
-
- /// Returns the width of the insert mode caret. (Scintilla feature 2189)
- int GetCaretWidth();
-
- ///
- /// Sets the position that starts the target which is used for updating the
- /// document without affecting the scroll position.
- /// (Scintilla feature 2190)
- ///
- void SetTargetStart(Position pos);
-
- /// Get the position that starts the target. (Scintilla feature 2191)
- Position GetTargetStart();
-
- ///
- /// Sets the position that ends the target which is used for updating the
- /// document without affecting the scroll position.
- /// (Scintilla feature 2192)
- ///
- void SetTargetEnd(Position pos);
-
- /// Get the position that ends the target. (Scintilla feature 2193)
- Position GetTargetEnd();
-
- /// Sets both the start and end of the target in one call. (Scintilla feature 2686)
- void SetTargetRange(Position start, Position end);
-
- /// Retrieve the text in the target. (Scintilla feature 2687)
- unsafe string GetTargetText();
-
- ///
- /// Replace the target text with the argument text.
- /// Text is counted so it can contain NULs.
- /// Returns the length of the replacement text.
- /// (Scintilla feature 2194)
- ///
- unsafe int ReplaceTarget(int length, string text);
-
- ///
- /// Replace the target text with the argument text after \d processing.
- /// Text is counted so it can contain NULs.
- /// Looks for \d where d is between 1 and 9 and replaces these with the strings
- /// matched in the last search operation which were surrounded by \( and \).
- /// Returns the length of the replacement text including any change
- /// caused by processing the \d patterns.
- /// (Scintilla feature 2195)
- ///
- unsafe int ReplaceTargetRE(int length, string text);
-
- ///
- /// Search for a counted string in the target and set the target to the found
- /// range. Text is counted so it can contain NULs.
- /// Returns length of range or -1 for failure in which case target is not moved.
- /// (Scintilla feature 2197)
- ///
- unsafe int SearchInTarget(int length, string text);
-
- /// Set the search flags used by SearchInTarget. (Scintilla feature 2198)
- void SetSearchFlags(int flags);
-
- /// Get the search flags used by SearchInTarget. (Scintilla feature 2199)
- int GetSearchFlags();
-
- /// Show a call tip containing a definition near position pos. (Scintilla feature 2200)
- unsafe void CallTipShow(Position pos, string definition);
-
- /// Remove the call tip from the screen. (Scintilla feature 2201)
- void CallTipCancel();
-
- /// Is there an active call tip? (Scintilla feature 2202)
- bool CallTipActive();
-
- /// Retrieve the position where the caret was before displaying the call tip. (Scintilla feature 2203)
- Position CallTipPosStart();
-
- /// Set the start position in order to change when backspacing removes the calltip. (Scintilla feature 2214)
- void CallTipSetPosStart(int posStart);
-
- /// Highlight a segment of the definition. (Scintilla feature 2204)
- void CallTipSetHlt(int start, int end);
-
- /// Set the background colour for the call tip. (Scintilla feature 2205)
- void CallTipSetBack(Colour back);
-
- /// Set the foreground colour for the call tip. (Scintilla feature 2206)
- void CallTipSetFore(Colour fore);
-
- /// Set the foreground colour for the highlighted part of the call tip. (Scintilla feature 2207)
- void CallTipSetForeHlt(Colour fore);
-
- /// Enable use of STYLE_CALLTIP and set call tip tab size in pixels. (Scintilla feature 2212)
- void CallTipUseStyle(int tabSize);
-
- /// Set position of calltip, above or below text. (Scintilla feature 2213)
- void CallTipSetPosition(bool above);
-
- /// Find the display line of a document line taking hidden lines into account. (Scintilla feature 2220)
- int VisibleFromDocLine(int line);
-
- /// Find the document line of a display line taking hidden lines into account. (Scintilla feature 2221)
- int DocLineFromVisible(int lineDisplay);
-
- /// The number of display lines needed to wrap a document line (Scintilla feature 2235)
- int WrapCount(int line);
-
- ///
- /// Set the fold level of a line.
- /// This encodes an integer level along with flags indicating whether the
- /// line is a header and whether it is effectively white space.
- /// (Scintilla feature 2222)
- ///
- void SetFoldLevel(int line, int level);
-
- /// Retrieve the fold level of a line. (Scintilla feature 2223)
- int GetFoldLevel(int line);
-
- /// Find the last child line of a header line. (Scintilla feature 2224)
- int GetLastChild(int line, int level);
-
- /// Find the parent line of a child line. (Scintilla feature 2225)
- int GetFoldParent(int line);
-
- /// Make a range of lines visible. (Scintilla feature 2226)
- void ShowLines(int lineStart, int lineEnd);
-
- /// Make a range of lines invisible. (Scintilla feature 2227)
- void HideLines(int lineStart, int lineEnd);
-
- /// Is a line visible? (Scintilla feature 2228)
- bool GetLineVisible(int line);
-
- /// Are all lines visible? (Scintilla feature 2236)
- bool GetAllLinesVisible();
-
- /// Show the children of a header line. (Scintilla feature 2229)
- void SetFoldExpanded(int line, bool expanded);
-
- /// Is a header line expanded? (Scintilla feature 2230)
- bool GetFoldExpanded(int line);
-
- /// Switch a header line between expanded and contracted. (Scintilla feature 2231)
- void ToggleFold(int line);
-
- /// Expand or contract a fold header. (Scintilla feature 2237)
- void FoldLine(int line, int action);
-
- /// Expand or contract a fold header and its children. (Scintilla feature 2238)
- void FoldChildren(int line, int action);
-
- /// Expand a fold header and all children. Use the level argument instead of the line's current level. (Scintilla feature 2239)
- void ExpandChildren(int line, int level);
-
- /// Expand or contract all fold headers. (Scintilla feature 2662)
- void FoldAll(int action);
-
- /// Ensure a particular line is visible by expanding any header line hiding it. (Scintilla feature 2232)
- void EnsureVisible(int line);
-
- /// Set automatic folding behaviours. (Scintilla feature 2663)
- void SetAutomaticFold(int automaticFold);
-
- /// Get automatic folding behaviours. (Scintilla feature 2664)
- int GetAutomaticFold();
-
- /// Set some style options for folding. (Scintilla feature 2233)
- void SetFoldFlags(int flags);
-
- ///
- /// Ensure a particular line is visible by expanding any header line hiding it.
- /// Use the currently set visibility policy to determine which range to display.
- /// (Scintilla feature 2234)
- ///
- void EnsureVisibleEnforcePolicy(int line);
-
- /// Sets whether a tab pressed when caret is within indentation indents. (Scintilla feature 2260)
- void SetTabIndents(bool tabIndents);
-
- /// Does a tab pressed when caret is within indentation indent? (Scintilla feature 2261)
- bool GetTabIndents();
-
- /// Sets whether a backspace pressed when caret is within indentation unindents. (Scintilla feature 2262)
- void SetBackSpaceUnIndents(bool bsUnIndents);
-
- /// Does a backspace pressed when caret is within indentation unindent? (Scintilla feature 2263)
- bool GetBackSpaceUnIndents();
-
- /// Sets the time the mouse must sit still to generate a mouse dwell event. (Scintilla feature 2264)
- void SetMouseDwellTime(int periodMilliseconds);
-
- /// Retrieve the time the mouse must sit still to generate a mouse dwell event. (Scintilla feature 2265)
- int GetMouseDwellTime();
-
- /// Get position of start of word. (Scintilla feature 2266)
- int WordStartPosition(Position pos, bool onlyWordCharacters);
-
- /// Get position of end of word. (Scintilla feature 2267)
- int WordEndPosition(Position pos, bool onlyWordCharacters);
-
- /// Sets whether text is word wrapped. (Scintilla feature 2268)
- void SetWrapMode(int mode);
-
- /// Retrieve whether text is word wrapped. (Scintilla feature 2269)
- int GetWrapMode();
-
- /// Set the display mode of visual flags for wrapped lines. (Scintilla feature 2460)
- void SetWrapVisualFlags(int wrapVisualFlags);
-
- /// Retrive the display mode of visual flags for wrapped lines. (Scintilla feature 2461)
- int GetWrapVisualFlags();
-
- /// Set the location of visual flags for wrapped lines. (Scintilla feature 2462)
- void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation);
-
- /// Retrive the location of visual flags for wrapped lines. (Scintilla feature 2463)
- int GetWrapVisualFlagsLocation();
-
- /// Set the start indent for wrapped lines. (Scintilla feature 2464)
- void SetWrapStartIndent(int indent);
-
- /// Retrive the start indent for wrapped lines. (Scintilla feature 2465)
- int GetWrapStartIndent();
-
- /// Sets how wrapped sublines are placed. Default is fixed. (Scintilla feature 2472)
- void SetWrapIndentMode(int mode);
-
- /// Retrieve how wrapped sublines are placed. Default is fixed. (Scintilla feature 2473)
- int GetWrapIndentMode();
-
- /// Sets the degree of caching of layout information. (Scintilla feature 2272)
- void SetLayoutCache(int mode);
-
- /// Retrieve the degree of caching of layout information. (Scintilla feature 2273)
- int GetLayoutCache();
-
- /// Sets the document width assumed for scrolling. (Scintilla feature 2274)
- void SetScrollWidth(int pixelWidth);
-
- /// Retrieve the document width assumed for scrolling. (Scintilla feature 2275)
- int GetScrollWidth();
-
- /// Sets whether the maximum width line displayed is used to set scroll width. (Scintilla feature 2516)
- void SetScrollWidthTracking(bool tracking);
-
- /// Retrieve whether the scroll width tracks wide lines. (Scintilla feature 2517)
- bool GetScrollWidthTracking();
-
- ///
- /// Measure the pixel width of some text in a particular style.
- /// NUL terminated text argument.
- /// Does not handle tab or control characters.
- /// (Scintilla feature 2276)
- ///
- unsafe int TextWidth(int style, string text);
-
- ///
- /// Sets the scroll range so that maximum scroll position has
- /// the last line at the bottom of the view (default).
- /// Setting this to false allows scrolling one page below the last line.
- /// (Scintilla feature 2277)
- ///
- void SetEndAtLastLine(bool endAtLastLine);
-
- ///
- /// Retrieve whether the maximum scroll position has the last
- /// line at the bottom of the view.
- /// (Scintilla feature 2278)
- ///
- bool GetEndAtLastLine();
-
- /// Retrieve the height of a particular line of text in pixels. (Scintilla feature 2279)
- int TextHeight(int line);
-
- /// Show or hide the vertical scroll bar. (Scintilla feature 2280)
- void SetVScrollBar(bool show);
-
- /// Is the vertical scroll bar visible? (Scintilla feature 2281)
- bool GetVScrollBar();
-
- /// Append a string to the end of the document without changing the selection. (Scintilla feature 2282)
- unsafe void AppendText(int length, string text);
-
- /// Is drawing done in two phases with backgrounds drawn before foregrounds? (Scintilla feature 2283)
- bool GetTwoPhaseDraw();
-
- ///
- /// In twoPhaseDraw mode, drawing is performed in two phases, first the background
- /// and then the foreground. This avoids chopping off characters that overlap the next run.
- /// (Scintilla feature 2284)
- ///
- void SetTwoPhaseDraw(bool twoPhase);
-
- /// How many phases is drawing done in? (Scintilla feature 2673)
- int GetPhasesDraw();
-
- ///
- /// In one phase draw, text is drawn in a series of rectangular blocks with no overlap.
- /// In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally.
- /// In multiple phase draw, each element is drawn over the whole drawing area, allowing text
- /// to overlap from one line to the next.
- /// (Scintilla feature 2674)
- ///
- void SetPhasesDraw(int phases);
-
- /// Choose the quality level for text from the FontQuality enumeration. (Scintilla feature 2611)
- void SetFontQuality(int fontQuality);
-
- /// Retrieve the quality level for text. (Scintilla feature 2612)
- int GetFontQuality();
-
- /// Scroll so that a display line is at the top of the display. (Scintilla feature 2613)
- void SetFirstVisibleLine(int lineDisplay);
-
- /// Change the effect of pasting when there are multiple selections. (Scintilla feature 2614)
- void SetMultiPaste(int multiPaste);
-
- /// Retrieve the effect of pasting when there are multiple selections.. (Scintilla feature 2615)
- int GetMultiPaste();
-
- ///
- /// Retrieve the value of a tag from a regular expression search.
- /// Result is NUL-terminated.
- /// (Scintilla feature 2616)
- ///
- unsafe string GetTag(int tagNumber);
-
- /// Make the target range start and end be the same as the selection range start and end. (Scintilla feature 2287)
- void TargetFromSelection();
-
- /// Join the lines in the target. (Scintilla feature 2288)
- void LinesJoin();
-
- ///
- /// Split the lines in the target into lines that are less wide than pixelWidth
- /// where possible.
- /// (Scintilla feature 2289)
- ///
- void LinesSplit(int pixelWidth);
-
- /// Set the colours used as a chequerboard pattern in the fold margin (Scintilla feature 2290)
- void SetFoldMarginColour(bool useSetting, Colour back);
-
- /// Set the colours used as a chequerboard pattern in the fold margin (Scintilla feature 2291)
- void SetFoldMarginHiColour(bool useSetting, Colour fore);
-
- /// Move caret down one line. (Scintilla feature 2300)
- void LineDown();
-
- /// Move caret down one line extending selection to new caret position. (Scintilla feature 2301)
- void LineDownExtend();
-
- /// Move caret up one line. (Scintilla feature 2302)
- void LineUp();
-
- /// Move caret up one line extending selection to new caret position. (Scintilla feature 2303)
- void LineUpExtend();
-
- /// Move caret left one character. (Scintilla feature 2304)
- void CharLeft();
-
- /// Move caret left one character extending selection to new caret position. (Scintilla feature 2305)
- void CharLeftExtend();
-
- /// Move caret right one character. (Scintilla feature 2306)
- void CharRight();
-
- /// Move caret right one character extending selection to new caret position. (Scintilla feature 2307)
- void CharRightExtend();
-
- /// Move caret left one word. (Scintilla feature 2308)
- void WordLeft();
-
- /// Move caret left one word extending selection to new caret position. (Scintilla feature 2309)
- void WordLeftExtend();
-
- /// Move caret right one word. (Scintilla feature 2310)
- void WordRight();
-
- /// Move caret right one word extending selection to new caret position. (Scintilla feature 2311)
- void WordRightExtend();
-
- /// Move caret to first position on line. (Scintilla feature 2312)
- void Home();
-
- /// Move caret to first position on line extending selection to new caret position. (Scintilla feature 2313)
- void HomeExtend();
-
- /// Move caret to last position on line. (Scintilla feature 2314)
- void LineEnd();
-
- /// Move caret to last position on line extending selection to new caret position. (Scintilla feature 2315)
- void LineEndExtend();
-
- /// Move caret to first position in document. (Scintilla feature 2316)
- void DocumentStart();
-
- /// Move caret to first position in document extending selection to new caret position. (Scintilla feature 2317)
- void DocumentStartExtend();
-
- /// Move caret to last position in document. (Scintilla feature 2318)
- void DocumentEnd();
-
- /// Move caret to last position in document extending selection to new caret position. (Scintilla feature 2319)
- void DocumentEndExtend();
-
- /// Move caret one page up. (Scintilla feature 2320)
- void PageUp();
-
- /// Move caret one page up extending selection to new caret position. (Scintilla feature 2321)
- void PageUpExtend();
-
- /// Move caret one page down. (Scintilla feature 2322)
- void PageDown();
-
- /// Move caret one page down extending selection to new caret position. (Scintilla feature 2323)
- void PageDownExtend();
-
- /// Switch from insert to overtype mode or the reverse. (Scintilla feature 2324)
- void EditToggleOvertype();
-
- /// Cancel any modes such as call tip or auto-completion list display. (Scintilla feature 2325)
- void Cancel();
-
- /// Delete the selection or if no selection, the character before the caret. (Scintilla feature 2326)
- void DeleteBack();
-
- ///
- /// If selection is empty or all on one line replace the selection with a tab character.
- /// If more than one line selected, indent the lines.
- /// (Scintilla feature 2327)
- ///
- void Tab();
-
- /// Dedent the selected lines. (Scintilla feature 2328)
- void BackTab();
-
- /// Insert a new line, may use a CRLF, CR or LF depending on EOL mode. (Scintilla feature 2329)
- void NewLine();
-
- /// Insert a Form Feed character. (Scintilla feature 2330)
- void FormFeed();
-
- ///
- /// Move caret to before first visible character on line.
- /// If already there move to first character on line.
- /// (Scintilla feature 2331)
- ///
- void VCHome();
-
- /// Like VCHome but extending selection to new caret position. (Scintilla feature 2332)
- void VCHomeExtend();
-
- /// Magnify the displayed text by increasing the sizes by 1 point. (Scintilla feature 2333)
- void ZoomIn();
-
- /// Make the displayed text smaller by decreasing the sizes by 1 point. (Scintilla feature 2334)
- void ZoomOut();
-
- /// Delete the word to the left of the caret. (Scintilla feature 2335)
- void DelWordLeft();
-
- /// Delete the word to the right of the caret. (Scintilla feature 2336)
- void DelWordRight();
-
- /// Delete the word to the right of the caret, but not the trailing non-word characters. (Scintilla feature 2518)
- void DelWordRightEnd();
-
- /// Cut the line containing the caret. (Scintilla feature 2337)
- void LineCut();
-
- /// Delete the line containing the caret. (Scintilla feature 2338)
- void LineDelete();
-
- /// Switch the current line with the previous. (Scintilla feature 2339)
- void LineTranspose();
-
- /// Duplicate the current line. (Scintilla feature 2404)
- void LineDuplicate();
-
- /// Transform the selection to lower case. (Scintilla feature 2340)
- void LowerCase();
-
- /// Transform the selection to upper case. (Scintilla feature 2341)
- void UpperCase();
-
- /// Scroll the document down, keeping the caret visible. (Scintilla feature 2342)
- void LineScrollDown();
-
- /// Scroll the document up, keeping the caret visible. (Scintilla feature 2343)
- void LineScrollUp();
-
- ///
- /// Delete the selection or if no selection, the character before the caret.
- /// Will not delete the character before at the start of a line.
- /// (Scintilla feature 2344)
- ///
- void DeleteBackNotLine();
-
- /// Move caret to first position on display line. (Scintilla feature 2345)
- void HomeDisplay();
-
- ///
- /// Move caret to first position on display line extending selection to
- /// new caret position.
- /// (Scintilla feature 2346)
- ///
- void HomeDisplayExtend();
-
- /// Move caret to last position on display line. (Scintilla feature 2347)
- void LineEndDisplay();
-
- ///
- /// Move caret to last position on display line extending selection to new
- /// caret position.
- /// (Scintilla feature 2348)
- ///
- void LineEndDisplayExtend();
-
- ///
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2349)
- ///
- void HomeWrap();
-
- ///
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2450)
- ///
- void HomeWrapExtend();
-
- ///
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2451)
- ///
- void LineEndWrap();
-
- ///
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2452)
- ///
- void LineEndWrapExtend();
-
- ///
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2453)
- ///
- void VCHomeWrap();
-
- ///
- /// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
- /// except they behave differently when word-wrap is enabled:
- /// They go first to the start / end of the display line, like (Home|LineEnd)Display
- /// The difference is that, the cursor is already at the point, it goes on to the start
- /// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
- /// (Scintilla feature 2454)
- ///
- void VCHomeWrapExtend();
-
- /// Copy the line containing the caret. (Scintilla feature 2455)
- void LineCopy();
-
- /// Move the caret inside current view if it's not there already. (Scintilla feature 2401)
- void MoveCaretInsideView();
-
- /// How many characters are on a line, including end of line characters? (Scintilla feature 2350)
- int LineLength(int line);
-
- /// Highlight the characters at two positions. (Scintilla feature 2351)
- void BraceHighlight(Position pos1, Position pos2);
-
- /// Use specified indicator to highlight matching braces instead of changing their style. (Scintilla feature 2498)
- void BraceHighlightIndicator(bool useBraceHighlightIndicator, int indicator);
-
- /// Highlight the character at a position indicating there is no matching brace. (Scintilla feature 2352)
- void BraceBadLight(Position pos);
-
- /// Use specified indicator to highlight non matching brace instead of changing its style. (Scintilla feature 2499)
- void BraceBadLightIndicator(bool useBraceBadLightIndicator, int indicator);
-
- /// Find the position of a matching brace or INVALID_POSITION if no match. (Scintilla feature 2353)
- Position BraceMatch(Position pos);
-
- /// Are the end of line characters visible? (Scintilla feature 2355)
- bool GetViewEOL();
-
- /// Make the end of line characters visible or invisible. (Scintilla feature 2356)
- void SetViewEOL(bool visible);
-
- /// Retrieve a pointer to the document object. (Scintilla feature 2357)
- IntPtr GetDocPointer();
-
- /// Change the document object used. (Scintilla feature 2358)
- void SetDocPointer(IntPtr pointer);
-
- /// Set which document modification events are sent to the container. (Scintilla feature 2359)
- void SetModEventMask(int mask);
-
- /// Retrieve the column number which text should be kept within. (Scintilla feature 2360)
- int GetEdgeColumn();
-
- ///
- /// Set the column number of the edge.
- /// If text goes past the edge then it is highlighted.
- /// (Scintilla feature 2361)
- ///
- void SetEdgeColumn(int column);
-
- /// Retrieve the edge highlight mode. (Scintilla feature 2362)
- int GetEdgeMode();
-
- ///
- /// The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
- /// goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
- /// (Scintilla feature 2363)
- ///
- void SetEdgeMode(int mode);
-
- /// Retrieve the colour used in edge indication. (Scintilla feature 2364)
- Colour GetEdgeColour();
-
- /// Change the colour used in edge indication. (Scintilla feature 2365)
- void SetEdgeColour(Colour edgeColour);
-
- /// Sets the current caret position to be the search anchor. (Scintilla feature 2366)
- void SearchAnchor();
-
- ///
- /// Find some text starting at the search anchor.
- /// Does not ensure the selection is visible.
- /// (Scintilla feature 2367)
- ///
- unsafe int SearchNext(int flags, string text);
-
- ///
- /// Find some text starting at the search anchor and moving backwards.
- /// Does not ensure the selection is visible.
- /// (Scintilla feature 2368)
- ///
- unsafe int SearchPrev(int flags, string text);
-
- /// Retrieves the number of lines completely visible. (Scintilla feature 2370)
- int LinesOnScreen();
-
- ///
- /// Set whether a pop up menu is displayed automatically when the user presses
- /// the wrong mouse button.
- /// (Scintilla feature 2371)
- ///
- void UsePopUp(bool allowPopUp);
-
- /// Is the selection rectangular? The alternative is the more common stream selection. (Scintilla feature 2372)
- bool SelectionIsRectangle();
-
- ///
- /// Set the zoom level. This number of points is added to the size of all fonts.
- /// It may be positive to magnify or negative to reduce.
- /// (Scintilla feature 2373)
- ///
- void SetZoom(int zoom);
-
- /// Retrieve the zoom level. (Scintilla feature 2374)
- int GetZoom();
-
- ///
- /// Create a new document object.
- /// Starts with reference count of 1 and not selected into editor.
- /// (Scintilla feature 2375)
- ///
- int CreateDocument();
-
- /// Extend life of document. (Scintilla feature 2376)
- void AddRefDocument(int doc);
-
- /// Release a reference to the document, deleting document if it fades to black. (Scintilla feature 2377)
- void ReleaseDocument(int doc);
-
- /// Get which document modification events are sent to the container. (Scintilla feature 2378)
- int GetModEventMask();
-
- /// Change internal focus flag. (Scintilla feature 2380)
- void SetFocus(bool focus);
-
- /// Get internal focus flag. (Scintilla feature 2381)
- bool GetFocus();
-
- /// Change error status - 0 = OK. (Scintilla feature 2382)
- void SetStatus(int statusCode);
-
- /// Get error status. (Scintilla feature 2383)
- int GetStatus();
-
- /// Set whether the mouse is captured when its button is pressed. (Scintilla feature 2384)
- void SetMouseDownCaptures(bool captures);
-
- /// Get whether mouse gets captured. (Scintilla feature 2385)
- bool GetMouseDownCaptures();
-
- /// Sets the cursor to one of the SC_CURSOR* values. (Scintilla feature 2386)
- void SetCursor(int cursorType);
-
- /// Get cursor type. (Scintilla feature 2387)
- int GetCursor();
-
- ///
- /// Change the way control characters are displayed:
- /// If symbol is < 32, keep the drawn way, else, use the given character.
- /// (Scintilla feature 2388)
- ///
- void SetControlCharSymbol(int symbol);
-
- /// Get the way control characters are displayed. (Scintilla feature 2389)
- int GetControlCharSymbol();
-
- /// Move to the previous change in capitalisation. (Scintilla feature 2390)
- void WordPartLeft();
-
- ///
- /// Move to the previous change in capitalisation extending selection
- /// to new caret position.
- /// (Scintilla feature 2391)
- ///
- void WordPartLeftExtend();
-
- /// Move to the change next in capitalisation. (Scintilla feature 2392)
- void WordPartRight();
-
- ///
- /// Move to the next change in capitalisation extending selection
- /// to new caret position.
- /// (Scintilla feature 2393)
- ///
- void WordPartRightExtend();
-
- ///
- /// Set the way the display area is determined when a particular line
- /// is to be moved to by Find, FindNext, GotoLine, etc.
- /// (Scintilla feature 2394)
- ///
- void SetVisiblePolicy(int visiblePolicy, int visibleSlop);
-
- /// Delete back from the current position to the start of the line. (Scintilla feature 2395)
- void DelLineLeft();
-
- /// Delete forwards from the current position to the end of the line. (Scintilla feature 2396)
- void DelLineRight();
-
- /// Get and Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2397)
- void SetXOffset(int newOffset);
-
- /// Get and Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2398)
- int GetXOffset();
-
- /// Set the last x chosen value to be the caret x position. (Scintilla feature 2399)
- void ChooseCaretX();
-
- /// Set the focus to this Scintilla widget. (Scintilla feature 2400)
- void GrabFocus();
-
- ///
- /// Set the way the caret is kept visible when going sideways.
- /// The exclusion zone is given in pixels.
- /// (Scintilla feature 2402)
- ///
- void SetXCaretPolicy(int caretPolicy, int caretSlop);
-
- ///
- /// Set the way the line the caret is on is kept visible.
- /// The exclusion zone is given in lines.
- /// (Scintilla feature 2403)
- ///
- void SetYCaretPolicy(int caretPolicy, int caretSlop);
-
- /// Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). (Scintilla feature 2406)
- void SetPrintWrapMode(int mode);
-
- /// Is printing line wrapped? (Scintilla feature 2407)
- int GetPrintWrapMode();
-
- /// Set a fore colour for active hotspots. (Scintilla feature 2410)
- void SetHotspotActiveFore(bool useSetting, Colour fore);
-
- /// Get the fore colour for active hotspots. (Scintilla feature 2494)
- Colour GetHotspotActiveFore();
-
- /// Set a back colour for active hotspots. (Scintilla feature 2411)
- void SetHotspotActiveBack(bool useSetting, Colour back);
-
- /// Get the back colour for active hotspots. (Scintilla feature 2495)
- Colour GetHotspotActiveBack();
-
- /// Enable / Disable underlining active hotspots. (Scintilla feature 2412)
- void SetHotspotActiveUnderline(bool underline);
-
- /// Get whether underlining for active hotspots. (Scintilla feature 2496)
- bool GetHotspotActiveUnderline();
-
- /// Limit hotspots to single line so hotspots on two lines don't merge. (Scintilla feature 2421)
- void SetHotspotSingleLine(bool singleLine);
-
- /// Get the HotspotSingleLine property (Scintilla feature 2497)
- bool GetHotspotSingleLine();
-
- /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2413)
- void ParaDown();
-
- /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2414)
- void ParaDownExtend();
-
- /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2415)
- void ParaUp();
-
- /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2416)
- void ParaUpExtend();
-
- ///
- /// Given a valid document position, return the previous position taking code
- /// page into account. Returns 0 if passed 0.
- /// (Scintilla feature 2417)
- ///
- Position PositionBefore(Position pos);
-
- ///
- /// Given a valid document position, return the next position taking code
- /// page into account. Maximum value returned is the last position in the document.
- /// (Scintilla feature 2418)
- ///
- Position PositionAfter(Position pos);
-
- ///
- /// Given a valid document position, return a position that differs in a number
- /// of characters. Returned value is always between 0 and last position in document.
- /// (Scintilla feature 2670)
- ///
- Position PositionRelative(Position pos, int relative);
-
- /// Copy a range of text to the clipboard. Positions are clipped into the document. (Scintilla feature 2419)
- void CopyRange(Position start, Position end);
-
- /// Copy argument text to the clipboard. (Scintilla feature 2420)
- unsafe void CopyText(int length, string text);
-
- ///
- /// Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or
- /// by lines (SC_SEL_LINES).
- /// (Scintilla feature 2422)
- ///
- void SetSelectionMode(int mode);
-
- /// Get the mode of the current selection. (Scintilla feature 2423)
- int GetSelectionMode();
-
- /// Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). (Scintilla feature 2424)
- Position GetLineSelStartPosition(int line);
-
- /// Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). (Scintilla feature 2425)
- Position GetLineSelEndPosition(int line);
-
- /// Move caret down one line, extending rectangular selection to new caret position. (Scintilla feature 2426)
- void LineDownRectExtend();
-
- /// Move caret up one line, extending rectangular selection to new caret position. (Scintilla feature 2427)
- void LineUpRectExtend();
-
- /// Move caret left one character, extending rectangular selection to new caret position. (Scintilla feature 2428)
- void CharLeftRectExtend();
-
- /// Move caret right one character, extending rectangular selection to new caret position. (Scintilla feature 2429)
- void CharRightRectExtend();
-
- /// Move caret to first position on line, extending rectangular selection to new caret position. (Scintilla feature 2430)
- void HomeRectExtend();
-
- ///
- /// Move caret to before first visible character on line.
- /// If already there move to first character on line.
- /// In either case, extend rectangular selection to new caret position.
- /// (Scintilla feature 2431)
- ///
- void VCHomeRectExtend();
-
- /// Move caret to last position on line, extending rectangular selection to new caret position. (Scintilla feature 2432)
- void LineEndRectExtend();
-
- /// Move caret one page up, extending rectangular selection to new caret position. (Scintilla feature 2433)
- void PageUpRectExtend();
-
- /// Move caret one page down, extending rectangular selection to new caret position. (Scintilla feature 2434)
- void PageDownRectExtend();
-
- /// Move caret to top of page, or one page up if already at top of page. (Scintilla feature 2435)
- void StutteredPageUp();
-
- /// Move caret to top of page, or one page up if already at top of page, extending selection to new caret position. (Scintilla feature 2436)
- void StutteredPageUpExtend();
-
- /// Move caret to bottom of page, or one page down if already at bottom of page. (Scintilla feature 2437)
- void StutteredPageDown();
-
- /// Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position. (Scintilla feature 2438)
- void StutteredPageDownExtend();
-
- /// Move caret left one word, position cursor at end of word. (Scintilla feature 2439)
- void WordLeftEnd();
-
- /// Move caret left one word, position cursor at end of word, extending selection to new caret position. (Scintilla feature 2440)
- void WordLeftEndExtend();
-
- /// Move caret right one word, position cursor at end of word. (Scintilla feature 2441)
- void WordRightEnd();
-
- /// Move caret right one word, position cursor at end of word, extending selection to new caret position. (Scintilla feature 2442)
- void WordRightEndExtend();
-
- ///
- /// Set the set of characters making up whitespace for when moving or selecting by word.
- /// Should be called after SetWordChars.
- /// (Scintilla feature 2443)
- ///
- unsafe void SetWhitespaceChars(string characters);
-
- /// Get the set of characters making up whitespace for when moving or selecting by word. (Scintilla feature 2647)
- unsafe string GetWhitespaceChars();
-
- ///
- /// Set the set of characters making up punctuation characters
- /// Should be called after SetWordChars.
- /// (Scintilla feature 2648)
- ///
- unsafe void SetPunctuationChars(string characters);
-
- /// Get the set of characters making up punctuation characters (Scintilla feature 2649)
- unsafe string GetPunctuationChars();
-
- /// Reset the set of characters for whitespace and word characters to the defaults. (Scintilla feature 2444)
- void SetCharsDefault();
-
- /// Get currently selected item position in the auto-completion list (Scintilla feature 2445)
- int AutoCGetCurrent();
-
- ///
- /// Get currently selected item text in the auto-completion list
- /// Returns the length of the item text
- /// Result is NUL-terminated.
- /// (Scintilla feature 2610)
- ///
- unsafe string AutoCGetCurrentText();
-
- /// Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference. (Scintilla feature 2634)
- void AutoCSetCaseInsensitiveBehaviour(int behaviour);
-
- /// Get auto-completion case insensitive behaviour. (Scintilla feature 2635)
- int AutoCGetCaseInsensitiveBehaviour();
-
- /// Change the effect of autocompleting when there are multiple selections. (Scintilla feature 2636)
- void AutoCSetMulti(int multi);
-
- /// Retrieve the effect of autocompleting when there are multiple selections.. (Scintilla feature 2637)
- int AutoCGetMulti();
-
- /// Set the way autocompletion lists are ordered. (Scintilla feature 2660)
- void AutoCSetOrder(int order);
-
- /// Get the way autocompletion lists are ordered. (Scintilla feature 2661)
- int AutoCGetOrder();
-
- /// Enlarge the document to a particular size of text bytes. (Scintilla feature 2446)
- void Allocate(int bytes);
-
- ///
- /// Returns the target converted to UTF8.
- /// Return the length in bytes.
- /// (Scintilla feature 2447)
- ///
- unsafe string TargetAsUTF8();
-
- ///
- /// Set the length of the utf8 argument for calling EncodedFromUTF8.
- /// Set to -1 and the string will be measured to the first nul.
- /// (Scintilla feature 2448)
- ///
- void SetLengthForEncode(int bytes);
-
- ///
- /// Translates a UTF8 string into the document encoding.
- /// Return the length of the result in bytes.
- /// On error return 0.
- /// (Scintilla feature 2449)
- ///
- unsafe string EncodedFromUTF8(string utf8);
-
- ///
- /// Find the position of a column on a line taking into account tabs and
- /// multi-byte characters. If beyond end of line, return line end position.
- /// (Scintilla feature 2456)
- ///
- int FindColumn(int line, int column);
-
- /// Can the caret preferred x position only be changed by explicit movement commands? (Scintilla feature 2457)
- int GetCaretSticky();
-
- /// Stop the caret preferred x position changing when the user types. (Scintilla feature 2458)
- void SetCaretSticky(int useCaretStickyBehaviour);
-
- /// Switch between sticky and non-sticky: meant to be bound to a key. (Scintilla feature 2459)
- void ToggleCaretSticky();
-
- /// Enable/Disable convert-on-paste for line endings (Scintilla feature 2467)
- void SetPasteConvertEndings(bool convert);
-
- /// Get convert-on-paste setting (Scintilla feature 2468)
- bool GetPasteConvertEndings();
-
- /// Duplicate the selection. If selection empty duplicate the line containing the caret. (Scintilla feature 2469)
- void SelectionDuplicate();
-
- /// Set background alpha of the caret line. (Scintilla feature 2470)
- void SetCaretLineBackAlpha(int alpha);
-
- /// Get the background alpha of the caret line. (Scintilla feature 2471)
- int GetCaretLineBackAlpha();
-
- /// Set the style of the caret to be drawn. (Scintilla feature 2512)
- void SetCaretStyle(int caretStyle);
-
- /// Returns the current style of the caret. (Scintilla feature 2513)
- int GetCaretStyle();
-
- /// Set the indicator used for IndicatorFillRange and IndicatorClearRange (Scintilla feature 2500)
- void SetIndicatorCurrent(int indicator);
-
- /// Get the current indicator (Scintilla feature 2501)
- int GetIndicatorCurrent();
-
- /// Set the value used for IndicatorFillRange (Scintilla feature 2502)
- void SetIndicatorValue(int value);
-
- /// Get the current indicator value (Scintilla feature 2503)
- int GetIndicatorValue();
-
- /// Turn a indicator on over a range. (Scintilla feature 2504)
- void IndicatorFillRange(int position, int fillLength);
-
- /// Turn a indicator off over a range. (Scintilla feature 2505)
- void IndicatorClearRange(int position, int clearLength);
-
- /// Are any indicators present at position? (Scintilla feature 2506)
- int IndicatorAllOnFor(int position);
-
- /// What value does a particular indicator have at at a position? (Scintilla feature 2507)
- int IndicatorValueAt(int indicator, int position);
-
- /// Where does a particular indicator start? (Scintilla feature 2508)
- int IndicatorStart(int indicator, int position);
-
- /// Where does a particular indicator end? (Scintilla feature 2509)
- int IndicatorEnd(int indicator, int position);
-
- /// Set number of entries in position cache (Scintilla feature 2514)
- void SetPositionCache(int size);
-
- /// How many entries are allocated to the position cache? (Scintilla feature 2515)
- int GetPositionCache();
-
- /// Copy the selection, if selection empty copy the line with the caret (Scintilla feature 2519)
- void CopyAllowLine();
-
- ///
- /// Compact the document buffer and return a read-only pointer to the
- /// characters in the document.
- /// (Scintilla feature 2520)
- ///
- IntPtr GetCharacterPointer();
-
- ///
- /// Return a read-only pointer to a range of characters in the document.
- /// May move the gap so that the range is contiguous, but will only move up
- /// to rangeLength bytes.
- /// (Scintilla feature 2643)
- ///
- IntPtr GetRangePointer(int position, int rangeLength);
-
- ///
- /// Return a position which, to avoid performance costs, should not be within
- /// the range of a call to GetRangePointer.
- /// (Scintilla feature 2644)
- ///
- Position GetGapPosition();
-
- /// Set the alpha fill colour of the given indicator. (Scintilla feature 2523)
- void IndicSetAlpha(int indicator, int alpha);
-
- /// Get the alpha fill colour of the given indicator. (Scintilla feature 2524)
- int IndicGetAlpha(int indicator);
-
- /// Set the alpha outline colour of the given indicator. (Scintilla feature 2558)
- void IndicSetOutlineAlpha(int indicator, int alpha);
-
- /// Get the alpha outline colour of the given indicator. (Scintilla feature 2559)
- int IndicGetOutlineAlpha(int indicator);
-
- /// Set extra ascent for each line (Scintilla feature 2525)
- void SetExtraAscent(int extraAscent);
-
- /// Get extra ascent for each line (Scintilla feature 2526)
- int GetExtraAscent();
-
- /// Set extra descent for each line (Scintilla feature 2527)
- void SetExtraDescent(int extraDescent);
-
- /// Get extra descent for each line (Scintilla feature 2528)
- int GetExtraDescent();
-
- /// Which symbol was defined for markerNumber with MarkerDefine (Scintilla feature 2529)
- int MarkerSymbolDefined(int markerNumber);
-
- /// Set the text in the text margin for a line (Scintilla feature 2530)
- unsafe void MarginSetText(int line, string text);
-
- /// Get the text in the text margin for a line (Scintilla feature 2531)
- unsafe string MarginGetText(int line);
-
- /// Set the style number for the text margin for a line (Scintilla feature 2532)
- void MarginSetStyle(int line, int style);
-
- /// Get the style number for the text margin for a line (Scintilla feature 2533)
- int MarginGetStyle(int line);
-
- /// Set the style in the text margin for a line (Scintilla feature 2534)
- unsafe void MarginSetStyles(int line, string styles);
-
- /// Get the styles in the text margin for a line (Scintilla feature 2535)
- unsafe string MarginGetStyles(int line);
-
- /// Clear the margin text on all lines (Scintilla feature 2536)
- void MarginTextClearAll();
-
- /// Get the start of the range of style numbers used for margin text (Scintilla feature 2537)
- void MarginSetStyleOffset(int style);
-
- /// Get the start of the range of style numbers used for margin text (Scintilla feature 2538)
- int MarginGetStyleOffset();
-
- /// Set the margin options. (Scintilla feature 2539)
- void SetMarginOptions(int marginOptions);
-
- /// Get the margin options. (Scintilla feature 2557)
- int GetMarginOptions();
-
- /// Set the annotation text for a line (Scintilla feature 2540)
- unsafe void AnnotationSetText(int line, string text);
-
- /// Get the annotation text for a line (Scintilla feature 2541)
- unsafe string AnnotationGetText(int line);
-
- /// Set the style number for the annotations for a line (Scintilla feature 2542)
- void AnnotationSetStyle(int line, int style);
-
- /// Get the style number for the annotations for a line (Scintilla feature 2543)
- int AnnotationGetStyle(int line);
-
- /// Set the annotation styles for a line (Scintilla feature 2544)
- unsafe void AnnotationSetStyles(int line, string styles);
-
- /// Get the annotation styles for a line (Scintilla feature 2545)
- unsafe string AnnotationGetStyles(int line);
-
- /// Get the number of annotation lines for a line (Scintilla feature 2546)
- int AnnotationGetLines(int line);
-
- /// Clear the annotations from all lines (Scintilla feature 2547)
- void AnnotationClearAll();
-
- /// Set the visibility for the annotations for a view (Scintilla feature 2548)
- void AnnotationSetVisible(int visible);
-
- /// Get the visibility for the annotations for a view (Scintilla feature 2549)
- int AnnotationGetVisible();
-
- /// Get the start of the range of style numbers used for annotations (Scintilla feature 2550)
- void AnnotationSetStyleOffset(int style);
-
- /// Get the start of the range of style numbers used for annotations (Scintilla feature 2551)
- int AnnotationGetStyleOffset();
-
- /// Release all extended (>255) style numbers (Scintilla feature 2552)
- void ReleaseAllExtendedStyles();
-
- /// Allocate some extended (>255) style numbers and return the start of the range (Scintilla feature 2553)
- int AllocateExtendedStyles(int numberStyles);
-
- /// Add a container action to the undo stack (Scintilla feature 2560)
- void AddUndoAction(int token, int flags);
-
- /// Find the position of a character from a point within the window. (Scintilla feature 2561)
- Position CharPositionFromPoint(int x, int y);
-
- ///
- /// Find the position of a character from a point within the window.
- /// Return INVALID_POSITION if not close to text.
- /// (Scintilla feature 2562)
- ///
- Position CharPositionFromPointClose(int x, int y);
-
- /// Set whether switching to rectangular mode while selecting with the mouse is allowed. (Scintilla feature 2668)
- void SetMouseSelectionRectangularSwitch(bool mouseSelectionRectangularSwitch);
-
- /// Whether switching to rectangular mode while selecting with the mouse is allowed. (Scintilla feature 2669)
- bool GetMouseSelectionRectangularSwitch();
-
- /// Set whether multiple selections can be made (Scintilla feature 2563)
- void SetMultipleSelection(bool multipleSelection);
-
- /// Whether multiple selections can be made (Scintilla feature 2564)
- bool GetMultipleSelection();
-
- /// Set whether typing can be performed into multiple selections (Scintilla feature 2565)
- void SetAdditionalSelectionTyping(bool additionalSelectionTyping);
-
- /// Whether typing can be performed into multiple selections (Scintilla feature 2566)
- bool GetAdditionalSelectionTyping();
-
- /// Set whether additional carets will blink (Scintilla feature 2567)
- void SetAdditionalCaretsBlink(bool additionalCaretsBlink);
-
- /// Whether additional carets will blink (Scintilla feature 2568)
- bool GetAdditionalCaretsBlink();
-
- /// Set whether additional carets are visible (Scintilla feature 2608)
- void SetAdditionalCaretsVisible(bool additionalCaretsBlink);
-
- /// Whether additional carets are visible (Scintilla feature 2609)
- bool GetAdditionalCaretsVisible();
-
- /// How many selections are there? (Scintilla feature 2570)
- int GetSelections();
-
- /// Is every selected range empty? (Scintilla feature 2650)
- bool GetSelectionEmpty();
-
- /// Clear selections to a single empty stream selection (Scintilla feature 2571)
- void ClearSelections();
-
- /// Set a simple selection (Scintilla feature 2572)
- int SetSelection(int caret, int anchor);
-
- /// Add a selection (Scintilla feature 2573)
- int AddSelection(int caret, int anchor);
-
- /// Drop one selection (Scintilla feature 2671)
- void DropSelectionN(int selection);
-
- /// Set the main selection (Scintilla feature 2574)
- void SetMainSelection(int selection);
-
- /// Which selection is the main selection (Scintilla feature 2575)
- int GetMainSelection();
-
- /// Which selection is the main selection (Scintilla feature 2576)
- void SetSelectionNCaret(int selection, Position pos);
-
- /// Which selection is the main selection (Scintilla feature 2577)
- Position GetSelectionNCaret(int selection);
-
- /// Which selection is the main selection (Scintilla feature 2578)
- void SetSelectionNAnchor(int selection, Position posAnchor);
-
- /// Which selection is the main selection (Scintilla feature 2579)
- Position GetSelectionNAnchor(int selection);
-
- /// Which selection is the main selection (Scintilla feature 2580)
- void SetSelectionNCaretVirtualSpace(int selection, int space);
-
- /// Which selection is the main selection (Scintilla feature 2581)
- int GetSelectionNCaretVirtualSpace(int selection);
-
- /// Which selection is the main selection (Scintilla feature 2582)
- void SetSelectionNAnchorVirtualSpace(int selection, int space);
-
- /// Which selection is the main selection (Scintilla feature 2583)
- int GetSelectionNAnchorVirtualSpace(int selection);
-
- /// Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2584)
- void SetSelectionNStart(int selection, Position pos);
-
- /// Returns the position at the start of the selection. (Scintilla feature 2585)
- Position GetSelectionNStart(int selection);
-
- /// Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2586)
- void SetSelectionNEnd(int selection, Position pos);
-
- /// Returns the position at the end of the selection. (Scintilla feature 2587)
- Position GetSelectionNEnd(int selection);
-
- /// Returns the position at the end of the selection. (Scintilla feature 2588)
- void SetRectangularSelectionCaret(Position pos);
-
- /// Returns the position at the end of the selection. (Scintilla feature 2589)
- Position GetRectangularSelectionCaret();
-
- /// Returns the position at the end of the selection. (Scintilla feature 2590)
- void SetRectangularSelectionAnchor(Position posAnchor);
-
- /// Returns the position at the end of the selection. (Scintilla feature 2591)
- Position GetRectangularSelectionAnchor();
-
- /// Returns the position at the end of the selection. (Scintilla feature 2592)
- void SetRectangularSelectionCaretVirtualSpace(int space);
-
- /// Returns the position at the end of the selection. (Scintilla feature 2593)
- int GetRectangularSelectionCaretVirtualSpace();
-
- /// Returns the position at the end of the selection. (Scintilla feature 2594)
- void SetRectangularSelectionAnchorVirtualSpace(int space);
-
- /// Returns the position at the end of the selection. (Scintilla feature 2595)
- int GetRectangularSelectionAnchorVirtualSpace();
-
- /// Returns the position at the end of the selection. (Scintilla feature 2596)
- void SetVirtualSpaceOptions(int virtualSpaceOptions);
-
- /// Returns the position at the end of the selection. (Scintilla feature 2597)
- int GetVirtualSpaceOptions();
-
- ///
- /// On GTK+, allow selecting the modifier key to use for mouse-based
- /// rectangular selection. Often the window manager requires Alt+Mouse Drag
- /// for moving windows.
- /// Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER.
- /// (Scintilla feature 2598)
- ///
- void SetRectangularSelectionModifier(int modifier);
-
- /// Get the modifier key used for rectangular selection. (Scintilla feature 2599)
- int GetRectangularSelectionModifier();
-
- ///
- /// Set the foreground colour of additional selections.
- /// Must have previously called SetSelFore with non-zero first argument for this to have an effect.
- /// (Scintilla feature 2600)
- ///
- void SetAdditionalSelFore(Colour fore);
-
- ///
- /// Set the background colour of additional selections.
- /// Must have previously called SetSelBack with non-zero first argument for this to have an effect.
- /// (Scintilla feature 2601)
- ///
- void SetAdditionalSelBack(Colour back);
-
- /// Set the alpha of the selection. (Scintilla feature 2602)
- void SetAdditionalSelAlpha(int alpha);
-
- /// Get the alpha of the selection. (Scintilla feature 2603)
- int GetAdditionalSelAlpha();
-
- /// Set the foreground colour of additional carets. (Scintilla feature 2604)
- void SetAdditionalCaretFore(Colour fore);
-
- /// Get the foreground colour of additional carets. (Scintilla feature 2605)
- Colour GetAdditionalCaretFore();
-
- /// Set the main selection to the next selection. (Scintilla feature 2606)
- void RotateSelection();
-
- /// Swap that caret and anchor of the main selection. (Scintilla feature 2607)
- void SwapMainAnchorCaret();
-
- ///
- /// Indicate that the internal state of a lexer has changed over a range and therefore
- /// there may be a need to redraw.
- /// (Scintilla feature 2617)
- ///
- int ChangeLexerState(Position start, Position end);
-
- ///
- /// Find the next line at or after lineStart that is a contracted fold header line.
- /// Return -1 when no more lines.
- /// (Scintilla feature 2618)
- ///
- int ContractedFoldNext(int lineStart);
-
- /// Centre current line in window. (Scintilla feature 2619)
- void VerticalCentreCaret();
-
- /// Move the selected lines up one line, shifting the line above after the selection (Scintilla feature 2620)
- void MoveSelectedLinesUp();
-
- /// Move the selected lines down one line, shifting the line below before the selection (Scintilla feature 2621)
- void MoveSelectedLinesDown();
-
- /// Set the identifier reported as IdFrom in notification messages. (Scintilla feature 2622)
- void SetIdentifier(int identifier);
-
- /// Get the identifier. (Scintilla feature 2623)
- int GetIdentifier();
-
- /// Set the width for future RGBA image data. (Scintilla feature 2624)
- void RGBAImageSetWidth(int width);
-
- /// Set the height for future RGBA image data. (Scintilla feature 2625)
- void RGBAImageSetHeight(int height);
-
- /// Set the scale factor in percent for future RGBA image data. (Scintilla feature 2651)
- void RGBAImageSetScale(int scalePercent);
-
- ///
- /// Define a marker from RGBA data.
- /// It has the width and height from RGBAImageSetWidth/Height
- /// (Scintilla feature 2626)
- ///
- unsafe void MarkerDefineRGBAImage(int markerNumber, string pixels);
-
- ///
- /// Register an RGBA image for use in autocompletion lists.
- /// It has the width and height from RGBAImageSetWidth/Height
- /// (Scintilla feature 2627)
- ///
- unsafe void RegisterRGBAImage(int type, string pixels);
-
- /// Scroll to start of document. (Scintilla feature 2628)
- void ScrollToStart();
-
- /// Scroll to end of document. (Scintilla feature 2629)
- void ScrollToEnd();
-
- /// Set the technology used. (Scintilla feature 2630)
- void SetTechnology(int technology);
-
- /// Get the tech. (Scintilla feature 2631)
- int GetTechnology();
-
- /// Create an ILoader*. (Scintilla feature 2632)
- int CreateLoader(int bytes);
-
- /// On OS X, show a find indicator. (Scintilla feature 2640)
- void FindIndicatorShow(Position start, Position end);
-
- /// On OS X, flash a find indicator, then fade out. (Scintilla feature 2641)
- void FindIndicatorFlash(Position start, Position end);
-
- /// On OS X, hide the find indicator. (Scintilla feature 2642)
- void FindIndicatorHide();
-
- ///
- /// Move caret to before first visible character on display line.
- /// If already there move to first character on display line.
- /// (Scintilla feature 2652)
- ///
- void VCHomeDisplay();
-
- /// Like VCHomeDisplay but extending selection to new caret position. (Scintilla feature 2653)
- void VCHomeDisplayExtend();
-
- /// Is the caret line always visible? (Scintilla feature 2654)
- bool GetCaretLineVisibleAlways();
-
- /// Sets the caret line to always visible. (Scintilla feature 2655)
- void SetCaretLineVisibleAlways(bool alwaysVisible);
-
- /// Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding. (Scintilla feature 2656)
- void SetLineEndTypesAllowed(int lineEndBitSet);
-
- /// Get the line end types currently allowed. (Scintilla feature 2657)
- int GetLineEndTypesAllowed();
-
- /// Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation. (Scintilla feature 2658)
- int GetLineEndTypesActive();
-
- /// Set the way a character is drawn. (Scintilla feature 2665)
- unsafe void SetRepresentation(string encodedCharacter, string representation);
-
- ///
- /// Set the way a character is drawn.
- /// Result is NUL-terminated.
- /// (Scintilla feature 2666)
- ///
- unsafe string GetRepresentation(string encodedCharacter);
-
- /// Remove a character representation. (Scintilla feature 2667)
- unsafe void ClearRepresentation(string encodedCharacter);
-
- /// Start notifying the container of all key presses and commands. (Scintilla feature 3001)
- void StartRecord();
-
- /// Stop notifying the container of all key presses and commands. (Scintilla feature 3002)
- void StopRecord();
-
- /// Set the lexing language of the document. (Scintilla feature 4001)
- void SetLexer(int lexer);
-
- /// Retrieve the lexing language of the document. (Scintilla feature 4002)
- int GetLexer();
-
- /// Colourise a segment of the document using the current lexing language. (Scintilla feature 4003)
- void Colourise(Position start, Position end);
-
- /// Set up a value that may be used by a lexer for some optional feature. (Scintilla feature 4004)
- unsafe void SetProperty(string key, string value);
-
- /// Set up the key words used by the lexer. (Scintilla feature 4005)
- unsafe void SetKeyWords(int keywordSet, string keyWords);
-
- /// Set the lexing language of the document based on string name. (Scintilla feature 4006)
- unsafe void SetLexerLanguage(string language);
-
- /// Load a lexer library (dll / so). (Scintilla feature 4007)
- unsafe void LoadLexerLibrary(string path);
-
- ///
- /// Retrieve a "property" value previously set with SetProperty.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4008)
- ///
- unsafe string GetProperty(string key);
-
- ///
- /// Retrieve a "property" value previously set with SetProperty,
- /// with "$()" variable replacement on returned buffer.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4009)
- ///
- unsafe string GetPropertyExpanded(string key);
-
- ///
- /// Retrieve a "property" value previously set with SetProperty,
- /// interpreted as an int AFTER any "$()" variable replacement.
- /// (Scintilla feature 4010)
- ///
- unsafe int GetPropertyInt(string key);
-
- /// Retrieve the number of bits the current lexer needs for styling. (Scintilla feature 4011)
- int GetStyleBitsNeeded();
-
- ///
- /// Retrieve the name of the lexer.
- /// Return the length of the text.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4012)
- ///
- unsafe string GetLexerLanguage();
-
- /// For private communication between an application and a known lexer. (Scintilla feature 4013)
- int PrivateLexerCall(int operation, int pointer);
-
- ///
- /// Retrieve a '\n' separated list of properties understood by the current lexer.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4014)
- ///
- unsafe string PropertyNames();
-
- /// Retrieve the type of a property. (Scintilla feature 4015)
- unsafe int PropertyType(string name);
-
- ///
- /// Describe a property.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4016)
- ///
- unsafe string DescribeProperty(string name);
-
- ///
- /// Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.
- /// Result is NUL-terminated.
- /// (Scintilla feature 4017)
- ///
- unsafe string DescribeKeyWordSets();
-
- ///
- /// Bit set of LineEndType enumertion for which line ends beyond the standard
- /// LF, CR, and CRLF are supported by the lexer.
- /// (Scintilla feature 4018)
- ///
- int GetLineEndTypesSupported();
-
- /// Allocate a set of sub styles for a particular base style, returning start of range (Scintilla feature 4020)
- int AllocateSubStyles(int styleBase, int numberStyles);
-
- /// The starting style number for the sub styles associated with a base style (Scintilla feature 4021)
- int GetSubStylesStart(int styleBase);
-
- /// The number of sub styles associated with a base style (Scintilla feature 4022)
- int GetSubStylesLength(int styleBase);
-
- /// For a sub style, return the base style, else return the argument. (Scintilla feature 4027)
- int GetStyleFromSubStyle(int subStyle);
-
- /// For a secondary style, return the primary style, else return the argument. (Scintilla feature 4028)
- int GetPrimaryStyleFromStyle(int style);
-
- /// Free allocated sub styles (Scintilla feature 4023)
- void FreeSubStyles();
-
- /// Set the identifiers that are shown in a particular style (Scintilla feature 4024)
- unsafe void SetIdentifiers(int style, string identifiers);
-
- ///
- /// Where styles are duplicated by a feature such as active/inactive code
- /// return the distance between the two types.
- /// (Scintilla feature 4025)
- ///
- int DistanceToSecondaryStyles();
-
- ///
- /// Get the set of base styles that can be extended with sub styles
- /// Result is NUL-terminated.
- /// (Scintilla feature 4026)
- ///
- unsafe string GetSubStyleBases();
-
- ///
- /// Deprecated in 2.30
- /// In palette mode?
- /// (Scintilla feature 2139)
- ///
- bool GetUsePalette();
-
- ///
- /// In palette mode, Scintilla uses the environment's palette calls to display
- /// more colours. This may lead to ugly displays.
- /// (Scintilla feature 2039)
- ///
- void SetUsePalette(bool usePalette);
-
- ///
- /// Deprecated in 3.5.5
- /// Always interpret keyboard input as Unicode
- /// (Scintilla feature 2521)
- ///
- void SetKeysUnicode(bool keysUnicode);
-
- /// Are keys always interpreted as Unicode? (Scintilla feature 2522)
- bool GetKeysUnicode();
-
- /* --Autogenerated -- end of section automatically generated from Scintilla.iface */
- }
-}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/MenuCmdID_h.cs b/CSharpRegexTools4Npp/PluginInfrastructure/MenuCmdID_h.cs
index 9e1681c..b5758e9 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/MenuCmdID_h.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/MenuCmdID_h.cs
@@ -20,7 +20,7 @@ public enum NppMenuCmd : uint
IDM_FILE_SAVE = (IDM_FILE + 6),
IDM_FILE_SAVEALL = (IDM_FILE + 7),
IDM_FILE_SAVEAS = (IDM_FILE + 8),
- //IDM_FILE_ASIAN_LANG = (IDM_FILE + 9),
+ //IDM_FILE_ASIAN_LANG = (IDM_FILE + 9),
IDM_FILE_PRINT = (IDM_FILE + 10),
IDM_FILE_PRINTNOW = 1001,
IDM_FILE_EXIT = (IDM_FILE + 11),
@@ -31,7 +31,7 @@ public enum NppMenuCmd : uint
IDM_FILE_DELETE = (IDM_FILE + 16),
IDM_FILE_RENAME = (IDM_FILE + 17),
- // A mettre à jour si on ajoute nouveau menu item dans le menu "File"
+ // A mettre � jour si on ajoute nouveau menu item dans le menu "File"
IDM_FILEMENU_LASTONE = IDM_FILE_RENAME,
IDM_EDIT = (IDM + 2000),
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/MenuCmdID_h.cs.bak b/CSharpRegexTools4Npp/PluginInfrastructure/MenuCmdID_h.cs.bak
deleted file mode 100644
index 9a8ecf2..0000000
--- a/CSharpRegexTools4Npp/PluginInfrastructure/MenuCmdID_h.cs.bak
+++ /dev/null
@@ -1,398 +0,0 @@
-// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
-//
-// This file should stay in sync with the CPP project file
-// "notepad-plus-plus/PowerEditor/src/menuCmdID.h"
-// found at
-// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/menuCmdID.h
-
-namespace CSharpRegexTools4Npp.PluginInfrastructure
-{
- public enum NppMenuCmd : uint
- {
- IDM = 40000,
-
- IDM_FILE = (IDM + 1000),
- IDM_FILE_NEW = (IDM_FILE + 1),
- IDM_FILE_OPEN = (IDM_FILE + 2),
- IDM_FILE_CLOSE = (IDM_FILE + 3),
- IDM_FILE_CLOSEALL = (IDM_FILE + 4),
- IDM_FILE_CLOSEALL_BUT_CURRENT = (IDM_FILE + 5),
- IDM_FILE_SAVE = (IDM_FILE + 6),
- IDM_FILE_SAVEALL = (IDM_FILE + 7),
- IDM_FILE_SAVEAS = (IDM_FILE + 8),
- //IDM_FILE_ASIAN_LANG = (IDM_FILE + 9),
- IDM_FILE_PRINT = (IDM_FILE + 10),
- IDM_FILE_PRINTNOW = 1001,
- IDM_FILE_EXIT = (IDM_FILE + 11),
- IDM_FILE_LOADSESSION = (IDM_FILE + 12),
- IDM_FILE_SAVESESSION = (IDM_FILE + 13),
- IDM_FILE_RELOAD = (IDM_FILE + 14),
- IDM_FILE_SAVECOPYAS = (IDM_FILE + 15),
- IDM_FILE_DELETE = (IDM_FILE + 16),
- IDM_FILE_RENAME = (IDM_FILE + 17),
-
- // A mettre � jour si on ajoute nouveau menu item dans le menu "File"
- IDM_FILEMENU_LASTONE = IDM_FILE_RENAME,
-
- IDM_EDIT = (IDM + 2000),
- IDM_EDIT_CUT = (IDM_EDIT + 1),
- IDM_EDIT_COPY = (IDM_EDIT + 2),
- IDM_EDIT_UNDO = (IDM_EDIT + 3),
- IDM_EDIT_REDO = (IDM_EDIT + 4),
- IDM_EDIT_PASTE = (IDM_EDIT + 5),
- IDM_EDIT_DELETE = (IDM_EDIT + 6),
- IDM_EDIT_SELECTALL = (IDM_EDIT + 7),
-
- IDM_EDIT_INS_TAB = (IDM_EDIT + 8),
- IDM_EDIT_RMV_TAB = (IDM_EDIT + 9),
- IDM_EDIT_DUP_LINE = (IDM_EDIT + 10),
- IDM_EDIT_TRANSPOSE_LINE = (IDM_EDIT + 11),
- IDM_EDIT_SPLIT_LINES = (IDM_EDIT + 12),
- IDM_EDIT_JOIN_LINES = (IDM_EDIT + 13),
- IDM_EDIT_LINE_UP = (IDM_EDIT + 14),
- IDM_EDIT_LINE_DOWN = (IDM_EDIT + 15),
- IDM_EDIT_UPPERCASE = (IDM_EDIT + 16),
- IDM_EDIT_LOWERCASE = (IDM_EDIT + 17),
-
- // Menu macro
- IDM_MACRO_STARTRECORDINGMACRO = (IDM_EDIT + 18),
- IDM_MACRO_STOPRECORDINGMACRO = (IDM_EDIT + 19),
- IDM_MACRO_PLAYBACKRECORDEDMACRO = (IDM_EDIT + 21),
- //-----------
-
- IDM_EDIT_BLOCK_COMMENT = (IDM_EDIT + 22),
- IDM_EDIT_STREAM_COMMENT = (IDM_EDIT + 23),
- IDM_EDIT_TRIMTRAILING = (IDM_EDIT + 24),
- IDM_EDIT_TRIMLINEHEAD = (IDM_EDIT + 42),
- IDM_EDIT_TRIM_BOTH = (IDM_EDIT + 43),
- IDM_EDIT_EOL2WS = (IDM_EDIT + 44),
- IDM_EDIT_TRIMALL = (IDM_EDIT + 45),
- IDM_EDIT_TAB2SW = (IDM_EDIT + 46),
- IDM_EDIT_SW2TAB = (IDM_EDIT + 47),
-
- // Menu macro
- IDM_MACRO_SAVECURRENTMACRO = (IDM_EDIT + 25),
- //-----------
-
- IDM_EDIT_RTL = (IDM_EDIT + 26),
- IDM_EDIT_LTR = (IDM_EDIT + 27),
- IDM_EDIT_SETREADONLY = (IDM_EDIT + 28),
- IDM_EDIT_FULLPATHTOCLIP = (IDM_EDIT + 29),
- IDM_EDIT_FILENAMETOCLIP = (IDM_EDIT + 30),
- IDM_EDIT_CURRENTDIRTOCLIP = (IDM_EDIT + 31),
-
- // Menu macro
- IDM_MACRO_RUNMULTIMACRODLG = (IDM_EDIT + 32),
- //-----------
-
- IDM_EDIT_CLEARREADONLY = (IDM_EDIT + 33),
- IDM_EDIT_COLUMNMODE = (IDM_EDIT + 34),
- IDM_EDIT_BLOCK_COMMENT_SET = (IDM_EDIT + 35),
- IDM_EDIT_BLOCK_UNCOMMENT = (IDM_EDIT + 36),
-
- IDM_EDIT_AUTOCOMPLETE = (50000 + 0),
- IDM_EDIT_AUTOCOMPLETE_CURRENTFILE = (50000 + 1),
- IDM_EDIT_FUNCCALLTIP = (50000 + 2),
-
- //Belong to MENU FILE
- IDM_OPEN_ALL_RECENT_FILE = (IDM_EDIT + 40),
- IDM_CLEAN_RECENT_FILE_LIST = (IDM_EDIT + 41),
-
- IDM_SEARCH = (IDM + 3000),
-
- IDM_SEARCH_FIND = (IDM_SEARCH + 1),
- IDM_SEARCH_FINDNEXT = (IDM_SEARCH + 2),
- IDM_SEARCH_REPLACE = (IDM_SEARCH + 3),
- IDM_SEARCH_GOTOLINE = (IDM_SEARCH + 4),
- IDM_SEARCH_TOGGLE_BOOKMARK = (IDM_SEARCH + 5),
- IDM_SEARCH_NEXT_BOOKMARK = (IDM_SEARCH + 6),
- IDM_SEARCH_PREV_BOOKMARK = (IDM_SEARCH + 7),
- IDM_SEARCH_CLEAR_BOOKMARKS = (IDM_SEARCH + 8),
- IDM_SEARCH_GOTOMATCHINGBRACE = (IDM_SEARCH + 9),
- IDM_SEARCH_FINDPREV = (IDM_SEARCH + 10),
- IDM_SEARCH_FINDINCREMENT = (IDM_SEARCH + 11),
- IDM_SEARCH_FINDINFILES = (IDM_SEARCH + 13),
- IDM_SEARCH_VOLATILE_FINDNEXT = (IDM_SEARCH + 14),
- IDM_SEARCH_VOLATILE_FINDPREV = (IDM_SEARCH + 15),
- IDM_SEARCH_CUTMARKEDLINES = (IDM_SEARCH + 18),
- IDM_SEARCH_COPYMARKEDLINES = (IDM_SEARCH + 19),
- IDM_SEARCH_PASTEMARKEDLINES = (IDM_SEARCH + 20),
- IDM_SEARCH_DELETEMARKEDLINES = (IDM_SEARCH + 21),
- IDM_SEARCH_MARKALLEXT1 = (IDM_SEARCH + 22),
- IDM_SEARCH_UNMARKALLEXT1 = (IDM_SEARCH + 23),
- IDM_SEARCH_MARKALLEXT2 = (IDM_SEARCH + 24),
- IDM_SEARCH_UNMARKALLEXT2 = (IDM_SEARCH + 25),
- IDM_SEARCH_MARKALLEXT3 = (IDM_SEARCH + 26),
- IDM_SEARCH_UNMARKALLEXT3 = (IDM_SEARCH + 27),
- IDM_SEARCH_MARKALLEXT4 = (IDM_SEARCH + 28),
- IDM_SEARCH_UNMARKALLEXT4 = (IDM_SEARCH + 29),
- IDM_SEARCH_MARKALLEXT5 = (IDM_SEARCH + 30),
- IDM_SEARCH_UNMARKALLEXT5 = (IDM_SEARCH + 31),
- IDM_SEARCH_CLEARALLMARKS = (IDM_SEARCH + 32),
-
- IDM_SEARCH_GOPREVMARKER1 = (IDM_SEARCH + 33),
- IDM_SEARCH_GOPREVMARKER2 = (IDM_SEARCH + 34),
- IDM_SEARCH_GOPREVMARKER3 = (IDM_SEARCH + 35),
- IDM_SEARCH_GOPREVMARKER4 = (IDM_SEARCH + 36),
- IDM_SEARCH_GOPREVMARKER5 = (IDM_SEARCH + 37),
- IDM_SEARCH_GOPREVMARKER_DEF = (IDM_SEARCH + 38),
-
- IDM_SEARCH_GONEXTMARKER1 = (IDM_SEARCH + 39),
- IDM_SEARCH_GONEXTMARKER2 = (IDM_SEARCH + 40),
- IDM_SEARCH_GONEXTMARKER3 = (IDM_SEARCH + 41),
- IDM_SEARCH_GONEXTMARKER4 = (IDM_SEARCH + 42),
- IDM_SEARCH_GONEXTMARKER5 = (IDM_SEARCH + 43),
- IDM_SEARCH_GONEXTMARKER_DEF = (IDM_SEARCH + 44),
-
- IDM_FOCUS_ON_FOUND_RESULTS = (IDM_SEARCH + 45),
- IDM_SEARCH_GOTONEXTFOUND = (IDM_SEARCH + 46),
- IDM_SEARCH_GOTOPREVFOUND = (IDM_SEARCH + 47),
-
- IDM_SEARCH_SETANDFINDNEXT = (IDM_SEARCH + 48),
- IDM_SEARCH_SETANDFINDPREV = (IDM_SEARCH + 49),
- IDM_SEARCH_INVERSEMARKS = (IDM_SEARCH + 50),
-
- IDM_VIEW = (IDM + 4000),
- //IDM_VIEW_TOOLBAR_HIDE = (IDM_VIEW + 1),
- IDM_VIEW_TOOLBAR_REDUCE = (IDM_VIEW + 2),
- IDM_VIEW_TOOLBAR_ENLARGE = (IDM_VIEW + 3),
- IDM_VIEW_TOOLBAR_STANDARD = (IDM_VIEW + 4),
- IDM_VIEW_REDUCETABBAR = (IDM_VIEW + 5),
- IDM_VIEW_LOCKTABBAR = (IDM_VIEW + 6),
- IDM_VIEW_DRAWTABBAR_TOPBAR = (IDM_VIEW + 7),
- IDM_VIEW_DRAWTABBAR_INACIVETAB = (IDM_VIEW + 8),
- IDM_VIEW_POSTIT = (IDM_VIEW + 9),
- IDM_VIEW_TOGGLE_FOLDALL = (IDM_VIEW + 10),
- IDM_VIEW_USER_DLG = (IDM_VIEW + 11),
- IDM_VIEW_LINENUMBER = (IDM_VIEW + 12),
- IDM_VIEW_SYMBOLMARGIN = (IDM_VIEW + 13),
- IDM_VIEW_FOLDERMAGIN = (IDM_VIEW + 14),
- IDM_VIEW_FOLDERMAGIN_SIMPLE = (IDM_VIEW + 15),
- IDM_VIEW_FOLDERMAGIN_ARROW = (IDM_VIEW + 16),
- IDM_VIEW_FOLDERMAGIN_CIRCLE = (IDM_VIEW + 17),
- IDM_VIEW_FOLDERMAGIN_BOX = (IDM_VIEW + 18),
- IDM_VIEW_ALL_CHARACTERS = (IDM_VIEW + 19),
- IDM_VIEW_INDENT_GUIDE = (IDM_VIEW + 20),
- IDM_VIEW_CURLINE_HILITING = (IDM_VIEW + 21),
- IDM_VIEW_WRAP = (IDM_VIEW + 22),
- IDM_VIEW_ZOOMIN = (IDM_VIEW + 23),
- IDM_VIEW_ZOOMOUT = (IDM_VIEW + 24),
- IDM_VIEW_TAB_SPACE = (IDM_VIEW + 25),
- IDM_VIEW_EOL = (IDM_VIEW + 26),
- IDM_VIEW_EDGELINE = (IDM_VIEW + 27),
- IDM_VIEW_EDGEBACKGROUND = (IDM_VIEW + 28),
- IDM_VIEW_TOGGLE_UNFOLDALL = (IDM_VIEW + 29),
- IDM_VIEW_FOLD_CURRENT = (IDM_VIEW + 30),
- IDM_VIEW_UNFOLD_CURRENT = (IDM_VIEW + 31),
- IDM_VIEW_FULLSCREENTOGGLE = (IDM_VIEW + 32),
- IDM_VIEW_ZOOMRESTORE = (IDM_VIEW + 33),
- IDM_VIEW_ALWAYSONTOP = (IDM_VIEW + 34),
- IDM_VIEW_SYNSCROLLV = (IDM_VIEW + 35),
- IDM_VIEW_SYNSCROLLH = (IDM_VIEW + 36),
- IDM_VIEW_EDGENONE = (IDM_VIEW + 37),
- IDM_VIEW_DRAWTABBAR_CLOSEBOTTUN = (IDM_VIEW + 38),
- IDM_VIEW_DRAWTABBAR_DBCLK2CLOSE = (IDM_VIEW + 39),
- IDM_VIEW_REFRESHTABAR = (IDM_VIEW + 40),
- IDM_VIEW_WRAP_SYMBOL = (IDM_VIEW + 41),
- IDM_VIEW_HIDELINES = (IDM_VIEW + 42),
- IDM_VIEW_DRAWTABBAR_VERTICAL = (IDM_VIEW + 43),
- IDM_VIEW_DRAWTABBAR_MULTILINE = (IDM_VIEW + 44),
- IDM_VIEW_DOCCHANGEMARGIN = (IDM_VIEW + 45),
- IDM_VIEW_LWDEF = (IDM_VIEW + 46),
- IDM_VIEW_LWALIGN = (IDM_VIEW + 47),
- IDM_VIEW_LWINDENT = (IDM_VIEW + 48),
- IDM_VIEW_SUMMARY = (IDM_VIEW + 49),
-
- IDM_VIEW_FOLD = (IDM_VIEW + 50),
- IDM_VIEW_FOLD_1 = (IDM_VIEW_FOLD + 1),
- IDM_VIEW_FOLD_2 = (IDM_VIEW_FOLD + 2),
- IDM_VIEW_FOLD_3 = (IDM_VIEW_FOLD + 3),
- IDM_VIEW_FOLD_4 = (IDM_VIEW_FOLD + 4),
- IDM_VIEW_FOLD_5 = (IDM_VIEW_FOLD + 5),
- IDM_VIEW_FOLD_6 = (IDM_VIEW_FOLD + 6),
- IDM_VIEW_FOLD_7 = (IDM_VIEW_FOLD + 7),
- IDM_VIEW_FOLD_8 = (IDM_VIEW_FOLD + 8),
-
- IDM_VIEW_UNFOLD = (IDM_VIEW + 60),
- IDM_VIEW_UNFOLD_1 = (IDM_VIEW_UNFOLD + 1),
- IDM_VIEW_UNFOLD_2 = (IDM_VIEW_UNFOLD + 2),
- IDM_VIEW_UNFOLD_3 = (IDM_VIEW_UNFOLD + 3),
- IDM_VIEW_UNFOLD_4 = (IDM_VIEW_UNFOLD + 4),
- IDM_VIEW_UNFOLD_5 = (IDM_VIEW_UNFOLD + 5),
- IDM_VIEW_UNFOLD_6 = (IDM_VIEW_UNFOLD + 6),
- IDM_VIEW_UNFOLD_7 = (IDM_VIEW_UNFOLD + 7),
- IDM_VIEW_UNFOLD_8 = (IDM_VIEW_UNFOLD + 8),
-
- IDM_VIEW_GOTO_ANOTHER_VIEW = 10001,
- IDM_VIEW_CLONE_TO_ANOTHER_VIEW = 10002,
- IDM_VIEW_GOTO_NEW_INSTANCE = 10003,
- IDM_VIEW_LOAD_IN_NEW_INSTANCE = 10004,
-
- IDM_VIEW_SWITCHTO_OTHER_VIEW = (IDM_VIEW + 72),
-
- IDM_FORMAT = (IDM + 5000),
- IDM_FORMAT_TODOS = (IDM_FORMAT + 1),
- IDM_FORMAT_TOUNIX = (IDM_FORMAT + 2),
- IDM_FORMAT_TOMAC = (IDM_FORMAT + 3),
- IDM_FORMAT_ANSI = (IDM_FORMAT + 4),
- IDM_FORMAT_UTF_8 = (IDM_FORMAT + 5),
- IDM_FORMAT_UCS_2BE = (IDM_FORMAT + 6),
- IDM_FORMAT_UCS_2LE = (IDM_FORMAT + 7),
- IDM_FORMAT_AS_UTF_8 = (IDM_FORMAT + 8),
- IDM_FORMAT_CONV2_ANSI = (IDM_FORMAT + 9),
- IDM_FORMAT_CONV2_AS_UTF_8 = (IDM_FORMAT + 10),
- IDM_FORMAT_CONV2_UTF_8 = (IDM_FORMAT + 11),
- IDM_FORMAT_CONV2_UCS_2BE = (IDM_FORMAT + 12),
- IDM_FORMAT_CONV2_UCS_2LE = (IDM_FORMAT + 13),
-
- IDM_FORMAT_ENCODE = (IDM_FORMAT + 20),
- IDM_FORMAT_WIN_1250 = (IDM_FORMAT_ENCODE + 0),
- IDM_FORMAT_WIN_1251 = (IDM_FORMAT_ENCODE + 1),
- IDM_FORMAT_WIN_1252 = (IDM_FORMAT_ENCODE + 2),
- IDM_FORMAT_WIN_1253 = (IDM_FORMAT_ENCODE + 3),
- IDM_FORMAT_WIN_1254 = (IDM_FORMAT_ENCODE + 4),
- IDM_FORMAT_WIN_1255 = (IDM_FORMAT_ENCODE + 5),
- IDM_FORMAT_WIN_1256 = (IDM_FORMAT_ENCODE + 6),
- IDM_FORMAT_WIN_1257 = (IDM_FORMAT_ENCODE + 7),
- IDM_FORMAT_WIN_1258 = (IDM_FORMAT_ENCODE + 8),
- IDM_FORMAT_ISO_8859_1 = (IDM_FORMAT_ENCODE + 9),
- IDM_FORMAT_ISO_8859_2 = (IDM_FORMAT_ENCODE + 10),
- IDM_FORMAT_ISO_8859_3 = (IDM_FORMAT_ENCODE + 11),
- IDM_FORMAT_ISO_8859_4 = (IDM_FORMAT_ENCODE + 12),
- IDM_FORMAT_ISO_8859_5 = (IDM_FORMAT_ENCODE + 13),
- IDM_FORMAT_ISO_8859_6 = (IDM_FORMAT_ENCODE + 14),
- IDM_FORMAT_ISO_8859_7 = (IDM_FORMAT_ENCODE + 15),
- IDM_FORMAT_ISO_8859_8 = (IDM_FORMAT_ENCODE + 16),
- IDM_FORMAT_ISO_8859_9 = (IDM_FORMAT_ENCODE + 17),
- IDM_FORMAT_ISO_8859_10 = (IDM_FORMAT_ENCODE + 18),
- IDM_FORMAT_ISO_8859_11 = (IDM_FORMAT_ENCODE + 19),
- IDM_FORMAT_ISO_8859_13 = (IDM_FORMAT_ENCODE + 20),
- IDM_FORMAT_ISO_8859_14 = (IDM_FORMAT_ENCODE + 21),
- IDM_FORMAT_ISO_8859_15 = (IDM_FORMAT_ENCODE + 22),
- IDM_FORMAT_ISO_8859_16 = (IDM_FORMAT_ENCODE + 23),
- IDM_FORMAT_DOS_437 = (IDM_FORMAT_ENCODE + 24),
- IDM_FORMAT_DOS_720 = (IDM_FORMAT_ENCODE + 25),
- IDM_FORMAT_DOS_737 = (IDM_FORMAT_ENCODE + 26),
- IDM_FORMAT_DOS_775 = (IDM_FORMAT_ENCODE + 27),
- IDM_FORMAT_DOS_850 = (IDM_FORMAT_ENCODE + 28),
- IDM_FORMAT_DOS_852 = (IDM_FORMAT_ENCODE + 29),
- IDM_FORMAT_DOS_855 = (IDM_FORMAT_ENCODE + 30),
- IDM_FORMAT_DOS_857 = (IDM_FORMAT_ENCODE + 31),
- IDM_FORMAT_DOS_858 = (IDM_FORMAT_ENCODE + 32),
- IDM_FORMAT_DOS_860 = (IDM_FORMAT_ENCODE + 33),
- IDM_FORMAT_DOS_861 = (IDM_FORMAT_ENCODE + 34),
- IDM_FORMAT_DOS_862 = (IDM_FORMAT_ENCODE + 35),
- IDM_FORMAT_DOS_863 = (IDM_FORMAT_ENCODE + 36),
- IDM_FORMAT_DOS_865 = (IDM_FORMAT_ENCODE + 37),
- IDM_FORMAT_DOS_866 = (IDM_FORMAT_ENCODE + 38),
- IDM_FORMAT_DOS_869 = (IDM_FORMAT_ENCODE + 39),
- IDM_FORMAT_BIG5 = (IDM_FORMAT_ENCODE + 40),
- IDM_FORMAT_GB2312 = (IDM_FORMAT_ENCODE + 41),
- IDM_FORMAT_SHIFT_JIS = (IDM_FORMAT_ENCODE + 42),
- IDM_FORMAT_KOREAN_WIN = (IDM_FORMAT_ENCODE + 43),
- IDM_FORMAT_EUC_KR = (IDM_FORMAT_ENCODE + 44),
- IDM_FORMAT_TIS_620 = (IDM_FORMAT_ENCODE + 45),
- IDM_FORMAT_MAC_CYRILLIC = (IDM_FORMAT_ENCODE + 46),
- IDM_FORMAT_KOI8U_CYRILLIC = (IDM_FORMAT_ENCODE + 47),
- IDM_FORMAT_KOI8R_CYRILLIC = (IDM_FORMAT_ENCODE + 48),
- IDM_FORMAT_ENCODE_END = IDM_FORMAT_KOI8R_CYRILLIC,
-
- //#define IDM_FORMAT_CONVERT 200
-
- IDM_LANG = (IDM + 6000),
- IDM_LANGSTYLE_CONFIG_DLG = (IDM_LANG + 1),
- IDM_LANG_C = (IDM_LANG + 2),
- IDM_LANG_CPP = (IDM_LANG + 3),
- IDM_LANG_JAVA = (IDM_LANG + 4),
- IDM_LANG_HTML = (IDM_LANG + 5),
- IDM_LANG_XML = (IDM_LANG + 6),
- IDM_LANG_JS = (IDM_LANG + 7),
- IDM_LANG_PHP = (IDM_LANG + 8),
- IDM_LANG_ASP = (IDM_LANG + 9),
- IDM_LANG_CSS = (IDM_LANG + 10),
- IDM_LANG_PASCAL = (IDM_LANG + 11),
- IDM_LANG_PYTHON = (IDM_LANG + 12),
- IDM_LANG_PERL = (IDM_LANG + 13),
- IDM_LANG_OBJC = (IDM_LANG + 14),
- IDM_LANG_ASCII = (IDM_LANG + 15),
- IDM_LANG_TEXT = (IDM_LANG + 16),
- IDM_LANG_RC = (IDM_LANG + 17),
- IDM_LANG_MAKEFILE = (IDM_LANG + 18),
- IDM_LANG_INI = (IDM_LANG + 19),
- IDM_LANG_SQL = (IDM_LANG + 20),
- IDM_LANG_VB = (IDM_LANG + 21),
- IDM_LANG_BATCH = (IDM_LANG + 22),
- IDM_LANG_CS = (IDM_LANG + 23),
- IDM_LANG_LUA = (IDM_LANG + 24),
- IDM_LANG_TEX = (IDM_LANG + 25),
- IDM_LANG_FORTRAN = (IDM_LANG + 26),
- IDM_LANG_BASH = (IDM_LANG + 27),
- IDM_LANG_FLASH = (IDM_LANG + 28),
- IDM_LANG_NSIS = (IDM_LANG + 29),
- IDM_LANG_TCL = (IDM_LANG + 30),
- IDM_LANG_LISP = (IDM_LANG + 31),
- IDM_LANG_SCHEME = (IDM_LANG + 32),
- IDM_LANG_ASM = (IDM_LANG + 33),
- IDM_LANG_DIFF = (IDM_LANG + 34),
- IDM_LANG_PROPS = (IDM_LANG + 35),
- IDM_LANG_PS = (IDM_LANG + 36),
- IDM_LANG_RUBY = (IDM_LANG + 37),
- IDM_LANG_SMALLTALK = (IDM_LANG + 38),
- IDM_LANG_VHDL = (IDM_LANG + 39),
- IDM_LANG_CAML = (IDM_LANG + 40),
- IDM_LANG_KIX = (IDM_LANG + 41),
- IDM_LANG_ADA = (IDM_LANG + 42),
- IDM_LANG_VERILOG = (IDM_LANG + 43),
- IDM_LANG_AU3 = (IDM_LANG + 44),
- IDM_LANG_MATLAB = (IDM_LANG + 45),
- IDM_LANG_HASKELL = (IDM_LANG + 46),
- IDM_LANG_INNO = (IDM_LANG + 47),
- IDM_LANG_CMAKE = (IDM_LANG + 48),
- IDM_LANG_YAML = (IDM_LANG + 49),
- IDM_LANG_COBOL = (IDM_LANG + 50),
- IDM_LANG_D = (IDM_LANG + 51),
- IDM_LANG_GUI4CLI = (IDM_LANG + 52),
- IDM_LANG_POWERSHELL = (IDM_LANG + 53),
- IDM_LANG_R = (IDM_LANG + 54),
- IDM_LANG_JSP = (IDM_LANG + 55),
- IDM_LANG_EXTERNAL = (IDM_LANG + 65),
- IDM_LANG_EXTERNAL_LIMIT = (IDM_LANG + 79),
- IDM_LANG_USER = (IDM_LANG + 80), //46080
- IDM_LANG_USER_LIMIT = (IDM_LANG + 110), //46110
-
- IDM_ABOUT = (IDM + 7000),
- IDM_HOMESWEETHOME = (IDM_ABOUT + 1),
- IDM_PROJECTPAGE = (IDM_ABOUT + 2),
- IDM_ONLINEHELP = (IDM_ABOUT + 3),
- IDM_FORUM = (IDM_ABOUT + 4),
- IDM_PLUGINSHOME = (IDM_ABOUT + 5),
- IDM_UPDATE_NPP = (IDM_ABOUT + 6),
- IDM_WIKIFAQ = (IDM_ABOUT + 7),
- IDM_HELP = (IDM_ABOUT + 8),
-
- IDM_SETTING = (IDM + 8000),
- IDM_SETTING_TAB_SIZE = (IDM_SETTING + 1),
- IDM_SETTING_TAB_REPLCESPACE = (IDM_SETTING + 2),
- IDM_SETTING_HISTORY_SIZE = (IDM_SETTING + 3),
- IDM_SETTING_EDGE_SIZE = (IDM_SETTING + 4),
- IDM_SETTING_IMPORTPLUGIN = (IDM_SETTING + 5),
- IDM_SETTING_IMPORTSTYLETHEMS = (IDM_SETTING + 6),
- IDM_SETTING_TRAYICON = (IDM_SETTING + 8),
- IDM_SETTING_SHORTCUT_MAPPER = (IDM_SETTING + 9),
- IDM_SETTING_REMEMBER_LAST_SESSION = (IDM_SETTING + 10),
- IDM_SETTING_PREFERECE = (IDM_SETTING + 11),
- IDM_SETTING_AUTOCNBCHAR = (IDM_SETTING + 15),
- IDM_SETTING_SHORTCUT_MAPPER_MACRO = (IDM_SETTING + 16),
- IDM_SETTING_SHORTCUT_MAPPER_RUN = (IDM_SETTING + 17),
- IDM_SETTING_EDITCONTEXTMENU = (IDM_SETTING + 18),
-
- IDM_EXECUTE = (IDM + 9000),
-
- IDM_SYSTRAYPOPUP = (IDM + 3100),
- IDM_SYSTRAYPOPUP_ACTIVATE = (IDM_SYSTRAYPOPUP + 1),
- IDM_SYSTRAYPOPUP_NEWDOC = (IDM_SYSTRAYPOPUP + 2),
- IDM_SYSTRAYPOPUP_NEW_AND_PASTE = (IDM_SYSTRAYPOPUP + 3),
- IDM_SYSTRAYPOPUP_OPENFILE = (IDM_SYSTRAYPOPUP + 4),
- IDM_SYSTRAYPOPUP_CLOSE = (IDM_SYSTRAYPOPUP + 5)
- }
-}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/Msgs_h.cs b/CSharpRegexTools4Npp/PluginInfrastructure/Msgs_h.cs
index 97ffea4..3b77d71 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/Msgs_h.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/Msgs_h.cs
@@ -9,7 +9,7 @@
namespace CSharpRegexTools4Npp.PluginInfrastructure
{
- public class Constants
+ class Constants
{
public const int WM_USER = 0x400;
public const int NPPMSG = WM_USER + 1000;
@@ -24,14 +24,16 @@ public enum LangType
L_ASM, L_DIFF, L_PROPS, L_PS, L_RUBY, L_SMALLTALK, L_VHDL, L_KIX, L_AU3,
L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO, L_SEARCHRESULT,
L_CMAKE, L_YAML, L_COBOL, L_GUI4CLI, L_D, L_POWERSHELL, L_R, L_JSP,
- L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77,
+ L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77, L_BAANC, L_SREC,
+ L_IHEX, L_TEHEX, L_SWIFT,
+ L_ASN1, L_AVS, L_BLITZBASIC, L_PUREBASIC, L_FREEBASIC,
+ L_CSOUND, L_ERLANG, L_ESCRIPT, L_FORTH, L_LATEX,
+ L_MMIXAL, L_NIM, L_NNCRONTAB, L_OSCRIPT, L_REBOL,
+ L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VISUALPROLOG,
+ L_TYPESCRIPT, L_JSON5, L_MSSQL, L_GDSCRIPT, L_HOLLYWOOD,
// Don't use L_JS, use L_JAVASCRIPT instead
// The end of enumated language type, so it should be always at the end
- L_EXTERNAL,
- L_SRECORD, L_INTELHEX, L_TEKTRONIXEXTENDEDHEX, L_SWIFT, L_ASN1, L_AVISYNTH,
- L_BLITZBASIC, L_PUREBASIC, L_FREEBASIC, L_CSOUND, L_ERLANG, L_ESCRIPT,
- L_FORTH, L_LATEX, L_MMIXAL, L_NIMROD, L_NNCRONTAB, L_OSCRIPT, L_REBOL,
- L_REGISTRY, L_RUST, L_SPICE, L_TXT2TAGS, L_VPROLOG,
+ L_EXTERNAL
}
[Flags]
@@ -49,7 +51,6 @@ public enum NppMsg : uint
ALL_OPEN_FILES = 0,
PRIMARY_VIEW = 1,
SECOND_VIEW = 2,
-
NPPM_GETOPENFILENAMES = Constants.NPPMSG + 8,
NPPM_MODELESSDIALOG = Constants.NPPMSG + 12,
@@ -80,12 +81,12 @@ public enum NppMsg : uint
STATUSBAR_UNICODE_TYPE = 4,
STATUSBAR_TYPING_MODE = 5,
- NPPM_GETMENUHANDLE = Constants.NPPMSG + 25,
- NPPPLUGINMENU = 0,
///
- /// INT NPPM_GETMENUHANDLE(INT menuChoice, 0)
- /// Return: menu handle (HMENU) of choice (plugin menu handle or Notepad++ main menu handle)
+ /// INT NPPM_GETMENUHANDLE(INT menuChoice, 0)
+ /// Return: menu handle (HMENU) of choice (plugin menu handle () or Notepad++ main menu handle ())
///
+ NPPM_GETMENUHANDLE = Constants.NPPMSG + 25,
+ NPPPLUGINMENU = 0,
NPPMAINMENU = 1,
///
@@ -195,7 +196,11 @@ public enum NppMsg : uint
NPPM_GETENABLETHEMETEXTUREFUNC = Constants.NPPMSG + 45,
///
- ///void NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str)
+ ///INT NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str)
+ /// Get user's plugin config directory path. It's useful if plugins want to save/load parameters for the current user
+ /// Returns the number of TCHAR copied/to copy.
+ /// Users should call it with "str" be NULL to get the required number of TCHAR (not including the terminating nul character),
+ /// allocate "str" buffer with the return value + 1, then call it again to get the path.
///
NPPM_GETPLUGINSCONFIGDIR = Constants.NPPMSG + 46,
@@ -243,7 +248,7 @@ public enum NppMsg : uint
NPPM_ISTABBARHIDDEN = Constants.NPPMSG + 52,
///
- /// INT NPPM_GETPOSFROMBUFFERID(INT bufferID, INT priorityView)
+ /// INT NPPM_GETPOSFROMBUFFERID(UINT_PTR bufferID, INT priorityView)
/// Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing
/// if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly
///
@@ -255,11 +260,11 @@ public enum NppMsg : uint
NPPM_GETPOSFROMBUFFERID = Constants.NPPMSG + 57,
///
- /// INT NPPM_GETFULLPATHFROMBUFFERID(INT bufferID, TCHAR *fullFilePath)
+ /// INT NPPM_GETFULLPATHFROMBUFFERID(UINT_PTR bufferID, TCHAR *fullFilePath)
/// Get full path file name from a bufferID.
/// Return -1 if the bufferID non existing, otherwise the number of TCHAR copied/to copy
/// User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character),
- /// allocate fullFilePath with the return values + 1, then call it again to get full path file name
+ /// allocate fullFilePath with the return values + 1, then call it again to get full path file name
///
NPPM_GETFULLPATHFROMBUFFERID = Constants.NPPMSG + 58,
@@ -278,7 +283,7 @@ public enum NppMsg : uint
NPPM_GETCURRENTBUFFERID = Constants.NPPMSG + 60,
///
- /// VOID NPPM_RELOADBUFFERID(0, 0)
+ /// VOID NPPM_RELOADBUFFERID(UINT_PTR bufferID, BOOL alert)
/// Reloads Buffer
/// wParam: Buffer to reload
/// lParam: 0 if no alert, else alert
@@ -286,7 +291,7 @@ public enum NppMsg : uint
NPPM_RELOADBUFFERID = Constants.NPPMSG + 61,
///
- /// INT NPPM_GETBUFFERLANGTYPE(INT bufferID, 0)
+ /// INT NPPM_GETBUFFERLANGTYPE(UINT_PTR bufferID, 0)
/// wParam: BufferID to get LangType from
/// lParam: 0
/// Returns as int, see LangType. -1 on error
@@ -294,7 +299,7 @@ public enum NppMsg : uint
NPPM_GETBUFFERLANGTYPE = Constants.NPPMSG + 64,
///
- /// BOOL NPPM_SETBUFFERLANGTYPE(INT bufferID, INT langType)
+ /// BOOL NPPM_SETBUFFERLANGTYPE(UINT_PTR bufferID, INT langType)
/// wParam: BufferID to set LangType of
/// lParam: LangType
/// Returns TRUE on success, FALSE otherwise
@@ -304,7 +309,7 @@ public enum NppMsg : uint
NPPM_SETBUFFERLANGTYPE = Constants.NPPMSG + 65,
///
- /// INT NPPM_GETBUFFERENCODING(INT bufferID, 0)
+ /// INT NPPM_GETBUFFERENCODING(UINT_PTR bufferID, 0)
/// wParam: BufferID to get encoding from
/// lParam: 0
/// returns as int, see UniMode. -1 on error
@@ -312,7 +317,7 @@ public enum NppMsg : uint
NPPM_GETBUFFERENCODING = Constants.NPPMSG + 66,
///
- /// BOOL NPPM_SETBUFFERENCODING(INT bufferID, INT encoding)
+ /// BOOL NPPM_SETBUFFERENCODING(UINT_PTR bufferID, INT encoding)
/// wParam: BufferID to set encoding of
/// lParam: encoding
/// Returns TRUE on success, FALSE otherwise
@@ -322,40 +327,22 @@ public enum NppMsg : uint
NPPM_SETBUFFERENCODING = Constants.NPPMSG + 67,
///
- /// INT NPPM_GETBUFFERFORMAT(INT bufferID, 0)
- /// wParam: BufferID to get format from
+ /// INT NPPM_GETBUFFERFORMAT(UINT_PTR bufferID, 0)
+ /// wParam: BufferID to get EolType format from
/// lParam: 0
- /// returns as int, see formatType. -1 on error
+ /// returns as int, see EolType format. -1 on error
///
NPPM_GETBUFFERFORMAT = Constants.NPPMSG + 68,
///
- /// BOOL NPPM_SETBUFFERFORMAT(INT bufferID, INT format)
- /// wParam: BufferID to set format of
+ /// BOOL NPPM_SETBUFFERFORMAT(UINT_PTR bufferID, INT format)
+ /// wParam: BufferID to set EolType format of
/// lParam: format
/// Returns TRUE on success, FALSE otherwise
- /// use int, see formatType
+ /// use int, see EolType format
///
NPPM_SETBUFFERFORMAT = Constants.NPPMSG + 69,
- ///
- /// BOOL NPPM_ADDREBAR(0, REBARBANDINFO *)
- /// Returns assigned ID in wID value of struct pointer
- ///
- NPPM_ADDREBAR = Constants.NPPMSG + 57,
-
- ///
- /// BOOL NPPM_ADDREBAR(INT ID, REBARBANDINFO *)
- ///Use ID assigned with NPPM_ADDREBAR
- ///
- NPPM_UPDATEREBAR = Constants.NPPMSG + 58,
-
- ///
- /// BOOL NPPM_ADDREBAR(INT ID, 0)
- ///Use ID assigned with NPPM_ADDREBAR
- ///
- NPPM_REMOVEREBAR = Constants.NPPMSG + 59,
-
///
/// BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot)
/// if hideOrNot is set as TRUE then tool bar will be hidden
@@ -402,7 +389,7 @@ public enum NppMsg : uint
/// BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey *sk)
/// get your plugin command current mapped shortcut into sk via cmdID
/// You may need it after getting NPPN_READY notification
- /// returned value : TRUE if this function call is successful and shorcut is enable, otherwise FALSE
+ /// returned value : TRUE if this function call is successful and shortcut is enable, otherwise FALSE
///
NPPM_GETSHORTCUTBYCMDID = Constants.NPPMSG + 76,
@@ -420,7 +407,7 @@ public enum NppMsg : uint
///
/// INT NPPM_GETCURRENTNATIVELANGENCODING(0, 0)
- /// returned value : the current native language enconding
+ /// returned value : the current native language encoding
///
NPPM_GETCURRENTNATIVELANGENCODING = Constants.NPPMSG + 79,
@@ -447,7 +434,7 @@ public enum NppMsg : uint
///
/// INT NPPM_GETLANGUAGENAME(int langType, TCHAR *langName)
- /// Get programing language name from the given language type (LangType)
+ /// Get programming language name from the given language type (LangType)
/// Return value is the number of copied character / number of character to copy (\0 is not included)
/// You should call this function 2 times - the first time you pass langName as NULL to get the number of characters to copy.
/// You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGENAME function the 2nd time
@@ -457,7 +444,7 @@ public enum NppMsg : uint
///
/// INT NPPM_GETLANGUAGEDESC(int langType, TCHAR *langDesc)
- /// Get programing language short description from the given language type (LangType)
+ /// Get programming language short description from the given language type (LangType)
/// Return value is the number of copied character / number of character to copy (\0 is not included)
/// You should call this function 2 times - the first time you pass langDesc as NULL to get the number of characters to copy.
/// You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time
@@ -466,7 +453,7 @@ public enum NppMsg : uint
NPPM_GETLANGUAGEDESC = Constants.NPPMSG + 84,
///
- /// VOID NPPM_ISDOCSWITCHERSHOWN(0, BOOL toShowOrNot)
+ /// VOID NPPM_SHOWDOCSWITCHER(0, BOOL toShowOrNot)
/// Send this message to show or hide doc switcher.
/// if toShowOrNot is TRUE then show doc switcher, otherwise hide it.
///
@@ -480,7 +467,7 @@ public enum NppMsg : uint
///
/// BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0)
- /// Check to see if loading plugins from "%APPDATA%\Notepad++\plugins" is allowed.
+ /// Check to see if loading plugins from "%APPDATA%\..\Local\Notepad++\plugins" is allowed.
///
NPPM_GETAPPDATAPLUGINSALLOWED = Constants.NPPMSG + 87,
@@ -523,6 +510,88 @@ public enum NppMsg : uint
///
NPPM_SAVEFILE = Constants.NPPMSG + 94,
+ ///
+ /// VOID NPPM_DISABLEAUTOUPDATE(0, 0)
+ ///
+ NPPM_DISABLEAUTOUPDATE = Constants.NPPMSG + 95,
+
+ ///
+ /// BOOL NPPM_REMOVESHORTCUTASSIGNMENT(int cmdID)
+ /// removes the assigned shortcut mapped to cmdID
+ /// returned value : TRUE if function call is successful, otherwise FALSE
+ ///
+ NPPM_REMOVESHORTCUTBYCMDID = Constants.NPPMSG + 96,
+
+ ///
+ /// INT NPPM_GETPLUGINHOMEPATH(size_t strLen, TCHAR *pluginRootPath)
+ /// Get plugin home root path. It's useful if plugins want to get its own path
+ /// by appending which is the name of plugin without extension part.
+ /// Returns the number of TCHAR copied/to copy.
+ /// Users should call it with pluginRootPath be NULL to get the required number of TCHAR (not including the terminating nul character),
+ /// allocate pluginRootPath buffer with the return value + 1, then call it again to get the path.
+ ///
+ NPPM_GETPLUGINHOMEPATH = Constants.NPPMSG + 97,
+
+ ///
+ /// INT NPPM_GETSETTINGSCLOUDPATH(size_t strLen, TCHAR *settingsOnCloudPath)
+ /// Get settings on cloud path. It's useful if plugins want to store its settings on Cloud, if this path is set.
+ /// Returns the number of TCHAR copied/to copy. If the return value is 0, then this path is not set, or the "strLen" is not enough to copy the path.
+ /// Users should call it with settingsCloudPath be NULL to get the required number of TCHAR (not including the terminating nul character),
+ /// allocate settingsCloudPath buffer with the return value + 1, then call it again to get the path.
+ ///
+ NPPM_GETSETTINGSONCLOUDPATH = Constants.NPPMSG + 98,
+
+ ///
+ /// BOOL NPPM_SETLINENUMBERWIDTHMODE(0, INT widthMode)
+ /// Set line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT)
+ /// It may help some plugins to disable non-dynamic line number margins width to have a smoothly visual effect while vertical scrolling the content in Notepad++
+ /// If calling is successful return TRUE, otherwise return FALSE.
+ ///
+ NPPM_SETLINENUMBERWIDTHMODE = Constants.NPPMSG + 99,
+ LINENUMWIDTH_DYNAMIC = 0,
+ LINENUMWIDTH_CONSTANT = 1,
+
+ ///
+ /// INT NPPM_GETLINENUMBERWIDTHMODE(0, 0)
+ /// Get line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT)
+ ///
+ NPPM_GETLINENUMBERWIDTHMODE = Constants.NPPMSG + 100,
+
+ ///
+ /// VOID NPPM_ADDTOOLBARICON_FORDARKMODE(UINT funcItem[X]._cmdID, toolbarIconsWithDarkMode iconHandles)
+ /// Use NPPM_ADDTOOLBARICON_FORDARKMODE instead obsolete NPPM_ADDTOOLBARICON which doesn't support the dark mode
+ /// 2 formats / 3 icons are needed: 1 * BMP + 2 * ICO
+ /// All 3 handles below should be set so the icon will be displayed correctly if toolbar icon sets are changed by users, also in dark mode
+ ///
+ NPPM_ADDTOOLBARICON_FORDARKMODE = Constants.NPPMSG + 101,
+
+ // BOOL NPPM_ALLOCATEINDICATOR(int numberRequested, int* startNumber)
+ // Allocates an indicator number to a plugin: if a plugin needs to add an indicator,
+ // it has to use this message to get the indicator number, in order to prevent a conflict with the other plugins.
+ // wParam[in]: numberRequested is the number of ID you request for the reservation
+ // lParam[out]: startNumber will be set to the initial command ID if successful
+ // Return TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful
+ //
+ // Example: If a plugin needs 1 indicator ID, the following code can be used :
+ //
+ // int idBegin;
+ // BOOL isAllocatedSuccessful = ::SendMessage(nppData._nppHandle, NPPM_ALLOCATEINDICATOR, 1, &idBegin);
+ //
+ // if isAllocatedSuccessful is TRUE, and value of idBegin is 7
+ // then indicator ID 7 is preserved by Notepad++, and it is safe to be used by the plugin.
+ NPPM_ALLOCATEINDICATOR = Constants.NPPMSG + 113,
+
+ ///
+ /// int NPPM_GETNATIVELANGFILENAME(size_t strLen, char* nativeLangFileName)
+ /// Get the Current native language file name string.
+ /// Users should call it with nativeLangFileName as NULL to get the required number of char (not including the terminating nul character),
+ /// allocate commandLineStr buffer with the return value + 1, then call it again to get the current native language file name string.
+ /// wParam[in]: strLen is "commandLineStr" buffer length
+ /// lParam[out]: commandLineStr recieves all copied native language file name string
+ /// Return the number of char copied/to copy
+ ///
+ NPPM_GETNATIVELANGFILENAME = Constants.NPPMSG + 116,
+
RUNCOMMAND_USER = Constants.WM_USER + 3000,
NPPM_GETFULLCURRENTPATH = RUNCOMMAND_USER + FULL_CURRENT_PATH,
NPPM_GETCURRENTDIRECTORY = RUNCOMMAND_USER + CURRENT_DIRECTORY,
@@ -530,6 +599,7 @@ public enum NppMsg : uint
NPPM_GETNAMEPART = RUNCOMMAND_USER + NAME_PART,
NPPM_GETEXTPART = RUNCOMMAND_USER + EXT_PART,
NPPM_GETCURRENTWORD = RUNCOMMAND_USER + CURRENT_WORD,
+ NPPM_GETNPPDIRECTORY = RUNCOMMAND_USER + NPP_DIRECTORY,
///
/// BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str)
/// where str is the allocated TCHAR array,
@@ -537,7 +607,7 @@ public enum NppMsg : uint
/// The return value is TRUE when get generic_string operation success
/// Otherwise (allocated array size is too small) FALSE
///
- NPPM_GETNPPDIRECTORY = RUNCOMMAND_USER + NPP_DIRECTORY,
+ NPPM_GETFILENAMEATCURSOR = RUNCOMMAND_USER + GETFILENAMEATCURSOR,
///
/// INT NPPM_GETCURRENTLINE(0, 0)
@@ -551,6 +621,8 @@ public enum NppMsg : uint
///
NPPM_GETCURRENTCOLUMN = RUNCOMMAND_USER + CURRENT_COLUMN,
+ NPPM_GETNPPFULLFILEPATH = RUNCOMMAND_USER + NPP_FULL_FILE_PATH,
+
VAR_NOT_RECOGNIZED = 0,
FULL_CURRENT_PATH = 1,
CURRENT_DIRECTORY = 2,
@@ -561,6 +633,8 @@ public enum NppMsg : uint
NPP_DIRECTORY = 7,
CURRENT_LINE = 8,
CURRENT_COLUMN = 9,
+ NPP_FULL_FILE_PATH = 10,
+ GETFILENAMEATCURSOR = 11,
///
/// To notify plugins that all the procedures of launchment of notepad++ are done.
@@ -686,12 +760,12 @@ public enum NppMsg : uint
///scnNotification->nmhdr.hwndFrom = bufferID;
///scnNotification->nmhdr.idFrom = docStatus;
/// where bufferID is BufferID
- /// docStatus can be combined by DOCSTAUS_READONLY and DOCSTAUS_BUFFERDIRTY
+ /// docStatus can be combined by DOCSTATUS_READONLY and DOCSTATUS_BUFFERDIRTY
///
NPPN_READONLYCHANGED = NPPN_FIRST + 16,
- DOCSTAUS_READONLY = 1,
- DOCSTAUS_BUFFERDIRTY = 2,
+ DOCSTATUS_READONLY = 1,
+ DOCSTATUS_BUFFERDIRTY = 2,
///
///scnNotification->nmhdr.code = NPPN_DOCORDERCHANGED;
@@ -763,6 +837,62 @@ public enum NppMsg : uint
///
NPPN_FILEDELETED = NPPN_FIRST + 26,
+ ///
+ /// To notify plugins that Dark Mode was enabled/disabled
+ /// scnNotification->nmhdr.code = NPPN_DARKMODECHANGED;
+ /// scnNotification->nmhdr.hwndFrom = hwndNpp;
+ /// scnNotification->nmhdr.idFrom = 0;
+ ///
+ NPPN_DARKMODECHANGED = NPPN_FIRST + 27,
+
+ ///
+ /// To notify plugins that the new argument for plugins (via '-pluginMessage="YOUR_PLUGIN_ARGUMENT"' in command line) is available
+ /// scnNotification->nmhdr.code = NPPN_CMDLINEPLUGINMSG;
+ /// scnNotification->nmhdr.hwndFrom = hwndNpp;
+ /// scnNotification->nmhdr.idFrom = pluginMessage; //where pluginMessage is pointer of type wchar_t
+ ///
+ NPPN_CMDLINEPLUGINMSG = NPPN_FIRST + 28,
+
+ ///
+ /// To notify lexer plugins that the buffer (in idFrom) is just applied to a external lexer
+ /// scnNotification->nmhdr.code = NPPN_EXTERNALLEXERBUFFER;
+ /// scnNotification->nmhdr.hwndFrom = hwndNpp;
+ /// scnNotification->nmhdr.idFrom = BufferID; //where pluginMessage is pointer of type wchar_t
+ ///
+ NPPN_EXTERNALLEXERBUFFER = NPPN_FIRST + 29,
+
+ ///
+ /// To notify plugins that the current document is just modified by Replace All action.
+ /// For solving the performance issue (from v8.6.4), Notepad++ doesn't trigger SCN_MODIFIED during Replace All action anymore.
+ /// As a result, the plugins which monitor SCN_MODIFIED should also monitor NPPN_GLOBALMODIFIED.
+ /// This notification is implemented in Notepad++ v8.6.5.
+ /// scnNotification->nmhdr.code = NPPN_GLOBALMODIFIED;
+ /// scnNotification->nmhdr.hwndFrom = BufferID;
+ /// scnNotifiNATIVELANGCHANGEDcation->nmhdr.idFrom = 0; // preserved for the future use, must be zero
+ ///
+ NPPN_GLOBALMODIFIED = NPPN_FIRST + 30,
+
+
+ ///
+ /// To notify plugins that the current native language is just changed to another one.
+ /// Use NPPM_GETNATIVELANGFILENAME to get current native language file name.
+ /// Use NPPM_GETMENUHANDLE(NPPPLUGINMENU, 0) to get submenu "Plugins" handle (HMENU)
+ /// scnNotification->nmhdr.code = NPPN_NATIVELANGCHANGED;
+ /// scnNotification->nmhdr.hwndFrom = hwndNpp
+ /// scnNotification->nmhdr.idFrom = 0; // preserved for the future use, must be zero
+ ///
+ NPPN_NATIVELANGCHANGED = NPPN_FIRST + 31,
+
/* --Autogenerated -- end of section automatically generated from notepad-plus-plus\PowerEditor\src\MISC\PluginsManager\Notepad_plus_msgs.h * */
}
+
+ public enum StatusBarSection
+ {
+ DocType,
+ DocSize,
+ CurPos,
+ EofFormat,
+ UnicodeType,
+ TypingMode,
+ }
}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/Msgs_h.cs.bak b/CSharpRegexTools4Npp/PluginInfrastructure/Msgs_h.cs.bak
deleted file mode 100644
index 0f310de..0000000
--- a/CSharpRegexTools4Npp/PluginInfrastructure/Msgs_h.cs.bak
+++ /dev/null
@@ -1,764 +0,0 @@
-// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
-//
-// This file should stay in sync with the CPP project file
-// "notepad-plus-plus/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h"
-// found at
-// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h
-
-using System;
-
-namespace CSharpRegexTools4Npp.PluginInfrastructure
-{
- public class Constants
- {
- public const int WM_USER = 0x400;
- public const int NPPMSG = WM_USER + 1000;
- }
-
- public enum LangType
- {
- L_TEXT, L_PHP, L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,
- L_HTML, L_XML, L_MAKEFILE, L_PASCAL, L_BATCH, L_INI, L_ASCII, L_USER,
- L_ASP, L_SQL, L_VB, L_JS, L_CSS, L_PERL, L_PYTHON, L_LUA,
- L_TEX, L_FORTRAN, L_BASH, L_FLASH, L_NSIS, L_TCL, L_LISP, L_SCHEME,
- L_ASM, L_DIFF, L_PROPS, L_PS, L_RUBY, L_SMALLTALK, L_VHDL, L_KIX, L_AU3,
- L_CAML, L_ADA, L_VERILOG, L_MATLAB, L_HASKELL, L_INNO, L_SEARCHRESULT,
- L_CMAKE, L_YAML, L_COBOL, L_GUI4CLI, L_D, L_POWERSHELL, L_R, L_JSP,
- L_COFFEESCRIPT, L_JSON, L_JAVASCRIPT, L_FORTRAN_77,
- // Don't use L_JS, use L_JAVASCRIPT instead
- // The end of enumated language type, so it should be always at the end
- L_EXTERNAL
- }
-
- [Flags]
- public enum NppMsg : uint
- {
- /* ++Autogenerated -- start of section automatically generated from notepad-plus-plus\PowerEditor\src\MISC\PluginsManager\Notepad_plus_msgs.h */
-
- NPPMSG = Constants.WM_USER + 1000,
-
- NPPM_GETCURRENTSCINTILLA = Constants.NPPMSG + 4,
- NPPM_GETCURRENTLANGTYPE = Constants.NPPMSG + 5,
- NPPM_SETCURRENTLANGTYPE = Constants.NPPMSG + 6,
-
- NPPM_GETNBOPENFILES = Constants.NPPMSG + 7,
- ALL_OPEN_FILES = 0,
- PRIMARY_VIEW = 1,
- SECOND_VIEW = 2,
-
- NPPM_GETOPENFILENAMES = Constants.NPPMSG + 8,
-
- NPPM_MODELESSDIALOG = Constants.NPPMSG + 12,
- MODELESSDIALOGADD = 0,
- MODELESSDIALOGREMOVE = 1,
-
- NPPM_GETNBSESSIONFILES = Constants.NPPMSG + 13,
- NPPM_GETSESSIONFILES = Constants.NPPMSG + 14,
- NPPM_SAVESESSION = Constants.NPPMSG + 15,
- NPPM_SAVECURRENTSESSION = Constants.NPPMSG + 16,
-
- NPPM_GETOPENFILENAMESPRIMARY = Constants.NPPMSG + 17,
- NPPM_GETOPENFILENAMESSECOND = Constants.NPPMSG + 18,
-
- NPPM_CREATESCINTILLAHANDLE = Constants.NPPMSG + 20,
- NPPM_DESTROYSCINTILLAHANDLE = Constants.NPPMSG + 21,
- NPPM_GETNBUSERLANG = Constants.NPPMSG + 22,
-
- NPPM_GETCURRENTDOCINDEX = Constants.NPPMSG + 23,
- MAIN_VIEW = 0,
- SUB_VIEW = 1,
-
- NPPM_SETSTATUSBAR = Constants.NPPMSG + 24,
- STATUSBAR_DOC_TYPE = 0,
- STATUSBAR_DOC_SIZE = 1,
- STATUSBAR_CUR_POS = 2,
- STATUSBAR_EOF_FORMAT = 3,
- STATUSBAR_UNICODE_TYPE = 4,
- STATUSBAR_TYPING_MODE = 5,
-
- NPPM_GETMENUHANDLE = Constants.NPPMSG + 25,
- NPPPLUGINMENU = 0,
- ///
- /// INT NPPM_GETMENUHANDLE(INT menuChoice, 0)
- /// Return: menu handle (HMENU) of choice (plugin menu handle or Notepad++ main menu handle)
- ///
- NPPMAINMENU = 1,
-
- ///
- ///ascii file to unicode
- ///int NPPM_ENCODESCI(MAIN_VIEW/SUB_VIEW, 0)
- ///return new unicodeMode
- ///
- NPPM_ENCODESCI = Constants.NPPMSG + 26,
-
- ///
- ///unicode file to ascii
- ///int NPPM_DECODESCI(MAIN_VIEW/SUB_VIEW, 0)
- ///return old unicodeMode
- ///
- NPPM_DECODESCI = Constants.NPPMSG + 27,
-
- ///
- ///void NPPM_ACTIVATEDOC(int view, int index2Activate)
- ///
- NPPM_ACTIVATEDOC = Constants.NPPMSG + 28,
-
- ///
- ///void NPPM_LAUNCHFINDINFILESDLG(TCHAR * dir2Search, TCHAR * filtre)
- ///
- NPPM_LAUNCHFINDINFILESDLG = Constants.NPPMSG + 29,
-
- ///
- ///void NPPM_DMMSHOW(0, tTbData->hClient)
- ///
- NPPM_DMMSHOW = Constants.NPPMSG + 30,
-
- ///
- ///void NPPM_DMMHIDE(0, tTbData->hClient)
- ///
- NPPM_DMMHIDE = Constants.NPPMSG + 31,
-
- ///
- ///void NPPM_DMMUPDATEDISPINFO(0, tTbData->hClient)
- ///
- NPPM_DMMUPDATEDISPINFO = Constants.NPPMSG + 32,
-
- ///
- ///void NPPM_DMMREGASDCKDLG(0, &tTbData)
- ///
- NPPM_DMMREGASDCKDLG = Constants.NPPMSG + 33,
-
- ///
- ///void NPPM_LOADSESSION(0, const TCHAR* file name)
- ///
- NPPM_LOADSESSION = Constants.NPPMSG + 34,
-
- ///
- ///void WM_DMM_VIEWOTHERTAB(0, tTbData->pszName)
- ///
- NPPM_DMMVIEWOTHERTAB = Constants.NPPMSG + 35,
-
- ///
- ///BOOL NPPM_RELOADFILE(BOOL withAlert, TCHAR *filePathName2Reload)
- ///
- NPPM_RELOADFILE = Constants.NPPMSG + 36,
-
- ///
- ///BOOL NPPM_SWITCHTOFILE(0, TCHAR *filePathName2switch)
- ///
- NPPM_SWITCHTOFILE = Constants.NPPMSG + 37,
-
- ///
- ///BOOL NPPM_SAVECURRENTFILE(0, 0)
- ///
- NPPM_SAVECURRENTFILE = Constants.NPPMSG + 38,
-
- ///
- ///BOOL NPPM_SAVEALLFILES(0, 0)
- ///
- NPPM_SAVEALLFILES = Constants.NPPMSG + 39,
-
- ///
- ///void WM_PIMENU_CHECK(UINT funcItem[X]._cmdID, TRUE/FALSE)
- ///
- NPPM_SETMENUITEMCHECK = Constants.NPPMSG + 40,
-
- ///
- ///void WM_ADDTOOLBARICON(UINT funcItem[X]._cmdID, toolbarIcons icon)
- ///
- NPPM_ADDTOOLBARICON = Constants.NPPMSG + 41,
-
- ///
- ///winVer NPPM_GETWINDOWSVERSION(0, 0)
- ///
- NPPM_GETWINDOWSVERSION = Constants.NPPMSG + 42,
-
- ///
- ///HWND WM_DMM_GETPLUGINHWNDBYNAME(const TCHAR *windowName, const TCHAR *moduleName)
- /// if moduleName is NULL, then return value is NULL
- /// if windowName is NULL, then the first found window handle which matches with the moduleName will be returned
- ///
- NPPM_DMMGETPLUGINHWNDBYNAME = Constants.NPPMSG + 43,
-
- ///
- ///BOOL NPPM_MAKECURRENTBUFFERDIRTY(0, 0)
- ///
- NPPM_MAKECURRENTBUFFERDIRTY = Constants.NPPMSG + 44,
-
- ///
- ///BOOL NPPM_GETENABLETHEMETEXTUREFUNC(0, 0)
- ///
- NPPM_GETENABLETHEMETEXTUREFUNC = Constants.NPPMSG + 45,
-
- ///
- ///void NPPM_GETPLUGINSCONFIGDIR(int strLen, TCHAR *str)
- ///
- NPPM_GETPLUGINSCONFIGDIR = Constants.NPPMSG + 46,
-
- ///
- ///BOOL NPPM_MSGTOPLUGIN(TCHAR *destModuleName, CommunicationInfo *info)
- /// return value is TRUE when the message arrive to the destination plugins.
- /// if destModule or info is NULL, then return value is FALSE
- ///
- NPPM_MSGTOPLUGIN = Constants.NPPMSG + 47,
-
- ///
- ///void NPPM_MENUCOMMAND(0, int cmdID)
- /// uncomment //#include "menuCmdID.h"
- /// in the beginning of this file then use the command symbols defined in "menuCmdID.h" file
- /// to access all the Notepad++ menu command items
- ///
- NPPM_MENUCOMMAND = Constants.NPPMSG + 48,
-
- ///
- ///void NPPM_TRIGGERTABBARCONTEXTMENU(int view, int index2Activate)
- ///
- NPPM_TRIGGERTABBARCONTEXTMENU = Constants.NPPMSG + 49,
-
- ///
- /// int NPPM_GETNPPVERSION(0, 0)
- /// return version
- /// ex : v4.6
- /// HIWORD(version) == 4
- /// LOWORD(version) == 6
- ///
- NPPM_GETNPPVERSION = Constants.NPPMSG + 50,
-
- ///
- /// BOOL NPPM_HIDETABBAR(0, BOOL hideOrNot)
- /// if hideOrNot is set as TRUE then tab bar will be hidden
- /// otherwise it'll be shown.
- /// return value : the old status value
- ///
- NPPM_HIDETABBAR = Constants.NPPMSG + 51,
-
- ///
- /// BOOL NPPM_ISTABBARHIDDEN(0, 0)
- /// returned value : TRUE if tab bar is hidden, otherwise FALSE
- ///
- NPPM_ISTABBARHIDDEN = Constants.NPPMSG + 52,
-
- ///
- /// INT NPPM_GETPOSFROMBUFFERID(INT bufferID, INT priorityView)
- /// Return VIEW|INDEX from a buffer ID. -1 if the bufferID non existing
- /// if priorityView set to SUB_VIEW, then SUB_VIEW will be search firstly
- ///
- /// VIEW takes 2 highest bits and INDEX (0 based) takes the rest (30 bits)
- /// Here's the values for the view :
- /// MAIN_VIEW 0
- /// SUB_VIEW 1
- ///
- NPPM_GETPOSFROMBUFFERID = Constants.NPPMSG + 57,
-
- ///
- /// INT NPPM_GETFULLPATHFROMBUFFERID(INT bufferID, TCHAR *fullFilePath)
- /// Get full path file name from a bufferID.
- /// Return -1 if the bufferID non existing, otherwise the number of TCHAR copied/to copy
- /// User should call it with fullFilePath be NULL to get the number of TCHAR (not including the nul character),
- /// allocate fullFilePath with the return values + 1, then call it again to get full path file name
- ///
- NPPM_GETFULLPATHFROMBUFFERID = Constants.NPPMSG + 58,
-
- ///
- /// LRESULT NPPM_GETBUFFERIDFROMPOS(INT index, INT iView)
- /// wParam: Position of document
- /// lParam: View to use, 0 = Main, 1 = Secondary
- /// Returns 0 if invalid
- ///
- NPPM_GETBUFFERIDFROMPOS = Constants.NPPMSG + 59,
-
- ///
- /// LRESULT NPPM_GETCURRENTBUFFERID(0, 0)
- /// Returns active Buffer
- ///
- NPPM_GETCURRENTBUFFERID = Constants.NPPMSG + 60,
-
- ///
- /// VOID NPPM_RELOADBUFFERID(0, 0)
- /// Reloads Buffer
- /// wParam: Buffer to reload
- /// lParam: 0 if no alert, else alert
- ///
- NPPM_RELOADBUFFERID = Constants.NPPMSG + 61,
-
- ///
- /// INT NPPM_GETBUFFERLANGTYPE(INT bufferID, 0)
- /// wParam: BufferID to get LangType from
- /// lParam: 0
- /// Returns as int, see LangType. -1 on error
- ///
- NPPM_GETBUFFERLANGTYPE = Constants.NPPMSG + 64,
-
- ///
- /// BOOL NPPM_SETBUFFERLANGTYPE(INT bufferID, INT langType)
- /// wParam: BufferID to set LangType of
- /// lParam: LangType
- /// Returns TRUE on success, FALSE otherwise
- /// use int, see LangType for possible values
- /// L_USER and L_EXTERNAL are not supported
- ///
- NPPM_SETBUFFERLANGTYPE = Constants.NPPMSG + 65,
-
- ///
- /// INT NPPM_GETBUFFERENCODING(INT bufferID, 0)
- /// wParam: BufferID to get encoding from
- /// lParam: 0
- /// returns as int, see UniMode. -1 on error
- ///
- NPPM_GETBUFFERENCODING = Constants.NPPMSG + 66,
-
- ///
- /// BOOL NPPM_SETBUFFERENCODING(INT bufferID, INT encoding)
- /// wParam: BufferID to set encoding of
- /// lParam: encoding
- /// Returns TRUE on success, FALSE otherwise
- /// use int, see UniMode
- /// Can only be done on new, unedited files
- ///
- NPPM_SETBUFFERENCODING = Constants.NPPMSG + 67,
-
- ///
- /// INT NPPM_GETBUFFERFORMAT(INT bufferID, 0)
- /// wParam: BufferID to get format from
- /// lParam: 0
- /// returns as int, see formatType. -1 on error
- ///
- NPPM_GETBUFFERFORMAT = Constants.NPPMSG + 68,
-
- ///
- /// BOOL NPPM_SETBUFFERFORMAT(INT bufferID, INT format)
- /// wParam: BufferID to set format of
- /// lParam: format
- /// Returns TRUE on success, FALSE otherwise
- /// use int, see formatType
- ///
- NPPM_SETBUFFERFORMAT = Constants.NPPMSG + 69,
-
- ///
- /// BOOL NPPM_ADDREBAR(0, REBARBANDINFO *)
- /// Returns assigned ID in wID value of struct pointer
- ///
- NPPM_ADDREBAR = Constants.NPPMSG + 57,
-
- ///
- /// BOOL NPPM_ADDREBAR(INT ID, REBARBANDINFO *)
- ///Use ID assigned with NPPM_ADDREBAR
- ///
- NPPM_UPDATEREBAR = Constants.NPPMSG + 58,
-
- ///
- /// BOOL NPPM_ADDREBAR(INT ID, 0)
- ///Use ID assigned with NPPM_ADDREBAR
- ///
- NPPM_REMOVEREBAR = Constants.NPPMSG + 59,
-
- ///
- /// BOOL NPPM_HIDETOOLBAR(0, BOOL hideOrNot)
- /// if hideOrNot is set as TRUE then tool bar will be hidden
- /// otherwise it'll be shown.
- /// return value : the old status value
- ///
- NPPM_HIDETOOLBAR = Constants.NPPMSG + 70,
-
- ///
- /// BOOL NPPM_ISTOOLBARHIDDEN(0, 0)
- /// returned value : TRUE if tool bar is hidden, otherwise FALSE
- ///
- NPPM_ISTOOLBARHIDDEN = Constants.NPPMSG + 71,
-
- ///
- /// BOOL NPPM_HIDEMENU(0, BOOL hideOrNot)
- /// if hideOrNot is set as TRUE then menu will be hidden
- /// otherwise it'll be shown.
- /// return value : the old status value
- ///
- NPPM_HIDEMENU = Constants.NPPMSG + 72,
-
- ///
- /// BOOL NPPM_ISMENUHIDDEN(0, 0)
- /// returned value : TRUE if menu is hidden, otherwise FALSE
- ///
- NPPM_ISMENUHIDDEN = Constants.NPPMSG + 73,
-
- ///
- /// BOOL NPPM_HIDESTATUSBAR(0, BOOL hideOrNot)
- /// if hideOrNot is set as TRUE then STATUSBAR will be hidden
- /// otherwise it'll be shown.
- /// return value : the old status value
- ///
- NPPM_HIDESTATUSBAR = Constants.NPPMSG + 74,
-
- ///
- /// BOOL NPPM_ISSTATUSBARHIDDEN(0, 0)
- /// returned value : TRUE if STATUSBAR is hidden, otherwise FALSE
- ///
- NPPM_ISSTATUSBARHIDDEN = Constants.NPPMSG + 75,
-
- ///
- /// BOOL NPPM_GETSHORTCUTBYCMDID(int cmdID, ShortcutKey *sk)
- /// get your plugin command current mapped shortcut into sk via cmdID
- /// You may need it after getting NPPN_READY notification
- /// returned value : TRUE if this function call is successful and shorcut is enable, otherwise FALSE
- ///
- NPPM_GETSHORTCUTBYCMDID = Constants.NPPMSG + 76,
-
- ///
- /// BOOL NPPM_DOOPEN(0, const TCHAR *fullPathName2Open)
- /// fullPathName2Open indicates the full file path name to be opened.
- /// The return value is TRUE (1) if the operation is successful, otherwise FALSE (0).
- ///
- NPPM_DOOPEN = Constants.NPPMSG + 77,
-
- ///
- /// BOOL NPPM_SAVECURRENTFILEAS (BOOL asCopy, const TCHAR* filename)
- ///
- NPPM_SAVECURRENTFILEAS = Constants.NPPMSG + 78,
-
- ///
- /// INT NPPM_GETCURRENTNATIVELANGENCODING(0, 0)
- /// returned value : the current native language enconding
- ///
- NPPM_GETCURRENTNATIVELANGENCODING = Constants.NPPMSG + 79,
-
- ///
- /// returns TRUE if NPPM_ALLOCATECMDID is supported
- /// Use to identify if subclassing is necessary
- ///
- NPPM_ALLOCATESUPPORTED = Constants.NPPMSG + 80,
-
- ///
- /// BOOL NPPM_ALLOCATECMDID(int numberRequested, int* startNumber)
- /// sets startNumber to the initial command ID if successful
- /// Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful
- ///
- NPPM_ALLOCATECMDID = Constants.NPPMSG + 81,
-
- ///
- /// BOOL NPPM_ALLOCATEMARKER(int numberRequested, int* startNumber)
- /// sets startNumber to the initial command ID if successful
- /// Allocates a marker number to a plugin
- /// Returns: TRUE if successful, FALSE otherwise. startNumber will also be set to 0 if unsuccessful
- ///
- NPPM_ALLOCATEMARKER = Constants.NPPMSG + 82,
-
- ///
- /// INT NPPM_GETLANGUAGENAME(int langType, TCHAR *langName)
- /// Get programing language name from the given language type (LangType)
- /// Return value is the number of copied character / number of character to copy (\0 is not included)
- /// You should call this function 2 times - the first time you pass langName as NULL to get the number of characters to copy.
- /// You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGENAME function the 2nd time
- /// by passing allocated buffer as argument langName
- ///
- NPPM_GETLANGUAGENAME = Constants.NPPMSG + 83,
-
- ///
- /// INT NPPM_GETLANGUAGEDESC(int langType, TCHAR *langDesc)
- /// Get programing language short description from the given language type (LangType)
- /// Return value is the number of copied character / number of character to copy (\0 is not included)
- /// You should call this function 2 times - the first time you pass langDesc as NULL to get the number of characters to copy.
- /// You allocate a buffer of the length of (the number of characters + 1) then call NPPM_GETLANGUAGEDESC function the 2nd time
- /// by passing allocated buffer as argument langDesc
- ///
- NPPM_GETLANGUAGEDESC = Constants.NPPMSG + 84,
-
- ///
- /// VOID NPPM_ISDOCSWITCHERSHOWN(0, BOOL toShowOrNot)
- /// Send this message to show or hide doc switcher.
- /// if toShowOrNot is TRUE then show doc switcher, otherwise hide it.
- ///
- NPPM_SHOWDOCSWITCHER = Constants.NPPMSG + 85,
-
- ///
- /// BOOL NPPM_ISDOCSWITCHERSHOWN(0, 0)
- /// Check to see if doc switcher is shown.
- ///
- NPPM_ISDOCSWITCHERSHOWN = Constants.NPPMSG + 86,
-
- ///
- /// BOOL NPPM_GETAPPDATAPLUGINSALLOWED(0, 0)
- /// Check to see if loading plugins from "%APPDATA%\Notepad++\plugins" is allowed.
- ///
- NPPM_GETAPPDATAPLUGINSALLOWED = Constants.NPPMSG + 87,
-
- ///
- /// INT NPPM_GETCURRENTVIEW(0, 0)
- /// Return: current edit view of Notepad++. Only 2 possible values: 0 = Main, 1 = Secondary
- ///
- NPPM_GETCURRENTVIEW = Constants.NPPMSG + 88,
-
- ///
- /// VOID NPPM_DOCSWITCHERDISABLECOLUMN(0, BOOL disableOrNot)
- /// Disable or enable extension column of doc switcher
- ///
- NPPM_DOCSWITCHERDISABLECOLUMN = Constants.NPPMSG + 89,
-
- ///
- /// INT NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR(0, 0)
- /// Return: current editor default foreground color. You should convert the returned value in COLORREF
- ///
- NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR = Constants.NPPMSG + 90,
-
- ///
- /// INT NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR(0, 0)
- /// Return: current editor default background color. You should convert the returned value in COLORREF
- ///
- NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR = Constants.NPPMSG + 91,
-
- ///
- /// VOID NPPM_SETSMOOTHFONT(0, BOOL setSmoothFontOrNot)
- ///
- NPPM_SETSMOOTHFONT = Constants.NPPMSG + 92,
-
- ///
- /// VOID NPPM_SETEDITORBORDEREDGE(0, BOOL withEditorBorderEdgeOrNot)
- ///
- NPPM_SETEDITORBORDEREDGE = Constants.NPPMSG + 93,
-
- ///
- /// VOID NPPM_SAVEFILE(0, const TCHAR *fileNameToSave)
- ///
- NPPM_SAVEFILE = Constants.NPPMSG + 94,
-
- RUNCOMMAND_USER = Constants.WM_USER + 3000,
- NPPM_GETFULLCURRENTPATH = RUNCOMMAND_USER + FULL_CURRENT_PATH,
- NPPM_GETCURRENTDIRECTORY = RUNCOMMAND_USER + CURRENT_DIRECTORY,
- NPPM_GETFILENAME = RUNCOMMAND_USER + FILE_NAME,
- NPPM_GETNAMEPART = RUNCOMMAND_USER + NAME_PART,
- NPPM_GETEXTPART = RUNCOMMAND_USER + EXT_PART,
- NPPM_GETCURRENTWORD = RUNCOMMAND_USER + CURRENT_WORD,
- ///
- /// BOOL NPPM_GETXXXXXXXXXXXXXXXX(size_t strLen, TCHAR *str)
- /// where str is the allocated TCHAR array,
- /// strLen is the allocated array size
- /// The return value is TRUE when get generic_string operation success
- /// Otherwise (allocated array size is too small) FALSE
- ///
- NPPM_GETNPPDIRECTORY = RUNCOMMAND_USER + NPP_DIRECTORY,
-
- ///
- /// INT NPPM_GETCURRENTLINE(0, 0)
- /// return the caret current position line
- ///
- NPPM_GETCURRENTLINE = RUNCOMMAND_USER + CURRENT_LINE,
-
- ///
- /// INT NPPM_GETCURRENTCOLUMN(0, 0)
- /// return the caret current position column
- ///
- NPPM_GETCURRENTCOLUMN = RUNCOMMAND_USER + CURRENT_COLUMN,
-
- VAR_NOT_RECOGNIZED = 0,
- FULL_CURRENT_PATH = 1,
- CURRENT_DIRECTORY = 2,
- FILE_NAME = 3,
- NAME_PART = 4,
- EXT_PART = 5,
- CURRENT_WORD = 6,
- NPP_DIRECTORY = 7,
- CURRENT_LINE = 8,
- CURRENT_COLUMN = 9,
-
- ///
- /// To notify plugins that all the procedures of launchment of notepad++ are done.
- ///scnNotification->nmhdr.code = NPPN_READY;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = 0;
- ///
- NPPN_FIRST = 1000,
- ///
- ///scnNotification->nmhdr.code = NPPN_READY;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = 0;
- ///
- NPPN_READY = NPPN_FIRST + 1,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_TB_MODIFICATION;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = 0;
- ///
- NPPN_TBMODIFICATION = NPPN_FIRST + 2,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILEBEFORECLOSE;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILEBEFORECLOSE = NPPN_FIRST + 3,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILEOPENED;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILEOPENED = NPPN_FIRST + 4,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILECLOSED;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILECLOSED = NPPN_FIRST + 5,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILEBEFOREOPEN = NPPN_FIRST + 6,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILEBEFORESAVE = NPPN_FIRST + 7,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILESAVED;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILESAVED = NPPN_FIRST + 8,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_SHUTDOWN;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = 0;
- ///
- NPPN_SHUTDOWN = NPPN_FIRST + 9,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_BUFFERACTIVATED;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = activatedBufferID;
- ///
- NPPN_BUFFERACTIVATED = NPPN_FIRST + 10,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_LANGCHANGED;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = currentBufferID;
- ///
- NPPN_LANGCHANGED = NPPN_FIRST + 11,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_WORDSTYLESUPDATED;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = currentBufferID;
- ///
- NPPN_WORDSTYLESUPDATED = NPPN_FIRST + 12,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_SHORTCUTSREMAPPED;
- ///scnNotification->nmhdr.hwndFrom = ShortcutKeyStructurePointer;
- ///scnNotification->nmhdr.idFrom = cmdID;
- ///where ShortcutKeyStructurePointer is pointer of struct ShortcutKey:
- ///struct ShortcutKey {
- /// bool _isCtrl;
- /// bool _isAlt;
- /// bool _isShift;
- /// UCHAR _key;
- ///};
- ///
- NPPN_SHORTCUTREMAPPED = NPPN_FIRST + 13,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILEBEFOREOPEN;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = NULL;
- ///
- NPPN_FILEBEFORELOAD = NPPN_FIRST + 14,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILEOPENFAILED;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILELOADFAILED = NPPN_FIRST + 15,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_READONLYCHANGED;
- ///scnNotification->nmhdr.hwndFrom = bufferID;
- ///scnNotification->nmhdr.idFrom = docStatus;
- /// where bufferID is BufferID
- /// docStatus can be combined by DOCSTAUS_READONLY and DOCSTAUS_BUFFERDIRTY
- ///
- NPPN_READONLYCHANGED = NPPN_FIRST + 16,
-
- DOCSTAUS_READONLY = 1,
- DOCSTAUS_BUFFERDIRTY = 2,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_DOCORDERCHANGED;
- ///scnNotification->nmhdr.hwndFrom = newIndex;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_DOCORDERCHANGED = NPPN_FIRST + 17,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_SNAPSHOTDIRTYFILELOADED;
- ///scnNotification->nmhdr.hwndFrom = NULL;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_SNAPSHOTDIRTYFILELOADED = NPPN_FIRST + 18,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_BEFORESHUTDOWN;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = 0;
- ///
- NPPN_BEFORESHUTDOWN = NPPN_FIRST + 19,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_CANCELSHUTDOWN;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = 0;
- ///
- NPPN_CANCELSHUTDOWN = NPPN_FIRST + 20,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILEBEFORERENAME;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILEBEFORERENAME = NPPN_FIRST + 21,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILERENAMECANCEL;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILERENAMECANCEL = NPPN_FIRST + 22,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILERENAMED;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILERENAMED = NPPN_FIRST + 23,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILEBEFOREDELETE;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILEBEFOREDELETE = NPPN_FIRST + 24,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILEDELETEFAILED;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILEDELETEFAILED = NPPN_FIRST + 25,
-
- ///
- ///scnNotification->nmhdr.code = NPPN_FILEDELETED;
- ///scnNotification->nmhdr.hwndFrom = hwndNpp;
- ///scnNotification->nmhdr.idFrom = BufferID;
- ///
- NPPN_FILEDELETED = NPPN_FIRST + 26,
-
- /* --Autogenerated -- end of section automatically generated from notepad-plus-plus\PowerEditor\src\MISC\PluginsManager\Notepad_plus_msgs.h * */
- }
-}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/NotepadPPGateway.cs b/CSharpRegexTools4Npp/PluginInfrastructure/NotepadPPGateway.cs
index 262ac9c..db6aca8 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/NotepadPPGateway.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/NotepadPPGateway.cs
@@ -1,29 +1,23 @@
// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
using System;
using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
+using System.Windows.Interop;
+using CSharpRegexTools4Npp.PluginInfrastructure;
+using CSharpRegexTools4Npp.Utils;
namespace CSharpRegexTools4Npp.PluginInfrastructure
{
- public interface INotepadPPGateway
- {
- NotepadPPGateway FileNew();
-
- string CurrentFileName { get; }
-
- unsafe string GetFilePath(int bufferId);
-
- NotepadPPGateway SetCurrentLanguage(LangType language);
- }
-
///
/// This class holds helpers for sending messages defined in the Msgs_h.cs file. It is at the moment
/// incomplete. Please help fill in the blanks.
///
- public class NotepadPPGateway : INotepadPPGateway
- {
+ public class NotepadPPGateway
+ {
public IntPtr Handle { get { return PluginBase.nppData._nppHandle; } }
private const int Unused = 0;
@@ -33,12 +27,12 @@ IntPtr Send(NppMsg command, int wParam, NppMenuCmd lParam)
return Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)command, wParam, lParam);
}
- IntPtr Send(NppMsg command, int wParam, int lParam)
+ private IntPtr Send(NppMsg command, int wParam, int lParam)
{
return Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)command, wParam, lParam);
}
- IntPtr Send(NppMsg command, IntPtr wParam, IntPtr lParam)
+ private IntPtr Send(NppMsg command, IntPtr wParam, IntPtr lParam)
{
return Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)command, wParam, lParam);
}
@@ -78,7 +72,6 @@ public NotepadPPGateway FileExit()
Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_MENUCOMMAND, Unused, NppMenuCmd.IDM_FILE_EXIT);
return this;
}
-
public bool OpenFile(string fileName)
{
bool result = false;
@@ -108,53 +101,6 @@ public int GetTabIndex(string tabPath, bool smart = false)
return index;
}
- public int GetTabIndex(string tabPath)
- {
- return GetTabIndex(tabPath, false);
- }
-
- public NotepadPPGateway ShowTab(string tabPath, bool smart)
- {
- try
- {
- ShowTab(GetTabIndex(tabPath, smart));
- }
- catch { }
-
- return this;
- }
-
-
- public NotepadPPGateway ShowTab(string tabPath)
- {
- try
- {
- ShowTab(GetTabIndex(tabPath));
- }
- catch { }
-
- return this;
- }
-
- public NotepadPPGateway ShowTab(int index)
- {
- try
- {
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_ACTIVATEDOC, 0, index);
- }
- catch { }
-
- return this;
- }
-
- public int TabCount
- {
- get
- {
- return Send(NppMsg.NPPM_GETNBOPENFILES, Unused, Unused).ToInt32();
- }
- }
-
public IntPtr GetBufferIdFromTab(int tabIndex)
{
return Send(NppMsg.NPPM_GETBUFFERIDFROMPOS, tabIndex, 0);
@@ -217,6 +163,21 @@ public string NppBinDirectoryPath
}
}
+ public string NppBinVersion
+ {
+ get
+ {
+ try
+ {
+ return FileVersionInfo.GetVersionInfo(Path.Combine(NppBinDirectoryPath, "notepad++.exe")).FileVersion;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+ }
+
///
/// Gets the path of the current document.
///
@@ -271,5 +232,287 @@ public void SetPluginMenuChecked(int id, bool check)
{
Send(NppMsg.NPPM_SETMENUITEMCHECK, PluginBase._funcItems.Items[id]._cmdID, check ? 1 : 0);
}
+
+ public int GetTabIndex(string tabPath)
+ {
+ return GetTabIndex(tabPath, false);
+ }
+
+ public NotepadPPGateway ShowTab(string tabPath, bool smart)
+ {
+ try
+ {
+ ShowTab(GetTabIndex(tabPath, smart));
+ }
+ catch { }
+
+ return this;
+ }
+
+
+ public NotepadPPGateway ShowTab(string tabPath)
+ {
+ try
+ {
+ ShowTab(GetTabIndex(tabPath));
+ }
+ catch { }
+
+ return this;
+ }
+
+ public NotepadPPGateway ShowTab(int index)
+ {
+ try
+ {
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_ACTIVATEDOC, 0, index);
+ }
+ catch { }
+
+ return this;
+ }
+
+ public int TabCount
+ {
+ get
+ {
+ return Send(NppMsg.NPPM_GETNBOPENFILES, Unused, Unused).ToInt32();
+ }
+ }
+
+
+ public void AddToolbarIcon(int funcItemsIndex, ToolbarIcons icon)
+ {
+ IntPtr pTbIcons = Marshal.AllocHGlobal(Marshal.SizeOf(icon));
+ try {
+ Marshal.StructureToPtr(icon, pTbIcons, false);
+ _ = Win32.SendMessage(
+ PluginBase.nppData._nppHandle,
+ (uint) NppMsg.NPPM_ADDTOOLBARICON,
+ PluginBase._funcItems.Items[funcItemsIndex]._cmdID,
+ pTbIcons);
+ } finally {
+ Marshal.FreeHGlobal(pTbIcons);
+ }
+ }
+
+ public void AddToolbarIcon(int funcItemsIndex, Bitmap icon)
+ {
+ ToolbarIcons tbi = new ToolbarIcons
+ {
+ hToolbarBmp = icon.GetHbitmap()
+ };
+ AddToolbarIcon(funcItemsIndex, tbi);
+ }
+
+ ///
+ /// Gets the path of the current document.
+ ///
+ public string GetCurrentFilePath()
+ {
+ var path = new StringBuilder(2000);
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETFULLCURRENTPATH, 0, path);
+ return path.ToString();
+ }
+
+ ///
+ /// This method incapsulates a common pattern in the Notepad++ API: when
+ /// you need to retrieve a string, you can first query the buffer size.
+ /// This method queries the necessary buffer size, allocates the temporary
+ /// memory, then returns the string retrieved through that buffer.
+ ///
+ /// Message ID of the data string to query.
+ /// String returned by Notepad++.
+ public string GetString(NppMsg message)
+ {
+ int len = Win32.SendMessage(
+ PluginBase.nppData._nppHandle,
+ (uint) message, Unused, Unused).ToInt32()
+ + 1;
+ var res = new StringBuilder(len);
+ _ = Win32.SendMessage(
+ PluginBase.nppData._nppHandle, (uint) message, len, res);
+ return res.ToString();
+ }
+
+ /// The path to the Notepad++ executable.
+ public string GetNppPath()
+ => GetString(NppMsg.NPPM_GETNPPDIRECTORY);
+
+ /// The path to the Config folder for plugins.
+ public string GetPluginConfigPath()
+ => GetString(NppMsg.NPPM_GETPLUGINSCONFIGDIR);
+
+ ///
+ /// Gets the path of the current document.
+ ///
+ public unsafe string GetFilePath(IntPtr bufferId)
+ {
+ var path = new StringBuilder(2000);
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_GETFULLPATHFROMBUFFERID, bufferId, path);
+ return path.ToString();
+ }
+
+ public void HideDockingForm(System.Windows.Forms.Form form)
+ {
+ Win32.SendMessage(PluginBase.nppData._nppHandle,
+ (uint)(NppMsg.NPPM_DMMHIDE),
+ 0, form.Handle);
+ }
+
+ public void ShowDockingForm(System.Windows.Forms.Form form)
+ {
+ Win32.SendMessage(PluginBase.nppData._nppHandle,
+ (uint)(NppMsg.NPPM_DMMSHOW),
+ 0, form.Handle);
+ }
+
+ public void ShowDockingForm(System.Windows.Window window)
+ {
+ Win32.SendMessage(PluginBase.nppData._nppHandle,
+ (uint)(NppMsg.NPPM_DMMSHOW),
+ 0, new WindowInteropHelper(window).Handle);
+ }
+
+ public Color GetDefaultForegroundColor()
+ {
+ var rawColor = (int)Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETEDITORDEFAULTFOREGROUNDCOLOR, 0, 0);
+ return Color.FromArgb(rawColor & 0xff, (rawColor >> 8) & 0xff, (rawColor >> 16) & 0xff);
+ }
+
+ public Color GetDefaultBackgroundColor()
+ {
+ var rawColor = (int)Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETEDITORDEFAULTBACKGROUNDCOLOR, 0, 0);
+ return Color.FromArgb(rawColor & 0xff, (rawColor >> 8) & 0xff, (rawColor >> 16) & 0xff);
+ }
+
+ ///
+ /// Figure out default N++ config file path
+ /// Path is usually -> .\Users\\AppData\Roaming\Notepad++\plugins\config\
+ ///
+ public string GetConfigDirectory()
+ {
+ var sbIniFilePath = new StringBuilder(Win32.MAX_PATH);
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETPLUGINSCONFIGDIR, Win32.MAX_PATH, sbIniFilePath);
+ return sbIniFilePath.ToString();
+ }
+
+ ///
+ /// 3-int array: {major, minor, bugfix}
+ /// Thus GetNppVersion() would return {8, 5, 0} for version 8.5.0
+ /// and {7, 7, 1} for version 7.7.1
+ ///
+ ///
+ public int[] GetNppVersion()
+ {
+ int version = Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETNPPVERSION, 0, 0).ToInt32();
+ int major = version >> 16;
+ int minor = Math.DivRem(version & 0xffff, 10, out int bugfix);
+ if (minor == 0)
+ (bugfix, minor) = (minor, bugfix);
+ return new int[] { major, minor, bugfix };
+ }
+
+ ///
+ /// Get all open filenames in both views (all in first view, then all in second view)
+ ///
+ ///
+ public string[] GetOpenFileNames()
+ {
+ var bufs = new List();
+ foreach (int view in GetVisibleViews())
+ {
+ int nbOpenFiles = (int)Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETNBOPENFILES, 0, view + 1);
+ for (int ii = 0; ii < nbOpenFiles; ii++)
+ {
+ IntPtr bufId = Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETBUFFERIDFROMPOS, ii, view);
+ bufs.Add(Npp.Notepad.GetFilePath(bufId));
+ }
+ }
+ return bufs.ToArray();
+ }
+
+ public void AddModelessDialog(IntPtr formHandle)
+ {
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_MODELESSDIALOG, IntPtr.Zero, formHandle);
+ }
+
+ public void RemoveModelessDialog(IntPtr formHandle)
+ {
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_MODELESSDIALOG, new IntPtr(1), formHandle);
+ }
+
+ ///
+ /// the status bar is the bar at the bottom with the document type, EOL type, current position, line, etc.
+ /// Set the message for one of the sections of that bar.
+ ///
+ ///
+ ///
+ public void SetStatusBarSection(string message, StatusBarSection section)
+ {
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_SETSTATUSBAR, (int)section, message);
+ }
+
+ public unsafe bool AllocateIndicators(int numberOfIndicators, out int[] indicators)
+ {
+ indicators = null;
+ if (numberOfIndicators < 1)
+ return false;
+ indicators = new int[numberOfIndicators];
+ fixed (int * indicatorsPtr = indicators)
+ {
+ IntPtr success = Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_ALLOCATEINDICATOR, (IntPtr)numberOfIndicators, (IntPtr)indicatorsPtr);
+ for (int ii = 1; ii < numberOfIndicators; ii++)
+ indicators[ii] = indicators[ii - 1] + 1;
+ return success != IntPtr.Zero;
+ }
+ }
+
+ public unsafe bool TryGetNativeLangName(out string langName)
+ {
+ langName = "";
+ int fnameLen = Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETNATIVELANGFILENAME, IntPtr.Zero, IntPtr.Zero).ToInt32() + 1;
+ if (fnameLen == 1)
+ return false;
+ var fnameArr = new byte[fnameLen];
+ fixed (byte * fnameBuf = fnameArr)
+ {
+ IntPtr fnamePtr = (IntPtr)fnameBuf;
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETNATIVELANGFILENAME, (IntPtr)fnameLen, fnamePtr);
+ langName = Marshal.PtrToStringAnsi(fnamePtr);
+ }
+ if (!string.IsNullOrEmpty(langName) && langName.EndsWith(".xml"))
+ {
+ langName = langName.Substring(0, langName.Length - 4);
+ return true;
+ }
+ return false;
+ }
+
+ public List GetVisibleViews()
+ {
+ var openViews = new List();
+ for (int view = 0; view < 2; view++)
+ {
+ // NPPM_GETCURRENTDOCINDEX(0, view) returns -1 if that view is invisible
+ if ((int)Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETCURRENTDOCINDEX, 0, view) >= 0)
+ openViews.Add(view);
+ }
+ return openViews;
+ }
}
+
+ ///
+ /// This class holds helpers for sending messages defined in the Resource_h.cs file. It is at the moment
+ /// incomplete. Please help fill in the blanks.
+ ///
+ class NppResource
+ {
+ private const int Unused = 0;
+
+ public void ClearIndicator()
+ {
+ Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) Resource.NPPM_INTERNAL_CLEARINDICATOR, Unused, Unused);
+ }
+ }
}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/NotepadPPGateway.cs.bak b/CSharpRegexTools4Npp/PluginInfrastructure/NotepadPPGateway.cs.bak
deleted file mode 100644
index 0223af9..0000000
--- a/CSharpRegexTools4Npp/PluginInfrastructure/NotepadPPGateway.cs.bak
+++ /dev/null
@@ -1,196 +0,0 @@
-// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-
-namespace CSharpRegexTools4Npp.PluginInfrastructure
-{
- public interface INotepadPPGateway
- {
- NotepadPPGateway FileNew();
-
- string CurrentFileName { get; }
-
- unsafe string GetFilePath(int bufferId);
-
- NotepadPPGateway SetCurrentLanguage(LangType language);
- }
-
- ///
- /// This class holds helpers for sending messages defined in the Msgs_h.cs file. It is at the moment
- /// incomplete. Please help fill in the blanks.
- ///
- public class NotepadPPGateway : INotepadPPGateway
- {
- public IntPtr Handle { get { return PluginBase.nppData._nppHandle; } }
-
- private const int Unused = 0;
-
- IntPtr Send(NppMsg command, int wParam, NppMenuCmd lParam)
- {
- return Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)command, wParam, lParam);
- }
-
- IntPtr Send(NppMsg command, IntPtr wParam, IntPtr lParam)
- {
- return Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)command, wParam, lParam);
- }
-
- public NotepadPPGateway FileNew()
- {
- Send(NppMsg.NPPM_MENUCOMMAND, Unused, NppMenuCmd.IDM_FILE_NEW);
- return this;
- }
-
- public NotepadPPGateway ReloadFile(string file, bool showAlert)
- {
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_RELOADFILE, showAlert ? 1 : 0, file);
- return this;
- }
-
- public NotepadPPGateway SaveCurrentFile()
- {
- Send(NppMsg.NPPM_SAVECURRENTFILE, Unused, Unused);
- return this;
- }
-
- public NotepadPPGateway SaveAllOpenedDocuments()
- {
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_SAVEALLFILES, Unused, Unused);
- return this;
- }
-
- public NotepadPPGateway FileExit()
- {
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_MENUCOMMAND, Unused, NppMenuCmd.IDM_FILE_EXIT);
- return this;
- }
-
- public bool OpenFile(string fileName)
- {
- bool result = false;
-
- try
- {
- if (File.Exists(fileName))
- {
- result = Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_DOOPEN, 0, fileName).ToInt64() == 1;
- }
- }
- catch { }
-
- return result;
- }
-
- public NotepadPPGateway ShowOpenedDocument(string tabPath)
- {
- try
- {
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_SWITCHTOFILE, 0, tabPath);
- }
- catch { }
-
- return this;
- }
-
- public int TabCount
- {
- get
- {
- return Send(NppMsg.NPPM_GETNBOPENFILES, Unused, Unused).ToInt32();
- }
- }
-
- public IntPtr GetBufferIdFromTab(int tabIndex)
- {
- return Send(NppMsg.NPPM_GETBUFFERIDFROMPOS, tabIndex, 0);
- }
-
- public string GetTabFileFromPosition(int tabIndex)
- {
- var id = this.GetBufferIdFromTab(tabIndex);
- return this.GetTabFile(id);
- }
-
- public List GetAllOpenedDocuments
- {
- get
- {
- var count = this.TabCount;
-
- var files = new List();
- for (int i = 0; i < count; i++)
- {
- var file = this.GetTabFileFromPosition(i);
-
- if (!string.IsNullOrEmpty(file))
- files.Add(file);
- }
- return files;
- }
- }
-
- public string GetTabFile(IntPtr index)
- {
- var path = new StringBuilder(2000);
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETFULLPATHFROMBUFFERID, index, path);
- return path.ToString();
- }
-
- ///
- /// Gets the path of plugins directory
- ///
- public string PluginsConfigDirectory
- {
- get
- {
- var path = new StringBuilder(2000);
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETPLUGINSCONFIGDIR, path.Capacity, path);
- return path.ToString();
- }
- }
-
- ///
- /// Get the path of the directory where to find the executable of the current Notepad++ instance.
- ///
- public string NppBinDirectoryPath
- {
- get
- {
- var path = new StringBuilder(2000);
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETNPPDIRECTORY, path.Capacity, path);
- return path.ToString();
- }
- }
-
- ///
- /// Gets the path of the current document.
- ///
- public string CurrentFileName
- {
- get
- {
- var path = new StringBuilder(2000);
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETFULLCURRENTPATH, path.Capacity, path);
- return path.ToString();
- }
- }
-
- ///
- /// Gets the path of the current document.
- ///
- public unsafe string GetFilePath(int bufferId)
- {
- var path = new StringBuilder(2000);
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETFULLPATHFROMBUFFERID, bufferId, path);
- return path.ToString();
- }
-
- public NotepadPPGateway SetCurrentLanguage(LangType language)
- {
- Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_SETCURRENTLANGTYPE, Unused, (int)language);
- return this;
- }
- }
-}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETBase.cs b/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETBase.cs
index 3b0aaec..9138062 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETBase.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETBase.cs
@@ -1,54 +1,213 @@
// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using CSharpRegexTools4Npp.Utils;
namespace CSharpRegexTools4Npp.PluginInfrastructure
{
- public class PluginBase
+ class PluginBase
{
- public static NppData nppData;
- public static FuncItems _funcItems = new FuncItems();
+ internal static NppData nppData;
+ internal static FuncItems _funcItems = new FuncItems();
+ private static List _untranslatedFuncItemNames = new List();
+ public static List GetUntranslatedFuncItemNames() => _untranslatedFuncItemNames.ToList();
- public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer)
+ internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer)
{
SetCommand(index, commandName, functionPointer, new ShortcutKey(), false);
}
- public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut)
+ internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut)
{
SetCommand(index, commandName, functionPointer, shortcut, false);
}
- public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, bool checkOnInit)
+ internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, bool checkOnInit)
{
SetCommand(index, commandName, functionPointer, new ShortcutKey(), checkOnInit);
}
- public static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit)
+ internal static void SetCommand(int index, string commandName, NppFuncItemDelegate functionPointer, ShortcutKey shortcut, bool checkOnInit)
{
- FuncItem funcItem = new FuncItem
- {
- _cmdID = index,
- _itemName = commandName
- };
-
+ FuncItem funcItem = new FuncItem();
+ funcItem._cmdID = index;
+ funcItem._itemName = commandName;
if (functionPointer != null)
funcItem._pFunc = new NppFuncItemDelegate(functionPointer);
if (shortcut._key != 0)
funcItem._pShKey = shortcut;
funcItem._init2Check = checkOnInit;
+ _untranslatedFuncItemNames.Add(commandName);
_funcItems.Add(funcItem);
}
- public static IntPtr GetCurrentScintilla()
+ ///
+ /// if a menu item (for your plugin's drop-down menu) has a checkmark, check/uncheck it, and call its associated funcId.
+ ///
+ /// the index of the menu item of interest
+ /// whether the menu item should be checked
+ public static void CheckMenuItem(int funcId, bool isChecked)
+ {
+ Win32.CheckMenuItem(
+ Win32.GetMenu(nppData._nppHandle),
+ PluginBase._funcItems.Items[funcId]._cmdID,
+ Win32.MF_BYCOMMAND | (isChecked ? Win32.MF_CHECKED : Win32.MF_UNCHECKED));
+ }
+
+ //private static IntPtr GetThisPluginMenuHandle()
+ //{
+ // IntPtr mainMenuHandle = Win32.GetMenu(nppData._nppHandle);
+ // int pluginMenuIndex = 10;
+ // IntPtr allPluginsMenuHandle = Win32.GetSubMenu(mainMenuHandle, pluginMenuIndex);
+ // int itemCount = Win32.GetMenuItemCount(allPluginsMenuHandle);
+ // if (itemCount < 0)
+ // return IntPtr.Zero;
+ // for (int ii = 0; ii < itemCount; ii++)
+ // {
+ // var mii = new Win32.MenuItemInfo(Win32.MenuItemMask.MIIM_STRING | Win32.MenuItemMask.MIIM_SUBMENU);
+ // mii.cch =
+ // }
+ //}
+
+ private static IntPtr MenuItemInfoToHGlobal(Win32.MenuItemInfo mii)
+ {
+ IntPtr miiPtr = Marshal.AllocHGlobal((int)mii.cbSize);
+ Marshal.StructureToPtr(mii, miiPtr, false);
+ return miiPtr;
+ }
+
+ private static bool SetMenuItemText(IntPtr hMenu, int index, string newText)
+ {
+ if (index >= _funcItems.Items.Count || index < 0 || newText is null)
+ return false;
+ var mii = new Win32.MenuItemInfo(Win32.MenuItemMask.MIIM_STRING | Win32.MenuItemMask.MIIM_FTYPE);
+ IntPtr newTextPtr = Marshal.StringToHGlobalAnsi(newText);
+ mii.dwTypeData = newTextPtr;
+ IntPtr miiPtr = MenuItemInfoToHGlobal(mii);
+ bool res = Win32.SetMenuItemInfo(hMenu, (uint)index, true, miiPtr);
+ Marshal.FreeHGlobal(miiPtr);
+ Marshal.FreeHGlobal(newTextPtr);
+ return res;
+ }
+
+ private static unsafe bool TryGetMenuItemText(IntPtr hMenu, int index, out string str)
+ {
+ str = null;
+ if (index < 0) // we assume the user has already checked the menu item count using Win32.GetMenuItemCount(hMenu)
+ return false;
+ var mii = new Win32.MenuItemInfo(Win32.MenuItemMask.MIIM_STRING | Win32.MenuItemMask.MIIM_STATE);
+ IntPtr miiPtr = MenuItemInfoToHGlobal(mii);
+ if (Win32.GetMenuItemInfo(hMenu, (uint)index, true, miiPtr))
+ {
+ mii = (Win32.MenuItemInfo)Marshal.PtrToStructure(miiPtr, typeof(Win32.MenuItemInfo));
+ mii.cch++;
+ byte[] textBuffer = new byte[mii.cch];
+ fixed (byte * textPtr = textBuffer)
+ {
+ IntPtr textPtrSafe = (IntPtr)textPtr;
+ mii.dwTypeData = textPtrSafe;
+ Marshal.StructureToPtr(mii, miiPtr, true);
+ Win32.GetMenuItemInfo(hMenu, (uint)index, true, miiPtr);
+ str = Marshal.PtrToStringAnsi(textPtrSafe);
+ }
+ }
+ Marshal.FreeHGlobal(miiPtr);
+ return !(str is null);
+ }
+
+ private static unsafe bool TryGetSubMenuWithName(IntPtr hMenu, string subMenuName, out IntPtr hSubMenu, out int idSubMenu)
+ {
+ idSubMenu = -1;
+ hSubMenu = IntPtr.Zero;
+ int itemCount = Win32.GetMenuItemCount(hMenu);
+ if (itemCount < 0)
+ return false;
+ for (int ii = 0; ii < itemCount; ii++)
+ {
+ if (!TryGetMenuItemText(hMenu, ii, out string menuItemName))
+ return false;
+ if (menuItemName == subMenuName)
+ {
+ idSubMenu = ii;
+ hSubMenu = Win32.GetSubMenu(hMenu, ii);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static IntPtr _allPluginsMenuHandle = IntPtr.Zero;
+ private static int _thisPluginIdxInAllPluginsMenu = -1;
+ private static IntPtr _thisPluginMenuHandle = IntPtr.Zero;
+
+ ///
+ /// If allPluginsMenuHandle is a valid menu handle, and this plugin's name is the name of one of the submenus of allPluginsMenuHandle,
+ /// set _allPluginsMenuHandle to allPluginsMenuHandle, and set _thisPluginMenuHandle to the handle of the submenu with the same name as this plugin.
+ ///
+ /// the menu handle to the Plugins submenu of the Notepad++ main menu
+ ///
+ private static unsafe bool TrySetPluginsMenuHandle(IntPtr allPluginsMenuHandle)
+ {
+ if (_thisPluginMenuHandle != IntPtr.Zero && _allPluginsMenuHandle != IntPtr.Zero && _thisPluginIdxInAllPluginsMenu >= 0
+ && TryGetMenuItemText(_allPluginsMenuHandle, _thisPluginIdxInAllPluginsMenu, out string pluginName)
+ && pluginName == Main.PluginName)
+ {
+ return true;
+ }
+ if (!TryGetSubMenuWithName(allPluginsMenuHandle, Main.PluginName, out _thisPluginMenuHandle, out _thisPluginIdxInAllPluginsMenu))
+ return false;
+ _allPluginsMenuHandle = allPluginsMenuHandle;
+ return true;
+ }
+
+ ///
+ /// attempt to change the names of this plugin's menu items to newNames, assuming that allPluginsMenuHandle is the handle of the Plugins submenu of the Notepad++ main menu.
+ /// Returns true if and only if all the menu items could be renamed.
+ ///
+ ///
+ ///
+ ///
+ public static bool ChangePluginMenuItemNames(IntPtr allPluginsMenuHandle, List newNames)
+ {
+ if (newNames.Count != _funcItems.Items.Count || !TrySetPluginsMenuHandle(allPluginsMenuHandle))
+ return false;
+ for (int ii = 0; ii < newNames.Count; ii++)
+ {
+ string newName = newNames[ii];
+ if (newName != "---" && !SetMenuItemText(_thisPluginMenuHandle, ii, newName))
+ return false;
+ }
+ return true;
+ }
+
+ ///
+ /// if a menu item (for your plugin's drop-down menu) has a checkmark:
+ /// - if it's checked, uncheck it
+ /// - if it's unchecked, check it.
+ /// Either way, call its associated funcId.
+ ///
+ /// the index of the menu item of interest
+ /// whether the menu item is currently checked
+ internal static void CheckMenuItemToggle(int funcId, ref bool isCurrentlyChecked)
+ {
+ // toggle value
+ isCurrentlyChecked = !isCurrentlyChecked;
+ CheckMenuItem(funcId, isCurrentlyChecked);
+ }
+
+ internal static IntPtr GetCurrentScintilla()
{
- Win32.SendMessage(nppData._nppHandle, (uint)NppMsg.NPPM_GETCURRENTSCINTILLA, 0, out int curScintilla);
+ int curScintilla;
+ Win32.SendMessage(nppData._nppHandle, (uint) NppMsg.NPPM_GETCURRENTSCINTILLA, 0, out curScintilla);
return (curScintilla == 0) ? nppData._scintillaMainHandle : nppData._scintillaSecondHandle;
}
- public static readonly Func gatewayFactory = () => new ScintillaGateway(GetCurrentScintilla());
+ static readonly Func gatewayFactory = () => new ScintillaGateway(GetCurrentScintilla());
- public static Func GetGatewayFactory()
+ public static Func GetGatewayFactory()
{
return gatewayFactory;
}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETHelper.cs b/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETHelper.cs
index 5d159b4..640b6b6 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETHelper.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETHelper.cs
@@ -4,7 +4,6 @@
using System.Windows.Forms;
using System.Collections.Generic;
using System.Runtime.InteropServices;
-using System.Linq;
namespace CSharpRegexTools4Npp.PluginInfrastructure
{
@@ -21,17 +20,6 @@ public struct NppData
[StructLayout(LayoutKind.Sequential)]
public struct ShortcutKey
{
- public ShortcutKey(string data)
- {
- //Ctrl+Shift+Alt+Key
- var parts = data.Split('+');
- _key = Convert.ToByte(Enum.Parse(typeof(Keys), parts.Last()));
- parts = parts.Take(parts.Length - 1).ToArray();
- _isCtrl = Convert.ToByte(parts.Contains("Ctrl"));
- _isShift = Convert.ToByte(parts.Contains("Shift"));
- _isAlt = Convert.ToByte(parts.Contains("Alt"));
- }
-
public ShortcutKey(bool isCtrl, bool isAlt, bool isShift, Keys key)
{
// the types 'bool' and 'char' have a size of 1 byte only!
@@ -40,18 +28,6 @@ public ShortcutKey(bool isCtrl, bool isAlt, bool isShift, Keys key)
_isShift = Convert.ToByte(isShift);
_key = Convert.ToByte(key);
}
-
- public bool IsCtrl { get { return _isCtrl != 0; } }
- public bool IsShift { get { return _isShift != 0; } }
- public bool IsAlt { get { return _isAlt != 0; } }
- public Keys Key { get { return (Keys)_key; } }
- public string AsText { get => Key == Keys.None ? null : (IsCtrl ? "Ctrl+" : string.Empty) + (IsAlt ? "Alt+" : string.Empty) + (IsShift ? "Shift+" : string.Empty) + Key.ToString(); }
-
- public override string ToString()
- {
- return AsText;
- }
-
public byte _isCtrl;
public byte _isAlt;
public byte _isShift;
@@ -61,7 +37,13 @@ public override string ToString()
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FuncItem
{
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
+ ///
+ /// The maximum number of UTF-16 characters in a FuncItem name.
+ /// This is one less than the number listed the relevant code, because that is the length of a C string
+ ///
+ public const int MAX_FUNC_ITEM_NAME_LENGTH = 63;
+
+ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_FUNC_ITEM_NAME_LENGTH + 1)] // +1 for terminating nul char
public string _itemName;
public NppFuncItemDelegate _pFunc;
public int _cmdID;
@@ -148,13 +130,9 @@ public void Dispose()
{
if (!_disposed)
{
+ foreach (IntPtr ptr in _shortCutKeys) Marshal.FreeHGlobal(ptr);
+ if (_nativePointer != IntPtr.Zero) Marshal.FreeHGlobal(_nativePointer);
_disposed = true;
- try
- {
- foreach (IntPtr ptr in _shortCutKeys) Marshal.FreeHGlobal(ptr);
- if (_nativePointer != IntPtr.Zero) Marshal.FreeHGlobal(_nativePointer);
- }
- catch { }
}
}
~FuncItems()
@@ -175,45 +153,49 @@ public enum winVer
public enum DockMgrMsg : uint
{
IDB_CLOSE_DOWN = 137,
- IDB_CLOSE_UP = 138,
- IDD_CONTAINER_DLG = 139,
-
- IDC_TAB_CONT = 1027,
- IDC_CLIENT_TAB = 1028,
- IDC_BTN_CAPTION = 1050,
-
- DMM_MSG = 0x5000,
- DMM_CLOSE = (DMM_MSG + 1),
- DMM_DOCK = (DMM_MSG + 2),
- DMM_FLOAT = (DMM_MSG + 3),
- DMM_DOCKALL = (DMM_MSG + 4),
- DMM_FLOATALL = (DMM_MSG + 5),
- DMM_MOVE = (DMM_MSG + 6),
- DMM_UPDATEDISPINFO = (DMM_MSG + 7),
- DMM_GETIMAGELIST = (DMM_MSG + 8),
- DMM_GETICONPOS = (DMM_MSG + 9),
- DMM_DROPDATA = (DMM_MSG + 10),
- DMM_MOVE_SPLITTER = (DMM_MSG + 11),
- DMM_CANCEL_MOVE = (DMM_MSG + 12),
- DMM_LBUTTONUP = (DMM_MSG + 13),
+ IDB_CLOSE_UP = 138,
+ IDD_CONTAINER_DLG = 139,
+
+ IDC_TAB_CONT = 1027,
+ IDC_CLIENT_TAB = 1028,
+ IDC_BTN_CAPTION = 1050,
+
+ DMM_MSG = 0x5000,
+ DMM_CLOSE = (DMM_MSG + 1),
+ DMM_DOCK = (DMM_MSG + 2),
+ DMM_FLOAT = (DMM_MSG + 3),
+ DMM_DOCKALL = (DMM_MSG + 4),
+ DMM_FLOATALL = (DMM_MSG + 5),
+ DMM_MOVE = (DMM_MSG + 6),
+ DMM_UPDATEDISPINFO = (DMM_MSG + 7),
+ DMM_GETIMAGELIST = (DMM_MSG + 8),
+ DMM_GETICONPOS = (DMM_MSG + 9),
+ DMM_DROPDATA = (DMM_MSG + 10),
+ DMM_MOVE_SPLITTER = (DMM_MSG + 11),
+ DMM_CANCEL_MOVE = (DMM_MSG + 12),
+ DMM_LBUTTONUP = (DMM_MSG + 13),
DMN_FIRST = 1050,
- DMN_CLOSE = (DMN_FIRST + 1),
- //nmhdr.Code = DWORD(DMN_CLOSE, 0));
- //nmhdr.hwndFrom = hwndNpp;
- //nmhdr.IdFrom = ctrlIdNpp;
-
- DMN_DOCK = (DMN_FIRST + 2),
- DMN_FLOAT = (DMN_FIRST + 3)
+ DMN_CLOSE = (DMN_FIRST + 1),
+ //nmhdr.Code = DWORD(DMN_CLOSE, 0));
+ //nmhdr.hwndFrom = hwndNpp;
+ //nmhdr.IdFrom = ctrlIdNpp;
+
+ DMN_DOCK = (DMN_FIRST + 2),
+ DMN_FLOAT = (DMN_FIRST + 3),
+ DMN_SWITCHIN = (DMN_FIRST + 4),
+ DMN_SWITCHOFF = (DMN_FIRST + 5),
+ DMN_FLOATDROPPED = (DMN_FIRST + 6),
//nmhdr.Code = DWORD(DMN_XXX, int newContainer);
//nmhdr.hwndFrom = hwndNpp;
//nmhdr.IdFrom = ctrlIdNpp;
}
[StructLayout(LayoutKind.Sequential)]
- public struct toolbarIcons
+ public struct ToolbarIcons
{
- public IntPtr hToolbarBmp;
- public IntPtr hToolbarIcon;
+ public IntPtr hToolbarBmp; // standard icon (color)
+ public IntPtr hToolbarIcon; // Fluent UI icon (black)
+ public IntPtr hToolbarIconDarkMode; // Fluent UI icon (white)
}
}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETHelper.cs.bak b/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETHelper.cs.bak
deleted file mode 100644
index 3e40499..0000000
--- a/CSharpRegexTools4Npp/PluginInfrastructure/NppPluginNETHelper.cs.bak
+++ /dev/null
@@ -1,213 +0,0 @@
-// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc.
-using System;
-using System.Text;
-using System.Windows.Forms;
-using System.Collections.Generic;
-using System.Runtime.InteropServices;
-using System.Linq;
-
-namespace CSharpRegexTools4Npp.PluginInfrastructure
-{
- [StructLayout(LayoutKind.Sequential)]
- public struct NppData
- {
- public IntPtr _nppHandle;
- public IntPtr _scintillaMainHandle;
- public IntPtr _scintillaSecondHandle;
- }
-
- public delegate void NppFuncItemDelegate();
-
- [StructLayout(LayoutKind.Sequential)]
- public struct ShortcutKey
- {
- public ShortcutKey(string data)
- {
- //Ctrl+Shift+Alt+Key
- var parts = data.Split('+');
- _key = Convert.ToByte(Enum.Parse(typeof(Keys), parts.Last()));
- parts = parts.Take(parts.Length - 1).ToArray();
- _isCtrl = Convert.ToByte(parts.Contains("Ctrl"));
- _isShift = Convert.ToByte(parts.Contains("Shift"));
- _isAlt = Convert.ToByte(parts.Contains("Alt"));
- }
-
- public ShortcutKey(bool isCtrl, bool isAlt, bool isShift, Keys key)
- {
- // the types 'bool' and 'char' have a size of 1 byte only!
- _isCtrl = Convert.ToByte(isCtrl);
- _isAlt = Convert.ToByte(isAlt);
- _isShift = Convert.ToByte(isShift);
- _key = Convert.ToByte(key);
- }
-
- public bool IsCtrl { get { return _isCtrl != 0; } }
- public bool IsShift { get { return _isShift != 0; } }
- public bool IsAlt { get { return _isAlt != 0; } }
- public Keys Key { get { return (Keys)_key; } }
-
- public byte _isCtrl;
- public byte _isAlt;
- public byte _isShift;
- public byte _key;
- }
-
- [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
- public struct FuncItem
- {
- [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
- public string _itemName;
- public NppFuncItemDelegate _pFunc;
- public int _cmdID;
- public bool _init2Check;
- public ShortcutKey _pShKey;
- }
-
- public class FuncItems : IDisposable
- {
- List _funcItems;
- int _sizeFuncItem;
- List _shortCutKeys;
- IntPtr _nativePointer;
- bool _disposed = false;
-
- public FuncItems()
- {
- _funcItems = new List();
- _sizeFuncItem = Marshal.SizeOf(typeof(FuncItem));
- _shortCutKeys = new List();
- }
-
- [DllImport("kernel32")]
- static extern void RtlMoveMemory(IntPtr Destination, IntPtr Source, int Length);
- public void Add(FuncItem funcItem)
- {
- int oldSize = _funcItems.Count * _sizeFuncItem;
- _funcItems.Add(funcItem);
- int newSize = _funcItems.Count * _sizeFuncItem;
- IntPtr newPointer = Marshal.AllocHGlobal(newSize);
-
- if (_nativePointer != IntPtr.Zero)
- {
- RtlMoveMemory(newPointer, _nativePointer, oldSize);
- Marshal.FreeHGlobal(_nativePointer);
- }
- IntPtr ptrPosNewItem = (IntPtr)(newPointer.ToInt64() + oldSize);
- byte[] aB = Encoding.Unicode.GetBytes(funcItem._itemName + "\0");
- Marshal.Copy(aB, 0, ptrPosNewItem, aB.Length);
- ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 128);
- IntPtr p = (funcItem._pFunc != null) ? Marshal.GetFunctionPointerForDelegate(funcItem._pFunc) : IntPtr.Zero;
- Marshal.WriteIntPtr(ptrPosNewItem, p);
- ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + IntPtr.Size);
- Marshal.WriteInt32(ptrPosNewItem, funcItem._cmdID);
- ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 4);
- Marshal.WriteInt32(ptrPosNewItem, Convert.ToInt32(funcItem._init2Check));
- ptrPosNewItem = (IntPtr)(ptrPosNewItem.ToInt64() + 4);
- if (funcItem._pShKey._key != 0)
- {
- IntPtr newShortCutKey = Marshal.AllocHGlobal(4);
- Marshal.StructureToPtr(funcItem._pShKey, newShortCutKey, false);
- Marshal.WriteIntPtr(ptrPosNewItem, newShortCutKey);
- }
- else Marshal.WriteIntPtr(ptrPosNewItem, IntPtr.Zero);
-
- _nativePointer = newPointer;
- }
-
- public void RefreshItems()
- {
- IntPtr ptrPosItem = _nativePointer;
- for (int i = 0; i < _funcItems.Count; i++)
- {
- FuncItem updatedItem = new FuncItem();
- updatedItem._itemName = _funcItems[i]._itemName;
- ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 128);
- updatedItem._pFunc = _funcItems[i]._pFunc;
- ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + IntPtr.Size);
- updatedItem._cmdID = Marshal.ReadInt32(ptrPosItem);
- ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 4);
- updatedItem._init2Check = _funcItems[i]._init2Check;
- ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + 4);
- updatedItem._pShKey = _funcItems[i]._pShKey;
- ptrPosItem = (IntPtr)(ptrPosItem.ToInt64() + IntPtr.Size);
-
- _funcItems[i] = updatedItem;
- }
- }
-
- public IntPtr NativePointer { get { return _nativePointer; } }
- public List Items { get { return _funcItems; } }
-
- public void Dispose()
- {
- if (!_disposed)
- {
- _disposed = true;
- try
- {
- foreach (IntPtr ptr in _shortCutKeys) Marshal.FreeHGlobal(ptr);
- if (_nativePointer != IntPtr.Zero) Marshal.FreeHGlobal(_nativePointer);
- }
- catch { }
- }
- }
- ~FuncItems()
- {
- Dispose();
- }
- }
-
-
- public enum winVer
- {
- WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K,
- WV_XP, WV_S2003, WV_XPX64, WV_VISTA, WV_WIN7, WV_WIN8, WV_WIN81, WV_WIN10
- }
-
-
- [Flags]
- public enum DockMgrMsg : uint
- {
- IDB_CLOSE_DOWN = 137,
- IDB_CLOSE_UP = 138,
- IDD_CONTAINER_DLG = 139,
-
- IDC_TAB_CONT = 1027,
- IDC_CLIENT_TAB = 1028,
- IDC_BTN_CAPTION = 1050,
-
- DMM_MSG = 0x5000,
- DMM_CLOSE = (DMM_MSG + 1),
- DMM_DOCK = (DMM_MSG + 2),
- DMM_FLOAT = (DMM_MSG + 3),
- DMM_DOCKALL = (DMM_MSG + 4),
- DMM_FLOATALL = (DMM_MSG + 5),
- DMM_MOVE = (DMM_MSG + 6),
- DMM_UPDATEDISPINFO = (DMM_MSG + 7),
- DMM_GETIMAGELIST = (DMM_MSG + 8),
- DMM_GETICONPOS = (DMM_MSG + 9),
- DMM_DROPDATA = (DMM_MSG + 10),
- DMM_MOVE_SPLITTER = (DMM_MSG + 11),
- DMM_CANCEL_MOVE = (DMM_MSG + 12),
- DMM_LBUTTONUP = (DMM_MSG + 13),
-
- DMN_FIRST = 1050,
- DMN_CLOSE = (DMN_FIRST + 1),
- //nmhdr.Code = DWORD(DMN_CLOSE, 0));
- //nmhdr.hwndFrom = hwndNpp;
- //nmhdr.IdFrom = ctrlIdNpp;
-
- DMN_DOCK = (DMN_FIRST + 2),
- DMN_FLOAT = (DMN_FIRST + 3)
- //nmhdr.Code = DWORD(DMN_XXX, int newContainer);
- //nmhdr.hwndFrom = hwndNpp;
- //nmhdr.IdFrom = ctrlIdNpp;
- }
-
- [StructLayout(LayoutKind.Sequential)]
- public struct toolbarIcons
- {
- public IntPtr hToolbarBmp;
- public IntPtr hToolbarIcon;
- }
-}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/Preference_h.cs b/CSharpRegexTools4Npp/PluginInfrastructure/Preference_h.cs
index 5282016..3010618 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/Preference_h.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/Preference_h.cs
@@ -4,16 +4,12 @@
// "notepad-plus-plus/scintilla/include/Scintilla.iface"
// found at
// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/include/Scintilla.iface
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-namespace NppPluginNET.PluginInfrastructure
+namespace CSharpRegexTools4Npp.PluginInfrastructure
{
- public enum Preference
- {
- /* ++Autogenerated -- start of section automatically generated from preference_rc.h */
+ public enum Preference
+ {
+ /* ++Autogenerated -- start of section automatically generated from preference_rc.h */
IDD_PREFERENCE_BOX = 6000,
IDC_BUTTON_CLOSE = IDD_PREFERENCE_BOX + 1,
@@ -41,7 +37,7 @@ public enum Preference
IDC_CHECK_TAB_HIDE = IDD_PREFERENCE_BAR_BOX + 18,
IDC_CHECK_TAB_MULTILINE = IDD_PREFERENCE_BAR_BOX + 19,
IDC_CHECK_TAB_VERTICAL = IDD_PREFERENCE_BAR_BOX + 20,
-
+ IDC_CHECK_TAB_LAST_EXIT = IDD_PREFERENCE_BAR_BOX + 21,
IDC_CHECK_HIDEMENUBAR = IDD_PREFERENCE_BAR_BOX + 22,
IDC_LOCALIZATION_GB_STATIC = IDD_PREFERENCE_BAR_BOX + 23,
IDC_COMBO_LOCALIZATION = IDD_PREFERENCE_BAR_BOX + 24,
@@ -56,6 +52,14 @@ public enum Preference
IDC_MONOINST_RADIO = IDD_PREFERENCE_MULTIINSTANCE_BOX + 4,
IDD_STATIC_RESTARTNOTE = IDD_PREFERENCE_MULTIINSTANCE_BOX + 5,
+ IDD_PREFERENCE_WORDCHARLIST_BOX = 6160,
+ IDC_WORDCHARLIST_GB_STATIC = IDD_PREFERENCE_WORDCHARLIST_BOX + 1,
+ IDC_RADIO_WORDCHAR_DEFAULT = IDD_PREFERENCE_WORDCHARLIST_BOX + 2,
+ IDC_RADIO_WORDCHAR_CUSTOM = IDD_PREFERENCE_WORDCHARLIST_BOX + 3,
+ IDC_WORDCHAR_CUSTOM_EDIT = IDD_PREFERENCE_WORDCHARLIST_BOX + 4,
+ IDD_WORDCHAR_QUESTION_BUTTON = IDD_PREFERENCE_WORDCHARLIST_BOX + 5,
+ IDD_STATIC_WORDCHAR_WARNING = IDD_PREFERENCE_WORDCHARLIST_BOX + 6,
+
IDD_PREFERENCE_MARGEIN_BOX = 6200,
IDC_FMS_GB_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 1,
IDC_RADIO_SIMPLE = IDD_PREFERENCE_MARGEIN_BOX + 2,
@@ -66,13 +70,9 @@ public enum Preference
IDC_CHECK_LINENUMBERMARGE = IDD_PREFERENCE_MARGEIN_BOX + 6,
IDC_CHECK_BOOKMARKMARGE = IDD_PREFERENCE_MARGEIN_BOX + 7,
- IDC_CHECK_SHOWVERTICALEDGE = IDD_PREFERENCE_MARGEIN_BOX + 8,
- IDC_NBCOLONE_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 9,
- IDC_COLONENUMBER_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 10,
-
IDC_VES_GB_STATIC = IDD_PREFERENCE_MARGEIN_BOX + 11,
- IDC_RADIO_LNMODE = IDD_PREFERENCE_MARGEIN_BOX + 12,
- IDC_RADIO_BGMODE = IDD_PREFERENCE_MARGEIN_BOX + 13,
+
+ IDC_CHECK_EDGEBGMODE = IDD_PREFERENCE_MARGEIN_BOX + 13,
IDC_CHECK_CURRENTLINEHILITE = IDD_PREFERENCE_MARGEIN_BOX + 14,
IDC_CHECK_SMOOTHFONT = IDD_PREFERENCE_MARGEIN_BOX + 15,
@@ -99,6 +99,11 @@ public enum Preference
IDC_BORDERWIDTH_SLIDER = IDD_PREFERENCE_MARGEIN_BOX + 33,
IDC_CHECK_DISABLEADVANCEDSCROLL = IDD_PREFERENCE_MARGEIN_BOX + 34,
IDC_CHECK_NOEDGE = IDD_PREFERENCE_MARGEIN_BOX + 35,
+ IDC_CHECK_SCROLLBEYONDLASTLINE = IDD_PREFERENCE_MARGEIN_BOX + 36,
+
+ IDC_STATIC_MULTILNMODE_TIP = IDD_PREFERENCE_MARGEIN_BOX + 37,
+ IDC_COLUMNPOS_EDIT = IDD_PREFERENCE_MARGEIN_BOX + 38,
+ IDC_CHECK_RIGHTCLICKKEEPSSELECTION = IDD_PREFERENCE_MARGEIN_BOX + 39,
IDD_PREFERENCE_DELIMITERSETTINGS_BOX = 6250,
IDC_DELIMITERSETTINGS_GB_STATIC = IDD_PREFERENCE_DELIMITERSETTINGS_BOX + 1,
@@ -119,6 +124,17 @@ public enum Preference
IDC_CLOUDPATH_EDIT = IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 8,
IDD_CLOUDPATH_BROWSE_BUTTON = IDD_PREFERENCE_SETTINGSONCLOUD_BOX + 9,
+ IDD_PREFERENCE_SEARCHENGINE_BOX = 6270,
+ IDC_SEARCHENGINES_GB_STATIC = IDD_PREFERENCE_SEARCHENGINE_BOX + 1,
+ IDC_SEARCHENGINE_DUCKDUCKGO_RADIO = IDD_PREFERENCE_SEARCHENGINE_BOX + 2,
+ IDC_SEARCHENGINE_GOOGLE_RADIO = IDD_PREFERENCE_SEARCHENGINE_BOX + 3,
+ IDC_SEARCHENGINE_BING_RADIO = IDD_PREFERENCE_SEARCHENGINE_BOX + 4,
+ IDC_SEARCHENGINE_YAHOO_RADIO = IDD_PREFERENCE_SEARCHENGINE_BOX + 5,
+ IDC_SEARCHENGINE_CUSTOM_RADIO = IDD_PREFERENCE_SEARCHENGINE_BOX + 6,
+ IDC_SEARCHENGINE_EDIT = IDD_PREFERENCE_SEARCHENGINE_BOX + 7,
+ IDD_SEARCHENGINE_NOTE_STATIC = IDD_PREFERENCE_SEARCHENGINE_BOX + 8,
+ IDC_SEARCHENGINE_STACKOVERFLOW_RADIO = IDD_PREFERENCE_SEARCHENGINE_BOX + 9,
+
IDD_PREFERENCE_SETTING_BOX = 6300,
IDC_TABSETTING_GB_STATIC = IDD_PREFERENCE_SETTING_BOX + 1,
IDC_CHECK_REPLACEBYSPACE = IDD_PREFERENCE_SETTING_BOX + 2,
@@ -126,14 +142,12 @@ public enum Preference
IDC_HISTORY_GB_STATIC = IDD_PREFERENCE_SETTING_BOX + 4,
IDC_CHECK_DONTCHECKHISTORY = IDD_PREFERENCE_SETTING_BOX + 5,
IDC_MAXNBFILE_STATIC = IDD_PREFERENCE_SETTING_BOX + 6,
- IDC_CHECK_FILEAUTODETECTION = IDD_PREFERENCE_SETTING_BOX + 7,
IDC_CHECK_MIN2SYSTRAY = IDD_PREFERENCE_SETTING_BOX + 8,
IDC_CHECK_REMEMBERSESSION = IDD_PREFERENCE_SETTING_BOX + 9,
IDC_TABSIZEVAL_STATIC = IDD_PREFERENCE_SETTING_BOX + 10,
IDC_MAXNBFILEVAL_STATIC = IDD_PREFERENCE_SETTING_BOX + 11,
IDC_FILEAUTODETECTION_STATIC = IDD_PREFERENCE_SETTING_BOX + 12,
IDC_CHECK_UPDATESILENTLY = IDD_PREFERENCE_SETTING_BOX + 13,
-
IDC_RADIO_BKNONE = IDD_PREFERENCE_SETTING_BOX + 15,
IDC_RADIO_BKSIMPLE = IDD_PREFERENCE_SETTING_BOX + 16,
IDC_RADIO_BKVERBOSE = IDD_PREFERENCE_SETTING_BOX + 17,
@@ -157,11 +171,19 @@ public enum Preference
IDC_CHECK_BACKSLASHISESCAPECHARACTERFORSQL = IDD_PREFERENCE_SETTING_BOX + 35,
IDC_EDIT_WORKSPACEFILEEXT = IDD_PREFERENCE_SETTING_BOX + 36,
IDC_WORKSPACEFILEEXT_STATIC = IDD_PREFERENCE_SETTING_BOX + 37,
+ IDC_CHECK_SMARTHILITEWHOLEWORDONLY = IDD_PREFERENCE_SETTING_BOX + 38,
+ IDC_CHECK_SMARTHILITEUSEFINDSETTINGS = IDD_PREFERENCE_SETTING_BOX + 39,
+ IDC_CHECK_SMARTHILITEANOTHERRVIEW = IDD_PREFERENCE_SETTING_BOX + 40,
- IDC_PREFERENCE_OFFSET_FLS = 40,
- IDC_CHECK_REMEMBEREDITVIEWPERFILE = IDD_PREFERENCE_SETTING_BOX + IDC_PREFERENCE_OFFSET_FLS + 1,
- IDC_REMEMBEREDITVIEWPERFILE_STATIC = IDD_PREFERENCE_SETTING_BOX + IDC_PREFERENCE_OFFSET_FLS + 2,
- IDC_EDIT_REMEMBEREDITVIEWPERFILE = IDD_PREFERENCE_SETTING_BOX + IDC_PREFERENCE_OFFSET_FLS + 3,
+ IDC_CHECK_REMEMBEREDITVIEWPERFILE = IDD_PREFERENCE_SETTING_BOX + 41,
+ IDC_REMEMBEREDITVIEWPERFILE_STATIC = IDD_PREFERENCE_SETTING_BOX + 42,
+ IDC_EDIT_REMEMBEREDITVIEWPERFILE = IDD_PREFERENCE_SETTING_BOX + 43,
+
+ IDC_DOCUMENTPEEK_STATIC = IDD_PREFERENCE_SETTING_BOX + 44,
+ IDC_CHECK_ENABLEDOCPEEKER = IDD_PREFERENCE_SETTING_BOX + 45,
+ IDC_CHECK_ENABLEDOCPEEKONMAP = IDD_PREFERENCE_SETTING_BOX + 46,
+ IDC_COMBO_FILEUPDATECHOICE = IDD_PREFERENCE_SETTING_BOX + 47,
+ IDC_CHECK_DIRECTWRITE_ENABLE = IDD_PREFERENCE_SETTING_BOX + 49,
IDD_PREFERENCE_NEWDOCSETTING_BOX = 6400,
IDC_FORMAT_GB_STATIC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 1,
@@ -194,6 +216,7 @@ public enum Preference
IDC_CUSTOMIZELENGTHVAL_STATIC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 28,
IDC_DISPLAY_STATIC = IDD_PREFERENCE_NEWDOCSETTING_BOX + 29,
IDC_OPENSAVEDIR_CHECK_USENEWSTYLESAVEDIALOG = IDD_PREFERENCE_NEWDOCSETTING_BOX + 30,
+ IDC_OPENSAVEDIR_CHECK_DRROPFOLDEROPENFILES = IDD_PREFERENCE_NEWDOCSETTING_BOX + 31,
IDD_PREFERENCE_DEFAULTDIRECTORY_BOX = 6450,
IDD_PREFERENCE_RECENTFILESHISTORY_BOX = 6460,
@@ -211,7 +234,7 @@ public enum Preference
IDC_CHECK_DEFAULTTABVALUE = IDD_PREFERENCE_LANG_BOX + 10,
IDC_GR_TABVALUE_STATIC = IDD_PREFERENCE_LANG_BOX + 11,
IDC_TABSIZEVAL_DISABLE_STATIC = IDD_PREFERENCE_LANG_BOX + 12,
- IDD_PREFERENCE_TABSETTINGS_BOX = 6550,
+ IDD_PREFERENCE_HILITE_BOX = 6550,
IDD_PREFERENCE_PRINT_BOX = 6600,
IDC_CHECK_PRINTLINENUM = IDD_PREFERENCE_PRINT_BOX + 1,
@@ -284,6 +307,7 @@ public enum Preference
IDD_BACKUPDIR_RESTORESESSION_STATIC2 = IDD_PREFERENCE_BACKUP_BOX + 21,
IDD_BACKUPDIR_RESTORESESSION_PATHLABEL_STATIC = IDD_PREFERENCE_BACKUP_BOX + 22,
IDD_BACKUPDIR_RESTORESESSION_PATH_EDIT = IDD_PREFERENCE_BACKUP_BOX + 23,
+ IDD_AUTOC_IGNORENUMBERS = IDD_PREFERENCE_BACKUP_BOX + 24,
IDD_PREFERENCE_AUTOCOMPLETION_BOX = 6850,
IDD_AUTOCINSERT_GRPSTATIC = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 1,
@@ -305,6 +329,10 @@ public enum Preference
IDC_MACHEDPAIROPEN_EDIT3 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 17,
IDC_MACHEDPAIRCLOSE_EDIT3 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 18,
- /* --Autogenerated -- end of section automatically generated from preference_rc.h */
- }
+ IDD_PREFERENCE_SEARCHINGSETTINGS_BOX = 6900,
+ IDC_CHECK_STOPFILLINGFINDFIELD = IDD_PREFERENCE_SEARCHINGSETTINGS_BOX + 1,
+ IDC_CHECK_MONOSPACEDFONT_FINDDLG = IDD_PREFERENCE_SEARCHINGSETTINGS_BOX + 2,
+
+ /* --Autogenerated -- end of section automatically generated from preference_rc.h */
+ }
}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/Resource_h.cs b/CSharpRegexTools4Npp/PluginInfrastructure/Resource_h.cs
index 3d59cdf..6edbc92 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/Resource_h.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/Resource_h.cs
@@ -4,12 +4,13 @@
// "notepad-plus-plus/scintilla/include/Scintilla.iface"
// found at
// https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/scintilla/include/Scintilla.iface
+using CSharpRegexTools4Npp.PluginInfrastructure;
namespace CSharpRegexTools4Npp.PluginInfrastructure
{
- public enum Resource
- {
- /* ++Autogenerated -- start of section automatically generated from resource.h */
+ public enum Resource
+ {
+ /* ++Autogenerated -- start of section automatically generated from resource.h */
IDC_STATIC = -1,
@@ -99,6 +100,7 @@ public enum Resource
IDI_UNSAVED_ICON = 502,
IDI_READONLY_ICON = 503,
IDI_FIND_RESULT_ICON = 504,
+ IDI_MONITORING_ICON = 505,
IDI_PROJECT_WORKSPACE = 601,
IDI_PROJECT_WORKSPACEDIRTY = 602,
@@ -109,6 +111,9 @@ public enum Resource
IDI_PROJECT_FILEINVALID = 607,
IDI_FB_ROOTOPEN = 608,
IDI_FB_ROOTCLOSE = 609,
+ IDI_FB_SELECTCURRENTFILE = 610,
+ IDI_FB_FOLDALL = 611,
+ IDI_FB_EXPANDALL = 612,
IDI_FUNCLIST_ROOT = 620,
IDI_FUNCLIST_NODE = 621,
@@ -117,6 +122,15 @@ public enum Resource
IDI_FUNCLIST_SORTBUTTON = 631,
IDI_FUNCLIST_RELOADBUTTON = 632,
+ IDI_VIEW_DOC_MAP_ON_ICON = 633,
+ IDI_VIEW_DOC_MAP_OFF_ICON = 634,
+ IDI_VIEW_FILEBROWSER_ON_ICON = 635,
+ IDI_VIEW_FILEBROWSER_OFF_ICON = 636,
+ IDI_VIEW_FUNCLIST_ON_ICON = 637,
+ IDI_VIEW_FUNCLIST_OFF_ICON = 638,
+ IDI_VIEW_MONITORING_ON_ICON = 639,
+ IDI_VIEW_MONITORING_OFF_ICON = 640,
+
IDC_MY_CUR = 1402,
IDC_UP_ARROW = 1403,
IDC_DRAG_TAB = 1404,
@@ -160,7 +174,6 @@ public enum Resource
IDR_CLOSETAB_INACT = 1531,
IDR_CLOSETAB_HOVER = 1532,
IDR_CLOSETAB_PUSH = 1533,
-
IDR_FUNC_LIST_ICO = 1534,
IDR_DOCMAP_ICO = 1535,
IDR_PROJECTPANEL_ICO = 1536,
@@ -168,6 +181,8 @@ public enum Resource
IDR_ASCIIPANEL_ICO = 1538,
IDR_DOCSWITCHER_ICO = 1539,
IDR_FILEBROWSER_ICO = 1540,
+ IDR_FILEMONITORING = 1541,
+
ID_MACRO = 20000,
ID_MACRO_LIMIT = 20200,
@@ -188,31 +203,31 @@ public enum Resource
IDCMD = 50000,
- IDC_PREV_DOC = IDCMD + 3,
- IDC_NEXT_DOC = IDCMD + 4,
- IDC_EDIT_TOGGLEMACRORECORDING = IDCMD + 5,
+ IDC_PREV_DOC = IDCMD+3,
+ IDC_NEXT_DOC = IDCMD+4,
+ IDC_EDIT_TOGGLEMACRORECORDING = IDCMD+5,
- IDCMD_LIMIT = IDCMD + 20,
+ IDCMD_LIMIT = IDCMD+20,
IDSCINTILLA = 60000,
- IDSCINTILLA_KEY_HOME = IDSCINTILLA + 0,
- IDSCINTILLA_KEY_HOME_WRAP = IDSCINTILLA + 1,
- IDSCINTILLA_KEY_END = IDSCINTILLA + 2,
- IDSCINTILLA_KEY_END_WRAP = IDSCINTILLA + 3,
- IDSCINTILLA_KEY_LINE_DUP = IDSCINTILLA + 4,
- IDSCINTILLA_KEY_LINE_CUT = IDSCINTILLA + 5,
- IDSCINTILLA_KEY_LINE_DEL = IDSCINTILLA + 6,
- IDSCINTILLA_KEY_LINE_TRANS = IDSCINTILLA + 7,
- IDSCINTILLA_KEY_LINE_COPY = IDSCINTILLA + 8,
- IDSCINTILLA_KEY_CUT = IDSCINTILLA + 9,
- IDSCINTILLA_KEY_COPY = IDSCINTILLA + 10,
- IDSCINTILLA_KEY_PASTE = IDSCINTILLA + 11,
- IDSCINTILLA_KEY_DEL = IDSCINTILLA + 12,
- IDSCINTILLA_KEY_SELECTALL = IDSCINTILLA + 13,
- IDSCINTILLA_KEY_OUTDENT = IDSCINTILLA + 14,
- IDSCINTILLA_KEY_UNDO = IDSCINTILLA + 15,
- IDSCINTILLA_KEY_REDO = IDSCINTILLA + 16,
- IDSCINTILLA_LIMIT = IDSCINTILLA + 30,
+ IDSCINTILLA_KEY_HOME = IDSCINTILLA+0,
+ IDSCINTILLA_KEY_HOME_WRAP = IDSCINTILLA+1,
+ IDSCINTILLA_KEY_END = IDSCINTILLA+2,
+ IDSCINTILLA_KEY_END_WRAP = IDSCINTILLA+3,
+ IDSCINTILLA_KEY_LINE_DUP = IDSCINTILLA+4,
+ IDSCINTILLA_KEY_LINE_CUT = IDSCINTILLA+5,
+ IDSCINTILLA_KEY_LINE_DEL = IDSCINTILLA+6,
+ IDSCINTILLA_KEY_LINE_TRANS = IDSCINTILLA+7,
+ IDSCINTILLA_KEY_LINE_COPY = IDSCINTILLA+8,
+ IDSCINTILLA_KEY_CUT = IDSCINTILLA+9,
+ IDSCINTILLA_KEY_COPY = IDSCINTILLA+10,
+ IDSCINTILLA_KEY_PASTE = IDSCINTILLA+11,
+ IDSCINTILLA_KEY_DEL = IDSCINTILLA+12,
+ IDSCINTILLA_KEY_SELECTALL = IDSCINTILLA+13,
+ IDSCINTILLA_KEY_OUTDENT = IDSCINTILLA+14,
+ IDSCINTILLA_KEY_UNDO = IDSCINTILLA+15,
+ IDSCINTILLA_KEY_REDO = IDSCINTILLA+16,
+ IDSCINTILLA_LIMIT = IDSCINTILLA+30,
IDD_FILEVIEW_DIALOG = 1000,
@@ -238,11 +253,15 @@ public enum Resource
IDC_ONLINEHELP_ADDR = 1704,
IDC_AUTHOR_NAME = 1705,
IDC_BUILD_DATETIME = 1706,
+ IDC_VERSION_BIT = 1707,
IDD_DEBUGINFOBOX = 1750,
IDC_DEBUGINFO_EDIT = 1751,
IDC_DEBUGINFO_COPYLINK = 1752,
+ IDD_DOSAVEORNOTBOX = 1760,
+ IDC_DOSAVEORNOTTEX = 1761,
+
IDD_GOLINE = 2000,
ID_GOLINE_EDIT = IDD_GOLINE + 1,
ID_CURRLINE = IDD_GOLINE + 2,
@@ -290,7 +309,7 @@ public enum Resource
NPPM_INTERNAL_RELOADNATIVELANG = NOTEPADPLUS_USER_INTERNAL + 25,
NPPM_INTERNAL_PLUGINSHORTCUTMOTIFIED = NOTEPADPLUS_USER_INTERNAL + 26,
NPPM_INTERNAL_SCINTILLAFINFERCLEARALL = NOTEPADPLUS_USER_INTERNAL + 27,
- NPPM_INTERNAL_SETTING_EDGE_SIZE = NOTEPADPLUS_USER_INTERNAL + 28,
+
NPPM_INTERNAL_SETTING_TAB_REPLCESPACE = NOTEPADPLUS_USER_INTERNAL + 29,
NPPM_INTERNAL_SETTING_TAB_SIZE = NOTEPADPLUS_USER_INTERNAL + 30,
NPPM_INTERNAL_RELOADSTYLERS = NOTEPADPLUS_USER_INTERNAL + 31,
@@ -304,6 +323,17 @@ public enum Resource
NPPM_INTERNAL_SAVECURRENTSESSION = NOTEPADPLUS_USER_INTERNAL + 39,
NPPM_INTERNAL_FINDINFINDERDLG = NOTEPADPLUS_USER_INTERNAL + 40,
NPPM_INTERNAL_REMOVEFINDER = NOTEPADPLUS_USER_INTERNAL + 41,
+ NPPM_INTERNAL_RELOADSCROLLTOEND = NOTEPADPLUS_USER_INTERNAL + 42,
+ NPPM_INTERNAL_FINDKEYCONFLICTS = NOTEPADPLUS_USER_INTERNAL + 43,
+ NPPM_INTERNAL_SCROLLBEYONDLASTLINE = NOTEPADPLUS_USER_INTERNAL + 44,
+ NPPM_INTERNAL_SETWORDCHARS = NOTEPADPLUS_USER_INTERNAL + 45,
+ NPPM_INTERNAL_EXPORTFUNCLISTANDQUIT = NOTEPADPLUS_USER_INTERNAL + 46,
+ NPPM_INTERNAL_PRNTANDQUIT = NOTEPADPLUS_USER_INTERNAL + 47,
+ NPPM_INTERNAL_SAVEBACKUP = NOTEPADPLUS_USER_INTERNAL + 48,
+ NPPM_INTERNAL_STOPMONITORING = NOTEPADPLUS_USER_INTERNAL + 49,
+ NPPM_INTERNAL_EDGEBACKGROUND = NOTEPADPLUS_USER_INTERNAL + 50,
+ NPPM_INTERNAL_EDGEMULTISETSIZE = NOTEPADPLUS_USER_INTERNAL + 51,
+ NPPM_INTERNAL_UPDATECLICKABLELINKS = NOTEPADPLUS_USER_INTERNAL + 52,
NPPM_INTERNAL_CHECKDOCSTATUS = Constants.NPPMSG + 53,
@@ -313,10 +343,6 @@ public enum Resource
CHECKDOCOPT_UPDATESILENTLY = 1,
CHECKDOCOPT_UPDATEGO2END = 2,
- NPPM_INTERNAL_GETCHECKDOCOPT = Constants.NPPMSG + 55,
-
- NPPM_INTERNAL_SETCHECKDOCOPT = Constants.NPPMSG + 56,
-
NPPM_INTERNAL_SETFILENAME = Constants.NPPMSG + 63,
SCINTILLA_USER = Constants.WM_USER + 2000,
@@ -337,9 +363,10 @@ public enum Resource
MENUINDEX_FORMAT = 4,
MENUINDEX_LANGUAGE = 5,
MENUINDEX_SETTINGS = 6,
- MENUINDEX_MACRO = 7,
- MENUINDEX_RUN = 8,
- MENUINDEX_PLUGINS = 9,
- /* --Autogenerated -- end of section automatically generated from resource.h */
- }
+ MENUINDEX_TOOLS = 7,
+ MENUINDEX_MACRO = 8,
+ MENUINDEX_RUN = 9,
+ MENUINDEX_PLUGINS = 10,
+ /* --Autogenerated -- end of section automatically generated from resource.h */
+ }
}
diff --git a/CSharpRegexTools4Npp/PluginInfrastructure/ScintillaGateway.cs b/CSharpRegexTools4Npp/PluginInfrastructure/ScintillaGateway.cs
index 1e4298f..680e2f2 100644
--- a/CSharpRegexTools4Npp/PluginInfrastructure/ScintillaGateway.cs
+++ b/CSharpRegexTools4Npp/PluginInfrastructure/ScintillaGateway.cs
@@ -12,7 +12,7 @@ namespace CSharpRegexTools4Npp.PluginInfrastructure
///
/// See http://www.scintilla.org/ScintillaDoc.html for further details.
///
- public class ScintillaGateway : IScintillaGateway
+ public class ScintillaGateway
{
private const int Unused = 0;
@@ -20,6 +20,45 @@ public class ScintillaGateway : IScintillaGateway
public static readonly int LengthZeroTerminator = "\0".Length;
+ ///
+ /// if bytes is null, returns null.
+ /// Else, returns bytes decoded from UTF-8 as a string, with all trailing NULL bytes stripped off.
+ ///
+ public static string Utf8BytesToNullStrippedString(byte[] bytes)
+ {
+ if (bytes is null)
+ return null;
+ int lastNullCharPos = bytes.Length - 1;
+ // this only bypasses NULL chars because no char
+ // other than NULL can have any 0-valued bytes in UTF-8.
+ // See https://en.wikipedia.org/wiki/UTF-8#Encoding
+ for (; lastNullCharPos >= 0 && bytes[lastNullCharPos] == '\x00'; lastNullCharPos--) { }
+ return Encoding.UTF8.GetString(bytes, 0, lastNullCharPos + 1);
+ }
+
+ ///
+ /// Recall that all Scintilla methods have the signature
+ /// (scintilla* scin, SciMsg msg, void* wParam, void* lParam) -> void*
+ /// Many of these scintilla methods are bimodal in the following way
+ /// * if lParam is 0, return the length of the buffer to be filled and have no side effects. The wParam may be involved in telling Scintilla how big the buffer needs to be.
+ /// * if lParam is greater than 0, it is assumed to be a pointer to a buffer. Now the wParam indicates what the text will need to be.