30 #include <ncursesw/curses.h> 31 #include <ncursesw/etip.h> 45 #define UNDEF(name) CUR_ ##name 48 inline int UNDEF( addch )( chtype ch ) {
return addch( ch ); }
51 #define addch UNDEF(addch) 55 inline int UNDEF( add_wch )( cchar_t * cch ) {
return add_wch( cch ); }
58 #define add_wch UNDEF(add_wch) 62 inline int UNDEF( echochar )( chtype ch ) {
return echochar( ch ); }
65 #define echochar UNDEF(echochar) 69 inline int UNDEF( insdelln )(
int n ) {
return insdelln( n ); }
72 #define insdelln UNDEF(insdelln) 77 inline int UNDEF( addstr )(
const char * str ) {
return addstr((
char* )str ); }
80 #define addstr UNDEF(addstr) 85 inline int UNDEF( addwstr )(
const wchar_t * str ) {
return addwstr((
wchar_t* )str ); }
88 #define addwstr UNDEF(addwstr) 92 inline int UNDEF( attron )( chtype at ) {
return attron( at ); }
95 #define attron UNDEF(attron) 99 inline int UNDEF( attroff )( chtype at ) {
return attroff( at ); }
102 #define attroff UNDEF(attroff) 106 inline chtype UNDEF( attrset )( chtype at ) {
return attrset( at ); }
109 #define attrset UNDEF(attrset) 113 inline int UNDEF( border )( chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br )
114 {
return border( ls, rs, ts, bs, tl, tr, bl, br ); }
117 #define border UNDEF(border) 121 inline int UNDEF( box )( WINDOW *win,
int v,
int h ) {
return box( win, v, h ); }
124 #define box UNDEF(box) 128 inline int UNDEF( mvwhline )( WINDOW *win,
int y,
int x, chtype c,
int n )
130 return mvwhline( win, y, x, c, n );
134 #define mvwhline UNDEF(mvwhline) 138 inline int UNDEF( mvwvline )( WINDOW *win,
int y,
int x, chtype c,
int n )
140 return mvwvline( win, y, x, c, n );
144 #define mvwvline UNDEF(mvwvline) 148 inline int UNDEF( clear )() {
return clear(); }
151 #define clear UNDEF(clear) 155 inline int UNDEF( clearok )( WINDOW* win,
bool bf ) {
return clearok( win, bf ); }
158 #define clearok UNDEF(clearok) 160 extern "C" int clearok( WINDOW*,
bool );
164 inline int UNDEF( clrtobot )() {
return clrtobot(); }
167 #define clrtobot UNDEF(clrtobot) 171 inline int UNDEF( clrtoeol )() {
return clrtoeol(); }
174 #define clrtoeol UNDEF(clrtoeol) 178 inline int UNDEF( delch )() {
return delch(); }
181 #define delch UNDEF(delch) 185 inline int UNDEF( deleteln )() {
return deleteln(); }
188 #define deleteln UNDEF(deleteln) 192 inline int UNDEF( erase )() {
return erase(); }
195 #define erase UNDEF(erase) 199 inline int UNDEF( flushok )( WINDOW* _win,
bool _bf )
201 return flushok( _win, _bf );
205 #define flushok UNDEF(flushok) 211 inline int UNDEF( getch )() {
return getch(); }
214 #define getch UNDEF(getch) 218 inline int UNDEF( getstr )(
char *_str ) {
return getstr( _str ); }
221 #define getstr UNDEF(getstr) 225 inline int UNDEF( instr )(
char *_str ) {
return instr( _str ); }
228 #define instr UNDEF(instr) 232 inline int UNDEF( innstr )(
char *_str,
int n ) {
return innstr( _str, n ); }
235 #define innstr UNDEF(innstr) 239 inline int UNDEF( mvwinnstr )( WINDOW *win,
int y,
int x,
char *_str,
int n )
241 return mvwinnstr( win, y, x, _str, n );
245 #define mvwinnstr UNDEF(mvwinnstr) 249 inline int UNDEF( mvinnstr )(
int y,
int x,
char *_str,
int n )
251 return mvinnstr( y, x, _str, n );
255 #define mvinnstr UNDEF(mvinnstr) 259 inline int UNDEF( winsstr )( WINDOW *w,
const char *_str )
261 return winsstr( w, _str );
265 #define winsstr UNDEF(winsstr) 269 inline int UNDEF( mvwinsstr )( WINDOW *w,
int y,
int x,
const char *_str )
271 return mvwinsstr( w, y, x, _str );
275 #define mvwinsstr UNDEF(mvwinsstr) 279 inline int UNDEF( insstr )(
const char *_str )
281 return insstr( _str );
285 #define insstr UNDEF(insstr) 289 inline int UNDEF( mvinsstr )(
int y,
int x,
const char *_str )
291 return mvinsstr( y, x, _str );
295 #define mvinsstr UNDEF(mvinsstr) 299 inline int UNDEF( insnstr )(
const char *_str,
int n )
301 return insnstr( _str, n );
305 #define insnstr UNDEF(insnstr) 309 inline int UNDEF( mvwinsnstr )( WINDOW *w,
int y,
int x,
const char *_str,
int n )
311 return mvwinsnstr( w, y, x, _str, n );
315 #define mvwinsnstr UNDEF(mvwinsnstr) 319 inline int UNDEF( mvinsnstr )(
int y,
int x,
const char *_str,
int n )
321 return mvinsnstr( y, x, _str, n );
325 #define mvinsnstr UNDEF(mvinsnstr) 329 inline int UNDEF( getnstr )(
char *_str,
int n ) {
return getnstr( _str, n ); }
332 #define getnstr UNDEF(getnstr) 336 inline void UNDEF( getyx )(
const WINDOW* win,
int& y,
int& x )
342 #define getyx UNDEF(getyx) 346 inline void UNDEF( getbegyx )( WINDOW* win,
int& y,
int& x ) { getbegyx( win, y, x ); }
349 #define getbegyx UNDEF(getbegyx) 353 inline void UNDEF( getmaxyx )( WINDOW* win,
int& y,
int& x ) { getmaxyx( win, y, x ); }
356 #define getmaxyx UNDEF(getmaxyx) 360 inline int UNDEF( hline )( chtype ch,
int n ) {
return hline( ch, n ); }
363 #define hline UNDEF(hline) 367 inline chtype UNDEF( inch )() {
return inch(); }
370 #define inch UNDEF(inch) 374 inline int UNDEF( in_wch )( cchar_t * cch ) {
return in_wch( cch ); }
377 #define in_wch UNDEF(in_wch) 381 inline int UNDEF( insch )(
char c ) {
return insch( c ); }
384 #define insch UNDEF(insch) 388 inline int UNDEF( ins_wch )(
const cchar_t *c ) {
return ins_wch( c ); }
391 #define ins_wch UNDEF(ins_wch) 395 inline int UNDEF( mvwins_wch )( WINDOW *w,
int y,
int x,
const cchar_t *cchar ) {
return mvwins_wch( w, y, x, cchar ); }
398 #define mvwins_wch UNDEF(mvwins_wch) 402 inline int UNDEF( insertln )() {
return insertln(); }
405 #define insertln UNDEF(insertln) 409 inline int UNDEF( leaveok )( WINDOW* win,
bool bf ) {
return leaveok( win, bf ); }
412 #define leaveok UNDEF(leaveok) 414 extern "C" int leaveok( WINDOW* win,
bool bf );
418 inline int UNDEF( move )(
int x,
int y ) {
return move( x, y ); }
421 #define move UNDEF(move) 425 inline int UNDEF( refresh )() {
return refresh(); }
428 #define refresh UNDEF(refresh) 432 inline int UNDEF( redrawwin )( WINDOW *win ) {
return redrawwin( win ); }
435 #define redrawwin UNDEF(redrawwin) 439 inline int UNDEF( scrl )(
int l ) {
return scrl( l ); }
442 #define scrl UNDEF(scrl) 446 inline int UNDEF( scroll )( WINDOW *win ) {
return scroll( win ); }
449 #define scroll UNDEF(scroll) 453 inline int UNDEF( scrollok )( WINDOW* win,
bool bf ) {
return scrollok( win, bf ); }
456 #define scrollok UNDEF(scrollok) 458 #if defined(__NCURSES_H) 459 extern "C" int scrollok( WINDOW*,
bool );
461 extern "C" int scrollok( WINDOW*,
char );
466 inline int UNDEF( setscrreg )(
int t,
int b ) {
return setscrreg( t, b ); }
469 #define setscrreg UNDEF(setscrreg) 473 inline int UNDEF( standend )() {
return standend(); }
476 #define standend UNDEF(standend) 480 inline int UNDEF( standout )() {
return standout(); }
483 #define standout UNDEF(standout) 487 inline WINDOW *UNDEF( subpad )( WINDOW *p,
int l,
int c,
int y,
int x )
488 {
return derwin( p, l, c, y, x ); }
491 #define subpad UNDEF(subpad) 495 #if NCURSES_VERSION_MAJOR < 5 496 inline int UNDEF( timeout )(
int delay ) {
return timeout( delay ); }
499 inline void UNDEF( timeout )(
int delay ) { timeout( delay ); }
503 #define timeout UNDEF(timeout) 507 inline int UNDEF( touchline )( WINDOW *win,
int s,
int c )
508 {
return touchline( win, s, c ); }
511 #define touchline UNDEF(touchline) 515 inline int UNDEF( touchwin )( WINDOW *win ) {
return touchwin( win ); }
518 #define touchwin UNDEF(touchwin) 522 inline int UNDEF( untouchwin )( WINDOW *win ) {
return untouchwin( win ); }
525 #define untouchwin UNDEF(untouchwin) 529 inline int UNDEF( vline )( chtype ch,
int n ) {
return vline( ch, n ); }
532 #define vline UNDEF(vline) 536 inline int UNDEF( waddstr )( WINDOW *win,
char *str ) {
return waddstr( win, str ); }
539 #define waddstr UNDEF(waddstr) 543 inline int UNDEF( waddwstr )( WINDOW *win,
wchar_t *str ) {
return waddwstr( win, str ); }
546 #define waddwstr UNDEF(waddwstr) 550 inline int UNDEF( mvwaddwstr )( WINDOW *win,
int y,
int x,
wchar_t *str )
551 {
return mvwaddwstr( win, y, x, str ); }
554 #define mvwaddwstr UNDEF(mvwaddwstr) 558 inline int UNDEF( waddchstr )( WINDOW *win, chtype *at ) {
return waddchstr( win, at ); }
561 #define waddchstr UNDEF(waddchstr) 565 inline int UNDEF( wstandend )( WINDOW *win ) {
return wstandend( win ); }
568 #define wstandend UNDEF(wstandend) 572 inline int UNDEF( wstandout )( WINDOW *win ) {
return wstandout( win ); }
575 #define wstandout UNDEF(wstandout) 580 inline int UNDEF( wattroff )( WINDOW *win,
int att ) {
return wattroff( win, att ); }
583 #define wattroff UNDEF(wattroff) 587 inline int UNDEF( chgat )(
int n, attr_t attr,
short color,
const void *opts )
589 return chgat( n, attr, color, opts );
593 #define chgat UNDEF(chgat) 597 inline int UNDEF( mvchgat )(
int y,
int x,
int n,
598 attr_t attr,
short color,
const void *opts )
600 return mvchgat( y, x, n, attr, color, opts );
604 #define mvchgat UNDEF(mvchgat) 608 inline int UNDEF( mvwchgat )( WINDOW *win,
int y,
int x,
int n,
609 attr_t attr,
short color,
const void *opts )
611 return mvwchgat( win, y, x, n, attr, color, opts );
615 #define mvwchgat UNDEF(mvwchgat) 619 inline int UNDEF( wattrset )( WINDOW *win,
int att ) {
return wattrset( win, att ); }
622 #define wattrset UNDEF(wattrset) 626 inline chtype UNDEF( winch )(
const WINDOW* win ) {
return winch( win ); }
629 #define winch UNDEF(winch) 633 inline int UNDEF( mvwaddch )( WINDOW *win,
int y,
int x,
const chtype ch )
634 {
return mvwaddch( win, y, x, ch ); }
637 #define mvwaddch UNDEF(mvwaddch) 641 inline int UNDEF( mvwaddchnstr )( WINDOW *win,
int y,
int x, chtype *str,
int n )
642 {
return mvwaddchnstr( win, y, x, str, n ); }
645 #define mvwaddchnstr UNDEF(mvwaddchnstr) 649 inline int UNDEF( mvwaddchstr )( WINDOW *win,
int y,
int x, chtype *str )
650 {
return mvwaddchstr( win, y, x, str ); }
653 #define mvwaddchstr UNDEF(mvwaddchstr) 657 inline int UNDEF( addnstr )(
const char *str,
int n )
658 {
return addnstr((
char* )str, n ); }
661 #define addnstr UNDEF(addnstr) 665 inline int UNDEF( addnwstr )(
const wchar_t *str,
int n )
666 {
return addnwstr((
wchar_t* )str, n ); }
669 #define addnwstr UNDEF(addnwstr) 673 inline int UNDEF( mvwaddnstr )( WINDOW *win,
int y,
int x,
const char *str,
int n )
674 {
return mvwaddnstr( win, y, x, (
char* )str, n ); }
677 #define mvwaddnstr UNDEF(mvwaddnstr) 681 inline int UNDEF( mvwaddnwstr )( WINDOW *win,
int y,
int x,
const wchar_t *str,
int n )
682 {
return mvwaddnwstr( win, y, x, (
wchar_t* )str, n ); }
685 #define mvwaddnwstr UNDEF(mvwaddnwstr) 689 inline int UNDEF( mvwaddstr )( WINDOW *win,
int y,
int x,
const char * str )
690 {
return mvwaddstr( win, y, x, (
char* )str ); }
693 #define mvwaddstr UNDEF(mvwaddstr) 697 inline int UNDEF( mvwdelch )( WINDOW *win,
int y,
int x )
698 {
return mvwdelch( win, y, x ); }
701 #define mvwdelch UNDEF(mvwdelch) 705 inline int UNDEF( mvwgetch )( WINDOW *win,
int y,
int x ) {
return mvwgetch( win, y, x );}
708 #define mvwgetch UNDEF(mvwgetch) 712 inline int UNDEF( mvwgetstr )( WINDOW *win,
int y,
int x,
char *str )
713 {
return mvwgetstr( win, y, x, str );}
716 #define mvwgetstr UNDEF(mvwgetstr) 720 inline int UNDEF( mvwgetnstr )( WINDOW *win,
int y,
int x,
char *str,
int n )
721 {
return mvwgetnstr( win, y, x, str, n );}
724 #define mvwgetnstr UNDEF(mvwgetnstr) 728 inline chtype UNDEF( mvwinch )( WINDOW *win,
int y,
int x )
730 return mvwinch( win, y, x );
734 #define mvwinch UNDEF(mvwinch) 738 inline int UNDEF( mvwin_wch )( WINDOW *win,
int y,
int x, cchar_t * cch )
740 return mvwin_wch( win, y, x, cch );
744 #define mvwin_wch UNDEF(mvwin_wch) 748 inline int UNDEF( mvwinsch )( WINDOW *win,
int y,
int x,
char c )
749 {
return mvwinsch( win, y, x, c ); }
752 #define mvwinsch UNDEF(mvwinsch) 756 inline int UNDEF( mvaddch )(
int y,
int x, chtype ch )
757 {
return mvaddch( y, x, ch ); }
760 #define mvaddch UNDEF(mvaddch) 764 inline int UNDEF( mvaddnstr )(
int y,
int x,
const char *str,
int n )
765 {
return mvaddnstr( y, x, (
char* )str, n ); }
768 #define mvaddnstr UNDEF(mvaddnstr) 772 inline int UNDEF( mvaddstr )(
int y,
int x,
const char * str )
773 {
return mvaddstr( y, x, (
char* )str ); }
776 #define mvaddstr UNDEF(mvaddstr) 780 inline int UNDEF( mvwadd_wch )( WINDOW *win,
int y,
int x,
const cchar_t * cch )
781 {
return mvwadd_wch( win, y, x, ( cchar_t* )cch ); }
784 #define mvwadd_wch UNDEF(mvwadd_wch) 788 inline int UNDEF( mvdelch )(
int y,
int x ) {
return mvdelch( y, x );}
791 #define mvdelch UNDEF(mvdelch) 795 inline int UNDEF( mvgetch )(
int y,
int x ) {
return mvgetch( y, x );}
798 #define mvgetch UNDEF(mvgetch) 802 inline int UNDEF( mvgetstr )(
int y,
int x,
char *str ) {
return mvgetstr( y, x, str );}
805 #define mvgetstr UNDEF(mvgetstr) 809 inline int UNDEF( mvgetnstr )(
int y,
int x,
char *str,
int n )
811 return mvgetnstr( y, x, str, n );
815 #define mvgetnstr UNDEF(mvgetnstr) 819 inline chtype UNDEF( mvinch )(
int y,
int x ) {
return mvinch( y, x );}
822 #define mvinch UNDEF(mvinch) 826 inline int UNDEF( mvinsch )(
int y,
int x,
char c )
827 {
return mvinsch( y, x, c ); }
830 #define mvinsch UNDEF(mvinsch) 834 inline void UNDEF( napms )(
unsigned long x ) { napms( x ); }
837 #define napms UNDEF(napms) 841 inline int UNDEF( fixterm )( void ) {
return fixterm(); }
844 #define fixterm UNDEF(fixterm) 848 inline int UNDEF( resetterm )( void ) {
return resetterm(); }
851 #define resetterm UNDEF(resetterm) 855 inline int UNDEF( saveterm )( void ) {
return saveterm(); }
858 #define saveterm UNDEF(saveterm) 862 inline int UNDEF( crmode )( void ) {
return crmode(); }
865 #define crmode UNDEF(crmode) 869 inline int UNDEF( nocrmode )( void ) {
return nocrmode(); }
872 #define nocrmode UNDEF(nocrmode) 876 inline chtype UNDEF( getbkgd )(
const WINDOW *win ) {
return getbkgd( win ); }
879 #define getbkgd UNDEF(getbkgd) 883 inline int UNDEF( bkgd )( chtype ch ) {
return bkgd( ch ); }
886 #define bkgd UNDEF(bkgd) 890 inline void UNDEF( bkgdset )( chtype ch ) { bkgdset( ch ); }
893 #define bkgdset UNDEF(bkgdset) 896 template <
class _Tp>
inline int ncursesMaxCoord() {
return INT_MAX; }
897 template <>
inline int ncursesMaxCoord<short>() {
return SHRT_MAX; }
905 friend std::ostream & operator<<( std::ostream & Stream,
const NCursesWindow & Obj_Cv );
906 friend std::ostream & operator<<( std::ostream & Stream,
const NCursesWindow * Obj_Cv );
908 friend class NCursesMenu;
909 friend class NCursesForm;
912 static bool b_initialized;
913 static void initialize();
914 static int ripoff_init( WINDOW *,
int );
918 short getcolor(
int getback )
const;
920 static int setpalette(
short fore,
short back,
short pair );
921 static int colorInitialized;
933 void err_handler(
const char * )
const THROWS( NCursesException );
1002 char absrel =
'a' );
1041 static int lines() { initialize();
return LINES; }
1046 static int cols() { initialize();
return COLS; }
1051 static int tabsize() { initialize();
return TABSIZE; }
1079 int begx()
const {
return getbegx(w); }
1084 int begy()
const {
return getbegy(w); }
1089 int maxx()
const {
return getmaxx(w) == ERR ? ERR : getmaxx(w)-1; }
1094 int maxy()
const {
return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; }
1097 static int maxcoord() {
return ncursesMaxCoord<NCURSES_SIZE_T>(); }
1105 wrect area()
const {
return wrect( begpos(), size() ); }
1125 int setpalette(
short fore,
short back );
1139 virtual int mvwin(
int begin_y,
int begin_x )
1141 return ::mvwin( w, begin_y, begin_x );
1144 int mvsubwin(
NCursesWindow* sub,
int begin_y,
int begin_x );
1146 virtual int resize(
int lines,
int columns );
1154 int move(
int y,
int x ) { return ::wmove( w, y, x ); }
1164 int mvcur(
int oldrow,
int oldcol,
int newrow,
int newcol )
const 1166 return ::mvcur( oldrow, oldcol, newrow, newcol );
1173 int nodelay(
bool bf ) { return ::nodelay( w, bf ); }
1183 int getch(
int y,
int x ) { return ::mvwgetch( w, y, x ); }
1192 return ::wgetnstr( w, str, n );
1199 int getstr(
int y,
int x,
char* str,
int n = -1 )
1201 return ::mvwgetnstr( w, y, x, str, n );
1209 int instr(
char *s,
int n = -1 ) { return ::winnstr( w, s, n ); }
1215 int instr(
int y,
int x,
char *s,
int n = -1 )
1217 return ::mvwinnstr( w, y, x, s, n );
1229 return addch((
const chtype )( ch&A_CHARTEXT ) );
1232 int addch(
const chtype ch ) { return ::waddch( w, ch ); }
1238 int add_attr_char();
1243 int add_wch(
const cchar_t * cch ) { return ::wadd_wch( w, cch ); }
1245 int add_wch(
int y,
int x,
const cchar_t * cch ) {
return mvwadd_wch( w, y, x, cch ); }
1251 int addch(
int y,
int x,
const char ch )
1253 return addch( y, x, (
const chtype )( ch&A_CHARTEXT ) );
1256 int addch(
int y,
int x,
const chtype ch )
1258 return ::mvwaddch( w, y, x, ch );
1266 return echochar((
const chtype )( ch&A_CHARTEXT ) );
1269 int echochar(
const chtype ch ) { return ::wechochar( w, ch ); }
1277 return ::waddnstr( w, (
char* )str, n );
1284 int addstr(
int y,
int x,
const char * str,
int n = -1 )
1286 return ::mvwaddnstr( w, y, x, (
char* )str, n );
1293 int addwstr(
const wchar_t* str,
int n = -1 );
1299 int addwstr(
int y,
int x,
const wchar_t * str,
int n = -1 );
1304 int printw(
const char* fmt, ... )
1306 __attribute__(( format( printf, 2, 3 ) ) );
1314 int printw(
int y,
int x,
const char * fmt, ... )
1316 __attribute__(( format( printf, 4, 5 ) ) );
1324 chtype
inch()
const { return ::winch( w ); }
1326 chtype inchar()
const {
return inch()&( A_CHARTEXT | A_ALTCHARSET ); }
1332 chtype
inch(
int y,
int x ) { return ::mvwinch( w, y, x ); }
1334 chtype inchar(
int y,
int x ) {
return inch( y, x )&( A_CHARTEXT | A_ALTCHARSET ); }
1340 int in_wchar(
int y,
int x, cchar_t * cchar );
1346 int insch( chtype ch ) { return ::winsch( w, ch ); }
1354 return ::mvwinsch( w, y, x, ch );
1361 int ins_wch(
int y,
int x,
const cchar_t * cchar )
1363 return mvwins_wch( w, y, x, cchar );
1375 int insdelln(
int n = 1 ) { return ::winsdelln( w, n ); }
1384 return ::winsnstr( w, s, n );
1391 int insstr(
int y,
int x,
const char *s,
int n = -1 )
1393 return ::mvwinsnstr( w, y, x, s, n );
1399 int attron( chtype at ) { return ::wattron( w, at ); }
1404 int attroff( chtype at ) { return ::wattroff( w, at ); }
1409 int attrset( chtype at ) { return ::wattrset( w, at ); }
1416 int chgat(
int n, attr_t attr,
short color,
const void *opts = NULL )
1418 return ::wchgat( w, n, attr, color, opts );
1426 int n, attr_t attr,
short color,
const void *opts = NULL )
1428 return ::mvwchgat( w, y, x, n, attr, color, opts );
1442 int bkgd(
const chtype ch ) { return ::wbkgd( w, ch ); }
1447 void bkgdset( chtype ch ) { ::wbkgdset( w, ch ); }
1468 int border( chtype left = 0, chtype right = 0,
1469 chtype top = 0, chtype bottom = 0,
1470 chtype top_left = 0, chtype top_right = 0,
1471 chtype bottom_left = 0, chtype bottom_right = 0 )
1473 return ::wborder( w, left, right, top, bottom, top_left, top_right,
1474 bottom_left, bottom_right );
1484 int hline(
int len, chtype ch = 0 ) { return ::whline( w, ch, len ); }
1489 int hline(
int y,
int x,
int len, chtype ch = 0 )
1491 return ::mvwhline( w, y, x, ch, len );
1498 int vline(
int len, chtype ch = 0 ) { return ::wvline( w, ch, len ); }
1503 int vline(
int y,
int x,
int len, chtype ch = 0 )
1505 return ::mvwvline( w, y, x, ch, len );
1527 int clearok(
bool bf ) { return ::clearok( w, bf ); }
1548 int delch(
int y,
int x ) { return ::mvwdelch( w, y, x ); }
1562 int scroll(
int amount = 1 ) { return ::wscrl( w, amount ); }
1569 int scrollok(
bool bf ) { return ::scrollok( w, bf ); }
1576 return ::wsetscrreg( w, from, to );
1583 int idlok(
bool bf ) { return ::idlok( w, bf ); }
1605 int touchln(
int s,
int cnt,
bool changed = TRUE )
1607 return ::wtouchln( w, s, cnt, (
int )( changed ? 1 : 0 ) );
1630 int leaveok(
bool bf ) { return ::leaveok( w, bf ); }
1635 int redrawln(
int from,
int n ) { return ::wredrawln( w, from, n ); }
1665 int syncok(
bool bf ) { return ::syncok( w, bf ); }
1668 int flushok(
bool bf ) { return ::flushok( w, bf ); }
1681 int keypad(
bool bf ) { return ::keypad( w, bf ); }
1687 int meta(
bool bf ) { return ::meta( w, bf ); }
1723 return ::overlay( w, win.
w );
1731 return ::overwrite( w, win.
w );
1740 int sminrow,
int smincol,
1741 int dminrow,
int dmincol,
1742 int dmaxrow,
int dmaxcol,
bool overlay = TRUE )
1744 return ::copywin( w, win.
w, sminrow, smincol, dminrow, dmincol,
1745 dmaxrow, dmaxcol, (
int )(
overlay ? 1 : 0 ) );
1849 int echochar(
const chtype ch ) { return ::pechochar( w, ch ); }
1866 int sminrow,
int smincol,
1867 int smaxrow,
int smaxcol )
1869 return ::prefresh( w, pminrow, pmincol,
1870 sminrow, smincol, smaxrow, smaxcol );
1877 int sminrow,
int smincol,
1878 int smaxrow,
int smaxcol )
1880 return ::pnoutrefresh( w, pminrow, pmincol,
1881 sminrow, smincol, smaxrow, smaxcol );
1885 #endif // _CURSESW_H int hline(int y, int x, int len, chtype ch=0)
Move the cursor to the requested position and then draw a horizontal line.
int overlay(NCursesWindow &win)
Overlay this window over win.
We leave this here for compatibility reasons.
void kill_subwindows()
Destroy all subwindows.
int clear()
Clear the window.
int printw(const char *fmt,...)
Do a formatted print to the window.
void syncup()
Propagate the changes up in the hierarchy.
static int lines()
Number of lines on terminal, not window.
short getcolor() const
Actual color pair.
int echochar(const chtype ch)
Put the attributed character onto the pad and immediately do a prefresh().
static int tabsize()
Size of a tab on terminal, not window.
NCursesWindow * parent()
Get my parent.
int vline(int len, chtype ch=0)
Draw a vertical line of len characters with the given character.
int bkgd(const chtype ch)
Set the background property and apply it to the window.
void idcok(bool bf)
If bf is TRUE, use insert/delete character hardware support if possible.
int vline(int y, int x, int len, chtype ch=0)
Move the cursor to the requested position and then draw a vertical line.
void bkgdset(chtype ch)
Set the background property.
NCursesWindow * par
parent, if subwindow
int insch(int y, int x, chtype ch)
Move cursor to requested position and then insert the attributed character before that position...
int addstr(int y, int x, const char *str, int n=-1)
Move the cursor to the requested position and then perform the addstr as described above...
short foreground() const
Actual foreground color.
int clearok(bool bf)
Set/Reset the clear flag.
int maxx() const
Largest x coord in window.
int delch()
Delete character under the cursor.
bool isDescendant(NCursesWindow &win)
Return TRUE if win is a descendant of this.
int delch(int y, int x)
Move cursor to requested position and delete the character under the cursor.
int insertln()
Insert an empty line above the current line.
short background() const
Actual background color.
virtual int refresh()
Propagate the changes in this window to the virtual screen and call doupdate().
int colors() const
Number of available colors.
int syncok(bool bf)
If called with bf=TRUE, syncup() is called whenever the window is changed.
static int cols()
Number of cols on terminal, not window.
int chgat(int y, int x, int n, attr_t attr, short color, const void *opts=NULL)
Move the cursor to the requested position and then perform chgat() as described above.
static int NumberOfColors()
Number of available colors.
int insch(chtype ch)
Insert attributed character into the window before current cursor position.
int noutrefresh(int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol)
Does the same like refresh() but without calling doupdate().
int box()
Draw a box around the window with the given vertical and horizontal drawing characters.
static int maxcoord()
Ncurses up to ncurses5 internally uses short.
int idlok(bool bf)
If bf is TRUE, use insert/delete line hardware support if possible.
int setcolor(short pair)
Set actually used palette entry.
void syncdown()
Propagate the changes down to all descendant windows.
NCursesColorWindow(NCursesWindow &par, int lines, int cols, int begin_y, int begin_x, char absrel= 'a')
Constructor.
int clrtoeol()
Clear to the end of the line.
int hline(int len, chtype ch=0)
Draw a horizontal line of len characters with the given character.
int addch(int y, int x, const char ch)
Move cursor to the requested position and then put attributed character to the window.
int attroff(chtype at)
Switch off the window attributes;.
void immedok(bool bf)
If called with bf=TRUE, any change in the window will cause an automatic immediate refresh() ...
int overwrite(NCursesWindow &win)
Overwrite win with this window.
int copywin(NCursesWindow &win, int sminrow, int smincol, int dminrow, int dmincol, int dmaxrow, int dmaxcol, bool overlay=TRUE)
Overlay or overwrite the rectangle in win given by dminrow,dmincol, dmaxrow,dmaxcol with the rectangl...
NCursesColorWindow(WINDOW *&window)
Constructor.
int addwstr(const wchar_t *str, int n=-1)
Write the wchar_t str to the window, stop writing if the terminating NUL or the limit n is reached...
void err_handler(const char *) const THROWS(NCursesException)
Signal an error with the given message text.
int doupdate()
Do all outputs to make the physical screen looking like the virtual one.
virtual ~NCursesWindow()
Destructor.
int height() const
Number of lines in this window.
int instr(char *s, int n=-1)
Get a std::string of characters from the window into the buffer s.
int standout()
Enable "standout" attributes.
int standend()
Disable "standout" attributes.
int add_attr_char(int y, int x)
Put attributed character from given position to the window.
int addch(const char ch)
Put attributed character to the window.
int setscrreg(int from, int to)
Define a soft scrolling region.
int redrawwin()
Redraw the whole window.
int in_wchar(cchar_t *cchar)
Retrieve combined character under the current cursor position.
static long count
count of all active windows
int border(chtype left=0, chtype right=0, chtype top=0, chtype bottom=0, chtype top_left=0, chtype top_right=0, chtype bottom_left=0, chtype bottom_right=0)
Draw a border around the window with the given characters for the various parts of the border...
virtual int noutrefresh()
Propagate the changes in this window to the virtual screen.
int begy() const
Line of top left corner relative to stdscr.
int getch(int y, int x)
Move cursor to position and get a keystroke from the window.
NCursesWindow * sibling()
Get the next child of my parent.
int mvcur(int oldrow, int oldcol, int newrow, int newcol) const
Perform lowlevel cursor motion that takes effect immediately.
int redrawln(int from, int n)
Redraw n lines starting from the requested line.
void getyx(int &y, int &x) const
Get current position of the cursor.
int insstr(const char *s, int n=-1)
Insert the std::string into the window before the current cursor position.
NCursesWindow()
Only for use by derived classes.
int chgat(int n, attr_t attr, short color, const void *opts=NULL)
Change the attributes of the next n characters in the current line.
int refresh()
For Pad's we reimplement refresh() and noutrefresh() to do nothing.
int begx() const
Column of top left corner relative to stdscr.
int instr(int y, int x, char *s, int n=-1)
Move the cursor to the requested position and then perform the instr() as described above...
int erase()
Erase the window.
virtual int mvwin(int begin_y, int begin_x)
Move window to new position with the new position as top left corner.
chtype getbkgd() const
Get current background setting.
int keypad(bool bf)
If called with bf=TRUE, the application will interpret function keys.
static void useColors(void)
Call this routine very early if you want to have colors.
int getstr(int y, int x, char *str, int n=-1)
Move the cursor to the requested position and then perform the getstr() as described above...
int insstr(int y, int x, const char *s, int n=-1)
Move the cursor to the requested position and then perform the insstr() as described above...
int leaveok(bool bf)
If bf is TRUE, curses will leave the cursor after an update whereever it is after the update...
int move(int y, int x)
Move cursor the this position.
int attron(chtype at)
Switch on the window attributes;.
int deleteln()
Delete the current line.
int echochar(const char ch)
Put attributed character to the window and refresh it immediately.
int getch()
Get a keystroke from the window.
int maxy() const
Largest y coord in window.
bool has_mouse() const
Return TRUE if terminal supports a mouse, FALSE otherwise.
int refresh(int pminrow, int pmincol, int sminrow, int smincol, int smaxrow, int smaxcol)
The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle on the screen.
int touchwin()
Mark the whole window as modified.
int scrollok(bool bf)
If bf is TRUE, window scrolls if cursor is moved off the bottom edge of the window or a scrolling reg...
NCursesWindow * sib
next subwindow of parent
int ins_wch(int y, int x, const cchar_t *cchar)
Move cursor to requested position and then insert the attributed character before that position...
int attrset(chtype at)
Set the window attributes;.
NCursesWindow Clone()
Make an exact copy of the window.
NCursesWindow * subwins
head of subwindows std::list
int touchln(int s, int cnt, bool changed=TRUE)
Mark cnt lines beginning from line s as changed or unchanged, depending on the value of the changed f...
bool is_wintouched() const
Return TRUE if window is marked as changed, FALSE otherwise.
int scroll(int amount=1)
Scroll amount lines.
int insdelln(int n=1)
If n>0 insert that many lines above the current line.
int untouchwin()
Mark the whole window as unmodified.
int addstr(const char *str, int n=-1)
Write the std::string str to the window, stop writing if the terminating NUL or the limit n is reache...
chtype inch() const
Retrieve attributed character under the current cursor position.
int width() const
Number of columns in this window.
NCursesColorWindow(int lines, int cols, int begin_y, int begin_x)
Constructor.
WINDOW * w
the curses WINDOW
bool is_linetouched(int line) const
Return TRUE if line is marked as changed, FALSE otherwise.
int getstr(char *str, int n=-1)
Read a series of characters into str until a newline or carriage return is received.
chtype inch(int y, int x)
Move cursor to requested position and then retrieve attributed character at this position.
void cursyncup()
Position the cursor in all ancestor windows corresponding to our setting.
static int ripoffline(int ripoff_lines, int(*init)(NCursesWindow &win))
This function is used to generate a window of ripped-of lines.
int meta(bool bf)
If called with bf=TRUE, keys may generate 8-Bit characters.
NCursesWindow * child()
Get the first child window.
int noutrefresh()
Propagate the changes in this window to the virtual screen.
int add_wch(const cchar_t *cch)
Put a combined character to the window.
bool alloced
TRUE if we own the WINDOW.
int clrtobot()
Clear to the end of the window.