From f8a14dc01262d11475f9e4713a64567ae8f7fccc Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 16 Mar 2014 00:46:02 +0000 Subject: [PATCH] ncurses 5.9 - patch 20140315 + modify _nc_New_TopRow_and_CurrentItem() to ensure that the menu's top-row is adjusted as needed to ensure that the current item is on the screen (patch by Johann Klammer). + add wgetdelay() to retrieve _delay member of WINDOW if it happens to be opaque, e.g., in the pthread configuration (prompted by patch by Soren Brinkmann). --- NEWS | 10 +++++++++- dist.mk | 4 ++-- include/curses.h.in | 4 +++- man/curs_opaque.3x | 9 +++++++-- man/curs_threads.3x | 5 +++-- man/ncurses.3x | 4 ++-- menu/m_global.c | 12 ++++++++---- package/debian-mingw/changelog | 4 ++-- package/debian-mingw64/changelog | 4 ++-- package/debian/changelog | 4 ++-- package/mingw-ncurses.nsi | 4 ++-- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- 13 files changed, 44 insertions(+), 24 deletions(-) diff --git a/NEWS b/NEWS index a356be37..329d3b8a 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.2177 2014/03/08 22:10:41 tom Exp $ +-- $Id: NEWS,v 1.2180 2014/03/15 20:39:44 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. +20140315 + + modify _nc_New_TopRow_and_CurrentItem() to ensure that the menu's + top-row is adjusted as needed to ensure that the current item is + on the screen (patch by Johann Klammer). + + add wgetdelay() to retrieve _delay member of WINDOW if it happens to + be opaque, e.g., in the pthread configuration (prompted by patch by + Soren Brinkmann). + 20140308 + modify ifdef in read_entry.c to handle the case where NCURSES_USE_DATABASE is not defined (patch by Xin Li). diff --git a/dist.mk b/dist.mk index 7f43575d..2dcbe1cb 100644 --- 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.975 2014/03/08 19:20:13 tom Exp $ +# $Id: dist.mk,v 1.976 2014/03/15 16:53:42 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 = 20140308 +NCURSES_PATCH = 20140315 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/curses.h.in b/include/curses.h.in index 15c9f7f2..30da31a5 100644 --- a/include/curses.h.in +++ b/include/curses.h.in @@ -32,7 +32,7 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ -/* $Id: curses.h.in,v 1.237 2014/02/01 22:08:12 tom Exp $ */ +/* $Id: curses.h.in,v 1.238 2014/03/15 19:04:15 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -930,6 +930,7 @@ extern NCURSES_EXPORT(bool) is_pad (const WINDOW *); /* @GENERATED_EXT_FUNCS@ * extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ extern NCURSES_EXPORT(bool) is_subwin (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ +extern NCURSES_EXPORT(int) wgetdelay (const WINDOW *); /* @GENERATED_EXT_FUNCS@ */ extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* @GENERATED_EXT_FUNCS@ */ #else @@ -1349,6 +1350,7 @@ NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); #define is_scrollok(win) ((win) ? (win)->_scroll : FALSE) #define is_subwin(win) ((win) ? ((win)->_flags & _SUBWIN) != 0 : FALSE) #define is_syncok(win) ((win) ? (win)->_sync : FALSE) +#define wgetdelay(win) ((win) ? (win)->_delay : 0) #define wgetparent(win) ((win) ? (win)->_parent : 0) #define wgetscrreg(win,t,b) ((win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR) #endif diff --git a/man/curs_opaque.3x b/man/curs_opaque.3x index 8c315ddd..62eb4e0b 100644 --- a/man/curs_opaque.3x +++ b/man/curs_opaque.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 2007-2010,2013 Free Software Foundation, Inc. * +.\" Copyright (c) 2007-2013,2014 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 * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_opaque.3x,v 1.10 2013/07/20 19:42:29 tom Exp $ +.\" $Id: curs_opaque.3x,v 1.11 2014/03/15 19:24:23 tom Exp $ .TH curs_opaque 3X "" .ie \n(.g .ds `` \(lq .el .ds `` `` @@ -78,6 +78,8 @@ .br \fBWINDOW * wgetparent(const WINDOW *win);\fR .br +\fBint wgetdelay(const WINDOW *win);\fR +.br \fBint wgetscrreg(const WINDOW *win, int *top, int *bottom);\fR .br .SH DESCRIPTION @@ -123,6 +125,9 @@ i.e., created by \fBsubwin\fP or \fBderwin\fP \fBis_syncok\fR returns the value set in \fBsyncok\fR .TP 5 +\fBwgetdelay\fR +returns the delay timeout as set in \fBwtimeout\fP. +.TP 5 \fBwgetparent\fR returns the parent WINDOW pointer for subwindows, or NULL for windows having no parent. diff --git a/man/curs_threads.3x b/man/curs_threads.3x index 5732e924..cddfd16b 100644 --- a/man/curs_threads.3x +++ b/man/curs_threads.3x @@ -1,5 +1,5 @@ .\"*************************************************************************** -.\" Copyright (c) 2008-2010,2012 Free Software Foundation, Inc. * +.\" Copyright (c) 2008-2012,2014 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 * @@ -26,7 +26,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $Id: curs_threads.3x,v 1.19 2012/05/26 17:03:26 tom Exp $ +.\" $Id: curs_threads.3x,v 1.20 2014/03/15 19:25:28 tom Exp $ .TH curs_threads 3X "" .de bP .IP \(bu 4 @@ -540,6 +540,7 @@ wget_wch/screen (input-operation) wget_wstr/screen (input-operation) wgetbkgrnd/window wgetch/screen (input-operation) +wgetdelay/window wgetn_wstr/screen (input-operation) wgetnstr/screen (input-operation) wgetparent/window diff --git a/man/ncurses.3x b/man/ncurses.3x index 0c0c2ef3..9a7ec6bd 100644 --- a/man/ncurses.3x +++ b/man/ncurses.3x @@ -1,6 +1,6 @@ '\" t .\"*************************************************************************** -.\" Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. * +.\" Copyright (c) 1998-2013,2014 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: ncurses.3x,v 1.115 2014/03/08 22:07:02 tom Exp $ +.\" $Id: ncurses.3x,v 1.116 2014/03/15 19:26:00 tom Exp $ .hy 0 .TH ncurses 3X "" .ie \n(.g .ds `` \(lq diff --git a/menu/m_global.c b/menu/m_global.c index d85f207e..fc4103c2 100644 --- a/menu/m_global.c +++ b/menu/m_global.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2014 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 * @@ -37,7 +37,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_global.c,v 1.27 2012/06/10 00:09:15 tom Exp $") +MODULE_ID("$Id: m_global.c,v 1.28 2014/03/15 20:37:22 tom Exp $") static char mark[] = "-"; /* *INDENT-OFF* */ @@ -568,7 +568,9 @@ _nc_New_TopRow_and_CurrentItem( cur_item = menu->curitem; assert(cur_item); - menu->toprow = (short)new_toprow; + menu->toprow = (short)(((menu->rows - menu->frows) >= 0) + ? min(menu->rows - menu->frows, new_toprow) + : 0); menu->curitem = new_current_item; if (mterm_called) @@ -590,7 +592,9 @@ _nc_New_TopRow_and_CurrentItem( } else { /* if we are not posted, this is quite simple */ - menu->toprow = (short)new_toprow; + menu->toprow = (short)(((menu->rows - menu->frows) >= 0) + ? min(menu->rows - menu->frows, new_toprow) + : 0); menu->curitem = new_current_item; } } diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 13be3173..cff4790c 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20140308) unstable; urgency=low +ncurses6 (5.9-20140315) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 08 Mar 2014 14:20:13 -0500 + -- Thomas E. Dickey Sat, 15 Mar 2014 12:53:42 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 13be3173..cff4790c 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20140308) unstable; urgency=low +ncurses6 (5.9-20140315) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 08 Mar 2014 14:20:13 -0500 + -- Thomas E. Dickey Sat, 15 Mar 2014 12:53:42 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index 3f7600ad..c0f99aed 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (5.9-20140308) unstable; urgency=low +ncurses6 (5.9-20140315) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 08 Mar 2014 14:20:13 -0500 + -- Thomas E. Dickey Sat, 15 Mar 2014 12:53:42 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index a5b989f4..e78e4e74 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.30 2014/03/08 19:20:13 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.31 2014/03/15 16:53:42 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "5" !define VERSION_MINOR "9" !define VERSION_YYYY "2014" -!define VERSION_MMDD "0308" +!define VERSION_MMDD "0315" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 85ed94f7..cd8ad641 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 5.9 -Release: 20140308 +Release: 20140315 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index a01506d1..9bac0f44 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 5.9 -Release: 20140308 +Release: 20140315 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz -- 2.45.0