-- 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
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
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.
# 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
# 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)
* 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
#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
#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
'\" 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 *
.\" 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
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
\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
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
\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
.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
-.\" $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.
.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
.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
.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
.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
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
/****************************************************************************
- * 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 *
#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
/* 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
#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);
/****************************************************************************
- * 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 *
#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
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
****************************************************************************/
/*
- * $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
*
#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.
/* 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 */
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) {\
#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;
#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
# 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,
if (sp && sp->_coloron)
attrs |= A_COLOR;
+#if USE_ITALIC
+ if (enter_italics_mode)
+ attrs |= A_ITALIC;
+#endif
+
return (attrs);
}
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
/****************************************************************************
- * 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 *
#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))
{ A_CHARTEXT, "A_CHARTEXT" },
{ A_NORMAL, "A_NORMAL" },
{ A_COLOR, "A_COLOR" },
+#if USE_ITALIC
+ { A_ITALIC, "A_ITALIC" },
+#endif
/* *INDENT-ON* */
}
#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); \
A_BOLD,
A_INVIS,
A_PROTECT,
+#if USE_ITALIC
+ A_ITALIC,
+#endif
};
unsigned n;
int used = 0;
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;
}
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 {
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);
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);
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;
if (SP_PARM->_coloron)
attrs |= A_COLOR;
+#if USE_ITALIC
+ if (enter_italics_mode)
+ attrs |= A_ITALIC;
#endif
+
+#endif /* USE_TERM_DRIVER */
}
returnChtype(attrs);
}
#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 */
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;
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 {
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);
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);
-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
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
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
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 $
***************************************************************************/
A_BOLD,
#ifdef A_INVIS
A_INVIS,
+#endif
+#ifdef A_ITALIC
+ A_ITALIC,
#endif
A_PROTECT,
A_ALTCHARSET
}
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" },
{ 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;
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 '<':
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
}
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;
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 '<':
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
* 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;
break;
}
if (result)
- *attr = attrs_to_cycle[*at_code].attr;
+ *attr = list[*at_code].attr;
return result;
}
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
#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();
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) {
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();
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) {
--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 {
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()));
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) {
} 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;
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()));