termbox-bindings-hs-0.1.0: termbox bindings
Safe HaskellSafe-Inferred
LanguageHaskell2010

Termbox.Bindings.Hs

Synopsis

Functions

Initialize / shutdown

tb_init :: IO (Either Tb_init_error ()) Source #

Initialize the termbox library.

tb_init_fd :: Fd -> IO (Either Tb_init_error ()) Source #

Initialize the termbox library.

tb_init = tb_init_fd(0)

tb_init_file :: FilePath -> IO (Either Tb_init_error ()) Source #

Initialize the termbox library.

tb_init = tb_init_file("/dev/tty")

tb_shutdown :: IO () #

Shutdown the termbox library.

Get/set input/output mode

Get terminal dimensions

tb_width :: IO Int Source #

Get the terminal width.

tb_height :: IO Int Source #

Get the terminal height.

Poll for events

tb_peek_event :: Int -> IO (Either () (Maybe Tb_event)) Source #

Wait up to a number of milliseconds for an event.

tb_poll_event :: IO (Either () Tb_event) Source #

Wait for an event.

Style a color

tb_attr :: Tb_attr -> Tb_color -> Tb_color Source #

Set the attribute of a color.

Set a cell

tb_set_cursor Source #

Arguments

:: Maybe (Int, Int)

x, y

-> IO () 

Set the cursor location, or hide it.

tb_put_cell Source #

Arguments

:: Int

x

-> Int

y

-> Tb_cell

cell

-> IO () 

Set a cell value in the back buffer.

tb_change_cell Source #

Arguments

:: Int

x

-> Int

y

-> Char

ch

-> Tb_color

fg

-> Tb_color

bg

-> IO () 

Set a cell value in the back buffer.

Clear and synchronize the back buffer

tb_clear :: IO () #

Clear the back buffer.

tb_set_clear_attributes Source #

Arguments

:: Tb_color

fg

-> Tb_color

bg

-> IO () 

Set the foreground and background attributes that tb_clear clears the back buffer with.

tb_present :: IO () #

Synchronize the back buffer with the terminal.

Types

newtype Tb_attr Source #

An attribute.

Constructors

Tb_attr Word16 

Bundled Patterns

pattern TB_BOLD :: Tb_attr 
pattern TB_REVERSE :: Tb_attr 
pattern TB_UNDERLINE :: Tb_attr 

Instances

Instances details
Semigroup Tb_attr Source # 
Instance details

Defined in Termbox.Bindings.Hs

Show Tb_attr Source # 
Instance details

Defined in Termbox.Bindings.Hs

Eq Tb_attr Source # 
Instance details

Defined in Termbox.Bindings.Hs

Methods

(==) :: Tb_attr -> Tb_attr -> Bool #

(/=) :: Tb_attr -> Tb_attr -> Bool #

Ord Tb_attr Source # 
Instance details

Defined in Termbox.Bindings.Hs

data Tb_cell Source #

A cell.

Constructors

Tb_cell 

Fields

Instances

Instances details
Generic Tb_cell Source # 
Instance details

Defined in Termbox.Bindings.Hs

Associated Types

type Rep Tb_cell :: Type -> Type #

Methods

from :: Tb_cell -> Rep Tb_cell x #

to :: Rep Tb_cell x -> Tb_cell #

Show Tb_cell Source # 
Instance details

Defined in Termbox.Bindings.Hs

Eq Tb_cell Source # 
Instance details

Defined in Termbox.Bindings.Hs

Methods

(==) :: Tb_cell -> Tb_cell -> Bool #

(/=) :: Tb_cell -> Tb_cell -> Bool #

Ord Tb_cell Source # 
Instance details

Defined in Termbox.Bindings.Hs

type Rep Tb_cell Source # 
Instance details

Defined in Termbox.Bindings.Hs

type Rep Tb_cell = D1 ('MetaData "Tb_cell" "Termbox.Bindings.Hs" "termbox-bindings-hs-0.1.0-CJcumylTzjB9BTM52ZYmH0" 'False) (C1 ('MetaCons "Tb_cell" 'PrefixI 'True) (S1 ('MetaSel ('Just "ch") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Char) :*: (S1 ('MetaSel ('Just "fg") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Tb_attr) :*: S1 ('MetaSel ('Just "bg") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Tb_attr))))

newtype Tb_color Source #

A color.

Constructors

Tb_color Word16 

Bundled Patterns

pattern TB_DEFAULT :: Tb_color 
pattern TB_BLACK :: Tb_color 
pattern TB_BLUE :: Tb_color 
pattern TB_CYAN :: Tb_color 
pattern TB_GREEN :: Tb_color 
pattern TB_MAGENTA :: Tb_color 
pattern TB_RED :: Tb_color 
pattern TB_WHITE :: Tb_color 
pattern TB_YELLOW :: Tb_color 

data Tb_event Source #

An event.

Constructors

Tb_event 

Fields

Instances

Instances details
Generic Tb_event Source # 
Instance details

Defined in Termbox.Bindings.Hs

Associated Types

type Rep Tb_event :: Type -> Type #

Methods

from :: Tb_event -> Rep Tb_event x #

to :: Rep Tb_event x -> Tb_event #

Show Tb_event Source # 
Instance details

Defined in Termbox.Bindings.Hs

Eq Tb_event Source # 
Instance details

Defined in Termbox.Bindings.Hs

Ord Tb_event Source # 
Instance details

Defined in Termbox.Bindings.Hs

type Rep Tb_event Source # 
Instance details

Defined in Termbox.Bindings.Hs

data Tb_key where Source #

Bundled Patterns

pattern TB_KEY_ARROW_DOWN :: Tb_key 
pattern TB_KEY_ARROW_LEFT :: Tb_key 
pattern TB_KEY_ARROW_RIGHT :: Tb_key 
pattern TB_KEY_ARROW_UP :: Tb_key 
pattern TB_KEY_BACKSPACE :: Tb_key 
pattern TB_KEY_BACKSPACE2 :: Tb_key 
pattern TB_KEY_CTRL_2 :: Tb_key 
pattern TB_KEY_CTRL_3 :: Tb_key 
pattern TB_KEY_CTRL_4 :: Tb_key 
pattern TB_KEY_CTRL_5 :: Tb_key 
pattern TB_KEY_CTRL_6 :: Tb_key 
pattern TB_KEY_CTRL_7 :: Tb_key 
pattern TB_KEY_CTRL_8 :: Tb_key 
pattern TB_KEY_CTRL_A :: Tb_key 
pattern TB_KEY_CTRL_B :: Tb_key 
pattern TB_KEY_CTRL_BACKSLASH :: Tb_key 
pattern TB_KEY_CTRL_C :: Tb_key 
pattern TB_KEY_CTRL_D :: Tb_key 
pattern TB_KEY_CTRL_E :: Tb_key 
pattern TB_KEY_CTRL_F :: Tb_key 
pattern TB_KEY_CTRL_G :: Tb_key 
pattern TB_KEY_CTRL_H :: Tb_key 
pattern TB_KEY_CTRL_I :: Tb_key 
pattern TB_KEY_CTRL_J :: Tb_key 
pattern TB_KEY_CTRL_K :: Tb_key 
pattern TB_KEY_CTRL_L :: Tb_key 
pattern TB_KEY_CTRL_LSQ_BRACKET :: Tb_key 
pattern TB_KEY_CTRL_M :: Tb_key 
pattern TB_KEY_CTRL_N :: Tb_key 
pattern TB_KEY_CTRL_O :: Tb_key 
pattern TB_KEY_CTRL_P :: Tb_key 
pattern TB_KEY_CTRL_Q :: Tb_key 
pattern TB_KEY_CTRL_R :: Tb_key 
pattern TB_KEY_CTRL_RSQ_BRACKET :: Tb_key 
pattern TB_KEY_CTRL_S :: Tb_key 
pattern TB_KEY_CTRL_SLASH :: Tb_key 
pattern TB_KEY_CTRL_T :: Tb_key 
pattern TB_KEY_CTRL_TILDE :: Tb_key 
pattern TB_KEY_CTRL_U :: Tb_key 
pattern TB_KEY_CTRL_UNDERSCORE :: Tb_key 
pattern TB_KEY_CTRL_V :: Tb_key 
pattern TB_KEY_CTRL_W :: Tb_key 
pattern TB_KEY_CTRL_X :: Tb_key 
pattern TB_KEY_CTRL_Y :: Tb_key 
pattern TB_KEY_CTRL_Z :: Tb_key 
pattern TB_KEY_DELETE :: Tb_key 
pattern TB_KEY_END :: Tb_key 
pattern TB_KEY_ENTER :: Tb_key 
pattern TB_KEY_ESC :: Tb_key 
pattern TB_KEY_F1 :: Tb_key 
pattern TB_KEY_F10 :: Tb_key 
pattern TB_KEY_F11 :: Tb_key 
pattern TB_KEY_F12 :: Tb_key 
pattern TB_KEY_F2 :: Tb_key 
pattern TB_KEY_F3 :: Tb_key 
pattern TB_KEY_F4 :: Tb_key 
pattern TB_KEY_F5 :: Tb_key 
pattern TB_KEY_F6 :: Tb_key 
pattern TB_KEY_F7 :: Tb_key 
pattern TB_KEY_F8 :: Tb_key 
pattern TB_KEY_F9 :: Tb_key 
pattern TB_KEY_HOME :: Tb_key 
pattern TB_KEY_INSERT :: Tb_key 
pattern TB_KEY_MOUSE_LEFT :: Tb_key 
pattern TB_KEY_MOUSE_MIDDLE :: Tb_key 
pattern TB_KEY_MOUSE_RELEASE :: Tb_key 
pattern TB_KEY_MOUSE_RIGHT :: Tb_key 
pattern TB_KEY_MOUSE_WHEEL_DOWN :: Tb_key 
pattern TB_KEY_MOUSE_WHEEL_UP :: Tb_key 
pattern TB_KEY_PGDN :: Tb_key 
pattern TB_KEY_PGUP :: Tb_key 
pattern TB_KEY_SPACE :: Tb_key 
pattern TB_KEY_TAB :: Tb_key 

Instances

Instances details
Show Tb_key Source # 
Instance details

Defined in Termbox.Bindings.Hs

Eq Tb_key Source # 
Instance details

Defined in Termbox.Bindings.Hs

Methods

(==) :: Tb_key -> Tb_key -> Bool #

(/=) :: Tb_key -> Tb_key -> Bool #

Ord Tb_key Source # 
Instance details

Defined in Termbox.Bindings.Hs