30 #include <ncursesw/etip.h>
36 #include <ncursesw/curses.h>
46 #define UNDEF(name) CUR_ ##name
49 inline int UNDEF( addch )( chtype ch ) {
return addch( ch ); }
52 #define addch UNDEF(addch)
56 inline int UNDEF( add_wch )( cchar_t * cch ) {
return add_wch( cch ); }
59 #define add_wch UNDEF(add_wch)
63 inline int UNDEF( echochar )( chtype ch ) {
return echochar( ch ); }
66 #define echochar UNDEF(echochar)
70 inline int UNDEF( insdelln )(
int n ) {
return insdelln( n ); }
73 #define insdelln UNDEF(insdelln)
78 inline int UNDEF( addstr )(
const char * str ) {
return addstr((
char* )str ); }
81 #define addstr UNDEF(addstr)
86 inline int UNDEF( addwstr )(
const wchar_t * str ) {
return addwstr((
wchar_t* )str ); }
89 #define addwstr UNDEF(addwstr)
93 inline int UNDEF( attron )( chtype at ) {
return attron( at ); }
96 #define attron UNDEF(attron)
100 inline int UNDEF( attroff )( chtype at ) {
return attroff( at ); }
103 #define attroff UNDEF(attroff)
107 inline chtype UNDEF( attrset )( chtype at ) {
return attrset( at ); }
110 #define attrset UNDEF(attrset)
114 inline int UNDEF( border )( chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br )
115 {
return border( ls, rs, ts, bs, tl, tr, bl, br ); }
118 #define border UNDEF(border)
122 inline int UNDEF( box )( WINDOW *win,
int v,
int h ) {
return box( win, v, h ); }
125 #define box UNDEF(box)
129 inline int UNDEF( mvwhline )( WINDOW *win,
int y,
int x, chtype c,
int n )
131 return mvwhline( win, y, x, c, n );
135 #define mvwhline UNDEF(mvwhline)
139 inline int UNDEF( mvwvline )( WINDOW *win,
int y,
int x, chtype c,
int n )
141 return mvwvline( win, y, x, c, n );
145 #define mvwvline UNDEF(mvwvline)
149 inline int UNDEF( clear )() {
return clear(); }
152 #define clear UNDEF(clear)
156 inline int UNDEF( clearok )( WINDOW* win,
bool bf ) {
return clearok( win, bf ); }
159 #define clearok UNDEF(clearok)
161 extern "C" int clearok( WINDOW*,
bool );
165 inline int UNDEF( clrtobot )() {
return clrtobot(); }
168 #define clrtobot UNDEF(clrtobot)
172 inline int UNDEF( clrtoeol )() {
return clrtoeol(); }
175 #define clrtoeol UNDEF(clrtoeol)
179 inline int UNDEF( delch )() {
return delch(); }
182 #define delch UNDEF(delch)
186 inline int UNDEF( deleteln )() {
return deleteln(); }
189 #define deleteln UNDEF(deleteln)
193 inline int UNDEF( erase )() {
return erase(); }
196 #define erase UNDEF(erase)
200 inline int UNDEF( flushok )( WINDOW* _win,
bool _bf )
202 return flushok( _win, _bf );
206 #define flushok UNDEF(flushok)
212 inline int UNDEF( getch )() {
return getch(); }
215 #define getch UNDEF(getch)
219 inline int UNDEF( getstr )(
char *_str ) {
return getstr( _str ); }
222 #define getstr UNDEF(getstr)
226 inline int UNDEF( instr )(
char *_str ) {
return instr( _str ); }
229 #define instr UNDEF(instr)
233 inline int UNDEF( innstr )(
char *_str,
int n ) {
return innstr( _str, n ); }
236 #define innstr UNDEF(innstr)
240 inline int UNDEF( mvwinnstr )( WINDOW *win,
int y,
int x,
char *_str,
int n )
242 return mvwinnstr( win, y, x, _str, n );
246 #define mvwinnstr UNDEF(mvwinnstr)
250 inline int UNDEF( mvinnstr )(
int y,
int x,
char *_str,
int n )
252 return mvinnstr( y, x, _str, n );
256 #define mvinnstr UNDEF(mvinnstr)
260 inline int UNDEF( winsstr )( WINDOW *w,
const char *_str )
262 return winsstr( w, _str );
266 #define winsstr UNDEF(winsstr)
270 inline int UNDEF( mvwinsstr )( WINDOW *w,
int y,
int x,
const char *_str )
272 return mvwinsstr( w, y, x, _str );
276 #define mvwinsstr UNDEF(mvwinsstr)
280 inline int UNDEF( insstr )(
const char *_str )
282 return insstr( _str );
286 #define insstr UNDEF(insstr)
290 inline int UNDEF( mvinsstr )(
int y,
int x,
const char *_str )
292 return mvinsstr( y, x, _str );
296 #define mvinsstr UNDEF(mvinsstr)
300 inline int UNDEF( insnstr )(
const char *_str,
int n )
302 return insnstr( _str, n );
306 #define insnstr UNDEF(insnstr)
310 inline int UNDEF( mvwinsnstr )( WINDOW *w,
int y,
int x,
const char *_str,
int n )
312 return mvwinsnstr( w, y, x, _str, n );
316 #define mvwinsnstr UNDEF(mvwinsnstr)
320 inline int UNDEF( mvinsnstr )(
int y,
int x,
const char *_str,
int n )
322 return mvinsnstr( y, x, _str, n );
326 #define mvinsnstr UNDEF(mvinsnstr)
330 inline int UNDEF( getnstr )(
char *_str,
int n ) {
return getnstr( _str, n ); }
333 #define getnstr UNDEF(getnstr)
337 inline void UNDEF( getyx )(
const WINDOW* win,
int& y,
int& x )
343 #define getyx UNDEF(getyx)
347 inline void UNDEF( getbegyx )( WINDOW* win,
int& y,
int& x ) { getbegyx( win, y, x ); }
350 #define getbegyx UNDEF(getbegyx)
354 inline void UNDEF( getmaxyx )( WINDOW* win,
int& y,
int& x ) { getmaxyx( win, y, x ); }
357 #define getmaxyx UNDEF(getmaxyx)
361 inline int UNDEF( hline )( chtype ch,
int n ) {
return hline( ch, n ); }
364 #define hline UNDEF(hline)
368 inline chtype UNDEF( inch )() {
return inch(); }
371 #define inch UNDEF(inch)
375 inline int UNDEF( in_wch )( cchar_t * cch ) {
return in_wch( cch ); }
378 #define in_wch UNDEF(in_wch)
382 inline int UNDEF( insch )(
char c ) {
return insch( c ); }
385 #define insch UNDEF(insch)
389 inline int UNDEF( ins_wch )(
const cchar_t *c ) {
return ins_wch( c ); }
392 #define ins_wch UNDEF(ins_wch)
396 inline int UNDEF( mvwins_wch )( WINDOW *w,
int y,
int x,
const cchar_t *cchar ) {
return mvwins_wch( w, y, x, cchar ); }
399 #define mvwins_wch UNDEF(mvwins_wch)
403 inline int UNDEF( insertln )() {
return insertln(); }
406 #define insertln UNDEF(insertln)
410 inline int UNDEF( leaveok )( WINDOW* win,
bool bf ) {
return leaveok( win, bf ); }
413 #define leaveok UNDEF(leaveok)
415 extern "C" int leaveok( WINDOW* win,
bool bf );
419 inline int UNDEF( move )(
int x,
int y ) {
return move( x, y ); }
422 #define move UNDEF(move)
426 inline int UNDEF( refresh )() {
return refresh(); }
429 #define refresh UNDEF(refresh)
433 inline int UNDEF( redrawwin )( WINDOW *win ) {
return redrawwin( win ); }
436 #define redrawwin UNDEF(redrawwin)
440 inline int UNDEF( scrl )(
int l ) {
return scrl( l ); }
443 #define scrl UNDEF(scrl)
447 inline int UNDEF( scroll )( WINDOW *win ) {
return scroll( win ); }
450 #define scroll UNDEF(scroll)
454 inline int UNDEF( scrollok )( WINDOW* win,
bool bf ) {
return scrollok( win, bf ); }
457 #define scrollok UNDEF(scrollok)
459 #if defined(__NCURSES_H)
460 extern "C" int scrollok( WINDOW*,
bool );
462 extern "C" int scrollok( WINDOW*,
char );
467 inline int UNDEF( setscrreg )(
int t,
int b ) {
return setscrreg( t, b ); }
470 #define setscrreg UNDEF(setscrreg)
474 inline int UNDEF( standend )() {
return standend(); }
477 #define standend UNDEF(standend)
481 inline int UNDEF( standout )() {
return standout(); }
484 #define standout UNDEF(standout)
488 inline WINDOW *UNDEF( subpad )( WINDOW *p,
int l,
int c,
int y,
int x )
489 {
return derwin( p, l, c, y, x ); }
492 #define subpad UNDEF(subpad)
496 #if NCURSES_VERSION_MAJOR < 5
497 inline int UNDEF( timeout )(
int delay ) {
return timeout( delay ); }
500 inline void UNDEF( timeout )(
int delay ) { timeout( delay ); }
504 #define timeout UNDEF(timeout)
508 inline int UNDEF( touchline )( WINDOW *win,
int s,
int c )
509 {
return touchline( win, s, c ); }
512 #define touchline UNDEF(touchline)
516 inline int UNDEF( touchwin )( WINDOW *win ) {
return touchwin( win ); }
519 #define touchwin UNDEF(touchwin)
523 inline int UNDEF( untouchwin )( WINDOW *win ) {
return untouchwin( win ); }
526 #define untouchwin UNDEF(untouchwin)
530 inline int UNDEF( vline )( chtype ch,
int n ) {
return vline( ch, n ); }
533 #define vline UNDEF(vline)
537 inline int UNDEF( waddstr )( WINDOW *win,
char *str ) {
return waddstr( win, str ); }
540 #define waddstr UNDEF(waddstr)
544 inline int UNDEF( waddwstr )( WINDOW *win,
wchar_t *str ) {
return waddwstr( win, str ); }
547 #define waddwstr UNDEF(waddwstr)
551 inline int UNDEF( mvwaddwstr )( WINDOW *win,
int y,
int x,
wchar_t *str )
552 {
return mvwaddwstr( win, y, x, str ); }
555 #define mvwaddwstr UNDEF(mvwaddwstr)
559 inline int UNDEF( waddchstr )( WINDOW *win, chtype *at ) {
return waddchstr( win, at ); }
562 #define waddchstr UNDEF(waddchstr)
566 inline int UNDEF( wstandend )( WINDOW *win ) {
return wstandend( win ); }
569 #define wstandend UNDEF(wstandend)
573 inline int UNDEF( wstandout )( WINDOW *win ) {
return wstandout( win ); }
576 #define wstandout UNDEF(wstandout)
581 inline int UNDEF( wattroff )( WINDOW *win,
int att ) {
return wattroff( win, att ); }
584 #define wattroff UNDEF(wattroff)
588 inline int UNDEF( chgat )(
int n, attr_t attr,
short color,
const void *opts )
590 return chgat( n, attr, color, opts );
594 #define chgat UNDEF(chgat)
598 inline int UNDEF( mvchgat )(
int y,
int x,
int n,
599 attr_t attr,
short color,
const void *opts )
601 return mvchgat( y, x, n, attr, color, opts );
605 #define mvchgat UNDEF(mvchgat)
609 inline int UNDEF( mvwchgat )( WINDOW *win,
int y,
int x,
int n,
610 attr_t attr,
short color,
const void *opts )
612 return mvwchgat( win, y, x, n, attr, color, opts );
616 #define mvwchgat UNDEF(mvwchgat)
620 inline int UNDEF( wattrset )( WINDOW *win,
int att ) {
return wattrset( win, att ); }
623 #define wattrset UNDEF(wattrset)
627 inline chtype UNDEF( winch )(
const WINDOW* win ) {
return winch( win ); }
630 #define winch UNDEF(winch)
634 inline int UNDEF( mvwaddch )( WINDOW *win,
int y,
int x,
const chtype ch )
635 {
return mvwaddch( win, y, x, ch ); }
638 #define mvwaddch UNDEF(mvwaddch)
642 inline int UNDEF( mvwaddchnstr )( WINDOW *win,
int y,
int x, chtype *str,
int n )
643 {
return mvwaddchnstr( win, y, x, str, n ); }
646 #define mvwaddchnstr UNDEF(mvwaddchnstr)
650 inline int UNDEF( mvwaddchstr )( WINDOW *win,
int y,
int x, chtype *str )
651 {
return mvwaddchstr( win, y, x, str ); }
654 #define mvwaddchstr UNDEF(mvwaddchstr)
658 inline int UNDEF( addnstr )(
const char *str,
int n )
659 {
return addnstr((
char* )str, n ); }
662 #define addnstr UNDEF(addnstr)
666 inline int UNDEF( addnwstr )(
const wchar_t *str,
int n )
667 {
return addnwstr((
wchar_t* )str, n ); }
670 #define addnwstr UNDEF(addnwstr)
674 inline int UNDEF( mvwaddnstr )( WINDOW *win,
int y,
int x,
const char *str,
int n )
675 {
return mvwaddnstr( win, y, x, (
char* )str, n ); }
678 #define mvwaddnstr UNDEF(mvwaddnstr)
682 inline int UNDEF( mvwaddnwstr )( WINDOW *win,
int y,
int x,
const wchar_t *str,
int n )
683 {
return mvwaddnwstr( win, y, x, (
wchar_t* )str, n ); }
686 #define mvwaddnwstr UNDEF(mvwaddnwstr)
690 inline int UNDEF( mvwaddstr )( WINDOW *win,
int y,
int x,
const char * str )
691 {
return mvwaddstr( win, y, x, (
char* )str ); }
694 #define mvwaddstr UNDEF(mvwaddstr)
698 inline int UNDEF( mvwdelch )( WINDOW *win,
int y,
int x )
699 {
return mvwdelch( win, y, x ); }
702 #define mvwdelch UNDEF(mvwdelch)
706 inline int UNDEF( mvwgetch )( WINDOW *win,
int y,
int x ) {
return mvwgetch( win, y, x );}
709 #define mvwgetch UNDEF(mvwgetch)
713 inline int UNDEF( mvwgetstr )( WINDOW *win,
int y,
int x,
char *str )
714 {
return mvwgetstr( win, y, x, str );}
717 #define mvwgetstr UNDEF(mvwgetstr)
721 inline int UNDEF( mvwgetnstr )( WINDOW *win,
int y,
int x,
char *str,
int n )
722 {
return mvwgetnstr( win, y, x, str, n );}
725 #define mvwgetnstr UNDEF(mvwgetnstr)
729 inline chtype UNDEF( mvwinch )( WINDOW *win,
int y,
int x )
731 return mvwinch( win, y, x );
735 #define mvwinch UNDEF(mvwinch)
739 inline int UNDEF( mvwin_wch )( WINDOW *win,
int y,
int x, cchar_t * cch )
741 return mvwin_wch( win, y, x, cch );
745 #define mvwin_wch UNDEF(mvwin_wch)
749 inline int UNDEF( mvwinsch )( WINDOW *win,
int y,
int x,
char c )
750 {
return mvwinsch( win, y, x, c ); }
753 #define mvwinsch UNDEF(mvwinsch)
757 inline int UNDEF( mvaddch )(
int y,
int x, chtype ch )
758 {
return mvaddch( y, x, ch ); }
761 #define mvaddch UNDEF(mvaddch)
765 inline int UNDEF( mvaddnstr )(
int y,
int x,
const char *str,
int n )
766 {
return mvaddnstr( y, x, (
char* )str, n ); }
769 #define mvaddnstr UNDEF(mvaddnstr)
773 inline int UNDEF( mvaddstr )(
int y,
int x,
const char * str )
774 {
return mvaddstr( y, x, (
char* )str ); }
777 #define mvaddstr UNDEF(mvaddstr)
781 inline int UNDEF( mvwadd_wch )( WINDOW *win,
int y,
int x,
const cchar_t * cch )
782 {
return mvwadd_wch( win, y, x, ( cchar_t* )cch ); }
785 #define mvwadd_wch UNDEF(mvwadd_wch)
789 inline int UNDEF( mvdelch )(
int y,
int x ) {
return mvdelch( y, x );}
792 #define mvdelch UNDEF(mvdelch)
796 inline int UNDEF( mvgetch )(
int y,
int x ) {
return mvgetch( y, x );}
799 #define mvgetch UNDEF(mvgetch)
803 inline int UNDEF( mvgetstr )(
int y,
int x,
char *str ) {
return mvgetstr( y, x, str );}
806 #define mvgetstr UNDEF(mvgetstr)
810 inline int UNDEF( mvgetnstr )(
int y,
int x,
char *str,
int n )
812 return mvgetnstr( y, x, str, n );
816 #define mvgetnstr UNDEF(mvgetnstr)
820 inline chtype UNDEF( mvinch )(
int y,
int x ) {
return mvinch( y, x );}
823 #define mvinch UNDEF(mvinch)
827 inline int UNDEF( mvinsch )(
int y,
int x,
char c )
828 {
return mvinsch( y, x, c ); }
831 #define mvinsch UNDEF(mvinsch)
835 inline void UNDEF( napms )(
unsigned long x ) { napms( x ); }
838 #define napms UNDEF(napms)
842 inline int UNDEF( fixterm )( void ) {
return fixterm(); }
845 #define fixterm UNDEF(fixterm)
849 inline int UNDEF( resetterm )( void ) {
return resetterm(); }
852 #define resetterm UNDEF(resetterm)
856 inline int UNDEF( saveterm )( void ) {
return saveterm(); }
859 #define saveterm UNDEF(saveterm)
863 inline int UNDEF( crmode )( void ) {
return crmode(); }
866 #define crmode UNDEF(crmode)
870 inline int UNDEF( nocrmode )( void ) {
return nocrmode(); }
873 #define nocrmode UNDEF(nocrmode)
877 inline chtype UNDEF( getbkgd )(
const WINDOW *win ) {
return getbkgd( win ); }
880 #define getbkgd UNDEF(getbkgd)
884 inline int UNDEF( bkgd )( chtype ch ) {
return bkgd( ch ); }
887 #define bkgd UNDEF(bkgd)
891 inline void UNDEF( bkgdset )( chtype ch ) { bkgdset( ch ); }
894 #define bkgdset UNDEF(bkgdset)
897 template <
class _Tp>
inline int ncursesMaxCoord() {
return INT_MAX; }
898 template <>
inline int ncursesMaxCoord<short>() {
return SHRT_MAX; }
906 friend std::ostream & operator<<( std::ostream & Stream,
const NCursesWindow & Obj_Cv );
907 friend std::ostream & operator<<( std::ostream & Stream,
const NCursesWindow * Obj_Cv );
909 friend class NCursesMenu;
910 friend class NCursesForm;
913 static bool b_initialized;
914 static void initialize();
915 static int ripoff_init( WINDOW *,
int );
919 short getcolor(
int getback )
const;
921 static int setpalette(
short fore,
short back,
short pair );
922 static int colorInitialized;
934 void err_handler(
const char * )
const THROWS( NCursesException );
1003 char absrel =
'a' );
1042 static int lines() { initialize();
return LINES; }
1047 static int cols() { initialize();
return COLS; }
1052 static int tabsize() { initialize();
return TABSIZE; }
1080 int begx()
const {
return getbegx(w); }
1085 int begy()
const {
return getbegy(w); }
1090 int maxx()
const {
return getmaxx(w) == ERR ? ERR : getmaxx(w)-1; }
1095 int maxy()
const {
return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; }
1098 static int maxcoord() {
return ncursesMaxCoord<NCURSES_SIZE_T>(); }
1106 wrect area()
const {
return wrect( begpos(), size() ); }
1126 int setpalette(
short fore,
short back );
1140 virtual int mvwin(
int begin_y,
int begin_x )
1142 return ::mvwin( w, begin_y, begin_x );
1145 int mvsubwin(
NCursesWindow* sub,
int begin_y,
int begin_x );
1147 virtual int resize(
int lines,
int columns );
1155 int move(
int y,
int x ) { return ::wmove( w, y, x ); }
1165 int mvcur(
int oldrow,
int oldcol,
int newrow,
int newcol )
const
1167 return ::mvcur( oldrow, oldcol, newrow, newcol );
1174 int nodelay(
bool bf ) { return ::nodelay( w, bf ); }
1184 int getch(
int y,
int x ) { return ::mvwgetch( w, y, x ); }
1193 return ::wgetnstr( w, str, n );
1200 int getstr(
int y,
int x,
char* str,
int n = -1 )
1202 return ::mvwgetnstr( w, y, x, str, n );
1210 int instr(
char *s,
int n = -1 ) { return ::winnstr( w, s, n ); }
1216 int instr(
int y,
int x,
char *s,
int n = -1 )
1218 return ::mvwinnstr( w, y, x, s, n );
1230 return addch((
const chtype )( ch&A_CHARTEXT ) );
1233 int addch(
const chtype ch ) { return ::waddch( w, ch ); }
1244 int add_wch(
const cchar_t * cch ) { return ::wadd_wch( w, cch ); }
1246 int add_wch(
int y,
int x,
const cchar_t * cch ) {
return mvwadd_wch( w, y, x, cch ); }
1252 int addch(
int y,
int x,
const char ch )
1254 return addch( y, x, (
const chtype )( ch&A_CHARTEXT ) );
1257 int addch(
int y,
int x,
const chtype ch )
1259 return ::mvwaddch( w, y, x, ch );
1267 return echochar((
const chtype )( ch&A_CHARTEXT ) );
1270 int echochar(
const chtype ch ) { return ::wechochar( w, ch ); }
1278 return ::waddnstr( w, (
char* )str, n );
1285 int addstr(
int y,
int x,
const char * str,
int n = -1 )
1287 return ::mvwaddnstr( w, y, x, (
char* )str, n );
1294 int addwstr(
const wchar_t* str,
int n = -1 );
1300 int addwstr(
int y,
int x,
const wchar_t * str,
int n = -1 );
1305 int printw(
const char* fmt, ... )
1307 __attribute__(( format( printf, 2, 3 ) ) );
1315 int printw(
int y,
int x,
const char * fmt, ... )
1317 __attribute__(( format( printf, 4, 5 ) ) );
1325 chtype
inch()
const { return ::winch( w ); }
1327 chtype inchar()
const {
return inch()&( A_CHARTEXT | A_ALTCHARSET ); }
1333 chtype
inch(
int y,
int x ) { return ::mvwinch( w, y, x ); }
1335 chtype inchar(
int y,
int x ) {
return inch( y, x )&( A_CHARTEXT | A_ALTCHARSET ); }
1341 int in_wchar(
int y,
int x, cchar_t * cchar );
1347 int insch( chtype ch ) { return ::winsch( w, ch ); }
1355 return ::mvwinsch( w, y, x, ch );
1362 int ins_wch(
int y,
int x,
const cchar_t * cchar )
1364 return mvwins_wch( w, y, x, cchar );
1376 int insdelln(
int n = 1 ) { return ::winsdelln( w, n ); }
1385 return ::winsnstr( w, s, n );
1392 int insstr(
int y,
int x,
const char *s,
int n = -1 )
1394 return ::mvwinsnstr( w, y, x, s, n );
1400 int attron( chtype at ) { return ::wattron( w, at ); }
1405 int attroff( chtype at ) { return ::wattroff( w, at ); }
1410 int attrset( chtype at ) { return ::wattrset( w, at ); }
1417 int chgat(
int n, attr_t attr,
short color,
const void *opts = NULL )
1419 return ::wchgat( w, n, attr, color, opts );
1427 int n, attr_t attr,
short color,
const void *opts = NULL )
1429 return ::mvwchgat( w, y, x, n, attr, color, opts );
1443 int bkgd(
const chtype ch ) { return ::wbkgd( w, ch ); }
1448 void bkgdset( chtype ch ) { ::wbkgdset( w, ch ); }
1469 int border( chtype left = 0, chtype right = 0,
1470 chtype top = 0, chtype bottom = 0,
1471 chtype top_left = 0, chtype top_right = 0,
1472 chtype bottom_left = 0, chtype bottom_right = 0 )
1474 return ::wborder( w, left, right, top, bottom, top_left, top_right,
1475 bottom_left, bottom_right );
1485 int hline(
int len, chtype ch = 0 ) { return ::whline( w, ch, len ); }
1490 int hline(
int y,
int x,
int len, chtype ch = 0 )
1492 return ::mvwhline( w, y, x, ch, len );
1499 int vline(
int len, chtype ch = 0 ) { return ::wvline( w, ch, len ); }
1504 int vline(
int y,
int x,
int len, chtype ch = 0 )
1506 return ::mvwvline( w, y, x, ch, len );
1528 int clearok(
bool bf ) { return ::clearok( w, bf ); }
1549 int delch(
int y,
int x ) { return ::mvwdelch( w, y, x ); }
1563 int scroll(
int amount = 1 ) { return ::wscrl( w, amount ); }
1570 int scrollok(
bool bf ) { return ::scrollok( w, bf ); }
1577 return ::wsetscrreg( w, from, to );
1584 int idlok(
bool bf ) { return ::idlok( w, bf ); }
1606 int touchln(
int s,
int cnt,
bool changed = TRUE )
1608 return ::wtouchln( w, s, cnt, (
int )( changed ? 1 : 0 ) );
1631 int leaveok(
bool bf ) { return ::leaveok( w, bf ); }
1636 int redrawln(
int from,
int n ) { return ::wredrawln( w, from, n ); }
1666 int syncok(
bool bf ) { return ::syncok( w, bf ); }
1669 int flushok(
bool bf ) { return ::flushok( w, bf ); }
1682 int keypad(
bool bf ) { return ::keypad( w, bf ); }
1688 int meta(
bool bf ) { return ::meta( w, bf ); }
1724 return ::overlay( w, win.
w );
1732 return ::overwrite( w, win.
w );
1741 int sminrow,
int smincol,
1742 int dminrow,
int dmincol,
1743 int dmaxrow,
int dmaxcol,
bool overlay = TRUE )
1745 return ::copywin( w, win.
w, sminrow, smincol, dminrow, dmincol,
1746 dmaxrow, dmaxcol, (
int )(
overlay ? 1 : 0 ) );
1850 int echochar(
const chtype ch ) { return ::pechochar( w, ch ); }
1867 int sminrow,
int smincol,
1868 int smaxrow,
int smaxcol )
1870 return ::prefresh( w, pminrow, pmincol,
1871 sminrow, smincol, smaxrow, smaxcol );
1878 int sminrow,
int smincol,
1879 int smaxrow,
int smaxcol )
1881 return ::pnoutrefresh( w, pminrow, pmincol,
1882 sminrow, smincol, smaxrow, smaxcol );
1886 #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.