-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1325 2008/11/23 00:20:04 tom Exp $
+-- $Id: NEWS,v 1.1330 2008/11/29 21:08:00 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.
+20081129
+ + improve a workaround in adding wide-characters, when a control
+ character is found. The library (cf: 20040207) uses unctrl() to
+ obtain a printable version of the control character, but was not
+ passing color or video attributes.
+ + improve test/ncurses.c 'a' test, using unctrl() more consistently to
+ display meta-characters.
+ + turn on _XOPEN_CURSES definition in curses.h
+ + add eterm-color entry (report by Vincent Lefevre) -TD
+ + correct use of key_name() in test/ncurses.c 'A' test, which only
+ displays wide-characters, not key-codes since 20070612 (report by
+ Ricardo Cantu).
+
20081122
+ change _nc_has_mouse() to has_mouse(), reflect its use in C++ and
Ada95 (patch by Juergen Pfeifer).
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: TO-DO,v 1.52 2008/11/22 22:58:59 tom Exp $
+-- $Id: TO-DO,v 1.53 2008/11/28 16:39:12 tom Exp $
-------------------------------------------------------------------------------
SHORT-TERM TO-DO ITEMS:
+ Scrolling optimization has holes: for example, it forces repaints of the
screen between calls to refresh().
-+ SVr4 uses slightly different rules for determining when softkeys are shown.
++ SVr4 uses slightly different rules for determining when softkeys are shown.
For example, they are initially displayed (before the ncurses 'e' test
activates them), and a touchwin can apparently also force them to be
displayed.
+ The window classes defined in the c++ subdirectory need documentation. Some
C++ programmer could earn a lot of good karma by doing this...
-+ vid_attr() should support the set_a_attributes (sgr1) string, but does not.
++ vid_attr() should support the set_a_attributes (sgr1) string, but does not.
There appear to be no terminals that require that functionality.
+ the configure --disable-ext-funcs option does not work for Ada95 tree.
+ the Ada95 tree requires a small fix to build on Cygwin, since the GNAT port
to that platform provides an incomplete Interrupts.Names package. For
instance (your gcc version may be different):
- /usr/lib/gcc/i686-pc-cygwin/3.4.4/adainclude/a-intnam.ads
+ /usr/lib/gcc/i686-pc-cygwin/3.4.4/adainclude/a-intnam.ads
cut here...
-------------------------------------------------------------------------------
DUMMY_INTERRUPT_1 : constant Interrupt_ID := 1;
DUMMY_INTERRUPT_2 : constant Interrupt_ID := 2;
-+ SIGINT : constant Interrupt_ID := 1;
++ SIGINT : constant Interrupt_ID := 2;
end Ada.Interrupts.Names;
-------------------------------------------------------------------------------
2. DOS port
Only a few of the files in the library depend on the terminfo format.
-It should be possible to further kernelize the package, then rewrite
+It should be possible to further kernelize the package, then rewrite
a small number of core files to produce a functionally-compatible
port that would do updates to a memory-mapped screen area. The first
result of this would be a DOS port.
move_insert, dest_tabs_magic_smso, transparent_underline,
needs_xon_xoff, hard_cursor.
Numerics: lines_of_memory, buttons.
- Strings: pkey_key, pkey_local, pkey_xmit, underline_char,
- enter_xon_mode, exit_xon_mode, xon_character, xoff_character,
+ Strings: pkey_key, pkey_local, pkey_xmit, underline_char,
+ enter_xon_mode, exit_xon_mode, xon_character, xoff_character,
display_clock, remove_clock, user[0-5], display_pc_char,
- enter_scancode_mode, exit_scancode_mode, pc_term_options,
+ enter_scancode_mode, exit_scancode_mode, pc_term_options,
scancode_escape, alt_scancode_esc.
These are the potentially important ones for ncurses. Notes:
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.673 2008/11/22 19:33:58 tom Exp $
+# $Id: dist.mk,v 1.674 2008/11/28 16:15:46 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 = 7
-NCURSES_PATCH = 20081122
+NCURSES_PATCH = 20081129
# 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.187 2008/08/30 20:11:29 tom Exp $ */
+/* $Id: curses.h.in,v 1.189 2008/11/29 18:35:46 tom Exp $ */
#ifndef __NCURSES_H
#define __NCURSES_H
#define CURSES 1
#define CURSES_H 1
-/* This should be defined for the enhanced functionality to be visible.
- * However, some of the wide-character (enhanced) functionality is missing.
- * So we do not define it (yet).
-#define _XOPEN_CURSES 1
- */
-
/* These are defined only in curses.h, and are used for conditional compiles */
#define NCURSES_VERSION_MAJOR @NCURSES_MAJOR@
#define NCURSES_VERSION_MINOR @NCURSES_MINOR@
-/* $Id: curses.wide,v 1.34 2007/03/10 17:52:23 tom Exp $ */
+/* $Id: curses.wide,v 1.36 2008/11/29 18:44:08 tom Exp $ */
/*
* vile:cmode:
* This file is part of ncurses, designed to be appended after curses.h.in
* (see that file for the relevant copyright).
*/
+#define _XOPEN_CURSES 1
+
#ifdef _XOPEN_SOURCE_EXTENDED
extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs;
# Report bugs and new terminal descriptions to
# bug-ncurses@gnu.org
#
-# $Revision: 1.342 $
-# $Date: 2008/11/15 21:54:35 $
+# $Revision: 1.343 $
+# $Date: 2008/11/29 15:27:35 $
#
# The original header is preserved below for reference. It is noted that there
# is a "newer" version which differs in some cosmetic details (but actually
sgr0=\E[m, smcup=\E7\E[?47h, smir=\E[4h, smso=\E[7m,
smul=\E[4m,
+# The codes supported by the term.el terminal emulation in GNU Emacs 22.2
+eterm-color|Emacs term.el terminal emulator term-protocol-version 0.96,
+ am, mir, msgr, xenl,
+ colors#8, cols#80, lines#24, pairs#64,
+ bel=^G, blink=\E[5m, bold=\E[1m, clear=\E[H\E[J, cr=^M,
+ csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
+ cud=\E[%p1%dB, cud1=^J, 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, ed=\E[J,
+ el=\E[K, el1=\E[1K, home=\E[H, ht=^I, ich=\E[%p1%d@,
+ il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, kbs=\177,
+ kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
+ kdch1=\E[3~, kend=\E[4~, khome=\E[1~, kich1=\E[2~,
+ knp=\E[6~, kpp=\E[5~, op=\E[39;49m, rc=\E8, rev=\E[7m,
+ ri=\EM, rmir=\E[4l, rmso=\E[27m, rmul=\E[24m, rs1=\Ec,
+ sc=\E7, setab=\E[%p1%'('%+%dm, setaf=\E[%p1%{30}%+%dm,
+ sgr=\E[0%?%p1%p3%|%t;7%;%?%p2%t;4%;%?%p4%t;5%;%?%p6%t;1%;%?%p7%t;8%;m,
+ sgr0=\E[m, smir=\E[4h, smso=\E[7m, smul=\E[4m,
+ u6=\E[%i%d;%dR, u7=\E[6n,
+
# Entries for use by the `screen' program by Juergen Weigert,
# Michael Schroeder, Oliver Laumann. The screen and
# screen-w entries came with version 3.7.1. The screen2 and screen3 entries
# * change several \E[2g (clear tab at current column) to \E[3g
# (clear all tabs) to match definition for tbc capability -TD
#
+# 2008-11-29
+# * add eterm-color -TD
+#
# The following sets edit modes for GNU EMACS.
# Local Variables:
# fill-prefix:"\t"
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_addch.c,v 1.113 2008/08/16 19:20:04 tom Exp $")
+MODULE_ID("$Id: lib_addch.c,v 1.114 2008/11/29 21:02:10 tom Exp $")
static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
int len = _nc_build_wch(win, CHREF(ch));
if (len >= -1) {
- /* handle EILSEQ */
+ attr_t attr = AttrOf(ch);
+
+ /* handle EILSEQ (i.e., when len >= -1) */
if (is8bits(CharOf(ch))) {
+ int rc = OK;
const char *s = unctrl((chtype) CharOf(ch));
- if (s[1] != 0) {
- return waddstr(win, s);
+
+ if (s[1] != '\0') {
+ while (*s != '\0') {
+ rc = waddch(win, UChar(*s) | attr);
+ if (rc != OK)
+ break;
+ ++s;
+ }
+ return rc;
}
}
if (len == -1)
- return waddch(win, ' ');
+ return waddch(win, ' ' | attr);
} else {
return OK;
}
Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
Thomas E. Dickey (beginning revision 1.27 in 1996).
-$Id: ncurses.c,v 1.329 2008/09/27 14:34:58 tom Exp $
+$Id: ncurses.c,v 1.332 2008/11/29 20:08:42 tom Exp $
***************************************************************************/
*
****************************************************************************/
+#define NUM_GETCH_FLAGS 256
+typedef bool GetchFlags[NUM_GETCH_FLAGS];
+
static void
-setup_getch(WINDOW *win, bool flags[])
+setup_getch(WINDOW *win, GetchFlags flags)
{
keypad(win, flags['k']); /* should be redundant, but for testing */
meta(win, flags['m']); /* force this to a known state */
}
static void
-wgetch_help(WINDOW *win, bool flags[])
+init_getch(WINDOW *win, GetchFlags flags)
+{
+ memset(flags, FALSE, NUM_GETCH_FLAGS);
+ flags[UChar('k')] = (win == stdscr);
+ flags[UChar('m')] = TRUE;
+
+ setup_getch(win, flags);
+}
+
+static void
+wgetch_help(WINDOW *win, GetchFlags flags)
{
static const char *help[] =
{
int first_y, first_x;
int c;
int incount = 0;
- bool flags[256];
+ GetchFlags flags;
bool blocking = (delay < 0);
- memset(flags, FALSE, sizeof(flags));
- flags[UChar('k')] = (win == stdscr);
-
- setup_getch(win, flags);
+ init_getch(win, flags);
wtimeout(win, delay);
getyx(win, first_y, first_x);
}
#endif
(void) waddstr(win, keyname(c));
- } else if (c > 0x80) {
- unsigned c2 = (unsigned) (c & 0x7f);
- if (isprint(c2))
- (void) wprintw(win, "M-%c", UChar(c2));
- else
+ } else if (c >= 0x80) {
+ unsigned c2 = (unsigned) c;
+#if !(defined(NCURSES_VERSION) || defined(_XOPEN_CURSES))
+ /* at least Solaris SVR4 curses breaks unctrl(128), etc. */
+ c2 &= 0x7f;
+#endif
+ if (isprint(c))
+ (void) wprintw(win, "%c", UChar(c));
+ else if (c2 != UChar(c))
(void) wprintw(win, "M-%s", unctrl(c2));
+ else
+ (void) wprintw(win, "%s", unctrl(c2));
waddstr(win, " (high-half character)");
} else {
if (isprint(c))
}
wtimeout(win, -1);
+
+ if (!level)
+ init_getch(win, flags);
}
static int
int first_y, first_x;
wint_t c;
int incount = 0;
- bool flags[256];
+ GetchFlags flags;
bool blocking = (delay < 0);
int y, x, code;
char *temp;
- memset(flags, FALSE, sizeof(flags));
- flags[UChar('k')] = (win == stdscr);
-
- setup_getch(win, flags);
+ init_getch(win, flags);
wtimeout(win, delay);
getyx(win, first_y, first_x);
resize_wide_boxes(level, win);
}
#endif
- (void) waddstr(win, key_name((wchar_t) c));
+ (void) waddstr(win, keyname((wchar_t) c));
} else {
+ (void) waddstr(win, key_name((wchar_t) c));
if (c < 256 && iscntrl(c)) {
- (void) wprintw(win, "%s (control character)", unctrl(c));
+ (void) wprintw(win, " (control character)");
} else {
- wchar_t c2 = (wchar_t) c;
- waddnwstr(win, &c2, 1);
- (void) wprintw(win, " = %#x (printable character)", (unsigned) c);
+ (void) wprintw(win, " = %#x (printable character)",
+ (unsigned) c);
}
}
wgetch_wrap(win, first_y);
}
wtimeout(win, -1);
+
+ if (!level)
+ init_getch(win, flags);
}
static void
int col = (n / height) * COLS / 2;
mvprintw(row, col, "%*s : ", COLS / 4, name);
- while (repeat-- >= 0) {
+ while (--repeat >= 0) {
add_wch(code);
}
return n + 1;