Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Commit 4e617b2

Browse files
committed
removed functionality that is now code-generated
1 parent 034971b commit 4e617b2

File tree

3 files changed

+5
-48
lines changed

3 files changed

+5
-48
lines changed

Demo Plugin/NppManagedPluginDemo/Demo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,21 @@ static void callbackHelloFX()
168168
{
169169
for ( ; i >= -10; i--)
170170
{
171-
editor.SetZoomLevel(i);
171+
editor.SetZoom(i);
172172
Thread.Sleep(30);
173173
}
174174
Thread.Sleep(100);
175175
for ( ; i <= 20 ; i++)
176176
{
177177
Thread.Sleep(30);
178-
editor.SetZoomLevel(i);
178+
editor.SetZoom(i);
179179
}
180180
Thread.Sleep(100);
181181
}
182182
for ( ; i >= currentZoomLevel ; i--)
183183
{
184184
Thread.Sleep(30);
185-
editor.SetZoomLevel(i);
185+
editor.SetZoom(i);
186186
}
187187
}
188188

Visual Studio Project Template C#/PluginInfrastructure/IScintillaGateway.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ public interface INotepadPPGateway
1818
public interface IScintillaGateway
1919
{
2020
int GetSelectionLength();
21-
void SetZoomLevel(int zoomLevel);
22-
unsafe string GetSelectedText();
23-
unsafe void ReplaceSelectedText(string newText);
2421
unsafe void AppendTextAndMoveCursor(string text);
2522

2623

Visual Studio Project Template C#/PluginInfrastructure/ScintillaGateway.cs

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public void FileNew()
1919
///
2020
/// See http://www.scintilla.org/ScintillaDoc.html for further details.
2121
/// </summary>
22-
public class ScintillaGateway : IScintillaGateway
22+
public class ScintillaGateway : IScintillaGateway
2323
{
2424
private const int Unused = 0;
2525

@@ -32,40 +32,10 @@ public ScintillaGateway(IntPtr scintilla)
3232

3333
public int GetSelectionLength()
3434
{
35-
var selectionLength = (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, 0, 0);
35+
var selectionLength = (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, Unused, Unused);
3636
return selectionLength;
3737
}
3838

39-
public void SetZoomLevel(int zoomLevel)
40-
{
41-
Win32.SendMessage(scintilla, SciMsg.SCI_SETZOOM, zoomLevel, 0);
42-
}
43-
44-
public unsafe string GetSelectedText()
45-
{
46-
var selectionLength = GetSelectionLength();
47-
if (selectionLength == 0)
48-
return "";
49-
50-
var buffer = new byte[selectionLength + 1];
51-
fixed (byte* ptr = buffer)
52-
{
53-
Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, 0, (IntPtr)ptr);
54-
}
55-
56-
var selected = Encoding.UTF8.GetString(buffer).TrimEnd('\0');
57-
return selected;
58-
}
59-
60-
public unsafe void AppendText(string text)
61-
{
62-
byte[] buffer = Encoding.UTF8.GetBytes(text);
63-
fixed (byte* ptr = buffer)
64-
{
65-
Win32.SendMessage(scintilla, SciMsg.SCI_APPENDTEXT, buffer.Length, (IntPtr)ptr);
66-
}
67-
}
68-
6939
public unsafe void AppendTextAndMoveCursor(string text)
7040
{
7141
byte[] buffer = Encoding.UTF8.GetBytes(text);
@@ -76,16 +46,6 @@ public unsafe void AppendTextAndMoveCursor(string text)
7646
}
7747
}
7848

79-
public unsafe void ReplaceSelectedText(string newText)
80-
{
81-
byte[] buffer = Encoding.UTF8.GetBytes(newText);
82-
fixed (byte* ptr = buffer)
83-
{
84-
Win32.SendMessage(scintilla, SciMsg.SCI_REPLACESEL, Unused, (IntPtr)ptr);
85-
}
86-
}
87-
88-
8949

9050

9151
/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */

0 commit comments

Comments
 (0)