--- Revision None +++ Revision 623034633066 @@ -0,0 +1,34 @@ +class Term::Curses { + has $.y is rw; + has $.x is rw; + + has $!stdscr; + + method new( + :$cbreak = True, + :$echo = False, + :$nl = False, + :$intrflush = False, + :$keypad = True, + :$use_default_colors = True, + :$start_color = True + ) { + #setlocale(0, ""); + + # TODO: use newterm() instead of initscr()? + my $stdscr = initscr(); + + cbreak() if $cbreak; + noecho() unless $echo; + nonl() unless $nl; + intrflush($stdscr, 0) unless $intrflush; + keypad($stdscr, 1) if $keypad; + if ($start_color and has_colors()) { + use_default_colors() if $use_default_colors; + start_color(); + } + + self.bless(*, :$stdscr); + } + + submethod BUILD(:$!stdscr) {}