From b7797edf1085231bcb84f32beede58290712aa8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Henrique=20Guard=C3=A3o=20Gandarez?= Date: Fri, 9 Oct 2020 20:09:04 -0300 Subject: [PATCH 1/3] update PluginInfrastructure folder --- .../PluginInfrastructure/ClikeStringArray.cs | 27 +- .../DllExport/NppPlugin.DllExport.targets | 10 +- .../PluginInfrastructure/GatewayDomain.cs | 728 ++++- .../PluginInfrastructure/IScintillaGateway.cs | 829 ++--- WakaTime/PluginInfrastructure/Msgs_h.cs | 99 +- .../PluginInfrastructure/NotepadPPGateway.cs | 42 +- WakaTime/PluginInfrastructure/Preference_h.cs | 60 +- WakaTime/PluginInfrastructure/Resource_h.cs | 44 +- .../PluginInfrastructure/ScintillaGateway.cs | 2669 +++++++++-------- .../PluginInfrastructure/Scintilla_iface.cs | 507 +++- WakaTime/PluginInfrastructure/Win32.cs | 3 - WakaTime/WakaTime.csproj | 1 + 12 files changed, 3079 insertions(+), 1940 deletions(-) diff --git a/WakaTime/PluginInfrastructure/ClikeStringArray.cs b/WakaTime/PluginInfrastructure/ClikeStringArray.cs index 86296ba..7bc1b21 100644 --- a/WakaTime/PluginInfrastructure/ClikeStringArray.cs +++ b/WakaTime/PluginInfrastructure/ClikeStringArray.cs @@ -1,7 +1,9 @@ // NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc. using System; using System.Collections.Generic; +using System.Reflection; using System.Runtime.InteropServices; +using System.Windows.Forms; namespace Kbg.NppPluginNET.PluginInfrastructure { @@ -18,10 +20,10 @@ public ClikeStringArray(int num, int stringCapacity) for (int i = 0; i < num; i++) { IntPtr item = Marshal.AllocHGlobal(stringCapacity); - Marshal.WriteIntPtr((IntPtr)((int)_nativeArray + (i * IntPtr.Size)), item); + Marshal.WriteIntPtr(_nativeArray + (i * IntPtr.Size), item); _nativeItems.Add(item); } - Marshal.WriteIntPtr((IntPtr)((int)_nativeArray + (num * IntPtr.Size)), IntPtr.Zero); + Marshal.WriteIntPtr(_nativeArray + (num * IntPtr.Size), IntPtr.Zero); } public ClikeStringArray(List lstStrings) { @@ -30,10 +32,10 @@ public ClikeStringArray(List lstStrings) for (int i = 0; i < lstStrings.Count; i++) { IntPtr item = Marshal.StringToHGlobalUni(lstStrings[i]); - Marshal.WriteIntPtr((IntPtr)((int)_nativeArray + (i * IntPtr.Size)), item); + Marshal.WriteIntPtr(_nativeArray + (i * IntPtr.Size), item); _nativeItems.Add(item); } - Marshal.WriteIntPtr((IntPtr)((int)_nativeArray + (lstStrings.Count * IntPtr.Size)), IntPtr.Zero); + Marshal.WriteIntPtr(_nativeArray + (lstStrings.Count * IntPtr.Size), IntPtr.Zero); } public IntPtr NativePointer { get { return _nativeArray; } } @@ -52,12 +54,19 @@ List _getManagedItems(bool unicode) public void Dispose() { - if (!_disposed) + try { - 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; + 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 (Exception e) + { + MessageBox.Show(MethodBase.GetCurrentMethod().ToString() +": "+ e.Message, this.GetType().Name); } } ~ClikeStringArray() diff --git a/WakaTime/PluginInfrastructure/DllExport/NppPlugin.DllExport.targets b/WakaTime/PluginInfrastructure/DllExport/NppPlugin.DllExport.targets index 4386eee..b7bdd41 100644 --- a/WakaTime/PluginInfrastructure/DllExport/NppPlugin.DllExport.targets +++ b/WakaTime/PluginInfrastructure/DllExport/NppPlugin.DllExport.targets @@ -30,17 +30,13 @@ On 32 bit windows usually C:\Program Files\ On 64 bit windows usually C:\Program Files (x86)\ $(ProgramW6432) points to the 64bit Program Files (on 32 bit windows it is blank) --> - + - + ContinueOnError="false" /> + - /// + /// /// /// a number 0-255 /// a number 0-255 @@ -202,7 +202,6 @@ public Cells(char[] charactersAndStyles) { this.charactersAndStyles = charactersAndStyles; } - public char[] Value { get { return charactersAndStyles; } } } @@ -230,11 +229,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() @@ -268,6 +264,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/WakaTime/PluginInfrastructure/IScintillaGateway.cs b/WakaTime/PluginInfrastructure/IScintillaGateway.cs index 5c16488..981e1b7 100644 --- a/WakaTime/PluginInfrastructure/IScintillaGateway.cs +++ b/WakaTime/PluginInfrastructure/IScintillaGateway.cs @@ -13,27 +13,6 @@ namespace Kbg.NppPluginNET.PluginInfrastructure /// public interface IScintillaGateway { - /// - /// Change the Scintilla window handle for this Gateway - /// and return the previous handle for potentially final updates. - /// - /// - /// - IntPtr SetScintillaHandle(IntPtr newHandle); - - /// - /// Switch the handle between main and second window handle. - /// - void SwitchScintillaHandle(); - - /// - /// Return the current Scintilla window handle - /// - /// - IntPtr GetScintillaHandle(); - - IntPtr CurrentBufferID { get; set; } - int GetSelectionLength(); void AppendTextAndMoveCursor(string text); void InsertTextAndMoveCursor(string text); @@ -61,7 +40,7 @@ public interface IScintillaGateway unsafe void AddStyledText(int length, Cells c); /// Insert string at a position. (Scintilla feature 2003) - unsafe void InsertText(Position pos, string text); + unsafe void InsertText(int 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); @@ -70,7 +49,7 @@ public interface IScintillaGateway void ClearAll(); /// Delete a range of text in the document. (Scintilla feature 2645) - void DeleteRange(Position pos, int deleteLength); + void DeleteRange(int start, int lengthDelete); /// Set all style bytes to 0, remove all folding information. (Scintilla feature 2005) void ClearDocumentStyle(); @@ -79,16 +58,16 @@ public interface IScintillaGateway int GetLength(); /// Returns the character byte at the position. (Scintilla feature 2007) - int GetCharAt(Position pos); + int GetCharAt(int pos); /// Returns the position of the caret. (Scintilla feature 2008) - Position GetCurrentPos(); + int GetCurrentPos(); /// Returns the position of the opposite end of the selection to the caret. (Scintilla feature 2009) - Position GetAnchor(); + int GetAnchor(); /// Returns the style byte at the position. (Scintilla feature 2010) - int GetStyleAt(Position pos); + int GetStyleAt(int pos); /// Redoes the next action on the undo history. (Scintilla feature 2011) void Redo(); @@ -121,10 +100,10 @@ public interface IScintillaGateway bool CanRedo(); /// Retrieve the line number at which a particular marker is located. (Scintilla feature 2017) - int MarkerLineFromHandle(int handle); + int MarkerLineFromHandle(int markerHandle); /// Delete a marker. (Scintilla feature 2018) - void MarkerDeleteHandle(int handle); + void MarkerDeleteHandle(int markerHandle); /// Is undo history being collected? (Scintilla feature 2019) bool GetUndoCollection(); @@ -134,33 +113,43 @@ public interface IScintillaGateway /// Returns one of SCWS_* constants. /// (Scintilla feature 2020) /// - int GetViewWS(); + WhiteSpace GetViewWS(); /// Make white space characters invisible, always visible or visible outside indentation. (Scintilla feature 2021) - void SetViewWS(int viewWS); + void SetViewWS(WhiteSpace viewWS); + + /// + /// Retrieve the current tab draw mode. + /// Returns one of SCTD_* constants. + /// (Scintilla feature 2698) + /// + TabDrawMode GetTabDrawMode(); + + /// Set how tabs are drawn when visible. (Scintilla feature 2699) + void SetTabDrawMode(TabDrawMode tabDrawMode); /// Find the position from a point within the window. (Scintilla feature 2022) - Position PositionFromPoint(int x, int y); + int 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); + int 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); + void GotoPos(int caret); /// /// 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); + void SetAnchor(int anchor); /// /// Retrieve the text of the line containing the caret. @@ -171,23 +160,23 @@ public interface IScintillaGateway unsafe string GetCurLine(int length); /// Retrieve the position of the last correctly styled character. (Scintilla feature 2028) - Position GetEndStyled(); + int GetEndStyled(); /// Convert all line endings in the document to one mode. (Scintilla feature 2029) - void ConvertEOLs(int eolMode); + void ConvertEOLs(EndOfLine eolMode); /// Retrieve the current end of line mode - one of CRLF, CR, or LF. (Scintilla feature 2030) - int GetEOLMode(); + EndOfLine GetEOLMode(); /// Set the current end of line mode. (Scintilla feature 2031) - void SetEOLMode(int eolMode); + void SetEOLMode(EndOfLine 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. + /// Set the current styling position to start. + /// The unused parameter is no longer used and should be set to 0. /// (Scintilla feature 2032) /// - void StartStyling(Position pos, int mask); + void StartStyling(int start, int unused); /// /// Change style from current styling position for length characters to a style @@ -228,14 +217,14 @@ public interface IScintillaGateway /// void SetCodePage(int codePage); - /// Is the IME displayed in a winow or inline? (Scintilla feature 2678) - int GetIMEInteraction(); + /// Is the IME displayed in a window or inline? (Scintilla feature 2678) + IMEInteraction GetIMEInteraction(); /// Choose to display the the IME in a winow or inline. (Scintilla feature 2679) - void SetIMEInteraction(int imeInteraction); + void SetIMEInteraction(IMEInteraction imeInteraction); /// Set the symbol used for a particular marker number. (Scintilla feature 2040) - void MarkerDefine(int markerNumber, int markerSymbol); + void MarkerDefine(int markerNumber, MarkerSymbol markerSymbol); /// Set the foreground colour used for a particular marker number. (Scintilla feature 2041) void MarkerSetFore(int markerNumber, Colour fore); @@ -275,16 +264,16 @@ public interface IScintillaGateway unsafe void MarkerDefinePixmap(int markerNumber, string pixmap); /// Add a set of markers to a line. (Scintilla feature 2466) - void MarkerAddSet(int line, int set); + void MarkerAddSet(int line, int markerSet); /// 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); + void MarkerSetAlpha(int markerNumber, Alpha alpha); /// Set a margin to be either numeric or symbolic. (Scintilla feature 2240) - void SetMarginTypeN(int margin, int marginType); + void SetMarginTypeN(int margin, MarginType marginType); /// Retrieve the type of a margin. (Scintilla feature 2241) - int GetMarginTypeN(int margin); + MarginType GetMarginTypeN(int margin); /// Set the width of a margin to a width expressed in pixels. (Scintilla feature 2242) void SetMarginWidthN(int margin, int pixelWidth); @@ -305,10 +294,22 @@ public interface IScintillaGateway bool GetMarginSensitiveN(int margin); /// Set the cursor shown when the mouse is inside a margin. (Scintilla feature 2248) - void SetMarginCursorN(int margin, int cursor); + void SetMarginCursorN(int margin, CursorShape cursor); /// Retrieve the cursor shown in a margin. (Scintilla feature 2249) - int GetMarginCursorN(int margin); + CursorShape GetMarginCursorN(int margin); + + /// Set the background colour of a margin. Only visible for SC_MARGIN_COLOUR. (Scintilla feature 2250) + void SetMarginBackN(int margin, Colour back); + + /// Retrieve the background colour of a margin (Scintilla feature 2251) + Colour GetMarginBackN(int margin); + + /// Allocate a non-standard number of margins. (Scintilla feature 2252) + void SetMargins(int margins); + + /// How many margins are there?. (Scintilla feature 2253) + int GetMargins(); /// Clear all the styles and make equivalent to the global default style. (Scintilla feature 2050) void StyleClearAll(); @@ -332,7 +333,7 @@ public interface IScintillaGateway 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); + void StyleSetEOLFilled(int style, bool eolFilled); /// Reset the default style to its state at startup (Scintilla feature 2058) void StyleResetDefault(); @@ -370,10 +371,10 @@ public interface IScintillaGateway bool StyleGetUnderline(int style); /// Get is a style mixed case, or to force upper or lower case. (Scintilla feature 2489) - int StyleGetCase(int style); + CaseVisible StyleGetCase(int style); /// Get the character get of the font in a style. (Scintilla feature 2490) - int StyleGetCharacterSet(int style); + CharacterSet StyleGetCharacterSet(int style); /// Get is a style visible or not. (Scintilla feature 2491) bool StyleGetVisible(int style); @@ -389,22 +390,22 @@ public interface IScintillaGateway 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); + void StyleSetCase(int style, CaseVisible caseVisible); /// Set the size of characters of a style. Size is in points multiplied by 100. (Scintilla feature 2061) - void StyleSetSizeFractional(int style, int caseForce); + void StyleSetSizeFractional(int style, int sizeHundredthPoints); /// 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); + void StyleSetWeight(int style, FontWeight weight); /// Get the weight of characters of a style. (Scintilla feature 2064) - int StyleGetWeight(int style); + FontWeight StyleGetWeight(int style); /// Set the character set of the font in a style. (Scintilla feature 2066) - void StyleSetCharacterSet(int style, int characterSet); + void StyleSetCharacterSet(int style, CharacterSet characterSet); /// Set a style to be a hotspot or not. (Scintilla feature 2409) void StyleSetHotSpot(int style, bool hotspot); @@ -416,10 +417,10 @@ public interface IScintillaGateway void SetSelBack(bool useSetting, Colour back); /// Get the alpha of the selection. (Scintilla feature 2477) - int GetSelAlpha(); + Alpha GetSelAlpha(); /// Set the alpha of the selection. (Scintilla feature 2478) - void SetSelAlpha(int alpha); + void SetSelAlpha(Alpha alpha); /// Is the selection end of line filled? (Scintilla feature 2479) bool GetSelEOLFilled(); @@ -430,11 +431,11 @@ public interface IScintillaGateway /// 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 keyDefinition is pressed perform sciCommand. (Scintilla feature 2070) + void AssignCmdKey(KeyModifier keyDefinition, int sciCommand); - /// When key+modifier combination km is pressed do nothing. (Scintilla feature 2071) - void ClearCmdKey(KeyModifier km); + /// When key+modifier combination keyDefinition is pressed do nothing. (Scintilla feature 2071) + void ClearCmdKey(KeyModifier keyDefinition); /// Drop all key mappings. (Scintilla feature 2072) void ClearAllCmdKeys(); @@ -465,6 +466,12 @@ public interface IScintillaGateway /// unsafe string GetWordChars(); + /// Set the number of characters to have directly indexed categories (Scintilla feature 2720) + void SetCharacterCategoryOptimization(int countCharacters); + + /// Get the number of characters to have directly indexed categories (Scintilla feature 2721) + int GetCharacterCategoryOptimization(); + /// /// Start a sequence of actions that is undone and redone as a unit. /// May be nested. @@ -476,40 +483,40 @@ public interface IScintillaGateway void EndUndoAction(); /// Set an indicator to plain, squiggle or TT. (Scintilla feature 2080) - void IndicSetStyle(int indic, int style); + void IndicSetStyle(int indicator, IndicatorStyle indicatorStyle); /// Retrieve the style of an indicator. (Scintilla feature 2081) - int IndicGetStyle(int indic); + IndicatorStyle IndicGetStyle(int indicator); /// Set the foreground colour of an indicator. (Scintilla feature 2082) - void IndicSetFore(int indic, Colour fore); + void IndicSetFore(int indicator, Colour fore); /// Retrieve the foreground colour of an indicator. (Scintilla feature 2083) - Colour IndicGetFore(int indic); + Colour IndicGetFore(int indicator); /// Set an indicator to draw under text or over(default). (Scintilla feature 2510) - void IndicSetUnder(int indic, bool under); + void IndicSetUnder(int indicator, bool under); /// Retrieve whether indicator drawn under or over text. (Scintilla feature 2511) - bool IndicGetUnder(int indic); + bool IndicGetUnder(int indicator); /// Set a hover indicator to plain, squiggle or TT. (Scintilla feature 2680) - void IndicSetHoverStyle(int indic, int style); + void IndicSetHoverStyle(int indicator, IndicatorStyle indicatorStyle); /// Retrieve the hover style of an indicator. (Scintilla feature 2681) - int IndicGetHoverStyle(int indic); + IndicatorStyle IndicGetHoverStyle(int indicator); /// Set the foreground hover colour of an indicator. (Scintilla feature 2682) - void IndicSetHoverFore(int indic, Colour fore); + void IndicSetHoverFore(int indicator, Colour fore); /// Retrieve the foreground hover colour of an indicator. (Scintilla feature 2683) - Colour IndicGetHoverFore(int indic); + Colour IndicGetHoverFore(int indicator); /// Set the attributes of an indicator. (Scintilla feature 2684) - void IndicSetFlags(int indic, int flags); + void IndicSetFlags(int indicator, IndicFlag flags); /// Retrieve the attributes of an indicator. (Scintilla feature 2685) - int IndicGetFlags(int indic); + IndicFlag IndicGetFlags(int indicator); /// Set the foreground colour of all whitespace and whether to use this setting. (Scintilla feature 2084) void SetWhitespaceFore(bool useSetting, Colour fore); @@ -523,17 +530,6 @@ public interface IScintillaGateway /// 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); @@ -555,6 +551,20 @@ public interface IScintillaGateway /// Set the colour of the background of the line containing the caret. (Scintilla feature 2098) void SetCaretLineBack(Colour back); + /// + /// Retrieve the caret line frame width. + /// Width = 0 means this option is disabled. + /// (Scintilla feature 2704) + /// + int GetCaretLineFrame(); + + /// + /// Display the caret line framed. + /// Set width != 0 to enable this option and width = 0 to disable it. + /// (Scintilla feature 2705) + /// + void SetCaretLineFrame(int width); + /// /// Set a style to be changeable or not (read only). /// Experimental feature, currently buggy. @@ -564,11 +574,11 @@ public interface IScintillaGateway /// /// Display a auto-completion list. - /// The lenEntered parameter indicates how many characters before + /// The lengthEntered parameter indicates how many characters before /// the caret should be used to provide context. /// (Scintilla feature 2100) /// - unsafe void AutoCShow(int lenEntered, string itemList); + unsafe void AutoCShow(int lengthEntered, string itemList); /// Remove the auto-completion list from the screen. (Scintilla feature 2101) void AutoCCancel(); @@ -577,7 +587,7 @@ public interface IScintillaGateway bool AutoCActive(); /// Retrieve the position of the caret when the auto-completion list was displayed. (Scintilla feature 2103) - Position AutoCPosStart(); + int AutoCPosStart(); /// User has selected an item so remove the list and insert the selection. (Scintilla feature 2104) void AutoCComplete(); @@ -596,7 +606,7 @@ public interface IScintillaGateway int AutoCGetSeparator(); /// Select the item in the auto-completion list that starts with a string. (Scintilla feature 2108) - unsafe void AutoCSelect(string text); + unsafe void AutoCSelect(string select); /// /// Should the auto-completion list be cancelled if the user backspaces to a @@ -703,31 +713,34 @@ public interface IScintillaGateway bool GetUseTabs(); /// Change the indentation of a line to a number of columns. (Scintilla feature 2126) - void SetLineIndentation(int line, int indentSize); + void SetLineIndentation(int line, int indentation); /// 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); + int GetLineIndentPosition(int line); /// Retrieve the column number of a position, taking tab width into account. (Scintilla feature 2129) - int GetColumn(Position pos); + int GetColumn(int pos); /// Count characters between two positions. (Scintilla feature 2633) - int CountCharacters(int startPos, int endPos); + int CountCharacters(int start, int end); + + /// Count code units between two positions. (Scintilla feature 2715) + int CountCodeUnits(int start, int end); /// Show or hide the horizontal scroll bar. (Scintilla feature 2130) - void SetHScrollBar(bool show); + void SetHScrollBar(bool visible); /// Is the horizontal scroll bar visible? (Scintilla feature 2131) bool GetHScrollBar(); /// Show or hide indentation guides. (Scintilla feature 2132) - void SetIndentationGuides(int indentView); + void SetIndentationGuides(IndentView indentView); /// Are the indentation guides visible? (Scintilla feature 2133) - int GetIndentationGuides(); + IndentView GetIndentationGuides(); /// /// Set the highlighted indentation guide column. @@ -740,7 +753,7 @@ public interface IScintillaGateway int GetHighlightGuide(); /// Get the position after the last visible characters on a line. (Scintilla feature 2136) - Position GetLineEndPosition(int line); + int GetLineEndPosition(int line); /// Get the code page used to interpret the bytes of the document as characters. (Scintilla feature 2137) int GetCodePage(); @@ -752,22 +765,22 @@ public interface IScintillaGateway bool GetReadOnly(); /// Sets the position of the caret. (Scintilla feature 2141) - void SetCurrentPos(Position pos); + void SetCurrentPos(int caret); /// Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2142) - void SetSelectionStart(Position pos); + void SetSelectionStart(int anchor); /// Returns the position at the start of the selection. (Scintilla feature 2143) - Position GetSelectionStart(); + int GetSelectionStart(); - /// Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2144) - void SetSelectionEnd(Position pos); + /// Sets the position that ends the selection - this becomes the caret. (Scintilla feature 2144) + void SetSelectionEnd(int caret); /// Returns the position at the end of the selection. (Scintilla feature 2145) - Position GetSelectionEnd(); + int GetSelectionEnd(); /// Set caret to a position, while removing any existing selection. (Scintilla feature 2556) - void SetEmptySelection(Position pos); + void SetEmptySelection(int caret); /// Sets the print magnification added to the point size of each style for printing. (Scintilla feature 2146) void SetPrintMagnification(int magnification); @@ -776,13 +789,13 @@ public interface IScintillaGateway int GetPrintMagnification(); /// Modify colours when printing for clearer printed text. (Scintilla feature 2148) - void SetPrintColourMode(int mode); + void SetPrintColourMode(PrintOption mode); /// Returns the print colour mode. (Scintilla feature 2149) - int GetPrintColourMode(); + PrintOption GetPrintColourMode(); /// Find some text in the document. (Scintilla feature 2150) - Position FindText(int flags, TextToFind ft); + int FindText(FindOption searchFlags, TextToFind ft); /// Retrieve the display line at the top of the display. (Scintilla feature 2152) int GetFirstVisibleLine(); @@ -813,7 +826,7 @@ public interface IScintillaGateway bool GetModify(); /// Select a range of text. (Scintilla feature 2160) - void SetSel(Position start, Position end); + void SetSel(int anchor, int caret); /// /// Retrieve the selected text. @@ -830,20 +843,20 @@ public interface IScintillaGateway /// int GetTextRange(TextRange tr); - /// Draw the selection in normal style or with selection highlighted. (Scintilla feature 2163) - void HideSelection(bool normal); + /// Draw the selection either highlighted or in normal (non-highlighted) style. (Scintilla feature 2163) + void HideSelection(bool hide); /// Retrieve the x value of the point in the window where a position is displayed. (Scintilla feature 2164) - int PointXFromPosition(Position pos); + int PointXFromPosition(int pos); /// Retrieve the y value of the point in the window where a position is displayed. (Scintilla feature 2165) - int PointYFromPosition(Position pos); + int PointYFromPosition(int pos); /// Retrieve the line containing a position. (Scintilla feature 2166) - int LineFromPosition(Position pos); + int LineFromPosition(int pos); /// Retrieve the position at the start of a line. (Scintilla feature 2167) - Position PositionFromLine(int line); + int PositionFromLine(int line); /// Scroll horizontally and vertically. (Scintilla feature 2168) void LineScroll(int columns, int lines); @@ -857,7 +870,7 @@ public interface IScintillaGateway /// This may be used to make a search match visible. /// (Scintilla feature 2569) /// - void ScrollRange(Position secondary, Position primary); + void ScrollRange(int secondary, int primary); /// Replace the selected text with the argument text. (Scintilla feature 2170) unsafe void ReplaceSel(string text); @@ -917,7 +930,7 @@ public interface IScintillaGateway IntPtr GetDirectPointer(); /// Set to overtype (true) or insert mode. (Scintilla feature 2186) - void SetOvertype(bool overtype); + void SetOvertype(bool overType); /// Returns true if overtype mode is active otherwise false is returned. (Scintilla feature 2187) bool GetOvertype(); @@ -933,27 +946,33 @@ public interface IScintillaGateway /// document without affecting the scroll position. /// (Scintilla feature 2190) /// - void SetTargetStart(Position pos); + void SetTargetStart(int start); /// Get the position that starts the target. (Scintilla feature 2191) - Position GetTargetStart(); + int 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); + void SetTargetEnd(int end); /// Get the position that ends the target. (Scintilla feature 2193) - Position GetTargetEnd(); + int GetTargetEnd(); /// Sets both the start and end of the target in one call. (Scintilla feature 2686) - void SetTargetRange(Position start, Position end); + void SetTargetRange(int start, int end); /// Retrieve the text in the target. (Scintilla feature 2687) unsafe string GetTargetText(); + /// Make the target range start and end be the same as the selection range start and end. (Scintilla feature 2287) + void TargetFromSelection(); + + /// Sets the target to the whole document. (Scintilla feature 2690) + void TargetWholeDocument(); + /// /// Replace the target text with the argument text. /// Text is counted so it can contain NULs. @@ -976,19 +995,19 @@ public interface IScintillaGateway /// /// 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. + /// Returns start of found 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); + void SetSearchFlags(FindOption searchFlags); /// Get the search flags used by SearchInTarget. (Scintilla feature 2199) - int GetSearchFlags(); + FindOption GetSearchFlags(); /// Show a call tip containing a definition near position pos. (Scintilla feature 2200) - unsafe void CallTipShow(Position pos, string definition); + unsafe void CallTipShow(int pos, string definition); /// Remove the call tip from the screen. (Scintilla feature 2201) void CallTipCancel(); @@ -997,13 +1016,13 @@ public interface IScintillaGateway bool CallTipActive(); /// Retrieve the position where the caret was before displaying the call tip. (Scintilla feature 2203) - Position CallTipPosStart(); + int 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); + void CallTipSetHlt(int highlightStart, int highlightEnd); /// Set the background colour for the call tip. (Scintilla feature 2205) void CallTipSetBack(Colour back); @@ -1021,13 +1040,13 @@ public interface IScintillaGateway void CallTipSetPosition(bool above); /// Find the display line of a document line taking hidden lines into account. (Scintilla feature 2220) - int VisibleFromDocLine(int line); + int VisibleFromDocLine(int docLine); /// Find the document line of a display line taking hidden lines into account. (Scintilla feature 2221) - int DocLineFromVisible(int lineDisplay); + int DocLineFromVisible(int displayLine); /// The number of display lines needed to wrap a document line (Scintilla feature 2235) - int WrapCount(int line); + int WrapCount(int docLine); /// /// Set the fold level of a line. @@ -1035,13 +1054,13 @@ public interface IScintillaGateway /// line is a header and whether it is effectively white space. /// (Scintilla feature 2222) /// - void SetFoldLevel(int line, int level); + void SetFoldLevel(int line, FoldLevel level); /// Retrieve the fold level of a line. (Scintilla feature 2223) - int GetFoldLevel(int line); + FoldLevel GetFoldLevel(int line); /// Find the last child line of a header line. (Scintilla feature 2224) - int GetLastChild(int line, int level); + int GetLastChild(int line, FoldLevel level); /// Find the parent line of a child line. (Scintilla feature 2225) int GetFoldParent(int line); @@ -1067,29 +1086,44 @@ public interface IScintillaGateway /// Switch a header line between expanded and contracted. (Scintilla feature 2231) void ToggleFold(int line); + /// Switch a header line between expanded and contracted and show some text after the line. (Scintilla feature 2700) + unsafe void ToggleFoldShowText(int line, string text); + + /// Set the style of fold display text. (Scintilla feature 2701) + void FoldDisplayTextSetStyle(FoldDisplayTextStyle style); + + /// Get the style of fold display text. (Scintilla feature 2707) + FoldDisplayTextStyle FoldDisplayTextGetStyle(); + + /// Set the default fold display text. (Scintilla feature 2722) + unsafe void SetDefaultFoldDisplayText(string text); + + /// Get the default fold display text. (Scintilla feature 2723) + unsafe string GetDefaultFoldDisplayText(); + /// Expand or contract a fold header. (Scintilla feature 2237) - void FoldLine(int line, int action); + void FoldLine(int line, FoldAction action); /// Expand or contract a fold header and its children. (Scintilla feature 2238) - void FoldChildren(int line, int action); + void FoldChildren(int line, FoldAction 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); + void ExpandChildren(int line, FoldLevel level); /// Expand or contract all fold headers. (Scintilla feature 2662) - void FoldAll(int action); + void FoldAll(FoldAction 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); + void SetAutomaticFold(AutomaticFold automaticFold); /// Get automatic folding behaviours. (Scintilla feature 2664) - int GetAutomaticFold(); + AutomaticFold GetAutomaticFold(); /// Set some style options for folding. (Scintilla feature 2233) - void SetFoldFlags(int flags); + void SetFoldFlags(FoldFlag flags); /// /// Ensure a particular line is visible by expanding any header line hiding it. @@ -1117,28 +1151,37 @@ public interface IScintillaGateway int GetMouseDwellTime(); /// Get position of start of word. (Scintilla feature 2266) - int WordStartPosition(Position pos, bool onlyWordCharacters); + int WordStartPosition(int pos, bool onlyWordCharacters); /// Get position of end of word. (Scintilla feature 2267) - int WordEndPosition(Position pos, bool onlyWordCharacters); + int WordEndPosition(int pos, bool onlyWordCharacters); + + /// Is the range start..end considered a word? (Scintilla feature 2691) + bool IsRangeWord(int start, int end); + + /// Sets limits to idle styling. (Scintilla feature 2692) + void SetIdleStyling(IdleStyling idleStyling); + + /// Retrieve the limits to idle styling. (Scintilla feature 2693) + IdleStyling GetIdleStyling(); /// Sets whether text is word wrapped. (Scintilla feature 2268) - void SetWrapMode(int mode); + void SetWrapMode(Wrap wrapMode); /// Retrieve whether text is word wrapped. (Scintilla feature 2269) - int GetWrapMode(); + Wrap GetWrapMode(); /// Set the display mode of visual flags for wrapped lines. (Scintilla feature 2460) - void SetWrapVisualFlags(int wrapVisualFlags); + void SetWrapVisualFlags(WrapVisualFlag wrapVisualFlags); /// Retrive the display mode of visual flags for wrapped lines. (Scintilla feature 2461) - int GetWrapVisualFlags(); + WrapVisualFlag GetWrapVisualFlags(); /// Set the location of visual flags for wrapped lines. (Scintilla feature 2462) - void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation); + void SetWrapVisualFlagsLocation(WrapVisualLocation wrapVisualFlagsLocation); /// Retrive the location of visual flags for wrapped lines. (Scintilla feature 2463) - int GetWrapVisualFlagsLocation(); + WrapVisualLocation GetWrapVisualFlagsLocation(); /// Set the start indent for wrapped lines. (Scintilla feature 2464) void SetWrapStartIndent(int indent); @@ -1147,16 +1190,16 @@ public interface IScintillaGateway int GetWrapStartIndent(); /// Sets how wrapped sublines are placed. Default is fixed. (Scintilla feature 2472) - void SetWrapIndentMode(int mode); + void SetWrapIndentMode(WrapIndentMode wrapIndentMode); /// Retrieve how wrapped sublines are placed. Default is fixed. (Scintilla feature 2473) - int GetWrapIndentMode(); + WrapIndentMode GetWrapIndentMode(); /// Sets the degree of caching of layout information. (Scintilla feature 2272) - void SetLayoutCache(int mode); + void SetLayoutCache(LineCache cacheMode); /// Retrieve the degree of caching of layout information. (Scintilla feature 2273) - int GetLayoutCache(); + LineCache GetLayoutCache(); /// Sets the document width assumed for scrolling. (Scintilla feature 2274) void SetScrollWidth(int pixelWidth); @@ -1197,7 +1240,7 @@ public interface IScintillaGateway int TextHeight(int line); /// Show or hide the vertical scroll bar. (Scintilla feature 2280) - void SetVScrollBar(bool show); + void SetVScrollBar(bool visible); /// Is the vertical scroll bar visible? (Scintilla feature 2281) bool GetVScrollBar(); @@ -1205,18 +1248,8 @@ public interface IScintillaGateway /// 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(); + PhasesDraw GetPhasesDraw(); /// /// In one phase draw, text is drawn in a series of rectangular blocks with no overlap. @@ -1225,22 +1258,22 @@ public interface IScintillaGateway /// to overlap from one line to the next. /// (Scintilla feature 2674) /// - void SetPhasesDraw(int phases); + void SetPhasesDraw(PhasesDraw phases); /// Choose the quality level for text from the FontQuality enumeration. (Scintilla feature 2611) - void SetFontQuality(int fontQuality); + void SetFontQuality(FontQuality fontQuality); /// Retrieve the quality level for text. (Scintilla feature 2612) - int GetFontQuality(); + FontQuality GetFontQuality(); /// Scroll so that a display line is at the top of the display. (Scintilla feature 2613) - void SetFirstVisibleLine(int lineDisplay); + void SetFirstVisibleLine(int displayLine); /// Change the effect of pasting when there are multiple selections. (Scintilla feature 2614) - void SetMultiPaste(int multiPaste); + void SetMultiPaste(MultiPaste multiPaste); - /// Retrieve the effect of pasting when there are multiple selections.. (Scintilla feature 2615) - int GetMultiPaste(); + /// Retrieve the effect of pasting when there are multiple selections. (Scintilla feature 2615) + MultiPaste GetMultiPaste(); /// /// Retrieve the value of a tag from a regular expression search. @@ -1249,9 +1282,6 @@ public interface IScintillaGateway /// 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(); @@ -1262,12 +1292,18 @@ public interface IScintillaGateway /// void LinesSplit(int pixelWidth); - /// Set the colours used as a chequerboard pattern in the fold margin (Scintilla feature 2290) + /// Set one of 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) + /// Set the other colour used as a chequerboard pattern in the fold margin (Scintilla feature 2291) void SetFoldMarginHiColour(bool useSetting, Colour fore); + /// Enable or disable accessibility. (Scintilla feature 2702) + void SetAccessibility(Accessibility accessibility); + + /// Report accessibility status. (Scintilla feature 2703) + Accessibility GetAccessibility(); + /// Move caret down one line. (Scintilla feature 2300) void LineDown(); @@ -1399,6 +1435,9 @@ public interface IScintillaGateway /// Switch the current line with the previous. (Scintilla feature 2339) void LineTranspose(); + /// Reverse order of selected lines. (Scintilla feature 2354) + void LineReverse(); + /// Duplicate the current line. (Scintilla feature 2404) void LineDuplicate(); @@ -1442,61 +1481,43 @@ public interface IScintillaGateway 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)?. + /// Like Home but when word-wrap is enabled goes first to start of display line + /// HomeDisplay, then to start of document line Home. /// (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)?. + /// Like HomeExtend but when word-wrap is enabled extends first to start of display line + /// HomeDisplayExtend, then to start of document line HomeExtend. /// (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)?. + /// Like LineEnd but when word-wrap is enabled goes first to end of display line + /// LineEndDisplay, then to start of document line LineEnd. /// (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)?. + /// Like LineEndExtend but when word-wrap is enabled extends first to end of display line + /// LineEndDisplayExtend, then to start of document line LineEndExtend. /// (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)?. + /// Like VCHome but when word-wrap is enabled goes first to start of display line + /// VCHomeDisplay, then behaves like VCHome. /// (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)?. + /// Like VCHomeExtend but when word-wrap is enabled extends first to start of display line + /// VCHomeDisplayExtend, then behaves like VCHomeExtend. /// (Scintilla feature 2454) /// void VCHomeWrapExtend(); @@ -1511,19 +1532,23 @@ public interface IScintillaGateway int LineLength(int line); /// Highlight the characters at two positions. (Scintilla feature 2351) - void BraceHighlight(Position pos1, Position pos2); + void BraceHighlight(int posA, int posB); /// Use specified indicator to highlight matching braces instead of changing their style. (Scintilla feature 2498) - void BraceHighlightIndicator(bool useBraceHighlightIndicator, int indicator); + void BraceHighlightIndicator(bool useSetting, int indicator); /// Highlight the character at a position indicating there is no matching brace. (Scintilla feature 2352) - void BraceBadLight(Position pos); + void BraceBadLight(int pos); /// Use specified indicator to highlight non matching brace instead of changing its style. (Scintilla feature 2499) - void BraceBadLightIndicator(bool useBraceBadLightIndicator, int indicator); + void BraceBadLightIndicator(bool useSetting, int indicator); - /// Find the position of a matching brace or INVALID_POSITION if no match. (Scintilla feature 2353) - Position BraceMatch(Position pos); + /// + /// Find the position of a matching brace or INVALID_POSITION if no match. + /// The maxReStyle must be 0 for now. It may be defined in a future release. + /// (Scintilla feature 2353) + /// + int BraceMatch(int pos, int maxReStyle); /// Are the end of line characters visible? (Scintilla feature 2355) bool GetViewEOL(); @@ -1535,10 +1560,10 @@ public interface IScintillaGateway IntPtr GetDocPointer(); /// Change the document object used. (Scintilla feature 2358) - void SetDocPointer(IntPtr pointer); + void SetDocPointer(IntPtr doc); /// Set which document modification events are sent to the container. (Scintilla feature 2359) - void SetModEventMask(int mask); + void SetModEventMask(ModificationFlags eventMask); /// Retrieve the column number which text should be kept within. (Scintilla feature 2360) int GetEdgeColumn(); @@ -1551,14 +1576,14 @@ public interface IScintillaGateway void SetEdgeColumn(int column); /// Retrieve the edge highlight mode. (Scintilla feature 2362) - int GetEdgeMode(); + EdgeVisualStyle GetEdgeMode(); /// - /// The edge may be displayed by a line (EDGE_LINE) or by highlighting text that + /// The edge may be displayed by a line (EDGE_LINE/EDGE_MULTILINE) or by highlighting text that /// goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). /// (Scintilla feature 2363) /// - void SetEdgeMode(int mode); + void SetEdgeMode(EdgeVisualStyle edgeMode); /// Retrieve the colour used in edge indication. (Scintilla feature 2364) Colour GetEdgeColour(); @@ -1566,6 +1591,12 @@ public interface IScintillaGateway /// Change the colour used in edge indication. (Scintilla feature 2365) void SetEdgeColour(Colour edgeColour); + /// Add a new vertical edge to the view. (Scintilla feature 2694) + void MultiEdgeAddLine(int column, Colour edgeColour); + + /// Clear all vertical edges. (Scintilla feature 2695) + void MultiEdgeClearAll(); + /// Sets the current caret position to be the search anchor. (Scintilla feature 2366) void SearchAnchor(); @@ -1574,24 +1605,24 @@ public interface IScintillaGateway /// Does not ensure the selection is visible. /// (Scintilla feature 2367) /// - unsafe int SearchNext(int flags, string text); + unsafe int SearchNext(FindOption searchFlags, 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); + unsafe int SearchPrev(FindOption searchFlags, 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. + /// the wrong mouse button on certain areas. /// (Scintilla feature 2371) /// - void UsePopUp(bool allowPopUp); + void UsePopUp(PopUp popUpMode); /// Is the selection rectangular? The alternative is the more common stream selection. (Scintilla feature 2372) bool SelectionIsRectangle(); @@ -1601,7 +1632,7 @@ public interface IScintillaGateway /// It may be positive to magnify or negative to reduce. /// (Scintilla feature 2373) /// - void SetZoom(int zoom); + void SetZoom(int zoomInPoints); /// Retrieve the zoom level. (Scintilla feature 2374) int GetZoom(); @@ -1611,16 +1642,25 @@ public interface IScintillaGateway /// Starts with reference count of 1 and not selected into editor. /// (Scintilla feature 2375) /// - int CreateDocument(); + IntPtr CreateDocument(int bytes, DocumentOption documentOptions); /// Extend life of document. (Scintilla feature 2376) - void AddRefDocument(int doc); + void AddRefDocument(IntPtr doc); /// Release a reference to the document, deleting document if it fades to black. (Scintilla feature 2377) - void ReleaseDocument(int doc); + void ReleaseDocument(IntPtr doc); + + /// Get which document options are set. (Scintilla feature 2379) + DocumentOption GetDocumentOptions(); /// Get which document modification events are sent to the container. (Scintilla feature 2378) - int GetModEventMask(); + ModificationFlags GetModEventMask(); + + /// Set whether command events are sent to the container. (Scintilla feature 2717) + void SetCommandEvents(bool commandEvents); + + /// Get whether command events are sent to the container. (Scintilla feature 2718) + bool GetCommandEvents(); /// Change internal focus flag. (Scintilla feature 2380) void SetFocus(bool focus); @@ -1629,10 +1669,10 @@ public interface IScintillaGateway bool GetFocus(); /// Change error status - 0 = OK. (Scintilla feature 2382) - void SetStatus(int statusCode); + void SetStatus(Status status); /// Get error status. (Scintilla feature 2383) - int GetStatus(); + Status GetStatus(); /// Set whether the mouse is captured when its button is pressed. (Scintilla feature 2384) void SetMouseDownCaptures(bool captures); @@ -1640,11 +1680,17 @@ public interface IScintillaGateway /// Get whether mouse gets captured. (Scintilla feature 2385) bool GetMouseDownCaptures(); + /// Set whether the mouse wheel can be active outside the window. (Scintilla feature 2696) + void SetMouseWheelCaptures(bool captures); + + /// Get whether mouse wheel can be active outside the window. (Scintilla feature 2697) + bool GetMouseWheelCaptures(); + /// Sets the cursor to one of the SC_CURSOR* values. (Scintilla feature 2386) - void SetCursor(int cursorType); + void SetCursor(CursorShape cursorType); /// Get cursor type. (Scintilla feature 2387) - int GetCursor(); + CursorShape GetCursor(); /// /// Change the way control characters are displayed: @@ -1681,7 +1727,7 @@ public interface IScintillaGateway /// is to be moved to by Find, FindNext, GotoLine, etc. /// (Scintilla feature 2394) /// - void SetVisiblePolicy(int visiblePolicy, int visibleSlop); + void SetVisiblePolicy(VisiblePolicy visiblePolicy, int visibleSlop); /// Delete back from the current position to the start of the line. (Scintilla feature 2395) void DelLineLeft(); @@ -1689,10 +1735,10 @@ public interface IScintillaGateway /// 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); + /// Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2397) + void SetXOffset(int xOffset); - /// Get and Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2398) + /// Get 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) @@ -1706,20 +1752,20 @@ public interface IScintillaGateway /// The exclusion zone is given in pixels. /// (Scintilla feature 2402) /// - void SetXCaretPolicy(int caretPolicy, int caretSlop); + void SetXCaretPolicy(CaretPolicy 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); + void SetYCaretPolicy(CaretPolicy 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); + void SetPrintWrapMode(Wrap wrapMode); /// Is printing line wrapped? (Scintilla feature 2407) - int GetPrintWrapMode(); + Wrap GetPrintWrapMode(); /// Set a fore colour for active hotspots. (Scintilla feature 2410) void SetHotspotActiveFore(bool useSetting, Colour fore); @@ -1745,16 +1791,16 @@ public interface IScintillaGateway /// Get the HotspotSingleLine property (Scintilla feature 2497) bool GetHotspotSingleLine(); - /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2413) + /// Move caret down one paragraph (delimited by empty lines). (Scintilla feature 2413) void ParaDown(); - /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2414) + /// Extend selection down one paragraph (delimited by empty lines). (Scintilla feature 2414) void ParaDownExtend(); - /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2415) + /// Move caret up one paragraph (delimited by empty lines). (Scintilla feature 2415) void ParaUp(); - /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2416) + /// Extend selection up one paragraph (delimited by empty lines). (Scintilla feature 2416) void ParaUpExtend(); /// @@ -1762,24 +1808,32 @@ public interface IScintillaGateway /// page into account. Returns 0 if passed 0. /// (Scintilla feature 2417) /// - Position PositionBefore(Position pos); + int PositionBefore(int 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); + int PositionAfter(int 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); + int PositionRelative(int pos, int relative); + + /// + /// Given a valid document position, return a position that differs in a number + /// of UTF-16 code units. Returned value is always between 0 and last position in document. + /// The result may point half way (2 bytes) inside a non-BMP character. + /// (Scintilla feature 2716) + /// + int PositionRelativeCodeUnits(int 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); + void CopyRange(int start, int end); /// Copy argument text to the clipboard. (Scintilla feature 2420) unsafe void CopyText(int length, string text); @@ -1789,16 +1843,19 @@ public interface IScintillaGateway /// by lines (SC_SEL_LINES). /// (Scintilla feature 2422) /// - void SetSelectionMode(int mode); + void SetSelectionMode(SelectionMode selectionMode); /// Get the mode of the current selection. (Scintilla feature 2423) - int GetSelectionMode(); + SelectionMode GetSelectionMode(); + + /// Get whether or not regular caret moves will extend or reduce the selection. (Scintilla feature 2706) + bool GetMoveExtendsSelection(); /// 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); + int 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); + int GetLineSelEndPosition(int line); /// Move caret down one line, extending rectangular selection to new caret position. (Scintilla feature 2426) void LineDownRectExtend(); @@ -1891,22 +1948,22 @@ public interface IScintillaGateway 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); + void AutoCSetCaseInsensitiveBehaviour(CaseInsensitiveBehaviour behaviour); /// Get auto-completion case insensitive behaviour. (Scintilla feature 2635) - int AutoCGetCaseInsensitiveBehaviour(); + CaseInsensitiveBehaviour AutoCGetCaseInsensitiveBehaviour(); /// Change the effect of autocompleting when there are multiple selections. (Scintilla feature 2636) - void AutoCSetMulti(int multi); + void AutoCSetMulti(MultiAutoComplete multi); - /// Retrieve the effect of autocompleting when there are multiple selections.. (Scintilla feature 2637) - int AutoCGetMulti(); + /// Retrieve the effect of autocompleting when there are multiple selections. (Scintilla feature 2637) + MultiAutoComplete AutoCGetMulti(); /// Set the way autocompletion lists are ordered. (Scintilla feature 2660) - void AutoCSetOrder(int order); + void AutoCSetOrder(Ordering order); /// Get the way autocompletion lists are ordered. (Scintilla feature 2661) - int AutoCGetOrder(); + Ordering AutoCGetOrder(); /// Enlarge the document to a particular size of text bytes. (Scintilla feature 2446) void Allocate(int bytes); @@ -1941,10 +1998,10 @@ public interface IScintillaGateway int FindColumn(int line, int column); /// Can the caret preferred x position only be changed by explicit movement commands? (Scintilla feature 2457) - int GetCaretSticky(); + CaretSticky GetCaretSticky(); /// Stop the caret preferred x position changing when the user types. (Scintilla feature 2458) - void SetCaretSticky(int useCaretStickyBehaviour); + void SetCaretSticky(CaretSticky useCaretStickyBehaviour); /// Switch between sticky and non-sticky: meant to be bound to a key. (Scintilla feature 2459) void ToggleCaretSticky(); @@ -1959,16 +2016,16 @@ public interface IScintillaGateway void SelectionDuplicate(); /// Set background alpha of the caret line. (Scintilla feature 2470) - void SetCaretLineBackAlpha(int alpha); + void SetCaretLineBackAlpha(Alpha alpha); /// Get the background alpha of the caret line. (Scintilla feature 2471) - int GetCaretLineBackAlpha(); + Alpha GetCaretLineBackAlpha(); /// Set the style of the caret to be drawn. (Scintilla feature 2512) - void SetCaretStyle(int caretStyle); + void SetCaretStyle(CaretStyle caretStyle); /// Returns the current style of the caret. (Scintilla feature 2513) - int GetCaretStyle(); + CaretStyle GetCaretStyle(); /// Set the indicator used for IndicatorFillRange and IndicatorClearRange (Scintilla feature 2500) void SetIndicatorCurrent(int indicator); @@ -1983,22 +2040,22 @@ public interface IScintillaGateway int GetIndicatorValue(); /// Turn a indicator on over a range. (Scintilla feature 2504) - void IndicatorFillRange(int position, int fillLength); + void IndicatorFillRange(int start, int lengthFill); /// Turn a indicator off over a range. (Scintilla feature 2505) - void IndicatorClearRange(int position, int clearLength); + void IndicatorClearRange(int start, int lengthClear); - /// Are any indicators present at position? (Scintilla feature 2506) - int IndicatorAllOnFor(int position); + /// Are any indicators present at pos? (Scintilla feature 2506) + int IndicatorAllOnFor(int pos); - /// What value does a particular indicator have at at a position? (Scintilla feature 2507) - int IndicatorValueAt(int indicator, int position); + /// What value does a particular indicator have at a position? (Scintilla feature 2507) + int IndicatorValueAt(int indicator, int pos); /// Where does a particular indicator start? (Scintilla feature 2508) - int IndicatorStart(int indicator, int position); + int IndicatorStart(int indicator, int pos); /// Where does a particular indicator end? (Scintilla feature 2509) - int IndicatorEnd(int indicator, int position); + int IndicatorEnd(int indicator, int pos); /// Set number of entries in position cache (Scintilla feature 2514) void SetPositionCache(int size); @@ -2019,29 +2076,29 @@ public interface IScintillaGateway /// /// 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. + /// to lengthRange bytes. /// (Scintilla feature 2643) /// - IntPtr GetRangePointer(int position, int rangeLength); + IntPtr GetRangePointer(int start, int lengthRange); /// /// Return a position which, to avoid performance costs, should not be within /// the range of a call to GetRangePointer. /// (Scintilla feature 2644) /// - Position GetGapPosition(); + int GetGapPosition(); /// Set the alpha fill colour of the given indicator. (Scintilla feature 2523) - void IndicSetAlpha(int indicator, int alpha); + void IndicSetAlpha(int indicator, Alpha alpha); /// Get the alpha fill colour of the given indicator. (Scintilla feature 2524) - int IndicGetAlpha(int indicator); + Alpha IndicGetAlpha(int indicator); /// Set the alpha outline colour of the given indicator. (Scintilla feature 2558) - void IndicSetOutlineAlpha(int indicator, int alpha); + void IndicSetOutlineAlpha(int indicator, Alpha alpha); /// Get the alpha outline colour of the given indicator. (Scintilla feature 2559) - int IndicGetOutlineAlpha(int indicator); + Alpha IndicGetOutlineAlpha(int indicator); /// Set extra ascent for each line (Scintilla feature 2525) void SetExtraAscent(int extraAscent); @@ -2086,10 +2143,10 @@ public interface IScintillaGateway int MarginGetStyleOffset(); /// Set the margin options. (Scintilla feature 2539) - void SetMarginOptions(int marginOptions); + void SetMarginOptions(MarginOption marginOptions); /// Get the margin options. (Scintilla feature 2557) - int GetMarginOptions(); + MarginOption GetMarginOptions(); /// Set the annotation text for a line (Scintilla feature 2540) unsafe void AnnotationSetText(int line, string text); @@ -2116,10 +2173,10 @@ public interface IScintillaGateway void AnnotationClearAll(); /// Set the visibility for the annotations for a view (Scintilla feature 2548) - void AnnotationSetVisible(int visible); + void AnnotationSetVisible(AnnotationVisible visible); /// Get the visibility for the annotations for a view (Scintilla feature 2549) - int AnnotationGetVisible(); + AnnotationVisible AnnotationGetVisible(); /// Get the start of the range of style numbers used for annotations (Scintilla feature 2550) void AnnotationSetStyleOffset(int style); @@ -2134,17 +2191,17 @@ public interface IScintillaGateway int AllocateExtendedStyles(int numberStyles); /// Add a container action to the undo stack (Scintilla feature 2560) - void AddUndoAction(int token, int flags); + void AddUndoAction(int token, UndoFlags flags); /// Find the position of a character from a point within the window. (Scintilla feature 2561) - Position CharPositionFromPoint(int x, int y); + int 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); + int 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); @@ -2171,7 +2228,7 @@ public interface IScintillaGateway bool GetAdditionalCaretsBlink(); /// Set whether additional carets are visible (Scintilla feature 2608) - void SetAdditionalCaretsVisible(bool additionalCaretsBlink); + void SetAdditionalCaretsVisible(bool additionalCaretsVisible); /// Whether additional carets are visible (Scintilla feature 2609) bool GetAdditionalCaretsVisible(); @@ -2186,10 +2243,10 @@ public interface IScintillaGateway void ClearSelections(); /// Set a simple selection (Scintilla feature 2572) - int SetSelection(int caret, int anchor); + void SetSelection(int caret, int anchor); /// Add a selection (Scintilla feature 2573) - int AddSelection(int caret, int anchor); + void AddSelection(int caret, int anchor); /// Drop one selection (Scintilla feature 2671) void DropSelectionN(int selection); @@ -2200,74 +2257,74 @@ public interface IScintillaGateway /// 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); + /// Set the caret position of the nth selection. (Scintilla feature 2576) + void SetSelectionNCaret(int selection, int caret); - /// Which selection is the main selection (Scintilla feature 2577) - Position GetSelectionNCaret(int selection); + /// Return the caret position of the nth selection. (Scintilla feature 2577) + int GetSelectionNCaret(int selection); - /// Which selection is the main selection (Scintilla feature 2578) - void SetSelectionNAnchor(int selection, Position posAnchor); + /// Set the anchor position of the nth selection. (Scintilla feature 2578) + void SetSelectionNAnchor(int selection, int anchor); - /// Which selection is the main selection (Scintilla feature 2579) - Position GetSelectionNAnchor(int selection); + /// Return the anchor position of the nth selection. (Scintilla feature 2579) + int GetSelectionNAnchor(int selection); - /// Which selection is the main selection (Scintilla feature 2580) + /// Set the virtual space of the caret of the nth selection. (Scintilla feature 2580) void SetSelectionNCaretVirtualSpace(int selection, int space); - /// Which selection is the main selection (Scintilla feature 2581) + /// Return the virtual space of the caret of the nth selection. (Scintilla feature 2581) int GetSelectionNCaretVirtualSpace(int selection); - /// Which selection is the main selection (Scintilla feature 2582) + /// Set the virtual space of the anchor of the nth selection. (Scintilla feature 2582) void SetSelectionNAnchorVirtualSpace(int selection, int space); - /// Which selection is the main selection (Scintilla feature 2583) + /// Return the virtual space of the anchor of the nth 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); + void SetSelectionNStart(int selection, int anchor); /// Returns the position at the start of the selection. (Scintilla feature 2585) - Position GetSelectionNStart(int selection); + int GetSelectionNStart(int selection); /// Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2586) - void SetSelectionNEnd(int selection, Position pos); + void SetSelectionNEnd(int selection, int caret); /// Returns the position at the end of the selection. (Scintilla feature 2587) - Position GetSelectionNEnd(int selection); + int GetSelectionNEnd(int selection); - /// Returns the position at the end of the selection. (Scintilla feature 2588) - void SetRectangularSelectionCaret(Position pos); + /// Set the caret position of the rectangular selection. (Scintilla feature 2588) + void SetRectangularSelectionCaret(int caret); - /// Returns the position at the end of the selection. (Scintilla feature 2589) - Position GetRectangularSelectionCaret(); + /// Return the caret position of the rectangular selection. (Scintilla feature 2589) + int GetRectangularSelectionCaret(); - /// Returns the position at the end of the selection. (Scintilla feature 2590) - void SetRectangularSelectionAnchor(Position posAnchor); + /// Set the anchor position of the rectangular selection. (Scintilla feature 2590) + void SetRectangularSelectionAnchor(int anchor); - /// Returns the position at the end of the selection. (Scintilla feature 2591) - Position GetRectangularSelectionAnchor(); + /// Return the anchor position of the rectangular selection. (Scintilla feature 2591) + int GetRectangularSelectionAnchor(); - /// Returns the position at the end of the selection. (Scintilla feature 2592) + /// Set the virtual space of the caret of the rectangular selection. (Scintilla feature 2592) void SetRectangularSelectionCaretVirtualSpace(int space); - /// Returns the position at the end of the selection. (Scintilla feature 2593) + /// Return the virtual space of the caret of the rectangular selection. (Scintilla feature 2593) int GetRectangularSelectionCaretVirtualSpace(); - /// Returns the position at the end of the selection. (Scintilla feature 2594) + /// Set the virtual space of the anchor of the rectangular selection. (Scintilla feature 2594) void SetRectangularSelectionAnchorVirtualSpace(int space); - /// Returns the position at the end of the selection. (Scintilla feature 2595) + /// Return the virtual space of the anchor of the rectangular selection. (Scintilla feature 2595) int GetRectangularSelectionAnchorVirtualSpace(); - /// Returns the position at the end of the selection. (Scintilla feature 2596) - void SetVirtualSpaceOptions(int virtualSpaceOptions); + /// Set options for virtual space behaviour. (Scintilla feature 2596) + void SetVirtualSpaceOptions(VirtualSpace virtualSpaceOptions); - /// Returns the position at the end of the selection. (Scintilla feature 2597) - int GetVirtualSpaceOptions(); + /// Return options for virtual space behaviour. (Scintilla feature 2597) + VirtualSpace GetVirtualSpaceOptions(); /// - /// On GTK+, allow selecting the modifier key to use for mouse-based + /// 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. @@ -2293,10 +2350,10 @@ public interface IScintillaGateway void SetAdditionalSelBack(Colour back); /// Set the alpha of the selection. (Scintilla feature 2602) - void SetAdditionalSelAlpha(int alpha); + void SetAdditionalSelAlpha(Alpha alpha); /// Get the alpha of the selection. (Scintilla feature 2603) - int GetAdditionalSelAlpha(); + Alpha GetAdditionalSelAlpha(); /// Set the foreground colour of additional carets. (Scintilla feature 2604) void SetAdditionalCaretFore(Colour fore); @@ -2310,12 +2367,26 @@ public interface IScintillaGateway /// Swap that caret and anchor of the main selection. (Scintilla feature 2607) void SwapMainAnchorCaret(); + /// + /// Add the next occurrence of the main selection to the set of selections as main. + /// If the current selection is empty then select word around caret. + /// (Scintilla feature 2688) + /// + void MultipleSelectAddNext(); + + /// + /// Add each occurrence of the main selection in the target to the set of selections. + /// If the current selection is empty then select word around caret. + /// (Scintilla feature 2689) + /// + void MultipleSelectAddEach(); + /// /// 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); + int ChangeLexerState(int start, int end); /// /// Find the next line at or after lineStart that is a contracted fold header line. @@ -2333,7 +2404,7 @@ public interface IScintillaGateway /// 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) + /// Set the identifier reported as idFrom in notification messages. (Scintilla feature 2622) void SetIdentifier(int identifier); /// Get the identifier. (Scintilla feature 2623) @@ -2369,19 +2440,19 @@ public interface IScintillaGateway void ScrollToEnd(); /// Set the technology used. (Scintilla feature 2630) - void SetTechnology(int technology); + void SetTechnology(Technology technology); /// Get the tech. (Scintilla feature 2631) - int GetTechnology(); + Technology GetTechnology(); /// Create an ILoader*. (Scintilla feature 2632) - int CreateLoader(int bytes); + IntPtr CreateLoader(int bytes, DocumentOption documentOptions); /// On OS X, show a find indicator. (Scintilla feature 2640) - void FindIndicatorShow(Position start, Position end); + void FindIndicatorShow(int start, int end); /// On OS X, flash a find indicator, then fade out. (Scintilla feature 2641) - void FindIndicatorFlash(Position start, Position end); + void FindIndicatorFlash(int start, int end); /// On OS X, hide the find indicator. (Scintilla feature 2642) void FindIndicatorHide(); @@ -2403,13 +2474,13 @@ public interface IScintillaGateway 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); + void SetLineEndTypesAllowed(LineEndType lineEndBitSet); /// Get the line end types currently allowed. (Scintilla feature 2657) - int GetLineEndTypesAllowed(); + LineEndType 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(); + LineEndType GetLineEndTypesActive(); /// Set the way a character is drawn. (Scintilla feature 2665) unsafe void SetRepresentation(string encodedCharacter, string representation); @@ -2437,13 +2508,13 @@ public interface IScintillaGateway int GetLexer(); /// Colourise a segment of the document using the current lexing language. (Scintilla feature 4003) - void Colourise(Position start, Position end); + void Colourise(int start, int 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); + 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); @@ -2471,10 +2542,7 @@ public interface IScintillaGateway /// 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(); + unsafe int GetPropertyInt(string key, int defaultValue); /// /// Retrieve the name of the lexer. @@ -2485,7 +2553,7 @@ public interface IScintillaGateway unsafe string GetLexerLanguage(); /// For private communication between an application and a known lexer. (Scintilla feature 4013) - int PrivateLexerCall(int operation, int pointer); + IntPtr PrivateLexerCall(int operation, IntPtr pointer); /// /// Retrieve a '\n' separated list of properties understood by the current lexer. @@ -2495,7 +2563,7 @@ public interface IScintillaGateway unsafe string PropertyNames(); /// Retrieve the type of a property. (Scintilla feature 4015) - unsafe int PropertyType(string name); + unsafe TypeProperty PropertyType(string name); /// /// Describe a property. @@ -2553,19 +2621,64 @@ public interface IScintillaGateway /// unsafe string GetSubStyleBases(); + /// Retrieve the number of named styles for the lexer. (Scintilla feature 4029) + int GetNamedStyles(); + /// - /// Deprecated in 2.30 - /// In palette mode? - /// (Scintilla feature 2139) + /// Retrieve the name of a style. + /// Result is NUL-terminated. + /// (Scintilla feature 4030) /// - bool GetUsePalette(); + unsafe string NameOfStyle(int style); /// - /// In palette mode, Scintilla uses the environment's palette calls to display - /// more colours. This may lead to ugly displays. - /// (Scintilla feature 2039) + /// Retrieve a ' ' separated list of style tags like "literal quoted string". + /// Result is NUL-terminated. + /// (Scintilla feature 4031) /// - void SetUsePalette(bool usePalette); + unsafe string TagsOfStyle(int style); + + /// + /// Retrieve a description of a style. + /// Result is NUL-terminated. + /// (Scintilla feature 4032) + /// + unsafe string DescriptionOfStyle(int style); + + /// Retrieve bidirectional text display state. (Scintilla feature 2708) + Bidirectional GetBidirectional(); + + /// Set bidirectional text display state. (Scintilla feature 2709) + void SetBidirectional(Bidirectional bidirectional); + + /// Retrieve line character index state. (Scintilla feature 2710) + LineCharacterIndexType GetLineCharacterIndex(); + + /// Request line character index be created or its use count increased. (Scintilla feature 2711) + void AllocateLineCharacterIndex(LineCharacterIndexType lineCharacterIndex); + + /// Decrease use count of line character index and remove if 0. (Scintilla feature 2712) + void ReleaseLineCharacterIndex(LineCharacterIndexType lineCharacterIndex); + + /// Retrieve the document line containing a position measured in index units. (Scintilla feature 2713) + int LineFromIndexPosition(int pos, LineCharacterIndexType lineCharacterIndex); + + /// Retrieve the position measured in index units at the start of a document line. (Scintilla feature 2714) + int IndexPositionFromLine(int line, LineCharacterIndexType lineCharacterIndex); + + /// + /// 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(); + + /// Retrieve the number of bits the current lexer needs for styling. (Scintilla feature 4011) + int GetStyleBitsNeeded(); /// /// Deprecated in 3.5.5 @@ -2577,6 +2690,16 @@ public interface IScintillaGateway /// Are keys always interpreted as Unicode? (Scintilla feature 2522) bool GetKeysUnicode(); + /// 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); + /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ } } diff --git a/WakaTime/PluginInfrastructure/Msgs_h.cs b/WakaTime/PluginInfrastructure/Msgs_h.cs index 036c660..a9efd7b 100644 --- a/WakaTime/PluginInfrastructure/Msgs_h.cs +++ b/WakaTime/PluginInfrastructure/Msgs_h.cs @@ -191,7 +191,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, @@ -239,7 +243,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 /// @@ -251,11 +255,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, @@ -274,7 +278,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 @@ -282,7 +286,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 @@ -290,7 +294,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 @@ -300,7 +304,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 @@ -308,7 +312,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 @@ -318,40 +322,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 @@ -398,7 +384,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, @@ -416,7 +402,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, @@ -443,7 +429,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 @@ -453,7 +439,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 @@ -462,7 +448,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. /// @@ -476,7 +462,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, @@ -519,6 +505,28 @@ 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, + RUNCOMMAND_USER = Constants.WM_USER + 3000, NPPM_GETFULLCURRENTPATH = RUNCOMMAND_USER + FULL_CURRENT_PATH, NPPM_GETCURRENTDIRECTORY = RUNCOMMAND_USER + CURRENT_DIRECTORY, @@ -526,6 +534,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, @@ -533,7 +542,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) @@ -547,6 +556,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, @@ -557,6 +568,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. @@ -682,12 +695,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; diff --git a/WakaTime/PluginInfrastructure/NotepadPPGateway.cs b/WakaTime/PluginInfrastructure/NotepadPPGateway.cs index 5b6aea5..e1668df 100644 --- a/WakaTime/PluginInfrastructure/NotepadPPGateway.cs +++ b/WakaTime/PluginInfrastructure/NotepadPPGateway.cs @@ -12,17 +12,7 @@ public interface INotepadPPGateway string GetCurrentFilePath(); unsafe string GetFilePath(int bufferId); void SetCurrentLanguage(LangType language); - /// - /// Returns the response from NPPM_GETFILENAME - /// - /// - string GetCurrentFileName(); - /// - /// Returns the response from NPPM_GETCURRENTDIRECTORY - /// - /// - string GetCurrentDirectory(); - } + } /// /// This class holds helpers for sending messages defined in the Msgs_h.cs file. It is at the moment @@ -37,32 +27,10 @@ public void FileNew() Win32.SendMessage(PluginBase.nppData._nppHandle, (uint) NppMsg.NPPM_MENUCOMMAND, Unused, NppMenuCmd.IDM_FILE_NEW); } - /// - /// Returns the response from NPPM_GETCURRENTDIRECTORY - /// - /// - public string GetCurrentDirectory() - { - StringBuilder path = new StringBuilder(Win32.MAX_PATH); - Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETCURRENTDIRECTORY, 0, path); - return path.ToString(); - } - - /// - /// Returns the response from NPPM_GETFILENAME - /// - /// - public string GetCurrentFileName() - { - StringBuilder fileName = new StringBuilder(Win32.MAX_PATH); - Win32.SendMessage(PluginBase.nppData._nppHandle, (uint)NppMsg.NPPM_GETFILENAME, 0, fileName); - return fileName.ToString(); - } - - /// - /// Gets the path of the current document. - /// - public string GetCurrentFilePath() + /// + /// 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); diff --git a/WakaTime/PluginInfrastructure/Preference_h.cs b/WakaTime/PluginInfrastructure/Preference_h.cs index c72ed1c..f1d1c2a 100644 --- a/WakaTime/PluginInfrastructure/Preference_h.cs +++ b/WakaTime/PluginInfrastructure/Preference_h.cs @@ -41,7 +41,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 +56,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 +74,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 +103,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 +128,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 +146,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 +175,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 +220,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 +238,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 +311,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 +333,10 @@ public enum Preference IDC_MACHEDPAIROPEN_EDIT3 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 17, IDC_MACHEDPAIRCLOSE_EDIT3 = IDD_PREFERENCE_AUTOCOMPLETION_BOX + 18, + 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/WakaTime/PluginInfrastructure/Resource_h.cs b/WakaTime/PluginInfrastructure/Resource_h.cs index f0b8361..45933bd 100644 --- a/WakaTime/PluginInfrastructure/Resource_h.cs +++ b/WakaTime/PluginInfrastructure/Resource_h.cs @@ -104,6 +104,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, @@ -114,6 +115,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, @@ -122,6 +126,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, @@ -165,7 +178,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, @@ -173,6 +185,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, @@ -243,11 +257,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, @@ -295,7 +313,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, @@ -309,6 +327,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, @@ -318,10 +347,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, @@ -342,9 +367,10 @@ public enum Resource MENUINDEX_FORMAT = 4, MENUINDEX_LANGUAGE = 5, MENUINDEX_SETTINGS = 6, - MENUINDEX_MACRO = 7, - MENUINDEX_RUN = 8, - MENUINDEX_PLUGINS = 9, + MENUINDEX_TOOLS = 7, + MENUINDEX_MACRO = 8, + MENUINDEX_RUN = 9, + MENUINDEX_PLUGINS = 10, /* --Autogenerated -- end of section automatically generated from resource.h */ } } diff --git a/WakaTime/PluginInfrastructure/ScintillaGateway.cs b/WakaTime/PluginInfrastructure/ScintillaGateway.cs index 0ff2c51..4483904 100644 --- a/WakaTime/PluginInfrastructure/ScintillaGateway.cs +++ b/WakaTime/PluginInfrastructure/ScintillaGateway.cs @@ -16,51 +16,16 @@ public class ScintillaGateway : IScintillaGateway { private const int Unused = 0; - private IntPtr scintilla; + private readonly IntPtr scintilla; public static readonly int LengthZeroTerminator = "\0".Length; - /// - /// - /// - public IntPtr CurrentBufferID { get; set; } - public ScintillaGateway(IntPtr scintilla) { this.scintilla = scintilla; } - /// - /// Switch the handle between main and second window handle. - /// - public void SwitchScintillaHandle() - { - this.scintilla = this.scintilla == PluginBase.nppData._scintillaMainHandle ? PluginBase.nppData._scintillaSecondHandle : PluginBase.nppData._scintillaMainHandle; - } - - /// - /// Change the Scintilla window handle for this Gateway - /// and return the previous handle for potentially final updates. - /// - /// - /// - public IntPtr SetScintillaHandle(IntPtr newHandle) - { - IntPtr oldHandle = this.scintilla; - this.scintilla = newHandle; - return oldHandle; - } - - /// - /// Return the current Scintilla window handle - /// - /// - public IntPtr GetScintillaHandle() - { - return this.scintilla; - } - public int GetSelectionLength() { var selectionLength = (int) Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, Unused, Unused) - LengthZeroTerminator; @@ -70,20 +35,20 @@ public int GetSelectionLength() public void AppendTextAndMoveCursor(string text) { AppendText(text.Length, text); - GotoPos(new Position(GetCurrentPos().Value + text.Length)); + GotoPos(GetCurrentPos() + text.Length); } public void InsertTextAndMoveCursor(string text) { var currentPos = GetCurrentPos(); InsertText(currentPos, text); - GotoPos(new Position(currentPos.Value + text.Length)); + GotoPos(currentPos + text.Length); } public void SelectCurrentLine() { int line = GetCurrentLineNumber(); - SetSelection(PositionFromLine(line).Value, PositionFromLine(line + 1).Value); + SetSelection(PositionFromLine(line), PositionFromLine(line + 1)); } /// @@ -91,7 +56,7 @@ public void SelectCurrentLine() /// public void ClearSelectionToCursor() { - var pos = GetCurrentPos().Value; + var pos = GetCurrentPos(); SetSelection(pos, pos); } @@ -100,7 +65,7 @@ public void ClearSelectionToCursor() /// public int GetCurrentLineNumber() { - return LineFromPosition(GetCurrentPos()); + return LineFromPosition(GetCurrentPos()); } /// @@ -124,7 +89,7 @@ public unsafe void AddText(int length, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDTEXT, length, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_ADDTEXT, (IntPtr) length, (IntPtr) textPtr); } } @@ -133,16 +98,16 @@ public unsafe void AddStyledText(int length, Cells c) { fixed (char* cPtr = c.Value) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDSTYLEDTEXT, length, (IntPtr) cPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_ADDSTYLEDTEXT, (IntPtr) length, (IntPtr) cPtr); } } /// Insert string at a position. (Scintilla feature 2003) - public unsafe void InsertText(Position pos, string text) + public unsafe void InsertText(int pos, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INSERTTEXT, pos.Value, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_INSERTTEXT, (IntPtr) pos, (IntPtr) textPtr); } } @@ -151,67 +116,62 @@ public unsafe void ChangeInsertion(int length, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHANGEINSERTION, length, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_CHANGEINSERTION, (IntPtr) length, (IntPtr) textPtr); } } /// Delete all text in the document. (Scintilla feature 2004) public void ClearAll() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALL, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALL, (IntPtr) Unused, (IntPtr) Unused); } /// Delete a range of text in the document. (Scintilla feature 2645) - public void DeleteRange(Position pos, int deleteLength) + public void DeleteRange(int start, int lengthDelete) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETERANGE, pos.Value, deleteLength); + Win32.SendMessage(scintilla, SciMsg.SCI_DELETERANGE, (IntPtr) start, (IntPtr) lengthDelete); } /// Set all style bytes to 0, remove all folding information. (Scintilla feature 2005) public void ClearDocumentStyle() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARDOCUMENTSTYLE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CLEARDOCUMENTSTYLE, (IntPtr) Unused, (IntPtr) Unused); } /// Returns the number of bytes in the document. (Scintilla feature 2006) public int GetLength() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLENGTH, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLENGTH, (IntPtr) Unused, (IntPtr) Unused); } /// Returns the character byte at the position. (Scintilla feature 2007) - public int GetCharAt(Position pos) + public int GetCharAt(int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARAT, pos.Value, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARAT, (IntPtr) pos, (IntPtr) Unused); } /// Returns the position of the caret. (Scintilla feature 2008) - public Position GetCurrentPos() + public int GetCurrentPos() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURRENTPOS, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCURRENTPOS, (IntPtr) Unused, (IntPtr) Unused); } /// Returns the position of the opposite end of the selection to the caret. (Scintilla feature 2009) - public Position GetAnchor() + public int GetAnchor() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETANCHOR, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETANCHOR, (IntPtr) Unused, (IntPtr) Unused); } /// Returns the style byte at the position. (Scintilla feature 2010) - public int GetStyleAt(Position pos) + public int GetStyleAt(int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEAT, pos.Value, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEAT, (IntPtr) pos, (IntPtr) Unused); } /// Redoes the next action on the undo history. (Scintilla feature 2011) public void Redo() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REDO, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_REDO, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -221,13 +181,13 @@ public void Redo() /// public void SetUndoCollection(bool collectUndo) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUNDOCOLLECTION, collectUndo ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETUNDOCOLLECTION, new IntPtr(collectUndo ? 1 : 0), (IntPtr) Unused); } /// Select all the text in the document. (Scintilla feature 2013) public void SelectAll() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SELECTALL, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SELECTALL, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -237,7 +197,7 @@ public void SelectAll() /// public void SetSavePoint() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSAVEPOINT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSAVEPOINT, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -247,35 +207,31 @@ public void SetSavePoint() /// public int GetStyledText(TextRange tr) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEDTEXT, Unused, tr.NativePointer); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEDTEXT, (IntPtr) Unused, tr.NativePointer); } /// Are there any redoable actions in the undo history? (Scintilla feature 2016) public bool CanRedo() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANREDO, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_CANREDO, (IntPtr) Unused, (IntPtr) Unused); } /// Retrieve the line number at which a particular marker is located. (Scintilla feature 2017) - public int MarkerLineFromHandle(int handle) + public int MarkerLineFromHandle(int markerHandle) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERLINEFROMHANDLE, handle, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERLINEFROMHANDLE, (IntPtr) markerHandle, (IntPtr) Unused); } /// Delete a marker. (Scintilla feature 2018) - public void MarkerDeleteHandle(int handle) + public void MarkerDeleteHandle(int markerHandle) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEHANDLE, handle, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEHANDLE, (IntPtr) markerHandle, (IntPtr) Unused); } /// Is undo history being collected? (Scintilla feature 2019) public bool GetUndoCollection() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETUNDOCOLLECTION, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETUNDOCOLLECTION, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -283,23 +239,37 @@ public bool GetUndoCollection() /// Returns one of SCWS_* constants. /// (Scintilla feature 2020) /// - public int GetViewWS() + public WhiteSpace GetViewWS() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIEWWS, Unused, Unused); - return (int) res; + return (WhiteSpace)Win32.SendMessage(scintilla, SciMsg.SCI_GETVIEWWS, (IntPtr) Unused, (IntPtr) Unused); } /// Make white space characters invisible, always visible or visible outside indentation. (Scintilla feature 2021) - public void SetViewWS(int viewWS) + public void SetViewWS(WhiteSpace viewWS) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIEWWS, viewWS, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETVIEWWS, (IntPtr) viewWS, (IntPtr) Unused); + } + + /// + /// Retrieve the current tab draw mode. + /// Returns one of SCTD_* constants. + /// (Scintilla feature 2698) + /// + public TabDrawMode GetTabDrawMode() + { + return (TabDrawMode)Win32.SendMessage(scintilla, SciMsg.SCI_GETTABDRAWMODE, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Set how tabs are drawn when visible. (Scintilla feature 2699) + public void SetTabDrawMode(TabDrawMode tabDrawMode) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETTABDRAWMODE, (IntPtr) tabDrawMode, (IntPtr) Unused); } /// Find the position from a point within the window. (Scintilla feature 2022) - public Position PositionFromPoint(int x, int y) + public int PositionFromPoint(int x, int y) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINT, x, y); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINT, (IntPtr) x, (IntPtr) y); } /// @@ -307,22 +277,21 @@ public Position PositionFromPoint(int x, int y) /// INVALID_POSITION if not close to text. /// (Scintilla feature 2023) /// - public Position PositionFromPointClose(int x, int y) + public int PositionFromPointClose(int x, int y) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINTCLOSE, x, y); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINTCLOSE, (IntPtr) x, (IntPtr) y); } /// Set caret to start of a line and ensure it is visible. (Scintilla feature 2024) public void GotoLine(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GOTOLINE, line, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_GOTOLINE, (IntPtr) line, (IntPtr) Unused); } /// Set caret to a position and ensure it is visible. (Scintilla feature 2025) - public void GotoPos(Position pos) + public void GotoPos(int caret) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GOTOPOS, pos.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_GOTOPOS, (IntPtr) caret, (IntPtr) Unused); } /// @@ -330,9 +299,9 @@ public void GotoPos(Position pos) /// end of the selection from the caret. /// (Scintilla feature 2026) /// - public void SetAnchor(Position posAnchor) + public void SetAnchor(int anchor) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETANCHOR, posAnchor.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETANCHOR, (IntPtr) anchor, (IntPtr) Unused); } /// @@ -346,45 +315,43 @@ public unsafe string GetCurLine(int length) byte[] textBuffer = new byte[10000]; fixed (byte* textPtr = textBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURLINE, length, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_GETCURLINE, (IntPtr) length, (IntPtr) textPtr); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } /// Retrieve the position of the last correctly styled character. (Scintilla feature 2028) - public Position GetEndStyled() + public int GetEndStyled() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETENDSTYLED, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETENDSTYLED, (IntPtr) Unused, (IntPtr) Unused); } /// Convert all line endings in the document to one mode. (Scintilla feature 2029) - public void ConvertEOLs(int eolMode) + public void ConvertEOLs(EndOfLine eolMode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CONVERTEOLS, eolMode, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CONVERTEOLS, (IntPtr) eolMode, (IntPtr) Unused); } /// Retrieve the current end of line mode - one of CRLF, CR, or LF. (Scintilla feature 2030) - public int GetEOLMode() + public EndOfLine GetEOLMode() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEOLMODE, Unused, Unused); - return (int) res; + return (EndOfLine)Win32.SendMessage(scintilla, SciMsg.SCI_GETEOLMODE, (IntPtr) Unused, (IntPtr) Unused); } /// Set the current end of line mode. (Scintilla feature 2031) - public void SetEOLMode(int eolMode) + public void SetEOLMode(EndOfLine eolMode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEOLMODE, eolMode, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETEOLMODE, (IntPtr) eolMode, (IntPtr) Unused); } /// - /// 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. + /// Set the current styling position to start. + /// The unused parameter is no longer used and should be set to 0. /// (Scintilla feature 2032) /// - public void StartStyling(Position pos, int mask) + public void StartStyling(int start, int unused) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STARTSTYLING, pos.Value, mask); + Win32.SendMessage(scintilla, SciMsg.SCI_STARTSTYLING, (IntPtr) start, (IntPtr) unused); } /// @@ -394,14 +361,13 @@ public void StartStyling(Position pos, int mask) /// public void SetStyling(int length, int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLING, length, style); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLING, (IntPtr) length, (IntPtr) style); } /// Is drawing done first into a buffer or direct to the screen? (Scintilla feature 2034) public bool GetBufferedDraw() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETBUFFEREDDRAW, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETBUFFEREDDRAW, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -411,39 +377,37 @@ public bool GetBufferedDraw() /// public void SetBufferedDraw(bool buffered) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETBUFFEREDDRAW, buffered ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETBUFFEREDDRAW, new IntPtr(buffered ? 1 : 0), (IntPtr) Unused); } /// Change the visible size of a tab to be a multiple of the width of a space character. (Scintilla feature 2036) public void SetTabWidth(int tabWidth) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTABWIDTH, tabWidth, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETTABWIDTH, (IntPtr) tabWidth, (IntPtr) Unused); } /// Retrieve the visible size of a tab. (Scintilla feature 2121) public int GetTabWidth() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTABWIDTH, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETTABWIDTH, (IntPtr) Unused, (IntPtr) Unused); } /// Clear explicit tabstops on a line. (Scintilla feature 2675) public void ClearTabStops(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARTABSTOPS, line, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CLEARTABSTOPS, (IntPtr) line, (IntPtr) Unused); } /// Add an explicit tab stop for a line. (Scintilla feature 2676) public void AddTabStop(int line, int x) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDTABSTOP, line, x); + Win32.SendMessage(scintilla, SciMsg.SCI_ADDTABSTOP, (IntPtr) line, (IntPtr) x); } /// Find the next explicit tab stop position on a line after a position. (Scintilla feature 2677) public int GetNextTabStop(int line, int x) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETNEXTTABSTOP, line, x); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETNEXTTABSTOP, (IntPtr) line, (IntPtr) x); } /// @@ -453,76 +417,73 @@ public int GetNextTabStop(int line, int x) /// public void SetCodePage(int codePage) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCODEPAGE, codePage, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCODEPAGE, (IntPtr) codePage, (IntPtr) Unused); } - /// Is the IME displayed in a winow or inline? (Scintilla feature 2678) - public int GetIMEInteraction() + /// Is the IME displayed in a window or inline? (Scintilla feature 2678) + public IMEInteraction GetIMEInteraction() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETIMEINTERACTION, Unused, Unused); - return (int) res; + return (IMEInteraction)Win32.SendMessage(scintilla, SciMsg.SCI_GETIMEINTERACTION, (IntPtr) Unused, (IntPtr) Unused); } /// Choose to display the the IME in a winow or inline. (Scintilla feature 2679) - public void SetIMEInteraction(int imeInteraction) + public void SetIMEInteraction(IMEInteraction imeInteraction) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETIMEINTERACTION, imeInteraction, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETIMEINTERACTION, (IntPtr) imeInteraction, (IntPtr) Unused); } /// Set the symbol used for a particular marker number. (Scintilla feature 2040) - public void MarkerDefine(int markerNumber, int markerSymbol) + public void MarkerDefine(int markerNumber, MarkerSymbol markerSymbol) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINE, markerNumber, markerSymbol); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINE, (IntPtr) markerNumber, (IntPtr) markerSymbol); } /// Set the foreground colour used for a particular marker number. (Scintilla feature 2041) public void MarkerSetFore(int markerNumber, Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETFORE, markerNumber, fore.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETFORE, (IntPtr) markerNumber, fore.Value); } /// Set the background colour used for a particular marker number. (Scintilla feature 2042) public void MarkerSetBack(int markerNumber, Colour back) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETBACK, markerNumber, back.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETBACK, (IntPtr) markerNumber, back.Value); } /// Set the background colour used for a particular marker number when its folding block is selected. (Scintilla feature 2292) public void MarkerSetBackSelected(int markerNumber, Colour back) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETBACKSELECTED, markerNumber, back.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETBACKSELECTED, (IntPtr) markerNumber, back.Value); } /// Enable/disable highlight for current folding bloc (smallest one that contains the caret) (Scintilla feature 2293) public void MarkerEnableHighlight(bool enabled) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERENABLEHIGHLIGHT, enabled ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERENABLEHIGHLIGHT, new IntPtr(enabled ? 1 : 0), (IntPtr) Unused); } /// Add a marker to a line, returning an ID which can be used to find or delete the marker. (Scintilla feature 2043) public int MarkerAdd(int line, int markerNumber) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADD, line, markerNumber); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADD, (IntPtr) line, (IntPtr) markerNumber); } /// Delete a marker from a line. (Scintilla feature 2044) public void MarkerDelete(int line, int markerNumber) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETE, line, markerNumber); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETE, (IntPtr) line, (IntPtr) markerNumber); } /// Delete all markers with a particular number from all lines. (Scintilla feature 2045) public void MarkerDeleteAll(int markerNumber) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEALL, markerNumber, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEALL, (IntPtr) markerNumber, (IntPtr) Unused); } /// Get a bit mask of all the markers set on a line. (Scintilla feature 2046) public int MarkerGet(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERGET, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERGET, (IntPtr) line, (IntPtr) Unused); } /// @@ -532,15 +493,13 @@ public int MarkerGet(int line) /// public int MarkerNext(int lineStart, int markerMask) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERNEXT, lineStart, markerMask); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERNEXT, (IntPtr) lineStart, (IntPtr) markerMask); } /// Find the previous line before lineStart that includes a marker in mask. (Scintilla feature 2048) public int MarkerPrevious(int lineStart, int markerMask) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERPREVIOUS, lineStart, markerMask); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERPREVIOUS, (IntPtr) lineStart, (IntPtr) markerMask); } /// Define a marker from a pixmap. (Scintilla feature 2049) @@ -548,121 +507,140 @@ public unsafe void MarkerDefinePixmap(int markerNumber, string pixmap) { fixed (byte* pixmapPtr = Encoding.UTF8.GetBytes(pixmap)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINEPIXMAP, markerNumber, (IntPtr) pixmapPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINEPIXMAP, (IntPtr) markerNumber, (IntPtr) pixmapPtr); } } /// Add a set of markers to a line. (Scintilla feature 2466) - public void MarkerAddSet(int line, int set) + public void MarkerAddSet(int line, int markerSet) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADDSET, line, set); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADDSET, (IntPtr) line, (IntPtr) markerSet); } /// Set the alpha used for a marker that is drawn in the text area, not the margin. (Scintilla feature 2476) - public void MarkerSetAlpha(int markerNumber, int alpha) + public void MarkerSetAlpha(int markerNumber, Alpha alpha) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETALPHA, markerNumber, alpha); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETALPHA, (IntPtr) markerNumber, (IntPtr) alpha); } /// Set a margin to be either numeric or symbolic. (Scintilla feature 2240) - public void SetMarginTypeN(int margin, int marginType) + public void SetMarginTypeN(int margin, MarginType marginType) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINTYPEN, margin, marginType); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINTYPEN, (IntPtr) margin, (IntPtr) marginType); } /// Retrieve the type of a margin. (Scintilla feature 2241) - public int GetMarginTypeN(int margin) + public MarginType GetMarginTypeN(int margin) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINTYPEN, margin, Unused); - return (int) res; + return (MarginType)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINTYPEN, (IntPtr) margin, (IntPtr) Unused); } /// Set the width of a margin to a width expressed in pixels. (Scintilla feature 2242) public void SetMarginWidthN(int margin, int pixelWidth) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINWIDTHN, margin, pixelWidth); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINWIDTHN, (IntPtr) margin, (IntPtr) pixelWidth); } /// Retrieve the width of a margin in pixels. (Scintilla feature 2243) public int GetMarginWidthN(int margin) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINWIDTHN, margin, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINWIDTHN, (IntPtr) margin, (IntPtr) Unused); } /// Set a mask that determines which markers are displayed in a margin. (Scintilla feature 2244) public void SetMarginMaskN(int margin, int mask) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINMASKN, margin, mask); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINMASKN, (IntPtr) margin, (IntPtr) mask); } /// Retrieve the marker mask of a margin. (Scintilla feature 2245) public int GetMarginMaskN(int margin) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINMASKN, margin, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINMASKN, (IntPtr) margin, (IntPtr) Unused); } /// Make a margin sensitive or insensitive to mouse clicks. (Scintilla feature 2246) public void SetMarginSensitiveN(int margin, bool sensitive) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINSENSITIVEN, margin, sensitive ? 1 : 0); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINSENSITIVEN, (IntPtr) margin, new IntPtr(sensitive ? 1 : 0)); } /// Retrieve the mouse click sensitivity of a margin. (Scintilla feature 2247) public bool GetMarginSensitiveN(int margin) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINSENSITIVEN, margin, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINSENSITIVEN, (IntPtr) margin, (IntPtr) Unused); } /// Set the cursor shown when the mouse is inside a margin. (Scintilla feature 2248) - public void SetMarginCursorN(int margin, int cursor) + public void SetMarginCursorN(int margin, CursorShape cursor) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINCURSORN, margin, cursor); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINCURSORN, (IntPtr) margin, (IntPtr) cursor); } /// Retrieve the cursor shown in a margin. (Scintilla feature 2249) - public int GetMarginCursorN(int margin) + public CursorShape GetMarginCursorN(int margin) + { + return (CursorShape)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINCURSORN, (IntPtr) margin, (IntPtr) Unused); + } + + /// Set the background colour of a margin. Only visible for SC_MARGIN_COLOUR. (Scintilla feature 2250) + public void SetMarginBackN(int margin, Colour back) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINBACKN, (IntPtr) margin, back.Value); + } + + /// Retrieve the background colour of a margin (Scintilla feature 2251) + public Colour GetMarginBackN(int margin) + { + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINBACKN, (IntPtr) margin, (IntPtr) Unused)); + } + + /// Allocate a non-standard number of margins. (Scintilla feature 2252) + public void SetMargins(int margins) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINCURSORN, margin, Unused); - return (int) res; + Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINS, (IntPtr) margins, (IntPtr) Unused); + } + + /// How many margins are there?. (Scintilla feature 2253) + public int GetMargins() + { + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINS, (IntPtr) Unused, (IntPtr) Unused); } /// Clear all the styles and make equivalent to the global default style. (Scintilla feature 2050) public void StyleClearAll() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLECLEARALL, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLECLEARALL, (IntPtr) Unused, (IntPtr) Unused); } /// Set the foreground colour of a style. (Scintilla feature 2051) public void StyleSetFore(int style, Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETFORE, style, fore.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETFORE, (IntPtr) style, fore.Value); } /// Set the background colour of a style. (Scintilla feature 2052) public void StyleSetBack(int style, Colour back) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETBACK, style, back.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETBACK, (IntPtr) style, back.Value); } /// Set a style to be bold or not. (Scintilla feature 2053) public void StyleSetBold(int style, bool bold) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETBOLD, style, bold ? 1 : 0); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETBOLD, (IntPtr) style, new IntPtr(bold ? 1 : 0)); } /// Set a style to be italic or not. (Scintilla feature 2054) public void StyleSetItalic(int style, bool italic) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETITALIC, style, italic ? 1 : 0); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETITALIC, (IntPtr) style, new IntPtr(italic ? 1 : 0)); } /// Set the size of characters of a style. (Scintilla feature 2055) public void StyleSetSize(int style, int sizePoints) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZE, style, sizePoints); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZE, (IntPtr) style, (IntPtr) sizePoints); } /// Set the font of a style. (Scintilla feature 2056) @@ -670,61 +648,56 @@ public unsafe void StyleSetFont(int style, string fontName) { fixed (byte* fontNamePtr = Encoding.UTF8.GetBytes(fontName)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETFONT, style, (IntPtr) fontNamePtr); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETFONT, (IntPtr) style, (IntPtr) fontNamePtr); } } /// Set a style to have its end of line filled or not. (Scintilla feature 2057) - public void StyleSetEOLFilled(int style, bool filled) + public void StyleSetEOLFilled(int style, bool eolFilled) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETEOLFILLED, style, filled ? 1 : 0); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETEOLFILLED, (IntPtr) style, new IntPtr(eolFilled ? 1 : 0)); } /// Reset the default style to its state at startup (Scintilla feature 2058) public void StyleResetDefault() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLERESETDEFAULT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLERESETDEFAULT, (IntPtr) Unused, (IntPtr) Unused); } /// Set a style to be underlined or not. (Scintilla feature 2059) public void StyleSetUnderline(int style, bool underline) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETUNDERLINE, style, underline ? 1 : 0); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETUNDERLINE, (IntPtr) style, new IntPtr(underline ? 1 : 0)); } /// Get the foreground colour of a style. (Scintilla feature 2481) public Colour StyleGetFore(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETFORE, style, Unused); - return new Colour((int) res); + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETFORE, (IntPtr) style, (IntPtr) Unused)); } /// Get the background colour of a style. (Scintilla feature 2482) public Colour StyleGetBack(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETBACK, style, Unused); - return new Colour((int) res); + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETBACK, (IntPtr) style, (IntPtr) Unused)); } /// Get is a style bold or not. (Scintilla feature 2483) public bool StyleGetBold(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETBOLD, style, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETBOLD, (IntPtr) style, (IntPtr) Unused); } /// Get is a style italic or not. (Scintilla feature 2484) public bool StyleGetItalic(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETITALIC, style, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETITALIC, (IntPtr) style, (IntPtr) Unused); } /// Get the size of characters of a style. (Scintilla feature 2485) public int StyleGetSize(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETSIZE, style, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETSIZE, (IntPtr) style, (IntPtr) Unused); } /// @@ -738,7 +711,7 @@ public unsafe string StyleGetFont(int style) byte[] fontNameBuffer = new byte[10000]; fixed (byte* fontNamePtr = fontNameBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETFONT, style, (IntPtr) fontNamePtr); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETFONT, (IntPtr) style, (IntPtr) fontNamePtr); return Encoding.UTF8.GetString(fontNameBuffer).TrimEnd('\0'); } } @@ -746,36 +719,31 @@ public unsafe string StyleGetFont(int style) /// Get is a style to have its end of line filled or not. (Scintilla feature 2487) public bool StyleGetEOLFilled(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETEOLFILLED, style, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETEOLFILLED, (IntPtr) style, (IntPtr) Unused); } /// Get is a style underlined or not. (Scintilla feature 2488) public bool StyleGetUnderline(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETUNDERLINE, style, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETUNDERLINE, (IntPtr) style, (IntPtr) Unused); } /// Get is a style mixed case, or to force upper or lower case. (Scintilla feature 2489) - public int StyleGetCase(int style) + public CaseVisible StyleGetCase(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCASE, style, Unused); - return (int) res; + return (CaseVisible)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCASE, (IntPtr) style, (IntPtr) Unused); } /// Get the character get of the font in a style. (Scintilla feature 2490) - public int StyleGetCharacterSet(int style) + public CharacterSet StyleGetCharacterSet(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHARACTERSET, style, Unused); - return (int) res; + return (CharacterSet)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHARACTERSET, (IntPtr) style, (IntPtr) Unused); } /// Get is a style visible or not. (Scintilla feature 2491) public bool StyleGetVisible(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETVISIBLE, style, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETVISIBLE, (IntPtr) style, (IntPtr) Unused); } /// @@ -785,121 +753,115 @@ public bool StyleGetVisible(int style) /// public bool StyleGetChangeable(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHANGEABLE, style, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHANGEABLE, (IntPtr) style, (IntPtr) Unused); } /// Get is a style a hotspot or not. (Scintilla feature 2493) public bool StyleGetHotSpot(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETHOTSPOT, style, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETHOTSPOT, (IntPtr) style, (IntPtr) Unused); } /// Set a style to be mixed case, or to force upper or lower case. (Scintilla feature 2060) - public void StyleSetCase(int style, int caseForce) + public void StyleSetCase(int style, CaseVisible caseVisible) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCASE, style, caseForce); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCASE, (IntPtr) style, (IntPtr) caseVisible); } /// Set the size of characters of a style. Size is in points multiplied by 100. (Scintilla feature 2061) - public void StyleSetSizeFractional(int style, int caseForce) + public void StyleSetSizeFractional(int style, int sizeHundredthPoints) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZEFRACTIONAL, style, caseForce); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZEFRACTIONAL, (IntPtr) style, (IntPtr) sizeHundredthPoints); } /// Get the size of characters of a style in points multiplied by 100 (Scintilla feature 2062) public int StyleGetSizeFractional(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETSIZEFRACTIONAL, style, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETSIZEFRACTIONAL, (IntPtr) style, (IntPtr) Unused); } /// Set the weight of characters of a style. (Scintilla feature 2063) - public void StyleSetWeight(int style, int weight) + public void StyleSetWeight(int style, FontWeight weight) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETWEIGHT, style, weight); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETWEIGHT, (IntPtr) style, (IntPtr) weight); } /// Get the weight of characters of a style. (Scintilla feature 2064) - public int StyleGetWeight(int style) + public FontWeight StyleGetWeight(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETWEIGHT, style, Unused); - return (int) res; + return (FontWeight)Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETWEIGHT, (IntPtr) style, (IntPtr) Unused); } /// Set the character set of the font in a style. (Scintilla feature 2066) - public void StyleSetCharacterSet(int style, int characterSet) + public void StyleSetCharacterSet(int style, CharacterSet characterSet) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHARACTERSET, style, characterSet); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHARACTERSET, (IntPtr) style, (IntPtr) characterSet); } /// Set a style to be a hotspot or not. (Scintilla feature 2409) public void StyleSetHotSpot(int style, bool hotspot) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETHOTSPOT, style, hotspot ? 1 : 0); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETHOTSPOT, (IntPtr) style, new IntPtr(hotspot ? 1 : 0)); } /// Set the foreground colour of the main and additional selections and whether to use this setting. (Scintilla feature 2067) public void SetSelFore(bool useSetting, Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELFORE, useSetting ? 1 : 0, fore.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELFORE, new IntPtr(useSetting ? 1 : 0), fore.Value); } /// Set the background colour of the main and additional selections and whether to use this setting. (Scintilla feature 2068) public void SetSelBack(bool useSetting, Colour back) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELBACK, useSetting ? 1 : 0, back.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELBACK, new IntPtr(useSetting ? 1 : 0), back.Value); } /// Get the alpha of the selection. (Scintilla feature 2477) - public int GetSelAlpha() + public Alpha GetSelAlpha() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELALPHA, Unused, Unused); - return (int) res; + return (Alpha)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELALPHA, (IntPtr) Unused, (IntPtr) Unused); } /// Set the alpha of the selection. (Scintilla feature 2478) - public void SetSelAlpha(int alpha) + public void SetSelAlpha(Alpha alpha) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELALPHA, alpha, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELALPHA, (IntPtr) alpha, (IntPtr) Unused); } /// Is the selection end of line filled? (Scintilla feature 2479) public bool GetSelEOLFilled() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELEOLFILLED, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELEOLFILLED, (IntPtr) Unused, (IntPtr) Unused); } /// Set the selection to have its end of line filled or not. (Scintilla feature 2480) public void SetSelEOLFilled(bool filled) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELEOLFILLED, filled ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELEOLFILLED, new IntPtr(filled ? 1 : 0), (IntPtr) Unused); } /// Set the foreground colour of the caret. (Scintilla feature 2069) public void SetCaretFore(Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETFORE, fore.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETFORE, fore.Value, (IntPtr) Unused); } - /// When key+modifier combination km is pressed perform msg. (Scintilla feature 2070) - public void AssignCmdKey(KeyModifier km, int msg) + /// When key+modifier combination keyDefinition is pressed perform sciCommand. (Scintilla feature 2070) + public void AssignCmdKey(KeyModifier keyDefinition, int sciCommand) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ASSIGNCMDKEY, km.Value, msg); + Win32.SendMessage(scintilla, SciMsg.SCI_ASSIGNCMDKEY, keyDefinition.Value, (IntPtr) sciCommand); } - /// When key+modifier combination km is pressed do nothing. (Scintilla feature 2071) - public void ClearCmdKey(KeyModifier km) + /// When key+modifier combination keyDefinition is pressed do nothing. (Scintilla feature 2071) + public void ClearCmdKey(KeyModifier keyDefinition) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARCMDKEY, km.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CLEARCMDKEY, keyDefinition.Value, (IntPtr) Unused); } /// Drop all key mappings. (Scintilla feature 2072) public void ClearAllCmdKeys() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALLCMDKEYS, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALLCMDKEYS, (IntPtr) Unused, (IntPtr) Unused); } /// Set the styles for a segment of the document. (Scintilla feature 2073) @@ -907,27 +869,26 @@ public unsafe void SetStylingEx(int length, string styles) { fixed (byte* stylesPtr = Encoding.UTF8.GetBytes(styles)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLINGEX, length, (IntPtr) stylesPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLINGEX, (IntPtr) length, (IntPtr) stylesPtr); } } /// Set a style to be visible or not. (Scintilla feature 2074) public void StyleSetVisible(int style, bool visible) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETVISIBLE, style, visible ? 1 : 0); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETVISIBLE, (IntPtr) style, new IntPtr(visible ? 1 : 0)); } /// Get the time in milliseconds that the caret is on and off. (Scintilla feature 2075) public int GetCaretPeriod() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETPERIOD, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETPERIOD, (IntPtr) Unused, (IntPtr) Unused); } /// Get the time in milliseconds that the caret is on and off. 0 = steady on. (Scintilla feature 2076) public void SetCaretPeriod(int periodMilliseconds) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETPERIOD, periodMilliseconds, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETPERIOD, (IntPtr) periodMilliseconds, (IntPtr) Unused); } /// @@ -939,7 +900,7 @@ public unsafe void SetWordChars(string characters) { fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWORDCHARS, Unused, (IntPtr) charactersPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_SETWORDCHARS, (IntPtr) Unused, (IntPtr) charactersPtr); } } @@ -953,11 +914,23 @@ public unsafe string GetWordChars() byte[] charactersBuffer = new byte[10000]; fixed (byte* charactersPtr = charactersBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWORDCHARS, Unused, (IntPtr) charactersPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_GETWORDCHARS, (IntPtr) Unused, (IntPtr) charactersPtr); return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0'); } } + /// Set the number of characters to have directly indexed categories (Scintilla feature 2720) + public void SetCharacterCategoryOptimization(int countCharacters) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETCHARACTERCATEGORYOPTIMIZATION, (IntPtr) countCharacters, (IntPtr) Unused); + } + + /// Get the number of characters to have directly indexed categories (Scintilla feature 2721) + public int GetCharacterCategoryOptimization() + { + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERCATEGORYOPTIMIZATION, (IntPtr) Unused, (IntPtr) Unused); + } + /// /// Start a sequence of actions that is undone and redone as a unit. /// May be nested. @@ -965,180 +938,171 @@ public unsafe string GetWordChars() /// public void BeginUndoAction() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BEGINUNDOACTION, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_BEGINUNDOACTION, (IntPtr) Unused, (IntPtr) Unused); } /// End a sequence of actions that is undone and redone as a unit. (Scintilla feature 2079) public void EndUndoAction() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENDUNDOACTION, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_ENDUNDOACTION, (IntPtr) Unused, (IntPtr) Unused); } /// Set an indicator to plain, squiggle or TT. (Scintilla feature 2080) - public void IndicSetStyle(int indic, int style) + public void IndicSetStyle(int indicator, IndicatorStyle indicatorStyle) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETSTYLE, indic, style); + Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETSTYLE, (IntPtr) indicator, (IntPtr) indicatorStyle); } /// Retrieve the style of an indicator. (Scintilla feature 2081) - public int IndicGetStyle(int indic) + public IndicatorStyle IndicGetStyle(int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETSTYLE, indic, Unused); - return (int) res; + return (IndicatorStyle)Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETSTYLE, (IntPtr) indicator, (IntPtr) Unused); } /// Set the foreground colour of an indicator. (Scintilla feature 2082) - public void IndicSetFore(int indic, Colour fore) + public void IndicSetFore(int indicator, Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFORE, indic, fore.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFORE, (IntPtr) indicator, fore.Value); } /// Retrieve the foreground colour of an indicator. (Scintilla feature 2083) - public Colour IndicGetFore(int indic) + public Colour IndicGetFore(int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFORE, indic, Unused); - return new Colour((int) res); + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFORE, (IntPtr) indicator, (IntPtr) Unused)); } /// Set an indicator to draw under text or over(default). (Scintilla feature 2510) - public void IndicSetUnder(int indic, bool under) + public void IndicSetUnder(int indicator, bool under) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETUNDER, indic, under ? 1 : 0); + Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETUNDER, (IntPtr) indicator, new IntPtr(under ? 1 : 0)); } /// Retrieve whether indicator drawn under or over text. (Scintilla feature 2511) - public bool IndicGetUnder(int indic) + public bool IndicGetUnder(int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETUNDER, indic, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETUNDER, (IntPtr) indicator, (IntPtr) Unused); } /// Set a hover indicator to plain, squiggle or TT. (Scintilla feature 2680) - public void IndicSetHoverStyle(int indic, int style) + public void IndicSetHoverStyle(int indicator, IndicatorStyle indicatorStyle) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETHOVERSTYLE, indic, style); + Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETHOVERSTYLE, (IntPtr) indicator, (IntPtr) indicatorStyle); } /// Retrieve the hover style of an indicator. (Scintilla feature 2681) - public int IndicGetHoverStyle(int indic) + public IndicatorStyle IndicGetHoverStyle(int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETHOVERSTYLE, indic, Unused); - return (int) res; + return (IndicatorStyle)Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETHOVERSTYLE, (IntPtr) indicator, (IntPtr) Unused); } /// Set the foreground hover colour of an indicator. (Scintilla feature 2682) - public void IndicSetHoverFore(int indic, Colour fore) + public void IndicSetHoverFore(int indicator, Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETHOVERFORE, indic, fore.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETHOVERFORE, (IntPtr) indicator, fore.Value); } /// Retrieve the foreground hover colour of an indicator. (Scintilla feature 2683) - public Colour IndicGetHoverFore(int indic) + public Colour IndicGetHoverFore(int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETHOVERFORE, indic, Unused); - return new Colour((int) res); + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETHOVERFORE, (IntPtr) indicator, (IntPtr) Unused)); } /// Set the attributes of an indicator. (Scintilla feature 2684) - public void IndicSetFlags(int indic, int flags) + public void IndicSetFlags(int indicator, IndicFlag flags) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFLAGS, indic, flags); + Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFLAGS, (IntPtr) indicator, (IntPtr) flags); } /// Retrieve the attributes of an indicator. (Scintilla feature 2685) - public int IndicGetFlags(int indic) + public IndicFlag IndicGetFlags(int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFLAGS, indic, Unused); - return (int) res; + return (IndicFlag)Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFLAGS, (IntPtr) indicator, (IntPtr) Unused); } /// Set the foreground colour of all whitespace and whether to use this setting. (Scintilla feature 2084) public void SetWhitespaceFore(bool useSetting, Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACEFORE, useSetting ? 1 : 0, fore.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACEFORE, new IntPtr(useSetting ? 1 : 0), fore.Value); } /// Set the background colour of all whitespace and whether to use this setting. (Scintilla feature 2085) public void SetWhitespaceBack(bool useSetting, Colour back) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACEBACK, useSetting ? 1 : 0, back.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACEBACK, new IntPtr(useSetting ? 1 : 0), back.Value); } /// Set the size of the dots used to mark space characters. (Scintilla feature 2086) public void SetWhitespaceSize(int size) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACESIZE, size, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACESIZE, (IntPtr) size, (IntPtr) Unused); } /// Get the size of the dots used to mark space characters. (Scintilla feature 2087) public int GetWhitespaceSize() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWHITESPACESIZE, Unused, Unused); - return (int) res; - } - - /// - /// 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) - /// - public void SetStyleBits(int bits) - { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLEBITS, bits, Unused); - } - - /// Retrieve number of bits in style bytes used to hold the lexical state. (Scintilla feature 2091) - public int GetStyleBits() - { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEBITS, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETWHITESPACESIZE, (IntPtr) Unused, (IntPtr) Unused); } /// Used to hold extra styling information for each line. (Scintilla feature 2092) public void SetLineState(int line, int state) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINESTATE, line, state); + Win32.SendMessage(scintilla, SciMsg.SCI_SETLINESTATE, (IntPtr) line, (IntPtr) state); } /// Retrieve the extra styling information for a line. (Scintilla feature 2093) public int GetLineState(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESTATE, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESTATE, (IntPtr) line, (IntPtr) Unused); } /// Retrieve the last line number that has line state. (Scintilla feature 2094) public int GetMaxLineState() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMAXLINESTATE, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMAXLINESTATE, (IntPtr) Unused, (IntPtr) Unused); } /// Is the background of the line containing the caret in a different colour? (Scintilla feature 2095) public bool GetCaretLineVisible() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEVISIBLE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEVISIBLE, (IntPtr) Unused, (IntPtr) Unused); } /// Display the background of the line containing the caret in a different colour. (Scintilla feature 2096) public void SetCaretLineVisible(bool show) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEVISIBLE, show ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEVISIBLE, new IntPtr(show ? 1 : 0), (IntPtr) Unused); } /// Get the colour of the background of the line containing the caret. (Scintilla feature 2097) public Colour GetCaretLineBack() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEBACK, Unused, Unused); - return new Colour((int) res); + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEBACK, (IntPtr) Unused, (IntPtr) Unused)); } /// Set the colour of the background of the line containing the caret. (Scintilla feature 2098) public void SetCaretLineBack(Colour back) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEBACK, back.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEBACK, back.Value, (IntPtr) Unused); + } + + /// + /// Retrieve the caret line frame width. + /// Width = 0 means this option is disabled. + /// (Scintilla feature 2704) + /// + public int GetCaretLineFrame() + { + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEFRAME, (IntPtr) Unused, (IntPtr) Unused); + } + + /// + /// Display the caret line framed. + /// Set width != 0 to enable this option and width = 0 to disable it. + /// (Scintilla feature 2705) + /// + public void SetCaretLineFrame(int width) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEFRAME, (IntPtr) width, (IntPtr) Unused); } /// @@ -1148,47 +1112,45 @@ public void SetCaretLineBack(Colour back) /// public void StyleSetChangeable(int style, bool changeable) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHANGEABLE, style, changeable ? 1 : 0); + Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHANGEABLE, (IntPtr) style, new IntPtr(changeable ? 1 : 0)); } /// /// Display a auto-completion list. - /// The lenEntered parameter indicates how many characters before + /// The lengthEntered parameter indicates how many characters before /// the caret should be used to provide context. /// (Scintilla feature 2100) /// - public unsafe void AutoCShow(int lenEntered, string itemList) + public unsafe void AutoCShow(int lengthEntered, string itemList) { fixed (byte* itemListPtr = Encoding.UTF8.GetBytes(itemList)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSHOW, lenEntered, (IntPtr) itemListPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSHOW, (IntPtr) lengthEntered, (IntPtr) itemListPtr); } } /// Remove the auto-completion list from the screen. (Scintilla feature 2101) public void AutoCCancel() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCCANCEL, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCCANCEL, (IntPtr) Unused, (IntPtr) Unused); } /// Is there an auto-completion list visible? (Scintilla feature 2102) public bool AutoCActive() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCACTIVE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCACTIVE, (IntPtr) Unused, (IntPtr) Unused); } /// Retrieve the position of the caret when the auto-completion list was displayed. (Scintilla feature 2103) - public Position AutoCPosStart() + public int AutoCPosStart() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCPOSSTART, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCPOSSTART, (IntPtr) Unused, (IntPtr) Unused); } /// User has selected an item so remove the list and insert the selection. (Scintilla feature 2104) public void AutoCComplete() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCCOMPLETE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCCOMPLETE, (IntPtr) Unused, (IntPtr) Unused); } /// Define a set of character that when typed cancel the auto-completion list. (Scintilla feature 2105) @@ -1196,7 +1158,7 @@ public unsafe void AutoCStops(string characterSet) { fixed (byte* characterSetPtr = Encoding.UTF8.GetBytes(characterSet)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSTOPS, Unused, (IntPtr) characterSetPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSTOPS, (IntPtr) Unused, (IntPtr) characterSetPtr); } } @@ -1207,22 +1169,21 @@ public unsafe void AutoCStops(string characterSet) /// public void AutoCSetSeparator(int separatorCharacter) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETSEPARATOR, separatorCharacter, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETSEPARATOR, (IntPtr) separatorCharacter, (IntPtr) Unused); } /// Retrieve the auto-completion list separator character. (Scintilla feature 2107) public int AutoCGetSeparator() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETSEPARATOR, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETSEPARATOR, (IntPtr) Unused, (IntPtr) Unused); } /// Select the item in the auto-completion list that starts with a string. (Scintilla feature 2108) - public unsafe void AutoCSelect(string text) + public unsafe void AutoCSelect(string select) { - fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) + fixed (byte* selectPtr = Encoding.UTF8.GetBytes(select)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSELECT, Unused, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSELECT, (IntPtr) Unused, (IntPtr) selectPtr); } } @@ -1233,14 +1194,13 @@ public unsafe void AutoCSelect(string text) /// public void AutoCSetCancelAtStart(bool cancel) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCANCELATSTART, cancel ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCANCELATSTART, new IntPtr(cancel ? 1 : 0), (IntPtr) Unused); } /// Retrieve whether auto-completion cancelled by backspacing before start. (Scintilla feature 2111) public bool AutoCGetCancelAtStart() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCANCELATSTART, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCANCELATSTART, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1252,34 +1212,32 @@ public unsafe void AutoCSetFillUps(string characterSet) { fixed (byte* characterSetPtr = Encoding.UTF8.GetBytes(characterSet)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETFILLUPS, Unused, (IntPtr) characterSetPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETFILLUPS, (IntPtr) Unused, (IntPtr) characterSetPtr); } } /// Should a single item auto-completion list automatically choose the item. (Scintilla feature 2113) public void AutoCSetChooseSingle(bool chooseSingle) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCHOOSESINGLE, chooseSingle ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCHOOSESINGLE, new IntPtr(chooseSingle ? 1 : 0), (IntPtr) Unused); } /// Retrieve whether a single item auto-completion list automatically choose the item. (Scintilla feature 2114) public bool AutoCGetChooseSingle() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCHOOSESINGLE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCHOOSESINGLE, (IntPtr) Unused, (IntPtr) Unused); } /// Set whether case is significant when performing auto-completion searches. (Scintilla feature 2115) public void AutoCSetIgnoreCase(bool ignoreCase) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETIGNORECASE, ignoreCase ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETIGNORECASE, new IntPtr(ignoreCase ? 1 : 0), (IntPtr) Unused); } /// Retrieve state of ignore case flag. (Scintilla feature 2116) public bool AutoCGetIgnoreCase() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETIGNORECASE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETIGNORECASE, (IntPtr) Unused, (IntPtr) Unused); } /// Display a list of strings and send notification when user chooses one. (Scintilla feature 2117) @@ -1287,21 +1245,20 @@ public unsafe void UserListShow(int listType, string itemList) { fixed (byte* itemListPtr = Encoding.UTF8.GetBytes(itemList)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_USERLISTSHOW, listType, (IntPtr) itemListPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_USERLISTSHOW, (IntPtr) listType, (IntPtr) itemListPtr); } } /// Set whether or not autocompletion is hidden automatically when nothing matches. (Scintilla feature 2118) public void AutoCSetAutoHide(bool autoHide) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETAUTOHIDE, autoHide ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETAUTOHIDE, new IntPtr(autoHide ? 1 : 0), (IntPtr) Unused); } /// Retrieve whether or not autocompletion is hidden automatically when nothing matches. (Scintilla feature 2119) public bool AutoCGetAutoHide() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETAUTOHIDE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETAUTOHIDE, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1311,7 +1268,7 @@ public bool AutoCGetAutoHide() /// public void AutoCSetDropRestOfWord(bool dropRestOfWord) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETDROPRESTOFWORD, dropRestOfWord ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETDROPRESTOFWORD, new IntPtr(dropRestOfWord ? 1 : 0), (IntPtr) Unused); } /// @@ -1321,8 +1278,7 @@ public void AutoCSetDropRestOfWord(bool dropRestOfWord) /// public bool AutoCGetDropRestOfWord() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETDROPRESTOFWORD, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETDROPRESTOFWORD, (IntPtr) Unused, (IntPtr) Unused); } /// Register an XPM image for use in autocompletion lists. (Scintilla feature 2405) @@ -1330,21 +1286,20 @@ public unsafe void RegisterImage(int type, string xpmData) { fixed (byte* xpmDataPtr = Encoding.UTF8.GetBytes(xpmData)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REGISTERIMAGE, type, (IntPtr) xpmDataPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_REGISTERIMAGE, (IntPtr) type, (IntPtr) xpmDataPtr); } } /// Clear all the registered XPM images. (Scintilla feature 2408) public void ClearRegisteredImages() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARREGISTEREDIMAGES, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CLEARREGISTEREDIMAGES, (IntPtr) Unused, (IntPtr) Unused); } /// Retrieve the auto-completion list type-separator character. (Scintilla feature 2285) public int AutoCGetTypeSeparator() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETTYPESEPARATOR, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETTYPESEPARATOR, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1354,7 +1309,7 @@ public int AutoCGetTypeSeparator() /// public void AutoCSetTypeSeparator(int separatorCharacter) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETTYPESEPARATOR, separatorCharacter, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETTYPESEPARATOR, (IntPtr) separatorCharacter, (IntPtr) Unused); } /// @@ -1364,14 +1319,13 @@ public void AutoCSetTypeSeparator(int separatorCharacter) /// public void AutoCSetMaxWidth(int characterCount) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMAXWIDTH, characterCount, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMAXWIDTH, (IntPtr) characterCount, (IntPtr) Unused); } /// Get the maximum width, in characters, of auto-completion and user lists. (Scintilla feature 2209) public int AutoCGetMaxWidth() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMAXWIDTH, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMAXWIDTH, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1381,27 +1335,25 @@ public int AutoCGetMaxWidth() /// public void AutoCSetMaxHeight(int rowCount) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMAXHEIGHT, rowCount, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMAXHEIGHT, (IntPtr) rowCount, (IntPtr) Unused); } /// Set the maximum height, in rows, of auto-completion and user lists. (Scintilla feature 2211) public int AutoCGetMaxHeight() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMAXHEIGHT, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMAXHEIGHT, (IntPtr) Unused, (IntPtr) Unused); } /// Set the number of spaces used for one level of indentation. (Scintilla feature 2122) public void SetIndent(int indentSize) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDENT, indentSize, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETINDENT, (IntPtr) indentSize, (IntPtr) Unused); } /// Retrieve indentation size. (Scintilla feature 2123) public int GetIndent() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDENT, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETINDENT, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1411,74 +1363,73 @@ public int GetIndent() /// public void SetUseTabs(bool useTabs) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUSETABS, useTabs ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETUSETABS, new IntPtr(useTabs ? 1 : 0), (IntPtr) Unused); } /// Retrieve whether tabs will be used in indentation. (Scintilla feature 2125) public bool GetUseTabs() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETUSETABS, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETUSETABS, (IntPtr) Unused, (IntPtr) Unused); } /// Change the indentation of a line to a number of columns. (Scintilla feature 2126) - public void SetLineIndentation(int line, int indentSize) + public void SetLineIndentation(int line, int indentation) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINEINDENTATION, line, indentSize); + Win32.SendMessage(scintilla, SciMsg.SCI_SETLINEINDENTATION, (IntPtr) line, (IntPtr) indentation); } /// Retrieve the number of columns that a line is indented. (Scintilla feature 2127) public int GetLineIndentation(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEINDENTATION, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEINDENTATION, (IntPtr) line, (IntPtr) Unused); } /// Retrieve the position before the first non indentation character on a line. (Scintilla feature 2128) - public Position GetLineIndentPosition(int line) + public int GetLineIndentPosition(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEINDENTPOSITION, line, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEINDENTPOSITION, (IntPtr) line, (IntPtr) Unused); } /// Retrieve the column number of a position, taking tab width into account. (Scintilla feature 2129) - public int GetColumn(Position pos) + public int GetColumn(int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCOLUMN, pos.Value, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCOLUMN, (IntPtr) pos, (IntPtr) Unused); } /// Count characters between two positions. (Scintilla feature 2633) - public int CountCharacters(int startPos, int endPos) + public int CountCharacters(int start, int end) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COUNTCHARACTERS, startPos, endPos); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_COUNTCHARACTERS, (IntPtr) start, (IntPtr) end); + } + + /// Count code units between two positions. (Scintilla feature 2715) + public int CountCodeUnits(int start, int end) + { + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_COUNTCODEUNITS, (IntPtr) start, (IntPtr) end); } /// Show or hide the horizontal scroll bar. (Scintilla feature 2130) - public void SetHScrollBar(bool show) + public void SetHScrollBar(bool visible) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHSCROLLBAR, show ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETHSCROLLBAR, new IntPtr(visible ? 1 : 0), (IntPtr) Unused); } /// Is the horizontal scroll bar visible? (Scintilla feature 2131) public bool GetHScrollBar() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHSCROLLBAR, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETHSCROLLBAR, (IntPtr) Unused, (IntPtr) Unused); } /// Show or hide indentation guides. (Scintilla feature 2132) - public void SetIndentationGuides(int indentView) + public void SetIndentationGuides(IndentView indentView) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDENTATIONGUIDES, indentView, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETINDENTATIONGUIDES, (IntPtr) indentView, (IntPtr) Unused); } /// Are the indentation guides visible? (Scintilla feature 2133) - public int GetIndentationGuides() + public IndentView GetIndentationGuides() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDENTATIONGUIDES, Unused, Unused); - return (int) res; + return (IndentView)Win32.SendMessage(scintilla, SciMsg.SCI_GETINDENTATIONGUIDES, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1488,120 +1439,109 @@ public int GetIndentationGuides() /// public void SetHighlightGuide(int column) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHIGHLIGHTGUIDE, column, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETHIGHLIGHTGUIDE, (IntPtr) column, (IntPtr) Unused); } /// Get the highlighted indentation guide column. (Scintilla feature 2135) public int GetHighlightGuide() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHIGHLIGHTGUIDE, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETHIGHLIGHTGUIDE, (IntPtr) Unused, (IntPtr) Unused); } /// Get the position after the last visible characters on a line. (Scintilla feature 2136) - public Position GetLineEndPosition(int line) + public int GetLineEndPosition(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDPOSITION, line, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDPOSITION, (IntPtr) line, (IntPtr) Unused); } /// Get the code page used to interpret the bytes of the document as characters. (Scintilla feature 2137) public int GetCodePage() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCODEPAGE, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCODEPAGE, (IntPtr) Unused, (IntPtr) Unused); } /// Get the foreground colour of the caret. (Scintilla feature 2138) public Colour GetCaretFore() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETFORE, Unused, Unused); - return new Colour((int) res); + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETFORE, (IntPtr) Unused, (IntPtr) Unused)); } /// In read-only mode? (Scintilla feature 2140) public bool GetReadOnly() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETREADONLY, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETREADONLY, (IntPtr) Unused, (IntPtr) Unused); } /// Sets the position of the caret. (Scintilla feature 2141) - public void SetCurrentPos(Position pos) + public void SetCurrentPos(int caret) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCURRENTPOS, pos.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCURRENTPOS, (IntPtr) caret, (IntPtr) Unused); } /// Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2142) - public void SetSelectionStart(Position pos) + public void SetSelectionStart(int anchor) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONSTART, pos.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONSTART, (IntPtr) anchor, (IntPtr) Unused); } /// Returns the position at the start of the selection. (Scintilla feature 2143) - public Position GetSelectionStart() + public int GetSelectionStart() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONSTART, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONSTART, (IntPtr) Unused, (IntPtr) Unused); } - /// Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2144) - public void SetSelectionEnd(Position pos) + /// Sets the position that ends the selection - this becomes the caret. (Scintilla feature 2144) + public void SetSelectionEnd(int caret) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONEND, pos.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONEND, (IntPtr) caret, (IntPtr) Unused); } /// Returns the position at the end of the selection. (Scintilla feature 2145) - public Position GetSelectionEnd() + public int GetSelectionEnd() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONEND, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONEND, (IntPtr) Unused, (IntPtr) Unused); } /// Set caret to a position, while removing any existing selection. (Scintilla feature 2556) - public void SetEmptySelection(Position pos) + public void SetEmptySelection(int caret) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEMPTYSELECTION, pos.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETEMPTYSELECTION, (IntPtr) caret, (IntPtr) Unused); } /// Sets the print magnification added to the point size of each style for printing. (Scintilla feature 2146) public void SetPrintMagnification(int magnification) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTMAGNIFICATION, magnification, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTMAGNIFICATION, (IntPtr) magnification, (IntPtr) Unused); } /// Returns the print magnification. (Scintilla feature 2147) public int GetPrintMagnification() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTMAGNIFICATION, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTMAGNIFICATION, (IntPtr) Unused, (IntPtr) Unused); } /// Modify colours when printing for clearer printed text. (Scintilla feature 2148) - public void SetPrintColourMode(int mode) + public void SetPrintColourMode(PrintOption mode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTCOLOURMODE, mode, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTCOLOURMODE, (IntPtr) mode, (IntPtr) Unused); } /// Returns the print colour mode. (Scintilla feature 2149) - public int GetPrintColourMode() + public PrintOption GetPrintColourMode() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTCOLOURMODE, Unused, Unused); - return (int) res; + return (PrintOption)Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTCOLOURMODE, (IntPtr) Unused, (IntPtr) Unused); } /// Find some text in the document. (Scintilla feature 2150) - public Position FindText(int flags, TextToFind ft) + public int FindText(FindOption searchFlags, TextToFind ft) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDTEXT, flags, ft.NativePointer); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_FINDTEXT, (IntPtr) searchFlags, ft.NativePointer); } /// Retrieve the display line at the top of the display. (Scintilla feature 2152) public int GetFirstVisibleLine() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFIRSTVISIBLELINE, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETFIRSTVISIBLELINE, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1614,7 +1554,7 @@ public unsafe string GetLine(int line) byte[] textBuffer = new byte[10000]; fixed (byte* textPtr = textBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINE, line, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_GETLINE, (IntPtr) line, (IntPtr) textPtr); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } @@ -1622,47 +1562,43 @@ public unsafe string GetLine(int line) /// Returns the number of lines in the document. There is always at least one. (Scintilla feature 2154) public int GetLineCount() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINECOUNT, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINECOUNT, (IntPtr) Unused, (IntPtr) Unused); } /// Sets the size in pixels of the left margin. (Scintilla feature 2155) public void SetMarginLeft(int pixelWidth) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINLEFT, Unused, pixelWidth); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINLEFT, (IntPtr) Unused, (IntPtr) pixelWidth); } /// Returns the size in pixels of the left margin. (Scintilla feature 2156) public int GetMarginLeft() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINLEFT, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINLEFT, (IntPtr) Unused, (IntPtr) Unused); } /// Sets the size in pixels of the right margin. (Scintilla feature 2157) public void SetMarginRight(int pixelWidth) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINRIGHT, Unused, pixelWidth); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINRIGHT, (IntPtr) Unused, (IntPtr) pixelWidth); } /// Returns the size in pixels of the right margin. (Scintilla feature 2158) public int GetMarginRight() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINRIGHT, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINRIGHT, (IntPtr) Unused, (IntPtr) Unused); } /// Is the document different from when it was last saved? (Scintilla feature 2159) public bool GetModify() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMODIFY, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMODIFY, (IntPtr) Unused, (IntPtr) Unused); } /// Select a range of text. (Scintilla feature 2160) - public void SetSel(Position start, Position end) + public void SetSel(int anchor, int caret) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSEL, start.Value, end.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSEL, (IntPtr) anchor, (IntPtr) caret); } /// @@ -1676,7 +1612,7 @@ public unsafe string GetSelText() byte[] textBuffer = new byte[10000]; fixed (byte* textPtr = textBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, Unused, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, (IntPtr) Unused, (IntPtr) textPtr); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } @@ -1688,54 +1624,49 @@ public unsafe string GetSelText() /// public int GetTextRange(TextRange tr) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXTRANGE, Unused, tr.NativePointer); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXTRANGE, (IntPtr) Unused, tr.NativePointer); } - /// Draw the selection in normal style or with selection highlighted. (Scintilla feature 2163) - public void HideSelection(bool normal) + /// Draw the selection either highlighted or in normal (non-highlighted) style. (Scintilla feature 2163) + public void HideSelection(bool hide) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HIDESELECTION, normal ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_HIDESELECTION, new IntPtr(hide ? 1 : 0), (IntPtr) Unused); } /// Retrieve the x value of the point in the window where a position is displayed. (Scintilla feature 2164) - public int PointXFromPosition(Position pos) + public int PointXFromPosition(int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POINTXFROMPOSITION, Unused, pos.Value); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POINTXFROMPOSITION, (IntPtr) Unused, (IntPtr) pos); } /// Retrieve the y value of the point in the window where a position is displayed. (Scintilla feature 2165) - public int PointYFromPosition(Position pos) + public int PointYFromPosition(int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POINTYFROMPOSITION, Unused, pos.Value); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POINTYFROMPOSITION, (IntPtr) Unused, (IntPtr) pos); } /// Retrieve the line containing a position. (Scintilla feature 2166) - public int LineFromPosition(Position pos) + public int LineFromPosition(int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEFROMPOSITION, pos.Value, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_LINEFROMPOSITION, (IntPtr) pos, (IntPtr) Unused); } /// Retrieve the position at the start of a line. (Scintilla feature 2167) - public Position PositionFromLine(int line) + public int PositionFromLine(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMLINE, line, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMLINE, (IntPtr) line, (IntPtr) Unused); } /// Scroll horizontally and vertically. (Scintilla feature 2168) public void LineScroll(int columns, int lines) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLL, columns, lines); + Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLL, (IntPtr) columns, (IntPtr) lines); } /// Ensure the caret is visible. (Scintilla feature 2169) public void ScrollCaret() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLCARET, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLCARET, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1744,9 +1675,9 @@ public void ScrollCaret() /// This may be used to make a search match visible. /// (Scintilla feature 2569) /// - public void ScrollRange(Position secondary, Position primary) + public void ScrollRange(int secondary, int primary) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLRANGE, secondary.Value, primary.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLRANGE, (IntPtr) secondary, (IntPtr) primary); } /// Replace the selected text with the argument text. (Scintilla feature 2170) @@ -1754,70 +1685,68 @@ public unsafe void ReplaceSel(string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REPLACESEL, Unused, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_REPLACESEL, (IntPtr) Unused, (IntPtr) textPtr); } } /// Set to read only or read write. (Scintilla feature 2171) public void SetReadOnly(bool readOnly) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETREADONLY, readOnly ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETREADONLY, new IntPtr(readOnly ? 1 : 0), (IntPtr) Unused); } /// Null operation. (Scintilla feature 2172) public void Null() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_NULL, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_NULL, (IntPtr) Unused, (IntPtr) Unused); } /// Will a paste succeed? (Scintilla feature 2173) public bool CanPaste() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANPASTE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_CANPASTE, (IntPtr) Unused, (IntPtr) Unused); } /// Are there any undoable actions in the undo history? (Scintilla feature 2174) public bool CanUndo() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANUNDO, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_CANUNDO, (IntPtr) Unused, (IntPtr) Unused); } /// Delete the undo history. (Scintilla feature 2175) public void EmptyUndoBuffer() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EMPTYUNDOBUFFER, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_EMPTYUNDOBUFFER, (IntPtr) Unused, (IntPtr) Unused); } /// Undo one action in the undo history. (Scintilla feature 2176) public void Undo() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_UNDO, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_UNDO, (IntPtr) Unused, (IntPtr) Unused); } /// Cut the selection to the clipboard. (Scintilla feature 2177) public void Cut() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CUT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CUT, (IntPtr) Unused, (IntPtr) Unused); } /// Copy the selection to the clipboard. (Scintilla feature 2178) public void Copy() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPY, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_COPY, (IntPtr) Unused, (IntPtr) Unused); } /// Paste the contents of the clipboard into the document replacing the selection. (Scintilla feature 2179) public void Paste() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PASTE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PASTE, (IntPtr) Unused, (IntPtr) Unused); } /// Clear the selection. (Scintilla feature 2180) public void Clear() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEAR, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CLEAR, (IntPtr) Unused, (IntPtr) Unused); } /// Replace the contents of the document with the argument text. (Scintilla feature 2181) @@ -1825,7 +1754,7 @@ public unsafe void SetText(string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTEXT, Unused, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_SETTEXT, (IntPtr) Unused, (IntPtr) textPtr); } } @@ -1837,10 +1766,10 @@ public unsafe void SetText(string text) /// public unsafe string GetText(int length) { - byte[] textBuffer = new byte[length]; + byte[] textBuffer = new byte[10000]; fixed (byte* textPtr = textBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXT, length, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXT, (IntPtr) length, (IntPtr) textPtr); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } @@ -1848,14 +1777,13 @@ public unsafe string GetText(int length) /// Retrieve the number of characters in the document. (Scintilla feature 2183) public int GetTextLength() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXTLENGTH, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXTLENGTH, (IntPtr) Unused, (IntPtr) Unused); } /// Retrieve a pointer to a function that processes messages for this Scintilla. (Scintilla feature 2184) public IntPtr GetDirectFunction() { - return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTFUNCTION, Unused, Unused); + return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTFUNCTION, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1865,33 +1793,31 @@ public IntPtr GetDirectFunction() /// public IntPtr GetDirectPointer() { - return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTPOINTER, Unused, Unused); + return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTPOINTER, (IntPtr) Unused, (IntPtr) Unused); } /// Set to overtype (true) or insert mode. (Scintilla feature 2186) - public void SetOvertype(bool overtype) + public void SetOvertype(bool overType) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETOVERTYPE, overtype ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETOVERTYPE, new IntPtr(overType ? 1 : 0), (IntPtr) Unused); } /// Returns true if overtype mode is active otherwise false is returned. (Scintilla feature 2187) public bool GetOvertype() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETOVERTYPE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETOVERTYPE, (IntPtr) Unused, (IntPtr) Unused); } /// Set the width of the insert mode caret. (Scintilla feature 2188) public void SetCaretWidth(int pixelWidth) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETWIDTH, pixelWidth, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETWIDTH, (IntPtr) pixelWidth, (IntPtr) Unused); } /// Returns the width of the insert mode caret. (Scintilla feature 2189) public int GetCaretWidth() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETWIDTH, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETWIDTH, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1899,16 +1825,15 @@ public int GetCaretWidth() /// document without affecting the scroll position. /// (Scintilla feature 2190) /// - public void SetTargetStart(Position pos) + public void SetTargetStart(int start) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETSTART, pos.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETSTART, (IntPtr) start, (IntPtr) Unused); } /// Get the position that starts the target. (Scintilla feature 2191) - public Position GetTargetStart() + public int GetTargetStart() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETSTART, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETSTART, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -1916,35 +1841,46 @@ public Position GetTargetStart() /// document without affecting the scroll position. /// (Scintilla feature 2192) /// - public void SetTargetEnd(Position pos) + public void SetTargetEnd(int end) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETEND, pos.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETEND, (IntPtr) end, (IntPtr) Unused); } /// Get the position that ends the target. (Scintilla feature 2193) - public Position GetTargetEnd() + public int GetTargetEnd() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETEND, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETEND, (IntPtr) Unused, (IntPtr) Unused); } /// Sets both the start and end of the target in one call. (Scintilla feature 2686) - public void SetTargetRange(Position start, Position end) + public void SetTargetRange(int start, int end) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETRANGE, start.Value, end.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETRANGE, (IntPtr) start, (IntPtr) end); } /// Retrieve the text in the target. (Scintilla feature 2687) public unsafe string GetTargetText() { - byte[] charactersBuffer = new byte[10000]; - fixed (byte* charactersPtr = charactersBuffer) + byte[] textBuffer = new byte[10000]; + fixed (byte* textPtr = textBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETTEXT, Unused, (IntPtr) charactersPtr); - return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0'); + Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETTEXT, (IntPtr) Unused, (IntPtr) textPtr); + return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } + /// Make the target range start and end be the same as the selection range start and end. (Scintilla feature 2287) + public void TargetFromSelection() + { + Win32.SendMessage(scintilla, SciMsg.SCI_TARGETFROMSELECTION, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Sets the target to the whole document. (Scintilla feature 2690) + public void TargetWholeDocument() + { + Win32.SendMessage(scintilla, SciMsg.SCI_TARGETWHOLEDOCUMENT, (IntPtr) Unused, (IntPtr) Unused); + } + /// /// Replace the target text with the argument text. /// Text is counted so it can contain NULs. @@ -1955,8 +1891,7 @@ public unsafe int ReplaceTarget(int length, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REPLACETARGET, length, (IntPtr) textPtr); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_REPLACETARGET, (IntPtr) length, (IntPtr) textPtr); } } @@ -1973,129 +1908,121 @@ public unsafe int ReplaceTargetRE(int length, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REPLACETARGETRE, length, (IntPtr) textPtr); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_REPLACETARGETRE, (IntPtr) length, (IntPtr) textPtr); } } /// /// 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. + /// Returns start of found range or -1 for failure in which case target is not moved. /// (Scintilla feature 2197) /// public unsafe int SearchInTarget(int length, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHINTARGET, length, (IntPtr) textPtr); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHINTARGET, (IntPtr) length, (IntPtr) textPtr); } } /// Set the search flags used by SearchInTarget. (Scintilla feature 2198) - public void SetSearchFlags(int flags) + public void SetSearchFlags(FindOption searchFlags) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSEARCHFLAGS, flags, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSEARCHFLAGS, (IntPtr) searchFlags, (IntPtr) Unused); } /// Get the search flags used by SearchInTarget. (Scintilla feature 2199) - public int GetSearchFlags() + public FindOption GetSearchFlags() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSEARCHFLAGS, Unused, Unused); - return (int) res; + return (FindOption)Win32.SendMessage(scintilla, SciMsg.SCI_GETSEARCHFLAGS, (IntPtr) Unused, (IntPtr) Unused); } /// Show a call tip containing a definition near position pos. (Scintilla feature 2200) - public unsafe void CallTipShow(Position pos, string definition) + public unsafe void CallTipShow(int pos, string definition) { fixed (byte* definitionPtr = Encoding.UTF8.GetBytes(definition)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSHOW, pos.Value, (IntPtr) definitionPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSHOW, (IntPtr) pos, (IntPtr) definitionPtr); } } /// Remove the call tip from the screen. (Scintilla feature 2201) public void CallTipCancel() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPCANCEL, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPCANCEL, (IntPtr) Unused, (IntPtr) Unused); } /// Is there an active call tip? (Scintilla feature 2202) public bool CallTipActive() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPACTIVE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPACTIVE, (IntPtr) Unused, (IntPtr) Unused); } /// Retrieve the position where the caret was before displaying the call tip. (Scintilla feature 2203) - public Position CallTipPosStart() + public int CallTipPosStart() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPPOSSTART, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPPOSSTART, (IntPtr) Unused, (IntPtr) Unused); } /// Set the start position in order to change when backspacing removes the calltip. (Scintilla feature 2214) public void CallTipSetPosStart(int posStart) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETPOSSTART, posStart, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETPOSSTART, (IntPtr) posStart, (IntPtr) Unused); } /// Highlight a segment of the definition. (Scintilla feature 2204) - public void CallTipSetHlt(int start, int end) + public void CallTipSetHlt(int highlightStart, int highlightEnd) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETHLT, start, end); + Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETHLT, (IntPtr) highlightStart, (IntPtr) highlightEnd); } /// Set the background colour for the call tip. (Scintilla feature 2205) public void CallTipSetBack(Colour back) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETBACK, back.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETBACK, back.Value, (IntPtr) Unused); } /// Set the foreground colour for the call tip. (Scintilla feature 2206) public void CallTipSetFore(Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETFORE, fore.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETFORE, fore.Value, (IntPtr) Unused); } /// Set the foreground colour for the highlighted part of the call tip. (Scintilla feature 2207) public void CallTipSetForeHlt(Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETFOREHLT, fore.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETFOREHLT, fore.Value, (IntPtr) Unused); } /// Enable use of STYLE_CALLTIP and set call tip tab size in pixels. (Scintilla feature 2212) public void CallTipUseStyle(int tabSize) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPUSESTYLE, tabSize, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPUSESTYLE, (IntPtr) tabSize, (IntPtr) Unused); } /// Set position of calltip, above or below text. (Scintilla feature 2213) public void CallTipSetPosition(bool above) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETPOSITION, above ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETPOSITION, new IntPtr(above ? 1 : 0), (IntPtr) Unused); } /// Find the display line of a document line taking hidden lines into account. (Scintilla feature 2220) - public int VisibleFromDocLine(int line) + public int VisibleFromDocLine(int docLine) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VISIBLEFROMDOCLINE, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_VISIBLEFROMDOCLINE, (IntPtr) docLine, (IntPtr) Unused); } /// Find the document line of a display line taking hidden lines into account. (Scintilla feature 2221) - public int DocLineFromVisible(int lineDisplay) + public int DocLineFromVisible(int displayLine) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCLINEFROMVISIBLE, lineDisplay, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_DOCLINEFROMVISIBLE, (IntPtr) displayLine, (IntPtr) Unused); } /// The number of display lines needed to wrap a document line (Scintilla feature 2235) - public int WrapCount(int line) + public int WrapCount(int docLine) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WRAPCOUNT, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_WRAPCOUNT, (IntPtr) docLine, (IntPtr) Unused); } /// @@ -2104,124 +2031,158 @@ public int WrapCount(int line) /// line is a header and whether it is effectively white space. /// (Scintilla feature 2222) /// - public void SetFoldLevel(int line, int level) + public void SetFoldLevel(int line, FoldLevel level) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDLEVEL, line, level); + Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDLEVEL, (IntPtr) line, (IntPtr) level); } /// Retrieve the fold level of a line. (Scintilla feature 2223) - public int GetFoldLevel(int line) + public FoldLevel GetFoldLevel(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDLEVEL, line, Unused); - return (int) res; + return (FoldLevel)Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDLEVEL, (IntPtr) line, (IntPtr) Unused); } /// Find the last child line of a header line. (Scintilla feature 2224) - public int GetLastChild(int line, int level) + public int GetLastChild(int line, FoldLevel level) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLASTCHILD, line, level); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLASTCHILD, (IntPtr) line, (IntPtr) level); } /// Find the parent line of a child line. (Scintilla feature 2225) public int GetFoldParent(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDPARENT, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDPARENT, (IntPtr) line, (IntPtr) Unused); } /// Make a range of lines visible. (Scintilla feature 2226) public void ShowLines(int lineStart, int lineEnd) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SHOWLINES, lineStart, lineEnd); + Win32.SendMessage(scintilla, SciMsg.SCI_SHOWLINES, (IntPtr) lineStart, (IntPtr) lineEnd); } /// Make a range of lines invisible. (Scintilla feature 2227) public void HideLines(int lineStart, int lineEnd) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HIDELINES, lineStart, lineEnd); + Win32.SendMessage(scintilla, SciMsg.SCI_HIDELINES, (IntPtr) lineStart, (IntPtr) lineEnd); } /// Is a line visible? (Scintilla feature 2228) public bool GetLineVisible(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEVISIBLE, line, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEVISIBLE, (IntPtr) line, (IntPtr) Unused); } /// Are all lines visible? (Scintilla feature 2236) public bool GetAllLinesVisible() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETALLLINESVISIBLE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETALLLINESVISIBLE, (IntPtr) Unused, (IntPtr) Unused); } /// Show the children of a header line. (Scintilla feature 2229) public void SetFoldExpanded(int line, bool expanded) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDEXPANDED, line, expanded ? 1 : 0); + Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDEXPANDED, (IntPtr) line, new IntPtr(expanded ? 1 : 0)); } /// Is a header line expanded? (Scintilla feature 2230) public bool GetFoldExpanded(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDEXPANDED, line, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDEXPANDED, (IntPtr) line, (IntPtr) Unused); } /// Switch a header line between expanded and contracted. (Scintilla feature 2231) public void ToggleFold(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TOGGLEFOLD, line, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_TOGGLEFOLD, (IntPtr) line, (IntPtr) Unused); + } + + /// Switch a header line between expanded and contracted and show some text after the line. (Scintilla feature 2700) + public unsafe void ToggleFoldShowText(int line, string text) + { + fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) + { + Win32.SendMessage(scintilla, SciMsg.SCI_TOGGLEFOLDSHOWTEXT, (IntPtr) line, (IntPtr) textPtr); + } + } + + /// Set the style of fold display text. (Scintilla feature 2701) + public void FoldDisplayTextSetStyle(FoldDisplayTextStyle style) + { + Win32.SendMessage(scintilla, SciMsg.SCI_FOLDDISPLAYTEXTSETSTYLE, (IntPtr) style, (IntPtr) Unused); + } + + /// Get the style of fold display text. (Scintilla feature 2707) + public FoldDisplayTextStyle FoldDisplayTextGetStyle() + { + return (FoldDisplayTextStyle)Win32.SendMessage(scintilla, SciMsg.SCI_FOLDDISPLAYTEXTGETSTYLE, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Set the default fold display text. (Scintilla feature 2722) + public unsafe void SetDefaultFoldDisplayText(string text) + { + fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETDEFAULTFOLDDISPLAYTEXT, (IntPtr) Unused, (IntPtr) textPtr); + } + } + + /// Get the default fold display text. (Scintilla feature 2723) + public unsafe string GetDefaultFoldDisplayText() + { + byte[] textBuffer = new byte[10000]; + fixed (byte* textPtr = textBuffer) + { + Win32.SendMessage(scintilla, SciMsg.SCI_GETDEFAULTFOLDDISPLAYTEXT, (IntPtr) Unused, (IntPtr) textPtr); + return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); + } } /// Expand or contract a fold header. (Scintilla feature 2237) - public void FoldLine(int line, int action) + public void FoldLine(int line, FoldAction action) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDLINE, line, action); + Win32.SendMessage(scintilla, SciMsg.SCI_FOLDLINE, (IntPtr) line, (IntPtr) action); } /// Expand or contract a fold header and its children. (Scintilla feature 2238) - public void FoldChildren(int line, int action) + public void FoldChildren(int line, FoldAction action) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDCHILDREN, line, action); + Win32.SendMessage(scintilla, SciMsg.SCI_FOLDCHILDREN, (IntPtr) line, (IntPtr) action); } /// Expand a fold header and all children. Use the level argument instead of the line's current level. (Scintilla feature 2239) - public void ExpandChildren(int line, int level) + public void ExpandChildren(int line, FoldLevel level) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EXPANDCHILDREN, line, level); + Win32.SendMessage(scintilla, SciMsg.SCI_EXPANDCHILDREN, (IntPtr) line, (IntPtr) level); } /// Expand or contract all fold headers. (Scintilla feature 2662) - public void FoldAll(int action) + public void FoldAll(FoldAction action) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDALL, action, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_FOLDALL, (IntPtr) action, (IntPtr) Unused); } /// Ensure a particular line is visible by expanding any header line hiding it. (Scintilla feature 2232) public void EnsureVisible(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENSUREVISIBLE, line, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_ENSUREVISIBLE, (IntPtr) line, (IntPtr) Unused); } /// Set automatic folding behaviours. (Scintilla feature 2663) - public void SetAutomaticFold(int automaticFold) + public void SetAutomaticFold(AutomaticFold automaticFold) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETAUTOMATICFOLD, automaticFold, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETAUTOMATICFOLD, (IntPtr) automaticFold, (IntPtr) Unused); } /// Get automatic folding behaviours. (Scintilla feature 2664) - public int GetAutomaticFold() + public AutomaticFold GetAutomaticFold() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETAUTOMATICFOLD, Unused, Unused); - return (int) res; + return (AutomaticFold)Win32.SendMessage(scintilla, SciMsg.SCI_GETAUTOMATICFOLD, (IntPtr) Unused, (IntPtr) Unused); } /// Set some style options for folding. (Scintilla feature 2233) - public void SetFoldFlags(int flags) + public void SetFoldFlags(FoldFlag flags) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDFLAGS, flags, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDFLAGS, (IntPtr) flags, (IntPtr) Unused); } /// @@ -2231,164 +2192,169 @@ public void SetFoldFlags(int flags) /// public void EnsureVisibleEnforcePolicy(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENSUREVISIBLEENFORCEPOLICY, line, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_ENSUREVISIBLEENFORCEPOLICY, (IntPtr) line, (IntPtr) Unused); } /// Sets whether a tab pressed when caret is within indentation indents. (Scintilla feature 2260) public void SetTabIndents(bool tabIndents) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTABINDENTS, tabIndents ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETTABINDENTS, new IntPtr(tabIndents ? 1 : 0), (IntPtr) Unused); } /// Does a tab pressed when caret is within indentation indent? (Scintilla feature 2261) public bool GetTabIndents() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTABINDENTS, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETTABINDENTS, (IntPtr) Unused, (IntPtr) Unused); } /// Sets whether a backspace pressed when caret is within indentation unindents. (Scintilla feature 2262) public void SetBackSpaceUnIndents(bool bsUnIndents) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETBACKSPACEUNINDENTS, bsUnIndents ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETBACKSPACEUNINDENTS, new IntPtr(bsUnIndents ? 1 : 0), (IntPtr) Unused); } /// Does a backspace pressed when caret is within indentation unindent? (Scintilla feature 2263) public bool GetBackSpaceUnIndents() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETBACKSPACEUNINDENTS, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETBACKSPACEUNINDENTS, (IntPtr) Unused, (IntPtr) Unused); } /// Sets the time the mouse must sit still to generate a mouse dwell event. (Scintilla feature 2264) public void SetMouseDwellTime(int periodMilliseconds) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSEDWELLTIME, periodMilliseconds, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSEDWELLTIME, (IntPtr) periodMilliseconds, (IntPtr) Unused); } /// Retrieve the time the mouse must sit still to generate a mouse dwell event. (Scintilla feature 2265) public int GetMouseDwellTime() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSEDWELLTIME, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSEDWELLTIME, (IntPtr) Unused, (IntPtr) Unused); } /// Get position of start of word. (Scintilla feature 2266) - public int WordStartPosition(Position pos, bool onlyWordCharacters) + public int WordStartPosition(int pos, bool onlyWordCharacters) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDSTARTPOSITION, pos.Value, onlyWordCharacters ? 1 : 0); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_WORDSTARTPOSITION, (IntPtr) pos, new IntPtr(onlyWordCharacters ? 1 : 0)); } /// Get position of end of word. (Scintilla feature 2267) - public int WordEndPosition(Position pos, bool onlyWordCharacters) + public int WordEndPosition(int pos, bool onlyWordCharacters) + { + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_WORDENDPOSITION, (IntPtr) pos, new IntPtr(onlyWordCharacters ? 1 : 0)); + } + + /// Is the range start..end considered a word? (Scintilla feature 2691) + public bool IsRangeWord(int start, int end) + { + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_ISRANGEWORD, (IntPtr) start, (IntPtr) end); + } + + /// Sets limits to idle styling. (Scintilla feature 2692) + public void SetIdleStyling(IdleStyling idleStyling) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETIDLESTYLING, (IntPtr) idleStyling, (IntPtr) Unused); + } + + /// Retrieve the limits to idle styling. (Scintilla feature 2693) + public IdleStyling GetIdleStyling() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDENDPOSITION, pos.Value, onlyWordCharacters ? 1 : 0); - return (int) res; + return (IdleStyling)Win32.SendMessage(scintilla, SciMsg.SCI_GETIDLESTYLING, (IntPtr) Unused, (IntPtr) Unused); } /// Sets whether text is word wrapped. (Scintilla feature 2268) - public void SetWrapMode(int mode) + public void SetWrapMode(Wrap wrapMode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPMODE, mode, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPMODE, (IntPtr) wrapMode, (IntPtr) Unused); } /// Retrieve whether text is word wrapped. (Scintilla feature 2269) - public int GetWrapMode() + public Wrap GetWrapMode() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPMODE, Unused, Unused); - return (int) res; + return (Wrap)Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPMODE, (IntPtr) Unused, (IntPtr) Unused); } /// Set the display mode of visual flags for wrapped lines. (Scintilla feature 2460) - public void SetWrapVisualFlags(int wrapVisualFlags) + public void SetWrapVisualFlags(WrapVisualFlag wrapVisualFlags) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPVISUALFLAGS, wrapVisualFlags, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPVISUALFLAGS, (IntPtr) wrapVisualFlags, (IntPtr) Unused); } /// Retrive the display mode of visual flags for wrapped lines. (Scintilla feature 2461) - public int GetWrapVisualFlags() + public WrapVisualFlag GetWrapVisualFlags() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPVISUALFLAGS, Unused, Unused); - return (int) res; + return (WrapVisualFlag)Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPVISUALFLAGS, (IntPtr) Unused, (IntPtr) Unused); } /// Set the location of visual flags for wrapped lines. (Scintilla feature 2462) - public void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation) + public void SetWrapVisualFlagsLocation(WrapVisualLocation wrapVisualFlagsLocation) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPVISUALFLAGSLOCATION, wrapVisualFlagsLocation, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPVISUALFLAGSLOCATION, (IntPtr) wrapVisualFlagsLocation, (IntPtr) Unused); } /// Retrive the location of visual flags for wrapped lines. (Scintilla feature 2463) - public int GetWrapVisualFlagsLocation() + public WrapVisualLocation GetWrapVisualFlagsLocation() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPVISUALFLAGSLOCATION, Unused, Unused); - return (int) res; + return (WrapVisualLocation)Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPVISUALFLAGSLOCATION, (IntPtr) Unused, (IntPtr) Unused); } /// Set the start indent for wrapped lines. (Scintilla feature 2464) public void SetWrapStartIndent(int indent) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPSTARTINDENT, indent, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPSTARTINDENT, (IntPtr) indent, (IntPtr) Unused); } /// Retrive the start indent for wrapped lines. (Scintilla feature 2465) public int GetWrapStartIndent() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPSTARTINDENT, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPSTARTINDENT, (IntPtr) Unused, (IntPtr) Unused); } /// Sets how wrapped sublines are placed. Default is fixed. (Scintilla feature 2472) - public void SetWrapIndentMode(int mode) + public void SetWrapIndentMode(WrapIndentMode wrapIndentMode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPINDENTMODE, mode, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPINDENTMODE, (IntPtr) wrapIndentMode, (IntPtr) Unused); } /// Retrieve how wrapped sublines are placed. Default is fixed. (Scintilla feature 2473) - public int GetWrapIndentMode() + public WrapIndentMode GetWrapIndentMode() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPINDENTMODE, Unused, Unused); - return (int) res; + return (WrapIndentMode)Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPINDENTMODE, (IntPtr) Unused, (IntPtr) Unused); } /// Sets the degree of caching of layout information. (Scintilla feature 2272) - public void SetLayoutCache(int mode) + public void SetLayoutCache(LineCache cacheMode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLAYOUTCACHE, mode, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETLAYOUTCACHE, (IntPtr) cacheMode, (IntPtr) Unused); } /// Retrieve the degree of caching of layout information. (Scintilla feature 2273) - public int GetLayoutCache() + public LineCache GetLayoutCache() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLAYOUTCACHE, Unused, Unused); - return (int) res; + return (LineCache)Win32.SendMessage(scintilla, SciMsg.SCI_GETLAYOUTCACHE, (IntPtr) Unused, (IntPtr) Unused); } /// Sets the document width assumed for scrolling. (Scintilla feature 2274) public void SetScrollWidth(int pixelWidth) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSCROLLWIDTH, pixelWidth, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSCROLLWIDTH, (IntPtr) pixelWidth, (IntPtr) Unused); } /// Retrieve the document width assumed for scrolling. (Scintilla feature 2275) public int GetScrollWidth() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSCROLLWIDTH, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSCROLLWIDTH, (IntPtr) Unused, (IntPtr) Unused); } /// Sets whether the maximum width line displayed is used to set scroll width. (Scintilla feature 2516) public void SetScrollWidthTracking(bool tracking) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSCROLLWIDTHTRACKING, tracking ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSCROLLWIDTHTRACKING, new IntPtr(tracking ? 1 : 0), (IntPtr) Unused); } /// Retrieve whether the scroll width tracks wide lines. (Scintilla feature 2517) public bool GetScrollWidthTracking() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSCROLLWIDTHTRACKING, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSCROLLWIDTHTRACKING, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -2401,8 +2367,7 @@ public unsafe int TextWidth(int style, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TEXTWIDTH, style, (IntPtr) textPtr); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_TEXTWIDTH, (IntPtr) style, (IntPtr) textPtr); } } @@ -2414,7 +2379,7 @@ public unsafe int TextWidth(int style, string text) /// public void SetEndAtLastLine(bool endAtLastLine) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETENDATLASTLINE, endAtLastLine ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETENDATLASTLINE, new IntPtr(endAtLastLine ? 1 : 0), (IntPtr) Unused); } /// @@ -2424,28 +2389,25 @@ public void SetEndAtLastLine(bool endAtLastLine) /// public bool GetEndAtLastLine() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETENDATLASTLINE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETENDATLASTLINE, (IntPtr) Unused, (IntPtr) Unused); } /// Retrieve the height of a particular line of text in pixels. (Scintilla feature 2279) public int TextHeight(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TEXTHEIGHT, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_TEXTHEIGHT, (IntPtr) line, (IntPtr) Unused); } /// Show or hide the vertical scroll bar. (Scintilla feature 2280) - public void SetVScrollBar(bool show) + public void SetVScrollBar(bool visible) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVSCROLLBAR, show ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETVSCROLLBAR, new IntPtr(visible ? 1 : 0), (IntPtr) Unused); } /// Is the vertical scroll bar visible? (Scintilla feature 2281) public bool GetVScrollBar() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVSCROLLBAR, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETVSCROLLBAR, (IntPtr) Unused, (IntPtr) Unused); } /// Append a string to the end of the document without changing the selection. (Scintilla feature 2282) @@ -2453,32 +2415,14 @@ public unsafe void AppendText(int length, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_APPENDTEXT, length, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_APPENDTEXT, (IntPtr) length, (IntPtr) textPtr); } } - /// Is drawing done in two phases with backgrounds drawn before foregrounds? (Scintilla feature 2283) - public bool GetTwoPhaseDraw() - { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTWOPHASEDRAW, Unused, Unused); - return 1 == (int) res; - } - - /// - /// 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) - /// - public void SetTwoPhaseDraw(bool twoPhase) - { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTWOPHASEDRAW, twoPhase ? 1 : 0, Unused); - } - /// How many phases is drawing done in? (Scintilla feature 2673) - public int GetPhasesDraw() + public PhasesDraw GetPhasesDraw() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPHASESDRAW, Unused, Unused); - return (int) res; + return (PhasesDraw)Win32.SendMessage(scintilla, SciMsg.SCI_GETPHASESDRAW, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -2488,41 +2432,39 @@ public int GetPhasesDraw() /// to overlap from one line to the next. /// (Scintilla feature 2674) /// - public void SetPhasesDraw(int phases) + public void SetPhasesDraw(PhasesDraw phases) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPHASESDRAW, phases, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETPHASESDRAW, (IntPtr) phases, (IntPtr) Unused); } /// Choose the quality level for text from the FontQuality enumeration. (Scintilla feature 2611) - public void SetFontQuality(int fontQuality) + public void SetFontQuality(FontQuality fontQuality) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFONTQUALITY, fontQuality, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETFONTQUALITY, (IntPtr) fontQuality, (IntPtr) Unused); } /// Retrieve the quality level for text. (Scintilla feature 2612) - public int GetFontQuality() + public FontQuality GetFontQuality() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFONTQUALITY, Unused, Unused); - return (int) res; + return (FontQuality)Win32.SendMessage(scintilla, SciMsg.SCI_GETFONTQUALITY, (IntPtr) Unused, (IntPtr) Unused); } /// Scroll so that a display line is at the top of the display. (Scintilla feature 2613) - public void SetFirstVisibleLine(int lineDisplay) + public void SetFirstVisibleLine(int displayLine) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFIRSTVISIBLELINE, lineDisplay, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETFIRSTVISIBLELINE, (IntPtr) displayLine, (IntPtr) Unused); } /// Change the effect of pasting when there are multiple selections. (Scintilla feature 2614) - public void SetMultiPaste(int multiPaste) + public void SetMultiPaste(MultiPaste multiPaste) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMULTIPASTE, multiPaste, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMULTIPASTE, (IntPtr) multiPaste, (IntPtr) Unused); } - /// Retrieve the effect of pasting when there are multiple selections.. (Scintilla feature 2615) - public int GetMultiPaste() + /// Retrieve the effect of pasting when there are multiple selections. (Scintilla feature 2615) + public MultiPaste GetMultiPaste() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMULTIPASTE, Unused, Unused); - return (int) res; + return (MultiPaste)Win32.SendMessage(scintilla, SciMsg.SCI_GETMULTIPASTE, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -2535,21 +2477,15 @@ public unsafe string GetTag(int tagNumber) byte[] tagValueBuffer = new byte[10000]; fixed (byte* tagValuePtr = tagValueBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTAG, tagNumber, (IntPtr) tagValuePtr); + Win32.SendMessage(scintilla, SciMsg.SCI_GETTAG, (IntPtr) tagNumber, (IntPtr) tagValuePtr); return Encoding.UTF8.GetString(tagValueBuffer).TrimEnd('\0'); } } - /// Make the target range start and end be the same as the selection range start and end. (Scintilla feature 2287) - public void TargetFromSelection() - { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TARGETFROMSELECTION, Unused, Unused); - } - /// Join the lines in the target. (Scintilla feature 2288) public void LinesJoin() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESJOIN, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINESJOIN, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -2559,181 +2495,193 @@ public void LinesJoin() /// public void LinesSplit(int pixelWidth) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESSPLIT, pixelWidth, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINESSPLIT, (IntPtr) pixelWidth, (IntPtr) Unused); } - /// Set the colours used as a chequerboard pattern in the fold margin (Scintilla feature 2290) + /// Set one of the colours used as a chequerboard pattern in the fold margin (Scintilla feature 2290) public void SetFoldMarginColour(bool useSetting, Colour back) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDMARGINCOLOUR, useSetting ? 1 : 0, back.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDMARGINCOLOUR, new IntPtr(useSetting ? 1 : 0), back.Value); } - /// Set the colours used as a chequerboard pattern in the fold margin (Scintilla feature 2291) + /// Set the other colour used as a chequerboard pattern in the fold margin (Scintilla feature 2291) public void SetFoldMarginHiColour(bool useSetting, Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDMARGINHICOLOUR, useSetting ? 1 : 0, fore.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDMARGINHICOLOUR, new IntPtr(useSetting ? 1 : 0), fore.Value); + } + + /// Enable or disable accessibility. (Scintilla feature 2702) + public void SetAccessibility(Accessibility accessibility) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETACCESSIBILITY, (IntPtr) accessibility, (IntPtr) Unused); + } + + /// Report accessibility status. (Scintilla feature 2703) + public Accessibility GetAccessibility() + { + return (Accessibility)Win32.SendMessage(scintilla, SciMsg.SCI_GETACCESSIBILITY, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret down one line. (Scintilla feature 2300) public void LineDown() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWN, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWN, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret down one line extending selection to new caret position. (Scintilla feature 2301) public void LineDownExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWNEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWNEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret up one line. (Scintilla feature 2302) public void LineUp() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEUP, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEUP, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret up one line extending selection to new caret position. (Scintilla feature 2303) public void LineUpExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEUPEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEUPEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret left one character. (Scintilla feature 2304) public void CharLeft() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFT, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret left one character extending selection to new caret position. (Scintilla feature 2305) public void CharLeftExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret right one character. (Scintilla feature 2306) public void CharRight() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHT, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret right one character extending selection to new caret position. (Scintilla feature 2307) public void CharRightExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret left one word. (Scintilla feature 2308) public void WordLeft() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFT, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret left one word extending selection to new caret position. (Scintilla feature 2309) public void WordLeftExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret right one word. (Scintilla feature 2310) public void WordRight() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHT, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret right one word extending selection to new caret position. (Scintilla feature 2311) public void WordRightExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to first position on line. (Scintilla feature 2312) public void Home() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOME, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_HOME, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to first position on line extending selection to new caret position. (Scintilla feature 2313) public void HomeExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_HOMEEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to last position on line. (Scintilla feature 2314) public void LineEnd() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to last position on line extending selection to new caret position. (Scintilla feature 2315) public void LineEndExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to first position in document. (Scintilla feature 2316) public void DocumentStart() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTSTART, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTSTART, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to first position in document extending selection to new caret position. (Scintilla feature 2317) public void DocumentStartExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTSTARTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTSTARTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to last position in document. (Scintilla feature 2318) public void DocumentEnd() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to last position in document extending selection to new caret position. (Scintilla feature 2319) public void DocumentEndExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTENDEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTENDEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret one page up. (Scintilla feature 2320) public void PageUp() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUP, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUP, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret one page up extending selection to new caret position. (Scintilla feature 2321) public void PageUpExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUPEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUPEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret one page down. (Scintilla feature 2322) public void PageDown() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWN, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWN, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret one page down extending selection to new caret position. (Scintilla feature 2323) public void PageDownExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWNEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWNEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Switch from insert to overtype mode or the reverse. (Scintilla feature 2324) public void EditToggleOvertype() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EDITTOGGLEOVERTYPE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_EDITTOGGLEOVERTYPE, (IntPtr) Unused, (IntPtr) Unused); } /// Cancel any modes such as call tip or auto-completion list display. (Scintilla feature 2325) public void Cancel() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CANCEL, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CANCEL, (IntPtr) Unused, (IntPtr) Unused); } /// Delete the selection or if no selection, the character before the caret. (Scintilla feature 2326) public void DeleteBack() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETEBACK, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DELETEBACK, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -2743,25 +2691,25 @@ public void DeleteBack() /// public void Tab() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TAB, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_TAB, (IntPtr) Unused, (IntPtr) Unused); } /// Dedent the selected lines. (Scintilla feature 2328) public void BackTab() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BACKTAB, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_BACKTAB, (IntPtr) Unused, (IntPtr) Unused); } /// Insert a new line, may use a CRLF, CR or LF depending on EOL mode. (Scintilla feature 2329) public void NewLine() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_NEWLINE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_NEWLINE, (IntPtr) Unused, (IntPtr) Unused); } /// Insert a Form Feed character. (Scintilla feature 2330) public void FormFeed() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FORMFEED, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_FORMFEED, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -2771,91 +2719,97 @@ public void FormFeed() /// public void VCHome() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOME, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_VCHOME, (IntPtr) Unused, (IntPtr) Unused); } /// Like VCHome but extending selection to new caret position. (Scintilla feature 2332) public void VCHomeExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Magnify the displayed text by increasing the sizes by 1 point. (Scintilla feature 2333) public void ZoomIn() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ZOOMIN, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_ZOOMIN, (IntPtr) Unused, (IntPtr) Unused); } /// Make the displayed text smaller by decreasing the sizes by 1 point. (Scintilla feature 2334) public void ZoomOut() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ZOOMOUT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_ZOOMOUT, (IntPtr) Unused, (IntPtr) Unused); } /// Delete the word to the left of the caret. (Scintilla feature 2335) public void DelWordLeft() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDLEFT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDLEFT, (IntPtr) Unused, (IntPtr) Unused); } /// Delete the word to the right of the caret. (Scintilla feature 2336) public void DelWordRight() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDRIGHT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDRIGHT, (IntPtr) Unused, (IntPtr) Unused); } /// Delete the word to the right of the caret, but not the trailing non-word characters. (Scintilla feature 2518) public void DelWordRightEnd() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDRIGHTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DELWORDRIGHTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Cut the line containing the caret. (Scintilla feature 2337) public void LineCut() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINECUT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINECUT, (IntPtr) Unused, (IntPtr) Unused); } /// Delete the line containing the caret. (Scintilla feature 2338) public void LineDelete() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDELETE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEDELETE, (IntPtr) Unused, (IntPtr) Unused); } /// Switch the current line with the previous. (Scintilla feature 2339) public void LineTranspose() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINETRANSPOSE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINETRANSPOSE, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Reverse order of selected lines. (Scintilla feature 2354) + public void LineReverse() + { + Win32.SendMessage(scintilla, SciMsg.SCI_LINEREVERSE, (IntPtr) Unused, (IntPtr) Unused); } /// Duplicate the current line. (Scintilla feature 2404) public void LineDuplicate() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDUPLICATE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEDUPLICATE, (IntPtr) Unused, (IntPtr) Unused); } /// Transform the selection to lower case. (Scintilla feature 2340) public void LowerCase() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LOWERCASE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LOWERCASE, (IntPtr) Unused, (IntPtr) Unused); } /// Transform the selection to upper case. (Scintilla feature 2341) public void UpperCase() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_UPPERCASE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_UPPERCASE, (IntPtr) Unused, (IntPtr) Unused); } /// Scroll the document down, keeping the caret visible. (Scintilla feature 2342) public void LineScrollDown() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLLDOWN, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLLDOWN, (IntPtr) Unused, (IntPtr) Unused); } /// Scroll the document up, keeping the caret visible. (Scintilla feature 2343) public void LineScrollUp() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLLUP, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLLUP, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -2865,13 +2819,13 @@ public void LineScrollUp() /// public void DeleteBackNotLine() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETEBACKNOTLINE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DELETEBACKNOTLINE, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to first position on display line. (Scintilla feature 2345) public void HomeDisplay() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEDISPLAY, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_HOMEDISPLAY, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -2881,13 +2835,13 @@ public void HomeDisplay() /// public void HomeDisplayExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEDISPLAYEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_HOMEDISPLAYEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to last position on display line. (Scintilla feature 2347) public void LineEndDisplay() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDDISPLAY, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDDISPLAY, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -2897,173 +2851,155 @@ public void LineEndDisplay() /// public void LineEndDisplayExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDDISPLAYEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDDISPLAYEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// - /// 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)?. + /// Like Home but when word-wrap is enabled goes first to start of display line + /// HomeDisplay, then to start of document line Home. /// (Scintilla feature 2349) /// public void HomeWrap() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEWRAP, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_HOMEWRAP, (IntPtr) Unused, (IntPtr) Unused); } /// - /// 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)?. + /// Like HomeExtend but when word-wrap is enabled extends first to start of display line + /// HomeDisplayExtend, then to start of document line HomeExtend. /// (Scintilla feature 2450) /// public void HomeWrapExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEWRAPEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_HOMEWRAPEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// - /// 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)?. + /// Like LineEnd but when word-wrap is enabled goes first to end of display line + /// LineEndDisplay, then to start of document line LineEnd. /// (Scintilla feature 2451) /// public void LineEndWrap() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDWRAP, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDWRAP, (IntPtr) Unused, (IntPtr) Unused); } /// - /// 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)?. + /// Like LineEndExtend but when word-wrap is enabled extends first to end of display line + /// LineEndDisplayExtend, then to start of document line LineEndExtend. /// (Scintilla feature 2452) /// public void LineEndWrapExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDWRAPEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDWRAPEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// - /// 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)?. + /// Like VCHome but when word-wrap is enabled goes first to start of display line + /// VCHomeDisplay, then behaves like VCHome. /// (Scintilla feature 2453) /// public void VCHomeWrap() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEWRAP, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEWRAP, (IntPtr) Unused, (IntPtr) Unused); } /// - /// 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)?. + /// Like VCHomeExtend but when word-wrap is enabled extends first to start of display line + /// VCHomeDisplayExtend, then behaves like VCHomeExtend. /// (Scintilla feature 2454) /// public void VCHomeWrapExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEWRAPEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEWRAPEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Copy the line containing the caret. (Scintilla feature 2455) public void LineCopy() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINECOPY, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINECOPY, (IntPtr) Unused, (IntPtr) Unused); } /// Move the caret inside current view if it's not there already. (Scintilla feature 2401) public void MoveCaretInsideView() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MOVECARETINSIDEVIEW, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_MOVECARETINSIDEVIEW, (IntPtr) Unused, (IntPtr) Unused); } /// How many characters are on a line, including end of line characters? (Scintilla feature 2350) public int LineLength(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINELENGTH, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_LINELENGTH, (IntPtr) line, (IntPtr) Unused); } /// Highlight the characters at two positions. (Scintilla feature 2351) - public void BraceHighlight(Position pos1, Position pos2) + public void BraceHighlight(int posA, int posB) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEHIGHLIGHT, pos1.Value, pos2.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_BRACEHIGHLIGHT, (IntPtr) posA, (IntPtr) posB); } /// Use specified indicator to highlight matching braces instead of changing their style. (Scintilla feature 2498) - public void BraceHighlightIndicator(bool useBraceHighlightIndicator, int indicator) + public void BraceHighlightIndicator(bool useSetting, int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEHIGHLIGHTINDICATOR, useBraceHighlightIndicator ? 1 : 0, indicator); + Win32.SendMessage(scintilla, SciMsg.SCI_BRACEHIGHLIGHTINDICATOR, new IntPtr(useSetting ? 1 : 0), (IntPtr) indicator); } /// Highlight the character at a position indicating there is no matching brace. (Scintilla feature 2352) - public void BraceBadLight(Position pos) + public void BraceBadLight(int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEBADLIGHT, pos.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_BRACEBADLIGHT, (IntPtr) pos, (IntPtr) Unused); } /// Use specified indicator to highlight non matching brace instead of changing its style. (Scintilla feature 2499) - public void BraceBadLightIndicator(bool useBraceBadLightIndicator, int indicator) + public void BraceBadLightIndicator(bool useSetting, int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEBADLIGHTINDICATOR, useBraceBadLightIndicator ? 1 : 0, indicator); + Win32.SendMessage(scintilla, SciMsg.SCI_BRACEBADLIGHTINDICATOR, new IntPtr(useSetting ? 1 : 0), (IntPtr) indicator); } - /// Find the position of a matching brace or INVALID_POSITION if no match. (Scintilla feature 2353) - public Position BraceMatch(Position pos) + /// + /// Find the position of a matching brace or INVALID_POSITION if no match. + /// The maxReStyle must be 0 for now. It may be defined in a future release. + /// (Scintilla feature 2353) + /// + public int BraceMatch(int pos, int maxReStyle) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEMATCH, pos.Value, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_BRACEMATCH, (IntPtr) pos, (IntPtr) maxReStyle); } /// Are the end of line characters visible? (Scintilla feature 2355) public bool GetViewEOL() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIEWEOL, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETVIEWEOL, (IntPtr) Unused, (IntPtr) Unused); } /// Make the end of line characters visible or invisible. (Scintilla feature 2356) public void SetViewEOL(bool visible) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIEWEOL, visible ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETVIEWEOL, new IntPtr(visible ? 1 : 0), (IntPtr) Unused); } /// Retrieve a pointer to the document object. (Scintilla feature 2357) public IntPtr GetDocPointer() { - return Win32.SendMessage(scintilla, SciMsg.SCI_GETDOCPOINTER, Unused, Unused); + return Win32.SendMessage(scintilla, SciMsg.SCI_GETDOCPOINTER, (IntPtr) Unused, (IntPtr) Unused); } /// Change the document object used. (Scintilla feature 2358) - public void SetDocPointer(IntPtr pointer) + public void SetDocPointer(IntPtr doc) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETDOCPOINTER, Unused, pointer); + Win32.SendMessage(scintilla, SciMsg.SCI_SETDOCPOINTER, (IntPtr) Unused, (IntPtr) doc); } /// Set which document modification events are sent to the container. (Scintilla feature 2359) - public void SetModEventMask(int mask) + public void SetModEventMask(ModificationFlags eventMask) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMODEVENTMASK, mask, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMODEVENTMASK, (IntPtr) eventMask, (IntPtr) Unused); } /// Retrieve the column number which text should be kept within. (Scintilla feature 2360) public int GetEdgeColumn() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGECOLUMN, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGECOLUMN, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3073,43 +3009,53 @@ public int GetEdgeColumn() /// public void SetEdgeColumn(int column) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGECOLUMN, column, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGECOLUMN, (IntPtr) column, (IntPtr) Unused); } /// Retrieve the edge highlight mode. (Scintilla feature 2362) - public int GetEdgeMode() + public EdgeVisualStyle GetEdgeMode() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGEMODE, Unused, Unused); - return (int) res; + return (EdgeVisualStyle)Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGEMODE, (IntPtr) Unused, (IntPtr) Unused); } /// - /// The edge may be displayed by a line (EDGE_LINE) or by highlighting text that + /// The edge may be displayed by a line (EDGE_LINE/EDGE_MULTILINE) or by highlighting text that /// goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). /// (Scintilla feature 2363) /// - public void SetEdgeMode(int mode) + public void SetEdgeMode(EdgeVisualStyle edgeMode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGEMODE, mode, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGEMODE, (IntPtr) edgeMode, (IntPtr) Unused); } /// Retrieve the colour used in edge indication. (Scintilla feature 2364) public Colour GetEdgeColour() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGECOLOUR, Unused, Unused); - return new Colour((int) res); + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGECOLOUR, (IntPtr) Unused, (IntPtr) Unused)); } /// Change the colour used in edge indication. (Scintilla feature 2365) public void SetEdgeColour(Colour edgeColour) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGECOLOUR, edgeColour.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGECOLOUR, edgeColour.Value, (IntPtr) Unused); + } + + /// Add a new vertical edge to the view. (Scintilla feature 2694) + public void MultiEdgeAddLine(int column, Colour edgeColour) + { + Win32.SendMessage(scintilla, SciMsg.SCI_MULTIEDGEADDLINE, (IntPtr) column, edgeColour.Value); + } + + /// Clear all vertical edges. (Scintilla feature 2695) + public void MultiEdgeClearAll() + { + Win32.SendMessage(scintilla, SciMsg.SCI_MULTIEDGECLEARALL, (IntPtr) Unused, (IntPtr) Unused); } /// Sets the current caret position to be the search anchor. (Scintilla feature 2366) public void SearchAnchor() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHANCHOR, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHANCHOR, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3117,12 +3063,11 @@ public void SearchAnchor() /// Does not ensure the selection is visible. /// (Scintilla feature 2367) /// - public unsafe int SearchNext(int flags, string text) + public unsafe int SearchNext(FindOption searchFlags, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHNEXT, flags, (IntPtr) textPtr); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHNEXT, (IntPtr) searchFlags, (IntPtr) textPtr); } } @@ -3131,37 +3076,34 @@ public unsafe int SearchNext(int flags, string text) /// Does not ensure the selection is visible. /// (Scintilla feature 2368) /// - public unsafe int SearchPrev(int flags, string text) + public unsafe int SearchPrev(FindOption searchFlags, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHPREV, flags, (IntPtr) textPtr); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHPREV, (IntPtr) searchFlags, (IntPtr) textPtr); } } /// Retrieves the number of lines completely visible. (Scintilla feature 2370) public int LinesOnScreen() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESONSCREEN, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_LINESONSCREEN, (IntPtr) Unused, (IntPtr) Unused); } /// /// Set whether a pop up menu is displayed automatically when the user presses - /// the wrong mouse button. + /// the wrong mouse button on certain areas. /// (Scintilla feature 2371) /// - public void UsePopUp(bool allowPopUp) + public void UsePopUp(PopUp popUpMode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_USEPOPUP, allowPopUp ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_USEPOPUP, (IntPtr) popUpMode, (IntPtr) Unused); } /// Is the selection rectangular? The alternative is the more common stream selection. (Scintilla feature 2372) public bool SelectionIsRectangle() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SELECTIONISRECTANGLE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_SELECTIONISRECTANGLE, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3169,16 +3111,15 @@ public bool SelectionIsRectangle() /// It may be positive to magnify or negative to reduce. /// (Scintilla feature 2373) /// - public void SetZoom(int zoom) + public void SetZoom(int zoomInPoints) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETZOOM, zoom, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETZOOM, (IntPtr) zoomInPoints, (IntPtr) Unused); } /// Retrieve the zoom level. (Scintilla feature 2374) public int GetZoom() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETZOOM, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETZOOM, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3186,81 +3127,105 @@ public int GetZoom() /// Starts with reference count of 1 and not selected into editor. /// (Scintilla feature 2375) /// - public int CreateDocument() + public IntPtr CreateDocument(int bytes, DocumentOption documentOptions) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CREATEDOCUMENT, Unused, Unused); - return (int) res; + return Win32.SendMessage(scintilla, SciMsg.SCI_CREATEDOCUMENT, (IntPtr) bytes, (IntPtr) documentOptions); } /// Extend life of document. (Scintilla feature 2376) - public void AddRefDocument(int doc) + public void AddRefDocument(IntPtr doc) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDREFDOCUMENT, Unused, doc); + Win32.SendMessage(scintilla, SciMsg.SCI_ADDREFDOCUMENT, (IntPtr) Unused, (IntPtr) doc); } /// Release a reference to the document, deleting document if it fades to black. (Scintilla feature 2377) - public void ReleaseDocument(int doc) + public void ReleaseDocument(IntPtr doc) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RELEASEDOCUMENT, Unused, doc); + Win32.SendMessage(scintilla, SciMsg.SCI_RELEASEDOCUMENT, (IntPtr) Unused, (IntPtr) doc); + } + + /// Get which document options are set. (Scintilla feature 2379) + public DocumentOption GetDocumentOptions() + { + return (DocumentOption)Win32.SendMessage(scintilla, SciMsg.SCI_GETDOCUMENTOPTIONS, (IntPtr) Unused, (IntPtr) Unused); } /// Get which document modification events are sent to the container. (Scintilla feature 2378) - public int GetModEventMask() + public ModificationFlags GetModEventMask() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMODEVENTMASK, Unused, Unused); - return (int) res; + return (ModificationFlags)Win32.SendMessage(scintilla, SciMsg.SCI_GETMODEVENTMASK, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Set whether command events are sent to the container. (Scintilla feature 2717) + public void SetCommandEvents(bool commandEvents) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETCOMMANDEVENTS, new IntPtr(commandEvents ? 1 : 0), (IntPtr) Unused); + } + + /// Get whether command events are sent to the container. (Scintilla feature 2718) + public bool GetCommandEvents() + { + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCOMMANDEVENTS, (IntPtr) Unused, (IntPtr) Unused); } /// Change internal focus flag. (Scintilla feature 2380) public void SetFocus(bool focus) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOCUS, focus ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETFOCUS, new IntPtr(focus ? 1 : 0), (IntPtr) Unused); } /// Get internal focus flag. (Scintilla feature 2381) public bool GetFocus() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOCUS, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETFOCUS, (IntPtr) Unused, (IntPtr) Unused); } /// Change error status - 0 = OK. (Scintilla feature 2382) - public void SetStatus(int statusCode) + public void SetStatus(Status status) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTATUS, statusCode, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSTATUS, (IntPtr) status, (IntPtr) Unused); } /// Get error status. (Scintilla feature 2383) - public int GetStatus() + public Status GetStatus() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTATUS, Unused, Unused); - return (int) res; + return (Status)Win32.SendMessage(scintilla, SciMsg.SCI_GETSTATUS, (IntPtr) Unused, (IntPtr) Unused); } /// Set whether the mouse is captured when its button is pressed. (Scintilla feature 2384) public void SetMouseDownCaptures(bool captures) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSEDOWNCAPTURES, captures ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSEDOWNCAPTURES, new IntPtr(captures ? 1 : 0), (IntPtr) Unused); } /// Get whether mouse gets captured. (Scintilla feature 2385) public bool GetMouseDownCaptures() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSEDOWNCAPTURES, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSEDOWNCAPTURES, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Set whether the mouse wheel can be active outside the window. (Scintilla feature 2696) + public void SetMouseWheelCaptures(bool captures) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSEWHEELCAPTURES, new IntPtr(captures ? 1 : 0), (IntPtr) Unused); + } + + /// Get whether mouse wheel can be active outside the window. (Scintilla feature 2697) + public bool GetMouseWheelCaptures() + { + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSEWHEELCAPTURES, (IntPtr) Unused, (IntPtr) Unused); } /// Sets the cursor to one of the SC_CURSOR* values. (Scintilla feature 2386) - public void SetCursor(int cursorType) + public void SetCursor(CursorShape cursorType) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCURSOR, cursorType, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCURSOR, (IntPtr) cursorType, (IntPtr) Unused); } /// Get cursor type. (Scintilla feature 2387) - public int GetCursor() + public CursorShape GetCursor() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURSOR, Unused, Unused); - return (int) res; + return (CursorShape)Win32.SendMessage(scintilla, SciMsg.SCI_GETCURSOR, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3270,20 +3235,19 @@ public int GetCursor() /// public void SetControlCharSymbol(int symbol) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCONTROLCHARSYMBOL, symbol, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCONTROLCHARSYMBOL, (IntPtr) symbol, (IntPtr) Unused); } /// Get the way control characters are displayed. (Scintilla feature 2389) public int GetControlCharSymbol() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCONTROLCHARSYMBOL, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCONTROLCHARSYMBOL, (IntPtr) Unused, (IntPtr) Unused); } /// Move to the previous change in capitalisation. (Scintilla feature 2390) public void WordPartLeft() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTLEFT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTLEFT, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3293,13 +3257,13 @@ public void WordPartLeft() /// public void WordPartLeftExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTLEFTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTLEFTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move to the change next in capitalisation. (Scintilla feature 2392) public void WordPartRight() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTRIGHT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTRIGHT, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3309,7 +3273,7 @@ public void WordPartRight() /// public void WordPartRightExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTRIGHTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTRIGHTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3317,46 +3281,45 @@ public void WordPartRightExtend() /// is to be moved to by Find, FindNext, GotoLine, etc. /// (Scintilla feature 2394) /// - public void SetVisiblePolicy(int visiblePolicy, int visibleSlop) + public void SetVisiblePolicy(VisiblePolicy visiblePolicy, int visibleSlop) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVISIBLEPOLICY, visiblePolicy, visibleSlop); + Win32.SendMessage(scintilla, SciMsg.SCI_SETVISIBLEPOLICY, (IntPtr) visiblePolicy, (IntPtr) visibleSlop); } /// Delete back from the current position to the start of the line. (Scintilla feature 2395) public void DelLineLeft() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELLINELEFT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DELLINELEFT, (IntPtr) Unused, (IntPtr) Unused); } /// Delete forwards from the current position to the end of the line. (Scintilla feature 2396) public void DelLineRight() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELLINERIGHT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DELLINERIGHT, (IntPtr) Unused, (IntPtr) Unused); } - /// Get and Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2397) - public void SetXOffset(int newOffset) + /// Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2397) + public void SetXOffset(int xOffset) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETXOFFSET, newOffset, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETXOFFSET, (IntPtr) xOffset, (IntPtr) Unused); } - /// Get and Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2398) + /// Get the xOffset (ie, horizontal scroll position). (Scintilla feature 2398) public int GetXOffset() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETXOFFSET, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETXOFFSET, (IntPtr) Unused, (IntPtr) Unused); } /// Set the last x chosen value to be the caret x position. (Scintilla feature 2399) public void ChooseCaretX() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHOOSECARETX, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CHOOSECARETX, (IntPtr) Unused, (IntPtr) Unused); } /// Set the focus to this Scintilla widget. (Scintilla feature 2400) public void GrabFocus() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GRABFOCUS, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_GRABFOCUS, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3364,9 +3327,9 @@ public void GrabFocus() /// The exclusion zone is given in pixels. /// (Scintilla feature 2402) /// - public void SetXCaretPolicy(int caretPolicy, int caretSlop) + public void SetXCaretPolicy(CaretPolicy caretPolicy, int caretSlop) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETXCARETPOLICY, caretPolicy, caretSlop); + Win32.SendMessage(scintilla, SciMsg.SCI_SETXCARETPOLICY, (IntPtr) caretPolicy, (IntPtr) caretSlop); } /// @@ -3374,98 +3337,93 @@ public void SetXCaretPolicy(int caretPolicy, int caretSlop) /// The exclusion zone is given in lines. /// (Scintilla feature 2403) /// - public void SetYCaretPolicy(int caretPolicy, int caretSlop) + public void SetYCaretPolicy(CaretPolicy caretPolicy, int caretSlop) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETYCARETPOLICY, caretPolicy, caretSlop); + Win32.SendMessage(scintilla, SciMsg.SCI_SETYCARETPOLICY, (IntPtr) caretPolicy, (IntPtr) caretSlop); } /// Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). (Scintilla feature 2406) - public void SetPrintWrapMode(int mode) + public void SetPrintWrapMode(Wrap wrapMode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTWRAPMODE, mode, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTWRAPMODE, (IntPtr) wrapMode, (IntPtr) Unused); } /// Is printing line wrapped? (Scintilla feature 2407) - public int GetPrintWrapMode() + public Wrap GetPrintWrapMode() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTWRAPMODE, Unused, Unused); - return (int) res; + return (Wrap)Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTWRAPMODE, (IntPtr) Unused, (IntPtr) Unused); } /// Set a fore colour for active hotspots. (Scintilla feature 2410) public void SetHotspotActiveFore(bool useSetting, Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEFORE, useSetting ? 1 : 0, fore.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEFORE, new IntPtr(useSetting ? 1 : 0), fore.Value); } /// Get the fore colour for active hotspots. (Scintilla feature 2494) public Colour GetHotspotActiveFore() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEFORE, Unused, Unused); - return new Colour((int) res); + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEFORE, (IntPtr) Unused, (IntPtr) Unused)); } /// Set a back colour for active hotspots. (Scintilla feature 2411) public void SetHotspotActiveBack(bool useSetting, Colour back) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEBACK, useSetting ? 1 : 0, back.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEBACK, new IntPtr(useSetting ? 1 : 0), back.Value); } /// Get the back colour for active hotspots. (Scintilla feature 2495) public Colour GetHotspotActiveBack() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEBACK, Unused, Unused); - return new Colour((int) res); + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEBACK, (IntPtr) Unused, (IntPtr) Unused)); } /// Enable / Disable underlining active hotspots. (Scintilla feature 2412) public void SetHotspotActiveUnderline(bool underline) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEUNDERLINE, underline ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTACTIVEUNDERLINE, new IntPtr(underline ? 1 : 0), (IntPtr) Unused); } /// Get whether underlining for active hotspots. (Scintilla feature 2496) public bool GetHotspotActiveUnderline() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEUNDERLINE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTACTIVEUNDERLINE, (IntPtr) Unused, (IntPtr) Unused); } /// Limit hotspots to single line so hotspots on two lines don't merge. (Scintilla feature 2421) public void SetHotspotSingleLine(bool singleLine) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTSINGLELINE, singleLine ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETHOTSPOTSINGLELINE, new IntPtr(singleLine ? 1 : 0), (IntPtr) Unused); } /// Get the HotspotSingleLine property (Scintilla feature 2497) public bool GetHotspotSingleLine() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTSINGLELINE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTSINGLELINE, (IntPtr) Unused, (IntPtr) Unused); } - /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2413) + /// Move caret down one paragraph (delimited by empty lines). (Scintilla feature 2413) public void ParaDown() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARADOWN, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PARADOWN, (IntPtr) Unused, (IntPtr) Unused); } - /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2414) + /// Extend selection down one paragraph (delimited by empty lines). (Scintilla feature 2414) public void ParaDownExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARADOWNEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PARADOWNEXTEND, (IntPtr) Unused, (IntPtr) Unused); } - /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2415) + /// Move caret up one paragraph (delimited by empty lines). (Scintilla feature 2415) public void ParaUp() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARAUP, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PARAUP, (IntPtr) Unused, (IntPtr) Unused); } - /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2416) + /// Extend selection up one paragraph (delimited by empty lines). (Scintilla feature 2416) public void ParaUpExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARAUPEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PARAUPEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3473,10 +3431,9 @@ public void ParaUpExtend() /// page into account. Returns 0 if passed 0. /// (Scintilla feature 2417) /// - public Position PositionBefore(Position pos) + public int PositionBefore(int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONBEFORE, pos.Value, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONBEFORE, (IntPtr) pos, (IntPtr) Unused); } /// @@ -3484,10 +3441,9 @@ public Position PositionBefore(Position pos) /// page into account. Maximum value returned is the last position in the document. /// (Scintilla feature 2418) /// - public Position PositionAfter(Position pos) + public int PositionAfter(int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONAFTER, pos.Value, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONAFTER, (IntPtr) pos, (IntPtr) Unused); } /// @@ -3495,16 +3451,26 @@ public Position PositionAfter(Position pos) /// of characters. Returned value is always between 0 and last position in document. /// (Scintilla feature 2670) /// - public Position PositionRelative(Position pos, int relative) + public int PositionRelative(int pos, int relative) + { + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONRELATIVE, (IntPtr) pos, (IntPtr) relative); + } + + /// + /// Given a valid document position, return a position that differs in a number + /// of UTF-16 code units. Returned value is always between 0 and last position in document. + /// The result may point half way (2 bytes) inside a non-BMP character. + /// (Scintilla feature 2716) + /// + public int PositionRelativeCodeUnits(int pos, int relative) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONRELATIVE, pos.Value, relative); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONRELATIVECODEUNITS, (IntPtr) pos, (IntPtr) relative); } /// Copy a range of text to the clipboard. Positions are clipped into the document. (Scintilla feature 2419) - public void CopyRange(Position start, Position end) + public void CopyRange(int start, int end) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPYRANGE, start.Value, end.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_COPYRANGE, (IntPtr) start, (IntPtr) end); } /// Copy argument text to the clipboard. (Scintilla feature 2420) @@ -3512,7 +3478,7 @@ public unsafe void CopyText(int length, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPYTEXT, length, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_COPYTEXT, (IntPtr) length, (IntPtr) textPtr); } } @@ -3521,60 +3487,63 @@ public unsafe void CopyText(int length, string text) /// by lines (SC_SEL_LINES). /// (Scintilla feature 2422) /// - public void SetSelectionMode(int mode) + public void SetSelectionMode(SelectionMode selectionMode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONMODE, mode, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONMODE, (IntPtr) selectionMode, (IntPtr) Unused); } /// Get the mode of the current selection. (Scintilla feature 2423) - public int GetSelectionMode() + public SelectionMode GetSelectionMode() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONMODE, Unused, Unused); - return (int) res; + return (SelectionMode)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONMODE, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Get whether or not regular caret moves will extend or reduce the selection. (Scintilla feature 2706) + public bool GetMoveExtendsSelection() + { + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMOVEEXTENDSSELECTION, (IntPtr) Unused, (IntPtr) Unused); } /// Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). (Scintilla feature 2424) - public Position GetLineSelStartPosition(int line) + public int GetLineSelStartPosition(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESELSTARTPOSITION, line, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESELSTARTPOSITION, (IntPtr) line, (IntPtr) Unused); } /// Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line). (Scintilla feature 2425) - public Position GetLineSelEndPosition(int line) + public int GetLineSelEndPosition(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESELENDPOSITION, line, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESELENDPOSITION, (IntPtr) line, (IntPtr) Unused); } /// Move caret down one line, extending rectangular selection to new caret position. (Scintilla feature 2426) public void LineDownRectExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWNRECTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWNRECTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret up one line, extending rectangular selection to new caret position. (Scintilla feature 2427) public void LineUpRectExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEUPRECTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEUPRECTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret left one character, extending rectangular selection to new caret position. (Scintilla feature 2428) public void CharLeftRectExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFTRECTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFTRECTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret right one character, extending rectangular selection to new caret position. (Scintilla feature 2429) public void CharRightRectExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHTRECTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHTRECTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to first position on line, extending rectangular selection to new caret position. (Scintilla feature 2430) public void HomeRectExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMERECTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_HOMERECTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3585,73 +3554,73 @@ public void HomeRectExtend() /// public void VCHomeRectExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMERECTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMERECTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to last position on line, extending rectangular selection to new caret position. (Scintilla feature 2432) public void LineEndRectExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDRECTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDRECTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret one page up, extending rectangular selection to new caret position. (Scintilla feature 2433) public void PageUpRectExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUPRECTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUPRECTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret one page down, extending rectangular selection to new caret position. (Scintilla feature 2434) public void PageDownRectExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWNRECTEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWNRECTEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to top of page, or one page up if already at top of page. (Scintilla feature 2435) public void StutteredPageUp() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEUP, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEUP, (IntPtr) Unused, (IntPtr) Unused); } /// 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) public void StutteredPageUpExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEUPEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEUPEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret to bottom of page, or one page down if already at bottom of page. (Scintilla feature 2437) public void StutteredPageDown() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEDOWN, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEDOWN, (IntPtr) Unused, (IntPtr) Unused); } /// 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) public void StutteredPageDownExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEDOWNEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_STUTTEREDPAGEDOWNEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret left one word, position cursor at end of word. (Scintilla feature 2439) public void WordLeftEnd() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret left one word, position cursor at end of word, extending selection to new caret position. (Scintilla feature 2440) public void WordLeftEndExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTENDEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFTENDEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret right one word, position cursor at end of word. (Scintilla feature 2441) public void WordRightEnd() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Move caret right one word, position cursor at end of word, extending selection to new caret position. (Scintilla feature 2442) public void WordRightEndExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTENDEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHTENDEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3663,7 +3632,7 @@ public unsafe void SetWhitespaceChars(string characters) { fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACECHARS, Unused, (IntPtr) charactersPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACECHARS, (IntPtr) Unused, (IntPtr) charactersPtr); } } @@ -3673,7 +3642,7 @@ public unsafe string GetWhitespaceChars() byte[] charactersBuffer = new byte[10000]; fixed (byte* charactersPtr = charactersBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWHITESPACECHARS, Unused, (IntPtr) charactersPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_GETWHITESPACECHARS, (IntPtr) Unused, (IntPtr) charactersPtr); return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0'); } } @@ -3687,7 +3656,7 @@ public unsafe void SetPunctuationChars(string characters) { fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPUNCTUATIONCHARS, Unused, (IntPtr) charactersPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_SETPUNCTUATIONCHARS, (IntPtr) Unused, (IntPtr) charactersPtr); } } @@ -3697,7 +3666,7 @@ public unsafe string GetPunctuationChars() byte[] charactersBuffer = new byte[10000]; fixed (byte* charactersPtr = charactersBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPUNCTUATIONCHARS, Unused, (IntPtr) charactersPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_GETPUNCTUATIONCHARS, (IntPtr) Unused, (IntPtr) charactersPtr); return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0'); } } @@ -3705,14 +3674,13 @@ public unsafe string GetPunctuationChars() /// Reset the set of characters for whitespace and word characters to the defaults. (Scintilla feature 2444) public void SetCharsDefault() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCHARSDEFAULT, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCHARSDEFAULT, (IntPtr) Unused, (IntPtr) Unused); } /// Get currently selected item position in the auto-completion list (Scintilla feature 2445) public int AutoCGetCurrent() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCURRENT, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCURRENT, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3723,57 +3691,54 @@ public int AutoCGetCurrent() /// public unsafe string AutoCGetCurrentText() { - byte[] sBuffer = new byte[10000]; - fixed (byte* sPtr = sBuffer) + byte[] textBuffer = new byte[10000]; + fixed (byte* textPtr = textBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCURRENTTEXT, Unused, (IntPtr) sPtr); - return Encoding.UTF8.GetString(sBuffer).TrimEnd('\0'); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCURRENTTEXT, (IntPtr) Unused, (IntPtr) textPtr); + return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } /// Set auto-completion case insensitive behaviour to either prefer case-sensitive matches or have no preference. (Scintilla feature 2634) - public void AutoCSetCaseInsensitiveBehaviour(int behaviour) + public void AutoCSetCaseInsensitiveBehaviour(CaseInsensitiveBehaviour behaviour) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR, behaviour, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR, (IntPtr) behaviour, (IntPtr) Unused); } /// Get auto-completion case insensitive behaviour. (Scintilla feature 2635) - public int AutoCGetCaseInsensitiveBehaviour() + public CaseInsensitiveBehaviour AutoCGetCaseInsensitiveBehaviour() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR, Unused, Unused); - return (int) res; + return (CaseInsensitiveBehaviour)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR, (IntPtr) Unused, (IntPtr) Unused); } /// Change the effect of autocompleting when there are multiple selections. (Scintilla feature 2636) - public void AutoCSetMulti(int multi) + public void AutoCSetMulti(MultiAutoComplete multi) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMULTI, multi, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMULTI, (IntPtr) multi, (IntPtr) Unused); } - /// Retrieve the effect of autocompleting when there are multiple selections.. (Scintilla feature 2637) - public int AutoCGetMulti() + /// Retrieve the effect of autocompleting when there are multiple selections. (Scintilla feature 2637) + public MultiAutoComplete AutoCGetMulti() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMULTI, Unused, Unused); - return (int) res; + return (MultiAutoComplete)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMULTI, (IntPtr) Unused, (IntPtr) Unused); } /// Set the way autocompletion lists are ordered. (Scintilla feature 2660) - public void AutoCSetOrder(int order) + public void AutoCSetOrder(Ordering order) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETORDER, order, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETORDER, (IntPtr) order, (IntPtr) Unused); } /// Get the way autocompletion lists are ordered. (Scintilla feature 2661) - public int AutoCGetOrder() + public Ordering AutoCGetOrder() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETORDER, Unused, Unused); - return (int) res; + return (Ordering)Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETORDER, (IntPtr) Unused, (IntPtr) Unused); } /// Enlarge the document to a particular size of text bytes. (Scintilla feature 2446) public void Allocate(int bytes) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATE, bytes, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATE, (IntPtr) bytes, (IntPtr) Unused); } /// @@ -3786,7 +3751,7 @@ public unsafe string TargetAsUTF8() byte[] sBuffer = new byte[10000]; fixed (byte* sPtr = sBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TARGETASUTF8, Unused, (IntPtr) sPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_TARGETASUTF8, (IntPtr) Unused, (IntPtr) sPtr); return Encoding.UTF8.GetString(sBuffer).TrimEnd('\0'); } } @@ -3798,7 +3763,7 @@ public unsafe string TargetAsUTF8() /// public void SetLengthForEncode(int bytes) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLENGTHFORENCODE, bytes, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETLENGTHFORENCODE, (IntPtr) bytes, (IntPtr) Unused); } /// @@ -3814,7 +3779,7 @@ public unsafe string EncodedFromUTF8(string utf8) byte[] encodedBuffer = new byte[10000]; fixed (byte* encodedPtr = encodedBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENCODEDFROMUTF8, (IntPtr) utf8Ptr, (IntPtr) encodedPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_ENCODEDFROMUTF8, (IntPtr) utf8Ptr, (IntPtr) encodedPtr); return Encoding.UTF8.GetString(encodedBuffer).TrimEnd('\0'); } } @@ -3827,157 +3792,145 @@ public unsafe string EncodedFromUTF8(string utf8) /// public int FindColumn(int line, int column) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDCOLUMN, line, column); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_FINDCOLUMN, (IntPtr) line, (IntPtr) column); } /// Can the caret preferred x position only be changed by explicit movement commands? (Scintilla feature 2457) - public int GetCaretSticky() + public CaretSticky GetCaretSticky() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETSTICKY, Unused, Unused); - return (int) res; + return (CaretSticky)Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETSTICKY, (IntPtr) Unused, (IntPtr) Unused); } /// Stop the caret preferred x position changing when the user types. (Scintilla feature 2458) - public void SetCaretSticky(int useCaretStickyBehaviour) + public void SetCaretSticky(CaretSticky useCaretStickyBehaviour) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETSTICKY, useCaretStickyBehaviour, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETSTICKY, (IntPtr) useCaretStickyBehaviour, (IntPtr) Unused); } /// Switch between sticky and non-sticky: meant to be bound to a key. (Scintilla feature 2459) public void ToggleCaretSticky() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TOGGLECARETSTICKY, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_TOGGLECARETSTICKY, (IntPtr) Unused, (IntPtr) Unused); } /// Enable/Disable convert-on-paste for line endings (Scintilla feature 2467) public void SetPasteConvertEndings(bool convert) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPASTECONVERTENDINGS, convert ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETPASTECONVERTENDINGS, new IntPtr(convert ? 1 : 0), (IntPtr) Unused); } /// Get convert-on-paste setting (Scintilla feature 2468) public bool GetPasteConvertEndings() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPASTECONVERTENDINGS, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETPASTECONVERTENDINGS, (IntPtr) Unused, (IntPtr) Unused); } /// Duplicate the selection. If selection empty duplicate the line containing the caret. (Scintilla feature 2469) public void SelectionDuplicate() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SELECTIONDUPLICATE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SELECTIONDUPLICATE, (IntPtr) Unused, (IntPtr) Unused); } /// Set background alpha of the caret line. (Scintilla feature 2470) - public void SetCaretLineBackAlpha(int alpha) + public void SetCaretLineBackAlpha(Alpha alpha) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEBACKALPHA, alpha, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEBACKALPHA, (IntPtr) alpha, (IntPtr) Unused); } /// Get the background alpha of the caret line. (Scintilla feature 2471) - public int GetCaretLineBackAlpha() + public Alpha GetCaretLineBackAlpha() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEBACKALPHA, Unused, Unused); - return (int) res; + return (Alpha)Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEBACKALPHA, (IntPtr) Unused, (IntPtr) Unused); } /// Set the style of the caret to be drawn. (Scintilla feature 2512) - public void SetCaretStyle(int caretStyle) + public void SetCaretStyle(CaretStyle caretStyle) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETSTYLE, caretStyle, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETSTYLE, (IntPtr) caretStyle, (IntPtr) Unused); } /// Returns the current style of the caret. (Scintilla feature 2513) - public int GetCaretStyle() + public CaretStyle GetCaretStyle() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETSTYLE, Unused, Unused); - return (int) res; + return (CaretStyle)Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETSTYLE, (IntPtr) Unused, (IntPtr) Unused); } /// Set the indicator used for IndicatorFillRange and IndicatorClearRange (Scintilla feature 2500) public void SetIndicatorCurrent(int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDICATORCURRENT, indicator, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETINDICATORCURRENT, (IntPtr) indicator, (IntPtr) Unused); } /// Get the current indicator (Scintilla feature 2501) public int GetIndicatorCurrent() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDICATORCURRENT, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETINDICATORCURRENT, (IntPtr) Unused, (IntPtr) Unused); } /// Set the value used for IndicatorFillRange (Scintilla feature 2502) public void SetIndicatorValue(int value) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDICATORVALUE, value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETINDICATORVALUE, (IntPtr) value, (IntPtr) Unused); } /// Get the current indicator value (Scintilla feature 2503) public int GetIndicatorValue() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDICATORVALUE, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETINDICATORVALUE, (IntPtr) Unused, (IntPtr) Unused); } /// Turn a indicator on over a range. (Scintilla feature 2504) - public void IndicatorFillRange(int position, int fillLength) + public void IndicatorFillRange(int start, int lengthFill) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORFILLRANGE, position, fillLength); + Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORFILLRANGE, (IntPtr) start, (IntPtr) lengthFill); } /// Turn a indicator off over a range. (Scintilla feature 2505) - public void IndicatorClearRange(int position, int clearLength) + public void IndicatorClearRange(int start, int lengthClear) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORCLEARRANGE, position, clearLength); + Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORCLEARRANGE, (IntPtr) start, (IntPtr) lengthClear); } - /// Are any indicators present at position? (Scintilla feature 2506) - public int IndicatorAllOnFor(int position) + /// Are any indicators present at pos? (Scintilla feature 2506) + public int IndicatorAllOnFor(int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORALLONFOR, position, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORALLONFOR, (IntPtr) pos, (IntPtr) Unused); } - /// What value does a particular indicator have at at a position? (Scintilla feature 2507) - public int IndicatorValueAt(int indicator, int position) + /// What value does a particular indicator have at a position? (Scintilla feature 2507) + public int IndicatorValueAt(int indicator, int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORVALUEAT, indicator, position); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORVALUEAT, (IntPtr) indicator, (IntPtr) pos); } /// Where does a particular indicator start? (Scintilla feature 2508) - public int IndicatorStart(int indicator, int position) + public int IndicatorStart(int indicator, int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORSTART, indicator, position); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORSTART, (IntPtr) indicator, (IntPtr) pos); } /// Where does a particular indicator end? (Scintilla feature 2509) - public int IndicatorEnd(int indicator, int position) + public int IndicatorEnd(int indicator, int pos) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATOREND, indicator, position); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_INDICATOREND, (IntPtr) indicator, (IntPtr) pos); } /// Set number of entries in position cache (Scintilla feature 2514) public void SetPositionCache(int size) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPOSITIONCACHE, size, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETPOSITIONCACHE, (IntPtr) size, (IntPtr) Unused); } /// How many entries are allocated to the position cache? (Scintilla feature 2515) public int GetPositionCache() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPOSITIONCACHE, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETPOSITIONCACHE, (IntPtr) Unused, (IntPtr) Unused); } /// Copy the selection, if selection empty copy the line with the caret (Scintilla feature 2519) public void CopyAllowLine() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPYALLOWLINE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_COPYALLOWLINE, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -3987,18 +3940,18 @@ public void CopyAllowLine() /// public IntPtr GetCharacterPointer() { - return Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERPOINTER, Unused, Unused); + return Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERPOINTER, (IntPtr) Unused, (IntPtr) Unused); } /// /// 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. + /// to lengthRange bytes. /// (Scintilla feature 2643) /// - public IntPtr GetRangePointer(int position, int rangeLength) + public IntPtr GetRangePointer(int start, int lengthRange) { - return Win32.SendMessage(scintilla, SciMsg.SCI_GETRANGEPOINTER, position, rangeLength); + return Win32.SendMessage(scintilla, SciMsg.SCI_GETRANGEPOINTER, (IntPtr) start, (IntPtr) lengthRange); } /// @@ -4006,69 +3959,63 @@ public IntPtr GetRangePointer(int position, int rangeLength) /// the range of a call to GetRangePointer. /// (Scintilla feature 2644) /// - public Position GetGapPosition() + public int GetGapPosition() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETGAPPOSITION, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETGAPPOSITION, (IntPtr) Unused, (IntPtr) Unused); } /// Set the alpha fill colour of the given indicator. (Scintilla feature 2523) - public void IndicSetAlpha(int indicator, int alpha) + public void IndicSetAlpha(int indicator, Alpha alpha) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETALPHA, indicator, alpha); + Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETALPHA, (IntPtr) indicator, (IntPtr) alpha); } /// Get the alpha fill colour of the given indicator. (Scintilla feature 2524) - public int IndicGetAlpha(int indicator) + public Alpha IndicGetAlpha(int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETALPHA, indicator, Unused); - return (int) res; + return (Alpha)Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETALPHA, (IntPtr) indicator, (IntPtr) Unused); } /// Set the alpha outline colour of the given indicator. (Scintilla feature 2558) - public void IndicSetOutlineAlpha(int indicator, int alpha) + public void IndicSetOutlineAlpha(int indicator, Alpha alpha) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETOUTLINEALPHA, indicator, alpha); + Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETOUTLINEALPHA, (IntPtr) indicator, (IntPtr) alpha); } /// Get the alpha outline colour of the given indicator. (Scintilla feature 2559) - public int IndicGetOutlineAlpha(int indicator) + public Alpha IndicGetOutlineAlpha(int indicator) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETOUTLINEALPHA, indicator, Unused); - return (int) res; + return (Alpha)Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETOUTLINEALPHA, (IntPtr) indicator, (IntPtr) Unused); } /// Set extra ascent for each line (Scintilla feature 2525) public void SetExtraAscent(int extraAscent) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEXTRAASCENT, extraAscent, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETEXTRAASCENT, (IntPtr) extraAscent, (IntPtr) Unused); } /// Get extra ascent for each line (Scintilla feature 2526) public int GetExtraAscent() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEXTRAASCENT, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETEXTRAASCENT, (IntPtr) Unused, (IntPtr) Unused); } /// Set extra descent for each line (Scintilla feature 2527) public void SetExtraDescent(int extraDescent) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEXTRADESCENT, extraDescent, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETEXTRADESCENT, (IntPtr) extraDescent, (IntPtr) Unused); } /// Get extra descent for each line (Scintilla feature 2528) public int GetExtraDescent() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEXTRADESCENT, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETEXTRADESCENT, (IntPtr) Unused, (IntPtr) Unused); } /// Which symbol was defined for markerNumber with MarkerDefine (Scintilla feature 2529) public int MarkerSymbolDefined(int markerNumber) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSYMBOLDEFINED, markerNumber, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSYMBOLDEFINED, (IntPtr) markerNumber, (IntPtr) Unused); } /// Set the text in the text margin for a line (Scintilla feature 2530) @@ -4076,7 +4023,7 @@ public unsafe void MarginSetText(int line, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETTEXT, line, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETTEXT, (IntPtr) line, (IntPtr) textPtr); } } @@ -4086,7 +4033,7 @@ public unsafe string MarginGetText(int line) byte[] textBuffer = new byte[10000]; fixed (byte* textPtr = textBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETTEXT, line, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETTEXT, (IntPtr) line, (IntPtr) textPtr); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } @@ -4094,14 +4041,13 @@ public unsafe string MarginGetText(int line) /// Set the style number for the text margin for a line (Scintilla feature 2532) public void MarginSetStyle(int line, int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLE, line, style); + Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLE, (IntPtr) line, (IntPtr) style); } /// Get the style number for the text margin for a line (Scintilla feature 2533) public int MarginGetStyle(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLE, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLE, (IntPtr) line, (IntPtr) Unused); } /// Set the style in the text margin for a line (Scintilla feature 2534) @@ -4109,7 +4055,7 @@ public unsafe void MarginSetStyles(int line, string styles) { fixed (byte* stylesPtr = Encoding.UTF8.GetBytes(styles)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLES, line, (IntPtr) stylesPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLES, (IntPtr) line, (IntPtr) stylesPtr); } } @@ -4119,7 +4065,7 @@ public unsafe string MarginGetStyles(int line) byte[] stylesBuffer = new byte[10000]; fixed (byte* stylesPtr = stylesBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLES, line, (IntPtr) stylesPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLES, (IntPtr) line, (IntPtr) stylesPtr); return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0'); } } @@ -4127,33 +4073,31 @@ public unsafe string MarginGetStyles(int line) /// Clear the margin text on all lines (Scintilla feature 2536) public void MarginTextClearAll() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINTEXTCLEARALL, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_MARGINTEXTCLEARALL, (IntPtr) Unused, (IntPtr) Unused); } /// Get the start of the range of style numbers used for margin text (Scintilla feature 2537) public void MarginSetStyleOffset(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLEOFFSET, style, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_MARGINSETSTYLEOFFSET, (IntPtr) style, (IntPtr) Unused); } /// Get the start of the range of style numbers used for margin text (Scintilla feature 2538) public int MarginGetStyleOffset() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLEOFFSET, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_MARGINGETSTYLEOFFSET, (IntPtr) Unused, (IntPtr) Unused); } /// Set the margin options. (Scintilla feature 2539) - public void SetMarginOptions(int marginOptions) + public void SetMarginOptions(MarginOption marginOptions) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINOPTIONS, marginOptions, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINOPTIONS, (IntPtr) marginOptions, (IntPtr) Unused); } /// Get the margin options. (Scintilla feature 2557) - public int GetMarginOptions() + public MarginOption GetMarginOptions() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINOPTIONS, Unused, Unused); - return (int) res; + return (MarginOption)Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINOPTIONS, (IntPtr) Unused, (IntPtr) Unused); } /// Set the annotation text for a line (Scintilla feature 2540) @@ -4161,7 +4105,7 @@ public unsafe void AnnotationSetText(int line, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETTEXT, line, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETTEXT, (IntPtr) line, (IntPtr) textPtr); } } @@ -4171,7 +4115,7 @@ public unsafe string AnnotationGetText(int line) byte[] textBuffer = new byte[10000]; fixed (byte* textPtr = textBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETTEXT, line, (IntPtr) textPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETTEXT, (IntPtr) line, (IntPtr) textPtr); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } @@ -4179,14 +4123,13 @@ public unsafe string AnnotationGetText(int line) /// Set the style number for the annotations for a line (Scintilla feature 2542) public void AnnotationSetStyle(int line, int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLE, line, style); + Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLE, (IntPtr) line, (IntPtr) style); } /// Get the style number for the annotations for a line (Scintilla feature 2543) public int AnnotationGetStyle(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLE, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLE, (IntPtr) line, (IntPtr) Unused); } /// Set the annotation styles for a line (Scintilla feature 2544) @@ -4194,7 +4137,7 @@ public unsafe void AnnotationSetStyles(int line, string styles) { fixed (byte* stylesPtr = Encoding.UTF8.GetBytes(styles)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLES, line, (IntPtr) stylesPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLES, (IntPtr) line, (IntPtr) stylesPtr); } } @@ -4204,7 +4147,7 @@ public unsafe string AnnotationGetStyles(int line) byte[] stylesBuffer = new byte[10000]; fixed (byte* stylesPtr = stylesBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLES, line, (IntPtr) stylesPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLES, (IntPtr) line, (IntPtr) stylesPtr); return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0'); } } @@ -4212,66 +4155,61 @@ public unsafe string AnnotationGetStyles(int line) /// Get the number of annotation lines for a line (Scintilla feature 2546) public int AnnotationGetLines(int line) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETLINES, line, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETLINES, (IntPtr) line, (IntPtr) Unused); } /// Clear the annotations from all lines (Scintilla feature 2547) public void AnnotationClearAll() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONCLEARALL, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONCLEARALL, (IntPtr) Unused, (IntPtr) Unused); } /// Set the visibility for the annotations for a view (Scintilla feature 2548) - public void AnnotationSetVisible(int visible) + public void AnnotationSetVisible(AnnotationVisible visible) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETVISIBLE, visible, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETVISIBLE, (IntPtr) visible, (IntPtr) Unused); } /// Get the visibility for the annotations for a view (Scintilla feature 2549) - public int AnnotationGetVisible() + public AnnotationVisible AnnotationGetVisible() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETVISIBLE, Unused, Unused); - return (int) res; + return (AnnotationVisible)Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETVISIBLE, (IntPtr) Unused, (IntPtr) Unused); } /// Get the start of the range of style numbers used for annotations (Scintilla feature 2550) public void AnnotationSetStyleOffset(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLEOFFSET, style, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETSTYLEOFFSET, (IntPtr) style, (IntPtr) Unused); } /// Get the start of the range of style numbers used for annotations (Scintilla feature 2551) public int AnnotationGetStyleOffset() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLEOFFSET, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETSTYLEOFFSET, (IntPtr) Unused, (IntPtr) Unused); } /// Release all extended (>255) style numbers (Scintilla feature 2552) public void ReleaseAllExtendedStyles() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RELEASEALLEXTENDEDSTYLES, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_RELEASEALLEXTENDEDSTYLES, (IntPtr) Unused, (IntPtr) Unused); } /// Allocate some extended (>255) style numbers and return the start of the range (Scintilla feature 2553) public int AllocateExtendedStyles(int numberStyles) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATEEXTENDEDSTYLES, numberStyles, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATEEXTENDEDSTYLES, (IntPtr) numberStyles, (IntPtr) Unused); } /// Add a container action to the undo stack (Scintilla feature 2560) - public void AddUndoAction(int token, int flags) + public void AddUndoAction(int token, UndoFlags flags) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDUNDOACTION, token, flags); + Win32.SendMessage(scintilla, SciMsg.SCI_ADDUNDOACTION, (IntPtr) token, (IntPtr) flags); } /// Find the position of a character from a point within the window. (Scintilla feature 2561) - public Position CharPositionFromPoint(int x, int y) + public int CharPositionFromPoint(int x, int y) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARPOSITIONFROMPOINT, x, y); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_CHARPOSITIONFROMPOINT, (IntPtr) x, (IntPtr) y); } /// @@ -4279,275 +4217,253 @@ public Position CharPositionFromPoint(int x, int y) /// Return INVALID_POSITION if not close to text. /// (Scintilla feature 2562) /// - public Position CharPositionFromPointClose(int x, int y) + public int CharPositionFromPointClose(int x, int y) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARPOSITIONFROMPOINTCLOSE, x, y); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_CHARPOSITIONFROMPOINTCLOSE, (IntPtr) x, (IntPtr) y); } /// Set whether switching to rectangular mode while selecting with the mouse is allowed. (Scintilla feature 2668) public void SetMouseSelectionRectangularSwitch(bool mouseSelectionRectangularSwitch) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSESELECTIONRECTANGULARSWITCH, mouseSelectionRectangularSwitch ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMOUSESELECTIONRECTANGULARSWITCH, new IntPtr(mouseSelectionRectangularSwitch ? 1 : 0), (IntPtr) Unused); } /// Whether switching to rectangular mode while selecting with the mouse is allowed. (Scintilla feature 2669) public bool GetMouseSelectionRectangularSwitch() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSESELECTIONRECTANGULARSWITCH, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMOUSESELECTIONRECTANGULARSWITCH, (IntPtr) Unused, (IntPtr) Unused); } /// Set whether multiple selections can be made (Scintilla feature 2563) public void SetMultipleSelection(bool multipleSelection) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMULTIPLESELECTION, multipleSelection ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMULTIPLESELECTION, new IntPtr(multipleSelection ? 1 : 0), (IntPtr) Unused); } /// Whether multiple selections can be made (Scintilla feature 2564) public bool GetMultipleSelection() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMULTIPLESELECTION, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMULTIPLESELECTION, (IntPtr) Unused, (IntPtr) Unused); } /// Set whether typing can be performed into multiple selections (Scintilla feature 2565) public void SetAdditionalSelectionTyping(bool additionalSelectionTyping) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELECTIONTYPING, additionalSelectionTyping ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELECTIONTYPING, new IntPtr(additionalSelectionTyping ? 1 : 0), (IntPtr) Unused); } /// Whether typing can be performed into multiple selections (Scintilla feature 2566) public bool GetAdditionalSelectionTyping() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALSELECTIONTYPING, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALSELECTIONTYPING, (IntPtr) Unused, (IntPtr) Unused); } /// Set whether additional carets will blink (Scintilla feature 2567) public void SetAdditionalCaretsBlink(bool additionalCaretsBlink) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETSBLINK, additionalCaretsBlink ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETSBLINK, new IntPtr(additionalCaretsBlink ? 1 : 0), (IntPtr) Unused); } /// Whether additional carets will blink (Scintilla feature 2568) public bool GetAdditionalCaretsBlink() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETSBLINK, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETSBLINK, (IntPtr) Unused, (IntPtr) Unused); } /// Set whether additional carets are visible (Scintilla feature 2608) - public void SetAdditionalCaretsVisible(bool additionalCaretsBlink) + public void SetAdditionalCaretsVisible(bool additionalCaretsVisible) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETSVISIBLE, additionalCaretsBlink ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETSVISIBLE, new IntPtr(additionalCaretsVisible ? 1 : 0), (IntPtr) Unused); } /// Whether additional carets are visible (Scintilla feature 2609) public bool GetAdditionalCaretsVisible() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETSVISIBLE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETSVISIBLE, (IntPtr) Unused, (IntPtr) Unused); } /// How many selections are there? (Scintilla feature 2570) public int GetSelections() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONS, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONS, (IntPtr) Unused, (IntPtr) Unused); } /// Is every selected range empty? (Scintilla feature 2650) public bool GetSelectionEmpty() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONEMPTY, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONEMPTY, (IntPtr) Unused, (IntPtr) Unused); } /// Clear selections to a single empty stream selection (Scintilla feature 2571) public void ClearSelections() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARSELECTIONS, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CLEARSELECTIONS, (IntPtr) Unused, (IntPtr) Unused); } /// Set a simple selection (Scintilla feature 2572) - public int SetSelection(int caret, int anchor) + public void SetSelection(int caret, int anchor) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTION, caret, anchor); - return (int) res; + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTION, (IntPtr) caret, (IntPtr) anchor); } /// Add a selection (Scintilla feature 2573) - public int AddSelection(int caret, int anchor) + public void AddSelection(int caret, int anchor) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDSELECTION, caret, anchor); - return (int) res; + Win32.SendMessage(scintilla, SciMsg.SCI_ADDSELECTION, (IntPtr) caret, (IntPtr) anchor); } /// Drop one selection (Scintilla feature 2671) public void DropSelectionN(int selection) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DROPSELECTIONN, selection, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_DROPSELECTIONN, (IntPtr) selection, (IntPtr) Unused); } /// Set the main selection (Scintilla feature 2574) public void SetMainSelection(int selection) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMAINSELECTION, selection, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETMAINSELECTION, (IntPtr) selection, (IntPtr) Unused); } /// Which selection is the main selection (Scintilla feature 2575) public int GetMainSelection() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMAINSELECTION, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETMAINSELECTION, (IntPtr) Unused, (IntPtr) Unused); } - /// Which selection is the main selection (Scintilla feature 2576) - public void SetSelectionNCaret(int selection, Position pos) + /// Set the caret position of the nth selection. (Scintilla feature 2576) + public void SetSelectionNCaret(int selection, int caret) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNCARET, selection, pos.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNCARET, (IntPtr) selection, (IntPtr) caret); } - /// Which selection is the main selection (Scintilla feature 2577) - public Position GetSelectionNCaret(int selection) + /// Return the caret position of the nth selection. (Scintilla feature 2577) + public int GetSelectionNCaret(int selection) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNCARET, selection, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNCARET, (IntPtr) selection, (IntPtr) Unused); } - /// Which selection is the main selection (Scintilla feature 2578) - public void SetSelectionNAnchor(int selection, Position posAnchor) + /// Set the anchor position of the nth selection. (Scintilla feature 2578) + public void SetSelectionNAnchor(int selection, int anchor) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNANCHOR, selection, posAnchor.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNANCHOR, (IntPtr) selection, (IntPtr) anchor); } - /// Which selection is the main selection (Scintilla feature 2579) - public Position GetSelectionNAnchor(int selection) + /// Return the anchor position of the nth selection. (Scintilla feature 2579) + public int GetSelectionNAnchor(int selection) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNANCHOR, selection, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNANCHOR, (IntPtr) selection, (IntPtr) Unused); } - /// Which selection is the main selection (Scintilla feature 2580) + /// Set the virtual space of the caret of the nth selection. (Scintilla feature 2580) public void SetSelectionNCaretVirtualSpace(int selection, int space) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNCARETVIRTUALSPACE, selection, space); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNCARETVIRTUALSPACE, (IntPtr) selection, (IntPtr) space); } - /// Which selection is the main selection (Scintilla feature 2581) + /// Return the virtual space of the caret of the nth selection. (Scintilla feature 2581) public int GetSelectionNCaretVirtualSpace(int selection) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNCARETVIRTUALSPACE, selection, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNCARETVIRTUALSPACE, (IntPtr) selection, (IntPtr) Unused); } - /// Which selection is the main selection (Scintilla feature 2582) + /// Set the virtual space of the anchor of the nth selection. (Scintilla feature 2582) public void SetSelectionNAnchorVirtualSpace(int selection, int space) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNANCHORVIRTUALSPACE, selection, space); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNANCHORVIRTUALSPACE, (IntPtr) selection, (IntPtr) space); } - /// Which selection is the main selection (Scintilla feature 2583) + /// Return the virtual space of the anchor of the nth selection. (Scintilla feature 2583) public int GetSelectionNAnchorVirtualSpace(int selection) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNANCHORVIRTUALSPACE, selection, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNANCHORVIRTUALSPACE, (IntPtr) selection, (IntPtr) Unused); } /// Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2584) - public void SetSelectionNStart(int selection, Position pos) + public void SetSelectionNStart(int selection, int anchor) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNSTART, selection, pos.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNSTART, (IntPtr) selection, (IntPtr) anchor); } /// Returns the position at the start of the selection. (Scintilla feature 2585) - public Position GetSelectionNStart(int selection) + public int GetSelectionNStart(int selection) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNSTART, selection, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNSTART, (IntPtr) selection, (IntPtr) Unused); } /// Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2586) - public void SetSelectionNEnd(int selection, Position pos) + public void SetSelectionNEnd(int selection, int caret) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNEND, selection, pos.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNEND, (IntPtr) selection, (IntPtr) caret); } /// Returns the position at the end of the selection. (Scintilla feature 2587) - public Position GetSelectionNEnd(int selection) + public int GetSelectionNEnd(int selection) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNEND, selection, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNEND, (IntPtr) selection, (IntPtr) Unused); } - /// Returns the position at the end of the selection. (Scintilla feature 2588) - public void SetRectangularSelectionCaret(Position pos) + /// Set the caret position of the rectangular selection. (Scintilla feature 2588) + public void SetRectangularSelectionCaret(int caret) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONCARET, pos.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONCARET, (IntPtr) caret, (IntPtr) Unused); } - /// Returns the position at the end of the selection. (Scintilla feature 2589) - public Position GetRectangularSelectionCaret() + /// Return the caret position of the rectangular selection. (Scintilla feature 2589) + public int GetRectangularSelectionCaret() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONCARET, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONCARET, (IntPtr) Unused, (IntPtr) Unused); } - /// Returns the position at the end of the selection. (Scintilla feature 2590) - public void SetRectangularSelectionAnchor(Position posAnchor) + /// Set the anchor position of the rectangular selection. (Scintilla feature 2590) + public void SetRectangularSelectionAnchor(int anchor) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONANCHOR, posAnchor.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONANCHOR, (IntPtr) anchor, (IntPtr) Unused); } - /// Returns the position at the end of the selection. (Scintilla feature 2591) - public Position GetRectangularSelectionAnchor() + /// Return the anchor position of the rectangular selection. (Scintilla feature 2591) + public int GetRectangularSelectionAnchor() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONANCHOR, Unused, Unused); - return new Position((int) res); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONANCHOR, (IntPtr) Unused, (IntPtr) Unused); } - /// Returns the position at the end of the selection. (Scintilla feature 2592) + /// Set the virtual space of the caret of the rectangular selection. (Scintilla feature 2592) public void SetRectangularSelectionCaretVirtualSpace(int space) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE, space, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE, (IntPtr) space, (IntPtr) Unused); } - /// Returns the position at the end of the selection. (Scintilla feature 2593) + /// Return the virtual space of the caret of the rectangular selection. (Scintilla feature 2593) public int GetRectangularSelectionCaretVirtualSpace() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, (IntPtr) Unused, (IntPtr) Unused); } - /// Returns the position at the end of the selection. (Scintilla feature 2594) + /// Set the virtual space of the anchor of the rectangular selection. (Scintilla feature 2594) public void SetRectangularSelectionAnchorVirtualSpace(int space) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, space, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, (IntPtr) space, (IntPtr) Unused); } - /// Returns the position at the end of the selection. (Scintilla feature 2595) + /// Return the virtual space of the anchor of the rectangular selection. (Scintilla feature 2595) public int GetRectangularSelectionAnchorVirtualSpace() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, (IntPtr) Unused, (IntPtr) Unused); } - /// Returns the position at the end of the selection. (Scintilla feature 2596) - public void SetVirtualSpaceOptions(int virtualSpaceOptions) + /// Set options for virtual space behaviour. (Scintilla feature 2596) + public void SetVirtualSpaceOptions(VirtualSpace virtualSpaceOptions) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIRTUALSPACEOPTIONS, virtualSpaceOptions, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETVIRTUALSPACEOPTIONS, (IntPtr) virtualSpaceOptions, (IntPtr) Unused); } - /// Returns the position at the end of the selection. (Scintilla feature 2597) - public int GetVirtualSpaceOptions() + /// Return options for virtual space behaviour. (Scintilla feature 2597) + public VirtualSpace GetVirtualSpaceOptions() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIRTUALSPACEOPTIONS, Unused, Unused); - return (int) res; + return (VirtualSpace)Win32.SendMessage(scintilla, SciMsg.SCI_GETVIRTUALSPACEOPTIONS, (IntPtr) Unused, (IntPtr) Unused); } /// - /// On GTK+, allow selecting the modifier key to use for mouse-based + /// 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. @@ -4555,14 +4471,13 @@ public int GetVirtualSpaceOptions() /// public void SetRectangularSelectionModifier(int modifier) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONMODIFIER, modifier, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONMODIFIER, (IntPtr) modifier, (IntPtr) Unused); } /// Get the modifier key used for rectangular selection. (Scintilla feature 2599) public int GetRectangularSelectionModifier() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONMODIFIER, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONMODIFIER, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -4572,7 +4487,7 @@ public int GetRectangularSelectionModifier() /// public void SetAdditionalSelFore(Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELFORE, fore.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELFORE, fore.Value, (IntPtr) Unused); } /// @@ -4582,45 +4497,63 @@ public void SetAdditionalSelFore(Colour fore) /// public void SetAdditionalSelBack(Colour back) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELBACK, back.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELBACK, back.Value, (IntPtr) Unused); } /// Set the alpha of the selection. (Scintilla feature 2602) - public void SetAdditionalSelAlpha(int alpha) + public void SetAdditionalSelAlpha(Alpha alpha) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELALPHA, alpha, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELALPHA, (IntPtr) alpha, (IntPtr) Unused); } /// Get the alpha of the selection. (Scintilla feature 2603) - public int GetAdditionalSelAlpha() + public Alpha GetAdditionalSelAlpha() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALSELALPHA, Unused, Unused); - return (int) res; + return (Alpha)Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALSELALPHA, (IntPtr) Unused, (IntPtr) Unused); } /// Set the foreground colour of additional carets. (Scintilla feature 2604) public void SetAdditionalCaretFore(Colour fore) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETFORE, fore.Value, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETFORE, fore.Value, (IntPtr) Unused); } /// Get the foreground colour of additional carets. (Scintilla feature 2605) public Colour GetAdditionalCaretFore() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETFORE, Unused, Unused); - return new Colour((int) res); + return new Colour((int) Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALCARETFORE, (IntPtr) Unused, (IntPtr) Unused)); } /// Set the main selection to the next selection. (Scintilla feature 2606) public void RotateSelection() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ROTATESELECTION, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_ROTATESELECTION, (IntPtr) Unused, (IntPtr) Unused); } /// Swap that caret and anchor of the main selection. (Scintilla feature 2607) public void SwapMainAnchorCaret() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SWAPMAINANCHORCARET, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SWAPMAINANCHORCARET, (IntPtr) Unused, (IntPtr) Unused); + } + + /// + /// Add the next occurrence of the main selection to the set of selections as main. + /// If the current selection is empty then select word around caret. + /// (Scintilla feature 2688) + /// + public void MultipleSelectAddNext() + { + Win32.SendMessage(scintilla, SciMsg.SCI_MULTIPLESELECTADDNEXT, (IntPtr) Unused, (IntPtr) Unused); + } + + /// + /// Add each occurrence of the main selection in the target to the set of selections. + /// If the current selection is empty then select word around caret. + /// (Scintilla feature 2689) + /// + public void MultipleSelectAddEach() + { + Win32.SendMessage(scintilla, SciMsg.SCI_MULTIPLESELECTADDEACH, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -4628,10 +4561,9 @@ public void SwapMainAnchorCaret() /// there may be a need to redraw. /// (Scintilla feature 2617) /// - public int ChangeLexerState(Position start, Position end) + public int ChangeLexerState(int start, int end) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHANGELEXERSTATE, start.Value, end.Value); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_CHANGELEXERSTATE, (IntPtr) start, (IntPtr) end); } /// @@ -4641,57 +4573,55 @@ public int ChangeLexerState(Position start, Position end) /// public int ContractedFoldNext(int lineStart) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CONTRACTEDFOLDNEXT, lineStart, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_CONTRACTEDFOLDNEXT, (IntPtr) lineStart, (IntPtr) Unused); } /// Centre current line in window. (Scintilla feature 2619) public void VerticalCentreCaret() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VERTICALCENTRECARET, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_VERTICALCENTRECARET, (IntPtr) Unused, (IntPtr) Unused); } /// Move the selected lines up one line, shifting the line above after the selection (Scintilla feature 2620) public void MoveSelectedLinesUp() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MOVESELECTEDLINESUP, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_MOVESELECTEDLINESUP, (IntPtr) Unused, (IntPtr) Unused); } /// Move the selected lines down one line, shifting the line below before the selection (Scintilla feature 2621) public void MoveSelectedLinesDown() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MOVESELECTEDLINESDOWN, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_MOVESELECTEDLINESDOWN, (IntPtr) Unused, (IntPtr) Unused); } - /// Set the identifier reported as IdFrom in notification messages. (Scintilla feature 2622) + /// Set the identifier reported as idFrom in notification messages. (Scintilla feature 2622) public void SetIdentifier(int identifier) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETIDENTIFIER, identifier, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETIDENTIFIER, (IntPtr) identifier, (IntPtr) Unused); } /// Get the identifier. (Scintilla feature 2623) public int GetIdentifier() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETIDENTIFIER, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETIDENTIFIER, (IntPtr) Unused, (IntPtr) Unused); } /// Set the width for future RGBA image data. (Scintilla feature 2624) public void RGBAImageSetWidth(int width) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETWIDTH, width, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETWIDTH, (IntPtr) width, (IntPtr) Unused); } /// Set the height for future RGBA image data. (Scintilla feature 2625) public void RGBAImageSetHeight(int height) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETHEIGHT, height, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETHEIGHT, (IntPtr) height, (IntPtr) Unused); } /// Set the scale factor in percent for future RGBA image data. (Scintilla feature 2651) public void RGBAImageSetScale(int scalePercent) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETSCALE, scalePercent, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_RGBAIMAGESETSCALE, (IntPtr) scalePercent, (IntPtr) Unused); } /// @@ -4703,7 +4633,7 @@ public unsafe void MarkerDefineRGBAImage(int markerNumber, string pixels) { fixed (byte* pixelsPtr = Encoding.UTF8.GetBytes(pixels)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINERGBAIMAGE, markerNumber, (IntPtr) pixelsPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINERGBAIMAGE, (IntPtr) markerNumber, (IntPtr) pixelsPtr); } } @@ -4716,58 +4646,56 @@ public unsafe void RegisterRGBAImage(int type, string pixels) { fixed (byte* pixelsPtr = Encoding.UTF8.GetBytes(pixels)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REGISTERRGBAIMAGE, type, (IntPtr) pixelsPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_REGISTERRGBAIMAGE, (IntPtr) type, (IntPtr) pixelsPtr); } } /// Scroll to start of document. (Scintilla feature 2628) public void ScrollToStart() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLTOSTART, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLTOSTART, (IntPtr) Unused, (IntPtr) Unused); } /// Scroll to end of document. (Scintilla feature 2629) public void ScrollToEnd() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLTOEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLTOEND, (IntPtr) Unused, (IntPtr) Unused); } /// Set the technology used. (Scintilla feature 2630) - public void SetTechnology(int technology) + public void SetTechnology(Technology technology) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTECHNOLOGY, technology, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETTECHNOLOGY, (IntPtr) technology, (IntPtr) Unused); } /// Get the tech. (Scintilla feature 2631) - public int GetTechnology() + public Technology GetTechnology() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTECHNOLOGY, Unused, Unused); - return (int) res; + return (Technology)Win32.SendMessage(scintilla, SciMsg.SCI_GETTECHNOLOGY, (IntPtr) Unused, (IntPtr) Unused); } /// Create an ILoader*. (Scintilla feature 2632) - public int CreateLoader(int bytes) + public IntPtr CreateLoader(int bytes, DocumentOption documentOptions) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CREATELOADER, bytes, Unused); - return (int) res; + return Win32.SendMessage(scintilla, SciMsg.SCI_CREATELOADER, (IntPtr) bytes, (IntPtr) documentOptions); } /// On OS X, show a find indicator. (Scintilla feature 2640) - public void FindIndicatorShow(Position start, Position end) + public void FindIndicatorShow(int start, int end) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORSHOW, start.Value, end.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORSHOW, (IntPtr) start, (IntPtr) end); } /// On OS X, flash a find indicator, then fade out. (Scintilla feature 2641) - public void FindIndicatorFlash(Position start, Position end) + public void FindIndicatorFlash(int start, int end) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORFLASH, start.Value, end.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORFLASH, (IntPtr) start, (IntPtr) end); } /// On OS X, hide the find indicator. (Scintilla feature 2642) public void FindIndicatorHide() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORHIDE, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORHIDE, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -4777,46 +4705,43 @@ public void FindIndicatorHide() /// public void VCHomeDisplay() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEDISPLAY, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEDISPLAY, (IntPtr) Unused, (IntPtr) Unused); } /// Like VCHomeDisplay but extending selection to new caret position. (Scintilla feature 2653) public void VCHomeDisplayExtend() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEDISPLAYEXTEND, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEDISPLAYEXTEND, (IntPtr) Unused, (IntPtr) Unused); } /// Is the caret line always visible? (Scintilla feature 2654) public bool GetCaretLineVisibleAlways() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEVISIBLEALWAYS, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEVISIBLEALWAYS, (IntPtr) Unused, (IntPtr) Unused); } /// Sets the caret line to always visible. (Scintilla feature 2655) public void SetCaretLineVisibleAlways(bool alwaysVisible) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEVISIBLEALWAYS, alwaysVisible ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEVISIBLEALWAYS, new IntPtr(alwaysVisible ? 1 : 0), (IntPtr) Unused); } /// Set the line end types that the application wants to use. May not be used if incompatible with lexer or encoding. (Scintilla feature 2656) - public void SetLineEndTypesAllowed(int lineEndBitSet) + public void SetLineEndTypesAllowed(LineEndType lineEndBitSet) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINEENDTYPESALLOWED, lineEndBitSet, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETLINEENDTYPESALLOWED, (IntPtr) lineEndBitSet, (IntPtr) Unused); } /// Get the line end types currently allowed. (Scintilla feature 2657) - public int GetLineEndTypesAllowed() + public LineEndType GetLineEndTypesAllowed() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESALLOWED, Unused, Unused); - return (int) res; + return (LineEndType)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESALLOWED, (IntPtr) Unused, (IntPtr) Unused); } /// Get the line end types currently recognised. May be a subset of the allowed types due to lexer limitation. (Scintilla feature 2658) - public int GetLineEndTypesActive() + public LineEndType GetLineEndTypesActive() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESACTIVE, Unused, Unused); - return (int) res; + return (LineEndType)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESACTIVE, (IntPtr) Unused, (IntPtr) Unused); } /// Set the way a character is drawn. (Scintilla feature 2665) @@ -4826,7 +4751,7 @@ public unsafe void SetRepresentation(string encodedCharacter, string representat { fixed (byte* representationPtr = Encoding.UTF8.GetBytes(representation)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) representationPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_SETREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) representationPtr); } } } @@ -4843,7 +4768,7 @@ public unsafe string GetRepresentation(string encodedCharacter) byte[] representationBuffer = new byte[10000]; fixed (byte* representationPtr = representationBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) representationPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_GETREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) representationPtr); return Encoding.UTF8.GetString(representationBuffer).TrimEnd('\0'); } } @@ -4854,39 +4779,38 @@ public unsafe void ClearRepresentation(string encodedCharacter) { fixed (byte* encodedCharacterPtr = Encoding.UTF8.GetBytes(encodedCharacter)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARREPRESENTATION, (IntPtr) encodedCharacterPtr, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_CLEARREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) Unused); } } /// Start notifying the container of all key presses and commands. (Scintilla feature 3001) public void StartRecord() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STARTRECORD, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_STARTRECORD, (IntPtr) Unused, (IntPtr) Unused); } /// Stop notifying the container of all key presses and commands. (Scintilla feature 3002) public void StopRecord() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STOPRECORD, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_STOPRECORD, (IntPtr) Unused, (IntPtr) Unused); } /// Set the lexing language of the document. (Scintilla feature 4001) public void SetLexer(int lexer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLEXER, lexer, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETLEXER, (IntPtr) lexer, (IntPtr) Unused); } /// Retrieve the lexing language of the document. (Scintilla feature 4002) public int GetLexer() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLEXER, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLEXER, (IntPtr) Unused, (IntPtr) Unused); } /// Colourise a segment of the document using the current lexing language. (Scintilla feature 4003) - public void Colourise(Position start, Position end) + public void Colourise(int start, int end) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COLOURISE, start.Value, end.Value); + Win32.SendMessage(scintilla, SciMsg.SCI_COLOURISE, (IntPtr) start, (IntPtr) end); } /// Set up a value that may be used by a lexer for some optional feature. (Scintilla feature 4004) @@ -4896,17 +4820,17 @@ public unsafe void SetProperty(string key, string value) { fixed (byte* valuePtr = Encoding.UTF8.GetBytes(value)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPROPERTY, (IntPtr) keyPtr, (IntPtr) valuePtr); + Win32.SendMessage(scintilla, SciMsg.SCI_SETPROPERTY, (IntPtr) keyPtr, (IntPtr) valuePtr); } } } /// Set up the key words used by the lexer. (Scintilla feature 4005) - public unsafe void SetKeyWords(int keywordSet, string keyWords) + public unsafe void SetKeyWords(int keyWordSet, string keyWords) { fixed (byte* keyWordsPtr = Encoding.UTF8.GetBytes(keyWords)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETKEYWORDS, keywordSet, (IntPtr) keyWordsPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_SETKEYWORDS, (IntPtr) keyWordSet, (IntPtr) keyWordsPtr); } } @@ -4915,7 +4839,7 @@ public unsafe void SetLexerLanguage(string language) { fixed (byte* languagePtr = Encoding.UTF8.GetBytes(language)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLEXERLANGUAGE, Unused, (IntPtr) languagePtr); + Win32.SendMessage(scintilla, SciMsg.SCI_SETLEXERLANGUAGE, (IntPtr) Unused, (IntPtr) languagePtr); } } @@ -4924,7 +4848,7 @@ public unsafe void LoadLexerLibrary(string path) { fixed (byte* pathPtr = Encoding.UTF8.GetBytes(path)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LOADLEXERLIBRARY, Unused, (IntPtr) pathPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_LOADLEXERLIBRARY, (IntPtr) Unused, (IntPtr) pathPtr); } } @@ -4937,11 +4861,11 @@ public unsafe string GetProperty(string key) { fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key)) { - byte[] bufBuffer = new byte[10000]; - fixed (byte* bufPtr = bufBuffer) + byte[] valueBuffer = new byte[10000]; + fixed (byte* valuePtr = valueBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTY, (IntPtr) keyPtr, (IntPtr) bufPtr); - return Encoding.UTF8.GetString(bufBuffer).TrimEnd('\0'); + Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTY, (IntPtr) keyPtr, (IntPtr) valuePtr); + return Encoding.UTF8.GetString(valueBuffer).TrimEnd('\0'); } } } @@ -4956,11 +4880,11 @@ public unsafe string GetPropertyExpanded(string key) { fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key)) { - byte[] bufBuffer = new byte[10000]; - fixed (byte* bufPtr = bufBuffer) + byte[] valueBuffer = new byte[10000]; + fixed (byte* valuePtr = valueBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTYEXPANDED, (IntPtr) keyPtr, (IntPtr) bufPtr); - return Encoding.UTF8.GetString(bufBuffer).TrimEnd('\0'); + Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTYEXPANDED, (IntPtr) keyPtr, (IntPtr) valuePtr); + return Encoding.UTF8.GetString(valueBuffer).TrimEnd('\0'); } } } @@ -4970,22 +4894,14 @@ public unsafe string GetPropertyExpanded(string key) /// interpreted as an int AFTER any "$()" variable replacement. /// (Scintilla feature 4010) /// - public unsafe int GetPropertyInt(string key) + public unsafe int GetPropertyInt(string key, int defaultValue) { fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTYINT, (IntPtr) keyPtr, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTYINT, (IntPtr) keyPtr, (IntPtr) defaultValue); } } - /// Retrieve the number of bits the current lexer needs for styling. (Scintilla feature 4011) - public int GetStyleBitsNeeded() - { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEBITSNEEDED, Unused, Unused); - return (int) res; - } - /// /// Retrieve the name of the lexer. /// Return the length of the text. @@ -4994,19 +4910,18 @@ public int GetStyleBitsNeeded() /// public unsafe string GetLexerLanguage() { - byte[] textBuffer = new byte[10000]; - fixed (byte* textPtr = textBuffer) + byte[] languageBuffer = new byte[10000]; + fixed (byte* languagePtr = languageBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLEXERLANGUAGE, Unused, (IntPtr) textPtr); - return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); + Win32.SendMessage(scintilla, SciMsg.SCI_GETLEXERLANGUAGE, (IntPtr) Unused, (IntPtr) languagePtr); + return Encoding.UTF8.GetString(languageBuffer).TrimEnd('\0'); } } /// For private communication between an application and a known lexer. (Scintilla feature 4013) - public int PrivateLexerCall(int operation, int pointer) + public IntPtr PrivateLexerCall(int operation, IntPtr pointer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PRIVATELEXERCALL, operation, pointer); - return (int) res; + return Win32.SendMessage(scintilla, SciMsg.SCI_PRIVATELEXERCALL, (IntPtr) operation, (IntPtr) pointer); } /// @@ -5019,18 +4934,17 @@ public unsafe string PropertyNames() byte[] namesBuffer = new byte[10000]; fixed (byte* namesPtr = namesBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PROPERTYNAMES, Unused, (IntPtr) namesPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_PROPERTYNAMES, (IntPtr) Unused, (IntPtr) namesPtr); return Encoding.UTF8.GetString(namesBuffer).TrimEnd('\0'); } } /// Retrieve the type of a property. (Scintilla feature 4015) - public unsafe int PropertyType(string name) + public unsafe TypeProperty PropertyType(string name) { fixed (byte* namePtr = Encoding.UTF8.GetBytes(name)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PROPERTYTYPE, (IntPtr) namePtr, Unused); - return (int) res; + return (TypeProperty)Win32.SendMessage(scintilla, SciMsg.SCI_PROPERTYTYPE, (IntPtr) namePtr, (IntPtr) Unused); } } @@ -5046,7 +4960,7 @@ public unsafe string DescribeProperty(string name) byte[] descriptionBuffer = new byte[10000]; fixed (byte* descriptionPtr = descriptionBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIBEPROPERTY, (IntPtr) namePtr, (IntPtr) descriptionPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIBEPROPERTY, (IntPtr) namePtr, (IntPtr) descriptionPtr); return Encoding.UTF8.GetString(descriptionBuffer).TrimEnd('\0'); } } @@ -5062,7 +4976,7 @@ public unsafe string DescribeKeyWordSets() byte[] descriptionsBuffer = new byte[10000]; fixed (byte* descriptionsPtr = descriptionsBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIBEKEYWORDSETS, Unused, (IntPtr) descriptionsPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIBEKEYWORDSETS, (IntPtr) Unused, (IntPtr) descriptionsPtr); return Encoding.UTF8.GetString(descriptionsBuffer).TrimEnd('\0'); } } @@ -5074,49 +4988,43 @@ public unsafe string DescribeKeyWordSets() /// public int GetLineEndTypesSupported() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESSUPPORTED, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESSUPPORTED, (IntPtr) Unused, (IntPtr) Unused); } /// Allocate a set of sub styles for a particular base style, returning start of range (Scintilla feature 4020) public int AllocateSubStyles(int styleBase, int numberStyles) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATESUBSTYLES, styleBase, numberStyles); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATESUBSTYLES, (IntPtr) styleBase, (IntPtr) numberStyles); } /// The starting style number for the sub styles associated with a base style (Scintilla feature 4021) public int GetSubStylesStart(int styleBase) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLESSTART, styleBase, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLESSTART, (IntPtr) styleBase, (IntPtr) Unused); } /// The number of sub styles associated with a base style (Scintilla feature 4022) public int GetSubStylesLength(int styleBase) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLESLENGTH, styleBase, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLESLENGTH, (IntPtr) styleBase, (IntPtr) Unused); } /// For a sub style, return the base style, else return the argument. (Scintilla feature 4027) public int GetStyleFromSubStyle(int subStyle) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEFROMSUBSTYLE, subStyle, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEFROMSUBSTYLE, (IntPtr) subStyle, (IntPtr) Unused); } /// For a secondary style, return the primary style, else return the argument. (Scintilla feature 4028) public int GetPrimaryStyleFromStyle(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRIMARYSTYLEFROMSTYLE, style, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETPRIMARYSTYLEFROMSTYLE, (IntPtr) style, (IntPtr) Unused); } /// Free allocated sub styles (Scintilla feature 4023) public void FreeSubStyles() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FREESUBSTYLES, Unused, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_FREESUBSTYLES, (IntPtr) Unused, (IntPtr) Unused); } /// Set the identifiers that are shown in a particular style (Scintilla feature 4024) @@ -5124,7 +5032,7 @@ public unsafe void SetIdentifiers(int style, string identifiers) { fixed (byte* identifiersPtr = Encoding.UTF8.GetBytes(identifiers)) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETIDENTIFIERS, style, (IntPtr) identifiersPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_SETIDENTIFIERS, (IntPtr) style, (IntPtr) identifiersPtr); } } @@ -5135,8 +5043,7 @@ public unsafe void SetIdentifiers(int style, string identifiers) /// public int DistanceToSecondaryStyles() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DISTANCETOSECONDARYSTYLES, Unused, Unused); - return (int) res; + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_DISTANCETOSECONDARYSTYLES, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -5149,30 +5056,125 @@ public unsafe string GetSubStyleBases() byte[] stylesBuffer = new byte[10000]; fixed (byte* stylesPtr = stylesBuffer) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLEBASES, Unused, (IntPtr) stylesPtr); + Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLEBASES, (IntPtr) Unused, (IntPtr) stylesPtr); return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0'); } } + /// Retrieve the number of named styles for the lexer. (Scintilla feature 4029) + public int GetNamedStyles() + { + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETNAMEDSTYLES, (IntPtr) Unused, (IntPtr) Unused); + } + /// - /// Deprecated in 2.30 - /// In palette mode? - /// (Scintilla feature 2139) + /// Retrieve the name of a style. + /// Result is NUL-terminated. + /// (Scintilla feature 4030) + /// + public unsafe string NameOfStyle(int style) + { + byte[] nameBuffer = new byte[10000]; + fixed (byte* namePtr = nameBuffer) + { + Win32.SendMessage(scintilla, SciMsg.SCI_NAMEOFSTYLE, (IntPtr) style, (IntPtr) namePtr); + return Encoding.UTF8.GetString(nameBuffer).TrimEnd('\0'); + } + } + + /// + /// Retrieve a ' ' separated list of style tags like "literal quoted string". + /// Result is NUL-terminated. + /// (Scintilla feature 4031) /// - public bool GetUsePalette() + public unsafe string TagsOfStyle(int style) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETUSEPALETTE, Unused, Unused); - return 1 == (int) res; + byte[] tagsBuffer = new byte[10000]; + fixed (byte* tagsPtr = tagsBuffer) + { + Win32.SendMessage(scintilla, SciMsg.SCI_TAGSOFSTYLE, (IntPtr) style, (IntPtr) tagsPtr); + return Encoding.UTF8.GetString(tagsBuffer).TrimEnd('\0'); + } } /// - /// In palette mode, Scintilla uses the environment's palette calls to display - /// more colours. This may lead to ugly displays. - /// (Scintilla feature 2039) + /// Retrieve a description of a style. + /// Result is NUL-terminated. + /// (Scintilla feature 4032) /// - public void SetUsePalette(bool usePalette) + public unsafe string DescriptionOfStyle(int style) + { + byte[] descriptionBuffer = new byte[10000]; + fixed (byte* descriptionPtr = descriptionBuffer) + { + Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIPTIONOFSTYLE, (IntPtr) style, (IntPtr) descriptionPtr); + return Encoding.UTF8.GetString(descriptionBuffer).TrimEnd('\0'); + } + } + + /// Retrieve bidirectional text display state. (Scintilla feature 2708) + public Bidirectional GetBidirectional() + { + return (Bidirectional)Win32.SendMessage(scintilla, SciMsg.SCI_GETBIDIRECTIONAL, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Set bidirectional text display state. (Scintilla feature 2709) + public void SetBidirectional(Bidirectional bidirectional) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETBIDIRECTIONAL, (IntPtr) bidirectional, (IntPtr) Unused); + } + + /// Retrieve line character index state. (Scintilla feature 2710) + public LineCharacterIndexType GetLineCharacterIndex() + { + return (LineCharacterIndexType)Win32.SendMessage(scintilla, SciMsg.SCI_GETLINECHARACTERINDEX, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Request line character index be created or its use count increased. (Scintilla feature 2711) + public void AllocateLineCharacterIndex(LineCharacterIndexType lineCharacterIndex) + { + Win32.SendMessage(scintilla, SciMsg.SCI_ALLOCATELINECHARACTERINDEX, (IntPtr) lineCharacterIndex, (IntPtr) Unused); + } + + /// Decrease use count of line character index and remove if 0. (Scintilla feature 2712) + public void ReleaseLineCharacterIndex(LineCharacterIndexType lineCharacterIndex) + { + Win32.SendMessage(scintilla, SciMsg.SCI_RELEASELINECHARACTERINDEX, (IntPtr) lineCharacterIndex, (IntPtr) Unused); + } + + /// Retrieve the document line containing a position measured in index units. (Scintilla feature 2713) + public int LineFromIndexPosition(int pos, LineCharacterIndexType lineCharacterIndex) + { + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_LINEFROMINDEXPOSITION, (IntPtr) pos, (IntPtr) lineCharacterIndex); + } + + /// Retrieve the position measured in index units at the start of a document line. (Scintilla feature 2714) + public int IndexPositionFromLine(int line, LineCharacterIndexType lineCharacterIndex) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUSEPALETTE, usePalette ? 1 : 0, Unused); + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_INDEXPOSITIONFROMLINE, (IntPtr) line, (IntPtr) lineCharacterIndex); + } + + /// + /// 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) + /// + public void SetStyleBits(int bits) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLEBITS, (IntPtr) bits, (IntPtr) Unused); + } + + /// Retrieve number of bits in style bytes used to hold the lexical state. (Scintilla feature 2091) + public int GetStyleBits() + { + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEBITS, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Retrieve the number of bits the current lexer needs for styling. (Scintilla feature 4011) + public int GetStyleBitsNeeded() + { + return (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEBITSNEEDED, (IntPtr) Unused, (IntPtr) Unused); } /// @@ -5182,14 +5184,29 @@ public void SetUsePalette(bool usePalette) /// public void SetKeysUnicode(bool keysUnicode) { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETKEYSUNICODE, keysUnicode ? 1 : 0, Unused); + Win32.SendMessage(scintilla, SciMsg.SCI_SETKEYSUNICODE, new IntPtr(keysUnicode ? 1 : 0), (IntPtr) Unused); } /// Are keys always interpreted as Unicode? (Scintilla feature 2522) public bool GetKeysUnicode() { - IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETKEYSUNICODE, Unused, Unused); - return 1 == (int) res; + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETKEYSUNICODE, (IntPtr) Unused, (IntPtr) Unused); + } + + /// Is drawing done in two phases with backgrounds drawn before foregrounds? (Scintilla feature 2283) + public bool GetTwoPhaseDraw() + { + return 1 == (int)Win32.SendMessage(scintilla, SciMsg.SCI_GETTWOPHASEDRAW, (IntPtr) Unused, (IntPtr) Unused); + } + + /// + /// 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) + /// + public void SetTwoPhaseDraw(bool twoPhase) + { + Win32.SendMessage(scintilla, SciMsg.SCI_SETTWOPHASEDRAW, new IntPtr(twoPhase ? 1 : 0), (IntPtr) Unused); } /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ diff --git a/WakaTime/PluginInfrastructure/Scintilla_iface.cs b/WakaTime/PluginInfrastructure/Scintilla_iface.cs index cc84383..945c0cf 100644 --- a/WakaTime/PluginInfrastructure/Scintilla_iface.cs +++ b/WakaTime/PluginInfrastructure/Scintilla_iface.cs @@ -21,7 +21,7 @@ public struct ScNotificationHeader /// /// environment specific window handle/pointer /// - public IntPtr hwndFrom; + public IntPtr hwndFrom; /// /// CtrlID of the window issuing the notification @@ -31,7 +31,7 @@ public struct ScNotificationHeader /// /// The SCN_* notification Code /// - public uint Code; + public uint Code; } [StructLayout(LayoutKind.Sequential)] @@ -160,6 +160,8 @@ public enum SciMsg : uint SCWS_VISIBLEAFTERINDENT = 2, + SCWS_VISIBLEONLYININDENT = 3, + /// Are white space characters currently visible? /// Returns one of SCWS_* constants. SCI_GETVIEWWS = 2020, @@ -167,6 +169,17 @@ public enum SciMsg : uint /// Make white space characters invisible, always visible or visible outside indentation. SCI_SETVIEWWS = 2021, + SCTD_LONGARROW = 0, + + SCTD_STRIKEOUT = 1, + + /// Retrieve the current tab draw mode. + /// Returns one of SCTD_* constants. + SCI_GETTABDRAWMODE = 2698, + + /// Set how tabs are drawn when visible. + SCI_SETTABDRAWMODE = 2699, + /// Find the position from a point within the window. SCI_POSITIONFROMPOINT = 2022, @@ -207,8 +220,8 @@ public enum SciMsg : uint /// Set the current end of line mode. SCI_SETEOLMODE = 2031, - /// 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. + /// Set the current styling position to start. + /// The unused parameter is no longer used and should be set to 0. SCI_STARTSTYLING = 2032, /// Change style from current styling position for length characters to a style @@ -247,7 +260,7 @@ public enum SciMsg : uint SC_IME_INLINE = 1, - /// Is the IME displayed in a winow or inline? + /// Is the IME displayed in a window or inline? SCI_GETIMEINTERACTION = 2678, /// Choose to display the the IME in a winow or inline. @@ -319,6 +332,8 @@ public enum SciMsg : uint SC_MARK_BOOKMARK = 31, + SC_MARK_VERTICALBOOKMARK = 32, + SC_MARK_CHARACTER = 10000, SC_MARKNUM_FOLDEREND = 25, @@ -394,6 +409,8 @@ public enum SciMsg : uint SC_MARGIN_RTEXT = 5, + SC_MARGIN_COLOUR = 6, + /// Set a margin to be either numeric or symbolic. SCI_SETMARGINTYPEN = 2240, @@ -424,6 +441,18 @@ public enum SciMsg : uint /// Retrieve the cursor shown in a margin. SCI_GETMARGINCURSORN = 2249, + /// Set the background colour of a margin. Only visible for SC_MARGIN_COLOUR. + SCI_SETMARGINBACKN = 2250, + + /// Retrieve the background colour of a margin + SCI_GETMARGINBACKN = 2251, + + /// Allocate a non-standard number of margins. + SCI_SETMARGINS = 2252, + + /// How many margins are there?. + SCI_GETMARGINS = 2253, + STYLE_DEFAULT = 32, STYLE_LINENUMBER = 33, @@ -438,6 +467,8 @@ public enum SciMsg : uint STYLE_CALLTIP = 38, + STYLE_FOLDDISPLAYTEXT = 39, + STYLE_LASTPREDEFINED = 39, STYLE_MAX = 255, @@ -464,6 +495,8 @@ public enum SciMsg : uint SC_CHARSET_RUSSIAN = 204, + SC_CHARSET_OEM866 = 866, + SC_CHARSET_CYRILLIC = 1251, SC_CHARSET_SHIFTJIS = 128, @@ -520,6 +553,8 @@ public enum SciMsg : uint SC_CASE_LOWER = 2, + SC_CASE_CAMEL = 3, + /// Get the foreground colour of a style. SCI_STYLEGETFORE = 2481, @@ -612,10 +647,10 @@ public enum SciMsg : uint /// Set the foreground colour of the caret. SCI_SETCARETFORE = 2069, - /// When key+modifier combination km is pressed perform msg. + /// When key+modifier combination keyDefinition is pressed perform sciCommand. SCI_ASSIGNCMDKEY = 2070, - /// When key+modifier combination km is pressed do nothing. + /// When key+modifier combination keyDefinition is pressed do nothing. SCI_CLEARCMDKEY = 2071, /// Drop all key mappings. @@ -641,6 +676,12 @@ public enum SciMsg : uint /// Returns the number of characters SCI_GETWORDCHARS = 2646, + /// Set the number of characters to have directly indexed categories + SCI_SETCHARACTERCATEGORYOPTIMIZATION = 2720, + + /// Get the number of characters to have directly indexed categories + SCI_GETCHARACTERCATEGORYOPTIMIZATION = 2721, + /// Start a sequence of actions that is undone and redone as a unit. /// May be nested. SCI_BEGINUNDOACTION = 2078, @@ -684,21 +725,29 @@ public enum SciMsg : uint INDIC_TEXTFORE = 17, + INDIC_POINT = 18, + + INDIC_POINTCHARACTER = 19, + + INDIC_GRADIENT = 20, + + INDIC_GRADIENTCENTRE = 21, + + INDIC_CONTAINER = 8, + INDIC_IME = 32, INDIC_IME_MAX = 35, INDIC_MAX = 35, - INDIC_CONTAINER = 8, + INDICATOR_CONTAINER = 8, - INDIC0_MASK = 0x20, - - INDIC1_MASK = 0x40, + INDICATOR_IME = 32, - INDIC2_MASK = 0x80, + INDICATOR_IME_MAX = 35, - INDICS_MASK = 0xE0, + INDICATOR_MAX = 35, /// Set an indicator to plain, squiggle or TT. SCI_INDICSETSTYLE = 2080, @@ -754,14 +803,6 @@ public enum SciMsg : uint /// Get the size of the dots used to mark space characters. SCI_GETWHITESPACESIZE = 2087, - /// 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. - SCI_SETSTYLEBITS = 2090, - - /// Retrieve number of bits in style bytes used to hold the lexical state. - SCI_GETSTYLEBITS = 2091, - /// Used to hold extra styling information for each line. SCI_SETLINESTATE = 2092, @@ -783,12 +824,20 @@ public enum SciMsg : uint /// Set the colour of the background of the line containing the caret. SCI_SETCARETLINEBACK = 2098, + /// Retrieve the caret line frame width. + /// Width = 0 means this option is disabled. + SCI_GETCARETLINEFRAME = 2704, + + /// Display the caret line framed. + /// Set width != 0 to enable this option and width = 0 to disable it. + SCI_SETCARETLINEFRAME = 2705, + /// Set a style to be changeable or not (read only). /// Experimental feature, currently buggy. SCI_STYLESETCHANGEABLE = 2099, /// Display a auto-completion list. - /// The lenEntered parameter indicates how many characters before + /// The lengthEntered parameter indicates how many characters before /// the caret should be used to provide context. SCI_AUTOCSHOW = 2100, @@ -912,6 +961,9 @@ public enum SciMsg : uint /// Count characters between two positions. SCI_COUNTCHARACTERS = 2633, + /// Count code units between two positions. + SCI_COUNTCODEUNITS = 2715, + /// Show or hide the horizontal scroll bar. SCI_SETHSCROLLBAR = 2130, @@ -960,7 +1012,7 @@ public enum SciMsg : uint /// Returns the position at the start of the selection. SCI_GETSELECTIONSTART = 2143, - /// Sets the position that ends the selection - this becomes the currentPosition. + /// Sets the position that ends the selection - this becomes the caret. SCI_SETSELECTIONEND = 2144, /// Returns the position at the end of the selection. @@ -985,12 +1037,16 @@ public enum SciMsg : uint SC_PRINT_COLOURONWHITEDEFAULTBG = 4, + SC_PRINT_SCREENCOLOURS = 5, + /// Modify colours when printing for clearer printed text. SCI_SETPRINTCOLOURMODE = 2148, /// Returns the print colour mode. SCI_GETPRINTCOLOURMODE = 2149, + SCFIND_NONE = 0x0, + SCFIND_WHOLEWORD = 0x2, SCFIND_MATCHCASE = 0x4, @@ -1046,7 +1102,7 @@ public enum SciMsg : uint /// Return the length of the text. SCI_GETTEXTRANGE = 2162, - /// Draw the selection in normal style or with selection highlighted. + /// Draw the selection either highlighted or in normal (non-highlighted) style. SCI_HIDESELECTION = 2163, /// Retrieve the x value of the point in the window where a position is displayed. @@ -1155,6 +1211,12 @@ public enum SciMsg : uint /// Retrieve the text in the target. SCI_GETTARGETTEXT = 2687, + /// Make the target range start and end be the same as the selection range start and end. + SCI_TARGETFROMSELECTION = 2287, + + /// Sets the target to the whole document. + SCI_TARGETWHOLEDOCUMENT = 2690, + /// Replace the target text with the argument text. /// Text is counted so it can contain NULs. /// Returns the length of the replacement text. @@ -1170,7 +1232,7 @@ public enum SciMsg : uint /// 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. + /// Returns start of found range or -1 for failure in which case target is not moved. SCI_SEARCHINTARGET = 2197, /// Set the search flags used by SearchInTarget. @@ -1264,6 +1326,27 @@ public enum SciMsg : uint /// Switch a header line between expanded and contracted. SCI_TOGGLEFOLD = 2231, + /// Switch a header line between expanded and contracted and show some text after the line. + SCI_TOGGLEFOLDSHOWTEXT = 2700, + + SC_FOLDDISPLAYTEXT_HIDDEN = 0, + + SC_FOLDDISPLAYTEXT_STANDARD = 1, + + SC_FOLDDISPLAYTEXT_BOXED = 2, + + /// Set the style of fold display text. + SCI_FOLDDISPLAYTEXTSETSTYLE = 2701, + + /// Get the style of fold display text. + SCI_FOLDDISPLAYTEXTGETSTYLE = 2707, + + /// Set the default fold display text. + SCI_SETDEFAULTFOLDDISPLAYTEXT = 2722, + + /// Get the default fold display text. + SCI_GETDEFAULTFOLDDISPLAYTEXT = 2723, + SC_FOLDACTION_CONTRACT = 0, SC_FOLDACTION_EXPAND = 1, @@ -1342,6 +1425,23 @@ public enum SciMsg : uint /// Get position of end of word. SCI_WORDENDPOSITION = 2267, + /// Is the range start..end considered a word? + SCI_ISRANGEWORD = 2691, + + SC_IDLESTYLING_NONE = 0, + + SC_IDLESTYLING_TOVISIBLE = 1, + + SC_IDLESTYLING_AFTERVISIBLE = 2, + + SC_IDLESTYLING_ALL = 3, + + /// Sets limits to idle styling. + SCI_SETIDLESTYLING = 2692, + + /// Retrieve the limits to idle styling. + SCI_GETIDLESTYLING = 2693, + SC_WRAP_NONE = 0, SC_WRAP_WORD = 1, @@ -1394,6 +1494,8 @@ public enum SciMsg : uint SC_WRAPINDENT_INDENT = 2, + SC_WRAPINDENT_DEEPINDENT = 3, + /// Sets how wrapped sublines are placed. Default is fixed. SCI_SETWRAPINDENTMODE = 2472, @@ -1452,13 +1554,6 @@ public enum SciMsg : uint /// Append a string to the end of the document without changing the selection. SCI_APPENDTEXT = 2282, - /// Is drawing done in two phases with backgrounds drawn before foregrounds? - SCI_GETTWOPHASEDRAW = 2283, - - /// 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. - SCI_SETTWOPHASEDRAW = 2284, - SC_PHASES_ONE = 0, SC_PHASES_TWO = 1, @@ -1500,16 +1595,13 @@ public enum SciMsg : uint /// Change the effect of pasting when there are multiple selections. SCI_SETMULTIPASTE = 2614, - /// Retrieve the effect of pasting when there are multiple selections.. + /// Retrieve the effect of pasting when there are multiple selections. SCI_GETMULTIPASTE = 2615, /// Retrieve the value of a tag from a regular expression search. /// Result is NUL-terminated. SCI_GETTAG = 2616, - /// Make the target range start and end be the same as the selection range start and end. - SCI_TARGETFROMSELECTION = 2287, - /// Join the lines in the target. SCI_LINESJOIN = 2288, @@ -1517,12 +1609,22 @@ public enum SciMsg : uint /// where possible. SCI_LINESSPLIT = 2289, - /// Set the colours used as a chequerboard pattern in the fold margin + /// Set one of the colours used as a chequerboard pattern in the fold margin SCI_SETFOLDMARGINCOLOUR = 2290, - /// Set the colours used as a chequerboard pattern in the fold margin + /// Set the other colour used as a chequerboard pattern in the fold margin SCI_SETFOLDMARGINHICOLOUR = 2291, + SC_ACCESSIBILITY_DISABLED = 0, + + SC_ACCESSIBILITY_ENABLED = 1, + + /// Enable or disable accessibility. + SCI_SETACCESSIBILITY = 2702, + + /// Report accessibility status. + SCI_GETACCESSIBILITY = 2703, + /// Move caret down one line. SCI_LINEDOWN = 2300, @@ -1648,6 +1750,9 @@ public enum SciMsg : uint /// Switch the current line with the previous. SCI_LINETRANSPOSE = 2339, + /// Reverse order of selected lines. + SCI_LINEREVERSE = 2354, + /// Duplicate the current line. SCI_LINEDUPLICATE = 2404, @@ -1681,46 +1786,28 @@ public enum SciMsg : uint /// caret position. SCI_LINEENDDISPLAYEXTEND = 2348, - /// 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)?. + /// Like Home but when word-wrap is enabled goes first to start of display line + /// HomeDisplay, then to start of document line Home. SCI_HOMEWRAP = 2349, - /// 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)?. + /// Like HomeExtend but when word-wrap is enabled extends first to start of display line + /// HomeDisplayExtend, then to start of document line HomeExtend. SCI_HOMEWRAPEXTEND = 2450, - /// 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)?. + /// Like LineEnd but when word-wrap is enabled goes first to end of display line + /// LineEndDisplay, then to start of document line LineEnd. SCI_LINEENDWRAP = 2451, - /// 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)?. + /// Like LineEndExtend but when word-wrap is enabled extends first to end of display line + /// LineEndDisplayExtend, then to start of document line LineEndExtend. SCI_LINEENDWRAPEXTEND = 2452, - /// 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)?. + /// Like VCHome but when word-wrap is enabled goes first to start of display line + /// VCHomeDisplay, then behaves like VCHome. SCI_VCHOMEWRAP = 2453, - /// 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)?. + /// Like VCHomeExtend but when word-wrap is enabled extends first to start of display line + /// VCHomeDisplayExtend, then behaves like VCHomeExtend. SCI_VCHOMEWRAPEXTEND = 2454, /// Copy the line containing the caret. @@ -1745,6 +1832,7 @@ public enum SciMsg : uint SCI_BRACEBADLIGHTINDICATOR = 2499, /// Find the position of a matching brace or INVALID_POSITION if no match. + /// The maxReStyle must be 0 for now. It may be defined in a future release. SCI_BRACEMATCH = 2353, /// Are the end of line characters visible? @@ -1768,6 +1856,8 @@ public enum SciMsg : uint EDGE_BACKGROUND = 2, + EDGE_MULTILINE = 3, + /// Retrieve the column number which text should be kept within. SCI_GETEDGECOLUMN = 2360, @@ -1778,7 +1868,7 @@ public enum SciMsg : uint /// Retrieve the edge highlight mode. SCI_GETEDGEMODE = 2362, - /// The edge may be displayed by a line (EDGE_LINE) or by highlighting text that + /// The edge may be displayed by a line (EDGE_LINE/EDGE_MULTILINE) or by highlighting text that /// goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). SCI_SETEDGEMODE = 2363, @@ -1788,6 +1878,12 @@ public enum SciMsg : uint /// Change the colour used in edge indication. SCI_SETEDGECOLOUR = 2365, + /// Add a new vertical edge to the view. + SCI_MULTIEDGEADDLINE = 2694, + + /// Clear all vertical edges. + SCI_MULTIEDGECLEARALL = 2695, + /// Sets the current caret position to be the search anchor. SCI_SEARCHANCHOR = 2366, @@ -1802,8 +1898,14 @@ public enum SciMsg : uint /// Retrieves the number of lines completely visible. SCI_LINESONSCREEN = 2370, + SC_POPUP_NEVER = 0, + + SC_POPUP_ALL = 1, + + SC_POPUP_TEXT = 2, + /// Set whether a pop up menu is displayed automatically when the user presses - /// the wrong mouse button. + /// the wrong mouse button on certain areas. SCI_USEPOPUP = 2371, /// Is the selection rectangular? The alternative is the more common stream selection. @@ -1816,6 +1918,12 @@ public enum SciMsg : uint /// Retrieve the zoom level. SCI_GETZOOM = 2374, + SC_DOCUMENTOPTION_DEFAULT = 0, + + SC_DOCUMENTOPTION_STYLES_NONE = 0x1, + + SC_DOCUMENTOPTION_TEXT_LARGE = 0x100, + /// Create a new document object. /// Starts with reference count of 1 and not selected into editor. SCI_CREATEDOCUMENT = 2375, @@ -1826,9 +1934,18 @@ public enum SciMsg : uint /// Release a reference to the document, deleting document if it fades to black. SCI_RELEASEDOCUMENT = 2377, + /// Get which document options are set. + SCI_GETDOCUMENTOPTIONS = 2379, + /// Get which document modification events are sent to the container. SCI_GETMODEVENTMASK = 2378, + /// Set whether command events are sent to the container. + SCI_SETCOMMANDEVENTS = 2717, + + /// Get whether command events are sent to the container. + SCI_GETCOMMANDEVENTS = 2718, + /// Change internal focus flag. SCI_SETFOCUS = 2380, @@ -1857,6 +1974,12 @@ public enum SciMsg : uint /// Get whether mouse gets captured. SCI_GETMOUSEDOWNCAPTURES = 2385, + /// Set whether the mouse wheel can be active outside the window. + SCI_SETMOUSEWHEELCAPTURES = 2696, + + /// Get whether mouse wheel can be active outside the window. + SCI_GETMOUSEWHEELCAPTURES = 2697, + SC_CURSORNORMAL = 0xFFFFFFFF, SC_CURSORARROW = 2, @@ -1906,10 +2029,10 @@ public enum SciMsg : uint /// Delete forwards from the current position to the end of the line. SCI_DELLINERIGHT = 2396, - /// Get and Set the xOffset (ie, horizontal scroll position). + /// Set the xOffset (ie, horizontal scroll position). SCI_SETXOFFSET = 2397, - /// Get and Set the xOffset (ie, horizontal scroll position). + /// Get the xOffset (ie, horizontal scroll position). SCI_GETXOFFSET = 2398, /// Set the last x chosen value to be the caret x position. @@ -1964,16 +2087,16 @@ public enum SciMsg : uint /// Get the HotspotSingleLine property SCI_GETHOTSPOTSINGLELINE = 2497, - /// Move caret between paragraphs (delimited by empty lines). + /// Move caret down one paragraph (delimited by empty lines). SCI_PARADOWN = 2413, - /// Move caret between paragraphs (delimited by empty lines). + /// Extend selection down one paragraph (delimited by empty lines). SCI_PARADOWNEXTEND = 2414, - /// Move caret between paragraphs (delimited by empty lines). + /// Move caret up one paragraph (delimited by empty lines). SCI_PARAUP = 2415, - /// Move caret between paragraphs (delimited by empty lines). + /// Extend selection up one paragraph (delimited by empty lines). SCI_PARAUPEXTEND = 2416, /// Given a valid document position, return the previous position taking code @@ -1988,6 +2111,11 @@ public enum SciMsg : uint /// of characters. Returned value is always between 0 and last position in document. SCI_POSITIONRELATIVE = 2670, + /// Given a valid document position, return a position that differs in a number + /// of UTF-16 code units. Returned value is always between 0 and last position in document. + /// The result may point half way (2 bytes) inside a non-BMP character. + SCI_POSITIONRELATIVECODEUNITS = 2716, + /// Copy a range of text to the clipboard. Positions are clipped into the document. SCI_COPYRANGE = 2419, @@ -2009,6 +2137,9 @@ public enum SciMsg : uint /// Get the mode of the current selection. SCI_GETSELECTIONMODE = 2423, + /// Get whether or not regular caret moves will extend or reduce the selection. + SCI_GETMOVEEXTENDSSELECTION = 2706, + /// Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line). SCI_GETLINESELSTARTPOSITION = 2424, @@ -2110,7 +2241,7 @@ public enum SciMsg : uint /// Change the effect of autocompleting when there are multiple selections. SCI_AUTOCSETMULTI = 2636, - /// Retrieve the effect of autocompleting when there are multiple selections.. + /// Retrieve the effect of autocompleting when there are multiple selections. SCI_AUTOCGETMULTI = 2637, SC_ORDER_PRESORTED = 0, @@ -2187,6 +2318,14 @@ public enum SciMsg : uint CARETSTYLE_BLOCK = 2, + CARETSTYLE_OVERSTRIKE_BAR = 0, + + CARETSTYLE_OVERSTRIKE_BLOCK = 0x10, + + CARETSTYLE_INS_MASK = 0xF, + + CARETSTYLE_BLOCK_AFTER = 0x100, + /// Set the style of the caret to be drawn. SCI_SETCARETSTYLE = 2512, @@ -2211,10 +2350,10 @@ public enum SciMsg : uint /// Turn a indicator off over a range. SCI_INDICATORCLEARRANGE = 2505, - /// Are any indicators present at position? + /// Are any indicators present at pos? SCI_INDICATORALLONFOR = 2506, - /// What value does a particular indicator have at at a position? + /// What value does a particular indicator have at a position? SCI_INDICATORVALUEAT = 2507, /// Where does a particular indicator start? @@ -2238,7 +2377,7 @@ public enum SciMsg : uint /// 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. + /// to lengthRange bytes. SCI_GETRANGEPOINTER = 2643, /// Return a position which, to avoid performance costs, should not be within @@ -2359,6 +2498,8 @@ public enum SciMsg : uint /// Allocate some extended (>255) style numbers and return the start of the range SCI_ALLOCATEEXTENDEDSTYLES = 2553, + UNDO_NONE = 0, + UNDO_MAY_COALESCE = 1, /// Add a container action to the undo stack @@ -2425,28 +2566,28 @@ public enum SciMsg : uint /// Which selection is the main selection SCI_GETMAINSELECTION = 2575, - /// Which selection is the main selection + /// Set the caret position of the nth selection. SCI_SETSELECTIONNCARET = 2576, - /// Which selection is the main selection + /// Return the caret position of the nth selection. SCI_GETSELECTIONNCARET = 2577, - /// Which selection is the main selection + /// Set the anchor position of the nth selection. SCI_SETSELECTIONNANCHOR = 2578, - /// Which selection is the main selection + /// Return the anchor position of the nth selection. SCI_GETSELECTIONNANCHOR = 2579, - /// Which selection is the main selection + /// Set the virtual space of the caret of the nth selection. SCI_SETSELECTIONNCARETVIRTUALSPACE = 2580, - /// Which selection is the main selection + /// Return the virtual space of the caret of the nth selection. SCI_GETSELECTIONNCARETVIRTUALSPACE = 2581, - /// Which selection is the main selection + /// Set the virtual space of the anchor of the nth selection. SCI_SETSELECTIONNANCHORVIRTUALSPACE = 2582, - /// Which selection is the main selection + /// Return the virtual space of the anchor of the nth selection. SCI_GETSELECTIONNANCHORVIRTUALSPACE = 2583, /// Sets the position that starts the selection - this becomes the anchor. @@ -2461,28 +2602,28 @@ public enum SciMsg : uint /// Returns the position at the end of the selection. SCI_GETSELECTIONNEND = 2587, - /// Returns the position at the end of the selection. + /// Set the caret position of the rectangular selection. SCI_SETRECTANGULARSELECTIONCARET = 2588, - /// Returns the position at the end of the selection. + /// Return the caret position of the rectangular selection. SCI_GETRECTANGULARSELECTIONCARET = 2589, - /// Returns the position at the end of the selection. + /// Set the anchor position of the rectangular selection. SCI_SETRECTANGULARSELECTIONANCHOR = 2590, - /// Returns the position at the end of the selection. + /// Return the anchor position of the rectangular selection. SCI_GETRECTANGULARSELECTIONANCHOR = 2591, - /// Returns the position at the end of the selection. + /// Set the virtual space of the caret of the rectangular selection. SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE = 2592, - /// Returns the position at the end of the selection. + /// Return the virtual space of the caret of the rectangular selection. SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE = 2593, - /// Returns the position at the end of the selection. + /// Set the virtual space of the anchor of the rectangular selection. SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE = 2594, - /// Returns the position at the end of the selection. + /// Return the virtual space of the anchor of the rectangular selection. SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE = 2595, SCVS_NONE = 0, @@ -2491,13 +2632,15 @@ public enum SciMsg : uint SCVS_USERACCESSIBLE = 2, - /// Returns the position at the end of the selection. + SCVS_NOWRAPLINESTART = 4, + + /// Set options for virtual space behaviour. SCI_SETVIRTUALSPACEOPTIONS = 2596, - /// Returns the position at the end of the selection. + /// Return options for virtual space behaviour. SCI_GETVIRTUALSPACEOPTIONS = 2597, - /// On GTK+, allow selecting the modifier key to use for mouse-based + /// 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. @@ -2532,6 +2675,14 @@ public enum SciMsg : uint /// Swap that caret and anchor of the main selection. SCI_SWAPMAINANCHORCARET = 2607, + /// Add the next occurrence of the main selection to the set of selections as main. + /// If the current selection is empty then select word around caret. + SCI_MULTIPLESELECTADDNEXT = 2688, + + /// Add each occurrence of the main selection in the target to the set of selections. + /// If the current selection is empty then select word around caret. + SCI_MULTIPLESELECTADDEACH = 2689, + /// Indicate that the internal state of a lexer has changed over a range and therefore /// there may be a need to redraw. SCI_CHANGELEXERSTATE = 2617, @@ -2549,7 +2700,7 @@ public enum SciMsg : uint /// Move the selected lines down one line, shifting the line below before the selection SCI_MOVESELECTEDLINESDOWN = 2621, - /// Set the identifier reported as IdFrom in notification messages. + /// Set the identifier reported as idFrom in notification messages. SCI_SETIDENTIFIER = 2622, /// Get the identifier. @@ -2682,9 +2833,6 @@ public enum SciMsg : uint /// interpreted as an int AFTER any "$()" variable replacement. SCI_GETPROPERTYINT = 4010, - /// Retrieve the number of bits the current lexer needs for styling. - SCI_GETSTYLEBITSNEEDED = 4011, - /// Retrieve the name of the lexer. /// Return the length of the text. /// Result is NUL-terminated. @@ -2747,6 +2895,23 @@ public enum SciMsg : uint /// Result is NUL-terminated. SCI_GETSUBSTYLEBASES = 4026, + /// Retrieve the number of named styles for the lexer. + SCI_GETNAMEDSTYLES = 4029, + + /// Retrieve the name of a style. + /// Result is NUL-terminated. + SCI_NAMEOFSTYLE = 4030, + + /// Retrieve a ' ' separated list of style tags like "literal quoted string". + /// Result is NUL-terminated. + SCI_TAGSOFSTYLE = 4031, + + /// Retrieve a description of a style. + /// Result is NUL-terminated. + SCI_DESCRIPTIONOFSTYLE = 4032, + + SC_MOD_NONE = 0x0, + SC_MOD_INSERTTEXT = 0x1, SC_MOD_DELETETEXT = 0x2, @@ -2859,6 +3024,22 @@ public enum SciMsg : uint SCMOD_META = 16, + SC_AC_FILLUP = 1, + + SC_AC_DOUBLECLICK = 2, + + SC_AC_TAB = 3, + + SC_AC_NEWLINE = 4, + + SC_AC_COMMAND = 5, + + SC_CHARACTERSOURCE_DIRECT_INPUT = 0, + + SC_CHARACTERSOURCE_TENTATIVE_INPUT = 1, + + SC_CHARACTERSOURCE_IME_RESULT = 2, + /// Events SCN_STYLENEEDED = 2000, @@ -2874,87 +3055,130 @@ public enum SciMsg : uint /// Events SCN_MODIFYATTEMPTRO = 2004, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_KEY = 2005, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_DOUBLECLICK = 2006, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_UPDATEUI = 2007, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_MODIFIED = 2008, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_MACRORECORD = 2009, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_MARGINCLICK = 2010, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_NEEDSHOWN = 2011, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_PAINTED = 2013, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_USERLISTSELECTION = 2014, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_URIDROPPED = 2015, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_DWELLSTART = 2016, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_DWELLEND = 2017, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_ZOOM = 2018, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_HOTSPOTCLICK = 2019, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_HOTSPOTDOUBLECLICK = 2020, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_CALLTIPCLICK = 2021, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_AUTOCSELECTION = 2022, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_INDICATORCLICK = 2023, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_INDICATORRELEASE = 2024, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_AUTOCCANCELLED = 2025, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_AUTOCCHARDELETED = 2026, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_HOTSPOTRELEASECLICK = 2027, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_FOCUSIN = 2028, - /// GTK+ Specific to work around focus and accelerator problems: + /// GTK Specific to work around focus and accelerator problems: SCN_FOCUSOUT = 2029, - SC_CP_DBCS = 1, + /// GTK Specific to work around focus and accelerator problems: + SCN_AUTOCCOMPLETED = 2030, + + /// GTK Specific to work around focus and accelerator problems: + SCN_MARGINRIGHTCLICK = 2031, + + /// GTK Specific to work around focus and accelerator problems: + SCN_AUTOCSELECTIONCHANGE = 2032, + + SC_BIDIRECTIONAL_DISABLED = 0, + + SC_BIDIRECTIONAL_L2R = 1, + + SC_BIDIRECTIONAL_R2L = 2, + + /// Retrieve bidirectional text display state. + SCI_GETBIDIRECTIONAL = 2708, + + /// Set bidirectional text display state. + SCI_SETBIDIRECTIONAL = 2709, + + SC_LINECHARACTERINDEX_NONE = 0, + + SC_LINECHARACTERINDEX_UTF32 = 1, + + SC_LINECHARACTERINDEX_UTF16 = 2, + + /// Retrieve line character index state. + SCI_GETLINECHARACTERINDEX = 2710, + + /// Request line character index be created or its use count increased. + SCI_ALLOCATELINECHARACTERINDEX = 2711, + + /// Decrease use count of line character index and remove if 0. + SCI_RELEASELINECHARACTERINDEX = 2712, + + /// Retrieve the document line containing a position measured in index units. + SCI_LINEFROMINDEXPOSITION = 2713, + + /// Retrieve the position measured in index units at the start of a document line. + SCI_INDEXPOSITIONFROMLINE = 2714, + + /// 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. + SCI_SETSTYLEBITS = 2090, - /// Deprecated in 2.30 - /// In palette mode? - SCI_GETUSEPALETTE = 2139, + /// Retrieve number of bits in style bytes used to hold the lexical state. + SCI_GETSTYLEBITS = 2091, - /// In palette mode, Scintilla uses the environment's palette calls to display - /// more colours. This may lead to ugly displays. - SCI_SETUSEPALETTE = 2039, + /// Retrieve the number of bits the current lexer needs for styling. + SCI_GETSTYLEBITSNEEDED = 4011, /// Deprecated in 3.5.5 /// Always interpret keyboard input as Unicode @@ -2963,6 +3187,21 @@ public enum SciMsg : uint /// Are keys always interpreted as Unicode? SCI_GETKEYSUNICODE = 2522, + /// Is drawing done in two phases with backgrounds drawn before foregrounds? + SCI_GETTWOPHASEDRAW = 2283, + + /// 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. + SCI_SETTWOPHASEDRAW = 2284, + + INDIC0_MASK = 0x20, + + INDIC1_MASK = 0x40, + + INDIC2_MASK = 0x80, + + INDICS_MASK = 0xE0, + /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ SC_SEARCHRESULT_LINEBUFFERMAXLENGTH = 1024 diff --git a/WakaTime/PluginInfrastructure/Win32.cs b/WakaTime/PluginInfrastructure/Win32.cs index b7f1596..d1a8c74 100644 --- a/WakaTime/PluginInfrastructure/Win32.cs +++ b/WakaTime/PluginInfrastructure/Win32.cs @@ -279,9 +279,6 @@ public static IntPtr SendMessage(IntPtr hWnd, uint Msg, int wParam, ref LangType [DllImport("kernel32")] public static extern int GetPrivateProfileInt(string lpAppName, string lpKeyName, int nDefault, string lpFileName); - [DllImport("kernel32")] - public static extern uint GetPrivateProfileString(string lpAppName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, uint nSize, string lpFileName); - [DllImport("kernel32")] public static extern bool WritePrivateProfileString(string lpAppName, string lpKeyName, string lpString, string lpFileName); diff --git a/WakaTime/WakaTime.csproj b/WakaTime/WakaTime.csproj index fda7733..6034228 100644 --- a/WakaTime/WakaTime.csproj +++ b/WakaTime/WakaTime.csproj @@ -188,6 +188,7 @@ + From a2b4169b1e21b6623decce6e20fe3cb1e2c6d7b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Henrique=20Guard=C3=A3o=20Gandarez?= Date: Sat, 10 Oct 2020 10:44:25 -0300 Subject: [PATCH 2/3] changes for v4.2.0 --- HISTORY.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index edbf395..a073188 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,12 @@ History ------- +4.2.0 (2020-10-10) +++++++++++++++++++ + +- Update NPP plugin platform with latest version. + + 4.1.0 (2019-04-10) ++++++++++++++++++ From f54b6d40c108669bae0a3c6ac6c08af0c1ec74ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Henrique=20Guard=C3=A3o=20Gandarez?= Date: Sat, 10 Oct 2020 10:54:07 -0300 Subject: [PATCH 3/3] 4.2.0 --- WakaTime/Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WakaTime/Properties/AssemblyInfo.cs b/WakaTime/Properties/AssemblyInfo.cs index 84e746f..ea1d5ae 100644 --- a/WakaTime/Properties/AssemblyInfo.cs +++ b/WakaTime/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.1.0")] -[assembly: AssemblyFileVersion("4.1.0")] +[assembly: AssemblyVersion("4.2.0")] +[assembly: AssemblyFileVersion("4.2.0")]