vty-5.1.1: A simple terminal UI library

Safe HaskellNone

Graphics.Vty.Picture

Description

The Picture data structure is representative of the final terminal view.

A Picture is a background paired with a layer of Images.

Synopsis

Documentation

data Picture Source

The type of images to be displayed using update.

Can be constructed directly or using picForImage. Which provides an initial instance with reasonable defaults for picCursor and picBackground.

Constructors

Picture 

emptyPicture :: PictureSource

a picture with no cursor, background or image layers

addToTop :: Picture -> Image -> PictureSource

The given Image is added as the top layer of the Picture

addToBottom :: Picture -> Image -> PictureSource

The given Image is added as the bottom layer of the Picture

picForImage :: Image -> PictureSource

Create a picture for display for the given image. The picture will not have a displayed cursor and no background pattern (ClearBackground) will be used.

picForLayers :: [Image] -> PictureSource

Create a picture for display with the given layers. Ordered top to bottom.

The picture will not have a displayed cursor and no background apttern (ClearBackgroun) will be used.

The first Image is the top layer.

data Cursor Source

A picture can be configured either to not show the cursor or show the cursor at the specified character position.

There is not a 1 to 1 map from character positions to a row and column on the screen due to characters that take more than 1 column.

todo: The Cursor can be given a (character,row) offset outside of the visible bounds of the output region. In this case the cursor will not be shown.

Constructors

NoCursor 
Cursor Int Int 

Instances

data Background Source

A Picture has a background pattern. The background is either ClearBackground. Which shows the layer below or is blank if the bottom layer. Or the background pattern is a character and a display attribute. If the display attribute used previously should be used for a background fill then use currentAttr for the background attribute.

todo The current attribute is always set to the default attributes at the start of updating the screen to a picture.

Constructors

Background 
ClearBackground

A ClearBackground is:

  • the space character if there are remaining non-skip ops
  • End of line if there are no remaining non-skip ops.

Instances

picImage :: Picture -> ImageSource

Compatibility with applications that do not use more than a single layer.