[][src]Module bear_lib_terminal::terminal

Rusticized interface for the FFI.

Modules

config

Module containing BLT configuration options.

state

Wherein are contained functions for checking the terminal's properties: its size, whether cetrain keys are pressed, mouse position, etc.

Structs

EventIterator

Infinite iterator over Terminal events, instantiated by events().

Enums

Event

A single input event.

KeyCode

All pressable keys.

Functions

clear

Clears the screen (either partailly or fully)

close

Closes the terminal window, causing all subsequent functions from the module (apart from open()) to fail

composition

Enable or disable composition, (dis)allowing for "stacking" tiles on top of each other in the same cell.

crop

Sets the current layer's crop area.

delay

Sleep for the specified amount of milliseconds.

events

Returns an instance of EventIterator, an infinite iterator over Terminal events.

has_input

Check, whether the next read_event() call will return Some.

layer

Selects the current layer.

measure

Calculate the argument's width/height without printing it.

open

Creates the terminal window of the specified size with the specified title, without showing it. To show the window use the refresh() function.

peek_event

Returns the next event in the queue if it's available without popping it therefrom, otherwise returns None.

pick

Get the character in the specified coordinates on the specified layer.

pick_background_color

Get the background color in the specified coordinates.

pick_foreground_color

Get the color of the character in the specified coordinates on the specified layer.

print

Prints the specified string to the specified location, formatting it along the way.

print_xy

Equivalent to print() with a Point constructed from the first two arguments.

put

Prints the specified character to the specified location.

put_ext

Prints the specified character to the specified pixel-offsetted location, gradient-colouring it from the corners.

put_xy

Equivalent to put() with a Point constructed from the first two arguments.

read_event

Returns the next event in the queue if it's available, otherwise returns None.

read_str

Reads up to max characters without parsing, starting at the specified coordinates.

refresh

Flushes all changes made to the screen; also shows the window after the open() call

set

Invoke the terminal_set() C API function with the argument's config_str.

set_background

Sets the current background color, which will affect all the output functions called later.

set_colors

Sets the current foreground and background color, which will affect all the output functions called later.

set_foreground

Sets the current foreground color, which will affect all the output functions called later.

wait_event

Returns the next event, blocks until one's available.

with_background

Sets the background color before calling the function and resets it afterwards.

with_colors

Sets the foreground and background color before calling the function and resets them afterwards.

with_foreground

Sets the foreground color before calling the function and resets it afterwards.