[][src]Module meli::terminal

Terminal grid cells, keys, colors, etc.

Modules

ansi

Create a CellBuffer from a string slice containing ANSI escape codes.

boundaries
braille
cells

Define a (x, y) point in the terminal display as a holder of a character, foreground/background colors and attributes.

color
embed
keys
position

Simple type definitions and macro helper for a (x,y) position on the terminal and the areas they define.

text_editing

Structs

Attr

The attributes of a Cell.

BoundsIterator

BoundsIterator iterates each row returning a RowIterator.

BracketModeEnd

Empty struct with a Display implementation that returns the byte sequence to end Bracketed Paste Mode

BracketModeStart

Empty struct with a Display implementation that returns the byte sequence to start Bracketed Paste Mode

BraillePixelIter

Iterate on 2x4 pixel blocks from a bitmap and return a unicode braille character for each block. The iterator holds four lines of bitmaps encoded as u16 numbers in swapped bit order, like the xbm graphics format. The bitmap is split to u16 columns.

Cell

A single point on a terminal display.

CellBuffer

An array of Cells that represents a terminal display.

DisableMouse

Ps = 1 0 0 2 ⇒ Don't use Cell Motion Mouse Tracking, xterm

DisableSGRMouse

Ps = 1 0 0 6 Disable SGR Mouse Mode, xterm.

EnableMouse

Ps = 1 0 0 2 ⇒ Use Cell Motion Mouse Tracking, xterm

EnableSGRMouse

Ps = 1 0 0 6 Enable SGR Mouse Mode, xterm.

FormatTag
RestoreWindowTitleIconFromStack

Restore window title and icon from terminal's title stack. CSI Ps ; Ps ; Ps t, where Ps = 2 3 ; 0 -> Restore xterm icon and window title from stack.

RowIterator

Use RowIterator to iterate the cells of a row without the need to do any bounds checking; the iterator will simply return None when it reaches the end of the row. RowIterator can be created via the CellBuffer::row_iter method and can be returned by BoundsIterator which iterates each row.

SaveWindowTitleIconToStack

CSI Ps ; Ps ; Ps t, where Ps = 2 2 ; 0 -> Save xterm icon and window title on stack.

ScrollRegion

In a scroll region up and down cursor movements shift the region vertically. The new lines are empty.

UText

Enums

Alignment
Color

The color of a Cell.

InputCommand

Main process sends commands to the input thread.

Key
MouseButton

A mouse button.

MouseEvent

A mouse related event.

WidgetWidth

Constants

BRACKET_PASTE_END
BRACKET_PASTE_START

Functions

align_area

Place given area of dimensions (width, height) inside area according to given alignment

center_area

Place box given by (width, height) in center of area

change_colors

Change foreground and background colors in an Area

clear_area

Completely clear an Area with an empty char and the terminal's default colors.

copy_area

Copy a source Area to a destination.

copy_area_with_break
create_box

Puts boundaries in area. Returns the inner area of the created box.

get_events

The thread function that listens for user input and forwards it to the main event loop.

get_x
get_y
place_in_area

Place box given by (width, height) in corner of area

pos_dec
pos_inc
set_x
set_y
write_string_to_grid

Write an &str to a CellBuffer in a specified Area with the passed colors.

Type Definitions

Area

An Area consists of two points: the upper left and bottom right corners.

Pos

A (x, y) position on screen.