]> gitweb.factorcode.org Git - factor.git/blob - extra/terminal/windows/windows.factor
classes.struct: moving to new/boa instead of <struct>/<struct-boa>
[factor.git] / extra / terminal / windows / windows.factor
1 ! Copyright (C) 2012 John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license
3
4 USING: accessors classes.struct kernel math system terminal
5 windows.kernel32 ;
6
7 IN: terminal.windows
8
9 M: windows (terminal-size)
10     STD_OUTPUT_HANDLE GetStdHandle
11     CONSOLE_SCREEN_BUFFER_INFO new
12     [ GetConsoleScreenBufferInfo ] keep swap zero? [
13         drop 0 0
14     ] [
15         srWindow>>
16         [ [ Right>> ] [ Left>> ] bi - 1 + ]
17         [ [ Bottom>> ] [ Top>> ] bi - 1 + ] bi
18     ] if ;