aboutsummaryrefslogtreecommitdiff
path: root/contrib/ncurses/ncurses/base
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ncurses/ncurses/base')
-rw-r--r--contrib/ncurses/ncurses/base/MKkeyname.awk10
-rw-r--r--contrib/ncurses/ncurses/base/lib_getch.c4
-rw-r--r--contrib/ncurses/ncurses/base/lib_pad.c35
-rw-r--r--contrib/ncurses/ncurses/base/lib_set_term.c22
4 files changed, 42 insertions, 29 deletions
diff --git a/contrib/ncurses/ncurses/base/MKkeyname.awk b/contrib/ncurses/ncurses/base/MKkeyname.awk
index 5aab9369857c..b8cd5da256a2 100644
--- a/contrib/ncurses/ncurses/base/MKkeyname.awk
+++ b/contrib/ncurses/ncurses/base/MKkeyname.awk
@@ -1,4 +1,4 @@
-# $Id: MKkeyname.awk,v 1.21 2002/02/23 22:36:33 tom Exp $
+# $Id: MKkeyname.awk,v 1.22 2002/05/25 22:25:06 tom Exp $
##############################################################################
# Copyright (c) 1999-2001,2002 Free Software Foundation, Inc. #
# #
@@ -49,10 +49,12 @@ END {
print "char name[20];"
print "char *p;"
print ""
+ print "\tif (c == -1) return \"-1\";"
+ print ""
print "\tfor (i = 0; _nc_key_names[i].name != 0; i++)"
print "\t\tif (_nc_key_names[i].code == c)"
print "\t\t\treturn (NCURSES_CONST char *)_nc_key_names[i].name;"
- print "\tif (c >= 256) return \"UNKNOWN KEY\";"
+ print "\tif (c < 0 || c >= 256) return \"UNKNOWN KEY\";"
print ""
print "\tif (table == 0)"
print "\t\ttable = typeCalloc(char *, 256);"
@@ -66,9 +68,7 @@ END {
print "\t\t\tp += 2;"
print "\t\t\tc -= 128;"
print "\t\t}"
- print "\t\tif (c < 0)"
- print "\t\t\tsprintf(p, \"%d\", c);"
- print "\t\telse if (c < 32)"
+ print "\t\tif (c < 32)"
print "\t\t\tsprintf(p, \"^%c\", c + '@');"
print "\t\telse if (c == 127)"
print "\t\t\tstrcpy(p, \"^?\");"
diff --git a/contrib/ncurses/ncurses/base/lib_getch.c b/contrib/ncurses/ncurses/base/lib_getch.c
index f4ecbdafe2ae..af1be33a18d5 100644
--- a/contrib/ncurses/ncurses/base/lib_getch.c
+++ b/contrib/ncurses/ncurses/base/lib_getch.c
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getch.c,v 1.60 2002/03/17 00:46:01 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.61 2002/06/16 00:31:57 tom Exp $")
#include <fifo_defs.h>
@@ -260,7 +260,7 @@ _nc_wgetch(WINDOW *win, unsigned long *result, int use_meta)
/* resizeterm can push KEY_RESIZE */
if (cooked_key_in_fifo()) {
*result = fifo_pull();
- returnCode(OK);
+ returnCode(*result >= KEY_MIN ? KEY_CODE_YES : OK);
}
}
#endif
diff --git a/contrib/ncurses/ncurses/base/lib_pad.c b/contrib/ncurses/ncurses/base/lib_pad.c
index 556fb19e6993..83983c3bbd1c 100644
--- a/contrib/ncurses/ncurses/base/lib_pad.c
+++ b/contrib/ncurses/ncurses/base/lib_pad.c
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_pad.c,v 1.36 2002/05/18 21:28:44 Kriang.Lerdsuwanakij Exp $")
+MODULE_ID("$Id: lib_pad.c,v 1.37 2002/05/23 23:39:26 tom Exp $")
NCURSES_EXPORT(WINDOW *)
newpad(int l, int c)
@@ -193,24 +193,21 @@ pnoutrefresh
i++, m++) {
register struct ldat *nline = &newscr->_line[m];
register struct ldat *oline = &win->_line[i];
- NCURSES_CH_T ch;
-
- /*
- * Special case for leftmost character of the displayed area.
- * Only half of a double-width character may be visible.
- */
- ch = oline->text[pmincol];
- if_WIDEC(isnac(ch)) {
- SetChar(ch, L(' '), AttrOf(oline->text[pmincol - 1]));
- }
- if (!CharEq(ch, nline->text[smincol])) {
- nline->text[smincol] = ch;
- CHANGED_CELL(nline, smincol);
- }
-
- for (j = pmincol + 1, n = smincol + 1; j <= pmaxcol; j++, n++) {
- if (!CharEq(oline->text[j], nline->text[n])) {
- nline->text[n] = oline->text[j];
+ for (j = pmincol, n = smincol; j <= pmaxcol; j++, n++) {
+ NCURSES_CH_T ch = oline->text[j];
+#if USE_WIDEC_SUPPORT
+ /*
+ * Special case for leftmost character of the displayed area.
+ * Only half of a double-width character may be visible.
+ */
+ if (j == pmincol
+ && j > 0
+ && isnac(ch)) {
+ SetChar(ch, L(' '), AttrOf(oline->text[j - 1]));
+ }
+#endif
+ if (!CharEq(ch, nline->text[n])) {
+ nline->text[n] = ch;
CHANGED_CELL(nline, n);
}
}
diff --git a/contrib/ncurses/ncurses/base/lib_set_term.c b/contrib/ncurses/ncurses/base/lib_set_term.c
index 03bb5bfaaac2..f3940fa03c1c 100644
--- a/contrib/ncurses/ncurses/base/lib_set_term.c
+++ b/contrib/ncurses/ncurses/base/lib_set_term.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2001,2002 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 @@
#include <term.h> /* cur_term */
#include <tic.h>
-MODULE_ID("$Id: lib_set_term.c,v 1.64 2002/02/10 00:21:10 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.65 2002/06/15 18:40:20 tom Exp $")
NCURSES_EXPORT(SCREEN *)
set_term(SCREEN * screenp)
@@ -181,7 +181,7 @@ extract_fgbg(char *src, int *result)
if (dst == 0) {
dst = src;
} else if (value >= 0) {
- *result = value % max_colors;
+ *result = value;
}
while (*dst != 0 && *dst != ';')
dst++;
@@ -275,6 +275,22 @@ _nc_setupscreen
p = extract_fgbg(p, &(SP->_default_bg));
TR(TRACE_CHARPUT | TRACE_MOVE, ("decoded fg=%d, bg=%d",
SP->_default_fg, SP->_default_bg));
+ if (SP->_default_fg > max_colors) {
+ if (set_a_foreground != ABSENT_STRING
+ && !strcmp(set_a_foreground, "\033[3%p1%dm")) {
+ set_a_foreground = "\033[3%?%p1%{8}%>%t9%e%p1%d%;m";
+ } else {
+ SP->_default_fg %= max_colors;
+ }
+ }
+ if (SP->_default_bg > max_colors) {
+ if (set_a_background != ABSENT_STRING
+ && !strcmp(set_a_background, "\033[4%p1%dm")) {
+ set_a_background = "\033[4%?%p1%{8}%>%t9%e%p1%d%;m";
+ } else {
+ SP->_default_bg %= max_colors;
+ }
+ }
}
#endif
#endif /* NCURSES_EXT_FUNCS */