]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.9 - patch 20130831
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 31 Aug 2013 21:14:42 +0000 (21:14 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 31 Aug 2013 21:14:42 +0000 (21:14 +0000)
+ modify test/ncurses.c b/B tests to display lines only for the
  attributes which a given terminal supports, to make room for an
  italics test.
+ completed ncv table in terminfo.tail; it did not list the wide
  character codes listed in X/Open Curses issue 7.
+ add A_ITALIC extension (prompted by discussion with Egmont Koblinger).

17 files changed:
NEWS
dist.mk
include/curses.h.in
man/curs_attr.3x
man/terminfo.tail
ncurses/base/lib_newterm.c
ncurses/base/lib_set_term.c
ncurses/curses.priv.h
ncurses/tinfo/comp_parse.c
ncurses/tinfo/tinfo_driver.c
ncurses/trace/lib_traceatr.c
ncurses/tty/lib_vidattr.c
ncurses/widechar/lib_vid_attr.c
package/debian/changelog
package/mingw-ncurses.spec
package/ncurses.spec
test/ncurses.c

diff --git a/NEWS b/NEWS
index ac14204eff774b270fc47892d5f1fd64b3c74d93..a8da274405cac2099f72aa10c85cdbaeaa9d28ed 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2093 2013/08/24 22:44:49 tom Exp $
+-- $Id: NEWS,v 1.2096 2013/08/31 20:36:47 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,14 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20130831
+       + modify test/ncurses.c b/B tests to display lines only for the
+         attributes which a given terminal supports, to make room for an
+         italics test.
+       + completed ncv table in terminfo.tail; it did not list the wide
+         character codes listed in X/Open Curses issue 7.
+       + add A_ITALIC extension (prompted by discussion with Egmont Koblinger).
+
 20130824
        + fix some gcc 4.8 -Wconversion warnings.
        + change format of dpkg test-scripts to quilted to work around bug
@@ -4692,7 +4700,7 @@ it is not possible to add this information.
          generated when cross-compiling for DJGPP.
        + modify infocmp to omit check for $TERM for operations that do not
          require it, e.g., "infocmp -e" used to build fallback list (report by
-         Koblinger Egmont).
+         Egmont Koblinger).
 
 20031004
        + add terminfo entries for DJGPP.
diff --git a/dist.mk b/dist.mk
index f8689c133c7de0c1c88bd7154946cee289dcce5a..75b5cd0d699c866ebcb3b510690b852579ff7f51 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.942 2013/08/24 12:26:13 tom Exp $
+# $Id: dist.mk,v 1.943 2013/08/31 10:53:48 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # 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.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 9
-NCURSES_PATCH = 20130824
+NCURSES_PATCH = 20130831
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index cf6546f638c8ff066080b02c4a9d3bd7bdaddac4..ddd73751909b323497aea2d52ded85583391583a 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.234 2013/08/24 22:48:56 tom Exp $ */
+/* $Id: curses.h.in,v 1.235 2013/08/31 13:13:05 tom Exp $ */
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
@@ -244,6 +244,10 @@ extern "C" {
 #define WA_TOP         A_TOP
 #define WA_VERTICAL    A_VERTICAL
 
+#if @NCURSES_EXT_FUNCS@
+#define WA_ITALIC      A_ITALIC        /* ncurses extension */
+#endif
+
 /* colors */
 #define COLOR_BLACK    0
 #define COLOR_RED      1
@@ -1059,6 +1063,10 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);    /*
 #define A_TOP          NCURSES_BITS(@cf_cv_1UL@,21)
 #define A_VERTICAL     NCURSES_BITS(@cf_cv_1UL@,22)
 
+#if @NCURSES_EXT_FUNCS@
+#define A_ITALIC       NCURSES_BITS(@cf_cv_1UL@,23)    /* ncurses extension */
+#endif
+
 /*
  * Most of the pseudo functions are macros that either provide compatibility
  * with older versions of curses, or provide inline functionality to improve
index 67740f9e2a72c4564296394b07e81102601cf7d8..cd49844861b3329b7caa8464c126e358b52a697e 100644 (file)
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2013 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            *
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_attr.3x,v 1.36 2010/12/04 18:36:44 tom Exp $
+.\" $Id: curs_attr.3x,v 1.38 2013/08/31 12:30:55 tom Exp $
 .TH curs_attr 3X ""
 .na
 .hy 0
@@ -164,9 +164,12 @@ The following video attributes, defined in \fB<curses.h>\fR, can be passed to
 the routines \fBattron\fR, \fBattroff\fR, and \fBattrset\fR, or OR'd with the
 characters passed to \fBaddch\fR.
 .PP
+.RS
 .TS
-center ;
+l l 
+_ _ _
 l l .
+\fIName\fR     \fIDescription\fR
 \fBA_NORMAL\fR Normal display (no highlight)
 \fBA_STANDOUT\fR       Best highlighting mode of the terminal.
 \fBA_UNDERLINE\fR      Underlining
@@ -177,9 +180,30 @@ l l .
 \fBA_PROTECT\fR        Protected mode
 \fBA_INVIS\fR  Invisible or blank mode
 \fBA_ALTCHARSET\fR     Alternate character set
+\fBA_ITALIC\fR Italics (non-X/Open extension)
 \fBA_CHARTEXT\fR       Bit-mask to extract a character
 \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR        Color-pair number \fIn\fR
 .TE
+.RE
+.PP
+These video attributes are supported by \fBattr_on\fP and related functions
+(which also support the attributes recognized by \fBattron\fP, etc.):
+.RS
+.TS
+l l 
+_ _ _
+l l .
+\fIName\fR     \fIDescription\fR
+\fBWA_HORIZONTAL\fR    Horizontal highlight
+\fBWA_LEFT\fR  Left highlight
+\fBWA_LOW\fR   Low highlight
+\fBWA_RIGHT\fR Right highlight
+\fBWA_TOP\fR   Top highlight
+\fBWA_VERTICAL\fR      Vertical highlight
+.TE
+.RE
+.PP
+For consistency
 .PP
 The following macro is the reverse of \fBCOLOR_PAIR(\fR\fIn\fR\fB)\fR:
 .PP
@@ -214,19 +238,27 @@ The XSI Curses standard states that whether the traditional functions
 SVr4 curses, these functions correctly manipulate all other highlights
 (specifically, \fBA_ALTCHARSET\fR, \fBA_PROTECT\fR, and \fBA_INVIS\fR).
 .PP
+This implementation provides the \fBA_ITALIC\fP attribute for terminals
+which have the \fIenter_italics_mode\fP (sitm) and \fIexit_italics_mode\fP (ritm) capabilities.
+Italics are not mentioned in X/Open Curses.
+Unlike the other video attributes, \fBI_ITALIC\fP is unrelated
+to the \fIset_attributes\fP capabilites.
+This implementation makes the assumption that
+\fIexit_attribute_mode\fP may also reset italics.
+.PP
 XSI Curses added the new entry points, \fBattr_get\fR, \fBattr_on\fR,
 \fBattr_off\fR, \fBattr_set\fR, \fBwattr_on\fR, \fBwattr_off\fR,
 \fBwattr_get\fR, \fBwattr_set\fR.  These are intended to work with
 a new series of highlight macros prefixed with \fBWA_\fR.
+The older macros have direct counterparts in the newer set of names:
 .PP
-Older versions of this library did not force an update of the screen
-when changing the attributes.
-Use \fBtouchwin\fR to force the screen to match the updated attributes.
-.PP
+.RS
 .ne 9
 .TS
-center ;
+l l 
+_ _ _
 l l .
+\fIName\fR     \fIDescription\fR
 \fBWA_NORMAL\fR        Normal display (no highlight)
 \fBWA_STANDOUT\fR      Best highlighting mode of the terminal.
 \fBWA_UNDERLINE\fR     Underlining
@@ -236,6 +268,11 @@ l l .
 \fBWA_BOLD\fR  Extra bright or bold
 \fBWA_ALTCHARSET\fR    Alternate character set
 .TE
+.RE
+.PP
+Older versions of this library did not force an update of the screen
+when changing the attributes.
+Use \fBtouchwin\fR to force the screen to match the updated attributes.
 .PP
 The XSI curses standard specifies that each pair of corresponding \fBA_\fR
 and \fBWA_\fR-using functions operates on the same current-highlight
@@ -243,8 +280,10 @@ information.
 .PP
 The XSI standard extended conformance level adds new highlights
 \fBA_HORIZONTAL\fR, \fBA_LEFT\fR, \fBA_LOW\fR, \fBA_RIGHT\fR, \fBA_TOP\fR,
-\fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each) which this
-implementation does not yet support.
+\fBA_VERTICAL\fR (and corresponding \fBWA_\fR macros for each).
+As of August 2013,
+no known terminal provides these highlights
+(i.e., via the \fBsgr1\fP capability).
 .SH RETURN VALUE
 All routines return the integer \fBOK\fR on success, or \fBERR\fP on failure.
 .PP
index 477c06b1cb592405b94020ae77c67f360e342bbb..f7ac493b054940740a6274965270e17a88f102f2 100644 (file)
@@ -1,4 +1,4 @@
-.\" $Id: terminfo.tail,v 1.65 2013/06/22 19:00:26 tom Exp $
+.\" $Id: terminfo.tail,v 1.67 2013/08/31 12:11:03 tom Exp $
 .\" Beginning of terminfo.tail file
 .\" This file is part of ncurses.
 .\" See "terminfo.head" for copyright.
@@ -55,35 +55,35 @@ of what a \fBterminfo\fR entry for a modern terminal typically looks like.
 .nf
 .ft CW
 \s-2ansi|ansi/pc-term compatible with color,
-       am, mc5i, mir, msgr,
-       colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,
-       acsc=+\\020\\,\\021-\\030.^Y0\\333`\\004a\\261f\\370g\\361h\\260
-            j\\331k\\277l\\332m\\300n\\305o~p\\304q\\304r\\304s_t\\303
-            u\\264v\\301w\\302x\\263y\\363z\\362{\\343|\\330}\\234~\\376,
-       bel=^G, blink=\\E[5m, bold=\\E[1m, cbt=\\E[Z, clear=\\E[H\\E[J,
-       cr=^M, cub=\\E[%p1%dD, cub1=\\E[D, cud=\\E[%p1%dB, cud1=\\E[B,
-       cuf=\\E[%p1%dC, cuf1=\\E[C, cup=\\E[%i%p1%d;%p2%dH,
-       cuu=\\E[%p1%dA, cuu1=\\E[A, dch=\\E[%p1%dP, dch1=\\E[P,
-       dl=\\E[%p1%dM, dl1=\\E[M, ech=\\E[%p1%dX, ed=\\E[J, el=\\E[K,
-       el1=\\E[1K, home=\\E[H, hpa=\\E[%i%p1%dG, ht=\\E[I, hts=\\EH,
-       ich=\\E[%p1%d@, il=\\E[%p1%dL, il1=\\E[L, ind=^J,
-       indn=\\E[%p1%dS, invis=\\E[8m, kbs=^H, kcbt=\\E[Z, kcub1=\\E[D,
-       kcud1=\\E[B, kcuf1=\\E[C, kcuu1=\\E[A, khome=\\E[H, kich1=\\E[L,
-       mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S, op=\\E[39;49m,
-       rep=%p1%c\\E[%p2%{1}%-%db, rev=\\E[7m, rin=\\E[%p1%dT,
-       rmacs=\\E[10m, rmpch=\\E[10m, rmso=\\E[m, rmul=\\E[m,
-       s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B, s3ds=\\E+B,
-       setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm,
-       sgr=\\E[0;10%?%p1%t;7%;
-                  %?%p2%t;4%;
-                  %?%p3%t;7%;
-                  %?%p4%t;5%;
-                  %?%p6%t;1%;
-                  %?%p7%t;8%;
-                  %?%p9%t;11%;m,
-       sgr0=\\E[0;10m, smacs=\\E[11m, smpch=\\E[11m, smso=\\E[7m,
-       smul=\\E[4m, tbc=\\E[3g, u6=\\E[%i%d;%dR, u7=\\E[6n,
-       u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%i%p1%dd,
+        am, mc5i, mir, msgr,
+        colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,
+        acsc=+\\020\\,\\021-\\030.^Y0\\333`\\004a\\261f\\370g\\361h\\260
+             j\\331k\\277l\\332m\\300n\\305o~p\\304q\\304r\\304s_t\\303
+             u\\264v\\301w\\302x\\263y\\363z\\362{\\343|\\330}\\234~\\376,
+        bel=^G, blink=\\E[5m, bold=\\E[1m, cbt=\\E[Z, clear=\\E[H\\E[J,
+        cr=^M, cub=\\E[%p1%dD, cub1=\\E[D, cud=\\E[%p1%dB, cud1=\\E[B,
+        cuf=\\E[%p1%dC, cuf1=\\E[C, cup=\\E[%i%p1%d;%p2%dH,
+        cuu=\\E[%p1%dA, cuu1=\\E[A, dch=\\E[%p1%dP, dch1=\\E[P,
+        dl=\\E[%p1%dM, dl1=\\E[M, ech=\\E[%p1%dX, ed=\\E[J, el=\\E[K,
+        el1=\\E[1K, home=\\E[H, hpa=\\E[%i%p1%dG, ht=\\E[I, hts=\\EH,
+        ich=\\E[%p1%d@, il=\\E[%p1%dL, il1=\\E[L, ind=^J,
+        indn=\\E[%p1%dS, invis=\\E[8m, kbs=^H, kcbt=\\E[Z, kcub1=\\E[D,
+        kcud1=\\E[B, kcuf1=\\E[C, kcuu1=\\E[A, khome=\\E[H, kich1=\\E[L,
+        mc4=\\E[4i, mc5=\\E[5i, nel=\\r\\E[S, op=\\E[39;49m,
+        rep=%p1%c\\E[%p2%{1}%-%db, rev=\\E[7m, rin=\\E[%p1%dT,
+        rmacs=\\E[10m, rmpch=\\E[10m, rmso=\\E[m, rmul=\\E[m,
+        s0ds=\\E(B, s1ds=\\E)B, s2ds=\\E*B, s3ds=\\E+B,
+        setab=\\E[4%p1%dm, setaf=\\E[3%p1%dm,
+        sgr=\\E[0;10%?%p1%t;7%;
+                   %?%p2%t;4%;
+                   %?%p3%t;7%;
+                   %?%p4%t;5%;
+                   %?%p6%t;1%;
+                   %?%p7%t;8%;
+                   %?%p9%t;11%;m,
+        sgr0=\\E[0;10m, smacs=\\E[11m, smpch=\\E[11m, smso=\\E[7m,
+        smul=\\E[4m, tbc=\\E[3g, u6=\\E[%i%d;%dR, u7=\\E[6n,
+        u8=\\E[?%[;0123456789]c, u9=\\E[c, vpa=\\E[%i%p1%dd,
 .fi
 .ft R
 .PP
@@ -354,7 +354,7 @@ Thus the model 33 teletype is described as
 .ft CW
 .\".in -2
 \s-133\||\|tty33\||\|tty\||\|model 33 teletype,
-       bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\s+1
+        bel=^G, cols#72, cr=^M, cud1=^J, hc, ind=^J, os,\s+1
 .\".in +2
 .ft R
 .fi
@@ -366,8 +366,8 @@ while the Lear Siegler \s-1ADM-3\s0 is described as
 .ft CW
 .\".in -2
 \s-1adm3\||\|3\||\|lsi adm3,
-       am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
-       ind=^J, lines#24,\s+1
+        am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H, cud1=^J,
+        ind=^J, lines#24,\s+1
 .\".in +2
 .ft R
 .fi
@@ -1447,18 +1447,25 @@ attributes understood by \fBcurses\fR is as follows:
 .PP
 .TS
 center;
-l c c
-lw25 lw2 lw10.
-\fBAttribute   Bit     Decimal\fR
-A_STANDOUT     0       1
-A_UNDERLINE    1       2
-A_REVERSE      2       4
-A_BLINK        3       8
-A_DIM          4       16
-A_BOLD         5       32
-A_INVIS        6       64
-A_PROTECT      7       128
-A_ALTCHARSET   8       256
+l l l l
+lw20 lw2 lw10 lw10.
+\fBAttribute   Bit     Decimal Set by\fR
+A_STANDOUT     0       1       sgr
+A_UNDERLINE    1       2       sgr
+A_REVERSE      2       4       sgr
+A_BLINK        3       8       sgr
+A_DIM          4       16      sgr
+A_BOLD         5       32      sgr
+A_INVIS        6       64      sgr
+A_PROTECT      7       128     sgr
+A_ALTCHARSET   8       256     sgr
+A_HORIZONTAL   9       512     sgr1
+A_LEFT 10      1024    sgr1
+A_LOW  11      2048    sgr1
+A_RIGHT        12      4096    sgr1
+A_TOP  13      8192    sgr1
+A_VERTICAL     14      16384   sgr1
+A_ITALIC       15      32768   sitm
 .TE
 .PP
 For example, on many IBM PC consoles, the underline attribute collides with the
@@ -1763,6 +1770,15 @@ The \fBncurses\fR wants to
 interpret it as \fBKEY_MOUSE\fR, for use by terminals and emulators like xterm
 that can return mouse-tracking information in the keyboard-input stream.
 .PP
+X/Open Curses does not mention italics.
+Portable applications must assume that numeric capabilities are
+signed 16-bit values.
+This includes the \fIno_color_video\fP (ncv) capability.
+The 32768 mask value used for italics with ncv can be confused with
+an absent or cancelled ncv.
+If italics should work with colors,
+then the ncv value must be specified, even if it is zero.
+.PP
 Different commercial ports of terminfo and curses support different subsets of
 the XSI Curses standard and (in some cases) different extension sets.
 Here
index a235dbdbe9c01b029c6ca9c422aa37f22922be2c..93d84323bc64486f7de7fd1c57ab4fa3021ae3ee 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2012,2013 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            *
@@ -48,7 +48,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: lib_newterm.c,v 1.88 2012/01/21 19:21:29 KO.Myung-Hun Exp $")
+MODULE_ID("$Id: lib_newterm.c,v 1.89 2013/08/31 14:56:50 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define NumLabels      InfoOf(SP_PARM).numlabels
@@ -307,7 +307,7 @@ NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx
            /* compute movement costs so we can do better move optimization */
 #ifdef USE_TERM_DRIVER
            TCBOf(SP_PARM)->drv->scinit(SP_PARM);
-#else
+#else /* ! USE_TERM_DRIVER */
            /*
             * Check for mismatched graphic-rendition capabilities.  Most SVr4
             * terminfo trees contain entries that have rmul or rmso equated to
@@ -320,13 +320,16 @@ NCURSES_SP_NAME(newterm) (NCURSES_SP_DCLx
 #define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode))
            SP_PARM->_use_rmso = SGR0_TEST(exit_standout_mode);
            SP_PARM->_use_rmul = SGR0_TEST(exit_underline_mode);
+#if USE_ITALIC
+           SP_PARM->_use_ritm = SGR0_TEST(exit_italics_mode);
+#endif
 
            /* compute movement costs so we can do better move optimization */
            _nc_mvcur_init();
 
            /* initialize terminal to a sane state */
            _nc_screen_init();
-#endif
+#endif /* USE_TERM_DRIVER */
 
            /* Initialize the terminal line settings. */
            _nc_initscr(NCURSES_SP_ARG);
index 1406b1ad03d0e7e1af6be686f061b47c00c3ebbc..acf6bc1f71cd10745cb07c3b58b303671a20459e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2012,2013 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            *
@@ -47,7 +47,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_set_term.c,v 1.147 2012/12/22 21:30:04 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.148 2013/08/31 13:33:06 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define MaxColors      InfoOf(sp).maxcolors
@@ -507,16 +507,7 @@ NCURSES_SP_NAME(_nc_setupscreen) (
 
     if (magic_cookie_glitch > 0) {     /* tvi, wyse */
 
-       sp->_xmc_triggers = sp->_ok_attributes & (
-                                                    A_STANDOUT |
-                                                    A_UNDERLINE |
-                                                    A_REVERSE |
-                                                    A_BLINK |
-                                                    A_DIM |
-                                                    A_BOLD |
-                                                    A_INVIS |
-                                                    A_PROTECT
-           );
+       sp->_xmc_triggers = sp->_ok_attributes & XMC_CONFLICT;
 #if 0
        /*
         * We "should" treat colors as an attribute.  The wyse350 (and its
index 3627433b873f0625a5599ab10630a4c112f80c39..46c63bb1f0eefb96011848c3d6a98d4d3f1e410c 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.525 2013/08/24 22:39:52 tom Exp $
+ * $Id: curses.priv.h,v 1.527 2013/08/31 17:02:41 tom Exp $
  *
  *     curses.priv.h
  *
@@ -379,6 +379,16 @@ color_t;
 
 #include <nc_tparm.h>
 
+/*
+ * Simplify ifdef's for the "*_ATTR" macros in case italics are not configured.
+ */
+#ifdef A_ITALIC
+#define USE_ITALIC 1
+#else
+#define USE_ITALIC 0
+#define A_ITALIC 0
+#endif
+
 /*
  * Use these macros internally, to make tracing less verbose.  But leave the
  * option for compiling the tracing into the library.
@@ -1089,6 +1099,9 @@ struct screen {
        /* used in lib_vidattr.c */
        bool            _use_rmso;      /* true if we may use 'rmso'         */
        bool            _use_rmul;      /* true if we may use 'rmul'         */
+#if USE_ITALIC
+       bool            _use_ritm;      /* true if we may use 'ritm'         */
+#endif
 
 #if USE_KLIBC_KBD
        bool            _extended_key;  /* true if an extended key           */
@@ -1704,7 +1717,9 @@ extern    NCURSES_EXPORT(void) name (void); \
        NCURSES_EXPORT(void) name (void) { }
 
 #define ALL_BUT_COLOR ((chtype)~(A_COLOR))
-#define NONBLANK_ATTR (A_NORMAL|A_BOLD|A_DIM|A_BLINK)
+#define NONBLANK_ATTR (A_BOLD | A_DIM | A_BLINK | A_ITALIC)
+#define TPARM_ATTR    (A_STANDOUT | A_UNDERLINE | A_REVERSE | A_BLINK | A_DIM | A_BOLD | A_ALTCHARSET | A_INVIS | A_PROTECT)
+#define XMC_CONFLICT  (A_STANDOUT | A_UNDERLINE | A_REVERSE | A_BLINK | A_DIM | A_BOLD | A_INVIS | A_PROTECT | A_ITALIC)
 #define XMC_CHANGES(c) ((c) & SP_PARM->_xmc_suppress)
 
 #define toggle_attr_on(S,at) {\
index 814d1116c6717e8400bd3c6865194289451a4c93..82a61a52e35d1dac97b75c6ce8b46e5a3aa9094c 100644 (file)
@@ -47,7 +47,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: comp_parse.c,v 1.89 2013/07/13 21:55:32 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.90 2013/08/31 15:22:31 tom Exp $")
 
 static void sanity_check2(TERMTYPE *, bool);
 NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2;
@@ -547,6 +547,7 @@ sanity_check2(TERMTYPE *tp, bool literal)
 #endif /* __UNUSED__ */
        PAIRED(enter_standout_mode, exit_standout_mode);
        PAIRED(enter_underline_mode, exit_underline_mode);
+       PAIRED(enter_italics_mode, exit_italics_mode);
     }
 
     /* we do this check/fix in postprocess_termcap(), but some packagers
index 84611c83b46be3440dae795af3a178a2b8e8fc7f..11431996f8022cc05ab9a2f14aa16e0511dbb657 100644 (file)
@@ -50,7 +50,7 @@
 # endif
 #endif
 
-MODULE_ID("$Id: tinfo_driver.c,v 1.30 2013/05/25 20:16:46 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.32 2013/08/31 15:22:46 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -955,6 +955,11 @@ drv_conattr(TERMINAL_CONTROL_BLOCK * TCB)
     if (sp && sp->_coloron)
        attrs |= A_COLOR;
 
+#if USE_ITALIC
+    if (enter_italics_mode)
+       attrs |= A_ITALIC;
+#endif
+
     return (attrs);
 }
 
@@ -1081,16 +1086,7 @@ _nc_cookie_init(SCREEN *sp)
 
     if (magic_cookie_glitch > 0) {     /* tvi, wyse */
 
-       sp->_xmc_triggers = sp->_ok_attributes & (
-                                                    A_STANDOUT |
-                                                    A_UNDERLINE |
-                                                    A_REVERSE |
-                                                    A_BLINK |
-                                                    A_DIM |
-                                                    A_BOLD |
-                                                    A_INVIS |
-                                                    A_PROTECT
-           );
+       sp->_xmc_triggers = sp->_ok_attributes & XMC_CONFLICT;
 #if 0
        /*
         * We "should" treat colors as an attribute.  The wyse350 (and its
index 07424222ec00c8814d95b285421e11552bbd1c69..d1c0de40856d14d5563759b6fb272be41b7a4c29 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2012,2013 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            *
@@ -43,7 +43,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_traceatr.c,v 1.79 2012/02/22 22:40:24 tom Exp $")
+MODULE_ID("$Id: lib_traceatr.c,v 1.80 2013/08/31 13:33:06 tom Exp $")
 
 #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name))
 
@@ -103,6 +103,9 @@ _traceattr2(int bufnum, chtype newmode)
        { A_CHARTEXT,           "A_CHARTEXT" },
        { A_NORMAL,             "A_NORMAL" },
        { A_COLOR,              "A_COLOR" },
+#if USE_ITALIC
+       { A_ITALIC,             "A_ITALIC" },
+#endif
        /* *INDENT-ON* */
 
     }
index c0a406c5e2050e176df3b0dc8ff53244486f41d1..0846d8485f423b0cfb8d5ad0ccb95aeffce34acf 100644 (file)
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_vidattr.c,v 1.63 2013/01/12 18:00:54 tom Exp $")
+MODULE_ID("$Id: lib_vidattr.c,v 1.67 2013/08/31 20:08:59 tom Exp $")
 
 #define doPut(mode) \
        TPUTS_TRACE(#mode); \
        NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx mode, 1, outc)
 
-#define TurnOn(mask,mode) \
+#define TurnOn(mask, mode) \
        if ((turn_on & mask) && mode) { doPut(mode); }
 
-#define TurnOff(mask,mode) \
+#define TurnOff(mask, mode) \
        if ((turn_off & mask) && mode) { doPut(mode); turn_off &= ~mask; }
 
        /* if there is no current screen, assume we *can* do color */
-#define SetColorsIf(why,old_attr) \
+#define SetColorsIf(why, old_attr) \
        if (can_color && (why)) { \
                int old_pair = PairNumber(old_attr); \
                TR(TRACE_ATTRS, ("old pair = %d -- new pair = %d", old_pair, pair)); \
                if ((pair != old_pair) \
                 || (fix_pair0 && (pair == 0)) \
                 || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \
-                    NCURSES_SP_NAME(_nc_do_color)(NCURSES_SP_ARGx \
+                    NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx \
                                     (short) old_pair, \
                                     (short) pair, \
                                     reverse, outc); \
@@ -139,6 +139,9 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
            A_BOLD,
            A_INVIS,
            A_PROTECT,
+#if USE_ITALIC
+           A_ITALIC,
+#endif
        };
        unsigned n;
        int used = 0;
@@ -229,6 +232,11 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
                if (!SP_PARM || SP_PARM->_use_rmso) {
                    TurnOff(A_STANDOUT, exit_standout_mode);
                }
+#if USE_ITALIC
+               if (!SP_PARM || SP_PARM->_use_ritm) {
+                   TurnOff(A_ITALIC, exit_italics_mode);
+               }
+#endif
            }
            PreviousAttr &= ALL_BUT_COLOR;
        }
@@ -251,6 +259,15 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
                                    1, outc);
            PreviousAttr &= ALL_BUT_COLOR;
        }
+#if USE_ITALIC
+       if (!SP_PARM || SP_PARM->_use_ritm) {
+           if (turn_on & A_ITALIC) {
+               TurnOn(A_ITALIC, enter_italics_mode);
+           } else if (turn_off & A_ITALIC) {
+               TurnOff(A_ITALIC, exit_italics_mode);
+           }
+       }
+#endif
        SetColorsIf((pair != 0) || fix_pair0, PreviousAttr);
     } else {
 
@@ -265,7 +282,11 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
        if (!SP_PARM || SP_PARM->_use_rmso) {
            TurnOff(A_STANDOUT, exit_standout_mode);
        }
-
+#if USE_ITALIC
+       if (!SP_PARM || SP_PARM->_use_ritm) {
+           TurnOff(A_ITALIC, exit_italics_mode);
+       }
+#endif
        if (turn_off && exit_attribute_mode) {
            doPut(exit_attribute_mode);
            turn_on |= (newmode & ALL_BUT_COLOR);
@@ -284,6 +305,9 @@ NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx
        TurnOn(A_PROTECT,       enter_protected_mode);
        TurnOn(A_INVIS,         enter_secure_mode);
        TurnOn(A_UNDERLINE,     enter_underline_mode);
+#if USE_ITALIC
+       TurnOn(A_ITALIC,        enter_italics_mode);
+#endif
 #if USE_WIDEC_SUPPORT
        TurnOn(A_HORIZONTAL,    enter_horizontal_hl_mode);
        TurnOn(A_LEFT,          enter_left_hl_mode);
@@ -345,7 +369,7 @@ NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0)
     if (HasTerminal(SP_PARM)) {
 #ifdef USE_TERM_DRIVER
        attrs = CallDriver(SP_PARM, conattr);
-#else
+#else /* ! USE_TERM_DRIVER */
 
        if (enter_alt_charset_mode)
            attrs |= A_ALTCHARSET;
@@ -377,7 +401,12 @@ NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0)
        if (SP_PARM->_coloron)
            attrs |= A_COLOR;
 
+#if USE_ITALIC
+       if (enter_italics_mode)
+           attrs |= A_ITALIC;
 #endif
+
+#endif /* USE_TERM_DRIVER */
     }
     returnChtype(attrs);
 }
index c752c1d149703e78a8cefe238f4281d592f18d4c..5034a42ff6e7a45d4fc164eeae497aba6866caad 100644 (file)
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_vid_attr.c,v 1.17 2013/01/12 18:01:35 tom Exp $")
+MODULE_ID("$Id: lib_vid_attr.c,v 1.21 2013/08/31 20:09:12 tom Exp $")
 
-#define doPut(mode) TPUTS_TRACE(#mode); NCURSES_SP_NAME(tputs)(NCURSES_SP_ARGx mode, 1, outc)
+#define doPut(mode) \
+       TPUTS_TRACE(#mode); \
+       NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx mode, 1, outc)
 
-#define TurnOn(mask,mode) \
+#define TurnOn(mask, mode) \
        if ((turn_on & mask) && mode) { doPut(mode); }
 
-#define TurnOff(mask,mode) \
+#define TurnOff(mask, mode) \
        if ((turn_off & mask) && mode) { doPut(mode); turn_off &= ~mask; }
 
        /* if there is no current screen, assume we *can* do color */
@@ -161,6 +163,11 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
                if (!SP_PARM || SP_PARM->_use_rmso) {
                    TurnOff(A_STANDOUT, exit_standout_mode);
                }
+#if USE_ITALIC
+               if (!SP_PARM || SP_PARM->_use_ritm) {
+                   TurnOff(A_ITALIC, exit_italics_mode);
+               }
+#endif
            }
            previous_attr &= ALL_BUT_COLOR;
            previous_pair = 0;
@@ -185,6 +192,15 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
            previous_attr &= ALL_BUT_COLOR;
            previous_pair = 0;
        }
+#if USE_ITALIC
+       if (!SP_PARM || SP_PARM->_use_ritm) {
+           if (turn_on & A_ITALIC) {
+               TurnOn(A_ITALIC, enter_italics_mode);
+           } else if (turn_off & A_ITALIC) {
+               TurnOff(A_ITALIC, exit_italics_mode);
+           }
+       }
+#endif
        SetColorsIf((pair != 0) || fix_pair0, previous_attr, previous_pair);
     } else {
 
@@ -199,7 +215,11 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
        if (!SP_PARM || SP_PARM->_use_rmso) {
            TurnOff(A_STANDOUT, exit_standout_mode);
        }
-
+#if USE_ITALIC
+       if (!SP_PARM || SP_PARM->_use_ritm) {
+           TurnOff(A_ITALIC, exit_italics_mode);
+       }
+#endif
        if (turn_off && exit_attribute_mode) {
            doPut(exit_attribute_mode);
            turn_on |= (newmode & ALL_BUT_COLOR);
@@ -219,6 +239,9 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
        TurnOn(A_PROTECT,       enter_protected_mode);
        TurnOn(A_INVIS,         enter_secure_mode);
        TurnOn(A_UNDERLINE,     enter_underline_mode);
+#if USE_ITALIC
+       TurnOn(A_ITALIC,        enter_italics_mode);
+#endif
 #if USE_WIDEC_SUPPORT
        TurnOn(A_HORIZONTAL,    enter_horizontal_hl_mode);
        TurnOn(A_LEFT,          enter_left_hl_mode);
index ee9821f66a0f6accb536949bc999aaece98d6785..4e173349ee0a101ed8e2a32ffe67514b17f2d644 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (5.9-20130824) unstable; urgency=low
+ncurses6 (5.9-20130831) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 24 Aug 2013 08:26:13 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 31 Aug 2013 06:53:48 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index bb0f8d27c3c1484d481a497f1eb631d79d7cdcf4..bada23621efcbaa35da15c4b791553762af624e0 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Release: 5.9
-Version: 20130824
+Version: 20130831
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{release}-%{version}.tgz
index dfff897490ddf488404852b67617e61a61717be1..63be527a24dbc02dd6edeb3db6691d4f24c96131 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Release: 5.9
-Version: 20130824
+Version: 20130831
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{release}-%{version}.tgz
index 4722e3f871fd38de89486c0497d4dd6ed2beb5a8..e34c54aca5684d66852dcef6d6335d0870872260 100644 (file)
@@ -40,7 +40,7 @@ AUTHOR
    Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
            Thomas E. Dickey (beginning revision 1.27 in 1996).
 
-$Id: ncurses.c,v 1.389 2013/04/27 19:46:53 tom Exp $
+$Id: ncurses.c,v 1.392 2013/08/31 20:47:55 tom Exp $
 
 ***************************************************************************/
 
@@ -1428,6 +1428,9 @@ show_attr(int row, int skip, bool arrow, chtype attr, const char *name)
                    A_BOLD,
 #ifdef A_INVIS
                    A_INVIS,
+#endif
+#ifdef A_ITALIC
+                   A_ITALIC,
 #endif
                    A_PROTECT,
                    A_ALTCHARSET
@@ -1450,11 +1453,13 @@ show_attr(int row, int skip, bool arrow, chtype attr, const char *name)
     }
     return row + 2;
 }
+
+typedef struct {
+    attr_t attr;
+    NCURSES_CONST char *name;
+} ATTR_TBL;
 /* *INDENT-OFF* */
-static const struct {
-    chtype                     attr;
-    NCURSES_CONST char *       name;
-} attrs_to_test[] = {
+static const ATTR_TBL attrs_to_test[] = {
     { A_STANDOUT,      "STANDOUT" },
     { A_REVERSE,       "REVERSE" },
     { A_BOLD,          "BOLD" },
@@ -1464,13 +1469,31 @@ static const struct {
     { A_PROTECT,       "PROTECT" },
 #ifdef A_INVIS
     { A_INVIS,         "INVISIBLE" },
+#endif
+#ifdef A_ITALIC
+    { A_ITALIC,                "ITALIC" },
 #endif
     { A_NORMAL,                "NORMAL" },
 };
 /* *INDENT-ON* */
 
+static unsigned
+init_attr_list(ATTR_TBL * target, attr_t attrs)
+{
+    unsigned result = 0;
+    size_t n;
+
+    for (n = 0; n < SIZEOF(attrs_to_test); ++n) {
+       attr_t test = attrs_to_test[n].attr;
+       if (test == A_NORMAL || (test & attrs) != 0) {
+           target[result++] = attrs_to_test[n];
+       }
+    }
+    return result;
+}
+
 static bool
-attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc)
+attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc, unsigned limit)
 {
     bool result = TRUE;
     bool error = FALSE;
@@ -1503,13 +1526,13 @@ attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc)
                break;
            case 'v':
                if (*kc == 0)
-                   *kc = SIZEOF(attrs_to_test) - 1;
+                   *kc = limit - 1;
                else
                    *kc -= 1;
                break;
            case 'V':
                *kc += 1;
-               if (*kc >= SIZEOF(attrs_to_test))
+               if (*kc >= limit)
                    *kc = 0;
                break;
            case '<':
@@ -1541,67 +1564,73 @@ attr_test(void)
     short tx = -1;
     int ac = 0;
     unsigned j, k;
+    ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+    unsigned my_size = init_attr_list(my_list, termattrs());
 
-    if (skip < 0)
-       skip = 0;
+    if (my_size > 1) {
+       if (skip < 0)
+           skip = 0;
 
-    n = skip;                  /* make it easy */
-    k = SIZEOF(attrs_to_test) - 1;
-    init_attr_string();
+       n = skip;               /* make it easy */
+       k = my_size - 1;
+       init_attr_string();
 
-    do {
-       int row = 2;
-       chtype normal = A_NORMAL | BLANK;
-       chtype extras = (chtype) ac;
+       do {
+           int row = 2;
+           chtype normal = A_NORMAL | BLANK;
+           chtype extras = (chtype) ac;
 
-       if (use_colors) {
-           short pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK);
-           if (pair != 0) {
-               pair = 1;
-               if (init_pair(pair, fg, bg) == ERR) {
-                   beep();
-               } else {
-                   normal |= (chtype) COLOR_PAIR(pair);
+           if (use_colors) {
+               short pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK);
+               if (pair != 0) {
+                   pair = 1;
+                   if (init_pair(pair, fg, bg) == ERR) {
+                       beep();
+                   } else {
+                       normal |= (chtype) COLOR_PAIR(pair);
+                   }
                }
-           }
-           if (tx >= 0) {
-               pair = 2;
-               if (init_pair(pair, tx, bg) == ERR) {
-                   beep();
-               } else {
-                   extras |= (chtype) COLOR_PAIR(pair);
+               if (tx >= 0) {
+                   pair = 2;
+                   if (init_pair(pair, tx, bg) == ERR) {
+                       beep();
+                   } else {
+                       extras |= (chtype) COLOR_PAIR(pair);
+                   }
                }
            }
-       }
-       bkgd(normal);
-       bkgdset(normal);
-       erase();
+           bkgd(normal);
+           bkgdset(normal);
+           erase();
 
-       box(stdscr, 0, 0);
-       MvAddStr(0, 20, "Character attribute test display");
+           box(stdscr, 0, 0);
+           MvAddStr(0, 20, "Character attribute test display");
 
-       for (j = 0; j < SIZEOF(attrs_to_test); ++j) {
-           bool arrow = (j == k);
-           row = show_attr(row, n, arrow,
-                           extras |
-                           attrs_to_test[j].attr |
-                           attrs_to_test[k].attr,
-                           attrs_to_test[j].name);
-       }
+           for (j = 0; j < my_size; ++j) {
+               bool arrow = (j == k);
+               row = show_attr(row, n, arrow,
+                               extras |
+                               my_list[j].attr |
+                               my_list[k].attr,
+                               my_list[j].name);
+           }
 
-       MvPrintw(row, 8,
-                "This terminal does %shave the magic-cookie glitch",
-                get_xmc() > -1 ? "" : "not ");
-       MvPrintw(row + 1, 8, "Enter '?' for help.");
-       show_color_attr(fg, bg, tx);
-       printw("  ACS (%d)", ac != 0);
+           MvPrintw(row, 8,
+                    "This terminal does %shave the magic-cookie glitch",
+                    get_xmc() > -1 ? "" : "not ");
+           MvPrintw(row + 1, 8, "Enter '?' for help.");
+           show_color_attr(fg, bg, tx);
+           printw("  ACS (%d)", ac != 0);
 
-       refresh();
-    } while (attr_getc(&n, &fg, &bg, &tx, &ac, &k));
+           refresh();
+       } while (attr_getc(&n, &fg, &bg, &tx, &ac, &k, my_size));
 
-    bkgdset(A_NORMAL | BLANK);
-    erase();
-    endwin();
+       bkgdset(A_NORMAL | BLANK);
+       erase();
+       endwin();
+    } else {
+       Cannot("does not support video attributes.");
+    }
 }
 
 #if USE_WIDEC_SUPPORT
@@ -1747,7 +1776,10 @@ wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const cha
 }
 
 static bool
-wide_attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc)
+wide_attr_getc(int *skip,
+              short *fg, short *bg,
+              short *tx, int *ac,
+              unsigned *kc, unsigned limit)
 {
     bool result = TRUE;
     bool error = FALSE;
@@ -1780,13 +1812,13 @@ wide_attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc
                break;
            case 'v':
                if (*kc == 0)
-                   *kc = SIZEOF(attrs_to_test) - 1;
+                   *kc = limit - 1;
                else
                    *kc -= 1;
                break;
            case 'V':
                *kc += 1;
-               if (*kc >= SIZEOF(attrs_to_test))
+               if (*kc >= limit)
                    *kc = 0;
                break;
            case '<':
@@ -1818,63 +1850,69 @@ wide_attr_test(void)
     short tx = -1;
     int ac = 0;
     unsigned j, k;
+    ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+    unsigned my_size = init_attr_list(my_list, term_attrs());
 
-    if (skip < 0)
-       skip = 0;
+    if (my_size > 1) {
+       if (skip < 0)
+           skip = 0;
 
-    n = skip;                  /* make it easy */
-    k = SIZEOF(attrs_to_test) - 1;
-    wide_init_attr_string();
+       n = skip;               /* make it easy */
+       k = my_size - 1;
+       wide_init_attr_string();
 
-    do {
-       int row = 2;
-       short pair = 0;
-       short extras = 0;
+       do {
+           int row = 2;
+           short pair = 0;
+           short extras = 0;
 
-       if (use_colors) {
-           pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK);
-           if (pair != 0) {
-               pair = 1;
-               if (init_pair(pair, fg, bg) == ERR) {
-                   beep();
+           if (use_colors) {
+               pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK);
+               if (pair != 0) {
+                   pair = 1;
+                   if (init_pair(pair, fg, bg) == ERR) {
+                       beep();
+                   }
                }
-           }
-           extras = pair;
-           if (tx >= 0) {
-               extras = 2;
-               if (init_pair(extras, tx, bg) == ERR) {
-                   beep();
+               extras = pair;
+               if (tx >= 0) {
+                   extras = 2;
+                   if (init_pair(extras, tx, bg) == ERR) {
+                       beep();
+                   }
                }
            }
-       }
-       set_wide_background(pair);
-       erase();
+           set_wide_background(pair);
+           erase();
 
-       box_set(stdscr, 0, 0);
-       MvAddStr(0, 20, "Character attribute test display");
+           box_set(stdscr, 0, 0);
+           MvAddStr(0, 20, "Character attribute test display");
 
-       for (j = 0; j < SIZEOF(attrs_to_test); ++j) {
-           row = wide_show_attr(row, n, j == k,
-                                ((attr_t) ac |
-                                 attrs_to_test[j].attr |
-                                 attrs_to_test[k].attr),
-                                extras,
-                                attrs_to_test[j].name);
-       }
+           for (j = 0; j < my_size; ++j) {
+               row = wide_show_attr(row, n, j == k,
+                                    ((attr_t) ac |
+                                     my_list[j].attr |
+                                     my_list[k].attr),
+                                    extras,
+                                    my_list[j].name);
+           }
 
-       MvPrintw(row, 8,
-                "This terminal does %shave the magic-cookie glitch",
-                get_xmc() > -1 ? "" : "not ");
-       MvPrintw(row + 1, 8, "Enter '?' for help.");
-       show_color_attr(fg, bg, tx);
-       printw("  ACS (%d)", ac != 0);
+           MvPrintw(row, 8,
+                    "This terminal does %shave the magic-cookie glitch",
+                    get_xmc() > -1 ? "" : "not ");
+           MvPrintw(row + 1, 8, "Enter '?' for help.");
+           show_color_attr(fg, bg, tx);
+           printw("  ACS (%d)", ac != 0);
 
-       refresh();
-    } while (wide_attr_getc(&n, &fg, &bg, &tx, &ac, &k));
+           refresh();
+       } while (wide_attr_getc(&n, &fg, &bg, &tx, &ac, &k, my_size));
 
-    set_wide_background(0);
-    erase();
-    endwin();
+       set_wide_background(0);
+       erase();
+       endwin();
+    } else {
+       Cannot("does not support extended video attributes.");
+    }
 }
 #endif
 
@@ -2610,32 +2648,19 @@ color_edit(void)
  * Alternate character-set stuff
  *
  ****************************************************************************/
-/* *INDENT-OFF* */
-static struct {
-    chtype attr;
-    const char *name;
-} attrs_to_cycle[] = {
-    { A_NORMAL,                "normal" },
-    { A_BOLD,          "bold" },
-    { A_BLINK,         "blink" },
-    { A_REVERSE,       "reverse" },
-    { A_UNDERLINE,     "underline" },
-};
-/* *INDENT-ON* */
-
 static bool
-cycle_attr(int ch, unsigned *at_code, chtype *attr)
+cycle_attr(int ch, unsigned *at_code, chtype *attr, ATTR_TBL * list, unsigned limit)
 {
     bool result = TRUE;
 
     switch (ch) {
     case 'v':
-       if ((*at_code += 1) >= SIZEOF(attrs_to_cycle))
+       if ((*at_code += 1) >= limit)
            *at_code = 0;
        break;
     case 'V':
        if (*at_code == 0)
-           *at_code = SIZEOF(attrs_to_cycle) - 1;
+           *at_code = limit - 1;
        else
            *at_code -= 1;
        break;
@@ -2644,7 +2669,7 @@ cycle_attr(int ch, unsigned *at_code, chtype *attr)
        break;
     }
     if (result)
-       *attr = attrs_to_cycle[*at_code].attr;
+       *attr = list[*at_code].attr;
     return result;
 }
 
@@ -2763,6 +2788,8 @@ slk_test(void)
     int bg = COLOR_WHITE;
     short pair = 0;
 #endif
+    ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+    unsigned my_size = init_attr_list(my_list, termattrs());
 
     c = CTRL('l');
 #if HAVE_SLK_COLOR
@@ -2843,7 +2870,7 @@ slk_test(void)
 #endif
 
        default:
-           if (cycle_attr(c, &at_code, &attr)) {
+           if (cycle_attr(c, &at_code, &attr, my_list, my_size)) {
                slk_attrset(attr);
                slk_touch();
                slk_noutrefresh();
@@ -2884,6 +2911,8 @@ wide_slk_test(void)
     int fg = COLOR_BLACK;
     int bg = COLOR_WHITE;
     short pair = 0;
+    ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+    unsigned my_size = init_attr_list(my_list, term_attrs());
 
     c = CTRL('l');
     if (use_colors) {
@@ -2995,7 +3024,7 @@ wide_slk_test(void)
            break;
 #endif
        default:
-           if (cycle_attr(c, &at_code, &attr)) {
+           if (cycle_attr(c, &at_code, &attr, my_list, my_size)) {
                slk_attr_set(attr, (short) (fg || bg), NULL);
                slk_touch();
                slk_noutrefresh();
@@ -3263,6 +3292,8 @@ acs_display(void)
     unsigned at_code = 0;
     short pair = 0;
     void (*last_show_acs) (int, attr_t, short) = 0;
+    ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+    unsigned my_size = init_attr_list(my_list, termattrs());
 
     do {
        switch (c) {
@@ -3320,7 +3351,7 @@ acs_display(void)
                --repeat;
            break;
        default:
-           if (cycle_attr(c, &at_code, &attr)
+           if (cycle_attr(c, &at_code, &attr, my_list, my_size)
                || cycle_colors(c, &fg, &bg, &pair)) {
                break;
            } else {
@@ -3344,12 +3375,12 @@ acs_display(void)
        if (use_colors) {
            MvPrintw(LINES - 1, 0,
                     "v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.",
-                    attrs_to_cycle[at_code].name,
+                    my_list[at_code].name,
                     fg, bg);
        } else {
            MvPrintw(LINES - 1, 0,
                     "v/V cycles through video attributes (%s).",
-                    attrs_to_cycle[at_code].name);
+                    my_list[at_code].name);
        }
        refresh();
     } while (!isQuit(c = Getchar()));
@@ -3803,6 +3834,8 @@ wide_acs_display(void)
     unsigned at_code = 0;
     short pair = 0;
     void (*last_show_wacs) (int, attr_t, short) = 0;
+    ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+    unsigned my_size = init_attr_list(my_list, term_attrs());
 
     do {
        switch (c) {
@@ -3852,7 +3885,7 @@ wide_acs_display(void)
            } else if (c == '_') {
                space = (space == ' ') ? '_' : ' ';
                last_show_wacs = 0;
-           } else if (cycle_attr(c, &at_code, &attr)
+           } else if (cycle_attr(c, &at_code, &attr, my_list, my_size)
                       || cycle_colors(c, &fg, &bg, &pair)) {
                if (last_show_wacs != 0)
                    break;
@@ -3877,12 +3910,12 @@ wide_acs_display(void)
        if (use_colors) {
            MvPrintw(LINES - 2, 2,
                     "v/V, f/F, b/B cycle through video attributes (%s) and color %d/%d.",
-                    attrs_to_cycle[at_code].name,
+                    my_list[at_code].name,
                     fg, bg);
        } else {
            MvPrintw(LINES - 2, 2,
                     "v/V cycles through video attributes (%s).",
-                    attrs_to_cycle[at_code].name);
+                    my_list[at_code].name);
        }
        refresh();
     } while (!isQuit(c = Getchar()));