jpayne@69: // * This makes emacs happy -*-Mode: C++;-*- jpayne@69: // vile:cppmode jpayne@69: /**************************************************************************** jpayne@69: * Copyright 2019-2021,2022 Thomas E. Dickey * jpayne@69: * Copyright 1998-2014,2017 Free Software Foundation, Inc. * jpayne@69: * * jpayne@69: * Permission is hereby granted, free of charge, to any person obtaining a * jpayne@69: * copy of this software and associated documentation files (the * jpayne@69: * "Software"), to deal in the Software without restriction, including * jpayne@69: * without limitation the rights to use, copy, modify, merge, publish, * jpayne@69: * distribute, distribute with modifications, sublicense, and/or sell * jpayne@69: * copies of the Software, and to permit persons to whom the Software is * jpayne@69: * furnished to do so, subject to the following conditions: * jpayne@69: * * jpayne@69: * The above copyright notice and this permission notice shall be included * jpayne@69: * in all copies or substantial portions of the Software. * jpayne@69: * * jpayne@69: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * jpayne@69: * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * jpayne@69: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * jpayne@69: * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * jpayne@69: * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * jpayne@69: * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * jpayne@69: * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * jpayne@69: * * jpayne@69: * Except as contained in this notice, the name(s) of the above copyright * jpayne@69: * holders shall not be used in advertising or otherwise to promote the * jpayne@69: * sale, use or other dealings in this Software without prior written * jpayne@69: * authorization. * jpayne@69: ****************************************************************************/ jpayne@69: jpayne@69: #ifndef NCURSES_CURSESW_H_incl jpayne@69: #define NCURSES_CURSESW_H_incl 1 jpayne@69: jpayne@69: // $Id: cursesw.h,v 1.59 2022/08/20 20:52:15 tom Exp $ jpayne@69: jpayne@69: extern "C" { jpayne@69: # include jpayne@69: } jpayne@69: jpayne@69: #if defined(BUILDING_NCURSES_CXX) jpayne@69: # define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_EXPORT jpayne@69: #else jpayne@69: # define NCURSES_CXX_IMPEXP NCURSES_EXPORT_GENERAL_IMPORT jpayne@69: #endif jpayne@69: jpayne@69: #define NCURSES_CXX_WRAPPED_VAR(type,name) extern NCURSES_CXX_IMPEXP type NCURSES_PUBLIC_VAR(name)(void) jpayne@69: jpayne@69: #define NCURSES_CXX_EXPORT(type) NCURSES_CXX_IMPEXP type NCURSES_API jpayne@69: #define NCURSES_CXX_EXPORT_VAR(type) NCURSES_CXX_IMPEXP type jpayne@69: jpayne@69: #include jpayne@69: jpayne@69: /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. jpayne@69: Undefine it here, because NCursesWindow uses lines as a method. */ jpayne@69: #undef lines jpayne@69: jpayne@69: /* "Convert" macros to inlines. We'll define it as another symbol to avoid jpayne@69: * conflict with library symbols. jpayne@69: */ jpayne@69: #undef UNDEF jpayne@69: #define UNDEF(name) CUR_ ##name jpayne@69: jpayne@69: #ifdef addch jpayne@69: inline int UNDEF(addch)(chtype ch) { return addch(ch); } jpayne@69: #undef addch jpayne@69: #define addch UNDEF(addch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef addchstr jpayne@69: inline int UNDEF(addchstr)(chtype *at) { return addchstr(at); } jpayne@69: #undef addchstr jpayne@69: #define addchstr UNDEF(addchstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef addnstr jpayne@69: inline int UNDEF(addnstr)(const char *str, int n) jpayne@69: { return addnstr(str, n); } jpayne@69: #undef addnstr jpayne@69: #define addnstr UNDEF(addnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef addstr jpayne@69: inline int UNDEF(addstr)(const char * str) { return addstr(str); } jpayne@69: #undef addstr jpayne@69: #define addstr UNDEF(addstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef attroff jpayne@69: inline int UNDEF(attroff)(chtype at) { return attroff(at); } jpayne@69: #undef attroff jpayne@69: #define attroff UNDEF(attroff) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef attron jpayne@69: inline int UNDEF(attron)(chtype at) { return attron(at); } jpayne@69: #undef attron jpayne@69: #define attron UNDEF(attron) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef attrset jpayne@69: inline chtype UNDEF(attrset)(chtype at) { return attrset(at); } jpayne@69: #undef attrset jpayne@69: #define attrset UNDEF(attrset) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef bkgd jpayne@69: inline int UNDEF(bkgd)(chtype ch) { return bkgd(ch); } jpayne@69: #undef bkgd jpayne@69: #define bkgd UNDEF(bkgd) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef bkgdset jpayne@69: inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); } jpayne@69: #undef bkgdset jpayne@69: #define bkgdset UNDEF(bkgdset) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef border jpayne@69: inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br) jpayne@69: { return border(ls, rs, ts, bs, tl, tr, bl, br); } jpayne@69: #undef border jpayne@69: #define border UNDEF(border) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef box jpayne@69: inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); } jpayne@69: #undef box jpayne@69: #define box UNDEF(box) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef chgat jpayne@69: inline int UNDEF(chgat)(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts) { jpayne@69: return chgat(n, attr, color, opts); } jpayne@69: #undef chgat jpayne@69: #define chgat UNDEF(chgat) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef clear jpayne@69: inline int UNDEF(clear)() { return clear(); } jpayne@69: #undef clear jpayne@69: #define clear UNDEF(clear) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef clearok jpayne@69: inline int UNDEF(clearok)(WINDOW* win, bool bf) { return clearok(win, bf); } jpayne@69: #undef clearok jpayne@69: #define clearok UNDEF(clearok) jpayne@69: #else jpayne@69: extern "C" NCURSES_IMPEXP int NCURSES_API clearok(WINDOW*, bool); jpayne@69: #endif jpayne@69: jpayne@69: #ifdef clrtobot jpayne@69: inline int UNDEF(clrtobot)() { return clrtobot(); } jpayne@69: #undef clrtobot jpayne@69: #define clrtobot UNDEF(clrtobot) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef clrtoeol jpayne@69: inline int UNDEF(clrtoeol)() { return clrtoeol(); } jpayne@69: #undef clrtoeol jpayne@69: #define clrtoeol UNDEF(clrtoeol) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef color_set jpayne@69: inline chtype UNDEF(color_set)(NCURSES_PAIRS_T p, void* opts) { return color_set(p, opts); } jpayne@69: #undef color_set jpayne@69: #define color_set UNDEF(color_set) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef crmode jpayne@69: inline int UNDEF(crmode)(void) { return crmode(); } jpayne@69: #undef crmode jpayne@69: #define crmode UNDEF(crmode) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef delch jpayne@69: inline int UNDEF(delch)() { return delch(); } jpayne@69: #undef delch jpayne@69: #define delch UNDEF(delch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef deleteln jpayne@69: inline int UNDEF(deleteln)() { return deleteln(); } jpayne@69: #undef deleteln jpayne@69: #define deleteln UNDEF(deleteln) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef echochar jpayne@69: inline int UNDEF(echochar)(chtype ch) { return echochar(ch); } jpayne@69: #undef echochar jpayne@69: #define echochar UNDEF(echochar) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef erase jpayne@69: inline int UNDEF(erase)() { return erase(); } jpayne@69: #undef erase jpayne@69: #define erase UNDEF(erase) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef fixterm jpayne@69: inline int UNDEF(fixterm)(void) { return fixterm(); } jpayne@69: #undef fixterm jpayne@69: #define fixterm UNDEF(fixterm) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef flushok jpayne@69: inline int UNDEF(flushok)(WINDOW* _win, bool _bf) { jpayne@69: return flushok(_win, _bf); } jpayne@69: #undef flushok jpayne@69: #define flushok UNDEF(flushok) jpayne@69: #else jpayne@69: #define _no_flushok jpayne@69: #endif jpayne@69: jpayne@69: #ifdef getattrs jpayne@69: inline int UNDEF(getattrs)(WINDOW *win) { return getattrs(win); } jpayne@69: #undef getattrs jpayne@69: #define getattrs UNDEF(getattrs) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef getbegyx jpayne@69: inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); } jpayne@69: #undef getbegyx jpayne@69: #define getbegyx UNDEF(getbegyx) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef getbkgd jpayne@69: inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); } jpayne@69: #undef getbkgd jpayne@69: #define getbkgd UNDEF(getbkgd) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef getch jpayne@69: inline int UNDEF(getch)() { return getch(); } jpayne@69: #undef getch jpayne@69: #define getch UNDEF(getch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef getmaxyx jpayne@69: inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); } jpayne@69: #undef getmaxyx jpayne@69: #define getmaxyx UNDEF(getmaxyx) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef getnstr jpayne@69: inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str, n); } jpayne@69: #undef getnstr jpayne@69: #define getnstr UNDEF(getnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef getparyx jpayne@69: inline void UNDEF(getparyx)(WINDOW* win, int& y, int& x) { getparyx(win, y, x); } jpayne@69: #undef getparyx jpayne@69: #define getparyx UNDEF(getparyx) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef getstr jpayne@69: inline int UNDEF(getstr)(char *_str) { return getstr(_str); } jpayne@69: #undef getstr jpayne@69: #define getstr UNDEF(getstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef getyx jpayne@69: inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { jpayne@69: getyx(win, y, x); } jpayne@69: #undef getyx jpayne@69: #define getyx UNDEF(getyx) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef hline jpayne@69: inline int UNDEF(hline)(chtype ch, int n) { return hline(ch, n); } jpayne@69: #undef hline jpayne@69: #define hline UNDEF(hline) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef inch jpayne@69: inline chtype UNDEF(inch)() { return inch(); } jpayne@69: #undef inch jpayne@69: #define inch UNDEF(inch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef inchstr jpayne@69: inline int UNDEF(inchstr)(chtype *str) { return inchstr(str); } jpayne@69: #undef inchstr jpayne@69: #define inchstr UNDEF(inchstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef innstr jpayne@69: inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); } jpayne@69: #undef innstr jpayne@69: #define innstr UNDEF(innstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef insch jpayne@69: inline int UNDEF(insch)(chtype c) { return insch(c); } jpayne@69: #undef insch jpayne@69: #define insch UNDEF(insch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef insdelln jpayne@69: inline int UNDEF(insdelln)(int n) { return insdelln(n); } jpayne@69: #undef insdelln jpayne@69: #define insdelln UNDEF(insdelln) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef insertln jpayne@69: inline int UNDEF(insertln)() { return insertln(); } jpayne@69: #undef insertln jpayne@69: #define insertln UNDEF(insertln) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef insnstr jpayne@69: inline int UNDEF(insnstr)(const char *_str, int n) { jpayne@69: return insnstr(_str, n); } jpayne@69: #undef insnstr jpayne@69: #define insnstr UNDEF(insnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef insstr jpayne@69: inline int UNDEF(insstr)(const char *_str) { jpayne@69: return insstr(_str); } jpayne@69: #undef insstr jpayne@69: #define insstr UNDEF(insstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef instr jpayne@69: inline int UNDEF(instr)(char *_str) { return instr(_str); } jpayne@69: #undef instr jpayne@69: #define instr UNDEF(instr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef intrflush jpayne@69: inline void UNDEF(intrflush)(WINDOW *win, bool bf) { intrflush(); } jpayne@69: #undef intrflush jpayne@69: #define intrflush UNDEF(intrflush) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef is_linetouched jpayne@69: inline int UNDEF(is_linetouched)(WINDOW *w, int l) { return is_linetouched(w,l); } jpayne@69: #undef is_linetouched jpayne@69: #define is_linetouched UNDEF(is_linetouched) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef leaveok jpayne@69: inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); } jpayne@69: #undef leaveok jpayne@69: #define leaveok UNDEF(leaveok) jpayne@69: #else jpayne@69: extern "C" NCURSES_IMPEXP int NCURSES_API leaveok(WINDOW* win, bool bf); jpayne@69: #endif jpayne@69: jpayne@69: #ifdef move jpayne@69: inline int UNDEF(move)(int x, int y) { return move(x, y); } jpayne@69: #undef move jpayne@69: #define move UNDEF(move) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvaddch jpayne@69: inline int UNDEF(mvaddch)(int y, int x, chtype ch) jpayne@69: { return mvaddch(y, x, ch); } jpayne@69: #undef mvaddch jpayne@69: #define mvaddch UNDEF(mvaddch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvaddnstr jpayne@69: inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n) jpayne@69: { return mvaddnstr(y, x, str, n); } jpayne@69: #undef mvaddnstr jpayne@69: #define mvaddnstr UNDEF(mvaddnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvaddstr jpayne@69: inline int UNDEF(mvaddstr)(int y, int x, const char * str) jpayne@69: { return mvaddstr(y, x, str); } jpayne@69: #undef mvaddstr jpayne@69: #define mvaddstr UNDEF(mvaddstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvchgat jpayne@69: inline int UNDEF(mvchgat)(int y, int x, int n, jpayne@69: attr_t attr, NCURSES_PAIRS_T color, const void *opts) { jpayne@69: return mvchgat(y, x, n, attr, color, opts); } jpayne@69: #undef mvchgat jpayne@69: #define mvchgat UNDEF(mvchgat) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvdelch jpayne@69: inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);} jpayne@69: #undef mvdelch jpayne@69: #define mvdelch UNDEF(mvdelch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvgetch jpayne@69: inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);} jpayne@69: #undef mvgetch jpayne@69: #define mvgetch UNDEF(mvgetch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvgetnstr jpayne@69: inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) { jpayne@69: return mvgetnstr(y, x, str, n);} jpayne@69: #undef mvgetnstr jpayne@69: #define mvgetnstr UNDEF(mvgetnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvgetstr jpayne@69: inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);} jpayne@69: #undef mvgetstr jpayne@69: #define mvgetstr UNDEF(mvgetstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvinch jpayne@69: inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} jpayne@69: #undef mvinch jpayne@69: #define mvinch UNDEF(mvinch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvinnstr jpayne@69: inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) { jpayne@69: return mvinnstr(y, x, _str, n); } jpayne@69: #undef mvinnstr jpayne@69: #define mvinnstr UNDEF(mvinnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvinsch jpayne@69: inline int UNDEF(mvinsch)(int y, int x, chtype c) jpayne@69: { return mvinsch(y, x, c); } jpayne@69: #undef mvinsch jpayne@69: #define mvinsch UNDEF(mvinsch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvinsnstr jpayne@69: inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) { jpayne@69: return mvinsnstr(y, x, _str, n); } jpayne@69: #undef mvinsnstr jpayne@69: #define mvinsnstr UNDEF(mvinsnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvinsstr jpayne@69: inline int UNDEF(mvinsstr)(int y, int x, const char *_str) { jpayne@69: return mvinsstr(y, x, _str); } jpayne@69: #undef mvinsstr jpayne@69: #define mvinsstr UNDEF(mvinsstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwaddch jpayne@69: inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, const chtype ch) jpayne@69: { return mvwaddch(win, y, x, ch); } jpayne@69: #undef mvwaddch jpayne@69: #define mvwaddch UNDEF(mvwaddch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwaddchnstr jpayne@69: inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, const chtype *str, int n) jpayne@69: { return mvwaddchnstr(win, y, x, str, n); } jpayne@69: #undef mvwaddchnstr jpayne@69: #define mvwaddchnstr UNDEF(mvwaddchnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwaddchstr jpayne@69: inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, const chtype *str) jpayne@69: { return mvwaddchstr(win, y, x, str); } jpayne@69: #undef mvwaddchstr jpayne@69: #define mvwaddchstr UNDEF(mvwaddchstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwaddnstr jpayne@69: inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n) jpayne@69: { return mvwaddnstr(win, y, x, str, n); } jpayne@69: #undef mvwaddnstr jpayne@69: #define mvwaddnstr UNDEF(mvwaddnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwaddstr jpayne@69: inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str) jpayne@69: { return mvwaddstr(win, y, x, str); } jpayne@69: #undef mvwaddstr jpayne@69: #define mvwaddstr UNDEF(mvwaddstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwchgat jpayne@69: inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, jpayne@69: attr_t attr, NCURSES_PAIRS_T color, const void *opts) { jpayne@69: return mvwchgat(win, y, x, n, attr, color, opts); } jpayne@69: #undef mvwchgat jpayne@69: #define mvwchgat UNDEF(mvwchgat) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwdelch jpayne@69: inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x) jpayne@69: { return mvwdelch(win, y, x); } jpayne@69: #undef mvwdelch jpayne@69: #define mvwdelch UNDEF(mvwdelch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwgetch jpayne@69: inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);} jpayne@69: #undef mvwgetch jpayne@69: #define mvwgetch UNDEF(mvwgetch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwgetnstr jpayne@69: inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) jpayne@69: {return mvwgetnstr(win, y, x, str, n);} jpayne@69: #undef mvwgetnstr jpayne@69: #define mvwgetnstr UNDEF(mvwgetnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwgetstr jpayne@69: inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str) jpayne@69: {return mvwgetstr(win, y, x, str);} jpayne@69: #undef mvwgetstr jpayne@69: #define mvwgetstr UNDEF(mvwgetstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwhline jpayne@69: inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) { jpayne@69: return mvwhline(win, y, x, c, n); } jpayne@69: #undef mvwhline jpayne@69: #define mvwhline UNDEF(mvwhline) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwinch jpayne@69: inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { jpayne@69: return mvwinch(win, y, x);} jpayne@69: #undef mvwinch jpayne@69: #define mvwinch UNDEF(mvwinch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwinchnstr jpayne@69: inline int UNDEF(mvwinchnstr)(WINDOW *win, int y, int x, chtype *str, int n) { return mvwinchnstr(win, y, x, str, n); } jpayne@69: #undef mvwinchnstr jpayne@69: #define mvwinchnstr UNDEF(mvwinchnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwinchstr jpayne@69: inline int UNDEF(mvwinchstr)(WINDOW *win, int y, int x, chtype *str) { return mvwinchstr(win, y, x, str); } jpayne@69: #undef mvwinchstr jpayne@69: #define mvwinchstr UNDEF(mvwinchstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwinnstr jpayne@69: inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { jpayne@69: return mvwinnstr(win, y, x, _str, n); } jpayne@69: #undef mvwinnstr jpayne@69: #define mvwinnstr UNDEF(mvwinnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwinsch jpayne@69: inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, chtype c) jpayne@69: { return mvwinsch(win, y, x, c); } jpayne@69: #undef mvwinsch jpayne@69: #define mvwinsch UNDEF(mvwinsch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwinsnstr jpayne@69: inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int n) { jpayne@69: return mvwinsnstr(w, y, x, _str, n); } jpayne@69: #undef mvwinsnstr jpayne@69: #define mvwinsnstr UNDEF(mvwinsnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwinsstr jpayne@69: inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) { jpayne@69: return mvwinsstr(w, y, x, _str); } jpayne@69: #undef mvwinsstr jpayne@69: #define mvwinsstr UNDEF(mvwinsstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef mvwvline jpayne@69: inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) { jpayne@69: return mvwvline(win, y, x, c, n); } jpayne@69: #undef mvwvline jpayne@69: #define mvwvline UNDEF(mvwvline) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef napms jpayne@69: inline void UNDEF(napms)(unsigned long x) { napms(x); } jpayne@69: #undef napms jpayne@69: #define napms UNDEF(napms) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef nocrmode jpayne@69: inline int UNDEF(nocrmode)(void) { return nocrmode(); } jpayne@69: #undef nocrmode jpayne@69: #define nocrmode UNDEF(nocrmode) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef nodelay jpayne@69: inline void UNDEF(nodelay)() { nodelay(); } jpayne@69: #undef nodelay jpayne@69: #define nodelay UNDEF(nodelay) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef redrawwin jpayne@69: inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); } jpayne@69: #undef redrawwin jpayne@69: #define redrawwin UNDEF(redrawwin) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef refresh jpayne@69: inline int UNDEF(refresh)() { return refresh(); } jpayne@69: #undef refresh jpayne@69: #define refresh UNDEF(refresh) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef resetterm jpayne@69: inline int UNDEF(resetterm)(void) { return resetterm(); } jpayne@69: #undef resetterm jpayne@69: #define resetterm UNDEF(resetterm) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef saveterm jpayne@69: inline int UNDEF(saveterm)(void) { return saveterm(); } jpayne@69: #undef saveterm jpayne@69: #define saveterm UNDEF(saveterm) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef scrl jpayne@69: inline int UNDEF(scrl)(int l) { return scrl(l); } jpayne@69: #undef scrl jpayne@69: #define scrl UNDEF(scrl) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef scroll jpayne@69: inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); } jpayne@69: #undef scroll jpayne@69: #define scroll UNDEF(scroll) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef scrollok jpayne@69: inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); } jpayne@69: #undef scrollok jpayne@69: #define scrollok UNDEF(scrollok) jpayne@69: #else jpayne@69: #if defined(__NCURSES_H) jpayne@69: extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool); jpayne@69: #else jpayne@69: extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char); jpayne@69: #endif jpayne@69: #endif jpayne@69: jpayne@69: #ifdef setscrreg jpayne@69: inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); } jpayne@69: #undef setscrreg jpayne@69: #define setscrreg UNDEF(setscrreg) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef standend jpayne@69: inline int UNDEF(standend)() { return standend(); } jpayne@69: #undef standend jpayne@69: #define standend UNDEF(standend) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef standout jpayne@69: inline int UNDEF(standout)() { return standout(); } jpayne@69: #undef standout jpayne@69: #define standout UNDEF(standout) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef subpad jpayne@69: inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) jpayne@69: { return derwin(p, l, c, y, x); } jpayne@69: #undef subpad jpayne@69: #define subpad UNDEF(subpad) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef timeout jpayne@69: inline void UNDEF(timeout)(int delay) { timeout(delay); } jpayne@69: #undef timeout jpayne@69: #define timeout UNDEF(timeout) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef touchline jpayne@69: inline int UNDEF(touchline)(WINDOW *win, int s, int c) jpayne@69: { return touchline(win, s, c); } jpayne@69: #undef touchline jpayne@69: #define touchline UNDEF(touchline) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef touchwin jpayne@69: inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); } jpayne@69: #undef touchwin jpayne@69: #define touchwin UNDEF(touchwin) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef untouchwin jpayne@69: inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); } jpayne@69: #undef untouchwin jpayne@69: #define untouchwin UNDEF(untouchwin) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef vline jpayne@69: inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); } jpayne@69: #undef vline jpayne@69: #define vline UNDEF(vline) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef waddchstr jpayne@69: inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); } jpayne@69: #undef waddchstr jpayne@69: #define waddchstr UNDEF(waddchstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef waddstr jpayne@69: inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); } jpayne@69: #undef waddstr jpayne@69: #define waddstr UNDEF(waddstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef wattroff jpayne@69: inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); } jpayne@69: #undef wattroff jpayne@69: #define wattroff UNDEF(wattroff) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef wattrset jpayne@69: inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); } jpayne@69: #undef wattrset jpayne@69: #define wattrset UNDEF(wattrset) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef winch jpayne@69: inline chtype UNDEF(winch)(const WINDOW* win) { return winch(win); } jpayne@69: #undef winch jpayne@69: #define winch UNDEF(winch) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef winchnstr jpayne@69: inline int UNDEF(winchnstr)(WINDOW *win, chtype *str, int n) { return winchnstr(win, str, n); } jpayne@69: #undef winchnstr jpayne@69: #define winchnstr UNDEF(winchnstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef winchstr jpayne@69: inline int UNDEF(winchstr)(WINDOW *win, chtype *str) { return winchstr(win, str); } jpayne@69: #undef winchstr jpayne@69: #define winchstr UNDEF(winchstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef winsstr jpayne@69: inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { jpayne@69: return winsstr(w, _str); } jpayne@69: #undef winsstr jpayne@69: #define winsstr UNDEF(winsstr) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef wstandend jpayne@69: inline int UNDEF(wstandend)(WINDOW *win) { return wstandend(win); } jpayne@69: #undef wstandend jpayne@69: #define wstandend UNDEF(wstandend) jpayne@69: #endif jpayne@69: jpayne@69: #ifdef wstandout jpayne@69: inline int UNDEF(wstandout)(WINDOW *win) { return wstandout(win); } jpayne@69: #undef wstandout jpayne@69: #define wstandout UNDEF(wstandout) jpayne@69: #endif jpayne@69: jpayne@69: /* jpayne@69: * jpayne@69: * C++ class for windows. jpayne@69: * jpayne@69: */ jpayne@69: jpayne@69: extern "C" int _nc_ripoffline(int, int (*init)(WINDOW*, int)); jpayne@69: extern "C" int _nc_xx_ripoff_init(WINDOW *, int); jpayne@69: extern "C" int _nc_has_mouse(void); jpayne@69: jpayne@69: class NCURSES_CXX_IMPEXP NCursesWindow jpayne@69: { jpayne@69: friend class NCursesMenu; jpayne@69: friend class NCursesForm; jpayne@69: jpayne@69: private: jpayne@69: static bool b_initialized; jpayne@69: static void initialize(); jpayne@69: void constructing(); jpayne@69: friend int _nc_xx_ripoff_init(WINDOW *, int); jpayne@69: jpayne@69: void set_keyboard(); jpayne@69: jpayne@69: NCURSES_COLOR_T getcolor(int getback) const; jpayne@69: NCURSES_PAIRS_T getPair() const; jpayne@69: jpayne@69: static int setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back, NCURSES_PAIRS_T pair); jpayne@69: static int colorInitialized; jpayne@69: jpayne@69: // This private constructor is only used during the initialization jpayne@69: // of windows generated by ripoffline() calls. jpayne@69: NCursesWindow(WINDOW* win, int ncols); jpayne@69: jpayne@69: protected: jpayne@69: virtual void err_handler(const char *) const THROWS(NCursesException); jpayne@69: // Signal an error with the given message text. jpayne@69: jpayne@69: static long count; // count of all active windows: jpayne@69: // We rely on the c++ promise that jpayne@69: // all otherwise uninitialized jpayne@69: // static class vars are set to 0 jpayne@69: jpayne@69: WINDOW* w; // the curses WINDOW jpayne@69: jpayne@69: bool alloced; // TRUE if we own the WINDOW jpayne@69: jpayne@69: NCursesWindow* par; // parent, if subwindow jpayne@69: NCursesWindow* subwins; // head of subwindows list jpayne@69: NCursesWindow* sib; // next subwindow of parent jpayne@69: jpayne@69: void kill_subwindows(); // disable all subwindows jpayne@69: // Destroy all subwindows. jpayne@69: jpayne@69: /* Only for use by derived classes. They are then in charge to jpayne@69: fill the member variables correctly. */ jpayne@69: NCursesWindow(); jpayne@69: jpayne@69: public: jpayne@69: explicit NCursesWindow(WINDOW* window); // useful only for stdscr jpayne@69: jpayne@69: NCursesWindow(int nlines, // number of lines jpayne@69: int ncols, // number of columns jpayne@69: int begin_y, // line origin jpayne@69: int begin_x); // col origin jpayne@69: jpayne@69: NCursesWindow(NCursesWindow& par,// parent window jpayne@69: int nlines, // number of lines jpayne@69: int ncols, // number of columns jpayne@69: int begin_y, // absolute or relative jpayne@69: int begin_x, // origins: jpayne@69: char absrel = 'a');// if `a', begin_y & begin_x are jpayne@69: // absolute screen pos, else if `r', they are relative to par origin jpayne@69: jpayne@69: NCursesWindow(NCursesWindow& par,// parent window jpayne@69: bool do_box = TRUE); jpayne@69: // this is the very common case that we want to create the subwindow that jpayne@69: // is two lines and two columns smaller and begins at (1,1). jpayne@69: // We may automatically request the box around it. jpayne@69: jpayne@69: NCursesWindow& operator=(const NCursesWindow& rhs) jpayne@69: { jpayne@69: if (this != &rhs) jpayne@69: *this = rhs; jpayne@69: return *this; jpayne@69: } jpayne@69: jpayne@69: NCursesWindow(const NCursesWindow& rhs) jpayne@69: : w(rhs.w), alloced(rhs.alloced), par(rhs.par), subwins(rhs.subwins), sib(rhs.sib) jpayne@69: { jpayne@69: } jpayne@69: jpayne@69: virtual ~NCursesWindow() THROWS(NCursesException); jpayne@69: jpayne@69: NCursesWindow Clone(); jpayne@69: // Make an exact copy of the window. jpayne@69: jpayne@69: // Initialization. jpayne@69: static void useColors(void); jpayne@69: // Call this routine very early if you want to have colors. jpayne@69: jpayne@69: static int ripoffline(int ripoff_lines, jpayne@69: int (*init)(NCursesWindow& win)); jpayne@69: // This function is used to generate a window of ripped-of lines. jpayne@69: // If the argument is positive, lines are removed from the top, if it jpayne@69: // is negative lines are removed from the bottom. This enhances the jpayne@69: // lowlevel ripoffline() function because it uses the internal jpayne@69: // implementation that allows to remove more than just a single line. jpayne@69: // This function must be called before any other ncurses function. The jpayne@69: // creation of the window is deferred until ncurses gets initialized. jpayne@69: // The initialization function is then called. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // terminal status jpayne@69: // ------------------------------------------------------------------------- jpayne@69: int lines() const { initialize(); return LINES; } jpayne@69: // Number of lines on terminal, *not* window jpayne@69: jpayne@69: int cols() const { initialize(); return COLS; } jpayne@69: // Number of cols on terminal, *not* window jpayne@69: jpayne@69: int tabsize() const { initialize(); return TABSIZE; } jpayne@69: // Size of a tab on terminal, *not* window jpayne@69: jpayne@69: static int NumberOfColors(); jpayne@69: // Number of available colors jpayne@69: jpayne@69: int colors() const { return NumberOfColors(); } jpayne@69: // Number of available colors jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // window status jpayne@69: // ------------------------------------------------------------------------- jpayne@69: int height() const { return maxy() + 1; } jpayne@69: // Number of lines in this window jpayne@69: jpayne@69: int width() const { return maxx() + 1; } jpayne@69: // Number of columns in this window jpayne@69: jpayne@69: int begx() const { return getbegx(w); } jpayne@69: // Column of top left corner relative to stdscr jpayne@69: jpayne@69: int begy() const { return getbegy(w); } jpayne@69: // Line of top left corner relative to stdscr jpayne@69: jpayne@69: int curx() const { return getcurx(w); } jpayne@69: // Column of top left corner relative to stdscr jpayne@69: jpayne@69: int cury() const { return getcury(w); } jpayne@69: // Line of top left corner relative to stdscr jpayne@69: jpayne@69: int maxx() const { return getmaxx(w) == ERR ? ERR : getmaxx(w)-1; } jpayne@69: // Largest x coord in window jpayne@69: jpayne@69: int maxy() const { return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; } jpayne@69: // Largest y coord in window jpayne@69: jpayne@69: NCURSES_PAIRS_T getcolor() const; jpayne@69: // Actual color pair jpayne@69: jpayne@69: NCURSES_COLOR_T foreground() const { return getcolor(0); } jpayne@69: // Actual foreground color jpayne@69: jpayne@69: NCURSES_COLOR_T background() const { return getcolor(1); } jpayne@69: // Actual background color jpayne@69: jpayne@69: int setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back); jpayne@69: // Set color palette entry jpayne@69: jpayne@69: int setcolor(NCURSES_PAIRS_T pair); jpayne@69: // Set actually used palette entry jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // window positioning jpayne@69: // ------------------------------------------------------------------------- jpayne@69: virtual int mvwin(int begin_y, int begin_x) { jpayne@69: return ::mvwin(w, begin_y, begin_x); } jpayne@69: // Move window to new position with the new position as top left corner. jpayne@69: // This is virtual because it is redefined in NCursesPanel. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // coordinate positioning jpayne@69: // ------------------------------------------------------------------------- jpayne@69: int move(int y, int x) { return ::wmove(w, y, x); } jpayne@69: // Move cursor the this position jpayne@69: jpayne@69: void getyx(int& y, int& x) const { ::getyx(w, y, x); } jpayne@69: // Get current position of the cursor jpayne@69: jpayne@69: void getbegyx(int& y, int& x) const { ::getbegyx(w, y, x); } jpayne@69: // Get beginning of the window jpayne@69: jpayne@69: void getmaxyx(int& y, int& x) const { ::getmaxyx(w, y, x); } jpayne@69: // Get size of the window jpayne@69: jpayne@69: void getparyx(int& y, int& x) const { ::getparyx(w, y, x); } jpayne@69: // Get parent's beginning of the window jpayne@69: jpayne@69: int mvcur(int oldrow, int oldcol, int newrow, int newcol) const { jpayne@69: return ::mvcur(oldrow, oldcol, newrow, newcol); } jpayne@69: // Perform lowlevel cursor motion that takes effect immediately. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // input jpayne@69: // ------------------------------------------------------------------------- jpayne@69: int getch() { return ::wgetch(w); } jpayne@69: // Get a keystroke from the window. jpayne@69: jpayne@69: int getch(int y, int x) { return ::mvwgetch(w, y, x); } jpayne@69: // Move cursor to position and get a keystroke from the window jpayne@69: jpayne@69: int getstr(char* str, int n=-1) { jpayne@69: return ::wgetnstr(w, str, n); } jpayne@69: // Read a series of characters into str until a newline or carriage return jpayne@69: // is received. Read at most n characters. If n is negative, the limit is jpayne@69: // ignored. jpayne@69: jpayne@69: int getstr(int y, int x, char* str, int n=-1) { jpayne@69: return ::mvwgetnstr(w, y, x, str, n); } jpayne@69: // Move the cursor to the requested position and then perform the getstr() jpayne@69: // as described above. jpayne@69: jpayne@69: int instr(char *s, int n=-1) { return ::winnstr(w, s, n); } jpayne@69: // Get a string of characters from the window into the buffer s. Retrieve jpayne@69: // at most n characters, if n is negative retrieve all characters up to the jpayne@69: // end of the current line. Attributes are stripped from the characters. jpayne@69: jpayne@69: int instr(int y, int x, char *s, int n=-1) { jpayne@69: return ::mvwinnstr(w, y, x, s, n); } jpayne@69: // Move the cursor to the requested position and then perform the instr() jpayne@69: // as described above. jpayne@69: jpayne@69: int scanw(const char* fmt, ...) jpayne@69: // Perform a scanw function from the window. jpayne@69: #if __GNUG__ >= 2 jpayne@69: __attribute__ ((format (scanf, 2, 3))); jpayne@69: #else jpayne@69: ; jpayne@69: #endif jpayne@69: jpayne@69: int scanw(const char*, va_list); jpayne@69: // Perform a scanw function from the window. jpayne@69: jpayne@69: int scanw(int y, int x, const char* fmt, ...) jpayne@69: // Move the cursor to the requested position and then perform a scanw jpayne@69: // from the window. jpayne@69: #if __GNUG__ >= 2 jpayne@69: __attribute__ ((format (scanf, 4, 5))); jpayne@69: #else jpayne@69: ; jpayne@69: #endif jpayne@69: jpayne@69: int scanw(int y, int x, const char* fmt, va_list); jpayne@69: // Move the cursor to the requested position and then perform a scanw jpayne@69: // from the window. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // output jpayne@69: // ------------------------------------------------------------------------- jpayne@69: int addch(const chtype ch) { return ::waddch(w, ch); } jpayne@69: // Put attributed character to the window. jpayne@69: jpayne@69: int addch(int y, int x, const chtype ch) { jpayne@69: return ::mvwaddch(w, y, x, ch); } jpayne@69: // Move cursor to the requested position and then put attributed character jpayne@69: // to the window. jpayne@69: jpayne@69: int echochar(const chtype ch) { return ::wechochar(w, ch); } jpayne@69: // Put attributed character to the window and refresh it immediately. jpayne@69: jpayne@69: int addstr(const char* str, int n=-1) { jpayne@69: return ::waddnstr(w, str, n); } jpayne@69: // Write the string str to the window, stop writing if the terminating jpayne@69: // NUL or the limit n is reached. If n is negative, it is ignored. jpayne@69: jpayne@69: int addstr(int y, int x, const char * str, int n=-1) { jpayne@69: return ::mvwaddnstr(w, y, x, str, n); } jpayne@69: // Move the cursor to the requested position and then perform the addchstr jpayne@69: // as described above. jpayne@69: jpayne@69: int addchstr(const chtype* str, int n=-1) { jpayne@69: return ::waddchnstr(w, str, n); } jpayne@69: // Write the string str to the window, stop writing if the terminating jpayne@69: // NUL or the limit n is reached. If n is negative, it is ignored. jpayne@69: jpayne@69: int addchstr(int y, int x, const chtype * str, int n=-1) { jpayne@69: return ::mvwaddchnstr(w, y, x, str, n); } jpayne@69: // Move the cursor to the requested position and then perform the addchstr jpayne@69: // as described above. jpayne@69: jpayne@69: int printw(const char* fmt, ...) jpayne@69: // Do a formatted print to the window. jpayne@69: #if (__GNUG__ >= 2) && !defined(printf) jpayne@69: __attribute__ ((format (printf, 2, 3))); jpayne@69: #else jpayne@69: ; jpayne@69: #endif jpayne@69: jpayne@69: int printw(int y, int x, const char * fmt, ...) jpayne@69: // Move the cursor and then do a formatted print to the window. jpayne@69: #if (__GNUG__ >= 2) && !defined(printf) jpayne@69: __attribute__ ((format (printf, 4, 5))); jpayne@69: #else jpayne@69: ; jpayne@69: #endif jpayne@69: jpayne@69: int printw(const char* fmt, va_list args); jpayne@69: // Do a formatted print to the window. jpayne@69: jpayne@69: int printw(int y, int x, const char * fmt, va_list args); jpayne@69: // Move the cursor and then do a formatted print to the window. jpayne@69: jpayne@69: chtype inch() const { return ::winch(w); } jpayne@69: // Retrieve attributed character under the current cursor position. jpayne@69: jpayne@69: chtype inch(int y, int x) { return ::mvwinch(w, y, x); } jpayne@69: // Move cursor to requested position and then retrieve attributed character jpayne@69: // at this position. jpayne@69: jpayne@69: int inchstr(chtype* str, int n=-1) { jpayne@69: return ::winchnstr(w, str, n); } jpayne@69: // Read the string str from the window, stop reading if the terminating jpayne@69: // NUL or the limit n is reached. If n is negative, it is ignored. jpayne@69: jpayne@69: int inchstr(int y, int x, chtype * str, int n=-1) { jpayne@69: return ::mvwinchnstr(w, y, x, str, n); } jpayne@69: // Move the cursor to the requested position and then perform the inchstr jpayne@69: // as described above. jpayne@69: jpayne@69: int insch(chtype ch) { return ::winsch(w, ch); } jpayne@69: // Insert attributed character into the window before current cursor jpayne@69: // position. jpayne@69: jpayne@69: int insch(int y, int x, chtype ch) { jpayne@69: return ::mvwinsch(w, y, x, ch); } jpayne@69: // Move cursor to requested position and then insert the attributed jpayne@69: // character before that position. jpayne@69: jpayne@69: int insertln() { return ::winsdelln(w, 1); } jpayne@69: // Insert an empty line above the current line. jpayne@69: jpayne@69: int insdelln(int n=1) { return ::winsdelln(w, n); } jpayne@69: // If n>0 insert that many lines above the current line. If n<0 delete jpayne@69: // that many lines beginning with the current line. jpayne@69: jpayne@69: int insstr(const char *s, int n=-1) { jpayne@69: return ::winsnstr(w, s, n); } jpayne@69: // Insert the string into the window before the current cursor position. jpayne@69: // Insert stops at end of string or when the limit n is reached. If n is jpayne@69: // negative, it is ignored. jpayne@69: jpayne@69: int insstr(int y, int x, const char *s, int n=-1) { jpayne@69: return ::mvwinsnstr(w, y, x, s, n); } jpayne@69: // Move the cursor to the requested position and then perform the insstr() jpayne@69: // as described above. jpayne@69: jpayne@69: int attron (chtype at) { return ::wattron (w, at); } jpayne@69: // Switch on the window attributes; jpayne@69: jpayne@69: int attroff(chtype at) { return ::wattroff(w, static_cast(at)); } jpayne@69: // Switch off the window attributes; jpayne@69: jpayne@69: int attrset(chtype at) { return ::wattrset(w, static_cast(at)); } jpayne@69: // Set the window attributes; jpayne@69: jpayne@69: chtype attrget() { return ::getattrs(w); } jpayne@69: // Get the window attributes; jpayne@69: jpayne@69: int color_set(NCURSES_PAIRS_T color_pair_number, void* opts=NULL) { jpayne@69: return ::wcolor_set(w, color_pair_number, opts); } jpayne@69: // Set the window color attribute; jpayne@69: jpayne@69: int chgat(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) { jpayne@69: return ::wchgat(w, n, attr, color, opts); } jpayne@69: // Change the attributes of the next n characters in the current line. If jpayne@69: // n is negative or greater than the number of remaining characters in the jpayne@69: // line, the attributes will be changed up to the end of the line. jpayne@69: jpayne@69: int chgat(int y, int x, jpayne@69: int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) { jpayne@69: return ::mvwchgat(w, y, x, n, attr, color, opts); } jpayne@69: // Move the cursor to the requested position and then perform chgat() as jpayne@69: // described above. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // background jpayne@69: // ------------------------------------------------------------------------- jpayne@69: chtype getbkgd() const { return ::getbkgd(w); } jpayne@69: // Get current background setting. jpayne@69: jpayne@69: int bkgd(const chtype ch) { return ::wbkgd(w, ch); } jpayne@69: // Set the background property and apply it to the window. jpayne@69: jpayne@69: void bkgdset(chtype ch) { ::wbkgdset(w, ch); } jpayne@69: // Set the background property. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // borders jpayne@69: // ------------------------------------------------------------------------- jpayne@69: int box(chtype vert=0, chtype hor=0) { jpayne@69: return ::wborder(w, vert, vert, hor, hor, 0, 0, 0, 0); } jpayne@69: // Draw a box around the window with the given vertical and horizontal jpayne@69: // drawing characters. If you specify a zero as character, curses will try jpayne@69: // to find a "nice" character. jpayne@69: jpayne@69: int border(chtype left=0, chtype right=0, jpayne@69: chtype top =0, chtype bottom=0, jpayne@69: chtype top_left =0, chtype top_right=0, jpayne@69: chtype bottom_left =0, chtype bottom_right=0) { jpayne@69: return ::wborder(w, left, right, top, bottom, top_left, top_right, jpayne@69: bottom_left, bottom_right); } jpayne@69: // Draw a border around the window with the given characters for the jpayne@69: // various parts of the border. If you pass zero for a character, curses jpayne@69: // will try to find "nice" characters. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // lines and boxes jpayne@69: // ------------------------------------------------------------------------- jpayne@69: int hline(int len, chtype ch=0) { return ::whline(w, ch, len); } jpayne@69: // Draw a horizontal line of len characters with the given character. If jpayne@69: // you pass zero for the character, curses will try to find a "nice" one. jpayne@69: jpayne@69: int hline(int y, int x, int len, chtype ch=0) { jpayne@69: return ::mvwhline(w, y, x, ch, len); } jpayne@69: // Move the cursor to the requested position and then draw a horizontal line. jpayne@69: jpayne@69: int vline(int len, chtype ch=0) { return ::wvline(w, ch, len); } jpayne@69: // Draw a vertical line of len characters with the given character. If jpayne@69: // you pass zero for the character, curses will try to find a "nice" one. jpayne@69: jpayne@69: int vline(int y, int x, int len, chtype ch=0) { jpayne@69: return ::mvwvline(w, y, x, ch, len); } jpayne@69: // Move the cursor to the requested position and then draw a vertical line. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // erasure jpayne@69: // ------------------------------------------------------------------------- jpayne@69: int erase() { return ::werase(w); } jpayne@69: // Erase the window. jpayne@69: jpayne@69: int clear() { return ::wclear(w); } jpayne@69: // Clear the window. jpayne@69: jpayne@69: int clearok(bool bf) { return ::clearok(w, bf); } jpayne@69: // Set/Reset the clear flag. If set, the next refresh() will clear the jpayne@69: // screen. jpayne@69: jpayne@69: int clrtobot() { return ::wclrtobot(w); } jpayne@69: // Clear to the end of the window. jpayne@69: jpayne@69: int clrtoeol() { return ::wclrtoeol(w); } jpayne@69: // Clear to the end of the line. jpayne@69: jpayne@69: int delch() { return ::wdelch(w); } jpayne@69: // Delete character under the cursor. jpayne@69: jpayne@69: int delch(int y, int x) { return ::mvwdelch(w, y, x); } jpayne@69: // Move cursor to requested position and delete the character under the jpayne@69: // cursor. jpayne@69: jpayne@69: int deleteln() { return ::winsdelln(w, -1); } jpayne@69: // Delete the current line. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // screen control jpayne@69: // ------------------------------------------------------------------------- jpayne@69: int scroll(int amount=1) { return ::wscrl(w, amount); } jpayne@69: // Scroll amount lines. If amount is positive, scroll up, otherwise jpayne@69: // scroll down. jpayne@69: jpayne@69: int scrollok(bool bf) { return ::scrollok(w, bf); } jpayne@69: // If bf is TRUE, window scrolls if cursor is moved off the bottom jpayne@69: // edge of the window or a scrolling region, otherwise the cursor is left jpayne@69: // at the bottom line. jpayne@69: jpayne@69: int setscrreg(int from, int to) { jpayne@69: return ::wsetscrreg(w, from, to); } jpayne@69: // Define a soft scrolling region. jpayne@69: jpayne@69: int idlok(bool bf) { return ::idlok(w, bf); } jpayne@69: // If bf is TRUE, use insert/delete line hardware support if possible. jpayne@69: // Otherwise do it in software. jpayne@69: jpayne@69: void idcok(bool bf) { ::idcok(w, bf); } jpayne@69: // If bf is TRUE, use insert/delete character hardware support if possible. jpayne@69: // Otherwise do it in software. jpayne@69: jpayne@69: int touchline(int s, int c) { return ::touchline(w, s, c); } jpayne@69: // Mark the given lines as modified. jpayne@69: jpayne@69: int touchwin() { return ::wtouchln(w, 0, height(), 1); } jpayne@69: // Mark the whole window as modified. jpayne@69: jpayne@69: int untouchwin() { return ::wtouchln(w, 0, height(), 0); } jpayne@69: // Mark the whole window as unmodified. jpayne@69: jpayne@69: int touchln(int s, int cnt, bool changed=TRUE) { jpayne@69: return ::wtouchln(w, s, cnt, static_cast(changed ? 1 : 0)); } jpayne@69: // Mark cnt lines beginning from line s as changed or unchanged, depending jpayne@69: // on the value of the changed flag. jpayne@69: jpayne@69: bool is_linetouched(int line) const { jpayne@69: return (::is_linetouched(w, line) == TRUE ? TRUE:FALSE); } jpayne@69: // Return TRUE if line is marked as changed, FALSE otherwise jpayne@69: jpayne@69: bool is_wintouched() const { jpayne@69: return (::is_wintouched(w) ? TRUE:FALSE); } jpayne@69: // Return TRUE if window is marked as changed, FALSE otherwise jpayne@69: jpayne@69: int leaveok(bool bf) { return ::leaveok(w, bf); } jpayne@69: // If bf is TRUE, curses will leave the cursor after an update wherever jpayne@69: // it is after the update. jpayne@69: jpayne@69: int redrawln(int from, int n) { return ::wredrawln(w, from, n); } jpayne@69: // Redraw n lines starting from the requested line jpayne@69: jpayne@69: int redrawwin() { return ::wredrawln(w, 0, height()); } jpayne@69: // Redraw the whole window jpayne@69: jpayne@69: int doupdate() { return ::doupdate(); } jpayne@69: // Do all outputs to make the physical screen looking like the virtual one jpayne@69: jpayne@69: void syncdown() { ::wsyncdown(w); } jpayne@69: // Propagate the changes down to all descendant windows jpayne@69: jpayne@69: void syncup() { ::wsyncup(w); } jpayne@69: // Propagate the changes up in the hierarchy jpayne@69: jpayne@69: void cursyncup() { ::wcursyncup(w); } jpayne@69: // Position the cursor in all ancestor windows corresponding to our setting jpayne@69: jpayne@69: int syncok(bool bf) { return ::syncok(w, bf); } jpayne@69: // If called with bf=TRUE, syncup() is called whenever the window is changed jpayne@69: jpayne@69: #ifndef _no_flushok jpayne@69: int flushok(bool bf) { return ::flushok(w, bf); } jpayne@69: #endif jpayne@69: jpayne@69: void immedok(bool bf) { ::immedok(w, bf); } jpayne@69: // If called with bf=TRUE, any change in the window will cause an jpayne@69: // automatic immediate refresh() jpayne@69: jpayne@69: int intrflush(bool bf) { return ::intrflush(w, bf); } jpayne@69: jpayne@69: int keypad(bool bf) { return ::keypad(w, bf); } jpayne@69: // If called with bf=TRUE, the application will interpret function keys. jpayne@69: jpayne@69: int nodelay(bool bf) { return ::nodelay(w, bf); } jpayne@69: jpayne@69: int meta(bool bf) { return ::meta(w, bf); } jpayne@69: // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise jpayne@69: // 7-Bit characters are generated. jpayne@69: jpayne@69: int standout() { return ::wstandout(w); } jpayne@69: // Enable "standout" attributes jpayne@69: jpayne@69: int standend() { return ::wstandend(w); } jpayne@69: // Disable "standout" attributes jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // The next two are virtual, because we redefine them in the jpayne@69: // NCursesPanel class. jpayne@69: // ------------------------------------------------------------------------- jpayne@69: virtual int refresh() { return ::wrefresh(w); } jpayne@69: // Propagate the changes in this window to the virtual screen and call jpayne@69: // doupdate(). This is redefined in NCursesPanel. jpayne@69: jpayne@69: virtual int noutrefresh() { return ::wnoutrefresh(w); } jpayne@69: // Propagate the changes in this window to the virtual screen. This is jpayne@69: // redefined in NCursesPanel. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // multiple window control jpayne@69: // ------------------------------------------------------------------------- jpayne@69: int overlay(NCursesWindow& win) { jpayne@69: return ::overlay(w, win.w); } jpayne@69: // Overlay this window over win. jpayne@69: jpayne@69: int overwrite(NCursesWindow& win) { jpayne@69: return ::overwrite(w, win.w); } jpayne@69: // Overwrite win with this window. jpayne@69: jpayne@69: int copywin(NCursesWindow& win, jpayne@69: int sminrow, int smincol, jpayne@69: int dminrow, int dmincol, jpayne@69: int dmaxrow, int dmaxcol, bool overlaywin=TRUE) { jpayne@69: return ::copywin(w, win.w, sminrow, smincol, dminrow, dmincol, jpayne@69: dmaxrow, dmaxcol, static_cast(overlaywin ? 1 : 0)); } jpayne@69: // Overlay or overwrite the rectangle in win given by dminrow,dmincol, jpayne@69: // dmaxrow,dmaxcol with the rectangle in this window beginning at jpayne@69: // sminrow,smincol. jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // Extended functions jpayne@69: // ------------------------------------------------------------------------- jpayne@69: #if defined(NCURSES_EXT_FUNCS) && (NCURSES_EXT_FUNCS != 0) jpayne@69: int wresize(int newLines, int newColumns) { jpayne@69: return ::wresize(w, newLines, newColumns); } jpayne@69: #endif jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // Mouse related jpayne@69: // ------------------------------------------------------------------------- jpayne@69: bool has_mouse() const; jpayne@69: // Return TRUE if terminal supports a mouse, FALSE otherwise jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // traversal support jpayne@69: // ------------------------------------------------------------------------- jpayne@69: NCursesWindow* child() { return subwins; } jpayne@69: // Get the first child window. jpayne@69: jpayne@69: NCursesWindow* sibling() { return sib; } jpayne@69: // Get the next child of my parent. jpayne@69: jpayne@69: NCursesWindow* parent() { return par; } jpayne@69: // Get my parent. jpayne@69: jpayne@69: bool isDescendant(NCursesWindow& win); jpayne@69: // Return TRUE if win is a descendant of this. jpayne@69: }; jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // We leave this here for compatibility reasons. jpayne@69: // ------------------------------------------------------------------------- jpayne@69: class NCURSES_CXX_IMPEXP NCursesColorWindow : public NCursesWindow jpayne@69: { jpayne@69: public: jpayne@69: explicit NCursesColorWindow(WINDOW* &window) // useful only for stdscr jpayne@69: : NCursesWindow(window) { jpayne@69: useColors(); } jpayne@69: jpayne@69: NCursesColorWindow(int nlines, // number of lines jpayne@69: int ncols, // number of columns jpayne@69: int begin_y, // line origin jpayne@69: int begin_x) // col origin jpayne@69: : NCursesWindow(nlines, ncols, begin_y, begin_x) { jpayne@69: useColors(); } jpayne@69: jpayne@69: NCursesColorWindow(NCursesWindow& parentWin,// parent window jpayne@69: int nlines, // number of lines jpayne@69: int ncols, // number of columns jpayne@69: int begin_y, // absolute or relative jpayne@69: int begin_x, // origins: jpayne@69: char absrel = 'a') // if `a', by & bx are jpayne@69: : NCursesWindow(parentWin, jpayne@69: nlines, ncols, // absolute screen pos, jpayne@69: begin_y, begin_x, // else if `r', they are jpayne@69: absrel ) { // relative to par origin jpayne@69: useColors(); } jpayne@69: }; jpayne@69: jpayne@69: // These enum definitions really belong inside the NCursesPad class, but only jpayne@69: // recent compilers support that feature. jpayne@69: jpayne@69: typedef enum { jpayne@69: REQ_PAD_REFRESH = KEY_MAX + 1, jpayne@69: REQ_PAD_UP, jpayne@69: REQ_PAD_DOWN, jpayne@69: REQ_PAD_LEFT, jpayne@69: REQ_PAD_RIGHT, jpayne@69: REQ_PAD_EXIT jpayne@69: } Pad_Request; jpayne@69: jpayne@69: const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code jpayne@69: const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code jpayne@69: jpayne@69: // ------------------------------------------------------------------------- jpayne@69: // Pad Support. We allow an association of a pad with a "real" window jpayne@69: // through which the pad may be viewed. jpayne@69: // ------------------------------------------------------------------------- jpayne@69: class NCURSES_CXX_IMPEXP NCursesPad : public NCursesWindow jpayne@69: { jpayne@69: private: jpayne@69: NCursesWindow* viewWin; // the "viewport" window jpayne@69: NCursesWindow* viewSub; // the "viewport" subwindow jpayne@69: jpayne@69: int h_gridsize, v_gridsize; jpayne@69: jpayne@69: protected: jpayne@69: int min_row, min_col; // top left row/col of the pads display area jpayne@69: jpayne@69: NCursesWindow* Win(void) const { jpayne@69: // Get the window into which the pad should be copied (if any) jpayne@69: return (viewSub?viewSub:(viewWin?viewWin:0)); jpayne@69: } jpayne@69: jpayne@69: NCursesWindow* getWindow(void) const { jpayne@69: return viewWin; jpayne@69: } jpayne@69: jpayne@69: NCursesWindow* getSubWindow(void) const { jpayne@69: return viewSub; jpayne@69: } jpayne@69: jpayne@69: virtual int driver (int key); // Virtualize keystroke key jpayne@69: // The driver translates the keystroke c into an Pad_Request jpayne@69: jpayne@69: virtual void OnUnknownOperation(int pad_req) { jpayne@69: (void) pad_req; jpayne@69: ::beep(); jpayne@69: } jpayne@69: // This is called if the driver returns an unknown op-code jpayne@69: jpayne@69: virtual void OnNavigationError(int pad_req) { jpayne@69: (void) pad_req; jpayne@69: ::beep(); jpayne@69: } jpayne@69: // This is called if a navigation request couldn't be satisfied jpayne@69: jpayne@69: virtual void OnOperation(int pad_req) { jpayne@69: (void) pad_req; jpayne@69: }; jpayne@69: // OnOperation is called if a Pad_Operation was executed and just before jpayne@69: // the refresh() operation is done. jpayne@69: jpayne@69: public: jpayne@69: NCursesPad(int nlines, int ncols); jpayne@69: // create a pad with the given size jpayne@69: jpayne@69: NCursesPad& operator=(const NCursesPad& rhs) jpayne@69: { jpayne@69: if (this != &rhs) { jpayne@69: *this = rhs; jpayne@69: NCursesWindow::operator=(rhs); jpayne@69: } jpayne@69: return *this; jpayne@69: } jpayne@69: jpayne@69: NCursesPad(const NCursesPad& rhs) jpayne@69: : NCursesWindow(rhs), jpayne@69: viewWin(rhs.viewWin), jpayne@69: viewSub(rhs.viewSub), jpayne@69: h_gridsize(rhs.h_gridsize), jpayne@69: v_gridsize(rhs.v_gridsize), jpayne@69: min_row(rhs.min_row), jpayne@69: min_col(rhs.min_col) jpayne@69: { jpayne@69: } jpayne@69: jpayne@69: virtual ~NCursesPad() THROWS(NCursesException) {} jpayne@69: jpayne@69: int echochar(const chtype ch) { return ::pechochar(w, ch); } jpayne@69: // Put the attributed character onto the pad and immediately do a jpayne@69: // prefresh(). jpayne@69: jpayne@69: int refresh() NCURSES_OVERRIDE; jpayne@69: // If a viewport is defined the pad is displayed in this window, otherwise jpayne@69: // this is a noop. jpayne@69: jpayne@69: int refresh(int pminrow, int pmincol, jpayne@69: int sminrow, int smincol, jpayne@69: int smaxrow, int smaxcol) { jpayne@69: return ::prefresh(w, pminrow, pmincol, jpayne@69: sminrow, smincol, smaxrow, smaxcol); jpayne@69: } jpayne@69: // The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle jpayne@69: // on the screen. refresh copies a rectangle of this size beginning jpayne@69: // with top left corner pminrow,pmincol onto the screen and calls doupdate(). jpayne@69: jpayne@69: int noutrefresh() NCURSES_OVERRIDE; jpayne@69: // If a viewport is defined the pad is displayed in this window, otherwise jpayne@69: // this is a noop. jpayne@69: jpayne@69: int noutrefresh(int pminrow, int pmincol, jpayne@69: int sminrow, int smincol, jpayne@69: int smaxrow, int smaxcol) { jpayne@69: return ::pnoutrefresh(w, pminrow, pmincol, jpayne@69: sminrow, smincol, smaxrow, smaxcol); jpayne@69: } jpayne@69: // Does the same as refresh() but without calling doupdate(). jpayne@69: jpayne@69: virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1); jpayne@69: // Add the window "view" as viewing window to the pad. jpayne@69: jpayne@69: virtual void setSubWindow(NCursesWindow& sub); jpayne@69: // Use the subwindow "sub" of the viewport window for the actual viewing. jpayne@69: // The full viewport window is usually used to provide some decorations jpayne@69: // like frames, titles etc. jpayne@69: jpayne@69: virtual void operator() (void); jpayne@69: // Perform Pad's operation jpayne@69: }; jpayne@69: jpayne@69: // A FramedPad is constructed always with a viewport window. This viewport jpayne@69: // will be framed (by a box() command) and the interior of the box is the jpayne@69: // viewport subwindow. On the frame we display scrollbar sliders. jpayne@69: class NCURSES_CXX_IMPEXP NCursesFramedPad : public NCursesPad jpayne@69: { jpayne@69: protected: jpayne@69: virtual void OnOperation(int pad_req) NCURSES_OVERRIDE; jpayne@69: jpayne@69: public: jpayne@69: NCursesFramedPad(NCursesWindow& win, int nlines, int ncols, jpayne@69: int v_grid = 1, int h_grid = 1) jpayne@69: : NCursesPad(nlines, ncols) { jpayne@69: NCursesPad::setWindow(win, v_grid, h_grid); jpayne@69: NCursesPad::setSubWindow(*(new NCursesWindow(win))); jpayne@69: } jpayne@69: // Construct the FramedPad with the given Window win as viewport. jpayne@69: jpayne@69: virtual ~NCursesFramedPad() THROWS(NCursesException) { jpayne@69: delete getSubWindow(); jpayne@69: } jpayne@69: jpayne@69: void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) NCURSES_OVERRIDE { jpayne@69: (void) view; jpayne@69: (void) v_grid; jpayne@69: (void) h_grid; jpayne@69: err_handler("Operation not allowed"); jpayne@69: } jpayne@69: // Disable this call; the viewport is already defined jpayne@69: jpayne@69: void setSubWindow(NCursesWindow& sub) NCURSES_OVERRIDE { jpayne@69: (void) sub; jpayne@69: err_handler("Operation not allowed"); jpayne@69: } jpayne@69: // Disable this call; the viewport subwindow is already defined jpayne@69: jpayne@69: }; jpayne@69: jpayne@69: #endif /* NCURSES_CURSESW_H_incl */