// NPP plugin platform for .Net v0.94.00 by Kasper B. Graversen etc. using System; using System.Runtime.InteropServices; using System.Text; using static NppChnConvPlugin.NppPluginInfrastructure.Win32; namespace NppChnConvPlugin.NppPluginInfrastructure { /// /// This it the plugin-writers primary interface to Notepad++/Scintilla. /// It takes away all the complexity with command numbers and Int-pointer casting. /// /// See http://www.scintilla.org/ScintillaDoc.html for further details. /// public class ScintillaGateway : IScintillaGateway { private const int Unused = 0; private 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; return selectionLength; } public void AppendTextAndMoveCursor(string text) { AppendText(text.Length, text); GotoPos(new Position(GetCurrentPos().Value + text.Length)); } public void InsertTextAndMoveCursor(string text) { var currentPos = GetCurrentPos(); InsertText(currentPos, text); GotoPos(new Position(currentPos.Value + text.Length)); } public void SelectCurrentLine() { int line = GetCurrentLineNumber(); SetSelection(PositionFromLine(line).Value, PositionFromLine(line + 1).Value); } /// /// clears the selection without changing the position of the cursor /// public void ClearSelectionToCursor() { var pos = GetCurrentPos().Value; SetSelection(pos, pos); } /// /// Get the current line from the current position /// public int GetCurrentLineNumber() { return LineFromPosition(GetCurrentPos()); } /// /// Get the scroll information for the current Scintilla window. /// /// Arguments for the scroll information such as tracking /// Which scroll bar information are you looking for /// A ScrollInfo struct with information of the current scroll state public ScrollInfo GetScrollInfo(ScrollInfoMask mask = ScrollInfoMask.SIF_ALL, ScrollInfoBar scrollBar = ScrollInfoBar.SB_BOTH) { ScrollInfo scrollInfo = new ScrollInfo(); scrollInfo.cbSize = (uint)Marshal.SizeOf(scrollInfo); scrollInfo.fMask = (uint)mask; Win32.GetScrollInfo(scintilla, (int)scrollBar, ref scrollInfo); return scrollInfo; } /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ /// Add text to the document at current position. (Scintilla feature 2001) 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); } } /// Add array of cells to document. (Scintilla feature 2002) public unsafe void AddStyledText(int length, Cells c) { fixed (char* cPtr = c.Value) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDSTYLEDTEXT, length, (IntPtr) cPtr); } } /// Insert string at a position. (Scintilla feature 2003) public unsafe void InsertText(Position pos, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INSERTTEXT, pos.Value, (IntPtr) textPtr); } } /// Change the text that is being inserted in response to SC_MOD_INSERTCHECK (Scintilla feature 2672) 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); } } /// Delete all text in the document. (Scintilla feature 2004) public void ClearAll() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALL, Unused, Unused); } /// Delete a range of text in the document. (Scintilla feature 2645) public void DeleteRange(Position pos, int deleteLength) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETERANGE, pos.Value, deleteLength); } /// 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); } /// 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; } /// Returns the character byte at the position. (Scintilla feature 2007) public int GetCharAt(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARAT, pos.Value, Unused); return (int) res; } /// Returns the position of the caret. (Scintilla feature 2008) public Position GetCurrentPos() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURRENTPOS, Unused, Unused); return new Position((int) res); } /// Returns the position of the opposite end of the selection to the caret. (Scintilla feature 2009) public Position GetAnchor() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETANCHOR, Unused, Unused); return new Position((int) res); } /// Returns the style byte at the position. (Scintilla feature 2010) public int GetStyleAt(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEAT, pos.Value, Unused); return (int) res; } /// Redoes the next action on the undo history. (Scintilla feature 2011) public void Redo() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REDO, Unused, Unused); } /// /// Choose between collecting actions into the undo /// history and discarding them. /// (Scintilla feature 2012) /// public void SetUndoCollection(bool collectUndo) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUNDOCOLLECTION, collectUndo ? 1 : 0, Unused); } /// Select all the text in the document. (Scintilla feature 2013) public void SelectAll() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SELECTALL, Unused, Unused); } /// /// Remember the current position in the undo history as the position /// at which the document was saved. /// (Scintilla feature 2014) /// public void SetSavePoint() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSAVEPOINT, Unused, Unused); } /// /// Retrieve a buffer of cells. /// Returns the number of bytes in the buffer not including terminating NULs. /// (Scintilla feature 2015) /// public int GetStyledText(TextRange tr) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTYLEDTEXT, Unused, tr.NativePointer); return (int) res; } /// 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; } /// Retrieve the line number at which a particular marker is located. (Scintilla feature 2017) public int MarkerLineFromHandle(int handle) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERLINEFROMHANDLE, handle, Unused); return (int) res; } /// Delete a marker. (Scintilla feature 2018) public void MarkerDeleteHandle(int handle) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDELETEHANDLE, handle, 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; } /// /// Are white space characters currently visible? /// Returns one of SCWS_* constants. /// (Scintilla feature 2020) /// public int GetViewWS() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIEWWS, Unused, Unused); return (int) res; } /// Make white space characters invisible, always visible or visible outside indentation. (Scintilla feature 2021) public void SetViewWS(int viewWS) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIEWWS, viewWS, Unused); } /// Find the position from a point within the window. (Scintilla feature 2022) public Position PositionFromPoint(int x, int y) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINT, x, y); return new Position((int) res); } /// /// Find the position from a point within the window but return /// INVALID_POSITION if not close to text. /// (Scintilla feature 2023) /// public Position PositionFromPointClose(int x, int y) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMPOINTCLOSE, x, y); return new Position((int) res); } /// 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); } /// Set caret to a position and ensure it is visible. (Scintilla feature 2025) public void GotoPos(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GOTOPOS, pos.Value, Unused); } /// /// Set the selection anchor to a position. The anchor is the opposite /// end of the selection from the caret. /// (Scintilla feature 2026) /// public void SetAnchor(Position posAnchor) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETANCHOR, posAnchor.Value, Unused); } /// /// Retrieve the text of the line containing the caret. /// Returns the index of the caret on the line. /// Result is NUL-terminated. /// (Scintilla feature 2027) /// 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); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } /// Retrieve the position of the last correctly styled character. (Scintilla feature 2028) public Position GetEndStyled() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETENDSTYLED, Unused, Unused); return new Position((int) res); } /// Convert all line endings in the document to one mode. (Scintilla feature 2029) public void ConvertEOLs(int eolMode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CONVERTEOLS, eolMode, Unused); } /// Retrieve the current end of line mode - one of CRLF, CR, or LF. (Scintilla feature 2030) public int GetEOLMode() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEOLMODE, Unused, Unused); return (int) res; } /// Set the current end of line mode. (Scintilla feature 2031) public void SetEOLMode(int eolMode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEOLMODE, eolMode, 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. /// (Scintilla feature 2032) /// public void StartStyling(Position pos, int mask) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STARTSTYLING, pos.Value, mask); } /// /// Change style from current styling position for length characters to a style /// and move the current styling position to after this newly styled segment. /// (Scintilla feature 2033) /// public void SetStyling(int length, int style) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTYLING, length, 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; } /// /// If drawing is buffered then each line of text is drawn into a bitmap buffer /// before drawing it to the screen to avoid flicker. /// (Scintilla feature 2035) /// public void SetBufferedDraw(bool buffered) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETBUFFEREDDRAW, buffered ? 1 : 0, 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); } /// 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; } /// Clear explicit tabstops on a line. (Scintilla feature 2675) public void ClearTabStops(int line) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARTABSTOPS, line, 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); } /// 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; } /// /// Set the code page used to interpret the bytes of the document as characters. /// The SC_CP_UTF8 value can be used to enter Unicode mode. /// (Scintilla feature 2037) /// public void SetCodePage(int codePage) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCODEPAGE, codePage, Unused); } /// Is the IME displayed in a winow or inline? (Scintilla feature 2678) public int GetIMEInteraction() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETIMEINTERACTION, Unused, Unused); return (int) res; } /// Choose to display the the IME in a winow or inline. (Scintilla feature 2679) public void SetIMEInteraction(int imeInteraction) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETIMEINTERACTION, imeInteraction, Unused); } /// Set the symbol used for a particular marker number. (Scintilla feature 2040) public void MarkerDefine(int markerNumber, int markerSymbol) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERDEFINE, markerNumber, 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); } /// 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); } /// 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); } /// 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); } /// 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; } /// 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); } /// 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); } /// 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; } /// /// Find the next line at or after lineStart that includes a marker in mask. /// Return -1 when no more lines. /// (Scintilla feature 2047) /// public int MarkerNext(int lineStart, int markerMask) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERNEXT, lineStart, markerMask); return (int) res; } /// 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; } /// Define a marker from a pixmap. (Scintilla feature 2049) 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); } } /// Add a set of markers to a line. (Scintilla feature 2466) public void MarkerAddSet(int line, int set) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERADDSET, line, set); } /// 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) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARKERSETALPHA, markerNumber, alpha); } /// Set a margin to be either numeric or symbolic. (Scintilla feature 2240) public void SetMarginTypeN(int margin, int marginType) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINTYPEN, margin, marginType); } /// Retrieve the type of a margin. (Scintilla feature 2241) public int GetMarginTypeN(int margin) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINTYPEN, margin, Unused); return (int) res; } /// 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); } /// 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; } /// 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); } /// 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; } /// 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); } /// 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; } /// Set the cursor shown when the mouse is inside a margin. (Scintilla feature 2248) public void SetMarginCursorN(int margin, int cursor) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINCURSORN, margin, cursor); } /// Retrieve the cursor shown in a margin. (Scintilla feature 2249) public int GetMarginCursorN(int margin) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINCURSORN, margin, Unused); return (int) res; } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// Set the font of a style. (Scintilla feature 2056) 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); } } /// Set a style to have its end of line filled or not. (Scintilla feature 2057) public void StyleSetEOLFilled(int style, bool filled) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETEOLFILLED, style, filled ? 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); } /// 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); } /// 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); } /// 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); } /// 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; } /// 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; } /// 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; } /// /// Get the font of a style. /// Returns the length of the fontName /// Result is NUL-terminated. /// (Scintilla feature 2486) /// 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); return Encoding.UTF8.GetString(fontNameBuffer).TrimEnd('\0'); } } /// 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; } /// 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; } /// Get is a style mixed case, or to force upper or lower case. (Scintilla feature 2489) public int StyleGetCase(int style) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCASE, style, Unused); return (int) res; } /// Get the character get of the font in a style. (Scintilla feature 2490) public int StyleGetCharacterSet(int style) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHARACTERSET, style, Unused); return (int) res; } /// 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; } /// /// Get is a style changeable or not (read only). /// Experimental feature, currently buggy. /// (Scintilla feature 2492) /// public bool StyleGetChangeable(int style) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETCHANGEABLE, style, Unused); return 1 == (int) res; } /// 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; } /// Set a style to be mixed case, or to force upper or lower case. (Scintilla feature 2060) public void StyleSetCase(int style, int caseForce) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCASE, style, caseForce); } /// 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) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETSIZEFRACTIONAL, style, caseForce); } /// 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; } /// Set the weight of characters of a style. (Scintilla feature 2063) public void StyleSetWeight(int style, int weight) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETWEIGHT, style, weight); } /// Get the weight of characters of a style. (Scintilla feature 2064) public int StyleGetWeight(int style) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLEGETWEIGHT, style, Unused); return (int) res; } /// Set the character set of the font in a style. (Scintilla feature 2066) public void StyleSetCharacterSet(int style, int characterSet) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHARACTERSET, style, 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); } /// 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); } /// 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); } /// Get the alpha of the selection. (Scintilla feature 2477) public int GetSelAlpha() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELALPHA, Unused, Unused); return (int) res; } /// Set the alpha of the selection. (Scintilla feature 2478) public void SetSelAlpha(int alpha) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELALPHA, alpha, 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; } /// 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); } /// 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); } /// When key+modifier combination km is pressed perform msg. (Scintilla feature 2070) public void AssignCmdKey(KeyModifier km, int msg) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ASSIGNCMDKEY, km.Value, msg); } /// When key+modifier combination km is pressed do nothing. (Scintilla feature 2071) public void ClearCmdKey(KeyModifier km) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARCMDKEY, km.Value, Unused); } /// Drop all key mappings. (Scintilla feature 2072) public void ClearAllCmdKeys() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARALLCMDKEYS, Unused, Unused); } /// Set the styles for a segment of the document. (Scintilla feature 2073) 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); } } /// 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); } /// 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; } /// 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); } /// /// Set the set of characters making up words for when moving or selecting by word. /// First sets defaults like SetCharsDefault. /// (Scintilla feature 2077) /// public unsafe void SetWordChars(string characters) { fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWORDCHARS, Unused, (IntPtr) charactersPtr); } } /// /// Get the set of characters making up words for when moving or selecting by word. /// Returns the number of characters /// (Scintilla feature 2646) /// public unsafe string GetWordChars() { byte[] charactersBuffer = new byte[10000]; fixed (byte* charactersPtr = charactersBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWORDCHARS, Unused, (IntPtr) charactersPtr); return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0'); } } /// /// Start a sequence of actions that is undone and redone as a unit. /// May be nested. /// (Scintilla feature 2078) /// public void BeginUndoAction() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BEGINUNDOACTION, Unused, 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); } /// Set an indicator to plain, squiggle or TT. (Scintilla feature 2080) public void IndicSetStyle(int indic, int style) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETSTYLE, indic, style); } /// Retrieve the style of an indicator. (Scintilla feature 2081) public int IndicGetStyle(int indic) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETSTYLE, indic, Unused); return (int) res; } /// Set the foreground colour of an indicator. (Scintilla feature 2082) public void IndicSetFore(int indic, Colour fore) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFORE, indic, fore.Value); } /// Retrieve the foreground colour of an indicator. (Scintilla feature 2083) public Colour IndicGetFore(int indic) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFORE, indic, Unused); return new Colour((int) res); } /// Set an indicator to draw under text or over(default). (Scintilla feature 2510) public void IndicSetUnder(int indic, bool under) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETUNDER, indic, under ? 1 : 0); } /// Retrieve whether indicator drawn under or over text. (Scintilla feature 2511) public bool IndicGetUnder(int indic) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETUNDER, indic, Unused); return 1 == (int) res; } /// Set a hover indicator to plain, squiggle or TT. (Scintilla feature 2680) public void IndicSetHoverStyle(int indic, int style) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETHOVERSTYLE, indic, style); } /// Retrieve the hover style of an indicator. (Scintilla feature 2681) public int IndicGetHoverStyle(int indic) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETHOVERSTYLE, indic, Unused); return (int) res; } /// Set the foreground hover colour of an indicator. (Scintilla feature 2682) public void IndicSetHoverFore(int indic, Colour fore) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETHOVERFORE, indic, fore.Value); } /// Retrieve the foreground hover colour of an indicator. (Scintilla feature 2683) public Colour IndicGetHoverFore(int indic) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETHOVERFORE, indic, Unused); return new Colour((int) res); } /// Set the attributes of an indicator. (Scintilla feature 2684) public void IndicSetFlags(int indic, int flags) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETFLAGS, indic, flags); } /// Retrieve the attributes of an indicator. (Scintilla feature 2685) public int IndicGetFlags(int indic) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETFLAGS, indic, Unused); return (int) res; } /// 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); } /// 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); } /// 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); } /// 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; } /// 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); } /// 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; } /// 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; } /// 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; } /// 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); } /// 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); } /// 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); } /// /// Set a style to be changeable or not (read only). /// Experimental feature, currently buggy. /// (Scintilla feature 2099) /// public void StyleSetChangeable(int style, bool changeable) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_STYLESETCHANGEABLE, style, changeable ? 1 : 0); } /// /// Display a auto-completion list. /// The lenEntered 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) { fixed (byte* itemListPtr = Encoding.UTF8.GetBytes(itemList)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSHOW, lenEntered, (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); } /// 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; } /// Retrieve the position of the caret when the auto-completion list was displayed. (Scintilla feature 2103) public Position AutoCPosStart() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCPOSSTART, Unused, Unused); return new Position((int) res); } /// 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); } /// Define a set of character that when typed cancel the auto-completion list. (Scintilla feature 2105) public unsafe void AutoCStops(string characterSet) { fixed (byte* characterSetPtr = Encoding.UTF8.GetBytes(characterSet)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSTOPS, Unused, (IntPtr) characterSetPtr); } } /// /// Change the separator character in the string setting up an auto-completion list. /// Default is space but can be changed if items contain space. /// (Scintilla feature 2106) /// public void AutoCSetSeparator(int separatorCharacter) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETSEPARATOR, separatorCharacter, 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; } /// Select the item in the auto-completion list that starts with a string. (Scintilla feature 2108) public unsafe void AutoCSelect(string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSELECT, Unused, (IntPtr) textPtr); } } /// /// Should the auto-completion list be cancelled if the user backspaces to a /// position before where the box was created. /// (Scintilla feature 2110) /// public void AutoCSetCancelAtStart(bool cancel) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCANCELATSTART, cancel ? 1 : 0, 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; } /// /// Define a set of characters that when typed will cause the autocompletion to /// choose the selected item. /// (Scintilla feature 2112) /// public unsafe void AutoCSetFillUps(string characterSet) { fixed (byte* characterSetPtr = Encoding.UTF8.GetBytes(characterSet)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETFILLUPS, 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); } /// 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; } /// 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); } /// 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; } /// Display a list of strings and send notification when user chooses one. (Scintilla feature 2117) 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); } } /// 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); } /// 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; } /// /// Set whether or not autocompletion deletes any word characters /// after the inserted text upon completion. /// (Scintilla feature 2270) /// public void AutoCSetDropRestOfWord(bool dropRestOfWord) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETDROPRESTOFWORD, dropRestOfWord ? 1 : 0, Unused); } /// /// Retrieve whether or not autocompletion deletes any word characters /// after the inserted text upon completion. /// (Scintilla feature 2271) /// public bool AutoCGetDropRestOfWord() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETDROPRESTOFWORD, Unused, Unused); return 1 == (int) res; } /// Register an XPM image for use in autocompletion lists. (Scintilla feature 2405) 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); } } /// Clear all the registered XPM images. (Scintilla feature 2408) public void ClearRegisteredImages() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARREGISTEREDIMAGES, Unused, 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; } /// /// Change the type-separator character in the string setting up an auto-completion list. /// Default is '?' but can be changed if items contain '?'. /// (Scintilla feature 2286) /// public void AutoCSetTypeSeparator(int separatorCharacter) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETTYPESEPARATOR, separatorCharacter, Unused); } /// /// Set the maximum width, in characters, of auto-completion and user lists. /// Set to 0 to autosize to fit longest item, which is the default. /// (Scintilla feature 2208) /// public void AutoCSetMaxWidth(int characterCount) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMAXWIDTH, characterCount, 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; } /// /// Set the maximum height, in rows, of auto-completion and user lists. /// The default is 5 rows. /// (Scintilla feature 2210) /// public void AutoCSetMaxHeight(int rowCount) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMAXHEIGHT, rowCount, 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; } /// 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); } /// Retrieve indentation size. (Scintilla feature 2123) public int GetIndent() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDENT, Unused, Unused); return (int) res; } /// /// Indentation will only use space characters if useTabs is false, otherwise /// it will use a combination of tabs and spaces. /// (Scintilla feature 2124) /// public void SetUseTabs(bool useTabs) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUSETABS, useTabs ? 1 : 0, 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; } /// Change the indentation of a line to a number of columns. (Scintilla feature 2126) public void SetLineIndentation(int line, int indentSize) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINEINDENTATION, line, indentSize); } /// 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; } /// Retrieve the position before the first non indentation character on a line. (Scintilla feature 2128) public Position GetLineIndentPosition(int line) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEINDENTPOSITION, line, Unused); return new Position((int) res); } /// Retrieve the column number of a position, taking tab width into account. (Scintilla feature 2129) public int GetColumn(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCOLUMN, pos.Value, Unused); return (int) res; } /// Count characters between two positions. (Scintilla feature 2633) public int CountCharacters(int startPos, int endPos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COUNTCHARACTERS, startPos, endPos); return (int) res; } /// Show or hide the horizontal scroll bar. (Scintilla feature 2130) public void SetHScrollBar(bool show) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHSCROLLBAR, show ? 1 : 0, 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; } /// Show or hide indentation guides. (Scintilla feature 2132) public void SetIndentationGuides(int indentView) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDENTATIONGUIDES, indentView, Unused); } /// Are the indentation guides visible? (Scintilla feature 2133) public int GetIndentationGuides() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDENTATIONGUIDES, Unused, Unused); return (int) res; } /// /// Set the highlighted indentation guide column. /// 0 = no highlighted guide. /// (Scintilla feature 2134) /// public void SetHighlightGuide(int column) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETHIGHLIGHTGUIDE, column, 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; } /// Get the position after the last visible characters on a line. (Scintilla feature 2136) public Position GetLineEndPosition(int line) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDPOSITION, line, Unused); return new Position((int) res); } /// 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; } /// 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); } /// In read-only mode? (Scintilla feature 2140) public bool GetReadOnly() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETREADONLY, Unused, Unused); return 1 == (int) res; } /// Sets the position of the caret. (Scintilla feature 2141) public void SetCurrentPos(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCURRENTPOS, pos.Value, Unused); } /// Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2142) public void SetSelectionStart(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONSTART, pos.Value, Unused); } /// Returns the position at the start of the selection. (Scintilla feature 2143) public Position GetSelectionStart() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONSTART, Unused, Unused); return new Position((int) res); } /// Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2144) public void SetSelectionEnd(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONEND, pos.Value, Unused); } /// Returns the position at the end of the selection. (Scintilla feature 2145) public Position GetSelectionEnd() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONEND, Unused, Unused); return new Position((int) res); } /// Set caret to a position, while removing any existing selection. (Scintilla feature 2556) public void SetEmptySelection(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEMPTYSELECTION, pos.Value, 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); } /// Returns the print magnification. (Scintilla feature 2147) public int GetPrintMagnification() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTMAGNIFICATION, Unused, Unused); return (int) res; } /// Modify colours when printing for clearer printed text. (Scintilla feature 2148) public void SetPrintColourMode(int mode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTCOLOURMODE, mode, Unused); } /// Returns the print colour mode. (Scintilla feature 2149) public int GetPrintColourMode() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTCOLOURMODE, Unused, Unused); return (int) res; } /// Find some text in the document. (Scintilla feature 2150) public Position FindText(int flags, TextToFind ft) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDTEXT, flags, ft.NativePointer); return new Position((int) res); } /// 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; } /// /// Retrieve the contents of a line. /// Returns the length of the line. /// (Scintilla feature 2153) /// 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); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } /// 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; } /// 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); } /// 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; } /// 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); } /// 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; } /// 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; } /// Select a range of text. (Scintilla feature 2160) public void SetSel(Position start, Position end) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSEL, start.Value, end.Value); } /// /// Retrieve the selected text. /// Return the length of the text. /// Result is NUL-terminated. /// (Scintilla feature 2161) /// public unsafe string GetSelText() { byte[] textBuffer = new byte[10000]; fixed (byte* textPtr = textBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELTEXT, Unused, (IntPtr) textPtr); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } /// /// Retrieve a range of text. /// Return the length of the text. /// (Scintilla feature 2162) /// public int GetTextRange(TextRange tr) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXTRANGE, Unused, tr.NativePointer); return (int) res; } /// Draw the selection in normal style or with selection highlighted. (Scintilla feature 2163) public void HideSelection(bool normal) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HIDESELECTION, normal ? 1 : 0, Unused); } /// Retrieve the x value of the point in the window where a position is displayed. (Scintilla feature 2164) public int PointXFromPosition(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POINTXFROMPOSITION, Unused, pos.Value); return (int) res; } /// Retrieve the y value of the point in the window where a position is displayed. (Scintilla feature 2165) public int PointYFromPosition(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POINTYFROMPOSITION, Unused, pos.Value); return (int) res; } /// Retrieve the line containing a position. (Scintilla feature 2166) public int LineFromPosition(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEFROMPOSITION, pos.Value, Unused); return (int) res; } /// Retrieve the position at the start of a line. (Scintilla feature 2167) public Position PositionFromLine(int line) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONFROMLINE, line, Unused); return new Position((int) res); } /// Scroll horizontally and vertically. (Scintilla feature 2168) public void LineScroll(int columns, int lines) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLL, columns, lines); } /// Ensure the caret is visible. (Scintilla feature 2169) public void ScrollCaret() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLCARET, Unused, Unused); } /// /// Scroll the argument positions and the range between them into view giving /// priority to the primary position then the secondary position. /// This may be used to make a search match visible. /// (Scintilla feature 2569) /// public void ScrollRange(Position secondary, Position primary) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLRANGE, secondary.Value, primary.Value); } /// Replace the selected text with the argument text. (Scintilla feature 2170) public unsafe void ReplaceSel(string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_REPLACESEL, 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); } /// Null operation. (Scintilla feature 2172) public void Null() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_NULL, Unused, 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; } /// 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; } /// Delete the undo history. (Scintilla feature 2175) public void EmptyUndoBuffer() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EMPTYUNDOBUFFER, Unused, Unused); } /// Undo one action in the undo history. (Scintilla feature 2176) public void Undo() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_UNDO, Unused, Unused); } /// Cut the selection to the clipboard. (Scintilla feature 2177) public void Cut() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CUT, Unused, Unused); } /// Copy the selection to the clipboard. (Scintilla feature 2178) public void Copy() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPY, Unused, 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); } /// Clear the selection. (Scintilla feature 2180) public void Clear() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEAR, Unused, Unused); } /// Replace the contents of the document with the argument text. (Scintilla feature 2181) public unsafe void SetText(string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTEXT, Unused, (IntPtr) textPtr); } } /// /// Retrieve all the text in the document. /// Returns number of characters retrieved. /// Result is NUL-terminated. /// (Scintilla feature 2182) /// public unsafe string GetText(int length) { byte[] textBuffer = new byte[length]; fixed (byte* textPtr = textBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTEXT, length, (IntPtr) textPtr); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } /// 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; } /// 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); } /// /// Retrieve a pointer value to use as the first argument when calling /// the function returned by GetDirectFunction. /// (Scintilla feature 2185) /// public IntPtr GetDirectPointer() { return Win32.SendMessage(scintilla, SciMsg.SCI_GETDIRECTPOINTER, Unused, Unused); } /// Set to overtype (true) or insert mode. (Scintilla feature 2186) public void SetOvertype(bool overtype) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETOVERTYPE, overtype ? 1 : 0, 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; } /// 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); } /// 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; } /// /// Sets the position that starts the target which is used for updating the /// document without affecting the scroll position. /// (Scintilla feature 2190) /// public void SetTargetStart(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETSTART, pos.Value, Unused); } /// Get the position that starts the target. (Scintilla feature 2191) public Position GetTargetStart() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETSTART, Unused, Unused); return new Position((int) res); } /// /// Sets the position that ends the target which is used for updating the /// document without affecting the scroll position. /// (Scintilla feature 2192) /// public void SetTargetEnd(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETEND, pos.Value, Unused); } /// Get the position that ends the target. (Scintilla feature 2193) public Position GetTargetEnd() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETEND, Unused, Unused); return new Position((int) res); } /// Sets both the start and end of the target in one call. (Scintilla feature 2686) public void SetTargetRange(Position start, Position end) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTARGETRANGE, start.Value, end.Value); } /// Retrieve the text in the target. (Scintilla feature 2687) public unsafe string GetTargetText() { byte[] charactersBuffer = new byte[10000]; fixed (byte* charactersPtr = charactersBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTARGETTEXT, Unused, (IntPtr) charactersPtr); return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0'); } } /// /// Replace the target text with the argument text. /// Text is counted so it can contain NULs. /// Returns the length of the replacement text. /// (Scintilla feature 2194) /// 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; } } /// /// Replace the target text with the argument text after \d processing. /// Text is counted so it can contain NULs. /// Looks for \d where d is between 1 and 9 and replaces these with the strings /// matched in the last search operation which were surrounded by \( and \). /// Returns the length of the replacement text including any change /// caused by processing the \d patterns. /// (Scintilla feature 2195) /// 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; } } /// /// Search for a counted string in the target and set the target to the found /// range. Text is counted so it can contain NULs. /// Returns length of range or -1 for failure in which case target is not moved. /// (Scintilla feature 2197) /// 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; } } /// Set the search flags used by SearchInTarget. (Scintilla feature 2198) public void SetSearchFlags(int flags) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSEARCHFLAGS, flags, Unused); } /// Get the search flags used by SearchInTarget. (Scintilla feature 2199) public int GetSearchFlags() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSEARCHFLAGS, Unused, Unused); return (int) res; } /// Show a call tip containing a definition near position pos. (Scintilla feature 2200) public unsafe void CallTipShow(Position pos, string definition) { fixed (byte* definitionPtr = Encoding.UTF8.GetBytes(definition)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSHOW, pos.Value, (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); } /// 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; } /// Retrieve the position where the caret was before displaying the call tip. (Scintilla feature 2203) public Position CallTipPosStart() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPPOSSTART, Unused, Unused); return new Position((int) res); } /// 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); } /// Highlight a segment of the definition. (Scintilla feature 2204) public void CallTipSetHlt(int start, int end) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CALLTIPSETHLT, start, end); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// Find the display line of a document line taking hidden lines into account. (Scintilla feature 2220) public int VisibleFromDocLine(int line) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VISIBLEFROMDOCLINE, line, Unused); return (int) res; } /// Find the document line of a display line taking hidden lines into account. (Scintilla feature 2221) public int DocLineFromVisible(int lineDisplay) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCLINEFROMVISIBLE, lineDisplay, Unused); return (int) res; } /// The number of display lines needed to wrap a document line (Scintilla feature 2235) public int WrapCount(int line) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WRAPCOUNT, line, Unused); return (int) res; } /// /// Set the fold level of a line. /// This encodes an integer level along with flags indicating whether the /// line is a header and whether it is effectively white space. /// (Scintilla feature 2222) /// public void SetFoldLevel(int line, int level) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDLEVEL, line, level); } /// Retrieve the fold level of a line. (Scintilla feature 2223) public int GetFoldLevel(int line) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFOLDLEVEL, line, Unused); return (int) res; } /// Find the last child line of a header line. (Scintilla feature 2224) public int GetLastChild(int line, int level) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLASTCHILD, line, level); return (int) res; } /// 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; } /// 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); } /// 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); } /// 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; } /// Are all lines visible? (Scintilla feature 2236) public bool GetAllLinesVisible() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETALLLINESVISIBLE, Unused, Unused); return 1 == (int) res; } /// 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); } /// 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; } /// 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); } /// Expand or contract a fold header. (Scintilla feature 2237) public void FoldLine(int line, int action) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDLINE, line, action); } /// Expand or contract a fold header and its children. (Scintilla feature 2238) public void FoldChildren(int line, int action) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDCHILDREN, line, 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) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_EXPANDCHILDREN, line, level); } /// Expand or contract all fold headers. (Scintilla feature 2662) public void FoldAll(int action) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FOLDALL, action, 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); } /// Set automatic folding behaviours. (Scintilla feature 2663) public void SetAutomaticFold(int automaticFold) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETAUTOMATICFOLD, automaticFold, Unused); } /// Get automatic folding behaviours. (Scintilla feature 2664) public int GetAutomaticFold() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETAUTOMATICFOLD, Unused, Unused); return (int) res; } /// Set some style options for folding. (Scintilla feature 2233) public void SetFoldFlags(int flags) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOLDFLAGS, flags, Unused); } /// /// Ensure a particular line is visible by expanding any header line hiding it. /// Use the currently set visibility policy to determine which range to display. /// (Scintilla feature 2234) /// public void EnsureVisibleEnforcePolicy(int line) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENSUREVISIBLEENFORCEPOLICY, line, 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); } /// 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; } /// 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); } /// 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; } /// 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); } /// 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; } /// Get position of start of word. (Scintilla feature 2266) public int WordStartPosition(Position pos, bool onlyWordCharacters) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDSTARTPOSITION, pos.Value, onlyWordCharacters ? 1 : 0); return (int) res; } /// Get position of end of word. (Scintilla feature 2267) public int WordEndPosition(Position pos, bool onlyWordCharacters) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDENDPOSITION, pos.Value, onlyWordCharacters ? 1 : 0); return (int) res; } /// Sets whether text is word wrapped. (Scintilla feature 2268) public void SetWrapMode(int mode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPMODE, mode, Unused); } /// Retrieve whether text is word wrapped. (Scintilla feature 2269) public int GetWrapMode() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPMODE, Unused, Unused); return (int) res; } /// Set the display mode of visual flags for wrapped lines. (Scintilla feature 2460) public void SetWrapVisualFlags(int wrapVisualFlags) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPVISUALFLAGS, wrapVisualFlags, Unused); } /// Retrive the display mode of visual flags for wrapped lines. (Scintilla feature 2461) public int GetWrapVisualFlags() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPVISUALFLAGS, Unused, Unused); return (int) res; } /// Set the location of visual flags for wrapped lines. (Scintilla feature 2462) public void SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPVISUALFLAGSLOCATION, wrapVisualFlagsLocation, Unused); } /// Retrive the location of visual flags for wrapped lines. (Scintilla feature 2463) public int GetWrapVisualFlagsLocation() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPVISUALFLAGSLOCATION, Unused, Unused); return (int) res; } /// 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); } /// 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; } /// Sets how wrapped sublines are placed. Default is fixed. (Scintilla feature 2472) public void SetWrapIndentMode(int mode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWRAPINDENTMODE, mode, Unused); } /// Retrieve how wrapped sublines are placed. Default is fixed. (Scintilla feature 2473) public int GetWrapIndentMode() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWRAPINDENTMODE, Unused, Unused); return (int) res; } /// Sets the degree of caching of layout information. (Scintilla feature 2272) public void SetLayoutCache(int mode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLAYOUTCACHE, mode, Unused); } /// Retrieve the degree of caching of layout information. (Scintilla feature 2273) public int GetLayoutCache() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLAYOUTCACHE, Unused, Unused); return (int) res; } /// 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); } /// 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; } /// 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); } /// 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; } /// /// Measure the pixel width of some text in a particular style. /// NUL terminated text argument. /// Does not handle tab or control characters. /// (Scintilla feature 2276) /// 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; } } /// /// Sets the scroll range so that maximum scroll position has /// the last line at the bottom of the view (default). /// Setting this to false allows scrolling one page below the last line. /// (Scintilla feature 2277) /// public void SetEndAtLastLine(bool endAtLastLine) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETENDATLASTLINE, endAtLastLine ? 1 : 0, Unused); } /// /// Retrieve whether the maximum scroll position has the last /// line at the bottom of the view. /// (Scintilla feature 2278) /// public bool GetEndAtLastLine() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETENDATLASTLINE, Unused, Unused); return 1 == (int) res; } /// 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; } /// Show or hide the vertical scroll bar. (Scintilla feature 2280) public void SetVScrollBar(bool show) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVSCROLLBAR, show ? 1 : 0, 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; } /// Append a string to the end of the document without changing the selection. (Scintilla feature 2282) 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); } } /// 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() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPHASESDRAW, Unused, Unused); return (int) res; } /// /// In one phase draw, text is drawn in a series of rectangular blocks with no overlap. /// In two phase draw, text is drawn in a series of lines allowing runs to overlap horizontally. /// In multiple phase draw, each element is drawn over the whole drawing area, allowing text /// to overlap from one line to the next. /// (Scintilla feature 2674) /// public void SetPhasesDraw(int phases) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPHASESDRAW, phases, Unused); } /// Choose the quality level for text from the FontQuality enumeration. (Scintilla feature 2611) public void SetFontQuality(int fontQuality) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFONTQUALITY, fontQuality, Unused); } /// Retrieve the quality level for text. (Scintilla feature 2612) public int GetFontQuality() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETFONTQUALITY, Unused, Unused); return (int) res; } /// Scroll so that a display line is at the top of the display. (Scintilla feature 2613) public void SetFirstVisibleLine(int lineDisplay) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFIRSTVISIBLELINE, lineDisplay, Unused); } /// Change the effect of pasting when there are multiple selections. (Scintilla feature 2614) public void SetMultiPaste(int multiPaste) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMULTIPASTE, multiPaste, Unused); } /// Retrieve the effect of pasting when there are multiple selections.. (Scintilla feature 2615) public int GetMultiPaste() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMULTIPASTE, Unused, Unused); return (int) res; } /// /// Retrieve the value of a tag from a regular expression search. /// Result is NUL-terminated. /// (Scintilla feature 2616) /// 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); 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); } /// /// Split the lines in the target into lines that are less wide than pixelWidth /// where possible. /// (Scintilla feature 2289) /// public void LinesSplit(int pixelWidth) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESSPLIT, pixelWidth, Unused); } /// Set 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); } /// Set the colours 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); } /// Move caret down one line. (Scintilla feature 2300) public void LineDown() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDOWN, Unused, 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); } /// Move caret up one line. (Scintilla feature 2302) public void LineUp() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEUP, Unused, 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); } /// Move caret left one character. (Scintilla feature 2304) public void CharLeft() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARLEFT, Unused, 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); } /// Move caret right one character. (Scintilla feature 2306) public void CharRight() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARRIGHT, Unused, 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); } /// Move caret left one word. (Scintilla feature 2308) public void WordLeft() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDLEFT, Unused, 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); } /// Move caret right one word. (Scintilla feature 2310) public void WordRight() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDRIGHT, Unused, 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); } /// Move caret to first position on line. (Scintilla feature 2312) public void Home() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOME, Unused, 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); } /// Move caret to last position on line. (Scintilla feature 2314) public void LineEnd() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEEND, Unused, 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); } /// Move caret to first position in document. (Scintilla feature 2316) public void DocumentStart() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTSTART, Unused, 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); } /// Move caret to last position in document. (Scintilla feature 2318) public void DocumentEnd() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DOCUMENTEND, Unused, 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); } /// Move caret one page up. (Scintilla feature 2320) public void PageUp() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEUP, Unused, 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); } /// Move caret one page down. (Scintilla feature 2322) public void PageDown() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PAGEDOWN, Unused, 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); } /// 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); } /// 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); } /// 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); } /// /// If selection is empty or all on one line replace the selection with a tab character. /// If more than one line selected, indent the lines. /// (Scintilla feature 2327) /// public void Tab() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TAB, Unused, Unused); } /// Dedent the selected lines. (Scintilla feature 2328) public void BackTab() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BACKTAB, Unused, 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); } /// Insert a Form Feed character. (Scintilla feature 2330) public void FormFeed() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FORMFEED, Unused, Unused); } /// /// Move caret to before first visible character on line. /// If already there move to first character on line. /// (Scintilla feature 2331) /// public void VCHome() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOME, Unused, 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// Cut the line containing the caret. (Scintilla feature 2337) public void LineCut() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINECUT, Unused, Unused); } /// Delete the line containing the caret. (Scintilla feature 2338) public void LineDelete() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDELETE, Unused, Unused); } /// Switch the current line with the previous. (Scintilla feature 2339) public void LineTranspose() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINETRANSPOSE, Unused, Unused); } /// Duplicate the current line. (Scintilla feature 2404) public void LineDuplicate() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEDUPLICATE, Unused, Unused); } /// Transform the selection to lower case. (Scintilla feature 2340) public void LowerCase() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LOWERCASE, Unused, Unused); } /// Transform the selection to upper case. (Scintilla feature 2341) public void UpperCase() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_UPPERCASE, Unused, 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); } /// Scroll the document up, keeping the caret visible. (Scintilla feature 2343) public void LineScrollUp() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINESCROLLUP, Unused, Unused); } /// /// Delete the selection or if no selection, the character before the caret. /// Will not delete the character before at the start of a line. /// (Scintilla feature 2344) /// public void DeleteBackNotLine() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DELETEBACKNOTLINE, Unused, 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); } /// /// Move caret to first position on display line extending selection to /// new caret position. /// (Scintilla feature 2346) /// public void HomeDisplayExtend() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEDISPLAYEXTEND, Unused, 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); } /// /// Move caret to last position on display line extending selection to new /// caret position. /// (Scintilla feature 2348) /// public void LineEndDisplayExtend() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDDISPLAYEXTEND, Unused, 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)?. /// (Scintilla feature 2349) /// public void HomeWrap() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEWRAP, Unused, 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)?. /// (Scintilla feature 2450) /// public void HomeWrapExtend() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_HOMEWRAPEXTEND, Unused, 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)?. /// (Scintilla feature 2451) /// public void LineEndWrap() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDWRAP, Unused, 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)?. /// (Scintilla feature 2452) /// public void LineEndWrapExtend() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINEENDWRAPEXTEND, Unused, 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)?. /// (Scintilla feature 2453) /// public void VCHomeWrap() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEWRAP, Unused, 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)?. /// (Scintilla feature 2454) /// public void VCHomeWrapExtend() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEWRAPEXTEND, Unused, Unused); } /// Copy the line containing the caret. (Scintilla feature 2455) public void LineCopy() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LINECOPY, Unused, 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); } /// 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; } /// Highlight the characters at two positions. (Scintilla feature 2351) public void BraceHighlight(Position pos1, Position pos2) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEHIGHLIGHT, pos1.Value, pos2.Value); } /// Use specified indicator to highlight matching braces instead of changing their style. (Scintilla feature 2498) public void BraceHighlightIndicator(bool useBraceHighlightIndicator, int indicator) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEHIGHLIGHTINDICATOR, useBraceHighlightIndicator ? 1 : 0, indicator); } /// Highlight the character at a position indicating there is no matching brace. (Scintilla feature 2352) public void BraceBadLight(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEBADLIGHT, pos.Value, Unused); } /// Use specified indicator to highlight non matching brace instead of changing its style. (Scintilla feature 2499) public void BraceBadLightIndicator(bool useBraceBadLightIndicator, int indicator) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEBADLIGHTINDICATOR, useBraceBadLightIndicator ? 1 : 0, indicator); } /// Find the position of a matching brace or INVALID_POSITION if no match. (Scintilla feature 2353) public Position BraceMatch(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_BRACEMATCH, pos.Value, Unused); return new Position((int) res); } /// 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; } /// 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); } /// Retrieve a pointer to the document object. (Scintilla feature 2357) public IntPtr GetDocPointer() { return Win32.SendMessage(scintilla, SciMsg.SCI_GETDOCPOINTER, Unused, Unused); } /// Change the document object used. (Scintilla feature 2358) public void SetDocPointer(IntPtr pointer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETDOCPOINTER, Unused, pointer); } /// Set which document modification events are sent to the container. (Scintilla feature 2359) public void SetModEventMask(int mask) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMODEVENTMASK, mask, 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; } /// /// Set the column number of the edge. /// If text goes past the edge then it is highlighted. /// (Scintilla feature 2361) /// public void SetEdgeColumn(int column) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGECOLUMN, column, Unused); } /// Retrieve the edge highlight mode. (Scintilla feature 2362) public int GetEdgeMode() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETEDGEMODE, Unused, Unused); return (int) res; } /// /// The edge may be displayed by a line (EDGE_LINE) or by highlighting text that /// goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE). /// (Scintilla feature 2363) /// public void SetEdgeMode(int mode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEDGEMODE, mode, 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); } /// 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); } /// 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); } /// /// Find some text starting at the search anchor. /// Does not ensure the selection is visible. /// (Scintilla feature 2367) /// public unsafe int SearchNext(int flags, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHNEXT, flags, (IntPtr) textPtr); return (int) res; } } /// /// Find some text starting at the search anchor and moving backwards. /// Does not ensure the selection is visible. /// (Scintilla feature 2368) /// public unsafe int SearchPrev(int flags, string text) { fixed (byte* textPtr = Encoding.UTF8.GetBytes(text)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SEARCHPREV, flags, (IntPtr) textPtr); return (int) res; } } /// 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; } /// /// Set whether a pop up menu is displayed automatically when the user presses /// the wrong mouse button. /// (Scintilla feature 2371) /// public void UsePopUp(bool allowPopUp) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_USEPOPUP, allowPopUp ? 1 : 0, 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; } /// /// Set the zoom level. This number of points is added to the size of all fonts. /// It may be positive to magnify or negative to reduce. /// (Scintilla feature 2373) /// public void SetZoom(int zoom) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETZOOM, zoom, Unused); } /// Retrieve the zoom level. (Scintilla feature 2374) public int GetZoom() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETZOOM, Unused, Unused); return (int) res; } /// /// Create a new document object. /// Starts with reference count of 1 and not selected into editor. /// (Scintilla feature 2375) /// public int CreateDocument() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CREATEDOCUMENT, Unused, Unused); return (int) res; } /// Extend life of document. (Scintilla feature 2376) public void AddRefDocument(int doc) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDREFDOCUMENT, Unused, doc); } /// Release a reference to the document, deleting document if it fades to black. (Scintilla feature 2377) public void ReleaseDocument(int doc) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RELEASEDOCUMENT, Unused, doc); } /// Get which document modification events are sent to the container. (Scintilla feature 2378) public int GetModEventMask() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMODEVENTMASK, Unused, Unused); return (int) res; } /// Change internal focus flag. (Scintilla feature 2380) public void SetFocus(bool focus) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETFOCUS, focus ? 1 : 0, 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; } /// Change error status - 0 = OK. (Scintilla feature 2382) public void SetStatus(int statusCode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSTATUS, statusCode, Unused); } /// Get error status. (Scintilla feature 2383) public int GetStatus() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSTATUS, Unused, Unused); return (int) res; } /// 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); } /// 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; } /// Sets the cursor to one of the SC_CURSOR* values. (Scintilla feature 2386) public void SetCursor(int cursorType) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCURSOR, cursorType, Unused); } /// Get cursor type. (Scintilla feature 2387) public int GetCursor() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCURSOR, Unused, Unused); return (int) res; } /// /// Change the way control characters are displayed: /// If symbol is < 32, keep the drawn way, else, use the given character. /// (Scintilla feature 2388) /// public void SetControlCharSymbol(int symbol) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCONTROLCHARSYMBOL, symbol, 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; } /// Move to the previous change in capitalisation. (Scintilla feature 2390) public void WordPartLeft() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTLEFT, Unused, Unused); } /// /// Move to the previous change in capitalisation extending selection /// to new caret position. /// (Scintilla feature 2391) /// public void WordPartLeftExtend() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTLEFTEXTEND, Unused, Unused); } /// Move to the change next in capitalisation. (Scintilla feature 2392) public void WordPartRight() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTRIGHT, Unused, Unused); } /// /// Move to the next change in capitalisation extending selection /// to new caret position. /// (Scintilla feature 2393) /// public void WordPartRightExtend() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_WORDPARTRIGHTEXTEND, Unused, Unused); } /// /// Set the way the display area is determined when a particular line /// is to be moved to by Find, FindNext, GotoLine, etc. /// (Scintilla feature 2394) /// public void SetVisiblePolicy(int visiblePolicy, int visibleSlop) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVISIBLEPOLICY, visiblePolicy, 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); } /// 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); } /// Get and Set the xOffset (ie, horizontal scroll position). (Scintilla feature 2397) public void SetXOffset(int newOffset) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETXOFFSET, newOffset, Unused); } /// Get and Set 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; } /// 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); } /// Set the focus to this Scintilla widget. (Scintilla feature 2400) public void GrabFocus() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GRABFOCUS, Unused, Unused); } /// /// Set the way the caret is kept visible when going sideways. /// The exclusion zone is given in pixels. /// (Scintilla feature 2402) /// public void SetXCaretPolicy(int caretPolicy, int caretSlop) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETXCARETPOLICY, caretPolicy, caretSlop); } /// /// Set the way the line the caret is on is kept visible. /// The exclusion zone is given in lines. /// (Scintilla feature 2403) /// public void SetYCaretPolicy(int caretPolicy, int caretSlop) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETYCARETPOLICY, caretPolicy, caretSlop); } /// Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE). (Scintilla feature 2406) public void SetPrintWrapMode(int mode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPRINTWRAPMODE, mode, Unused); } /// Is printing line wrapped? (Scintilla feature 2407) public int GetPrintWrapMode() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPRINTWRAPMODE, Unused, Unused); return (int) res; } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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; } /// 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); } /// Get the HotspotSingleLine property (Scintilla feature 2497) public bool GetHotspotSingleLine() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETHOTSPOTSINGLELINE, Unused, Unused); return 1 == (int) res; } /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2413) public void ParaDown() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARADOWN, Unused, Unused); } /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2414) public void ParaDownExtend() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARADOWNEXTEND, Unused, Unused); } /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2415) public void ParaUp() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARAUP, Unused, Unused); } /// Move caret between paragraphs (delimited by empty lines). (Scintilla feature 2416) public void ParaUpExtend() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PARAUPEXTEND, Unused, Unused); } /// /// Given a valid document position, return the previous position taking code /// page into account. Returns 0 if passed 0. /// (Scintilla feature 2417) /// public Position PositionBefore(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONBEFORE, pos.Value, Unused); return new Position((int) res); } /// /// 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) /// public Position PositionAfter(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONAFTER, pos.Value, Unused); return new Position((int) res); } /// /// 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) /// public Position PositionRelative(Position pos, int relative) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_POSITIONRELATIVE, pos.Value, relative); return new Position((int) res); } /// Copy a range of text to the clipboard. Positions are clipped into the document. (Scintilla feature 2419) public void CopyRange(Position start, Position end) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COPYRANGE, start.Value, end.Value); } /// Copy argument text to the clipboard. (Scintilla feature 2420) 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); } } /// /// Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or /// by lines (SC_SEL_LINES). /// (Scintilla feature 2422) /// public void SetSelectionMode(int mode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONMODE, mode, Unused); } /// Get the mode of the current selection. (Scintilla feature 2423) public int GetSelectionMode() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONMODE, Unused, Unused); return (int) res; } /// 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) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESELSTARTPOSITION, line, Unused); return new Position((int) res); } /// 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) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINESELENDPOSITION, line, Unused); return new Position((int) res); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// /// Move caret to before first visible character on line. /// If already there move to first character on line. /// In either case, extend rectangular selection to new caret position. /// (Scintilla feature 2431) /// public void VCHomeRectExtend() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMERECTEXTEND, Unused, 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// 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); } /// /// Set the set of characters making up whitespace for when moving or selecting by word. /// Should be called after SetWordChars. /// (Scintilla feature 2443) /// public unsafe void SetWhitespaceChars(string characters) { fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETWHITESPACECHARS, Unused, (IntPtr) charactersPtr); } } /// Get the set of characters making up whitespace for when moving or selecting by word. (Scintilla feature 2647) public unsafe string GetWhitespaceChars() { byte[] charactersBuffer = new byte[10000]; fixed (byte* charactersPtr = charactersBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETWHITESPACECHARS, Unused, (IntPtr) charactersPtr); return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0'); } } /// /// Set the set of characters making up punctuation characters /// Should be called after SetWordChars. /// (Scintilla feature 2648) /// public unsafe void SetPunctuationChars(string characters) { fixed (byte* charactersPtr = Encoding.UTF8.GetBytes(characters)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETPUNCTUATIONCHARS, Unused, (IntPtr) charactersPtr); } } /// Get the set of characters making up punctuation characters (Scintilla feature 2649) public unsafe string GetPunctuationChars() { byte[] charactersBuffer = new byte[10000]; fixed (byte* charactersPtr = charactersBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPUNCTUATIONCHARS, Unused, (IntPtr) charactersPtr); return Encoding.UTF8.GetString(charactersBuffer).TrimEnd('\0'); } } /// 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); } /// 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; } /// /// Get currently selected item text in the auto-completion list /// Returns the length of the item text /// Result is NUL-terminated. /// (Scintilla feature 2610) /// public unsafe string AutoCGetCurrentText() { byte[] sBuffer = new byte[10000]; fixed (byte* sPtr = sBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCURRENTTEXT, Unused, (IntPtr) sPtr); return Encoding.UTF8.GetString(sBuffer).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) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR, behaviour, Unused); } /// Get auto-completion case insensitive behaviour. (Scintilla feature 2635) public int AutoCGetCaseInsensitiveBehaviour() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR, Unused, Unused); return (int) res; } /// Change the effect of autocompleting when there are multiple selections. (Scintilla feature 2636) public void AutoCSetMulti(int multi) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETMULTI, multi, Unused); } /// Retrieve the effect of autocompleting when there are multiple selections.. (Scintilla feature 2637) public int AutoCGetMulti() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETMULTI, Unused, Unused); return (int) res; } /// Set the way autocompletion lists are ordered. (Scintilla feature 2660) public void AutoCSetOrder(int order) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCSETORDER, order, Unused); } /// Get the way autocompletion lists are ordered. (Scintilla feature 2661) public int AutoCGetOrder() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_AUTOCGETORDER, Unused, Unused); return (int) res; } /// 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); } /// /// Returns the target converted to UTF8. /// Return the length in bytes. /// (Scintilla feature 2447) /// public unsafe string TargetAsUTF8() { byte[] sBuffer = new byte[10000]; fixed (byte* sPtr = sBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_TARGETASUTF8, Unused, (IntPtr) sPtr); return Encoding.UTF8.GetString(sBuffer).TrimEnd('\0'); } } /// /// Set the length of the utf8 argument for calling EncodedFromUTF8. /// Set to -1 and the string will be measured to the first nul. /// (Scintilla feature 2448) /// public void SetLengthForEncode(int bytes) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLENGTHFORENCODE, bytes, Unused); } /// /// Translates a UTF8 string into the document encoding. /// Return the length of the result in bytes. /// On error return 0. /// (Scintilla feature 2449) /// public unsafe string EncodedFromUTF8(string utf8) { fixed (byte* utf8Ptr = Encoding.UTF8.GetBytes(utf8)) { byte[] encodedBuffer = new byte[10000]; fixed (byte* encodedPtr = encodedBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ENCODEDFROMUTF8, (IntPtr) utf8Ptr, (IntPtr) encodedPtr); return Encoding.UTF8.GetString(encodedBuffer).TrimEnd('\0'); } } } /// /// Translates a UTF8 string into the document encoding. /// Return the length of the result in bytes. /// On error return 0. /// (Scintilla feature 2449) /// public unsafe int EncodedFromUTF8Len(string utf8) { fixed (byte* utf8Ptr = Encoding.UTF8.GetBytes(utf8)) { byte[] encodedBuffer = new byte[10000]; fixed (byte* encodedPtr = encodedBuffer) { var res = Win32.SendMessage(scintilla, SciMsg.SCI_ENCODEDFROMUTF8, (IntPtr)utf8Ptr, (IntPtr)encodedPtr); return res.ToInt32(); } } } /// /// Find the position of a column on a line taking into account tabs and /// multi-byte characters. If beyond end of line, return line end position. /// (Scintilla feature 2456) /// public int FindColumn(int line, int column) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDCOLUMN, line, column); return (int) res; } /// Can the caret preferred x position only be changed by explicit movement commands? (Scintilla feature 2457) public int GetCaretSticky() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETSTICKY, Unused, Unused); return (int) res; } /// Stop the caret preferred x position changing when the user types. (Scintilla feature 2458) public void SetCaretSticky(int useCaretStickyBehaviour) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETSTICKY, useCaretStickyBehaviour, 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); } /// 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); } /// 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; } /// 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); } /// Set background alpha of the caret line. (Scintilla feature 2470) public void SetCaretLineBackAlpha(int alpha) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETLINEBACKALPHA, alpha, Unused); } /// Get the background alpha of the caret line. (Scintilla feature 2471) public int GetCaretLineBackAlpha() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETLINEBACKALPHA, Unused, Unused); return (int) res; } /// Set the style of the caret to be drawn. (Scintilla feature 2512) public void SetCaretStyle(int caretStyle) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETCARETSTYLE, caretStyle, Unused); } /// Returns the current style of the caret. (Scintilla feature 2513) public int GetCaretStyle() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETCARETSTYLE, Unused, Unused); return (int) res; } /// 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); } /// Get the current indicator (Scintilla feature 2501) public int GetIndicatorCurrent() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETINDICATORCURRENT, Unused, Unused); return (int) res; } /// Set the value used for IndicatorFillRange (Scintilla feature 2502) public void SetIndicatorValue(int value) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETINDICATORVALUE, value, 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; } /// Turn a indicator on over a range. (Scintilla feature 2504) public void IndicatorFillRange(int position, int fillLength) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORFILLRANGE, position, fillLength); } /// Turn a indicator off over a range. (Scintilla feature 2505) public void IndicatorClearRange(int position, int clearLength) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORCLEARRANGE, position, clearLength); } /// Are any indicators present at position? (Scintilla feature 2506) public int IndicatorAllOnFor(int position) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORALLONFOR, position, Unused); return (int) res; } /// What value does a particular indicator have at at a position? (Scintilla feature 2507) public int IndicatorValueAt(int indicator, int position) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORVALUEAT, indicator, position); return (int) res; } /// Where does a particular indicator start? (Scintilla feature 2508) public int IndicatorStart(int indicator, int position) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATORSTART, indicator, position); return (int) res; } /// Where does a particular indicator end? (Scintilla feature 2509) public int IndicatorEnd(int indicator, int position) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICATOREND, indicator, position); return (int) res; } /// 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); } /// 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; } /// 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); } /// /// Compact the document buffer and return a read-only pointer to the /// characters in the document. /// (Scintilla feature 2520) /// public IntPtr GetCharacterPointer() { return Win32.SendMessage(scintilla, SciMsg.SCI_GETCHARACTERPOINTER, Unused, 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. /// (Scintilla feature 2643) /// public IntPtr GetRangePointer(int position, int rangeLength) { return Win32.SendMessage(scintilla, SciMsg.SCI_GETRANGEPOINTER, position, rangeLength); } /// /// Return a position which, to avoid performance costs, should not be within /// the range of a call to GetRangePointer. /// (Scintilla feature 2644) /// public Position GetGapPosition() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETGAPPOSITION, Unused, Unused); return new Position((int) res); } /// Set the alpha fill colour of the given indicator. (Scintilla feature 2523) public void IndicSetAlpha(int indicator, int alpha) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETALPHA, indicator, alpha); } /// Get the alpha fill colour of the given indicator. (Scintilla feature 2524) public int IndicGetAlpha(int indicator) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETALPHA, indicator, Unused); return (int) res; } /// Set the alpha outline colour of the given indicator. (Scintilla feature 2558) public void IndicSetOutlineAlpha(int indicator, int alpha) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICSETOUTLINEALPHA, indicator, alpha); } /// Get the alpha outline colour of the given indicator. (Scintilla feature 2559) public int IndicGetOutlineAlpha(int indicator) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_INDICGETOUTLINEALPHA, indicator, Unused); return (int) res; } /// Set extra ascent for each line (Scintilla feature 2525) public void SetExtraAscent(int extraAscent) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEXTRAASCENT, extraAscent, 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; } /// Set extra descent for each line (Scintilla feature 2527) public void SetExtraDescent(int extraDescent) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETEXTRADESCENT, extraDescent, 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; } /// 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; } /// Set the text in the text margin for a line (Scintilla feature 2530) 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); } } /// Get the text in the text margin for a line (Scintilla feature 2531) 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); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } /// 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); } /// 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; } /// Set the style in the text margin for a line (Scintilla feature 2534) 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); } } /// Get the styles in the text margin for a line (Scintilla feature 2535) 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); return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0'); } } /// Clear the margin text on all lines (Scintilla feature 2536) public void MarginTextClearAll() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_MARGINTEXTCLEARALL, Unused, 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); } /// 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; } /// Set the margin options. (Scintilla feature 2539) public void SetMarginOptions(int marginOptions) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMARGINOPTIONS, marginOptions, Unused); } /// Get the margin options. (Scintilla feature 2557) public int GetMarginOptions() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETMARGINOPTIONS, Unused, Unused); return (int) res; } /// Set the annotation text for a line (Scintilla feature 2540) 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); } } /// Get the annotation text for a line (Scintilla feature 2541) 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); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } /// 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); } /// 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; } /// Set the annotation styles for a line (Scintilla feature 2544) 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); } } /// Get the annotation styles for a line (Scintilla feature 2545) 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); return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0'); } } /// 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; } /// Clear the annotations from all lines (Scintilla feature 2547) public void AnnotationClearAll() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONCLEARALL, Unused, Unused); } /// Set the visibility for the annotations for a view (Scintilla feature 2548) public void AnnotationSetVisible(int visible) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONSETVISIBLE, visible, Unused); } /// Get the visibility for the annotations for a view (Scintilla feature 2549) public int AnnotationGetVisible() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ANNOTATIONGETVISIBLE, Unused, Unused); return (int) res; } /// 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); } /// 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; } /// Release all extended (>255) style numbers (Scintilla feature 2552) public void ReleaseAllExtendedStyles() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_RELEASEALLEXTENDEDSTYLES, Unused, 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; } /// Add a container action to the undo stack (Scintilla feature 2560) public void AddUndoAction(int token, int flags) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDUNDOACTION, token, flags); } /// Find the position of a character from a point within the window. (Scintilla feature 2561) public Position CharPositionFromPoint(int x, int y) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARPOSITIONFROMPOINT, x, y); return new Position((int) res); } /// /// Find the position of a character from a point within the window. /// Return INVALID_POSITION if not close to text. /// (Scintilla feature 2562) /// public Position CharPositionFromPointClose(int x, int y) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHARPOSITIONFROMPOINTCLOSE, x, y); return new Position((int) res); } /// 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); } /// 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; } /// 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); } /// 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; } /// 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); } /// 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; } /// 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); } /// 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; } /// Set whether additional carets are visible (Scintilla feature 2608) public void SetAdditionalCaretsVisible(bool additionalCaretsBlink) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALCARETSVISIBLE, additionalCaretsBlink ? 1 : 0, 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; } /// How many selections are there? (Scintilla feature 2570) public int GetSelections() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONS, Unused, Unused); return (int) res; } /// 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; } /// Clear selections to a single empty stream selection (Scintilla feature 2571) public void ClearSelections() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARSELECTIONS, Unused, Unused); } /// Set a simple selection (Scintilla feature 2572) public int SetSelection(int caret, int anchor) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTION, caret, anchor); return (int) res; } /// Add a selection (Scintilla feature 2573) public int AddSelection(int caret, int anchor) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ADDSELECTION, caret, anchor); return (int) res; } /// Drop one selection (Scintilla feature 2671) public void DropSelectionN(int selection) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DROPSELECTIONN, selection, Unused); } /// Set the main selection (Scintilla feature 2574) public void SetMainSelection(int selection) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETMAINSELECTION, selection, 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; } /// Which selection is the main selection (Scintilla feature 2576) public void SetSelectionNCaret(int selection, Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNCARET, selection, pos.Value); } /// Which selection is the main selection (Scintilla feature 2577) public Position GetSelectionNCaret(int selection) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNCARET, selection, Unused); return new Position((int) res); } /// Which selection is the main selection (Scintilla feature 2578) public void SetSelectionNAnchor(int selection, Position posAnchor) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNANCHOR, selection, posAnchor.Value); } /// Which selection is the main selection (Scintilla feature 2579) public Position GetSelectionNAnchor(int selection) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNANCHOR, selection, Unused); return new Position((int) res); } /// Which selection is the main selection (Scintilla feature 2580) public void SetSelectionNCaretVirtualSpace(int selection, int space) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNCARETVIRTUALSPACE, selection, space); } /// Which selection is the main selection (Scintilla feature 2581) public int GetSelectionNCaretVirtualSpace(int selection) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNCARETVIRTUALSPACE, selection, Unused); return (int) res; } /// Which selection is the main selection (Scintilla feature 2582) public void SetSelectionNAnchorVirtualSpace(int selection, int space) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNANCHORVIRTUALSPACE, selection, space); } /// Which selection is the main selection (Scintilla feature 2583) public int GetSelectionNAnchorVirtualSpace(int selection) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNANCHORVIRTUALSPACE, selection, Unused); return (int) res; } /// Sets the position that starts the selection - this becomes the anchor. (Scintilla feature 2584) public void SetSelectionNStart(int selection, Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNSTART, selection, pos.Value); } /// Returns the position at the start of the selection. (Scintilla feature 2585) public Position GetSelectionNStart(int selection) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNSTART, selection, Unused); return new Position((int) res); } /// Sets the position that ends the selection - this becomes the currentPosition. (Scintilla feature 2586) public void SetSelectionNEnd(int selection, Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETSELECTIONNEND, selection, pos.Value); } /// Returns the position at the end of the selection. (Scintilla feature 2587) public Position GetSelectionNEnd(int selection) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSELECTIONNEND, selection, Unused); return new Position((int) res); } /// Returns the position at the end of the selection. (Scintilla feature 2588) public void SetRectangularSelectionCaret(Position pos) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONCARET, pos.Value, Unused); } /// Returns the position at the end of the selection. (Scintilla feature 2589) public Position GetRectangularSelectionCaret() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONCARET, Unused, Unused); return new Position((int) res); } /// Returns the position at the end of the selection. (Scintilla feature 2590) public void SetRectangularSelectionAnchor(Position posAnchor) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONANCHOR, posAnchor.Value, Unused); } /// Returns the position at the end of the selection. (Scintilla feature 2591) public Position GetRectangularSelectionAnchor() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONANCHOR, Unused, Unused); return new Position((int) res); } /// Returns the position at the end of the selection. (Scintilla feature 2592) public void SetRectangularSelectionCaretVirtualSpace(int space) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE, space, Unused); } /// Returns the position at the end of the selection. (Scintilla feature 2593) public int GetRectangularSelectionCaretVirtualSpace() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, Unused, Unused); return (int) res; } /// Returns the position at the end of the selection. (Scintilla feature 2594) public void SetRectangularSelectionAnchorVirtualSpace(int space) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, space, Unused); } /// Returns the position at the end of the selection. (Scintilla feature 2595) public int GetRectangularSelectionAnchorVirtualSpace() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, Unused, Unused); return (int) res; } /// Returns the position at the end of the selection. (Scintilla feature 2596) public void SetVirtualSpaceOptions(int virtualSpaceOptions) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETVIRTUALSPACEOPTIONS, virtualSpaceOptions, Unused); } /// Returns the position at the end of the selection. (Scintilla feature 2597) public int GetVirtualSpaceOptions() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETVIRTUALSPACEOPTIONS, Unused, Unused); return (int) res; } /// /// On GTK+, allow selecting the modifier key to use for mouse-based /// rectangular selection. Often the window manager requires Alt+Mouse Drag /// for moving windows. /// Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER. /// (Scintilla feature 2598) /// public void SetRectangularSelectionModifier(int modifier) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETRECTANGULARSELECTIONMODIFIER, modifier, 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; } /// /// Set the foreground colour of additional selections. /// Must have previously called SetSelFore with non-zero first argument for this to have an effect. /// (Scintilla feature 2600) /// public void SetAdditionalSelFore(Colour fore) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELFORE, fore.Value, Unused); } /// /// Set the background colour of additional selections. /// Must have previously called SetSelBack with non-zero first argument for this to have an effect. /// (Scintilla feature 2601) /// public void SetAdditionalSelBack(Colour back) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELBACK, back.Value, Unused); } /// Set the alpha of the selection. (Scintilla feature 2602) public void SetAdditionalSelAlpha(int alpha) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETADDITIONALSELALPHA, alpha, Unused); } /// Get the alpha of the selection. (Scintilla feature 2603) public int GetAdditionalSelAlpha() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETADDITIONALSELALPHA, Unused, Unused); return (int) res; } /// 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); } /// 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); } /// Set the main selection to the next selection. (Scintilla feature 2606) public void RotateSelection() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_ROTATESELECTION, Unused, 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); } /// /// 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) /// public int ChangeLexerState(Position start, Position end) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CHANGELEXERSTATE, start.Value, end.Value); return (int) res; } /// /// Find the next line at or after lineStart that is a contracted fold header line. /// Return -1 when no more lines. /// (Scintilla feature 2618) /// public int ContractedFoldNext(int lineStart) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CONTRACTEDFOLDNEXT, lineStart, Unused); return (int) res; } /// Centre current line in window. (Scintilla feature 2619) public void VerticalCentreCaret() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VERTICALCENTRECARET, Unused, 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); } /// 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); } /// 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); } /// Get the identifier. (Scintilla feature 2623) public int GetIdentifier() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETIDENTIFIER, Unused, Unused); return (int) res; } /// 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); } /// 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); } /// 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); } /// /// Define a marker from RGBA data. /// It has the width and height from RGBAImageSetWidth/Height /// (Scintilla feature 2626) /// 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); } } /// /// Register an RGBA image for use in autocompletion lists. /// It has the width and height from RGBAImageSetWidth/Height /// (Scintilla feature 2627) /// 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); } } /// Scroll to start of document. (Scintilla feature 2628) public void ScrollToStart() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLTOSTART, Unused, Unused); } /// Scroll to end of document. (Scintilla feature 2629) public void ScrollToEnd() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SCROLLTOEND, Unused, Unused); } /// Set the technology used. (Scintilla feature 2630) public void SetTechnology(int technology) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETTECHNOLOGY, technology, Unused); } /// Get the tech. (Scintilla feature 2631) public int GetTechnology() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETTECHNOLOGY, Unused, Unused); return (int) res; } /// Create an ILoader*. (Scintilla feature 2632) public int CreateLoader(int bytes) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CREATELOADER, bytes, Unused); return (int) res; } /// On OS X, show a find indicator. (Scintilla feature 2640) public void FindIndicatorShow(Position start, Position end) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORSHOW, start.Value, end.Value); } /// On OS X, flash a find indicator, then fade out. (Scintilla feature 2641) public void FindIndicatorFlash(Position start, Position end) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORFLASH, start.Value, end.Value); } /// On OS X, hide the find indicator. (Scintilla feature 2642) public void FindIndicatorHide() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FINDINDICATORHIDE, Unused, Unused); } /// /// Move caret to before first visible character on display line. /// If already there move to first character on display line. /// (Scintilla feature 2652) /// public void VCHomeDisplay() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_VCHOMEDISPLAY, Unused, 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); } /// 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; } /// 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); } /// 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) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLINEENDTYPESALLOWED, lineEndBitSet, Unused); } /// Get the line end types currently allowed. (Scintilla feature 2657) public int GetLineEndTypesAllowed() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESALLOWED, Unused, Unused); return (int) res; } /// 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() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESACTIVE, Unused, Unused); return (int) res; } /// Set the way a character is drawn. (Scintilla feature 2665) public unsafe void SetRepresentation(string encodedCharacter, string representation) { fixed (byte* encodedCharacterPtr = Encoding.UTF8.GetBytes(encodedCharacter)) { fixed (byte* representationPtr = Encoding.UTF8.GetBytes(representation)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) representationPtr); } } } /// /// Set the way a character is drawn. /// Result is NUL-terminated. /// (Scintilla feature 2666) /// public unsafe string GetRepresentation(string encodedCharacter) { fixed (byte* encodedCharacterPtr = Encoding.UTF8.GetBytes(encodedCharacter)) { byte[] representationBuffer = new byte[10000]; fixed (byte* representationPtr = representationBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETREPRESENTATION, (IntPtr) encodedCharacterPtr, (IntPtr) representationPtr); return Encoding.UTF8.GetString(representationBuffer).TrimEnd('\0'); } } } /// Remove a character representation. (Scintilla feature 2667) public unsafe void ClearRepresentation(string encodedCharacter) { fixed (byte* encodedCharacterPtr = Encoding.UTF8.GetBytes(encodedCharacter)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_CLEARREPRESENTATION, (IntPtr) encodedCharacterPtr, 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); } /// 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); } /// 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); } /// 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; } /// Colourise a segment of the document using the current lexing language. (Scintilla feature 4003) public void Colourise(Position start, Position end) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_COLOURISE, start.Value, end.Value); } /// Set up a value that may be used by a lexer for some optional feature. (Scintilla feature 4004) public unsafe void SetProperty(string key, string value) { fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key)) { fixed (byte* valuePtr = Encoding.UTF8.GetBytes(value)) { IntPtr res = 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) { fixed (byte* keyWordsPtr = Encoding.UTF8.GetBytes(keyWords)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETKEYWORDS, keywordSet, (IntPtr) keyWordsPtr); } } /// Set the lexing language of the document based on string name. (Scintilla feature 4006) public unsafe void SetLexerLanguage(string language) { fixed (byte* languagePtr = Encoding.UTF8.GetBytes(language)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETLEXERLANGUAGE, Unused, (IntPtr) languagePtr); } } /// Load a lexer library (dll / so). (Scintilla feature 4007) public unsafe void LoadLexerLibrary(string path) { fixed (byte* pathPtr = Encoding.UTF8.GetBytes(path)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_LOADLEXERLIBRARY, Unused, (IntPtr) pathPtr); } } /// /// Retrieve a "property" value previously set with SetProperty. /// Result is NUL-terminated. /// (Scintilla feature 4008) /// public unsafe string GetProperty(string key) { fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key)) { byte[] bufBuffer = new byte[10000]; fixed (byte* bufPtr = bufBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTY, (IntPtr) keyPtr, (IntPtr) bufPtr); return Encoding.UTF8.GetString(bufBuffer).TrimEnd('\0'); } } } /// /// Retrieve a "property" value previously set with SetProperty, /// with "$()" variable replacement on returned buffer. /// Result is NUL-terminated. /// (Scintilla feature 4009) /// public unsafe string GetPropertyExpanded(string key) { fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key)) { byte[] bufBuffer = new byte[10000]; fixed (byte* bufPtr = bufBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTYEXPANDED, (IntPtr) keyPtr, (IntPtr) bufPtr); return Encoding.UTF8.GetString(bufBuffer).TrimEnd('\0'); } } } /// /// Retrieve a "property" value previously set with SetProperty, /// interpreted as an int AFTER any "$()" variable replacement. /// (Scintilla feature 4010) /// public unsafe int GetPropertyInt(string key) { fixed (byte* keyPtr = Encoding.UTF8.GetBytes(key)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETPROPERTYINT, (IntPtr) keyPtr, Unused); return (int) res; } } /// 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. /// Result is NUL-terminated. /// (Scintilla feature 4012) /// public unsafe string GetLexerLanguage() { byte[] textBuffer = new byte[10000]; fixed (byte* textPtr = textBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLEXERLANGUAGE, Unused, (IntPtr) textPtr); return Encoding.UTF8.GetString(textBuffer).TrimEnd('\0'); } } /// For private communication between an application and a known lexer. (Scintilla feature 4013) public int PrivateLexerCall(int operation, int pointer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PRIVATELEXERCALL, operation, pointer); return (int) res; } /// /// Retrieve a '\n' separated list of properties understood by the current lexer. /// Result is NUL-terminated. /// (Scintilla feature 4014) /// public unsafe string PropertyNames() { byte[] namesBuffer = new byte[10000]; fixed (byte* namesPtr = namesBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PROPERTYNAMES, 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) { fixed (byte* namePtr = Encoding.UTF8.GetBytes(name)) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_PROPERTYTYPE, (IntPtr) namePtr, Unused); return (int) res; } } /// /// Describe a property. /// Result is NUL-terminated. /// (Scintilla feature 4016) /// public unsafe string DescribeProperty(string name) { fixed (byte* namePtr = Encoding.UTF8.GetBytes(name)) { byte[] descriptionBuffer = new byte[10000]; fixed (byte* descriptionPtr = descriptionBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIBEPROPERTY, (IntPtr) namePtr, (IntPtr) descriptionPtr); return Encoding.UTF8.GetString(descriptionBuffer).TrimEnd('\0'); } } } /// /// Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer. /// Result is NUL-terminated. /// (Scintilla feature 4017) /// public unsafe string DescribeKeyWordSets() { byte[] descriptionsBuffer = new byte[10000]; fixed (byte* descriptionsPtr = descriptionsBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DESCRIBEKEYWORDSETS, Unused, (IntPtr) descriptionsPtr); return Encoding.UTF8.GetString(descriptionsBuffer).TrimEnd('\0'); } } /// /// Bit set of LineEndType enumertion for which line ends beyond the standard /// LF, CR, and CRLF are supported by the lexer. /// (Scintilla feature 4018) /// public int GetLineEndTypesSupported() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETLINEENDTYPESSUPPORTED, Unused, Unused); return (int) res; } /// 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; } /// 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; } /// 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; } /// 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; } /// 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; } /// Free allocated sub styles (Scintilla feature 4023) public void FreeSubStyles() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_FREESUBSTYLES, Unused, Unused); } /// Set the identifiers that are shown in a particular style (Scintilla feature 4024) 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); } } /// /// Where styles are duplicated by a feature such as active/inactive code /// return the distance between the two types. /// (Scintilla feature 4025) /// public int DistanceToSecondaryStyles() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_DISTANCETOSECONDARYSTYLES, Unused, Unused); return (int) res; } /// /// Get the set of base styles that can be extended with sub styles /// Result is NUL-terminated. /// (Scintilla feature 4026) /// public unsafe string GetSubStyleBases() { byte[] stylesBuffer = new byte[10000]; fixed (byte* stylesPtr = stylesBuffer) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETSUBSTYLEBASES, Unused, (IntPtr) stylesPtr); return Encoding.UTF8.GetString(stylesBuffer).TrimEnd('\0'); } } /// /// Deprecated in 2.30 /// In palette mode? /// (Scintilla feature 2139) /// public bool GetUsePalette() { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_GETUSEPALETTE, Unused, Unused); return 1 == (int) res; } /// /// In palette mode, Scintilla uses the environment's palette calls to display /// more colours. This may lead to ugly displays. /// (Scintilla feature 2039) /// public void SetUsePalette(bool usePalette) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETUSEPALETTE, usePalette ? 1 : 0, Unused); } /// /// Deprecated in 3.5.5 /// Always interpret keyboard input as Unicode /// (Scintilla feature 2521) /// public void SetKeysUnicode(bool keysUnicode) { IntPtr res = Win32.SendMessage(scintilla, SciMsg.SCI_SETKEYSUNICODE, keysUnicode ? 1 : 0, 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; } /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ } }