ConsoleDriver

public class ConsoleDriver

Base class for implementing text drivers.

Currently there is a Curses implementation, but an implementation that does not rely on Curses and that purely uses Terminfo would be desirable, as well as a Windows console one

  • Adds a rune at the current cursor position, not expected to work with graphemes, use when you know that the value being added will not compose

    Declaration

    Swift

    public func addRune(_ rune: rune)
  • Adds a specified character at the current cursor position

    Declaration

    Swift

    public func addCharacter(_ char: Character)
  • Adds the specified string at the current cursor position

    Declaration

    Swift

    public func addStr(_ str: String)

    Parameters

    str

    the string to add to print at the current position

  • Moves the cursor to the screen to the specified column and row

    Declaration

    Swift

    public func moveTo(col: Int, row: Int)
  • This method takes the platform-agnostic Color enumeration for foreground and background and produces an attribute

    Declaration

    Swift

    public func makeAttribute(fore: Color, back: Color, flags: CellFlags = []) -> Attribute
  • Enumeration describing the kind of colors available to the application that range from black and white to a complete user-settable palette of colors

    See more

    Declaration

    Swift

    public enum ColorSupport
  • Returns the available color options for the current driver

    On some Unix terminals, there is only black and white available, others support 16 colors, others can support a larger range by setting the colors using an RGB set of properties.

    Declaration

    Swift

    public func colorSupport() -> ColorSupport
  • Sets the current attribute used to draw, any subsequence text output will use the specified attribute

    Declaration

    Swift

    public func setAttribute(_ attr: Attribute)
  • Should suspend execution of the application on Unix (implements Control-Z)

    Declaration

    Swift

    @discardableResult
    public func suspend() -> Bool

    Return Value

    True if the application did suspend

  • Redraws the physical screen with the contents that have been queued up via any of the printing commands.

    Declaration

    Swift

    public func updateScreen()
  • Updates the screen to reflect all the changes that have been done to the display buffer

    Declaration

    Swift

    public func refresh()
  • Updates the location of the cursor position

    Declaration

    Swift

    public func updateCursor()
  • Ends the execution of the console driver.

    Declaration

    Swift

    public func end()
  • Undocumented

    Declaration

    Swift

    public func cookMouse()
  • Undocumented

    Declaration

    Swift

    public func uncookMouse()