Permalink
Browse files

Merge pull request #22 from lipnitsk/master

Fix code to support 64-bit
  • Loading branch information...
kbilsted committed Feb 7, 2017
2 parents c984e36 + df11d42 commit a9c44746380ca3af7a147a5466342c632e2b0d80
@@ -878,14 +878,14 @@ public interface IScintillaGateway
int GetTextLength();
/// <summary>Retrieve a pointer to a function that processes messages for this Scintilla. (Scintilla feature 2184)</summary>
int GetDirectFunction();
IntPtr GetDirectFunction();
/// <summary>
/// Retrieve a pointer value to use as the first argument when calling
/// the function returned by GetDirectFunction.
/// (Scintilla feature 2185)
/// </summary>
int GetDirectPointer();
IntPtr GetDirectPointer();
/// <summary>Set to overtype (true) or insert mode. (Scintilla feature 2186)</summary>
void SetOvertype(bool overtype);
@@ -1503,10 +1503,10 @@ public interface IScintillaGateway
void SetViewEOL(bool visible);
/// <summary>Retrieve a pointer to the document object. (Scintilla feature 2357)</summary>
int GetDocPointer();
IntPtr GetDocPointer();
/// <summary>Change the document object used. (Scintilla feature 2358)</summary>
void SetDocPointer(int pointer);
void SetDocPointer(IntPtr pointer);
/// <summary>Set which document modification events are sent to the container. (Scintilla feature 2359)</summary>
void SetModEventMask(int mask);
@@ -1985,15 +1985,15 @@ public interface IScintillaGateway
/// characters in the document.
/// (Scintilla feature 2520)
/// </summary>
int GetCharacterPointer();
IntPtr GetCharacterPointer();
/// <summary>
/// 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)
/// </summary>
int GetRangePointer(int position, int rangeLength);
IntPtr GetRangePointer(int position, int rangeLength);
/// <summary>
/// Return a position which, to avoid performance costs, should not be within
@@ -1801,21 +1801,19 @@ public int GetTextLength()
}
/// <summary>Retrieve a pointer to a function that processes messages for this Scintilla. (Scintilla feature 2184)</summary>
public int GetDirectFunction()
public IntPtr GetDirectFunction()
{
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTFUNCTION, Unused, Unused);
return (int) res;
return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTFUNCTION, Unused, Unused);
}
/// <summary>
/// Retrieve a pointer value to use as the first argument when calling
/// the function returned by GetDirectFunction.
/// (Scintilla feature 2185)
/// </summary>
public int GetDirectPointer()
public IntPtr GetDirectPointer()
{
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTPOINTER, Unused, Unused);
return (int) res;
return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTPOINTER, Unused, Unused);
}
/// <summary>Set to overtype (true) or insert mode. (Scintilla feature 2186)</summary>
@@ -2992,14 +2990,13 @@ public void SetViewEOL(bool visible)
}
/// <summary>Retrieve a pointer to the document object. (Scintilla feature 2357)</summary>
public int GetDocPointer()
public IntPtr GetDocPointer()
{
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETDOCPOINTER, Unused, Unused);
return (int) res;
return Win32.SendMessage(scintilla, SciMsg.SCI_GETDOCPOINTER, Unused, Unused);
}
/// <summary>Change the document object used. (Scintilla feature 2358)</summary>
public void SetDocPointer(int pointer)
public void SetDocPointer(IntPtr pointer)
{
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETDOCPOINTER, Unused, pointer);
}
@@ -3936,10 +3933,9 @@ public void CopyAllowLine()
/// characters in the document.
/// (Scintilla feature 2520)
/// </summary>
public int GetCharacterPointer()
public IntPtr GetCharacterPointer()
{
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERPOINTER, Unused, Unused);
return (int) res;
return Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERPOINTER, Unused, Unused);
}
/// <summary>
@@ -3948,10 +3944,9 @@ public int GetCharacterPointer()
/// to rangeLength bytes.
/// (Scintilla feature 2643)
/// </summary>
public int GetRangePointer(int position, int rangeLength)
public IntPtr GetRangePointer(int position, int rangeLength)
{
IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRANGEPOINTER, position, rangeLength);
return (int) res;
return Win32.SendMessage(scintilla, SciMsg.SCI_GETRANGEPOINTER, position, rangeLength);
}
/// <summary>
@@ -26,7 +26,7 @@ public struct ScNotificationHeader
/// <summary>
/// CtrlID of the window issuing the notification
/// </summary>
public uint IdFrom;
public IntPtr IdFrom;
/// <summary>
/// The SCN_* notification Code
@@ -46,8 +46,8 @@ public struct ScNotification
public int Length; /* SCN_MODIFIED */
public int LinesAdded; /* SCN_MODIFIED */
public int Message; /* SCN_MACRORECORD */
public uint wParam; /* SCN_MACRORECORD */
public int lParam; /* SCN_MACRORECORD */
public IntPtr wParam; /* SCN_MACRORECORD */
public IntPtr lParam; /* SCN_MACRORECORD */
/// <summary>
/// 0-based index
@@ -15,7 +15,7 @@ public class Win32
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, NppMenuCmd lParam);
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
@@ -24,7 +24,7 @@ public class Win32
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, IntPtr lParam);
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
@@ -33,7 +33,7 @@ public class Win32
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam);
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
@@ -42,123 +42,167 @@ public class Win32
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, out int lParam);
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, out IntPtr lParam);
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, int lParam);
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, NppMenuCmd lParam)
{
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), new IntPtr((uint)lParam));
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, IntPtr lParam)
{
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, ref LangType lParam);
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam)
{
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), new IntPtr(lParam));
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, out int lParam)
{
IntPtr outVal;
IntPtr retval = SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), out outVal);
lParam = outVal.ToInt32();
return retval;
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, int lParam)
{
return SendMessage(hWnd, (UInt32)Msg, wParam, new IntPtr(lParam));
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam);
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam)
{
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder lParam);
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, [MarshalAs(UnmanagedType.LPWStr)] string lParam)
{
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}
// TODO KBG Experimental
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, IntPtr lParam);
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, int lParam)
{
return SendMessage(hWnd, (UInt32)Msg, wParam, new IntPtr(lParam));
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, int lParam);
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, IntPtr lParam)
{
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, IntPtr lParam);
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, string lParam)
{
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, string lParam);
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lParam)
{
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), lParam);
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, [MarshalAs(UnmanagedType.LPStr)] StringBuilder lParam);
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, int lParam)
{
return SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), new IntPtr(lParam));
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
[DllImport("user32")]
public static extern IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, int wParam, int lParam);
public static IntPtr SendMessage(IntPtr hWnd, SciMsg Msg, IntPtr wParam, IntPtr lParam)
{
return SendMessage(hWnd, (UInt32)Msg, wParam, lParam);
}
/// <summary>
/// You should try to avoid calling this method in your plugin code. Rather use one of the gateways such as
/// <see cref="ScintillaGateway"/> or <see cref="NotepadPPGateway"/>.
/// If gateways are missing or incomplete, please help extend them and send your code to the project
/// at https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net
/// </summary>
public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, ref LangType lParam)
{
IntPtr outVal;
IntPtr retval = SendMessage(hWnd, (UInt32)Msg, new IntPtr(wParam), out outVal);
lParam = (LangType)outVal;
return retval;
}
public const int MAX_PATH = 260;
@@ -186,4 +230,4 @@ public class Win32
[DllImport("kernel32")]
public static extern void OutputDebugString(string lpOutputString);
}
}
}

0 comments on commit a9c4474

Please sign in to comment.