+ correct check in win_driver.c for saving screen contents, e.g., when
NCURSES_CONSOLE2 is set (cf:
20140503).
+ reorganize b/B menu items in ncurses.c, putting the test-strings into
subwindows. This is needed for a planned change to use Unicode
fullwidth characters in the test-screens.
+ correct update to form status for _NEWTOP, broken by fixes for
compiler warnings (patch by Leon Winter, cf:
20120616).
12 files changed:
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2229 2014/06/21 21:51:45 tom Exp $
+-- $Id: NEWS,v 1.2234 2014/06/29 23:43:38 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
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
+20140629
+ + correct check in win_driver.c for saving screen contents, e.g., when
+ NCURSES_CONSOLE2 is set (cf: 20140503).
+ + reorganize b/B menu items in ncurses.c, putting the test-strings into
+ subwindows. This is needed for a planned change to use Unicode
+ fullwidth characters in the test-screens.
+ + correct update to form status for _NEWTOP, broken by fixes for
+ compiler warnings (patch by Leon Winter, cf: 20120616).
+
20140621
+ change shared-library suffix for AIX 5 and 6 to ".so", avoiding
conflict with the static library (report by Ben Lentz).
20140621
+ change shared-library suffix for AIX 5 and 6 to ".so", avoiding
conflict with the static library (report by Ben Lentz).
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.992 2014/06/21 14:35:14 tom Exp $
+# $Id: dist.mk,v 1.994 2014/06/28 21:47:46 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
# 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
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 5
NCURSES_MINOR = 9
-NCURSES_PATCH = 20140621
+NCURSES_PATCH = 20140629
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
-MODULE_ID("$Id: frm_driver.c,v 1.111 2014/03/08 22:08:20 Xin.Li Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.112 2014/06/28 16:28:22 Leon.Winter Exp $")
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
/*----------------------------------------------------------------------------
This is the core module of the form library. It contains the majority
{
res = fct(form);
if (res == E_OK)
{
res = fct(form);
if (res == E_OK)
- SetStatus(form, _NEWTOP);
+ SetStatus(form->current, _NEWTOP);
#define CUR my_term.type.
#define CUR my_term.type.
-MODULE_ID("$Id: win_driver.c,v 1.38 2014/05/10 21:50:00 tom Exp $")
+MODULE_ID("$Id: win_driver.c,v 1.39 2014/06/29 22:48:17 tom Exp $")
#ifndef __GNUC__
# error We need GCC to compile for MinGW
#ifndef __GNUC__
# error We need GCC to compile for MinGW
if (CON.hdl != INVALID_HANDLE_VALUE) {
CON.buffered = buffered;
get_SBI();
if (CON.hdl != INVALID_HANDLE_VALUE) {
CON.buffered = buffered;
get_SBI();
save_original_screen();
}
}
save_original_screen();
}
}
-ncurses6 (5.9-20140621) unstable; urgency=low
+ncurses6 (5.9-20140629) unstable; urgency=low
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 21 Jun 2014 10:35:14 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 28 Jun 2014 17:47:47 -0400
ncurses6 (5.9-20131005) unstable; urgency=low
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (5.9-20140621) unstable; urgency=low
+ncurses6 (5.9-20140629) unstable; urgency=low
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 21 Jun 2014 10:35:14 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 28 Jun 2014 17:47:47 -0400
ncurses6 (5.9-20131005) unstable; urgency=low
ncurses6 (5.9-20131005) unstable; urgency=low
-ncurses6 (5.9-20140621) unstable; urgency=low
+ncurses6 (5.9-20140629) unstable; urgency=low
- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 21 Jun 2014 10:35:14 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 28 Jun 2014 17:47:47 -0400
ncurses6 (5.9-20120608) unstable; urgency=low
ncurses6 (5.9-20120608) unstable; urgency=low
-; $Id: mingw-ncurses.nsi,v 1.47 2014/06/21 14:35:14 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.49 2014/06/28 21:47:47 tom Exp $\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
\r
; TODO add examples\r
; TODO bump ABI to 6\r
!define VERSION_MAJOR "5"\r
!define VERSION_MINOR "9"\r
!define VERSION_YYYY "2014"\r
!define VERSION_MAJOR "5"\r
!define VERSION_MINOR "9"\r
!define VERSION_YYYY "2014"\r
-!define VERSION_MMDD "0621"\r
+!define VERSION_MMDD "0629"\r
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
\r
!define MY_ABI "5"\r
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
\r
!define MY_ABI "5"\r
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 5.9
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 5.9
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 5.9
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 5.9
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz
/*
* Author: Thomas E. Dickey
*
/*
* Author: Thomas E. Dickey
*
- * $Id: dots_curses.c,v 1.1 2014/06/21 16:07:50 tom Exp $
+ * $Id: dots_curses.c,v 1.2 2014/06/28 20:33:24 tom Exp $
*
* A simple demo of the curses interface used for comparison with termcap.
*/
*
* A simple demo of the curses interface used for comparison with termcap.
*/
for (bg = 0; bg < COLORS; bg++) {
int pair = mypair(fg, bg);
if (pair > 0)
for (bg = 0; bg < COLORS; bg++) {
int pair = mypair(fg, bg);
if (pair > 0)
- init_pair(pair, fg, bg);
+ init_pair((short) pair, (short) fg, (short) bg);
refresh();
++total_chars;
}
refresh();
++total_chars;
}
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.401 2014/06/21 18:37:29 tom Exp $
+$Id: ncurses.c,v 1.408 2014/06/28 21:45:40 tom Exp $
***************************************************************************/
***************************************************************************/
#if USE_WIDEC_SUPPORT
static wchar_t
#if USE_WIDEC_SUPPORT
static wchar_t
{
return (ch + 0xff10 - '0');
}
{
return (ch + 0xff10 - '0');
}
{
int ch;
while ((ch = *source++) != 0) {
{
int ch;
while ((ch = *source++) != 0) {
- *target++ = fullwidth_of(ch);
+ *target++ = fullwidth_digit(ch);
- source[0] = fullwidth_of(digit + '0');
+ source[0] = fullwidth_digit(digit + '0');
source[1] = 0;
setcchar(target, source, A_NORMAL, 0, 0);
}
source[1] = 0;
setcchar(target, source, A_NORMAL, 0, 0);
}
#define termattrs() my_termattrs()
#endif
#define termattrs() my_termattrs()
#endif
-#define MAX_ATTRSTRING 31
-#define LEN_ATTRSTRING 26
+#define ATTRSTRING_1ST 32 /* ' ' */
+#define ATTRSTRING_END 126 /* '~' */
+
+#define COL_ATTRSTRING 25
+#define MARGIN_4_ATTRS (COL_ATTRSTRING + 8)
+#define LEN_ATTRSTRING (COLS - MARGIN_4_ATTRS)
+#define MAX_ATTRSTRING (ATTRSTRING_END + 1 - ATTRSTRING_1ST)
static char attr_test_string[MAX_ATTRSTRING + 1];
static char attr_test_string[MAX_ATTRSTRING + 1];
static void
adjust_attr_string(int adjust)
{
static void
adjust_attr_string(int adjust)
{
- int first = ((int) UChar(attr_test_string[0])) + adjust;
- int last = first + LEN_ATTRSTRING;
+ char save = attr_test_string[0];
+ int first = ((int) UChar(save)) + adjust;
+ int j, k;
- if (first >= ' ' && last <= '~') { /* 32..126 */
- int j, k;
- for (j = 0, k = first; j < MAX_ATTRSTRING && k <= last; ++j, ++k) {
+ if (first >= ATTRSTRING_1ST) {
+ for (j = 0, k = first; j < MAX_ATTRSTRING; ++j, ++k) {
+ if (k > ATTRSTRING_END)
+ break;
attr_test_string[j] = (char) k;
if (((k + 1 - first) % 5) == 0) {
if (++j >= MAX_ATTRSTRING)
attr_test_string[j] = (char) k;
if (((k + 1 - first) % 5) == 0) {
if (++j >= MAX_ATTRSTRING)
attr_test_string[j] = ' ';
}
}
attr_test_string[j] = ' ';
}
}
- while (j < MAX_ATTRSTRING)
- attr_test_string[j++] = ' ';
- attr_test_string[j] = '\0';
- } else {
- beep();
+ if ((LEN_ATTRSTRING - j) > 5) {
+ attr_test_string[0] = save;
+ adjust_attr_string(adjust - 1);
+ } else {
+ while (j < MAX_ATTRSTRING)
+ attr_test_string[j++] = ' ';
+ attr_test_string[j] = '\0';
+ }
+/*
+ * Prefer the right-end of the string for starting, since that maps to the
+ * VT100 line-drawing.
+ */
+static int
+default_attr_string(void)
+{
+ int result = (ATTRSTRING_END - LEN_ATTRSTRING);
+ result += (LEN_ATTRSTRING / 5);
+ if (result < ATTRSTRING_1ST)
+ result = ATTRSTRING_1ST;
+ return result;
+}
+
static void
init_attr_string(void)
{
static void
init_attr_string(void)
{
- attr_test_string[0] = 'a';
+ attr_test_string[0] = (char) default_attr_string();
adjust_attr_string(0);
}
static int
adjust_attr_string(0);
}
static int
-show_attr(int row, int skip, bool arrow, chtype attr, const char *name)
+show_attr(WINDOW *win, int row, int skip, bool arrow, chtype attr, const char *name)
{
int ncv = get_ncv();
chtype test = attr & (chtype) (~A_ALTCHARSET);
{
int ncv = get_ncv();
chtype test = attr & (chtype) (~A_ALTCHARSET);
if (arrow)
MvPrintw(row, 5, "-->");
MvPrintw(row, 8, "%s mode:", name);
if (arrow)
MvPrintw(row, 5, "-->");
MvPrintw(row, 8, "%s mode:", name);
- MvPrintw(row, 24, "|");
+ MvPrintw(row, COL_ATTRSTRING - 1, "|");
if (skip)
printw("%*s", skip, " ");
/*
if (skip)
printw("%*s", skip, " ");
/*
* character at a time (to pass its rendition directly), and use the
* string operation for the other attributes.
*/
* character at a time (to pass its rendition directly), and use the
* string operation for the other attributes.
*/
if (attr & A_ALTCHARSET) {
const char *s;
chtype ch;
for (s = attr_test_string; *s != '\0'; ++s) {
ch = UChar(*s);
if (attr & A_ALTCHARSET) {
const char *s;
chtype ch;
for (s = attr_test_string; *s != '\0'; ++s) {
ch = UChar(*s);
+ (void) waddch(win, ch | attr);
- (void) attrset(attr);
- addstr(attr_test_string);
- attroff(attr);
+ (void) wattrset(win, attr);
+ (void) waddstr(win, attr_test_string);
+ (void) wattroff(win, attr);
}
if (skip)
printw("%*s", skip, " ");
}
if (skip)
printw("%*s", skip, " ");
+ MvPrintw(row, COL_ATTRSTRING + LEN_ATTRSTRING, "|");
if (test != A_NORMAL) {
if (!(termattrs() & test)) {
printw(" (N/A)");
if (test != A_NORMAL) {
if (!(termattrs() & test)) {
printw(" (N/A)");
NCURSES_COLOR_T tx = -1;
int ac = 0;
unsigned j, k;
NCURSES_COLOR_T tx = -1;
int ac = 0;
unsigned j, k;
+ WINDOW *my_wins[SIZEOF(attrs_to_test)];
ATTR_TBL my_list[SIZEOF(attrs_to_test)];
unsigned my_size = init_attr_list(my_list, termattrs());
if (my_size > 1) {
ATTR_TBL my_list[SIZEOF(attrs_to_test)];
unsigned my_size = init_attr_list(my_list, termattrs());
if (my_size > 1) {
+ for (j = 0; j < my_size; ++j) {
+ my_wins[j] = subwin(stdscr,
+ 1, LEN_ATTRSTRING,
+ 2 + (int) (2 * j), COL_ATTRSTRING);
+ scrollok(my_wins[j], FALSE);
+ }
+
for (j = 0; j < my_size; ++j) {
bool arrow = (j == k);
for (j = 0; j < my_size; ++j) {
bool arrow = (j == k);
- row = show_attr(row, n, arrow,
+ row = show_attr(my_wins[j], row, n, arrow,
extras |
my_list[j].attr |
my_list[k].attr,
extras |
my_list[j].attr |
my_list[k].attr,
static void
wide_adjust_attr_string(int adjust)
{
static void
wide_adjust_attr_string(int adjust)
{
- int first = ((int) UChar(wide_attr_test_string[0])) + adjust;
- int last = first + LEN_ATTRSTRING;
+ char save = (char) wide_attr_test_string[0];
+ int first = ((int) UChar(save)) + adjust;
+ int j, k;
- if (first >= ' ' && last <= '~') { /* 32..126 */
- int j, k;
- for (j = 0, k = first; j < MAX_ATTRSTRING && k <= last; ++j, ++k) {
+ if (first >= ATTRSTRING_1ST) {
+ for (j = 0, k = first; j < MAX_ATTRSTRING; ++j, ++k) {
+ if (k > ATTRSTRING_END)
+ break;
wide_attr_test_string[j] = k;
if (((k + 1 - first) % 5) == 0) {
if (++j >= MAX_ATTRSTRING)
wide_attr_test_string[j] = k;
if (((k + 1 - first) % 5) == 0) {
if (++j >= MAX_ATTRSTRING)
wide_attr_test_string[j] = ' ';
}
}
wide_attr_test_string[j] = ' ';
}
}
- while (j < MAX_ATTRSTRING)
- wide_attr_test_string[j++] = ' ';
- wide_attr_test_string[j] = '\0';
- } else {
- beep();
+ if ((LEN_ATTRSTRING - j) > 5) {
+ wide_attr_test_string[0] = save;
+ wide_adjust_attr_string(adjust - 1);
+ } else {
+ while (j < MAX_ATTRSTRING)
+ wide_attr_test_string[j++] = ' ';
+ wide_attr_test_string[j] = '\0';
+ }
}
}
static void
wide_init_attr_string(void)
{
}
}
static void
wide_init_attr_string(void)
{
- wide_attr_test_string[0] = 'a';
+ wide_attr_test_string[0] = default_attr_string();
wide_adjust_attr_string(0);
}
wide_adjust_attr_string(0);
}
+wide_show_attr(WINDOW *win,
+ int row,
int skip,
bool arrow,
chtype attr,
int skip,
bool arrow,
chtype attr,
if (arrow)
MvPrintw(row, 5, "-->");
MvPrintw(row, 8, "%s mode:", name);
if (arrow)
MvPrintw(row, 5, "-->");
MvPrintw(row, 8, "%s mode:", name);
- MvPrintw(row, 24, "|");
+ MvPrintw(row, COL_ATTRSTRING - 1, "|");
if (skip)
printw("%*s", skip, " ");
if (skip)
printw("%*s", skip, " ");
* character at a time (to pass its rendition directly), and use the
* string operation for the other attributes.
*/
* character at a time (to pass its rendition directly), and use the
* string operation for the other attributes.
*/
if (attr & WA_ALTCHARSET) {
const wchar_t *s;
cchar_t ch;
if (attr & WA_ALTCHARSET) {
const wchar_t *s;
cchar_t ch;
fill[0] = *s;
fill[1] = L'\0';
setcchar(&ch, fill, attr, pair, 0);
fill[0] = *s;
fill[1] = L'\0';
setcchar(&ch, fill, attr, pair, 0);
+ (void) wadd_wch(win, &ch);
}
} else {
attr_t old_attr = 0;
NCURSES_PAIRS_T old_pair = 0;
}
} else {
attr_t old_attr = 0;
NCURSES_PAIRS_T old_pair = 0;
- (void) (attr_get) (&old_attr, &old_pair, 0);
- (void) attr_set(attr, pair, 0);
- addwstr(wide_attr_test_string);
- (void) attr_set(old_attr, old_pair, 0);
+ (void) (wattr_get) (win, &old_attr, &old_pair, 0);
+ (void) wattr_set(win, attr, pair, 0);
+ (void) waddwstr(win, wide_attr_test_string);
+ (void) wattr_set(win, old_attr, old_pair, 0);
}
if (skip)
printw("%*s", skip, " ");
}
if (skip)
printw("%*s", skip, " ");
+ MvPrintw(row, COL_ATTRSTRING + LEN_ATTRSTRING, "|");
if (test != A_NORMAL) {
if (!(term_attrs() & test)) {
printw(" (N/A)");
if (test != A_NORMAL) {
if (!(term_attrs() & test)) {
printw(" (N/A)");
int ac = 0;
unsigned j, k;
ATTR_TBL my_list[SIZEOF(attrs_to_test)];
int ac = 0;
unsigned j, k;
ATTR_TBL my_list[SIZEOF(attrs_to_test)];
+ WINDOW *my_wins[SIZEOF(attrs_to_test)];
unsigned my_size = init_attr_list(my_list, term_attrs());
if (my_size > 1) {
unsigned my_size = init_attr_list(my_list, term_attrs());
if (my_size > 1) {
+ for (j = 0; j < my_size; ++j) {
+ my_wins[j] = subwin(stdscr,
+ 1, LEN_ATTRSTRING,
+ 2 + (int) (2 * j), COL_ATTRSTRING);
+ scrollok(my_wins[j], FALSE);
+ }
+
MvAddStr(0, 20, "Character attribute test display");
for (j = 0; j < my_size; ++j) {
MvAddStr(0, 20, "Character attribute test display");
for (j = 0; j < my_size; ++j) {
- row = wide_show_attr(row, n, j == k,
+ row = wide_show_attr(my_wins[j], row, n, (j == k),
((attr_t) ac |
my_list[j].attr |
my_list[k].attr),
((attr_t) ac |
my_list[j].attr |
my_list[k].attr),
fill_panel(win)
--------------------------------------------------------------------------*/
static void
fill_panel(win)
--------------------------------------------------------------------------*/
static void
{
register int y, x;
for (y = 0; y < LINES - 1; y++) {
for (x = 0; x < COLS; x++)
{
register int y, x;
for (y = 0; y < LINES - 1; y++) {
for (x = 0; x < COLS; x++)
- wprintw(stdscr, "%d", (y + x) % 10);
+ wprintw(win, "%d", (y + x) % 10);
#if USE_WIDEC_SUPPORT
static void
#if USE_WIDEC_SUPPORT
static void
+init_wide_panel(WINDOW *win)
{
int digit;
cchar_t temp[10];
{
int digit;
cchar_t temp[10];
int y, x;
getyx(stdscr, y, x);
digit = (y + x / 2) % 10;
int y, x;
getyx(stdscr, y, x);
digit = (y + x / 2) % 10;
- } while (add_wch(&temp[digit]) != ERR);
+ } while (wadd_wch(win, &temp[digit]) != ERR);
-demo_panels(void (*InitPanel) (void), void (*FillPanel) (PANEL *))
+demo_panels(void (*InitPanel) (WINDOW *), void (*FillPanel) (PANEL *))
scrollok(stdscr, FALSE); /* we don't want stdscr to scroll! */
refresh();
scrollok(stdscr, FALSE); /* we don't want stdscr to scroll! */
refresh();
for (count = 0; count < 5; count++) {
px[1] = mkpanel(COLOR_RED,
LINES / 2 - 2,
for (count = 0; count < 5; count++) {
px[1] = mkpanel(COLOR_RED,
LINES / 2 - 2,