Skip to content
Snippets Groups Projects
scintilla.rb 135 KiB
Newer Older
# This file is automatically generated from Scintilla.iface
# DO NOT MODIFY

module Fox
  class FXScintilla
Lars Kanis's avatar
Lars Kanis committed
    # 







    # Basics

    INVALID_POSITION = -1
    # Define start of Scintilla messages to be greater than all Windows edit (EM_*) messages
    # as many EM_ messages can be used although that use is deprecated.
    SCI_START = 2000
    SCI_OPTIONAL_START = 3000
    SCI_LEXER_START = 4000

    # Add text to the document at current position.
    def addText(length, text)
      sendMessage(2001, length, text)
    end

    # Add array of cells to document.
    def addStyledText(length, c)
      sendMessage(2002, length, c)
    end

    # Insert string at a position.
    def insertText(pos, text)
      sendMessage(2003, pos, text)
    end

    # Delete all text in the document.
    def clearAll
      sendMessage(2004, 0, 0)
    end

    # Set all style bytes to 0, remove all folding information.
    def clearDocumentStyle
      sendMessage(2005, 0, 0)
    end

    # Returns the number of bytes in the document.
    def getLength
      sendMessage(2006, 0, 0)
    end

    # Returns the character byte at the position.
    def getCharAt(pos)
      sendMessage(2007, pos, 0)
    end

    # Returns the position of the caret.
    def getCurrentPos
      sendMessage(2008, 0, 0)
    end

    # Returns the position of the opposite end of the selection to the caret.
    def getAnchor
      sendMessage(2009, 0, 0)
    end

    # Returns the style byte at the position.
    def getStyleAt(pos)
      sendMessage(2010, pos, 0)
    end

    # Redoes the next action on the undo history.
    def redo
      sendMessage(2011, 0, 0)
    end

    # Choose between collecting actions into the undo
    # history and discarding them.
    def setUndoCollection(collectUndo)
      sendMessage(2012, collectUndo, 0)
    end

    # Select all the text in the document.
    def selectAll
      sendMessage(2013, 0, 0)
    end

    # Remember the current position in the undo history as the position
    # at which the document was saved.
    def setSavePoint
      sendMessage(2014, 0, 0)
    end

    # Retrieve a buffer of cells.
    # Returns the number of bytes in the buffer not including terminating NULs.
    def getStyledText(tr)
      sendMessage(2015, 0, tr)
    end

    # Are there any redoable actions in the undo history?
    def canRedo
      sendMessage(2016, 0, 0) == 1 ? true : false
    end

    # Retrieve the line number at which a particular marker is located.
    def markerLineFromHandle(handle)
      sendMessage(2017, handle, 0)
    end

    # Delete a marker.
    def markerDeleteHandle(handle)
      sendMessage(2018, handle, 0)
    end

    # Is undo history being collected?
    def getUndoCollection
      sendMessage(2019, 0, 0) == 1 ? true : false
    end

    SCWS_INVISIBLE = 0
    SCWS_VISIBLEALWAYS = 1
    SCWS_VISIBLEAFTERINDENT = 2

    # Are white space characters currently visible?
    # Returns one of SCWS_* constants.
    def getViewWS
      sendMessage(2020, 0, 0)
    end

    # Make white space characters invisible, always visible or visible outside indentation.
    def setViewWS(viewWS)
      sendMessage(2021, viewWS, 0)
    end

    # Find the position from a point within the window.
    def positionFromPoint(x, y)
      sendMessage(2022, x, y)
    end

    # Find the position from a point within the window but return
    # INVALID_POSITION if not close to text.
    def positionFromPointClose(x, y)
      sendMessage(2023, x, y)
    end

    # Set caret to start of a line and ensure it is visible.
    def gotoLine(line)
      sendMessage(2024, line, 0)
    end

    # Set caret to a position and ensure it is visible.
    def gotoPos(pos)
      sendMessage(2025, pos, 0)
    end

    # Set the selection anchor to a position. The anchor is the opposite
    # end of the selection from the caret.
    def setAnchor(posAnchor)
      sendMessage(2026, posAnchor, 0)
    end

    # Retrieve the text of the line containing the caret.
    # Returns the index of the caret on the line.
    def getCurLine(length)
      buffer = "".ljust(length)
      sendMessage(2027, length, buffer)
      buffer
    end

    # Retrieve the position of the last correctly styled character.
    def getEndStyled
      sendMessage(2028, 0, 0)
    end

    SC_EOL_CRLF = 0
    SC_EOL_CR = 1
    SC_EOL_LF = 2

    # Convert all line endings in the document to one mode.
    def convertEOLs(eolMode)
      sendMessage(2029, eolMode, 0)
    end

    # Retrieve the current end of line mode - one of CRLF, CR, or LF.
    def getEOLMode
      sendMessage(2030, 0, 0)
    end

    # Set the current end of line mode.
    def setEOLMode(eolMode)
      sendMessage(2031, eolMode, 0)
    end

    # 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.
    def startStyling(pos, mask)
      sendMessage(2032, pos, mask)
    end

Loading
Loading full blame...