| cursesw.h | | cursesw.h | |
| // * This makes emacs happy -*-Mode: C++;-*- | | // * This makes emacs happy -*-Mode: C++;-*- | |
| /**************************************************************************
** | | /**************************************************************************
** | |
|
| * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc.
* | | * Copyright (c) 1998-2001,2004 Free Software Foundation, Inc.
* | |
| *
* | | *
* | |
| * Permission is hereby granted, free of charge, to any person obtaining a
* | | * Permission is hereby granted, free of charge, to any person obtaining a
* | |
| * copy of this software and associated documentation files (the
* | | * copy of this software and associated documentation files (the
* | |
| * "Software"), to deal in the Software without restriction, including
* | | * "Software"), to deal in the Software without restriction, including
* | |
| * without limitation the rights to use, copy, modify, merge, publish,
* | | * without limitation the rights to use, copy, modify, merge, publish,
* | |
| * distribute, distribute with modifications, sublicense, and/or sell
* | | * distribute, distribute with modifications, sublicense, and/or sell
* | |
| * copies of the Software, and to permit persons to whom the Software is
* | | * copies of the Software, and to permit persons to whom the Software is
* | |
| * furnished to do so, subject to the following conditions:
* | | * furnished to do so, subject to the following conditions:
* | |
| *
* | | *
* | |
| * The above copyright notice and this permission notice shall be included
* | | * The above copyright notice and this permission notice shall be included
* | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| *
* | | *
* | |
| * Except as contained in this notice, the name(s) of the above copyright
* | | * Except as contained in this notice, the name(s) of the above copyright
* | |
| * holders shall not be used in advertising or otherwise to promote the
* | | * holders shall not be used in advertising or otherwise to promote the
* | |
| * sale, use or other dealings in this Software without prior written
* | | * sale, use or other dealings in this Software without prior written
* | |
| * authorization.
* | | * authorization.
* | |
| **************************************************************************
**/ | | **************************************************************************
**/ | |
| | | | |
| #ifndef NCURSES_CURSESW_H_incl | | #ifndef NCURSES_CURSESW_H_incl | |
| #define NCURSES_CURSESW_H_incl 1 | | #define NCURSES_CURSESW_H_incl 1 | |
| | | | |
|
| // $Id: cursesw.h,v 1.28 2001/07/15 01:17:56 tom Exp $ | | // $Id: cursesw.h,v 1.30 2004/02/08 00:11:54 tom Exp $ | |
| | | | |
| #include <ncurses/etip.h> | | #include <ncurses/etip.h> | |
|
| #include <stdio.h> | | | |
| #include <stdarg.h> | | #include <stdarg.h> | |
|
| | | #include <stdio.h> | |
| | | | |
| #if HAVE_STRSTREAM_H && (USE_STRSTREAM_VSCAN||USE_STRSTREAM_VSCAN_CAST) | | #if HAVE_STRSTREAM_H && (USE_STRSTREAM_VSCAN||USE_STRSTREAM_VSCAN_CAST) | |
| #include <strstream.h> | | #include <strstream.h> | |
| #endif | | #endif | |
| | | | |
| extern "C" { | | extern "C" { | |
| # include <ncurses/curses.h> | | # include <ncurses/curses.h> | |
| } | | } | |
| | | | |
| /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. | | /* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. | |
| | | | |
| skipping to change at line 76 | | skipping to change at line 76 | |
| #define echochar UNDEF(echochar) | | #define echochar UNDEF(echochar) | |
| #endif | | #endif | |
| | | | |
| #ifdef insdelln | | #ifdef insdelln | |
| inline int UNDEF(insdelln)(int n) { return insdelln(n); } | | inline int UNDEF(insdelln)(int n) { return insdelln(n); } | |
| #undef insdelln | | #undef insdelln | |
| #define insdelln UNDEF(insdelln) | | #define insdelln UNDEF(insdelln) | |
| #endif | | #endif | |
| | | | |
| #ifdef addstr | | #ifdef addstr | |
|
| /* The (char*) cast is to hack around missing const's */ | | inline int UNDEF(addstr)(const char * str) { return addstr(str); } | |
| inline int UNDEF(addstr)(const char * str) { return addstr((char*)str); } | | | |
| #undef addstr | | #undef addstr | |
| #define addstr UNDEF(addstr) | | #define addstr UNDEF(addstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef attron | | #ifdef attron | |
| inline int UNDEF(attron)(chtype at) { return attron(at); } | | inline int UNDEF(attron)(chtype at) { return attron(at); } | |
| #undef attron | | #undef attron | |
| #define attron UNDEF(attron) | | #define attron UNDEF(attron) | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 100 | |
| #define attroff UNDEF(attroff) | | #define attroff UNDEF(attroff) | |
| #endif | | #endif | |
| | | | |
| #ifdef attrset | | #ifdef attrset | |
| inline chtype UNDEF(attrset)(chtype at) { return attrset(at); } | | inline chtype UNDEF(attrset)(chtype at) { return attrset(at); } | |
| #undef attrset | | #undef attrset | |
| #define attrset UNDEF(attrset) | | #define attrset UNDEF(attrset) | |
| #endif | | #endif | |
| | | | |
| #ifdef color_set | | #ifdef color_set | |
|
| inline chtype UNDEF(color_set)(short p,void* opts) { return color_set(p,opt
s); } | | inline chtype UNDEF(color_set)(short p, void* opts) { return color_set(p, o
pts); } | |
| #undef color_set | | #undef color_set | |
| #define color_set UNDEF(color_set) | | #define color_set UNDEF(color_set) | |
| #endif | | #endif | |
| | | | |
| #ifdef border | | #ifdef border | |
| inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype
tl, chtype tr, chtype bl, chtype br) | | inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype
tl, chtype tr, chtype bl, chtype br) | |
|
| { return border(ls,rs,ts,bs,tl,tr,bl,br); } | | { return border(ls, rs, ts, bs, tl, tr, bl, br); } | |
| #undef border | | #undef border | |
| #define border UNDEF(border) | | #define border UNDEF(border) | |
| #endif | | #endif | |
| | | | |
| #ifdef box | | #ifdef box | |
| inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); } | | inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); } | |
| #undef box | | #undef box | |
| #define box UNDEF(box) | | #define box UNDEF(box) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwhline | | #ifdef mvwhline | |
|
| inline int UNDEF(mvwhline)(WINDOW *win,int y,int x,chtype c,int n) { | | inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) { | |
| return mvwhline(win,y,x,c,n); } | | return mvwhline(win, y, x, c, n); } | |
| #undef mvwhline | | #undef mvwhline | |
| #define mvwhline UNDEF(mvwhline) | | #define mvwhline UNDEF(mvwhline) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwvline | | #ifdef mvwvline | |
|
| inline int UNDEF(mvwvline)(WINDOW *win,int y,int x,chtype c,int n) { | | inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) { | |
| return mvwvline(win,y,x,c,n); } | | return mvwvline(win, y, x, c, n); } | |
| #undef mvwvline | | #undef mvwvline | |
| #define mvwvline UNDEF(mvwvline) | | #define mvwvline UNDEF(mvwvline) | |
| #endif | | #endif | |
| | | | |
| #ifdef clear | | #ifdef clear | |
| inline int UNDEF(clear)() { return clear(); } | | inline int UNDEF(clear)() { return clear(); } | |
| #undef clear | | #undef clear | |
| #define clear UNDEF(clear) | | #define clear UNDEF(clear) | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 205 | | skipping to change at line 204 | |
| #define getstr UNDEF(getstr) | | #define getstr UNDEF(getstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef instr | | #ifdef instr | |
| inline int UNDEF(instr)(char *_str) { return instr(_str); } | | inline int UNDEF(instr)(char *_str) { return instr(_str); } | |
| #undef instr | | #undef instr | |
| #define instr UNDEF(instr) | | #define instr UNDEF(instr) | |
| #endif | | #endif | |
| | | | |
| #ifdef innstr | | #ifdef innstr | |
|
| inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str,n); } | | inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); } | |
| #undef innstr | | #undef innstr | |
| #define innstr UNDEF(innstr) | | #define innstr UNDEF(innstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwinnstr | | #ifdef mvwinnstr | |
| inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { | | inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { | |
|
| return mvwinnstr(win,y,x,_str,n); } | | return mvwinnstr(win, y, x, _str, n); } | |
| #undef mvwinnstr | | #undef mvwinnstr | |
| #define mvwinnstr UNDEF(mvwinnstr) | | #define mvwinnstr UNDEF(mvwinnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvinnstr | | #ifdef mvinnstr | |
| inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) { | | inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) { | |
|
| return mvinnstr(y,x,_str,n); } | | return mvinnstr(y, x, _str, n); } | |
| #undef mvinnstr | | #undef mvinnstr | |
| #define mvinnstr UNDEF(mvinnstr) | | #define mvinnstr UNDEF(mvinnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef winsstr | | #ifdef winsstr | |
| inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { | | inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { | |
|
| return winsstr(w,_str); } | | return winsstr(w, _str); } | |
| #undef winsstr | | #undef winsstr | |
| #define winsstr UNDEF(winsstr) | | #define winsstr UNDEF(winsstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwinsstr | | #ifdef mvwinsstr | |
| inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) { | | inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) { | |
|
| return mvwinsstr(w,y,x,_str); } | | return mvwinsstr(w, y, x, _str); } | |
| #undef mvwinsstr | | #undef mvwinsstr | |
| #define mvwinsstr UNDEF(mvwinsstr) | | #define mvwinsstr UNDEF(mvwinsstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef insstr | | #ifdef insstr | |
| inline int UNDEF(insstr)(const char *_str) { | | inline int UNDEF(insstr)(const char *_str) { | |
| return insstr(_str); } | | return insstr(_str); } | |
| #undef insstr | | #undef insstr | |
| #define insstr UNDEF(insstr) | | #define insstr UNDEF(insstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvinsstr | | #ifdef mvinsstr | |
|
| inline int UNDEF(mvinsstr)(int y, int x,const char *_str) { | | inline int UNDEF(mvinsstr)(int y, int x, const char *_str) { | |
| return mvinsstr(y,x,_str); } | | return mvinsstr(y, x, _str); } | |
| #undef mvinsstr | | #undef mvinsstr | |
| #define mvinsstr UNDEF(mvinsstr) | | #define mvinsstr UNDEF(mvinsstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef insnstr | | #ifdef insnstr | |
| inline int UNDEF(insnstr)(const char *_str, int n) { | | inline int UNDEF(insnstr)(const char *_str, int n) { | |
|
| return insnstr(_str,n); } | | return insnstr(_str, n); } | |
| #undef insnstr | | #undef insnstr | |
| #define insnstr UNDEF(insnstr) | | #define insnstr UNDEF(insnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwinsnstr | | #ifdef mvwinsnstr | |
|
| inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x,const char *_str, int | | inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int | |
| n) { | | n) { | |
| return mvwinsnstr(w,y,x,_str,n); } | | return mvwinsnstr(w, y, x, _str, n); } | |
| #undef mvwinsnstr | | #undef mvwinsnstr | |
| #define mvwinsnstr UNDEF(mvwinsnstr) | | #define mvwinsnstr UNDEF(mvwinsnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvinsnstr | | #ifdef mvinsnstr | |
|
| inline int UNDEF(mvinsnstr)(int y, int x,const char *_str, int n) { | | inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) { | |
| return mvinsnstr(y,x,_str,n); } | | return mvinsnstr(y, x, _str, n); } | |
| #undef mvinsnstr | | #undef mvinsnstr | |
| #define mvinsnstr UNDEF(mvinsnstr) | | #define mvinsnstr UNDEF(mvinsnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef getnstr | | #ifdef getnstr | |
|
| inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str,n); } | | inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str, n); } | |
| #undef getnstr | | #undef getnstr | |
| #define getnstr UNDEF(getnstr) | | #define getnstr UNDEF(getnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef getyx | | #ifdef getyx | |
| inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { | | inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { | |
| getyx(win, y, x); } | | getyx(win, y, x); } | |
| #undef getyx | | #undef getyx | |
| #define getyx UNDEF(getyx) | | #define getyx UNDEF(getyx) | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 392 | | skipping to change at line 391 | |
| #endif | | #endif | |
| | | | |
| #ifdef standout | | #ifdef standout | |
| inline int UNDEF(standout)() { return standout(); } | | inline int UNDEF(standout)() { return standout(); } | |
| #undef standout | | #undef standout | |
| #define standout UNDEF(standout) | | #define standout UNDEF(standout) | |
| #endif | | #endif | |
| | | | |
| #ifdef subpad | | #ifdef subpad | |
| inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) | | inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) | |
|
| { return derwin(p,l,c,y,x); } | | { return derwin(p, l, c, y, x); } | |
| #undef subpad | | #undef subpad | |
| #define subpad UNDEF(subpad) | | #define subpad UNDEF(subpad) | |
| #endif | | #endif | |
| | | | |
| #ifdef timeout | | #ifdef timeout | |
| inline void UNDEF(timeout)(int delay) { timeout(delay); } | | inline void UNDEF(timeout)(int delay) { timeout(delay); } | |
| #undef timeout | | #undef timeout | |
| #define timeout UNDEF(timeout) | | #define timeout UNDEF(timeout) | |
| #endif | | #endif | |
| | | | |
| #ifdef touchline | | #ifdef touchline | |
| inline int UNDEF(touchline)(WINDOW *win, int s, int c) | | inline int UNDEF(touchline)(WINDOW *win, int s, int c) | |
|
| { return touchline(win,s,c); } | | { return touchline(win, s, c); } | |
| #undef touchline | | #undef touchline | |
| #define touchline UNDEF(touchline) | | #define touchline UNDEF(touchline) | |
| #endif | | #endif | |
| | | | |
| #ifdef touchwin | | #ifdef touchwin | |
| inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); } | | inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); } | |
| #undef touchwin | | #undef touchwin | |
| #define touchwin UNDEF(touchwin) | | #define touchwin UNDEF(touchwin) | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 459 | | skipping to change at line 458 | |
| #define wstandout UNDEF(wstandout) | | #define wstandout UNDEF(wstandout) | |
| #endif | | #endif | |
| | | | |
| #ifdef wattroff | | #ifdef wattroff | |
| inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att
); } | | inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att
); } | |
| #undef wattroff | | #undef wattroff | |
| #define wattroff UNDEF(wattroff) | | #define wattroff UNDEF(wattroff) | |
| #endif | | #endif | |
| | | | |
| #ifdef chgat | | #ifdef chgat | |
|
| inline int UNDEF(chgat)(int n,attr_t attr, short color, const void *opts) { | | inline int UNDEF(chgat)(int n, attr_t attr, short color, const void *opts) | |
| return chgat(n,attr,color,opts); } | | { | |
| | | return chgat(n, attr, color, opts); } | |
| #undef chgat | | #undef chgat | |
| #define chgat UNDEF(chgat) | | #define chgat UNDEF(chgat) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvchgat | | #ifdef mvchgat | |
| inline int UNDEF(mvchgat)(int y, int x, int n, | | inline int UNDEF(mvchgat)(int y, int x, int n, | |
| attr_t attr, short color, const void *opts) { | | attr_t attr, short color, const void *opts) { | |
|
| return mvchgat(y,x,n,attr,color,opts); } | | return mvchgat(y, x, n, attr, color, opts); } | |
| #undef mvchgat | | #undef mvchgat | |
| #define mvchgat UNDEF(mvchgat) | | #define mvchgat UNDEF(mvchgat) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwchgat | | #ifdef mvwchgat | |
| inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, | | inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, | |
| attr_t attr, short color, const void *opts) { | | attr_t attr, short color, const void *opts) { | |
|
| return mvwchgat(win,y,x,n,attr,color,opts); } | | return mvwchgat(win, y, x, n, attr, color, opts); } | |
| #undef mvwchgat | | #undef mvwchgat | |
| #define mvwchgat UNDEF(mvwchgat) | | #define mvwchgat UNDEF(mvwchgat) | |
| #endif | | #endif | |
| | | | |
| #ifdef wattrset | | #ifdef wattrset | |
| inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att
); } | | inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att
); } | |
| #undef wattrset | | #undef wattrset | |
| #define wattrset UNDEF(wattrset) | | #define wattrset UNDEF(wattrset) | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 516 | | skipping to change at line 515 | |
| | | | |
| #ifdef mvwaddchstr | | #ifdef mvwaddchstr | |
| inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, chtype *str) | | inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, chtype *str) | |
| { return mvwaddchstr(win, y, x, str); } | | { return mvwaddchstr(win, y, x, str); } | |
| #undef mvwaddchstr | | #undef mvwaddchstr | |
| #define mvwaddchstr UNDEF(mvwaddchstr) | | #define mvwaddchstr UNDEF(mvwaddchstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef addnstr | | #ifdef addnstr | |
| inline int UNDEF(addnstr)(const char *str, int n) | | inline int UNDEF(addnstr)(const char *str, int n) | |
|
| { return addnstr((char*)str, n); } | | { return addnstr(str, n); } | |
| #undef addnstr | | #undef addnstr | |
| #define addnstr UNDEF(addnstr) | | #define addnstr UNDEF(addnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwaddnstr | | #ifdef mvwaddnstr | |
| inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, in
t n) | | inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, in
t n) | |
|
| { return mvwaddnstr(win, y, x, (char*)str, n); } | | { return mvwaddnstr(win, y, x, str, n); } | |
| #undef mvwaddnstr | | #undef mvwaddnstr | |
| #define mvwaddnstr UNDEF(mvwaddnstr) | | #define mvwaddnstr UNDEF(mvwaddnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwaddstr | | #ifdef mvwaddstr | |
| inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str) | | inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str) | |
|
| { return mvwaddstr(win, y, x, (char*)str); } | | { return mvwaddstr(win, y, x, str); } | |
| #undef mvwaddstr | | #undef mvwaddstr | |
| #define mvwaddstr UNDEF(mvwaddstr) | | #define mvwaddstr UNDEF(mvwaddstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwdelch | | #ifdef mvwdelch | |
| inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x) | | inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x) | |
| { return mvwdelch(win, y, x); } | | { return mvwdelch(win, y, x); } | |
| #undef mvwdelch | | #undef mvwdelch | |
| #define mvwdelch UNDEF(mvwdelch) | | #define mvwdelch UNDEF(mvwdelch) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwgetch | | #ifdef mvwgetch | |
| inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win
, y, x);} | | inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win
, y, x);} | |
| #undef mvwgetch | | #undef mvwgetch | |
| #define mvwgetch UNDEF(mvwgetch) | | #define mvwgetch UNDEF(mvwgetch) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwgetstr | | #ifdef mvwgetstr | |
| inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str) | | inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str) | |
|
| {return mvwgetstr(win,y,x, str);} | | {return mvwgetstr(win, y, x, str);} | |
| #undef mvwgetstr | | #undef mvwgetstr | |
| #define mvwgetstr UNDEF(mvwgetstr) | | #define mvwgetstr UNDEF(mvwgetstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwgetnstr | | #ifdef mvwgetnstr | |
| inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) | | inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) | |
|
| {return mvwgetnstr(win,y,x, str,n);} | | {return mvwgetnstr(win, y, x, str, n);} | |
| #undef mvwgetnstr | | #undef mvwgetnstr | |
| #define mvwgetnstr UNDEF(mvwgetnstr) | | #define mvwgetnstr UNDEF(mvwgetnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvwinch | | #ifdef mvwinch | |
| inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { | | inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { | |
| return mvwinch(win, y, x);} | | return mvwinch(win, y, x);} | |
| #undef mvwinch | | #undef mvwinch | |
| #define mvwinch UNDEF(mvwinch) | | #define mvwinch UNDEF(mvwinch) | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 585 | | skipping to change at line 584 | |
| | | | |
| #ifdef mvaddch | | #ifdef mvaddch | |
| inline int UNDEF(mvaddch)(int y, int x, chtype ch) | | inline int UNDEF(mvaddch)(int y, int x, chtype ch) | |
| { return mvaddch(y, x, ch); } | | { return mvaddch(y, x, ch); } | |
| #undef mvaddch | | #undef mvaddch | |
| #define mvaddch UNDEF(mvaddch) | | #define mvaddch UNDEF(mvaddch) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvaddnstr | | #ifdef mvaddnstr | |
| inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n) | | inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n) | |
|
| { return mvaddnstr(y, x, (char*)str, n); } | | { return mvaddnstr(y, x, str, n); } | |
| #undef mvaddnstr | | #undef mvaddnstr | |
| #define mvaddnstr UNDEF(mvaddnstr) | | #define mvaddnstr UNDEF(mvaddnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvaddstr | | #ifdef mvaddstr | |
| inline int UNDEF(mvaddstr)(int y, int x, const char * str) | | inline int UNDEF(mvaddstr)(int y, int x, const char * str) | |
|
| { return mvaddstr(y, x, (char*)str); } | | { return mvaddstr(y, x, str); } | |
| #undef mvaddstr | | #undef mvaddstr | |
| #define mvaddstr UNDEF(mvaddstr) | | #define mvaddstr UNDEF(mvaddstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvdelch | | #ifdef mvdelch | |
| inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);} | | inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);} | |
| #undef mvdelch | | #undef mvdelch | |
| #define mvdelch UNDEF(mvdelch) | | #define mvdelch UNDEF(mvdelch) | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 617 | | skipping to change at line 616 | |
| #endif | | #endif | |
| | | | |
| #ifdef mvgetstr | | #ifdef mvgetstr | |
| inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x,
str);} | | inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x,
str);} | |
| #undef mvgetstr | | #undef mvgetstr | |
| #define mvgetstr UNDEF(mvgetstr) | | #define mvgetstr UNDEF(mvgetstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvgetnstr | | #ifdef mvgetnstr | |
| inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) { | | inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) { | |
|
| return mvgetnstr(y, x, str,n);} | | return mvgetnstr(y, x, str, n);} | |
| #undef mvgetnstr | | #undef mvgetnstr | |
| #define mvgetnstr UNDEF(mvgetnstr) | | #define mvgetnstr UNDEF(mvgetnstr) | |
| #endif | | #endif | |
| | | | |
| #ifdef mvinch | | #ifdef mvinch | |
| inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} | | inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} | |
| #undef mvinch | | #undef mvinch | |
| #define mvinch UNDEF(mvinch) | | #define mvinch UNDEF(mvinch) | |
| #endif | | #endif | |
| | | | |
| | | | |
| skipping to change at line 704 | | skipping to change at line 703 | |
| */ | | */ | |
| | | | |
| class NCURSES_IMPEXP NCursesWindow | | class NCURSES_IMPEXP NCursesWindow | |
| { | | { | |
| friend class NCursesMenu; | | friend class NCursesMenu; | |
| friend class NCursesForm; | | friend class NCursesForm; | |
| | | | |
| private: | | private: | |
| static bool b_initialized; | | static bool b_initialized; | |
| static void initialize(); | | static void initialize(); | |
|
| static int ripoff_init(WINDOW *,int); | | static int ripoff_init(WINDOW *, int); | |
| | | | |
| void init(); | | void init(); | |
| | | | |
| short getcolor(int getback) const; | | short getcolor(int getback) const; | |
| | | | |
| static int setpalette(short fore, short back, short pair); | | static int setpalette(short fore, short back, short pair); | |
| static int colorInitialized; | | static int colorInitialized; | |
| | | | |
| // This private constructor is only used during the initialization | | // This private constructor is only used during the initialization | |
| // of windows generated by ripoffline() calls. | | // of windows generated by ripoffline() calls. | |
| | | | |
| skipping to change at line 841 | | skipping to change at line 840 | |
| int setpalette(short fore, short back); | | int setpalette(short fore, short back); | |
| // Set color palette entry | | // Set color palette entry | |
| | | | |
| int setcolor(short pair); | | int setcolor(short pair); | |
| // Set actually used palette entry | | // Set actually used palette entry | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| // window positioning | | // window positioning | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| virtual int mvwin(int begin_y, int begin_x) { | | virtual int mvwin(int begin_y, int begin_x) { | |
|
| return ::mvwin(w,begin_y,begin_x); } | | return ::mvwin(w, begin_y, begin_x); } | |
| // Move window to new position with the new position as top left corner. | | // Move window to new position with the new position as top left corner. | |
| // This is virtual because it is redefined in NCursesPanel. | | // This is virtual because it is redefined in NCursesPanel. | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| // coordinate positioning | | // coordinate positioning | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| int move(int y, int x) { return ::wmove(w, y, x); } | | int move(int y, int x) { return ::wmove(w, y, x); } | |
| // Move cursor the this position | | // Move cursor the this position | |
| | | | |
| void getyx(int& y, int& x) const { ::getyx(w, y, x); } | | void getyx(int& y, int& x) const { ::getyx(w, y, x); } | |
| | | | |
| skipping to change at line 864 | | skipping to change at line 863 | |
| int mvcur(int oldrow, int oldcol, int newrow, int newcol) cons
t { | | int mvcur(int oldrow, int oldcol, int newrow, int newcol) cons
t { | |
| return ::mvcur(oldrow, oldcol, newrow, newcol); } | | return ::mvcur(oldrow, oldcol, newrow, newcol); } | |
| // Perform lowlevel cursor motion that takes effect immediately. | | // Perform lowlevel cursor motion that takes effect immediately. | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| // input | | // input | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| int getch() { return ::wgetch(w); } | | int getch() { return ::wgetch(w); } | |
| // Get a keystroke from the window. | | // Get a keystroke from the window. | |
| | | | |
|
| int getch(int y, int x) { return ::mvwgetch(w,y,x); } | | int getch(int y, int x) { return ::mvwgetch(w, y, x); } | |
| // Move cursor to position and get a keystroke from the window | | // Move cursor to position and get a keystroke from the window | |
| | | | |
| int getstr(char* str, int n=-1) { | | int getstr(char* str, int n=-1) { | |
|
| return ::wgetnstr(w, str,n); } | | return ::wgetnstr(w, str, n); } | |
| // Read a series of characters into str until a newline or carriage retur
n | | // Read a series of characters into str until a newline or carriage retur
n | |
| // is received. Read at most n characters. If n is negative, the limit is | | // is received. Read at most n characters. If n is negative, the limit is | |
| // ignored. | | // ignored. | |
| | | | |
| int getstr(int y, int x, char* str, int n=-1) { | | int getstr(int y, int x, char* str, int n=-1) { | |
|
| return ::mvwgetnstr(w,y,x,str,n); } | | return ::mvwgetnstr(w, y, x, str, n); } | |
| // Move the cursor to the requested position and then perform the getstr(
) | | // Move the cursor to the requested position and then perform the getstr(
) | |
| // as described above. | | // as described above. | |
| | | | |
|
| int instr(char *s, int n=-1) { return ::winnstr(w,s,n); } | | int instr(char *s, int n=-1) { return ::winnstr(w, s, n); } | |
| // Get a string of characters from the window into the buffer s. Retrieve | | // Get a string of characters from the window into the buffer s. Retrieve | |
| // at most n characters, if n is negative retrieve all characters up to t
he | | // at most n characters, if n is negative retrieve all characters up to t
he | |
| // end of the current line. Attributes are stripped from the characters. | | // end of the current line. Attributes are stripped from the characters. | |
| | | | |
| int instr(int y, int x, char *s, int n=-1) { | | int instr(int y, int x, char *s, int n=-1) { | |
|
| return ::mvwinnstr(w,y,x,s,n); } | | return ::mvwinnstr(w, y, x, s, n); } | |
| // Move the cursor to the requested position and then perform the instr() | | // Move the cursor to the requested position and then perform the instr() | |
| // as described above. | | // as described above. | |
| | | | |
| int scanw(const char* fmt, ...) | | int scanw(const char* fmt, ...) | |
| // Perform a scanw function from the window. | | // Perform a scanw function from the window. | |
| #if __GNUG__ >= 2 | | #if __GNUG__ >= 2 | |
| __attribute__ ((format (scanf, 2, 3))); | | __attribute__ ((format (scanf, 2, 3))); | |
| #else | | #else | |
| ; | | ; | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 912 | | skipping to change at line 911 | |
| ; | | ; | |
| #endif | | #endif | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| // output | | // output | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| int addch(const chtype ch) { return ::waddch(w, ch); } | | int addch(const chtype ch) { return ::waddch(w, ch); } | |
| // Put attributed character to the window. | | // Put attributed character to the window. | |
| | | | |
| int addch(int y, int x, const chtype ch) { | | int addch(int y, int x, const chtype ch) { | |
|
| return ::mvwaddch(w,y,x,ch); } | | return ::mvwaddch(w, y, x, ch); } | |
| // Move cursor to the requested position and then put attributed characte
r | | // Move cursor to the requested position and then put attributed characte
r | |
| // to the window. | | // to the window. | |
| | | | |
|
| int echochar(const chtype ch) { return ::wechochar(w,ch); } | | int echochar(const chtype ch) { return ::wechochar(w, ch); } | |
| // Put attributed character to the window and refresh it immediately. | | // Put attributed character to the window and refresh it immediately. | |
| | | | |
| int addstr(const char* str, int n=-1) { | | int addstr(const char* str, int n=-1) { | |
|
| return ::waddnstr(w, (char*)str,n); } | | return ::waddnstr(w, str, n); } | |
| // Write the string str to the window, stop writing if the terminating | | // 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. | | // NUL or the limit n is reached. If n is negative, it is ignored. | |
| | | | |
| int addstr(int y, int x, const char * str, int n=-1) { | | int addstr(int y, int x, const char * str, int n=-1) { | |
|
| return ::mvwaddnstr(w,y,x,(char*)str,n); } | | 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 addstr | |
| // as described above. | | // as described above. | |
| | | | |
| int printw(const char* fmt, ...) | | int printw(const char* fmt, ...) | |
| // Do a formatted print to the window. | | // Do a formatted print to the window. | |
| #if (__GNUG__ >= 2) && !defined(printf) | | #if (__GNUG__ >= 2) && !defined(printf) | |
| __attribute__ ((format (printf, 2, 3))); | | __attribute__ ((format (printf, 2, 3))); | |
| #else | | #else | |
| ; | | ; | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 948 | | skipping to change at line 947 | |
| // Move the cursor and then do a formatted print to the window. | | // Move the cursor and then do a formatted print to the window. | |
| #if (__GNUG__ >= 2) && !defined(printf) | | #if (__GNUG__ >= 2) && !defined(printf) | |
| __attribute__ ((format (printf, 4, 5))); | | __attribute__ ((format (printf, 4, 5))); | |
| #else | | #else | |
| ; | | ; | |
| #endif | | #endif | |
| | | | |
| chtype inch() const { return ::winch(w); } | | chtype inch() const { return ::winch(w); } | |
| // Retrieve attributed character under the current cursor position. | | // Retrieve attributed character under the current cursor position. | |
| | | | |
|
| chtype inch(int y, int x) { return ::mvwinch(w,y,x); } | | chtype inch(int y, int x) { return ::mvwinch(w, y, x); } | |
| // Move cursor to requested position and then retrieve attributed charact
er | | // Move cursor to requested position and then retrieve attributed charact
er | |
| // at this position. | | // at this position. | |
| | | | |
| int insch(chtype ch) { return ::winsch(w, ch); } | | int insch(chtype ch) { return ::winsch(w, ch); } | |
| // Insert attributed character into the window before current cursor | | // Insert attributed character into the window before current cursor | |
| // position. | | // position. | |
| | | | |
| int insch(int y, int x, chtype ch) { | | int insch(int y, int x, chtype ch) { | |
|
| return ::mvwinsch(w,y,x,(char)ch); } | | return ::mvwinsch(w, y, x, ch); } | |
| // Move cursor to requested position and then insert the attributed | | // Move cursor to requested position and then insert the attributed | |
| // character before that position. | | // character before that position. | |
| | | | |
|
| int insertln() { return ::winsdelln(w,1); } | | int insertln() { return ::winsdelln(w, 1); } | |
| // Insert an empty line above the current line. | | // Insert an empty line above the current line. | |
| | | | |
|
| int insdelln(int n=1) { return ::winsdelln(w,n); } | | int insdelln(int n=1) { return ::winsdelln(w, n); } | |
| // If n>0 insert that many lines above the current line. If n<0 delete | | // If n>0 insert that many lines above the current line. If n<0 delete | |
| // that many lines beginning with the current line. | | // that many lines beginning with the current line. | |
| | | | |
| int insstr(const char *s, int n=-1) { | | int insstr(const char *s, int n=-1) { | |
|
| return ::winsnstr(w,s,n); } | | return ::winsnstr(w, s, n); } | |
| // Insert the string into the window before the current cursor position. | | // Insert the string into the window before the current cursor position. | |
| // Insert stops at end of string or when the limit n is reached. If n is | | // Insert stops at end of string or when the limit n is reached. If n is | |
| // negative, it is ignored. | | // negative, it is ignored. | |
| | | | |
| int insstr(int y, int x, const char *s, int n=-1) { | | int insstr(int y, int x, const char *s, int n=-1) { | |
|
| return ::mvwinsnstr(w,y,x,s,n); } | | return ::mvwinsnstr(w, y, x, s, n); } | |
| // Move the cursor to the requested position and then perform the insstr(
) | | // Move the cursor to the requested position and then perform the insstr(
) | |
| // as described above. | | // as described above. | |
| | | | |
| int attron (chtype at) { return ::wattron (w, at); } | | int attron (chtype at) { return ::wattron (w, at); } | |
| // Switch on the window attributes; | | // Switch on the window attributes; | |
| | | | |
| int attroff(chtype at) { return ::wattroff(w, (int) at); } | | int attroff(chtype at) { return ::wattroff(w, (int) at); } | |
| // Switch off the window attributes; | | // Switch off the window attributes; | |
| | | | |
| int attrset(chtype at) { return ::wattrset(w, (int) at); } | | int attrset(chtype at) { return ::wattrset(w, (int) at); } | |
| // Set the window attributes; | | // Set the window attributes; | |
| | | | |
| int color_set(short color_pair_number, void* opts=NULL) { | | int color_set(short color_pair_number, void* opts=NULL) { | |
| return ::wcolor_set(w, color_pair_number, opts); } | | return ::wcolor_set(w, color_pair_number, opts); } | |
| // Set the window color attribute; | | // Set the window color attribute; | |
| | | | |
|
| int chgat(int n,attr_t attr, short color, const void *opts=NUL | | int chgat(int n, attr_t attr, short color, const void *opts=NU | |
| L) { | | LL) { | |
| return ::wchgat(w,n,attr,color,opts); } | | return ::wchgat(w, n, attr, color, opts); } | |
| // Change the attributes of the next n characters in the current line. If | | // 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 th
e | | // n is negative or greater than the number of remaining characters in th
e | |
| // line, the attributes will be changed up to the end of the line. | | // line, the attributes will be changed up to the end of the line. | |
| | | | |
| int chgat(int y, int x, | | int chgat(int y, int x, | |
|
| int n,attr_t attr, short color, const void *opts=NULL | | int n, attr_t attr, short color, const void *opts=NUL | |
| ) { | | L) { | |
| return ::mvwchgat(w,y,x,n,attr,color,opts); } | | return ::mvwchgat(w, y, x, n, attr, color, opts); } | |
| // Move the cursor to the requested position and then perform chgat() as | | // Move the cursor to the requested position and then perform chgat() as | |
| // described above. | | // described above. | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| // background | | // background | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| chtype getbkgd() const { return ::getbkgd(w); } | | chtype getbkgd() const { return ::getbkgd(w); } | |
| // Get current background setting. | | // Get current background setting. | |
| | | | |
|
| int bkgd(const chtype ch) { return ::wbkgd(w,ch); } | | int bkgd(const chtype ch) { return ::wbkgd(w, ch); } | |
| // Set the background property and apply it to the window. | | // Set the background property and apply it to the window. | |
| | | | |
|
| void bkgdset(chtype ch) { ::wbkgdset(w,ch); } | | void bkgdset(chtype ch) { ::wbkgdset(w, ch); } | |
| // Set the background property. | | // Set the background property. | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| // borders | | // borders | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| int box(chtype vert=0, chtype hor=0) { | | int box(chtype vert=0, chtype hor=0) { | |
|
| return ::wborder(w, vert, vert, hor, hor, 0, 0 ,0, 0); } | | return ::wborder(w, vert, vert, hor, hor, 0, 0, 0, 0); } | |
| // Draw a box around the window with the given vertical and horizontal | | // Draw a box around the window with the given vertical and horizontal | |
| // drawing characters. If you specify a zero as character, curses will tr
y | | // drawing characters. If you specify a zero as character, curses will tr
y | |
| // to find a "nice" character. | | // to find a "nice" character. | |
| | | | |
| int border(chtype left=0, chtype right=0, | | int border(chtype left=0, chtype right=0, | |
| chtype top =0, chtype bottom=0, | | chtype top =0, chtype bottom=0, | |
| chtype top_left =0, chtype top_right=0, | | chtype top_left =0, chtype top_right=0, | |
| chtype bottom_left =0, chtype bottom_right=0) { | | chtype bottom_left =0, chtype bottom_right=0) { | |
|
| return ::wborder(w,left,right,top,bottom,top_left,top_right, | | return ::wborder(w, left, right, top, bottom, top_left, top_right, | |
| bottom_left,bottom_right); } | | bottom_left, bottom_right); } | |
| // Draw a border around the window with the given characters for the | | // Draw a border around the window with the given characters for the | |
| // various parts of the border. If you pass zero for a character, curses | | // various parts of the border. If you pass zero for a character, curses | |
| // will try to find "nice" characters. | | // will try to find "nice" characters. | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| // lines and boxes | | // lines and boxes | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| int hline(int len, chtype ch=0) { return ::whline(w, ch, len);
} | | int hline(int len, chtype ch=0) { return ::whline(w, ch, len);
} | |
| // Draw a horizontal line of len characters with the given character. If | | // Draw a horizontal line of len characters with the given character. If | |
| // you pass zero for the character, curses will try to find a "nice" one. | | // you pass zero for the character, curses will try to find a "nice" one. | |
| | | | |
| int hline(int y, int x, int len, chtype ch=0) { | | int hline(int y, int x, int len, chtype ch=0) { | |
|
| return ::mvwhline(w,y,x,ch,len); } | | return ::mvwhline(w, y, x, ch, len); } | |
| // Move the cursor to the requested position and then draw a horizontal l
ine. | | // Move the cursor to the requested position and then draw a horizontal l
ine. | |
| | | | |
| int vline(int len, chtype ch=0) { return ::wvline(w, ch, len);
} | | int vline(int len, chtype ch=0) { return ::wvline(w, ch, len);
} | |
| // Draw a vertical line of len characters with the given character. If | | // Draw a vertical line of len characters with the given character. If | |
| // you pass zero for the character, curses will try to find a "nice" one. | | // you pass zero for the character, curses will try to find a "nice" one. | |
| | | | |
| int vline(int y, int x, int len, chtype ch=0) { | | int vline(int y, int x, int len, chtype ch=0) { | |
|
| return ::mvwvline(w,y,x,ch,len); } | | return ::mvwvline(w, y, x, ch, len); } | |
| // Move the cursor to the requested position and then draw a vertical lin
e. | | // Move the cursor to the requested position and then draw a vertical lin
e. | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| // erasure | | // erasure | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| int erase() { return ::werase(w); } | | int erase() { return ::werase(w); } | |
| // Erase the window. | | // Erase the window. | |
| | | | |
| int clear() { return ::wclear(w); } | | int clear() { return ::wclear(w); } | |
| // Clear the window. | | // Clear the window. | |
| | | | |
| skipping to change at line 1076 | | skipping to change at line 1075 | |
| | | | |
| int clrtobot() { return ::wclrtobot(w); } | | int clrtobot() { return ::wclrtobot(w); } | |
| // Clear to the end of the window. | | // Clear to the end of the window. | |
| | | | |
| int clrtoeol() { return ::wclrtoeol(w); } | | int clrtoeol() { return ::wclrtoeol(w); } | |
| // Clear to the end of the line. | | // Clear to the end of the line. | |
| | | | |
| int delch() { return ::wdelch(w); } | | int delch() { return ::wdelch(w); } | |
| // Delete character under the cursor. | | // Delete character under the cursor. | |
| | | | |
|
| int delch(int y, int x) { return ::mvwdelch(w,y,x); } | | int delch(int y, int x) { return ::mvwdelch(w, y, x); } | |
| // Move cursor to requested position and delete the character under the | | // Move cursor to requested position and delete the character under the | |
| // cursor. | | // cursor. | |
| | | | |
|
| int deleteln() { return ::winsdelln(w,-1); } | | int deleteln() { return ::winsdelln(w, -1); } | |
| // Delete the current line. | | // Delete the current line. | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| // screen control | | // screen control | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
|
| int scroll(int amount=1) { return ::wscrl(w,amount); } | | int scroll(int amount=1) { return ::wscrl(w, amount); } | |
| // Scroll amount lines. If amount is positive, scroll up, otherwise | | // Scroll amount lines. If amount is positive, scroll up, otherwise | |
| // scroll down. | | // scroll down. | |
| | | | |
| int scrollok(bool bf) { return ::scrollok(w, bf); } | | int scrollok(bool bf) { return ::scrollok(w, bf); } | |
| // If bf is TRUE, window scrolls if cursor is moved off the bottom | | // If bf is TRUE, window scrolls if cursor is moved off the bottom | |
| // edge of the window or a scrolling region, otherwise the cursor is left | | // edge of the window or a scrolling region, otherwise the cursor is left | |
| // at the bottom line. | | // at the bottom line. | |
| | | | |
| int setscrreg(int from, int to) { | | int setscrreg(int from, int to) { | |
|
| return ::wsetscrreg(w,from,to); } | | return ::wsetscrreg(w, from, to); } | |
| // Define a soft scrolling region. | | // Define a soft scrolling region. | |
| | | | |
| int idlok(bool bf) { return ::idlok(w, bf); } | | int idlok(bool bf) { return ::idlok(w, bf); } | |
| // If bf is TRUE, use insert/delete line hardware support if possible. | | // If bf is TRUE, use insert/delete line hardware support if possible. | |
| // Otherwise do it in software. | | // Otherwise do it in software. | |
| | | | |
| void idcok(bool bf) { ::idcok(w, bf); } | | void idcok(bool bf) { ::idcok(w, bf); } | |
| // If bf is TRUE, use insert/delete character hardware support if possibl
e. | | // If bf is TRUE, use insert/delete character hardware support if possibl
e. | |
| // Otherwise do it in software. | | // Otherwise do it in software. | |
| | | | |
|
| int touchwin() { return ::wtouchln(w,0,height(),1); } | | int touchwin() { return ::wtouchln(w, 0, height(), 1); } | |
| // Mark the whole window as modified. | | // Mark the whole window as modified. | |
| | | | |
|
| int untouchwin() { return ::wtouchln(w,0,height(),0); } | | int untouchwin() { return ::wtouchln(w, 0, height(), 0); } | |
| // Mark the whole window as unmodified. | | // Mark the whole window as unmodified. | |
| | | | |
| int touchln(int s, int cnt, bool changed=TRUE) { | | int touchln(int s, int cnt, bool changed=TRUE) { | |
|
| return ::wtouchln(w,s,cnt,(int)(changed?1:0)); } | | return ::wtouchln(w, s, cnt, (int)(changed?1:0)); } | |
| // Mark cnt lines beginning from line s as changed or unchanged, dependin
g | | // Mark cnt lines beginning from line s as changed or unchanged, dependin
g | |
| // on the value of the changed flag. | | // on the value of the changed flag. | |
| | | | |
| bool is_linetouched(int line) const { | | bool is_linetouched(int line) const { | |
|
| return (::is_linetouched(w,line) ? TRUE:FALSE); } | | return (::is_linetouched(w, line) ? TRUE:FALSE); } | |
| // Return TRUE if line is marked as changed, FALSE otherwise | | // Return TRUE if line is marked as changed, FALSE otherwise | |
| | | | |
| bool is_wintouched() const { | | bool is_wintouched() const { | |
| return (::is_wintouched(w) ? TRUE:FALSE); } | | return (::is_wintouched(w) ? TRUE:FALSE); } | |
| // Return TRUE if window is marked as changed, FALSE otherwise | | // Return TRUE if window is marked as changed, FALSE otherwise | |
| | | | |
| int leaveok(bool bf) { return ::leaveok(w, bf); } | | int leaveok(bool bf) { return ::leaveok(w, bf); } | |
| // If bf is TRUE, curses will leave the cursor after an update whereever | | // If bf is TRUE, curses will leave the cursor after an update whereever | |
| // it is after the update. | | // it is after the update. | |
| | | | |
|
| int redrawln(int from, int n) { return ::wredrawln(w,from,n);
} | | int redrawln(int from, int n) { return ::wredrawln(w, from, n)
; } | |
| // Redraw n lines starting from the requested line | | // Redraw n lines starting from the requested line | |
| | | | |
|
| int redrawwin() { return ::wredrawln(w,0,height()); } | | int redrawwin() { return ::wredrawln(w, 0, height()); } | |
| // Redraw the whole window | | // Redraw the whole window | |
| | | | |
| int doupdate() { return ::doupdate(); } | | int doupdate() { return ::doupdate(); } | |
| // Do all outputs to make the physical screen looking like the virtual on
e | | // Do all outputs to make the physical screen looking like the virtual on
e | |
| | | | |
| void syncdown() { ::wsyncdown(w); } | | void syncdown() { ::wsyncdown(w); } | |
| // Propagate the changes down to all descendant windows | | // Propagate the changes down to all descendant windows | |
| | | | |
| void syncup() { ::wsyncup(w); } | | void syncup() { ::wsyncup(w); } | |
| // Propagate the changes up in the hierarchy | | // Propagate the changes up in the hierarchy | |
| | | | |
| void cursyncup() { ::wcursyncup(w); } | | void cursyncup() { ::wcursyncup(w); } | |
| // Position the cursor in all ancestor windows corresponding to our setti
ng | | // Position the cursor in all ancestor windows corresponding to our setti
ng | |
| | | | |
|
| int syncok(bool bf) { return ::syncok(w,bf); } | | int syncok(bool bf) { return ::syncok(w, bf); } | |
| // If called with bf=TRUE, syncup() is called whenever the window is chan
ged | | // If called with bf=TRUE, syncup() is called whenever the window is chan
ged | |
| | | | |
| #ifndef _no_flushok | | #ifndef _no_flushok | |
| int flushok(bool bf) { return ::flushok(w, bf); } | | int flushok(bool bf) { return ::flushok(w, bf); } | |
| #endif | | #endif | |
| | | | |
|
| void immedok(bool bf) { ::immedok(w,bf); } | | void immedok(bool bf) { ::immedok(w, bf); } | |
| // If called with bf=TRUE, any change in the window will cause an | | // If called with bf=TRUE, any change in the window will cause an | |
| // automatic immediate refresh() | | // automatic immediate refresh() | |
| | | | |
| int keypad(bool bf) { return ::keypad(w, bf); } | | int keypad(bool bf) { return ::keypad(w, bf); } | |
| // If called with bf=TRUE, the application will interpret function keys. | | // If called with bf=TRUE, the application will interpret function keys. | |
| | | | |
|
| int meta(bool bf) { return ::meta(w,bf); } | | int meta(bool bf) { return ::meta(w, bf); } | |
| // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise | | // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise | |
| // 7-Bit characters are generated. | | // 7-Bit characters are generated. | |
| | | | |
| int standout() { return ::wstandout(w); } | | int standout() { return ::wstandout(w); } | |
| // Enable "standout" attributes | | // Enable "standout" attributes | |
| | | | |
| int standend() { return ::wstandend(w); } | | int standend() { return ::wstandend(w); } | |
| // Disable "standout" attributes | | // Disable "standout" attributes | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| | | | |
| skipping to change at line 1199 | | skipping to change at line 1198 | |
| // Overlay this window over win. | | // Overlay this window over win. | |
| | | | |
| int overwrite(NCursesWindow& win) { | | int overwrite(NCursesWindow& win) { | |
| return ::overwrite(w, win.w); } | | return ::overwrite(w, win.w); } | |
| // Overwrite win with this window. | | // Overwrite win with this window. | |
| | | | |
| int copywin(NCursesWindow& win, | | int copywin(NCursesWindow& win, | |
| int sminrow, int smincol, | | int sminrow, int smincol, | |
| int dminrow, int dmincol, | | int dminrow, int dmincol, | |
| int dmaxrow, int dmaxcol, bool overlay=TRUE) { | | int dmaxrow, int dmaxcol, bool overlay=TRUE) { | |
|
| return ::copywin(w,win.w,sminrow,smincol,dminrow,dmincol, | | return ::copywin(w, win.w, sminrow, smincol, dminrow, dmincol, | |
| dmaxrow,dmaxcol,(int)(overlay?1:0)); } | | dmaxrow, dmaxcol, (int)(overlay?1:0)); } | |
| // Overlay or overwrite the rectangle in win given by dminrow,dmincol, | | // Overlay or overwrite the rectangle in win given by dminrow,dmincol, | |
| // dmaxrow,dmaxcol with the rectangle in this window beginning at | | // dmaxrow,dmaxcol with the rectangle in this window beginning at | |
| // sminrow,smincol. | | // sminrow,smincol. | |
| | | | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| // Mouse related | | // Mouse related | |
| // ----------------------------------------------------------------------
--- | | // ----------------------------------------------------------------------
--- | |
| bool has_mouse() const; | | bool has_mouse() const; | |
| // Return TRUE if terminal supports a mouse, FALSE otherwise | | // Return TRUE if terminal supports a mouse, FALSE otherwise | |
| | | | |
| | | | |
| skipping to change at line 1240 | | skipping to change at line 1239 | |
| class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow { | | class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow { | |
| public: | | public: | |
| NCursesColorWindow(WINDOW* &window) // useful only for stdscr | | NCursesColorWindow(WINDOW* &window) // useful only for stdscr | |
| : NCursesWindow(window) { | | : NCursesWindow(window) { | |
| useColors(); } | | useColors(); } | |
| | | | |
| NCursesColorWindow(int lines, // number of lines | | NCursesColorWindow(int lines, // number of lines | |
| int cols, // number of columns | | int cols, // number of columns | |
| int begin_y, // line origin | | int begin_y, // line origin | |
| int begin_x) // col origin | | int begin_x) // col origin | |
|
| : NCursesWindow(lines,cols,begin_y,begin_x) { | | : NCursesWindow(lines, cols, begin_y, begin_x) { | |
| useColors(); } | | useColors(); } | |
| | | | |
| NCursesColorWindow(NCursesWindow& par,// parent window | | NCursesColorWindow(NCursesWindow& par,// parent window | |
| int lines, // number of lines | | int lines, // number of lines | |
| int cols, // number of columns | | int cols, // number of columns | |
| int begin_y, // absolute or relative | | int begin_y, // absolute or relative | |
| int begin_x, // origins: | | int begin_x, // origins: | |
| char absrel = 'a') // if `a', by & bx are | | char absrel = 'a') // if `a', by & bx are | |
|
| : NCursesWindow(par,lines,cols, // absolute screen pos, | | : NCursesWindow(par, lines, cols, // absolute screen pos, | |
| begin_y,begin_x, // else if `r', they are | | begin_y, begin_x, // else if `r', they are | |
| absrel ) { // relative to par origin | | absrel ) { // relative to par origin | |
| useColors(); } | | useColors(); } | |
| }; | | }; | |
| | | | |
| // These enum definitions really belong inside the NCursesPad class, but on
ly | | // These enum definitions really belong inside the NCursesPad class, but on
ly | |
| // recent compilers support that feature. | | // recent compilers support that feature. | |
| | | | |
| typedef enum { | | typedef enum { | |
| REQ_PAD_REFRESH = KEY_MAX + 1, | | REQ_PAD_REFRESH = KEY_MAX + 1, | |
| REQ_PAD_UP, | | REQ_PAD_UP, | |
| | | | |
| skipping to change at line 1321 | | skipping to change at line 1320 | |
| }; | | }; | |
| // OnOperation is called if a Pad_Operation was executed and just before | | // OnOperation is called if a Pad_Operation was executed and just before | |
| // the refresh() operation is done. | | // the refresh() operation is done. | |
| | | | |
| public: | | public: | |
| NCursesPad(int lines, int cols); | | NCursesPad(int lines, int cols); | |
| // create a pad with the given size | | // create a pad with the given size | |
| | | | |
| virtual ~NCursesPad() {} | | virtual ~NCursesPad() {} | |
| | | | |
|
| int echochar(const chtype ch) { return ::pechochar(w,ch); } | | int echochar(const chtype ch) { return ::pechochar(w, ch); } | |
| // Put the attributed character onto the pad and immediately do a | | // Put the attributed character onto the pad and immediately do a | |
| // prefresh(). | | // prefresh(). | |
| | | | |
| int refresh(); | | int refresh(); | |
| // If a viewport is defined the pad is displayed in this window, otherwis
e | | // If a viewport is defined the pad is displayed in this window, otherwis
e | |
| // this is a noop. | | // this is a noop. | |
| | | | |
| int refresh(int pminrow, int pmincol, | | int refresh(int pminrow, int pmincol, | |
| int sminrow, int smincol, | | int sminrow, int smincol, | |
| int smaxrow, int smaxcol) { | | int smaxrow, int smaxcol) { | |
|
| return ::prefresh(w,pminrow,pmincol, | | return ::prefresh(w, pminrow, pmincol, | |
| sminrow,smincol,smaxrow,smaxcol); | | sminrow, smincol, smaxrow, smaxcol); | |
| } | | } | |
| // The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle | | // The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle | |
| // on the screen. <b>refresh</b> copies a rectangle of this size beginnin
g | | // on the screen. <b>refresh</b> copies a rectangle of this size beginnin
g | |
| // with top left corner pminrow,pmincol onto the screen and calls doupdat
e(). | | // with top left corner pminrow,pmincol onto the screen and calls doupdat
e(). | |
| | | | |
| int noutrefresh(); | | int noutrefresh(); | |
| // If a viewport is defined the pad is displayed in this window, otherwis
e | | // If a viewport is defined the pad is displayed in this window, otherwis
e | |
| // this is a noop. | | // this is a noop. | |
| | | | |
| int noutrefresh(int pminrow, int pmincol, | | int noutrefresh(int pminrow, int pmincol, | |
| int sminrow, int smincol, | | int sminrow, int smincol, | |
| int smaxrow, int smaxcol) { | | int smaxrow, int smaxcol) { | |
|
| return ::pnoutrefresh(w,pminrow,pmincol, | | return ::pnoutrefresh(w, pminrow, pmincol, | |
| sminrow,smincol,smaxrow,smaxcol); | | sminrow, smincol, smaxrow, smaxcol); | |
| } | | } | |
| // Does the same as refresh() but without calling doupdate(). | | // Does the same as refresh() but without calling doupdate(). | |
| | | | |
| virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid =
1); | | virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid =
1); | |
| // Add the window "view" as viewing window to the pad. | | // Add the window "view" as viewing window to the pad. | |
| | | | |
| virtual void setSubWindow(NCursesWindow& sub); | | virtual void setSubWindow(NCursesWindow& sub); | |
| // Use the subwindow "sub" of the viewport window for the actual viewing. | | // Use the subwindow "sub" of the viewport window for the actual viewing. | |
| // The full viewport window is usually used to provide some decorations | | // The full viewport window is usually used to provide some decorations | |
| // like frames, titles etc. | | // like frames, titles etc. | |
| | | | |
| skipping to change at line 1373 | | skipping to change at line 1372 | |
| // A FramedPad is constructed always with a viewport window. This viewport | | // A FramedPad is constructed always with a viewport window. This viewport | |
| // will be framed (by a box() command) and the interior of the box is the | | // will be framed (by a box() command) and the interior of the box is the | |
| // viewport subwindow. On the frame we display scrollbar sliders. | | // viewport subwindow. On the frame we display scrollbar sliders. | |
| class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad { | | class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad { | |
| protected: | | protected: | |
| virtual void OnOperation(int pad_req); | | virtual void OnOperation(int pad_req); | |
| | | | |
| public: | | public: | |
| NCursesFramedPad(NCursesWindow& win, int lines, int cols, | | NCursesFramedPad(NCursesWindow& win, int lines, int cols, | |
| int v_grid = 1, int h_grid = 1) | | int v_grid = 1, int h_grid = 1) | |
|
| : NCursesPad(lines,cols) { | | : NCursesPad(lines, cols) { | |
| NCursesPad::setWindow(win,v_grid,h_grid); | | NCursesPad::setWindow(win, v_grid, h_grid); | |
| NCursesPad::setSubWindow(*(new NCursesWindow(win))); | | NCursesPad::setSubWindow(*(new NCursesWindow(win))); | |
| } | | } | |
| // Construct the FramedPad with the given Window win as viewport. | | // Construct the FramedPad with the given Window win as viewport. | |
| | | | |
| virtual ~NCursesFramedPad() { | | virtual ~NCursesFramedPad() { | |
| delete getSubWindow(); | | delete getSubWindow(); | |
| } | | } | |
| | | | |
| void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) { | | void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) { | |
| err_handler("Operation not allowed"); | | err_handler("Operation not allowed"); | |
| | | | |
End of changes. 77 change blocks. |
| 94 lines changed or deleted | | 94 lines changed or added | |
|