./test/savescreen.c
./test/tclock.c
./test/test.priv.h
+./test/test_getstr.c
+./test/test_instr.c
./test/testaddch.c
./test/testcurs.c
./test/testscanw.c
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1138 2007/06/23 21:28:00 tom Exp $
+-- $Id: NEWS,v 1.1140 2007/06/30 23:37:37 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.
+20070630
+ + add "widec" row to _tracedump() output to help diagnose remaining
+ problems with multi-column characters.
+ + partial fix for refresh of window on top of multi-column characters
+ which are partly overwritten (report by Sadrul H Chowdhury).
+ + ignore A_CHARTEXT bits in vidattr() and vid_attr(), in case
+ multi-column extension bits are passed there.
+ + add setlocale() call to demo_panels.c, needed for wide-characters.
+ + add some output flags to _nc_trace_ttymode to help diagnose a bug
+ report by Larry Virden, i.e., ONLCR, OCRNL, ONOCR and ONLRET,
+
20070623
+ add test/demo_panels.c
+ implement opaque version of setsyx() and getsyx().
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
-# $Id: dist.mk,v 1.598 2007/06/23 15:16:37 tom Exp $
+# $Id: dist.mk,v 1.599 2007/06/30 16:01:18 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 = 6
-NCURSES_PATCH = 20070623
+NCURSES_PATCH = 20070630
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 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 <curses.priv.h>
-MODULE_ID("$Id: lib_refresh.c,v 1.34 2006/05/27 19:21:19 tom Exp $")
+MODULE_ID("$Id: lib_refresh.c,v 1.37 2007/06/30 23:35:43 tom Exp $")
NCURSES_EXPORT(int)
wrefresh(WINDOW *win)
wnoutrefresh(WINDOW *win)
{
NCURSES_SIZE_T limit_x;
- NCURSES_SIZE_T i, j;
+ NCURSES_SIZE_T src_row, src_col;
NCURSES_SIZE_T begx;
NCURSES_SIZE_T begy;
- NCURSES_SIZE_T m, n;
+ NCURSES_SIZE_T dst_row, dst_col;
#if USE_SCROLL_HINTS
bool wide;
#endif
* so we'll force the issue.
*/
- /* limit(n) */
+ /* limit(dst_col) */
limit_x = win->_maxx;
- /* limit(j) */
+ /* limit(src_col) */
if (limit_x > newscr->_maxx - begx)
limit_x = newscr->_maxx - begx;
- for (i = 0, m = begy + win->_yoffset;
- i <= win->_maxy && m <= newscr->_maxy;
- i++, m++) {
- register struct ldat *nline = &newscr->_line[m];
- register struct ldat *oline = &win->_line[i];
+ for (src_row = 0, dst_row = begy + win->_yoffset;
+ src_row <= win->_maxy && dst_row <= newscr->_maxy;
+ src_row++, dst_row++) {
+ register struct ldat *nline = &newscr->_line[dst_row];
+ register struct ldat *oline = &win->_line[src_row];
if (oline->firstchar != _NOCHANGE) {
int last = oline->lastchar;
if (last > limit_x)
last = limit_x;
- for (j = oline->firstchar, n = j + begx; j <= last; j++, n++) {
- if (!CharEq(oline->text[j], nline->text[n])) {
- nline->text[n] = oline->text[j];
- CHANGED_CELL(nline, n);
+ src_col = oline->firstchar;
+ dst_col = src_col + begx;
+
+ if_WIDEC({
+ static cchar_t blank = BLANK;
+ int last_col = begx + ((last < win->_maxx)
+ ? last
+ : win->_maxx);
+ int fix_left = dst_col;
+ int fix_right = last_col;
+ register int j;
+
+ /*
+ * Check for boundary cases where we may overwrite part of a
+ * multi-column character. For those, wipe the remainder of
+ * the character to blanks.
+ */
+ j = dst_col;
+ if (isWidecExt(nline->text[j])) {
+ /*
+ * On the left, we only care about multi-column characters
+ * that extend into the changed region.
+ */
+ fix_left = 1 + j - WidecExt(nline->text[j]);
+ if (fix_left < 0)
+ fix_left = 0; /* only if cell is corrupt */
+ }
+
+ j = last_col;
+ if (WidecExt(nline->text[j]) != 0) {
+ /*
+ * On the right, any multi-column character is a problem,
+ * unless it happens to be contained in the change, and
+ * ending at the right boundary of the change. The
+ * computation for 'fix_left' accounts for the left-side of
+ * this character. Find the end of the character.
+ */
+ fix_right = ++j;
+ while (j <= newscr->_maxx && isWidecExt(nline->text[j])) {
+ fix_right = j++;
+ }
+ }
+
+ /*
+ * The analysis is simpler if we do the clearing afterwards.
+ * Do that now.
+ */
+ for (j = fix_left; j < dst_col; ++j) {
+ nline->text[j] = blank;
+ CHANGED_CELL(nline, j);
+ }
+ for (j = last_col + 1; j <= fix_right; ++j) {
+ nline->text[j] = blank;
+ CHANGED_CELL(nline, j);
+ }
+ });
+
+ /*
+ * Copy the changed text.
+ */
+ for (; src_col <= last; src_col++, dst_col++) {
+ if (!CharEq(oline->text[src_col], nline->text[dst_col])) {
+ nline->text[dst_col] = oline->text[src_col];
+ CHANGED_CELL(nline, dst_col);
}
}
if (wide) {
int oind = oline->oldindex;
- nline->oldindex = (oind == _NEWINDEX) ? _NEWINDEX : begy + oind
- + win->_yoffset;
+ nline->oldindex = ((oind == _NEWINDEX)
+ ? _NEWINDEX
+ : (begy + oind + win->_yoffset));
}
#endif /* USE_SCROLL_HINTS */
oline->firstchar = oline->lastchar = _NOCHANGE;
- if_USE_SCROLL_HINTS(oline->oldindex = i);
+ if_USE_SCROLL_HINTS(oline->oldindex = src_row);
}
if (win->_clear) {
/****************************************************************************
- * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 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 <curses.priv.h>
-MODULE_ID("$Id: lib_window.c,v 1.22 2006/05/27 19:21:19 tom Exp $")
+MODULE_ID("$Id: lib_window.c,v 1.23 2007/06/30 23:36:11 tom Exp $")
NCURSES_EXPORT(void)
_nc_synchook(WINDOW *win)
/* left and right character in child coordinates */
int left = pp->_line[win->_pary + y].firstchar - win->_parx;
int right = pp->_line[win->_pary + y].lastchar - win->_parx;
- /* The change maybe outside the childs range */
+ /* The change may be outside the child's range */
if (left < 0)
left = 0;
if (right > win->_maxx)
/****************************************************************************
- * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 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 <curses.priv.h>
#include <term.h> /* cur_term */
-MODULE_ID("$Id: lib_tracebits.c,v 1.13 2006/12/10 01:33:00 tom Exp $")
+MODULE_ID("$Id: lib_tracebits.c,v 1.15 2007/06/30 16:14:20 tom Exp $")
#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
#define _POSIX_SOURCE
#ifndef TOSTOP
#define TOSTOP 0
#endif
+
#ifndef IEXTEN
#define IEXTEN 0
#endif
+#ifndef ONLCR
+#define ONLCR 0
+#endif
+
+#ifndef OCRNL
+#define OCRNL 0
+#endif
+
+#ifndef ONOCR
+#define ONOCR 0
+#endif
+
+#ifndef ONLRET
+#define ONLRET 0
+#endif
+
#ifdef TRACE
typedef struct {
{
{OPOST, "OPOST"},
{OFLAGS_TABS, "XTABS"},
+ {ONLCR, "ONLCR"},
+ {OCRNL, "OCRNL"},
+ {ONOCR, "ONOCR"},
+ {ONLRET, "ONLRET"},
{0, NULL}
-#define ALLOUT (OPOST)
+#define ALLOUT (OPOST|OFLAGS_TABS|ONLCR|OCRNL|ONOCR|ONLRET)
}, cflags[] =
{
{CLOCAL, "CLOCAL"},
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_tracedmp.c,v 1.28 2007/04/21 21:10:54 tom Exp $")
+MODULE_ID("$Id: lib_tracedmp.c,v 1.29 2007/06/30 23:01:19 tom Exp $")
#ifdef TRACE
(long) win->_line[n].lastchar,
ep);
+ /* if there are multi-column characters on the line, print them now */
+ if_WIDEC({
+ bool multicolumn = FALSE;
+ for (j = 0; j < width; ++j)
+ if (WidecExt(win->_line[n].text[j]) != 0) {
+ multicolumn = TRUE;
+ break;
+ }
+ if (multicolumn) {
+ ep = my_buffer;
+ for (j = 0; j < width; ++j) {
+ int test = WidecExt(win->_line[n].text[j]);
+ if (test) {
+ ep[j] = test + '0';
+ } else {
+ ep[j] = ' ';
+ }
+ }
+ ep[j] = '\0';
+ _tracef("%*s[%2d]%*s='%s'", (int) strlen(name),
+ "widec", n, 8, " ", my_buffer);
+ }
+ });
+
/* dump A_COLOR part, will screw up if there are more than 96 */
havecolors = FALSE;
for (j = 0; j < width; ++j)
#include <curses.priv.h>
-MODULE_ID("$Id: hardscroll.c,v 1.39 2007/04/28 20:14:08 tom Exp $")
+MODULE_ID("$Id: hardscroll.c,v 1.40 2007/06/30 21:11:01 tom Exp $")
#if defined(SCROLLDEBUG) || defined(HASHDEBUG)
int i;
int start, end, shift;
- TR(TRACE_ICALLS, ("_nc_scroll_optimize() begins"));
+ TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize")));
#if !defined(SCROLLDEBUG) && !defined(HASHDEBUG)
#if USE_HASHMAP
}
#endif /* !defined(SCROLLDEBUG) && !defined(HASHDEBUG) */
}
+ TR(TRACE_ICALLS, (T_RETURN("")));
}
#if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG)
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$Id: lib_vidattr.c,v 1.48 2007/04/21 23:25:38 tom Exp $")
+MODULE_ID("$Id: lib_vidattr.c,v 1.49 2007/06/30 21:58:04 tom Exp $")
#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
#define fix_pair0 FALSE
#endif
+ newmode &= A_ATTRIBUTES;
T((T_CALLED("vidputs(%s)"), _traceattr(newmode)));
/* this allows us to go on whether or not newterm() has been called */
#include <ctype.h>
#include <term.h>
-MODULE_ID("$Id: tty_update.c,v 1.239 2007/04/19 20:57:49 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.240 2007/06/30 21:07:51 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
nonempty = 0;
if (curscr->_clear || newscr->_clear) { /* force refresh ? */
- TR(TRACE_UPDATE, ("clearing and updating from scratch"));
ClrUpdate();
curscr->_clear = FALSE; /* reset flag */
newscr->_clear = FALSE; /* reset flag */
NCURSES_CH_T blank = ClrBlank(stdscr);
int nonempty = min(screen_lines, newscr->_maxy + 1);
- TR(TRACE_UPDATE, ("ClrUpdate() called"));
+ TR(TRACE_UPDATE, (T_CALLED("ClrUpdate")));
ClearScreen(blank);
for (i = 0; i < nonempty; i++)
TransformLine(i);
+
+ TR(TRACE_UPDATE, (T_RETURN("")));
}
/*
/****************************************************************************
- * Copyright (c) 2002-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 2002-2006,2007 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 <curses.priv.h>
#include <term.h>
-MODULE_ID("$Id: lib_vid_attr.c,v 1.4 2006/11/26 00:26:00 tom Exp $")
+MODULE_ID("$Id: lib_vid_attr.c,v 1.5 2007/06/30 22:03:02 tom Exp $")
#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
#define fix_pair0 FALSE
#endif
+ newmode &= A_ATTRIBUTES;
T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair));
/* this allows us to go on whether or not newterm() has been called */
* authorization. *
****************************************************************************/
/*
- * $Id: chgat.c,v 1.6 2007/01/06 23:28:46 tom Exp $
+ * $Id: chgat.c,v 1.7 2007/06/30 17:52:17 tom Exp $
*
* test-driver for chgat/wchgat/mvchgat/mvwchgat
*/
typedef struct {
unsigned c;
unsigned v;
- int pair, attr;
+ int pair;
+ unsigned attr;
int count;
int ch;
const char *c_msg;
}
static const char *
-video_params(unsigned state, int *attr)
+video_params(unsigned state, unsigned *attr)
{
/* *INDENT-OFF* */
static struct {
- int attr;
+ unsigned attr;
const char *msg;
} table[] = {
{ A_NORMAL, "normal" },
* authorization. *
****************************************************************************/
/*
- * $Id: demo_panels.c,v 1.16 2007/06/23 21:24:23 tom Exp $
+ * $Id: demo_panels.c,v 1.22 2007/06/30 21:38:08 tom Exp $
*
* Demonstrate a variety of functions from the panel library.
*/
typedef void (*InitPanel) (void);
typedef void (*FillPanel) (PANEL *);
-static bool use_colors;
+static bool use_colors = FALSE;
+static bool unboxed = FALSE;
static FILE *log_in;
static FILE *log_out;
init_pair(color, fg, bg);
wbkgdset(win, (chtype) (COLOR_PAIR(color) | ' '));
- } else {
+ } else if (!unboxed) {
wbkgdset(win, A_BOLD | ' ');
}
}
}
static void
-remove_panel(PANEL ** pans, int which)
+my_remove_panel(PANEL ** pans, int which)
{
if (pans[which] != 0) {
PANEL *pan = pans[which];
#define ABS(a) ((a) < 0 ? -(a) : (a))
static void
-create_panel(PANEL ** pans, int which, FillPanel myFill)
+my_create_panel(PANEL ** pans, int which, FillPanel myFill)
{
PANEL *pan = 0;
int code;
init_pair(pair, fg, bg);
/* remove the old panel, if any */
- remove_panel(pans, which);
+ my_remove_panel(pans, which);
/* get the position of one corner */
wmove(stdscr, getmaxy(stdscr) / 2, getmaxx(stdscr) / 2);
static void
my_move_panel(PANEL ** pans, int which)
{
- int code;
- int y0, x0;
- int y1, x1;
- WINDOW *win = panel_window(pans[which]);
- char also[80];
+ if (pans[which] != 0) {
+ int code;
+ int y0, x0;
+ int y1, x1;
+ WINDOW *win = panel_window(pans[which]);
+ char also[80];
- getbegyx(win, y0, x0);
- sprintf(also, " (start %d,%d)", y0, x0);
- wmove(stdscr, y0, x0);
- while ((code = get_position("Move panel", also, which, &x1, &y1)) == 0) {
- ;
- }
- if (code > 0) {
- move_panel(pans[which], y1, x1);
+ getbegyx(win, y0, x0);
+ sprintf(also, " (start %d,%d)", y0, x0);
+ wmove(stdscr, y0, x0);
+ while ((code = get_position("Move panel", also, which, &x1, &y1)) == 0) {
+ ;
+ }
+ if (code > 0) {
+ move_panel(pans[which], y1, x1);
+ }
}
}
static void
-resize_panel(PANEL ** pans, int which, FillPanel myFill)
+my_resize_panel(PANEL ** pans, int which, FillPanel myFill)
{
- int code;
- int y0, x0;
- int y1, x1;
- WINDOW *win = panel_window(pans[which]);
- char also[80];
+ if (pans[which] != 0) {
+ int code;
+ int y0, x0;
+ int y1, x1;
+ WINDOW *win = panel_window(pans[which]);
+ char also[80];
- getbegyx(win, y0, x0);
- sprintf(also, " (start %d,%d)", y0, x0);
- wmove(stdscr, y0, x0);
- while ((code = get_position("Resize panel", also, which, &x1, &y1)) == 0) {
- ;
- }
- if (code > 0) {
- WINDOW *next = newwin(ABS(y1 - y0) + 1,
- ABS(x1 - x0) + 1,
- MIN(y0, y1),
- MIN(x0, x1));
- if (next != 0) {
- keypad(next, TRUE);
- if (use_colors) {
- wbkgdset(next, (chtype) (COLOR_PAIR(which) | ' '));
- } else {
- wbkgdset(next, A_BOLD | ' ');
+ getbegyx(win, y0, x0);
+ sprintf(also, " (start %d,%d)", y0, x0);
+ wmove(stdscr, y0, x0);
+ while ((code = get_position("Resize panel",
+ also, which, &x1, &y1)) == 0) {
+ ;
+ }
+ if (code > 0) {
+ WINDOW *next = newwin(ABS(y1 - y0) + 1,
+ ABS(x1 - x0) + 1,
+ MIN(y0, y1),
+ MIN(x0, x1));
+ if (next != 0) {
+ keypad(next, TRUE);
+ if (use_colors) {
+ wbkgdset(next, (chtype) (COLOR_PAIR(which) | ' '));
+ } else if (!unboxed) {
+ wbkgdset(next, A_BOLD | ' ');
+ }
+ replace_panel(pans[which], next);
+ myFill(pans[which]);
+ delwin(win);
}
- replace_panel(pans[which], next);
- myFill(pans[which]);
- delwin(win);
}
}
}
}
}
+static void
+fill_unboxed(PANEL * pan)
+{
+ WINDOW *win = panel_window(pan);
+ int num = ((const char *) panel_userptr(pan))[1];
+ int y, x;
+
+ for (y = 0; y < getmaxy(win); y++) {
+ for (x = 0; x < getmaxx(win); x++) {
+ wmove(win, y, x);
+ waddch(win, UChar(num));
+ }
+ }
+}
+
#if USE_WIDEC_SUPPORT
static void
make_fullwidth_digit(cchar_t *target, int digit)
}
}
+#define wrapper(func) \
+static int my_##func(PANEL *pan) \
+{ \
+ int code = ERR; \
+ if (pan != 0) { \
+ code = func(pan); \
+ } \
+ return code; \
+}
+/* *INDENT-OFF* */
+wrapper(bottom_panel)
+wrapper(hide_panel)
+wrapper(show_panel)
+wrapper(top_panel)
+/* *INDENT-ON* */
+
static void
do_panel(PANEL * px[MAX_PANELS + 1],
NCURSES_CONST char *cmd,
saywhat(cmd);
switch (*cmd) {
case 'b':
- bottom_panel(px[which]);
+ my_bottom_panel(px[which]);
break;
case 'c':
- create_panel(px, which, myFill);
+ my_create_panel(px, which, myFill);
break;
case 'd':
- remove_panel(px, which);
+ my_remove_panel(px, which);
break;
case 'h':
- hide_panel(px[which]);
+ my_hide_panel(px[which]);
break;
case 'm':
my_move_panel(px, which);
break;
case 'r':
- resize_panel(px, which, myFill);
+ my_resize_panel(px, which, myFill);
break;
case 's':
- show_panel(px[which]);
+ my_show_panel(px[which]);
break;
case 't':
- top_panel(px[which]);
+ my_top_panel(px[which]);
break;
}
}
if (ch == ERR || ch == QUIT || ch == ESCAPE) {
buffer[0] = '\0';
break;
+ } else if (ch == CTRL('L')) {
+ wrefresh(curscr);
} else if (ch == '\n' || ch == KEY_ENTER) {
break;
} else if (ch == '?') {
}
#if NO_LEAKS
for (itmp = 1; itmp <= MAX_PANELS; ++itmp) {
- remove_panel(px, itmp);
+ my_remove_panel(px, itmp);
}
#endif
}
#if USE_WIDEC_SUPPORT
," -w use wide-characters in panels and background"
#endif
+ ," -x do not enclose panels in boxes"
};
size_t n;
for (n = 0; n < SIZEOF(tbl); n++)
InitPanel myInit = init_panel;
FillPanel myFill = fill_panel;
- while ((c = getopt(argc, argv, "i:o:mw")) != EOF) {
+ setlocale(LC_ALL, "");
+
+ while ((c = getopt(argc, argv, "i:o:mwx")) != EOF) {
switch (c) {
case 'i':
log_in = fopen(optarg, "r");
myFill = fill_wide_panel;
break;
#endif
+ case 'x':
+ unboxed = TRUE;
+ break;
default:
usage();
}
}
+ if (unboxed)
+ myFill = fill_unboxed;
initscr();
cbreak();
/****************************************************************************
- * Copyright (c) 2006 Free Software Foundation, Inc. *
+ * Copyright (c) 2006,2007 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: echochar.c,v 1.3 2006/12/03 00:14:29 tom Exp $
+ * $Id: echochar.c,v 1.4 2007/06/30 17:54:56 tom Exp $
*
* Demonstrate the echochar function (compare to dots.c).
* Thomas Dickey - 2006/11/4
if (use_colors) {
start_color();
if (COLOR_PAIRS > 0) {
- my_pairs = calloc(COLOR_PAIRS, sizeof(*my_pairs));
+ my_pairs = calloc((unsigned) COLOR_PAIRS, sizeof(*my_pairs));
}
use_colors = (my_pairs != 0);
}
}
}
if (opt_r) {
- addch(p);
+ addch(UChar(p));
refresh();
} else {
- echochar(p);
+ echochar(UChar(p));
}
++total_chars;
}
* authorization. *
****************************************************************************/
/*
- * $Id: inch_wide.c,v 1.4 2007/06/09 21:25:54 tom Exp $
+ * $Id: inch_wide.c,v 1.5 2007/06/30 17:50:44 tom Exp $
*/
/*
int in_wch(cchar_t *wcval);
if ((fp = fopen(argv[level], "r")) != 0) {
while ((j = fgetc(fp)) != EOF) {
- if (waddch(txtwin, j) != OK) {
+ if (waddch(txtwin, UChar(j)) != OK) {
break;
}
}
* authorization. *
****************************************************************************/
/*
- * $Id: inchs.c,v 1.6 2007/06/09 21:25:06 tom Exp $
+ * $Id: inchs.c,v 1.7 2007/06/30 17:50:44 tom Exp $
*/
/*
chtype inch(void);
if ((fp = fopen(argv[level], "r")) != 0) {
while ((j = fgetc(fp)) != EOF) {
- if (waddch(txtwin, j) != OK) {
+ if (waddch(txtwin, UChar(j)) != OK) {
break;
}
}
/****************************************************************************
- * Copyright (c) 2006 Free Software Foundation, Inc. *
+ * Copyright (c) 2006,2007 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: redraw.c,v 1.3 2006/11/04 23:20:27 tom Exp $
+ * $Id: redraw.c,v 1.4 2007/06/30 17:55:06 tom Exp $
*
* Demonstrate the redrawwin() and wredrawln() functions.
* Thomas Dickey - 2006/11/4
if (ch > KEY_MIN) {
waddstr(win, keyname(ch));
} else {
- waddstr(win, unctrl(ch));
+ waddstr(win, unctrl(UChar(ch)));
}
break;
}
/****************************************************************************
* Author: Thomas E. Dickey 1996-on *
****************************************************************************/
-/* $Id: test.priv.h,v 1.67 2007/06/23 15:46:17 tom Exp $ */
+/* $Id: test.priv.h,v 1.68 2007/06/30 17:53:09 tom Exp $ */
#ifndef __TEST_PRIV_H
#define __TEST_PRIV_H 1
#ifndef HAVE_TYPE_ATTR_T
#if !USE_WIDEC_SUPPORT
-#define attr_t long
+#define attr_t chtype
#endif
#endif
--- /dev/null
+/*
+ * $Id: test_getstr.c,v 1.1 2007/06/30 16:51:28 tom Exp $
+ *
+ * Demonstrate the getstr functions from the curses library.
+
+ int getstr(char *str);
+ int getnstr(char *str, int n);
+ int wgetstr(WINDOW *win, char *str);
+ int wgetnstr(WINDOW *win, char *str, int n);
+ int mvgetstr(int y, int x, char *str);
+ int mvwgetstr(WINDOW *win, int y, int x, char *str);
+ int mvgetnstr(int y, int x, char *str, int n);
+ int mvwgetnstr(WINDOW *, int y, int x, char *str, int n);
+ */
+
+#include <test.priv.h>
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ printf("Not implemented - test-driver for curses getstr() functions\n");
+ return EXIT_SUCCESS;
+}
--- /dev/null
+/*
+ * $Id: test_instr.c,v 1.1 2007/06/30 16:51:44 tom Exp $
+ *
+ * Demonstrate the instr functions from the curses library.
+
+ int instr(char *str);
+ int innstr(char *str, int n);
+ int winstr(WINDOW *win, char *str);
+ int winnstr(WINDOW *win, char *str, int n);
+ int mvinstr(int y, int x, char *str);
+ int mvinnstr(int y, int x, char *str, int n);
+ int mvwinstr(WINDOW *win, int y, int x, char *str);
+ int mvwinnstr(WINDOW *win, int y, int x, char *str, int n);
+ */
+
+#include <test.priv.h>
+
+int
+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
+{
+ printf("Not implemented - test-driver for curses instr() functions\n");
+ return EXIT_SUCCESS;
+}
/****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2006,2007 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 *
* scroll operation worked, and the refresh() code only had to do a
* partial repaint.
*
- * $Id: view.c,v 1.64 2006/05/20 15:37:03 tom Exp $
+ * $Id: view.c,v 1.65 2007/06/30 16:40:04 tom Exp $
*/
#include <test.priv.h>
lptr++;
else
break;
- wscrl(stdscr, lptr - olptr);
+ scrl(lptr - olptr);
break;
case KEY_UP:
lptr--;
else
break;
- wscrl(stdscr, lptr - olptr);
+ scrl(lptr - olptr);
break;
case 'h':