EXPORTS

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

:all

  :const
    common_lvb_leading_byte
    common_lvb_trailing_byte
    key_event
    mouse_event
    window_buffer_size_event
    enable_extended_flags

  :syscalls
    set_console_active_screen_buffer
    set_console_screen_buffer_size
    set_console_window_info
    create_console_screen_buffer
    get_console_screen_buffer_info
    write_console_output
    write_console_output_character
    write_console_output_attribute
    set_console_cursor_info
    get_console_cursor_info
    set_console_cursor_position
    read_console_input
    get_console_mode
    set_console_mode
    fill_console_output_character
    fill_console_output_attribute
    create_event
    wait_for_multiple_objects
    set_event
    get_current_console_font

  :func
    get_cursor_position
    get_term_size
    get_win_min_size
    get_win_size
    fix_win_size
    update_size_maybe
    append_diff_line
    prepare_diff_messages
    get_ct
    cell_to_char_info
    move_cursor
    show_cursor
    clear
    key_event_record_to_event
    input_event_producer

  :types
    syscallHandle
    char_info
    coord
    small_rect
    console_cursor_info
    key_event_record
    window_buffer_size_record
    diff_msg

  :vars
    $is_cjk
    $orig_cursor_info
    $orig_size
    $orig_window
    $orig_mode
    $orig_screen
    $term_size
    $interrupt
    $charbuf
    $diffbuf
    $cancel_comm
    $cancel_done_comm

NAME

Termbox::Go::Win32::Backend - Win32 Backend implementation for Termbox

DESCRIPTION

This module contains some Windows native functions for the implementation of Termbox for Win32.

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

Win32::API

Win32::Console

Unicode::EastAsianWidth

Unicode::EastAsianWidth::Detect

SEE ALSO

termbox_windows.go

syscalls_windows.go

SUBROUTINES

append_diff_line

my $nColumns = append_diff_line($wRow);

cell_to_char_info

my ($uAttributes, $uChar) = cell_to_char_info(\%Cell);

char_info

my \%hashref | undef = char_info( | @array | \%hashref);

Usage: my \%hashref = char_info(); my \%hashref = char_info($char, $attr) // die; my \%hashref = char_info({char => $char, attr => $attr}) // die;

clear

my $bSucceeded = clear();

console_cursor_info

my \%hashref | undef = console_cursor_info( | @array | \%hashref);

Usage: my \%hashref = console_cursor_info(); my \%hashref = console_cursor_info($size, $visible) // die; my \%hashref = console_cursor_info({ size => $size, visible => $visible, }) // die;

coord

my \%hashref | undef = coord( | @array | \%hashref);

Usage: my \%hashref = coord(); my \%hashref = coord($x, $y) // die; my \%hashref = coord({x => $x, y = $y}) // die;

create_console_screen_buffer

my $handle | undef = create_console_screen_buffer();

create_event

my $handle | undef = create_event();

diff_msg

my \%hashref | undef = diff_msg( | @array | \%hashref);

Usage: my \%hashref = diff_msg(); my \%hashref = diff_msg($pos, $lines, \@chars) // die; my \%hashref = diff_msg({ pos => $pos, lines => $lines, chars => \@chars, }) // die;

fill_console_output_attribute

my $bSucceeded = fill_console_output_attribute($hConsoleOutput, $wAttribute, $nLength);

fill_console_output_character

my $bSucceeded = fill_console_output_character($hConsoleOutput, $cCharacter, $nLength);

fix_win_size

my $bSucceeded = fix_win_size($hConsoleOutput, \%dwSize);

get_console_cursor_info

my $bSucceeded = get_console_cursor_info($hConsoleOutput, \%lpConsoleCursorInfo);

get_console_mode

my $bSucceeded = get_console_mode($hConsoleHandle, \$lpMode);

get_console_screen_buffer_info

my $bSucceeded = get_console_screen_buffer_info($hConsoleOutput, \%lpConsoleScreenBufferInfo);

get_ct

my $uColor = get_ct(\%rgColorTable, $iColor);

get_current_console_font

my $bSucceeded = get_current_console_font($hConsoleOutput, \%dwFontSize);

get_cursor_position

my \%dwCursorPosition = get_cursor_position($hConsoleOutput);

get_term_size

my (\%dwSize, \%srWindow) = get_term_size($hConsoleOutput);

get_win_min_size

my \%dwSize = get_win_min_size($hConsoleOutput);

get_win_size

my \%dwSize = get_win_size($hConsoleOutput);

input_event_producer

my $bSucceeded = input_event_producer();

key_event_record

my \%hashref | undef = key_event_record( | @array | \%hashref);

Usage: my \%hashref = key_event_record(); my \%hashref = key_event_record( $key_down, $repeat_count, $virtual_key_code, $virtual_scan_code, $unicode_char, $control_key_state ) // die; my \%hashref = key_event_record({ key_down => $key_down, repeat_count => $repeat_count, virtual_key_code => $virtual_key_code, virtual_scan_code => $virtual_scan_code, unicode_char => $unicode_char, control_key_state => $control_key_state, }) // die:

key_event_record_to_event

my (\%Event, $bSucceeded) = key_event_record_to_event(\%lpBuffer);

mouse_event_record

my \%hashref | undef = mouse_event_record( | \%hashref);

Usage: my \%hashref = mouse_event_record(); my \%hashref = mouse_event_record({ mouse_pos => { x => $x, y => $y, }, button_state => $button_state, control_key_state => $control_key_state, event_flags => $event_flags, }) // die;

move_cursor

my $bSucceeded = move_cursor($uLeft, $uTop);

prepare_diff_messages

my $bSucceeded = prepare_diff_messages();

compares 'back_buffer' with 'front_buffer' and prepares all changes in the form of 'diff_msg's in the 'diff_buf'

read_console_input

my $bSucceeded = read_console_input($hConsoleInput, \%lpBuffer);

set_console_active_screen_buffer

my $bSucceeded = set_console_active_screen_buffer($hConsoleOutput);

set_console_cursor_info

my $bSucceeded = set_console_cursor_info($hConsoleOutput, \%lpConsoleCursorInfo);

set_console_cursor_position

my $bSucceeded = set_console_cursor_position($hConsoleOutput, $dwCursorPosition);

set_console_mode

my $bSucceeded = set_console_mode($hConsoleHandle, $lpMode);

set_console_screen_buffer_size

my $bSucceeded = set_console_screen_buffer_size($hConsoleOutput, \%dwSize);

set_console_window_info

my $bSucceeded = set_console_window_info($hConsoleOutput, \%lpConsoleWindow);

set_event

my $bSucceeded = set_event($hEvent);

show_cursor

my $bSucceeded = show_cursor($bVisible);

small_rect

my \%hashref | undef = small_rect( | @array | \%hashref);

Usage: my \%hashref = small_rect(); my \%hashref = small_rect( $left, $top, $right, $bottom, ) // die; my \%hashref = small_rect({ left => $left, top => $top, right => $right, bottom => $bottom, }) // die;

syscallHandle

my $scalar | undef = syscallHandle( | $scalar);

Usage: $handle = syscallHandle(); $handle = syscallHandle($handle) // die;

update_size_maybe

my $bSucceeded = update_size_maybe();

wait_for_multiple_objects

my $bSucceeded = wait_for_multiple_objects(\@lpHandles);

window_buffer_size_record

my \%hashref | undef = window_buffer_size_record( | \%hashref);

Usage: my \%hashref = window_buffer_size_record(); my \%hashref = window_buffer_size_record({x => $x, y => $y}) // die;

write_console_output

my $bSucceeded = write_console_output($hConsoleOutput, $lpBuffer, \%lpWriteRegion);

write_console_output_attribute

my $bSucceeded = write_console_output_attribute($hConsoleOutput, $lpAttribute, \%dwWriteCoord);

write_console_output_character

my $bSucceeded = write_console_output_character($hConsoleOutput, $lpCharacter, \%dwWriteCoord);