diff --git a/curses.h b/curses.h index 8f5a89c1..19d288e1 100644 --- a/curses.h +++ b/curses.h @@ -1292,8 +1292,10 @@ PDCEX bool is_immedok(const WINDOW *); PDCEX bool is_keypad(const WINDOW *); PDCEX bool is_leaveok(const WINDOW *); PDCEX bool is_nodelay(const WINDOW *); +PDCEX bool is_notimeout(const WINDOW *); PDCEX bool is_pad(const WINDOW *); PDCEX bool is_scrollok(const WINDOW *); +PDCEX bool is_subwin(const WINDOW *); PDCEX bool is_syncok(const WINDOW *); PDCEX int set_tabsize(int); PDCEX int use_default_colors(void); diff --git a/pdcurses/inopts.c b/pdcurses/inopts.c index 6774bc8d..754c660c 100644 --- a/pdcurses/inopts.c +++ b/pdcurses/inopts.c @@ -34,6 +34,7 @@ inopts bool is_keypad(const WINDOW *win); bool is_nodelay(const WINDOW *win); + bool is_notimeout(const WINDOW *win); ### Description @@ -101,6 +102,9 @@ inopts is_keypad() and is_nodelay() returns TRUE or FALSE. + is_notimeout() is provided for compatibility with other curses + implementations, i.e. it always returns FALSE. + ### Portability X/Open ncurses NetBSD cbreak Y Y Y @@ -126,6 +130,7 @@ inopts nocrmode Y Y Y is_keypad - Y Y is_nodelay - Y - + is_notimeout - Y - **man-end****************************************************************/ @@ -381,3 +386,12 @@ bool is_nodelay(const WINDOW *win) return win->_nodelay; } + +bool is_notimeout(const WINDOW *win) +{ + (void) win; + + PDC_LOG(("is_notimeout() - called - returning FALSE...\n")); + + return FALSE; +} diff --git a/pdcurses/window.c b/pdcurses/window.c index 98dcc10e..26bdef18 100644 --- a/pdcurses/window.c +++ b/pdcurses/window.c @@ -19,6 +19,7 @@ window int mvwin(WINDOW *win, int y, int x); int mvderwin(WINDOW *win, int pary, int parx); int syncok(WINDOW *win, bool bf); + bool is_subwin(const WINDOW *win); bool is_syncok(const WINDOW *win); void wsyncup(WINDOW *win); void wcursyncup(WINDOW *win); @@ -70,6 +71,9 @@ window If syncok() is called with a second argument of TRUE, this causes a wsyncup() to be called every time the window is changed. + is_subwin() reports whether the specified window is a subwindow, + created by subwin() or derwin(). + is_syncok() reports whether the specified window is in syncok mode. wcursyncup() causes the current cursor position of all of a window's @@ -104,7 +108,7 @@ window syncok() return OK or ERR. wsyncup(), wcursyncup() and wsyncdown() return nothing. - is_syncok() returns TRUE or FALSE. + is_subwin() and is_syncok() returns TRUE or FALSE. ### Errors @@ -126,6 +130,7 @@ window dupwin Y Y Y wsyncup Y Y Y syncok Y Y Y + is_subwin - Y - is_syncok - Y - wcursyncup Y Y Y wsyncdown Y Y Y @@ -560,6 +565,16 @@ int syncok(WINDOW *win, bool bf) return OK; } +bool is_subwin(const WINDOW *win) +{ + PDC_LOG(("is_subwin() - called\n")); + + if (!win) + return FALSE; + + return ((win->_flags & _SUBWIN) ? TRUE : FALSE); +} + bool is_syncok(const WINDOW *win) { PDC_LOG(("is_syncok() - called\n"));