mirror of
https://github.com/Aigor44/ncursesw-morphos.git
synced 2024-12-27 07:49:06 +08:00
ncurses 6.0 - patch 20170923
+ modify menu for test/ncurses.c to fit on 24-line screen. + build-fix for configure --with-caps=uwin + add options to test_arrays.c, for selecting termcap vs terminfo, etc.
This commit is contained in:
parent
989279b4d7
commit
93ed44d781
7
NEWS
7
NEWS
@ -25,7 +25,7 @@
|
|||||||
-- sale, use or other dealings in this Software without prior written --
|
-- sale, use or other dealings in this Software without prior written --
|
||||||
-- authorization. --
|
-- authorization. --
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- $Id: NEWS,v 1.2951 2017/09/11 21:43:24 tom Exp $
|
-- $Id: NEWS,v 1.2955 2017/09/23 15:13:23 tom Exp $
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
This is a log of changes that ncurses has gone through since Zeyd started
|
This is a log of changes that ncurses has gone through since Zeyd started
|
||||||
@ -45,6 +45,11 @@ See the AUTHORS file for the corresponding full names.
|
|||||||
Changes through 1.9.9e did not credit all contributions;
|
Changes through 1.9.9e did not credit all contributions;
|
||||||
it is not possible to add this information.
|
it is not possible to add this information.
|
||||||
|
|
||||||
|
20170923
|
||||||
|
+ modify menu for test/ncurses.c to fit on 24-line screen.
|
||||||
|
+ build-fix for configure --with-caps=uwin
|
||||||
|
+ add options to test_arrays.c, for selecting termcap vs terminfo, etc.
|
||||||
|
|
||||||
20170916
|
20170916
|
||||||
+ minor fix to test/filter.c to avoid clearing the command in one case.
|
+ minor fix to test/filter.c to avoid clearing the command in one case.
|
||||||
+ modify filter() to discard clr_eos if back_color_erase is set.
|
+ modify filter() to discard clr_eos if back_color_erase is set.
|
||||||
|
4
dist.mk
4
dist.mk
@ -25,7 +25,7 @@
|
|||||||
# use or other dealings in this Software without prior written #
|
# use or other dealings in this Software without prior written #
|
||||||
# authorization. #
|
# authorization. #
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# $Id: dist.mk,v 1.1183 2017/09/10 17:21:32 tom Exp $
|
# $Id: dist.mk,v 1.1184 2017/09/19 23:16:48 tom Exp $
|
||||||
# Makefile for creating ncurses distributions.
|
# Makefile for creating ncurses distributions.
|
||||||
#
|
#
|
||||||
# This only needs to be used directly as a makefile by developers, but
|
# This only needs to be used directly as a makefile by developers, but
|
||||||
@ -37,7 +37,7 @@ SHELL = /bin/sh
|
|||||||
# These define the major/minor/patch versions of ncurses.
|
# These define the major/minor/patch versions of ncurses.
|
||||||
NCURSES_MAJOR = 6
|
NCURSES_MAJOR = 6
|
||||||
NCURSES_MINOR = 0
|
NCURSES_MINOR = 0
|
||||||
NCURSES_PATCH = 20170916
|
NCURSES_PATCH = 20170923
|
||||||
|
|
||||||
# We don't append the patch to the version, since this only applies to releases
|
# We don't append the patch to the version, since this only applies to releases
|
||||||
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
|
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Id: curses.priv.h,v 1.584 2017/08/04 09:02:33 tom Exp $
|
* $Id: curses.priv.h,v 1.585 2017/09/20 00:34:16 tom Exp $
|
||||||
*
|
*
|
||||||
* curses.priv.h
|
* curses.priv.h
|
||||||
*
|
*
|
||||||
@ -425,10 +425,11 @@ typedef union {
|
|||||||
/*
|
/*
|
||||||
* Simplify ifdef's for the "*_ATTR" macros in case italics are not configured.
|
* Simplify ifdef's for the "*_ATTR" macros in case italics are not configured.
|
||||||
*/
|
*/
|
||||||
#ifdef A_ITALIC
|
#if defined(A_ITALIC) && defined(exit_italics_mode)
|
||||||
#define USE_ITALIC 1
|
#define USE_ITALIC 1
|
||||||
#else
|
#else
|
||||||
#define USE_ITALIC 0
|
#define USE_ITALIC 0
|
||||||
|
#undef A_ITALIC
|
||||||
#define A_ITALIC 0
|
#define A_ITALIC 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
#include <tic.h>
|
#include <tic.h>
|
||||||
|
|
||||||
MODULE_ID("$Id: comp_parse.c,v 1.99 2017/08/26 16:15:50 tom Exp $")
|
MODULE_ID("$Id: comp_parse.c,v 1.100 2017/09/20 00:37:08 tom Exp $")
|
||||||
|
|
||||||
static void sanity_check2(TERMTYPE2 *, bool);
|
static void sanity_check2(TERMTYPE2 *, bool);
|
||||||
NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
|
NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
|
||||||
@ -537,7 +537,9 @@ sanity_check2(TERMTYPE2 *tp, bool literal)
|
|||||||
#endif /* __UNUSED__ */
|
#endif /* __UNUSED__ */
|
||||||
PAIRED(enter_standout_mode, exit_standout_mode);
|
PAIRED(enter_standout_mode, exit_standout_mode);
|
||||||
PAIRED(enter_underline_mode, exit_underline_mode);
|
PAIRED(enter_underline_mode, exit_underline_mode);
|
||||||
|
#if defined(enter_italics_mode) && defined(exit_italics_mode)
|
||||||
PAIRED(enter_italics_mode, exit_italics_mode);
|
PAIRED(enter_italics_mode, exit_italics_mode);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we do this check/fix in postprocess_termcap(), but some packagers
|
/* we do this check/fix in postprocess_termcap(), but some packagers
|
||||||
@ -568,7 +570,9 @@ sanity_check2(TERMTYPE2 *tp, bool literal)
|
|||||||
PAIRED(enter_xon_mode, exit_xon_mode);
|
PAIRED(enter_xon_mode, exit_xon_mode);
|
||||||
PAIRED(enter_am_mode, exit_am_mode);
|
PAIRED(enter_am_mode, exit_am_mode);
|
||||||
ANDMISSING(label_off, label_on);
|
ANDMISSING(label_off, label_on);
|
||||||
|
#if defined(display_clock) && defined(remove_clock)
|
||||||
PAIRED(display_clock, remove_clock);
|
PAIRED(display_clock, remove_clock);
|
||||||
|
#endif
|
||||||
ANDMISSING(set_color_pair, initialize_pair);
|
ANDMISSING(set_color_pair, initialize_pair);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. *
|
* Copyright (c) 1998-2014,2017 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 *
|
||||||
@ -39,7 +39,7 @@
|
|||||||
#define CUR SP_TERMTYPE
|
#define CUR SP_TERMTYPE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MODULE_ID("$Id: lib_acs.c,v 1.45 2014/03/08 20:32:59 tom Exp $")
|
MODULE_ID("$Id: lib_acs.c,v 1.46 2017/09/20 00:48:55 tom Exp $")
|
||||||
|
|
||||||
#if BROKEN_LINKER || USE_REENTRANT
|
#if BROKEN_LINKER || USE_REENTRANT
|
||||||
#define MyBuffer _nc_prescreen.real_acs_map
|
#define MyBuffer _nc_prescreen.real_acs_map
|
||||||
@ -171,7 +171,7 @@ NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0)
|
|||||||
if (ena_acs != NULL) {
|
if (ena_acs != NULL) {
|
||||||
NCURSES_PUTP2("ena_acs", ena_acs);
|
NCURSES_PUTP2("ena_acs", ena_acs);
|
||||||
}
|
}
|
||||||
#if NCURSES_EXT_FUNCS
|
#if NCURSES_EXT_FUNCS && defined(enter_pc_charset_mode) && defined(exit_pc_charset_mode)
|
||||||
/*
|
/*
|
||||||
* Linux console "supports" the "PC ROM" character set by the coincidence
|
* Linux console "supports" the "PC ROM" character set by the coincidence
|
||||||
* that smpch/rmpch and smacs/rmacs have the same values. ncurses has
|
* that smpch/rmpch and smacs/rmacs have the same values. ncurses has
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
ncurses6 (6.0+20170916) unstable; urgency=low
|
ncurses6 (6.0+20170923) unstable; urgency=low
|
||||||
|
|
||||||
* latest weekly patch
|
* latest weekly patch
|
||||||
|
|
||||||
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 10 Sep 2017 13:21:32 -0400
|
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 19 Sep 2017 19:16:48 -0400
|
||||||
|
|
||||||
ncurses6 (5.9-20131005) unstable; urgency=low
|
ncurses6 (5.9-20131005) unstable; urgency=low
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
ncurses6 (6.0+20170916) unstable; urgency=low
|
ncurses6 (6.0+20170923) unstable; urgency=low
|
||||||
|
|
||||||
* latest weekly patch
|
* latest weekly patch
|
||||||
|
|
||||||
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 10 Sep 2017 13:21:32 -0400
|
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 19 Sep 2017 19:16:48 -0400
|
||||||
|
|
||||||
ncurses6 (5.9-20131005) unstable; urgency=low
|
ncurses6 (5.9-20131005) unstable; urgency=low
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
ncurses6 (6.0+20170916) unstable; urgency=low
|
ncurses6 (6.0+20170923) unstable; urgency=low
|
||||||
|
|
||||||
* latest weekly patch
|
* latest weekly patch
|
||||||
|
|
||||||
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 10 Sep 2017 13:21:32 -0400
|
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 19 Sep 2017 19:16:48 -0400
|
||||||
|
|
||||||
ncurses6 (5.9-20120608) unstable; urgency=low
|
ncurses6 (5.9-20120608) unstable; urgency=low
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; $Id: mingw-ncurses.nsi,v 1.231 2017/09/10 17:21:32 tom Exp $
|
; $Id: mingw-ncurses.nsi,v 1.232 2017/09/19 23:16:48 tom Exp $
|
||||||
|
|
||||||
; TODO add examples
|
; TODO add examples
|
||||||
; TODO bump ABI to 6
|
; TODO bump ABI to 6
|
||||||
@ -10,7 +10,7 @@
|
|||||||
!define VERSION_MAJOR "6"
|
!define VERSION_MAJOR "6"
|
||||||
!define VERSION_MINOR "0"
|
!define VERSION_MINOR "0"
|
||||||
!define VERSION_YYYY "2017"
|
!define VERSION_YYYY "2017"
|
||||||
!define VERSION_MMDD "0916"
|
!define VERSION_MMDD "0923"
|
||||||
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
|
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
|
||||||
|
|
||||||
!define MY_ABI "5"
|
!define MY_ABI "5"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
Summary: shared libraries for terminal handling
|
Summary: shared libraries for terminal handling
|
||||||
Name: mingw32-ncurses6
|
Name: mingw32-ncurses6
|
||||||
Version: 6.0
|
Version: 6.0
|
||||||
Release: 20170916
|
Release: 20170923
|
||||||
License: X11
|
License: X11
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
Source: ncurses-%{version}-%{release}.tgz
|
Source: ncurses-%{version}-%{release}.tgz
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
Summary: shared libraries for terminal handling
|
Summary: shared libraries for terminal handling
|
||||||
Name: ncurses6
|
Name: ncurses6
|
||||||
Version: 6.0
|
Version: 6.0
|
||||||
Release: 20170916
|
Release: 20170923
|
||||||
License: X11
|
License: X11
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
Source: ncurses-%{version}-%{release}.tgz
|
Source: ncurses-%{version}-%{release}.tgz
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Copyright (c) 2016 Free Software Foundation, Inc. *
|
* Copyright (c) 2016,2017 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 *
|
||||||
@ -52,7 +52,7 @@
|
|||||||
#include <sys/ptem.h>
|
#include <sys/ptem.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MODULE_ID("$Id: reset_cmd.c,v 1.11 2016/12/24 23:20:57 tom Exp $")
|
MODULE_ID("$Id: reset_cmd.c,v 1.12 2017/09/20 00:49:25 tom Exp $")
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
|
* SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS,
|
||||||
@ -496,17 +496,23 @@ send_init_strings(int fd GCC_UNUSED, TTY * old_settings)
|
|||||||
? reset_2string
|
? reset_2string
|
||||||
: init_2string);
|
: init_2string);
|
||||||
|
|
||||||
|
#if defined(set_lr_margin)
|
||||||
if (set_lr_margin != 0) {
|
if (set_lr_margin != 0) {
|
||||||
need_flush |= sent_string(TPARM_2(set_lr_margin, 0,
|
need_flush |= sent_string(TPARM_2(set_lr_margin, 0,
|
||||||
columns - 1));
|
columns - 1));
|
||||||
} else if (set_left_margin_parm != 0
|
} else
|
||||||
&& set_right_margin_parm != 0) {
|
#endif
|
||||||
|
#if defined(set_left_margin_parm) && defined(set_right_margin_parm)
|
||||||
|
if (set_left_margin_parm != 0
|
||||||
|
&& set_right_margin_parm != 0) {
|
||||||
need_flush |= sent_string(TPARM_1(set_left_margin_parm, 0));
|
need_flush |= sent_string(TPARM_1(set_left_margin_parm, 0));
|
||||||
need_flush |= sent_string(TPARM_1(set_right_margin_parm,
|
need_flush |= sent_string(TPARM_1(set_right_margin_parm,
|
||||||
columns - 1));
|
columns - 1));
|
||||||
} else if (clear_margins != 0
|
} else
|
||||||
&& set_left_margin != 0
|
#endif
|
||||||
&& set_right_margin != 0) {
|
if (clear_margins != 0
|
||||||
|
&& set_left_margin != 0
|
||||||
|
&& set_right_margin != 0) {
|
||||||
need_flush |= sent_string(clear_margins);
|
need_flush |= sent_string(clear_margins);
|
||||||
if (carriage_return != 0) {
|
if (carriage_return != 0) {
|
||||||
need_flush |= sent_string(carriage_return);
|
need_flush |= sent_string(carriage_return);
|
||||||
|
39
progs/tic.c
39
progs/tic.c
@ -48,7 +48,7 @@
|
|||||||
#include <parametrized.h>
|
#include <parametrized.h>
|
||||||
#include <transform.h>
|
#include <transform.h>
|
||||||
|
|
||||||
MODULE_ID("$Id: tic.c,v 1.243 2017/08/26 20:56:55 tom Exp $")
|
MODULE_ID("$Id: tic.c,v 1.244 2017/09/20 00:39:37 tom Exp $")
|
||||||
|
|
||||||
#define STDIN_NAME "<stdin>"
|
#define STDIN_NAME "<stdin>"
|
||||||
|
|
||||||
@ -1537,27 +1537,62 @@ check_keypad(TERMTYPE2 *tp)
|
|||||||
static void
|
static void
|
||||||
check_printer(TERMTYPE2 *tp)
|
check_printer(TERMTYPE2 *tp)
|
||||||
{
|
{
|
||||||
|
(void) tp;
|
||||||
|
#if defined(enter_doublewide_mode) && defined(exit_doublewide_mode)
|
||||||
PAIRED(enter_doublewide_mode, exit_doublewide_mode);
|
PAIRED(enter_doublewide_mode, exit_doublewide_mode);
|
||||||
|
#endif
|
||||||
|
#if defined(enter_italics_mode) && defined(exit_italics_mode)
|
||||||
PAIRED(enter_italics_mode, exit_italics_mode);
|
PAIRED(enter_italics_mode, exit_italics_mode);
|
||||||
|
#endif
|
||||||
|
#if defined(enter_leftward_mode) && defined(exit_leftward_mode)
|
||||||
PAIRED(enter_leftward_mode, exit_leftward_mode);
|
PAIRED(enter_leftward_mode, exit_leftward_mode);
|
||||||
|
#endif
|
||||||
|
#if defined(enter_micro_mode) && defined(exit_micro_mode)
|
||||||
PAIRED(enter_micro_mode, exit_micro_mode);
|
PAIRED(enter_micro_mode, exit_micro_mode);
|
||||||
|
#endif
|
||||||
|
#if defined(enter_shadow_mode) && defined(exit_shadow_mode)
|
||||||
PAIRED(enter_shadow_mode, exit_shadow_mode);
|
PAIRED(enter_shadow_mode, exit_shadow_mode);
|
||||||
|
#endif
|
||||||
|
#if defined(enter_subscript_mode) && defined(exit_subscript_mode)
|
||||||
PAIRED(enter_subscript_mode, exit_subscript_mode);
|
PAIRED(enter_subscript_mode, exit_subscript_mode);
|
||||||
|
#endif
|
||||||
|
#if defined(enter_superscript_mode) && defined(exit_superscript_mode)
|
||||||
PAIRED(enter_superscript_mode, exit_superscript_mode);
|
PAIRED(enter_superscript_mode, exit_superscript_mode);
|
||||||
|
#endif
|
||||||
|
#if defined(enter_upward_mode) && defined(exit_upward_mode)
|
||||||
PAIRED(enter_upward_mode, exit_upward_mode);
|
PAIRED(enter_upward_mode, exit_upward_mode);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(start_char_set_def) && defined(stop_char_set_def)
|
||||||
ANDMISSING(start_char_set_def, stop_char_set_def);
|
ANDMISSING(start_char_set_def, stop_char_set_def);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* if we have a parameterized form, then the non-parameterized is easy */
|
/* if we have a parameterized form, then the non-parameterized is easy */
|
||||||
|
#if defined(set_bottom_margin_parm) && defined(set_bottom_margin)
|
||||||
ANDMISSING(set_bottom_margin_parm, set_bottom_margin);
|
ANDMISSING(set_bottom_margin_parm, set_bottom_margin);
|
||||||
|
#endif
|
||||||
|
#if defined(set_left_margin_parm) && defined(set_left_margin)
|
||||||
ANDMISSING(set_left_margin_parm, set_left_margin);
|
ANDMISSING(set_left_margin_parm, set_left_margin);
|
||||||
|
#endif
|
||||||
|
#if defined(set_right_margin_parm) && defined(set_right_margin)
|
||||||
ANDMISSING(set_right_margin_parm, set_right_margin);
|
ANDMISSING(set_right_margin_parm, set_right_margin);
|
||||||
|
#endif
|
||||||
|
#if defined(set_top_margin_parm) && defined(set_top_margin)
|
||||||
ANDMISSING(set_top_margin_parm, set_top_margin);
|
ANDMISSING(set_top_margin_parm, set_top_margin);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(parm_down_micro) && defined(micro_down)
|
||||||
ANDMISSING(parm_down_micro, micro_down);
|
ANDMISSING(parm_down_micro, micro_down);
|
||||||
|
#endif
|
||||||
|
#if defined(parm_left_micro) && defined(micro_left)
|
||||||
ANDMISSING(parm_left_micro, micro_left);
|
ANDMISSING(parm_left_micro, micro_left);
|
||||||
|
#endif
|
||||||
|
#if defined(parm_right_micro) && defined(micro_right)
|
||||||
ANDMISSING(parm_right_micro, micro_right);
|
ANDMISSING(parm_right_micro, micro_right);
|
||||||
|
#endif
|
||||||
|
#if defined(parm_up_micro) && defined(micro_up)
|
||||||
ANDMISSING(parm_up_micro, micro_up);
|
ANDMISSING(parm_up_micro, micro_up);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
@ -2756,7 +2791,9 @@ check_termtype(TERMTYPE2 *tp, bool literal)
|
|||||||
_nc_visbuf(exit_attribute_mode)));
|
_nc_visbuf(exit_attribute_mode)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if defined(exit_italics_mode)
|
||||||
CHECK_SGR0(exit_italics_mode);
|
CHECK_SGR0(exit_italics_mode);
|
||||||
|
#endif
|
||||||
CHECK_SGR0(exit_standout_mode);
|
CHECK_SGR0(exit_standout_mode);
|
||||||
CHECK_SGR0(exit_underline_mode);
|
CHECK_SGR0(exit_underline_mode);
|
||||||
if (check_sgr0 != exit_attribute_mode) {
|
if (check_sgr0 != exit_attribute_mode) {
|
||||||
|
426
test/ncurses.c
426
test/ncurses.c
@ -40,7 +40,7 @@ AUTHOR
|
|||||||
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
|
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
|
||||||
Thomas E. Dickey (beginning revision 1.27 in 1996).
|
Thomas E. Dickey (beginning revision 1.27 in 1996).
|
||||||
|
|
||||||
$Id: ncurses.c,v 1.460 2017/09/09 22:52:38 tom Exp $
|
$Id: ncurses.c,v 1.465 2017/09/23 15:42:49 tom Exp $
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
@ -985,8 +985,8 @@ finish_getch_test(void)
|
|||||||
endwin();
|
endwin();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
getch_test(void)
|
getch_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
int delay = begin_getch_test();
|
int delay = begin_getch_test();
|
||||||
|
|
||||||
@ -995,6 +995,7 @@ getch_test(void)
|
|||||||
forget_boxes();
|
forget_boxes();
|
||||||
finish_getch_test();
|
finish_getch_test();
|
||||||
slk_clear();
|
slk_clear();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_WIDEC_SUPPORT
|
#if USE_WIDEC_SUPPORT
|
||||||
@ -1202,8 +1203,8 @@ wget_wch_test(unsigned level, WINDOW *win, int delay)
|
|||||||
init_getch(win, flags, delay);
|
init_getch(win, flags, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
get_wch_test(void)
|
x_getch_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
int delay = begin_getch_test();
|
int delay = begin_getch_test();
|
||||||
|
|
||||||
@ -1212,6 +1213,7 @@ get_wch_test(void)
|
|||||||
forget_boxes();
|
forget_boxes();
|
||||||
finish_getch_test();
|
finish_getch_test();
|
||||||
slk_clear();
|
slk_clear();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1606,8 +1608,8 @@ attr_getc(int *skip,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
attr_test(void)
|
attr_test(bool recur GCC_UNUSED)
|
||||||
/* test text attributes */
|
/* test text attributes */
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
@ -1691,8 +1693,10 @@ attr_test(void)
|
|||||||
bkgdset(A_NORMAL | BLANK);
|
bkgdset(A_NORMAL | BLANK);
|
||||||
erase();
|
erase();
|
||||||
endwin();
|
endwin();
|
||||||
|
return OK;
|
||||||
} else {
|
} else {
|
||||||
Cannot("does not support video attributes.");
|
Cannot("does not support video attributes.");
|
||||||
|
return ERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1964,8 +1968,8 @@ wide_attr_getc(int *skip,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
wide_attr_test(void)
|
x_attr_test(bool recur GCC_UNUSED)
|
||||||
/* test text attributes using wide-character calls */
|
/* test text attributes using wide-character calls */
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
@ -2043,8 +2047,10 @@ wide_attr_test(void)
|
|||||||
set_wide_background(0);
|
set_wide_background(0);
|
||||||
erase();
|
erase();
|
||||||
endwin();
|
endwin();
|
||||||
|
return OK;
|
||||||
} else {
|
} else {
|
||||||
Cannot("does not support extended video attributes.");
|
Cannot("does not support extended video attributes.");
|
||||||
|
return ERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -2177,8 +2183,8 @@ color_cycle(int current, int step)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* generate a color test pattern */
|
/* generate a color test pattern */
|
||||||
static void
|
static int
|
||||||
color_test(void)
|
color_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
NCURSES_PAIRS_T i;
|
NCURSES_PAIRS_T i;
|
||||||
int top = 0, width;
|
int top = 0, width;
|
||||||
@ -2200,6 +2206,11 @@ color_test(void)
|
|||||||
bool opt_wide = FALSE;
|
bool opt_wide = FALSE;
|
||||||
WINDOW *helpwin;
|
WINDOW *helpwin;
|
||||||
|
|
||||||
|
if (!use_colors) {
|
||||||
|
Cannot("does not support color.");
|
||||||
|
return ERR;
|
||||||
|
}
|
||||||
|
|
||||||
numbered = (char *) calloc((size_t) (COLS + 1), sizeof(char));
|
numbered = (char *) calloc((size_t) (COLS + 1), sizeof(char));
|
||||||
done = ((COLS < 16) || (numbered == 0));
|
done = ((COLS < 16) || (numbered == 0));
|
||||||
|
|
||||||
@ -2393,12 +2404,13 @@ color_test(void)
|
|||||||
endwin();
|
endwin();
|
||||||
|
|
||||||
free(numbered);
|
free(numbered);
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_WIDEC_SUPPORT
|
#if USE_WIDEC_SUPPORT
|
||||||
/* generate a color test pattern */
|
/* generate a color test pattern */
|
||||||
static void
|
static int
|
||||||
wide_color_test(void)
|
x_color_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int top = 0, width;
|
int top = 0, width;
|
||||||
@ -2422,6 +2434,10 @@ wide_color_test(void)
|
|||||||
wchar_t *buffer = 0;
|
wchar_t *buffer = 0;
|
||||||
WINDOW *helpwin;
|
WINDOW *helpwin;
|
||||||
|
|
||||||
|
if (!use_colors) {
|
||||||
|
Cannot("does not support color.");
|
||||||
|
return ERR;
|
||||||
|
}
|
||||||
numbered = (char *) calloc((size_t) (COLS + 1), sizeof(char));
|
numbered = (char *) calloc((size_t) (COLS + 1), sizeof(char));
|
||||||
buffer = (wchar_t *) calloc((size_t) (COLS + 1), sizeof(wchar_t));
|
buffer = (wchar_t *) calloc((size_t) (COLS + 1), sizeof(wchar_t));
|
||||||
done = ((COLS < 16) || (numbered == 0) || (buffer == 0));
|
done = ((COLS < 16) || (numbered == 0) || (buffer == 0));
|
||||||
@ -2630,6 +2646,7 @@ wide_color_test(void)
|
|||||||
|
|
||||||
free(numbered);
|
free(numbered);
|
||||||
free(buffer);
|
free(buffer);
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
#endif /* USE_WIDEC_SUPPORT */
|
#endif /* USE_WIDEC_SUPPORT */
|
||||||
|
|
||||||
@ -2751,8 +2768,8 @@ init_all_colors(bool xterm_colors, char *palette_file)
|
|||||||
|
|
||||||
#define scaled_rgb(n) ((255 * (n)) / 1000)
|
#define scaled_rgb(n) ((255 * (n)) / 1000)
|
||||||
|
|
||||||
static void
|
static int
|
||||||
color_edit(void)
|
color_edit(bool recur GCC_UNUSED)
|
||||||
/* display the color test pattern, without trying to edit colors */
|
/* display the color test pattern, without trying to edit colors */
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -2762,6 +2779,14 @@ color_edit(void)
|
|||||||
int top_color;
|
int top_color;
|
||||||
int page_size;
|
int page_size;
|
||||||
|
|
||||||
|
if (!use_colors) {
|
||||||
|
Cannot("does not support color.");
|
||||||
|
return ERR;
|
||||||
|
} else if (!can_change_color()) {
|
||||||
|
Cannot("has hardwired color values.");
|
||||||
|
return ERR;
|
||||||
|
}
|
||||||
|
|
||||||
reset_all_colors();
|
reset_all_colors();
|
||||||
#ifdef KEY_RESIZE
|
#ifdef KEY_RESIZE
|
||||||
retry:
|
retry:
|
||||||
@ -2979,6 +3004,7 @@ color_edit(void)
|
|||||||
reset_all_colors();
|
reset_all_colors();
|
||||||
|
|
||||||
endwin();
|
endwin();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_COLOR_CONTENT */
|
#endif /* HAVE_COLOR_CONTENT */
|
||||||
|
|
||||||
@ -3115,8 +3141,8 @@ call_slk_color(int fg, int bg)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void
|
static int
|
||||||
slk_test(void)
|
slk_test(bool recur GCC_UNUSED)
|
||||||
/* exercise the soft keys */
|
/* exercise the soft keys */
|
||||||
{
|
{
|
||||||
int c, fmt = 1;
|
int c, fmt = 1;
|
||||||
@ -3236,12 +3262,13 @@ slk_test(void)
|
|||||||
slk_clear();
|
slk_clear();
|
||||||
erase();
|
erase();
|
||||||
endwin();
|
endwin();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_WIDEC_SUPPORT
|
#if USE_WIDEC_SUPPORT
|
||||||
#define SLKLEN 8
|
#define SLKLEN 8
|
||||||
static void
|
static int
|
||||||
wide_slk_test(void)
|
x_slk_test(bool recur GCC_UNUSED)
|
||||||
/* exercise the soft keys */
|
/* exercise the soft keys */
|
||||||
{
|
{
|
||||||
int c, fmt = 1;
|
int c, fmt = 1;
|
||||||
@ -3390,6 +3417,7 @@ wide_slk_test(void)
|
|||||||
slk_clear();
|
slk_clear();
|
||||||
erase();
|
erase();
|
||||||
endwin();
|
endwin();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /* SLK_INIT */
|
#endif /* SLK_INIT */
|
||||||
@ -3614,10 +3642,11 @@ show_acs_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
|
|||||||
n = show_1_acs(n, repeat, BOTH(ACS_S7));
|
n = show_1_acs(n, repeat, BOTH(ACS_S7));
|
||||||
(void) show_1_acs(n, repeat, BOTH(ACS_S9));
|
(void) show_1_acs(n, repeat, BOTH(ACS_S9));
|
||||||
#endif
|
#endif
|
||||||
|
#undef BOTH
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
acs_display(void)
|
acs_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
int c = 'a';
|
int c = 'a';
|
||||||
int pagesize = 32;
|
int pagesize = 32;
|
||||||
@ -3729,6 +3758,7 @@ acs_display(void)
|
|||||||
Pause();
|
Pause();
|
||||||
erase();
|
erase();
|
||||||
endwin();
|
endwin();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_WIDEC_SUPPORT
|
#if USE_WIDEC_SUPPORT
|
||||||
@ -4163,8 +4193,8 @@ show_utf8_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* display the wide-ACS character set */
|
/* display the wide-ACS character set */
|
||||||
static void
|
static int
|
||||||
wide_acs_display(void)
|
x_acs_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
int c = 'a';
|
int c = 'a';
|
||||||
int digit = 0;
|
int digit = 0;
|
||||||
@ -4266,6 +4296,7 @@ wide_acs_display(void)
|
|||||||
Pause();
|
Pause();
|
||||||
erase();
|
erase();
|
||||||
endwin();
|
endwin();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -4273,8 +4304,8 @@ wide_acs_display(void)
|
|||||||
/*
|
/*
|
||||||
* Graphic-rendition test (adapted from vttest)
|
* Graphic-rendition test (adapted from vttest)
|
||||||
*/
|
*/
|
||||||
static void
|
static int
|
||||||
test_sgr_attributes(void)
|
sgr_attr_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
int pass;
|
int pass;
|
||||||
|
|
||||||
@ -4348,6 +4379,7 @@ test_sgr_attributes(void)
|
|||||||
bkgdset(A_NORMAL | BLANK);
|
bkgdset(A_NORMAL | BLANK);
|
||||||
erase();
|
erase();
|
||||||
endwin();
|
endwin();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -4649,8 +4681,8 @@ delete_framed(FRAME * fp, bool showit)
|
|||||||
return np;
|
return np;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
acs_and_scroll(void)
|
scroll_test(bool recur GCC_UNUSED)
|
||||||
/* Demonstrate windows */
|
/* Demonstrate windows */
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
@ -4672,11 +4704,11 @@ acs_and_scroll(void)
|
|||||||
switch (c) {
|
switch (c) {
|
||||||
case CTRL('C'):
|
case CTRL('C'):
|
||||||
if ((neww = typeCalloc(FRAME, (size_t) 1)) == 0) {
|
if ((neww = typeCalloc(FRAME, (size_t) 1)) == 0) {
|
||||||
failed("acs_and_scroll");
|
failed("scroll_test");
|
||||||
goto breakout;
|
goto breakout;
|
||||||
}
|
}
|
||||||
if ((neww->wind = getwindow()) == (WINDOW *) 0) {
|
if ((neww->wind = getwindow()) == (WINDOW *) 0) {
|
||||||
failed("acs_and_scroll");
|
failed("scroll_test");
|
||||||
free(neww);
|
free(neww);
|
||||||
goto breakout;
|
goto breakout;
|
||||||
}
|
}
|
||||||
@ -4770,7 +4802,7 @@ acs_and_scroll(void)
|
|||||||
|
|
||||||
wrefresh(neww->wind);
|
wrefresh(neww->wind);
|
||||||
} else {
|
} else {
|
||||||
failed("acs_and_scroll");
|
failed("scroll_test");
|
||||||
}
|
}
|
||||||
(void) fclose(fp);
|
(void) fclose(fp);
|
||||||
}
|
}
|
||||||
@ -4892,6 +4924,7 @@ acs_and_scroll(void)
|
|||||||
noraw();
|
noraw();
|
||||||
erase();
|
erase();
|
||||||
endwin();
|
endwin();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -5098,7 +5131,7 @@ canned_panel(PANEL *px[MAX_PANELS + 1], NCURSES_CONST char *cmd)
|
|||||||
wait_a_while(nap_msec);
|
wait_a_while(nap_msec);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
demo_panels(void (*InitPanel) (WINDOW *), void (*FillPanel) (PANEL *))
|
demo_panels(void (*InitPanel) (WINDOW *), void (*FillPanel) (PANEL *))
|
||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
@ -5237,7 +5270,24 @@ demo_panels(void (*InitPanel) (WINDOW *), void (*FillPanel) (PANEL *))
|
|||||||
|
|
||||||
erase();
|
erase();
|
||||||
endwin();
|
endwin();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if USE_LIBPANEL
|
||||||
|
static int
|
||||||
|
panel_test(bool recur GCC_UNUSED)
|
||||||
|
{
|
||||||
|
return demo_panels(init_panel, fill_panel);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if USE_WIDEC_SUPPORT && USE_LIBPANEL
|
||||||
|
static int
|
||||||
|
x_panel_test(bool recur GCC_UNUSED)
|
||||||
|
{
|
||||||
|
return demo_panels(init_wide_panel, fill_wide_panel);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#endif /* USE_LIBPANEL */
|
#endif /* USE_LIBPANEL */
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -5677,24 +5727,24 @@ padgetch(WINDOW *win)
|
|||||||
#define PAD_HIGH 200
|
#define PAD_HIGH 200
|
||||||
#define PAD_WIDE 200
|
#define PAD_WIDE 200
|
||||||
|
|
||||||
static void
|
static int
|
||||||
demo_pad(bool colored)
|
pad_test(bool recur GCC_UNUSED)
|
||||||
/* Demonstrate pads. */
|
/* Demonstrate pads. */
|
||||||
{
|
{
|
||||||
WINDOW *panpad = newpad(PAD_HIGH, PAD_WIDE);
|
WINDOW *panpad = newpad(PAD_HIGH, PAD_WIDE);
|
||||||
|
|
||||||
if (panpad == 0) {
|
if (panpad == 0) {
|
||||||
Cannot("cannot create requested pad");
|
Cannot("cannot create requested pad");
|
||||||
return;
|
return ERR;
|
||||||
}
|
}
|
||||||
#ifdef A_COLOR
|
#ifdef A_COLOR
|
||||||
if (colored && use_colors) {
|
if (use_colors) {
|
||||||
init_pair(1, COLOR_BLACK, COLOR_GREEN);
|
init_pair(1, COLOR_BLACK, COLOR_GREEN);
|
||||||
init_pair(2, COLOR_CYAN, COLOR_BLUE);
|
init_pair(2, COLOR_CYAN, COLOR_BLUE);
|
||||||
wbkgd(panpad, (chtype) (COLOR_PAIR(2) | ' '));
|
wbkgd(panpad, (chtype) (COLOR_PAIR(2) | ' '));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
fill_pad(panpad, FALSE, colored);
|
fill_pad(panpad, FALSE, TRUE);
|
||||||
|
|
||||||
panner_legend(LINES - 4);
|
panner_legend(LINES - 4);
|
||||||
panner_legend(LINES - 3);
|
panner_legend(LINES - 3);
|
||||||
@ -5707,11 +5757,12 @@ demo_pad(bool colored)
|
|||||||
* We'll still be able to widen it during a test, since that's required
|
* We'll still be able to widen it during a test, since that's required
|
||||||
* for testing boundaries.
|
* for testing boundaries.
|
||||||
*/
|
*/
|
||||||
panner(panpad, 2, 2, LINES - 5, COLS - 15, padgetch, colored);
|
panner(panpad, 2, 2, LINES - 5, COLS - 15, padgetch, TRUE);
|
||||||
|
|
||||||
delwin(panpad);
|
delwin(panpad);
|
||||||
endwin();
|
endwin();
|
||||||
erase();
|
erase();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
#endif /* HAVE_NEWPAD */
|
#endif /* HAVE_NEWPAD */
|
||||||
|
|
||||||
@ -5731,10 +5782,11 @@ Continue(WINDOW *win)
|
|||||||
wGetchar(win);
|
wGetchar(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
flushinp_test(WINDOW *win)
|
flushinp_test(bool recur GCC_UNUSED)
|
||||||
/* Input test, adapted from John Burnell's PDCurses tester */
|
/* Input test, adapted from John Burnell's PDCurses tester */
|
||||||
{
|
{
|
||||||
|
WINDOW *win = stdscr;
|
||||||
int w, h, bx, by, sw, sh, i;
|
int w, h, bx, by, sw, sh, i;
|
||||||
|
|
||||||
WINDOW *subWin;
|
WINDOW *subWin;
|
||||||
@ -5745,7 +5797,7 @@ flushinp_test(WINDOW *win)
|
|||||||
sw = w / 3;
|
sw = w / 3;
|
||||||
sh = h / 3;
|
sh = h / 3;
|
||||||
if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == 0)
|
if ((subWin = subwin(win, sh, sw, by + h - sh - 2, bx + w - sw - 2)) == 0)
|
||||||
return;
|
return ERR;
|
||||||
|
|
||||||
#ifdef A_COLOR
|
#ifdef A_COLOR
|
||||||
if (use_colors) {
|
if (use_colors) {
|
||||||
@ -5812,6 +5864,7 @@ flushinp_test(WINDOW *win)
|
|||||||
Continue(win);
|
Continue(win);
|
||||||
|
|
||||||
cbreak();
|
cbreak();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -5869,8 +5922,8 @@ static CONST_MENUS char *animals[] =
|
|||||||
(char *) 0
|
(char *) 0
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static int
|
||||||
menu_test(void)
|
menu_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
MENU *m;
|
MENU *m;
|
||||||
ITEM *items[SIZEOF(animals)];
|
ITEM *items[SIZEOF(animals)];
|
||||||
@ -5932,6 +5985,7 @@ menu_test(void)
|
|||||||
#ifdef NCURSES_MOUSE_VERSION
|
#ifdef NCURSES_MOUSE_VERSION
|
||||||
mousemask(0, (mmask_t *) 0);
|
mousemask(0, (mmask_t *) 0);
|
||||||
#endif
|
#endif
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TRACE
|
#ifdef TRACE
|
||||||
@ -6032,8 +6086,8 @@ run_trace_menu(MENU * m)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
trace_set(void)
|
trace_set(bool recur GCC_UNUSED)
|
||||||
/* interactively set the trace level */
|
/* interactively set the trace level */
|
||||||
{
|
{
|
||||||
MENU *m;
|
MENU *m;
|
||||||
@ -6103,6 +6157,8 @@ trace_set(void)
|
|||||||
free_menu(m);
|
free_menu(m);
|
||||||
for (ip = items; *ip; ip++)
|
for (ip = items; *ip; ip++)
|
||||||
free_item(*ip);
|
free_item(*ip);
|
||||||
|
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
#endif /* TRACE */
|
#endif /* TRACE */
|
||||||
#endif /* USE_LIBMENU */
|
#endif /* USE_LIBMENU */
|
||||||
@ -6427,8 +6483,8 @@ CHAR_CHECK_CB(pw_char_check)
|
|||||||
return (isgraph(ch) ? TRUE : FALSE);
|
return (isgraph(ch) ? TRUE : FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
demo_forms(void)
|
form_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
WINDOW *w;
|
WINDOW *w;
|
||||||
FORM *form;
|
FORM *form;
|
||||||
@ -6521,6 +6577,7 @@ demo_forms(void)
|
|||||||
#ifdef NCURSES_MOUSE_VERSION
|
#ifdef NCURSES_MOUSE_VERSION
|
||||||
mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
|
mousemask(ALL_MOUSE_EVENTS, (mmask_t *) 0);
|
||||||
#endif
|
#endif
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
#endif /* USE_LIBFORM */
|
#endif /* USE_LIBFORM */
|
||||||
|
|
||||||
@ -6784,8 +6841,8 @@ overlap_test_4(int flavor, WINDOW *a, WINDOW *b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* test effects of overlapping windows */
|
/* test effects of overlapping windows */
|
||||||
static void
|
static int
|
||||||
overlap_test(void)
|
overlap_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
int state, flavor[OVERLAP_FLAVORS];
|
int state, flavor[OVERLAP_FLAVORS];
|
||||||
@ -6874,6 +6931,7 @@ overlap_test(void)
|
|||||||
delwin(win1);
|
delwin(win1);
|
||||||
erase();
|
erase();
|
||||||
exit_curses();
|
exit_curses();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_COPYWIN */
|
#endif /* HAVE_COPYWIN */
|
||||||
@ -6926,8 +6984,8 @@ show_boolean_setting(const char *name, int value)
|
|||||||
AddCh('\n');
|
AddCh('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int
|
||||||
show_settings(void)
|
settings_test(bool recur GCC_UNUSED)
|
||||||
{
|
{
|
||||||
#if USE_WIDEC_SUPPORT
|
#if USE_WIDEC_SUPPORT
|
||||||
wchar_t ch;
|
wchar_t ch;
|
||||||
@ -6958,6 +7016,7 @@ show_settings(void)
|
|||||||
Pause();
|
Pause();
|
||||||
erase();
|
erase();
|
||||||
exit_curses();
|
exit_curses();
|
||||||
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -6966,152 +7025,6 @@ show_settings(void)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static bool
|
|
||||||
do_single_test(const char c)
|
|
||||||
/* perform a single specified test */
|
|
||||||
{
|
|
||||||
switch (c) {
|
|
||||||
case 'a':
|
|
||||||
getch_test();
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if USE_WIDEC_SUPPORT
|
|
||||||
case 'A':
|
|
||||||
get_wch_test();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 'b':
|
|
||||||
attr_test();
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if USE_WIDEC_SUPPORT
|
|
||||||
case 'B':
|
|
||||||
wide_attr_test();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 'c':
|
|
||||||
if (!use_colors)
|
|
||||||
Cannot("does not support color.");
|
|
||||||
else
|
|
||||||
color_test();
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if USE_WIDEC_SUPPORT
|
|
||||||
case 'C':
|
|
||||||
if (!use_colors)
|
|
||||||
Cannot("does not support color.");
|
|
||||||
else
|
|
||||||
wide_color_test();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_COLOR_CONTENT
|
|
||||||
case 'd':
|
|
||||||
if (!use_colors)
|
|
||||||
Cannot("does not support color.");
|
|
||||||
else if (!can_change_color())
|
|
||||||
Cannot("has hardwired color values.");
|
|
||||||
else
|
|
||||||
color_edit();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_SOFTKEYS
|
|
||||||
case 'e':
|
|
||||||
slk_test();
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if USE_WIDEC_SUPPORT
|
|
||||||
case 'E':
|
|
||||||
wide_slk_test();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 'f':
|
|
||||||
acs_display();
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if USE_WIDEC_SUPPORT
|
|
||||||
case 'F':
|
|
||||||
wide_acs_display();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_LIBPANEL
|
|
||||||
case 'o':
|
|
||||||
demo_panels(init_panel, fill_panel);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_WIDEC_SUPPORT && USE_LIBPANEL
|
|
||||||
case 'O':
|
|
||||||
demo_panels(init_wide_panel, fill_wide_panel);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 'g':
|
|
||||||
acs_and_scroll();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'i':
|
|
||||||
flushinp_test(stdscr);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'k':
|
|
||||||
test_sgr_attributes();
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if USE_LIBMENU
|
|
||||||
case 'm':
|
|
||||||
menu_test();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_NEWPAD
|
|
||||||
case 'p':
|
|
||||||
demo_pad(FALSE);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'P':
|
|
||||||
demo_pad(TRUE);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_LIBFORM
|
|
||||||
case 'r':
|
|
||||||
demo_forms();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_COPYWIN
|
|
||||||
case 's':
|
|
||||||
overlap_test();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if USE_LIBMENU && defined(TRACE)
|
|
||||||
case 't':
|
|
||||||
trace_set();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case 'v':
|
|
||||||
show_settings();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '?':
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
@ -7203,64 +7116,85 @@ rip_header(WINDOW *win, int cols)
|
|||||||
static void
|
static void
|
||||||
main_menu(bool top)
|
main_menu(bool top)
|
||||||
{
|
{
|
||||||
char command;
|
|
||||||
|
|
||||||
do {
|
|
||||||
(void) puts("This is the ncurses main menu");
|
|
||||||
(void) puts("a = keyboard and mouse input test");
|
|
||||||
#if USE_WIDEC_SUPPORT
|
#if USE_WIDEC_SUPPORT
|
||||||
(void) puts("A = wide-character keyboard and mouse input test");
|
typedef struct {
|
||||||
#endif
|
bool recur;
|
||||||
(void) puts("b = character attribute test");
|
int (*narrow_func) (bool);
|
||||||
#if USE_WIDEC_SUPPORT
|
int (*wide_func) (bool);
|
||||||
(void) puts("B = wide-character attribute test");
|
int code;
|
||||||
#endif
|
const char *help;
|
||||||
(void) puts("c = color test pattern");
|
} MyCmds;
|
||||||
#if USE_WIDEC_SUPPORT
|
#define BOTH(a) a, x_ ## a
|
||||||
(void) puts("C = color test pattern using wide-character calls");
|
#define ONLY(a) a, NULL
|
||||||
|
#define CMDS(recur, funcs,code,help) { recur, funcs, code, help }
|
||||||
|
#else
|
||||||
|
typedef struct {
|
||||||
|
bool recur;
|
||||||
|
int (*narrow_func) (bool);
|
||||||
|
int code;
|
||||||
|
const char *help;
|
||||||
|
} MyCmds;
|
||||||
|
#define BOTH(a) a
|
||||||
|
#define ONLY(a) a
|
||||||
|
#define CMDS(recur, funcs,code,help) { recur, funcs, code, help }
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
static MyCmds cmds[] =
|
||||||
|
{
|
||||||
|
CMDS(TRUE, BOTH(getch_test), 'a', "keyboard and mouse input test"),
|
||||||
|
CMDS(TRUE, BOTH(attr_test), 'b', "character attribute test"),
|
||||||
|
CMDS(TRUE, BOTH(color_test), 'c', "color test pattern"),
|
||||||
#if HAVE_COLOR_CONTENT
|
#if HAVE_COLOR_CONTENT
|
||||||
if (top)
|
CMDS(FALSE, ONLY(color_edit), 'd', "edit RGB color values"),
|
||||||
(void) puts("d = edit RGB color values");
|
|
||||||
#endif
|
#endif
|
||||||
#if USE_SOFTKEYS
|
#if USE_SOFTKEYS
|
||||||
(void) puts("e = exercise soft keys");
|
CMDS(TRUE, BOTH(slk_test), 'e', "exercise soft keys"),
|
||||||
#if USE_WIDEC_SUPPORT
|
|
||||||
(void) puts("E = exercise soft keys using wide-characters");
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
CMDS(TRUE, BOTH(acs_test), 'f', "display ACS characters"),
|
||||||
(void) puts("f = display ACS characters");
|
CMDS(TRUE, ONLY(scroll_test), 'g', "display windows and scrolling"),
|
||||||
#if USE_WIDEC_SUPPORT
|
CMDS(TRUE, ONLY(flushinp_test), 'i', "test flushinp()"),
|
||||||
(void) puts("F = display Wide-ACS characters");
|
CMDS(TRUE, ONLY(sgr_attr_test), 'k', "display character attributes"),
|
||||||
#endif
|
|
||||||
(void) puts("g = display windows and scrolling");
|
|
||||||
(void) puts("i = test of flushinp()");
|
|
||||||
(void) puts("k = display character attributes");
|
|
||||||
#if USE_LIBMENU
|
#if USE_LIBMENU
|
||||||
(void) puts("m = menu code test");
|
CMDS(TRUE, ONLY(menu_test), 'm', "exercise menu library"),
|
||||||
#endif
|
|
||||||
#if USE_LIBPANEL
|
|
||||||
(void) puts("o = exercise panels library");
|
|
||||||
#if USE_WIDEC_SUPPORT
|
|
||||||
(void) puts("O = exercise panels with wide-characters");
|
|
||||||
#endif
|
#endif
|
||||||
|
#if USE_LIBMENU
|
||||||
|
CMDS(TRUE, BOTH(panel_test), 'o', "exercise panel library"),
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_NEWPAD
|
#if HAVE_NEWPAD
|
||||||
(void) puts("p = exercise pad features");
|
CMDS(TRUE, ONLY(pad_test), 'p', "exercise pad features"),
|
||||||
(void) puts("P = exercise pad features, using color");
|
|
||||||
#endif
|
#endif
|
||||||
(void) puts("q = quit");
|
CMDS(TRUE, ONLY(NULL), 'q', "quit"),
|
||||||
#if USE_LIBFORM
|
#if USE_LIBMENU
|
||||||
(void) puts("r = exercise forms code");
|
CMDS(TRUE, ONLY(form_test), 'r', "exercise form library"),
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_COPYWIN
|
#if HAVE_COPYWIN
|
||||||
(void) puts("s = overlapping-refresh test");
|
CMDS(TRUE, ONLY(overlap_test), 's', "overlapping-refresh test"),
|
||||||
#endif
|
#endif
|
||||||
#if USE_LIBMENU && defined(TRACE)
|
#if USE_LIBMENU && defined(TRACE)
|
||||||
(void) puts("t = set trace level");
|
CMDS(TRUE, ONLY(trace_set), 't', "set trace level"),
|
||||||
#endif
|
#endif
|
||||||
(void) puts("v = show terminal name and settings");
|
CMDS(TRUE, ONLY(settings_test), 'v', "show terminal name and settings"),
|
||||||
(void) puts("? = repeat this command summary");
|
CMDS(FALSE, ONLY(NULL), '?', "repeat this command summary")
|
||||||
|
};
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
|
int (*doit) (bool);
|
||||||
|
char command;
|
||||||
|
unsigned n;
|
||||||
|
|
||||||
|
do {
|
||||||
|
printf("This is the ncurses main menu (uppercase for wide-characters)\n");
|
||||||
|
for (n = 0; n < SIZEOF(cmds); ++n) {
|
||||||
|
if (top || cmds[n].recur) {
|
||||||
|
putchar(' ');
|
||||||
|
#if USE_WIDEC_SUPPORT
|
||||||
|
if (cmds[n].wide_func) {
|
||||||
|
printf("%c,", toupper(cmds[n].code));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
printf("%c\t= %s\n", cmds[n].code, cmds[n].help);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
(void) fputs("> ", stdout);
|
(void) fputs("> ", stdout);
|
||||||
(void) fflush(stdout); /* necessary under SVr4 curses */
|
(void) fflush(stdout); /* necessary under SVr4 curses */
|
||||||
@ -7291,7 +7225,21 @@ main_menu(bool top)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_single_test(command)) {
|
doit = NULL;
|
||||||
|
for (n = 0; n < SIZEOF(cmds); ++n) {
|
||||||
|
if (cmds[n].code == command) {
|
||||||
|
doit = cmds[n].narrow_func;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#if USE_WIDEC_SUPPORT
|
||||||
|
if (toupper(cmds[n].code) == command) {
|
||||||
|
doit = cmds[n].wide_func;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (doit != NULL && doit(FALSE) == OK) {
|
||||||
/*
|
/*
|
||||||
* This may be overkill; it's intended to reset everything back
|
* This may be overkill; it's intended to reset everything back
|
||||||
* to the initial terminal modes so that tests don't get in
|
* to the initial terminal modes so that tests don't get in
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
* authorization. *
|
* authorization. *
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
/*
|
/*
|
||||||
* $Id: test_arrays.c,v 1.6 2010/11/13 19:57:57 tom Exp $
|
* $Id: test_arrays.c,v 1.7 2017/09/20 00:21:22 tom Exp $
|
||||||
*
|
*
|
||||||
* Author: Thomas E Dickey
|
* Author: Thomas E Dickey
|
||||||
*
|
*
|
||||||
@ -50,7 +50,14 @@ extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];
|
|||||||
#if HAVE_TIGETSTR
|
#if HAVE_TIGETSTR
|
||||||
#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)
|
#if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)
|
||||||
|
|
||||||
#define DUMP(name) dump_array(#name, name)
|
static bool opt_C;
|
||||||
|
static bool opt_T;
|
||||||
|
static bool opt_c;
|
||||||
|
static bool opt_f;
|
||||||
|
static bool opt_n;
|
||||||
|
static bool opt_t;
|
||||||
|
|
||||||
|
#define PLAIN(opts, name) if (opts) dump_array(#name, name)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dump_array(const char *name, NCURSES_CONST char *const *list)
|
dump_array(const char *name, NCURSES_CONST char *const *list)
|
||||||
@ -63,20 +70,139 @@ dump_array(const char *name, NCURSES_CONST char *const *list)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static void
|
||||||
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
|
dump_plain(void)
|
||||||
{
|
{
|
||||||
DUMP(boolnames);
|
PLAIN(opt_T && opt_n, boolnames);
|
||||||
DUMP(boolcodes);
|
PLAIN(opt_C && opt_c, boolcodes);
|
||||||
DUMP(boolfnames);
|
PLAIN(opt_T && opt_f, boolfnames);
|
||||||
|
|
||||||
DUMP(numnames);
|
PLAIN(opt_T && opt_n, numnames);
|
||||||
DUMP(numcodes);
|
PLAIN(opt_C && opt_c, numcodes);
|
||||||
DUMP(numfnames);
|
PLAIN(opt_T && opt_f, numfnames);
|
||||||
|
|
||||||
DUMP(strnames);
|
PLAIN(opt_T && opt_n, strnames);
|
||||||
DUMP(strcodes);
|
PLAIN(opt_C && opt_c, strcodes);
|
||||||
DUMP(strfnames);
|
PLAIN(opt_T && opt_f, strfnames);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define STRING(opts, name) if (opts) { printf("%s\"%s\"", c++ ? "," : "", name); }
|
||||||
|
#define NUMBER(opts, value) if (opts) { printf("%s%d", c++ ? "," : "", value); }
|
||||||
|
|
||||||
|
static void
|
||||||
|
dump_table(void)
|
||||||
|
{
|
||||||
|
int c = 0;
|
||||||
|
int r;
|
||||||
|
|
||||||
|
STRING(opt_t, "Index");
|
||||||
|
STRING(opt_t, "Type");
|
||||||
|
STRING(opt_n, "Name");
|
||||||
|
STRING(opt_c, "Code");
|
||||||
|
STRING(opt_f, "FName");
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
for (r = 0; boolnames[r]; ++r) {
|
||||||
|
c = 0;
|
||||||
|
NUMBER(opt_t, r);
|
||||||
|
STRING(opt_t, "bool");
|
||||||
|
STRING(opt_T && opt_n, boolnames[r]);
|
||||||
|
STRING(opt_C && opt_c, boolcodes[r]);
|
||||||
|
STRING(opt_T && opt_f, boolfnames[r]);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (r = 0; numnames[r]; ++r) {
|
||||||
|
c = 0;
|
||||||
|
NUMBER(opt_t, r);
|
||||||
|
STRING(opt_t, "num");
|
||||||
|
STRING(opt_T && opt_n, numnames[r]);
|
||||||
|
STRING(opt_C && opt_c, numcodes[r]);
|
||||||
|
STRING(opt_T && opt_f, numfnames[r]);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (r = 0; strnames[r]; ++r) {
|
||||||
|
c = 0;
|
||||||
|
NUMBER(opt_t, r);
|
||||||
|
STRING(opt_t, "str");
|
||||||
|
STRING(opt_T && opt_n, strnames[r]);
|
||||||
|
STRING(opt_C && opt_c, strcodes[r]);
|
||||||
|
STRING(opt_T && opt_f, strfnames[r]);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
usage(void)
|
||||||
|
{
|
||||||
|
static const char *msg[] =
|
||||||
|
{
|
||||||
|
"Usage: test_arrays [options]",
|
||||||
|
"",
|
||||||
|
"If no options are given, print all (boolean, numeric, string)",
|
||||||
|
"capability names showing their index within the tables.",
|
||||||
|
"",
|
||||||
|
"Options:",
|
||||||
|
" -C print termcap names",
|
||||||
|
" -T print terminfo names",
|
||||||
|
" -c print termcap names",
|
||||||
|
" -f print full terminfo names",
|
||||||
|
" -n print short terminfo names",
|
||||||
|
" -t print the result as CSV table",
|
||||||
|
};
|
||||||
|
unsigned n;
|
||||||
|
for (n = 0; n < SIZEOF(msg); ++n) {
|
||||||
|
fprintf(stderr, "%s\n", msg[n]);
|
||||||
|
}
|
||||||
|
ExitProgram(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
|
||||||
|
while ((n = getopt(argc, argv, "CTcfnt")) != -1) {
|
||||||
|
switch (n) {
|
||||||
|
case 'C':
|
||||||
|
opt_C = TRUE;
|
||||||
|
break;
|
||||||
|
case 'T':
|
||||||
|
opt_T = TRUE;
|
||||||
|
break;
|
||||||
|
case 'c':
|
||||||
|
opt_c = TRUE;
|
||||||
|
break;
|
||||||
|
case 'f':
|
||||||
|
opt_f = TRUE;
|
||||||
|
break;
|
||||||
|
case 'n':
|
||||||
|
opt_n = TRUE;
|
||||||
|
break;
|
||||||
|
case 't':
|
||||||
|
opt_t = TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
usage();
|
||||||
|
/* NOTREACHED */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (optind < argc)
|
||||||
|
usage();
|
||||||
|
|
||||||
|
if (!(opt_T || opt_C)) {
|
||||||
|
opt_T = opt_C = TRUE;
|
||||||
|
}
|
||||||
|
if (!(opt_c || opt_f || opt_n)) {
|
||||||
|
opt_c = opt_f = opt_n = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (opt_t) {
|
||||||
|
dump_table();
|
||||||
|
} else {
|
||||||
|
dump_plain();
|
||||||
|
}
|
||||||
|
|
||||||
ExitProgram(EXIT_SUCCESS);
|
ExitProgram(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user