/****************************************************************************
- * Copyright (c) 2007,2008 Free Software Foundation, Inc. *
+ * 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 *
* copy of this software and associated documentation files (the *
* authorization. *
****************************************************************************/
/*
- * $Id: test_opaque.c,v 1.7 2008/07/05 23:18:40 tom Exp $
+ * $Id: test_opaque.c,v 1.13 2021/07/11 09:13:49 tom Exp $
*
* Author: Thomas E Dickey
*
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 <test.priv.h>
#define BASE_Y 6
#define MAX_COLS 1024
-#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20080119) && NCURSES_EXT_FUNCS
+#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20080119) && NCURSES_EXT_FUNCS && NCURSES_OPAQUE
static bool
Quit(int ch)
{
to_keyword(stswin, cell);
if (active == cell)
- wstandout(stswin);
+ (void) wstandout(stswin);
wprintw(stswin, "%s:", name);
if (active == cell)
- wstandend(stswin);
+ (void) wstandend(stswin);
}
/* *INDENT-OFF* */
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
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", wgetparent(txtwin));
+ 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;