EXPORTS

Nothing per default, but can export the following per request:

:all

  :bool
    TRUE
    FALSE

  :const
    cursor_hidden

  :keys
    KeyCtrlTilde
    KeyCtrl2
    KeyCtrlSpace
    KeyCtrlA
    KeyCtrlB
    KeyCtrlC
    KeyCtrlD
    KeyCtrlE
    KeyCtrlF
    KeyCtrlG
    KeyBackspace
    KeyCtrlH
    KeyTab
    KeyCtrlI
    KeyCtrlJ
    KeyCtrlK
    KeyCtrlL
    KeyEnter
    KeyCtrlM
    KeyCtrlN
    KeyCtrlO
    KeyCtrlP
    KeyCtrlQ
    KeyCtrlR
    KeyCtrlS
    KeyCtrlT
    KeyCtrlU
    KeyCtrlV
    KeyCtrlW
    KeyCtrlX
    KeyCtrlY
    KeyCtrlZ
    KeyEsc
    KeyCtrlLsqBracket
    KeyCtrl3
    KeyCtrl4
    KeyCtrlBackslash
    KeyCtrl5
    KeyCtrlRsqBracket
    KeyCtrl6
    KeyCtrl7
    KeyCtrlSlash
    KeyCtrlUnderscore
    KeySpace
    KeyBackspace2
    KeyCtrl8

    KeyF1
    KeyF2
    KeyF3
    KeyF4
    KeyF5
    KeyF6
    KeyF7
    KeyF8
    KeyF9
    KeyF10
    KeyF11
    KeyF12
    KeyInsert
    KeyDelete
    KeyHome
    KeyEnd
    KeyPgup
    KeyPgdn
    KeyArrowUp
    KeyArrowDown
    KeyArrowLeft
    KeyArrowRight
    key_min
    MouseLeft
    MouseMiddle
    MouseRight
    MouseRelease
    MouseWheelUp
    MouseWheelDown

  :mode
    ModAlt
    ModMotion

  :color
    ColorDefault
    ColorBlack
    ColorRed
    ColorGreen
    ColorYellow
    ColorBlue
    ColorMagenta
    ColorCyan
    ColorWhite
    ColorDarkGray
    ColorLightRed
    ColorLightGreen
    ColorLightYellow
    ColorLightBlue
    ColorLightMagenta
    ColorLightCyan
    ColorLightGray

  :attr
    AttrBold
    AttrBlink
    AttrHidden
    AttrDim
    AttrUnderline
    AttrCursive
    AttrReverse
    max_attr

  :input
    InputEsc
    InputAlt
    InputMouse
    InputCurrent

  :output
    OutputCurrent
    OutputNormal
    Output256
    Output216
    OutputGrayscale
    OutputRGB

  :event
    EventKey
    EventResize
    EventMouse
    EventError
    EventInterrupt
    EventRaw
    EventNone

  :func
    AttributeToRGB
    RGBToAttribute
    is_cursor_hidden

  :types
    Event
    Cell

  :vars
    $IsInit
    $back_buffer
    $front_buffer
    $input_mode
    $output_mode
    $cursor_x
    $cursor_y
    $foreground
    $background
    $in
    $out
    $input_comm
    $interrupt_comm

NAME

Termbox::Go::Common - OS independent implementation for Termbox

DESCRIPTION

This module contains some common constants, vars, functions and classes for the implementation of Termbox.

COPYRIGHT AND LICENCE

This file is part of the port of Termbox.

Copyright (C) 2012 by termbox-go authors

This library content was taken from the termbox-go implementation of Termbox
which is licensed under MIT licence.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

AUTHORS

DISCLAIMER OF WARRANTIES

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

REQUIRES

5.014

Params::Util

SEE ALSO

api_common.go

termbox_common.go

SUBROUTINES

AttributeToRGB

my ($r, $g, $b) = AttributeToRGB($attr);

AttributeToRGB converts an Attribute to the underlying rgb triplet. This is only useful if termbox is in Full RGB mode and the specified attribute is also an attribute with r, g, b specified

Cell

my \%hashref = Cell( | \%hashref | @array);

A cell, single conceptual entity on the screen. The screen is basically a 2d array of cells. 'Ch' is a unicode character, 'Fg' and 'Bg' are foreground and background attributes respectively.

Event

my \%hashref = Event( | \%hashref | @array);

This type represents a termbox event. The 'Mod', 'Key' and 'Ch' fields are valid if 'Type' is EventKey. The 'Width' and 'Height' fields are valid if 'Type' is EventResize. The 'Err' field is valid if 'Type' is EventError.

RGBToAttribute

my $attr = RGBToAttribute($r, $g, $b);

RGBToAttribute is used to convert an rgb triplet into a termbox attribute. This attribute can only be applied when termbox is in Full RGB mode, otherwise it'll be ignored and no color will be drawn. R, G, B have to be in the range of 0 and 255.

cellbuf::clear

cellbuf::clear($self);

Clears the internally used buffer.

cellbuf::init

cellbuf::init($self, $width, $height);

Initializes the internally used buffer

cellbuf::resize

cellbuf::resize($self, $width, $height);

Adjusts the already initialized internal buffer to the new screen resolution.

is_cursor_hidden

my $bool = is_cursor_hidden($x, $y);

Returns a boolean value indicating whether the cursor is hidden.