X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=c%2B%2B%2Fcursesw.h;h=40b28f575a145b5478cdf79393ece07eaadc8e2d;hp=62c71ea7d0dd7193f827c541a58fb3648015455d;hb=5da4544722decdeb2bfd0c7c4581af0ea62148f9;hpb=c7bc3019ea01faeaf2baf5b6a9efaf65c5ebe0aa diff --git a/c++/cursesw.h b/c++/cursesw.h index 62c71ea7..40b28f57 100644 --- a/c++/cursesw.h +++ b/c++/cursesw.h @@ -1,6 +1,7 @@ // * This makes emacs happy -*-Mode: C++;-*- +// vile:cppmode /**************************************************************************** - * Copyright (c) 1998-2005,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2014,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,14 +31,14 @@ #ifndef NCURSES_CURSESW_H_incl #define NCURSES_CURSESW_H_incl 1 -// $Id: cursesw.h,v 1.46 2007/11/24 19:09:09 tom Exp $ - -#include +// $Id: cursesw.h,v 1.53 2017/11/21 00:37:23 tom Exp $ extern "C" { # include } +#include + /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. Undefine it here, because NCursesWindow uses lines as a method. */ #undef lines @@ -54,16 +55,17 @@ inline int UNDEF(addch)(chtype ch) { return addch(ch); } #define addch UNDEF(addch) #endif -#ifdef echochar -inline int UNDEF(echochar)(chtype ch) { return echochar(ch); } -#undef echochar -#define echochar UNDEF(echochar) +#ifdef addchstr +inline int UNDEF(addchstr)(chtype *at) { return addchstr(at); } +#undef addchstr +#define addchstr UNDEF(addchstr) #endif -#ifdef insdelln -inline int UNDEF(insdelln)(int n) { return insdelln(n); } -#undef insdelln -#define insdelln UNDEF(insdelln) +#ifdef addnstr +inline int UNDEF(addnstr)(const char *str, int n) +{ return addnstr(str, n); } +#undef addnstr +#define addnstr UNDEF(addnstr) #endif #ifdef addstr @@ -72,28 +74,34 @@ inline int UNDEF(addstr)(const char * str) { return addstr(str); } #define addstr UNDEF(addstr) #endif -#ifdef attron -inline int UNDEF(attron)(chtype at) { return attron(at); } -#undef attron -#define attron UNDEF(attron) -#endif - #ifdef attroff inline int UNDEF(attroff)(chtype at) { return attroff(at); } #undef attroff #define attroff UNDEF(attroff) #endif +#ifdef attron +inline int UNDEF(attron)(chtype at) { return attron(at); } +#undef attron +#define attron UNDEF(attron) +#endif + #ifdef attrset inline chtype UNDEF(attrset)(chtype at) { return attrset(at); } #undef attrset #define attrset UNDEF(attrset) #endif -#ifdef color_set -inline chtype UNDEF(color_set)(short p, void* opts) { return color_set(p, opts); } -#undef color_set -#define color_set UNDEF(color_set) +#ifdef bkgd +inline int UNDEF(bkgd)(chtype ch) { return bkgd(ch); } +#undef bkgd +#define bkgd UNDEF(bkgd) +#endif + +#ifdef bkgdset +inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); } +#undef bkgdset +#define bkgdset UNDEF(bkgdset) #endif #ifdef border @@ -109,18 +117,11 @@ inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); } #define box UNDEF(box) #endif -#ifdef mvwhline -inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) { - return mvwhline(win, y, x, c, n); } -#undef mvwhline -#define mvwhline UNDEF(mvwhline) -#endif - -#ifdef mvwvline -inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) { - return mvwvline(win, y, x, c, n); } -#undef mvwvline -#define mvwvline UNDEF(mvwvline) +#ifdef chgat +inline int UNDEF(chgat)(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts) { + return chgat(n, attr, color, opts); } +#undef chgat +#define chgat UNDEF(chgat) #endif #ifdef clear @@ -149,6 +150,18 @@ inline int UNDEF(clrtoeol)() { return clrtoeol(); } #define clrtoeol UNDEF(clrtoeol) #endif +#ifdef color_set +inline chtype UNDEF(color_set)(NCURSES_PAIRS_T p, void* opts) { return color_set(p, opts); } +#undef color_set +#define color_set UNDEF(color_set) +#endif + +#ifdef crmode +inline int UNDEF(crmode)(void) { return crmode(); } +#undef crmode +#define crmode UNDEF(crmode) +#endif + #ifdef delch inline int UNDEF(delch)() { return delch(); } #undef delch @@ -161,12 +174,24 @@ inline int UNDEF(deleteln)() { return deleteln(); } #define deleteln UNDEF(deleteln) #endif +#ifdef echochar +inline int UNDEF(echochar)(chtype ch) { return echochar(ch); } +#undef echochar +#define echochar UNDEF(echochar) +#endif + #ifdef erase inline int UNDEF(erase)() { return erase(); } #undef erase #define erase UNDEF(erase) #endif +#ifdef fixterm +inline int UNDEF(fixterm)(void) { return fixterm(); } +#undef fixterm +#define fixterm UNDEF(fixterm) +#endif + #ifdef flushok inline int UNDEF(flushok)(WINDOW* _win, bool _bf) { return flushok(_win, _bf); } @@ -176,91 +201,34 @@ inline int UNDEF(flushok)(WINDOW* _win, bool _bf) { #define _no_flushok #endif -#ifdef getch -inline int UNDEF(getch)() { return getch(); } -#undef getch -#define getch UNDEF(getch) -#endif - -#ifdef getstr -inline int UNDEF(getstr)(char *_str) { return getstr(_str); } -#undef getstr -#define getstr UNDEF(getstr) -#endif - -#ifdef instr -inline int UNDEF(instr)(char *_str) { return instr(_str); } -#undef instr -#define instr UNDEF(instr) -#endif - -#ifdef innstr -inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); } -#undef innstr -#define innstr UNDEF(innstr) -#endif - -#ifdef mvwinnstr -inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { - return mvwinnstr(win, y, x, _str, n); } -#undef mvwinnstr -#define mvwinnstr UNDEF(mvwinnstr) -#endif - -#ifdef mvinnstr -inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) { - return mvinnstr(y, x, _str, n); } -#undef mvinnstr -#define mvinnstr UNDEF(mvinnstr) -#endif - -#ifdef winsstr -inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { - return winsstr(w, _str); } -#undef winsstr -#define winsstr UNDEF(winsstr) -#endif - -#ifdef mvwinsstr -inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) { - return mvwinsstr(w, y, x, _str); } -#undef mvwinsstr -#define mvwinsstr UNDEF(mvwinsstr) -#endif - -#ifdef insstr -inline int UNDEF(insstr)(const char *_str) { - return insstr(_str); } -#undef insstr -#define insstr UNDEF(insstr) +#ifdef getattrs +inline int UNDEF(getattrs)(WINDOW *win) { return getattrs(win); } +#undef getattrs +#define getattrs UNDEF(getattrs) #endif -#ifdef mvinsstr -inline int UNDEF(mvinsstr)(int y, int x, const char *_str) { - return mvinsstr(y, x, _str); } -#undef mvinsstr -#define mvinsstr UNDEF(mvinsstr) +#ifdef getbegyx +inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); } +#undef getbegyx +#define getbegyx UNDEF(getbegyx) #endif -#ifdef insnstr -inline int UNDEF(insnstr)(const char *_str, int n) { - return insnstr(_str, n); } -#undef insnstr -#define insnstr UNDEF(insnstr) +#ifdef getbkgd +inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); } +#undef getbkgd +#define getbkgd UNDEF(getbkgd) #endif -#ifdef mvwinsnstr -inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int n) { - return mvwinsnstr(w, y, x, _str, n); } -#undef mvwinsnstr -#define mvwinsnstr UNDEF(mvwinsnstr) +#ifdef getch +inline int UNDEF(getch)() { return getch(); } +#undef getch +#define getch UNDEF(getch) #endif -#ifdef mvinsnstr -inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) { - return mvinsnstr(y, x, _str, n); } -#undef mvinsnstr -#define mvinsnstr UNDEF(mvinsnstr) +#ifdef getmaxyx +inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); } +#undef getmaxyx +#define getmaxyx UNDEF(getmaxyx) #endif #ifdef getnstr @@ -269,6 +237,18 @@ inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str, n); } #define getnstr UNDEF(getnstr) #endif +#ifdef getparyx +inline void UNDEF(getparyx)(WINDOW* win, int& y, int& x) { getparyx(win, y, x); } +#undef getparyx +#define getparyx UNDEF(getparyx) +#endif + +#ifdef getstr +inline int UNDEF(getstr)(char *_str) { return getstr(_str); } +#undef getstr +#define getstr UNDEF(getstr) +#endif + #ifdef getyx inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { getyx(win, y, x); } @@ -276,18 +256,6 @@ inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { #define getyx UNDEF(getyx) #endif -#ifdef getbegyx -inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); } -#undef getbegyx -#define getbegyx UNDEF(getbegyx) -#endif - -#ifdef getmaxyx -inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); } -#undef getmaxyx -#define getmaxyx UNDEF(getmaxyx) -#endif - #ifdef hline inline int UNDEF(hline)(chtype ch, int n) { return hline(ch, n); } #undef hline @@ -300,18 +268,68 @@ inline chtype UNDEF(inch)() { return inch(); } #define inch UNDEF(inch) #endif +#ifdef inchstr +inline int UNDEF(inchstr)(chtype *str) { return inchstr(str); } +#undef inchstr +#define inchstr UNDEF(inchstr) +#endif + +#ifdef innstr +inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); } +#undef innstr +#define innstr UNDEF(innstr) +#endif + #ifdef insch inline int UNDEF(insch)(chtype c) { return insch(c); } #undef insch #define insch UNDEF(insch) #endif +#ifdef insdelln +inline int UNDEF(insdelln)(int n) { return insdelln(n); } +#undef insdelln +#define insdelln UNDEF(insdelln) +#endif + #ifdef insertln inline int UNDEF(insertln)() { return insertln(); } #undef insertln #define insertln UNDEF(insertln) #endif +#ifdef insnstr +inline int UNDEF(insnstr)(const char *_str, int n) { + return insnstr(_str, n); } +#undef insnstr +#define insnstr UNDEF(insnstr) +#endif + +#ifdef insstr +inline int UNDEF(insstr)(const char *_str) { + return insstr(_str); } +#undef insstr +#define insstr UNDEF(insstr) +#endif + +#ifdef instr +inline int UNDEF(instr)(char *_str) { return instr(_str); } +#undef instr +#define instr UNDEF(instr) +#endif + +#ifdef intrflush +inline void UNDEF(intrflush)(WINDOW *win, bool bf) { intrflush(); } +#undef intrflush +#define intrflush UNDEF(intrflush) +#endif + +#ifdef is_linetouched +inline int UNDEF(is_linetouched)(WINDOW *w, int l) { return is_linetouched(w,l); } +#undef is_linetouched +#define is_linetouched UNDEF(is_linetouched) +#endif + #ifdef leaveok inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); } #undef leaveok @@ -326,358 +344,406 @@ inline int UNDEF(move)(int x, int y) { return move(x, y); } #define move UNDEF(move) #endif -#ifdef refresh -inline int UNDEF(refresh)() { return refresh(); } -#undef refresh -#define refresh UNDEF(refresh) -#endif - -#ifdef redrawwin -inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); } -#undef redrawwin -#define redrawwin UNDEF(redrawwin) +#ifdef mvaddch +inline int UNDEF(mvaddch)(int y, int x, chtype ch) +{ return mvaddch(y, x, ch); } +#undef mvaddch +#define mvaddch UNDEF(mvaddch) #endif -#ifdef scrl -inline int UNDEF(scrl)(int l) { return scrl(l); } -#undef scrl -#define scrl UNDEF(scrl) +#ifdef mvaddnstr +inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n) +{ return mvaddnstr(y, x, str, n); } +#undef mvaddnstr +#define mvaddnstr UNDEF(mvaddnstr) #endif -#ifdef scroll -inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); } -#undef scroll -#define scroll UNDEF(scroll) +#ifdef mvaddstr +inline int UNDEF(mvaddstr)(int y, int x, const char * str) +{ return mvaddstr(y, x, str); } +#undef mvaddstr +#define mvaddstr UNDEF(mvaddstr) #endif -#ifdef scrollok -inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); } -#undef scrollok -#define scrollok UNDEF(scrollok) -#else -#if defined(__NCURSES_H) -extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool); -#else -extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char); +#ifdef mvchgat +inline int UNDEF(mvchgat)(int y, int x, int n, + attr_t attr, NCURSES_PAIRS_T color, const void *opts) { + return mvchgat(y, x, n, attr, color, opts); } +#undef mvchgat +#define mvchgat UNDEF(mvchgat) #endif + +#ifdef mvdelch +inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);} +#undef mvdelch +#define mvdelch UNDEF(mvdelch) #endif -#ifdef setscrreg -inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); } -#undef setscrreg -#define setscrreg UNDEF(setscrreg) +#ifdef mvgetch +inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);} +#undef mvgetch +#define mvgetch UNDEF(mvgetch) #endif -#ifdef standend -inline int UNDEF(standend)() { return standend(); } -#undef standend -#define standend UNDEF(standend) +#ifdef mvgetnstr +inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) { + return mvgetnstr(y, x, str, n);} +#undef mvgetnstr +#define mvgetnstr UNDEF(mvgetnstr) #endif -#ifdef standout -inline int UNDEF(standout)() { return standout(); } -#undef standout -#define standout UNDEF(standout) +#ifdef mvgetstr +inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);} +#undef mvgetstr +#define mvgetstr UNDEF(mvgetstr) #endif -#ifdef subpad -inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) -{ return derwin(p, l, c, y, x); } -#undef subpad -#define subpad UNDEF(subpad) +#ifdef mvinch +inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} +#undef mvinch +#define mvinch UNDEF(mvinch) #endif -#ifdef timeout -inline void UNDEF(timeout)(int delay) { timeout(delay); } -#undef timeout -#define timeout UNDEF(timeout) +#ifdef mvinnstr +inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) { + return mvinnstr(y, x, _str, n); } +#undef mvinnstr +#define mvinnstr UNDEF(mvinnstr) #endif -#ifdef touchline -inline int UNDEF(touchline)(WINDOW *win, int s, int c) -{ return touchline(win, s, c); } -#undef touchline -#define touchline UNDEF(touchline) +#ifdef mvinsch +inline int UNDEF(mvinsch)(int y, int x, chtype c) +{ return mvinsch(y, x, c); } +#undef mvinsch +#define mvinsch UNDEF(mvinsch) #endif -#ifdef touchwin -inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); } -#undef touchwin -#define touchwin UNDEF(touchwin) +#ifdef mvinsnstr +inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) { + return mvinsnstr(y, x, _str, n); } +#undef mvinsnstr +#define mvinsnstr UNDEF(mvinsnstr) #endif -#ifdef untouchwin -inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); } -#undef untouchwin -#define untouchwin UNDEF(untouchwin) +#ifdef mvinsstr +inline int UNDEF(mvinsstr)(int y, int x, const char *_str) { + return mvinsstr(y, x, _str); } +#undef mvinsstr +#define mvinsstr UNDEF(mvinsstr) #endif -#ifdef vline -inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); } -#undef vline -#define vline UNDEF(vline) +#ifdef mvwaddch +inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, const chtype ch) +{ return mvwaddch(win, y, x, ch); } +#undef mvwaddch +#define mvwaddch UNDEF(mvwaddch) #endif -#ifdef waddstr -inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); } -#undef waddstr -#define waddstr UNDEF(waddstr) +#ifdef mvwaddchnstr +inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, const chtype *str, int n) +{ return mvwaddchnstr(win, y, x, str, n); } +#undef mvwaddchnstr +#define mvwaddchnstr UNDEF(mvwaddchnstr) #endif -#ifdef waddchstr -inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); } -#undef waddchstr -#define waddchstr UNDEF(waddchstr) +#ifdef mvwaddchstr +inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, const chtype *str) +{ return mvwaddchstr(win, y, x, str); } +#undef mvwaddchstr +#define mvwaddchstr UNDEF(mvwaddchstr) #endif -#ifdef wstandend -inline int UNDEF(wstandend)(WINDOW *win) { return wstandend(win); } -#undef wstandend -#define wstandend UNDEF(wstandend) +#ifdef mvwaddnstr +inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n) +{ return mvwaddnstr(win, y, x, str, n); } +#undef mvwaddnstr +#define mvwaddnstr UNDEF(mvwaddnstr) #endif -#ifdef wstandout -inline int UNDEF(wstandout)(WINDOW *win) { return wstandout(win); } -#undef wstandout -#define wstandout UNDEF(wstandout) +#ifdef mvwaddstr +inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str) +{ return mvwaddstr(win, y, x, str); } +#undef mvwaddstr +#define mvwaddstr UNDEF(mvwaddstr) #endif +#ifdef mvwchgat +inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, + attr_t attr, NCURSES_PAIRS_T color, const void *opts) { + return mvwchgat(win, y, x, n, attr, color, opts); } +#undef mvwchgat +#define mvwchgat UNDEF(mvwchgat) +#endif -#ifdef wattroff -inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); } -#undef wattroff -#define wattroff UNDEF(wattroff) +#ifdef mvwdelch +inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x) +{ return mvwdelch(win, y, x); } +#undef mvwdelch +#define mvwdelch UNDEF(mvwdelch) #endif -#ifdef chgat -inline int UNDEF(chgat)(int n, attr_t attr, short color, const void *opts) { - return chgat(n, attr, color, opts); } -#undef chgat -#define chgat UNDEF(chgat) +#ifdef mvwgetch +inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);} +#undef mvwgetch +#define mvwgetch UNDEF(mvwgetch) #endif -#ifdef mvchgat -inline int UNDEF(mvchgat)(int y, int x, int n, - attr_t attr, short color, const void *opts) { - return mvchgat(y, x, n, attr, color, opts); } -#undef mvchgat -#define mvchgat UNDEF(mvchgat) +#ifdef mvwgetnstr +inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) +{return mvwgetnstr(win, y, x, str, n);} +#undef mvwgetnstr +#define mvwgetnstr UNDEF(mvwgetnstr) #endif -#ifdef mvwchgat -inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, - attr_t attr, short color, const void *opts) { - return mvwchgat(win, y, x, n, attr, color, opts); } -#undef mvwchgat -#define mvwchgat UNDEF(mvwchgat) +#ifdef mvwgetstr +inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str) +{return mvwgetstr(win, y, x, str);} +#undef mvwgetstr +#define mvwgetstr UNDEF(mvwgetstr) #endif -#ifdef wattrset -inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); } -#undef wattrset -#define wattrset UNDEF(wattrset) +#ifdef mvwhline +inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) { + return mvwhline(win, y, x, c, n); } +#undef mvwhline +#define mvwhline UNDEF(mvwhline) #endif -#ifdef winch -inline chtype UNDEF(winch)(const WINDOW* win) { return winch(win); } -#undef winch -#define winch UNDEF(winch) +#ifdef mvwinch +inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { + return mvwinch(win, y, x);} +#undef mvwinch +#define mvwinch UNDEF(mvwinch) #endif -#ifdef mvwaddch -inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, const chtype ch) -{ return mvwaddch(win, y, x, ch); } -#undef mvwaddch -#define mvwaddch UNDEF(mvwaddch) +#ifdef mvwinchnstr +inline int UNDEF(mvwinchnstr)(WINDOW *win, int y, int x, chtype *str, int n) { return mvwinchnstr(win, y, x, str, n); } +#undef mvwinchnstr +#define mvwinchnstr UNDEF(mvwinchnstr) #endif -#ifdef mvwaddchnstr -inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, chtype *str, int n) -{ return mvwaddchnstr(win, y, x, str, n); } -#undef mvwaddchnstr -#define mvwaddchnstr UNDEF(mvwaddchnstr) +#ifdef mvwinchstr +inline int UNDEF(mvwinchstr)(WINDOW *win, int y, int x, chtype *str) { return mvwinchstr(win, y, x, str); } +#undef mvwinchstr +#define mvwinchstr UNDEF(mvwinchstr) #endif -#ifdef mvwaddchstr -inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, chtype *str) -{ return mvwaddchstr(win, y, x, str); } -#undef mvwaddchstr -#define mvwaddchstr UNDEF(mvwaddchstr) +#ifdef mvwinnstr +inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { + return mvwinnstr(win, y, x, _str, n); } +#undef mvwinnstr +#define mvwinnstr UNDEF(mvwinnstr) +#endif + +#ifdef mvwinsch +inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, chtype c) +{ return mvwinsch(win, y, x, c); } +#undef mvwinsch +#define mvwinsch UNDEF(mvwinsch) +#endif + +#ifdef mvwinsnstr +inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int n) { + return mvwinsnstr(w, y, x, _str, n); } +#undef mvwinsnstr +#define mvwinsnstr UNDEF(mvwinsnstr) +#endif + +#ifdef mvwinsstr +inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) { + return mvwinsstr(w, y, x, _str); } +#undef mvwinsstr +#define mvwinsstr UNDEF(mvwinsstr) +#endif + +#ifdef mvwvline +inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) { + return mvwvline(win, y, x, c, n); } +#undef mvwvline +#define mvwvline UNDEF(mvwvline) +#endif + +#ifdef napms +inline void UNDEF(napms)(unsigned long x) { napms(x); } +#undef napms +#define napms UNDEF(napms) +#endif + +#ifdef nocrmode +inline int UNDEF(nocrmode)(void) { return nocrmode(); } +#undef nocrmode +#define nocrmode UNDEF(nocrmode) #endif -#ifdef addnstr -inline int UNDEF(addnstr)(const char *str, int n) -{ return addnstr(str, n); } -#undef addnstr -#define addnstr UNDEF(addnstr) +#ifdef nodelay +inline void UNDEF(nodelay)() { nodelay(); } +#undef nodelay +#define nodelay UNDEF(nodelay) #endif -#ifdef mvwaddnstr -inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n) -{ return mvwaddnstr(win, y, x, str, n); } -#undef mvwaddnstr -#define mvwaddnstr UNDEF(mvwaddnstr) +#ifdef redrawwin +inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); } +#undef redrawwin +#define redrawwin UNDEF(redrawwin) #endif -#ifdef mvwaddstr -inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str) -{ return mvwaddstr(win, y, x, str); } -#undef mvwaddstr -#define mvwaddstr UNDEF(mvwaddstr) +#ifdef refresh +inline int UNDEF(refresh)() { return refresh(); } +#undef refresh +#define refresh UNDEF(refresh) #endif -#ifdef mvwdelch -inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x) -{ return mvwdelch(win, y, x); } -#undef mvwdelch -#define mvwdelch UNDEF(mvwdelch) +#ifdef resetterm +inline int UNDEF(resetterm)(void) { return resetterm(); } +#undef resetterm +#define resetterm UNDEF(resetterm) #endif -#ifdef mvwgetch -inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);} -#undef mvwgetch -#define mvwgetch UNDEF(mvwgetch) +#ifdef saveterm +inline int UNDEF(saveterm)(void) { return saveterm(); } +#undef saveterm +#define saveterm UNDEF(saveterm) #endif -#ifdef mvwgetstr -inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str) -{return mvwgetstr(win, y, x, str);} -#undef mvwgetstr -#define mvwgetstr UNDEF(mvwgetstr) +#ifdef scrl +inline int UNDEF(scrl)(int l) { return scrl(l); } +#undef scrl +#define scrl UNDEF(scrl) #endif -#ifdef mvwgetnstr -inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) -{return mvwgetnstr(win, y, x, str, n);} -#undef mvwgetnstr -#define mvwgetnstr UNDEF(mvwgetnstr) +#ifdef scroll +inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); } +#undef scroll +#define scroll UNDEF(scroll) #endif -#ifdef mvwinch -inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { - return mvwinch(win, y, x);} -#undef mvwinch -#define mvwinch UNDEF(mvwinch) +#ifdef scrollok +inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); } +#undef scrollok +#define scrollok UNDEF(scrollok) +#else +#if defined(__NCURSES_H) +extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool); +#else +extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char); +#endif #endif -#ifdef mvwinsch -inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, chtype c) -{ return mvwinsch(win, y, x, c); } -#undef mvwinsch -#define mvwinsch UNDEF(mvwinsch) +#ifdef setscrreg +inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); } +#undef setscrreg +#define setscrreg UNDEF(setscrreg) #endif -#ifdef mvaddch -inline int UNDEF(mvaddch)(int y, int x, chtype ch) -{ return mvaddch(y, x, ch); } -#undef mvaddch -#define mvaddch UNDEF(mvaddch) +#ifdef standend +inline int UNDEF(standend)() { return standend(); } +#undef standend +#define standend UNDEF(standend) #endif -#ifdef mvaddnstr -inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n) -{ return mvaddnstr(y, x, str, n); } -#undef mvaddnstr -#define mvaddnstr UNDEF(mvaddnstr) +#ifdef standout +inline int UNDEF(standout)() { return standout(); } +#undef standout +#define standout UNDEF(standout) #endif -#ifdef mvaddstr -inline int UNDEF(mvaddstr)(int y, int x, const char * str) -{ return mvaddstr(y, x, str); } -#undef mvaddstr -#define mvaddstr UNDEF(mvaddstr) +#ifdef subpad +inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) +{ return derwin(p, l, c, y, x); } +#undef subpad +#define subpad UNDEF(subpad) #endif -#ifdef mvdelch -inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);} -#undef mvdelch -#define mvdelch UNDEF(mvdelch) +#ifdef timeout +inline void UNDEF(timeout)(int delay) { timeout(delay); } +#undef timeout +#define timeout UNDEF(timeout) #endif -#ifdef mvgetch -inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);} -#undef mvgetch -#define mvgetch UNDEF(mvgetch) +#ifdef touchline +inline int UNDEF(touchline)(WINDOW *win, int s, int c) +{ return touchline(win, s, c); } +#undef touchline +#define touchline UNDEF(touchline) #endif -#ifdef mvgetstr -inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);} -#undef mvgetstr -#define mvgetstr UNDEF(mvgetstr) +#ifdef touchwin +inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); } +#undef touchwin +#define touchwin UNDEF(touchwin) #endif -#ifdef mvgetnstr -inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) { - return mvgetnstr(y, x, str, n);} -#undef mvgetnstr -#define mvgetnstr UNDEF(mvgetnstr) +#ifdef untouchwin +inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); } +#undef untouchwin +#define untouchwin UNDEF(untouchwin) #endif -#ifdef mvinch -inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} -#undef mvinch -#define mvinch UNDEF(mvinch) +#ifdef vline +inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); } +#undef vline +#define vline UNDEF(vline) #endif -#ifdef mvinsch -inline int UNDEF(mvinsch)(int y, int x, chtype c) -{ return mvinsch(y, x, c); } -#undef mvinsch -#define mvinsch UNDEF(mvinsch) +#ifdef waddchstr +inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); } +#undef waddchstr +#define waddchstr UNDEF(waddchstr) #endif -#ifdef napms -inline void UNDEF(napms)(unsigned long x) { napms(x); } -#undef napms -#define napms UNDEF(napms) +#ifdef waddstr +inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); } +#undef waddstr +#define waddstr UNDEF(waddstr) #endif -#ifdef fixterm -inline int UNDEF(fixterm)(void) { return fixterm(); } -#undef fixterm -#define fixterm UNDEF(fixterm) +#ifdef wattroff +inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); } +#undef wattroff +#define wattroff UNDEF(wattroff) #endif -#ifdef resetterm -inline int UNDEF(resetterm)(void) { return resetterm(); } -#undef resetterm -#define resetterm UNDEF(resetterm) +#ifdef wattrset +inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); } +#undef wattrset +#define wattrset UNDEF(wattrset) #endif -#ifdef saveterm -inline int UNDEF(saveterm)(void) { return saveterm(); } -#undef saveterm -#define saveterm UNDEF(saveterm) +#ifdef winch +inline chtype UNDEF(winch)(const WINDOW* win) { return winch(win); } +#undef winch +#define winch UNDEF(winch) #endif -#ifdef crmode -inline int UNDEF(crmode)(void) { return crmode(); } -#undef crmode -#define crmode UNDEF(crmode) +#ifdef winchnstr +inline int UNDEF(winchnstr)(WINDOW *win, chtype *str, int n) { return winchnstr(win, str, n); } +#undef winchnstr +#define winchnstr UNDEF(winchnstr) #endif -#ifdef nocrmode -inline int UNDEF(nocrmode)(void) { return nocrmode(); } -#undef nocrmode -#define nocrmode UNDEF(nocrmode) +#ifdef winchstr +inline int UNDEF(winchstr)(WINDOW *win, chtype *str) { return winchstr(win, str); } +#undef winchstr +#define winchstr UNDEF(winchstr) #endif -#ifdef getbkgd -inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); } -#undef getbkgd -#define getbkgd UNDEF(getbkgd) +#ifdef winsstr +inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { + return winsstr(w, _str); } +#undef winsstr +#define winsstr UNDEF(winsstr) #endif -#ifdef bkgd -inline int UNDEF(bkgd)(chtype ch) { return bkgd(ch); } -#undef bkgd -#define bkgd UNDEF(bkgd) +#ifdef wstandend +inline int UNDEF(wstandend)(WINDOW *win) { return wstandend(win); } +#undef wstandend +#define wstandend UNDEF(wstandend) #endif -#ifdef bkgdset -inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); } -#undef bkgdset -#define bkgdset UNDEF(bkgdset) +#ifdef wstandout +inline int UNDEF(wstandout)(WINDOW *win) { return wstandout(win); } +#undef wstandout +#define wstandout UNDEF(wstandout) #endif /* @@ -703,10 +769,10 @@ private: void set_keyboard(); - short getcolor(int getback) const; - short getPair() const; + NCURSES_COLOR_T getcolor(int getback) const; + NCURSES_PAIRS_T getPair() const; - static int setpalette(short fore, short back, short pair); + static int setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back, NCURSES_PAIRS_T pair); static int colorInitialized; // This private constructor is only used during the initialization @@ -824,25 +890,31 @@ public: int begy() const { return getbegy(w); } // Line of top left corner relative to stdscr + int curx() const { return getcurx(w); } + // Column of top left corner relative to stdscr + + int cury() const { return getcury(w); } + // Line of top left corner relative to stdscr + int maxx() const { return getmaxx(w) == ERR ? ERR : getmaxx(w)-1; } // Largest x coord in window int maxy() const { return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; } // Largest y coord in window - short getcolor() const; + NCURSES_PAIRS_T getcolor() const; // Actual color pair - short foreground() const { return getcolor(0); } + NCURSES_COLOR_T foreground() const { return getcolor(0); } // Actual foreground color - short background() const { return getcolor(1); } + NCURSES_COLOR_T background() const { return getcolor(1); } // Actual background color - int setpalette(short fore, short back); + int setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back); // Set color palette entry - int setcolor(short pair); + int setcolor(NCURSES_PAIRS_T pair); // Set actually used palette entry // ------------------------------------------------------------------------- @@ -862,6 +934,15 @@ public: void getyx(int& y, int& x) const { ::getyx(w, y, x); } // Get current position of the cursor + void getbegyx(int& y, int& x) const { ::getbegyx(w, y, x); } + // Get beginning of the window + + void getmaxyx(int& y, int& x) const { ::getmaxyx(w, y, x); } + // Get size of the window + + void getparyx(int& y, int& x) const { ::getparyx(w, y, x); } + // Get parent's beginning of the window + int mvcur(int oldrow, int oldcol, int newrow, int newcol) const { return ::mvcur(oldrow, oldcol, newrow, newcol); } // Perform lowlevel cursor motion that takes effect immediately. @@ -904,6 +985,9 @@ public: ; #endif + int scanw(const char*, va_list); + // Perform a scanw function from the window. + int scanw(int y, int x, const char* fmt, ...) // Move the cursor to the requested position and then perform a scanw // from the window. @@ -913,6 +997,10 @@ public: ; #endif + int scanw(int y, int x, const char* fmt, va_list); + // Move the cursor to the requested position and then perform a scanw + // from the window. + // ------------------------------------------------------------------------- // output // ------------------------------------------------------------------------- @@ -934,7 +1022,17 @@ public: int addstr(int y, int x, const char * str, int n=-1) { return ::mvwaddnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the addstr + // Move the cursor to the requested position and then perform the addchstr + // as described above. + + int addchstr(const chtype* str, int n=-1) { + return ::waddchnstr(w, str, n); } + // Write the string str to the window, stop writing if the terminating + // NUL or the limit n is reached. If n is negative, it is ignored. + + int addchstr(int y, int x, const chtype * str, int n=-1) { + return ::mvwaddchnstr(w, y, x, str, n); } + // Move the cursor to the requested position and then perform the addchstr // as described above. int printw(const char* fmt, ...) @@ -953,6 +1051,12 @@ public: ; #endif + int printw(const char* fmt, va_list args); + // Do a formatted print to the window. + + int printw(int y, int x, const char * fmt, va_list args); + // Move the cursor and then do a formatted print to the window. + chtype inch() const { return ::winch(w); } // Retrieve attributed character under the current cursor position. @@ -960,6 +1064,16 @@ public: // Move cursor to requested position and then retrieve attributed character // at this position. + int inchstr(chtype* str, int n=-1) { + return ::winchnstr(w, str, n); } + // Read the string str from the window, stop reading if the terminating + // NUL or the limit n is reached. If n is negative, it is ignored. + + int inchstr(int y, int x, chtype * str, int n=-1) { + return ::mvwinchnstr(w, y, x, str, n); } + // Move the cursor to the requested position and then perform the inchstr + // as described above. + int insch(chtype ch) { return ::winsch(w, ch); } // Insert attributed character into the window before current cursor // position. @@ -996,18 +1110,21 @@ public: int attrset(chtype at) { return ::wattrset(w, static_cast(at)); } // Set the window attributes; - int color_set(short color_pair_number, void* opts=NULL) { + chtype attrget() { return ::getattrs(w); } + // Get the window attributes; + + int color_set(NCURSES_PAIRS_T color_pair_number, void* opts=NULL) { return ::wcolor_set(w, color_pair_number, opts); } // Set the window color attribute; - int chgat(int n, attr_t attr, short color, const void *opts=NULL) { + int chgat(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) { return ::wchgat(w, n, attr, color, opts); } // Change the attributes of the next n characters in the current line. If // n is negative or greater than the number of remaining characters in the // line, the attributes will be changed up to the end of the line. int chgat(int y, int x, - int n, attr_t attr, short color, const void *opts=NULL) { + int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) { return ::mvwchgat(w, y, x, n, attr, color, opts); } // Move the cursor to the requested position and then perform chgat() as // described above. @@ -1111,11 +1228,13 @@ public: // If bf is TRUE, use insert/delete line hardware support if possible. // Otherwise do it in software. - void idcok(bool bf) { ::idcok(w, bf); } // If bf is TRUE, use insert/delete character hardware support if possible. // Otherwise do it in software. + int touchline(int s, int c) { return ::touchline(w, s, c); } + // Mark the given lines as modified. + int touchwin() { return ::wtouchln(w, 0, height(), 1); } // Mark the whole window as modified. @@ -1128,7 +1247,7 @@ public: // on the value of the changed flag. bool is_linetouched(int line) const { - return (::is_linetouched(w, line) ? TRUE:FALSE); } + return (::is_linetouched(w, line) == TRUE ? TRUE:FALSE); } // Return TRUE if line is marked as changed, FALSE otherwise bool is_wintouched() const { @@ -1168,9 +1287,13 @@ public: // If called with bf=TRUE, any change in the window will cause an // automatic immediate refresh() + int intrflush(bool bf) { return ::intrflush(w, bf); } + int keypad(bool bf) { return ::keypad(w, bf); } // If called with bf=TRUE, the application will interpret function keys. + int nodelay(bool bf) { return ::nodelay(w, bf); } + int meta(bool bf) { return ::meta(w, bf); } // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise // 7-Bit characters are generated. @@ -1217,7 +1340,7 @@ public: // ------------------------------------------------------------------------- // Extended functions // ------------------------------------------------------------------------- -#ifdef NCURSES_EXT_FUNCS +#if defined(NCURSES_EXT_FUNCS) && (NCURSES_EXT_FUNCS != 0) int wresize(int newLines, int newColumns) { return ::wresize(w, newLines, newColumns); } #endif @@ -1321,16 +1444,19 @@ protected: // The driver translates the keystroke c into an Pad_Request virtual void OnUnknownOperation(int pad_req) { + (void) pad_req; ::beep(); } // This is called if the driver returns an unknown op-code virtual void OnNavigationError(int pad_req) { + (void) pad_req; ::beep(); } // This is called if a navigation request couldn't be satisfied virtual void OnOperation(int pad_req) { + (void) pad_req; }; // OnOperation is called if a Pad_Operation was executed and just before // the refresh() operation is done. @@ -1425,11 +1551,15 @@ public: } void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) { + (void) view; + (void) v_grid; + (void) h_grid; err_handler("Operation not allowed"); } // Disable this call; the viewport is already defined void setSubWindow(NCursesWindow& sub) { + (void) sub; err_handler("Operation not allowed"); } // Disable this call; the viewport subwindow is already defined