X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Ftest_opaque.c;h=eeea2302284c12df8d1e7d65eed9237d079920b7;hp=8e19a8c29cc403ab143d46185152774c8fa6f82f;hb=21b36e89c00f2188954d680bf9fea60328b4538c;hpb=3934889cc6b0f45cf218c88df7f35634d250c9e5;ds=sidebyside diff --git a/test/test_opaque.c b/test/test_opaque.c index 8e19a8c2..eeea2302 100644 --- a/test/test_opaque.c +++ b/test/test_opaque.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright 2020 Thomas E. Dickey * + * Copyright 2020,2021 Thomas E. Dickey * * Copyright 2007-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * @@ -27,7 +27,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_opaque.c,v 1.10 2020/02/02 23:34:34 tom Exp $ + * $Id: test_opaque.c,v 1.12 2021/03/06 23:53:34 tom Exp $ * * Author: Thomas E Dickey * @@ -45,6 +45,9 @@ bool is_scrollok(const WINDOW *win); bool is_syncok(const WINDOW *win); int wgetscrreg (const WINDOW *, int *, int *); + bool is_pad(const WINDOW *win); + bool is_subwin(const WINDOW *win); + int wgetdelay(const WINDOW *win); */ #include @@ -209,6 +212,8 @@ static struct { }; /* *INDENT-ON* */ +#define bool2c(c) ((c) ? 'T' : 'F') + /* * Display and/or allow update for the properties accessed in the opaque * window. Some may change state after refreshing the window, so we @@ -227,18 +232,35 @@ show_opaque(WINDOW *stswin, WINDOW *txtwin, bool before, int active) show_keyword(stswin, n, active, bool_funcs[n].name); to_result(stswin, n, before); - wprintw(stswin, "%c", bool_funcs[n].func(txtwin, -1) ? 'T' : 'F'); + wprintw(stswin, "%c", bool2c(bool_funcs[n].func(txtwin, -1))); } + show_keyword(stswin, n, active, "is_pad"); + to_result(stswin, n, TRUE); + wprintw(stswin, "%c", bool2c(is_pad(txtwin))); + + ++n; + show_keyword(stswin, n, active, "is_subwin"); + to_result(stswin, n, TRUE); + wprintw(stswin, "%c", bool2c(is_subwin(txtwin))); + + ++n; show_keyword(stswin, n, active, "wgetparent"); to_result(stswin, n, TRUE); wprintw(stswin, "%p", (void *) wgetparent(txtwin)); + ++n; + show_keyword(stswin, n, active, "wgetdelay"); + to_result(stswin, n, TRUE); + wprintw(stswin, "%d", wgetdelay(txtwin)); + ++n; show_keyword(stswin, n, active, "wgetscrreg"); to_result(stswin, n, TRUE); if (wgetscrreg(txtwin, &top, &bottom) == OK) wprintw(stswin, "%d,%d", top, bottom); + else + wprintw(stswin, "none"); wnoutrefresh(stswin); return active;