mirror of
https://github.com/Aigor44/ncursesw-morphos.git
synced 2024-12-15 07:30:12 +08:00
ncurses 5.6 - patch 20070210
+ add test/inchs.c, test_inch_wide.c, to test win_wchnstr(). + remove libdl from library list for termlib (report by Miroslav Lichvar). + fix configure.in to allow --without-progs --with-termlib (patch by Miroslav Lichvar). + modify win_wchnstr() to ensure that only a base cell is returned for each multi-column character (prompted by report by Wei Kong regarding change in mvwin_wch() cf: 20041023).
This commit is contained in:
parent
5242fccf15
commit
614ef82f41
2
MANIFEST
2
MANIFEST
@ -971,6 +971,8 @@
|
||||
./test/gdc.c
|
||||
./test/hanoi.c
|
||||
./test/hashtest.c
|
||||
./test/inch_wide.c
|
||||
./test/inchs.c
|
||||
./test/ins_wide.c
|
||||
./test/inserts.c
|
||||
./test/keynames.c
|
||||
|
12
NEWS
12
NEWS
@ -25,7 +25,7 @@
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: NEWS,v 1.1079 2007/02/04 00:30:41 tom Exp $
|
||||
-- $Id: NEWS,v 1.1084 2007/02/11 01:17:49 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
This is a log of changes that ncurses has gone through since Zeyd started
|
||||
@ -45,6 +45,16 @@ 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.
|
||||
|
||||
20070210
|
||||
+ add test/inchs.c, test_inch_wide.c, to test win_wchnstr().
|
||||
+ remove libdl from library list for termlib (report by Miroslav
|
||||
Lichvar).
|
||||
+ fix configure.in to allow --without-progs --with-termlib (patch by
|
||||
Miroslav Lichvar).
|
||||
+ modify win_wchnstr() to ensure that only a base cell is returned
|
||||
for each multi-column character (prompted by report by Wei Kong
|
||||
regarding change in mvwin_wch() cf: 20041023).
|
||||
|
||||
20070203
|
||||
+ modify fix_wchnstr() in form library to strip attributes (and color)
|
||||
from the cchar_t array (field cells) read from a field's window.
|
||||
|
66
configure
vendored
66
configure
vendored
@ -1,5 +1,5 @@
|
||||
#! /bin/sh
|
||||
# From configure.in Revision: 1.393 .
|
||||
# From configure.in Revision: 1.395 .
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by Autoconf 2.52.20061216.
|
||||
#
|
||||
@ -14838,11 +14838,13 @@ echo "$as_me:14837: checking for library subsets" >&5
|
||||
echo $ECHO_N "checking for library subsets... $ECHO_C" >&6
|
||||
LIB_SUBSETS=
|
||||
|
||||
test "$cf_with_progs" = yes && LIB_SUBSETS="${LIB_SUBSETS}ticlib"
|
||||
if test "$with_ticlib" != no ; then
|
||||
LIB_SUBSETS="${LIB_SUBSETS} "
|
||||
else
|
||||
LIB_SUBSETS="${LIB_SUBSETS}+"
|
||||
if test "$cf_with_progs" = yes || test "$with_ticlib" != no; then
|
||||
LIB_SUBSETS="${LIB_SUBSETS}ticlib"
|
||||
if test "$with_ticlib" != no ; then
|
||||
LIB_SUBSETS="${LIB_SUBSETS} "
|
||||
else
|
||||
LIB_SUBSETS="${LIB_SUBSETS}+"
|
||||
fi
|
||||
fi
|
||||
|
||||
LIB_SUBSETS="${LIB_SUBSETS}termlib"
|
||||
@ -14857,7 +14859,7 @@ LIB_SUBSETS="${LIB_SUBSETS}base"
|
||||
test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar"
|
||||
test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs"
|
||||
|
||||
echo "$as_me:14860: result: $LIB_SUBSETS" >&5
|
||||
echo "$as_me:14862: result: $LIB_SUBSETS" >&5
|
||||
echo "${ECHO_T}$LIB_SUBSETS" >&6
|
||||
|
||||
### Construct the list of include-directories to be generated
|
||||
@ -14895,7 +14897,7 @@ elif test "$includedir" != "/usr/include"; then
|
||||
fi
|
||||
|
||||
### Build up pieces for makefile rules
|
||||
echo "$as_me:14898: checking default library suffix" >&5
|
||||
echo "$as_me:14900: checking default library suffix" >&5
|
||||
echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
|
||||
|
||||
case $DFT_LWR_MODEL in
|
||||
@ -14906,10 +14908,10 @@ echo $ECHO_N "checking default library suffix... $ECHO_C" >&6
|
||||
shared) DFT_ARG_SUFFIX='' ;;
|
||||
esac
|
||||
test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}"
|
||||
echo "$as_me:14909: result: $DFT_ARG_SUFFIX" >&5
|
||||
echo "$as_me:14911: result: $DFT_ARG_SUFFIX" >&5
|
||||
echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6
|
||||
|
||||
echo "$as_me:14912: checking default library-dependency suffix" >&5
|
||||
echo "$as_me:14914: checking default library-dependency suffix" >&5
|
||||
echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6
|
||||
|
||||
case $DFT_LWR_MODEL in
|
||||
@ -14938,10 +14940,10 @@ if test $DFT_LWR_MODEL = shared ; then
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
echo "$as_me:14941: result: $DFT_DEP_SUFFIX" >&5
|
||||
echo "$as_me:14943: result: $DFT_DEP_SUFFIX" >&5
|
||||
echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6
|
||||
|
||||
echo "$as_me:14944: checking default object directory" >&5
|
||||
echo "$as_me:14946: checking default object directory" >&5
|
||||
echo $ECHO_N "checking default object directory... $ECHO_C" >&6
|
||||
|
||||
case $DFT_LWR_MODEL in
|
||||
@ -14957,12 +14959,12 @@ echo $ECHO_N "checking default object directory... $ECHO_C" >&6
|
||||
DFT_OBJ_SUBDIR='obj_s' ;;
|
||||
esac
|
||||
esac
|
||||
echo "$as_me:14960: result: $DFT_OBJ_SUBDIR" >&5
|
||||
echo "$as_me:14962: result: $DFT_OBJ_SUBDIR" >&5
|
||||
echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6
|
||||
|
||||
# libtool thinks it can make c++ shared libraries (perhaps only g++)
|
||||
if test "$cf_with_cxx" = yes ; then
|
||||
echo "$as_me:14965: checking c++ library-dependency suffix" >&5
|
||||
echo "$as_me:14967: checking c++ library-dependency suffix" >&5
|
||||
echo $ECHO_N "checking c++ library-dependency suffix... $ECHO_C" >&6
|
||||
if test "$with_libtool" != "no"; then
|
||||
CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX
|
||||
@ -14988,7 +14990,7 @@ else
|
||||
esac
|
||||
test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}"
|
||||
fi
|
||||
echo "$as_me:14991: result: $CXX_LIB_SUFFIX" >&5
|
||||
echo "$as_me:14993: result: $CXX_LIB_SUFFIX" >&5
|
||||
echo "${ECHO_T}$CXX_LIB_SUFFIX" >&6
|
||||
|
||||
fi
|
||||
@ -14997,7 +14999,7 @@ fi
|
||||
|
||||
# TICS_LIST and TINFO_LIST are needed to build the libtic.so and libterm.so
|
||||
TICS_LIST="$SHLIB_LIST"
|
||||
TINFO_LIST="$SHLIB_LIST"
|
||||
TINFO_LIST=`echo "$SHLIB_LIST" | sed -e 's/-ldl//'`
|
||||
|
||||
if test "$with_ticlib" != no ; then
|
||||
|
||||
@ -15048,12 +15050,12 @@ fi
|
||||
# needed for Ada95
|
||||
TINFO_ARGS2=`echo "$TINFO_ARGS" | sed -e 's,-L\.\./,-L../../,'`
|
||||
|
||||
echo "$as_me:15051: checking where we will install curses.h" >&5
|
||||
echo "$as_me:15053: checking where we will install curses.h" >&5
|
||||
echo $ECHO_N "checking where we will install curses.h... $ECHO_C" >&6
|
||||
test "$with_overwrite" = no && \
|
||||
test "x$includedir" = 'x${prefix}/include' && \
|
||||
includedir='${prefix}/include/ncurses'${LIB_SUFFIX}
|
||||
echo "$as_me:15056: result: $includedir" >&5
|
||||
echo "$as_me:15058: result: $includedir" >&5
|
||||
echo "${ECHO_T}$includedir" >&6
|
||||
|
||||
### Resolve a conflict between normal and wide-curses by forcing applications
|
||||
@ -15061,7 +15063,7 @@ echo "${ECHO_T}$includedir" >&6
|
||||
if test "$with_overwrite" != no ; then
|
||||
if test "$NCURSES_LIBUTF8" = 1 ; then
|
||||
NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)'
|
||||
{ echo "$as_me:15064: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5
|
||||
{ echo "$as_me:15066: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5
|
||||
echo "$as_me: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&2;}
|
||||
fi
|
||||
fi
|
||||
@ -15077,7 +15079,7 @@ EOF
|
||||
### Construct the list of subdirectories for which we'll customize makefiles
|
||||
### with the appropriate compile-rules.
|
||||
|
||||
echo "$as_me:15080: checking for src modules" >&5
|
||||
echo "$as_me:15082: checking for src modules" >&5
|
||||
echo $ECHO_N "checking for src modules... $ECHO_C" >&6
|
||||
|
||||
# dependencies and linker-arguments for test-programs
|
||||
@ -15140,7 +15142,7 @@ EOF
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "$as_me:15143: result: $cf_cv_src_modules" >&5
|
||||
echo "$as_me:15145: result: $cf_cv_src_modules" >&5
|
||||
echo "${ECHO_T}$cf_cv_src_modules" >&6
|
||||
|
||||
TEST_ARGS="-L${LIB_DIR} $TEST_ARGS"
|
||||
@ -15386,7 +15388,7 @@ DEFS=-DHAVE_CONFIG_H
|
||||
: ${CONFIG_STATUS=./config.status}
|
||||
ac_clean_files_save=$ac_clean_files
|
||||
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
|
||||
{ echo "$as_me:15389: creating $CONFIG_STATUS" >&5
|
||||
{ echo "$as_me:15391: creating $CONFIG_STATUS" >&5
|
||||
echo "$as_me: creating $CONFIG_STATUS" >&6;}
|
||||
cat >$CONFIG_STATUS <<_ACEOF
|
||||
#! $SHELL
|
||||
@ -15562,7 +15564,7 @@ cat >>$CONFIG_STATUS <<\EOF
|
||||
echo "$ac_cs_version"; exit 0 ;;
|
||||
--he | --h)
|
||||
# Conflict between --help and --header
|
||||
{ { echo "$as_me:15565: error: ambiguous option: $1
|
||||
{ { echo "$as_me:15567: error: ambiguous option: $1
|
||||
Try \`$0 --help' for more information." >&5
|
||||
echo "$as_me: error: ambiguous option: $1
|
||||
Try \`$0 --help' for more information." >&2;}
|
||||
@ -15581,7 +15583,7 @@ Try \`$0 --help' for more information." >&2;}
|
||||
ac_need_defaults=false;;
|
||||
|
||||
# This is an error.
|
||||
-*) { { echo "$as_me:15584: error: unrecognized option: $1
|
||||
-*) { { echo "$as_me:15586: error: unrecognized option: $1
|
||||
Try \`$0 --help' for more information." >&5
|
||||
echo "$as_me: error: unrecognized option: $1
|
||||
Try \`$0 --help' for more information." >&2;}
|
||||
@ -15674,7 +15676,7 @@ do
|
||||
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
||||
"default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
|
||||
"include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;;
|
||||
*) { { echo "$as_me:15677: error: invalid argument: $ac_config_target" >&5
|
||||
*) { { echo "$as_me:15679: error: invalid argument: $ac_config_target" >&5
|
||||
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
|
||||
{ (exit 1); exit 1; }; };;
|
||||
esac
|
||||
@ -16046,7 +16048,7 @@ done; }
|
||||
esac
|
||||
|
||||
if test x"$ac_file" != x-; then
|
||||
{ echo "$as_me:16049: creating $ac_file" >&5
|
||||
{ echo "$as_me:16051: creating $ac_file" >&5
|
||||
echo "$as_me: creating $ac_file" >&6;}
|
||||
rm -f "$ac_file"
|
||||
fi
|
||||
@ -16064,7 +16066,7 @@ echo "$as_me: creating $ac_file" >&6;}
|
||||
-) echo $tmp/stdin ;;
|
||||
[\\/$]*)
|
||||
# Absolute (can't be DOS-style, as IFS=:)
|
||||
test -f "$f" || { { echo "$as_me:16067: error: cannot find input file: $f" >&5
|
||||
test -f "$f" || { { echo "$as_me:16069: error: cannot find input file: $f" >&5
|
||||
echo "$as_me: error: cannot find input file: $f" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
echo $f;;
|
||||
@ -16077,7 +16079,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
|
||||
echo $srcdir/$f
|
||||
else
|
||||
# /dev/null tree
|
||||
{ { echo "$as_me:16080: error: cannot find input file: $f" >&5
|
||||
{ { echo "$as_me:16082: error: cannot find input file: $f" >&5
|
||||
echo "$as_me: error: cannot find input file: $f" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi;;
|
||||
@ -16143,7 +16145,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
|
||||
* ) ac_file_in=$ac_file.in ;;
|
||||
esac
|
||||
|
||||
test x"$ac_file" != x- && { echo "$as_me:16146: creating $ac_file" >&5
|
||||
test x"$ac_file" != x- && { echo "$as_me:16148: creating $ac_file" >&5
|
||||
echo "$as_me: creating $ac_file" >&6;}
|
||||
|
||||
# First look for the input files in the build tree, otherwise in the
|
||||
@ -16154,7 +16156,7 @@ echo "$as_me: creating $ac_file" >&6;}
|
||||
-) echo $tmp/stdin ;;
|
||||
[\\/$]*)
|
||||
# Absolute (can't be DOS-style, as IFS=:)
|
||||
test -f "$f" || { { echo "$as_me:16157: error: cannot find input file: $f" >&5
|
||||
test -f "$f" || { { echo "$as_me:16159: error: cannot find input file: $f" >&5
|
||||
echo "$as_me: error: cannot find input file: $f" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
echo $f;;
|
||||
@ -16167,7 +16169,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
|
||||
echo $srcdir/$f
|
||||
else
|
||||
# /dev/null tree
|
||||
{ { echo "$as_me:16170: error: cannot find input file: $f" >&5
|
||||
{ { echo "$as_me:16172: error: cannot find input file: $f" >&5
|
||||
echo "$as_me: error: cannot find input file: $f" >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi;;
|
||||
@ -16225,7 +16227,7 @@ cat >>$CONFIG_STATUS <<\EOF
|
||||
rm -f $tmp/in
|
||||
if test x"$ac_file" != x-; then
|
||||
if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
|
||||
{ echo "$as_me:16228: $ac_file is unchanged" >&5
|
||||
{ echo "$as_me:16230: $ac_file is unchanged" >&5
|
||||
echo "$as_me: $ac_file is unchanged" >&6;}
|
||||
else
|
||||
ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
|
18
configure.in
18
configure.in
@ -28,14 +28,14 @@ dnl***************************************************************************
|
||||
dnl
|
||||
dnl Author: Thomas E. Dickey 1995-on
|
||||
dnl
|
||||
dnl $Id: configure.in,v 1.393 2007/02/03 19:26:12 tom Exp $
|
||||
dnl $Id: configure.in,v 1.395 2007/02/10 22:47:04 tom Exp $
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
dnl See http://invisible-island.net/autoconf/ for additional information.
|
||||
dnl
|
||||
dnl ---------------------------------------------------------------------------
|
||||
AC_PREREQ(2.13.20020210)
|
||||
AC_REVISION($Revision: 1.393 $)
|
||||
AC_REVISION($Revision: 1.395 $)
|
||||
AC_INIT(ncurses/base/lib_initscr.c)
|
||||
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
|
||||
|
||||
@ -1401,11 +1401,13 @@ fi
|
||||
AC_MSG_CHECKING(for library subsets)
|
||||
LIB_SUBSETS=
|
||||
|
||||
test "$cf_with_progs" = yes && LIB_SUBSETS="${LIB_SUBSETS}ticlib"
|
||||
if test "$with_ticlib" != no ; then
|
||||
LIB_SUBSETS="${LIB_SUBSETS} "
|
||||
else
|
||||
LIB_SUBSETS="${LIB_SUBSETS}+"
|
||||
if test "$cf_with_progs" = yes || test "$with_ticlib" != no; then
|
||||
LIB_SUBSETS="${LIB_SUBSETS}ticlib"
|
||||
if test "$with_ticlib" != no ; then
|
||||
LIB_SUBSETS="${LIB_SUBSETS} "
|
||||
else
|
||||
LIB_SUBSETS="${LIB_SUBSETS}+"
|
||||
fi
|
||||
fi
|
||||
|
||||
LIB_SUBSETS="${LIB_SUBSETS}termlib"
|
||||
@ -1465,7 +1467,7 @@ fi
|
||||
|
||||
# TICS_LIST and TINFO_LIST are needed to build the libtic.so and libterm.so
|
||||
TICS_LIST="$SHLIB_LIST"
|
||||
TINFO_LIST="$SHLIB_LIST"
|
||||
TINFO_LIST=`echo "$SHLIB_LIST" | sed -e 's/-ldl//'`
|
||||
|
||||
if test "$with_ticlib" != no ; then
|
||||
|
||||
|
4
dist.mk
4
dist.mk
@ -25,7 +25,7 @@
|
||||
# use or other dealings in this Software without prior written #
|
||||
# authorization. #
|
||||
##############################################################################
|
||||
# $Id: dist.mk,v 1.576 2007/01/28 17:28:52 tom Exp $
|
||||
# $Id: dist.mk,v 1.577 2007/02/10 16:33:08 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 = 6
|
||||
NCURSES_PATCH = 20070203
|
||||
NCURSES_PATCH = 20070210
|
||||
|
||||
# We don't append the patch to the version, since this only applies to releases
|
||||
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 2002,2004 Free Software Foundation, Inc. *
|
||||
* Copyright (c) 2002-2004-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 *
|
||||
@ -27,7 +27,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Thomas Dickey 2002,2004 *
|
||||
* Author: Thomas Dickey *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
#include <curses.priv.h>
|
||||
|
||||
MODULE_ID("$Id: lib_in_wchnstr.c,v 1.4 2007/02/03 23:10:20 tom Exp $")
|
||||
MODULE_ID("$Id: lib_in_wchnstr.c,v 1.7 2007/02/11 01:00:00 tom Exp $")
|
||||
|
||||
NCURSES_EXPORT(int)
|
||||
win_wchnstr(WINDOW *win, cchar_t *wchstr, int n)
|
||||
@ -49,17 +49,25 @@ win_wchnstr(WINDOW *win, cchar_t *wchstr, int n)
|
||||
T((T_CALLED("win_wchnstr(%p,%p,%d)"), win, wchstr, n));
|
||||
if (win != 0
|
||||
&& wchstr != 0) {
|
||||
NCURSES_CH_T *src;
|
||||
int row, col;
|
||||
int j;
|
||||
int j, k, limit;
|
||||
|
||||
getyx(win, row, col);
|
||||
limit = getmaxx(win) - col;
|
||||
src = &(win->_line[row].text[col]);
|
||||
|
||||
if (n < 0) {
|
||||
n = getmaxx(win) + 1 - getcurx(win);
|
||||
n = limit;
|
||||
} else if (n > limit) {
|
||||
n = limit;
|
||||
}
|
||||
for (j = 0; j < n; ++j) {
|
||||
wchstr[j] = win->_line[row].text[col + j];
|
||||
for (j = k = 0; j < n; ++j) {
|
||||
if (j == 0 || !WidecExt(src[j]) || isWidecBase(src[j])) {
|
||||
wchstr[k++] = src[j];
|
||||
}
|
||||
}
|
||||
memset(&(wchstr[k]), 0, sizeof(*wchstr));
|
||||
T(("result = %s", _nc_viscbuf(wchstr, n)));
|
||||
} else {
|
||||
code = ERR;
|
||||
|
80
test/README
80
test/README
@ -25,7 +25,7 @@
|
||||
-- sale, use or other dealings in this Software without prior written --
|
||||
-- authorization. --
|
||||
-------------------------------------------------------------------------------
|
||||
-- $Id: README,v 1.28 2006/11/05 01:10:56 tom Exp $
|
||||
-- $Id: README,v 1.29 2007/02/11 01:16:17 tom Exp $
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The programs in this directory are designed to test your newest toy :-)
|
||||
@ -213,9 +213,9 @@ BC -
|
||||
COLORS test: echochar ncurses xmas
|
||||
COLOR_PAIR test: background blue bs cardfile demo_forms demo_menus echochar filter firework gdc hanoi ins_wide inserts knight ncurses newdemo rain tclock testaddch testcurs view worm xmas
|
||||
COLOR_PAIRS test: echochar ncurses newdemo
|
||||
COLS test: cardfile demo_altkeys demo_defkey demo_forms demo_keyok demo_menus edit_field firework foldkeys hashtest ins_wide inserts lrtest movewindow ncurses newdemo rain tclock testcurs view worm
|
||||
COLS test: cardfile demo_altkeys demo_defkey demo_forms demo_keyok demo_menus echochar edit_field firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain tclock testcurs view worm
|
||||
ESCDELAY lib: ncurses
|
||||
LINES test: cardfile demo_defkey demo_keyok demo_menus edit_field firework hanoi hashtest ins_wide inserts lrtest movewindow ncurses newdemo rain tclock testcurs view worm xmas
|
||||
LINES test: cardfile demo_defkey demo_keyok demo_menus echochar edit_field firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo rain tclock testcurs view worm xmas
|
||||
PAIR_NUMBER test: ncurses
|
||||
PC lib: ncurses
|
||||
SP lib: ncurses
|
||||
@ -241,7 +241,7 @@ attroff test: echochar filter gdc ncurses tclock
|
||||
attron test: bs echochar filter gdc ncurses
|
||||
attrset test: bs firework gdc hanoi ncurses rain tclock testaddch testcurs
|
||||
baudrate lib: ncurses
|
||||
beep test: blue bs cardfile chgat demo_forms demo_menus edit_field hanoi ins_wide inserts knight movewindow ncurses tclock testcurs view xmas
|
||||
beep test: blue bs cardfile chgat demo_forms demo_menus edit_field hanoi inch_wide inchs ins_wide inserts knight movewindow ncurses tclock testcurs view xmas
|
||||
bkgd test: background cardfile demo_forms ncurses tclock view
|
||||
bkgdset test: background ncurses testaddch
|
||||
bkgrnd test: ncurses
|
||||
@ -251,10 +251,10 @@ boolfnames progs: dump_entry
|
||||
boolnames progs: dump_entry infocmp
|
||||
border -
|
||||
border_set -
|
||||
box test: cardfile chgat demo_forms demo_menus edit_field ins_wide inserts lrtest ncurses newdemo redraw testcurs
|
||||
box test: cardfile chgat demo_forms demo_menus edit_field inch_wide inchs ins_wide inserts lrtest ncurses newdemo redraw testcurs
|
||||
box_set test: ncurses
|
||||
can_change_color test: ncurses
|
||||
cbreak test: background blue bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus ditto filter firework foldkeys gdc hanoi hashtest ins_wide inserts knight lrtest movewindow ncurses newdemo tclock testcurs view worm xmas
|
||||
cbreak test: background blue bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus ditto filter firework foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses newdemo tclock testcurs view worm xmas
|
||||
chgat test: chgat
|
||||
clear test: blue bs gdc ncurses testcurs xmas
|
||||
clearok test: bs knight
|
||||
@ -263,7 +263,7 @@ clrtoeol test: blue bs demo_altkeys demo_menus foldkeys hanoi hashtest movewin
|
||||
color_content test: ncurses
|
||||
color_set test: color_set ncurses
|
||||
copywin test: ncurses testcurs
|
||||
cur_term test: dots echochar lrtest progs: clear tic tput tset
|
||||
cur_term test: dots lrtest progs: clear tput tset
|
||||
curs_set test: echochar firework gdc hanoi lrtest ncurses newdemo rain tclock testcurs worm xmas
|
||||
curscr test: edit_field knight lrtest ncurses tclock view
|
||||
curses_version test: ncurses progs: infocmp tic toe tput tset
|
||||
@ -271,18 +271,18 @@ def_prog_mode test: bs ncurses
|
||||
def_shell_mode lib: ncurses
|
||||
define_key test: demo_altkeys demo_defkey foldkeys
|
||||
del_curterm lib: ncurses
|
||||
delay_output -
|
||||
delay_output test: newdemo
|
||||
delch -
|
||||
deleteln -
|
||||
delscreen -
|
||||
delwin test: cardfile chgat demo_forms demo_menus edit_field ins_wide inserts movewindow ncurses newdemo redraw testcurs
|
||||
derwin test: cardfile chgat demo_forms demo_menus ins_wide inserts movewindow ncurses
|
||||
derwin test: cardfile chgat demo_forms demo_menus inch_wide inchs ins_wide inserts movewindow ncurses
|
||||
doupdate test: cardfile demo_menus edit_field ins_wide inserts knight movewindow ncurses redraw
|
||||
dupwin test: edit_field
|
||||
echo test: bs hanoi ncurses testcurs testscanw
|
||||
echo_wchar test: ncurses
|
||||
echochar test: echochar ncurses
|
||||
endwin test: background blue bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus ditto echochar filter firework firstlast foldkeys gdc hanoi hashtest ins_wide inserts keynames knight lrtest movewindow ncurses newdemo rain redraw tclock testaddch testcurs testscanw view worm xmas
|
||||
endwin test: background blue bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus ditto echochar filter firework firstlast foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts keynames knight lrtest movewindow ncurses newdemo rain redraw tclock testaddch testcurs testscanw view worm xmas
|
||||
erase test: cardfile demo_menus filter firework firstlast hanoi lrtest ncurses tclock testcurs
|
||||
erasechar lib: ncurses
|
||||
erasewchar -
|
||||
@ -299,8 +299,8 @@ getcchar test: ncurses view
|
||||
getch test: background blue bs chgat color_set demo_altkeys ditto filter firework firstlast foldkeys hanoi hashtest lrtest rain tclock testaddch testcurs view worm xmas
|
||||
getcurx test: bs chgat demo_altkeys demo_defkey foldkeys movewindow ncurses redraw testcurs
|
||||
getcury test: bs chgat demo_altkeys demo_defkey edit_field foldkeys movewindow ncurses redraw testcurs
|
||||
getmaxx test: chgat movewindow ncurses newdemo redraw testcurs
|
||||
getmaxy test: chgat demo_forms movewindow ncurses newdemo redraw testcurs
|
||||
getmaxx test: chgat inch_wide inchs movewindow ncurses newdemo redraw testcurs
|
||||
getmaxy test: chgat demo_forms inch_wide inchs movewindow ncurses newdemo redraw testcurs
|
||||
getmouse test: bs knight movewindow ncurses
|
||||
getn_wstr -
|
||||
getnstr test: filter ncurses
|
||||
@ -326,7 +326,7 @@ inchnstr -
|
||||
inchstr -
|
||||
init_color test: ncurses
|
||||
init_pair test: background blue bs cardfile chgat color_set demo_forms demo_menus echochar filter firework gdc hanoi ins_wide inserts knight ncurses newdemo rain tclock testaddch testcurs view worm xmas
|
||||
initscr test: background blue bs cardfile chgat color_set demo_defkey demo_forms demo_keyok demo_menus echochar firework firstlast gdc hanoi hashtest ins_wide inserts knight lrtest movewindow ncurses newdemo rain redraw tclock testaddch testcurs testscanw view worm xmas
|
||||
initscr test: background blue bs cardfile chgat color_set demo_defkey demo_forms demo_keyok demo_menus echochar firework firstlast gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses newdemo rain redraw tclock testaddch testcurs testscanw view worm xmas
|
||||
innstr -
|
||||
innwstr -
|
||||
ins_nwstr test: ins_wide
|
||||
@ -349,7 +349,7 @@ key_name test: ncurses
|
||||
keybound test: demo_altkeys demo_defkey
|
||||
keyname test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses redraw testcurs view progs: tic
|
||||
keyok test: demo_keyok foldkeys
|
||||
keypad test: bs cardfile chgat demo_altkeys demo_defkey demo_forms demo_keyok demo_menus edit_field filter firework foldkeys hashtest ins_wide inserts keynames knight lrtest movewindow ncurses redraw tclock testcurs testscanw view
|
||||
keypad test: bs cardfile chgat demo_altkeys demo_defkey demo_forms demo_keyok demo_menus edit_field filter firework foldkeys hashtest inch_wide inchs ins_wide inserts keynames knight lrtest movewindow ncurses redraw tclock testcurs testscanw view
|
||||
killchar lib: ncurses
|
||||
killwchar -
|
||||
leaveok test: hanoi
|
||||
@ -404,10 +404,10 @@ mvvline test: ncurses
|
||||
mvvline_set test: ncurses
|
||||
mvwadd_wch -
|
||||
mvwadd_wchnstr lib: form
|
||||
mvwadd_wchstr -
|
||||
mvwadd_wchstr test: inch_wide
|
||||
mvwaddch test: movewindow newdemo testcurs xmas
|
||||
mvwaddchnstr -
|
||||
mvwaddchstr -
|
||||
mvwaddchstr test: inchs
|
||||
mvwaddnstr test: newdemo testcurs
|
||||
mvwaddnwstr -
|
||||
mvwaddstr test: firstlast ins_wide inserts knight ncurses newdemo testcurs xmas
|
||||
@ -416,19 +416,19 @@ mvwchgat test: chgat
|
||||
mvwdelch test: ncurses
|
||||
mvwget_wch -
|
||||
mvwget_wstr -
|
||||
mvwgetch -
|
||||
mvwgetch test: inch_wide inchs
|
||||
mvwgetn_wstr -
|
||||
mvwgetnstr -
|
||||
mvwgetstr -
|
||||
mvwhline test: movewindow
|
||||
mvwhline_set -
|
||||
mvwin test: cardfile demo_menus movewindow testcurs xmas
|
||||
mvwin_wch -
|
||||
mvwin_wchnstr lib: form
|
||||
mvwin_wchstr -
|
||||
mvwinch test: newdemo testcurs
|
||||
mvwinchnstr -
|
||||
mvwinchstr -
|
||||
mvwin_wch test: inch_wide
|
||||
mvwin_wchnstr test: inch_wide
|
||||
mvwin_wchstr test: inch_wide
|
||||
mvwinch test: inchs newdemo testcurs
|
||||
mvwinchnstr test: inchs
|
||||
mvwinchstr test: inchs
|
||||
mvwinnstr test: testcurs
|
||||
mvwinnwstr -
|
||||
mvwins_nwstr test: ins_wide
|
||||
@ -439,19 +439,19 @@ mvwinsnstr test: inserts
|
||||
mvwinsstr test: inserts testcurs
|
||||
mvwinstr -
|
||||
mvwinwstr -
|
||||
mvwprintw test: chgat ncurses testcurs
|
||||
mvwprintw test: chgat inch_wide inchs ncurses testcurs
|
||||
mvwscanw test: testcurs
|
||||
mvwvline test: ins_wide inserts movewindow
|
||||
mvwvline_set -
|
||||
napms test: dots echochar firework gdc hanoi lrtest ncurses newdemo railroad rain tclock testcurs view worm xmas progs: tset
|
||||
napms test: dots echochar firework gdc hanoi lrtest ncurses railroad rain tclock testcurs view worm xmas progs: tset
|
||||
newpad test: edit_field ncurses testcurs
|
||||
newscr lib: ncurses
|
||||
newterm test: demo_altkeys ditto filter foldkeys gdc keynames
|
||||
newwin test: cardfile chgat demo_defkey demo_forms demo_keyok demo_menus edit_field firstlast ins_wide inserts knight movewindow ncurses newdemo redraw testcurs xmas
|
||||
newwin test: cardfile chgat demo_defkey demo_forms demo_keyok demo_menus edit_field firstlast inch_wide inchs ins_wide inserts knight movewindow ncurses newdemo redraw testcurs xmas
|
||||
nl test: demo_forms ncurses rain testcurs
|
||||
nocbreak test: testcurs
|
||||
nodelay test: firework gdc lrtest ncurses newdemo rain tclock view xmas
|
||||
noecho test: background bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus ditto firework firstlast foldkeys gdc hanoi hashtest ins_wide inserts knight lrtest movewindow ncurses rain redraw tclock testcurs view worm xmas
|
||||
noecho test: background bs cardfile chgat color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus ditto firework firstlast foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses rain redraw tclock testcurs view worm xmas
|
||||
nofilter -
|
||||
nonl test: bs demo_forms hashtest movewindow ncurses view worm xmas
|
||||
noqiflush -
|
||||
@ -561,10 +561,10 @@ vw_printw -
|
||||
vw_scanw -
|
||||
vwprintw test: movewindow
|
||||
vwscanw lib: ncurses
|
||||
wadd_wch lib: ncurses
|
||||
wadd_wch test: inch_wide
|
||||
wadd_wchnstr lib: form
|
||||
wadd_wchstr -
|
||||
waddch test: demo_forms firstlast knight ncurses
|
||||
waddch test: demo_forms firstlast inch_wide inchs knight ncurses
|
||||
waddchnstr lib: ncurses
|
||||
waddchstr -
|
||||
waddnstr lib: menu
|
||||
@ -586,8 +586,8 @@ wborder lib: ncurses
|
||||
wborder_set lib: ncurses
|
||||
wchgat test: chgat view
|
||||
wclear test: ncurses testcurs
|
||||
wclrtobot test: firstlast ncurses testcurs
|
||||
wclrtoeol test: chgat demo_defkey demo_keyok firstlast ins_wide inserts knight ncurses testcurs
|
||||
wclrtobot test: firstlast inch_wide inchs ncurses testcurs
|
||||
wclrtoeol test: chgat demo_defkey demo_keyok firstlast inch_wide inchs ins_wide inserts knight ncurses testcurs
|
||||
wcolor_set lib: ncurses
|
||||
wcursyncup lib: form
|
||||
wdelch test: ncurses testcurs
|
||||
@ -605,12 +605,12 @@ wgetnstr test: ncurses
|
||||
wgetstr -
|
||||
whline test: testcurs
|
||||
whline_set lib: ncurses
|
||||
win_wch lib: form
|
||||
win_wchnstr lib: form
|
||||
win_wchstr -
|
||||
winch test: knight testcurs
|
||||
winchnstr lib: ncurses
|
||||
winchstr -
|
||||
win_wch test: inch_wide
|
||||
win_wchnstr test: inch_wide
|
||||
win_wchstr test: inch_wide
|
||||
winch test: inchs knight testcurs
|
||||
winchnstr test: inchs
|
||||
winchstr test: inchs
|
||||
winnstr test: demo_altkeys demo_defkey foldkeys
|
||||
winnwstr lib: ncurses
|
||||
wins_nwstr test: ins_wide
|
||||
@ -624,9 +624,9 @@ winsstr test: inserts
|
||||
winstr -
|
||||
winwstr lib: ncurses
|
||||
wmouse_trafo lib: menu
|
||||
wmove test: chgat demo_altkeys demo_defkey demo_keyok demo_menus firstlast foldkeys ins_wide inserts knight movewindow ncurses newdemo redraw testcurs
|
||||
wnoutrefresh test: demo_menus edit_field ins_wide inserts knight movewindow ncurses redraw
|
||||
wprintw test: chgat demo_defkey demo_forms demo_keyok demo_menus edit_field ins_wide inserts knight movewindow ncurses testcurs
|
||||
wmove test: chgat demo_altkeys demo_defkey demo_keyok demo_menus firstlast foldkeys inch_wide inchs ins_wide inserts knight movewindow ncurses newdemo redraw testcurs
|
||||
wnoutrefresh test: demo_menus edit_field inch_wide inchs ins_wide inserts knight movewindow ncurses redraw
|
||||
wprintw test: chgat demo_defkey demo_forms demo_keyok demo_menus edit_field inch_wide inchs ins_wide inserts knight movewindow ncurses testcurs
|
||||
wredrawln test: redraw
|
||||
wrefresh test: chgat demo_forms demo_keyok demo_menus edit_field firstlast knight lrtest movewindow ncurses newdemo redraw tclock testcurs view xmas
|
||||
wresize test: cardfile ncurses
|
||||
|
200
test/inch_wide.c
Normal file
200
test/inch_wide.c
Normal file
@ -0,0 +1,200 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 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 *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: inch_wide.c,v 1.3 2007/02/11 00:32:58 tom Exp $
|
||||
*/
|
||||
/*
|
||||
int in_wch(cchar_t *wcval);
|
||||
int mvin_wch(int y, int x, cchar_t *wcval);
|
||||
int mvwin_wch(WINDOW *win, int y, int x, cchar_t *wcval);
|
||||
int win_wch(WINDOW *win, cchar_t *wcval);
|
||||
int in_wchstr(cchar_t *wchstr);
|
||||
int in_wchnstr(cchar_t *wchstr, int n);
|
||||
int win_wchstr(WINDOW *win, cchar_t *wchstr);
|
||||
int win_wchnstr(WINDOW *win, cchar_t *wchstr, int n);
|
||||
int mvin_wchstr(int y, int x, cchar_t *wchstr);
|
||||
int mvin_wchnstr(int y, int x, cchar_t *wchstr, int n);
|
||||
int mvwin_wchstr(WINDOW *win, int y, int x, cchar_t *wchstr);
|
||||
int mvwin_wchnstr(WINDOW *win, int y, int x, cchar_t *wchstr, int n);
|
||||
*/
|
||||
|
||||
#include <test.priv.h>
|
||||
|
||||
#if USE_WIDEC_SUPPORT
|
||||
|
||||
#define MAX_COLS 1024
|
||||
|
||||
static bool
|
||||
Quit(int ch)
|
||||
{
|
||||
return (ch == ERR || ch == QUIT || ch == ESCAPE);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
|
||||
{
|
||||
WINDOW *txtbox;
|
||||
WINDOW *txtwin;
|
||||
WINDOW *chrbox;
|
||||
WINDOW *chrwin;
|
||||
WINDOW *strwin;
|
||||
FILE *fp;
|
||||
int j;
|
||||
int txt_x = 0, txt_y = 0;
|
||||
int limit;
|
||||
cchar_t ch;
|
||||
cchar_t text[MAX_COLS];
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s file\n", argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
initscr();
|
||||
|
||||
chrbox = newwin(7, COLS, 0, 0);
|
||||
box(chrbox, 0, 0);
|
||||
wnoutrefresh(chrbox);
|
||||
|
||||
chrwin = derwin(chrbox, 1, COLS - 2, 1, 1);
|
||||
strwin = derwin(chrbox, 4, COLS - 2, 2, 1);
|
||||
|
||||
txtbox = newwin(LINES - 7, COLS, 7, 0);
|
||||
box(txtbox, 0, 0);
|
||||
wnoutrefresh(txtbox);
|
||||
|
||||
txtwin = derwin(txtbox,
|
||||
getmaxy(txtbox) - 2,
|
||||
getmaxx(txtbox) - 2,
|
||||
1, 1);
|
||||
|
||||
keypad(txtwin, TRUE); /* enable keyboard mapping */
|
||||
(void) cbreak(); /* take input chars one at a time, no wait for \n */
|
||||
(void) noecho(); /* don't echo input */
|
||||
|
||||
if ((fp = fopen(argv[1], "r")) != 0) {
|
||||
while ((j = fgetc(fp)) != EOF) {
|
||||
if (waddch(txtwin, j) != OK) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
wprintw(txtwin, "Cannot open:\n%s", argv[1]);
|
||||
}
|
||||
fclose(fp);
|
||||
while (!Quit(j = mvwgetch(txtwin, txt_y, txt_x))) {
|
||||
switch (j) {
|
||||
case KEY_DOWN:
|
||||
case 'j':
|
||||
if (txt_y < getmaxy(txtwin) - 1)
|
||||
txt_y++;
|
||||
else
|
||||
beep();
|
||||
break;
|
||||
case KEY_UP:
|
||||
case 'k':
|
||||
if (txt_y > 0)
|
||||
txt_y--;
|
||||
else
|
||||
beep();
|
||||
break;
|
||||
case KEY_LEFT:
|
||||
case 'h':
|
||||
if (txt_x > 0)
|
||||
txt_x--;
|
||||
else
|
||||
beep();
|
||||
break;
|
||||
case KEY_RIGHT:
|
||||
case 'l':
|
||||
if (txt_x < getmaxx(txtwin) - 1)
|
||||
txt_x++;
|
||||
else
|
||||
beep();
|
||||
break;
|
||||
}
|
||||
|
||||
wmove(txtwin, txt_y, txt_x);
|
||||
|
||||
mvwprintw(chrwin, 0, 0, "char:");
|
||||
wclrtoeol(chrwin);
|
||||
if (win_wch(txtwin, &ch) != ERR) {
|
||||
if (wadd_wch(chrwin, &ch) != ERR) {
|
||||
for (j = txt_x + 1; j < getmaxx(txtwin); ++j) {
|
||||
if (mvwin_wch(txtwin, txt_y, j, &ch) != ERR) {
|
||||
if (wadd_wch(chrwin, &ch) == ERR) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
wnoutrefresh(chrwin);
|
||||
|
||||
mvwprintw(strwin, 0, 0, "text:");
|
||||
wclrtobot(strwin);
|
||||
|
||||
limit = getmaxx(strwin) - 5;
|
||||
|
||||
wmove(txtwin, txt_y, txt_x);
|
||||
if (win_wchstr(txtwin, text) != ERR) {
|
||||
mvwadd_wchstr(strwin, 0, 5, text);
|
||||
}
|
||||
|
||||
wmove(txtwin, txt_y, txt_x);
|
||||
if (win_wchnstr(txtwin, text, limit) != ERR) {
|
||||
mvwadd_wchstr(strwin, 1, 5, text);
|
||||
}
|
||||
|
||||
if (mvwin_wchstr(txtwin, txt_y, txt_x, text) != ERR) {
|
||||
mvwadd_wchstr(strwin, 2, 5, text);
|
||||
}
|
||||
|
||||
if (mvwin_wchnstr(txtwin, txt_y, txt_x, text, limit) != ERR) {
|
||||
mvwadd_wchstr(strwin, 3, 5, text);
|
||||
}
|
||||
|
||||
wnoutrefresh(strwin);
|
||||
|
||||
/* FIXME: want stdscr tests also, but must be separate program */
|
||||
}
|
||||
endwin();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
#else
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
printf("This program requires the wide-ncurses library\n");
|
||||
ExitProgram(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
189
test/inchs.c
Normal file
189
test/inchs.c
Normal file
@ -0,0 +1,189 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 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 *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
/*
|
||||
* $Id: inchs.c,v 1.4 2007/02/11 00:27:12 tom Exp $
|
||||
*/
|
||||
/*
|
||||
chtype inch(void);
|
||||
chtype winch(WINDOW *win);
|
||||
chtype mvinch(int y, int x);
|
||||
chtype mvwinch(WINDOW *win, int y, int x);
|
||||
int inchstr(chtype *chstr);
|
||||
int inchnstr(chtype *chstr, int n);
|
||||
int winchstr(WINDOW *win, chtype *chstr);
|
||||
int winchnstr(WINDOW *win, chtype *chstr, int n);
|
||||
int mvinchstr(int y, int x, chtype *chstr);
|
||||
int mvinchnstr(int y, int x, chtype *chstr, int n);
|
||||
int mvwinchstr(WINDOW *win, int y, int x, chtype *chstr);
|
||||
int mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr, int n);
|
||||
*/
|
||||
|
||||
#include <test.priv.h>
|
||||
|
||||
#define MAX_COLS 1024
|
||||
|
||||
static bool
|
||||
Quit(int ch)
|
||||
{
|
||||
return (ch == ERR || ch == QUIT || ch == ESCAPE);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
|
||||
{
|
||||
WINDOW *txtbox;
|
||||
WINDOW *txtwin;
|
||||
WINDOW *chrbox;
|
||||
WINDOW *chrwin;
|
||||
WINDOW *strwin;
|
||||
FILE *fp;
|
||||
int ch, j;
|
||||
int txt_x = 0, txt_y = 0;
|
||||
int limit;
|
||||
chtype text[MAX_COLS];
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s file\n", argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
initscr();
|
||||
|
||||
chrbox = newwin(7, COLS, 0, 0);
|
||||
box(chrbox, 0, 0);
|
||||
wnoutrefresh(chrbox);
|
||||
|
||||
chrwin = derwin(chrbox, 1, COLS - 2, 1, 1);
|
||||
strwin = derwin(chrbox, 4, COLS - 2, 2, 1);
|
||||
|
||||
txtbox = newwin(LINES - 7, COLS, 7, 0);
|
||||
box(txtbox, 0, 0);
|
||||
wnoutrefresh(txtbox);
|
||||
|
||||
txtwin = derwin(txtbox,
|
||||
getmaxy(txtbox) - 2,
|
||||
getmaxx(txtbox) - 2,
|
||||
1, 1);
|
||||
|
||||
keypad(txtwin, TRUE); /* enable keyboard mapping */
|
||||
(void) cbreak(); /* take input chars one at a time, no wait for \n */
|
||||
(void) noecho(); /* don't echo input */
|
||||
|
||||
if ((fp = fopen(argv[1], "r")) != 0) {
|
||||
while ((ch = fgetc(fp)) != EOF) {
|
||||
if (waddch(txtwin, ch) != OK) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
wprintw(txtwin, "Cannot open:\n%s", argv[1]);
|
||||
}
|
||||
fclose(fp);
|
||||
while (!Quit(ch = mvwgetch(txtwin, txt_y, txt_x))) {
|
||||
switch (ch) {
|
||||
case KEY_DOWN:
|
||||
case 'j':
|
||||
if (txt_y < getmaxy(txtwin) - 1)
|
||||
txt_y++;
|
||||
else
|
||||
beep();
|
||||
break;
|
||||
case KEY_UP:
|
||||
case 'k':
|
||||
if (txt_y > 0)
|
||||
txt_y--;
|
||||
else
|
||||
beep();
|
||||
break;
|
||||
case KEY_LEFT:
|
||||
case 'h':
|
||||
if (txt_x > 0)
|
||||
txt_x--;
|
||||
else
|
||||
beep();
|
||||
break;
|
||||
case KEY_RIGHT:
|
||||
case 'l':
|
||||
if (txt_x < getmaxx(txtwin) - 1)
|
||||
txt_x++;
|
||||
else
|
||||
beep();
|
||||
break;
|
||||
}
|
||||
|
||||
wmove(txtwin, txt_y, txt_x);
|
||||
|
||||
mvwprintw(chrwin, 0, 0, "char:");
|
||||
wclrtoeol(chrwin);
|
||||
if ((ch = winch(txtwin)) != ERR) {
|
||||
if (waddch(chrwin, (chtype) ch) != ERR) {
|
||||
for (j = txt_x + 1; j < getmaxx(txtwin); ++j) {
|
||||
if ((ch = mvwinch(txtwin, txt_y, j)) != ERR) {
|
||||
if (waddch(chrwin, (chtype) ch) == ERR) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
wnoutrefresh(chrwin);
|
||||
|
||||
mvwprintw(strwin, 0, 0, "text:");
|
||||
wclrtobot(strwin);
|
||||
|
||||
limit = getmaxx(strwin) - 5;
|
||||
|
||||
wmove(txtwin, txt_y, txt_x);
|
||||
if (winchstr(txtwin, text) != ERR) {
|
||||
mvwaddchstr(strwin, 0, 5, text);
|
||||
}
|
||||
|
||||
wmove(txtwin, txt_y, txt_x);
|
||||
if (winchnstr(txtwin, text, limit) != ERR) {
|
||||
mvwaddchstr(strwin, 1, 5, text);
|
||||
}
|
||||
|
||||
if (mvwinchstr(txtwin, txt_y, txt_x, text) != ERR) {
|
||||
mvwaddchstr(strwin, 2, 5, text);
|
||||
}
|
||||
|
||||
if (mvwinchnstr(txtwin, txt_y, txt_x, text, limit) != ERR) {
|
||||
mvwaddchstr(strwin, 3, 5, text);
|
||||
}
|
||||
|
||||
wnoutrefresh(strwin);
|
||||
|
||||
/* FIXME: want stdscr tests also, but must be separate program */
|
||||
}
|
||||
endwin();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
10
test/modules
10
test/modules
@ -1,6 +1,6 @@
|
||||
# $Id: modules,v 1.29 2006/12/24 00:53:52 tom Exp $
|
||||
# $Id: modules,v 1.30 2007/02/10 22:28:07 tom Exp $
|
||||
##############################################################################
|
||||
# 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 "Software"), #
|
||||
@ -40,8 +40,8 @@ chgat progs $(srcdir) $(HEADER_DEPS)
|
||||
color_set progs $(srcdir) $(HEADER_DEPS)
|
||||
demo_altkeys progs $(srcdir) $(HEADER_DEPS)
|
||||
demo_defkey progs $(srcdir) $(HEADER_DEPS)
|
||||
demo_keyok progs $(srcdir) $(HEADER_DEPS)
|
||||
demo_forms progs $(srcdir) $(HEADER_DEPS) ../include/form.h $(srcdir)/edit_field.h
|
||||
demo_keyok progs $(srcdir) $(HEADER_DEPS)
|
||||
demo_menus progs $(srcdir) $(HEADER_DEPS) ../include/menu.h
|
||||
demo_panels progs $(srcdir) $(HEADER_DEPS) ../include/panel.h
|
||||
demo_termcap progs $(srcdir) $(HEADER_DEPS)
|
||||
@ -56,13 +56,15 @@ foldkeys progs $(srcdir) $(HEADER_DEPS)
|
||||
gdc progs $(srcdir) $(HEADER_DEPS)
|
||||
hanoi progs $(srcdir) $(HEADER_DEPS)
|
||||
hashtest progs $(srcdir) $(HEADER_DEPS)
|
||||
inch_wide progs $(srcdir) $(HEADER_DEPS)
|
||||
inchs progs $(srcdir) $(HEADER_DEPS)
|
||||
ins_wide progs $(srcdir) $(HEADER_DEPS)
|
||||
inserts progs $(srcdir) $(HEADER_DEPS)
|
||||
keynames progs $(srcdir) $(HEADER_DEPS)
|
||||
knight progs $(srcdir) $(HEADER_DEPS)
|
||||
lrtest progs $(srcdir) $(HEADER_DEPS)
|
||||
ncurses progs $(srcdir) $(HEADER_DEPS) ../include/panel.h ../include/menu.h ../include/form.h
|
||||
movewindow progs $(srcdir) $(HEADER_DEPS)
|
||||
ncurses progs $(srcdir) $(HEADER_DEPS) ../include/panel.h ../include/menu.h ../include/form.h
|
||||
newdemo progs $(srcdir) $(HEADER_DEPS)
|
||||
railroad progs $(srcdir) $(HEADER_DEPS)
|
||||
rain progs $(srcdir) $(HEADER_DEPS)
|
||||
|
@ -1,6 +1,6 @@
|
||||
# $Id: programs,v 1.6 2006/12/24 16:23:58 tom Exp $
|
||||
# $Id: programs,v 1.7 2007/02/10 22:27:58 tom Exp $
|
||||
##############################################################################
|
||||
# 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 "Software"), #
|
||||
@ -53,6 +53,8 @@ foldkeys $(LDFLAGS_CURSES) $(LOCAL_LIBS) foldkeys
|
||||
gdc $(LDFLAGS_CURSES) $(LOCAL_LIBS) gdc
|
||||
hanoi $(LDFLAGS_CURSES) $(LOCAL_LIBS) hanoi
|
||||
hashtest $(LDFLAGS_CURSES) $(LOCAL_LIBS) hashtest
|
||||
inch_wide $(LDFLAGS_CURSES) $(LOCAL_LIBS) inch_wide
|
||||
inchs $(LDFLAGS_CURSES) $(LOCAL_LIBS) inchs
|
||||
ins_wide $(LDFLAGS_CURSES) $(LOCAL_LIBS) ins_wide
|
||||
inserts $(LDFLAGS_CURSES) $(LOCAL_LIBS) inserts
|
||||
keynames $(LDFLAGS_CURSES) $(LOCAL_LIBS) keynames
|
||||
|
Loading…
Reference in New Issue
Block a user