AdaCurses-20140726/ 0000755 0001751 0000144 00000000000 12365055355 012363 5 ustar tom users AdaCurses-20140726/TODO 0000644 0001751 0000144 00000006007 10422526331 013043 0 ustar tom users -------------------------------------------------------------------------------
-- Copyright (c) 1998-1999,2006 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: TODO,v 1.5 2006/04/22 22:23:21 tom Exp $
-------------------------------------------------------------------------------
-- Intensive testing
Perhaps the delivery of the Beta will help a bit.
-- Documentation
Like most WEB pages: under continuous construction
-- Style cleanup
-- Alternate functions for procedures with out params
Comfort purpose
-- Sample program
Under continuous construction (and it's not a WEB page!!!)
-- Make the binding objects a shared library
They are rather large, so it would make sense, otherwise Ada95
would look too large, although the generated code is as compact
as C or C++. I'll wait a bit until the GNAT people provide some
better support to construct shared libraries.
-- Think about more inlining
-- Check for memory leaks.
Oh I would like it so much if the GNAT guys would put an optional
GC into their system.
AdaCurses-20140726/config.sub 0000755 0001751 0000144 00000105420 12324540223 014334 0 ustar tom users #! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2014 Free Software Foundation, Inc.
timestamp='2014-04-03'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit ;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| k1om-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-unknown
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aros)
basic_machine=i386-pc
os=-aros
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
bluegene*)
basic_machine=powerpc-ibm
os=-cnk
;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dicos)
basic_machine=i686-pc
os=-dicos
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppa-next)
os=-nextstep3
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
i*86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
i386-vsta | vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32)
basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i686-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
openrisc | openrisc-*)
basic_machine=or32-unknown
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rdos | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh5el)
basic_machine=sh5le-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tile*)
basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases
# that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-svr4*)
os=-sysv4
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo $os | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-aros*)
os=-aros
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-nacl*)
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
c8051-*)
os=-elf
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
;;
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-be)
os=-beos
;;
*-haiku)
os=-haiku
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-cnk*|-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
AdaCurses-20140726/README 0000644 0001751 0000144 00000004406 07746514446 013257 0 ustar tom users -------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
-------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
The documentation is provided in HTML format in the ./html
subdirectory. The main document is named index.html
AdaCurses-20140726/install-sh 0000755 0001751 0000144 00000015723 07762207755 014407 0 ustar tom users #! /bin/sh
#
# install - install a program, script, or datafile
#
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# 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, 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
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd=$cpprog
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "$0: no input file specified" >&2
exit 1
else
:
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d "$dst" ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "$0: $src does not exist" >&2
exit 1
fi
if [ x"$dst" = x ]
then
echo "$0: no destination specified" >&2
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d "$dst" ]
then
dst=$dst/`basename "$src"`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp=$pathcomp$1
shift
if [ ! -d "$pathcomp" ] ;
then
$mkdirprog "$pathcomp"
else
:
fi
pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd "$dst" &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename "$dst"`
else
dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename "$dst"`
else
:
fi
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/#inst.$$#
rmtmp=$dstdir/#rm.$$#
# Trap to clean up temp files at exit.
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
# Move or copy the file name to the temp name
$doit $instcmd "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
# Now remove or move aside any old file at destination location. We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons. In this case, the final cleanup
# might fail but the new file should still install successfully.
{
if [ -f "$dstdir/$dstfile" ]
then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
{
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit
}
AdaCurses-20140726/samples/ 0000755 0001751 0000144 00000000000 12365055355 014027 5 ustar tom users AdaCurses-20140726/samples/ncurses2-demo_forms.ads 0000644 0001751 0000144 00000005673 07212274076 020425 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.demo_forms;
AdaCurses-20140726/samples/ncurses2-overlap_test.adb 0000644 0001751 0000144 00000015322 11541116166 020744 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2004,2011 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.5 $
-- $Date: 2011/03/19 12:07:18 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-- test effects of overlapping windows
procedure ncurses2.overlap_test is
procedure fillwin (win : Window; ch : Character);
procedure crosswin (win : Window; ch : Character);
procedure fillwin (win : Window; ch : Character) is
y1 : Line_Position;
x1 : Column_Position;
begin
Get_Size (win, y1, x1);
for y in 0 .. y1 - 1 loop
Move_Cursor (win, y, 0);
for x in 0 .. x1 - 1 loop
Add (win, Ch => ch);
end loop;
end loop;
exception
when Curses_Exception => null;
-- write to lower right corner
end fillwin;
procedure crosswin (win : Window; ch : Character) is
y1 : Line_Position;
x1 : Column_Position;
begin
Get_Size (win, y1, x1);
for y in 0 .. y1 - 1 loop
for x in 0 .. x1 - 1 loop
if ((x > (x1 - 1) / 3) and (x <= (2 * (x1 - 1)) / 3))
or (((y > (y1 - 1) / 3) and (y <= (2 * (y1 - 1)) / 3))) then
Move_Cursor (win, y, x);
Add (win, Ch => ch);
end if;
end loop;
end loop;
end crosswin;
-- In a 24x80 screen like some xterms are, the instructions will
-- be overwritten.
ch : Character;
win1 : Window := New_Window (9, 20, 3, 3);
win2 : Window := New_Window (9, 20, 9, 16);
begin
Set_Raw_Mode (SwitchOn => True);
Refresh;
Move_Cursor (Line => 0, Column => 0);
Add (Str => "This test shows the behavior of wnoutrefresh() with " &
"respect to");
Add (Ch => newl);
Add (Str => "the shared region of two overlapping windows A and B. "&
"The cross");
Add (Ch => newl);
Add (Str => "pattern in each window does not overlap the other.");
Add (Ch => newl);
Move_Cursor (Line => 18, Column => 0);
Add (Str => "a = refresh A, then B, then doupdate. b = refresh B, " &
"then A, then doupdate");
Add (Ch => newl);
Add (Str => "c = fill window A with letter A. d = fill window B " &
"with letter B.");
Add (Ch => newl);
Add (Str => "e = cross pattern in window A. f = cross pattern " &
"in window B.");
Add (Ch => newl);
Add (Str => "g = clear window A. h = clear window B.");
Add (Ch => newl);
Add (Str => "i = overwrite A onto B. j = overwrite " &
"B onto A.");
Add (Ch => newl);
Add (Str => "^Q/ESC = terminate test.");
loop
ch := Code_To_Char (Getchar);
exit when ch = CTRL ('Q') or ch = CTRL ('['); -- QUIT or ESCAPE
case ch is
when 'a' => -- refresh window A first, then B
Refresh_Without_Update (win1);
Refresh_Without_Update (win2);
Update_Screen;
when 'b' => -- refresh window B first, then A
Refresh_Without_Update (win2);
Refresh_Without_Update (win1);
Update_Screen;
when 'c' => -- fill window A so it's visible
fillwin (win1, 'A');
when 'd' => -- fill window B so it's visible
fillwin (win2, 'B');
when 'e' => -- cross test pattern in window A
crosswin (win1, 'A');
when 'f' => -- cross test pattern in window B
crosswin (win2, 'B');
when 'g' => -- clear window A
Clear (win1);
Move_Cursor (win1, 0, 0);
when 'h' => -- clear window B
Clear (win2);
Move_Cursor (win2, 0, 0);
when 'i' => -- overwrite A onto B
Overwrite (win1, win2);
when 'j' => -- overwrite B onto A
Overwrite (win2, win1);
when others => null;
end case;
end loop;
Delete (win2);
Delete (win1);
Erase;
End_Windows;
end ncurses2.overlap_test;
AdaCurses-20140726/samples/rain.adb 0000644 0001751 0000144 00000014211 11056336677 015434 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Rain --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2007,2008 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. --
------------------------------------------------------------------------------
-- Author: Laurent Pautet
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
-- $Revision: 1.8 $
-- $Date: 2008/08/30 21:38:07 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- --
with ncurses2.util; use ncurses2.util;
with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random;
with Status; use Status;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
procedure Rain is
Visibility : Cursor_Visibility;
subtype X_Position is Line_Position;
subtype Y_Position is Column_Position;
Xpos : array (1 .. 5) of X_Position;
Ypos : array (1 .. 5) of Y_Position;
done : Boolean;
c : Key_Code;
N : Integer;
G : Generator;
Max_X, X : X_Position;
Max_Y, Y : Y_Position;
procedure Next (J : in out Integer);
procedure Cursor (X : X_Position; Y : Y_Position);
procedure Next (J : in out Integer) is
begin
if J = 5 then
J := 1;
else
J := J + 1;
end if;
end Next;
procedure Cursor (X : X_Position; Y : Y_Position) is
begin
Move_Cursor (Line => X, Column => Y);
end Cursor;
pragma Inline (Cursor);
begin
Init_Screen;
Set_NL_Mode;
Set_Echo_Mode (False);
Visibility := Invisible;
Set_Cursor_Visibility (Visibility);
Set_Timeout_Mode (Standard_Window, Non_Blocking, 0);
Max_X := Lines - 5;
Max_Y := Columns - 5;
for I in Xpos'Range loop
Xpos (I) := X_Position (Float (Max_X) * Random (G)) + 2;
Ypos (I) := Y_Position (Float (Max_Y) * Random (G)) + 2;
end loop;
N := 1;
done := False;
while not done and Process.Continue loop
X := X_Position (Float (Max_X) * Random (G)) + 2;
Y := Y_Position (Float (Max_Y) * Random (G)) + 2;
Cursor (X, Y);
Add (Ch => '.');
Cursor (Xpos (N), Ypos (N));
Add (Ch => 'o');
--
Next (N);
Cursor (Xpos (N), Ypos (N));
Add (Ch => 'O');
--
Next (N);
Cursor (Xpos (N) - 1, Ypos (N));
Add (Ch => '-');
Cursor (Xpos (N), Ypos (N) - 1);
Add (Str => "|.|");
Cursor (Xpos (N) + 1, Ypos (N));
Add (Ch => '-');
--
Next (N);
Cursor (Xpos (N) - 2, Ypos (N));
Add (Ch => '-');
Cursor (Xpos (N) - 1, Ypos (N) - 1);
Add (Str => "/\\");
Cursor (Xpos (N), Ypos (N) - 2);
Add (Str => "| O |");
Cursor (Xpos (N) + 1, Ypos (N) - 1);
Add (Str => "\\/");
Cursor (Xpos (N) + 2, Ypos (N));
Add (Ch => '-');
--
Next (N);
Cursor (Xpos (N) - 2, Ypos (N));
Add (Ch => ' ');
Cursor (Xpos (N) - 1, Ypos (N) - 1);
Add (Str => " ");
Cursor (Xpos (N), Ypos (N) - 2);
Add (Str => " ");
Cursor (Xpos (N) + 1, Ypos (N) - 1);
Add (Str => " ");
Cursor (Xpos (N) + 2, Ypos (N));
Add (Ch => ' ');
Xpos (N) := X;
Ypos (N) := Y;
c := Getchar;
case c is
when Character'Pos ('q') => done := True;
when Character'Pos ('Q') => done := True;
when Character'Pos ('s') => Set_NoDelay_Mode (Standard_Window, False);
when Character'Pos (' ') => Set_NoDelay_Mode (Standard_Window, True);
when others => null;
end case;
Nap_Milli_Seconds (50);
end loop;
Visibility := Normal;
Set_Cursor_Visibility (Visibility);
End_Windows;
Curses_Free_All;
end Rain;
AdaCurses-20140726/samples/ncurses2-util.ads 0000644 0001751 0000144 00000007522 10447516250 017240 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses2.util --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2006 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.2 $
-- $Date: 2006/06/25 14:24:40 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Ada.Text_IO;
package ncurses2.util is
Blank : constant Character := ' ';
Blank2 : constant Attributed_Character :=
(Ch => Blank, Attr => Normal_Video, Color => Color_Pair'First);
newl : constant Character := Character'Val (10);
function CTRL (c : Character) return Key_Code;
function CTRL (c : Character) return Character;
function Getchar (win : Window := Standard_Window) return Key_Code;
procedure Getchar (win : Window := Standard_Window);
procedure Pause;
procedure Cannot (s : String);
procedure ShellOut (message : Boolean);
package Int_IO is new Ada.Text_IO.Integer_IO (Integer);
function Is_Digit (c : Key_Code) return Boolean;
procedure P (s : String);
function Code_To_Char (c : Key_Code) return Character;
function ctoi (c : Character) return Integer;
end ncurses2.util;
AdaCurses-20140726/samples/ncurses2-acs_and_scroll.ads 0000644 0001751 0000144 00000005677 07212274072 021241 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.acs_and_scroll;
AdaCurses-20140726/samples/explain.txt 0000644 0001751 0000144 00000017215 11541115445 016226 0 ustar tom users #VERSION
This is Version 00.90.00 of the demo package.
#MENUKEYS
In a menu you can use the following Keys in the whole application:
- CTRL-X eXit the menu
- CTRL-N Go to next item
- CTRL-P Go to previous item
- CTRL-U Scroll up one line
- CTRL-D Scroll down one line
- CTRL-F Scroll down one page
- PAGE DOWN Scroll down one page
- PAGE UP Scroll back one page
- CTRL-B Scroll back one page
- CTRL-Y Clear pattern
- CTRL-H Delete last character from pattern
- Backspace Delete last character from pattern
- CTRL-A Next pattern match
- CTRL-E Previous pattern match
- CTRL-T Toggle item in a multi-selection menu
- CR or LF Select an item
- HOME Key Go to the first item
- F3 Quit the menu
- Cursor Down Down one item
- Cursor Up Up one item
- Cursor Left Left one item
- Cursor Right Right one item
- END Key Go to last item
#FORMKEYS
- CTRL-X eXit the form
- CTRL-F Go forward to the next field
- CTRL-B Go backward to the previous field
- CTRL-L Go to the field left of the current one
- CTRL-R Go to the field right of the current one
- CTRL-U Go to the field above the current one
- CTRL-D Go to the field below the current one
- CTRL-W Go to the next word in the field
- CTRL-T Go to the previous word in the field
- CTRL-A Go to the beginning of the field
- CTRL-E Go to the end of the field
- CTRL-I Insert a blank character at the current position
- CTRL-O Insert a line
- CTRL-V Delete a character
- CTRL-H Delete previous character
- CTRL-Y Delete a line
- CTRL-G Delete a word
- CTRL-K Clear to end of field
- CTRL-N Next choice in a choice field (Enumerations etc.)
- CTRL-P Previous choice in a choice field.
#HELP
#HELPKEYS
You may scroll with the Cursor Up/Down Keys.
You may leave the help with the Function Key labeled 'Quit'.
#INHELP
You are already in the help system.
You may leave the help with the Function Key labeled 'Quit'.
#MAIN
This is the main menu of the sample program for the ncurses Ada95
binding. The main intention of the demo is not to demonstrate or
test all the features of ncurses and it's subsystems, but to provide
to you some sample code how to use the binding with Ada95.
You may select this options:
* Look at some ncurses core functions
* Look at some features of the menu subsystem
* Look at some features of the form subsystem
* Look at the output of the Ada.Text_IO like functions
for ncurses.
#MAINPAD
You may press at any place in this demo CTRL-C. This will give you a command
window. You can just type in the Label-String of a function key, then this
key will be simulated. This should help you to run the application even if
you run it on a terminal with no or only a few function keys. With CTRL-N
and CTRL-P you may browse through the possible values in the command window.
#MENU00
Here we give you a selection of various menu demonstrations.
#MENU-PAD00
This menu itself is a demo for a single valued, 1-column menu with
descriptions for the items, a marker and a padding character between
the item name and the description.
#MENU01
This is a demo of the some of the menu layout options. One of them
is the spacing functionality. Just press the Key labeled "Flip" to
flip between the non-spaced and a spaced version of the menu. Please
note that this functionality is unique for ncurses and is not found
in the SVr4 menu implementation.
This is a menu that sometimes does not fit into it's window and
therefore it becomes a scroll menu.
You can also see here very nicely the pattern matching functionality
of menus. Type for example a 'J' and you will be positioned to the
next item after the current starting with a 'J'. Any more characters
you type in make the pattern more specific. With CTRL-A and CTRL-Z
(for more details press the Key labeled "Keys") you can browse
through all the items matching the pattern.
You may change the format of the menu. Just press one of the keys
labeled "4x1", "4x2" or "4x3" to get a menu with that many rows
and columns.
With the Keys "O-Row" or "O-Col" (they occupy the same label and
switch on selection) you can change the major order scheme for
the menu. If "O-Col" is visible, the menu is currently major
ordered by rows, you can switch to major column order by pressing
the key. If "O-Row" is visible, it's just the reverse situation.
This Key is not visible in "4x1" layout mode, because in this case
the functionality makes no sense.
With the Keys "Multi" or "Singl" (they occupy the same label and
switch on selection) you can change whether or not the menu allows
multiple or only single selection.
With the Keys "+Desc" or "-Desc" (they occupy the same label and
switch on selection) you can change whether or not the descriptions
for each item should be displayed. Please not that this key is
not visible in the "4x3" layout mode, because in this case the
menu would not fit on a typical 80x24 screen.
With the Keys "Disab" or "Enab" (they occupy the same label and
switch on selection) you can dis- or enable the selectability of
the month with 31 days.
#MENU-PAD01
You may press "Flip" to see the effect of ncurses unique menu-spacing.
The Keys "4x1", "4x2" and "4x3" will change the format of the menu.
Please note that this is a scrolling menu. You may also play with the
pattern matching functionality or try to change the format of the menu.
For more details press the Key labeled "Help".
#FORM00
This is a demo of the forms package.
#FORM-PAD00
Please note that this demo is far from being complete. It really shows
only a small part of the functionality of the forms package. Let's hope
the next version will have a richer demo (You want to contribute ?).
#NOTIMPL
Sorry this functionality of the demo is not implemented at the moment.
Remember this is a freeware project, so I can use only my very rare
free time to continue coding. If you would like to contribute, you
are very welcome !
#CURSES00
This is a menu where you can select some different demos of the ncurses
functionality.
#CURSES-PAD00
Please note that this demo is far from being complete. It really shows
only a small part of the functionality of the curses package. Let's hope
the next version will have a richer demo (You want to contribute ?).
#MOUSEKEYS
In this demo you may use this keys:
- Key labeled "Help" to get a help
- Key labeled "Keys" is what you are reading now
- Key labeled "Quit" to leave the demo
You may click the mouse buttons at any location at the screen and look
at the protocol window !
#MOUSE00
A rather simple use of a mouse as demo. It's there just to test the
code and to provide the sample source.
It might be of interest, that the output into the protocol window is
done by the (n)curses Text_IO subpackages. Especially the output of
the button and state names is done by Ads's enumeration IO, which
allows you to print the names of enumeration literals. That's really
nice.
#MOUSE-PAD00
This is a very simple demo of the mouse features of ncurses. It's there
just to test whether or not the generated code for the binding really
works on the different architectures (seems so).
#ATTRIBDEMO
Again this is a more than simple demo and just here to give you the
sourcecode.
#ATTRIBKEYS
You may press one of the three well known standard keys of this demo.
#ATTRIB-PAD00
Again this is a more than simple demo and just here to give you the
source code. Feel free to contribute more.
#TEXTIO
#TEXTIOKEYS
#TEXTIO-PAD00
#END
AdaCurses-20140726/samples/ncurses.adb 0000644 0001751 0000144 00000006034 07212274072 016156 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.m; use ncurses2.m;
with GNAT.OS_Lib; use GNAT.OS_Lib;
procedure ncurses is
begin
OS_Exit (main);
end ncurses;
AdaCurses-20140726/samples/ncurses2-getopt.ads 0000644 0001751 0000144 00000007100 10447516250 017555 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2006 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.2 $
-- $Date: 2006/06/25 14:24:40 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package ncurses2.getopt is
type stringa is access String;
type stringfunc is access
function (n : Positive) return String;
procedure Qgetopt (retval : out Integer;
argc : Integer;
argv : stringfunc;
optstring : String;
optind : in out Integer;
-- ignored for ncurses, must be initialized to 0
-- by the caller
Optarg : out stringa
-- a garbage collector would be useful here.
);
end ncurses2.getopt;
AdaCurses-20140726/samples/sample-form_demo.adb 0000644 0001751 0000144 00000013314 11542241134 017713 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Form_Demo --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.16 $
-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
with Terminal_Interface.Curses.Forms.Field_User_Data;
with Sample.My_Field_Type; use Sample.My_Field_Type;
with Sample.Explanation; use Sample.Explanation;
with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux;
with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Form_Demo.Handler;
with Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
with Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
use Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
with Terminal_Interface.Curses.Forms.Field_Types.IntField;
use Terminal_Interface.Curses.Forms.Field_Types.IntField;
package body Sample.Form_Demo is
type User_Data is
record
Data : Integer;
end record;
type User_Access is access User_Data;
package Fld_U is new
Terminal_Interface.Curses.Forms.Field_User_Data (User_Data,
User_Access);
type Weekday is (Sunday, Monday, Tuesday, Wednesday, Thursday,
Friday, Saturday);
package Weekday_Enum is new
Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada (Weekday);
Enum_Field : constant Enumeration_Field :=
Weekday_Enum.Create;
procedure Demo
is
Mft : constant My_Data := (Ch => 'X');
FA : Field_Array_Access := new Field_Array'
(Make (0, 14, "Sample Entry Form"),
Make (2, 0, "WeekdayEnumeration"),
Make (2, 20, "Numeric 1-10"),
Make (2, 34, "Only 'X'"),
Make (5, 0, "Multiple Lines offscreen(Scroll)"),
Make (Width => 18, Top => 3, Left => 0),
Make (Width => 12, Top => 3, Left => 20),
Make (Width => 12, Top => 3, Left => 34),
Make (Width => 46, Top => 6, Left => 0, Height => 4, Off_Screen => 2),
Null_Field
);
Frm : Terminal_Interface.Curses.Forms.Form := Create (FA);
I_F : constant Integer_Field := (Precision => 0,
Lower_Limit => 1,
Upper_Limit => 10);
F1, F2 : User_Access;
package Fh is new Sample.Form_Demo.Handler (Default_Driver);
begin
Push_Environment ("FORM00");
Notepad ("FORM-PAD00");
Default_Labels;
Set_Field_Type (FA.all (6), Enum_Field);
Set_Field_Type (FA.all (7), I_F);
Set_Field_Type (FA.all (8), Mft);
F1 := new User_Data'(Data => 4711);
Fld_U.Set_User_Data (FA.all (1), F1);
Fh.Drive_Me (Frm);
Fld_U.Get_User_Data (FA.all (1), F2);
pragma Assert (F1 = F2);
pragma Assert (F1.Data = F2.Data);
Pop_Environment;
Delete (Frm);
Free (FA, True);
end Demo;
end Sample.Form_Demo;
AdaCurses-20140726/samples/sample-form_demo-aux.adb 0000644 0001751 0000144 00000024645 11315445062 020523 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Form_Demo.Aux --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.17 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
with Sample.Manifest; use Sample.Manifest;
with Sample.Helpers; use Sample.Helpers;
with Sample.Keyboard_Handler; use Sample.Keyboard_Handler;
with Sample.Explanation; use Sample.Explanation;
package body Sample.Form_Demo.Aux is
procedure Geometry (F : Form;
L : out Line_Count; -- Lines used for menu
C : out Column_Count; -- Columns used for menu
Y : out Line_Position; -- Proposed Line for menu
X : out Column_Position) -- Proposed Column for menu
is
begin
Scale (F, L, C);
L := L + 2; -- count for frame at top and bottom
C := C + 2; -- "
-- Calculate horizontal coordinate at the screen center
X := (Columns - C) / 2;
Y := 1; -- start always in line 1
end Geometry;
function Create (F : Form;
Title : String;
Lin : Line_Position;
Col : Column_Position) return Panel
is
W, S : Window;
L : Line_Count;
C : Column_Count;
Y : Line_Position;
X : Column_Position;
Pan : Panel;
begin
Geometry (F, L, C, Y, X);
W := New_Window (L, C, Lin, Col);
Set_Meta_Mode (W);
Set_KeyPad_Mode (W);
if Has_Colors then
Set_Background (Win => W,
Ch => (Ch => ' ',
Color => Default_Colors,
Attr => Normal_Video));
Set_Character_Attributes (Win => W,
Color => Default_Colors,
Attr => Normal_Video);
Erase (W);
end if;
S := Derived_Window (W, L - 2, C - 2, 1, 1);
Set_Meta_Mode (S);
Set_KeyPad_Mode (S);
Box (W);
Set_Window (F, W);
Set_Sub_Window (F, S);
if Title'Length > 0 then
Window_Title (W, Title);
end if;
Pan := New_Panel (W);
Post (F);
return Pan;
end Create;
procedure Destroy (F : Form;
P : in out Panel)
is
W, S : Window;
begin
W := Get_Window (F);
S := Get_Sub_Window (F);
Post (F, False);
Erase (W);
Delete (P);
Set_Window (F, Null_Window);
Set_Sub_Window (F, Null_Window);
Delete (S);
Delete (W);
Update_Panels;
end Destroy;
function Get_Request (F : Form;
P : Panel;
Handle_CRLF : Boolean := True) return Key_Code
is
W : constant Window := Get_Window (F);
K : Real_Key_Code;
Ch : Character;
begin
Top (P);
loop
K := Get_Key (W);
if K in Special_Key_Code'Range then
case K is
when HELP_CODE => Explain_Context;
when EXPLAIN_CODE => Explain ("FORMKEYS");
when Key_Home => return F_First_Field;
when Key_End => return F_Last_Field;
when QUIT_CODE => return QUIT;
when Key_Cursor_Down => return F_Down_Char;
when Key_Cursor_Up => return F_Up_Char;
when Key_Cursor_Left => return F_Previous_Char;
when Key_Cursor_Right => return F_Next_Char;
when Key_Next_Page => return F_Next_Page;
when Key_Previous_Page => return F_Previous_Page;
when Key_Backspace => return F_Delete_Previous;
when Key_Clear_Screen => return F_Clear_Field;
when Key_Clear_End_Of_Line => return F_Clear_EOF;
when others => return K;
end case;
elsif K in Normal_Key_Code'Range then
Ch := Character'Val (K);
case Ch is
when CAN => return QUIT; -- CTRL-X
when ACK => return F_Next_Field; -- CTRL-F
when STX => return F_Previous_Field; -- CTRL-B
when FF => return F_Left_Field; -- CTRL-L
when DC2 => return F_Right_Field; -- CTRL-R
when NAK => return F_Up_Field; -- CTRL-U
when EOT => return F_Down_Field; -- CTRL-D
when ETB => return F_Next_Word; -- CTRL-W
when DC4 => return F_Previous_Word; -- CTRL-T
when SOH => return F_Begin_Field; -- CTRL-A
when ENQ => return F_End_Field; -- CTRL-E
when HT => return F_Insert_Char; -- CTRL-I
when SI => return F_Insert_Line; -- CTRL-O
when SYN => return F_Delete_Char; -- CTRL-V
when BS => return F_Delete_Previous; -- CTRL-H
when EM => return F_Delete_Line; -- CTRL-Y
when BEL => return F_Delete_Word; -- CTRL-G
when VT => return F_Clear_EOF; -- CTRL-K
when SO => return F_Next_Choice; -- CTRL-N
when DLE => return F_Previous_Choice; -- CTRL-P
when CR | LF =>
if Handle_CRLF then
return F_New_Line;
else
return K;
end if;
when others => return K;
end case;
else
return K;
end if;
end loop;
end Get_Request;
function Make (Top : Line_Position;
Left : Column_Position;
Text : String) return Field
is
Fld : Field;
C : constant Column_Count := Column_Count (Text'Length);
begin
Fld := New_Field (1, C, Top, Left);
Set_Buffer (Fld, 0, Text);
Switch_Options (Fld, (Active => True, others => False), False);
if Has_Colors then
Set_Background (Fld => Fld, Color => Default_Colors);
end if;
return Fld;
end Make;
function Make (Height : Line_Count := 1;
Width : Column_Count;
Top : Line_Position;
Left : Column_Position;
Off_Screen : Natural := 0) return Field
is
Fld : constant Field := New_Field (Height, Width, Top, Left, Off_Screen);
begin
if Has_Colors then
Set_Foreground (Fld => Fld, Color => Form_Fore_Color);
Set_Background (Fld => Fld, Color => Form_Back_Color);
else
Set_Background (Fld, (Reverse_Video => True, others => False));
end if;
return Fld;
end Make;
function Default_Driver (F : Form;
K : Key_Code;
P : Panel) return Boolean
is
begin
if P = Null_Panel then
raise Panel_Exception;
end if;
if K in User_Key_Code'Range and then K = QUIT then
if Driver (F, F_Validate_Field) = Form_Ok then
return True;
end if;
end if;
return False;
end Default_Driver;
function Count_Active (F : Form) return Natural
is
N : Natural := 0;
O : Field_Option_Set;
H : constant Natural := Field_Count (F);
begin
if H > 0 then
for I in 1 .. H loop
Get_Options (Fields (F, I), O);
if O.Active then
N := N + 1;
end if;
end loop;
end if;
return N;
end Count_Active;
end Sample.Form_Demo.Aux;
AdaCurses-20140726/samples/sample-my_field_type.ads 0000644 0001751 0000144 00000007046 10447516776 020647 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.My_Field_Type --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998,2006 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
with Terminal_Interface.Curses.Forms.Field_Types.User;
use Terminal_Interface.Curses.Forms.Field_Types.User;
-- This is a very simple user defined field type. It accepts only a
-- defined character as input into the field.
--
package Sample.My_Field_Type is
type My_Data is new User_Defined_Field_Type with
record
Ch : Character;
end record;
function Field_Check (Fld : Field;
Typ : My_Data) return Boolean;
function Character_Check (Ch : Character;
Typ : My_Data) return Boolean;
end Sample.My_Field_Type;
AdaCurses-20140726/samples/ncurses2-slk_test.adb 0000644 0001751 0000144 00000017204 11541115574 020070 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.9 $
-- $Date: 2011/03/19 12:03:08 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Ada.Strings.Unbounded;
with Interfaces.C;
with Terminal_Interface.Curses.Aux;
procedure ncurses2.slk_test is
procedure myGet (Win : Window := Standard_Window;
Str : out Ada.Strings.Unbounded.Unbounded_String;
Len : Integer := -1);
procedure myGet (Win : Window := Standard_Window;
Str : out Ada.Strings.Unbounded.Unbounded_String;
Len : Integer := -1)
is
use Ada.Strings.Unbounded;
use Interfaces.C;
use Terminal_Interface.Curses.Aux;
function Wgetnstr (Win : Window;
Str : char_array;
Len : int) return int;
pragma Import (C, Wgetnstr, "wgetnstr");
-- FIXME: how to construct "(Len > 0) ? Len : 80"?
Ask : constant Interfaces.C.size_t := Interfaces.C.size_t'Val (Len + 80);
Txt : char_array (0 .. Ask);
begin
Txt (0) := Interfaces.C.char'First;
if Wgetnstr (Win, Txt, Txt'Length) = Curses_Err then
raise Curses_Exception;
end if;
Str := To_Unbounded_String (To_Ada (Txt, True));
end myGet;
use Int_IO;
use Ada.Strings.Unbounded;
c : Key_Code;
buf : Unbounded_String;
c2 : Character;
fmt : Label_Justification := Centered;
tmp : Integer;
begin
c := CTRL ('l');
loop
Move_Cursor (Line => 0, Column => 0);
c2 := Code_To_Char (c);
case c2 is
when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l')
Erase;
Switch_Character_Attribute (Attr => (Bold_Character => True,
others => False));
Add (Line => 0, Column => 20,
Str => "Soft Key Exerciser");
Switch_Character_Attribute (On => False,
Attr => (Bold_Character => True,
others => False));
Move_Cursor (Line => 2, Column => 0);
P ("Available commands are:");
P ("");
P ("^L -- refresh screen");
P ("a -- activate or restore soft keys");
P ("d -- disable soft keys");
P ("c -- set centered format for labels");
P ("l -- set left-justified format for labels");
P ("r -- set right-justified format for labels");
P ("[12345678] -- set label; labels are numbered 1 through 8");
P ("e -- erase stdscr (should not erase labels)");
P ("s -- test scrolling of shortened screen");
P ("x, q -- return to main menu");
P ("");
P ("Note: if activating the soft keys causes your terminal to");
P ("scroll up one line, your terminal auto-scrolls when anything");
P ("is written to the last screen position. The ncurses code");
P ("does not yet handle this gracefully.");
Refresh;
Restore_Soft_Label_Keys;
when 'a' =>
Restore_Soft_Label_Keys;
when 'e' =>
Clear;
when 's' =>
Add (Line => 20, Column => 0,
Str => "Press Q to stop the scrolling-test: ");
loop
c := Getchar;
c2 := Code_To_Char (c);
exit when c2 = 'Q';
-- c = ERR?
-- TODO when c is not a character (arrow key)
-- the behavior is different from the C version.
Add (Ch => c2);
end loop;
when 'd' =>
Clear_Soft_Label_Keys;
when 'l' =>
fmt := Left;
when 'c' =>
fmt := Centered;
when 'r' =>
fmt := Right;
when '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' =>
Add (Line => 20, Column => 0,
Str => "Please enter the label value: ");
Set_Echo_Mode (SwitchOn => True);
myGet (Str => buf);
Set_Echo_Mode (SwitchOn => False);
tmp := ctoi (c2);
Set_Soft_Label_Key (Label_Number (tmp), To_String (buf), fmt);
Refresh_Soft_Label_Keys;
Move_Cursor (Line => 20, Column => 0);
Clear_To_End_Of_Line;
when 'x' | 'q' =>
exit;
-- the C version needed a goto, ha ha
-- breaks exit the case not the loop because fall-through
-- happens in C!
when others =>
Beep;
end case;
c := Getchar;
-- TODO exit when c = EOF
end loop;
Erase;
End_Windows;
end ncurses2.slk_test;
AdaCurses-20140726/samples/sample-keyboard_handler.ads 0000644 0001751 0000144 00000006650 07746514446 021313 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Keyboard_Handler --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-- This package contains a centralized keyboard handler used throughout
-- this example. The handler establishes a timeout mechanism that provides
-- periodical updates of the common header lines used in this example.
--
package Sample.Keyboard_Handler is
function Get_Key (Win : Window := Standard_Window) return Real_Key_Code;
-- The central routine for handling keystrokes.
procedure Init_Keyboard_Handler;
-- Initialize the keyboard
end Sample.Keyboard_Handler;
AdaCurses-20140726/samples/ncurses2-demo_panels.ads 0000644 0001751 0000144 00000005722 07212274111 020542 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.demo_panels (nap_mseci : Integer);
AdaCurses-20140726/samples/sample-header_handler.adb 0000644 0001751 0000144 00000017410 11542233276 020702 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Header_Handler --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.19 $
-- $Date: 2011/03/22 23:54:38 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Calendar; use Ada.Calendar;
with Terminal_Interface.Curses.Text_IO.Integer_IO;
with Sample.Manifest; use Sample.Manifest;
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO);
-- This package handles the painting of the header line of the screen.
--
package body Sample.Header_Handler is
package Int_IO is new
Terminal_Interface.Curses.Text_IO.Integer_IO (Integer);
use Int_IO;
Header_Window : Window := Null_Window;
Display_Hour : Integer := -1; -- hour last displayed
Display_Min : Integer := -1; -- minute last displayed
Display_Day : Integer := -1; -- day last displayed
Display_Month : Integer := -1; -- month last displayed
-- This is the routine handed over to the curses library to be called
-- as initialization routine when ripping of the header lines from
-- the screen. This routine must follow C conventions.
function Init_Header_Window (Win : Window;
Columns : Column_Count) return Integer;
pragma Convention (C, Init_Header_Window);
procedure Internal_Update_Header_Window (Do_Update : Boolean);
-- The initialization must be called before Init_Screen. It steals two
-- lines from the top of the screen.
procedure Init_Header_Handler
is
begin
Rip_Off_Lines (2, Init_Header_Window'Access);
end Init_Header_Handler;
procedure N_Out (N : Integer);
-- Emit a two digit number and ensure that a leading zero is generated if
-- necessary.
procedure N_Out (N : Integer)
is
begin
if N < 10 then
Add (Header_Window, '0');
Put (Header_Window, N, 1);
else
Put (Header_Window, N, 2);
end if;
end N_Out;
-- Paint the header window. The input parameter is a flag indicating
-- whether or not the screen should be updated physically after painting.
procedure Internal_Update_Header_Window (Do_Update : Boolean)
is
type Month_Name_Array is
array (Month_Number'First .. Month_Number'Last) of String (1 .. 9);
Month_Names : constant Month_Name_Array :=
("January ",
"February ",
"March ",
"April ",
"May ",
"June ",
"July ",
"August ",
"September",
"October ",
"November ",
"December ");
Now : constant Time := Clock;
Sec : constant Integer := Integer (Seconds (Now));
Hour : constant Integer := Sec / 3600;
Minute : constant Integer := (Sec - Hour * 3600) / 60;
Mon : constant Month_Number := Month (Now);
D : constant Day_Number := Day (Now);
begin
if Header_Window /= Null_Window then
if Minute /= Display_Min or else Hour /= Display_Hour
or else Display_Day /= D or else Display_Month /= Mon then
Move_Cursor (Header_Window, 0, 0);
N_Out (D); Add (Header_Window, '.');
Add (Header_Window, Month_Names (Mon));
Move_Cursor (Header_Window, 1, 0);
N_Out (Hour); Add (Header_Window, ':');
N_Out (Minute);
Display_Min := Minute;
Display_Hour := Hour;
Display_Month := Mon;
Display_Day := D;
Refresh_Without_Update (Header_Window);
if Do_Update then
Update_Screen;
end if;
end if;
end if;
end Internal_Update_Header_Window;
-- This routine is called in the keyboard input timeout handler. So it will
-- periodically update the header line of the screen.
procedure Update_Header_Window
is
begin
Internal_Update_Header_Window (True);
end Update_Header_Window;
function Init_Header_Window (Win : Window;
Columns : Column_Count) return Integer
is
Title : constant String := "Ada 95 ncurses Binding Sample";
Pos : Column_Position;
begin
Header_Window := Win;
if Win /= Null_Window then
if Has_Colors then
Set_Background (Win => Win,
Ch => (Ch => ' ',
Color => Header_Color,
Attr => Normal_Video));
Set_Character_Attributes (Win => Win,
Attr => Normal_Video,
Color => Header_Color);
Erase (Win);
end if;
Leave_Cursor_After_Update (Win, True);
Pos := Columns - Column_Position (Title'Length);
Add (Win, 0, Pos / 2, Title);
-- In this phase we must not allow a physical update, because
-- ncurses is not properly initialized at this point.
Internal_Update_Header_Window (False);
return 0;
else
return -1;
end if;
end Init_Header_Window;
end Sample.Header_Handler;
AdaCurses-20140726/samples/ncurses2-getch_test.adb 0000644 0001751 0000144 00000023644 11315445062 020373 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,2009 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.8 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Character input test
-- test the keypad feature
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse;
with Ada.Characters.Handling;
with Ada.Strings.Bounded;
with ncurses2.genericPuts;
procedure ncurses2.getch_test is
use Int_IO;
function mouse_decode (ep : Mouse_Event) return String;
function mouse_decode (ep : Mouse_Event) return String is
Y : Line_Position;
X : Column_Position;
Button : Mouse_Button;
State : Button_State;
package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200);
use BS;
buf : Bounded_String := To_Bounded_String ("");
begin
-- Note that these bindings do not allow
-- two button states,
-- The C version can print {click-1, click-3} for example.
-- They also don't have the 'id' or z coordinate.
Get_Event (ep, Y, X, Button, State);
-- TODO Append (buf, "id "); from C version
Append (buf, "at (");
Append (buf, Column_Position'Image (X));
Append (buf, ", ");
Append (buf, Line_Position'Image (Y));
Append (buf, ") state");
Append (buf, Mouse_Button'Image (Button));
Append (buf, " = ");
Append (buf, Button_State'Image (State));
return To_String (buf);
end mouse_decode;
buf : String (1 .. 1024); -- TODO was BUFSIZE
n : Integer;
c : Key_Code;
blockflag : Timeout_Mode := Blocking;
firsttime : Boolean := True;
tmp2 : Event_Mask;
tmp6 : String (1 .. 6);
tmp20 : String (1 .. 20);
x : Column_Position;
y : Line_Position;
tmpx : Integer;
incount : Integer := 0;
begin
Refresh;
tmp2 := Start_Mouse (All_Events);
Add (Str => "Delay in 10ths of a second ( for blocking input)? ");
Set_Echo_Mode (SwitchOn => True);
Get (Str => buf);
Set_Echo_Mode (SwitchOn => False);
Set_NL_Mode (SwitchOn => False);
if Ada.Characters.Handling.Is_Digit (buf (1)) then
Get (Item => n, From => buf, Last => tmpx);
Set_Timeout_Mode (Mode => Delayed, Amount => n * 100);
blockflag := Delayed;
end if;
c := Character'Pos ('?');
Set_Raw_Mode (SwitchOn => True);
loop
if not firsttime then
Add (Str => "Key pressed: ");
Put (tmp6, Integer (c), 8);
Add (Str => tmp6);
Add (Ch => ' ');
if c = Key_Mouse then
declare
event : Mouse_Event;
begin
event := Get_Mouse;
Add (Str => "KEY_MOUSE, ");
Add (Str => mouse_decode (event));
Add (Ch => newl);
end;
elsif c >= Key_Min then
Key_Name (c, tmp20);
Add (Str => tmp20);
-- I used tmp and got bitten by the length problem:->
Add (Ch => newl);
elsif c > 16#80# then -- TODO fix, use constant if possible
declare
c2 : constant Character := Character'Val (c mod 16#80#);
begin
if Ada.Characters.Handling.Is_Graphic (c2) then
Add (Str => "M-");
Add (Ch => c2);
else
Add (Str => "M-");
Add (Str => Un_Control ((Ch => c2,
Color => Color_Pair'First,
Attr => Normal_Video)));
end if;
Add (Str => " (high-half character)");
Add (Ch => newl);
end;
else
declare
c2 : constant Character := Character'Val (c mod 16#80#);
begin
if Ada.Characters.Handling.Is_Graphic (c2) then
Add (Ch => c2);
Add (Str => " (ASCII printable character)");
Add (Ch => newl);
else
Add (Str => Un_Control ((Ch => c2,
Color => Color_Pair'First,
Attr => Normal_Video)));
Add (Str => " (ASCII control character)");
Add (Ch => newl);
end if;
end;
end if;
-- TODO I am not sure why this was in the C version
-- the delay statement scroll anyway.
Get_Cursor_Position (Line => y, Column => x);
if y >= Lines - 1 then
Move_Cursor (Line => 0, Column => 0);
end if;
Clear_To_End_Of_Line;
end if;
firsttime := False;
if c = Character'Pos ('g') then
declare
package p is new ncurses2.genericPuts (1024);
use p;
use p.BS;
timedout : Boolean := False;
boundedbuf : Bounded_String;
begin
Add (Str => "getstr test: ");
Set_Echo_Mode (SwitchOn => True);
-- Note that if delay mode is set
-- Get can raise an exception.
-- The C version would print the string it had so far
-- also TODO get longer length string, like the C version
declare begin
myGet (Str => boundedbuf);
exception when Curses_Exception =>
Add (Str => "Timed out.");
Add (Ch => newl);
timedout := True;
end;
-- note that the Ada Get will stop reading at 1024.
if not timedout then
Set_Echo_Mode (SwitchOn => False);
Add (Str => " I saw '");
myAdd (Str => boundedbuf);
Add (Str => "'.");
Add (Ch => newl);
end if;
end;
elsif c = Character'Pos ('s') then
ShellOut (True);
elsif c = Character'Pos ('x') or c = Character'Pos ('q') or
(c = Key_None and blockflag = Blocking) then
exit;
elsif c = Character'Pos ('?') then
Add (Str => "Type any key to see its keypad value. Also:");
Add (Ch => newl);
Add (Str => "g -- triggers a getstr test");
Add (Ch => newl);
Add (Str => "s -- shell out");
Add (Ch => newl);
Add (Str => "q -- quit");
Add (Ch => newl);
Add (Str => "? -- repeats this help message");
Add (Ch => newl);
end if;
loop
c := Getchar;
exit when c /= Key_None;
if blockflag /= Blocking then
Put (tmp6, incount); -- argh string length!
Add (Str => tmp6);
Add (Str => ": input timed out");
Add (Ch => newl);
else
Put (tmp6, incount);
Add (Str => tmp6);
Add (Str => ": input error");
Add (Ch => newl);
exit;
end if;
incount := incount + 1;
end loop;
end loop;
End_Mouse (tmp2);
Set_Timeout_Mode (Mode => Blocking, Amount => 0); -- amount is ignored
Set_Raw_Mode (SwitchOn => False);
Set_NL_Mode (SwitchOn => True);
Erase;
End_Windows;
end ncurses2.getch_test;
AdaCurses-20140726/samples/ncurses2-demo_pad.ads 0000644 0001751 0000144 00000005671 07212274077 020042 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.demo_pad;
AdaCurses-20140726/samples/sample-curses_demo-mouse.adb 0000644 0001751 0000144 00000021313 11042670563 021407 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Curses_Demo.Mouse --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2008 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.16 $
-- $Date: 2008/07/26 18:48:19 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse;
with Terminal_Interface.Curses.Text_IO; use Terminal_Interface.Curses.Text_IO;
with Terminal_Interface.Curses.Text_IO.Integer_IO;
with Terminal_Interface.Curses.Text_IO.Enumeration_IO;
with Sample.Helpers; use Sample.Helpers;
with Sample.Manifest; use Sample.Manifest;
with Sample.Keyboard_Handler; use Sample.Keyboard_Handler;
with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Explanation; use Sample.Explanation;
package body Sample.Curses_Demo.Mouse is
package Int_IO is new
Terminal_Interface.Curses.Text_IO.Integer_IO (Integer);
use Int_IO;
package Button_IO is new
Terminal_Interface.Curses.Text_IO.Enumeration_IO (Mouse_Button);
use Button_IO;
package State_IO is new
Terminal_Interface.Curses.Text_IO.Enumeration_IO (Button_State);
use State_IO;
procedure Demo is
type Controls is array (1 .. 3) of Panel;
Frame : Window;
Msg : Window;
Ctl : Controls;
Pan : Panel;
K : Real_Key_Code;
V : Cursor_Visibility := Invisible;
W : Window;
Note : Window;
Msg_L : constant Line_Count := 8;
Lins : Line_Position := Lines;
Cols : Column_Position;
Mask : Event_Mask;
procedure Show_Mouse_Event;
procedure Show_Mouse_Event
is
Evt : constant Mouse_Event := Get_Mouse;
Y : Line_Position;
X : Column_Position;
Button : Mouse_Button;
State : Button_State;
W : Window;
begin
Get_Event (Evt, Y, X, Button, State);
Put (Msg, "Event at");
Put (Msg, " X="); Put (Msg, Integer (X), 3);
Put (Msg, ", Y="); Put (Msg, Integer (Y), 3);
Put (Msg, ", Btn="); Put (Msg, Button, 10);
Put (Msg, ", Stat="); Put (Msg, State, 15);
for I in Ctl'Range loop
W := Get_Window (Ctl (I));
if Enclosed_In_Window (W, Evt) then
Transform_Coordinates (W, Y, X, From_Screen);
Put (Msg, ",Box(");
Put (Msg, (I), 1); Put (Msg, ",");
Put (Msg, Integer (Y), 1); Put (Msg, ",");
Put (Msg, Integer (X), 1); Put (Msg, ")");
end if;
end loop;
New_Line (Msg);
Flush (Msg);
Update_Panels; Update_Screen;
end Show_Mouse_Event;
begin
Push_Environment ("MOUSE00");
Notepad ("MOUSE-PAD00");
Default_Labels;
Set_Cursor_Visibility (V);
Note := Notepad_Window;
if Note /= Null_Window then
Get_Window_Position (Note, Lins, Cols);
end if;
Frame := Create (Msg_L, Columns, Lins - Msg_L, 0);
if Has_Colors then
Set_Background (Win => Frame,
Ch => (Color => Default_Colors,
Attr => Normal_Video,
Ch => ' '));
Set_Character_Attributes (Win => Frame,
Attr => Normal_Video,
Color => Default_Colors);
Erase (Frame);
end if;
Msg := Derived_Window (Frame, Msg_L - 2, Columns - 2, 1, 1);
Pan := Create (Frame);
Set_Meta_Mode;
Set_KeyPad_Mode;
Mask := Start_Mouse;
Box (Frame);
Window_Title (Frame, "Mouse Protocol");
Refresh_Without_Update (Frame);
Allow_Scrolling (Msg, True);
declare
Middle_Column : constant Integer := Integer (Columns) / 2;
Middle_Index : constant Natural := Ctl'First + (Ctl'Length / 2);
Width : constant Column_Count := 5;
Height : constant Line_Count := 3;
Half : constant Column_Count := Width / 2;
Space : constant Column_Count := 3;
Position : Integer;
W : Window;
begin
for I in Ctl'Range loop
Position := ((I) - Integer (Middle_Index)) *
Integer (Half + Space + Width) + Middle_Column;
W := Create (Height,
Width,
1,
Column_Position (Position));
if Has_Colors then
Set_Background (Win => W,
Ch => (Color => Menu_Back_Color,
Attr => Normal_Video,
Ch => ' '));
Set_Character_Attributes (Win => W,
Attr => Normal_Video,
Color => Menu_Fore_Color);
Erase (W);
end if;
Ctl (I) := Create (W);
Box (W);
Move_Cursor (W, 1, Half);
Put (W, (I), 1);
Refresh_Without_Update (W);
end loop;
end;
Update_Panels; Update_Screen;
loop
K := Get_Key;
if K in Special_Key_Code'Range then
case K is
when QUIT_CODE => exit;
when HELP_CODE => Explain_Context;
when EXPLAIN_CODE => Explain ("MOUSEKEYS");
when Key_Mouse => Show_Mouse_Event;
when others => null;
end case;
end if;
end loop;
for I in Ctl'Range loop
W := Get_Window (Ctl (I));
Clear (W);
Delete (Ctl (I));
Delete (W);
end loop;
Clear (Frame);
Delete (Pan);
Delete (Msg);
Delete (Frame);
Set_Cursor_Visibility (V);
End_Mouse (Mask);
Pop_Environment;
Update_Panels; Update_Screen;
end Demo;
end Sample.Curses_Demo.Mouse;
AdaCurses-20140726/samples/status.adb 0000644 0001751 0000144 00000006524 07746514446 016041 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Status --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Laurent Pautet
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
-- $Revision: 1.7 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- This package has been contributed by Laurent Pautet --
-- --
package body Status is
protected body Process is
procedure Stop is
begin
Done := True;
end Stop;
function Continue return Boolean is
begin
return not Done;
end Continue;
end Process;
end Status;
AdaCurses-20140726/samples/ncurses2-trace_set.ads 0000644 0001751 0000144 00000005672 07212274053 020236 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses2.trace_set --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.trace_set;
AdaCurses-20140726/samples/sample-menu_demo.ads 0000644 0001751 0000144 00000005711 07746514446 017763 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Menu_Demo --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Menu_Demo is
procedure Demo;
end Sample.Menu_Demo;
AdaCurses-20140726/samples/sample-form_demo.ads 0000644 0001751 0000144 00000005711 07746514446 017762 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Form_Demo --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Form_Demo is
procedure Demo;
end Sample.Form_Demo;
AdaCurses-20140726/samples/sample-curses_demo-attributes.adb 0000644 0001751 0000144 00000013020 07746514446 022456 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Curses_Demo.Attributes --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Sample.Manifest; use Sample.Manifest;
with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Keyboard_Handler; use Sample.Keyboard_Handler;
with Sample.Explanation; use Sample.Explanation;
package body Sample.Curses_Demo.Attributes is
procedure Demo
is
P : Panel := Create (Standard_Window);
K : Real_Key_Code;
begin
Set_Meta_Mode;
Set_KeyPad_Mode;
Top (P);
Push_Environment ("ATTRIBDEMO");
Default_Labels;
Notepad ("ATTRIB-PAD00");
Set_Character_Attributes (Attr => (others => False));
Add (Line => 1, Column => Columns / 2 - 10,
Str => "This is NORMAL");
Set_Character_Attributes (Attr => (Stand_Out => True,
others => False));
Add (Line => 2, Column => Columns / 2 - 10,
Str => "This is Stand_Out");
Set_Character_Attributes (Attr => (Under_Line => True,
others => False));
Add (Line => 3, Column => Columns / 2 - 10,
Str => "This is Under_Line");
Set_Character_Attributes (Attr => (Reverse_Video => True,
others => False));
Add (Line => 4, Column => Columns / 2 - 10,
Str => "This is Reverse_Video");
Set_Character_Attributes (Attr => (Blink => True,
others => False));
Add (Line => 5, Column => Columns / 2 - 10,
Str => "This is Blink");
Set_Character_Attributes (Attr => (Dim_Character => True,
others => False));
Add (Line => 6, Column => Columns / 2 - 10,
Str => "This is Dim_Character");
Set_Character_Attributes (Attr => (Bold_Character => True,
others => False));
Add (Line => 7, Column => Columns / 2 - 10,
Str => "This is Bold_Character");
Refresh_Without_Update;
Update_Panels; Update_Screen;
loop
K := Get_Key;
if K in Special_Key_Code'Range then
case K is
when QUIT_CODE => exit;
when HELP_CODE => Explain_Context;
when EXPLAIN_CODE => Explain ("ATTRIBKEYS");
when others => null;
end case;
end if;
end loop;
Pop_Environment;
Clear;
Refresh_Without_Update;
Delete (P);
Update_Panels; Update_Screen;
end Demo;
end Sample.Curses_Demo.Attributes;
AdaCurses-20140726/samples/README 0000644 0001751 0000144 00000004735 10422526414 014707 0 ustar tom users -------------------------------------------------------------------------------
-- Copyright (c) 1998,2006 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: README,v 1.2 2006/04/22 22:24:12 tom Exp $
-------------------------------------------------------------------------------
The intention of the demo at this point in time is not to demonstrate all
the features of (n)curses and its subsystems, but to give some sample
sources how to use the binding at all.
Ideally in the future we can combine both goals.
AdaCurses-20140726/samples/ncurses2-attr_test.adb 0000644 0001751 0000144 00000033554 11042670476 020262 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2007,2008 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.9 $
-- $Date: 2008/07/26 18:47:26 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Terminfo;
use Terminal_Interface.Curses.Terminfo;
with Ada.Characters.Handling;
with Ada.Strings.Fixed;
procedure ncurses2.attr_test is
function subset (super, sub : Character_Attribute_Set) return Boolean;
function intersect (b, a : Character_Attribute_Set) return Boolean;
function has_A_COLOR (attr : Attributed_Character) return Boolean;
function show_attr (row : Line_Position;
skip : Natural;
attr : Character_Attribute_Set;
name : String;
once : Boolean) return Line_Position;
procedure attr_getc (skip : in out Integer;
fg, bg : in out Color_Number;
result : out Boolean);
function subset (super, sub : Character_Attribute_Set) return Boolean is
begin
if
(super.Stand_Out or not sub.Stand_Out) and
(super.Under_Line or not sub.Under_Line) and
(super.Reverse_Video or not sub.Reverse_Video) and
(super.Blink or not sub.Blink) and
(super.Dim_Character or not sub.Dim_Character) and
(super.Bold_Character or not sub.Bold_Character) and
(super.Alternate_Character_Set or not sub.Alternate_Character_Set) and
(super.Invisible_Character or not sub.Invisible_Character) -- and
-- (super.Protected_Character or not sub.Protected_Character) and
-- (super.Horizontal or not sub.Horizontal) and
-- (super.Left or not sub.Left) and
-- (super.Low or not sub.Low) and
-- (super.Right or not sub.Right) and
-- (super.Top or not sub.Top) and
-- (super.Vertical or not sub.Vertical)
then
return True;
else
return False;
end if;
end subset;
function intersect (b, a : Character_Attribute_Set) return Boolean is
begin
if
(a.Stand_Out and b.Stand_Out) or
(a.Under_Line and b.Under_Line) or
(a.Reverse_Video and b.Reverse_Video) or
(a.Blink and b.Blink) or
(a.Dim_Character and b.Dim_Character) or
(a.Bold_Character and b.Bold_Character) or
(a.Alternate_Character_Set and b.Alternate_Character_Set) or
(a.Invisible_Character and b.Invisible_Character) -- or
-- (a.Protected_Character and b.Protected_Character) or
-- (a.Horizontal and b.Horizontal) or
-- (a.Left and b.Left) or
-- (a.Low and b.Low) or
-- (a.Right and b.Right) or
-- (a.Top and b.Top) or
-- (a.Vertical and b.Vertical)
then
return True;
else
return False;
end if;
end intersect;
function has_A_COLOR (attr : Attributed_Character) return Boolean is
begin
if attr.Color /= Color_Pair (0) then
return True;
else
return False;
end if;
end has_A_COLOR;
-- Print some text with attributes.
function show_attr (row : Line_Position;
skip : Natural;
attr : Character_Attribute_Set;
name : String;
once : Boolean) return Line_Position is
function make_record (n : Integer) return Character_Attribute_Set;
function make_record (n : Integer) return Character_Attribute_Set is
-- unsupported means true
a : Character_Attribute_Set := (others => False);
m : Integer;
rest : Integer;
begin
-- ncv is a bitmap with these fields
-- A_STANDOUT,
-- A_UNDERLINE,
-- A_REVERSE,
-- A_BLINK,
-- A_DIM,
-- A_BOLD,
-- A_INVIS,
-- A_PROTECT,
-- A_ALTCHARSET
-- It means no_color_video,
-- video attributes that can't be used with colors
-- see man terminfo.5
m := n mod 2;
rest := n / 2;
if 1 = m then
a.Stand_Out := True;
end if;
m := rest mod 2;
rest := rest / 2;
if 1 = m then
a.Under_Line := True;
end if;
m := rest mod 2;
rest := rest / 2;
if 1 = m then
a.Reverse_Video := True;
end if;
m := rest mod 2;
rest := rest / 2;
if 1 = m then
a.Blink := True;
end if;
m := rest mod 2;
rest := rest / 2;
if 1 = m then
a.Bold_Character := True;
end if;
m := rest mod 2;
rest := rest / 2;
if 1 = m then
a.Invisible_Character := True;
end if;
m := rest mod 2;
rest := rest / 2;
if 1 = m then
a.Protected_Character := True;
end if;
m := rest mod 2;
rest := rest / 2;
if 1 = m then
a.Alternate_Character_Set := True;
end if;
return a;
end make_record;
ncv : constant Integer := Get_Number ("ncv");
begin
Move_Cursor (Line => row, Column => 8);
Add (Str => name & " mode:");
Move_Cursor (Line => row, Column => 24);
Add (Ch => '|');
if skip /= 0 then
-- printw("%*s", skip, " ")
Add (Str => Ada.Strings.Fixed."*" (skip, ' '));
end if;
if once then
Switch_Character_Attribute (Attr => attr);
else
Set_Character_Attributes (Attr => attr);
end if;
Add (Str => "abcde fghij klmno pqrst uvwxy z");
if once then
Switch_Character_Attribute (Attr => attr, On => False);
end if;
if skip /= 0 then
Add (Str => Ada.Strings.Fixed."*" (skip, ' '));
end if;
Add (Ch => '|');
if attr /= Normal_Video then
declare begin
if not subset (super => Supported_Attributes, sub => attr) then
Add (Str => " (N/A)");
elsif ncv > 0 and has_A_COLOR (Get_Background) then
declare
Color_Supported_Attributes :
constant Character_Attribute_Set := make_record (ncv);
begin
if intersect (Color_Supported_Attributes, attr) then
Add (Str => " (NCV) ");
end if;
end;
end if;
end;
end if;
return row + 2;
end show_attr;
procedure attr_getc (skip : in out Integer;
fg, bg : in out Color_Number;
result : out Boolean) is
ch : constant Key_Code := Getchar;
nc : constant Color_Number := Color_Number (Number_Of_Colors);
begin
result := True;
if Ada.Characters.Handling.Is_Digit (Character'Val (ch)) then
skip := ctoi (Code_To_Char (ch));
elsif ch = CTRL ('L') then
Touch;
Touch (Current_Window);
Refresh;
elsif Has_Colors then
case ch is
-- Note the mathematical elegance compared to the C version.
when Character'Pos ('f') => fg := (fg + 1) mod nc;
when Character'Pos ('F') => fg := (fg - 1) mod nc;
when Character'Pos ('b') => bg := (bg + 1) mod nc;
when Character'Pos ('B') => bg := (bg - 1) mod nc;
when others =>
result := False;
end case;
else
result := False;
end if;
end attr_getc;
-- pairs could be defined as array ( Color_Number(0) .. colors - 1) of
-- array (Color_Number(0).. colors - 1) of Boolean;
pairs : array (Color_Pair'Range) of Boolean := (others => False);
fg, bg : Color_Number := Black; -- = 0;
xmc : constant Integer := Get_Number ("xmc");
skip : Integer := xmc;
n : Integer;
use Int_IO;
begin
pairs (0) := True;
if skip < 0 then
skip := 0;
end if;
n := skip;
loop
declare
row : Line_Position := 2;
normal : Attributed_Character := Blank2;
-- ???
begin
-- row := 2; -- weird, row is set to 0 without this.
-- TODO delete the above line, it was a gdb quirk that confused me
if Has_Colors then
declare pair : constant Color_Pair :=
Color_Pair (fg * Color_Number (Number_Of_Colors) + bg);
begin
-- Go though each color pair. Assume that the number of
-- Redefinable_Color_Pairs is 8*8 with predefined Colors 0..7
if not pairs (pair) then
Init_Pair (pair, fg, bg);
pairs (pair) := True;
end if;
normal.Color := pair;
end;
end if;
Set_Background (Ch => normal);
Erase;
Add (Line => 0, Column => 20,
Str => "Character attribute test display");
row := show_attr (row, n, (Stand_Out => True, others => False),
"STANDOUT", True);
row := show_attr (row, n, (Reverse_Video => True, others => False),
"REVERSE", True);
row := show_attr (row, n, (Bold_Character => True, others => False),
"BOLD", True);
row := show_attr (row, n, (Under_Line => True, others => False),
"UNDERLINE", True);
row := show_attr (row, n, (Dim_Character => True, others => False),
"DIM", True);
row := show_attr (row, n, (Blink => True, others => False),
"BLINK", True);
-- row := show_attr (row, n, (Protected_Character => True,
-- others => False), "PROTECT", True);
row := show_attr (row, n, (Invisible_Character => True,
others => False), "INVISIBLE", True);
row := show_attr (row, n, Normal_Video, "NORMAL", False);
Move_Cursor (Line => row, Column => 8);
if xmc > -1 then
Add (Str => "This terminal does have the magic-cookie glitch");
else
Add (Str => "This terminal does not have the magic-cookie glitch");
end if;
Move_Cursor (Line => row + 1, Column => 8);
Add (Str => "Enter a digit to set gaps on each side of " &
"displayed attributes");
Move_Cursor (Line => row + 2, Column => 8);
Add (Str => "^L = repaint");
if Has_Colors then
declare tmp1 : String (1 .. 1);
begin
Add (Str => ". f/F/b/F toggle colors (");
Put (tmp1, Integer (fg));
Add (Str => tmp1);
Add (Ch => '/');
Put (tmp1, Integer (bg));
Add (Str => tmp1);
Add (Ch => ')');
end;
end if;
Refresh;
end;
declare result : Boolean; begin
attr_getc (n, fg, bg, result);
exit when not result;
end;
end loop;
Set_Background (Ch => Blank2);
Erase;
End_Windows;
end ncurses2.attr_test;
AdaCurses-20140726/samples/ncurses2-getopt.adb 0000644 0001751 0000144 00000015543 11541116417 017543 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,2011 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.8 $
-- $Date: 2011/03/19 12:09:51 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- A simplified version of the GNU getopt function
-- copyright Free Software Foundtion
with Ada.Strings.Fixed;
with Ada.Strings.Bounded;
with Ada.Text_IO; use Ada.Text_IO;
package body ncurses2.getopt is
nextchar : Natural := 0;
-- Ncurses doesn't use the non option elements so we are spared
-- the job of computing those.
-- also the user is not allowed to modify argv or argc
-- Doing so is Erroneous execution.
-- long options are not handled.
procedure Qgetopt (retval : out Integer;
argc : Integer;
argv : stringfunc;
-- argv will be the Argument function.
optstring : String;
optind : in out Integer;
-- ignored for ncurses, must be initialized to 1 by
-- the caller
Optarg : out stringa
-- a garbage collector would be useful here.
) is
package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (200);
use BS;
optargx : Bounded_String;
begin
if argc < optind then
retval := -1;
return;
end if;
optargx := To_Bounded_String ("");
if nextchar = 0 then
if argv (optind) = "--" then
-- the rest are non-options, we ignore them
retval := -1;
return;
end if;
if argv (optind)(1) /= '-' or argv (optind)'Length = 1 then
optind := optind + 1;
Optarg := new String'(argv (optind));
retval := 1;
return;
end if;
nextchar := 2; -- skip the one hyphen.
end if;
-- Look at and handle the next short option-character.
declare
c : Character := argv (optind) (nextchar);
temp : constant Natural :=
Ada.Strings.Fixed.Index (optstring, String'(1 => c));
begin
if temp = 0 or c = ':' then
Put_Line (Standard_Error,
argv (optind) & ": invalid option -- " & c);
c := '?';
return;
end if;
if optstring (temp + 1) = ':' then
if optstring (temp + 2) = ':' then
-- This is an option that accepts an argument optionally.
if nextchar /= argv (optind)'Length then
optargx := To_Bounded_String
(argv (optind) (nextchar .. argv (optind)'Length));
else
Optarg := null;
end if;
else
-- This is an option that requires an argument.
if nextchar /= argv (optind)'Length then
optargx := To_Bounded_String
(argv (optind) (nextchar .. argv (optind)'Length));
optind := optind + 1;
elsif optind = argc then
Put_Line (Standard_Error,
argv (optind) &
": option requires an argument -- " & c);
if optstring (optstring'First) = ':' then
c := ':';
else
c := '?';
end if;
else
-- increment it again when taking next ARGV-elt as argument.
optind := optind + 1;
optargx := To_Bounded_String (argv (optind));
optind := optind + 1;
end if;
end if;
nextchar := 0;
else -- no argument for the option
if nextchar = argv (optind)'Length then
optind := optind + 1;
nextchar := 0;
else
nextchar := nextchar + 1;
end if;
end if;
retval := Character'Pos (c);
Optarg := new String'(To_String (optargx));
return;
end;
end Qgetopt;
end ncurses2.getopt;
AdaCurses-20140726/samples/ncurses2-menu_test.adb 0000644 0001751 0000144 00000015047 11542240500 020233 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2011 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.8 $
-- $Date: 2011/03/23 00:39:28 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse;
procedure ncurses2.menu_test is
function menu_virtualize (c : Key_Code) return Key_Code;
procedure xAdd (l : Line_Position; c : Column_Position; s : String);
function menu_virtualize (c : Key_Code) return Key_Code is
begin
case c is
when Character'Pos (newl) | Key_Exit =>
return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO
when Character'Pos ('u') =>
return M_ScrollUp_Line;
when Character'Pos ('d') =>
return M_ScrollDown_Line;
when Character'Pos ('b') | Key_Next_Page =>
return M_ScrollUp_Page;
when Character'Pos ('f') | Key_Previous_Page =>
return M_ScrollDown_Page;
when Character'Pos ('n') | Key_Cursor_Down =>
return M_Next_Item;
when Character'Pos ('p') | Key_Cursor_Up =>
return M_Previous_Item;
when Character'Pos (' ') =>
return M_Toggle_Item;
when Key_Mouse =>
return c;
when others =>
Beep;
return c;
end case;
end menu_virtualize;
MENU_Y : constant Line_Count := 8;
MENU_X : constant Column_Count := 8;
type String_Access is access String;
animals : constant array (Positive range <>) of String_Access :=
(new String'("Lions"),
new String'("Tigers"),
new String'("Bears"),
new String'("(Oh my!)"),
new String'("Newts"),
new String'("Platypi"),
new String'("Lemurs"));
items_a : constant Item_Array_Access :=
new Item_Array (1 .. animals'Last + 1);
tmp : Event_Mask;
procedure xAdd (l : Line_Position; c : Column_Position; s : String) is
begin
Add (Line => l, Column => c, Str => s);
end xAdd;
mrows : Line_Count;
mcols : Column_Count;
menuwin : Window;
m : Menu;
c1 : Key_Code;
c : Driver_Result;
r : Key_Code;
begin
tmp := Start_Mouse;
xAdd (0, 0, "This is the menu test:");
xAdd (2, 0, " Use up and down arrow to move the select bar.");
xAdd (3, 0, " 'n' and 'p' act like arrows.");
xAdd (4, 0, " 'b' and 'f' scroll up/down (page), 'u' and 'd' (line).");
xAdd (5, 0, " Press return to exit.");
Refresh;
for i in animals'Range loop
items_a.all (i) := New_Item (animals (i).all);
end loop;
items_a.all (animals'Last + 1) := Null_Item;
m := New_Menu (items_a);
Set_Format (m, Line_Position (animals'Last + 1) / 2, 1);
Scale (m, mrows, mcols);
menuwin := Create (mrows + 2, mcols + 2, MENU_Y, MENU_X);
Set_Window (m, menuwin);
Set_KeyPad_Mode (menuwin, True);
Box (menuwin); -- 0,0?
Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1));
Post (m);
loop
c1 := Getchar (menuwin);
r := menu_virtualize (c1);
c := Driver (m, r);
exit when c = Unknown_Request; -- E_UNKNOWN_COMMAND?
if c = Request_Denied then
Beep;
end if;
-- continue ?
end loop;
Move_Cursor (Line => Lines - 2, Column => 0);
Add (Str => "You chose: ");
Add (Str => Name (Current (m)));
Add (Ch => newl);
Pause; -- the C version didn't use Pause, it spelled it out
Post (m, False); -- unpost, not clear :-(
declare begin
Delete (menuwin);
exception when Curses_Exception => null; end;
-- menuwin has children so will raise the exception.
Delete (m);
End_Mouse (tmp);
end ncurses2.menu_test;
AdaCurses-20140726/samples/ncurses2-acs_display.adb 0000644 0001751 0000144 00000024706 11042670506 020535 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2008 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.6 $
-- $Date: 2008/07/26 18:47:34 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with ncurses2.genericPuts;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Ada.Strings.Unbounded;
with Ada.Strings.Fixed;
procedure ncurses2.acs_display is
use Int_IO;
procedure show_upper_chars (first : Integer);
function show_1_acs (N : Integer;
name : String;
code : Attributed_Character)
return Integer;
procedure show_acs_chars;
procedure show_upper_chars (first : Integer) is
C1 : constant Boolean := (first = 128);
last : constant Integer := first + 31;
package p is new ncurses2.genericPuts (200);
use p;
use p.BS;
use Ada.Strings.Unbounded;
tmpa : Unbounded_String;
tmpb : BS.Bounded_String;
begin
Erase;
Switch_Character_Attribute
(Attr => (Bold_Character => True, others => False));
Move_Cursor (Line => 0, Column => 20);
tmpa := To_Unbounded_String ("Display of ");
if C1 then
tmpa := tmpa & "C1";
else
tmpa := tmpa & "GR";
end if;
tmpa := tmpa & " Character Codes ";
myPut (tmpb, first);
Append (tmpa, To_String (tmpb));
Append (tmpa, " to ");
myPut (tmpb, last);
Append (tmpa, To_String (tmpb));
Add (Str => To_String (tmpa));
Switch_Character_Attribute
(On => False,
Attr => (Bold_Character => True, others => False));
Refresh;
for code in first .. last loop
declare
row : constant Line_Position
:= Line_Position (4 + ((code - first) mod 16));
col : constant Column_Position
:= Column_Position (((code - first) / 16) *
Integer (Columns) / 2);
tmp3 : String (1 .. 3);
tmpx : String (1 .. Integer (Columns / 4));
reply : Key_Code;
begin
Put (tmp3, code);
myPut (tmpb, code, 16);
tmpa := To_Unbounded_String (tmp3 & " (" & To_String (tmpb) & ')');
Ada.Strings.Fixed.Move (To_String (tmpa), tmpx,
Justify => Ada.Strings.Right);
Add (Line => row, Column => col,
Str => tmpx & ' ' & ':' & ' ');
if C1 then
Set_NoDelay_Mode (Mode => True);
end if;
Add_With_Immediate_Echo (Ch => Code_To_Char (Key_Code (code)));
-- TODO check this
if C1 then
reply := Getchar;
while reply /= Key_None loop
Add (Ch => Code_To_Char (reply));
Nap_Milli_Seconds (10);
reply := Getchar;
end loop;
Set_NoDelay_Mode (Mode => False);
end if;
end;
end loop;
end show_upper_chars;
function show_1_acs (N : Integer;
name : String;
code : Attributed_Character)
return Integer is
height : constant Integer := 16;
row : constant Line_Position := Line_Position (4 + (N mod height));
col : constant Column_Position := Column_Position ((N / height) *
Integer (Columns) / 2);
tmpx : String (1 .. Integer (Columns) / 3);
begin
Ada.Strings.Fixed.Move (name, tmpx,
Justify => Ada.Strings.Right,
Drop => Ada.Strings.Left);
Add (Line => row, Column => col, Str => tmpx & ' ' & ':' & ' ');
-- we need more room than C because our identifiers are longer
-- 22 chars actually
Add (Ch => code);
return N + 1;
end show_1_acs;
procedure show_acs_chars is
n : Integer;
begin
Erase;
Switch_Character_Attribute
(Attr => (Bold_Character => True, others => False));
Add (Line => 0, Column => 20,
Str => "Display of the ACS Character Set");
Switch_Character_Attribute (On => False,
Attr => (Bold_Character => True,
others => False));
Refresh;
-- the following is useful to generate the below
-- grep '^[ ]*ACS_' ../src/terminal_interface-curses.ads |
-- awk '{print "n := show_1_acs(n, \""$1"\", ACS_Map("$1"));"}'
n := show_1_acs (0, "ACS_Upper_Left_Corner",
ACS_Map (ACS_Upper_Left_Corner));
n := show_1_acs (n, "ACS_Lower_Left_Corner",
ACS_Map (ACS_Lower_Left_Corner));
n := show_1_acs (n, "ACS_Upper_Right_Corner",
ACS_Map (ACS_Upper_Right_Corner));
n := show_1_acs (n, "ACS_Lower_Right_Corner",
ACS_Map (ACS_Lower_Right_Corner));
n := show_1_acs (n, "ACS_Left_Tee", ACS_Map (ACS_Left_Tee));
n := show_1_acs (n, "ACS_Right_Tee", ACS_Map (ACS_Right_Tee));
n := show_1_acs (n, "ACS_Bottom_Tee", ACS_Map (ACS_Bottom_Tee));
n := show_1_acs (n, "ACS_Top_Tee", ACS_Map (ACS_Top_Tee));
n := show_1_acs (n, "ACS_Horizontal_Line",
ACS_Map (ACS_Horizontal_Line));
n := show_1_acs (n, "ACS_Vertical_Line", ACS_Map (ACS_Vertical_Line));
n := show_1_acs (n, "ACS_Plus_Symbol", ACS_Map (ACS_Plus_Symbol));
n := show_1_acs (n, "ACS_Scan_Line_1", ACS_Map (ACS_Scan_Line_1));
n := show_1_acs (n, "ACS_Scan_Line_9", ACS_Map (ACS_Scan_Line_9));
n := show_1_acs (n, "ACS_Diamond", ACS_Map (ACS_Diamond));
n := show_1_acs (n, "ACS_Checker_Board", ACS_Map (ACS_Checker_Board));
n := show_1_acs (n, "ACS_Degree", ACS_Map (ACS_Degree));
n := show_1_acs (n, "ACS_Plus_Minus", ACS_Map (ACS_Plus_Minus));
n := show_1_acs (n, "ACS_Bullet", ACS_Map (ACS_Bullet));
n := show_1_acs (n, "ACS_Left_Arrow", ACS_Map (ACS_Left_Arrow));
n := show_1_acs (n, "ACS_Right_Arrow", ACS_Map (ACS_Right_Arrow));
n := show_1_acs (n, "ACS_Down_Arrow", ACS_Map (ACS_Down_Arrow));
n := show_1_acs (n, "ACS_Up_Arrow", ACS_Map (ACS_Up_Arrow));
n := show_1_acs (n, "ACS_Board_Of_Squares",
ACS_Map (ACS_Board_Of_Squares));
n := show_1_acs (n, "ACS_Lantern", ACS_Map (ACS_Lantern));
n := show_1_acs (n, "ACS_Solid_Block", ACS_Map (ACS_Solid_Block));
n := show_1_acs (n, "ACS_Scan_Line_3", ACS_Map (ACS_Scan_Line_3));
n := show_1_acs (n, "ACS_Scan_Line_7", ACS_Map (ACS_Scan_Line_7));
n := show_1_acs (n, "ACS_Less_Or_Equal", ACS_Map (ACS_Less_Or_Equal));
n := show_1_acs (n, "ACS_Greater_Or_Equal",
ACS_Map (ACS_Greater_Or_Equal));
n := show_1_acs (n, "ACS_PI", ACS_Map (ACS_PI));
n := show_1_acs (n, "ACS_Not_Equal", ACS_Map (ACS_Not_Equal));
n := show_1_acs (n, "ACS_Sterling", ACS_Map (ACS_Sterling));
if n = 0 then
raise Constraint_Error;
end if;
end show_acs_chars;
c1 : Key_Code;
c : Character := 'a';
begin
loop
case c is
when 'a' =>
show_acs_chars;
when '0' | '1' | '2' | '3' =>
show_upper_chars (ctoi (c) * 32 + 128);
when others =>
null;
end case;
Add (Line => Lines - 3, Column => 0,
Str => "Note: ANSI terminals may not display C1 characters.");
Add (Line => Lines - 2, Column => 0,
Str => "Select: a=ACS, 0=C1, 1,2,3=GR characters, q=quit");
Refresh;
c1 := Getchar;
c := Code_To_Char (c1);
exit when c = 'q' or c = 'x';
end loop;
Pause;
Erase;
End_Windows;
end ncurses2.acs_display;
AdaCurses-20140726/samples/ncurses2-color_test.ads 0000644 0001751 0000144 00000005673 07212274075 020447 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.color_test;
AdaCurses-20140726/samples/sample-helpers.ads 0000644 0001751 0000144 00000006404 11541117407 017435 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Helpers --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-- This package contains some convenient helper routines used throughout
-- this example.
--
package Sample.Helpers is
procedure Window_Title (Win : Window;
Title : String);
-- Put a title string into the first line of the window
procedure Not_Implemented;
end Sample.Helpers;
AdaCurses-20140726/samples/sample-curses_demo-attributes.ads 0000644 0001751 0000144 00000005743 07746514446 022514 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Curses_Demo.Attributes --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Curses_Demo.Attributes is
procedure Demo;
end Sample.Curses_Demo.Attributes;
AdaCurses-20140726/samples/ncurses2-demo_panels.adb 0000644 0001751 0000144 00000030707 11542241134 020522 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,2011 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.7 $
-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Panels.User_Data;
with ncurses2.genericPuts;
procedure ncurses2.demo_panels (nap_mseci : Integer) is
use Int_IO;
function mkpanel (color : Color_Number;
rows : Line_Count;
cols : Column_Count;
tly : Line_Position;
tlx : Column_Position) return Panel;
procedure rmpanel (pan : in out Panel);
procedure pflush;
procedure wait_a_while (msec : Integer);
procedure saywhat (text : String);
procedure fill_panel (pan : Panel);
nap_msec : Integer := nap_mseci;
function mkpanel (color : Color_Number;
rows : Line_Count;
cols : Column_Count;
tly : Line_Position;
tlx : Column_Position) return Panel is
win : Window;
pan : Panel := Null_Panel;
begin
win := New_Window (rows, cols, tly, tlx);
if Null_Window /= win then
pan := New_Panel (win);
if pan = Null_Panel then
Delete (win);
elsif Has_Colors then
declare
fg, bg : Color_Number;
begin
if color = Blue then
fg := White;
else
fg := Black;
end if;
bg := color;
Init_Pair (Color_Pair (color), fg, bg);
Set_Background (win, (Ch => ' ',
Attr => Normal_Video,
Color => Color_Pair (color)));
end;
else
Set_Background (win, (Ch => ' ',
Attr => (Bold_Character => True,
others => False),
Color => Color_Pair (color)));
end if;
end if;
return pan;
end mkpanel;
procedure rmpanel (pan : in out Panel) is
win : Window := Panel_Window (pan);
begin
Delete (pan);
Delete (win);
end rmpanel;
procedure pflush is
begin
Update_Panels;
Update_Screen;
end pflush;
procedure wait_a_while (msec : Integer) is
begin
-- The C version had some #ifdef blocks here
if msec = 1 then
Getchar;
else
Nap_Milli_Seconds (msec);
end if;
end wait_a_while;
procedure saywhat (text : String) is
begin
Move_Cursor (Line => Lines - 1, Column => 0);
Clear_To_End_Of_Line;
Add (Str => text);
end saywhat;
-- from sample-curses_demo.adb
type User_Data is new String (1 .. 2);
type User_Data_Access is access all User_Data;
package PUD is new Panels.User_Data (User_Data, User_Data_Access);
use PUD;
procedure fill_panel (pan : Panel) is
win : constant Window := Panel_Window (pan);
num : constant Character := Get_User_Data (pan).all (2);
tmp6 : String (1 .. 6) := "-panx-";
maxy : Line_Count;
maxx : Column_Count;
begin
Move_Cursor (win, 1, 1);
tmp6 (5) := num;
Add (win, Str => tmp6);
Clear_To_End_Of_Line (win);
Box (win);
Get_Size (win, maxy, maxx);
for y in 2 .. maxy - 3 loop
for x in 1 .. maxx - 3 loop
Move_Cursor (win, y, x);
Add (win, num);
end loop;
end loop;
exception
when Curses_Exception => null;
end fill_panel;
modstr : constant array (0 .. 5) of String (1 .. 5) :=
("test ",
"TEST ",
"(**) ",
"*()* ",
"<--> ",
"LAST "
);
package p is new ncurses2.genericPuts (1024);
use p;
use p.BS;
-- the C version said register int y, x;
tmpb : BS.Bounded_String;
begin
Refresh;
for y in 0 .. Integer (Lines - 2) loop
for x in 0 .. Integer (Columns - 1) loop
myPut (tmpb, (y + x) mod 10);
myAdd (Str => tmpb);
end loop;
end loop;
for y in 0 .. 4 loop
declare
p1, p2, p3, p4, p5 : Panel;
U1 : constant User_Data_Access := new User_Data'("p1");
U2 : constant User_Data_Access := new User_Data'("p2");
U3 : constant User_Data_Access := new User_Data'("p3");
U4 : constant User_Data_Access := new User_Data'("p4");
U5 : constant User_Data_Access := new User_Data'("p5");
begin
p1 := mkpanel (Red, Lines / 2 - 2, Columns / 8 + 1, 0, 0);
Set_User_Data (p1, U1);
p2 := mkpanel (Green, Lines / 2 + 1, Columns / 7, Lines / 4,
Columns / 10);
Set_User_Data (p2, U2);
p3 := mkpanel (Yellow, Lines / 4, Columns / 10, Lines / 2,
Columns / 9);
Set_User_Data (p3, U3);
p4 := mkpanel (Blue, Lines / 2 - 2, Columns / 8, Lines / 2 - 2,
Columns / 3);
Set_User_Data (p4, U4);
p5 := mkpanel (Magenta, Lines / 2 - 2, Columns / 8, Lines / 2,
Columns / 2 - 2);
Set_User_Data (p5, U5);
fill_panel (p1);
fill_panel (p2);
fill_panel (p3);
fill_panel (p4);
fill_panel (p5);
Hide (p4);
Hide (p5);
pflush;
saywhat ("press any key to continue");
wait_a_while (nap_msec);
saywhat ("h3 s1 s2 s4 s5; press any key to continue");
Move (p1, 0, 0);
Hide (p3);
Show (p1);
Show (p2);
Show (p4);
Show (p5);
pflush;
wait_a_while (nap_msec);
saywhat ("s1; press any key to continue");
Show (p1);
pflush;
wait_a_while (nap_msec);
saywhat ("s2; press any key to continue");
Show (p2);
pflush;
wait_a_while (nap_msec);
saywhat ("m2; press any key to continue");
Move (p2, Lines / 3 + 1, Columns / 8);
pflush;
wait_a_while (nap_msec);
saywhat ("s3;");
Show (p3);
pflush;
wait_a_while (nap_msec);
saywhat ("m3; press any key to continue");
Move (p3, Lines / 4 + 1, Columns / 15);
pflush;
wait_a_while (nap_msec);
saywhat ("b3; press any key to continue");
Bottom (p3);
pflush;
wait_a_while (nap_msec);
saywhat ("s4; press any key to continue");
Show (p4);
pflush;
wait_a_while (nap_msec);
saywhat ("s5; press any key to continue");
Show (p5);
pflush;
wait_a_while (nap_msec);
saywhat ("t3; press any key to continue");
Top (p3);
pflush;
wait_a_while (nap_msec);
saywhat ("t1; press any key to continue");
Top (p1);
pflush;
wait_a_while (nap_msec);
saywhat ("t2; press any key to continue");
Top (p2);
pflush;
wait_a_while (nap_msec);
saywhat ("t3; press any key to continue");
Top (p3);
pflush;
wait_a_while (nap_msec);
saywhat ("t4; press any key to continue");
Top (p4);
pflush;
wait_a_while (nap_msec);
for itmp in 0 .. 5 loop
declare
w4 : constant Window := Panel_Window (p4);
w5 : constant Window := Panel_Window (p5);
begin
saywhat ("m4; press any key to continue");
Move_Cursor (w4, Lines / 8, 1);
Add (w4, modstr (itmp));
Move (p4, Lines / 6, Column_Position (itmp) * (Columns / 8));
Move_Cursor (w5, Lines / 6, 1);
Add (w5, modstr (itmp));
pflush;
wait_a_while (nap_msec);
saywhat ("m5; press any key to continue");
Move_Cursor (w4, Lines / 6, 1);
Add (w4, modstr (itmp));
Move (p5, Lines / 3 - 1, (Column_Position (itmp) * 10) + 6);
Move_Cursor (w5, Lines / 8, 1);
Add (w5, modstr (itmp));
pflush;
wait_a_while (nap_msec);
end;
end loop;
saywhat ("m4; press any key to continue");
Move (p4, Lines / 6, 6 * (Columns / 8));
-- Move(p4, Lines / 6, itmp * (Columns / 8));
pflush;
wait_a_while (nap_msec);
saywhat ("t5; press any key to continue");
Top (p5);
pflush;
wait_a_while (nap_msec);
saywhat ("t2; press any key to continue");
Top (p2);
pflush;
wait_a_while (nap_msec);
saywhat ("t1; press any key to continue");
Top (p1);
pflush;
wait_a_while (nap_msec);
saywhat ("d2; press any key to continue");
rmpanel (p2);
pflush;
wait_a_while (nap_msec);
saywhat ("h3; press any key to continue");
Hide (p3);
pflush;
wait_a_while (nap_msec);
saywhat ("d1; press any key to continue");
rmpanel (p1);
pflush;
wait_a_while (nap_msec);
saywhat ("d4; press any key to continue");
rmpanel (p4);
pflush;
wait_a_while (nap_msec);
saywhat ("d5; press any key to continue");
rmpanel (p5);
pflush;
wait_a_while (nap_msec);
if nap_msec = 1 then
exit;
else
nap_msec := 100;
end if;
end;
end loop;
Erase;
End_Windows;
end ncurses2.demo_panels;
AdaCurses-20140726/samples/ncurses2-acs_and_scroll.adb 0000644 0001751 0000144 00000063545 11542237674 021226 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.11 $
-- $Date: 2011/03/23 00:33:00 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Windows and scrolling tester.
-- Demonstrate windows
with Ada.Strings.Fixed;
with Ada.Strings;
with ncurses2.util; use ncurses2.util;
with ncurses2.genericPuts;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse;
with Terminal_Interface.Curses.PutWin; use Terminal_Interface.Curses.PutWin;
with Ada.Streams.Stream_IO; use Ada.Streams.Stream_IO;
with Ada.Streams; use Ada.Streams;
procedure ncurses2.acs_and_scroll is
Macro_Quit : constant Key_Code := Character'Pos ('Q') mod 16#20#;
Macro_Escape : constant Key_Code := Character'Pos ('[') mod 16#20#;
Quit : constant Key_Code := CTRL ('Q');
Escape : constant Key_Code := CTRL ('[');
Botlines : constant Line_Position := 4;
type pair is record
y : Line_Position;
x : Column_Position;
end record;
type Frame;
type FrameA is access Frame;
f : File_Type;
dumpfile : constant String := "screendump";
procedure Outerbox (ul, lr : pair; onoff : Boolean);
function HaveKeyPad (w : Window) return Boolean;
function HaveScroll (w : Window) return Boolean;
procedure newwin_legend (curpw : Window);
procedure transient (curpw : Window; msg : String);
procedure newwin_report (win : Window := Standard_Window);
procedure selectcell (uli : Line_Position;
ulj : Column_Position;
lri : Line_Position;
lrj : Column_Position;
p : out pair;
b : out Boolean);
function getwindow return Window;
procedure newwin_move (win : Window;
dy : Line_Position;
dx : Column_Position);
function delete_framed (fp : FrameA; showit : Boolean) return FrameA;
-- A linked list
-- I wish there was a standard library linked list. Oh well.
type Frame is record
next, last : FrameA;
do_scroll : Boolean;
do_keypad : Boolean;
wind : Window;
end record;
current : FrameA;
c : Key_Code;
procedure Outerbox (ul, lr : pair; onoff : Boolean) is
begin
if onoff then
-- Note the fix of an obscure bug
-- try making a 1x1 box then enlarging it, the is a blank
-- upper left corner!
Add (Line => ul.y - 1, Column => ul.x - 1,
Ch => ACS_Map (ACS_Upper_Left_Corner));
Add (Line => ul.y - 1, Column => lr.x + 1,
Ch => ACS_Map (ACS_Upper_Right_Corner));
Add (Line => lr.y + 1, Column => lr.x + 1,
Ch => ACS_Map (ACS_Lower_Right_Corner));
Add (Line => lr.y + 1, Column => ul.x - 1,
Ch => ACS_Map (ACS_Lower_Left_Corner));
Move_Cursor (Line => ul.y - 1, Column => ul.x);
Horizontal_Line (Line_Symbol => ACS_Map (ACS_Horizontal_Line),
Line_Size => Integer (lr.x - ul.x) + 1);
Move_Cursor (Line => ul.y, Column => ul.x - 1);
Vertical_Line (Line_Symbol => ACS_Map (ACS_Vertical_Line),
Line_Size => Integer (lr.y - ul.y) + 1);
Move_Cursor (Line => lr.y + 1, Column => ul.x);
Horizontal_Line (Line_Symbol => ACS_Map (ACS_Horizontal_Line),
Line_Size => Integer (lr.x - ul.x) + 1);
Move_Cursor (Line => ul.y, Column => lr.x + 1);
Vertical_Line (Line_Symbol => ACS_Map (ACS_Vertical_Line),
Line_Size => Integer (lr.y - ul.y) + 1);
else
Add (Line => ul.y - 1, Column => ul.x - 1, Ch => ' ');
Add (Line => ul.y - 1, Column => lr.x + 1, Ch => ' ');
Add (Line => lr.y + 1, Column => lr.x + 1, Ch => ' ');
Add (Line => lr.y + 1, Column => ul.x - 1, Ch => ' ');
Move_Cursor (Line => ul.y - 1, Column => ul.x);
Horizontal_Line (Line_Symbol => Blank2,
Line_Size => Integer (lr.x - ul.x) + 1);
Move_Cursor (Line => ul.y, Column => ul.x - 1);
Vertical_Line (Line_Symbol => Blank2,
Line_Size => Integer (lr.y - ul.y) + 1);
Move_Cursor (Line => lr.y + 1, Column => ul.x);
Horizontal_Line (Line_Symbol => Blank2,
Line_Size => Integer (lr.x - ul.x) + 1);
Move_Cursor (Line => ul.y, Column => lr.x + 1);
Vertical_Line (Line_Symbol => Blank2,
Line_Size => Integer (lr.y - ul.y) + 1);
end if;
end Outerbox;
function HaveKeyPad (w : Window) return Boolean is
begin
return Get_KeyPad_Mode (w);
exception
when Curses_Exception => return False;
end HaveKeyPad;
function HaveScroll (w : Window) return Boolean is
begin
return Scrolling_Allowed (w);
exception
when Curses_Exception => return False;
end HaveScroll;
procedure newwin_legend (curpw : Window) is
package p is new genericPuts (200);
use p;
use p.BS;
type string_a is access String;
type rrr is record
msg : string_a;
code : Integer range 0 .. 3;
end record;
legend : constant array (Positive range <>) of rrr :=
(
(
new String'("^C = create window"), 0
),
(
new String'("^N = next window"), 0
),
(
new String'("^P = previous window"), 0
),
(
new String'("^F = scroll forward"), 0
),
(
new String'("^B = scroll backward"), 0
),
(
new String'("^K = keypad(%s)"), 1
),
(
new String'("^S = scrollok(%s)"), 2
),
(
new String'("^W = save window to file"), 0
),
(
new String'("^R = restore window"), 0
),
(
new String'("^X = resize"), 0
),
(
new String'("^Q%s = exit"), 3
)
);
buf : Bounded_String;
do_keypad : constant Boolean := HaveKeyPad (curpw);
do_scroll : constant Boolean := HaveScroll (curpw);
pos : Natural;
mypair : pair;
use Ada.Strings.Fixed;
begin
Move_Cursor (Line => Lines - 4, Column => 0);
for n in legend'Range loop
pos := Ada.Strings.Fixed.Index (Source => legend (n).msg.all,
Pattern => "%s");
-- buf := (others => ' ');
buf := To_Bounded_String (legend (n).msg.all);
case legend (n).code is
when 0 => null;
when 1 =>
if do_keypad then
Replace_Slice (buf, pos, pos + 1, "yes");
else
Replace_Slice (buf, pos, pos + 1, "no");
end if;
when 2 =>
if do_scroll then
Replace_Slice (buf, pos, pos + 1, "yes");
else
Replace_Slice (buf, pos, pos + 1, "no");
end if;
when 3 =>
if do_keypad then
Replace_Slice (buf, pos, pos + 1, "/ESC");
else
Replace_Slice (buf, pos, pos + 1, "");
end if;
end case;
Get_Cursor_Position (Line => mypair.y, Column => mypair.x);
if Columns < mypair.x + 3 + Column_Position (Length (buf)) then
Add (Ch => newl);
elsif n /= 1 then -- n /= legen'First
Add (Str => ", ");
end if;
myAdd (Str => buf);
end loop;
Clear_To_End_Of_Line;
end newwin_legend;
procedure transient (curpw : Window; msg : String) is
begin
newwin_legend (curpw);
if msg /= "" then
Add (Line => Lines - 1, Column => 0, Str => msg);
Refresh;
Nap_Milli_Seconds (1000);
end if;
Move_Cursor (Line => Lines - 1, Column => 0);
if HaveKeyPad (curpw) then
Add (Str => "Non-arrow");
else
Add (Str => "All other");
end if;
Add (Str => " characters are echoed, window should ");
if not HaveScroll (curpw) then
Add (Str => "not ");
end if;
Add (Str => "scroll");
Clear_To_End_Of_Line;
end transient;
procedure newwin_report (win : Window := Standard_Window) is
y : Line_Position;
x : Column_Position;
use Int_IO;
tmp2a : String (1 .. 2);
tmp2b : String (1 .. 2);
begin
if win /= Standard_Window then
transient (win, "");
end if;
Get_Cursor_Position (win, y, x);
Move_Cursor (Line => Lines - 1, Column => Columns - 17);
Put (tmp2a, Integer (y));
Put (tmp2b, Integer (x));
Add (Str => "Y = " & tmp2a & " X = " & tmp2b);
if win /= Standard_Window then
Refresh;
else
Move_Cursor (win, y, x);
end if;
end newwin_report;
procedure selectcell (uli : Line_Position;
ulj : Column_Position;
lri : Line_Position;
lrj : Column_Position;
p : out pair;
b : out Boolean) is
c : Key_Code;
res : pair;
i : Line_Position := 0;
j : Column_Position := 0;
si : constant Line_Position := lri - uli + 1;
sj : constant Column_Position := lrj - ulj + 1;
begin
res.y := uli;
res.x := ulj;
loop
Move_Cursor (Line => uli + i, Column => ulj + j);
newwin_report;
c := Getchar;
case c is
when
Macro_Quit |
Macro_Escape =>
-- on the same line macro calls interfere due to the # comment
-- this is needed because keypad off affects all windows.
-- try removing the ESCAPE and see what happens.
b := False;
return;
when KEY_UP =>
i := i + si - 1;
-- same as i := i - 1 because of Modulus arithmetic,
-- on Line_Position, which is a Natural
-- the C version uses this form too, interestingly.
when KEY_DOWN =>
i := i + 1;
when KEY_LEFT =>
j := j + sj - 1;
when KEY_RIGHT =>
j := j + 1;
when Key_Mouse =>
declare
event : Mouse_Event;
y : Line_Position;
x : Column_Position;
Button : Mouse_Button;
State : Button_State;
begin
event := Get_Mouse;
Get_Event (Event => event,
Y => y,
X => x,
Button => Button,
State => State);
if y > uli and x > ulj then
i := y - uli;
j := x - ulj;
-- same as when others =>
res.y := uli + i;
res.x := ulj + j;
p := res;
b := True;
return;
else
Beep;
end if;
end;
when others =>
res.y := uli + i;
res.x := ulj + j;
p := res;
b := True;
return;
end case;
i := i mod si;
j := j mod sj;
end loop;
end selectcell;
function getwindow return Window is
rwindow : Window;
ul, lr : pair;
result : Boolean;
begin
Move_Cursor (Line => 0, Column => 0);
Clear_To_End_Of_Line;
Add (Str => "Use arrows to move cursor, anything else to mark corner 1");
Refresh;
selectcell (2, 1, Lines - Botlines - 2, Columns - 2, ul, result);
if not result then
return Null_Window;
end if;
Add (Line => ul.y - 1, Column => ul.x - 1,
Ch => ACS_Map (ACS_Upper_Left_Corner));
Move_Cursor (Line => 0, Column => 0);
Clear_To_End_Of_Line;
Add (Str => "Use arrows to move cursor, anything else to mark corner 2");
Refresh;
selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2, lr, result);
if not result then
return Null_Window;
end if;
rwindow := Sub_Window (Number_Of_Lines => lr.y - ul.y + 1,
Number_Of_Columns => lr.x - ul.x + 1,
First_Line_Position => ul.y,
First_Column_Position => ul.x);
Outerbox (ul, lr, True);
Refresh;
Refresh (rwindow);
Move_Cursor (Line => 0, Column => 0);
Clear_To_End_Of_Line;
return rwindow;
end getwindow;
procedure newwin_move (win : Window;
dy : Line_Position;
dx : Column_Position) is
cur_y, max_y : Line_Position;
cur_x, max_x : Column_Position;
begin
Get_Cursor_Position (win, cur_y, cur_x);
Get_Size (win, max_y, max_x);
cur_x := Column_Position'Min (Column_Position'Max (cur_x + dx, 0),
max_x - 1);
cur_y := Line_Position'Min (Line_Position'Max (cur_y + dy, 0),
max_y - 1);
Move_Cursor (win, Line => cur_y, Column => cur_x);
end newwin_move;
function delete_framed (fp : FrameA; showit : Boolean) return FrameA is
np : FrameA;
begin
fp.all.last.all.next := fp.all.next;
fp.all.next.all.last := fp.all.last;
if showit then
Erase (fp.all.wind);
Refresh (fp.all.wind);
end if;
Delete (fp.all.wind);
if fp = fp.all.next then
np := null;
else
np := fp.all.next;
end if;
-- TODO free(fp);
return np;
end delete_framed;
Mask : Event_Mask := No_Events;
Mask2 : Event_Mask;
usescr : Window;
begin
if Has_Mouse then
Register_Reportable_Event (
Button => Left,
State => Clicked,
Mask => Mask);
Mask2 := Start_Mouse (Mask);
end if;
c := CTRL ('C');
Set_Raw_Mode (SwitchOn => True);
loop
transient (Standard_Window, "");
case c is
when Character'Pos ('c') mod 16#20# => -- Ctrl('c')
declare
neww : constant FrameA := new Frame'(null, null,
False, False,
Null_Window);
begin
neww.all.wind := getwindow;
if neww.all.wind = Null_Window then
exit;
-- was goto breakout; ha ha ha
else
if current = null then
neww.all.next := neww;
neww.all.last := neww;
else
neww.all.next := current.all.next;
neww.all.last := current;
neww.all.last.all.next := neww;
neww.all.next.all.last := neww;
end if;
current := neww;
Set_KeyPad_Mode (current.all.wind, True);
current.all.do_keypad := HaveKeyPad (current.all.wind);
current.all.do_scroll := HaveScroll (current.all.wind);
end if;
end;
when Character'Pos ('N') mod 16#20# => -- Ctrl('N')
if current /= null then
current := current.all.next;
end if;
when Character'Pos ('P') mod 16#20# => -- Ctrl('P')
if current /= null then
current := current.all.last;
end if;
when Character'Pos ('F') mod 16#20# => -- Ctrl('F')
if current /= null and then HaveScroll (current.all.wind) then
Scroll (current.all.wind, 1);
end if;
when Character'Pos ('B') mod 16#20# => -- Ctrl('B')
if current /= null and then HaveScroll (current.all.wind) then
-- The C version of Scroll may return ERR which is ignored
-- we need to avoid the exception
-- with the 'and HaveScroll(current.wind)'
Scroll (current.all.wind, -1);
end if;
when Character'Pos ('K') mod 16#20# => -- Ctrl('K')
if current /= null then
current.all.do_keypad := not current.all.do_keypad;
Set_KeyPad_Mode (current.all.wind, current.all.do_keypad);
end if;
when Character'Pos ('S') mod 16#20# => -- Ctrl('S')
if current /= null then
current.all.do_scroll := not current.all.do_scroll;
Allow_Scrolling (current.all.wind, current.all.do_scroll);
end if;
when Character'Pos ('W') mod 16#20# => -- Ctrl('W')
if current /= current.all.next then
Create (f, Name => dumpfile); -- TODO error checking
if not Is_Open (f) then
raise Curses_Exception;
end if;
Put_Window (current.all.wind, f);
Close (f);
current := delete_framed (current, True);
end if;
when Character'Pos ('R') mod 16#20# => -- Ctrl('R')
declare
neww : FrameA := new Frame'(null, null, False, False,
Null_Window);
begin
Open (f, Mode => In_File, Name => dumpfile);
neww := new Frame'(null, null, False, False, Null_Window);
neww.all.next := current.all.next;
neww.all.last := current;
neww.all.last.all.next := neww;
neww.all.next.all.last := neww;
neww.all.wind := Get_Window (f);
Close (f);
Refresh (neww.all.wind);
end;
when Character'Pos ('X') mod 16#20# => -- Ctrl('X')
if current /= null then
declare
tmp, ul, lr : pair;
mx : Column_Position;
my : Line_Position;
tmpbool : Boolean;
begin
Move_Cursor (Line => 0, Column => 0);
Clear_To_End_Of_Line;
Add (Str => "Use arrows to move cursor, anything else " &
"to mark new corner");
Refresh;
Get_Window_Position (current.all.wind, ul.y, ul.x);
selectcell (ul.y, ul.x, Lines - Botlines - 2, Columns - 2,
tmp, tmpbool);
if not tmpbool then
-- the C version had a goto. I refuse gotos.
Beep;
else
Get_Size (current.all.wind, lr.y, lr.x);
lr.y := lr.y + ul.y - 1;
lr.x := lr.x + ul.x - 1;
Outerbox (ul, lr, False);
Refresh_Without_Update;
Get_Size (current.all.wind, my, mx);
if my > tmp.y - ul.y then
Get_Cursor_Position (current.all.wind, lr.y, lr.x);
Move_Cursor (current.all.wind, tmp.y - ul.y + 1, 0);
Clear_To_End_Of_Screen (current.all.wind);
Move_Cursor (current.all.wind, lr.y, lr.x);
end if;
if mx > tmp.x - ul.x then
for i in 0 .. my - 1 loop
Move_Cursor (current.all.wind, i, tmp.x - ul.x + 1);
Clear_To_End_Of_Line (current.all.wind);
end loop;
end if;
Refresh_Without_Update (current.all.wind);
lr := tmp;
-- The C version passes invalid args to resize
-- which returns an ERR. For Ada we avoid the exception.
if lr.y /= ul.y and lr.x /= ul.x then
Resize (current.all.wind, lr.y - ul.y + 0,
lr.x - ul.x + 0);
end if;
Get_Window_Position (current.all.wind, ul.y, ul.x);
Get_Size (current.all.wind, lr.y, lr.x);
lr.y := lr.y + ul.y - 1;
lr.x := lr.x + ul.x - 1;
Outerbox (ul, lr, True);
Refresh_Without_Update;
Refresh_Without_Update (current.all.wind);
Move_Cursor (Line => 0, Column => 0);
Clear_To_End_Of_Line;
Update_Screen;
end if;
end;
end if;
when Key_F10 =>
declare tmp : pair; tmpbool : Boolean;
begin
-- undocumented --- use this to test area clears
selectcell (0, 0, Lines - 1, Columns - 1, tmp, tmpbool);
Clear_To_End_Of_Screen;
Refresh;
end;
when Key_Cursor_Up =>
newwin_move (current.all.wind, -1, 0);
when Key_Cursor_Down =>
newwin_move (current.all.wind, 1, 0);
when Key_Cursor_Left =>
newwin_move (current.all.wind, 0, -1);
when Key_Cursor_Right =>
newwin_move (current.all.wind, 0, 1);
when Key_Backspace | Key_Delete_Char =>
declare
y : Line_Position;
x : Column_Position;
tmp : Line_Position;
begin
Get_Cursor_Position (current.all.wind, y, x);
-- x := x - 1;
-- I got tricked by the -1 = Max_Natural - 1 result
-- y := y - 1;
if not (x = 0 and y = 0) then
if x = 0 then
y := y - 1;
Get_Size (current.all.wind, tmp, x);
end if;
x := x - 1;
Delete_Character (current.all.wind, y, x);
end if;
end;
when others =>
-- TODO c = '\r' ?
if current /= null then
declare
begin
Add (current.all.wind, Ch => Code_To_Char (c));
exception
when Curses_Exception => null;
-- this happens if we are at the
-- lower right of a window and add a character.
end;
else
Beep;
end if;
end case;
newwin_report (current.all.wind);
if current /= null then
usescr := current.all.wind;
else
usescr := Standard_Window;
end if;
Refresh (usescr);
c := Getchar (usescr);
exit when c = Quit or (c = Escape and HaveKeyPad (usescr));
-- TODO when does c = ERR happen?
end loop;
-- TODO while current /= null loop
-- current := delete_framed(current, False);
-- end loop;
Allow_Scrolling (Mode => True);
End_Mouse (Mask2);
Set_Raw_Mode (SwitchOn => True);
Erase;
End_Windows;
end ncurses2.acs_and_scroll;
AdaCurses-20140726/samples/sample-explanation.adb 0000644 0001751 0000144 00000034716 11543464671 020315 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Explanation --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.26 $
-- $Date: 2011/03/26 22:33:29 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Poor mans help system. This scans a sequential file for key lines and
-- then reads the lines up to the next key. Those lines are presented in
-- a window as help or explanation.
--
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Unchecked_Deallocation;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Sample.Keyboard_Handler; use Sample.Keyboard_Handler;
with Sample.Manifest; use Sample.Manifest;
with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Helpers; use Sample.Helpers;
package body Sample.Explanation is
Help_Keys : constant String := "HELPKEYS";
In_Help : constant String := "INHELP";
File_Name : constant String := "explain.txt";
F : File_Type;
type Help_Line;
type Help_Line_Access is access Help_Line;
pragma Controlled (Help_Line_Access);
type String_Access is access String;
pragma Controlled (String_Access);
type Help_Line is
record
Prev, Next : Help_Line_Access;
Line : String_Access;
end record;
procedure Explain (Key : String;
Win : Window);
procedure Release_String is
new Ada.Unchecked_Deallocation (String,
String_Access);
procedure Release_Help_Line is
new Ada.Unchecked_Deallocation (Help_Line,
Help_Line_Access);
function Search (Key : String) return Help_Line_Access;
procedure Release_Help (Root : in out Help_Line_Access);
function Check_File (Name : String) return Boolean;
procedure Explain (Key : String)
is
begin
Explain (Key, Null_Window);
end Explain;
procedure Explain (Key : String;
Win : Window)
is
-- Retrieve the text associated with this key and display it in this
-- window. If no window argument is passed, the routine will create
-- a temporary window and use it.
function Filter_Key return Real_Key_Code;
procedure Unknown_Key;
procedure Redo;
procedure To_Window (C : in out Help_Line_Access;
More : in out Boolean);
Frame : Window := Null_Window;
W : Window := Win;
K : Real_Key_Code;
P : Panel;
Height : Line_Count;
Width : Column_Count;
Help : Help_Line_Access := Search (Key);
Current : Help_Line_Access;
Top_Line : Help_Line_Access;
Has_More : Boolean := True;
procedure Unknown_Key
is
begin
Add (W, "Help message with ID ");
Add (W, Key);
Add (W, " not found.");
Add (W, Character'Val (10));
Add (W, "Press the Function key labeled 'Quit' key to continue.");
end Unknown_Key;
procedure Redo
is
H : Help_Line_Access := Top_Line;
begin
if Top_Line /= null then
for L in 0 .. (Height - 1) loop
Add (W, L, 0, H.all.Line.all);
exit when H.all.Next = null;
H := H.all.Next;
end loop;
else
Unknown_Key;
end if;
end Redo;
function Filter_Key return Real_Key_Code
is
K : Real_Key_Code;
begin
loop
K := Get_Key (W);
if K in Special_Key_Code'Range then
case K is
when HELP_CODE =>
if not Find_Context (In_Help) then
Push_Environment (In_Help, False);
Explain (In_Help, W);
Pop_Environment;
Redo;
end if;
when EXPLAIN_CODE =>
if not Find_Context (Help_Keys) then
Push_Environment (Help_Keys, False);
Explain (Help_Keys, W);
Pop_Environment;
Redo;
end if;
when others => exit;
end case;
else
exit;
end if;
end loop;
return K;
end Filter_Key;
procedure To_Window (C : in out Help_Line_Access;
More : in out Boolean)
is
L : Line_Position := 0;
begin
loop
Add (W, L, 0, C.all.Line.all);
L := L + 1;
exit when C.all.Next = null or else L = Height;
C := C.all.Next;
end loop;
if C.all.Next /= null then
pragma Assert (L = Height);
More := True;
else
More := False;
end if;
end To_Window;
begin
if W = Null_Window then
Push_Environment ("HELP");
Default_Labels;
Frame := New_Window (Lines - 2, Columns, 0, 0);
if Has_Colors then
Set_Background (Win => Frame,
Ch => (Ch => ' ',
Color => Help_Color,
Attr => Normal_Video));
Set_Character_Attributes (Win => Frame,
Attr => Normal_Video,
Color => Help_Color);
Erase (Frame);
end if;
Box (Frame);
Set_Character_Attributes (Frame, (Reverse_Video => True,
others => False));
Add (Frame, Lines - 3, 2, "Cursor Up/Down scrolls");
Set_Character_Attributes (Frame); -- Back to default.
Window_Title (Frame, "Explanation");
W := Derived_Window (Frame, Lines - 4, Columns - 2, 1, 1);
Refresh_Without_Update (Frame);
Get_Size (W, Height, Width);
Set_Meta_Mode (W);
Set_KeyPad_Mode (W);
Allow_Scrolling (W, True);
Set_Echo_Mode (False);
P := Create (Frame);
Top (P);
Update_Panels;
else
Clear (W);
Refresh_Without_Update (W);
end if;
Current := Help; Top_Line := Help;
if null = Help then
Unknown_Key;
loop
K := Filter_Key;
exit when K = QUIT_CODE;
end loop;
else
To_Window (Current, Has_More);
if Has_More then
-- This means there are more lines available, so we have to go
-- into a scroll manager.
loop
K := Filter_Key;
if K in Special_Key_Code'Range then
case K is
when Key_Cursor_Down =>
if Current.all.Next /= null then
Move_Cursor (W, Height - 1, 0);
Scroll (W, 1);
Current := Current.all.Next;
Top_Line := Top_Line.all.Next;
Add (W, Current.all.Line.all);
end if;
when Key_Cursor_Up =>
if Top_Line.all.Prev /= null then
Move_Cursor (W, 0, 0);
Scroll (W, -1);
Top_Line := Top_Line.all.Prev;
Current := Current.all.Prev;
Add (W, Top_Line.all.Line.all);
end if;
when QUIT_CODE => exit;
when others => null;
end case;
end if;
end loop;
else
loop
K := Filter_Key;
exit when K = QUIT_CODE;
end loop;
end if;
end if;
Clear (W);
if Frame /= Null_Window then
Clear (Frame);
Delete (P);
Delete (W);
Delete (Frame);
Pop_Environment;
end if;
Update_Panels;
Update_Screen;
Release_Help (Help);
end Explain;
function Search (Key : String) return Help_Line_Access
is
Last : Natural;
Buffer : String (1 .. 256);
Root : Help_Line_Access := null;
Current : Help_Line_Access;
Tail : Help_Line_Access := null;
function Next_Line return Boolean;
function Next_Line return Boolean
is
H_End : constant String := "#END";
begin
Get_Line (F, Buffer, Last);
if Last = H_End'Length and then H_End = Buffer (1 .. Last) then
return False;
else
return True;
end if;
end Next_Line;
begin
Reset (F);
Outer :
loop
exit Outer when not Next_Line;
if Last = (1 + Key'Length) and then Key = Buffer (2 .. Last)
and then Buffer (1) = '#' then
loop
exit when not Next_Line;
exit when Buffer (1) = '#';
Current := new Help_Line'(null, null,
new String'(Buffer (1 .. Last)));
if Tail = null then
Release_Help (Root);
Root := Current;
else
Tail.all.Next := Current;
Current.all.Prev := Tail;
end if;
Tail := Current;
end loop;
exit Outer;
end if;
end loop Outer;
return Root;
end Search;
procedure Release_Help (Root : in out Help_Line_Access)
is
Next : Help_Line_Access;
begin
loop
exit when Root = null;
Next := Root.all.Next;
Release_String (Root.all.Line);
Release_Help_Line (Root);
Root := Next;
end loop;
end Release_Help;
procedure Explain_Context
is
begin
Explain (Context);
end Explain_Context;
procedure Notepad (Key : String)
is
H : constant Help_Line_Access := Search (Key);
T : Help_Line_Access := H;
N : Line_Count := 1;
L : Line_Position := 0;
W : Window;
P : Panel;
begin
if H /= null then
loop
T := T.all.Next;
exit when T = null;
N := N + 1;
end loop;
W := New_Window (N + 2, Columns, Lines - N - 2, 0);
if Has_Colors then
Set_Background (Win => W,
Ch => (Ch => ' ',
Color => Notepad_Color,
Attr => Normal_Video));
Set_Character_Attributes (Win => W,
Attr => Normal_Video,
Color => Notepad_Color);
Erase (W);
end if;
Box (W);
Window_Title (W, "Notepad");
P := New_Panel (W);
T := H;
loop
Add (W, L + 1, 1, T.all.Line.all, Integer (Columns - 2));
L := L + 1;
T := T.all.Next;
exit when T = null;
end loop;
T := H;
Release_Help (T);
Refresh_Without_Update (W);
Notepad_To_Context (P);
end if;
end Notepad;
function Check_File (Name : String) return Boolean is
The_File : File_Type;
begin
Open (The_File, In_File, Name);
Close (The_File);
return True;
exception
when Name_Error =>
return False;
end Check_File;
begin
if Check_File ("/usr/share/AdaCurses/" & File_Name) then
Open (F, In_File, "/usr/share/AdaCurses/" & File_Name);
elsif Check_File (File_Name) then
Open (F, In_File, File_Name);
else
Put_Line (Standard_Error,
"The file explain.txt was not found in the current directory."
);
raise Name_Error;
end if;
end Sample.Explanation;
AdaCurses-20140726/samples/ncurses2-acs_display.ads 0000644 0001751 0000144 00000005674 07212274073 020564 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.acs_display;
AdaCurses-20140726/samples/sample-form_demo-handler.ads 0000644 0001751 0000144 00000007232 11315445551 021360 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Form_Demo.Handler --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses;
use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels;
use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Forms;
use Terminal_Interface.Curses.Forms;
generic
with function My_Driver (Frm : Form;
K : Key_Code;
Pan : Panel) return Boolean;
package Sample.Form_Demo.Handler is
procedure Drive_Me (F : Form;
Lin : Line_Position;
Col : Column_Position;
Title : String := "");
-- Position the menu at the given point and drive it.
procedure Drive_Me (F : Form;
Title : String := "");
-- Center menu and drive it.
end Sample.Form_Demo.Handler;
AdaCurses-20140726/samples/sample-explanation.ads 0000644 0001751 0000144 00000006725 11315445551 020326 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Explanation --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Poor mans help system. This scans a sequential file for key lines and
-- then reads the lines up to the next key. Those lines are presented in
-- a window as help or explanation.
--
package Sample.Explanation is
procedure Explain (Key : String);
-- Retrieve the text associated with this key and display it.
procedure Explain_Context;
-- Explain the current context.
procedure Notepad (Key : String);
-- Put a note on the screen and maintain it with the context
Explanation_Not_Found : exception;
Explanation_Error : exception;
end Sample.Explanation;
AdaCurses-20140726/samples/ncurses2-overlap_test.ads 0000644 0001751 0000144 00000005675 07212274051 020775 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.overlap_test;
AdaCurses-20140726/samples/sample-menu_demo-aux.adb 0000644 0001751 0000144 00000021336 11315445062 020516 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Menu_Demo.Aux --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.14 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
with Sample.Manifest; use Sample.Manifest;
with Sample.Helpers; use Sample.Helpers;
with Sample.Keyboard_Handler; use Sample.Keyboard_Handler;
with Sample.Explanation; use Sample.Explanation;
package body Sample.Menu_Demo.Aux is
procedure Geometry (M : Menu;
L : out Line_Count;
C : out Column_Count;
Y : out Line_Position;
X : out Column_Position;
Fy : out Line_Position;
Fx : out Column_Position);
procedure Geometry (M : Menu;
L : out Line_Count; -- Lines used for menu
C : out Column_Count; -- Columns used for menu
Y : out Line_Position; -- Proposed Line for menu
X : out Column_Position; -- Proposed Column for menu
Fy : out Line_Position; -- Vertical inner frame
Fx : out Column_Position) -- Horiz. inner frame
is
Spc_Desc : Column_Position; -- spaces between description and item
begin
Set_Mark (M, Menu_Marker);
Spacing (M, Spc_Desc, Fy, Fx);
Scale (M, L, C);
Fx := Fx + Column_Position (Fy - 1); -- looks a bit nicer
L := L + 2 * Fy; -- count for frame at top and bottom
C := C + 2 * Fx; -- "
-- Calculate horizontal coordinate at the screen center
X := (Columns - C) / 2;
Y := 1; -- always startin line 1
end Geometry;
procedure Geometry (M : Menu;
L : out Line_Count; -- Lines used for menu
C : out Column_Count; -- Columns used for menu
Y : out Line_Position; -- Proposed Line for menu
X : out Column_Position) -- Proposed Column for menu
is
Fy : Line_Position;
Fx : Column_Position;
begin
Geometry (M, L, C, Y, X, Fy, Fx);
end Geometry;
function Create (M : Menu;
Title : String;
Lin : Line_Position;
Col : Column_Position) return Panel
is
W, S : Window;
L : Line_Count;
C : Column_Count;
Y, Fy : Line_Position;
X, Fx : Column_Position;
Pan : Panel;
begin
Geometry (M, L, C, Y, X, Fy, Fx);
W := New_Window (L, C, Lin, Col);
Set_Meta_Mode (W);
Set_KeyPad_Mode (W);
if Has_Colors then
Set_Background (Win => W,
Ch => (Ch => ' ',
Color => Menu_Back_Color,
Attr => Normal_Video));
Set_Foreground (Men => M, Color => Menu_Fore_Color);
Set_Background (Men => M, Color => Menu_Back_Color);
Set_Grey (Men => M, Color => Menu_Grey_Color);
Erase (W);
end if;
S := Derived_Window (W, L - Fy, C - Fx, Fy, Fx);
Set_Meta_Mode (S);
Set_KeyPad_Mode (S);
Box (W);
Set_Window (M, W);
Set_Sub_Window (M, S);
if Title'Length > 0 then
Window_Title (W, Title);
end if;
Pan := New_Panel (W);
Post (M);
return Pan;
end Create;
procedure Destroy (M : Menu;
P : in out Panel)
is
W, S : Window;
begin
W := Get_Window (M);
S := Get_Sub_Window (M);
Post (M, False);
Erase (W);
Delete (P);
Set_Window (M, Null_Window);
Set_Sub_Window (M, Null_Window);
Delete (S);
Delete (W);
Update_Panels;
end Destroy;
function Get_Request (M : Menu; P : Panel) return Key_Code
is
W : constant Window := Get_Window (M);
K : Real_Key_Code;
Ch : Character;
begin
Top (P);
loop
K := Get_Key (W);
if K in Special_Key_Code'Range then
case K is
when HELP_CODE => Explain_Context;
when EXPLAIN_CODE => Explain ("MENUKEYS");
when Key_Home => return REQ_FIRST_ITEM;
when QUIT_CODE => return QUIT;
when Key_Cursor_Down => return REQ_DOWN_ITEM;
when Key_Cursor_Up => return REQ_UP_ITEM;
when Key_Cursor_Left => return REQ_LEFT_ITEM;
when Key_Cursor_Right => return REQ_RIGHT_ITEM;
when Key_End => return REQ_LAST_ITEM;
when Key_Backspace => return REQ_BACK_PATTERN;
when Key_Next_Page => return REQ_SCR_DPAGE;
when Key_Previous_Page => return REQ_SCR_UPAGE;
when others => return K;
end case;
elsif K in Normal_Key_Code'Range then
Ch := Character'Val (K);
case Ch is
when CAN => return QUIT; -- CTRL-X
when SO => return REQ_NEXT_ITEM; -- CTRL-N
when DLE => return REQ_PREV_ITEM; -- CTRL-P
when NAK => return REQ_SCR_ULINE; -- CTRL-U
when EOT => return REQ_SCR_DLINE; -- CTRL-D
when ACK => return REQ_SCR_DPAGE; -- CTRL-F
when STX => return REQ_SCR_UPAGE; -- CTRL-B
when EM => return REQ_CLEAR_PATTERN; -- CTRL-Y
when BS => return REQ_BACK_PATTERN; -- CTRL-H
when SOH => return REQ_NEXT_MATCH; -- CTRL-A
when ENQ => return REQ_PREV_MATCH; -- CTRL-E
when DC4 => return REQ_TOGGLE_ITEM; -- CTRL-T
when CR | LF => return SELECT_ITEM;
when others => return K;
end case;
else
return K;
end if;
end loop;
end Get_Request;
end Sample.Menu_Demo.Aux;
AdaCurses-20140726/samples/ncurses2-attr_test.ads 0000644 0001751 0000144 00000005733 10447516250 020276 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2006 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.2 $
-- $Date: 2006/06/25 14:24:40 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.attr_test;
AdaCurses-20140726/samples/sample-curses_demo.adb 0000644 0001751 0000144 00000014170 11542237320 020257 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Curses_Demo --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.17 $
-- $Date: 2011/03/23 00:29:04 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Panels.User_Data;
with Sample.Manifest; use Sample.Manifest;
with Sample.Helpers; use Sample.Helpers;
with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Explanation; use Sample.Explanation;
with Sample.Menu_Demo.Handler;
with Sample.Curses_Demo.Mouse;
with Sample.Curses_Demo.Attributes;
package body Sample.Curses_Demo is
type User_Data is new Integer;
type User_Data_Access is access all User_Data;
package PUD is new Panels.User_Data (User_Data, User_Data_Access);
-- We use above instantiation of the generic User_Data package to
-- demonstrate and test the use of the user data mechanism.
procedure Demo
is
function My_Driver (M : Menu;
K : Key_Code;
Pan : Panel) return Boolean;
package Mh is new Sample.Menu_Demo.Handler (My_Driver);
Itm : Item_Array_Access := new Item_Array'
(New_Item ("Attributes Demo"),
New_Item ("Mouse Demo"),
Null_Item);
M : Menu := New_Menu (Itm);
U1 : constant User_Data_Access := new User_Data'(4711);
U2 : User_Data_Access;
function My_Driver (M : Menu;
K : Key_Code;
Pan : Panel) return Boolean
is
Idx : constant Positive := Get_Index (Current (M));
Result : Boolean := False;
begin
PUD.Set_User_Data (Pan, U1); -- set some user data, just for fun
if K in User_Key_Code'Range then
if K = QUIT then
Result := True;
elsif K = SELECT_ITEM then
if Idx in Itm'Range then
Hide (Pan);
Update_Panels;
end if;
case Idx is
when 1 => Sample.Curses_Demo.Attributes.Demo;
when 2 => Sample.Curses_Demo.Mouse.Demo;
when others => Not_Implemented;
end case;
if Idx in Itm'Range then
Top (Pan);
Show (Pan);
Update_Panels;
Update_Screen;
end if;
end if;
end if;
PUD.Get_User_Data (Pan, U2); -- get the user data
pragma Assert (U1.all = U2.all and then U1 = U2);
return Result;
end My_Driver;
begin
if (1 + Item_Count (M)) /= Itm'Length then
raise Constraint_Error;
end if;
if not Has_Mouse then
declare
O : Item_Option_Set;
begin
Get_Options (Itm.all (2), O);
O.Selectable := False;
Set_Options (Itm.all (2), O);
end;
end if;
Push_Environment ("CURSES00");
Notepad ("CURSES-PAD00");
Default_Labels;
Refresh_Soft_Label_Keys_Without_Update;
Mh.Drive_Me (M, " Demo ");
Pop_Environment;
Delete (M);
Free (Itm, True);
end Demo;
end Sample.Curses_Demo;
AdaCurses-20140726/samples/sample-my_field_type.adb 0000644 0001751 0000144 00000007225 11042670536 020610 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.My_Field_Type --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2008 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.16 $
-- $Date: 2008/07/26 18:47:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- This is a very simple user defined field type. It accepts only a
-- defined character as input into the field.
--
package body Sample.My_Field_Type is
-- That's simple. There are minimal field validity checks.
function Field_Check (Fld : Field;
Typ : My_Data) return Boolean
is
begin
if Fld = Null_Field or Typ.Ch = Character'Val (0) then
return False;
end if;
return True;
end Field_Check;
-- Check exactly against the specified character.
function Character_Check (Ch : Character;
Typ : My_Data) return Boolean
is
C : constant Character := Typ.Ch;
begin
return Ch = C;
end Character_Check;
end Sample.My_Field_Type;
AdaCurses-20140726/samples/sample-form_demo-handler.adb 0000644 0001751 0000144 00000010677 11315445062 021343 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Form_Demo.Handler --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.14 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Sample.Form_Demo.Aux;
package body Sample.Form_Demo.Handler is
package Aux renames Sample.Form_Demo.Aux;
procedure Drive_Me (F : Form;
Title : String := "")
is
L : Line_Count;
C : Column_Count;
Y : Line_Position;
X : Column_Position;
begin
Aux.Geometry (F, L, C, Y, X);
Drive_Me (F, Y, X, Title);
end Drive_Me;
procedure Drive_Me (F : Form;
Lin : Line_Position;
Col : Column_Position;
Title : String := "")
is
Pan : Panel := Aux.Create (F, Title, Lin, Col);
V : Cursor_Visibility := Normal;
Handle_CRLF : Boolean := True;
begin
Set_Cursor_Visibility (V);
if Aux.Count_Active (F) = 1 then
Handle_CRLF := False;
end if;
loop
declare
K : constant Key_Code := Aux.Get_Request (F, Pan, Handle_CRLF);
R : Driver_Result;
begin
if (K = 13 or else K = 10) and then not Handle_CRLF then
R := Unknown_Request;
else
R := Driver (F, K);
end if;
case R is
when Form_Ok => null;
when Unknown_Request =>
if My_Driver (F, K, Pan) then
exit;
end if;
when others => Beep;
end case;
end;
end loop;
Set_Cursor_Visibility (V);
Aux.Destroy (F, Pan);
end Drive_Me;
end Sample.Form_Demo.Handler;
AdaCurses-20140726/samples/ncurses2-m.ads 0000644 0001751 0000144 00000005743 07212274047 016523 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package ncurses2.m is
function main return Integer;
end ncurses2.m;
AdaCurses-20140726/samples/ncurses2-test_sgr_attributes.ads 0000644 0001751 0000144 00000005704 07212274052 022360 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.test_sgr_attributes;
AdaCurses-20140726/samples/tour.adb 0000644 0001751 0000144 00000005707 07746514446 015511 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- tour --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Sample; use Sample;
procedure Tour is
begin
Whow;
end Tour;
AdaCurses-20140726/samples/ncurses2-color_edit.ads 0000644 0001751 0000144 00000005673 07212274074 020414 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.color_edit;
AdaCurses-20140726/samples/sample-menu_demo-aux.ads 0000644 0001751 0000144 00000010165 11541117367 020542 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Menu_Demo.Aux --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
package Sample.Menu_Demo.Aux is
procedure Geometry (M : Menu;
L : out Line_Count;
C : out Column_Count;
Y : out Line_Position;
X : out Column_Position);
-- Calculate the geometry for a panel being able to be used to display
-- the menu.
function Create (M : Menu;
Title : String;
Lin : Line_Position;
Col : Column_Position) return Panel;
-- Create a panel decorated with a frame and the title at the specified
-- position. The dimension of the panel is derived from the menus layout.
procedure Destroy (M : Menu;
P : in out Panel);
-- Destroy all the windowing structures associated with this menu and
-- panel.
function Get_Request (M : Menu; P : Panel) return Key_Code;
-- Centralized request driver for all menus in this sample. This
-- gives us a common key binding for all menus.
end Sample.Menu_Demo.Aux;
AdaCurses-20140726/samples/ncurses2-m.adb 0000644 0001751 0000144 00000036315 11042670526 016477 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2008 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.8 $
-- $Date: 2008/07/26 18:47:50 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- TODO use Default_Character where appropriate
-- This is an Ada version of ncurses
-- I translated this because it tests the most features.
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Characters.Latin_1;
-- with Ada.Characters.Handling;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Strings.Unbounded;
with ncurses2.util; use ncurses2.util;
with ncurses2.getch_test;
with ncurses2.attr_test;
with ncurses2.color_test;
with ncurses2.demo_panels;
with ncurses2.color_edit;
with ncurses2.slk_test;
with ncurses2.acs_display;
with ncurses2.acs_and_scroll;
with ncurses2.flushinp_test;
with ncurses2.test_sgr_attributes;
with ncurses2.menu_test;
with ncurses2.demo_pad;
with ncurses2.demo_forms;
with ncurses2.overlap_test;
with ncurses2.trace_set;
with ncurses2.getopt; use ncurses2.getopt;
package body ncurses2.m is
use Int_IO;
function To_trace (n : Integer) return Trace_Attribute_Set;
procedure usage;
procedure Set_Terminal_Modes;
function Do_Single_Test (c : Character) return Boolean;
function To_trace (n : Integer) return Trace_Attribute_Set is
a : Trace_Attribute_Set := (others => False);
m : Integer;
rest : Integer;
begin
m := n mod 2;
if 1 = m then
a.Times := True;
end if;
rest := n / 2;
m := rest mod 2;
if 1 = m then
a.Tputs := True;
end if;
rest := rest / 2;
m := rest mod 2;
if 1 = m then
a.Update := True;
end if;
rest := rest / 2;
m := rest mod 2;
if 1 = m then
a.Cursor_Move := True;
end if;
rest := rest / 2;
m := rest mod 2;
if 1 = m then
a.Character_Output := True;
end if;
rest := rest / 2;
m := rest mod 2;
if 1 = m then
a.Calls := True;
end if;
rest := rest / 2;
m := rest mod 2;
if 1 = m then
a.Virtual_Puts := True;
end if;
rest := rest / 2;
m := rest mod 2;
if 1 = m then
a.Input_Events := True;
end if;
rest := rest / 2;
m := rest mod 2;
if 1 = m then
a.TTY_State := True;
end if;
rest := rest / 2;
m := rest mod 2;
if 1 = m then
a.Internal_Calls := True;
end if;
rest := rest / 2;
m := rest mod 2;
if 1 = m then
a.Character_Calls := True;
end if;
rest := rest / 2;
m := rest mod 2;
if 1 = m then
a.Termcap_TermInfo := True;
end if;
return a;
end To_trace;
-- these are type Stdscr_Init_Proc;
function rip_footer (
Win : Window;
Columns : Column_Count) return Integer;
pragma Convention (C, rip_footer);
function rip_footer (
Win : Window;
Columns : Column_Count) return Integer is
begin
Set_Background (Win, (Ch => ' ',
Attr => (Reverse_Video => True, others => False),
Color => 0));
Erase (Win);
Move_Cursor (Win, 0, 0);
Add (Win, "footer:" & Columns'Img & " columns");
Refresh_Without_Update (Win);
return 0; -- Curses_OK;
end rip_footer;
function rip_header (
Win : Window;
Columns : Column_Count) return Integer;
pragma Convention (C, rip_header);
function rip_header (
Win : Window;
Columns : Column_Count) return Integer is
begin
Set_Background (Win, (Ch => ' ',
Attr => (Reverse_Video => True, others => False),
Color => 0));
Erase (Win);
Move_Cursor (Win, 0, 0);
Add (Win, "header:" & Columns'Img & " columns");
-- 'Img is a GNAT extention
Refresh_Without_Update (Win);
return 0; -- Curses_OK;
end rip_header;
procedure usage is
-- type Stringa is access String;
use Ada.Strings.Unbounded;
-- tbl : constant array (Positive range <>) of Stringa := (
tbl : constant array (Positive range <>) of Unbounded_String
:= (
To_Unbounded_String ("Usage: ncurses [options]"),
To_Unbounded_String (""),
To_Unbounded_String ("Options:"),
To_Unbounded_String (" -a f,b set default-colors " &
"(assumed white-on-black)"),
To_Unbounded_String (" -d use default-colors if terminal " &
"supports them"),
To_Unbounded_String (" -e fmt specify format for soft-keys " &
"test (e)"),
To_Unbounded_String (" -f rip-off footer line " &
"(can repeat)"),
To_Unbounded_String (" -h rip-off header line " &
"(can repeat)"),
To_Unbounded_String (" -s msec specify nominal time for " &
"panel-demo (default: 1, to hold)"),
To_Unbounded_String (" -t mask specify default trace-level " &
"(may toggle with ^T)")
);
begin
for n in tbl'Range loop
Put_Line (Standard_Error, To_String (tbl (n)));
end loop;
-- exit(EXIT_FAILURE);
-- TODO should we use Set_Exit_Status and throw and exception?
end usage;
procedure Set_Terminal_Modes is begin
Set_Raw_Mode (SwitchOn => False);
Set_Cbreak_Mode (SwitchOn => True);
Set_Echo_Mode (SwitchOn => False);
Allow_Scrolling (Mode => True);
Use_Insert_Delete_Line (Do_Idl => True);
Set_KeyPad_Mode (SwitchOn => True);
end Set_Terminal_Modes;
nap_msec : Integer := 1;
function Do_Single_Test (c : Character) return Boolean is
begin
case c is
when 'a' =>
getch_test;
when 'b' =>
attr_test;
when 'c' =>
if not Has_Colors then
Cannot ("does not support color.");
else
color_test;
end if;
when 'd' =>
if not Has_Colors then
Cannot ("does not support color.");
elsif not Can_Change_Color then
Cannot ("has hardwired color values.");
else
color_edit;
end if;
when 'e' =>
slk_test;
when 'f' =>
acs_display;
when 'o' =>
demo_panels (nap_msec);
when 'g' =>
acs_and_scroll;
when 'i' =>
flushinp_test (Standard_Window);
when 'k' =>
test_sgr_attributes;
when 'm' =>
menu_test;
when 'p' =>
demo_pad;
when 'r' =>
demo_forms;
when 's' =>
overlap_test;
when 't' =>
trace_set;
when '?' =>
null;
when others => return False;
end case;
return True;
end Do_Single_Test;
command : Character;
my_e_param : Soft_Label_Key_Format := Four_Four;
assumed_colors : Boolean := False;
default_colors : Boolean := False;
default_fg : Color_Number := White;
default_bg : Color_Number := Black;
-- nap_msec was an unsigned long integer in the C version,
-- yet napms only takes an int!
c : Integer;
c2 : Character;
optind : Integer := 1; -- must be initialized to one.
optarg : getopt.stringa;
length : Integer;
tmpi : Integer;
package myio is new Ada.Text_IO.Integer_IO (Integer);
use myio;
save_trace : Integer := 0;
save_trace_set : Trace_Attribute_Set;
function main return Integer is
begin
loop
Qgetopt (c, Argument_Count, Argument'Access,
"a:de:fhs:t:", optind, optarg);
exit when c = -1;
c2 := Character'Val (c);
case c2 is
when 'a' =>
-- Ada doesn't have scanf, it doesn't even have a
-- regular expression library.
assumed_colors := True;
myio.Get (optarg.all, Integer (default_fg), length);
myio.Get (optarg.all (length + 2 .. optarg.all'Length),
Integer (default_bg), length);
when 'd' =>
default_colors := True;
when 'e' =>
myio.Get (optarg.all, tmpi, length);
if tmpi > 3 then
usage;
return 1;
end if;
my_e_param := Soft_Label_Key_Format'Val (tmpi);
when 'f' =>
Rip_Off_Lines (-1, rip_footer'Access);
when 'h' =>
Rip_Off_Lines (1, rip_header'Access);
when 's' =>
myio.Get (optarg.all, nap_msec, length);
when 't' =>
myio.Get (optarg.all, save_trace, length);
when others =>
usage;
return 1;
end case;
end loop;
-- the C version had a bunch of macros here.
-- if (!isatty(fileno(stdin)))
-- isatty is not available in the standard Ada so skip it.
save_trace_set := To_trace (save_trace);
Trace_On (save_trace_set);
Init_Soft_Label_Keys (my_e_param);
Init_Screen;
Set_Background (Ch => (Ch => Blank,
Attr => Normal_Video,
Color => Color_Pair'First));
if Has_Colors then
Start_Color;
if default_colors then
Use_Default_Colors;
elsif assumed_colors then
Assume_Default_Colors (default_fg, default_bg);
end if;
end if;
Set_Terminal_Modes;
Save_Curses_Mode (Curses);
End_Windows;
-- TODO add macro #if blocks.
Put_Line ("Welcome to " & Curses_Version & ". Press ? for help.");
loop
Put_Line ("This is the ncurses main menu");
Put_Line ("a = keyboard and mouse input test");
Put_Line ("b = character attribute test");
Put_Line ("c = color test pattern");
Put_Line ("d = edit RGB color values");
Put_Line ("e = exercise soft keys");
Put_Line ("f = display ACS characters");
Put_Line ("g = display windows and scrolling");
Put_Line ("i = test of flushinp()");
Put_Line ("k = display character attributes");
Put_Line ("m = menu code test");
Put_Line ("o = exercise panels library");
Put_Line ("p = exercise pad features");
Put_Line ("q = quit");
Put_Line ("r = exercise forms code");
Put_Line ("s = overlapping-refresh test");
Put_Line ("t = set trace level");
Put_Line ("? = repeat this command summary");
Put ("> ");
Flush;
command := Ada.Characters.Latin_1.NUL;
-- get_input:
-- loop
declare
Ch : Character;
begin
Get (Ch);
-- TODO if read(ch) <= 0
-- TODO ada doesn't have an Is_Space function
command := Ch;
-- TODO if ch = '\n' or '\r' are these in Ada?
end;
-- end loop get_input;
declare
begin
if Do_Single_Test (command) then
Flush_Input;
Set_Terminal_Modes;
Reset_Curses_Mode (Curses);
Clear;
Refresh;
End_Windows;
if command = '?' then
Put_Line ("This is the ncurses capability tester.");
Put_Line ("You may select a test from the main menu by " &
"typing the");
Put_Line ("key letter of the choice (the letter to left " &
"of the =)");
Put_Line ("at the > prompt. The commands `x' or `q' will " &
"exit.");
end if;
-- continue; --why continue in the C version?
end if;
exception
when Curses_Exception => End_Windows;
end;
exit when command = 'q';
end loop;
Curses_Free_All;
return 0; -- TODO ExitProgram(EXIT_SUCCESS);
end main;
end ncurses2.m;
AdaCurses-20140726/samples/sample-function_key_setting.adb 0000644 0001751 0000144 00000017302 11542241134 022177 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Function_Key_Setting --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.15 $
-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Sample.Manifest; use Sample.Manifest;
-- This package implements a simple stack of function key label environments.
--
package body Sample.Function_Key_Setting is
Max_Label_Length : constant Positive := 8;
Number_Of_Keys : Label_Number := Label_Number'Last;
Justification : Label_Justification := Left;
subtype Label is String (1 .. Max_Label_Length);
type Label_Array is array (Label_Number range <>) of Label;
type Key_Environment (N : Label_Number := Label_Number'Last);
type Env_Ptr is access Key_Environment;
pragma Controlled (Env_Ptr);
type String_Access is access String;
pragma Controlled (String_Access);
Active_Context : String_Access := new String'("MAIN");
Active_Notepad : Panel := Null_Panel;
type Key_Environment (N : Label_Number := Label_Number'Last) is
record
Prev : Env_Ptr;
Help : String_Access;
Notepad : Panel;
Labels : Label_Array (1 .. N);
end record;
procedure Release_String is
new Ada.Unchecked_Deallocation (String,
String_Access);
procedure Release_Environment is
new Ada.Unchecked_Deallocation (Key_Environment,
Env_Ptr);
Top_Of_Stack : Env_Ptr := null;
procedure Push_Environment (Key : String;
Reset : Boolean := True)
is
P : constant Env_Ptr := new Key_Environment (Number_Of_Keys);
begin
-- Store the current labels in the environment
for I in 1 .. Number_Of_Keys loop
Get_Soft_Label_Key (I, P.all.Labels (I));
if Reset then
Set_Soft_Label_Key (I, " ");
end if;
end loop;
P.all.Prev := Top_Of_Stack;
-- now store active help context and notepad
P.all.Help := Active_Context;
P.all.Notepad := Active_Notepad;
-- The notepad must now vanish and the new notepad is empty.
if P.all.Notepad /= Null_Panel then
Hide (P.all.Notepad);
Update_Panels;
end if;
Active_Notepad := Null_Panel;
Active_Context := new String'(Key);
Top_Of_Stack := P;
if Reset then
Refresh_Soft_Label_Keys_Without_Update;
end if;
end Push_Environment;
procedure Pop_Environment
is
P : Env_Ptr := Top_Of_Stack;
begin
if Top_Of_Stack = null then
raise Function_Key_Stack_Error;
else
for I in 1 .. Number_Of_Keys loop
Set_Soft_Label_Key (I, P.all.Labels (I), Justification);
end loop;
pragma Assert (Active_Context /= null);
Release_String (Active_Context);
Active_Context := P.all.Help;
Refresh_Soft_Label_Keys_Without_Update;
Notepad_To_Context (P.all.Notepad);
Top_Of_Stack := P.all.Prev;
Release_Environment (P);
end if;
end Pop_Environment;
function Context return String
is
begin
if Active_Context /= null then
return Active_Context.all;
else
return "";
end if;
end Context;
function Find_Context (Key : String) return Boolean
is
P : Env_Ptr := Top_Of_Stack;
begin
if Active_Context.all = Key then
return True;
else
loop
exit when P = null;
if P.all.Help.all = Key then
return True;
else
P := P.all.Prev;
end if;
end loop;
return False;
end if;
end Find_Context;
procedure Notepad_To_Context (Pan : Panel)
is
W : Window;
begin
if Active_Notepad /= Null_Panel then
W := Get_Window (Active_Notepad);
Clear (W);
Delete (Active_Notepad);
Delete (W);
end if;
Active_Notepad := Pan;
if Pan /= Null_Panel then
Top (Pan);
end if;
Update_Panels;
Update_Screen;
end Notepad_To_Context;
procedure Initialize (Mode : Soft_Label_Key_Format := PC_Style;
Just : Label_Justification := Left)
is
begin
case Mode is
when PC_Style .. PC_Style_With_Index
=> Number_Of_Keys := 12;
when others
=> Number_Of_Keys := 8;
end case;
Init_Soft_Label_Keys (Mode);
Justification := Just;
end Initialize;
procedure Default_Labels
is
begin
Set_Soft_Label_Key (FKEY_QUIT, "Quit");
Set_Soft_Label_Key (FKEY_HELP, "Help");
Set_Soft_Label_Key (FKEY_EXPLAIN, "Keys");
Refresh_Soft_Label_Keys_Without_Update;
end Default_Labels;
function Notepad_Window return Window
is
begin
if Active_Notepad /= Null_Panel then
return Get_Window (Active_Notepad);
else
return Null_Window;
end if;
end Notepad_Window;
end Sample.Function_Key_Setting;
AdaCurses-20140726/samples/ncurses2-demo_pad.adb 0000644 0001751 0000144 00000057603 11542241134 020010 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,2011 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.8 $
-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Interfaces.C;
with System.Storage_Elements;
with System.Address_To_Access_Conversions;
with Ada.Text_IO;
-- with Ada.Real_Time; use Ada.Real_Time;
-- TODO is there a way to use Real_Time or Ada.Calendar in place of
-- gettimeofday?
-- Demonstrate pads.
procedure ncurses2.demo_pad is
type timestruct is record
seconds : Integer;
microseconds : Integer;
end record;
type myfunc is access function (w : Window) return Key_Code;
function gettime return timestruct;
procedure do_h_line (y : Line_Position;
x : Column_Position;
c : Attributed_Character;
to : Column_Position);
procedure do_v_line (y : Line_Position;
x : Column_Position;
c : Attributed_Character;
to : Line_Position);
function padgetch (win : Window) return Key_Code;
function panner_legend (line : Line_Position) return Boolean;
procedure panner_legend (line : Line_Position);
procedure panner_h_cleanup (from_y : Line_Position;
from_x : Column_Position;
to_x : Column_Position);
procedure panner_v_cleanup (from_y : Line_Position;
from_x : Column_Position;
to_y : Line_Position);
procedure panner (pad : Window;
top_xp : Column_Position;
top_yp : Line_Position;
portyp : Line_Position;
portxp : Column_Position;
pgetc : myfunc);
function gettime return timestruct is
retval : timestruct;
use Interfaces.C;
type timeval is record
tv_sec : long;
tv_usec : long;
end record;
pragma Convention (C, timeval);
-- TODO function from_timeval is new Ada.Unchecked_Conversion(
-- timeval_a, System.Storage_Elements.Integer_Address);
-- should Interfaces.C.Pointers be used here?
package myP is new System.Address_To_Access_Conversions (timeval);
use myP;
t : constant Object_Pointer := new timeval;
function gettimeofday
(TP : System.Storage_Elements.Integer_Address;
TZP : System.Storage_Elements.Integer_Address) return int;
pragma Import (C, gettimeofday, "gettimeofday");
tmp : int;
begin
tmp := gettimeofday (System.Storage_Elements.To_Integer
(myP.To_Address (t)),
System.Storage_Elements.To_Integer
(myP.To_Address (null)));
if tmp < 0 then
retval.seconds := 0;
retval.microseconds := 0;
else
retval.seconds := Integer (t.all.tv_sec);
retval.microseconds := Integer (t.all.tv_usec);
end if;
return retval;
end gettime;
-- in C, The behavior of mvhline, mvvline for negative/zero length is
-- unspecified, though we can rely on negative x/y values to stop the
-- macro. Except Ada makes Line_Position(-1) = Natural - 1 so forget it.
procedure do_h_line (y : Line_Position;
x : Column_Position;
c : Attributed_Character;
to : Column_Position) is
begin
if to > x then
Move_Cursor (Line => y, Column => x);
Horizontal_Line (Line_Size => Natural (to - x), Line_Symbol => c);
end if;
end do_h_line;
procedure do_v_line (y : Line_Position;
x : Column_Position;
c : Attributed_Character;
to : Line_Position) is
begin
if to > y then
Move_Cursor (Line => y, Column => x);
Vertical_Line (Line_Size => Natural (to - y), Line_Symbol => c);
end if;
end do_v_line;
function padgetch (win : Window) return Key_Code is
c : Key_Code;
c2 : Character;
begin
c := Getchar (win);
c2 := Code_To_Char (c);
case c2 is
when '!' =>
ShellOut (False);
return Key_Refresh;
when Character'Val (Character'Pos ('r') mod 16#20#) => -- CTRL('r')
End_Windows;
Refresh;
return Key_Refresh;
when Character'Val (Character'Pos ('l') mod 16#20#) => -- CTRL('l')
return Key_Refresh;
when 'U' =>
return Key_Cursor_Up;
when 'D' =>
return Key_Cursor_Down;
when 'R' =>
return Key_Cursor_Right;
when 'L' =>
return Key_Cursor_Left;
when '+' =>
return Key_Insert_Line;
when '-' =>
return Key_Delete_Line;
when '>' =>
return Key_Insert_Char;
when '<' =>
return Key_Delete_Char;
-- when ERR=> /* FALLTHRU */
when 'q' =>
return (Key_Exit);
when others =>
return (c);
end case;
end padgetch;
show_panner_legend : Boolean := True;
function panner_legend (line : Line_Position) return Boolean is
legend : constant array (0 .. 3) of String (1 .. 61) :=
(
"Use arrow keys (or U,D,L,R) to pan, q to quit (?,t,s flags) ",
"Use ! to shell-out. Toggle legend:?, timer:t, scroll mark:s.",
"Use +,- (or j,k) to grow/shrink the panner vertically. ",
"Use <,> (or h,l) to grow/shrink the panner horizontally. ");
legendsize : constant := 4;
n : constant Integer := legendsize - Integer (Lines - line);
begin
if line < Lines and n >= 0 then
Move_Cursor (Line => line, Column => 0);
if show_panner_legend then
Add (Str => legend (n));
end if;
Clear_To_End_Of_Line;
return show_panner_legend;
end if;
return False;
end panner_legend;
procedure panner_legend (line : Line_Position) is
begin
if not panner_legend (line) then
Beep;
end if;
end panner_legend;
procedure panner_h_cleanup (from_y : Line_Position;
from_x : Column_Position;
to_x : Column_Position) is
begin
if not panner_legend (from_y) then
do_h_line (from_y, from_x, Blank2, to_x);
end if;
end panner_h_cleanup;
procedure panner_v_cleanup (from_y : Line_Position;
from_x : Column_Position;
to_y : Line_Position) is
begin
if not panner_legend (from_y) then
do_v_line (from_y, from_x, Blank2, to_y);
end if;
end panner_v_cleanup;
procedure panner (pad : Window;
top_xp : Column_Position;
top_yp : Line_Position;
portyp : Line_Position;
portxp : Column_Position;
pgetc : myfunc) is
function f (y : Line_Position) return Line_Position;
function f (x : Column_Position) return Column_Position;
function greater (y1, y2 : Line_Position) return Integer;
function greater (x1, x2 : Column_Position) return Integer;
top_x : Column_Position := top_xp;
top_y : Line_Position := top_yp;
porty : Line_Position := portyp;
portx : Column_Position := portxp;
-- f[x] returns max[x - 1, 0]
function f (y : Line_Position) return Line_Position is
begin
if y > 0 then
return y - 1;
else
return y; -- 0
end if;
end f;
function f (x : Column_Position) return Column_Position is
begin
if x > 0 then
return x - 1;
else
return x; -- 0
end if;
end f;
function greater (y1, y2 : Line_Position) return Integer is
begin
if y1 > y2 then
return 1;
else
return 0;
end if;
end greater;
function greater (x1, x2 : Column_Position) return Integer is
begin
if x1 > x2 then
return 1;
else
return 0;
end if;
end greater;
pymax : Line_Position;
basey : Line_Position := 0;
pxmax : Column_Position;
basex : Column_Position := 0;
c : Key_Code;
scrollers : Boolean := True;
before, after : timestruct;
timing : Boolean := True;
package floatio is new Ada.Text_IO.Float_IO (Long_Float);
begin
Get_Size (pad, pymax, pxmax);
Allow_Scrolling (Mode => False); -- we don't want stdscr to scroll!
c := Key_Refresh;
loop
-- During shell-out, the user may have resized the window. Adjust
-- the port size of the pad to accommodate this. Ncurses
-- automatically resizes all of the normal windows to fit on the
-- new screen.
if top_x > Columns then
top_x := Columns;
end if;
if portx > Columns then
portx := Columns;
end if;
if top_y > Lines then
top_y := Lines;
end if;
if porty > Lines then
porty := Lines;
end if;
case c is
when Key_Refresh | Character'Pos ('?') =>
if c = Key_Refresh then
Erase;
else -- '?'
show_panner_legend := not show_panner_legend;
end if;
panner_legend (Lines - 4);
panner_legend (Lines - 3);
panner_legend (Lines - 2);
panner_legend (Lines - 1);
when Character'Pos ('t') =>
timing := not timing;
if not timing then
panner_legend (Lines - 1);
end if;
when Character'Pos ('s') =>
scrollers := not scrollers;
-- Move the top-left corner of the pad, keeping the
-- bottom-right corner fixed.
when Character'Pos ('h') =>
-- increase-columns: move left edge to left
if top_x = 0 then
Beep;
else
panner_v_cleanup (top_y, top_x, porty);
top_x := top_x - 1;
end if;
when Character'Pos ('j') =>
-- decrease-lines: move top-edge down
if top_y >= porty then
Beep;
else
if top_y /= 0 then
panner_h_cleanup (top_y - 1, f (top_x), portx);
end if;
top_y := top_y + 1;
end if;
when Character'Pos ('k') =>
-- increase-lines: move top-edge up
if top_y = 0 then
Beep;
else
top_y := top_y - 1;
panner_h_cleanup (top_y, top_x, portx);
end if;
when Character'Pos ('l') =>
-- decrease-columns: move left-edge to right
if top_x >= portx then
Beep;
else
if top_x /= 0 then
panner_v_cleanup (f (top_y), top_x - 1, porty);
end if;
top_x := top_x + 1;
end if;
-- Move the bottom-right corner of the pad, keeping the
-- top-left corner fixed.
when Key_Insert_Char =>
-- increase-columns: move right-edge to right
if portx >= pxmax or portx >= Columns then
Beep;
else
panner_v_cleanup (f (top_y), portx - 1, porty);
portx := portx + 1;
-- C had ++portx instead of portx++, weird.
end if;
when Key_Insert_Line =>
-- increase-lines: move bottom-edge down
if porty >= pymax or porty >= Lines then
Beep;
else
panner_h_cleanup (porty - 1, f (top_x), portx);
porty := porty + 1;
end if;
when Key_Delete_Char =>
-- decrease-columns: move bottom edge up
if portx <= top_x then
Beep;
else
portx := portx - 1;
panner_v_cleanup (f (top_y), portx, porty);
end if;
when Key_Delete_Line =>
-- decrease-lines
if porty <= top_y then
Beep;
else
porty := porty - 1;
panner_h_cleanup (porty, f (top_x), portx);
end if;
when Key_Cursor_Left =>
-- pan leftwards
if basex > 0 then
basex := basex - 1;
else
Beep;
end if;
when Key_Cursor_Right =>
-- pan rightwards
-- if (basex + portx - (pymax > porty) < pxmax)
if basex + portx -
Column_Position (greater (pymax, porty)) < pxmax then
-- if basex + portx < pxmax or
-- (pymax > porty and basex + portx - 1 < pxmax) then
basex := basex + 1;
else
Beep;
end if;
when Key_Cursor_Up =>
-- pan upwards
if basey > 0 then
basey := basey - 1;
else
Beep;
end if;
when Key_Cursor_Down =>
-- pan downwards
-- same as if (basey + porty - (pxmax > portx) < pymax)
if basey + porty -
Line_Position (greater (pxmax, portx)) < pymax then
-- if (basey + porty < pymax) or
-- (pxmax > portx and basey + porty - 1 < pymax) then
basey := basey + 1;
else
Beep;
end if;
when Character'Pos ('H') |
Key_Home |
Key_Find =>
basey := 0;
when Character'Pos ('E') |
Key_End |
Key_Select =>
if pymax < porty then
basey := 0;
else
basey := pymax - porty;
end if;
when others =>
Beep;
end case;
-- more writing off the screen.
-- Interestingly, the exception is not handled if
-- we put a block around this.
-- delcare --begin
if top_y /= 0 and top_x /= 0 then
Add (Line => top_y - 1, Column => top_x - 1,
Ch => ACS_Map (ACS_Upper_Left_Corner));
end if;
if top_x /= 0 then
do_v_line (top_y, top_x - 1, ACS_Map (ACS_Vertical_Line), porty);
end if;
if top_y /= 0 then
do_h_line (top_y - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx);
end if;
-- exception when Curses_Exception => null; end;
-- in C was ... pxmax > portx - 1
if scrollers and pxmax >= portx then
declare
length : constant Column_Position := portx - top_x - 1;
lowend, highend : Column_Position;
begin
-- Instead of using floats, I'll use integers only.
lowend := top_x + (basex * length) / pxmax;
highend := top_x + ((basex + length) * length) / pxmax;
do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line),
lowend);
if highend < portx then
Switch_Character_Attribute
(Attr => (Reverse_Video => True, others => False),
On => True);
do_h_line (porty - 1, lowend, Blank2, highend + 1);
Switch_Character_Attribute
(Attr => (Reverse_Video => True, others => False),
On => False);
do_h_line (porty - 1, highend + 1,
ACS_Map (ACS_Horizontal_Line), portx);
end if;
end;
else
do_h_line (porty - 1, top_x, ACS_Map (ACS_Horizontal_Line), portx);
end if;
if scrollers and pymax >= porty then
declare
length : constant Line_Position := porty - top_y - 1;
lowend, highend : Line_Position;
begin
lowend := top_y + (basey * length) / pymax;
highend := top_y + ((basey + length) * length) / pymax;
do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line),
lowend);
if highend < porty then
Switch_Character_Attribute
(Attr => (Reverse_Video => True, others => False),
On => True);
do_v_line (lowend, portx - 1, Blank2, highend + 1);
Switch_Character_Attribute
(Attr => (Reverse_Video => True, others => False),
On => False);
do_v_line (highend + 1, portx - 1,
ACS_Map (ACS_Vertical_Line), porty);
end if;
end;
else
do_v_line (top_y, portx - 1, ACS_Map (ACS_Vertical_Line), porty);
end if;
if top_y /= 0 then
Add (Line => top_y - 1, Column => portx - 1,
Ch => ACS_Map (ACS_Upper_Right_Corner));
end if;
if top_x /= 0 then
Add (Line => porty - 1, Column => top_x - 1,
Ch => ACS_Map (ACS_Lower_Left_Corner));
end if;
declare
begin
-- Here is another place where it is possible
-- to write to the corner of the screen.
Add (Line => porty - 1, Column => portx - 1,
Ch => ACS_Map (ACS_Lower_Right_Corner));
exception
when Curses_Exception => null;
end;
before := gettime;
Refresh_Without_Update;
declare
-- the C version allows the panel to have a zero height
-- wich raise the exception
begin
Refresh_Without_Update
(
pad,
basey, basex,
top_y, top_x,
porty - Line_Position (greater (pxmax, portx)) - 1,
portx - Column_Position (greater (pymax, porty)) - 1);
exception
when Curses_Exception => null;
end;
Update_Screen;
if timing then
declare
s : String (1 .. 7);
elapsed : Long_Float;
begin
after := gettime;
elapsed := (Long_Float (after.seconds - before.seconds) +
Long_Float (after.microseconds
- before.microseconds)
/ 1.0e6);
Move_Cursor (Line => Lines - 1, Column => Columns - 20);
floatio.Put (s, elapsed, Aft => 3, Exp => 0);
Add (Str => s);
Refresh;
end;
end if;
c := pgetc (pad);
exit when c = Key_Exit;
end loop;
Allow_Scrolling (Mode => True);
end panner;
Gridsize : constant := 3;
Gridcount : Integer := 0;
Pad_High : constant Line_Count := 200;
Pad_Wide : constant Column_Count := 200;
panpad : Window := New_Pad (Pad_High, Pad_Wide);
begin
if panpad = Null_Window then
Cannot ("cannot create requested pad");
return;
end if;
for i in 0 .. Pad_High - 1 loop
for j in 0 .. Pad_Wide - 1 loop
if i mod Gridsize = 0 and j mod Gridsize = 0 then
if i = 0 or j = 0 then
Add (panpad, '+');
else
-- depends on ASCII?
Add (panpad,
Ch => Character'Val (Character'Pos ('A') +
Gridcount mod 26));
Gridcount := Gridcount + 1;
end if;
elsif i mod Gridsize = 0 then
Add (panpad, '-');
elsif j mod Gridsize = 0 then
Add (panpad, '|');
else
declare
-- handle the write to the lower right corner error
begin
Add (panpad, ' ');
exception
when Curses_Exception => null;
end;
end if;
end loop;
end loop;
panner_legend (Lines - 4);
panner_legend (Lines - 3);
panner_legend (Lines - 2);
panner_legend (Lines - 1);
Set_KeyPad_Mode (panpad, True);
-- Make the pad (initially) narrow enough that a trace file won't wrap.
-- We'll still be able to widen it during a test, since that's required
-- for testing boundaries.
panner (panpad, 2, 2, Lines - 5, Columns - 15, padgetch'Access);
Delete (panpad);
End_Windows; -- Hmm, Erase after End_Windows
Erase;
end ncurses2.demo_pad;
AdaCurses-20140726/samples/sample-text_io_demo.adb 0000644 0001751 0000144 00000016160 11542241134 020425 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Text_IO_Demo --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.17 $
-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Numerics.Generic_Elementary_Functions;
with Ada.Numerics.Complex_Types;
use Ada.Numerics.Complex_Types;
with Terminal_Interface.Curses;
use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels;
use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Text_IO;
use Terminal_Interface.Curses.Text_IO;
with Terminal_Interface.Curses.Text_IO.Integer_IO;
with Terminal_Interface.Curses.Text_IO.Float_IO;
with Terminal_Interface.Curses.Text_IO.Enumeration_IO;
with Terminal_Interface.Curses.Text_IO.Complex_IO;
with Terminal_Interface.Curses.Text_IO.Fixed_IO;
with Terminal_Interface.Curses.Text_IO.Decimal_IO;
with Terminal_Interface.Curses.Text_IO.Modular_IO;
with Sample.Manifest; use Sample.Manifest;
with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Keyboard_Handler; use Sample.Keyboard_Handler;
with Sample.Explanation; use Sample.Explanation;
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Complex_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Decimal_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Enumeration_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Fixed_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Float_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Integer_IO);
pragma Elaborate_All (Terminal_Interface.Curses.Text_Io.Modular_IO);
package body Sample.Text_IO_Demo is
type Weekday is (Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday);
type Fix is delta 0.1 range 0.0 .. 4.0;
type Dec is delta 0.01 digits 5 range 0.0 .. 4.0;
type Md is mod 5;
package Math is new
Ada.Numerics.Generic_Elementary_Functions (Float);
package Int_IO is new
Terminal_Interface.Curses.Text_IO.Integer_IO (Integer);
use Int_IO;
package Real_IO is new
Terminal_Interface.Curses.Text_IO.Float_IO (Float);
use Real_IO;
package Enum_IO is new
Terminal_Interface.Curses.Text_IO.Enumeration_IO (Weekday);
use Enum_IO;
package C_IO is new
Terminal_Interface.Curses.Text_IO.Complex_IO (Ada.Numerics.Complex_Types);
use C_IO;
package F_IO is new
Terminal_Interface.Curses.Text_IO.Fixed_IO (Fix);
use F_IO;
package D_IO is new
Terminal_Interface.Curses.Text_IO.Decimal_IO (Dec);
use D_IO;
package M_IO is new
Terminal_Interface.Curses.Text_IO.Modular_IO (Md);
use M_IO;
procedure Demo
is
W : Window;
P : Panel := Create (Standard_Window);
K : Real_Key_Code;
Im : constant Complex := (0.0, 1.0);
Fx : constant Dec := 3.14;
Dc : constant Dec := 2.72;
L : Md;
begin
Push_Environment ("TEXTIO");
Default_Labels;
Notepad ("TEXTIO-PAD00");
Set_Echo_Mode (False);
Set_Meta_Mode;
Set_KeyPad_Mode;
W := Sub_Window (Standard_Window, Lines - 2, Columns - 2, 1, 1);
Box;
Refresh_Without_Update;
Set_Meta_Mode (W);
Set_KeyPad_Mode (W);
Immediate_Update_Mode (W, True);
Set_Window (W);
for I in 1 .. 10 loop
Put ("Square root of ");
Put (Item => I, Width => 5);
Put (" is ");
Put (Item => Math.Sqrt (Float (I)), Exp => 0, Aft => 7);
New_Line;
end loop;
for W in Weekday loop
Put (Item => W); Put (' ');
end loop;
New_Line;
L := Md'First;
for I in 1 .. 2 loop
for J in Md'Range loop
Put (L); Put (' ');
L := L + 1;
end loop;
end loop;
New_Line;
Put (Im); New_Line;
Put (Fx); New_Line;
Put (Dc); New_Line;
loop
K := Get_Key;
if K in Special_Key_Code'Range then
case K is
when QUIT_CODE => exit;
when HELP_CODE => Explain_Context;
when EXPLAIN_CODE => Explain ("TEXTIOKEYS");
when others => null;
end case;
end if;
end loop;
Set_Window (Null_Window);
Erase; Refresh_Without_Update;
Delete (P);
Delete (W);
Pop_Environment;
end Demo;
end Sample.Text_IO_Demo;
AdaCurses-20140726/samples/sample-curses_demo-mouse.ads 0000644 0001751 0000144 00000005731 07746514446 021453 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Curses_Demo.Mouse --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Curses_Demo.Mouse is
procedure Demo;
end Sample.Curses_Demo.Mouse;
AdaCurses-20140726/samples/sample-header_handler.ads 0000644 0001751 0000144 00000006367 07746514446 020750 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Header_Handler --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-- This package handles the painting of the header line of the screen.
--
package Sample.Header_Handler is
procedure Init_Header_Handler;
-- Initialize the handler for the headerlines.
procedure Update_Header_Window;
-- Update the information in the header window
end Sample.Header_Handler;
AdaCurses-20140726/samples/ncurses2-menu_test.ads 0000644 0001751 0000144 00000005672 07212274050 020265 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.menu_test;
AdaCurses-20140726/samples/ncurses2-color_edit.adb 0000644 0001751 0000144 00000024174 11315445062 020364 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2009 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.6 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with ncurses2.genericPuts;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
procedure ncurses2.color_edit is
use Int_IO;
type RGB_Enum is (Redx, Greenx, Bluex);
procedure change_color (current : Color_Number;
field : RGB_Enum;
value : RGB_Value;
usebase : Boolean);
procedure change_color (current : Color_Number;
field : RGB_Enum;
value : RGB_Value;
usebase : Boolean) is
red, green, blue : RGB_Value;
begin
if usebase then
Color_Content (current, red, green, blue);
else
red := 0;
green := 0;
blue := 0;
end if;
case field is
when Redx => red := red + value;
when Greenx => green := green + value;
when Bluex => blue := blue + value;
end case;
declare
begin
Init_Color (current, red, green, blue);
exception
when Curses_Exception => Beep;
end;
end change_color;
package x is new ncurses2.genericPuts (100); use x;
tmpb : x.BS.Bounded_String;
tmp4 : String (1 .. 4);
tmp6 : String (1 .. 6);
tmp8 : String (1 .. 8);
-- This would be easier if Ada had a Bounded_String
-- defined as a class instead of the inferior generic package,
-- then I could define Put, Add, and Get for them. Blech.
value : RGB_Value := 0;
red, green, blue : RGB_Value;
max_colors : constant Natural := Number_Of_Colors;
current : Color_Number := 0;
field : RGB_Enum := Redx;
this_c : Key_Code := 0;
begin
Refresh;
for i in Color_Number'(0) .. Color_Number (Number_Of_Colors) loop
Init_Pair (Color_Pair (i), White, i);
end loop;
Move_Cursor (Line => Lines - 2, Column => 0);
Add (Str => "Number: ");
myPut (tmpb, Integer (value));
myAdd (Str => tmpb);
loop
Switch_Character_Attribute (On => False,
Attr => (Bold_Character => True,
others => False));
Add (Line => 0, Column => 20, Str => "Color RGB Value Editing");
Switch_Character_Attribute (On => False,
Attr => (Bold_Character => True,
others => False));
for i in Color_Number'(0) .. Color_Number (Number_Of_Colors) loop
Move_Cursor (Line => 2 + Line_Position (i), Column => 0);
if current = i then
Add (Ch => '>');
else
Add (Ch => ' ');
end if;
-- TODO if i <= color_names'Max then
Put (tmp8, Integer (i));
Set_Character_Attributes (Color => Color_Pair (i));
Add (Str => " ");
Set_Character_Attributes;
Refresh;
Color_Content (i, red, green, blue);
Add (Str => " R = ");
if current = i and field = Redx then
Switch_Character_Attribute (On => True,
Attr => (Stand_Out => True,
others => False));
end if;
Put (tmp4, Integer (red));
Add (Str => tmp4);
if current = i and field = Redx then
Set_Character_Attributes;
end if;
Add (Str => " G = ");
if current = i and field = Greenx then
Switch_Character_Attribute (On => True,
Attr => (Stand_Out => True,
others => False));
end if;
Put (tmp4, Integer (green));
Add (Str => tmp4);
if current = i and field = Greenx then
Set_Character_Attributes;
end if;
Add (Str => " B = ");
if current = i and field = Bluex then
Switch_Character_Attribute (On => True,
Attr => (Stand_Out => True,
others => False));
end if;
Put (tmp4, Integer (blue));
Add (Str => tmp4);
if current = i and field = Bluex then
Set_Character_Attributes;
end if;
Set_Character_Attributes;
Add (Ch => ')');
end loop;
Add (Line => Line_Position (Number_Of_Colors + 3), Column => 0,
Str => "Use up/down to select a color, left/right to change " &
"fields.");
Add (Line => Line_Position (Number_Of_Colors + 4), Column => 0,
Str => "Modify field by typing nnn=, nnn-, or nnn+. ? for help.");
Move_Cursor (Line => 2 + Line_Position (current), Column => 0);
this_c := Getchar;
if Is_Digit (this_c) then
value := 0;
end if;
case this_c is
when KEY_UP =>
current := (current - 1) mod Color_Number (max_colors);
when KEY_DOWN =>
current := (current + 1) mod Color_Number (max_colors);
when KEY_RIGHT =>
field := RGB_Enum'Val ((RGB_Enum'Pos (field) + 1) mod 3);
when KEY_LEFT =>
field := RGB_Enum'Val ((RGB_Enum'Pos (field) - 1) mod 3);
when
Character'Pos ('0') |
Character'Pos ('1') |
Character'Pos ('2') |
Character'Pos ('3') |
Character'Pos ('4') |
Character'Pos ('5') |
Character'Pos ('6') |
Character'Pos ('7') |
Character'Pos ('8') |
Character'Pos ('9') =>
value := value * 10 + RGB_Value (ctoi (Code_To_Char (this_c)));
when Character'Pos ('+') =>
change_color (current, field, value, True);
when Character'Pos ('-') =>
change_color (current, field, -value, True);
when Character'Pos ('=') =>
change_color (current, field, value, False);
when Character'Pos ('?') =>
Erase;
P (" RGB Value Editing Help");
P ("");
P ("You are in the RGB value editor. Use the arrow keys to " &
"select one of");
P ("the fields in one of the RGB triples of the current colors;" &
" the one");
P ("currently selected will be reverse-video highlighted.");
P ("");
P ("To change a field, enter the digits of the new value; they" &
" are echoed");
P ("as entered. Finish by typing `='. The change will take" &
" effect instantly.");
P ("To increment or decrement a value, use the same procedure," &
" but finish");
P ("with a `+' or `-'.");
P ("");
P ("To quit, do `x' or 'q'");
Pause;
Erase;
when Character'Pos ('q') |
Character'Pos ('x') =>
null;
when others =>
Beep;
end case;
Move_Cursor (Line => Lines - 2, Column => 0);
Put (tmp6, Integer (value));
Add (Str => "Number: " & tmp6);
Clear_To_End_Of_Line;
exit when this_c = Character'Pos ('x') or
this_c = Character'Pos ('q');
end loop;
Erase;
End_Windows;
end ncurses2.color_edit;
AdaCurses-20140726/samples/sample-keyboard_handler.adb 0000644 0001751 0000144 00000020076 11542240020 021235 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Keyboard_Handler --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.16 $
-- $Date: 2011/03/23 00:34:24 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Strings; use Ada.Strings;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Strings.Maps.Constants; use Ada.Strings.Maps.Constants;
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
with Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
use Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
with Sample.Header_Handler; use Sample.Header_Handler;
with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux;
with Sample.Manifest; use Sample.Manifest;
with Sample.Form_Demo.Handler;
-- This package contains a centralized keyboard handler used throughout
-- this example. The handler establishes a timeout mechanism that provides
-- periodical updates of the common header lines used in this example.
--
package body Sample.Keyboard_Handler is
In_Command : Boolean := False;
function Get_Key (Win : Window := Standard_Window) return Real_Key_Code
is
K : Real_Key_Code;
function Command return Real_Key_Code;
function Command return Real_Key_Code
is
function My_Driver (F : Form;
C : Key_Code;
P : Panel) return Boolean;
package Fh is new Sample.Form_Demo.Handler (My_Driver);
type Label_Array is array (Label_Number) of String (1 .. 8);
Labels : Label_Array;
FA : Field_Array_Access := new Field_Array'
(Make (0, 0, "Command:"),
Make (Top => 0, Left => 9, Width => Columns - 11),
Null_Field);
K : Real_Key_Code := Key_None;
N : Natural := 0;
function My_Driver (F : Form;
C : Key_Code;
P : Panel) return Boolean
is
Ch : Character;
begin
if P = Null_Panel then
raise Panel_Exception;
end if;
if C in User_Key_Code'Range and then C = QUIT then
if Driver (F, F_Validate_Field) = Form_Ok then
K := Key_None;
return True;
end if;
elsif C in Normal_Key_Code'Range then
Ch := Character'Val (C);
if Ch = LF or else Ch = CR then
if Driver (F, F_Validate_Field) = Form_Ok then
declare
Buffer : String (1 .. Positive (Columns - 11));
Cmdc : String (1 .. 8);
begin
Get_Buffer (Fld => FA.all (2), Str => Buffer);
Trim (Buffer, Left);
if Buffer (1) /= ' ' then
Cmdc := To_Upper (Buffer (Cmdc'Range));
for I in Labels'Range loop
if Cmdc = Labels (I) then
K := Function_Key_Code
(Function_Key_Number (I));
exit;
end if;
end loop;
end if;
return True;
end;
end if;
end if;
end if;
return False;
end My_Driver;
begin
In_Command := True;
for I in Label_Number'Range loop
Get_Soft_Label_Key (I, Labels (I));
Trim (Labels (I), Left);
Translate (Labels (I), Upper_Case_Map);
if Labels (I) (1) /= ' ' then
N := N + 1;
end if;
end loop;
if N > 0 then -- some labels were really set
declare
Enum_Info : Enumeration_Info (N);
Enum_Field : Enumeration_Field;
J : Positive := Enum_Info.Names'First;
Frm : Form := Create (FA);
begin
for I in Label_Number'Range loop
if Labels (I) (1) /= ' ' then
Enum_Info.Names (J) := new String'(Labels (I));
J := J + 1;
end if;
end loop;
Enum_Field := Create (Enum_Info, True);
Set_Field_Type (FA.all (2), Enum_Field);
Set_Background (FA.all (2), Normal_Video);
Fh.Drive_Me (Frm, Lines - 3, 0);
Delete (Frm);
Update_Panels; Update_Screen;
end;
end if;
Free (FA, True);
In_Command := False;
return K;
end Command;
begin
Set_Timeout_Mode (Win, Delayed, 30000);
loop
K := Get_Keystroke (Win);
if K = Key_None then -- a timeout occurred
Update_Header_Window;
elsif K = 3 and then not In_Command then -- CTRL-C
K := Command;
exit when K /= Key_None;
else
exit;
end if;
end loop;
return K;
end Get_Key;
procedure Init_Keyboard_Handler is
begin
null;
end Init_Keyboard_Handler;
end Sample.Keyboard_Handler;
AdaCurses-20140726/samples/sample-function_key_setting.ads 0000644 0001751 0000144 00000010775 11541117303 022226 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Function_Key_Setting --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
-- This package implements a simple stack of function key label environments.
--
package Sample.Function_Key_Setting is
procedure Push_Environment (Key : String;
Reset : Boolean := True);
-- Push the definition of the current function keys on an internal
-- stack. If the reset flag is true, all labels are reset while
-- pushed, so the new environment can assume a tabula rasa.
-- The Key defines the new Help Context associated with the new
-- Environment. This saves also the currently active Notepad.
procedure Pop_Environment;
-- Pop the Definitions from the stack and make them the current ones.
-- This also restores the Help context and the previous Notepad.
procedure Initialize (Mode : Soft_Label_Key_Format := PC_Style;
Just : Label_Justification := Left);
-- Initialize the environment
function Context return String;
-- Return the current context identifier
function Find_Context (Key : String) return Boolean;
-- Look for a context, return true if it is in the stack,
-- false otherwise.
procedure Notepad_To_Context (Pan : Panel);
-- Add a panel representing a notepad to the current context.
Function_Key_Stack_Error : exception;
procedure Default_Labels;
-- Set the default labels used in all environments
function Notepad_Window return Window;
-- Return the current notepad window or Null_Window if there is none.
end Sample.Function_Key_Setting;
AdaCurses-20140726/samples/ncurses2-genericputs.ads 0000644 0001751 0000144 00000007720 11315445062 020610 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2009 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.3 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Bounded;
use Ada.Strings.Bounded;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Terminal_Interface.Curses;
generic
Max : Natural;
-- type mystring is private;
-- type myint is
package ncurses2.genericPuts is
package BS is new
Ada.Strings.Bounded.Generic_Bounded_Length (Max);
use BS;
procedure myGet (Win : Terminal_Interface.Curses.Window
:= Terminal_Interface.Curses.Standard_Window;
Str : out BS.Bounded_String;
Len : Integer := -1);
procedure myPut (Str : out BS.Bounded_String;
i : Integer;
Base : Number_Base := 10);
-- the default should be Ada.Text_IO.Integer_IO.Default_Base
-- but Default_Base is hidden in the generic so doesn't exist!
procedure myAdd (Str : BS.Bounded_String);
procedure Fill_String (Cp : chars_ptr; Str : out BS.Bounded_String);
end ncurses2.genericPuts;
AdaCurses-20140726/samples/ncurses2-flushinp_test.ads 0000644 0001751 0000144 00000006010 07212274112 021133 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses;
procedure ncurses2.flushinp_test (win : Terminal_Interface.Curses.Window);
AdaCurses-20140726/samples/ncurses2-getch_test.ads 0000644 0001751 0000144 00000005673 07212274046 020421 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.getch_test;
AdaCurses-20140726/samples/rain.ads 0000644 0001751 0000144 00000006024 07746514446 015463 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Rain --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Laurent Pautet
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
-- $Revision: 1.6 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- --
procedure Rain;
AdaCurses-20140726/samples/sample-menu_demo.adb 0000644 0001751 0000144 00000035006 11542241134 017716 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Menu_Demo --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2008,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.19 $
-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
with Terminal_Interface.Curses.Menus.Menu_User_Data;
with Terminal_Interface.Curses.Menus.Item_User_Data;
with Sample.Manifest; use Sample.Manifest;
with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Menu_Demo.Handler;
with Sample.Helpers; use Sample.Helpers;
with Sample.Explanation; use Sample.Explanation;
package body Sample.Menu_Demo is
package Spacing_Demo is
procedure Spacing_Test;
end Spacing_Demo;
package body Spacing_Demo is
procedure Spacing_Test
is
function My_Driver (M : Menu;
K : Key_Code;
P : Panel) return Boolean;
procedure Set_Option_Key;
procedure Set_Select_Key;
procedure Set_Description_Key;
procedure Set_Hide_Key;
package Mh is new Sample.Menu_Demo.Handler (My_Driver);
I : Item_Array_Access := new Item_Array'
(New_Item ("January", "31 Days"),
New_Item ("February", "28/29 Days"),
New_Item ("March", "31 Days"),
New_Item ("April", "30 Days"),
New_Item ("May", "31 Days"),
New_Item ("June", "30 Days"),
New_Item ("July", "31 Days"),
New_Item ("August", "31 Days"),
New_Item ("September", "30 Days"),
New_Item ("October", "31 Days"),
New_Item ("November", "30 Days"),
New_Item ("December", "31 Days"),
Null_Item);
M : Menu := New_Menu (I);
Flip_State : Boolean := True;
Hide_Long : Boolean := False;
type Format_Code is (Four_By_1, Four_By_2, Four_By_3);
type Operations is (Flip, Reorder, Reformat, Reselect, Describe);
type Change is array (Operations) of Boolean;
pragma Pack (Change);
No_Change : constant Change := Change'(others => False);
Current_Format : Format_Code := Four_By_1;
To_Change : Change := No_Change;
function My_Driver (M : Menu;
K : Key_Code;
P : Panel) return Boolean
is
begin
if M = Null_Menu then
raise Menu_Exception;
end if;
if P = Null_Panel then
raise Panel_Exception;
end if;
To_Change := No_Change;
if K in User_Key_Code'Range then
if K = QUIT then
return True;
end if;
end if;
if K in Special_Key_Code'Range then
case K is
when Key_F4 =>
To_Change (Flip) := True;
return True;
when Key_F5 =>
To_Change (Reformat) := True;
Current_Format := Four_By_1;
return True;
when Key_F6 =>
To_Change (Reformat) := True;
Current_Format := Four_By_2;
return True;
when Key_F7 =>
To_Change (Reformat) := True;
Current_Format := Four_By_3;
return True;
when Key_F8 =>
To_Change (Reorder) := True;
return True;
when Key_F9 =>
To_Change (Reselect) := True;
return True;
when Key_F10 =>
if Current_Format /= Four_By_3 then
To_Change (Describe) := True;
return True;
else
return False;
end if;
when Key_F11 =>
Hide_Long := not Hide_Long;
declare
O : Item_Option_Set;
begin
for J in I'Range loop
Get_Options (I.all (J), O);
O.Selectable := True;
if Hide_Long then
case J is
when 1 | 3 | 5 | 7 | 8 | 10 | 12 =>
O.Selectable := False;
when others => null;
end case;
end if;
Set_Options (I.all (J), O);
end loop;
end;
return False;
when others => null;
end case;
end if;
return False;
end My_Driver;
procedure Set_Option_Key
is
O : Menu_Option_Set;
begin
if Current_Format = Four_By_1 then
Set_Soft_Label_Key (8, "");
else
Get_Options (M, O);
if O.Row_Major_Order then
Set_Soft_Label_Key (8, "O-Col");
else
Set_Soft_Label_Key (8, "O-Row");
end if;
end if;
Refresh_Soft_Label_Keys_Without_Update;
end Set_Option_Key;
procedure Set_Select_Key
is
O : Menu_Option_Set;
begin
Get_Options (M, O);
if O.One_Valued then
Set_Soft_Label_Key (9, "Multi");
else
Set_Soft_Label_Key (9, "Singl");
end if;
Refresh_Soft_Label_Keys_Without_Update;
end Set_Select_Key;
procedure Set_Description_Key
is
O : Menu_Option_Set;
begin
if Current_Format = Four_By_3 then
Set_Soft_Label_Key (10, "");
else
Get_Options (M, O);
if O.Show_Descriptions then
Set_Soft_Label_Key (10, "-Desc");
else
Set_Soft_Label_Key (10, "+Desc");
end if;
end if;
Refresh_Soft_Label_Keys_Without_Update;
end Set_Description_Key;
procedure Set_Hide_Key
is
begin
if Hide_Long then
Set_Soft_Label_Key (11, "Enab");
else
Set_Soft_Label_Key (11, "Disab");
end if;
Refresh_Soft_Label_Keys_Without_Update;
end Set_Hide_Key;
begin
Push_Environment ("MENU01");
Notepad ("MENU-PAD01");
Default_Labels;
Set_Soft_Label_Key (4, "Flip");
Set_Soft_Label_Key (5, "4x1");
Set_Soft_Label_Key (6, "4x2");
Set_Soft_Label_Key (7, "4x3");
Set_Option_Key;
Set_Select_Key;
Set_Description_Key;
Set_Hide_Key;
Set_Format (M, 4, 1);
loop
Mh.Drive_Me (M);
exit when To_Change = No_Change;
if To_Change (Flip) then
if Flip_State then
Flip_State := False;
Set_Spacing (M, 3, 2, 0);
else
Flip_State := True;
Set_Spacing (M);
end if;
elsif To_Change (Reformat) then
case Current_Format is
when Four_By_1 => Set_Format (M, 4, 1);
when Four_By_2 => Set_Format (M, 4, 2);
when Four_By_3 =>
declare
O : Menu_Option_Set;
begin
Get_Options (M, O);
O.Show_Descriptions := False;
Set_Options (M, O);
Set_Format (M, 4, 3);
end;
end case;
Set_Option_Key;
Set_Description_Key;
elsif To_Change (Reorder) then
declare
O : Menu_Option_Set;
begin
Get_Options (M, O);
O.Row_Major_Order := not O.Row_Major_Order;
Set_Options (M, O);
Set_Option_Key;
end;
elsif To_Change (Reselect) then
declare
O : Menu_Option_Set;
begin
Get_Options (M, O);
O.One_Valued := not O.One_Valued;
Set_Options (M, O);
Set_Select_Key;
end;
elsif To_Change (Describe) then
declare
O : Menu_Option_Set;
begin
Get_Options (M, O);
O.Show_Descriptions := not O.Show_Descriptions;
Set_Options (M, O);
Set_Description_Key;
end;
else
null;
end if;
end loop;
Set_Spacing (M);
Pop_Environment;
pragma Assert (Get_Index (Items (M, 1)) = Get_Index (I (1)));
Delete (M);
Free (I, True);
end Spacing_Test;
end Spacing_Demo;
procedure Demo
is
-- We use this datatype only to test the instantiation of
-- the Menu_User_Data generic package. No functionality
-- behind it.
type User_Data is new Integer;
type User_Data_Access is access User_Data;
-- Those packages are only instantiated to test the usability.
-- No real functionality is shown in the demo.
package MUD is new Menu_User_Data (User_Data, User_Data_Access);
package IUD is new Item_User_Data (User_Data, User_Data_Access);
function My_Driver (M : Menu;
K : Key_Code;
P : Panel) return Boolean;
package Mh is new Sample.Menu_Demo.Handler (My_Driver);
Itm : Item_Array_Access := new Item_Array'
(New_Item ("Menu Layout Options"),
New_Item ("Demo of Hook functions"),
Null_Item);
M : Menu := New_Menu (Itm);
U1 : constant User_Data_Access := new User_Data'(4711);
U2 : User_Data_Access;
U3 : constant User_Data_Access := new User_Data'(4712);
U4 : User_Data_Access;
function My_Driver (M : Menu;
K : Key_Code;
P : Panel) return Boolean
is
Idx : constant Positive := Get_Index (Current (M));
begin
if K in User_Key_Code'Range then
if K = QUIT then
return True;
elsif K = SELECT_ITEM then
if Idx in Itm'Range then
Hide (P);
Update_Panels;
end if;
case Idx is
when 1 => Spacing_Demo.Spacing_Test;
when others => Not_Implemented;
end case;
if Idx in Itm'Range then
Top (P);
Show (P);
Update_Panels;
Update_Screen;
end if;
end if;
end if;
return False;
end My_Driver;
begin
Push_Environment ("MENU00");
Notepad ("MENU-PAD00");
Default_Labels;
Refresh_Soft_Label_Keys_Without_Update;
Set_Pad_Character (M, '|');
MUD.Set_User_Data (M, U1);
IUD.Set_User_Data (Itm.all (1), U3);
Mh.Drive_Me (M);
MUD.Get_User_Data (M, U2);
pragma Assert (U1 = U2 and U1.all = 4711);
IUD.Get_User_Data (Itm.all (1), U4);
pragma Assert (U3 = U4 and U3.all = 4712);
Pop_Environment;
Delete (M);
Free (Itm, True);
end Demo;
end Sample.Menu_Demo;
AdaCurses-20140726/samples/sample-menu_demo-handler.ads 0000644 0001751 0000144 00000007232 11315445604 021360 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Menu_Demo.Handler --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses;
use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels;
use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Menus;
use Terminal_Interface.Curses.Menus;
generic
with function My_Driver (Men : Menu;
K : Key_Code;
Pan : Panel) return Boolean;
package Sample.Menu_Demo.Handler is
procedure Drive_Me (M : Menu;
Lin : Line_Position;
Col : Column_Position;
Title : String := "");
-- Position the menu at the given point and drive it.
procedure Drive_Me (M : Menu;
Title : String := "");
-- Center menu and drive it.
end Sample.Menu_Demo.Handler;
AdaCurses-20140726/samples/ncurses2-demo_forms.adb 0000644 0001751 0000144 00000041561 11542241134 020366 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2011 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.6 $
-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
with Terminal_Interface.Curses.Forms.Field_User_Data;
with Ada.Characters.Handling;
with Ada.Strings;
with Ada.Strings.Bounded;
procedure ncurses2.demo_forms is
package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (80);
type myptr is access Integer;
-- The C version stores a pointer in the userptr and
-- converts it into a long integer.
-- The correct, but inconvenient way to do it is to use a
-- pointer to long and keep the pointer constant.
-- It just adds one memory piece to allocate and deallocate (not done here)
package StringData is new
Terminal_Interface.Curses.Forms.Field_User_Data (Integer, myptr);
function edit_secure (me : Field; c_in : Key_Code) return Key_Code;
function form_virtualize (f : Form; w : Window) return Key_Code;
function my_form_driver (f : Form; c : Key_Code) return Boolean;
function make_label (frow : Line_Position;
fcol : Column_Position;
label : String) return Field;
function make_field (frow : Line_Position;
fcol : Column_Position;
rows : Line_Count;
cols : Column_Count;
secure : Boolean) return Field;
procedure display_form (f : Form);
procedure erase_form (f : Form);
-- prints '*' instead of characters.
-- Not that this keeps a bug from the C version:
-- type in the psasword field then move off and back.
-- the cursor is at position one, but
-- this assumes it as at the end so text gets appended instead
-- of overwtitting.
function edit_secure (me : Field; c_in : Key_Code) return Key_Code is
rows, frow : Line_Position;
nrow : Natural;
cols, fcol : Column_Position;
nbuf : Buffer_Number;
c : Key_Code := c_in;
c2 : Character;
use StringData;
begin
Info (me, rows, cols, frow, fcol, nrow, nbuf);
-- TODO if result = Form_Ok and nbuf > 0 then
-- C version checked the return value
-- of Info, the Ada binding throws an exception I think.
if nbuf > 0 then
declare
temp : BS.Bounded_String;
temps : String (1 .. 10);
-- TODO Get_Buffer povides no information on the field length?
len : myptr;
begin
Get_Buffer (me, 1, Str => temps);
-- strcpy(temp, field_buffer(me, 1));
Get_User_Data (me, len);
temp := BS.To_Bounded_String (temps (1 .. len.all));
if c <= Key_Max then
c2 := Code_To_Char (c);
if Ada.Characters.Handling.Is_Graphic (c2) then
BS.Append (temp, c2);
len.all := len.all + 1;
Set_Buffer (me, 1, BS.To_String (temp));
c := Character'Pos ('*');
else
c := 0;
end if;
else
case c is
when REQ_BEG_FIELD |
REQ_CLR_EOF |
REQ_CLR_EOL |
REQ_DEL_LINE |
REQ_DEL_WORD |
REQ_DOWN_CHAR |
REQ_END_FIELD |
REQ_INS_CHAR |
REQ_INS_LINE |
REQ_LEFT_CHAR |
REQ_NEW_LINE |
REQ_NEXT_WORD |
REQ_PREV_WORD |
REQ_RIGHT_CHAR |
REQ_UP_CHAR =>
c := 0; -- we don't want to do inline editing
when REQ_CLR_FIELD =>
if len.all /= 0 then
temp := BS.To_Bounded_String ("");
Set_Buffer (me, 1, BS.To_String (temp));
len.all := 0;
end if;
when REQ_DEL_CHAR |
REQ_DEL_PREV =>
if len.all /= 0 then
BS.Delete (temp, BS.Length (temp), BS.Length (temp));
Set_Buffer (me, 1, BS.To_String (temp));
len.all := len.all - 1;
end if;
when others => null;
end case;
end if;
end;
end if;
return c;
end edit_secure;
mode : Key_Code := REQ_INS_MODE;
function form_virtualize (f : Form; w : Window) return Key_Code is
type lookup_t is record
code : Key_Code;
result : Key_Code;
-- should be Form_Request_Code, but we need MAX_COMMAND + 1
end record;
lookup : constant array (Positive range <>) of lookup_t :=
(
(
Character'Pos ('A') mod 16#20#, REQ_NEXT_CHOICE
),
(
Character'Pos ('B') mod 16#20#, REQ_PREV_WORD
),
(
Character'Pos ('C') mod 16#20#, REQ_CLR_EOL
),
(
Character'Pos ('D') mod 16#20#, REQ_DOWN_FIELD
),
(
Character'Pos ('E') mod 16#20#, REQ_END_FIELD
),
(
Character'Pos ('F') mod 16#20#, REQ_NEXT_PAGE
),
(
Character'Pos ('G') mod 16#20#, REQ_DEL_WORD
),
(
Character'Pos ('H') mod 16#20#, REQ_DEL_PREV
),
(
Character'Pos ('I') mod 16#20#, REQ_INS_CHAR
),
(
Character'Pos ('K') mod 16#20#, REQ_CLR_EOF
),
(
Character'Pos ('L') mod 16#20#, REQ_LEFT_FIELD
),
(
Character'Pos ('M') mod 16#20#, REQ_NEW_LINE
),
(
Character'Pos ('N') mod 16#20#, REQ_NEXT_FIELD
),
(
Character'Pos ('O') mod 16#20#, REQ_INS_LINE
),
(
Character'Pos ('P') mod 16#20#, REQ_PREV_FIELD
),
(
Character'Pos ('R') mod 16#20#, REQ_RIGHT_FIELD
),
(
Character'Pos ('S') mod 16#20#, REQ_BEG_FIELD
),
(
Character'Pos ('U') mod 16#20#, REQ_UP_FIELD
),
(
Character'Pos ('V') mod 16#20#, REQ_DEL_CHAR
),
(
Character'Pos ('W') mod 16#20#, REQ_NEXT_WORD
),
(
Character'Pos ('X') mod 16#20#, REQ_CLR_FIELD
),
(
Character'Pos ('Y') mod 16#20#, REQ_DEL_LINE
),
(
Character'Pos ('Z') mod 16#20#, REQ_PREV_CHOICE
),
(
Character'Pos ('[') mod 16#20#, -- ESCAPE
Form_Request_Code'Last + 1
),
(
Key_Backspace, REQ_DEL_PREV
),
(
KEY_DOWN, REQ_DOWN_CHAR
),
(
Key_End, REQ_LAST_FIELD
),
(
Key_Home, REQ_FIRST_FIELD
),
(
KEY_LEFT, REQ_LEFT_CHAR
),
(
KEY_LL, REQ_LAST_FIELD
),
(
Key_Next, REQ_NEXT_FIELD
),
(
KEY_NPAGE, REQ_NEXT_PAGE
),
(
KEY_PPAGE, REQ_PREV_PAGE
),
(
Key_Previous, REQ_PREV_FIELD
),
(
KEY_RIGHT, REQ_RIGHT_CHAR
),
(
KEY_UP, REQ_UP_CHAR
),
(
Character'Pos ('Q') mod 16#20#, -- QUIT
Form_Request_Code'Last + 1 -- TODO MAX_FORM_COMMAND + 1
)
);
c : Key_Code := Getchar (w);
me : constant Field := Current (f);
begin
if c = Character'Pos (']') mod 16#20# then
if mode = REQ_INS_MODE then
mode := REQ_OVL_MODE;
else
mode := REQ_INS_MODE;
end if;
c := mode;
else
for n in lookup'Range loop
if lookup (n).code = c then
c := lookup (n).result;
exit;
end if;
end loop;
end if;
-- Force the field that the user is typing into to be in reverse video,
-- while the other fields are shown underlined.
if c <= Key_Max then
c := edit_secure (me, c);
Set_Background (me, (Reverse_Video => True, others => False));
elsif c <= Form_Request_Code'Last then
c := edit_secure (me, c);
Set_Background (me, (Under_Line => True, others => False));
end if;
return c;
end form_virtualize;
function my_form_driver (f : Form; c : Key_Code) return Boolean is
flag : constant Driver_Result := Driver (f, F_Validate_Field);
begin
if c = Form_Request_Code'Last + 1
and flag = Form_Ok then
return True;
else
Beep;
return False;
end if;
end my_form_driver;
function make_label (frow : Line_Position;
fcol : Column_Position;
label : String) return Field is
f : constant Field := Create (1, label'Length, frow, fcol, 0, 0);
o : Field_Option_Set := Get_Options (f);
begin
if f /= Null_Field then
Set_Buffer (f, 0, label);
o.Active := False;
Set_Options (f, o);
end if;
return f;
end make_label;
function make_field (frow : Line_Position;
fcol : Column_Position;
rows : Line_Count;
cols : Column_Count;
secure : Boolean) return Field is
f : Field;
use StringData;
len : myptr;
begin
if secure then
f := Create (rows, cols, frow, fcol, 0, 1);
else
f := Create (rows, cols, frow, fcol, 0, 0);
end if;
if f /= Null_Field then
Set_Background (f, (Under_Line => True, others => False));
len := new Integer;
len.all := 0;
Set_User_Data (f, len);
end if;
return f;
end make_field;
procedure display_form (f : Form) is
w : Window;
rows : Line_Count;
cols : Column_Count;
begin
Scale (f, rows, cols);
w := New_Window (rows + 2, cols + 4, 0, 0);
if w /= Null_Window then
Set_Window (f, w);
Set_Sub_Window (f, Derived_Window (w, rows, cols, 1, 2));
Box (w); -- 0,0
Set_KeyPad_Mode (w, True);
end if;
-- TODO if Post(f) /= Form_Ok then it's a procedure
declare
begin
Post (f);
exception
when
Eti_System_Error |
Eti_Bad_Argument |
Eti_Posted |
Eti_Connected |
Eti_Bad_State |
Eti_No_Room |
Eti_Not_Posted |
Eti_Unknown_Command |
Eti_No_Match |
Eti_Not_Selectable |
Eti_Not_Connected |
Eti_Request_Denied |
Eti_Invalid_Field |
Eti_Current =>
Refresh (w);
end;
-- end if;
end display_form;
procedure erase_form (f : Form) is
w : Window := Get_Window (f);
s : Window := Get_Sub_Window (f);
begin
Post (f, False);
Erase (w);
Refresh (w);
Delete (s);
Delete (w);
end erase_form;
finished : Boolean := False;
f : constant Field_Array_Access := new Field_Array (1 .. 12);
secure : Field;
myform : Form;
w : Window;
c : Key_Code;
result : Driver_Result;
begin
Move_Cursor (Line => 18, Column => 0);
Add (Str => "Defined form-traversal keys: ^Q/ESC- exit form");
Add (Ch => newl);
Add (Str => "^N -- go to next field ^P -- go to previous field");
Add (Ch => newl);
Add (Str => "Home -- go to first field End -- go to last field");
Add (Ch => newl);
Add (Str => "^L -- go to field to left ^R -- go to field to right");
Add (Ch => newl);
Add (Str => "^U -- move upward to field ^D -- move downward to field");
Add (Ch => newl);
Add (Str => "^W -- go to next word ^B -- go to previous word");
Add (Ch => newl);
Add (Str => "^S -- go to start of field ^E -- go to end of field");
Add (Ch => newl);
Add (Str => "^H -- delete previous char ^Y -- delete line");
Add (Ch => newl);
Add (Str => "^G -- delete current word ^C -- clear to end of line");
Add (Ch => newl);
Add (Str => "^K -- clear to end of field ^X -- clear field");
Add (Ch => newl);
Add (Str => "Arrow keys move within a field as you would expect.");
Add (Line => 4, Column => 57, Str => "Forms Entry Test");
Refresh;
-- describe the form
f.all (1) := make_label (0, 15, "Sample Form");
f.all (2) := make_label (2, 0, "Last Name");
f.all (3) := make_field (3, 0, 1, 18, False);
f.all (4) := make_label (2, 20, "First Name");
f.all (5) := make_field (3, 20, 1, 12, False);
f.all (6) := make_label (2, 34, "Middle Name");
f.all (7) := make_field (3, 34, 1, 12, False);
f.all (8) := make_label (5, 0, "Comments");
f.all (9) := make_field (6, 0, 4, 46, False);
f.all (10) := make_label (5, 20, "Password:");
f.all (11) := make_field (5, 30, 1, 9, True);
secure := f.all (11);
f.all (12) := Null_Field;
myform := New_Form (f);
display_form (myform);
w := Get_Window (myform);
Set_Raw_Mode (SwitchOn => True);
Set_NL_Mode (SwitchOn => True); -- lets us read ^M's
while not finished loop
c := form_virtualize (myform, w);
result := Driver (myform, c);
case result is
when Form_Ok =>
Add (Line => 5, Column => 57, Str => Get_Buffer (secure, 1));
Clear_To_End_Of_Line;
Refresh;
when Unknown_Request =>
finished := my_form_driver (myform, c);
when others =>
Beep;
end case;
end loop;
erase_form (myform);
-- TODO Free_Form(myform);
-- for (c = 0; f[c] != 0; c++) free_field(f[c]);
Set_Raw_Mode (SwitchOn => False);
Set_NL_Mode (SwitchOn => True);
end ncurses2.demo_forms;
AdaCurses-20140726/samples/sample-menu_demo-handler.adb 0000644 0001751 0000144 00000011730 11315445062 021333 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Menu_Demo.Handler --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.16 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Sample.Menu_Demo.Aux;
with Sample.Manifest; use Sample.Manifest;
with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse;
package body Sample.Menu_Demo.Handler is
package Aux renames Sample.Menu_Demo.Aux;
procedure Drive_Me (M : Menu;
Title : String := "")
is
L : Line_Count;
C : Column_Count;
Y : Line_Position;
X : Column_Position;
begin
Aux.Geometry (M, L, C, Y, X);
Drive_Me (M, Y, X, Title);
end Drive_Me;
procedure Drive_Me (M : Menu;
Lin : Line_Position;
Col : Column_Position;
Title : String := "")
is
Mask : Event_Mask := No_Events;
Old : Event_Mask;
Pan : Panel := Aux.Create (M, Title, Lin, Col);
V : Cursor_Visibility := Invisible;
begin
-- We are only interested in Clicks with the left button
Register_Reportable_Events (Left, All_Clicks, Mask);
Old := Start_Mouse (Mask);
Set_Cursor_Visibility (V);
loop
declare
K : Key_Code := Aux.Get_Request (M, Pan);
R : constant Driver_Result := Driver (M, K);
begin
case R is
when Menu_Ok => null;
when Unknown_Request =>
declare
I : constant Item := Current (M);
O : Item_Option_Set;
begin
if K = Key_Mouse then
K := SELECT_ITEM;
end if;
Get_Options (I, O);
if K = SELECT_ITEM and then not O.Selectable then
Beep;
else
if My_Driver (M, K, Pan) then
exit;
end if;
end if;
end;
when others => Beep;
end case;
end;
end loop;
End_Mouse (Old);
Aux.Destroy (M, Pan);
end Drive_Me;
end Sample.Menu_Demo.Handler;
AdaCurses-20140726/samples/sample-helpers.adb 0000644 0001751 0000144 00000007100 11541116741 017406 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Helpers --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.14 $
-- $Date: 2011/03/19 12:13:21 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Sample.Explanation; use Sample.Explanation;
-- This package contains some convenient helper routines used throughout
-- this example.
--
package body Sample.Helpers is
procedure Window_Title (Win : Window;
Title : String)
is
Height : Line_Count;
Width : Column_Count;
Pos : Column_Position := 0;
begin
Get_Size (Win, Height, Width);
if Title'Length < Width then
Pos := (Width - Title'Length) / 2;
end if;
Add (Win, 0, Pos, Title);
end Window_Title;
procedure Not_Implemented is
begin
Explain ("NOTIMPL");
end Not_Implemented;
end Sample.Helpers;
AdaCurses-20140726/samples/ncurses2.ads 0000644 0001751 0000144 00000005732 07212274054 016265 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package ncurses2 is
pragma Pure (ncurses2);
end ncurses2;
AdaCurses-20140726/samples/ncurses2-color_test.adb 0000644 0001751 0000144 00000014715 11042670465 020422 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2008 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.3 $
-- $Date: 2008/07/26 18:47:17 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Ada.Strings.Fixed;
procedure ncurses2.color_test is
use Int_IO;
procedure show_color_name (y, x : Integer; color : Integer);
color_names : constant array (0 .. 15) of String (1 .. 7) :=
(
"black ",
"red ",
"green ",
"yellow ",
"blue ",
"magenta",
"cyan ",
"white ",
"BLACK ",
"RED ",
"GREEN ",
"YELLOW ",
"BLUE ",
"MAGENTA",
"CYAN ",
"WHITE "
);
procedure show_color_name (y, x : Integer; color : Integer) is
tmp5 : String (1 .. 5);
begin
if Number_Of_Colors > 8 then
Put (tmp5, color);
Add (Line => Line_Position (y), Column => Column_Position (x),
Str => tmp5);
else
Add (Line => Line_Position (y), Column => Column_Position (x),
Str => color_names (color));
end if;
end show_color_name;
top, width : Integer;
hello : String (1 .. 5);
-- tmp3 : String (1 .. 3);
-- tmp2 : String (1 .. 2);
begin
Refresh;
Add (Str => "There are ");
-- Put(tmp3, Number_Of_Colors*Number_Of_Colors);
Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors *
Number_Of_Colors),
Ada.Strings.Left));
Add (Str => " color pairs");
Add (Ch => newl);
if Number_Of_Colors > 8 then
width := 4;
else
width := 8;
end if;
if Number_Of_Colors > 8 then
hello := "Test ";
else
hello := "Hello";
end if;
for Bright in Boolean loop
if Number_Of_Colors > 8 then
top := 0;
else
top := Boolean'Pos (Bright) * (Number_Of_Colors + 3);
end if;
Clear_To_End_Of_Screen;
Move_Cursor (Line => Line_Position (top) + 1, Column => 0);
-- Put(tmp2, Number_Of_Colors);
Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors),
Ada.Strings.Left));
Add (Ch => 'x');
Add (Str => Ada.Strings.Fixed.Trim (Integer'Image (Number_Of_Colors),
Ada.Strings.Left));
Add (Str => " matrix of foreground/background colors, bright *");
if Bright then
Add (Str => "on");
else
Add (Str => "off");
end if;
Add (Ch => '*');
for i in 0 .. Number_Of_Colors - 1 loop
show_color_name (top + 2, (i + 1) * width, i);
end loop;
for i in 0 .. Number_Of_Colors - 1 loop
show_color_name (top + 3 + i, 0, i);
end loop;
for i in 1 .. Number_Of_Color_Pairs - 1 loop
Init_Pair (Color_Pair (i), Color_Number (i mod Number_Of_Colors),
Color_Number (i / Number_Of_Colors));
-- attron((attr_t) COLOR_PAIR(i)) -- Huh?
Set_Color (Pair => Color_Pair (i));
if Bright then
Switch_Character_Attribute (Attr => (Bold_Character => True,
others => False));
end if;
Add (Line => Line_Position (top + 3 + (i / Number_Of_Colors)),
Column => Column_Position ((i mod Number_Of_Colors + 1) *
width),
Str => hello);
Set_Character_Attributes;
end loop;
if Number_Of_Colors > 8 or Bright then
Pause;
end if;
end loop;
Erase;
End_Windows;
end ncurses2.color_test;
AdaCurses-20140726/samples/sample.ads 0000644 0001751 0000144 00000005663 07746514446 016023 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample is
procedure Whow;
end Sample;
AdaCurses-20140726/samples/sample-text_io_demo.ads 0000644 0001751 0000144 00000005717 07746514446 020500 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Text_IO_Demo --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Text_IO_Demo is
procedure Demo;
end Sample.Text_IO_Demo;
AdaCurses-20140726/samples/Makefile.in 0000644 0001751 0000144 00000011223 12034077732 016067 0 ustar tom users ##############################################################################
# Copyright (c) 1998-2011,2012 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. #
##############################################################################
#
# Author: Juergen Pfeifer, 1996
#
# $Id: Makefile.in,v 1.48 2012/10/06 19:00:42 tom Exp $
#
.SUFFIXES:
SHELL = /bin/sh
VPATH = @srcdir@
THIS = Makefile
x = @EXEEXT@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
datarootdir = @datarootdir@
datadir = @datadir@
libdir = @libdir@
includedir = @includedir@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
AWK = @AWK@
LN_S = @LN_S@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @ACPPFLAGS@ \
-DHAVE_CONFIG_H -I$(srcdir)
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
CFLAGS_NORMAL = $(CCFLAGS)
CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
CFLAGS_PROFILE = $(CCFLAGS) -pg
CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
REL_VERSION = @cf_cv_rel_version@
ABI_VERSION = @cf_cv_abi_version@
LOCAL_LIBDIR = @top_builddir@/lib
LINK = $(CC)
LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@
RANLIB = @RANLIB@
################################################################################
BINDIR = $(DESTDIR)$(bindir)
DATADIR = $(DESTDIR)$(datadir)
LIBDIR = $(DESTDIR)$(libdir)
MY_DATADIR = $(DATADIR)/AdaCurses
################################################################################
ada_srcdir=../src
LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS)
ADA = @cf_ada_compiler@
ADAFLAGS = @ADAFLAGS@ -I$(srcdir)
ADAMAKE = @cf_ada_make@
ADAMAKEFLAGS = -a -A$(srcdir) -A$(ada_srcdir) -A$(srcdir)/$(ada_srcdir)
ALIB = @cf_ada_package@
ABASE = $(ALIB)-curses
CARGS =-cargs $(ADAFLAGS)
LARGS =-largs -L../lib -lAdaCurses @TEST_ARG2@ $(LD_FLAGS) @TEST_LIBS2@
PROGS = tour$x ncurses$x @USE_GNAT_SIGINT@ rain$x
all :: $(PROGS)
@echo made $@
sources :
@echo made $@
libs \
install \
install.libs ::
@echo made $@
uninstall \
uninstall.libs ::
@echo made $@
install.examples :: $(BINDIR) $(PROGS)
$(INSTALL) $(PROGS) $(BINDIR)
install.examples :: $(MY_DATADIR)
$(INSTALL_DATA) explain.txt $(MY_DATADIR)
uninstall.examples ::
-cd $(BINDIR) && rm -f $(PROGS)
-rmdir $(BINDIR)
-rm -f $(MY_DATADIR)/explain.txt
-rmdir $(MY_DATADIR)
$(BINDIR) \
$(MY_DATADIR) :
mkdir -p $@
ncurses$x :
$(ADAMAKE) $(ADAMAKEFLAGS) ncurses $(CARGS) $(LARGS)
tour$x :
$(ADAMAKE) $(ADAMAKEFLAGS) tour $(CARGS) $(LARGS)
rain$x :
$(ADAMAKE) $(ADAMAKEFLAGS) rain $(CARGS) $(LARGS)
mostlyclean:
@echo made $@
clean :: mostlyclean
rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \
trace screendump b~*.ad[bs]
distclean :: clean
rm -f Makefile
realclean :: distclean
@echo made $@
AdaCurses-20140726/samples/ncurses2-genericputs.adb 0000644 0001751 0000144 00000012125 11315445062 020562 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,2009 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.4 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body ncurses2.genericPuts is
procedure myGet (Win : Window := Standard_Window;
Str : out BS.Bounded_String;
Len : Integer := -1)
is
function Wgetnstr (Win : Window;
Str : char_array;
Len : int) return int;
pragma Import (C, Wgetnstr, "wgetnstr");
N : Integer := Len;
Txt : char_array (0 .. size_t (Max_Length));
xStr : String (1 .. Max_Length);
Cnt : Natural;
begin
if N < 0 then
N := Max_Length;
end if;
if N > Max_Length then
raise Constraint_Error;
end if;
Txt (0) := Interfaces.C.char'First;
if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then
raise Curses_Exception;
end if;
To_Ada (Txt, xStr, Cnt, True);
Str := To_Bounded_String (xStr (1 .. Cnt));
end myGet;
procedure myPut (Str : out BS.Bounded_String;
i : Integer;
Base : Number_Base := 10) is
package Int_IO is new Integer_IO (Integer); use Int_IO;
tmp : String (1 .. BS.Max_Length);
begin
Put (tmp, i, Base);
Str := To_Bounded_String (tmp);
Trim (Str, Ada.Strings.Trim_End'(Ada.Strings.Left));
end myPut;
procedure myAdd (Str : BS.Bounded_String) is
begin
Add (Str => To_String (Str));
end myAdd;
-- from ncurses-aux
procedure Fill_String (Cp : chars_ptr;
Str : out BS.Bounded_String)
is
-- Fill the string with the characters referenced by the
-- chars_ptr.
--
Len : Natural;
begin
if Cp /= Null_Ptr then
Len := Natural (Strlen (Cp));
if Max_Length < Len then
raise Constraint_Error;
end if;
declare
S : String (1 .. Len);
begin
S := Value (Cp);
Str := To_Bounded_String (S);
end;
else
Str := Null_Bounded_String;
end if;
end Fill_String;
end ncurses2.genericPuts;
AdaCurses-20140726/samples/sample-curses_demo.ads 0000644 0001751 0000144 00000005715 07746514446 020327 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Curses_Demo --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Curses_Demo is
procedure Demo;
end Sample.Curses_Demo;
AdaCurses-20140726/samples/ncurses2-flushinp_test.adb 0000644 0001751 0000144 00000012656 07212274112 021127 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with ncurses2.util; use ncurses2.util;
procedure ncurses2.flushinp_test (win : Window) is
procedure Continue (win : Window);
procedure Continue (win : Window) is
begin
Set_Echo_Mode (False);
Move_Cursor (win, 10, 1);
Add (win, 10, 1, " Press any key to continue");
Refresh (win);
Getchar (win);
end Continue;
h, by, sh : Line_Position;
w, bx, sw : Column_Position;
subWin : Window;
begin
Clear (win);
Get_Size (win, h, w);
Get_Window_Position (win, by, bx);
sw := w / 3;
sh := h / 3;
subWin := Sub_Window (win, sh, sw, by + h - sh - 2, bx + w - sw - 2);
if Has_Colors then
Init_Pair (2, Cyan, Blue);
Change_Background (subWin,
Attributed_Character'(Ch => ' ', Color => 2,
Attr => Normal_Video));
end if;
Set_Character_Attributes (subWin,
(Bold_Character => True, others => False));
Box (subWin);
Add (subWin, 2, 1, "This is a subwindow");
Refresh (win);
Set_Cbreak_Mode (True);
Add (win, 0, 1, "This is a test of the flushinp() call.");
Add (win, 2, 1, "Type random keys for 5 seconds.");
Add (win, 3, 1,
"These should be discarded (not echoed) after the subwindow " &
"goes away.");
Refresh (win);
for i in 0 .. 4 loop
Move_Cursor (subWin, 1, 1);
Add (subWin, Str => "Time = ");
Add (subWin, Str => Integer'Image (i));
Refresh (subWin);
Nap_Milli_Seconds (1000);
Flush_Input;
end loop;
Delete (subWin);
Erase (win);
Flash_Screen;
Refresh (win);
Nap_Milli_Seconds (1000);
Add (win, 2, 1,
Str => "If you were still typing when the window timer expired,");
Add (win, 3, 1,
"or else you typed nothing at all while it was running,");
Add (win, 4, 1,
"test was invalid. You'll see garbage or nothing at all. ");
Add (win, 6, 1, "Press a key");
Move_Cursor (win, 9, 10);
Refresh (win);
Set_Echo_Mode (True);
Getchar (win);
Flush_Input;
Add (win, 12, 0,
"If you see any key other than what you typed, flushinp() is broken.");
Continue (win);
Move_Cursor (win, 9, 10);
Delete_Character (win);
Refresh (win);
Move_Cursor (win, 12, 0);
Clear_To_End_Of_Line;
Add (win,
"What you typed should now have been deleted; if not, wdelch() " &
"failed.");
Continue (win);
Set_Cbreak_Mode (True);
end ncurses2.flushinp_test;
AdaCurses-20140726/samples/ncurses2-test_sgr_attributes.adb 0000644 0001751 0000144 00000017501 10447516250 022340 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2006 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.2 $
-- $Date: 2006/06/25 14:24:40 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with ncurses2.util; use ncurses2.util;
-- Graphic-rendition test (adapted from vttest)
procedure ncurses2.test_sgr_attributes is
procedure xAdd (l : Line_Position; c : Column_Position; s : String);
procedure xAdd (l : Line_Position; c : Column_Position; s : String) is
begin
Add (Line => l, Column => c, Str => s);
end xAdd;
normal, current : Attributed_Character;
begin
for pass in reverse Boolean loop
if pass then
normal := (Ch => ' ', Attr => Normal_Video, Color => 0);
else
normal := (Ch => ' ', Attr =>
(Reverse_Video => True, others => False), Color => 0);
end if;
-- Use non-default colors if possible to exercise bce a little
if Has_Colors then
Init_Pair (1, White, Blue);
normal.Color := 1;
end if;
Set_Background (Ch => normal);
Erase;
xAdd (1, 20, "Graphic rendition test pattern:");
xAdd (4, 1, "vanilla");
current := normal;
current.Attr.Bold_Character := not current.Attr.Bold_Character;
Set_Background (Ch => current);
xAdd (4, 40, "bold");
current := normal;
current.Attr.Under_Line := not current.Attr.Under_Line;
Set_Background (Ch => current);
xAdd (6, 6, "underline");
current := normal;
current.Attr.Bold_Character := not current.Attr.Bold_Character;
current.Attr.Under_Line := not current.Attr.Under_Line;
Set_Background (Ch => current);
xAdd (6, 45, "bold underline");
current := normal;
current.Attr.Blink := not current.Attr.Blink;
Set_Background (Ch => current);
xAdd (8, 1, "blink");
current := normal;
current.Attr.Blink := not current.Attr.Blink;
current.Attr.Bold_Character := not current.Attr.Bold_Character;
Set_Background (Ch => current);
xAdd (8, 40, "bold blink");
current := normal;
current.Attr.Under_Line := not current.Attr.Under_Line;
current.Attr.Blink := not current.Attr.Blink;
Set_Background (Ch => current);
xAdd (10, 6, "underline blink");
current := normal;
current.Attr.Bold_Character := not current.Attr.Bold_Character;
current.Attr.Under_Line := not current.Attr.Under_Line;
current.Attr.Blink := not current.Attr.Blink;
Set_Background (Ch => current);
xAdd (10, 45, "bold underline blink");
current := normal;
current.Attr.Reverse_Video := not current.Attr.Reverse_Video;
Set_Background (Ch => current);
xAdd (12, 1, "negative");
current := normal;
current.Attr.Bold_Character := not current.Attr.Bold_Character;
current.Attr.Reverse_Video := not current.Attr.Reverse_Video;
Set_Background (Ch => current);
xAdd (12, 40, "bold negative");
current := normal;
current.Attr.Under_Line := not current.Attr.Under_Line;
current.Attr.Reverse_Video := not current.Attr.Reverse_Video;
Set_Background (Ch => current);
xAdd (14, 6, "underline negative");
current := normal;
current.Attr.Bold_Character := not current.Attr.Bold_Character;
current.Attr.Under_Line := not current.Attr.Under_Line;
current.Attr.Reverse_Video := not current.Attr.Reverse_Video;
Set_Background (Ch => current);
xAdd (14, 45, "bold underline negative");
current := normal;
current.Attr.Blink := not current.Attr.Blink;
current.Attr.Reverse_Video := not current.Attr.Reverse_Video;
Set_Background (Ch => current);
xAdd (16, 1, "blink negative");
current := normal;
current.Attr.Bold_Character := not current.Attr.Bold_Character;
current.Attr.Blink := not current.Attr.Blink;
current.Attr.Reverse_Video := not current.Attr.Reverse_Video;
Set_Background (Ch => current);
xAdd (16, 40, "bold blink negative");
current := normal;
current.Attr.Under_Line := not current.Attr.Under_Line;
current.Attr.Blink := not current.Attr.Blink;
current.Attr.Reverse_Video := not current.Attr.Reverse_Video;
Set_Background (Ch => current);
xAdd (18, 6, "underline blink negative");
current := normal;
current.Attr.Bold_Character := not current.Attr.Bold_Character;
current.Attr.Under_Line := not current.Attr.Under_Line;
current.Attr.Blink := not current.Attr.Blink;
current.Attr.Reverse_Video := not current.Attr.Reverse_Video;
Set_Background (Ch => current);
xAdd (18, 45, "bold underline blink negative");
Set_Background (Ch => normal);
Move_Cursor (Line => Lines - 2, Column => 1);
if pass then
Add (Str => "Dark");
else
Add (Str => "Light");
end if;
Add (Str => " background. ");
Clear_To_End_Of_Line;
Pause;
end loop;
Set_Background (Ch => Blank2);
Erase;
End_Windows;
end ncurses2.test_sgr_attributes;
AdaCurses-20140726/samples/sample-manifest.ads 0000644 0001751 0000144 00000007756 07746514446 017634 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Manifest --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
package Sample.Manifest is
QUIT : constant User_Key_Code := User_Key_Code'First;
SELECT_ITEM : constant User_Key_Code := QUIT + 1;
FKEY_HELP : constant Label_Number := 1;
HELP_CODE : constant Special_Key_Code := Key_F1;
FKEY_EXPLAIN : constant Label_Number := 2;
EXPLAIN_CODE : constant Special_Key_Code := Key_F2;
FKEY_QUIT : constant Label_Number := 3;
QUIT_CODE : constant Special_Key_Code := Key_F3;
Menu_Marker : constant String := "=> ";
Default_Colors : constant Redefinable_Color_Pair := 1;
Menu_Fore_Color : constant Redefinable_Color_Pair := 2;
Menu_Back_Color : constant Redefinable_Color_Pair := 3;
Menu_Grey_Color : constant Redefinable_Color_Pair := 4;
Form_Fore_Color : constant Redefinable_Color_Pair := 5;
Form_Back_Color : constant Redefinable_Color_Pair := 6;
Notepad_Color : constant Redefinable_Color_Pair := 7;
Help_Color : constant Redefinable_Color_Pair := 8;
Header_Color : constant Redefinable_Color_Pair := 9;
end Sample.Manifest;
AdaCurses-20140726/samples/ncurses2-trace_set.adb 0000644 0001751 0000144 00000041345 11542240601 020203 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses2.trace_set --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,2011 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.5 $
-- $Date: 2011/03/23 00:40:33 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace;
with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
with Ada.Strings.Bounded;
-- interactively set the trace level
procedure ncurses2.trace_set is
function menu_virtualize (c : Key_Code) return Key_Code;
function subset (super, sub : Trace_Attribute_Set) return Boolean;
function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set;
function trace_num (tlevel : Trace_Attribute_Set) return String;
function tracetrace (tlevel : Trace_Attribute_Set) return String;
function run_trace_menu (m : Menu; count : Integer) return Boolean;
function menu_virtualize (c : Key_Code) return Key_Code is
begin
case c is
when Character'Pos (newl) | Key_Exit =>
return Menu_Request_Code'Last + 1; -- MAX_COMMAND? TODO
when Character'Pos ('u') =>
return M_ScrollUp_Line;
when Character'Pos ('d') =>
return M_ScrollDown_Line;
when Character'Pos ('b') | Key_Next_Page =>
return M_ScrollUp_Page;
when Character'Pos ('f') | Key_Previous_Page =>
return M_ScrollDown_Page;
when Character'Pos ('n') | Key_Cursor_Down =>
return M_Next_Item;
when Character'Pos ('p') | Key_Cursor_Up =>
return M_Previous_Item;
when Character'Pos (' ') =>
return M_Toggle_Item;
when Key_Mouse =>
return c;
when others =>
Beep;
return c;
end case;
end menu_virtualize;
type string_a is access String;
type tbl_entry is record
name : string_a;
mask : Trace_Attribute_Set;
end record;
t_tbl : constant array (Positive range <>) of tbl_entry :=
(
(new String'("Disable"),
Trace_Disable),
(new String'("Times"),
Trace_Attribute_Set'(Times => True, others => False)),
(new String'("Tputs"),
Trace_Attribute_Set'(Tputs => True, others => False)),
(new String'("Update"),
Trace_Attribute_Set'(Update => True, others => False)),
(new String'("Cursor_Move"),
Trace_Attribute_Set'(Cursor_Move => True, others => False)),
(new String'("Character_Output"),
Trace_Attribute_Set'(Character_Output => True, others => False)),
(new String'("Ordinary"),
Trace_Ordinary),
(new String'("Calls"),
Trace_Attribute_Set'(Calls => True, others => False)),
(new String'("Virtual_Puts"),
Trace_Attribute_Set'(Virtual_Puts => True, others => False)),
(new String'("Input_Events"),
Trace_Attribute_Set'(Input_Events => True, others => False)),
(new String'("TTY_State"),
Trace_Attribute_Set'(TTY_State => True, others => False)),
(new String'("Internal_Calls"),
Trace_Attribute_Set'(Internal_Calls => True, others => False)),
(new String'("Character_Calls"),
Trace_Attribute_Set'(Character_Calls => True, others => False)),
(new String'("Termcap_TermInfo"),
Trace_Attribute_Set'(Termcap_TermInfo => True, others => False)),
(new String'("Maximium"),
Trace_Maximum)
);
package BS is new Ada.Strings.Bounded.Generic_Bounded_Length (300);
function subset (super, sub : Trace_Attribute_Set) return Boolean is
begin
if
(super.Times or not sub.Times) and
(super.Tputs or not sub.Tputs) and
(super.Update or not sub.Update) and
(super.Cursor_Move or not sub.Cursor_Move) and
(super.Character_Output or not sub.Character_Output) and
(super.Calls or not sub.Calls) and
(super.Virtual_Puts or not sub.Virtual_Puts) and
(super.Input_Events or not sub.Input_Events) and
(super.TTY_State or not sub.TTY_State) and
(super.Internal_Calls or not sub.Internal_Calls) and
(super.Character_Calls or not sub.Character_Calls) and
(super.Termcap_TermInfo or not sub.Termcap_TermInfo) and
True then
return True;
else
return False;
end if;
end subset;
function trace_or (a, b : Trace_Attribute_Set) return Trace_Attribute_Set is
retval : Trace_Attribute_Set := Trace_Disable;
begin
retval.Times := (a.Times or b.Times);
retval.Tputs := (a.Tputs or b.Tputs);
retval.Update := (a.Update or b.Update);
retval.Cursor_Move := (a.Cursor_Move or b.Cursor_Move);
retval.Character_Output := (a.Character_Output or b.Character_Output);
retval.Calls := (a.Calls or b.Calls);
retval.Virtual_Puts := (a.Virtual_Puts or b.Virtual_Puts);
retval.Input_Events := (a.Input_Events or b.Input_Events);
retval.TTY_State := (a.TTY_State or b.TTY_State);
retval.Internal_Calls := (a.Internal_Calls or b.Internal_Calls);
retval.Character_Calls := (a.Character_Calls or b.Character_Calls);
retval.Termcap_TermInfo := (a.Termcap_TermInfo or b.Termcap_TermInfo);
return retval;
end trace_or;
-- Print the hexadecimal value of the mask so
-- users can set it from the command line.
function trace_num (tlevel : Trace_Attribute_Set) return String is
result : Integer := 0;
m : Integer := 1;
begin
if tlevel.Times then
result := result + m;
end if;
m := m * 2;
if tlevel.Tputs then
result := result + m;
end if;
m := m * 2;
if tlevel.Update then
result := result + m;
end if;
m := m * 2;
if tlevel.Cursor_Move then
result := result + m;
end if;
m := m * 2;
if tlevel.Character_Output then
result := result + m;
end if;
m := m * 2;
if tlevel.Calls then
result := result + m;
end if;
m := m * 2;
if tlevel.Virtual_Puts then
result := result + m;
end if;
m := m * 2;
if tlevel.Input_Events then
result := result + m;
end if;
m := m * 2;
if tlevel.TTY_State then
result := result + m;
end if;
m := m * 2;
if tlevel.Internal_Calls then
result := result + m;
end if;
m := m * 2;
if tlevel.Character_Calls then
result := result + m;
end if;
m := m * 2;
if tlevel.Termcap_TermInfo then
result := result + m;
end if;
m := m * 2;
return result'Img;
end trace_num;
function tracetrace (tlevel : Trace_Attribute_Set) return String is
use BS;
buf : Bounded_String := To_Bounded_String ("");
begin
-- The C version prints the hexadecimal value of the mask, we
-- won't do that here because this is Ada.
if tlevel = Trace_Disable then
Append (buf, "Trace_Disable");
else
if subset (tlevel,
Trace_Attribute_Set'(Times => True, others => False)) then
Append (buf, "Times");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Tputs => True, others => False)) then
Append (buf, "Tputs");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Update => True, others => False)) then
Append (buf, "Update");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Cursor_Move => True,
others => False)) then
Append (buf, "Cursor_Move");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Character_Output => True,
others => False)) then
Append (buf, "Character_Output");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Ordinary) then
Append (buf, "Ordinary");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Calls => True, others => False)) then
Append (buf, "Calls");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Virtual_Puts => True,
others => False)) then
Append (buf, "Virtual_Puts");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Input_Events => True,
others => False)) then
Append (buf, "Input_Events");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(TTY_State => True,
others => False)) then
Append (buf, "TTY_State");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Internal_Calls => True,
others => False)) then
Append (buf, "Internal_Calls");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Character_Calls => True,
others => False)) then
Append (buf, "Character_Calls");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Attribute_Set'(Termcap_TermInfo => True,
others => False)) then
Append (buf, "Termcap_TermInfo");
Append (buf, ", ");
end if;
if subset (tlevel,
Trace_Maximum) then
Append (buf, "Maximium");
Append (buf, ", ");
end if;
end if;
if To_String (buf) (Length (buf) - 1) = ',' then
Delete (buf, Length (buf) - 1, Length (buf));
end if;
return To_String (buf);
end tracetrace;
function run_trace_menu (m : Menu; count : Integer) return Boolean is
i, p : Item;
changed : Boolean;
c, v : Key_Code;
begin
loop
changed := (count /= 0);
c := Getchar (Get_Window (m));
v := menu_virtualize (c);
case Driver (m, v) is
when Unknown_Request =>
return False;
when others =>
i := Current (m);
if i = Menus.Items (m, 1) then -- the first item
for n in t_tbl'First + 1 .. t_tbl'Last loop
if Value (i) then
Set_Value (i, False);
changed := True;
end if;
end loop;
else
for n in t_tbl'First + 1 .. t_tbl'Last loop
p := Menus.Items (m, n);
if Value (p) then
Set_Value (Menus.Items (m, 1), False);
changed := True;
exit;
end if;
end loop;
end if;
if not changed then
return True;
end if;
end case;
end loop;
end run_trace_menu;
nc_tracing, mask : Trace_Attribute_Set;
pragma Import (C, nc_tracing, "_nc_tracing");
items_a : constant Item_Array_Access :=
new Item_Array (t_tbl'First .. t_tbl'Last + 1);
mrows : Line_Count;
mcols : Column_Count;
menuwin : Window;
menu_y : constant Line_Position := 8;
menu_x : constant Column_Position := 8;
ip : Item;
m : Menu;
count : Integer;
newtrace : Trace_Attribute_Set;
begin
Add (Line => 0, Column => 0, Str => "Interactively set trace level:");
Add (Line => 2, Column => 0,
Str => " Press space bar to toggle a selection.");
Add (Line => 3, Column => 0,
Str => " Use up and down arrow to move the select bar.");
Add (Line => 4, Column => 0,
Str => " Press return to set the trace level.");
Add (Line => 6, Column => 0, Str => "(Current trace level is ");
Add (Str => tracetrace (nc_tracing) & " numerically: " &
trace_num (nc_tracing));
Add (Ch => ')');
Refresh;
for n in t_tbl'Range loop
items_a.all (n) := New_Item (t_tbl (n).name.all);
end loop;
items_a.all (t_tbl'Last + 1) := Null_Item;
m := New_Menu (items_a);
Set_Format (m, 16, 2);
Scale (m, mrows, mcols);
Switch_Options (m, (One_Valued => True, others => False), On => False);
menuwin := New_Window (mrows + 2, mcols + 2, menu_y, menu_x);
Set_Window (m, menuwin);
Set_KeyPad_Mode (menuwin, SwitchOn => True);
Box (menuwin);
Set_Sub_Window (m, Derived_Window (menuwin, mrows, mcols, 1, 1));
Post (m);
for n in t_tbl'Range loop
ip := Items (m, n);
mask := t_tbl (n).mask;
if mask = Trace_Disable then
Set_Value (ip, nc_tracing = Trace_Disable);
elsif subset (sub => mask, super => nc_tracing) then
Set_Value (ip, True);
end if;
end loop;
count := 1;
while run_trace_menu (m, count) loop
count := count + 1;
end loop;
newtrace := Trace_Disable;
for n in t_tbl'Range loop
ip := Items (m, n);
if Value (ip) then
mask := t_tbl (n).mask;
newtrace := trace_or (newtrace, mask);
end if;
end loop;
Trace_On (newtrace);
Trace_Put ("trace level interactively set to " &
tracetrace (nc_tracing));
Move_Cursor (Line => Lines - 4, Column => 0);
Add (Str => "Trace level is ");
Add (Str => tracetrace (nc_tracing));
Add (Ch => newl);
Pause; -- was just Add(); Getchar
Post (m, False);
-- menuwin has subwindows I think, which makes an error.
declare begin
Delete (menuwin);
exception when Curses_Exception => null; end;
-- free_menu(m);
-- free_item()
end ncurses2.trace_set;
AdaCurses-20140726/samples/sample.adb 0000644 0001751 0000144 00000020427 11542241134 015751 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2008,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.18 $
-- $Date: 2011/03/23 00:44:12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Text_IO;
with Ada.Exceptions; use Ada.Exceptions;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
with Terminal_Interface.Curses.Menus.Menu_User_Data;
with Terminal_Interface.Curses.Menus.Item_User_Data;
with Sample.Manifest; use Sample.Manifest;
with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
with Sample.Keyboard_Handler; use Sample.Keyboard_Handler;
with Sample.Header_Handler; use Sample.Header_Handler;
with Sample.Explanation; use Sample.Explanation;
with Sample.Menu_Demo.Handler;
with Sample.Curses_Demo;
with Sample.Form_Demo;
with Sample.Menu_Demo;
with Sample.Text_IO_Demo;
with GNAT.OS_Lib;
package body Sample is
type User_Data is
record
Data : Integer;
end record;
type User_Access is access User_Data;
package Ud is new
Terminal_Interface.Curses.Menus.Menu_User_Data
(User_Data, User_Access);
package Id is new
Terminal_Interface.Curses.Menus.Item_User_Data
(User_Data, User_Access);
procedure Whow is
procedure Main_Menu;
procedure Main_Menu
is
function My_Driver (M : Menu;
K : Key_Code;
Pan : Panel) return Boolean;
package Mh is new Sample.Menu_Demo.Handler (My_Driver);
I : Item_Array_Access := new Item_Array'
(New_Item ("Curses Core Demo"),
New_Item ("Menu Demo"),
New_Item ("Form Demo"),
New_Item ("Text IO Demo"),
Null_Item);
M : Menu := New_Menu (I);
D1, D2 : User_Access;
I1, I2 : User_Access;
function My_Driver (M : Menu;
K : Key_Code;
Pan : Panel) return Boolean
is
Idx : constant Positive := Get_Index (Current (M));
begin
if K in User_Key_Code'Range then
if K = QUIT then
return True;
elsif K = SELECT_ITEM then
if Idx <= 4 then
Hide (Pan);
Update_Panels;
end if;
case Idx is
when 1 => Sample.Curses_Demo.Demo;
when 2 => Sample.Menu_Demo.Demo;
when 3 => Sample.Form_Demo.Demo;
when 4 => Sample.Text_IO_Demo.Demo;
when others => null;
end case;
if Idx <= 4 then
Top (Pan);
Show (Pan);
Update_Panels;
Update_Screen;
end if;
end if;
end if;
return False;
end My_Driver;
begin
if (1 + Item_Count (M)) /= I'Length then
raise Constraint_Error;
end if;
D1 := new User_Data'(Data => 4711);
Ud.Set_User_Data (M, D1);
I1 := new User_Data'(Data => 1174);
Id.Set_User_Data (I.all (1), I1);
Set_Spacing (Men => M, Row => 2);
Default_Labels;
Notepad ("MAINPAD");
Mh.Drive_Me (M, " Demo ");
Ud.Get_User_Data (M, D2);
pragma Assert (D1 = D2);
pragma Assert (D1.Data = D2.Data);
Id.Get_User_Data (I.all (1), I2);
pragma Assert (I1 = I2);
pragma Assert (I1.Data = I2.Data);
Delete (M);
Free (I, True);
end Main_Menu;
begin
Initialize (PC_Style_With_Index);
Init_Header_Handler;
Init_Screen;
if Has_Colors then
Start_Color;
Init_Pair (Pair => Default_Colors, Fore => Black, Back => White);
Init_Pair (Pair => Menu_Back_Color, Fore => Black, Back => Cyan);
Init_Pair (Pair => Menu_Fore_Color, Fore => Red, Back => Cyan);
Init_Pair (Pair => Menu_Grey_Color, Fore => White, Back => Cyan);
Init_Pair (Pair => Notepad_Color, Fore => Black, Back => Yellow);
Init_Pair (Pair => Help_Color, Fore => Blue, Back => Cyan);
Init_Pair (Pair => Form_Back_Color, Fore => Black, Back => Cyan);
Init_Pair (Pair => Form_Fore_Color, Fore => Red, Back => Cyan);
Init_Pair (Pair => Header_Color, Fore => Black, Back => Green);
Set_Background (Ch => (Color => Default_Colors,
Attr => Normal_Video,
Ch => ' '));
Set_Character_Attributes (Attr => Normal_Video,
Color => Default_Colors);
Erase;
Set_Soft_Label_Key_Attributes (Color => Header_Color);
-- This propagates the attributes to the label window
Refresh_Soft_Label_Keys;
end if;
Init_Keyboard_Handler;
Set_Echo_Mode (False);
Set_Raw_Mode;
Set_Meta_Mode;
Set_KeyPad_Mode;
-- Initialize the Function Key Environment
-- We have some fixed key throughout this sample
Main_Menu;
End_Windows;
Curses_Free_All;
exception
when Event : others =>
Terminal_Interface.Curses.End_Windows;
Text_IO.Put ("Exception: ");
Text_IO.Put (Exception_Name (Event));
Text_IO.New_Line;
GNAT.OS_Lib.OS_Exit (1);
end Whow;
end Sample;
AdaCurses-20140726/samples/ncurses2-getch.ads 0000644 0001751 0000144 00000005662 07212274045 017357 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure getch_test;
AdaCurses-20140726/samples/status.ads 0000644 0001751 0000144 00000006740 07746514446 016062 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Status --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Laurent Pautet
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- This package has been contributed by Laurent Pautet --
-- --
with Ada.Interrupts.Names;
package Status is
pragma Warnings (Off); -- the next pragma exists since 3.11p
pragma Unreserve_All_Interrupts;
pragma Warnings (On);
protected Process is
procedure Stop;
function Continue return Boolean;
pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
private
Done : Boolean := False;
end Process;
end Status;
AdaCurses-20140726/samples/ncurses2-slk_test.ads 0000644 0001751 0000144 00000005671 07212274052 020113 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.1 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure ncurses2.slk_test;
AdaCurses-20140726/samples/ncurses2-util.adb 0000644 0001751 0000144 00000015412 12340207742 017211 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses2.util --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2008,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno 2000
-- Version Control
-- $Revision: 1.9 $
-- $Date: 2014/05/24 21:32:18 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with Terminal_Interface.Curses.Trace; use Terminal_Interface.Curses.Trace;
with Interfaces.C;
with Interfaces.C.Strings;
with Ada.Characters.Handling;
with ncurses2.genericPuts;
package body ncurses2.util is
-- #defines from C
-- #define CTRL(x) ((x) & 0x1f)
function CTRL (c : Character) return Key_Code is
begin
return Character'Pos (c) mod 16#20#;
-- uses a property of ASCII
-- A = 16#41#; a = 16#61#; ^A = 1 or 16#1#
end CTRL;
function CTRL (c : Character) return Character is
begin
return Character'Val (Character'Pos (c) mod 16#20#);
-- uses a property of ASCII
-- A = 16#41#; a = 16#61#; ^A = 1 or 16#1#
end CTRL;
save_trace : Trace_Attribute_Set;
-- Common function to allow ^T to toggle trace-mode in the middle of a test
-- so that trace-files can be made smaller.
function Getchar (win : Window := Standard_Window) return Key_Code is
c : Key_Code;
begin
-- #ifdef TRACE
c := Get_Keystroke (win);
while c = CTRL ('T') loop
-- if _nc_tracing in C
if Current_Trace_Setting /= Trace_Disable then
save_trace := Current_Trace_Setting;
Trace_Put ("TOGGLE-TRACING OFF");
Current_Trace_Setting := Trace_Disable;
else
Current_Trace_Setting := save_trace;
end if;
Trace_On (Current_Trace_Setting);
if Current_Trace_Setting /= Trace_Disable then
Trace_Put ("TOGGLE-TRACING ON");
end if;
end loop;
-- #else c := Get_Keystroke;
return c;
end Getchar;
procedure Getchar (win : Window := Standard_Window) is
begin
if Getchar (win) < 0 then
Beep;
end if;
end Getchar;
procedure Pause is
begin
Move_Cursor (Line => Lines - 1, Column => 0);
Add (Str => "Press any key to continue... ");
Getchar;
end Pause;
procedure Cannot (s : String) is
use Interfaces.C;
use Interfaces.C.Strings;
function getenv (x : char_array) return chars_ptr;
pragma Import (C, getenv, "getenv");
tmp1 : char_array (0 .. 10);
package p is new ncurses2.genericPuts (1024);
use p;
use p.BS;
tmpb : BS.Bounded_String;
Length : size_t;
begin
To_C ("TERM", tmp1, Length);
Fill_String (getenv (tmp1), tmpb);
Add (Ch => newl);
myAdd (Str => "This " & tmpb & " terminal " & s);
Pause;
end Cannot;
procedure ShellOut (message : Boolean) is
use Interfaces.C;
Txt : char_array (0 .. 10);
Length : size_t;
procedure system (x : char_array);
pragma Import (C, system, "system");
begin
To_C ("sh", Txt, Length);
if message then
Add (Str => "Shelling out...");
end if;
Save_Curses_Mode (Mode => Curses);
End_Windows;
system (Txt);
if message then
Add (Str => "returned from shellout.");
Add (Ch => newl);
end if;
Refresh;
end ShellOut;
function Is_Digit (c : Key_Code) return Boolean is
begin
if c >= 16#100# then
return False;
else
return Ada.Characters.Handling.Is_Digit (Character'Val (c));
end if;
end Is_Digit;
procedure P (s : String) is
begin
Add (Str => s);
Add (Ch => newl);
end P;
function Code_To_Char (c : Key_Code) return Character is
begin
if c > Character'Pos (Character'Last) then
return Character'Val (0);
-- maybe raise exception?
else
return Character'Val (c);
end if;
end Code_To_Char;
-- This was untestable due to a bug in GNAT (3.12p)
-- Hmm, what bug? I don't remember.
function ctoi (c : Character) return Integer is
begin
return Character'Pos (c) - Character'Pos ('0');
end ctoi;
end ncurses2.util;
AdaCurses-20140726/samples/sample-form_demo-aux.ads 0000644 0001751 0000144 00000011632 11541117334 020533 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Form_Demo.Aux --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
package Sample.Form_Demo.Aux is
procedure Geometry (F : Form;
L : out Line_Count;
C : out Column_Count;
Y : out Line_Position;
X : out Column_Position);
-- Calculate the geometry for a panel being able to be used to display
-- the menu.
function Create (F : Form;
Title : String;
Lin : Line_Position;
Col : Column_Position) return Panel;
-- Create a panel decorated with a frame and the title at the specified
-- position. The dimension of the panel is derived from the menus layout.
procedure Destroy (F : Form;
P : in out Panel);
-- Destroy all the windowing structures associated with this menu and
-- panel.
function Get_Request (F : Form;
P : Panel;
Handle_CRLF : Boolean := True) return Key_Code;
-- Centralized request driver for all menus in this sample. This
-- gives us a common key binding for all menus.
function Make (Top : Line_Position;
Left : Column_Position;
Text : String) return Field;
-- create a label
function Make (Height : Line_Count := 1;
Width : Column_Count;
Top : Line_Position;
Left : Column_Position;
Off_Screen : Natural := 0) return Field;
-- create a editable field
function Default_Driver (F : Form;
K : Key_Code;
P : Panel) return Boolean;
function Count_Active (F : Form) return Natural;
-- Count the number of active fields in the form
end Sample.Form_Demo.Aux;
AdaCurses-20140726/samples/tour.ads 0000644 0001751 0000144 00000005622 07746514446 015526 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Tour --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.9 $
-- Binding Version 01.00
------------------------------------------------------------------------------
procedure Tour;
AdaCurses-20140726/configure.in 0000644 0001751 0000144 00000046156 12342653627 014711 0 ustar tom users dnl***************************************************************************
dnl Copyright (c) 2010-2013,2014 Free Software Foundation, Inc. *
dnl *
dnl Permission is hereby granted, free of charge, to any person obtaining a *
dnl copy of this software and associated documentation files (the *
dnl "Software"), to deal in the Software without restriction, including *
dnl without limitation the rights to use, copy, modify, merge, publish, *
dnl distribute, distribute with modifications, sublicense, and/or sell *
dnl copies of the Software, and to permit persons to whom the Software is *
dnl furnished to do so, subject to the following conditions: *
dnl *
dnl The above copyright notice and this permission notice shall be included *
dnl in all copies or substantial portions of the Software. *
dnl *
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
dnl *
dnl Except as contained in this notice, the name(s) of the above copyright *
dnl holders shall not be used in advertising or otherwise to promote the *
dnl sale, use or other dealings in this Software without prior written *
dnl authorization. *
dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey
dnl
dnl $Id: configure.in,v 1.55 2014/06/01 16:40:55 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.52.20030208)
AC_REVISION($Revision: 1.55 $)
AC_INIT(gen/gen.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
CF_TOP_BUILDDIR
CF_WITH_SYSTYPE
### Save the given $CFLAGS to allow user-override.
cf_user_CFLAGS="$CFLAGS"
### Default install-location
CF_CFG_DEFAULTS
### Checks for programs.
CF_PROG_CC(gnatgcc gcc cc)
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
CF_PROG_CC_C_O(CC)
AC_ARG_PROGRAM
CF_PROG_AWK
CF_PROG_EGREP
AC_PROG_INSTALL
CF_PROG_LN_S
AC_SYS_LONG_FILE_NAMES
# if we find pkg-config, check if we should install the ".pc" files.
CF_PKG_CONFIG
CF_WITH_PKG_CONFIG_LIBDIR
AC_MSG_CHECKING(if you want to build test-programs)
AC_ARG_WITH(tests,
[ --without-tests suppress build with test-programs],
[cf_with_tests=$withval],
[cf_with_tests=yes])
AC_MSG_RESULT($cf_with_tests)
AC_MSG_CHECKING(if we should assume mixed-case filenames)
AC_ARG_ENABLE(mixed-case,
[ --enable-mixed-case tic should assume mixed-case filenames],
[enable_mixedcase=$enableval],
[enable_mixedcase=auto])
AC_MSG_RESULT($enable_mixedcase)
if test "$enable_mixedcase" = "auto" ; then
CF_MIXEDCASE_FILENAMES
else
cf_cv_mixedcase=$enable_mixedcase
if test "$enable_mixedcase" = "yes" ; then
AC_DEFINE(MIXEDCASE_FILENAMES)
fi
fi
# do this after mixed-case option (tags/TAGS is not as important as tic).
AC_PROG_MAKE_SET
CF_MAKE_TAGS
CF_MAKEFLAGS
dnl These are standard among *NIX systems, but not when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, ':')
AC_CHECK_TOOL(LD, ld, ld)
AC_CHECK_TOOL(AR, ar, ar)
CF_AR_FLAGS
CF_PATHSEP
dnl Special option for use by system-builders: the install-prefix is used to
dnl adjust the location into which the actual install is done, so that an
dnl archive can be built without modifying the host system's configuration.
AC_MSG_CHECKING(if you have specified an install-prefix)
AC_ARG_WITH(install-prefix,
[ --with-install-prefix prefixes actual install-location ($DESTDIR)],
[case "$withval" in #(vi
yes|no) #(vi
;;
*) DESTDIR="$withval"
;;
esac])
AC_MSG_RESULT($DESTDIR)
AC_SUBST(DESTDIR)
###############################################################################
CF_HELP_MESSAGE(Build-Tools Needed to Compile Temporary Applications for Cross-compiling:)
# If we're cross-compiling, allow the user to override the tools and their
# options. The configure script is oriented toward identifying the host
# compiler, etc., but we need a build compiler to generate parts of the source.
CF_BUILD_CC
###############################################################################
CF_HELP_MESSAGE(Options to Specify the Libraries Built/Used:)
### Options to allow the user to specify the set of libraries which are used.
### Use "--without-normal --with-shared" to allow the default model to be
### shared, for example.
cf_list_models=""
AC_MSG_CHECKING(if you want to build shared C-objects)
AC_ARG_WITH(shared,
[ --with-shared generate shared C-objects (needed for --with-ada-sharedlib)],
[with_shared=$withval],
[with_shared=no])
AC_MSG_RESULT($with_shared)
test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared"
AC_MSG_CHECKING(for specified models)
test -z "$cf_list_models" && cf_list_models=normal
AC_MSG_RESULT($cf_list_models)
### Use the first model as the default, and save its suffix for use in building
### up test-applications.
AC_MSG_CHECKING(for default model)
DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'`
AC_MSG_RESULT($DFT_LWR_MODEL)
CF_UPPER(DFT_UPR_MODEL,$DFT_LWR_MODEL)dnl
AC_SUBST(DFT_LWR_MODEL)dnl the default model ("normal")
AC_SUBST(DFT_UPR_MODEL)dnl the default model ("NORMAL")
CF_NCURSES_ADDON
CF_WITH_LIB_PREFIX(cf_prefix)
LIB_SUFFIX=
AC_SUBST(LIB_SUFFIX)
###############################################################################
dnl Not all ports of gcc support the -g option
if test X"$CC_G_OPT" = X"" ; then
CC_G_OPT='-g'
test -n "$GCC" && test "${ac_cv_prog_cc_g}" != yes && CC_G_OPT=''
fi
AC_SUBST(CC_G_OPT)
AC_MSG_CHECKING(for default loader flags)
case $DFT_LWR_MODEL in
normal) LD_MODEL='' ;;
debug) LD_MODEL=$CC_G_OPT ;;
profile) LD_MODEL='-pg';;
shared) LD_MODEL='' ;;
esac
AC_SUBST(LD_MODEL)dnl the type of link (e.g., -g or -pg)
AC_MSG_RESULT($LD_MODEL)
CF_SHARED_OPTS
# The test/sample programs in the original tree link using rpath option.
# Make it optional for packagers.
if test -n "$LOCAL_LDFLAGS"
then
AC_MSG_CHECKING(if you want to link sample programs with rpath option)
AC_ARG_ENABLE(rpath-link,
[ --enable-rpath-link link sample programs with rpath option],
[with_rpath_link=$enableval],
[with_rpath_link=yes])
AC_MSG_RESULT($with_rpath_link)
if test "$with_rpath_link" = no
then
LOCAL_LDFLAGS=
LOCAL_LDFLAGS2=
fi
fi
###############################################################################
CF_HELP_MESSAGE(Fine-Tuning Your Configuration:)
### use option --enable-broken-linker to force on use of broken-linker support
AC_MSG_CHECKING(if you want broken-linker support code)
AC_ARG_ENABLE(broken_linker,
[ --enable-broken_linker compile with broken-linker support code],
[with_broken_linker=$enableval],
[with_broken_linker=${BROKEN_LINKER:-no}])
AC_MSG_RESULT($with_broken_linker)
BROKEN_LINKER=0
if test "$with_broken_linker" = yes ; then
AC_DEFINE(BROKEN_LINKER)
BROKEN_LINKER=1
elif test "$DFT_LWR_MODEL" = shared ; then
case $cf_cv_system_name in #(vi
cygwin*)
AC_DEFINE(BROKEN_LINKER)
BROKEN_LINKER=1
CF_VERBOSE(cygwin linker is broken anyway)
;;
esac
fi
AC_SUBST(BROKEN_LINKER)
# Check to define _XOPEN_SOURCE "automatically"
CF_XOPEN_SOURCE
CF_LARGEFILE
### Enable compiling-in rcs id's
AC_MSG_CHECKING(if RCS identifiers should be compiled-in)
AC_ARG_WITH(rcs-ids,
[ --with-rcs-ids compile-in RCS identifiers],
[with_rcs_ids=$withval],
[with_rcs_ids=no])
AC_MSG_RESULT($with_rcs_ids)
test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS,1,[Define to 1 if RCS identifiers should be compiled-in)])
###############################################################################
CF_HELP_MESSAGE(Extensions:)
### Note that some functions (such as const) are normally disabled anyway.
AC_MSG_CHECKING(if you want to build with function extensions)
AC_ARG_ENABLE(ext-funcs,
[ --disable-ext-funcs disable function-extensions],
[with_ext_funcs=$enableval],
[with_ext_funcs=yes])
AC_MSG_RESULT($with_ext_funcs)
if test "$with_ext_funcs" = yes ; then
NCURSES_EXT_FUNCS=1
AC_DEFINE(HAVE_USE_DEFAULT_COLORS,1,[Define to 1 if we have use_default_colors function])
AC_DEFINE(NCURSES_EXT_FUNCS,1,[Define to 1 if we have ncurses extended functions])
else
NCURSES_EXT_FUNCS=0
fi
AC_SUBST(NCURSES_EXT_FUNCS)
### use option --enable-const to turn on use of const beyond that in XSI.
AC_MSG_CHECKING(for extended use of const keyword)
AC_ARG_ENABLE(const,
[ --enable-const compile with extra/non-standard const],
[with_ext_const=$enableval],
[with_ext_const=no])
AC_MSG_RESULT($with_ext_const)
NCURSES_CONST='/*nothing*/'
if test "$with_ext_const" = yes ; then
NCURSES_CONST=const
fi
AC_SUBST(NCURSES_CONST)
###############################################################################
# These options are relatively safe to experiment with.
CF_HELP_MESSAGE(Development Code:)
AC_MSG_CHECKING(if you want all development code)
AC_ARG_WITH(develop,
[ --without-develop disable development options],
[with_develop=$withval],
[with_develop=no])
AC_MSG_RESULT($with_develop)
###############################################################################
# These are just experimental, probably should not be in a package:
CF_HELP_MESSAGE(Experimental Code:)
# This is still experimental (20080329), but should ultimately be moved to
# the script-block --with-normal, etc.
CF_WITH_PTHREAD
AC_MSG_CHECKING(if you want to use weak-symbols for pthreads)
AC_ARG_ENABLE(weak-symbols,
[ --enable-weak-symbols enable weak-symbols for pthreads],
[use_weak_symbols=$withval],
[use_weak_symbols=no])
AC_MSG_RESULT($use_weak_symbols)
if test "$use_weak_symbols" = yes ; then
CF_WEAK_SYMBOLS
else
cf_cv_weak_symbols=no
fi
if test $cf_cv_weak_symbols = yes ; then
AC_DEFINE(USE_WEAK_SYMBOLS,1,[Define to 1 to enable weak-symbols for pthreads])
fi
PTHREAD=
if test "$with_pthread" = "yes" ; then
AC_DEFINE(USE_PTHREADS,1,[Define to 1 to use the pthreads library])
enable_reentrant=yes
if test $cf_cv_weak_symbols = yes ; then
PTHREAD=-lpthread
fi
fi
AC_SUBST(PTHREAD)
# OpenSUSE is installing ncurses6, using reentrant option.
AC_CHECK_FUNC(_nc_TABSIZE,[assume_reentrant=yes], [assume_reentrant=no])
# Reentrant code has to be opaque; there's little advantage to making ncurses
# opaque outside of that, so there is no --enable-opaque option. We can use
# this option without --with-pthreads, but this will be always set for
# pthreads.
AC_MSG_CHECKING(if you want experimental reentrant code)
AC_ARG_ENABLE(reentrant,
[ --enable-reentrant compile with experimental reentrant code],
[with_reentrant=$enableval],
[with_reentrant=$assume_reentrant])
AC_MSG_RESULT($with_reentrant)
if test "$with_reentrant" = yes ; then
cf_cv_enable_reentrant=1
if test $cf_cv_weak_symbols = yes ; then
CF_REMOVE_LIB(LIBS,$LIBS,pthread)
elif test "$assume_reentrant" = no ; then
LIB_SUFFIX="t${LIB_SUFFIX}"
fi
AC_DEFINE(USE_REENTRANT,1,[Define to 1 to compile with experimental reentrant code])
else
cf_cv_enable_reentrant=0
fi
AC_SUBST(cf_cv_enable_reentrant)
### Allow using a different wrap-prefix
if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then
AC_MSG_CHECKING(for prefix used to wrap public variables)
AC_ARG_WITH(wrap-prefix,
[ --with-wrap-prefix=XXX override prefix used for public variables],
[NCURSES_WRAP_PREFIX=$withval],
[NCURSES_WRAP_PREFIX=_nc_])
AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
else
NCURSES_WRAP_PREFIX=_nc_
fi
AC_SUBST(NCURSES_WRAP_PREFIX)
AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX",[Define to override _nc_ ncurses internal prefix])
###############################################################################
CF_HELP_MESSAGE(Testing/development Options:)
### use option --disable-echo to suppress full display compiling commands
CF_DISABLE_ECHO
### use option --enable-warnings to turn on all gcc warnings
AC_MSG_CHECKING(if you want to see compiler warnings)
AC_ARG_ENABLE(warnings,
[ --enable-warnings build: turn on GCC compiler warnings],
[with_warnings=$enableval])
AC_MSG_RESULT($with_warnings)
if test "x$with_warnings" = "xyes"; then
CF_ADD_ADAFLAGS(-gnatg)
CF_GCC_WARNINGS(Wno-unknown-pragmas Wswitch-enum)
fi
CF_GCC_ATTRIBUTES
### use option --enable-assertions to turn on generation of assertion code
AC_MSG_CHECKING(if you want to enable runtime assertions)
AC_ARG_ENABLE(assertions,
[ --enable-assertions test: turn on generation of assertion code],
[with_assertions=$enableval],
[with_assertions=no])
AC_MSG_RESULT($with_assertions)
if test -n "$GCC"
then
if test "$with_assertions" = no
then
CPPFLAGS="$CPPFLAGS -DNDEBUG"
else
CF_ADD_ADAFLAGS(-gnata)
fi
fi
### use option --disable-leaks to suppress "permanent" leaks, for testing
AC_DEFINE(HAVE_NC_ALLOC_H,1,[Define to 1 if we have nc_alloc.h header])
### use option --enable-expanded to generate certain macros as functions
AC_ARG_ENABLE(expanded,
[ --enable-expanded test: generate functions for certain macros],
[test "$enableval" = yes && AC_DEFINE(NCURSES_EXPANDED,1,[Define to 1 if ncurses macros should be expanded as functions])])
### use option --disable-macros to suppress macros in favor of functions
AC_ARG_ENABLE(macros,
[ --disable-macros test: use functions rather than macros],
[test "$enableval" = no && AC_DEFINE(NCURSES_NOMACROS,1,[Define to 1 if ncurses macros should be expanded as functions])])
# Normally we only add trace() to the debug-library. Allow this to be
# extended to all models of the ncurses library:
cf_all_traces=no
case "$CFLAGS $CPPFLAGS" in
*-DTRACE*)
cf_all_traces=yes
;;
esac
AC_MSG_CHECKING(whether to add trace feature to all models)
AC_ARG_WITH(trace,
[ --with-trace test: add trace() function to all models of ncurses],
[cf_with_trace=$withval],
[cf_with_trace=$cf_all_traces])
AC_MSG_RESULT($cf_with_trace)
if test "$cf_with_trace" = yes ; then
ADA_TRACE=TRUE
CF_ADD_CFLAGS(-DTRACE)
else
ADA_TRACE=FALSE
fi
AC_SUBST(ADA_TRACE)
CF_DISABLE_GNAT_PROJECTS
### Checks for libraries.
case $cf_cv_system_name in #(vi
*mingw32*) #(vi
;;
*)
AC_CHECK_FUNC(gettimeofday,
AC_DEFINE(HAVE_GETTIMEOFDAY),[
AC_CHECK_LIB(bsd, gettimeofday,
AC_DEFINE(HAVE_GETTIMEOFDAY,1,[Define to 1 if we have gettimeofday])
LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday
;;
esac
### Checks for header files.
AC_STDC_HEADERS
AC_HEADER_DIRENT
AC_HEADER_TIME
### checks for compiler characteristics
AC_LANG_C
AC_C_CONST
### Checks for external-data
CF_LINK_DATAONLY
### Checks for library functions.
CF_MKSTEMP
dnl We'll do our own -g libraries, unless the user's overridden via $CFLAGS
if test -z "$cf_user_CFLAGS" && test "$with_no_leaks" = no ; then
CF_STRIP_G_OPT(CFLAGS)
CF_STRIP_G_OPT(CXXFLAGS)
fi
CF_HELP_MESSAGE(Ada95 Binding Options:)
cf_with_ada=yes
dnl Check for availability of GNU Ada Translator (GNAT).
dnl At the moment we support no other Ada95 compiler.
if test "$cf_with_ada" != "no" ; then
CF_PROG_GNAT
if test "$cf_cv_prog_gnat_correct" = yes; then
CF_FIXUP_ADAFLAGS
CF_GNAT_GENERICS
CF_GNAT_SIGINT
CF_GNAT_PROJECTS
CF_WITH_ADA_COMPILER
cf_ada_package=terminal_interface
AC_SUBST(cf_ada_package)
CF_WITH_ADA_INCLUDE
CF_WITH_ADA_OBJECTS
CF_WITH_ADA_SHAREDLIB
else
AC_MSG_ERROR(No usable Ada compiler found)
fi
else
AC_MSG_ERROR(The Ada compiler is needed for this package)
fi
################################################################################
# not needed
TINFO_LDFLAGS2=
AC_SUBST(TINFO_LDFLAGS2)
TINFO_LIBS=
AC_SUBST(TINFO_LIBS)
### Construct the list of include-directories to be generated
CF_INCLUDE_DIRS
CF_ADA_INCLUDE_DIRS
### Build up pieces for makefile rules
AC_MSG_CHECKING(default library suffix)
CF_LIB_TYPE($DFT_LWR_MODEL,DFT_ARG_SUFFIX)dnl
AC_SUBST(DFT_ARG_SUFFIX)dnl the string to append to "-lncurses" ("")
AC_MSG_RESULT($DFT_ARG_SUFFIX)
AC_MSG_CHECKING(default library-dependency suffix)
CF_LIB_SUFFIX($DFT_LWR_MODEL,DFT_LIB_SUFFIX,DFT_DEP_SUFFIX)dnl
AC_SUBST(DFT_DEP_SUFFIX)dnl the corresponding library-suffix (".a")
AC_MSG_RESULT($DFT_DEP_SUFFIX)
AC_MSG_CHECKING(default object directory)
CF_OBJ_SUBDIR($DFT_LWR_MODEL,DFT_OBJ_SUBDIR)dnl
AC_SUBST(DFT_OBJ_SUBDIR)dnl the default object-directory ("obj")
AC_MSG_RESULT($DFT_OBJ_SUBDIR)
### Set up low-level terminfo dependencies for makefiles.
if test "$DFT_LWR_MODEL" = shared ; then
case $cf_cv_system_name in #(vi
cygwin*)
# "lib" files have ".dll.a" suffix, "cyg" files have ".dll"
;;
msys*)
# "lib" files have ".dll.a" suffix, "msys-" files have ".dll"
;;
esac
fi
### Construct the list of subdirectories for which we'll customize makefiles
### with the appropriate compile-rules.
SUB_MAKEFILES="gen/adacurses${DFT_ARG_SUFFIX}-config:gen/adacurses-config.in"
AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR',[Define to override ':' as the library path-separator])
### Now that we're done running tests, add the compiler-warnings, if any
CF_ADD_CFLAGS($EXTRA_CFLAGS)
################################################################################
TEST_ARG2=
AC_SUBST(TEST_ARG2)
TEST_LIBS2=
AC_SUBST(TEST_LIBS2)
dnl for separate build, this is good enough for "sh $(top_srcdir)/misc/shlib"
NCURSES_SHLIB2="sh -c"
AC_SUBST(NCURSES_SHLIB2)
ADA_SUBDIRS="include gen src doc"
if test "x$cf_with_tests" != "xno" ; then
ADA_SUBDIRS="$ADA_SUBDIRS samples"
fi
for cf_dir in $ADA_SUBDIRS
do
SUB_MAKEFILES="$SUB_MAKEFILES $cf_dir/Makefile"
done
AC_SUBST(ADA_SUBDIRS)
NCURSES_TREE="#"
AC_SUBST(NCURSES_TREE)
EXTERNAL_TREE=
AC_SUBST(EXTERNAL_TREE)
# match layout used by make-tar.sh
ADAHTML_DIR=../doc/ada
AC_SUBST(ADAHTML_DIR)
AC_OUTPUT( \
$SUB_MAKEFILES \
doc/adacurses${DFT_ARG_SUFFIX}-config.1:doc/MKada_config.in \
Makefile,[
if test -z "$USE_OLD_MAKERULES" ; then
$AWK -f $srcdir/mk-1st.awk <$srcdir/src/modules >>src/Makefile
fi
],[
### Special initialization commands, used to pass information from the
### configuration-run into config.status
AWK="$AWK"
DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX"
DFT_LWR_MODEL="$DFT_LWR_MODEL"
LIB_NAME="$LIB_NAME"
LIB_PREFIX="$LIB_PREFIX"
LIB_SUFFIX="$LIB_SUFFIX"
LN_S="$LN_S"
NCURSES_MAJOR="$NCURSES_MAJOR"
NCURSES_MINOR="$NCURSES_MINOR"
NCURSES_PATCH="$NCURSES_PATCH"
USE_OLD_MAKERULES="$USE_OLD_MAKERULES"
cf_cv_abi_version="$cf_cv_abi_version"
cf_cv_rel_version="$cf_cv_rel_version"
cf_cv_rm_so_locs="$cf_cv_rm_so_locs"
cf_cv_shared_soname='$cf_cv_shared_soname'
cf_cv_shlib_version="$cf_cv_shlib_version"
cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix"
cf_cv_system_name="$cf_cv_system_name"
host="$host"
target="$target"
],cat)dnl
${MAKE:-make} preinstall
AdaCurses-20140726/mk-1st.awk 0000644 0001751 0000144 00000006621 11530702161 014173 0 ustar tom users # $Id: mk-1st.awk,v 1.4 2011/02/22 09:40:01 tom Exp $
##############################################################################
# Copyright (c) 2010,2011 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. #
##############################################################################
#
# Author: Thomas E. Dickey
#
# Generate compile-rules for the Ada95 modules that we are using in libraries
# or programs. This script is used for older versions of gnatmake, which do
# not build libraries reliably, e.g., gnatmake 3.15.
#
# Fields in src/modules:
# $1 = module name
# $2 = directory where spec-dependency ".ads" is found
# $3 = directory where body-dependency ".adb" is found
# $4 = unit to compile (spec or body)
#
BEGIN {
printf "\n";
printf "# generated by Ada95/mk-1st.awk\n";
}
/^[#]/ {
next
}
/^$/ {
next
}
{
printf "\n";
printf "%s.o :", $1;
if ( $2 == "none" ) {
pre_spec = "";
} else if ( $2 == "." ) {
pre_spec = "";
printf " \\\n\t\t%s.ads", $1;
} else {
pre_spec = sprintf("%s/", $2);
printf " \\\n\t\t%s%s.ads", pre_spec, $1;
}
if ( $3 == "none" ) {
pre_body = "";
} else if ( $3 == "." ) {
pre_body = "";
printf " \\\n\t\t%s.adb", $1;
} else {
pre_body = sprintf("%s/", $3);
printf " \\\n\t\t%s%s.adb", pre_body, $1;
printf " \\\n\t\t$(BASEDEPS)";
}
if ( $4 == "spec" ) {
suffix = "ads";
prefix = pre_spec;
} else {
suffix = "adb";
prefix = pre_body;
}
printf "\n";
printf "\t$(ADA) $(ADAFLAGS) -c -o $@ %s%s.%s\n", prefix, $1, suffix
}
END {
print ""
}
AdaCurses-20140726/src/ 0000755 0001751 0000144 00000000000 12365055355 013152 5 ustar tom users AdaCurses-20140726/src/terminal_interface-curses-forms-field_types.adb 0000644 0001751 0000144 00000025307 12340207631 024404 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.27 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Ada.Unchecked_Deallocation;
with System.Address_To_Access_Conversions;
-- |
-- |=====================================================================
-- | man page form_fieldtype.3x
-- |=====================================================================
-- |
package body Terminal_Interface.Curses.Forms.Field_Types is
use type System.Address;
package Argument_Conversions is
new System.Address_To_Access_Conversions (Argument);
function Get_Fieldtype (F : Field) return C_Field_Type;
pragma Import (C, Get_Fieldtype, "field_type");
function Get_Arg (F : Field) return System.Address;
pragma Import (C, Get_Arg, "field_arg");
-- |
-- |=====================================================================
-- | man page form_field_validation.3x
-- |=====================================================================
-- |
-- |
-- |
function Get_Type (Fld : Field) return Field_Type_Access
is
Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
Arg : Argument_Access;
begin
if Low_Level = Null_Field_Type then
return null;
else
if Low_Level = M_Builtin_Router or else
Low_Level = M_Generic_Type or else
Low_Level = M_Choice_Router or else
Low_Level = M_Generic_Choice then
Arg := Argument_Access
(Argument_Conversions.To_Pointer (Get_Arg (Fld)));
if Arg = null then
raise Form_Exception;
else
return Arg.all.Typ;
end if;
else
raise Form_Exception;
end if;
end if;
end Get_Type;
function Copy_Arg (Usr : System.Address) return System.Address
is
begin
return Usr;
end Copy_Arg;
procedure Free_Arg (Usr : System.Address)
is
procedure Free_Type is new Ada.Unchecked_Deallocation
(Field_Type'Class, Field_Type_Access);
procedure Freeargs is new Ada.Unchecked_Deallocation
(Argument, Argument_Access);
To_Be_Free : Argument_Access
:= Argument_Access (Argument_Conversions.To_Pointer (Usr));
Low_Level : C_Field_Type;
begin
if To_Be_Free /= null then
if To_Be_Free.all.Usr /= System.Null_Address then
Low_Level := To_Be_Free.all.Cft;
if Low_Level.all.Freearg /= null then
Low_Level.all.Freearg (To_Be_Free.all.Usr);
end if;
end if;
if To_Be_Free.all.Typ /= null then
Free_Type (To_Be_Free.all.Typ);
end if;
Freeargs (To_Be_Free);
end if;
end Free_Arg;
procedure Wrap_Builtin (Fld : Field;
Typ : Field_Type'Class;
Cft : C_Field_Type := C_Builtin_Router)
is
Usr_Arg : constant System.Address := Get_Arg (Fld);
Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
Arg : Argument_Access;
function Set_Fld_Type (F : Field := Fld;
Cf : C_Field_Type := Cft;
Arg1 : Argument_Access) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_user");
begin
pragma Assert (Low_Level /= Null_Field_Type);
if Cft /= C_Builtin_Router and then Cft /= C_Choice_Router then
raise Form_Exception;
else
Arg := new Argument'(Usr => System.Null_Address,
Typ => new Field_Type'Class'(Typ),
Cft => Get_Fieldtype (Fld));
if Usr_Arg /= System.Null_Address then
if Low_Level.all.Copyarg /= null then
Arg.all.Usr := Low_Level.all.Copyarg (Usr_Arg);
else
Arg.all.Usr := Usr_Arg;
end if;
end if;
Eti_Exception (Set_Fld_Type (Arg1 => Arg));
end if;
end Wrap_Builtin;
function Field_Check_Router (Fld : Field;
Usr : System.Address) return Curses_Bool
is
Arg : constant Argument_Access
:= Argument_Access (Argument_Conversions.To_Pointer (Usr));
begin
pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
and then Arg.all.Typ /= null);
if Arg.all.Cft.all.Fcheck /= null then
return Arg.all.Cft.all.Fcheck (Fld, Arg.all.Usr);
else
return 1;
end if;
end Field_Check_Router;
function Char_Check_Router (Ch : C_Int;
Usr : System.Address) return Curses_Bool
is
Arg : constant Argument_Access
:= Argument_Access (Argument_Conversions.To_Pointer (Usr));
begin
pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
and then Arg.all.Typ /= null);
if Arg.all.Cft.all.Ccheck /= null then
return Arg.all.Cft.all.Ccheck (Ch, Arg.all.Usr);
else
return 1;
end if;
end Char_Check_Router;
function Next_Router (Fld : Field;
Usr : System.Address) return Curses_Bool
is
Arg : constant Argument_Access
:= Argument_Access (Argument_Conversions.To_Pointer (Usr));
begin
pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
and then Arg.all.Typ /= null);
if Arg.all.Cft.all.Next /= null then
return Arg.all.Cft.all.Next (Fld, Arg.all.Usr);
else
return 1;
end if;
end Next_Router;
function Prev_Router (Fld : Field;
Usr : System.Address) return Curses_Bool
is
Arg : constant Argument_Access :=
Argument_Access (Argument_Conversions.To_Pointer (Usr));
begin
pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type
and then Arg.all.Typ /= null);
if Arg.all.Cft.all.Prev /= null then
return Arg.all.Cft.all.Prev (Fld, Arg.all.Usr);
else
return 1;
end if;
end Prev_Router;
-- -----------------------------------------------------------------------
--
function C_Builtin_Router return C_Field_Type
is
T : C_Field_Type;
begin
if M_Builtin_Router = Null_Field_Type then
T := New_Fieldtype (Field_Check_Router'Access,
Char_Check_Router'Access);
if T = Null_Field_Type then
raise Form_Exception;
else
Eti_Exception (Set_Fieldtype_Arg (T,
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access));
end if;
M_Builtin_Router := T;
end if;
pragma Assert (M_Builtin_Router /= Null_Field_Type);
return M_Builtin_Router;
end C_Builtin_Router;
-- -----------------------------------------------------------------------
--
function C_Choice_Router return C_Field_Type
is
T : C_Field_Type;
begin
if M_Choice_Router = Null_Field_Type then
T := New_Fieldtype (Field_Check_Router'Access,
Char_Check_Router'Access);
if T = Null_Field_Type then
raise Form_Exception;
else
Eti_Exception (Set_Fieldtype_Arg (T,
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access));
Eti_Exception (Set_Fieldtype_Choice (T,
Next_Router'Access,
Prev_Router'Access));
end if;
M_Choice_Router := T;
end if;
pragma Assert (M_Choice_Router /= Null_Field_Type);
return M_Choice_Router;
end C_Choice_Router;
end Terminal_Interface.Curses.Forms.Field_Types;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-alpha.ads 0000644 0001751 0000144 00000006471 11315445666 025526 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Alpha --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.Alpha is
pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Alpha);
type Alpha_Field is new Field_Type
with record
Minimum_Field_Width : Natural := 0;
end record;
procedure Set_Field_Type (Fld : Field;
Typ : Alpha_Field);
pragma Inline (Set_Field_Type);
end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
AdaCurses-20140726/src/terminal_interface-curses-forms-form_user_data.adb 0000644 0001751 0000144 00000010133 12340207631 025056 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Form_User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.15 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- |
-- |=====================================================================
-- | man page form__userptr.3x
-- |=====================================================================
-- |
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Form_User_Data is
use type Interfaces.C.int;
-- |
-- |
-- |
procedure Set_User_Data (Frm : Form;
Data : User_Access)
is
function Set_Form_Userptr (Frm : Form;
Data : User_Access) return Eti_Error;
pragma Import (C, Set_Form_Userptr, "set_form_userptr");
begin
Eti_Exception (Set_Form_Userptr (Frm, Data));
end Set_User_Data;
-- |
-- |
-- |
function Get_User_Data (Frm : Form) return User_Access
is
function Form_Userptr (Frm : Form) return User_Access;
pragma Import (C, Form_Userptr, "form_userptr");
begin
return Form_Userptr (Frm);
end Get_User_Data;
procedure Get_User_Data (Frm : Form;
Data : out User_Access)
is
begin
Data := Get_User_Data (Frm);
end Get_User_Data;
end Terminal_Interface.Curses.Forms.Form_User_Data;
AdaCurses-20140726/src/terminal_interface.ads 0000644 0001751 0000144 00000006053 10447516776 017512 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998,2006 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.14 $
-- $Date: 2006/06/25 14:30:22 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface is
pragma Pure (Terminal_Interface);
--
-- Everything is in the child units
--
end Terminal_Interface;
AdaCurses-20140726/src/c_threaded_variables.c 0000644 0001751 0000144 00000005373 12340210232 017414 0 ustar tom users /****************************************************************************
* Copyright (c) 2011,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 *
* "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. *
****************************************************************************/
/****************************************************************************
* Author: Nicolas Boulenguez, 2011 *
****************************************************************************/
#include "c_threaded_variables.h"
#define WRAP(type, name) \
type \
name ## _as_function () \
{ \
return name; \
}
/* *INDENT-OFF* */
WRAP(WINDOW *, stdscr)
WRAP(WINDOW *, curscr)
WRAP(int, LINES)
WRAP(int, COLS)
WRAP(int, TABSIZE)
WRAP(int, COLORS)
WRAP(int, COLOR_PAIRS)
chtype
acs_map_as_function(char inx)
{
return acs_map[(unsigned char) inx];
}
/* *INDENT-ON* */
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-user-choice.ads 0000644 0001751 0000144 00000011760 11541120503 026621 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.User.Choice --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2008,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.14 $
-- $Date: 2011/03/19 12:27:47 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
package Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
pragma Preelaborate
(Terminal_Interface.Curses.Forms.Field_Types.User.Choice);
subtype C_Int is Interfaces.C.int;
type User_Defined_Field_Type_With_Choice is abstract new
User_Defined_Field_Type with null record;
-- This is the root of the mechanism we use to create field types in
-- Ada95 that allow the prev/next mechanism. You should your own type
-- derive from this one and implement the Field_Check, Character_Check
-- Next and Previous functions for your own type.
type User_Defined_Field_Type_With_Choice_Access is access all
User_Defined_Field_Type_With_Choice'Class;
function Next
(Fld : Field;
Typ : User_Defined_Field_Type_With_Choice) return Boolean
is abstract;
-- If True is returned, the function successfully generated a next
-- value into the fields buffer.
function Previous
(Fld : Field;
Typ : User_Defined_Field_Type_With_Choice) return Boolean
is abstract;
-- If True is returned, the function successfully generated a previous
-- value into the fields buffer.
-- +----------------------------------------------------------------------
-- | Private Part.
-- |
private
function C_Generic_Choice return C_Field_Type;
function Generic_Next (Fld : Field;
Usr : System.Address) return Curses_Bool;
pragma Convention (C, Generic_Next);
-- This is the generic next Choice_Function for the low-level fieldtype
-- representing all the User_Defined_Field_Type derivatives. It routes
-- the call to the Next implementation for the type.
function Generic_Prev (Fld : Field;
Usr : System.Address) return Curses_Bool;
pragma Convention (C, Generic_Prev);
-- This is the generic prev Choice_Function for the low-level fieldtype
-- representing all the User_Defined_Field_Type derivatives. It routes
-- the call to the Previous implementation for the type.
end Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-alpha.adb 0000644 0001751 0000144 00000007004 12340207631 025461 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Alpha --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.13 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.Alpha is
procedure Set_Field_Type (Fld : Field;
Typ : Alpha_Field)
is
function Set_Fld_Type (F : Field := Fld;
Arg1 : C_Int) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_alpha");
begin
Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;
end Terminal_Interface.Curses.Forms.Field_Types.Alpha;
AdaCurses-20140726/src/terminal_interface-curses-trace.adb_p 0000644 0001751 0000144 00000007442 12340207715 022371 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Trace --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2009,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
#if ADA_TRACE then
with Interfaces.C; use Interfaces.C;
#end if;
package body Terminal_Interface.Curses.Trace is
#if ADA_TRACE then
procedure Trace_On (x : Trace_Attribute_Set) is
procedure traceC (y : Trace_Attribute_Set);
pragma Import (C, traceC, "trace");
begin
traceC (x);
end Trace_On;
procedure Trace_Put (str : String) is
procedure tracef (format : char_array; s : char_array);
pragma Import (C, tracef, "_traces");
-- _traces() is defined in c_varargs_to_ada.h
begin
tracef (To_C ("%s"), To_C (str));
end Trace_Put;
#else
procedure Trace_On (x : Trace_Attribute_Set) is
pragma Warnings (Off, x); -- unreferenced
begin
null;
end Trace_On;
procedure Trace_Put (str : String) is
pragma Warnings (Off, str); -- unreferenced
begin
null;
end Trace_Put;
#end if;
end Terminal_Interface.Curses.Trace;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-enumeration-ada.adb 0000644 0001751 0000144 00000010377 11542231164 027455 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- $Date: 2011/03/22 23:36:20 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Characters.Handling; use Ada.Characters.Handling;
package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is
function Create (Set : Type_Set := Mixed_Case;
Case_Sensitive : Boolean := False;
Must_Be_Unique : Boolean := False)
return Enumeration_Field
is
I : Enumeration_Info (T'Pos (T'Last) - T'Pos (T'First) + 1);
J : Positive := 1;
begin
I.Case_Sensitive := Case_Sensitive;
I.Match_Must_Be_Unique := Must_Be_Unique;
for E in T'Range loop
I.Names (J) := new String'(T'Image (E));
-- The Image attribute defaults to upper case, so we have to handle
-- only the other ones...
if Set /= Upper_Case then
I.Names (J).all := To_Lower (I.Names (J).all);
if Set = Mixed_Case then
I.Names (J).all (I.Names (J).all'First) :=
To_Upper (I.Names (J).all (I.Names (J).all'First));
end if;
end if;
J := J + 1;
end loop;
return Create (I, True);
end Create;
function Value (Fld : Field;
Buf : Buffer_Number := Buffer_Number'First) return T
is
begin
return T'Value (Get_Buffer (Fld, Buf));
end Value;
end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-regexp.adb 0000644 0001751 0000144 00000007017 12340207631 025672 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.RegExp --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C; use Interfaces.C;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.RegExp is
procedure Set_Field_Type (Fld : Field;
Typ : Regular_Expression_Field)
is
function Set_Ftyp (F : Field := Fld;
Arg1 : char_array) return Eti_Error;
pragma Import (C, Set_Ftyp, "set_field_type_regexp");
begin
Eti_Exception (Set_Ftyp (Arg1 => To_C (Typ.Regular_Expression.all)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;
end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-user-choice.adb 0000644 0001751 0000144 00000012257 12340207631 026610 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.User.Choice --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.20 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with System.Address_To_Access_Conversions;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.User.Choice is
package Argument_Conversions is
new System.Address_To_Access_Conversions (Argument);
function Generic_Next (Fld : Field;
Usr : System.Address) return Curses_Bool
is
Result : Boolean;
Udf : constant User_Defined_Field_Type_With_Choice_Access :=
User_Defined_Field_Type_With_Choice_Access
(Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
begin
Result := Next (Fld, Udf.all);
return Curses_Bool (Boolean'Pos (Result));
end Generic_Next;
function Generic_Prev (Fld : Field;
Usr : System.Address) return Curses_Bool
is
Result : Boolean;
Udf : constant User_Defined_Field_Type_With_Choice_Access :=
User_Defined_Field_Type_With_Choice_Access
(Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
begin
Result := Previous (Fld, Udf.all);
return Curses_Bool (Boolean'Pos (Result));
end Generic_Prev;
-- -----------------------------------------------------------------------
--
function C_Generic_Choice return C_Field_Type
is
Res : Eti_Error;
T : C_Field_Type;
begin
if M_Generic_Choice = Null_Field_Type then
T := New_Fieldtype (Generic_Field_Check'Access,
Generic_Char_Check'Access);
if T = Null_Field_Type then
raise Form_Exception;
else
Res := Set_Fieldtype_Arg (T,
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access);
Eti_Exception (Res);
Res := Set_Fieldtype_Choice (T,
Generic_Next'Access,
Generic_Prev'Access);
Eti_Exception (Res);
end if;
M_Generic_Choice := T;
end if;
pragma Assert (M_Generic_Choice /= Null_Field_Type);
return M_Generic_Choice;
end C_Generic_Choice;
end Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
AdaCurses-20140726/src/terminal_interface-curses-terminfo.ads 0000644 0001751 0000144 00000010253 07746514446 022632 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Terminfo --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.3 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
package Terminal_Interface.Curses.Terminfo is
pragma Preelaborate (Terminal_Interface.Curses.Terminfo);
-- |=====================================================================
-- | Man page curs_terminfo.3x
-- |=====================================================================
-- Not implemented: setupterm, setterm, set_curterm, del_curterm,
-- restartterm, tparm, putp, vidputs, vidattr,
-- mvcur
type Terminfo_String is new String;
-- |
procedure Get_String (Name : String;
Value : out Terminfo_String;
Result : out Boolean);
function Has_String (Name : String) return Boolean;
-- AKA: tigetstr()
-- |
function Get_Flag (Name : String) return Boolean;
-- AKA: tigetflag()
-- |
function Get_Number (Name : String) return Integer;
-- AKA: tigetnum()
type putctype is access function (c : Interfaces.C.int)
return Interfaces.C.int;
pragma Convention (C, putctype);
-- |
procedure Put_String (Str : Terminfo_String;
affcnt : Natural := 1;
putc : putctype := null);
-- AKA: tputs()
end Terminal_Interface.Curses.Terminfo;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-alphanumeric.ads 0000644 0001751 0000144 00000006541 11315445666 027107 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
pragma Preelaborate
(Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric);
type AlphaNumeric_Field is new Field_Type
with record
Minimum_Field_Width : Natural := 0;
end record;
procedure Set_Field_Type (Fld : Field;
Typ : AlphaNumeric_Field);
pragma Inline (Set_Field_Type);
end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
AdaCurses-20140726/src/terminal_interface-curses-text_io-fixed_io.adb 0000644 0001751 0000144 00000007423 11315445471 024216 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Fixed_IO --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;
package body Terminal_Interface.Curses.Text_IO.Fixed_IO is
package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
package FIXIO is new Ada.Text_IO.Fixed_IO (Num);
procedure Put
(Win : Window;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
Buf : String (1 .. Field'Last);
Len : Field := Fore + 1 + Aft;
begin
if Exp > 0 then
Len := Len + 1 + Exp;
end if;
FIXIO.Put (Buf, Item, Aft, Exp);
Aux.Put_Buf (Win, Buf, Len, False);
end Put;
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp) is
begin
Put (Get_Window, Item, Fore, Aft, Exp);
end Put;
end Terminal_Interface.Curses.Text_IO.Fixed_IO;
AdaCurses-20140726/src/terminal_interface-curses-text_io-aux.ads 0000644 0001751 0000144 00000007001 11315445062 023232 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Aux --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.14 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
private package Terminal_Interface.Curses.Text_IO.Aux is
-- pragma Preelaborate (Aux);
-- This routine is called from the Text_IO output routines for numeric
-- and enumeration types.
--
procedure Put_Buf
(Win : Window; -- The output window
Buf : String; -- The buffer containing the text
Width : Field; -- The width of the output field
Signal : Boolean := True; -- If true, we raise Layout_Error
Ljust : Boolean := False); -- The Buf is left justified
end Terminal_Interface.Curses.Text_IO.Aux;
AdaCurses-20140726/src/terminal_interface-curses-text_io.adb 0000644 0001751 0000144 00000023045 12340207742 022424 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.22 $
-- $Date: 2014/05/24 21:32:18 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package body Terminal_Interface.Curses.Text_IO is
Default_Window : Window := Null_Window;
procedure Set_Window (Win : Window)
is
begin
Default_Window := Win;
end Set_Window;
function Get_Window return Window
is
begin
if Default_Window = Null_Window then
return Standard_Window;
else
return Default_Window;
end if;
end Get_Window;
pragma Inline (Get_Window);
procedure Flush (Win : Window)
is
begin
Refresh (Win);
end Flush;
procedure Flush
is
begin
Flush (Get_Window);
end Flush;
--------------------------------------------
-- Specification of line and page lengths --
--------------------------------------------
-- There are no set routines in this package. I assume, that you allocate
-- the window with an appropriate size.
-- A scroll-window is interpreted as an page with unbounded page length,
-- i.e. it returns the conventional 0 as page length.
function Line_Length (Win : Window) return Count
is
N_Lines : Line_Count;
N_Cols : Column_Count;
begin
Get_Size (Win, N_Lines, N_Cols);
-- if Natural (N_Cols) > Natural (Count'Last) then
-- raise Layout_Error;
-- end if;
return Count (N_Cols);
end Line_Length;
function Line_Length return Count
is
begin
return Line_Length (Get_Window);
end Line_Length;
function Page_Length (Win : Window) return Count
is
N_Lines : Line_Count;
N_Cols : Column_Count;
begin
if Scrolling_Allowed (Win) then
return 0;
else
Get_Size (Win, N_Lines, N_Cols);
-- if Natural (N_Lines) > Natural (Count'Last) then
-- raise Layout_Error;
-- end if;
return Count (N_Lines);
end if;
end Page_Length;
function Page_Length return Count
is
begin
return Page_Length (Get_Window);
end Page_Length;
------------------------------------
-- Column, Line, and Page Control --
------------------------------------
procedure New_Line (Win : Window; Spacing : Positive_Count := 1)
is
P_Size : constant Count := Page_Length (Win);
begin
if not Spacing'Valid then
raise Constraint_Error;
end if;
for I in 1 .. Spacing loop
if P_Size > 0 and then Line (Win) >= P_Size then
New_Page (Win);
else
Add (Win, ASCII.LF);
end if;
end loop;
end New_Line;
procedure New_Line (Spacing : Positive_Count := 1)
is
begin
New_Line (Get_Window, Spacing);
end New_Line;
procedure New_Page (Win : Window)
is
begin
Clear (Win);
end New_Page;
procedure New_Page
is
begin
New_Page (Get_Window);
end New_Page;
procedure Set_Col (Win : Window; To : Positive_Count)
is
Y : Line_Position;
X1 : Column_Position;
X2 : Column_Position;
N : Natural;
begin
if not To'Valid then
raise Constraint_Error;
end if;
Get_Cursor_Position (Win, Y, X1);
N := Natural (To); N := N - 1;
X2 := Column_Position (N);
if X1 > X2 then
New_Line (Win, 1);
X1 := 0;
end if;
if X1 < X2 then
declare
Filler : constant String (Integer (X1) .. (Integer (X2) - 1))
:= (others => ' ');
begin
Put (Win, Filler);
end;
end if;
end Set_Col;
procedure Set_Col (To : Positive_Count)
is
begin
Set_Col (Get_Window, To);
end Set_Col;
procedure Set_Line (Win : Window; To : Positive_Count)
is
Y1 : Line_Position;
Y2 : Line_Position;
X : Column_Position;
N : Natural;
begin
if not To'Valid then
raise Constraint_Error;
end if;
Get_Cursor_Position (Win, Y1, X);
pragma Warnings (Off, X); -- unreferenced
N := Natural (To); N := N - 1;
Y2 := Line_Position (N);
if Y2 < Y1 then
New_Page (Win);
Y1 := 0;
end if;
if Y1 < Y2 then
New_Line (Win, Positive_Count (Y2 - Y1));
end if;
end Set_Line;
procedure Set_Line (To : Positive_Count)
is
begin
Set_Line (Get_Window, To);
end Set_Line;
function Col (Win : Window) return Positive_Count
is
Y : Line_Position;
X : Column_Position;
N : Natural;
begin
Get_Cursor_Position (Win, Y, X);
N := Natural (X); N := N + 1;
-- if N > Natural (Count'Last) then
-- raise Layout_Error;
-- end if;
return Positive_Count (N);
end Col;
function Col return Positive_Count
is
begin
return Col (Get_Window);
end Col;
function Line (Win : Window) return Positive_Count
is
Y : Line_Position;
X : Column_Position;
N : Natural;
begin
Get_Cursor_Position (Win, Y, X);
N := Natural (Y); N := N + 1;
-- if N > Natural (Count'Last) then
-- raise Layout_Error;
-- end if;
return Positive_Count (N);
end Line;
function Line return Positive_Count
is
begin
return Line (Get_Window);
end Line;
-----------------------
-- Characters Output --
-----------------------
procedure Put (Win : Window; Item : Character)
is
P_Size : constant Count := Page_Length (Win);
Y : Line_Position;
X : Column_Position;
L : Line_Count;
C : Column_Count;
begin
if P_Size > 0 then
Get_Cursor_Position (Win, Y, X);
Get_Size (Win, L, C);
if (Y + 1) = L and then (X + 1) = C then
New_Page (Win);
end if;
end if;
Add (Win, Item);
end Put;
procedure Put (Item : Character)
is
begin
Put (Get_Window, Item);
end Put;
--------------------
-- Strings-Output --
--------------------
procedure Put (Win : Window; Item : String)
is
P_Size : constant Count := Page_Length (Win);
Y : Line_Position;
X : Column_Position;
L : Line_Count;
C : Column_Count;
begin
if P_Size > 0 then
Get_Cursor_Position (Win, Y, X);
Get_Size (Win, L, C);
if (Y + 1) = L and then (X + 1 + Item'Length) >= C then
New_Page (Win);
end if;
end if;
Add (Win, Item);
end Put;
procedure Put (Item : String)
is
begin
Put (Get_Window, Item);
end Put;
procedure Put_Line
(Win : Window;
Item : String)
is
begin
Put (Win, Item);
New_Line (Win, 1);
end Put_Line;
procedure Put_Line
(Item : String)
is
begin
Put_Line (Get_Window, Item);
end Put_Line;
end Terminal_Interface.Curses.Text_IO;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-alphanumeric.adb 0000644 0001751 0000144 00000007031 12340207631 027044 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.13 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric is
procedure Set_Field_Type (Fld : Field;
Typ : AlphaNumeric_Field)
is
function Set_Fld_Type (F : Field := Fld;
Arg1 : C_Int) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_alnum");
begin
Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Minimum_Field_Width)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;
end Terminal_Interface.Curses.Forms.Field_Types.AlphaNumeric;
AdaCurses-20140726/src/terminal_interface-curses-panels.adb 0000644 0001751 0000144 00000014162 11315445062 022233 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Panels --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2004,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.14 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C;
package body Terminal_Interface.Curses.Panels is
use type Interfaces.C.int;
function Create (Win : Window) return Panel
is
function Newpanel (Win : Window) return Panel;
pragma Import (C, Newpanel, "new_panel");
Pan : Panel;
begin
Pan := Newpanel (Win);
if Pan = Null_Panel then
raise Panel_Exception;
end if;
return Pan;
end Create;
procedure Bottom (Pan : Panel)
is
function Bottompanel (Pan : Panel) return C_Int;
pragma Import (C, Bottompanel, "bottom_panel");
begin
if Bottompanel (Pan) = Curses_Err then
raise Panel_Exception;
end if;
end Bottom;
procedure Top (Pan : Panel)
is
function Toppanel (Pan : Panel) return C_Int;
pragma Import (C, Toppanel, "top_panel");
begin
if Toppanel (Pan) = Curses_Err then
raise Panel_Exception;
end if;
end Top;
procedure Show (Pan : Panel)
is
function Showpanel (Pan : Panel) return C_Int;
pragma Import (C, Showpanel, "show_panel");
begin
if Showpanel (Pan) = Curses_Err then
raise Panel_Exception;
end if;
end Show;
procedure Hide (Pan : Panel)
is
function Hidepanel (Pan : Panel) return C_Int;
pragma Import (C, Hidepanel, "hide_panel");
begin
if Hidepanel (Pan) = Curses_Err then
raise Panel_Exception;
end if;
end Hide;
function Get_Window (Pan : Panel) return Window
is
function Panel_Win (Pan : Panel) return Window;
pragma Import (C, Panel_Win, "panel_window");
Win : constant Window := Panel_Win (Pan);
begin
if Win = Null_Window then
raise Panel_Exception;
end if;
return Win;
end Get_Window;
procedure Replace (Pan : Panel;
Win : Window)
is
function Replace_Pan (Pan : Panel;
Win : Window) return C_Int;
pragma Import (C, Replace_Pan, "replace_panel");
begin
if Replace_Pan (Pan, Win) = Curses_Err then
raise Panel_Exception;
end if;
end Replace;
procedure Move (Pan : Panel;
Line : Line_Position;
Column : Column_Position)
is
function Move (Pan : Panel;
Line : C_Int;
Column : C_Int) return C_Int;
pragma Import (C, Move, "move_panel");
begin
if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then
raise Panel_Exception;
end if;
end Move;
function Is_Hidden (Pan : Panel) return Boolean
is
function Panel_Hidden (Pan : Panel) return C_Int;
pragma Import (C, Panel_Hidden, "panel_hidden");
begin
if Panel_Hidden (Pan) = Curses_False then
return False;
else
return True;
end if;
end Is_Hidden;
procedure Delete (Pan : in out Panel)
is
function Del_Panel (Pan : Panel) return C_Int;
pragma Import (C, Del_Panel, "del_panel");
begin
if Del_Panel (Pan) = Curses_Err then
raise Panel_Exception;
end if;
Pan := Null_Panel;
end Delete;
end Terminal_Interface.Curses.Panels;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-intfield.adb 0000644 0001751 0000144 00000007366 12340207631 026205 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.IntField --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.13 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.IntField is
procedure Set_Field_Type (Fld : Field;
Typ : Integer_Field)
is
function Set_Fld_Type (F : Field := Fld;
Arg1 : C_Int;
Arg2 : C_Long_Int;
Arg3 : C_Long_Int) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_integer");
begin
Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
Arg2 => C_Long_Int (Typ.Lower_Limit),
Arg3 => C_Long_Int (Typ.Upper_Limit)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;
end Terminal_Interface.Curses.Forms.Field_Types.IntField;
AdaCurses-20140726/src/terminal_interface-curses-terminfo.adb 0000644 0001751 0000144 00000015424 11315445062 022576 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Terminfo --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.6 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Ada.Unchecked_Conversion;
package body Terminal_Interface.Curses.Terminfo is
function Is_MinusOne_Pointer (P : chars_ptr) return Boolean;
function Is_MinusOne_Pointer (P : chars_ptr) return Boolean is
type Weird_Address is new System.Storage_Elements.Integer_Address;
Invalid_Pointer : constant Weird_Address := -1;
function To_Weird is new Ada.Unchecked_Conversion
(Source => chars_ptr, Target => Weird_Address);
begin
if To_Weird (P) = Invalid_Pointer then
return True;
else
return False;
end if;
end Is_MinusOne_Pointer;
pragma Inline (Is_MinusOne_Pointer);
------------------------------------------------------------------------------
function Get_Flag (Name : String) return Boolean
is
function tigetflag (id : char_array) return Curses_Bool;
pragma Import (C, tigetflag);
Txt : char_array (0 .. Name'Length);
Length : size_t;
begin
To_C (Name, Txt, Length);
if tigetflag (Txt) = Curses_Bool (Curses_True) then
return True;
else
return False;
end if;
end Get_Flag;
------------------------------------------------------------------------------
procedure Get_String (Name : String;
Value : out Terminfo_String;
Result : out Boolean)
is
function tigetstr (id : char_array) return chars_ptr;
pragma Import (C, tigetstr, "tigetstr");
Txt : char_array (0 .. Name'Length);
Length : size_t;
Txt2 : chars_ptr;
begin
To_C (Name, Txt, Length);
Txt2 := tigetstr (Txt);
if Txt2 = Null_Ptr then
Result := False;
elsif Is_MinusOne_Pointer (Txt2) then
raise Curses_Exception;
else
Value := Terminfo_String (Fill_String (Txt2));
Result := True;
end if;
end Get_String;
------------------------------------------------------------------------------
function Has_String (Name : String) return Boolean
is
function tigetstr (id : char_array) return chars_ptr;
pragma Import (C, tigetstr, "tigetstr");
Txt : char_array (0 .. Name'Length);
Length : size_t;
Txt2 : chars_ptr;
begin
To_C (Name, Txt, Length);
Txt2 := tigetstr (Txt);
if Txt2 = Null_Ptr then
return False;
elsif Is_MinusOne_Pointer (Txt2) then
raise Curses_Exception;
else
return True;
end if;
end Has_String;
------------------------------------------------------------------------------
function Get_Number (Name : String) return Integer is
function tigetstr (s : char_array) return C_Int;
pragma Import (C, tigetstr);
Txt : char_array (0 .. Name'Length);
Length : size_t;
begin
To_C (Name, Txt, Length);
return Integer (tigetstr (Txt));
end Get_Number;
------------------------------------------------------------------------------
procedure Put_String (Str : Terminfo_String;
affcnt : Natural := 1;
putc : putctype := null) is
function tputs (str : char_array;
affcnt : C_Int;
putc : putctype) return C_Int;
function putp (str : char_array) return C_Int;
pragma Import (C, tputs);
pragma Import (C, putp);
Txt : char_array (0 .. Str'Length);
Length : size_t;
Err : C_Int;
begin
To_C (String (Str), Txt, Length);
if putc = null then
Err := putp (Txt);
else
Err := tputs (Txt, C_Int (affcnt), putc);
end if;
if Err = Curses_Err then
raise Curses_Exception;
end if;
end Put_String;
end Terminal_Interface.Curses.Terminfo;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-ipv4_address.adb 0000644 0001751 0000144 00000006744 12340207631 026775 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.13 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
procedure Set_Field_Type (Fld : Field;
Typ : Internet_V4_Address_Field)
is
function Set_Fld_Type (F : Field := Fld)
return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_ipv4");
begin
Eti_Exception (Set_Fld_Type);
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;
end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-numeric.adb 0000644 0001751 0000144 00000007446 12340207631 026050 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Numeric --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.14 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.Numeric is
procedure Set_Field_Type (Fld : Field;
Typ : Numeric_Field)
is
type Double is new Interfaces.C.double;
function Set_Fld_Type (F : Field := Fld;
Arg1 : C_Int;
Arg2 : Double;
Arg3 : Double) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_numeric");
begin
Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
Arg2 => Double (Typ.Lower_Limit),
Arg3 => Double (Typ.Upper_Limit)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;
end Terminal_Interface.Curses.Forms.Field_Types.Numeric;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-enumeration.ads 0000644 0001751 0000144 00000012115 11315445666 026757 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C.Strings;
package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
pragma Preelaborate
(Terminal_Interface.Curses.Forms.Field_Types.Enumeration);
type String_Access is access String;
-- Type_Set is used by the child package Ada
type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
type Enum_Array is array (Positive range <>)
of String_Access;
type Enumeration_Info (C : Positive) is
record
Names : Enum_Array (1 .. C);
Case_Sensitive : Boolean := False;
Match_Must_Be_Unique : Boolean := False;
end record;
type Enumeration_Field is new Field_Type with private;
function Create (Info : Enumeration_Info;
Auto_Release_Names : Boolean := False)
return Enumeration_Field;
-- Make an fieldtype from the info. Enumerations are special, because
-- they normally don't copy the enum values into a private store, so
-- we have to care for the lifetime of the info we provide.
-- The Auto_Release_Names flag may be used to automatically releases
-- the strings in the Names array of the Enumeration_Info.
function Make_Enumeration_Type (Info : Enumeration_Info;
Auto_Release_Names : Boolean := False)
return Enumeration_Field renames Create;
procedure Release (Enum : in out Enumeration_Field);
-- But we may want to release the field to release the memory allocated
-- by it internally. After that the Enumeration field is no longer usable.
-- The next type defintions are all ncurses extensions. They are typically
-- not available in other curses implementations.
procedure Set_Field_Type (Fld : Field;
Typ : Enumeration_Field);
pragma Inline (Set_Field_Type);
private
type CPA_Access is access Interfaces.C.Strings.chars_ptr_array;
type Enumeration_Field is new Field_Type with
record
Case_Sensitive : Boolean := False;
Match_Must_Be_Unique : Boolean := False;
Arr : CPA_Access := null;
end record;
end Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
AdaCurses-20140726/src/ncurses_compat.c 0000644 0001751 0000144 00000007700 11543753120 016337 0 ustar tom users /****************************************************************************
* Copyright (c) 2011 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. *
****************************************************************************/
/****************************************************************************
* Author: Thomas E. Dickey, 2011 *
****************************************************************************/
/*
Version Control
$Id: ncurses_compat.c,v 1.2 2011/03/28 00:29:04 tom Exp $
--------------------------------------------------------------------------*/
/*
* Provide compatibility with older versions of ncurses.
*/
#include
#if defined(NCURSES_VERSION_PATCH)
#if NCURSES_VERSION_PATCH < 20081122
extern bool has_mouse(void);
extern int _nc_has_mouse(void);
bool
has_mouse(void)
{
return (bool) _nc_has_mouse();
}
#endif
/*
* These are provided by lib_gen.c:
*/
#if NCURSES_VERSION_PATCH < 20070331
extern bool (is_keypad) (const WINDOW *);
extern bool (is_scrollok) (const WINDOW *);
bool
is_keypad(const WINDOW *win)
{
return ((win)->_use_keypad);
}
bool
(is_scrollok) (const WINDOW *win)
{
return ((win)->_scroll);
}
#endif
#if NCURSES_VERSION_PATCH < 20060107
extern int (getbegx) (WINDOW *);
extern int (getbegy) (WINDOW *);
extern int (getcurx) (WINDOW *);
extern int (getcury) (WINDOW *);
extern int (getmaxx) (WINDOW *);
extern int (getmaxy) (WINDOW *);
extern int (getparx) (WINDOW *);
extern int (getpary) (WINDOW *);
int
(getbegy) (WINDOW *win)
{
return ((win) ? (win)->_begy : ERR);
}
int
(getbegx) (WINDOW *win)
{
return ((win) ? (win)->_begx : ERR);
}
int
(getcury) (WINDOW *win)
{
return ((win) ? (win)->_cury : ERR);
}
int
(getcurx) (WINDOW *win)
{
return ((win) ? (win)->_curx : ERR);
}
int
(getmaxy) (WINDOW *win)
{
return ((win) ? ((win)->_maxy + 1) : ERR);
}
int
(getmaxx) (WINDOW *win)
{
return ((win) ? ((win)->_maxx + 1) : ERR);
}
int
(getpary) (WINDOW *win)
{
return ((win) ? (win)->_pary : ERR);
}
int
(getparx) (WINDOW *win)
{
return ((win) ? (win)->_parx : ERR);
}
#endif
#endif
AdaCurses-20140726/src/terminal_interface-curses-panels-user_data.adb 0000644 0001751 0000144 00000007770 11315446021 024203 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Panels.User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux;
use Terminal_Interface.Curses.Aux;
with Terminal_Interface.Curses.Panels;
use Terminal_Interface.Curses.Panels;
package body Terminal_Interface.Curses.Panels.User_Data is
use type Interfaces.C.int;
procedure Set_User_Data (Pan : Panel;
Data : User_Access)
is
function Set_Panel_Userptr (Pan : Panel;
Addr : User_Access) return C_Int;
pragma Import (C, Set_Panel_Userptr, "set_panel_userptr");
begin
if Set_Panel_Userptr (Pan, Data) = Curses_Err then
raise Panel_Exception;
end if;
end Set_User_Data;
function Get_User_Data (Pan : Panel) return User_Access
is
function Panel_Userptr (Pan : Panel) return User_Access;
pragma Import (C, Panel_Userptr, "panel_userptr");
begin
return Panel_Userptr (Pan);
end Get_User_Data;
procedure Get_User_Data (Pan : Panel;
Data : out User_Access)
is
begin
Data := Get_User_Data (Pan);
end Get_User_Data;
end Terminal_Interface.Curses.Panels.User_Data;
AdaCurses-20140726/src/terminal_interface-curses-text_io-complex_io.adb 0000644 0001751 0000144 00000007303 11315446021 024553 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Complex_IO --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Text_IO.Float_IO;
package body Terminal_Interface.Curses.Text_IO.Complex_IO is
package FIO is new
Terminal_Interface.Curses.Text_IO.Float_IO (Complex_Types.Real'Base);
procedure Put
(Win : Window;
Item : Complex;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
begin
Put (Win, '(');
FIO.Put (Win, Item.Re, Fore, Aft, Exp);
Put (Win, ',');
FIO.Put (Win, Item.Im, Fore, Aft, Exp);
Put (Win, ')');
end Put;
procedure Put
(Item : Complex;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
begin
Put (Get_Window, Item, Fore, Aft, Exp);
end Put;
end Terminal_Interface.Curses.Text_IO.Complex_IO;
AdaCurses-20140726/src/terminal_interface-curses-text_io.ads 0000644 0001751 0000144 00000013657 11315445471 022461 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.14 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Ada.IO_Exceptions;
package Terminal_Interface.Curses.Text_IO is
use type Ada.Text_IO.Count;
subtype Count is Ada.Text_IO.Count;
subtype Positive_Count is Count range 1 .. Count'Last;
subtype Field is Ada.Text_IO.Field;
subtype Number_Base is Integer range 2 .. 16;
type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
-- For most of the routines you will see a version without a Window
-- type parameter. They will operate on a default window, which can
-- be set by the user. It is initially equal to Standard_Window.
procedure Set_Window (Win : Window);
-- Set Win as the default window
function Get_Window return Window;
-- Get the current default window
procedure Flush (Win : Window);
procedure Flush;
--------------------------------------------
-- Specification of line and page lengths --
--------------------------------------------
-- There are no set routines in this package. I assume, that you allocate
-- the window with an appropriate size.
-- A scroll-window is interpreted as an page with unbounded page length,
-- i.e. it returns the conventional 0 as page length.
function Line_Length (Win : Window) return Count;
function Line_Length return Count;
function Page_Length (Win : Window) return Count;
function Page_Length return Count;
------------------------------------
-- Column, Line, and Page Control --
------------------------------------
procedure New_Line (Win : Window; Spacing : Positive_Count := 1);
procedure New_Line (Spacing : Positive_Count := 1);
procedure New_Page (Win : Window);
procedure New_Page;
procedure Set_Col (Win : Window; To : Positive_Count);
procedure Set_Col (To : Positive_Count);
procedure Set_Line (Win : Window; To : Positive_Count);
procedure Set_Line (To : Positive_Count);
function Col (Win : Window) return Positive_Count;
function Col return Positive_Count;
function Line (Win : Window) return Positive_Count;
function Line return Positive_Count;
-----------------------
-- Characters-Output --
-----------------------
procedure Put (Win : Window; Item : Character);
procedure Put (Item : Character);
--------------------
-- Strings-Output --
--------------------
procedure Put (Win : Window; Item : String);
procedure Put (Item : String);
procedure Put_Line
(Win : Window;
Item : String);
procedure Put_Line
(Item : String);
-- Exceptions
Status_Error : exception renames Ada.IO_Exceptions.Status_Error;
Mode_Error : exception renames Ada.IO_Exceptions.Mode_Error;
Name_Error : exception renames Ada.IO_Exceptions.Name_Error;
Use_Error : exception renames Ada.IO_Exceptions.Use_Error;
Device_Error : exception renames Ada.IO_Exceptions.Device_Error;
End_Error : exception renames Ada.IO_Exceptions.End_Error;
Data_Error : exception renames Ada.IO_Exceptions.Data_Error;
Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error;
end Terminal_Interface.Curses.Text_IO;
AdaCurses-20140726/src/terminal_interface-curses-text_io-enumeration_io.ads 0000644 0001751 0000144 00000006612 11315445471 025465 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Enumeration_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic
type Enum is (<>);
package Terminal_Interface.Curses.Text_IO.Enumeration_IO is
Default_Width : Field := 0;
Default_Setting : Type_Set := Mixed_Case;
procedure Put
(Win : Window;
Item : Enum;
Width : Field := Default_Width;
Set : Type_Set := Default_Setting);
procedure Put
(Item : Enum;
Width : Field := Default_Width;
Set : Type_Set := Default_Setting);
private
pragma Inline (Put);
end Terminal_Interface.Curses.Text_IO.Enumeration_IO;
AdaCurses-20140726/src/library.gpr 0000644 0001751 0000144 00000006241 12342477045 015332 0 ustar tom users ------------------------------------------------------------------------------
-- Copyright (c) 2010-2011,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 --
-- "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: library.gpr,v 1.9 2014/06/01 01:13:09 tom Exp $
-- http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Library-Projects.html
-- http://www.adaworld.com/debian/debian-ada-policy.html
project Library is
Build_Dir := External ("BUILD_DIR");
Source_Dir := External ("SOURCE_DIR");
Source_Dir2 := External ("SOURCE_DIR2");
Kind := External ("LIB_KIND");
for Library_Name use External ("LIB_NAME");
for Library_Version use External ("SONAME");
for Library_Kind use Kind;
for Library_Dir use Build_Dir & "/lib";
for Object_Dir use Build_Dir & "/" & Kind & "-obj";
for Library_ALI_Dir use Build_Dir & "/" & Kind & "-ali";
for Source_Dirs use (Source_Dir & "/src",
Source_Dir2,
Build_Dir & "/src");
for Library_Options use ("-lncurses", "-lpanel", "-lmenu", "-lform");
package Compiler is
for Default_Switches ("Ada") use
("-g",
"-O2",
"-gnatafno",
"-gnatVa", -- All validity checks
"-gnatwa"); -- Activate all optional errors
end Compiler;
for Languages use ("C", "Ada");
end Library;
AdaCurses-20140726/src/c_varargs_to_ada.c 0000644 0001751 0000144 00000007532 12340207742 016573 0 ustar tom users /****************************************************************************
* Copyright (c) 2011,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 *
* "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. *
****************************************************************************/
/****************************************************************************
* Author: Nicolas Boulenguez, 2011 *
****************************************************************************/
/*
Version Control
$Id: c_varargs_to_ada.c,v 1.6 2014/05/24 21:32:18 tom Exp $
--------------------------------------------------------------------------*/
/*
*/
#include "c_varargs_to_ada.h"
int
set_field_type_alnum(FIELD *field,
int minimum_width)
{
return set_field_type(field, TYPE_ALNUM, minimum_width);
}
int
set_field_type_alpha(FIELD *field,
int minimum_width)
{
return set_field_type(field, TYPE_ALPHA, minimum_width);
}
int
set_field_type_enum(FIELD *field,
char **value_list,
int case_sensitive,
int unique_match)
{
return set_field_type(field, TYPE_ENUM, value_list, case_sensitive,
unique_match);
}
int
set_field_type_integer(FIELD *field,
int precision,
long minimum,
long maximum)
{
return set_field_type(field, TYPE_INTEGER, precision, minimum, maximum);
}
int
set_field_type_numeric(FIELD *field,
int precision,
double minimum,
double maximum)
{
return set_field_type(field, TYPE_NUMERIC, precision, minimum, maximum);
}
int
set_field_type_regexp(FIELD *field,
char *regular_expression)
{
return set_field_type(field, TYPE_REGEXP, regular_expression);
}
int
set_field_type_ipv4(FIELD *field)
{
return set_field_type(field, TYPE_IPV4);
}
int
set_field_type_user(FIELD *field,
FIELDTYPE *fieldtype,
void *arg)
{
return set_field_type(field, fieldtype, arg);
}
void *
void_star_make_arg(va_list *list)
{
return va_arg(*list, void *);
}
#ifdef TRACE
void
_traces(const char *fmt, char *arg)
{
_tracef(fmt, arg);
}
#endif
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-user.ads 0000644 0001751 0000144 00000012216 11541120451 025370 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.User --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.15 $
-- $Date: 2011/03/19 12:27:21 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
package Terminal_Interface.Curses.Forms.Field_Types.User is
pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.User);
subtype C_Int is Interfaces.C.int;
type User_Defined_Field_Type is abstract new Field_Type with null record;
-- This is the root of the mechanism we use to create field types in
-- Ada95. You should your own type derive from this one and implement
-- the Field_Check and Character_Check functions for your own type.
type User_Defined_Field_Type_Access is access all
User_Defined_Field_Type'Class;
function Field_Check
(Fld : Field;
Typ : User_Defined_Field_Type) return Boolean
is abstract;
-- If True is returned, the field is considered valid, otherwise it is
-- invalid.
function Character_Check
(Ch : Character;
Typ : User_Defined_Field_Type) return Boolean
is abstract;
-- If True is returned, the character is considered as valid for the
-- field, otherwise as invalid.
procedure Set_Field_Type (Fld : Field;
Typ : User_Defined_Field_Type);
-- This should work for all types derived from User_Defined_Field_Type.
-- No need to reimplement it for your derived type.
-- +----------------------------------------------------------------------
-- | Private Part.
-- | Used by the Choice child package.
private
function C_Generic_Type return C_Field_Type;
function Generic_Field_Check (Fld : Field;
Usr : System.Address) return Curses_Bool;
pragma Convention (C, Generic_Field_Check);
-- This is the generic Field_Check_Function for the low-level fieldtype
-- representing all the User_Defined_Field_Type derivatives. It routes
-- the call to the Field_Check implementation for the type.
function Generic_Char_Check (Ch : C_Int;
Usr : System.Address) return Curses_Bool;
pragma Convention (C, Generic_Char_Check);
-- This is the generic Char_Check_Function for the low-level fieldtype
-- representing all the User_Defined_Field_Type derivatives. It routes
-- the call to the Character_Check implementation for the type.
end Terminal_Interface.Curses.Forms.Field_Types.User;
AdaCurses-20140726/src/c_threaded_variables.h 0000644 0001751 0000144 00000005045 12340207715 017431 0 ustar tom users /****************************************************************************
* Copyright (c) 2011,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 *
* "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. *
****************************************************************************/
#ifndef __C_THREADED_VARIABLES_H
#define __C_THREADED_VARIABLES_H
#include
extern WINDOW *stdscr_as_function(void);
extern WINDOW *curscr_as_function(void);
extern int LINES_as_function(void);
extern int LINES_as_function(void);
extern int COLS_as_function(void);
extern int TABSIZE_as_function(void);
extern int COLORS_as_function(void);
extern int COLOR_PAIRS_as_function(void);
extern chtype acs_map_as_function(char /* index */ );
#endif /* __C_THREADED_VARIABLES_H */
AdaCurses-20140726/src/terminal_interface-curses-forms.adb 0000644 0001751 0000144 00000100533 12340207631 022072 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.32 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C.Pointers;
with Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms is
use Terminal_Interface.Curses.Aux;
type C_Field_Array is array (Natural range <>) of aliased Field;
package F_Array is new
Interfaces.C.Pointers (Natural, Field, C_Field_Array, Null_Field);
------------------------------------------------------------------------------
-- |
-- |
-- |
-- subtype chars_ptr is Interfaces.C.Strings.chars_ptr;
procedure Request_Name (Key : Form_Request_Code;
Name : out String)
is
function Form_Request_Name (Key : C_Int) return chars_ptr;
pragma Import (C, Form_Request_Name, "form_request_name");
begin
Fill_String (Form_Request_Name (C_Int (Key)), Name);
end Request_Name;
function Request_Name (Key : Form_Request_Code) return String
is
function Form_Request_Name (Key : C_Int) return chars_ptr;
pragma Import (C, Form_Request_Name, "form_request_name");
begin
return Fill_String (Form_Request_Name (C_Int (Key)));
end Request_Name;
------------------------------------------------------------------------------
-- |
-- |
-- |
-- |
-- |=====================================================================
-- | man page form_field_new.3x
-- |=====================================================================
-- |
-- |
-- |
function Create (Height : Line_Count;
Width : Column_Count;
Top : Line_Position;
Left : Column_Position;
Off_Screen : Natural := 0;
More_Buffers : Buffer_Number := Buffer_Number'First)
return Field
is
function Newfield (H, W, T, L, O, M : C_Int) return Field;
pragma Import (C, Newfield, "new_field");
Fld : constant Field := Newfield (C_Int (Height), C_Int (Width),
C_Int (Top), C_Int (Left),
C_Int (Off_Screen),
C_Int (More_Buffers));
begin
if Fld = Null_Field then
raise Form_Exception;
end if;
return Fld;
end Create;
-- |
-- |
-- |
procedure Delete (Fld : in out Field)
is
function Free_Field (Fld : Field) return Eti_Error;
pragma Import (C, Free_Field, "free_field");
begin
Eti_Exception (Free_Field (Fld));
Fld := Null_Field;
end Delete;
-- |
-- |
-- |
function Duplicate (Fld : Field;
Top : Line_Position;
Left : Column_Position) return Field
is
function Dup_Field (Fld : Field;
Top : C_Int;
Left : C_Int) return Field;
pragma Import (C, Dup_Field, "dup_field");
F : constant Field := Dup_Field (Fld,
C_Int (Top),
C_Int (Left));
begin
if F = Null_Field then
raise Form_Exception;
end if;
return F;
end Duplicate;
-- |
-- |
-- |
function Link (Fld : Field;
Top : Line_Position;
Left : Column_Position) return Field
is
function Lnk_Field (Fld : Field;
Top : C_Int;
Left : C_Int) return Field;
pragma Import (C, Lnk_Field, "link_field");
F : constant Field := Lnk_Field (Fld,
C_Int (Top),
C_Int (Left));
begin
if F = Null_Field then
raise Form_Exception;
end if;
return F;
end Link;
-- |
-- |=====================================================================
-- | man page form_field_just.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Set_Justification (Fld : Field;
Just : Field_Justification := None)
is
function Set_Field_Just (Fld : Field;
Just : C_Int) return Eti_Error;
pragma Import (C, Set_Field_Just, "set_field_just");
begin
Eti_Exception (Set_Field_Just (Fld,
C_Int (Field_Justification'Pos (Just))));
end Set_Justification;
-- |
-- |
-- |
function Get_Justification (Fld : Field) return Field_Justification
is
function Field_Just (Fld : Field) return C_Int;
pragma Import (C, Field_Just, "field_just");
begin
return Field_Justification'Val (Field_Just (Fld));
end Get_Justification;
-- |
-- |=====================================================================
-- | man page form_field_buffer.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Set_Buffer
(Fld : Field;
Buffer : Buffer_Number := Buffer_Number'First;
Str : String)
is
function Set_Fld_Buffer (Fld : Field;
Bufnum : C_Int;
S : char_array)
return Eti_Error;
pragma Import (C, Set_Fld_Buffer, "set_field_buffer");
begin
Eti_Exception (Set_Fld_Buffer (Fld, C_Int (Buffer), To_C (Str)));
end Set_Buffer;
-- |
-- |
-- |
procedure Get_Buffer
(Fld : Field;
Buffer : Buffer_Number := Buffer_Number'First;
Str : out String)
is
function Field_Buffer (Fld : Field;
B : C_Int) return chars_ptr;
pragma Import (C, Field_Buffer, "field_buffer");
begin
Fill_String (Field_Buffer (Fld, C_Int (Buffer)), Str);
end Get_Buffer;
function Get_Buffer
(Fld : Field;
Buffer : Buffer_Number := Buffer_Number'First) return String
is
function Field_Buffer (Fld : Field;
B : C_Int) return chars_ptr;
pragma Import (C, Field_Buffer, "field_buffer");
begin
return Fill_String (Field_Buffer (Fld, C_Int (Buffer)));
end Get_Buffer;
-- |
-- |
-- |
procedure Set_Status (Fld : Field;
Status : Boolean := True)
is
function Set_Fld_Status (Fld : Field;
St : C_Int) return Eti_Error;
pragma Import (C, Set_Fld_Status, "set_field_status");
begin
if Set_Fld_Status (Fld, Boolean'Pos (Status)) /= E_Ok then
raise Form_Exception;
end if;
end Set_Status;
-- |
-- |
-- |
function Changed (Fld : Field) return Boolean
is
function Field_Status (Fld : Field) return C_Int;
pragma Import (C, Field_Status, "field_status");
Res : constant C_Int := Field_Status (Fld);
begin
if Res = Curses_False then
return False;
else
return True;
end if;
end Changed;
-- |
-- |
-- |
procedure Set_Maximum_Size (Fld : Field;
Max : Natural := 0)
is
function Set_Field_Max (Fld : Field;
M : C_Int) return Eti_Error;
pragma Import (C, Set_Field_Max, "set_max_field");
begin
Eti_Exception (Set_Field_Max (Fld, C_Int (Max)));
end Set_Maximum_Size;
-- |
-- |=====================================================================
-- | man page form_field_opts.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Set_Options (Fld : Field;
Options : Field_Option_Set)
is
function Set_Field_Opts (Fld : Field;
Opt : Field_Option_Set) return Eti_Error;
pragma Import (C, Set_Field_Opts, "set_field_opts");
begin
Eti_Exception (Set_Field_Opts (Fld, Options));
end Set_Options;
-- |
-- |
-- |
procedure Switch_Options (Fld : Field;
Options : Field_Option_Set;
On : Boolean := True)
is
function Field_Opts_On (Fld : Field;
Opt : Field_Option_Set) return Eti_Error;
pragma Import (C, Field_Opts_On, "field_opts_on");
function Field_Opts_Off (Fld : Field;
Opt : Field_Option_Set) return Eti_Error;
pragma Import (C, Field_Opts_Off, "field_opts_off");
begin
if On then
Eti_Exception (Field_Opts_On (Fld, Options));
else
Eti_Exception (Field_Opts_Off (Fld, Options));
end if;
end Switch_Options;
-- |
-- |
-- |
procedure Get_Options (Fld : Field;
Options : out Field_Option_Set)
is
function Field_Opts (Fld : Field) return Field_Option_Set;
pragma Import (C, Field_Opts, "field_opts");
begin
Options := Field_Opts (Fld);
end Get_Options;
-- |
-- |
-- |
function Get_Options (Fld : Field := Null_Field)
return Field_Option_Set
is
Fos : Field_Option_Set;
begin
Get_Options (Fld, Fos);
return Fos;
end Get_Options;
-- |
-- |=====================================================================
-- | man page form_field_attributes.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Set_Foreground
(Fld : Field;
Fore : Character_Attribute_Set := Normal_Video;
Color : Color_Pair := Color_Pair'First)
is
function Set_Field_Fore (Fld : Field;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Field_Fore, "set_field_fore");
begin
Eti_Exception (Set_Field_Fore (Fld, (Ch => Character'First,
Color => Color,
Attr => Fore)));
end Set_Foreground;
-- |
-- |
-- |
procedure Foreground (Fld : Field;
Fore : out Character_Attribute_Set)
is
function Field_Fore (Fld : Field) return Attributed_Character;
pragma Import (C, Field_Fore, "field_fore");
begin
Fore := Field_Fore (Fld).Attr;
end Foreground;
procedure Foreground (Fld : Field;
Fore : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Field_Fore (Fld : Field) return Attributed_Character;
pragma Import (C, Field_Fore, "field_fore");
begin
Fore := Field_Fore (Fld).Attr;
Color := Field_Fore (Fld).Color;
end Foreground;
-- |
-- |
-- |
procedure Set_Background
(Fld : Field;
Back : Character_Attribute_Set := Normal_Video;
Color : Color_Pair := Color_Pair'First)
is
function Set_Field_Back (Fld : Field;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Field_Back, "set_field_back");
begin
Eti_Exception (Set_Field_Back (Fld, (Ch => Character'First,
Color => Color,
Attr => Back)));
end Set_Background;
-- |
-- |
-- |
procedure Background (Fld : Field;
Back : out Character_Attribute_Set)
is
function Field_Back (Fld : Field) return Attributed_Character;
pragma Import (C, Field_Back, "field_back");
begin
Back := Field_Back (Fld).Attr;
end Background;
procedure Background (Fld : Field;
Back : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Field_Back (Fld : Field) return Attributed_Character;
pragma Import (C, Field_Back, "field_back");
begin
Back := Field_Back (Fld).Attr;
Color := Field_Back (Fld).Color;
end Background;
-- |
-- |
-- |
procedure Set_Pad_Character (Fld : Field;
Pad : Character := Space)
is
function Set_Field_Pad (Fld : Field;
Ch : C_Int) return Eti_Error;
pragma Import (C, Set_Field_Pad, "set_field_pad");
begin
Eti_Exception (Set_Field_Pad (Fld,
C_Int (Character'Pos (Pad))));
end Set_Pad_Character;
-- |
-- |
-- |
procedure Pad_Character (Fld : Field;
Pad : out Character)
is
function Field_Pad (Fld : Field) return C_Int;
pragma Import (C, Field_Pad, "field_pad");
begin
Pad := Character'Val (Field_Pad (Fld));
end Pad_Character;
-- |
-- |=====================================================================
-- | man page form_field_info.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Info (Fld : Field;
Lines : out Line_Count;
Columns : out Column_Count;
First_Row : out Line_Position;
First_Column : out Column_Position;
Off_Screen : out Natural;
Additional_Buffers : out Buffer_Number)
is
type C_Int_Access is access all C_Int;
function Fld_Info (Fld : Field;
L, C, Fr, Fc, Os, Ab : C_Int_Access)
return Eti_Error;
pragma Import (C, Fld_Info, "field_info");
L, C, Fr, Fc, Os, Ab : aliased C_Int;
begin
Eti_Exception (Fld_Info (Fld,
L'Access, C'Access,
Fr'Access, Fc'Access,
Os'Access, Ab'Access));
Lines := Line_Count (L);
Columns := Column_Count (C);
First_Row := Line_Position (Fr);
First_Column := Column_Position (Fc);
Off_Screen := Natural (Os);
Additional_Buffers := Buffer_Number (Ab);
end Info;
-- |
-- |
-- |
procedure Dynamic_Info (Fld : Field;
Lines : out Line_Count;
Columns : out Column_Count;
Max : out Natural)
is
type C_Int_Access is access all C_Int;
function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return Eti_Error;
pragma Import (C, Dyn_Info, "dynamic_field_info");
L, C, M : aliased C_Int;
begin
Eti_Exception (Dyn_Info (Fld,
L'Access, C'Access,
M'Access));
Lines := Line_Count (L);
Columns := Column_Count (C);
Max := Natural (M);
end Dynamic_Info;
-- |
-- |=====================================================================
-- | man page form_win.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Set_Window (Frm : Form;
Win : Window)
is
function Set_Form_Win (Frm : Form;
Win : Window) return Eti_Error;
pragma Import (C, Set_Form_Win, "set_form_win");
begin
Eti_Exception (Set_Form_Win (Frm, Win));
end Set_Window;
-- |
-- |
-- |
function Get_Window (Frm : Form) return Window
is
function Form_Win (Frm : Form) return Window;
pragma Import (C, Form_Win, "form_win");
W : constant Window := Form_Win (Frm);
begin
return W;
end Get_Window;
-- |
-- |
-- |
procedure Set_Sub_Window (Frm : Form;
Win : Window)
is
function Set_Form_Sub (Frm : Form;
Win : Window) return Eti_Error;
pragma Import (C, Set_Form_Sub, "set_form_sub");
begin
Eti_Exception (Set_Form_Sub (Frm, Win));
end Set_Sub_Window;
-- |
-- |
-- |
function Get_Sub_Window (Frm : Form) return Window
is
function Form_Sub (Frm : Form) return Window;
pragma Import (C, Form_Sub, "form_sub");
W : constant Window := Form_Sub (Frm);
begin
return W;
end Get_Sub_Window;
-- |
-- |
-- |
procedure Scale (Frm : Form;
Lines : out Line_Count;
Columns : out Column_Count)
is
type C_Int_Access is access all C_Int;
function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return Eti_Error;
pragma Import (C, M_Scale, "scale_form");
X, Y : aliased C_Int;
begin
Eti_Exception (M_Scale (Frm, Y'Access, X'Access));
Lines := Line_Count (Y);
Columns := Column_Count (X);
end Scale;
-- |
-- |=====================================================================
-- | man page menu_hook.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Set_Field_Init_Hook (Frm : Form;
Proc : Form_Hook_Function)
is
function Set_Field_Init (Frm : Form;
Proc : Form_Hook_Function) return Eti_Error;
pragma Import (C, Set_Field_Init, "set_field_init");
begin
Eti_Exception (Set_Field_Init (Frm, Proc));
end Set_Field_Init_Hook;
-- |
-- |
-- |
procedure Set_Field_Term_Hook (Frm : Form;
Proc : Form_Hook_Function)
is
function Set_Field_Term (Frm : Form;
Proc : Form_Hook_Function) return Eti_Error;
pragma Import (C, Set_Field_Term, "set_field_term");
begin
Eti_Exception (Set_Field_Term (Frm, Proc));
end Set_Field_Term_Hook;
-- |
-- |
-- |
procedure Set_Form_Init_Hook (Frm : Form;
Proc : Form_Hook_Function)
is
function Set_Form_Init (Frm : Form;
Proc : Form_Hook_Function) return Eti_Error;
pragma Import (C, Set_Form_Init, "set_form_init");
begin
Eti_Exception (Set_Form_Init (Frm, Proc));
end Set_Form_Init_Hook;
-- |
-- |
-- |
procedure Set_Form_Term_Hook (Frm : Form;
Proc : Form_Hook_Function)
is
function Set_Form_Term (Frm : Form;
Proc : Form_Hook_Function) return Eti_Error;
pragma Import (C, Set_Form_Term, "set_form_term");
begin
Eti_Exception (Set_Form_Term (Frm, Proc));
end Set_Form_Term_Hook;
-- |
-- |=====================================================================
-- | man page form_fields.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Redefine (Frm : Form;
Flds : Field_Array_Access)
is
function Set_Frm_Fields (Frm : Form;
Items : System.Address) return Eti_Error;
pragma Import (C, Set_Frm_Fields, "set_form_fields");
begin
pragma Assert (Flds.all (Flds'Last) = Null_Field);
if Flds.all (Flds'Last) /= Null_Field then
raise Form_Exception;
else
Eti_Exception (Set_Frm_Fields (Frm, Flds.all (Flds'First)'Address));
end if;
end Redefine;
-- |
-- |
-- |
function Fields (Frm : Form;
Index : Positive) return Field
is
use F_Array;
function C_Fields (Frm : Form) return Pointer;
pragma Import (C, C_Fields, "form_fields");
P : Pointer := C_Fields (Frm);
begin
if P = null or else Index > Field_Count (Frm) then
raise Form_Exception;
else
P := P + ptrdiff_t (C_Int (Index) - 1);
return P.all;
end if;
end Fields;
-- |
-- |
-- |
function Field_Count (Frm : Form) return Natural
is
function Count (Frm : Form) return C_Int;
pragma Import (C, Count, "field_count");
begin
return Natural (Count (Frm));
end Field_Count;
-- |
-- |
-- |
procedure Move (Fld : Field;
Line : Line_Position;
Column : Column_Position)
is
function Move (Fld : Field; L, C : C_Int) return Eti_Error;
pragma Import (C, Move, "move_field");
begin
Eti_Exception (Move (Fld, C_Int (Line), C_Int (Column)));
end Move;
-- |
-- |=====================================================================
-- | man page form_new.3x
-- |=====================================================================
-- |
-- |
-- |
function Create (Fields : Field_Array_Access) return Form
is
function NewForm (Fields : System.Address) return Form;
pragma Import (C, NewForm, "new_form");
M : Form;
begin
pragma Assert (Fields.all (Fields'Last) = Null_Field);
if Fields.all (Fields'Last) /= Null_Field then
raise Form_Exception;
else
M := NewForm (Fields.all (Fields'First)'Address);
if M = Null_Form then
raise Form_Exception;
end if;
return M;
end if;
end Create;
-- |
-- |
-- |
procedure Delete (Frm : in out Form)
is
function Free (Frm : Form) return Eti_Error;
pragma Import (C, Free, "free_form");
begin
Eti_Exception (Free (Frm));
Frm := Null_Form;
end Delete;
-- |
-- |=====================================================================
-- | man page form_opts.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Set_Options (Frm : Form;
Options : Form_Option_Set)
is
function Set_Form_Opts (Frm : Form;
Opt : Form_Option_Set) return Eti_Error;
pragma Import (C, Set_Form_Opts, "set_form_opts");
begin
Eti_Exception (Set_Form_Opts (Frm, Options));
end Set_Options;
-- |
-- |
-- |
procedure Switch_Options (Frm : Form;
Options : Form_Option_Set;
On : Boolean := True)
is
function Form_Opts_On (Frm : Form;
Opt : Form_Option_Set) return Eti_Error;
pragma Import (C, Form_Opts_On, "form_opts_on");
function Form_Opts_Off (Frm : Form;
Opt : Form_Option_Set) return Eti_Error;
pragma Import (C, Form_Opts_Off, "form_opts_off");
begin
if On then
Eti_Exception (Form_Opts_On (Frm, Options));
else
Eti_Exception (Form_Opts_Off (Frm, Options));
end if;
end Switch_Options;
-- |
-- |
-- |
procedure Get_Options (Frm : Form;
Options : out Form_Option_Set)
is
function Form_Opts (Frm : Form) return Form_Option_Set;
pragma Import (C, Form_Opts, "form_opts");
begin
Options := Form_Opts (Frm);
end Get_Options;
-- |
-- |
-- |
function Get_Options (Frm : Form := Null_Form) return Form_Option_Set
is
Fos : Form_Option_Set;
begin
Get_Options (Frm, Fos);
return Fos;
end Get_Options;
-- |
-- |=====================================================================
-- | man page form_post.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Post (Frm : Form;
Post : Boolean := True)
is
function M_Post (Frm : Form) return Eti_Error;
pragma Import (C, M_Post, "post_form");
function M_Unpost (Frm : Form) return Eti_Error;
pragma Import (C, M_Unpost, "unpost_form");
begin
if Post then
Eti_Exception (M_Post (Frm));
else
Eti_Exception (M_Unpost (Frm));
end if;
end Post;
-- |
-- |=====================================================================
-- | man page form_cursor.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Position_Cursor (Frm : Form)
is
function Pos_Form_Cursor (Frm : Form) return Eti_Error;
pragma Import (C, Pos_Form_Cursor, "pos_form_cursor");
begin
Eti_Exception (Pos_Form_Cursor (Frm));
end Position_Cursor;
-- |
-- |=====================================================================
-- | man page form_data.3x
-- |=====================================================================
-- |
-- |
-- |
function Data_Ahead (Frm : Form) return Boolean
is
function Ahead (Frm : Form) return C_Int;
pragma Import (C, Ahead, "data_ahead");
Res : constant C_Int := Ahead (Frm);
begin
if Res = Curses_False then
return False;
else
return True;
end if;
end Data_Ahead;
-- |
-- |
-- |
function Data_Behind (Frm : Form) return Boolean
is
function Behind (Frm : Form) return C_Int;
pragma Import (C, Behind, "data_behind");
Res : constant C_Int := Behind (Frm);
begin
if Res = Curses_False then
return False;
else
return True;
end if;
end Data_Behind;
-- |
-- |=====================================================================
-- | man page form_driver.3x
-- |=====================================================================
-- |
-- |
-- |
function Driver (Frm : Form;
Key : Key_Code) return Driver_Result
is
function Frm_Driver (Frm : Form; Key : C_Int) return Eti_Error;
pragma Import (C, Frm_Driver, "form_driver");
R : constant Eti_Error := Frm_Driver (Frm, C_Int (Key));
begin
case R is
when E_Unknown_Command =>
return Unknown_Request;
when E_Invalid_Field =>
return Invalid_Field;
when E_Request_Denied =>
return Request_Denied;
when others =>
Eti_Exception (R);
return Form_Ok;
end case;
end Driver;
-- |
-- |=====================================================================
-- | man page form_page.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Set_Current (Frm : Form;
Fld : Field)
is
function Set_Current_Fld (Frm : Form; Fld : Field) return Eti_Error;
pragma Import (C, Set_Current_Fld, "set_current_field");
begin
Eti_Exception (Set_Current_Fld (Frm, Fld));
end Set_Current;
-- |
-- |
-- |
function Current (Frm : Form) return Field
is
function Current_Fld (Frm : Form) return Field;
pragma Import (C, Current_Fld, "current_field");
Fld : constant Field := Current_Fld (Frm);
begin
if Fld = Null_Field then
raise Form_Exception;
end if;
return Fld;
end Current;
-- |
-- |
-- |
procedure Set_Page (Frm : Form;
Page : Page_Number := Page_Number'First)
is
function Set_Frm_Page (Frm : Form; Pg : C_Int) return Eti_Error;
pragma Import (C, Set_Frm_Page, "set_form_page");
begin
Eti_Exception (Set_Frm_Page (Frm, C_Int (Page)));
end Set_Page;
-- |
-- |
-- |
function Page (Frm : Form) return Page_Number
is
function Get_Page (Frm : Form) return C_Int;
pragma Import (C, Get_Page, "form_page");
P : constant C_Int := Get_Page (Frm);
begin
if P < 0 then
raise Form_Exception;
else
return Page_Number (P);
end if;
end Page;
function Get_Index (Fld : Field) return Positive
is
function Get_Fieldindex (Fld : Field) return C_Int;
pragma Import (C, Get_Fieldindex, "field_index");
Res : constant C_Int := Get_Fieldindex (Fld);
begin
if Res = Curses_Err then
raise Form_Exception;
end if;
return Positive (Natural (Res) + Positive'First);
end Get_Index;
-- |
-- |=====================================================================
-- | man page form_new_page.3x
-- |=====================================================================
-- |
-- |
-- |
procedure Set_New_Page (Fld : Field;
New_Page : Boolean := True)
is
function Set_Page (Fld : Field; Flg : C_Int) return Eti_Error;
pragma Import (C, Set_Page, "set_new_page");
begin
Eti_Exception (Set_Page (Fld, Boolean'Pos (New_Page)));
end Set_New_Page;
-- |
-- |
-- |
function Is_New_Page (Fld : Field) return Boolean
is
function Is_New (Fld : Field) return C_Int;
pragma Import (C, Is_New, "new_page");
Res : constant C_Int := Is_New (Fld);
begin
if Res = Curses_False then
return False;
else
return True;
end if;
end Is_New_Page;
procedure Free (FA : in out Field_Array_Access;
Free_Fields : Boolean := False)
is
procedure Release is new Ada.Unchecked_Deallocation
(Field_Array, Field_Array_Access);
begin
if FA /= null and then Free_Fields then
for I in FA'First .. (FA'Last - 1) loop
if FA.all (I) /= Null_Field then
Delete (FA.all (I));
end if;
end loop;
end if;
Release (FA);
end Free;
-- |=====================================================================
function Default_Field_Options return Field_Option_Set
is
begin
return Get_Options (Null_Field);
end Default_Field_Options;
function Default_Form_Options return Form_Option_Set
is
begin
return Get_Options (Null_Form);
end Default_Form_Options;
end Terminal_Interface.Curses.Forms;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_user_data.adb 0000644 0001751 0000144 00000010155 12340207631 025202 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.15 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-- |
-- |=====================================================================
-- | man page form_field_userptr.3x
-- |=====================================================================
-- |
package body Terminal_Interface.Curses.Forms.Field_User_Data is
-- |
-- |
-- |
use type Interfaces.C.int;
procedure Set_User_Data (Fld : Field;
Data : User_Access)
is
function Set_Field_Userptr (Fld : Field;
Usr : User_Access) return Eti_Error;
pragma Import (C, Set_Field_Userptr, "set_field_userptr");
begin
Eti_Exception (Set_Field_Userptr (Fld, Data));
end Set_User_Data;
-- |
-- |
-- |
function Get_User_Data (Fld : Field) return User_Access
is
function Field_Userptr (Fld : Field) return User_Access;
pragma Import (C, Field_Userptr, "field_userptr");
begin
return Field_Userptr (Fld);
end Get_User_Data;
procedure Get_User_Data (Fld : Field;
Data : out User_Access)
is
begin
Data := Get_User_Data (Fld);
end Get_User_Data;
end Terminal_Interface.Curses.Forms.Field_User_Data;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-intfield.ads 0000644 0001751 0000144 00000006574 11315445666 026243 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.IntField --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.IntField is
pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.IntField);
type Integer_Field is new Field_Type with
record
Precision : Natural;
Lower_Limit : Integer;
Upper_Limit : Integer;
end record;
procedure Set_Field_Type (Fld : Field;
Typ : Integer_Field);
pragma Inline (Set_Field_Type);
end Terminal_Interface.Curses.Forms.Field_Types.IntField;
AdaCurses-20140726/src/terminal_interface-curses-text_io-aux.adb 0000644 0001751 0000144 00000012424 11315445062 023216 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Aux --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2006,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.13 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package body Terminal_Interface.Curses.Text_IO.Aux is
procedure Put_Buf
(Win : Window;
Buf : String;
Width : Field;
Signal : Boolean := True;
Ljust : Boolean := False)
is
L : Field;
Len : Field;
W : Field := Width;
LC : Line_Count;
CC : Column_Count;
Y : Line_Position;
X : Column_Position;
procedure Output (From, To : Field);
procedure Output (From, To : Field)
is
begin
if Len > 0 then
if W = 0 then
W := Len;
end if;
if Len > W then
-- LRM A10.6 (7) says this
W := Len;
end if;
pragma Assert (Len <= W);
Get_Size (Win, LC, CC);
if Column_Count (Len) > CC then
if Signal then
raise Layout_Error;
else
return;
end if;
else
if Len < W and then not Ljust then
declare
Filler : constant String (1 .. (W - Len))
:= (others => ' ');
begin
Put (Win, Filler);
end;
end if;
Get_Cursor_Position (Win, Y, X);
if (X + Column_Position (Len)) > CC then
New_Line (Win);
end if;
Put (Win, Buf (From .. To));
if Len < W and then Ljust then
declare
Filler : constant String (1 .. (W - Len))
:= (others => ' ');
begin
Put (Win, Filler);
end;
end if;
end if;
end if;
end Output;
begin
pragma Assert (Win /= Null_Window);
if Ljust then
L := 1;
for I in 1 .. Buf'Length loop
exit when Buf (L) = ' ';
L := L + 1;
end loop;
Len := L - 1;
Output (1, Len);
else -- input buffer is not left justified
L := Buf'Length;
for I in 1 .. Buf'Length loop
exit when Buf (L) = ' ';
L := L - 1;
end loop;
Len := Buf'Length - L;
Output (L + 1, Buf'Length);
end if;
end Put_Buf;
end Terminal_Interface.Curses.Text_IO.Aux;
AdaCurses-20140726/src/terminal_interface-curses-termcap.adb 0000644 0001751 0000144 00000015530 11315445062 022404 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Termcap --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000-2006,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
package body Terminal_Interface.Curses.Termcap is
function Get_Entry (Name : String) return Boolean
is
function tgetent (name : char_array; val : char_array)
return C_Int;
pragma Import (C, tgetent, "tgetent");
NameTxt : char_array (0 .. Name'Length);
Length : size_t;
ignored : constant char_array (0 .. 0) := (0 => nul);
result : C_Int;
begin
To_C (Name, NameTxt, Length);
result := tgetent (char_array (ignored), NameTxt);
if result = -1 then
raise Curses_Exception;
else
return Boolean'Val (result);
end if;
end Get_Entry;
------------------------------------------------------------------------------
function Get_Flag (Name : String) return Boolean
is
function tgetflag (id : char_array) return C_Int;
pragma Import (C, tgetflag, "tgetflag");
Txt : char_array (0 .. Name'Length);
Length : size_t;
begin
To_C (Name, Txt, Length);
if tgetflag (Txt) = 0 then
return False;
else
return True;
end if;
end Get_Flag;
------------------------------------------------------------------------------
procedure Get_Number (Name : String;
Value : out Integer;
Result : out Boolean)
is
function tgetnum (id : char_array) return C_Int;
pragma Import (C, tgetnum, "tgetnum");
Txt : char_array (0 .. Name'Length);
Length : size_t;
begin
To_C (Name, Txt, Length);
Value := Integer (tgetnum (Txt));
if Value = -1 then
Result := False;
else
Result := True;
end if;
end Get_Number;
------------------------------------------------------------------------------
procedure Get_String (Name : String;
Value : out String;
Result : out Boolean)
is
function tgetstr (id : char_array;
buf : char_array) return chars_ptr;
pragma Import (C, tgetstr, "tgetstr");
Txt : char_array (0 .. Name'Length);
Length : size_t;
Txt2 : chars_ptr;
type t is new char_array (0 .. 1024); -- does it need to be 1024?
Return_Buffer : constant t := (others => nul);
begin
To_C (Name, Txt, Length);
Txt2 := tgetstr (Txt, char_array (Return_Buffer));
if Txt2 = Null_Ptr then
Result := False;
else
Value := Fill_String (Txt2);
Result := True;
end if;
end Get_String;
function Get_String (Name : String) return Boolean
is
function tgetstr (Id : char_array;
buf : char_array) return chars_ptr;
pragma Import (C, tgetstr, "tgetstr");
Txt : char_array (0 .. Name'Length);
Length : size_t;
Txt2 : chars_ptr;
type t is new char_array (0 .. 1024); -- does it need to be 1024?
Phony_Txt : constant t := (others => nul);
begin
To_C (Name, Txt, Length);
Txt2 := tgetstr (Txt, char_array (Phony_Txt));
if Txt2 = Null_Ptr then
return False;
else
return True;
end if;
end Get_String;
------------------------------------------------------------------------------
function TGoto (Cap : String;
Col : Column_Position;
Row : Line_Position) return Termcap_String is
function tgoto (cap : char_array;
col : C_Int;
row : C_Int) return chars_ptr;
pragma Import (C, tgoto);
Txt : char_array (0 .. Cap'Length);
Length : size_t;
begin
To_C (Cap, Txt, Length);
return Termcap_String (Fill_String
(tgoto (Txt, C_Int (Col), C_Int (Row))));
end TGoto;
end Terminal_Interface.Curses.Termcap;
AdaCurses-20140726/src/terminal_interface-curses-text_io-integer_io.ads 0000644 0001751 0000144 00000006604 11315445471 024575 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Integer_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic
type Num is range <>;
package Terminal_Interface.Curses.Text_IO.Integer_IO is
Default_Width : Field := Num'Width;
Default_Base : Number_Base := 10;
procedure Put
(Win : Window;
Item : Num;
Width : Field := Default_Width;
Base : Number_Base := Default_Base);
procedure Put
(Item : Num;
Width : Field := Default_Width;
Base : Number_Base := Default_Base);
private
pragma Inline (Put);
end Terminal_Interface.Curses.Text_IO.Integer_IO;
AdaCurses-20140726/src/terminal_interface-curses-menus-item_user_data.adb 0000644 0001751 0000144 00000007567 12340207631 025073 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Menus.Item_User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.14 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Menus.Item_User_Data is
use type Interfaces.C.int;
procedure Set_User_Data (Itm : Item;
Data : User_Access)
is
function Set_Item_Userptr (Itm : Item;
Addr : User_Access) return Eti_Error;
pragma Import (C, Set_Item_Userptr, "set_item_userptr");
begin
Eti_Exception (Set_Item_Userptr (Itm, Data));
end Set_User_Data;
function Get_User_Data (Itm : Item) return User_Access
is
function Item_Userptr (Itm : Item) return User_Access;
pragma Import (C, Item_Userptr, "item_userptr");
begin
return Item_Userptr (Itm);
end Get_User_Data;
procedure Get_User_Data (Itm : Item;
Data : out User_Access)
is
begin
Data := Get_User_Data (Itm);
end Get_User_Data;
end Terminal_Interface.Curses.Menus.Item_User_Data;
AdaCurses-20140726/src/modules 0000644 0001751 0000144 00000007741 11411507072 014543 0 ustar tom users # $Id: modules,v 1.3 2010/06/26 23:33:14 tom Exp $
##############################################################################
# Copyright (c) 2010 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. #
##############################################################################
#
# Author: Thomas E. Dickey 2010
#
# Library objects
# rootname depend-spec depend-body unit
$(ALIB) $(srcdir) none spec
$(ABASE)-aux none $(srcdir) body
$(ABASE) none . body
$(ABASE)-terminfo $(srcdir) $(srcdir) body
$(ABASE)-termcap $(srcdir) $(srcdir) body
$(ABASE)-putwin $(srcdir) $(srcdir) body
$(ABASE)-trace . . body
$(ABASE)-mouse . $(srcdir) body
$(ABASE)-panels . $(srcdir) body
$(ABASE)-menus . $(srcdir) body
$(ABASE)-forms . $(srcdir) body
$(ABASE)-forms-field_types . $(srcdir) body
$(ABASE)-forms-field_types-alpha $(srcdir) $(srcdir) body
$(ABASE)-forms-field_types-alphanumeric $(srcdir) $(srcdir) body
$(ABASE)-forms-field_types-intfield $(srcdir) $(srcdir) body
$(ABASE)-forms-field_types-numeric $(srcdir) $(srcdir) body
$(ABASE)-forms-field_types-regexp $(srcdir) $(srcdir) body
$(ABASE)-forms-field_types-enumeration $(srcdir) $(srcdir) body
$(ABASE)-forms-field_types-ipv4_address $(srcdir) $(srcdir) body
$(ABASE)-forms-field_types-user $(srcdir) $(srcdir) body
$(ABASE)-forms-field_types-user-choice $(srcdir) $(srcdir) body
$(ABASE)-text_io $(srcdir) $(srcdir) body
$(ABASE)-text_io-aux $(srcdir) $(srcdir) body
$(ABASE)-menus-menu_user_data . $(srcdir) body
$(ABASE)-menus-item_user_data . $(srcdir) body
$(ABASE)-forms-form_user_data . $(srcdir) body
$(ABASE)-forms-field_user_data . $(srcdir) body
$(ABASE)-forms-field_types-enumeration-ada $(srcdir) $(srcdir) body
$(ABASE)-panels-user_data . $(srcdir) body
$(ABASE)-text_io-integer_io $(srcdir) $(srcdir) body
$(ABASE)-text_io-float_io $(srcdir) $(srcdir) body
$(ABASE)-text_io-fixed_io $(srcdir) $(srcdir) body
$(ABASE)-text_io-decimal_io $(srcdir) $(srcdir) body
$(ABASE)-text_io-enumeration_io $(srcdir) $(srcdir) body
$(ABASE)-text_io-modular_io $(srcdir) $(srcdir) body
$(ABASE)-text_io-complex_io $(srcdir) $(srcdir) body
AdaCurses-20140726/src/terminal_interface-curses-aux.adb 0000644 0001751 0000144 00000012130 11315445604 021541 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Aux --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package body Terminal_Interface.Curses.Aux is
--
-- Some helpers
procedure Fill_String (Cp : chars_ptr;
Str : out String)
is
-- Fill the string with the characters referenced by the
-- chars_ptr.
--
Len : Natural;
begin
if Cp /= Null_Ptr then
Len := Natural (Strlen (Cp));
if Str'Length < Len then
raise Constraint_Error;
end if;
declare
S : String (1 .. Len);
begin
S := Value (Cp);
Str (Str'First .. (Str'First + Len - 1)) := S (S'Range);
end;
else
Len := 0;
end if;
if Len < Str'Length then
Str ((Str'First + Len) .. Str'Last) := (others => ' ');
end if;
end Fill_String;
function Fill_String (Cp : chars_ptr) return String
is
Len : Natural;
begin
if Cp /= Null_Ptr then
Len := Natural (Strlen (Cp));
if Len = 0 then
return "";
else
declare
S : String (1 .. Len);
begin
Fill_String (Cp, S);
return S;
end;
end if;
else
return "";
end if;
end Fill_String;
procedure Eti_Exception (Code : Eti_Error)
is
begin
case Code is
when E_Ok => null;
when E_System_Error => raise Eti_System_Error;
when E_Bad_Argument => raise Eti_Bad_Argument;
when E_Posted => raise Eti_Posted;
when E_Connected => raise Eti_Connected;
when E_Bad_State => raise Eti_Bad_State;
when E_No_Room => raise Eti_No_Room;
when E_Not_Posted => raise Eti_Not_Posted;
when E_Unknown_Command => raise Eti_Unknown_Command;
when E_No_Match => raise Eti_No_Match;
when E_Not_Selectable => raise Eti_Not_Selectable;
when E_Not_Connected => raise Eti_Not_Connected;
when E_Request_Denied => raise Eti_Request_Denied;
when E_Invalid_Field => raise Eti_Invalid_Field;
when E_Current => raise Eti_Current;
end case;
end Eti_Exception;
end Terminal_Interface.Curses.Aux;
AdaCurses-20140726/src/terminal_interface-curses-putwin.adb 0000644 0001751 0000144 00000007636 07746514446 022327 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.PutWin --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.3 $
-- Binding Version 01.00
with Ada.Streams.Stream_IO.C_Streams;
with Interfaces.C_Streams;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.PutWin is
package ICS renames Interfaces.C_Streams;
package ACS renames Ada.Streams.Stream_IO.C_Streams;
use type C_Int;
procedure Put_Window (Win : Window;
File : Ada.Streams.Stream_IO.File_Type) is
function putwin (Win : Window; f : ICS.FILEs) return C_Int;
pragma Import (C, putwin, "putwin");
R : constant C_Int := putwin (Win, ACS.C_Stream (File));
begin
if R /= Curses_Ok then
raise Curses_Exception;
end if;
end Put_Window;
function Get_Window (File : Ada.Streams.Stream_IO.File_Type)
return Window is
function getwin (f : ICS.FILEs) return Window;
pragma Import (C, getwin, "getwin");
W : constant Window := getwin (ACS.C_Stream (File));
begin
if W = Null_Window then
raise Curses_Exception;
else
return W;
end if;
end Get_Window;
end Terminal_Interface.Curses.PutWin;
AdaCurses-20140726/src/terminal_interface-curses-text_io-float_io.adb 0000644 0001751 0000144 00000007422 11315445471 024223 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Float_IO --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;
package body Terminal_Interface.Curses.Text_IO.Float_IO is
package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
package FIO is new Ada.Text_IO.Float_IO (Num);
procedure Put
(Win : Window;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
Buf : String (1 .. Field'Last);
Len : Field := Fore + 1 + Aft;
begin
if Exp > 0 then
Len := Len + 1 + Exp;
end if;
FIO.Put (Buf, Item, Aft, Exp);
Aux.Put_Buf (Win, Buf, Len, False);
end Put;
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
begin
Put (Get_Window, Item, Fore, Aft, Exp);
end Put;
end Terminal_Interface.Curses.Text_IO.Float_IO;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-enumeration.adb 0000644 0001751 0000144 00000012312 12340207631 026720 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
function Create (Info : Enumeration_Info;
Auto_Release_Names : Boolean := False)
return Enumeration_Field
is
procedure Release_String is
new Ada.Unchecked_Deallocation (String,
String_Access);
E : Enumeration_Field;
L : constant size_t := 1 + size_t (Info.C);
S : String_Access;
begin
E.Case_Sensitive := Info.Case_Sensitive;
E.Match_Must_Be_Unique := Info.Match_Must_Be_Unique;
E.Arr := new chars_ptr_array (size_t (1) .. L);
for I in 1 .. Positive (L - 1) loop
if Info.Names (I) = null then
raise Form_Exception;
end if;
E.Arr.all (size_t (I)) := New_String (Info.Names (I).all);
if Auto_Release_Names then
S := Info.Names (I);
Release_String (S);
end if;
end loop;
E.Arr.all (L) := Null_Ptr;
return E;
end Create;
procedure Release (Enum : in out Enumeration_Field)
is
I : size_t := 0;
P : chars_ptr;
begin
loop
P := Enum.Arr.all (I);
exit when P = Null_Ptr;
Free (P);
Enum.Arr.all (I) := Null_Ptr;
I := I + 1;
end loop;
Enum.Arr := null;
end Release;
procedure Set_Field_Type (Fld : Field;
Typ : Enumeration_Field)
is
function Set_Fld_Type (F : Field := Fld;
Arg1 : chars_ptr_array;
Arg2 : C_Int;
Arg3 : C_Int) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_enum");
begin
if Typ.Arr = null then
raise Form_Exception;
end if;
Eti_Exception
(Set_Fld_Type
(Arg1 => Typ.Arr.all,
Arg2 => C_Int (Boolean'Pos (Typ.Case_Sensitive)),
Arg3 => C_Int (Boolean'Pos (Typ.Match_Must_Be_Unique))));
Wrap_Builtin (Fld, Typ, C_Choice_Router);
end Set_Field_Type;
end Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
AdaCurses-20140726/src/terminal_interface-curses-text_io-enumeration_io.adb 0000644 0001751 0000144 00000007765 11315445471 025456 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Enumeration_IO --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Terminal_Interface.Curses.Text_IO.Aux;
package body Terminal_Interface.Curses.Text_IO.Enumeration_IO is
package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
package EIO is new Ada.Text_IO.Enumeration_IO (Enum);
procedure Put
(Win : Window;
Item : Enum;
Width : Field := Default_Width;
Set : Type_Set := Default_Setting)
is
Buf : String (1 .. Field'Last);
Tset : Ada.Text_IO.Type_Set;
begin
if Set /= Mixed_Case then
Tset := Ada.Text_IO.Type_Set'Val (Type_Set'Pos (Set));
else
Tset := Ada.Text_IO.Lower_Case;
end if;
EIO.Put (Buf, Item, Tset);
if Set = Mixed_Case then
Buf (Buf'First) := To_Upper (Buf (Buf'First));
end if;
Aux.Put_Buf (Win, Buf, Width, True, True);
end Put;
procedure Put
(Item : Enum;
Width : Field := Default_Width;
Set : Type_Set := Default_Setting)
is
begin
Put (Get_Window, Item, Width, Set);
end Put;
end Terminal_Interface.Curses.Text_IO.Enumeration_IO;
AdaCurses-20140726/src/terminal_interface-curses-text_io-float_io.ads 0000644 0001751 0000144 00000006712 11315445471 024245 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Float_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic
type Num is digits <>;
package Terminal_Interface.Curses.Text_IO.Float_IO is
Default_Fore : Field := 2;
Default_Aft : Field := Num'Digits - 1;
Default_Exp : Field := 3;
procedure Put
(Win : Window;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
private
pragma Inline (Put);
end Terminal_Interface.Curses.Text_IO.Float_IO;
AdaCurses-20140726/src/c_varargs_to_ada.h 0000644 0001751 0000144 00000006402 11541177375 016605 0 ustar tom users /****************************************************************************
* Copyright (c) 2011 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: c_varargs_to_ada.h,v 1.3 2011/03/19 19:07:41 tom Exp $ */
#ifndef __C_VARARGS_TO_ADA_H
#define __C_VARARGS_TO_ADA_H
#include
extern int set_field_type_alnum(FIELD * /* field */ ,
int /* minimum_width */ );
extern int set_field_type_alpha(FIELD * /* field */ ,
int /* minimum_width */ );
extern int set_field_type_enum(FIELD * /* field */ ,
char ** /* value_list */ ,
int /* case_sensitive */ ,
int /* unique_match */ );
extern int set_field_type_integer(FIELD * /* field */ ,
int /* precision */ ,
long /* minimum */ ,
long /* maximum */ );
extern int set_field_type_numeric(FIELD * /* field */ ,
int /* precision */ ,
double /* minimum */ ,
double /* maximum */ );
extern int set_field_type_regexp(FIELD * /* field */ ,
char * /* regular_expression */ );
extern int set_field_type_ipv4(FIELD * /* field */ );
extern int set_field_type_user(FIELD * /* field */ ,
FIELDTYPE * /* fieldtype */ ,
void * /* arg */ );
extern void *void_star_make_arg(va_list * /* list */ );
#ifdef TRACE
extern void _traces(const char * /* fmt */
,char * /* arg */ );
#endif
#endif /* __C_VARARGS_TO_ADA_H */
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-enumeration-ada.ads 0000644 0001751 0000144 00000007230 07746514446 027512 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.10 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic
type T is (<>);
package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is
pragma Preelaborate
(Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada);
function Create (Set : Type_Set := Mixed_Case;
Case_Sensitive : Boolean := False;
Must_Be_Unique : Boolean := False)
return Enumeration_Field;
function Value (Fld : Field;
Buf : Buffer_Number := Buffer_Number'First) return T;
-- Translate the content of the fields buffer - indicated by the
-- buffer number - into an enumeration value. If the buffer is empty
-- or the content is invalid, a Constraint_Error is raises.
end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
AdaCurses-20140726/src/Makefile.in 0000644 0001751 0000144 00000026176 12342467622 015232 0 ustar tom users ##############################################################################
# Copyright (c) 1998-2011,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 "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. #
##############################################################################
#
# Author: Juergen Pfeifer, 1996
#
# $Id: Makefile.in,v 1.69 2014/06/01 00:10:58 tom Exp $
#
.SUFFIXES:
SHELL = /bin/sh
VPATH = @srcdir@
THIS = Makefile
MODEL = ../../@DFT_OBJ_SUBDIR@
DESTDIR = @DESTDIR@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
includedir = @includedir@
libdir = @libdir@
LIBDIR = $(DESTDIR)$(libdir)
ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@
ADA_OBJECTS = $(DESTDIR)@ADA_OBJECTS@
INSTALL = @INSTALL@
INSTALL_LIB = @INSTALL@ @INSTALL_LIB@
AR = @AR@
ARFLAGS = @ARFLAGS@
AWK = @AWK@
LN_S = @LN_S@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @ACPPFLAGS@ @CPPFLAGS@ \
-DHAVE_CONFIG_H -I$(srcdir)
CCFLAGS = $(CPPFLAGS) $(CFLAGS)
CFLAGS_NORMAL = $(CCFLAGS)
CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
CFLAGS_PROFILE = $(CCFLAGS) -pg
CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
LINK = $(CC)
LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@
RANLIB = @RANLIB@
################################################################################
ADA = @cf_ada_compiler@
ADAPREP = gnatprep
ADAFLAGS = @ADAFLAGS@ -I. -I$(srcdir)
LIB_NAME = AdaCurses
SONAME = @ADA_SHAREDLIB@
GNAT_PROJECT = $(srcdir)/library.gpr
# build/source are the Ada95 tree
BUILD_DIR = ..
SOURCE_DIR = ..
BUILD_DIR_LIB = $(BUILD_DIR)/lib
SOURCE_DIR_SRC = $(SOURCE_DIR)/src
ADAMAKE = @cf_ada_make@
ADAMAKEFLAGS = \
-P$(GNAT_PROJECT) \
-XBUILD_DIR=`cd $(BUILD_DIR);pwd` \
-XSOURCE_DIR=`cd $(SOURCE_DIR);pwd` \
-XSOURCE_DIR2=`cd $(srcdir);pwd` \
-XLIB_NAME=$(LIB_NAME) \
-XSONAME=$(SONAME)
CARGS = -cargs $(ADAFLAGS)
LARGS =
STATIC_LIBNAME = lib$(LIB_NAME).a
SHARED_LIBNAME = $(SONAME)
SHARED_SYMLINK = lib$(LIB_NAME).so
ALIB = @cf_ada_package@
ABASE = $(ALIB)-curses
################################################################################
GENERATED_SOURCES=$(ABASE).ads \
$(ABASE).adb \
$(ABASE)-aux.ads \
$(ABASE)-trace.ads \
$(ABASE)-menus.ads \
$(ABASE)-forms.ads \
$(ABASE)-mouse.ads \
$(ABASE)-panels.ads \
$(ABASE)-menus-menu_user_data.ads \
$(ABASE)-menus-item_user_data.ads \
$(ABASE)-forms-form_user_data.ads \
$(ABASE)-forms-field_types.ads \
$(ABASE)-forms-field_user_data.ads \
$(ABASE)-panels-user_data.ads
################################################################################
LIBOBJS=$(ALIB).o \
$(ABASE)-aux.o \
$(ABASE).o \
$(ABASE)-terminfo.o \
$(ABASE)-termcap.o \
$(ABASE)-putwin.o \
$(ABASE)-trace.o \
$(ABASE)-mouse.o \
$(ABASE)-panels.o \
$(ABASE)-menus.o \
$(ABASE)-forms.o \
$(ABASE)-forms-field_types.o \
$(ABASE)-forms-field_types-alpha.o \
$(ABASE)-forms-field_types-alphanumeric.o \
$(ABASE)-forms-field_types-intfield.o \
$(ABASE)-forms-field_types-numeric.o \
$(ABASE)-forms-field_types-regexp.o \
$(ABASE)-forms-field_types-enumeration.o \
$(ABASE)-forms-field_types-ipv4_address.o \
$(ABASE)-forms-field_types-user.o \
$(ABASE)-forms-field_types-user-choice.o \
$(ABASE)-text_io.o \
$(ABASE)-text_io-aux.o
# Ada object files for generic packages. Since gnat 3.10 they are
# also compiled
GENOBJS=$(ABASE)-menus-menu_user_data.o \
$(ABASE)-menus-item_user_data.o \
$(ABASE)-forms-form_user_data.o \
$(ABASE)-forms-field_user_data.o \
$(ABASE)-forms-field_types-enumeration-ada.o \
$(ABASE)-panels-user_data.o \
$(ABASE)-text_io-integer_io.o \
$(ABASE)-text_io-float_io.o \
$(ABASE)-text_io-fixed_io.o \
$(ABASE)-text_io-decimal_io.o \
$(ABASE)-text_io-enumeration_io.o \
$(ABASE)-text_io-modular_io.o \
$(ABASE)-text_io-complex_io.o
all :: $(BUILD_DIR_LIB)/$(STATIC_LIBNAME)
@echo done
$(ADA_INCLUDE) \
$(ADA_OBJECTS) \
$(LIBDIR) \
$(BUILD_DIR_LIB) :
mkdir -p $@
sources :
@echo made $@
libs \
install \
install.libs :: \
$(BUILD_DIR_LIB)/$(STATIC_LIBNAME)
@echo made $(STATIC_LIBNAME)
install \
install.libs :: \
$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \
$(ADA_OBJECTS)
@$(INSTALL_LIB) \
$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) \
$(ADA_OBJECTS)
uninstall \
uninstall.libs ::
@rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
mostlyclean ::
rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a
clean :: mostlyclean
rm -f $(ABASE)-trace.adb
distclean :: clean
rm -f Makefile
realclean :: distclean
BASEDEPS=$(ABASE).ads $(ABASE)-aux.ads $(ABASE).adb
$(ABASE)-trace.adb : $(srcdir)/$(ABASE)-trace.adb_p
rm -f $@
$(ADAPREP) -DADA_TRACE=@ADA_TRACE@ $(srcdir)/$(ABASE)-trace.adb_p $@
###############################################################################
# Use these definitions when building a shared library.
SHARED_C_OBJS = c_varargs_to_ada.o c_threaded_variables.o ncurses_compat.o
SHARED_OBJS = $(SHARED_C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@
c_varargs_to_ada.o : $(srcdir)/c_varargs_to_ada.c
$(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_varargs_to_ada.c
c_threaded_variables.o : $(srcdir)/c_threaded_variables.c
$(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/c_threaded_variables.c
ncurses_compat.o : $(srcdir)/ncurses_compat.c
$(CC) $(CFLAGS_DEFAULT) -c -o $@ $(srcdir)/ncurses_compat.c
###############################################################################
# Use these definitions when building a static library.
STATIC_C_OBJS = static_c_varargs_to_ada.o static_c_threaded_variables.o static_ncurses_compat.o
STATIC_OBJS = $(STATIC_C_OBJS) @USE_OLD_MAKERULES@$(LIBOBJS) @cf_generic_objects@
static_c_varargs_to_ada.o : $(srcdir)/c_varargs_to_ada.c
$(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/c_varargs_to_ada.c
static_c_threaded_variables.o : $(srcdir)/c_threaded_variables.c
$(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/c_threaded_variables.c
static_ncurses_compat.o : $(srcdir)/ncurses_compat.c
$(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/ncurses_compat.c
###############################################################################
@USE_OLD_MAKERULES@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
@USE_OLD_MAKERULES@ $(BUILD_DIR_LIB) \
@USE_OLD_MAKERULES@ $(STATIC_OBJS)
@USE_OLD_MAKERULES@ $(AR) $(ARFLAGS) $@ $(STATIC_OBJS)
$(BUILD_DIR)/static-ali : ; mkdir -p $@
$(BUILD_DIR)/static-obj : ; mkdir -p $@
STATIC_DIRS = \
$(BUILD_DIR_LIB) \
$(BUILD_DIR)/static-ali \
$(BUILD_DIR)/static-obj
@USE_GNAT_PROJECTS@$(BUILD_DIR_LIB)/$(STATIC_LIBNAME) :: \
@USE_GNAT_PROJECTS@ $(ABASE)-trace.adb \
@USE_GNAT_PROJECTS@ $(STATIC_C_OBJS) \
@USE_GNAT_PROJECTS@ $(STATIC_DIRS)
@USE_GNAT_PROJECTS@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=static
@USE_GNAT_PROJECTS@ $(AR) $(ARFLAGS) $@ $(STATIC_C_OBJS)
@USE_GNAT_PROJECTS@
@USE_GNAT_LIBRARIES@install \
@USE_GNAT_LIBRARIES@install.libs :: \
@USE_GNAT_LIBRARIES@ $(ADA_OBJECTS)
@USE_GNAT_LIBRARIES@ $(INSTALL_LIB) \
@USE_GNAT_LIBRARIES@ $(BUILD_DIR)/static-ali/*.ali \
@USE_GNAT_LIBRARIES@ $(ADA_OBJECTS)
uninstall \
uninstall.libs ::
@rm -f $(ADA_OBJECTS)/$(STATIC_LIBNAME)
@USE_GNAT_LIBRARIES@uninstall \
@USE_GNAT_LIBRARIES@uninstall.libs ::
@USE_GNAT_LIBRARIES@ @$(SHELL) -c 'for name in $(BUILD_DIR)/static-ali/*.ali ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
$(BUILD_DIR)/dynamic-ali : ; mkdir -p $@
$(BUILD_DIR)/dynamic-obj : ; mkdir -p $@
SHARED_DIRS = \
$(BUILD_DIR_LIB) \
$(BUILD_DIR)/dynamic-ali \
$(BUILD_DIR)/dynamic-obj
@MAKE_ADA_SHAREDLIB@all :: $(BUILD_DIR_LIB)/$(SHARED_LIBNAME)
@MAKE_ADA_SHAREDLIB@$(BUILD_DIR_LIB)/$(SHARED_LIBNAME) :: \
@MAKE_ADA_SHAREDLIB@ $(ABASE)-trace.adb \
@MAKE_ADA_SHAREDLIB@ $(SHARED_DIRS) \
@MAKE_ADA_SHAREDLIB@ $(SHARED_OBJS)
@MAKE_ADA_SHAREDLIB@ cp $(SHARED_OBJS) $(BUILD_DIR)/dynamic-obj/
@MAKE_ADA_SHAREDLIB@ $(ADAMAKE) $(ADAMAKEFLAGS) -XLIB_KIND=dynamic
install \
install.libs :: $(ADA_INCLUDE)
$(INSTALL_LIB) \
$(SOURCE_DIR_SRC)/*.ad[sb] \
$(ADA_INCLUDE)
install \
install.libs :: $(ADA_INCLUDE)
$(INSTALL_LIB) \
$(GENERATED_SOURCES) \
$(ADA_INCLUDE)
uninstall \
uninstall.libs ::
$(SHELL) -c 'for name in $(SOURCE_DIR_SRC)/*.ad[sb] $(GENERATED_SOURCES); do rm -f $(ADA_INCLUDE)/`basename $$name`; done'
@MAKE_ADA_SHAREDLIB@install \
@MAKE_ADA_SHAREDLIB@install.libs :: $(ADA_OBJECTS) $(LIBDIR)
@MAKE_ADA_SHAREDLIB@ $(INSTALL_LIB) \
@MAKE_ADA_SHAREDLIB@ $(BUILD_DIR)/dynamic-ali/* \
@MAKE_ADA_SHAREDLIB@ $(ADA_OBJECTS)
@MAKE_ADA_SHAREDLIB@ $(INSTALL_LIB) \
@MAKE_ADA_SHAREDLIB@ $(BUILD_DIR_LIB)/$(SHARED_LIBNAME) \
@MAKE_ADA_SHAREDLIB@ $(LIBDIR)
@MAKE_ADA_SHAREDLIB@ cd $(LIBDIR) && $(LN_S) $(SHARED_LIBNAME) $(SHARED_SYMLINK)
@MAKE_ADA_SHAREDLIB@
@MAKE_ADA_SHAREDLIB@uninstall \
@MAKE_ADA_SHAREDLIB@uninstall.libs ::
@MAKE_ADA_SHAREDLIB@ $(SHELL) -c 'for name in $(BUILD_DIR)/dynamic-ali/* ; do rm -f $(ADA_OBJECTS)/`basename $$name`; done'
@MAKE_ADA_SHAREDLIB@
@MAKE_ADA_SHAREDLIB@uninstall \
@MAKE_ADA_SHAREDLIB@uninstall.libs ::
@MAKE_ADA_SHAREDLIB@ rm -f $(LIBDIR)/$(SHARED_SYMLINK)
@MAKE_ADA_SHAREDLIB@ rm -f $(LIBDIR)/$(SHARED_LIBNAME)
clean ::
rm -rf $(BUILD_DIR)/*-ali
rm -rf $(BUILD_DIR)/*-obj
rm -rf $(BUILD_DIR_LIB)
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-user.adb 0000644 0001751 0000144 00000013735 12340207631 025362 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.User --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.23 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with System.Address_To_Access_Conversions;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.User is
procedure Set_Field_Type (Fld : Field;
Typ : User_Defined_Field_Type)
is
function Allocate_Arg (T : User_Defined_Field_Type'Class)
return Argument_Access;
function Set_Fld_Type (F : Field := Fld;
Cft : C_Field_Type := C_Generic_Type;
Arg1 : Argument_Access)
return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_user");
function Allocate_Arg (T : User_Defined_Field_Type'Class)
return Argument_Access
is
Ptr : constant Field_Type_Access
:= new User_Defined_Field_Type'Class'(T);
begin
return new Argument'(Usr => System.Null_Address,
Typ => Ptr,
Cft => Null_Field_Type);
end Allocate_Arg;
begin
Eti_Exception (Set_Fld_Type (Arg1 => Allocate_Arg (Typ)));
end Set_Field_Type;
package Argument_Conversions is
new System.Address_To_Access_Conversions (Argument);
function Generic_Field_Check (Fld : Field;
Usr : System.Address) return Curses_Bool
is
Result : Boolean;
Udf : constant User_Defined_Field_Type_Access :=
User_Defined_Field_Type_Access
(Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
begin
Result := Field_Check (Fld, Udf.all);
return Curses_Bool (Boolean'Pos (Result));
end Generic_Field_Check;
function Generic_Char_Check (Ch : C_Int;
Usr : System.Address) return Curses_Bool
is
Result : Boolean;
Udf : constant User_Defined_Field_Type_Access :=
User_Defined_Field_Type_Access
(Argument_Access (Argument_Conversions.To_Pointer (Usr)).all.Typ);
begin
Result := Character_Check (Character'Val (Ch), Udf.all);
return Curses_Bool (Boolean'Pos (Result));
end Generic_Char_Check;
-- -----------------------------------------------------------------------
--
function C_Generic_Type return C_Field_Type
is
Res : Eti_Error;
T : C_Field_Type;
begin
if M_Generic_Type = Null_Field_Type then
T := New_Fieldtype (Generic_Field_Check'Access,
Generic_Char_Check'Access);
if T = Null_Field_Type then
raise Form_Exception;
else
Res := Set_Fieldtype_Arg (T,
Make_Arg'Access,
Copy_Arg'Access,
Free_Arg'Access);
Eti_Exception (Res);
end if;
M_Generic_Type := T;
end if;
pragma Assert (M_Generic_Type /= Null_Field_Type);
return M_Generic_Type;
end C_Generic_Type;
end Terminal_Interface.Curses.Forms.Field_Types.User;
AdaCurses-20140726/src/terminal_interface-curses-text_io-integer_io.adb 0000644 0001751 0000144 00000007165 11315445471 024557 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Integer_IO --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;
package body Terminal_Interface.Curses.Text_IO.Integer_IO is
package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
package IIO is new Ada.Text_IO.Integer_IO (Num);
procedure Put
(Win : Window;
Item : Num;
Width : Field := Default_Width;
Base : Number_Base := Default_Base)
is
Buf : String (1 .. Field'Last);
begin
IIO.Put (Buf, Item, Base);
Aux.Put_Buf (Win, Buf, Width);
end Put;
procedure Put
(Item : Num;
Width : Field := Default_Width;
Base : Number_Base := Default_Base)
is
begin
Put (Get_Window, Item, Width, Base);
end Put;
end Terminal_Interface.Curses.Text_IO.Integer_IO;
AdaCurses-20140726/src/terminal_interface-curses-text_io-fixed_io.ads 0000644 0001751 0000144 00000006711 11315445471 024236 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Fixed_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic
type Num is delta <>;
package Terminal_Interface.Curses.Text_IO.Fixed_IO is
Default_Fore : Field := Num'Fore;
Default_Aft : Field := Num'Aft;
Default_Exp : Field := 0;
procedure Put
(Win : Window;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
private
pragma Inline (Put);
end Terminal_Interface.Curses.Text_IO.Fixed_IO;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-regexp.ads 0000644 0001751 0000144 00000006602 11315446021 025711 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.RegExp --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.RegExp is
pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp);
type String_Access is access String;
type Regular_Expression_Field is new Field_Type with
record
Regular_Expression : String_Access;
end record;
procedure Set_Field_Type (Fld : Field;
Typ : Regular_Expression_Field);
pragma Inline (Set_Field_Type);
end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
AdaCurses-20140726/src/terminal_interface-curses-text_io-modular_io.adb 0000644 0001751 0000144 00000007165 11315445551 024564 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Modular_IO --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;
package body Terminal_Interface.Curses.Text_IO.Modular_IO is
package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
package MIO is new Ada.Text_IO.Modular_IO (Num);
procedure Put
(Win : Window;
Item : Num;
Width : Field := Default_Width;
Base : Number_Base := Default_Base)
is
Buf : String (1 .. Field'Last);
begin
MIO.Put (Buf, Item, Base);
Aux.Put_Buf (Win, Buf, Width);
end Put;
procedure Put
(Item : Num;
Width : Field := Default_Width;
Base : Number_Base := Default_Base)
is
begin
Put (Get_Window, Item, Width, Base);
end Put;
end Terminal_Interface.Curses.Text_IO.Modular_IO;
AdaCurses-20140726/src/terminal_interface-curses-menus-menu_user_data.adb 0000644 0001751 0000144 00000007545 12340207631 025075 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Menus.Menu_User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.15 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Menus.Menu_User_Data is
use type Interfaces.C.int;
procedure Set_User_Data (Men : Menu;
Data : User_Access)
is
function Set_Menu_Userptr (Men : Menu;
Data : User_Access) return Eti_Error;
pragma Import (C, Set_Menu_Userptr, "set_menu_userptr");
begin
Eti_Exception (Set_Menu_Userptr (Men, Data));
end Set_User_Data;
function Get_User_Data (Men : Menu) return User_Access
is
function Menu_Userptr (Men : Menu) return User_Access;
pragma Import (C, Menu_Userptr, "menu_userptr");
begin
return Menu_Userptr (Men);
end Get_User_Data;
procedure Get_User_Data (Men : Menu;
Data : out User_Access)
is
begin
Data := Get_User_Data (Men);
end Get_User_Data;
end Terminal_Interface.Curses.Menus.Menu_User_Data;
AdaCurses-20140726/src/terminal_interface-curses-text_io-decimal_io.adb 0000644 0001751 0000144 00000007425 11315445471 024517 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Decimal_IO --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Text_IO;
with Terminal_Interface.Curses.Text_IO.Aux;
package body Terminal_Interface.Curses.Text_IO.Decimal_IO is
package Aux renames Terminal_Interface.Curses.Text_IO.Aux;
package DIO is new Ada.Text_IO.Decimal_IO (Num);
procedure Put
(Win : Window;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp)
is
Buf : String (1 .. Field'Last);
Len : Field := Fore + 1 + Aft;
begin
if Exp > 0 then
Len := Len + 1 + Exp;
end if;
DIO.Put (Buf, Item, Aft, Exp);
Aux.Put_Buf (Win, Buf, Len, False);
end Put;
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp) is
begin
Put (Get_Window, Item, Fore, Aft, Exp);
end Put;
end Terminal_Interface.Curses.Text_IO.Decimal_IO;
AdaCurses-20140726/src/terminal_interface-curses-menus.adb 0000644 0001751 0000144 00000074642 12340207631 022106 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Menus --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2011,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 --
-- "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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.32 $
-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
with Interfaces.C.Pointers;
package body Terminal_Interface.Curses.Menus is
type C_Item_Array is array (Natural range <>) of aliased Item;
package I_Array is new
Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item);
use type System.Bit_Order;
subtype chars_ptr is Interfaces.C.Strings.chars_ptr;
------------------------------------------------------------------------------
procedure Request_Name (Key : Menu_Request_Code;
Name : out String)
is
function Request_Name (Key : C_Int) return chars_ptr;
pragma Import (C, Request_Name, "menu_request_name");
begin
Fill_String (Request_Name (C_Int (Key)), Name);
end Request_Name;
function Request_Name (Key : Menu_Request_Code) return String
is
function Request_Name (Key : C_Int) return chars_ptr;
pragma Import (C, Request_Name, "menu_request_name");
begin
return Fill_String (Request_Name (C_Int (Key)));
end Request_Name;
function Create (Name : String;
Description : String := "") return Item
is
type Char_Ptr is access all Interfaces.C.char;
function Newitem (Name, Desc : Char_Ptr) return Item;
pragma Import (C, Newitem, "new_item");
type Name_String is new char_array (0 .. Name'Length);
type Name_String_Ptr is access Name_String;
pragma Controlled (Name_String_Ptr);
type Desc_String is new char_array (0 .. Description'Length);
type Desc_String_Ptr is access Desc_String;
pragma Controlled (Desc_String_Ptr);
Name_Str : constant Name_String_Ptr := new Name_String;
Desc_Str : constant Desc_String_Ptr := new Desc_String;
Name_Len, Desc_Len : size_t;
Result : Item;
begin
To_C (Name, Name_Str.all, Name_Len);
To_C (Description, Desc_Str.all, Desc_Len);
Result := Newitem (Name_Str.all (Name_Str.all'First)'Access,
Desc_Str.all (Desc_Str.all'First)'Access);
if Result = Null_Item then
raise Eti_System_Error;
end if;
return Result;
end Create;
procedure Delete (Itm : in out Item)
is
function Descname (Itm : Item) return chars_ptr;
pragma Import (C, Descname, "item_description");
function Itemname (Itm : Item) return chars_ptr;
pragma Import (C, Itemname, "item_name");
function Freeitem (Itm : Item) return Eti_Error;
pragma Import (C, Freeitem, "free_item");
Ptr : chars_ptr;
begin
Ptr := Descname (Itm);
if Ptr /= Null_Ptr then
Interfaces.C.Strings.Free (Ptr);
end if;
Ptr := Itemname (Itm);
if Ptr /= Null_Ptr then
Interfaces.C.Strings.Free (Ptr);
end if;
Eti_Exception (Freeitem (Itm));
Itm := Null_Item;
end Delete;
-------------------------------------------------------------------------------
procedure Set_Value (Itm : Item;
Value : Boolean := True)
is
function Set_Item_Val (Itm : Item;
Val : C_Int) return Eti_Error;
pragma Import (C, Set_Item_Val, "set_item_value");
begin
Eti_Exception (Set_Item_Val (Itm, Boolean'Pos (Value)));
end Set_Value;
function Value (Itm : Item) return Boolean
is
function Item_Val (Itm : Item) return C_Int;
pragma Import (C, Item_Val, "item_value");
begin
if Item_Val (Itm) = Curses_False then
return False;
else
return True;
end if;
end Value;
-------------------------------------------------------------------------------
function Visible (Itm : Item) return Boolean
is
function Item_Vis (Itm : Item) return C_Int;
pragma Import (C, Item_Vis, "item_visible");
begin
if Item_Vis (Itm) = Curses_False then
return False;
else
return True;
end if;
end Visible;
-------------------------------------------------------------------------------
procedure Set_Options (Itm : Item;
Options : Item_Option_Set)
is
function Set_Item_Opts (Itm : Item;
Opt : Item_Option_Set) return Eti_Error;
pragma Import (C, Set_Item_Opts, "set_item_opts");
begin
Eti_Exception (Set_Item_Opts (Itm, Options));
end Set_Options;
procedure Switch_Options (Itm : Item;
Options : Item_Option_Set;
On : Boolean := True)
is
function Item_Opts_On (Itm : Item;
Opt : Item_Option_Set) return Eti_Error;
pragma Import (C, Item_Opts_On, "item_opts_on");
function Item_Opts_Off (Itm : Item;
Opt : Item_Option_Set) return Eti_Error;
pragma Import (C, Item_Opts_Off, "item_opts_off");
begin
if On then
Eti_Exception (Item_Opts_On (Itm, Options));
else
Eti_Exception (Item_Opts_Off (Itm, Options));
end if;
end Switch_Options;
procedure Get_Options (Itm : Item;
Options : out Item_Option_Set)
is
function Item_Opts (Itm : Item) return Item_Option_Set;
pragma Import (C, Item_Opts, "item_opts");
begin
Options := Item_Opts (Itm);
end Get_Options;
function Get_Options (Itm : Item := Null_Item) return Item_Option_Set
is
Ios : Item_Option_Set;
begin
Get_Options (Itm, Ios);
return Ios;
end Get_Options;
-------------------------------------------------------------------------------
procedure Name (Itm : Item;
Name : out String)
is
function Itemname (Itm : Item) return chars_ptr;
pragma Import (C, Itemname, "item_name");
begin
Fill_String (Itemname (Itm), Name);
end Name;
function Name (Itm : Item) return String
is
function Itemname (Itm : Item) return chars_ptr;
pragma Import (C, Itemname, "item_name");
begin
return Fill_String (Itemname (Itm));
end Name;
procedure Description (Itm : Item;
Description : out String)
is
function Descname (Itm : Item) return chars_ptr;
pragma Import (C, Descname, "item_description");
begin
Fill_String (Descname (Itm), Description);
end Description;
function Description (Itm : Item) return String
is
function Descname (Itm : Item) return chars_ptr;
pragma Import (C, Descname, "item_description");
begin
return Fill_String (Descname (Itm));
end Description;
-------------------------------------------------------------------------------
procedure Set_Current (Men : Menu;
Itm : Item)
is
function Set_Curr_Item (Men : Menu;
Itm : Item) return Eti_Error;
pragma Import (C, Set_Curr_Item, "set_current_item");
begin
Eti_Exception (Set_Curr_Item (Men, Itm));
end Set_Current;
function Current (Men : Menu) return Item
is
function Curr_Item (Men : Menu) return Item;
pragma Import (C, Curr_Item, "current_item");
Res : constant Item := Curr_Item (Men);
begin
if Res = Null_Item then
raise Menu_Exception;
end if;
return Res;
end Current;
procedure Set_Top_Row (Men : Menu;
Line : Line_Position)
is
function Set_Toprow (Men : Menu;
Line : C_Int) return Eti_Error;
pragma Import (C, Set_Toprow, "set_top_row");
begin
Eti_Exception (Set_Toprow (Men, C_Int (Line)));
end Set_Top_Row;
function Top_Row (Men : Menu) return Line_Position
is
function Toprow (Men : Menu) return C_Int;
pragma Import (C, Toprow, "top_row");
Res : constant C_Int := Toprow (Men);
begin
if Res = Curses_Err then
raise Menu_Exception;
end if;
return Line_Position (Res);
end Top_Row;
function Get_Index (Itm : Item) return Positive
is
function Get_Itemindex (Itm : Item) return C_Int;
pragma Import (C, Get_Itemindex, "item_index");
Res : constant C_Int := Get_Itemindex (Itm);
begin
if Res = Curses_Err then
raise Menu_Exception;
end if;
return Positive (Natural (Res) + Positive'First);
end Get_Index;
-------------------------------------------------------------------------------
procedure Post (Men : Menu;
Post : Boolean := True)
is
function M_Post (Men : Menu) return Eti_Error;
pragma Import (C, M_Post, "post_menu");
function M_Unpost (Men : Menu) return Eti_Error;
pragma Import (C, M_Unpost, "unpost_menu");
begin
if Post then
Eti_Exception (M_Post (Men));
else
Eti_Exception (M_Unpost (Men));
end if;
end Post;
-------------------------------------------------------------------------------
procedure Set_Options (Men : Menu;
Options : Menu_Option_Set)
is
function Set_Menu_Opts (Men : Menu;
Opt : Menu_Option_Set) return Eti_Error;
pragma Import (C, Set_Menu_Opts, "set_menu_opts");
begin
Eti_Exception (Set_Menu_Opts (Men, Options));
end Set_Options;
procedure Switch_Options (Men : Menu;
Options : Menu_Option_Set;
On : Boolean := True)
is
function Menu_Opts_On (Men : Menu;
Opt : Menu_Option_Set) return Eti_Error;
pragma Import (C, Menu_Opts_On, "menu_opts_on");
function Menu_Opts_Off (Men : Menu;
Opt : Menu_Option_Set) return Eti_Error;
pragma Import (C, Menu_Opts_Off, "menu_opts_off");
begin
if On then
Eti_Exception (Menu_Opts_On (Men, Options));
else
Eti_Exception (Menu_Opts_Off (Men, Options));
end if;
end Switch_Options;
procedure Get_Options (Men : Menu;
Options : out Menu_Option_Set)
is
function Menu_Opts (Men : Menu) return Menu_Option_Set;
pragma Import (C, Menu_Opts, "menu_opts");
begin
Options := Menu_Opts (Men);
end Get_Options;
function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set
is
Mos : Menu_Option_Set;
begin
Get_Options (Men, Mos);
return Mos;
end Get_Options;
-------------------------------------------------------------------------------
procedure Set_Window (Men : Menu;
Win : Window)
is
function Set_Menu_Win (Men : Menu;
Win : Window) return Eti_Error;
pragma Import (C, Set_Menu_Win, "set_menu_win");
begin
Eti_Exception (Set_Menu_Win (Men, Win));
end Set_Window;
function Get_Window (Men : Menu) return Window
is
function Menu_Win (Men : Menu) return Window;
pragma Import (C, Menu_Win, "menu_win");
W : constant Window := Menu_Win (Men);
begin
return W;
end Get_Window;
procedure Set_Sub_Window (Men : Menu;
Win : Window)
is
function Set_Menu_Sub (Men : Menu;
Win : Window) return Eti_Error;
pragma Import (C, Set_Menu_Sub, "set_menu_sub");
begin
Eti_Exception (Set_Menu_Sub (Men, Win));
end Set_Sub_Window;
function Get_Sub_Window (Men : Menu) return Window
is
function Menu_Sub (Men : Menu) return Window;
pragma Import (C, Menu_Sub, "menu_sub");
W : constant Window := Menu_Sub (Men);
begin
return W;
end Get_Sub_Window;
procedure Scale (Men : Menu;
Lines : out Line_Count;
Columns : out Column_Count)
is
type C_Int_Access is access all C_Int;
function M_Scale (Men : Menu;
Yp, Xp : C_Int_Access) return Eti_Error;
pragma Import (C, M_Scale, "scale_menu");
X, Y : aliased C_Int;
begin
Eti_Exception (M_Scale (Men, Y'Access, X'Access));
Lines := Line_Count (Y);
Columns := Column_Count (X);
end Scale;
-------------------------------------------------------------------------------
procedure Position_Cursor (Men : Menu)
is
function Pos_Menu_Cursor (Men : Menu) return Eti_Error;
pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor");
begin
Eti_Exception (Pos_Menu_Cursor (Men));
end Position_Cursor;
-------------------------------------------------------------------------------
procedure Set_Mark (Men : Menu;
Mark : String)
is
type Char_Ptr is access all Interfaces.C.char;
function Set_Mark (Men : Menu;
Mark : Char_Ptr) return Eti_Error;
pragma Import (C, Set_Mark, "set_menu_mark");
Txt : char_array (0 .. Mark'Length);
Len : size_t;
begin
To_C (Mark, Txt, Len);
Eti_Exception (Set_Mark (Men, Txt (Txt'First)'Access));
end Set_Mark;
procedure Mark (Men : Menu;
Mark : out String)
is
function Get_Menu_Mark (Men : Menu) return chars_ptr;
pragma Import (C, Get_Menu_Mark, "menu_mark");
begin
Fill_String (Get_Menu_Mark (Men), Mark);
end Mark;
function Mark (Men : Menu) return String
is
function Get_Menu_Mark (Men : Menu) return chars_ptr;
pragma Import (C, Get_Menu_Mark, "menu_mark");
begin
return Fill_String (Get_Menu_Mark (Men));
end Mark;
-------------------------------------------------------------------------------
procedure Set_Foreground
(Men : Menu;
Fore : Character_Attribute_Set := Normal_Video;
Color : Color_Pair := Color_Pair'First)
is
function Set_Menu_Fore (Men : Menu;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Menu_Fore, "set_menu_fore");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Fore);
begin
Eti_Exception (Set_Menu_Fore (Men, Ch));
end Set_Foreground;
procedure Foreground (Men : Menu;
Fore : out Character_Attribute_Set)
is
function Menu_Fore (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Fore, "menu_fore");
begin
Fore := Menu_Fore (Men).Attr;
end Foreground;
procedure Foreground (Men : Menu;
Fore : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Menu_Fore (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Fore, "menu_fore");
begin
Fore := Menu_Fore (Men).Attr;
Color := Menu_Fore (Men).Color;
end Foreground;
procedure Set_Background
(Men : Menu;
Back : Character_Attribute_Set := Normal_Video;
Color : Color_Pair := Color_Pair'First)
is
function Set_Menu_Back (Men : Menu;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Menu_Back, "set_menu_back");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Back);
begin
Eti_Exception (Set_Menu_Back (Men, Ch));
end Set_Background;
procedure Background (Men : Menu;
Back : out Character_Attribute_Set)
is
function Menu_Back (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Back, "menu_back");
begin
Back := Menu_Back (Men).Attr;
end Background;
procedure Background (Men : Menu;
Back : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Menu_Back (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Back, "menu_back");
begin
Back := Menu_Back (Men).Attr;
Color := Menu_Back (Men).Color;
end Background;
procedure Set_Grey (Men : Menu;
Grey : Character_Attribute_Set := Normal_Video;
Color : Color_Pair := Color_Pair'First)
is
function Set_Menu_Grey (Men : Menu;
Attr : Attributed_Character) return Eti_Error;
pragma Import (C, Set_Menu_Grey, "set_menu_grey");
Ch : constant Attributed_Character := (Ch => Character'First,
Color => Color,
Attr => Grey);
begin
Eti_Exception (Set_Menu_Grey (Men, Ch));
end Set_Grey;
procedure Grey (Men : Menu;
Grey : out Character_Attribute_Set)
is
function Menu_Grey (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Grey, "menu_grey");
begin
Grey := Menu_Grey (Men).Attr;
end Grey;
procedure Grey (Men : Menu;
Grey : out Character_Attribute_Set;
Color : out Color_Pair)
is
function Menu_Grey (Men : Menu) return Attributed_Character;
pragma Import (C, Menu_Grey, "menu_grey");
begin
Grey := Menu_Grey (Men).Attr;
Color := Menu_Grey (Men).Color;
end Grey;
procedure Set_Pad_Character (Men : Menu;
Pad : Character := Space)
is
function Set_Menu_Pad (Men : Menu;
Ch : C_Int) return Eti_Error;
pragma Import (C, Set_Menu_Pad, "set_menu_pad");
begin
Eti_Exception (Set_Menu_Pad (Men, C_Int (Character'Pos (Pad))));
end Set_Pad_Character;
procedure Pad_Character (Men : Menu;
Pad : out Character)
is
function Menu_Pad (Men : Menu) return C_Int;
pragma Import (C, Menu_Pad, "menu_pad");
begin
Pad := Character'Val (Menu_Pad (Men));
end Pad_Character;
-------------------------------------------------------------------------------
procedure Set_Spacing (Men : Menu;
Descr : Column_Position := 0;
Row : Line_Position := 0;
Col : Column_Position := 0)
is
function Set_Spacing (Men : Menu;
D, R, C : C_Int) return Eti_Error;
pragma Import (C, Set_Spacing, "set_menu_spacing");
begin
Eti_Exception (Set_Spacing (Men,
C_Int (Descr),
C_Int (Row),
C_Int (Col)));
end Set_Spacing;
procedure Spacing (Men : Menu;
Descr : out Column_Position;
Row : out Line_Position;
Col : out Column_Position)
is
type C_Int_Access is access all C_Int;
function Get_Spacing (Men : Menu;
D, R, C : C_Int_Access) return Eti_Error;
pragma Import (C, Get_Spacing, "menu_spacing");
D, R, C : aliased C_Int;
begin
Eti_Exception (Get_Spacing (Men,
D'Access,
R'Access,
C'Access));
Descr := Column_Position (D);
Row := Line_Position (R);
Col := Column_Position (C);
end Spacing;
-------------------------------------------------------------------------------
function Set_Pattern (Men : Menu;
Text : String) return Boolean
is
type Char_Ptr is access all Interfaces.C.char;
function Set_Pattern (Men : Menu;
Pattern : Char_Ptr) return Eti_Error;
pragma Import (C, Set_Pattern, "set_menu_pattern");
S : char_array (0 .. Text'Length);
L : size_t;
Res : Eti_Error;
begin
To_C (Text, S, L);
Res := Set_Pattern (Men, S (S'First)'Access);
case Res is
when E_No_Match =>
return False;
when others =>
Eti_Exception (Res);
return True;
end case;
end Set_Pattern;
procedure Pattern (Men : Menu;
Text : out String)
is
function Get_Pattern (Men : Menu) return chars_ptr;
pragma Import (C, Get_Pattern, "menu_pattern");
begin
Fill_String (Get_Pattern (Men), Text);
end Pattern;
-------------------------------------------------------------------------------
procedure Set_Format (Men : Menu;
Lines : Line_Count;
Columns : Column_Count)
is
function Set_Menu_Fmt (Men : Menu;
Lin : C_Int;
Col : C_Int) return Eti_Error;
pragma Import (C, Set_Menu_Fmt, "set_menu_format");
begin
Eti_Exception (Set_Menu_Fmt (Men,
C_Int (Lines),
C_Int (Columns)));
end Set_Format;
procedure Format (Men : Menu;
Lines : out Line_Count;
Columns : out Column_Count)
is
type C_Int_Access is access all C_Int;
function Menu_Fmt (Men : Menu;
Y, X : C_Int_Access) return Eti_Error;
pragma Import (C, Menu_Fmt, "menu_format");
L, C : aliased C_Int;
begin
Eti_Exception (Menu_Fmt (Men, L'Access, C'Access));
Lines := Line_Count (L);
Columns := Column_Count (C);
end Format;
-------------------------------------------------------------------------------
procedure Set_Item_Init_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Item_Init (Men : Menu;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Item_Init, "set_item_init");
begin
Eti_Exception (Set_Item_Init (Men, Proc));
end Set_Item_Init_Hook;
procedure Set_Item_Term_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Item_Term (Men : Menu;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Item_Term, "set_item_term");
begin
Eti_Exception (Set_Item_Term (Men, Proc));
end Set_Item_Term_Hook;
procedure Set_Menu_Init_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Menu_Init (Men : Menu;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Menu_Init, "set_menu_init");
begin
Eti_Exception (Set_Menu_Init (Men, Proc));
end Set_Menu_Init_Hook;
procedure Set_Menu_Term_Hook (Men : Menu;
Proc : Menu_Hook_Function)
is
function Set_Menu_Term (Men : Menu;
Proc : Menu_Hook_Function) return Eti_Error;
pragma Import (C, Set_Menu_Term, "set_menu_term");
begin
Eti_Exception (Set_Menu_Term (Men, Proc));
end Set_Menu_Term_Hook;
function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function
is
function Item_Init (Men : Menu) return Menu_Hook_Function;
pragma Import (C, Item_Init, "item_init");
begin
return Item_Init (Men);
end Get_Item_Init_Hook;
function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function
is
function Item_Term (Men : Menu) return Menu_Hook_Function;
pragma Import (C, Item_Term, "item_term");
begin
return Item_Term (Men);
end Get_Item_Term_Hook;
function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function
is
function Menu_Init (Men : Menu) return Menu_Hook_Function;
pragma Import (C, Menu_Init, "menu_init");
begin
return Menu_Init (Men);
end Get_Menu_Init_Hook;
function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function
is
function Menu_Term (Men : Menu) return Menu_Hook_Function;
pragma Import (C, Menu_Term, "menu_term");
begin
return Menu_Term (Men);
end Get_Menu_Term_Hook;
-------------------------------------------------------------------------------
procedure Redefine (Men : Menu;
Items : Item_Array_Access)
is
function Set_Items (Men : Menu;
Items : System.Address) return Eti_Error;
pragma Import (C, Set_Items, "set_menu_items");
begin
pragma Assert (Items.all (Items'Last) = Null_Item);
if Items.all (Items'Last) /= Null_Item then
raise Menu_Exception;
else
Eti_Exception (Set_Items (Men, Items.all'Address));
end if;
end Redefine;
function Item_Count (Men : Menu) return Natural
is
function Count (Men : Menu) return C_Int;
pragma Import (C, Count, "item_count");
begin
return Natural (Count (Men));
end Item_Count;
function Items (Men : Menu;
Index : Positive) return Item
is
use I_Array;
function C_Mitems (Men : Menu) return Pointer;
pragma Import (C, C_Mitems, "menu_items");
P : Pointer := C_Mitems (Men);
begin
if P = null or else Index > Item_Count (Men) then
raise Menu_Exception;
else
P := P + ptrdiff_t (C_Int (Index) - 1);
return P.all;
end if;
end Items;
-------------------------------------------------------------------------------
function Create (Items : Item_Array_Access) return Menu
is
function Newmenu (Items : System.Address) return Menu;
pragma Import (C, Newmenu, "new_menu");
M : Menu;
begin
pragma Assert (Items.all (Items'Last) = Null_Item);
if Items.all (Items'Last) /= Null_Item then
raise Menu_Exception;
else
M := Newmenu (Items.all'Address);
if M = Null_Menu then
raise Menu_Exception;
end if;
return M;
end if;
end Create;
procedure Delete (Men : in out Menu)
is
function Free (Men : Menu) return Eti_Error;
pragma Import (C, Free, "free_menu");
begin
Eti_Exception (Free (Men));
Men := Null_Menu;
end Delete;
------------------------------------------------------------------------------
function Driver (Men : Menu;
Key : Key_Code) return Driver_Result
is
function Driver (Men : Menu;
Key : C_Int) return Eti_Error;
pragma Import (C, Driver, "menu_driver");
R : constant Eti_Error := Driver (Men, C_Int (Key));
begin
case R is
when E_Unknown_Command =>
return Unknown_Request;
when E_No_Match =>
return No_Match;
when E_Request_Denied | E_Not_Selectable =>
return Request_Denied;
when others =>
Eti_Exception (R);
return Menu_Ok;
end case;
end Driver;
procedure Free (IA : in out Item_Array_Access;
Free_Items : Boolean := False)
is
procedure Release is new Ada.Unchecked_Deallocation
(Item_Array, Item_Array_Access);
begin
if IA /= null and then Free_Items then
for I in IA'First .. (IA'Last - 1) loop
if IA.all (I) /= Null_Item then
Delete (IA.all (I));
end if;
end loop;
end if;
Release (IA);
end Free;
-------------------------------------------------------------------------------
function Default_Menu_Options return Menu_Option_Set
is
begin
return Get_Options (Null_Menu);
end Default_Menu_Options;
function Default_Item_Options return Item_Option_Set
is
begin
return Get_Options (Null_Item);
end Default_Item_Options;
-------------------------------------------------------------------------------
end Terminal_Interface.Curses.Menus;
AdaCurses-20140726/src/terminal_interface-curses-text_io-modular_io.ads 0000644 0001751 0000144 00000006602 11315445551 024600 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Modular_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic
type Num is mod <>;
package Terminal_Interface.Curses.Text_IO.Modular_IO is
Default_Width : Field := Num'Width;
Default_Base : Number_Base := 10;
procedure Put
(Win : Window;
Item : Num;
Width : Field := Default_Width;
Base : Number_Base := Default_Base);
procedure Put
(Item : Num;
Width : Field := Default_Width;
Base : Number_Base := Default_Base);
private
pragma Inline (Put);
end Terminal_Interface.Curses.Text_IO.Modular_IO;
AdaCurses-20140726/src/terminal_interface-curses-termcap.ads 0000644 0001751 0000144 00000010066 07746514446 022444 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Termcap --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.3 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Termcap is
pragma Preelaborate (Terminal_Interface.Curses.Termcap);
-- |=====================================================================
-- | Man page curs_termcap.3x
-- |=====================================================================
-- Not implemented: tputs (see curs_terminfo)
type Termcap_String is new String;
-- |
function TGoto (Cap : String;
Col : Column_Position;
Row : Line_Position) return Termcap_String;
-- AKA: tgoto()
-- |
function Get_Entry (Name : String) return Boolean;
-- AKA: tgetent()
-- |
function Get_Flag (Name : String) return Boolean;
-- AKA: tgetflag()
-- |
procedure Get_Number (Name : String;
Value : out Integer;
Result : out Boolean);
-- AKA: tgetnum()
-- |
procedure Get_String (Name : String;
Value : out String;
Result : out Boolean);
function Get_String (Name : String) return Boolean;
-- Returns True if the string is found.
-- AKA: tgetstr()
end Terminal_Interface.Curses.Termcap;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-numeric.ads 0000644 0001751 0000144 00000006565 11315445666 026107 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Numeric --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.Numeric is
pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Numeric);
type Numeric_Field is new Field_Type with
record
Precision : Natural;
Lower_Limit : Float;
Upper_Limit : Float;
end record;
procedure Set_Field_Type (Fld : Field;
Typ : Numeric_Field);
pragma Inline (Set_Field_Type);
end Terminal_Interface.Curses.Forms.Field_Types.Numeric;
AdaCurses-20140726/src/terminal_interface-curses-text_io-decimal_io.ads 0000644 0001751 0000144 00000006727 11315445471 024544 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Decimal_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
generic
type Num is delta <> digits <>;
package Terminal_Interface.Curses.Text_IO.Decimal_IO is
Default_Fore : Field := Num'Fore;
Default_Aft : Field := Num'Aft;
Default_Exp : Field := 0;
procedure Put
(Win : Window;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
private
pragma Inline (Put);
end Terminal_Interface.Curses.Text_IO.Decimal_IO;
AdaCurses-20140726/src/terminal_interface-curses-forms-field_types-ipv4_address.ads 0000644 0001751 0000144 00000006463 11315445666 027031 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address is
pragma Preelaborate
(Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address);
type Internet_V4_Address_Field is new Field_Type with null record;
procedure Set_Field_Type (Fld : Field;
Typ : Internet_V4_Address_Field);
pragma Inline (Set_Field_Type);
end Terminal_Interface.Curses.Forms.Field_Types.IPV4_Address;
AdaCurses-20140726/src/terminal_interface-curses-mouse.adb 0000644 0001751 0000144 00000020367 11315445062 022105 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Mouse --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2008,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.24 $
-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C; use Interfaces.C;
use Interfaces;
package body Terminal_Interface.Curses.Mouse is
use type System.Bit_Order;
function Has_Mouse return Boolean
is
function Mouse_Avail return C_Int;
pragma Import (C, Mouse_Avail, "has_mouse");
begin
if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then
return True;
else
return False;
end if;
end Has_Mouse;
function Get_Mouse return Mouse_Event
is
type Event_Access is access all Mouse_Event;
function Getmouse (Ev : Event_Access) return C_Int;
pragma Import (C, Getmouse, "getmouse");
Event : aliased Mouse_Event;
begin
if Getmouse (Event'Access) = Curses_Err then
raise Curses_Exception;
end if;
return Event;
end Get_Mouse;
procedure Register_Reportable_Event (Button : Mouse_Button;
State : Button_State;
Mask : in out Event_Mask)
is
Button_Nr : constant Natural := Mouse_Button'Pos (Button);
State_Nr : constant Natural := Button_State'Pos (State);
begin
if Button in Modifier_Keys and then State /= Pressed then
raise Curses_Exception;
else
if Button in Real_Buttons then
Mask := Mask or ((2 ** (6 * Button_Nr)) ** State_Nr);
else
Mask := Mask or (BUTTON_CTRL ** (Button_Nr - 4));
end if;
end if;
end Register_Reportable_Event;
procedure Register_Reportable_Events (Button : Mouse_Button;
State : Button_States;
Mask : in out Event_Mask)
is
begin
for S in Button_States'Range loop
if State (S) then
Register_Reportable_Event (Button, S, Mask);
end if;
end loop;
end Register_Reportable_Events;
function Start_Mouse (Mask : Event_Mask := All_Events)
return Event_Mask
is
function MMask (M : Event_Mask;
O : access Event_Mask) return Event_Mask;
pragma Import (C, MMask, "mousemask");
R : Event_Mask;
Old : aliased Event_Mask;
begin
R := MMask (Mask, Old'Access);
if R = No_Events then
Beep;
end if;
return Old;
end Start_Mouse;
procedure End_Mouse (Mask : Event_Mask := No_Events)
is
begin
if Mask /= No_Events then
Beep;
end if;
end End_Mouse;
procedure Dispatch_Event (Mask : Event_Mask;
Button : out Mouse_Button;
State : out Button_State);
procedure Dispatch_Event (Mask : Event_Mask;
Button : out Mouse_Button;
State : out Button_State) is
L : Event_Mask;
begin
Button := Alt; -- preset to non real button;
if (Mask and BUTTON1_EVENTS) /= 0 then
Button := Left;
elsif (Mask and BUTTON2_EVENTS) /= 0 then
Button := Middle;
elsif (Mask and BUTTON3_EVENTS) /= 0 then
Button := Right;
elsif (Mask and BUTTON4_EVENTS) /= 0 then
Button := Button4;
end if;
if Button in Real_Buttons then
L := 2 ** (6 * Mouse_Button'Pos (Button));
for I in Button_State'Range loop
if (Mask and L) /= 0 then
State := I;
exit;
end if;
L := 2 * L;
end loop;
else
State := Pressed;
if (Mask and BUTTON_CTRL) /= 0 then
Button := Control;
elsif (Mask and BUTTON_SHIFT) /= 0 then
Button := Shift;
elsif (Mask and BUTTON_ALT) /= 0 then
Button := Alt;
end if;
end if;
end Dispatch_Event;
procedure Get_Event (Event : Mouse_Event;
Y : out Line_Position;
X : out Column_Position;
Button : out Mouse_Button;
State : out Button_State)
is
Mask : constant Event_Mask := Event.Bstate;
begin
X := Column_Position (Event.X);
Y := Line_Position (Event.Y);
Dispatch_Event (Mask, Button, State);
end Get_Event;
procedure Unget_Mouse (Event : Mouse_Event)
is
function Ungetmouse (Ev : Mouse_Event) return C_Int;
pragma Import (C, Ungetmouse, "ungetmouse");
begin
if Ungetmouse (Event) = Curses_Err then
raise Curses_Exception;
end if;
end Unget_Mouse;
function Enclosed_In_Window (Win : Window := Standard_Window;
Event : Mouse_Event) return Boolean
is
function Wenclose (Win : Window; Y : C_Int; X : C_Int)
return Curses_Bool;
pragma Import (C, Wenclose, "wenclose");
begin
if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X))
= Curses_Bool_False then
return False;
else
return True;
end if;
end Enclosed_In_Window;
function Mouse_Interval (Msec : Natural := 200) return Natural
is
function Mouseinterval (Msec : C_Int) return C_Int;
pragma Import (C, Mouseinterval, "mouseinterval");
begin
return Natural (Mouseinterval (C_Int (Msec)));
end Mouse_Interval;
end Terminal_Interface.Curses.Mouse;
AdaCurses-20140726/src/terminal_interface-curses-putwin.ads 0000644 0001751 0000144 00000006141 07746514446 022336 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.PutWin --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.3 $
-- Binding Version 01.00
with Ada.Streams.Stream_IO;
package Terminal_Interface.Curses.PutWin is
procedure Put_Window (Win : Window;
File : Ada.Streams.Stream_IO.File_Type);
function Get_Window (File : Ada.Streams.Stream_IO.File_Type) return Window;
end Terminal_Interface.Curses.PutWin;
AdaCurses-20140726/src/terminal_interface-curses-text_io-complex_io.ads 0000644 0001751 0000144 00000007114 11315445471 024604 0 ustar tom users ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Complex_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 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. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Numerics.Generic_Complex_Types;
generic
with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>);
package Terminal_Interface.Curses.Text_IO.Complex_IO is
use Complex_Types;
Default_Fore : Field := 2;
Default_Aft : Field := Real'Digits - 1;
Default_Exp : Field := 3;
procedure Put
(Win : Window;
Item : Complex;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
procedure Put
(Item : Complex;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
private
pragma Inline (Put);
end Terminal_Interface.Curses.Text_IO.Complex_IO;
AdaCurses-20140726/NEWS 0000644 0001751 0000144 00002023246 12365030263 013062 0 ustar tom users -------------------------------------------------------------------------------
-- 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 --
-- "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: NEWS,v 1.2246 2014/07/26 22:50:27 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
working with Pavel Curtis' original work, pcurses, in 1992.
Changes through 1.9.9e are recorded by Zeyd M Ben-Halim.
Changes since 1.9.9e are recorded by Thomas E Dickey.
Contributors include those who have provided patches (even small ones), as well
as those who provide useful information (bug reports, analyses). Changes with
no cited author are the work of Thomas E Dickey (TD).
A few contributors are given in this file by their initials.
They each account for one percent or more of the changes since 1.9.9e.
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.
20140726
+ eliminate some redundant -I options used for building libraries, and
ensure that ${srcdir} is added to the include-options (prompted by
discussion with Paul Gilmartin).
+ modify configure script to work with Minix3.2
+ add form library extension O_DYNAMIC_JUSTIFY option which can be
used to override the different treatment of justification for static
versus dynamic fields (adapted from patch by Leon Winter).
+ add a null pointer check in test/edit_field.c (report/analysis by
Leon Winter, cf: 20130608).
20140719
+ make workarounds for compiling test-programs with NetBSD curses.
+ improve configure macro CF_ADD_LIBS, to eliminate repeated -l/-L
options, from xterm changes.
20140712
+ correct Charable() macro check for A_ALTCHARSET in wide-characters.
+ build-fix for position-debug code in tty_update.c, to work with or
without sp-funcs.
20140705
+ add w/W toggle to ncurses.c 'B' test, to demonstrate permutation of
video-attributes and colors with double-width character strings.
20140629
+ correct check in win_driver.c for saving screen contents, e.g., when
NCURSES_CONSOLE2 is set (cf: 20140503).
+ reorganize b/B menu items in ncurses.c, putting the test-strings into
subwindows. This is needed for a planned change to use Unicode
fullwidth characters in the test-screens.
+ correct update to form status for _NEWTOP, broken by fixes for
compiler warnings (patch by Leon Winter, cf: 20120616).
20140621
+ change shared-library suffix for AIX 5 and 6 to ".so", avoiding
conflict with the static library (report by Ben Lentz).
+ document RPATH_LIST in INSTALLATION file, as part of workarounds for
upgrading an ncurses library using the "--with-shared" option.
+ modify test/ncurses.c c/C tests to cycle through subsets of the
total number of colors, to better illustrate 8/16/88/256-colors by
providing directly comparable screens.
+ add test/dots_curses.c, for comparison with the low-level examples.
20140614
+ fix dereference before null check found by Coverity in tic.c
(cf: 20140524).
+ fix sign-extension bug in read_entry.c which prevented "toe" from
reading empty "screen+italics" entry.
+ modify sgr for screen.xterm-new to support dim capability -TD
+ add dim capability to nsterm+7 -TD
+ cancel dim capability for iterm -TD
+ add dim, invis capabilities to vte-2012 -TD
+ add sitm/ritm to konsole-base and mlterm3 -TD
20140609
> fix regression in screen terminfo entries (reports by Christian
Ebert, Gabriele Balducci) -TD
+ revert the change to screen; see notes for why this did not work -TD
+ cancel sitm/ritm for entries which extend "screen", to work around
screen's hardcoded behavior for SGR 3 -TD
20140607
+ separate masking for sgr in vidputs from sitm/ritm, which do not
overlap with sgr functionality.
+ remove unneeded -i option from adacurses-config; put -a in the -I
option for consistency (patch by Pascal Pignard).
+ update xterm-new to patch #305 -TD
+ change format of test-scripts for Debian Ada95 and ncurses-examples
packages to quilted to work around Debian #700177 (cf: 20130907).
+ build fix for form_driver_w.c as part of ncurses-examples package for
older ncurses than 20131207.
+ add Hello World example to adacurses-config manpage.
+ remove unused --enable-pc-files option from Ada95/configure.
+ add --disable-gnat-projects option for testing.
+ revert changes to Ada95 project-files configuration (cf: 20140524).
+ corrected usage message in adacurses-config.
20140524
+ fix typo in ncurses manpage for the NCURSES_NO_MAGIC_COOKIE
environment variable.
+ improve discussion of input-echoing in curs_getch.3x
+ clarify discussion in curs_addch.3x of wrapping.
+ modify parametrized.h to make fln non-padded.
+ correct several entries which had termcap-style padding used in
terminfo: adm21, aj510, alto-h19, att605-pc, x820 -TD
+ correct syntax for padding in some entries: dg211, h19 -TD
+ correct ti924-8 which had confused padding versus octal escapes -TD
+ correct padding in sbi entry -TD
+ fix an old bug in the termcap emulation; "%i" was ignored in tparm()
because the parameters to be incremented were already on the internal
stack (report by Corinna Vinschen).
+ modify tic's "-c" option to take into account the "-C" option to
activate additional checks which compare the results from running
tparm() on the terminfo expressions versus the translated termcap
expressions.
+ modify tic to allow it to read from FIFOs (report by Matthieu Fronton,
cf: 20120324).
> patches by Nicolas Boulenguez:
+ explicit dereferences to suppress some style warnings.
+ when c_varargs_to_ada.c includes its header, use double quotes
instead of <>.
+ samples/ncurses2-util.adb: removed unused with clause. The warning
was removed by an obsolete pragma.
+ replaced Unreferenced pragmas with Warnings (Off). The latter,
available with older GNATs, needs no configure test. This also
replaces 3 untested Unreferenced pragmas.
+ simplified To_C usage in trace handling. Using two parameters allows
some basic formatting, and avoids a warning about security with some
compiler flags.
+ for generated Ada sources, replace many snippets with one pure
package.
+ removed C_Chtype and its conversions.
+ removed C_AttrType and its conversions.
+ removed conversions between int, Item_Option_Set, Menu_Option_Set.
+ removed int, Field_Option_Set, Item_Option_Set conversions.
+ removed C_TraceType, Attribute_Option_Set conversions.
+ replaced C.int with direct use of Eti_Error, now enumerated. As it
was used in a case statement, values were tested by the Ada compiler
to be consecutive anyway.
+ src/Makefile.in: remove duplicate stanza
+ only consider using a project for shared libraries.
+ style. Silent gnat-4.9 warning about misplaced "then".
+ generate shared library project to honor ADAFLAGS, LDFLAGS.
20140510
+ cleanup recently introduced compiler warnings for MingW port.
+ workaround for ${MAKEFLAGS} configure check versus GNU make 4.0,
which introduces more than one gratuitous incompatibility.
20140503
+ add vt520ansi terminfo entry (patch by Mike Gran)
+ further improve MinGW support for the scenario where there is an
ANSI-escapes handler such as ansicon running in the console window
(patch by Juergen Pfeifer).
20140426
+ add --disable-lib-suffixes option (adapted from patch by Juergen
Pfeifer).
+ merge some changes from Juergen Pfeifer's work with MSYS2, to
simplify later merging:
+ use NC_ISATTY() macro for isatty() in library
+ add _nc_mingw_isatty() and related functions to windows-driver
+ rename terminal driver entrypoints to simplify grep's
+ remove a check in the sp-funcs flavor of newterm() which allowed only
the first call to newterm() to succeed (report by Thomas Beierlein,
cf: 20090927).
20140419
+ update config.guess, config.sub from
http://git.savannah.gnu.org/cgit/config.git
20140412
+ modify configure script:
+ drop the -no-gcc option from Intel compiler, from lynx changes.
+ extend the --with-hashed-db configure option to simplify building
with different versions of Berkeley database using FreeBSD ports.
+ improve initialization for MinGW port (Juergen Pfeifer):
+ enforce Windows-style path-separator if cross-compiling,
+ add a driver-name method to each of the drivers,
+ allow the Windows driver name to match "unknown", ignoring case,
+ lengthen the built-in name for the Windows console driver to
"#win32console", and
+ move the comparison of driver-names allowing abbreviation, e.g.,
to "#win32con" into the Windows console driver.
20140329
+ add check in tic for mismatch between ccc and initp/initc
+ cancel ccc in putty-256color and konsole-256color for consistency
with the cancelled initc capability (patch by Sven Zuhlsdorf).
+ add xterm+256setaf building block for various terminals which only
get the 256-color feature half-implemented -TD
+ updated "st" entry (leaving the 0.1.1 version as "simpleterm") to
0.4.1 -TD
20140323
+ fix typo in "mlterm" entry (report by Gabriele Balducci) -TD
20140322
+ use types from in sample build-scripts for chtype, etc.
+ modify configure script and curses.h.in to allow the types specified
using --with-chtype and related options to be defined in
+ add terminology entry -TD
+ add mlterm3 entry, use that as "mlterm" -TD
+ inherit mlterm-256color from mlterm -TD
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).
+ add cast in form_driver_w() to fix ARM build (patch by Xin Li).
+ add logic to win_driver.c to save/restore screen contents when not
allocating a console-buffer (cf: 20140215).
20140301
+ clarify error-returns from newwin (report by Ruslan Nabioullin).
20140222
+ fix some compiler warnings in win_driver.c
+ updated notes for wsvt25 based on tack and vttest -TD
+ add teken entry to show actual properties of FreeBSD's "xterm"
console -TD
20140215
+ in-progress changes to win_driver.c to implement output without
allocating a console-buffer. This uses a pre-existing environment
variable NCGDB used by Juergen Pfeifer for debugging (prompted by
discussion with Erwin Waterlander regarding Console2, which hangs
when reading in an allocated console-buffer).
+ add -t option to gdc.c, and modify to accept "S" to step through the
scrolling-stages.
+ regenerate NCURSES-Programming-HOWTO.html to fix some of the broken
html emitted by docbook.
20140209
+ modify CF_XOPEN_SOURCE macro to omit followup check to determine if
_XOPEN_SOURCE can/should be defined. g++ 4.7.2 built on Solaris 10
has some header breakage due to its own predefinition of this symbol
(report by Jean-Pierre Flori, Sage #15796).
20140201
+ add/use symbol NCURSES_PAIRS_T like NCURSES_COLOR_T, to illustrate
which "short" types are for color pairs and which are color values.
+ fix build for s390x, by correcting field bit offsets in generated
representation clauses when int=32 long=64 and endian=big, or at
least on s390x (patch by Nicolas Boulenguez).
+ minor cleanup change to test/form_driver_w.c (patch by Gaute Hope).
20140125
+ remove unnecessary ifdef's in Ada95/gen/gen.c, which reportedly do
not work as is with gcc 4.8 due to fixes using chtype cast made for
new compiler warnings by gcc 4.8 in 20130824 (Debian #735753, patch
by Nicolas Boulenguez).
20140118
+ apply includesubdir variable which was introduced in 20130805 to
gen-pkgconfig.in (Debian #735782).
20131221
+ further improved man2html, used this to fix broken links in html
manpages. See
ftp://invisible-island.net/ncurses/patches/man2html
20131214
+ modify configure-script/ifdef's to allow OLD_TTY feature to be
suppressed if the type of ospeed is configured using the option
--with-ospeed to not be a short. By default, it is a short for
termcap-compatibility (adapted from suggestion by Christian
Weisgerber).
+ correct a typo in _nc_baudrate() (patch by Christian Weisgerber,
cf: 20061230).
+ fix a few -Wlogical-op warnings.
+ updated llib-l* files.
20131207
+ add form_driver_w() entrypoint to wide-character forms library, as
well as test program form_driver_w (adapted from patch by Gaute
Hope).
20131123
+ minor fix for CF_GCC_WARNINGS to special-case options which are not
recognized by clang.
20131116
+ add special case to configure script to move _XOPEN_SOURCE_EXTENDED
definition from CPPFLAGS to CFLAGS if it happens to be needed for
Solaris, because g++ errors with that definition (report by
Jean-Pierre Flori, Sage #15268).
+ correct logic in infocmp's -i option which was intended to ignore
strings which correspond to function-keys as candidates for piecing
together initialization- or reset-strings. The problem dates to
1.9.7a, but was overlooked until changes in -Wlogical-op warnings for
gcc 4.8 (report by David Binderman).
+ updated CF_GCC_WARNINGS to documented options for gcc 4.9.0, adding
checks for -Wextra, -Wignored-qualifiers and -Wlogical-op
+ updated CF_GCC_WARNINGS to documented options for gcc 4.9.0, moving
checks for -Wextra and -Wdeclaration-after-statement into the macro,
and adding checks for -Wignored-qualifiers, -Wlogical-op and
-Wvarargs
+ updated CF_CURSES_UNCTRL_H and CF_SHARED_OPTS macros from ongoing
work on cdk.
+ update config.sub from
http://git.savannah.gnu.org/cgit/config.git
20131110
+ minor cleanup of terminfo.tail
20131102
+ use TS extension to describe xterm's title-escapes -TD
+ modify terminator and nsterm-s to use xterm+sl-twm building block -TD
+ update hurd.ti, add xenl to reflect 2011-03-06 change in
http://git.savannah.gnu.org/cgit/hurd/hurd.git/log/console/display.c
(Debian #727119).
+ simplify pfkey expression in ansi.sys -TD
20131027
+ correct/simplify ifdef's for cur_term versus broken-linker and
reentrant options (report by Jean-Pierre Flori, cf: 20090530).
+ modify release/version combinations in test build-scripts to make
them more consistent with other packages.
20131019
+ add nc_mingw.h to installed headers for MinGW port; needed for
compiling ncurses-examples.
+ add rpm-script for testing cross-compile of ncurses-examples.
20131014
+ fix new typo in CF_ADA_INCLUDE_DIRS macro (report by Roumen Petrov).
20131012
+ fix a few compiler warnings in progs and test.
+ minor fix to package/debian-mingw/rules, do not strip dll's.
+ minor fixes to configure script for empty $prefix, e.g., when doing
cross-compiles to MinGW.
+ add script for building test-packages of binaries cross-compiled to
MinGW using NSIS.
20131005
+ minor fixes for ncurses-example package and makefile.
+ add scripts for test-builds of cross-compiler packages for ncurses6
to MinGW.
20130928
+ some build-fixes for ncurses-examples with NetBSD-6.0 curses, though
it lacks some common functions such as use_env() which is not yet
addressed.
+ build-fix and some compiler warning fixes for ncurses-examples with
OpenBSD 5.3
+ fix a possible null-pointer reference in a trace message from newterm.
+ quiet a few warnings from NetBSD 6.0 namespace pollution by
nonstandard popcount() function in standard strings.h header.
+ ignore g++ 4.2.1 warnings for "-Weffc++" in c++/cursesmain.cc
+ fix a few overlooked places for --enable-string-hacks option.
20130921
+ fix typo in curs_attr.3x (patch by Sven Joachim, cf: 20130831).
+ build-fix for --with-shared option for DragonFly and FreeBSD (report
by Rong-En Fan, cf: 20130727).
20130907
+ build-fixes for MSYS for two test-programs (patches by Ray Donnelly,
Alexey Pavlov).
+ revert change to two of the dpkg format files, to work with dpkg
before/after Debian #700177.
+ fix gcc -Wconversion warning in wattr_get() macro.
+ add msys and msysdll to known host/configuration types (patch by
Alexey Pavlov).
+ modify CF_RPATH_HACK configure macro to not rely upon "-u" option
of sort, improving portability.
+ minor improvements for test-programs from reviewing Solaris port.
+ update config.guess, config.sub from
http://git.savannah.gnu.org/cgit/config.git
20130831
+ modify test/ncurses.c b/B tests to display lines only for the
attributes which a given terminal supports, to make room for an
italics test.
+ completed ncv table in terminfo.tail; it did not list the wide
character codes listed in X/Open Curses issue 7.
+ add A_ITALIC extension (prompted by discussion with Egmont Koblinger).
20130824
+ fix some gcc 4.8 -Wconversion warnings.
+ change format of dpkg test-scripts to quilted to work around bug
introduced by Debian #700177.
+ discard cached keyname() values if meta() is changed after a value
was cached using (report by Kurban Mallachiev).
20130816
+ add checks in tic to warn about terminals which lack cursor
addressing, capabilities or having those, are marked as hard_copy or
generic_type.
+ use --without-progs in mingw-ncurses rpm.
+ split out _nc_init_termtype() from alloc_entry.c to use in MinGW
port when tic and other programs are not needed.
20130805
+ minor fixes to the --disable-overwrite logic, to ensure that the
configured $(includedir) is not cancelled by the mingwxx-filesystem
rpm macros.
+ add --disable-db-install configure option, to simplify building
cross-compile support packages.
+ add mingw-ncurses.spec file, for testing cross-compiles.
20130727
+ improve configure macros from ongoing work on cdk, dialog, xterm:
+ CF_ADD_LIB_AFTER - fix a problem with -Wl options
+ CF_RPATH_HACK - add missing result-message
+ CF_SHARED_OPTS - modify to use $rel_builddir in cygwin and mingw
dll symbols (which can be overridden) rather than explicit "../".
+ CF_SHARED_OPTS - modify NetBSD and DragonFly symbols to use ${CC}
rather than ${LD} to improve rpath support.
+ CF_SHARED_OPTS - add a symbol to denote the temporary files that
are created by the macro, to simplify clean-rules.
+ CF_X_ATHENA - trim extra libraries to work with -Wl,--as-needed
+ fix a regression in hashed-database support for NetBSD, which uses
the key-size differently from other implementations (cf: 20121229).
20130720
+ further improvements for setupterm manpage, clarifying the
initialization of cur_term.
20130713
+ improve manpages for initscr and setupterm.
+ minor compiler-warning fixes
20130706
+ add fallback defs for and (cf: 20120225).
+ add check for size of wchar_t, use that to suppress a chunk of
wcwidth.h in MinGW port.
+ quiet linker warnings for MinGW cross-compile with dll's using the
--enable-auto-import flag.
+ add ncurses.map rule to ncurses/Makefile to help diagnose symbol
table issues.
20130622
+ modify the clear program to take into account the E3 extended
capability to clear the terminal's scrollback buffer (patch by
Miroslav Lichvar, Redhat #815790).
+ clarify in resizeterm manpage that LINES and COLS are updated.
+ updated ansi example in terminfo.tail, correct misordered example
of sgr.
+ fix other doclifter warnings for manpages
+ remove unnecessary ".ta" in terminfo.tail, add missing ".fi"
(patch by Eric Raymond).
20130615
+ minor changes to some configure macros to make them more reusable.
+ fixes for tabs program (prompted by report by Nick Andrik).
+ corrected logic in command-line parsing of -a and -c predefined
tab-lists options.
+ allow "-0" and "-8" options to be combined with others, e.g.,"-0d".
+ make warning messages more consistent with the other utilities by
not printing the full pathname of the program.
+ add -V option for consistency with other utilities.
+ fix off-by-one in columns for tabs program when processing an option
such as "-5" (patch by Nick Andrik).
20130608
+ add to test/demo_forms.c examples of using the menu-hooks as well
as showing how the menu item user-data can be used to pass a callback
function pointer.
+ add test/dots_termcap.c
+ remove setupterm call from test/demo_termcap.c
+ build-fix if --disable-ext-funcs configure option is used.
+ modified test/edit_field.c and test/demo_forms.c to move the lengths
into a user-data structure, keeping the original string for later
expansion to free-format input/out demo.
+ modified test/demo_forms.c to load data from file.
+ added note to clarify Terminal.app's non-emulation of the various
terminal types listed in the preferences dialog -TD
+ fix regression in error-reporting in lib_setup.c (Debian #711134,
cf: 20121117).
+ build-fix for a case where --enable-broken_linker and
--enable-reentrant options are combined (report by George R Goffe).
20130525
+ modify mvcur() to distinguish between internal use by the ncurses
library, and external callers, preventing it from reading the content
of the screen which is only nonblank when curses calls have updated
it. This makes test/dots_mvcur.c avoid painting colored cells in
the left margin of the display.
+ minor fix to test/dots_mvcur.c
+ move configured symbols USE_DATABASE and USE_TERMCAP to term.h as
NCURSES_USE_DATABASE and NCURSES_USE_TERMCAP to allow consistent
use of these symbols in term_entry.h
20130518
+ corrected ifdefs in test/testcurs.c to allow comparison of mouse
interface versus pdcurses (cf: 20130316).
+ add pow() to configure-check for math library, needed since
20121208 for test/hanoi (Debian #708056).
+ regenerated html manpages.
+ update doctype used for html documentation.
20130511
+ move nsterm-related entries out of "obsolete" section to more
plausible "ansi consoles" -TD
+ additional cleanup of table-of-contents by reordering -TD
+ revise fix for check for 8-bit value in _nc_insert_ch(); prior fix
prevented inserts when video attributes were attached to the data
(cf: 20121215) (Redhat #959534).
20130504
+ fixes for issues found by Coverity:
+ correct FNKEY() macro in progs/dump_entry.c, allowing kf11-kf63 to
display when infocmp's -R option is used for HP or AIX subsets.
+ fix dead-code issue with test/movewindow.c
+ improve limited-checking in _nc_read_termtype().
20130427
+ fix clang 3.2 warning in progs/dump_entry.c
+ drop AC_TYPE_SIGNAL check; ncurses relies on c89 and later.
20130413
+ add MinGW to cases where ncurses installs by default into /usr
(prompted by discussion with Daniel Silva Ferreira).
+ add -D option to infocmp's usage-message (patch by Miroslav Lichvar).
+ add a missing 'int' type for main function in configure check for
type of bool variable, to work with clang 3.2 (report by Dmitri
Gribenko).
+ improve configure check for static_cast, to work with clang 3.2
(report by Dmitri Gribenko).
+ re-order rule for demo.o and macros defining header dependencies in
c++/Makefile.in to accommodate gmake (report by Dmitri Gribenko).
20130406
+ improve parameter checking in copywin().
+ modify configure script to work around OS X's "libtool" program, to
choose glibtool instead. At the same time, chance the autoconf macro
to look for a "tool" rather than a "prog", to help with potential use
in cross-compiling.
+ separate the rpath usage for c++ library from demo program
(Redhat #911540)
+ update/correct header-dependencies in c++ makefile (report by Werner
Fink).
+ add --with-cxx-shared to dpkg-script, as done for rpm-script.
20130324
+ build-fix for libtool configuration (reports by Daniel Silva Ferreira
and Roumen Petrov).
20130323
+ build-fix for OS X, to handle changes for --with-cxx-shared feature
(report by Christian Ebert).
+ change initialization for vt220, similar entries for consistency
with cursor-key strings (NetBSD #47674) -TD
+ further improvements to linux-16color (Benjamin Sittler)
20130316
+ additional fix for tic.c, to allocate missing buffer space.
+ eliminate configure-script warnings for gen-pkgconfig.in
+ correct typo in sgr string for sun-color,
add bold for consistency with sgr,
change smso for consistency with sgr -TD
+ correct typo in sgr string for terminator -TD
+ add blink to the attributes masked by ncv in linux-16color (report
by Benjamin Sittler)
+ improve warning message from post-load checking for missing "%?"
operator by tic/infocmp by showing the entry name and capability.
+ minor formatting improvement to tic/infocmp -f option to ensure
line split after "%;".
+ amend scripting for --with-cxx-shared option to handle the debug
library "libncurses++_g.a" (report by Sven Joachim).
20130309
+ amend change to toe.c for reading from /dev/zero, to ensure that
there is a buffer for the temporary filename (cf: 20120324).
+ regenerated html manpages.
+ fix typo in terminfo.head (report by Sven Joachim, cf: 20130302).
+ updated some autoconf macros:
+ CF_ACVERSION_CHECK, from byacc 1.9 20130304
+ CF_INTEL_COMPILER, CF_XOPEN_SOURCE from luit 2.0-20130217
+ add configure option --with-cxx-shared to permit building
libncurses++ as a shared library when using g++, e.g., the same
limitations as libtool but better integrated with the usual build
configuration (Redhat #911540).
+ modify MKkey_defs.sh to filter out build-path which was unnecessarily
shown in curses.h (Debian #689131).
20130302
+ add section to terminfo manpage discussing user-defined capabilities.
+ update manpage description of NCURSES_NO_SETBUF, explaining why it
is obsolete.
+ add a check in waddch_nosync() to ensure that tab characters are
treated as control characters; some broken locales claim they are
printable.
+ add some traces to the Windows console driver.
+ initialize a temporary array in _nc_mbtowc, needed for some cases
of raw input in MinGW port.
20130218
+ correct ifdef on change to lib_twait.c (report by Werner Fink).
+ update config.guess, config.sub
20130216
+ modify test/testcurs.c to work with mouse for ncurses as it does for
pdcurses.
+ modify test/knight.c to work with mouse for pdcurses as it does for
ncurses.
+ modify internal recursion in wgetch() which handles cooked mode to
check if the call to wgetnstr() returned an error. This can happen
when both nocbreak() and nodelay() are set, for instance (report by
Nils Christopher Brause) (cf: 960418).
+ fixes for issues found by Coverity:
+ add a check for valid position in ClearToEOS()
+ fix in lib_twait.c when --enable-wgetch-events is used, pointer
use after free.
+ improve a limit-check in make_hash.c
+ fix a memory leak in hashed_db.c
20130209
+ modify test/configure script to make it simpler to override names
of curses-related libraries, to help with linking with pdcurses in
MinGW environment.
+ if the --with-terminfo-dirs configure option is not used, there is
no corresponding compiled-in value for that. Fill in "no default
value" for that part of the manpage substitution.
20130202
+ correct initialization in knight.c which let it occasionally make
an incorrect move (cf: 20001028).
+ improve documentation of the terminfo/termcap search path.
20130126
+ further fixes to mvcur to pass callback function (cf: 20130112),
needed to make test/dots_mvcur work.
+ reduce calls to SetConsoleActiveScreenBuffer in win_driver.c, to
help reduce flicker.
+ modify configure script to omit "+b" from linker options for very
old HP-UX systems (report by Dennis Grevenstein)
+ add HP-UX workaround for missing EILSEQ on old HP-UX systems (patch
by Dennis Grevenstein).
+ restore memmove/strdup support for antique systems (request by
Dennis Grevenstein).
+ change %l behavior in tparm to push the string length onto the stack
rather than saving the formatted length into the output buffer
(report by Roy Marples, cf: 980620).
20130119
+ fixes for issues found by Coverity:
+ fix memory leak in safe_sprintf.c
+ add check for return-value in tty_update.c
+ correct initialization for -s option in test/view.c
+ add check for numeric overflow in lib_instr.c
+ improve error-checking in copywin
+ add advice in infocmp manpage for termcap users (Debian #698469).
+ add "-y" option to test/demo_termcap and test/demo_terminfo to
demonstrate behavior with/without extended capabilities.
+ updated termcap manpage to document legacy termcap behavior for
matching capability names.
+ modify name-comparison for tgetstr, etc., to accommodate legacy
applications as well as to improve compatbility with BSD 4.2
termcap implementations (Debian #698299) (cf: 980725).
20130112
+ correct prototype in manpage for vid_puts.
+ drop ncurses/tty/tty_display.h, ncurses/tty/tty_input.h, since they
are unused in the current driver model.
+ modify mvcur to use stdout except when called within the ncurses
library.
+ modify vidattr and vid_attr to use stdout as documented in manpage.
+ amend changes made to buffering in 20120825 so that the low-level
putp() call uses stdout rather than ncurses' internal buffering.
The putp_sp() call does the same, for consistency (Redhat #892674).
20130105
+ add "-s" option to test/view.c to allow it to start in single-step
mode, reducing size of trace files when it is used for debugging
MinGW changes.
+ revert part of 20121222 change to tinfo_driver.c
+ add experimental logic in win_driver.c to improve optimization of
screen updates. This does not yet work with double-width characters,
so it is ifdef'd out for the moment (prompted by report by Erwin
Waterlander regarding screen flicker).
20121229
+ fix coverity warnings regarding copying into fixed-size buffers.
+ add throw-declarations in the c++ binding per Coverity warning.
+ minor changes to new-items for consistent reference to bug-report
numbers.
20121222
+ add *.dSYM directories to clean-rule in ncurses directory makefile,
for Mac OS builds.
+ add a configure check for gcc option -no-cpp-precomp, which is not
available in all Mac OS X configurations (report by Andras Salamon,
cf: 20011208).
+ improve 20021221 workaround for broken acs, handling a case where
that ACS_xxx character is not in the acsc string but there is a known
wide-character which can be used.
20121215
+ fix several warnings from clang 3.1 --analyze, includes correcting
a null-pointer check in _nc_mvcur_resume.
+ correct display of double-width characters with MinGW port (report
by Erwin Waterlander).
+ replace MinGW's wcrtomb(), fixing a problem with _nc_viscbuf
> fixes based on Coverity report:
+ correct coloring in test/bs.c
+ correct check for 8-bit value in _nc_insert_ch().
+ remove dead code in progs/tset.c, test/linedata.h
+ add null-pointer checks in lib_tracemse.c, panel.priv.h, and some
test-programs.
20121208
+ modify test/knight.c to show the number of choices possible for
each position in automove option, e.g., to allow user to follow
Warnsdorff's rule to solve the puzzle.
+ modify test/hanoi.c to show the minimum number of moves possible for
the given number of tiles (prompted by patch by Lucas Gioia).
> fixes based on Coverity report:
+ remove a few redundant checks.
+ correct logic in test/bs.c, when randomly placing a specific type of
ship.
+ check return value from remove/unlink in tic.
+ check return value from sscanf in test/ncurses.c
+ fix a null dereference in c++/cursesw.cc
+ fix two instances of uninitialized variables when configuring for the
terminal driver.
+ correct scope of variable used in SetSafeOutcWrapper macro.
+ set umask when calling mkstemp in tic.
+ initialize wbkgrndset() temporary variable when extended-colors are
used.
20121201
+ also replace MinGW's wctomb(), fixing a problem with setcchar().
+ modify test/view.c to load UTF-8 when built with MinGW by using
regular win32 API because the MinGW functions mblen() and mbtowc()
do not work.
20121124
+ correct order of color initialization versus display in some of the
test-programs, e.g., test_addstr.c
> fixes based on Coverity report:
+ delete windows on exit from some of the test-programs.
20121117
> fixes based on Coverity report:
+ add missing braces around FreeAndNull in two places.
+ various fixes in test/ncurses.c
+ improve limit-checks in tinfo/make_hash.c, tinfo/read_entry.c
+ correct malloc size in progs/infocmp.c
+ guard against negative array indices in test/knight.c
+ fix off-by-one limit check in test/color_name.h
+ add null-pointer check in progs/tabs.c, test/bs.c, test/demo_forms.c,
test/inchs.c
+ fix memory-leak in tinfo/lib_setup.c, progs/toe.c,
test/clip_printw.c, test/demo_menus.c
+ delete unused windows in test/chgat.c, test/clip_printw.c,
test/insdelln.c, test/newdemo.c on error-return.
20121110
+ modify configure macro CF_INCLUDE_DIRS to put $CPPFLAGS after the
local -I include options in case someone has set conflicting -I
options in $CPPFLAGS (prompted by patch for ncurses/Makefile.in by
Vassili Courzakis).
+ modify the ncurses*-config scripts to eliminate relative paths from
the RPATH_LIST variable, e.g., "../lib" as used in installing shared
libraries or executables.
20121102
+ realign these related pages:
curs_add_wchstr.3x
curs_addchstr.3x
curs_addstr.3x
curs_addwstr.3x
and fix a long-ago error in curs_addstr.3x which said that a -1
length parameter would only write as much as fit onto one line
(report by Reuben Thomas).
+ remove obsolete fallback _nc_memmove() for memmove()/bcopy().
+ remove obsolete fallback _nc_strdup() for strdup().
+ cancel any debug-rpm in package/ncurses.spec
+ reviewed vte-2012, reverted most of the change since it was incorrect
based on testing with tack -TD
+ un-cancel the initc in vte-256color, since this was implemented
starting with version 0.20 in 2009 -TD
20121026
+ improve malloc/realloc checking (prompted by discussion in Redhat
#866989).
+ add ncurses test-program as "ncurses6" to the rpm- and dpkg-scripts.
+ updated configure macros CF_GCC_VERSION and CF_WITH_PATHLIST. The
first corrects pattern used for Mac OS X's customization of gcc.
20121017
+ fix change to _nc_scroll_optimize(), which incorrectly freed memory
(Redhat #866989).
20121013
+ add vte-2012, gnome-2012, making these the defaults for vte/gnome
(patch by Christian Persch).
20121006
+ improve CF_GCC_VERSION to work around Debian's customization of gcc
--version message.
+ improve configure macros as done in byacc:
+ drop 2.13 compatibility; use 2.52.xxxx version only since EMX port
has used that for a while.
+ add 3rd parameter to AC_DEFINE's to allow autoheader to run, i.e.,
for experimental use.
+ remove unused configure macros.
+ modify configure script and makefiles to quiet new autoconf warning
for LIBS_TO_MAKE variable.
+ modify configure script to show $PATH_SEPARATOR variable.
+ update config.guess, config.sub
20120922
+ modify setupterm to set its copy of TERM to "unknown" if configured
for the terminal driver and TERM was null or empty.
+ modify treatment of TERM variable for MinGW port to allow explicit
use of the windows console driver by checking if $TERM is set to
"#win32con" or an abbreviation of that.
+ undo recent change to fallback definition of vsscanf() to build with
older Solaris compilers (cf: 20120728).
20120908
+ add test-screens to test/ncurses to show 256-characters at a time,
to help with MinGW port.
20120903
+ simplify varargs logic in lib_printw.c; va_copy is no longer needed
there.
+ modifications for MinGW port to make wide-character display usable.
20120902
+ regenerate configure script (report by Sven Joachim, cf: 20120901).
20120901
+ add a null-pointer check in _nc_flush (cf: 20120825).
+ fix a case in _nc_scroll_optimize() where the _oldnums_list array
might not be allocated.
+ improve comparisons in configure.in for unset shell variables.
20120826
+ increase size of ncurses' output-buffer, in case of very small
initial screen-sizes.
+ fix evaluation of TERMINFO and TERMINFO_DIRS default values as needed
after changes to use --datarootdir (reports by Gabriele Balducci,
Roumen Petrov).
20120825
+ change output buffering scheme, using buffer maintained by ncurses
rather than stdio, to avoid problems with SIGTSTP handling (report
by Brian Bloniarz).
20120811
+ update autoconf patch to 2.52.20120811, adding --datarootdir
(prompted by discussion with Erwin Waterlander).
+ improve description of --enable-reentrant option in README and the
INSTALL file.
+ add nsterm-256color, make this the default nsterm -TD
+ remove bw from nsterm-bce, per testing with tack -TD
20120804
+ update test/configure, adding check for tinfo library.
+ improve limit-checks for the getch fifo (report by Werner Fink).
+ fix a remaining mismatch between $with_echo and the symbols updated
for CF_DISABLE_ECHO affecting parameters for mk-2nd.awk (report by
Sven Joachim, cf: 20120317).
+ modify followup check for pkg-config's library directory in the
--enable-pc-files option to validate syntax (report by Sven Joachim,
cf: 20110716).
20120728
+ correct path for ncurses_mingw.h in include/headers, in case build
is done outside source-tree (patch by Roumen Petrov).
+ modify some older xterm entries to align with xterm source -TD
+ separate "xterm-old" alias from "xterm-r6" -TD
+ add E3 extended capability to xterm-basic and putty -TD
+ parenthesize parameters of other macros in curses.h -TD
+ parenthesize parameter of COLOR_PAIR and PAIR_NUMBER in curses.h
in case it happens to be a comma-expression, etc. (patch by Nick
Black).
20120721
+ improved form_request_by_name() and menu_request_by_name().
+ eliminate two fixed-size buffers in toe.c
+ extend use_tioctl() to have expected behavior when use_env(FALSE) and
use_tioctl(TRUE) are called.
+ modify ncurses test-program, adding -E and -T options to demonstrate
use_env() versus use_tioctl().
20120714
+ add use_tioctl() function (adapted from patch by Werner Fink,
Novell #769788):
20120707
+ add ncurses_mingw.h to installed headers (prompted by patch by
Juergen Pfeifer).
+ clarify return-codes from wgetch() in response to SIGWINCH (prompted
by Novell #769788).
+ modify resizeterm() to always push a KEY_RESIZE onto the fifo, even
if screensize is unchanged. Modify _nc_update_screensize() to push a
KEY_RESIZE if there was a SIGWINCH, even if it does not call
resizeterm(). These changes eliminate the case where a SIGWINCH is
received, but ERR returned from wgetch or wgetnstr because the screen
dimensions did not change (Novell #769788).
20120630
+ add --enable-interop to sample package scripts (suggested by Juergen
Pfeifer).
+ update CF_PATH_SYNTAX macro, from mawk changes.
+ modify mk-0th.awk to allow for generating llib-ltic, etc., though
some work is needed on cproto to work with lib_gen.c to update
llib-lncurses.
+ remove redundant getenv() cal in database-iterator leftover from
cleanup in 20120622 changes (report by Sven Joachim).
20120622
+ add -d, -e and -q options to test/demo_terminfo and test/demo_termcap
+ fix caching of environment variables in database-iterator (patch by
Philippe Troin, Redhat #831366).
20120616
+ add configure check to distinguish clang from gcc to eliminate
warnings about unused command-line parameters when compiler warnings
are enabled.
+ improve behavior when updating terminfo entries which are hardlinked
by allowing for the possibility that an alias has been repurposed to
a new primary name.
+ fix some strict compiler warnings based on package scripts.
+ further fixes for configure check for working poll (Debian #676461).
20120608
+ fix an uninitialized variable in -c/-n logic for infocmp changes
(cf: 20120526).
+ corrected fix for building c++ binding with clang 3.0 (report/patch
by Richard Yao, Gentoo #417613, cf: 20110409)
+ correct configure check for working poll, fixing the case where stdin
is redirected, e.g., in rpm/dpkg builds (Debian #676461).
+ add rpm- and dpkg-scripts, to test those build-environments.
The resulting packages are used only for testing.
20120602
+ add kdch1 aka "Remove" to vt220 and vt220-8 entries -TD
+ add kdch1, etc., to qvt108 -TD
+ add dl1/il1 to some entries based on dl/il values -TD
+ add dl to simpleterm -TD
+ add consistency-checks in tic for insert-line vs delete-line
controls, and insert/delete-char keys
+ correct no-leaks logic in infocmp when doing comparisons, fixing
duplicate free of entries given via the command-line, and freeing
entries loaded from the last-but-one of files specified on the
command-line.
+ add kdch1 to wsvt25 entry from NetBSD CVS (reported by David Lord,
analysis by Martin Husemann).
+ add cnorm/civis to wsvt25 entry from NetBSD CVS (report/analysis by
Onno van der Linden).
20120526
+ extend -c and -n options of infocmp to allow comparing more than two
entries.
+ correct check in infocmp for number of terminal names when more than
two are given.
+ correct typo in curs_threads.3x (report by Yanhui Shen on
freebsd-hackers mailing list).
20120512
+ corrected 'op' for bterm (report by Samuel Thibault) -TD
+ modify test/background.c to demonstrate a background character
holding a colored ACS_HLINE. The behavior differs from SVr4 due to
the thick- and double-line extension (cf: 20091003).
+ modify handling of acs characters in PutAttrChar to avoid mapping an
unmapped character to a space with A_ALTCHARSET set.
+ rewrite vt520 entry based on vt420 -TD
20120505
+ remove p6 (bold) from opus3n1+ for consistency -TD
+ remove acs stuff from env230 per clues in Ingres termcap -TD
+ modify env230 sgr/sgr0 to match other capabilities -TD
+ modify smacs/rmacs in bq300-8 to match sgr/sgr0 -TD
+ make sgr for dku7202 agree with other caps -TD
+ make sgr for ibmpc agree with other caps -TD
+ make sgr for tek4107 agree with other caps -TD
+ make sgr for ndr9500 agree with other caps -TD
+ make sgr for sco-ansi agree with other caps -TD
+ make sgr for d410 agree with other caps -TD
+ make sgr for d210 agree with other caps -TD
+ make sgr for d470c, d470c-7b agree with other caps -TD
+ remove redundant AC_DEFINE for NDEBUG versus Makefile definition.
+ fix a back-link in _nc_delink_entry(), which is needed if ncurses is
configured with --enable-termcap and --disable-getcap.
20120428
+ fix some inconsistencies between vt320/vt420, e.g., cnorm/civis -TD
+ add eslok flag to dec+sl -TD
+ dec+sl applies to vt320 and up -TD
+ drop wsl width from xterm+sl -TD
+ reuse xterm+sl in putty and nsca-m -TD
+ add ansi+tabs to vt520 -TD
+ add ansi+enq to vt220-vt520 -TD
+ fix a compiler warning in example in ncurses-intro.doc (Paul Waring).
+ added paragraph in keyname manpage telling how extended capabilities
are interpreted as key definitions.
+ modify tic's check of conflicting key definitions to include extended
capability strings in addition to the existing check on predefined
keys.
20120421
+ improve cleanup of temporary files in tic using atexit().
+ add msgr to vt420, similar DEC vtXXX entries -TD
+ add several missing vt420 capabilities from vt220 -TD
+ factor out ansi+pp from several entries -TD
+ change xterm+sl and xterm+sl-twm to include only the status-line
capabilities and not "use=xterm", making them more generally useful
as building-blocks -TD
+ add dec+sl building block, as example -TD
20120414
+ add XT to some terminfo entries to improve usefulness for other
applications than screen, which would like to pretend that xterm's
title is a status-line. -TD
+ change use-clauses in ansi-mtabs, hp2626, and hp2622 based on review
of ordering and overrides -TD
+ add consistency check in tic for screen's "XT" capability.
+ add section in terminfo.src summarizing the user-defined capabilities
used in that file -TD
20120407
+ fix an inconsistency between tic/infocmp "-x" option; tic omits all
non-standard capabilities, while infocmp was ignoring only the user
definable capabilities.
+ improve special case in tic parsing of description to allow it to be
followed by terminfo capabilities. Previously the description had to
be the last field on an input line to allow tic to distinguish
between termcap and terminfo format while still allowing commas to be
embedded in the description.
+ correct variable name in gen_edit.sh which broke configurability of
the --with-xterm-kbs option.
+ revert 2011-07-16 change to "linux" alias, return to "linux2.2" -TD
+ further amend 20110910 change, providing for configure-script
override of the "linux" terminfo entry to install and changing the
default for that to "linux2.2" (Debian #665959).
20120331
+ update Ada95/configure to use CF_DISABLE_ECHO (cf: 20120317).
+ correct order of use-clauses in st-256color -TD
+ modify configure script to look for gnatgcc if the Ada95 binding
is built, in preference to the default gcc/cc (suggested by
Nicolas Boulenguez).
+ modify configure script to ensure that the same -On option used for
the C compiler in CFLAGS is used for ADAFLAGS rather than simply
using "-O3" (suggested by Nicolas Boulenguez)
20120324
+ amend an old fix so that next_char() exits properly for empty files,
e.g., from reading /dev/null (cf: 20080804).
+ modify tic so that it can read from the standard input, or from
a character device. Because tic uses seek's, this requires writing
the data to a temporary file first (prompted by remark by Sven
Joachim) (cf: 20000923).
20120317
+ correct a check made in lib_napms.c, so that terminfo applications
can again use napms() (cf: 20110604).
+ add a note in tic.h regarding required casts for ABSENT_BOOLEAN
(cf: 20040327).
+ correct scripting for --disable-echo option in test/configure.
+ amend check for missing c++ compiler to work when no error is
reported, and no variables set (cf: 20021206).
+ add/use configure macro CF_DISABLE_ECHO.
20120310
+ fix some strict compiler warnings for abi6 and 64-bits.
+ use begin_va_copy/end_va_copy macros in lib_printw.c (cf: 20120303).
+ improve a limit-check in infocmp.c (Werner Fink):
20120303
+ minor tidying of terminfo.tail, clarify reason for limitation
regarding mapping of \0 to \200
+ minor improvement to _nc_copy_termtype(), using memcpy to replace
loops.
+ fix no-leaks checking in test/demo_termcap.c to account for multiple
calls to setupterm().
+ modified the libgpm change to show previous load as a problem in the
debug-trace.
> merge some patches from OpenSUSE rpm (Werner Fink):
+ ncurses-5.7-printw.dif, fixes for varargs handling in lib_printw.c
+ ncurses-5.7-gpm.dif, do not dlopen libgpm if already loaded by
runtime linker
+ ncurses-5.6-fallback.dif, do not free arrays and strings from static
fallback entries
20120228
+ fix breakage in tic/infocmp from 20120225 (report by Werner Fink).
20120225
+ modify configure script to allow creating dll's for MinGW when
cross-compiling.
+ add --enable-string-hacks option to control whether strlcat and
strlcpy may be used. The same issue applies to OpenBSD's warnings
about snprintf, noting that this function is weakly standardized.
+ add configure checks for strlcat, strlcpy and snprintf, to help
reduce bogus warnings with OpenBSD builds.
+ build-fix for OpenBSD 4.9 to supply consistent intptr_t declaration
(cf:20111231)
+ update config.guess, config.sub
20120218
+ correct CF_ETIP_DEFINES configure macro, making it exit properly on
the first success (patch by Pierre Labastie).
+ improve configure macro CF_MKSTEMP by moving existence-check for
mkstemp out of the AC_TRY_RUN, to help with cross-compiles.
+ improve configure macro CF_FUNC_POLL from luit changes to detect
broken implementations, e.g., with Mac OS X.
+ add configure option --with-tparm-arg
+ build-fix for MinGW cross-compiling, so that make_hash does not
depend on TTY definition (cf: 20111008).
20120211
+ make sgr for xterm-pcolor agree with other caps -TD
+ make sgr for att5425 agree with other caps -TD
+ make sgr for att630 agree with other caps -TD
+ make sgr for linux entries agree with other caps -TD
+ make sgr for tvi9065 agree with other caps -TD
+ make sgr for ncr260vt200an agree with other caps -TD
+ make sgr for ncr160vt100pp agree with other caps -TD
+ make sgr for ncr260vt300an agree with other caps -TD
+ make sgr for aaa-60-dec-rv, aaa+dec agree with other caps -TD
+ make sgr for cygwin, cygwinDBG agree with other caps -TD
+ add configure option --with-xterm-kbs to simplify configuration for
Linux versus most other systems.
20120204
+ improved tic -D option, avoid making target directory and provide
better diagnostics.
20120128
+ add mach-gnu (Debian #614316, patch by Samuel Thibault)
+ add mach-gnu-color, tweaks to mach-gnu terminfo -TD
+ make sgr for sun-color agree with smso -TD
+ make sgr for prism9 agree with other caps -TD
+ make sgr for icl6404 agree with other caps -TD
+ make sgr for ofcons agree with other caps -TD
+ make sgr for att5410v1, att4415, att620 agree with other caps -TD
+ make sgr for aaa-unk, aaa-rv agree with other caps -TD
+ make sgr for avt-ns agree with other caps -TD
+ amend fix intended to separate fixups for acsc to allow "tic -cv" to
give verbose warnings (cf: 20110730).
+ modify misc/gen-edit.sh to make the location of the tabset directory
consistent with misc/Makefile.in, i.e., using ${datadir}/tabset
(Debian #653435, patch by Sven Joachim).
20120121
+ add --with-lib-prefix option to allow configuring for old/new flavors
of OS/2 EMX.
+ modify check for gnat version to allow for year, as used in FreeBSD
port.
+ modify check_existence() in db_iterator.c to simply check if the
path is a directory or file, according to the need. Checking for
directory size also gives no usable result with OS/2 (cf: 20120107).
+ support OS/2 kLIBC (patch by KO Myung-Han).
20120114
+ several improvements to test/movewindow.c (prompted by discussion on
Linux Mint forum):
+ modify movement commands to make them continuous
+ rewrote the test for mvderwin
+ rewrote the test for recursive mvwin
+ split-out reusable CF_WITH_NCURSES_ETC macro in test/configure.in
+ updated configure macro CF_XOPEN_SOURCE, build-fixes for Mac OS X
and OpenBSD.
+ regenerated html manpages.
20120107
+ various improvments for MinGW (Juergen Pfeifer):
+ modify stat() calls to ignore the st_size member
+ drop mk-dlls.sh script.
+ change recommended regular expression library.
+ modify rain.c to allow for threaded configuraton.
+ modify tset.c to allow for case when size-change logic is not used.
20111231
+ modify toe's report when -a and -s options are combined, to add
a column showing which entries belong to a given database.
+ add -s option to toe, to sort its output.
+ modify progs/toe.c, simplifying use of db-iterator results to use
caching improvements from 20111001 and 20111126.
+ correct generation of pc-files when ticlib or termlib options are
given to rename the corresponding tic- or tinfo-libraries (report
by Sven Joachim).
20111224
+ document a portability issue with tput, i.e., that scripts which work
with ncurses may fail in other implementations that do no parameter
analysis.
+ add putty-sco entry -TD
20111217
+ review/fix places in manpages where --program-prefix configure option
was not being used.
+ add -D option to infocmp, to show the database locations that it
could use.
+ fix build for the special case where term-driver, ticlib and termlib
are all enabled. The terminal driver depends on a few features in
the base ncurses library, so tic's dependencies include both ncurses
and termlib.
+ fix build work for term-driver when --enable-wgetch-events option is
enabled.
+ use types to fix some questionable casts to void*.
20111210
+ modify configure script to check if thread library provides
pthread_mutexattr_settype(), e.g., not provided by Solaris 2.6
+ modify configure script to suppress check to define _XOPEN_SOURCE
for IRIX64, since its header files have a conflict versus
_SGI_SOURCE.
+ modify configure script to add ".pc" files for tic- and
tinfo-libraries, which were omitted in recent change (cf: 20111126).
+ fix inconsistent checks on $PKG_CONFIG variable in configure script.
20111203
+ modify configure-check for etip.h dependencies, supplying a temporary
copy of ncurses_dll.h since it is a generated file (prompted by
Debian #646977).
+ modify CF_CPP_PARAM_INIT "main" function to work with current C++.
20111126
+ correct database iterator's check for duplicate entries
(cf: 20111001).
+ modify database iterator to ignore $TERMCAP when it is not an
absolute pathname.
+ add -D option to tic, to show the database locations that it could
use.
+ improve description of database locations in tic manpage.
+ modify the configure script to generate a list of the ".pc" files to
generate, rather than deriving the list from the libraries which have
been built (patch by Mike Frysinger).
+ use AC_CHECK_TOOLS in preference to AC_PATH_PROGS when searching for
ncurses*-config, e.g., in Ada95/configure and test/configure (adapted
from patch by Mike Frysinger).
20111119
+ remove obsolete/conflicting fallback definition for _POSIX_SOURCE
from curses.priv.h, fixing a regression with IRIX64 and Tru64
(cf: 20110416)
+ modify _nc_tic_dir() to ensure that its return-value is nonnull,
i.e., the database iterator was not initialized. This case is needed
to when tic is translating to termcap, rather than loading the
database (cf: 20111001).
20111112
+ add pccon entries for OpenBSD console (Alexei Malinin).
+ build-fix for OpenBSD 4.9 with gcc 4.2.1, setting _XOPEN_SOURCE to
600 to work around inconsistent ifdef'ing of wcstof between C and
C++ header files.
+ modify capconvert script to accept more than exact match on "xterm",
e.g., the "xterm-*" variants, to exclude from the conversion (patch
by Robert Millan).
+ add -lc_r as alternative for -lpthread, allows build of threaded code
in older FreeBSD machines.
+ build-fix for MirBSD, which fails when either _XOPEN_SOURCE or
_POSIX_SOURCE are defined.
+ fix a typo misc/Makefile.in, used in uninstalling pc-files.
20111030
+ modify make_db_path() to allow creating "terminfo.db" in the same
directory as an existing "terminfo" directory. This fixes a case
where switching between hashed/filesystem databases would cause the
new hashed database to be installed in the next best location -
root's home directory.
+ add variable cf_cv_prog_gnat_correct to those passed to
config.status, fixing a problem with Ada95 builds (cf: 20111022).
+ change feature test from _XPG5 to _XOPEN_SOURCE in two places, to
accommodate broken implementations for _XPG6.
+ eliminate usage of NULL symbol from etip.h, to reduce header
interdependencies.
+ add configure check to decide when to add _XOPEN_SOURCE define to
compiler options, i.e., for Solaris 10 and later (cf: 20100403).
This is a workaround for gcc 4.6, which fails to build the c++
binding if that symbol is defined by the application, due to
incorrectly combining the corresponding feature test macros
(report by Peter Kruse).
20111022
+ correct logic for discarding mouse events, retaining the partial
events used to build up click, double-click, etc, until needed
(cf: 20110917).
+ fix configure script to avoid creating unused Ada95 makefile when
gnat does not work.
+ cleanup width-related gcc 3.4.3 warnings for 64-bit platform, for the
internal functions of libncurses. The external interface of courses
uses bool, which still produces these warnings.
20111015
+ improve description of --disable-tic-depends option to make it
clear that it may be useful whether or not the --with-termlib
option is also given (report by Sven Joachim).
+ amend termcap equivalent for set_pglen_inch to use the X/Open
"YI" rather than the obsolete Solaris 2.5 "sL" (cf: 990109).
+ improve manpage for tgetent differences from termcap library.
20111008
+ moved static data from db_iterator.c to lib_data.c
+ modify db_iterator.c for memory-leak checking, fix one leak.
+ modify misc/gen-pkgconfig.in to use Requires.private for the parts
of ncurses rather than Requires, as well as Libs.private for the
other library dependencies (prompted by Debian #644728).
20111001
+ modify tic "-K" option to only set the strict-flag rather than force
source-output. That allows the same flag to control the parser for
input and output of termcap source.
+ modify _nc_getent() to ignore backslash at the end of a comment line,
making it consistent with ncurses' parser.
+ restore a special-case check for directory needed to make termcap
text files load as if they were databases (cf: 20110924).
+ modify tic's resolution/collision checking to attempt to remove the
conflicting alias from the second entry in the pair, which is
normally following in the source file. Also improved the warning
message to make it simpler to see which alias is the problem.
+ improve performance of the database iterator by caching search-list.
20110925
+ add a missing "else" in changes to _nc_read_tic_entry().
20110924
+ modify _nc_read_tic_entry() so that hashed-database is checked before
filesystem.
+ updated CF_CURSES_LIBS check in test/configure script.
+ modify configure script and makefiles to split TIC_ARGS and
TINFO_ARGS into pieces corresponding to LDFLAGS and LIBS variables,
to help separate searches for tic- and tinfo-libraries (patch by Nick
Alcock aka "Nix").
+ build-fix for lib_mouse.c changes (cf: 20110917).
20110917
+ fix compiler warning for clang 2.9
+ improve merging of mouse events (integrated patch by Damien
Guibouret).
+ correct mask-check used in lib_mouse for wheel mouse buttons 4/5
(patch by Damien Guibouret).
20110910
+ modify misc/gen_edit.sh to select a "linux" entry which works with
the current kernel rather than assuming it is always "linux3.0"
(cf: 20110716).
+ revert a change to getmouse() which had the undesirable side-effect
of suppressing button-release events (report by Damien Guibouret,
cf: 20100102).
+ add xterm+kbs fragment from xterm #272 -TD
+ add configure option --with-pkg-config-libdir to provide control over
the actual directory into which pc-files are installed, do not use
the pkg-config environment variables (discussion with Frederic L W
Meunier).
+ add link to mailing-list archive in announce.html.in, as done in
FAQ (prompted by question by Andrius Bentkus).
+ improve manpage install by adjusting the "#include" examples to
show the ncurses-subdirectory used when --disable-overwrite option
is used.
+ install an alias for "curses" to the ncurses manpage, tied to the
--with-curses-h configure option (suggested by Reuben Thomas).
20110903
+ propagate error-returns from wresize, i.e., the internal
increase_size and decrease_size functions through resize_term (report
by Tim van der Molen, cf: 20020713).
+ fix typo in tset manpage (patch by Sven Joachim).
20110820
+ add a check to ensure that termcap files which might have "^?" do
not use the terminfo interpretation as "\177".
+ minor cleanup of X-terminal emulator section of terminfo.src -TD
+ add terminator entry -TD
+ add simpleterm entry -TD
+ improve wattr_get macros by ensuring that if the window pointer is
null, then the attribute and color values returned will be zero
(cf: 20110528).
20110813
+ add substitution for $RPATH_LIST to misc/ncurses-config.in
+ improve performance of tic with hashed-database by caching the
database connection, using atexit() to cleanup.
+ modify treatment of 2-character aliases at the beginning of termcap
entries so they are not counted in use-resolution, since these are
guaranteed to be unique. Also ignore these aliases when reporting
the primary name of the entry (cf: 20040501)
+ double-check gn (generic) flag in terminal descriptions to
accommodate old/buggy termcap databases which misused that feature.
+ minor fixes to _nc_tgetent(), ensure buffer is initialized even on
error-return.
20110807
+ improve rpath fix from 20110730 by ensuring that the new $RPATH_LIST
variable is defined in the makefiles which use it.
+ build-fix for DragonFlyBSD's pkgsrc in test/configure script.
+ build-fixes for NetBSD 5.1 with termcap support enabled.
+ corrected k9 in dg460-ansi, add other features based on manuals -TD
+ improve trimming of whitespace at the end of terminfo/termcap output
from tic/infocmp.
+ when writing termcap source, ensure that colons in the description
field are translated to a non-delimiter, i.e., "=".
+ add "-0" option to tic/infocmp, to make the termcap/terminfo source
use a single line.
+ add a null-pointer check when handling the $CC variable.
20110730
+ modify configure script and makefiles in c++ and progs to allow the
directory used for rpath option to be overridden, e.g., to work
around updates to the variables used by tic during an install.
+ add -K option to tic/infocmp, to provide stricter BSD-compatibility
for termcap output.
+ add _nc_strict_bsd variable in tic library which controls the
"strict" BSD termcap compatibility from 20110723, plus these
features:
+ allow escapes such as "\8" and "\9" when reading termcap
+ disallow "\a", "\e", "\l", "\s" and "\:" escapes when reading
termcap files, passing through "a", "e", etc.
+ expand "\:" as "\072" on output.
+ modify _nc_get_token() to reset the token's string value in case
there is a string-typed token lacking the "=" marker.
+ fix a few memory leaks in _nc_tgetent.
+ fix a few places where reading from a termcap file could refer to
freed memory.
+ add an overflow check when converting terminfo/termcap numeric
values, since terminfo stores those in a short, and they must be
positive.
+ correct internal variables used for translating to termcap "%>"
feature, and translating from termcap %B to terminfo, needed by
tctest (cf: 19991211).
+ amend a minor fix to acsc when loading a termcap file to separate it
from warnings needed for tic (cf: 20040710)
+ modify logic in _nc_read_entry() and _nc_read_tic_entry() to allow
a termcap file to be handled via TERMINFO_DIRS.
+ modify _nc_infotocap() to include non-mandatory padding when
translating to termcap.
+ modify _nc_read_termcap_entry(), passing a flag in the case where
getcap is used, to reduce interactive warning messages.
20110723
+ add a check in start_color() to limit color-pairs to 256 when
extended colors are not supported (patch by David Benjamin).
+ modify setcchar to omit no-longer-needed OR'ing of color pair in
the SetAttr() macro (patch by David Benjamin).
+ add kich1 to sun terminfo entry (Yuri Pankov)
+ use bold rather than reverse for smso in sun-color terminfo entry
(Yuri Pankov).
+ improve generation of termcap using tic/infocmp -C option, e.g.,
to correspond with 4.2BSD (prompted by discussion with Yuri Pankov
regarding Schilling's test program):
+ translate %02 and %03 to %2 and %3 respectively.
+ suppress string capabilities which use %s, not supported by tgoto
+ use \040 rather than \s
+ expand null characters as \200 rather than \0
+ modify configure script to support shared libraries for DragonFlyBSD.
20110716
+ replace an assert() in _nc_Free_Argument() with a regular null
pointer check (report/analysis by Franjo Ivancic).
+ modify configure --enable-pc-files option to take into account the
PKG_CONFIG_PATH variable (report by Frederic L W Meunier).
+ add/use xterm+tmux chunk from xterm #271 -TD
+ resync xterm-new entry from xterm #271 -TD
+ add E3 extended capability to linux-basic (Miroslav Lichvar)
+ add linux2.2, linux2.6, linux3.0 entries to give context for E3 -TD
+ add SI/SO change to linux2.6 entry (Debian #515609) -TD
+ fix inconsistent tabset path in pcmw (Todd C. Miller).
+ remove a backslash which continued comment, obscuring altos3
definition with OpenBSD toolset (Nicholas Marriott).
20110702
+ add workaround from xterm #271 changes to ensure that compiler flags
are not used in the $CC variable.
+ improve support for shared libraries, tested with AIX 5.3, 6.1 and
7.1 with both gcc 4.2.4 and cc.
+ modify configure checks for AIX to include release 7.x
+ add loader flags/libraries to libtool options so that dynamic loading
works properly, adapted from ncurses-5.7-ldflags-with-libtool.patch
at gentoo prefix repository (patch by Michael Haubenwallner).
20110626
+ move include of nc_termios.h out of term_entry.h, since the latter
is installed, e.g., for tack while the former is not (report by
Sven Joachim).
20110625
+ improve cleanup() function in lib_tstp.c, using _exit() rather than
exit() and checking for SIGTERM rather than SIGQUIT (prompted by
comments forwarded by Nicholas Marriott).
+ reduce name pollution from term.h, moving fallback #define's for
tcgetattr(), etc., to new private header nc_termios.h (report by
Sergio NNX).
+ two minor fixes for tracing (patch by Vassili Courzakis).
+ improve trace initialization by starting it in use_env() and
ripoffline().
+ review old email, add details for some changelog entries.
20110611
+ update minix entry to minix 3.2 (Thomas Cort).
+ fix a strict compiler warning in change to wattr_get (cf: 20110528).
20110604
+ fixes for MirBSD port:
+ set default prefix to /usr.
+ add support for shared libraries in configure script.
+ use S_ISREG and S_ISDIR consistently, with fallback definitions.
+ add a few more checks based on ncurses/link_test.
+ modify MKlib_gen.sh to handle sp-funcs renaming of NCURSES_OUTC type.
20110528
+ add case to CF_SHARED_OPTS for Interix (patch by Markus Duft).
+ used ncurses/link_test to check for behavior when the terminal has
not been initialized and when an application passes null pointers
to the library. Added checks to cover this (prompted by Redhat
#707344).
+ modify MKlib_gen.sh to make its main() function call each function
with zero parameters, to help find inconsistent checking for null
pointers, etc.
20110521
+ fix warnings from clang 2.7 "--analyze"
20110514
+ compiler-warning fixes in panel and progs.
+ modify CF_PKG_CONFIG macro, from changes to tin -TD
+ modify CF_CURSES_FUNCS configure macro, used in test directory
configure script:
+ work around (non-optimizer) bug in gcc 4.2.1 which caused
test-expression to be omitted from executable.
+ force the linker to see a link-time expression of a symbol, to
help work around weak-symbol issues.
20110507
+ update discussion of MKfallback.sh script in INSTALL; normally the
script is used automatically via the configured makefiles. However
there are still occasions when it might be used directly by packagers
(report by Gunter Schaffler).
+ modify misc/ncurses-config.in to omit the "-L" option from the
"--libs" output if the library directory is /usr/lib.
+ change order of tests for curses.h versus ncurses.h headers in the
configure scripts for Ada95 and test-directories, to look for
ncurses.h, from fixes to tin -TD
+ modify ncurses/tinfo/access.c to account for Tandem's root uid
(report by Joachim Schmitz).
20110430
+ modify rules in Ada95/src/Makefile.in to ensure that the PIC option
is not used when building a static library (report by Nicolas
Boulenguez):
+ Ada95 build-fix for big-endian architectures such as sparc. This
undoes one of the fixes from 20110319, which added an "Unused" member
to representation clauses, replacing that with pragmas to suppress
warnings about unused bits (patch by Nicolas Boulenguez).
20110423
+ add check in test/configure for use_window, use_screen.
+ add configure-checks for getopt's variables, which may be declared
as different types on some Unix systems.
+ add check in test/configure for some legacy curses types of the
function pointer passed to tputs().
+ modify init_pair() to accept -1's for color value after
assume_default_colors() has been called (Debian #337095).
+ modify test/background.c, adding commmand-line options to demonstrate
assume_default_colors() and use_default_colors().
20110416
+ modify configure script/source-code to only define _POSIX_SOURCE if
the checks for sigaction and/or termios fail, and if _POSIX_C_SOURCE
and _XOPEN_SOURCE are undefined (report by Valentin Ochs).
+ update config.guess, config.sub
20110409
+ fixes to build c++ binding with clang 3.0 (patch by Alexander
Kolesen).
+ add check for unctrl.h in test/configure, to work around breakage in
some ncurses packages.
+ add "--disable-widec" option to test/configure script.
+ add "--with-curses-colr" and "--with-curses-5lib" options to the
test/configure script to address testing with very old machines.
20110404 5.9 release for upload to ftp.gnu.org
20110402
+ various build-fixes for the rpm/dpkg scripts.
+ add "--enable-rpath-link" option to Ada95/configure, to allow
packages to suppress the rpath feature which is normally used for
the in-tree build of sample programs.
+ corrected definition of libdir variable in Ada95/src/Makefile.in,
needed for rpm script.
+ add "--with-shared" option to Ada95/configure script, to allow
making the C-language parts of the binding use appropriate compiler
options if building a shared library with gnat.
20110329
> portability fixes for Ada95 binding:
+ add configure check to ensure that SIGINT works with gnat. This is
needed for the "rain" sample program. If SIGINT does not work, omit
that sample program.
+ correct typo in check of $PKG_CONFIG variable in Ada95/configure
+ add ncurses_compat.c, to supply functions used in the Ada95 binding
which were added in 5.7 and later.
+ modify sed expression in CF_NCURSES_ADDON to eliminate a dependency
upon GNU sed.
20110326
+ add special check in Ada95/configure script for ncurses6 reentrant
code.
+ regen Ada html documentation.
+ build-fix for Ada shared libraries versus the varargs workaround.
+ add rpm and dpkg scripts for Ada95 and test directories, for test
builds.
+ update test/configure macros CF_CURSES_LIBS, CF_XOPEN_SOURCE and
CF_X_ATHENA_LIBS.
+ add configure check to determine if gnat's project feature supports
libraries, i.e., collections of .ali files.
+ make all dereferences in Ada95 samples explicit.
+ fix typo in comment in lib_add_wch.c (patch by Petr Pavlu).
+ add configure check for, ifdef's for math.h which is in a separate
package on Solaris and potentially not installed (report by Petr
Pavlu).
> fixes for Ada95 binding (Nicolas Boulenguez):
+ improve type-checking in Ada95 by eliminating a few warning-suppress
pragmas.
+ suppress unreferenced warnings.
+ make all dereferences in binding explicit.
20110319
+ regen Ada html documentation.
+ change order of -I options from ncurses*-config script when the
--disable-overwrite option was used, so that the subdirectory include
is listed first.
+ modify the make-tar.sh scripts to add a MANIFEST and NEWS file.
+ modify configure script to provide value for HTML_DIR in
Ada95/gen/Makefile.in, which depends on whether the Ada95 binding is
distributed separately (report by Nicolas Boulenguez).
+ modify configure script to add "-g" and/or "-O3" to ADAFLAGS if the
CFLAGS for the build has these options.
+ amend change from 20070324, to not add 1 to the result of getmaxx
and getmaxy in the Ada binding (report by Nicolas Boulenguez for
thread in comp.lang.ada).
+ build-fix Ada95/samples for gnat 4.5
+ spelling fixes for Ada95/samples/explain.txt
> fixes for Ada95 binding (Nicolas Boulenguez):
+ add item in Trace_Attribute_Set corresponding to TRACE_ATTRS.
+ add workaround for binding to set_field_type(), which uses varargs.
The original binding from 990220 relied on the prevalent
implementation of varargs which did not support or need va_copy().
+ add dependency on gen/Makefile.in needed for *-panels.ads
+ add Library_Options to library.gpr
+ add Languages to library.gpr, for gprbuild
20110307
+ revert changes to limit-checks from 20110122 (Debian #616711).
> minor type-cleanup of Ada95 binding (Nicolas Boulenguez):
+ corrected a minor sign error in a field of Low_Level_Field_Type, to
conform to form.h.
+ replaced C_Int by Curses_Bool as return type for some callbacks, see
fieldtype(3FORM).
+ modify samples/sample-explain.adb to provide explicit message when
explain.txt is not found.
20110305
+ improve makefiles for Ada95 tree (patch by Nicolas Boulenguez).
+ fix an off-by-one error in _nc_slk_initialize() from 20100605 fixes
for compiler warnings (report by Nicolas Boulenguez).
+ modify Ada95/gen/gen.c to declare unused bits in generated layouts,
needed to compile when chtype is 64-bits using gnat 4.4.5
20110226 5.8 release for upload to ftp.gnu.org
20110226
+ update release notes, for 5.8.
+ regenerated html manpages.
+ change open() in _nc_read_file_entry() to fopen() for consistency
with write_file().
+ modify misc/run_tic.in to create parent directory, in case this is
a new install of hashed database.
+ fix typo in Ada95/mk-1st.awk which causes error with original awk.
20110220
+ configure script rpath fixes from xterm #269.
+ workaround for cygwin's non-functional features.h, to force ncurses'
configure script to define _XOPEN_SOURCE_EXTENDED when building
wide-character configuration.
+ build-fix in run_tic.sh for OS/2 EMX install
+ add cons25-debian entry (patch by Brian M Carlson, Debian #607662).
20110212
+ regenerated html manpages.
+ use _tracef() in show_where() function of tic, to work correctly with
special case of trace configuration.
20110205
+ add xterm-utf8 entry as a demo of the U8 feature -TD
+ add U8 feature to denote entries for terminal emulators which do not
support VT100 SI/SO when processing UTF-8 encoding -TD
+ improve the NCURSES_NO_UTF8_ACS feature by adding a check for an
extended terminfo capability U8 (prompted by mailing list
discussion).
20110122
+ start documenting interface changes for upcoming 5.8 release.
+ correct limit-checks in derwin().
+ correct limit-checks in newwin(), to ensure that windows have nonzero
size (report by Garrett Cooper).
+ fix a missing "weak" declaration for pthread_kill (patch by Nicholas
Alcock).
+ improve documentation of KEY_ENTER in curs_getch.3x manpage (prompted
by discussion with Kevin Martin).
20110115
+ modify Ada95/configure script to make the --with-curses-dir option
work without requiring the --with-ncurses option.
+ modify test programs to allow them to be built with NetBSD curses.
+ document thick- and double-line symbols in curs_add_wch.3x manpage.
+ document WACS_xxx constants in curs_add_wch.3x manpage.
+ fix some warnings for clang 2.6 "--analyze"
+ modify Ada95 makefiles to make html-documentation with the project
file configuration if that is used.
+ update config.guess, config.sub
20110108
+ regenerated html manpages.
+ minor fixes to enable lint when trace is not enabled, e.g., with
clang --analyze.
+ fix typo in man/default_colors.3x (patch by Tim van der Molen).
+ update ncurses/llib-lncurses*
20110101
+ fix remaining strict compiler warnings in ncurses library ABI=5,
except those dealing with function pointers, etc.
20101225
+ modify nc_tparm.h, adding guards against repeated inclusion, and
allowing TPARM_ARG to be overridden.
+ fix some strict compiler warnings in ncurses library.
20101211
+ suppress ncv in screen entry, allowing underline (patch by Alejandro
R Sedeno).
+ also suppress ncv in konsole-base -TD
+ fixes in wins_nwstr() and related functions to ensure that special
characters, i.e., control characters are handled properly with the
wide-character configuration.
+ correct a comparison in wins_nwstr() (Redhat #661506).
+ correct help-messages in some of the test-programs, which still
referred to quitting with 'q'.
20101204
+ add special case to _nc_infotocap() to recognize the setaf/setab
strings from xterm+256color and xterm+88color, and provide a reduced
version which works with termcap.
+ remove obsolete emacs "Local Variables" section from documentation
(request by Sven Joachim).
+ update doc/html/index.html to include NCURSES-Programming-HOWTO.html
(report by Sven Joachim).
20101128
+ modify test/configure and test/Makefile.in to handle this special
case of building within a build-tree (Debian #34182):
mkdir -p build && cd build && ../test/configure && make
20101127
+ miscellaneous build-fixes for Ada95 and test-directories when built
out-of-tree.
+ use VPATH in makefiles to simplify out-of-tree builds (Debian #34182).
+ fix typo in rmso for tek4106 entry -Goran Weinholt
20101120
+ improve checks in test/configure for X libraries, from xterm #267
changes.
+ modify test/configure to allow it to use the build-tree's libraries
e.g., when using that to configure the test-programs without the
rpath feature (request by Sven Joachim).
+ repurpose "gnome" terminfo entries as "vte", retaining "gnome" items
for compatibility, but generally deprecating those since the VTE
library is what actually defines the behavior of "gnome", etc.,
since 2003 -TD
20101113
+ compiler warning fixes for test programs.
+ various build-fixes for test-programs with pdcurses.
+ updated configure checks for X packages in test/configure from xterm
#267 changes.
+ add configure check to gnatmake, to accommodate cygwin.
20101106
+ correct list of sub-directories needed in Ada95 tree for building as
a separate package.
+ modify scripts in test-directory to improve builds as a separate
package.
20101023
+ correct parsing of relative tab-stops in tabs program (report by
Philip Ganchev).
+ adjust configure script so that "t" is not added to library suffix
when weak-symbols are used, allowing the pthread configuration to
more closely match the non-thread naming (report by Werner Fink).
+ modify configure check for tic program, used for fallbacks, to a
warning if not found. This makes it simpler to use additonal
scripts to bootstrap the fallbacks code using tic from the build
tree (report by Werner Fink).
+ fix several places in configure script using ${variable-value} form.
+ modify configure macro CF_LDFLAGS_STATIC to accommodate some loaders
which do not support selectively linking against static libraries
(report by John P. Hartmann)
+ fix an unescaped dash in man/tset.1 (report by Sven Joachim).
20101009
+ correct comparison used for setting 16-colors in linux-16color
entry (Novell #644831) -TD
+ improve linux-16color entry, using "dim" for color-8 which makes it
gray rather than black like color-0 -TD
+ drop misc/ncu-indent and misc/jpf-indent; they are provided by an
external package "cindent".
20101002
+ improve linkages in html manpages, adding references to the newer
pages, e.g., *_variables, curs_sp_funcs, curs_threads.
+ add checks in tic for inconsistent cursor-movement controls, and for
inconsistent printer-controls.
+ fill in no-parameter forms of cursor-movement where a parameterized
form is available -TD
+ fill in missing cursor controls where the form of the controls is
ANSI -TD
+ fix inconsistent punctuation in form_variables manpage (patch by
Sven Joachim).
+ add parameterized cursor-controls to linux-basic (report by Dae) -TD
> patch by Juergen Pfeifer:
+ document how to build 32-bit libraries in README.MinGW
+ fixes to filename computation in mk-dlls.sh.in
+ use POSIX locale in mk-dlls.sh.in rather than en_US (report by Sven
Joachim).
+ add a check in mk-dlls.sh.in to obtain the size of a pointer to
distinguish between 32-bit and 64-bit hosts. The result is stored
in mingw_arch
20100925
+ add "XT" capability to entries for terminals that support both
xterm-style mouse- and title-controls, for "screen" which
special-cases TERM beginning with "xterm" or "rxvt" -TD
> patch by Juergen Pfeifer:
+ use 64-Bit MinGW toolchain (recommended package from TDM, see
README.MinGW).
+ support pthreads when using the TDM MinGW toolchain
20100918
+ regenerated html manpages.
+ minor fixes for symlinks to curs_legacy.3x and curs_slk.3x manpages.
+ add manpage for sp-funcs.
+ add sp-funcs to test/listused.sh, for documentation aids.
20100911
+ add manpages for summarizing public variables of curses-, terminfo-
and form-libraries.
+ minor fixes to manpages for consistency (patch by Jason McIntyre).
+ modify tic's -I/-C dump to reformat acsc strings into canonical form
(sorted, unique mapping) (cf: 971004).
+ add configure check for pthread_kill(), needed for some old
platforms.
20100904
+ add configure option --without-tests, to suppress building test
programs (request by Frederic L W Meunier).
20100828
+ modify nsterm, xnuppc and tek4115 to make sgr/sgr0 consistent -TD
+ add check in terminfo source-reader to provide more informative
message when someone attempts to run tic on a compiled terminal
description (prompted by Debian #593920).
+ note in infotocap and captoinfo manpages that they read terminal
descriptions from text-files (Debian #593920).
+ improve acsc string for vt52, show arrow keys (patch by Benjamin
Sittler).
20100814
+ document in manpages that "mv" functions first use wmove() to check
the window pointer and whether the position lies within the window
(suggested by Poul-Henning Kamp).
+ fixes to curs_color.3x, curs_kernel.3x and wresize.3x manpages (patch
by Tim van der Molen).
+ modify configure script to transform library names for tic- and
tinfo-libraries so that those build properly with Mac OS X shared
library configuration.
+ modify configure script to ensure that it removes conftest.dSYM
directory leftover on checks with Mac OS X.
+ modify configure script to cleanup after check for symbolic links.
20100807
+ correct a typo in mk-1st.awk (patch by Gabriele Balducci)
(cf: 20100724)
+ improve configure checks for location of tic and infocmp programs
used for installing database and for generating fallback data,
e.g., for cross-compiling.
+ add Markus Kuhn's wcwidth function for compiling MinGW
+ add special case to CF_REGEX for cross-compiling to MinGW target.
20100731
+ modify initialization check for win32con driver to eliminate need for
special case for TERM "unknown", using terminal database if available
(prompted by discussion with Roumen Petrov).
+ for MinGW port, ensure that terminal driver is setup if tgetent()
is called (patch by Roumen Petrov).
+ document tabs "-0" and "-8" options in manpage.
+ fix Debian "lintian" issues with manpages reported in
http://lintian.debian.org/full/csmall@debian.org.html#ncurses
20100724
+ add a check in tic for missing set_tab if clear_all_tabs given.
+ improve use of symbolic links in makefiles by using "-f" option if
it is supported, to eliminate temporary removal of the target
(prompted by http://www.t2-project.org/packages/ncurses.html)
+ minor improvement to test/ncurses.c, reset color pairs in 'd' test
after exit from 'm' main-menu command.
+ improved ncu-indent, from mawk changes, allows more than one of
GCC_NORETURN, GCC_PRINTFLIKE and GCC_SCANFLIKE on a single line.
20100717
+ add hard-reset for rs2 to wsvt25 to help ensure that reset ends
the alternate character set (patch by Nicholas Marriott)
+ remove tar-copy.sh and related configure/Makefile chunks, since the
Ada95 binding is now installed using rules in Ada95/src.
20100703
+ continue integrating changes to use gnatmake project files in Ada95
+ add/use configure check to turn on project rules for Ada95/src.
+ revert the vfork change from 20100130, since it does not work.
20100626
+ continue integrating changes to use gnatmake project files in Ada95
+ old gnatmake (3.15) does not produce libraries using project-file;
work around by adding script to generate alternate makefile.
20100619
+ continue integrating changes to use gnatmake project files in Ada95
+ add configure --with-ada-sharedlib option, for the test_make rule.
+ move Ada95-related logic into aclocal.m4, since additional checks
will be needed to distinguish old/new implementations of gnat.
20100612
+ start integrating changes to use gnatmake project files in Ada95 tree
+ add test_make / test_clean / test_install rules in Ada95/src
+ change install-path for adainclude directory to /usr/share/ada (was
/usr/lib/ada).
+ update Ada95/configure.
+ add mlterm+256color entry, for mlterm 3.0.0 -TD
+ modify test/configure to use macros to ensure consistent order
of updating LIBS variable.
20100605
+ change search order of options for Solaris in CF_SHARED_OPTS, to
work with 64-bit compiles.
+ correct quoting of assignment in CF_SHARED_OPTS case for aix
(cf: 20081227)
20100529
+ regenerated html documentation.
+ modify test/configure to support pkg-config for checking X libraries
used by PDCurses.
+ add/use configure macro CF_ADD_LIB to force consistency of
assignments to $LIBS, etc.
+ fix configure script for combining --with-pthread
and --enable-weak-symbols options.
20100522
+ correct cross-compiling configure check for CF_MKSTEMP macro, by
adding a check cache variable set by AC_CHECK_FUNC (report by
Pierre Labastie).
+ simplify include-dependencies of make_hash and make_keys, to reduce
the need for setting BUILD_CPPFLAGS in cross-compiling when the
build- and target-machines differ.
+ repair broken-linker configuration by restoring a definition of SP
variable to curses.priv.h, and adjusting for cases where sp-funcs
are used.
+ improve configure macro CF_AR_FLAGS, allowing ARFLAGS environment
variable to override (prompted by report by Pablo Cazallas).
20100515
+ add configure option --enable-pthreads-eintr to control whether the
new EINTR feature is enabled.
+ modify logic in pthread configuration to allow EINTR to interrupt
a read operation in wgetch() (Novell #540571, patch by Werner Fink).
+ drop mkdirs.sh, use "mkdir -p".
+ add configure option --disable-libtool-version, to use the
"-version-number" feature which was added in libtool 1.5 (report by
Peter Haering). The default value for the option uses the newer
feature, which makes libraries generated using libtool compatible
with the standard builds of ncurses.
+ updated test/configure to match configure script macros.
+ fixes for configure script from lynx changes:
+ improve CF_FIND_LINKAGE logic for the case where a function is
found in predefined libraries.
+ revert part of change to CF_HEADER (cf: 20100424)
20100501
+ correct limit-check in wredrawln, accounting for begy/begx values
(patch by David Benjamin).
+ fix most compiler warnings from clang.
+ amend build-fix for OpenSolaris, to ensure that a system header is
included in curses.h before testing feature symbols, since they
may be defined by that route.
20100424
+ fix some strict compiler warnings in ncurses library.
+ modify configure macro CF_HEADER_PATH to not look for variations in
the predefined include directories.
+ improve configure macros CF_GCC_VERSION and CF_GCC_WARNINGS to work
with gcc 4.x's c89 alias, which gives warning messages for cases
where older versions would produce an error.
20100417
+ modify _nc_capcmp() to work with cancelled strings.
+ correct translation of "^" in _nc_infotocap(), used to transform
terminfo to termcap strings
+ add configure --disable-rpath-hack, to allow disabling the feature
which adds rpath options for libraries in unusual places.
+ improve CF_RPATH_HACK_2 by checking if the rpath option for a given
directory was already added.
+ improve CF_RPATH_HACK_2 by using ldd to provide a standard list of
directories (which will be ignored).
20100410
+ improve win_driver.c handling of mouse:
+ discard motion events
+ avoid calling _nc_timed_wait when there is a mouse event
+ handle 4th and "rightmost" buttons.
+ quote substitutions in CF_RPATH_HACK_2 configure macro, needed for
cases where there are embedded blanks in the rpath option.
20100403
+ add configure check for exctags vs ctags, to work around pkgsrc.
+ simplify logic in _nc_get_screensize() to make it easier to see how
environment variables may override system- and terminfo-values
(prompted by discussion with Igor Bujna).
+ make debug-traces for COLOR_PAIR and PAIR_NUMBER less verbose.
+ improve handling of color-pairs embedded in attributes for the
extended-colors configuration.
+ modify MKlib_gen.sh to build link_test with sp-funcs.
+ build-fixes for OpenSolaris aka Solaris 11, for wide-character
configuration as well as for rpath feature in *-config scripts.
20100327
+ refactor CF_SHARED_OPTS configure macro, making CF_RPATH_HACK more
reusable.
+ improve configure CF_REGEX, similar fixes.
+ improve configure CF_FIND_LINKAGE, adding add check between system
(default) and explicit paths, where we can find the entrypoint in the
given library.
+ add check if Gpm_Open() returns a -2, e.g., for "xterm". This is
normally suppressed but can be overridden using $NCURSES_GPM_TERMS.
Ensure that Gpm_Close() is called in this case.
20100320
+ rename atari and st52 terminfo entries to atari-old, st52-old, use
newer entries from FreeMiNT by Guido Flohr (from patch/report by Alan
Hourihane).
20100313
+ modify install-rule for manpages so that *-config manpages will
install when building with --srcdir (report by Sven Joachim).
+ modify CF_DISABLE_LEAKS configure macro so that the --enable-leaks
option is not the same as --disable-leaks (GenToo #305889).
+ modify #define's for build-compiler to suppress cchar_t symbol from
compile of make_hash and make_keys, improving cross-compilation of
ncursesw (report by Bernhard Rosenkraenzer).
+ modify CF_MAN_PAGES configure macro to replace all occurrences of
TPUT in tput.1's manpage (Debian #573597, report/analysis by Anders
Kaseorg).
20100306
+ generate manpages for the *-config scripts, adapted from help2man
(suggested by Sven Joachim).
+ use va_copy() in _nc_printf_string() to avoid conflicting use of
va_list value in _nc_printf_length() (report by Wim Lewis).
20100227
+ add Ada95/configure script, to use in tar-file created by
Ada95/make-tar.sh
+ fix typo in wresize.3x (patch by Tim van der Molen).
+ modify screen-bce.XXX entries to exclude ech, since screen's color
model does not clear with color for that feature -TD
20100220
+ add make-tar.sh scripts to Ada95 and test subdirectories to help with
making those separately distributable.
+ build-fix for static libraries without dlsym (Debian #556378).
+ fix a syntax error in man/form_field_opts.3x (patch by Ingo
Schwarze).
20100213
+ add several screen-bce.XXX entries -TD
20100206
+ update mrxvt terminfo entry -TD
+ modify win_driver.c to support mouse single-clicks.
+ correct name for termlib in ncurses*-config, e.g., if it is renamed
to provide a single file for ncurses/ncursesw libraries (patch by
Miroslav Lichvar).
20100130
+ use vfork in test/ditto.c if available (request by Mike Frysinger).
+ miscellaneous cleanup of manpages.
+ fix typo in curs_bkgd.3x (patch by Tim van der Molen).
+ build-fix for --srcdir (patch by Miroslav Lichvar).
20100123
+ for term-driver configuration, ensure that the driver pointer is
initialized in setupterm so that terminfo/termcap programs work.
+ amend fix for Debian #542031 to ensure that wattrset() returns only
OK or ERR, rather than the attribute value (report by Miroslav
Lichvar).
+ reorder WINDOWLIST to put WINDOW data after SCREEN pointer, making
_nc_screen_of() compatible between normal/wide libraries again (patch
by Miroslav Lichvar)
+ review/fix include-dependencies in modules files (report by Miroslav
Lichvar).
20100116
+ modify win_driver.c to initialize acs_map for win32 console, so
that line-drawing works.
+ modify win_driver.c to initialize TERMINAL struct so that programs
such as test/lrtest.c and test/ncurses.c which test string
capabilities can run.
+ modify term-driver modules to eliminate forward-reference
declarations.
20100109
+ modify configure macro CF_XOPEN_SOURCE, etc., to use CF_ADD_CFLAGS
consistently to add new -D's while removing duplicates.
+ modify a few configure macros to consistently put new options
before older in the list.
+ add tiparm(), based on review of X/Open Curses Issue 7.
+ minor documentation cleanup.
+ update config.guess, config.sub from
http://savannah.gnu.org/projects/config
(caveat - its maintainer put 2010 copyright date on files dated 2009)
20100102
+ minor improvement to tic's checking of similar SGR's to allow for the
most common case of SGR 0.
+ modify getmouse() to act as its documentation implied, returning on
each call the preceding event until none are left. When no more
events remain, it will return ERR.
20091227
+ change order of lookup in progs/tput.c, looking for terminfo data
first. This fixes a confusion between termcap "sg" and terminfo
"sgr" or "sgr0", originally from 990123 changes, but exposed by
20091114 fixes for hashing. With this change, only "dl" and "ed" are
ambiguous (Mandriva #56272).
20091226
+ add bterm terminfo entry, based on bogl 0.1.18 -TD
+ minor fix to rxvt+pcfkeys terminfo entry -TD
+ build-fixes for Ada95 tree for gnat 4.4 "style".
20091219
+ remove old check in mvderwin() which prevented moving a derived
window whose origin happened to coincide with its parent's origin
(report by Katarina Machalkova).
+ improve test/ncurses.c to put mouse droppings in the proper window.
+ update minix terminfo entry -TD
+ add bw (auto-left-margin) to nsterm* entries (Benjamin Sittler)
20091212
+ correct transfer of multicolumn characters in multirow
field_buffer(), which stopped at the end of the first row due to
filling of unused entries in a cchar_t array with nulls.
+ updated nsterm* entries (Benjamin Sittler, Emanuele Giaquinta)
+ modify _nc_viscbuf2() and _tracecchar_t2() to show wide-character
nulls.
+ use strdup() in set_menu_mark(), restore .marklen struct member on
failure.
+ eliminate clause 3 from the UCB copyrights in read_termcap.c and
tset.c per
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
(patch by Nicholas Marriott).
+ replace a malloc in tic.c with strdup, checking for failure (patch by
Nicholas Marriott).
+ update config.guess, config.sub from
http://savannah.gnu.org/projects/config
20091205
+ correct layout of working window used to extract data in
wide-character configured by set_field_buffer (patch by Rafael
Garrido Fernandez)
+ improve some limit-checks related to filename length in reading and
writing terminfo entries.
+ ensure that filename is always filled in when attempting to read
a terminfo entry, so that infocmp can report the filename (patch
by Nicholas Marriott).
20091128
+ modify mk-1st.awk to allow tinfo library to be built when term-driver
is enabled.
+ add error-check to configure script to ensure that sp-funcs is
enabled if term-driver is, since some internal interfaces rely upon
this.
20091121
+ fix case where progs/tput is used while sp-funcs is configure; this
requires save/restore of out-character function from _nc_prescreen
rather than the SCREEN structure (report by Charles Wilson).
+ fix typo in man/curs_trace.3x which caused incorrect symbolic links
+ improved configure macros CF_GCC_ATTRIBUTES, CF_PROG_LINT.
20091114
+ updated man/curs_trace.3x
+ limit hashing for termcap-names to 2-characters (Ubuntu #481740).
+ change a variable name in lib_newwin.c to make it clearer which
value is being freed on error (patch by Nicholas Marriott).
20091107
+ improve test/ncurses.c color-cycling test by reusing attribute-
and color-cycling logic from the video-attributes screen.
+ add ifdef'd with NCURSES_INTEROP_FUNCS experimental bindings in form
library which help make it compatible with interop applications
(patch by Juergen Pfeifer).
+ add configure option --enable-interop, for integrating changes
for generic/interop support to form-library by Juergen Pfeifer
20091031
+ modify use of $CC environment variable which is defined by X/Open
as a curses feature, to ignore it if it is not a single character
(prompted by discussion with Benjamin C W Sittler).
+ add START_TRACE in slk_init
+ fix a regression in _nc_ripoffline which made test/ncurses.c not show
soft-keys, broken in 20090927 merging.
+ change initialization of "hidden" flag for soft-keys from true to
false, broken in 20090704 merging (Ubuntu #464274).
+ update nsterm entries (patch by Benjamin C W Sittler, prompted by
discussion with Fabian Groffen in GenToo #206201).
+ add test/xterm-256color.dat
20091024
+ quiet some pedantic gcc warnings.
+ modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a
SIGWINCH, and discard that value, to avoid confusing application
(patch by Eygene Ryabinkin, FreeBSD #136223).
20091017
+ modify handling of $PKG_CONFIG_LIBDIR to use only the first item in
a possibly colon-separated list (Debian #550716).
20091010
+ supply a null-terminator to buffer in _nc_viswibuf().
+ fix a sign-extension bug in unget_wch() (report by Mike Gran).
+ minor fixes to error-returns in default function for tputs, as well
as in lib_screen.c
20091003
+ add WACS_xxx definitions to wide-character configuration for thick-
and double-lines (discussion with Slava Zanko).
+ remove unnecessary kcan assignment to ^C from putty (Sven Joachim)
+ add ccc and initc capabilities to xterm-16color -TD
> patch by Benjamin C W Sittler:
+ add linux-16color
+ correct initc capability of linux-c-nc end-of-range
+ similar change for dg+ccc and dgunix+ccc
20090927
+ move leak-checking for comp_captab.c into _nc_leaks_tinfo() since
that module since 20090711 is in libtinfo.
+ add configure option --enable-term-driver, to allow compiling with
terminal-driver. That is used in MinGW port, and (being somewhat
more complicated) is an experimental alternative to the conventional
termlib internals. Currently, it requires the sp-funcs feature to
be enabled.
+ completed integrating "sp-funcs" by Juergen Pfeifer in ncurses
library (some work remains for forms library).
20090919
+ document return code from define_key (report by Mike Gran).
+ make some symbolic links in the terminfo directory-tree shorter
(patch by Daniel Jacobowitz, forwarded by Sven Joachim).).
+ fix some groff warnings in terminfo.5, etc., from recent Debian
changes.
+ change ncv and op capabilities in sun-color terminfo entry to match
Sun's entry for this (report by Laszlo Peter).
+ improve interix smso terminfo capability by using reverse rather than
bold (report by Kristof Zelechovski).
20090912
+ add some test programs (and make these use the same special keys
by sharing linedata.h functions):
test/test_addstr.c
test/test_addwstr.c
test/test_addchstr.c
test/test_add_wchstr.c
+ correct internal _nc_insert_ch() to use _nc_insert_wch() when
inserting wide characters, since the wins_wch() function that it used
did not update the cursor position (report by Ciprian Craciun).
20090906
+ fix typo s/is_timeout/is_notimeout/ which made "man is_notimeout" not
work.
+ add null-pointer checks to other opaque-functions.
+ add is_pad() and is_subwin() functions for opaque access to WINDOW
(discussion with Mark Dickinson).
+ correct merge to lib_newterm.c, which broke when sp-funcs was
enabled.
20090905
+ build-fix for building outside source-tree (report by Sven Joachim).
+ fix Debian lintian warning for man/tabs.1 by making section number
agree with file-suffix (report by Sven Joachim).
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090829
+ workaround for bug in g++ 4.1-4.4 warnings for wattrset() macro on
amd64 (Debian #542031).
+ fix typo in curs_mouse.3x (Debian #429198).
20090822
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090815
+ correct use of terminfo capabilities for initializing soft-keys,
broken in 20090510 merging.
+ modify wgetch() to ensure it checks SIGWINCH when it gets an error
in non-blocking mode (patch by Clemens Ladisch).
+ use PATH_SEPARATOR symbol when substituting into run_tic.sh, to
help with builds on non-Unix platforms such as OS/2 EMX.
+ modify scripting for misc/run_tic.sh to test configure script's
$cross_compiling variable directly rather than comparing host/build
compiler names (prompted by comment in GenToo #249363).
+ fix configure script option --with-database, which was coded as an
enable-type switch.
+ build-fixes for --srcdir (report by Frederic L W Meunier).
20090808
+ separate _nc_find_entry() and _nc_find_type_entry() from
implementation details of hash function.
20090803
+ add tabs.1 to man/man_db.renames
+ modify lib_addch.c to compensate for removal of wide-character test
from unctrl() in 20090704 (Debian #539735).
20090801
+ improve discussion in INSTALL for use of system's tic/infocmp for
cross-compiling and building fallbacks.
+ modify test/demo_termcap.c to correspond better to options in
test/demo_terminfo.c
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+ fix logic for 'V' in test/ncurses.c tests f/F.
20090728
+ correct logic in tigetnum(), which caused tput program to treat all
string capabilities as numeric (report by Rajeev V Pillai,
cf: 20090711).
20090725
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090718
+ fix a null-pointer check in _nc_format_slks() in lib_slk.c, from
20090704 changes.
+ modify _nc_find_type_entry() to use hashing.
+ make CCHARW_MAX value configurable, noting that changing this would
change the size of cchar_t, and would be ABI-incompatible.
+ modify test-programs, e.g,. test/view.c, to address subtle
differences between Tru64/Solaris and HPUX/AIX getcchar() return
values.
+ modify length returned by getcchar() to count the trailing null
which is documented in X/Open (cf: 20020427).
+ fixes for test programs to build/work on HPUX and AIX, etc.
20090711
+ improve performance of tigetstr, etc., by using hashing code from tic.
+ minor fixes for memory-leak checking.
+ add test/demo_terminfo, for comparison with demo_termcap
20090704
+ remove wide-character checks from unctrl() (patch by Clemens Ladisch).
+ revise wadd_wch() and wecho_wchar() to eliminate dependency on
unctrl().
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090627
+ update llib-lncurses[wt] to use sp-funcs.
+ various code-fixes to build/work with --disable-macros configure
option.
+ add several new files from Juergen Pfeifer which will be used when
integration of "sp-funcs" is complete. This includes a port to
MinGW.
20090613
+ move definition for NCURSES_WRAPPED_VAR back to ncurses_dll.h, to
make includes of term.h without curses.h work (report by "Nix").
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090607
+ fix a regression in lib_tputs.c, from ongoing merges.
20090606
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090530
+ fix an infinite recursion when adding a legacy-coding 8-bit value
using insch() (report by Clemens Ladisch).
+ free home-terminfo string in del_curterm() (patch by Dan Weber).
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090523
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090516
+ work around antique BSD game's manipulation of stdscr, etc., versus
SCREEN's copy of the pointer (Debian #528411).
+ add a cast to wattrset macro to avoid compiler warning when comparing
its result against ERR (adapted from patch by Matt Kraii, Debian
#528374).
20090510
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090502
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+ add vwmterm terminfo entry (patch by Bryan Christ).
20090425
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090419
+ build fix for _nc_free_and_exit() change in 20090418 (report by
Christian Ebert).
20090418
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090411
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
This change finishes merging for menu and panel libraries, does
part of the form library.
20090404
+ suppress configure check for static/dynamic linker flags for gcc on
Darwin (report by Nelson Beebe).
20090328
+ extend ansi.sys pfkey capability from kf1-kf10 to kf1-kf48, moving
function key definitions from emx-base for consistency -TD
+ correct missing final 'p' in pfkey capability of ansi.sys-old (report
by Kalle Olavi Niemitalo).
+ improve test/ncurses.c 'F' test, show combining characters in color.
+ quiet a false report by cppcheck in c++/cursesw.cc by eliminating
a temporary variable.
+ use _nc_doalloc() rather than realloc() in a few places in ncurses
library to avoid leak in out-of-memory condition (reports by William
Egert and Martin Ettl based on cppcheck tool).
+ add --with-ncurses-wrap-prefix option to test/configure (discussion
with Charles Wilson).
+ use ncurses*-config scripts if available for test/configure.
+ update test/aclocal.m4 and test/configure
> patches by Charles Wilson:
+ modify CF_WITH_LIBTOOL configure check to allow unreleased libtool
version numbers (e.g. which include alphabetic chars, as well as
digits, after the final '.').
+ improve use of -no-undefined option for libtool by setting an
intermediate variable LT_UNDEF in the configure script, and then
using that in the libtool link-commands.
+ fix an missing use of NCURSES_PUBLIC_VAR() in tinfo/MKcodes.awk
from 20090321 changes.
+ improve mk-1st.awk script by writing separate cases for the
LIBTOOL_LINK command, depending on which library (ncurses, ticlib,
termlib) is to be linked.
+ modify configure.in to allow broken-linker configurations, not just
enable-reentrant, to set public wrap prefix.
20090321
+ add TICS_LIST and SHLIB_LIST to allow libtool 2.2.6 on Cygwin to
build with tic and term libraries (patch by Charles Wilson).
+ add -no-undefined option to libtool for Cygwin, MinGW, U/Win and AIX
(report by Charles Wilson).
+ fix definition for c++/Makefile.in's SHLIB_LIST, which did not list
the form, menu or panel libraries (patch by Charles Wilson).
+ add configure option --with-wrap-prefix to allow setting the prefix
for functions used to wrap global variables to something other than
"_nc_" (discussion with Charles Wilson).
20090314
+ modify scripts to generate ncurses*-config and pc-files to add
dependency for tinfo library (patch by Charles Wilson).
+ improve comparison of program-names when checking for linked flavors
such as "reset" by ignoring the executable suffix (reports by Charles
Wilson, Samuel Thibault and Cedric Bretaudeau on Cygwin mailing
list).
+ suppress configure check for static/dynamic linker flags for gcc on
Solaris 10, since gcc is confused by absence of static libc, and
does not switch back to dynamic mode before finishing the libraries
(reports by Joel Bertrand, Alan Pae).
+ minor fixes to Intel compiler warning checks in configure script.
+ modify _nc_leaks_tinfo() so leak-checking in test/railroad.c works.
+ modify set_curterm() to make broken-linker configuration work with
changes from 20090228 (report by Charles Wilson).
20090228
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
+ modify declaration of cur_term when broken-linker is used, but
enable-reentrant is not, to match pre-5.7 (report by Charles Wilson).
20090221
+ continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
20090214
+ add configure script --enable-sp-funcs to enable the new set of
extended functions.
+ start integrating patches by Juergen Pfeifer:
+ add extended functions which specify the SCREEN pointer for several
curses functions which use the global SP (these are incomplete;
some internals work is needed to complete these).
+ add special cases to configure script for MinGW port.
20090207
+ update several configure macros from lynx changes
+ append (not prepend) to CFLAGS/CPPFLAGS
+ change variable from PATHSEP to PATH_SEPARATOR
+ improve install-rules for pc-files (patch by Miroslav Lichvar).
+ make it work with $DESTDIR
+ create the pkg-config library directory if needed.
20090124
+ modify init_pair() to allow caller to create extra color pairs beyond
the color_pairs limit, which use default colors (request by Emanuele
Giaquinta).
+ add misc/terminfo.tmp and misc/*.pc to "sources" rule.
+ fix typo "==" where "=" is needed in ncurses-config.in and
gen-pkgconfig.in files (Debian #512161).
20090117
+ add -shared option to MK_SHARED_LIB when -Bsharable is used, for
*BSD's, without which "main" might be one of the shared library's
dependencies (report/analysis by Ken Dickey).
+ modify waddch_literal(), updating line-pointer after a multicolumn
character is found to not fit on the current row, and wrapping is
done. Since the line-pointer was not updated, the wrapped
multicolumn character was written to the beginning of the current row
(cf: 20041023, reported by "Nick" regarding problem with ncmpc
http://musicpd.org/mantis/bug_view_page.php?bug_id=1930).
20090110
+ add screen.Eterm terminfo entry (GenToo #124887) -TD
+ modify adacurses-config to look for ".ali" files in the adalib
directory.
+ correct install for Ada95, which omitted libAdaCurses.a used in
adacurses-config
+ change install for adacurses-config to provide additional flavors
such as adacursesw-config, for ncursesw (GenToo #167849).
20090105
+ remove undeveloped feature in ncurses-config.in for setting
prefix variable.
+ recent change to ncurses-config.in did not take into account the
--disable-overwrite option, which sets $includedir to the
subdirectory and using just that for a -I option does not work - fix
(report by Frederic L W Meunier).
20090104
+ modify gen-pkgconfig.in to eliminate a dependency on rpath when
deciding whether to add $LIBS to --libs output; that should be shown
for the ncurses and tinfo libraries without taking rpath into
account.
+ fix an overlooked change from $AR_OPTS to $ARFLAGS in mk-1st.awk,
used in static libraries (report by Marty Jack).
20090103
+ add a configure-time check to pick a suitable value for
CC_SHARED_OPTS for Solaris (report by Dagobert Michelsen).
+ add configure --with-pkg-config and --enable-pc-files options, along
with misc/gen-pkgconfig.in which can be used to generate ".pc" files
for pkg-config (request by Jan Engelhardt).
+ use $includedir symbol in misc/ncurses-config.in, add --includedir
option.
+ change makefiles to use $ARFLAGS rather than $AR_OPTS, provide a
configure check to detect whether a "-" is needed before "ar"
options.
+ update config.guess, config.sub from
http://savannah.gnu.org/projects/config
20081227
+ modify mk-1st.awk to work with extra categories for tinfo library.
+ modify configure script to allow building shared libraries with gcc
on AIX 5 or 6 (adapted from patch by Lital Natan).
20081220
+ modify to omit the opaque-functions from lib_gen.o when
--disable-ext-funcs is used.
+ add test/clip_printw.c to illustrate how to use printw without
wrapping.
+ modify ncurses 'F' test to demo wborder_set() with colored lines.
+ modify ncurses 'f' test to demo wborder() with colored lines.
20081213
+ add check for failure to open hashed-database needed for db4.6
(GenToo #245370).
+ corrected --without-manpages option; previous change only suppressed
the auxiliary rules install.man and uninstall.man
+ add case for FreeMINT to configure macro CF_XOPEN_SOURCE (patch from
GenToo #250454).
+ fixes from NetBSD port at
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ncurses/patches
patch-ac (build-fix for DragonFly)
patch-ae (use INSTALL_SCRIPT for installing misc/ncurses*-config).
+ improve configure script macros CF_HEADER_PATH and CF_LIBRARY_PATH
by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS values to the
search-lists.
+ correct title string for keybound manpage (patch by Frederic Culot,
OpenBSD documentation/6019),
20081206
+ move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to
work for progs/clear, progs/tabs, etc.
+ correct buffer-size after internal resizing of wide-character
set_field_buffer(), broken in 20081018 changes (report by Mike Gran).
+ add "-i" option to test/filter.c to tell it to use initscr() rather
than newterm(), to investigate report on comp.unix.programmer that
ncurses would clear the screen in that case (it does not - the issue
was xterm's alternate screen feature).
+ add check in mouse-driver to disable connection if GPM returns a
zero, indicating that the connection is closed (Debian #506717,
adapted from patch by Samuel Thibault).
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).
+ document in TO-DO an issue with Cygwin's package for GNAT (report
by Mike Dennison).
+ improve error-checking of command-line options in "tabs" program.
20081115
+ change several terminfo entries to make consistent use of ANSI
clear-all-tabs -TD
+ add "tabs" program (prompted by Debian #502260).
+ add configure --without-manpages option (request by Mike Frysinger).
20081102 5.7 release for upload to ftp.gnu.org
20081025
+ add a manpage to discuss memory leaks.
+ add support for shared libraries for QNX (other than libtool, which
does not work well on that platform).
+ build-fix for QNX C++ binding.
20081018
+ build-fixes for OS/2 EMX.
+ modify form library to accept control characters such as newline
in set_field_buffer(), which is compatible with Solaris (report by
Nit Khair).
+ modify configure script to assume --without-hashed-db when
--disable-database is used.
+ add "-e" option in ncurses/Makefile.in when generating source-files
to force earlier exit if the build environment fails unexpectedly
(prompted by patch by Adrian Bunk).
+ change configure script to use CF_UTF8_LIB, improved variant of
CF_LIBUTF8.
20081012
+ add teraterm4.59 terminfo entry, use that as primary teraterm entry, rename
original to teraterm2.3 -TD
+ update "gnome" terminfo to 2.22.3 -TD
+ update "konsole" terminfo to 1.6.6, needs today's fix for tic -TD
+ add "aterm" terminfo -TD
+ add "linux2.6.26" terminfo -TD
+ add logic to tic for cancelling strings in user-defined capabilities,
overlooked til now.
20081011
+ regenerated html documentation.
+ add -m and -s options to test/keynames.c and test/key_names.c to test
the meta() function with keyname() or key_name(), respectively.
+ correct return value of key_name() on error; it is null.
+ document some unresolved issues for rpath and pthreads in TO-DO.
+ fix a missing prototype for ioctl() on OpenBSD in tset.c
+ add configure option --disable-tic-depends to make explicit whether
tic library depends on ncurses/ncursesw library, amends change from
20080823 (prompted by Debian #501421).
20081004
+ some build-fixes for configure --disable-ext-funcs (incomplete, but
works for C/C++ parts).
+ improve configure-check for awks unable to handle large strings, e.g.
AIX 5.1 whose awk silently gives up on large printf's.
20080927
+ fix build for --with-dmalloc by workaround for redefinition of
strndup between string.h and dmalloc.h
+ fix build for --disable-sigwinch
+ add environment variable NCURSES_GPM_TERMS to allow override to use
GPM on terminals other than "linux", etc.
+ disable GPM mouse support when $TERM does not happen to contain
"linux", since Gpm_Open() no longer limits its assertion to terminals
that it might handle, e.g., within "screen" in xterm.
+ reset mouse file-descriptor when unloading GPM library (report by
Miroslav Lichvar).
+ fix build for --disable-leaks --enable-widec --with-termlib
> patch by Juergen Pfeifer:
+ use improved initialization for soft-label keys in Ada95 sample code.
+ discard internal symbol _nc_slk_format (unused since 20080112).
+ move call of slk_paint_info() from _nc_slk_initialize() to
slk_intern_refresh(), improving initialization.
20080925
+ fix bug in mouse code for GPM from 20080920 changes (reported in
Debian #500103, also Miroslav Lichvar).
20080920
+ fix shared-library rules for cygwin with tic- and tinfo-libraries.
+ fix a memory leak when failure to connect to GPM.
+ correct check for notimeout() in wgetch() (report on linux.redhat
newsgroup by FurtiveBertie).
+ add an example warning-suppression file for valgrind,
misc/ncurses.supp (based on example from Reuben Thomas)
20080913
+ change shared-library configuration for OpenBSD, make rpath work.
+ build-fixes for using libutf8, e.g., on OpenBSD 3.7
20080907
+ corrected fix for --enable-weak-symbols (report by Frederic L W
Meunier).
20080906
+ corrected gcc options for building shared libraries on IRIX64.
+ add configure check for awk programs unable to handle big-strings,
use that to improve the default for --enable-big-strings option.
+ makefile-fixes for --enable-weak-symbols (report by Frederic L W
Meunier).
+ update test/configure script.
+ adapt ifdef's from library to make test/view.c build when mbrtowc()
is unavailable, e.g., with HPUX 10.20.
+ add configure check for wcsrtombs, mbsrtowcs, which are used in
test/ncurses.c, and use wcstombs, mbstowcs instead if available,
fixing build of ncursew for HPUX 11.00
20080830
+ fixes to make Ada95 demo_panels() example work.
+ modify Ada95 'rain' test program to accept keyboard commands like the
C-version.
+ modify BeOS-specific ifdef's to build on Haiku (patch by Scott
Mccreary).
+ add configure-check to see if the std namespace is legal for cerr
and endl, to fix a build issue with Tru64.
+ consistently use NCURSES_BOOL in lib_gen.c
+ filter #line's from lib_gen.c
+ change delimiter in MKlib_gen.sh from '%' to '@', to avoid
substitution by IBM xlc to '#' as part of its extensions to digraphs.
+ update config.guess, config.sub from
http://savannah.gnu.org/projects/config
(caveat - its maintainer removed support for older Linux systems).
20080823
+ modify configure check for pthread library to work with OSF/1 5.1,
which uses #define's to associate its header and library.
+ use pthread_mutexattr_init() for initializing pthread_mutexattr_t,
makes threaded code work on HPUX 11.23
+ fix a bug in demo_menus in freeing menus (cf: 20080804).
+ modify configure script for the case where tic library is used (and
possibly renamed) to remove its dependency upon ncurses/ncursew
library (patch by Dr Werner Fink).
+ correct manpage for menu_fore() which gave wrong default for
the attribute used to display a selected entry (report by Mike Gran).
+ add Eterm-256color, Eterm-88color and rxvt-88color (prompted by
Debian #495815) -TD
20080816
+ add configure option --enable-weak-symbols to turn on new feature.
+ add configure-check for availability of weak symbols.
+ modify linkage with pthread library to use weak symbols so that
applications not linked to that library will not use the mutexes,
etc. This relies on gcc, and may be platform-specific (patch by Dr
Werner Fink).
+ add note to INSTALL to document limitation of renaming of tic library
using the --with-ticlib configure option (report by Dr Werner Fink).
+ document (in manpage) why tputs does not detect I/O errors (prompted
by comments by Samuel Thibault).
+ fix remaining warnings from Klocwork report.
20080804
+ modify _nc_panelhook() data to account for a permanent memory leak.
+ fix memory leaks in test/demo_menus
+ fix most warnings from Klocwork tool (report by Larry Zhou).
+ modify configure script CF_XOPEN_SOURCE macro to add case for
"dragonfly" from xterm #236 changes.
+ modify configure script --with-hashed-db to let $LIBS override the
search for the db library (prompted by report by Samson Pierre).
20080726
+ build-fixes for gcc 4.3.1 (changes to gnat "warnings", and C inlining
thresholds).
20080713
+ build-fix (reports by Christian Ebert, Funda Wang).
20080712
+ compiler-warning fixes for Solaris.
20080705
+ use NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc., to
make those work properly with the "--enable-ext-mouse" configuration
(cf: 20050205).
+ improve documentation of build-cc options in INSTALL.
+ work-around a bug in gcc 4.2.4 on AIX, which does not pass the
-static/-dynamic flags properly to linker, causing test/bs to
not link.
20080628
+ correct some ifdef's needed for the broken-linker configuration.
+ make debugging library's $BAUDRATE feature work for termcap
interface.
+ make $NCURSES_NO_PADDING feature work for termcap interface (prompted
by comment on FreeBSD mailing list).
+ add screen.mlterm terminfo entry -TD
+ improve mlterm and mlterm+pcfkeys terminfo entries -TD
20080621
+ regenerated html documentation.
+ expand manpage description of parameters for form_driver() and
menu_driver() (prompted by discussion with Adam Spragg).
+ add null-pointer checks for cur_term in baudrate() and
def_shell_mode(), def_prog_mode()
+ fix some memory leaks in delscreen() and wide acs.
20080614
+ modify test/ditto.c to illustrate multi-threaded use_screen().
+ change CC_SHARED_OPTS from -KPIC to -xcode=pic32 for Solaris.
+ add "-shared" option to MK_SHARED_LIB for gcc on Solaris (report
by Poor Yorick).
20080607
+ finish changes to wgetch(), making it switch as needed to the
window's actual screen when calling wrefresh() and wgetnstr(). That
allows wgetch() to get used concurrently in different threads with
some minor restrictions, e.g., the application should not delete a
window which is being used in a wgetch().
+ simplify mutex's, combining the window- and screen-mutex's.
20080531
+ modify wgetch() to use the screen which corresponds to its window
parameter rather than relying on SP; some dependent functions still
use SP internally.
+ factor out most use of SP in lib_mouse.c, using parameter.
+ add internal _nc_keyname(), replacing keyname() to associate with a
particular SCREEN rather than the global SP.
+ add internal _nc_unctrl(), replacing unctrl() to associate with a
particular SCREEN rather than the global SP.
+ add internal _nc_tracemouse(), replacing _tracemouse() to eliminate
its associated global buffer _nc_globals.tracemse_buf now in SCREEN.
+ add internal _nc_tracechar(), replacing _tracechar() to use SCREEN in
preference to the global _nc_globals.tracechr_buf buffer.
20080524
+ modify _nc_keypad() to make it switch temporarily as needed to the
screen which must be updated.
+ wrap cur_term variable to help make _nc_keymap() thread-safe, and
always set the screen's copy of this variable in set_curterm().
+ restore curs_set() state after endwin()/refresh() (report/patch
Miroslav Lichvar)
20080517
+ modify configure script to note that --enable-ext-colors and
--enable-ext-mouse are not experimental, but extensions from
the ncurses ABI 5.
+ corrected manpage description of setcchar() (discussion with
Emanuele Giaquinta).
+ fix for adding a non-spacing character at the beginning of a line
(report/patch by Miroslav Lichvar).
20080503
+ modify screen.* terminfo entries using new screen+fkeys to fix
overridden keys in screen.rxvt (Debian #478094) -TD
+ modify internal interfaces to reduce wgetch()'s dependency on the
global SP.
+ simplify some loops with macros each_screen(), each_window() and
each_ripoff().
20080426
+ continue modifying test/ditto.c toward making it demonstrate
multithreaded use_screen(), using fifos to pass data between screens.
+ fix typo in form.3x (report by Mike Gran).
20080419
+ add screen.rxvt terminfo entry -TD
+ modify tic -f option to format spaces as \s to prevent them from
being lost when that is read back in unformatted strings.
+ improve test/ditto.c, using a "talk"-style layout.
20080412
+ change test/ditto.c to use openpty() and xterm.
+ add locks for copywin(), dupwin(), overlap(), overlay() on their
window parameters.
+ add locks for initscr() and newterm() on updates to the SCREEN
pointer.
+ finish table in curs_thread.3x manpage.
20080405
+ begin table in curs_thread.3x manpage describing the scope of data
used by each function (or symbol) for threading analysis.
+ add null-pointer checks to setsyx() and getsyx() (prompted by
discussion by Martin v. Lowis and Jeroen Ruigrok van der Werven on
python-dev2 mailing list).
20080329
+ add null-pointer checks in set_term() and delscreen().
+ move _nc_windows into _nc_globals, since windows can be pads, which
are not associated with a particular screen.
+ change use_screen() to pass the SCREEN* parameter rather than
stdscr to the callback function.
+ force libtool to use tag for 'CC' in case it does not detect this,
e.g., on aix when using CC=powerpc-ibm-aix5.3.0.0-gcc
(report/patch by Michael Haubenwallner).
+ override OBJEXT to "lo" when building with libtool, to work on
platforms such as AIX where libtool may use a different suffix for
the object files than ".o" (report/patch by Michael Haubenwallner).
+ add configure --with-pthread option, for building with the POSIX
thread library.
20080322
+ fill in extended-color pair two more places in wbkgrndset() and
waddch_nosync() (prompted by Sedeno's patch).
+ fill in extended-color pair in _nc_build_wch() to make colors work
for wide-characters using extended-colors (patch by Alejandro R
Sedeno).
+ add x/X toggles to ncurses.c C color test to test/demo
wide-characters with extended-colors.
+ add a/A toggles to ncurses.c c/C color tests.
+ modify test/ditto.c to use use_screen().
+ finish modifying test/rain.c to demonstrate threads.
20080308
+ start modifying test/rain.c for threading demo.
+ modify test/ncurses.c to make 'f' test accept the f/F/b/F/> toggles
that the 'F' accepts.
+ modify test/worm.c to show trail in reverse-video when other threads
are working concurrently.
+ fix a deadlock from improper nesting of mutexes for windowlist and
window.
20080301
+ fixes from 20080223 resolved issue with mutexes; change to use
recursive mutexes to fix memory leak in delwin() as called from
_nc_free_and_exit().
20080223
+ fix a size-difference in _nc_globals which caused hanging of mutex
lock/unlock when termlib was built separately.
20080216
+ avoid using nanosleep() in threaded configuration since that often
is implemented to suspend the entire process.
20080209
+ update test programs to build/work with various UNIX curses for
comparisons. This was to reinvestigate statement in X/Open curses
that insnstr and winsnstr perform wrapping. None of the Unix-branded
implementations do this, as noted in manpage (cf: 20040228).
20080203
+ modify _nc_setupscreen() to set the legacy-coding value the same
for both narrow/wide models. It had been set only for wide model,
but is needed to make unctrl() work with locale in the narrow model.
+ improve waddch() and winsch() handling of EILSEQ from mbrtowc() by
using unctrl() to display illegal bytes rather than trying to append
further bytes to make up a valid sequence (reported by Andrey A
Chernov).
+ modify unctrl() to check codes in 128-255 range versus isprint().
If they are not printable, and locale was set, use a "M-" or "~"
sequence.
20080126
+ improve threading in test/worm.c (wrap refresh calls, and KEY_RESIZE
handling). Now it hangs in napms(), no matter whether nanosleep()
or poll() or select() are used on Linux.
20080119
+ fixes to build with --disable-ext-funcs
+ add manpage for use_window and use_screen.
+ add set_tabsize() and set_escdelay() functions.
20080112
+ remove recursive-mutex definitions, finish threading demo for worm.c
+ remove a redundant adjustment of lines in resizeterm.c's
adjust_window() which caused occasional misadjustment of stdscr when
softkeys were used.
20080105
+ several improvements to terminfo entries based on xterm #230 -TD
+ modify MKlib_gen.sh to handle keyname/key_name prototypes, so the
"link_test" builds properly.
+ fix for toe command-line options -u/-U to ensure filename is given.
+ fix allocation-size for command-line parsing in infocmp from 20070728
(report by Miroslav Lichvar)
+ improve resizeterm() by moving ripped-off lines, and repainting the
soft-keys (report by Katarina Machalkova)
+ add clarification in wclear's manpage noting that the screen will be
cleared even if a subwindow is cleared (prompted by Christer Enfors
question).
+ change test/ncurses.c soft-key tests to work with KEY_RESIZE.
20071222
+ continue implementing support for threading demo by adding mutex
for delwin().
20071215
+ add several functions to C++ binding which wrap C functions that
pass a WINDOW* parameter (request by Chris Lee).
20071201
+ add note about configure options needed for Berkeley database to the
INSTALL file.
+ improve checks for version of Berkeley database libraries.
+ amend fix for rpath to not modify LDFLAGS if the platform has no
applicable transformation (report by Christian Ebert, cf: 20071124).
20071124
+ modify configure option --with-hashed-db to accept a parameter which
is the install-prefix of a given Berkeley Database (prompted by
pierre4d2 comments).
+ rewrite wrapper for wcrtomb(), making it work on Solaris. This is
used in the form library to determine the length of the buffer needed
by field_buffer (report by Alfred Fung).
+ remove unneeded window-parameter from C++ binding for wresize (report
by Chris Lee).
20071117
+ modify the support for filesystems which do not support mixed-case to
generate 2-character (hexadecimal) codes for the lower-level of the
filesystem terminfo database (request by Michail Vidiassov).
+ add configure option --enable-mixed-case, to allow overriding the
configure script's check if the filesystem supports mixed-case
filenames.
+ add wresize() to C++ binding (request by Chris Lee).
+ define NCURSES_EXT_FUNCS and NCURSES_EXT_COLORS in curses.h to make
it simpler to tell if the extended functions and/or colors are
declared.
20071103
+ update memory-leak checks for changes to names.c and codes.c
+ correct acsc strings in h19, z100 (patch by Benjamin C W Sittler).
20071020
+ continue implementing support for threading demo by adding mutex
for use_window().
+ add mrxvt terminfo entry, add/fix xterm building blocks for modified
cursor keys -TD
+ compile with FreeBSD "contemporary" TTY interface (patch by
Rong-En Fan).
20071013
+ modify makefile rules to allow clear, tput and tset to be built
without libtic. The other programs (infocmp, tic and toe) rely on
that library.
+ add/modify null-pointer checks in several functions for SP and/or
the WINDOW* parameter (report by Thorben Krueger).
+ fixes for field_buffer() in formw library (see Redhat #310071,
patches by Miroslav Lichvar).
+ improve performance of NCURSES_CHAR_EQ code (patch by Miroslav
Lichvar).
+ update/improve mlterm and rxvt terminfo entries, e.g., for
the modified cursor- and keypad-keys -TD
20071006
+ add code to curses.priv.h ifdef'd with NCURSES_CHAR_EQ, which
changes the CharEq() macro to an inline function to allow comparing
cchar_t struct's without comparing gaps in a possibly unpacked
memory layout (report by Miroslav Lichvar).
20070929
+ add new functions to lib_trace.c to setup mutex's for the _tracef()
calls within the ncurses library.
+ for the reentrant model, move _nc_tputs_trace and _nc_outchars into
the SCREEN.
+ start modifying test/worm.c to provide threading demo (incomplete).
+ separated ifdef's for some BSD-related symbols in tset.c, to make
it compile on LynxOS (report by Greg Gemmer).
20070915
+ modify Ada95/gen/Makefile to use shlib script, to simplify building
shared-library configuration on platforms lacking rpath support.
+ build-fix for Ada95/src/Makefile to reflect changed dependency for
the terminal-interface-curses-aux.adb file which is now generated.
+ restructuring test/worm.c, for use_window() example.
20070908
+ add use_window() and use_screen() functions, to develop into support
for threaded library (incomplete).
+ fix typos in man/curs_opaque.3x which kept the install script from
creating symbolic links to two aliases created in 20070818 (report by
Rong-En Fan).
20070901
+ remove a spurious newline from output of html.m4, which caused links
for Ada95 html to be incorrect for the files generated using m4.
+ start investigating mutex's for SCREEN manipulation (incomplete).
+ minor cleanup of codes.c/names.c for --enable-const
+ expand/revise "Routine and Argument Names" section of ncurses manpage
to address report by David Givens in newsgroup discussion.
+ fix interaction between --without-progs/--with-termcap configure
options (report by Michail Vidiassov).
+ fix typo in "--disable-relink" option (report by Michail Vidiassov).
20070825
+ fix a sign-extension bug in infocmp's repair_acsc() function
(cf: 971004).
+ fix old configure script bug which prevented "--disable-warnings"
option from working (patch by Mike Frysinger).
20070818
+ add 9term terminal description (request by Juhapekka Tolvanen) -TD
+ modify comp_hash.c's string output to avoid misinterpreting a null
"\0" followed by a digit.
+ modify MKnames.awk and MKcodes.awk to support big-strings.
This only applies to the cases (broken linker, reentrant) where
the corresponding arrays are accessed via wrapper functions.
+ split MKnames.awk into two scripts, eliminating the shell redirection
which complicated the make process and also the bogus timestamp file
which was introduced to fix "make -j".
+ add test/test_opaque.c, test/test_arrays.c
+ add wgetscrreg() and wgetparent() for applications that may need it
when NCURSES_OPAQUE is defined (prompted by Bryan Christ).
20070812
+ amend treatment of infocmp "-r" option to retain the 1023-byte limit
unless "-T" is given (cf: 981017).
+ modify comp_captab.c generation to use big-strings.
+ make _nc_capalias_table and _nc_infoalias_table private accessed via
_nc_get_alias_table() since the tables are used only within the tic
library.
+ modify configure script to skip Intel compiler in CF_C_INLINE.
+ make _nc_info_hash_table and _nc_cap_hash_table private accessed via
_nc_get_hash_table() since the tables are used only within the tic
library.
20070728
+ make _nc_capalias_table and _nc_infoalias_table private, accessed via
_nc_get_alias_table() since they are used only by parse_entry.c
+ make _nc_key_names private since it is used only by lib_keyname.c
+ add --disable-big-strings configure option to control whether
unctrl.c is generated using the big-string optimization - which may
use strings longer than supported by a given compiler.
+ reduce relocation tables for tic, infocmp by changing type of
internal hash tables to short, and make those private symbols.
+ eliminate large fixed arrays from progs/infocmp.c
20070721
+ change winnstr() to stop at the end of the line (cf: 970315).
+ add test/test_get_wstr.c
+ add test/test_getstr.c
+ add test/test_inwstr.c
+ add test/test_instr.c
20070716
+ restore a call to obtain screen-size in _nc_setupterm(), which
is used in tput and other non-screen applications via setupterm()
(Debian #433357, reported by Florent Bayle, Christian Ohm,
cf: 20070310).
20070714
+ add test/savescreen.c test-program
+ add check to trace-file open, if the given name is a directory, add
".log" to the name and try again.
+ add konsole-256color entry -TD
+ add extra gcc warning options from xterm.
+ minor fixes for ncurses/hashmap test-program.
+ modify configure script to quiet c++ build with libtool when the
--disable-echo option is used.
+ modify configure script to disable ada95 if libtool is selected,
writing a warning message (addresses FreeBSD #114493).
+ update config.guess, config.sub
20070707
+ add continuous-move "M" to demo_panels to help test refresh changes.
+ improve fix for refresh of window on top of multi-column characters,
taking into account some split characters on left/right window
boundaries.
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().
20070612
+ corrected xterm+pcf2 terminfo modifiers for F1-F4, to match xterm
#226 -TD
+ split-out key_name() from MKkeyname.awk since it now depends upon
wunctrl() which is not in libtinfo (report by Rong-En Fan).
20070609
+ add test/key_name.c
+ add stdscr cases to test/inchs.c and test/inch_wide.c
+ update test/configure
+ correct formatting of DEL (0x7f) in _nc_vischar().
+ null-terminate result of wunctrl().
+ add null-pointer check in key_name() (report by Andreas Krennmair,
cf: 20020901).
20070602
+ adapt mouse-handling code from menu library in form-library
(discussion with Clive Nicolson).
+ add a modification of test/dots.c, i.e., test/dots_mvcur.c to
illustrate how to use mvcur().
+ modify wide-character flavor of SetAttr() to preserve the
WidecExt() value stored in the .attr field, e.g., in case it
is overwritten by chgat (report by Aleksi Torhamo).
+ correct buffer-size for _nc_viswbuf2n() (report by Aleksi Torhamo).
+ build-fixes for Solaris 2.6 and 2.7 (patch by Peter O'Gorman).
20070526
+ modify keyname() to use "^X" form only if meta() has been called, or
if keyname() is called without initializing curses, e.g., via
initscr() or newterm() (prompted by LinuxBase #1604).
+ document some portability issues in man/curs_util.3x
+ add a shadow copy of TTY buffer to _nc_prescreen to fix applications
broken by moving that data into SCREEN (cf: 20061230).
20070512
+ add 'O' (wide-character panel test) in ncurses.c to demonstrate a
problem reported by Sadrul H Chowdhury with repainting parts of
a fullwidth cell.
+ modify slk_init() so that if there are preceding calls to
ripoffline(), those affect the available lines for soft-keys (adapted
from patch by Clive Nicolson).
+ document some portability issues in man/curs_getyx.3x
20070505
+ fix a bug in Ada95/samples/ncurses which caused a variable to
become uninitialized in the "b" test.
+ fix Ada95/gen/Makefile.in adahtml rule to account for recent
movement of files, fix a few incorrect manpage references in the
generated html.
+ add Ada95 binding to _nc_freeall() as Curses_Free_All to help with
memory-checking.
+ correct some functions in Ada95 binding which were using return value
from C where none was returned: idcok(), immedok() and wtimeout().
+ amend recent changes for Ada95 binding to make it build with
Cygwin's linker, e.g., with configure options
--enable-broken-linker --with-ticlib
20070428
+ add a configure check for gcc's options for inlining, use that to
quiet a warning message where gcc's default behavior changed from
3.x to 4.x.
+ improve warning message when checking if GPM is linked to curses
library by not warning if its use of "wgetch" is via a weak symbol.
+ add loader options when building with static libraries to ensure that
an installed shared library for ncurses does not conflict. This is
reported as problem with Tru64, but could affect other platforms
(report Martin Mokrejs, analysis by Tim Mooney).
+ fix build on cygwin after recent ticlib/termlib changes, i.e.,
+ adjust TINFO_SUFFIX value to work with cygwin's dll naming
+ revert a change from 20070303 which commented out dependency of
SHLIB_LIST in form/menu/panel/c++ libraries.
+ fix initialization of ripoff stack pointer (cf: 20070421).
20070421
+ move most static variables into structures _nc_globals and
_nc_prescreen, to simplify storage.
+ add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding
type for data manipulated by signal handlers (prompted by comments
in mailing.openbsd.bugs newsgroup).
+ modify CF_WITH_LIBTOOL to allow one to pass options such as -static
to the libtool create- and link-operations.
20070414
+ fix whitespace in curs_opaque.3x which caused a spurious ';' in
the installed aliases (report by Peter Santoro).
+ fix configure script to not try to generate adacurses-config when
Ada95 tree is not built.
20070407
+ add man/curs_legacy.3x, man/curs_opaque.3x
+ fix acs_map binding for Ada95 when --enable-reentrant is used.
+ add adacurses-config to the Ada95 install, based on version from
FreeBSD port, in turn by Juergen Pfeifer in 2000 (prompted by
comment on comp.lang.ada newsgroup).
+ fix includes in c++ binding to build with Intel compiler
(cf: 20061209).
+ update install rule in Ada95 to use mkdirs.sh
> other fixes prompted by inspection for Coverity report:
+ modify ifdef's for c++ binding to use try/catch/throw statements
+ add a null-pointer check in tack/ansi.c request_cfss()
+ fix a memory leak in ncurses/base/wresize.c
+ corrected check for valid memu/meml capabilities in
progs/dump_entry.c when handling V_HPUX case.
> fixes based on Coverity report:
+ remove dead code in test/bs.c
+ remove dead code in test/demo_defkey.c
+ remove an unused assignment in progs/infocmp.c
+ fix a limit check in tack/ansi.c tools_charset()
+ fix tack/ansi.c tools_status() to perform the VT320/VT420
tests in request_cfss(). The function had exited too soon.
+ fix a memory leak in tic.c's make_namelist()
+ fix a couple of places in tack/output.c which did not check for EOF.
+ fix a loop-condition in test/bs.c
+ add index checks in lib_color.c for color palettes
+ add index checks in progs/dump_entry.c for version_filter() handling
of V_BSD case.
+ fix a possible null-pointer dereference in copywin()
+ fix a possible null-pointer dereference in waddchnstr()
+ add a null-pointer check in _nc_expand_try()
+ add a null-pointer check in tic.c's make_namelist()
+ add a null-pointer check in _nc_expand_try()
+ add null-pointer checks in test/cardfile.c
+ fix a double-free in ncurses/tinfo/trim_sgr0.c
+ fix a double-free in ncurses/base/wresize.c
+ add try/catch block to c++/cursesmain.cc
20070331
+ modify Ada95 binding to build with --enable-reentrant by wrapping
global variables (bug: acs_map does not yet work).
+ modify Ada95 binding to use the new access-functions, allowing it
to build/run when NCURSES_OPAQUE is set.
+ add access-functions and macros to return properties of the WINDOW
structure, e.g., when NCURSES_OPAQUE is set.
+ improved install-sh's quoting.
+ use mkdirs.sh rather than mkinstalldirs, e.g., to use fixes from
other programs.
20070324
+ eliminate part of the direct use of WINDOW data from Ada95 interface.
+ fix substitutions for termlib filename to make configure option
--enable-reentrant work with --with-termlib.
+ change a constructor for NCursesWindow to allow compiling with
NCURSES_OPAQUE set, since we cannot pass a reference to
an opaque pointer.
20070317
+ ignore --with-chtype=unsigned since unsigned is always added to
the type in curses.h; do the same for --with-mmask-t.
+ change warning regarding --enable-ext-colors and wide-character
in the configure script to an error.
+ tweak error message in CF_WITH_LIBTOOL to distinguish other programs
such as Darwin's libtool program (report by Michail Vidiassov)
+ modify edit_man.sh to allow for multiple substitutions per line.
+ set locale in misc/ncurses-config.in since it uses a range
+ change permissions libncurses++.a install (report by Michail
Vidiassov).
+ corrected length of temporary buffer in wide-character version
of set_field_buffer() (related to report by Bryan Christ).
20070311
+ fix mk-1st.awk script install_shlib() function, broken in 20070224
changes for cygwin (report by Michail Vidiassov).
20070310
+ increase size of array in _nc_visbuf2n() to make "tic -v" work
properly in its similar_sgr() function (report/analysis by Peter
Santoro).
+ add --enable-reentrant configure option for ongoing changes to
implement a reentrant version of ncurses:
+ libraries are suffixed with "t"
+ wrap several global variables (curscr, newscr, stdscr, ttytype,
COLORS, COLOR_PAIRS, COLS, ESCDELAY, LINES and TABSIZE) as
functions returning values stored in SCREEN or cur_term.
+ move some initialization (LINES, COLS) from lib_setup.c,
i.e., setupterm() to _nc_setupscreen(), i.e., newterm().
20070303
+ regenerated html documentation.
+ add NCURSES_OPAQUE symbol to curses.h, will use to make structs
opaque in selected configurations.
+ move the chunk in lib_acs.c which resets acs capabilities when
running on a terminal whose locale interferes with those into
_nc_setupscreen(), so the libtinfo/libtinfow files can be made
identical (requested by Miroslav Lichvar).
+ do not use configure variable SHLIB_LIBS for building libraries
outside the ncurses directory, since that symbol is customized
only for that directory, and using it introduces an unneeded
dependency on libdl (requested by Miroslav Lichvar).
+ modify mk-1st.awk so the generated makefile rules for linking or
installing shared libraries do not first remove the library, in
case it is in use, e.g., libncurses.so by /bin/sh (report by Jeff
Chua).
+ revised section "Using NCURSES under XTERM" in ncurses-intro.html
(prompted by newsgroup comment by Nick Guenther).
20070224
+ change internal return codes of _nc_wgetch() to check for cases
where KEY_CODE_YES should be returned, e.g., if a KEY_RESIZE was
ungetch'd, and read by wget_wch().
+ fix static-library build broken in 20070217 changes to remove "-ldl"
(report by Miroslav Lichvar).
+ change makefile/scripts for cygwin to allow building termlib.
+ use Form_Hook in manpages to match form.h
+ use Menu_Hook in manpages, as well as a few places in menu.h
+ correct form- and menu-manpages to use specific Field_Options,
Menu_Options and Item_Options types.
+ correct prototype for _tracechar() in manpage (cf: 20011229).
+ correct prototype for wunctrl() in manpage.
20070217
+ fixes for $(TICS_LIST) in ncurses/Makefile (report by Miroslav
Lichvar).
+ modify relinking of shared libraries to apply only when rpath is
enabled, and add --disable-relink option which can be used to
disable the feature altogether (reports by Michail Vidiassov,
Adam J Richter).
+ fix --with-termlib option for wide-character configuration, stripping
the "w" suffix in one place (report by Miroslav Lichvar).
+ remove "-ldl" from some library lists to reduce dependencies in
programs (report by Miroslav Lichvar).
+ correct description of --enable-signed-char in configure --help
(report by Michail Vidiassov).
+ add pattern for GNU/kFreeBSD configuration to CF_XOPEN_SOURCE,
which matches an earlier change to CF_SHARED_OPTS, from xterm #224
fixes.
+ remove "${DESTDIR}" from -install_name option used for linking
shared libraries on Darwin (report by Michail Vidiassov).
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.
Otherwise, when copying the field cells back to the window, the
associated color overrides the field's background color (report by
Ricardo Cantu).
+ improve tracing for form library, showing created forms, fields, etc.
+ ignore --enable-rpath configure option if --with-shared was omitted.
+ add _nc_leaks_tinfo(), _nc_free_tic(), _nc_free_tinfo() entrypoints
to allow leak-checking when both tic- and tinfo-libraries are built.
+ drop CF_CPP_VSCAN_FUNC macro from configure script, since C++ binding
no longer relies on it.
+ disallow combining configure script options --with-ticlib and
--enable-termcap (report by Rong-En Fan).
+ remove tack from ncurses tree.
20070128
+ fix typo in configure script that broke --with-termlib option
(report by Rong-En Fan).
20070127
+ improve fix for FreeBSD gnu/98975, to allow for null pointer passed
to tgetent() (report by Rong-en Fan).
+ update tack/HISTORY and tack/README to tell how to build it after
it is removed from the ncurses tree.
+ fix configure check for libtool's version to trim blank lines
(report by sci-fi@hush.ai).
+ review/eliminate other original-file artifacts in cursesw.cc, making
its license consistent with ncurses.
+ use ncurses vw_scanw() rather than reading into a fixed buffer in
the c++ binding for scanw() methods (prompted by report by Nuno Dias).
+ eliminate fixed-buffer vsprintf() calls in c++ binding.
20070120
+ add _nc_leaks_tic() to separate leak-checking of tic library from
term/ncurses libraries, and thereby eliminate a library dependency.
+ fix test/mk-test.awk to ignore blank lines.
+ correct paths in include/headers, for --srcdir (patch by Miroslav
Lichvar).
20070113
+ add a break-statement in misc/shlib to ensure that it exits on the
_first_ matched directory (report by Paul Novak).
+ add tack/configure, which can be used to build tack outside the
ncurses build-tree.
+ add --with-ticlib option, to build/install the tic-support functions
in a separate library (suggested by Miroslav Lichvar).
20070106
+ change MKunctrl.awk to reduce relocation table for unctrl.o
+ change MKkeyname.awk to reduce relocation table for keyname.o
(patch by Miroslav Lichvar).
20061230
+ modify configure check for libtool's version to trim blank lines
(report by sci-fi@hush.ai).
+ modify some modules to allow them to be reentrant if _REENTRANT is
defined: lib_baudrate.c, resizeterm.c (local data only)
+ eliminate static data from some modules: add_tries.c, hardscroll.c,
lib_ttyflags.c, lib_twait.c
+ improve manpage install to add aliases for the transformed program
names, e.g., from --program-prefix.
+ used linklint to verify links in the HTML documentation, made fixes
to manpages as needed.
+ fix a typo in curs_mouse.3x (report by William McBrine).
+ fix install-rule for ncurses5-config to make the bin-directory.
20061223
+ modify configure script to omit the tic (terminfo compiler) support
from ncurses library if --without-progs option is given.
+ modify install rule for ncurses5-config to do this via "install.libs"
+ modify shared-library rules to allow FreeBSD 3.x to use rpath.
+ update config.guess, config.sub
20061217 5.6 release for upload to ftp.gnu.org
20061217
+ add ifdef's for for HPUX, which has the corresponding
definitions in .
+ revert the va_copy() change from 20061202, since it was neither
correct nor portable.
+ add $(LOCAL_LIBS) definition to progs/Makefile.in, needed for
rpath on Solaris.
+ ignore wide-acs line-drawing characters that wcwidth() claims are
not one-column. This is a workaround for Solaris' broken locale
support.
20061216
+ modify configure --with-gpm option to allow it to accept a parameter,
i.e., the name of the dynamic GPM library to load via dlopen()
(requested by Bryan Henderson).
+ add configure option --with-valgrind, changes from vile.
+ modify configure script AC_TRY_RUN and AC_TRY_LINK checks to use
'return' in preference to 'exit()'.
20061209
+ change default for --with-develop back to "no".
+ add XTABS to tracing of TTY bits.
+ updated autoconf patch to ifdef-out the misfeature which declares
exit() for configure tests. This fixes a redefinition warning on
Solaris.
+ use ${CC} rather than ${LD} in shared library rules for IRIX64,
Solaris to help ensure that initialization sections are provided for
extra linkage requirements, e.g., of C++ applications (prompted by
comment by Casper Dik in newsgroup).
+ rename "$target" in CF_MAN_PAGES to make it easier to distinguish
from the autoconf predefined symbol. There was no conflict,
since "$target" was used only in the generated edit_man.sh file,
but SuSE's rpm package contains a patch.
20061202
+ update man/term.5 to reflect extended terminfo support and hashed
database configuration.
+ updates for test/configure script.
+ adapted from SuSE rpm package:
+ remove long-obsolete workaround for broken-linker which declared
cur_term in tic.c
+ improve error recovery in PUTC() macro when wcrtomb() does not
return usable results for an 8-bit character.
+ patches from rpm package (SuSE):
+ use va_copy() in extra varargs manipulation for tracing version
of printw, etc.
+ use a va_list rather than a null in _nc_freeall()'s call to
_nc_printf_string().
+ add some see-also references in manpages to show related
wide-character functions (suggested by Claus Fischer).
20061125
+ add a check in lib_color.c to ensure caller does not increase COLORS
above max_colors, which is used as an array index (discussion with
Simon Sasburg).
+ add ifdef's allowing ncurses to be built with tparm() using either
varargs (the existing status), or using a fixed-parameter list (to
match X/Open).
20061104
+ fix redrawing of windows other than stdscr using wredrawln() by
touching the corresponding rows in curscr (discussion with Dan
Gookin).
+ add test/redraw.c
+ add test/echochar.c
+ review/cleanup manpage descriptions of error-returns for form- and
menu-libraries (prompted by FreeBSD docs/46196).
20061028
+ add AUTHORS file -TD
+ omit the -D options from output of the new config script --cflags
option (suggested by Ralf S Engelschall).
+ make NCURSES_INLINE unconditionally defined in curses.h
20061021
+ revert change to accommodate bash 3.2, since that breaks other
platforms, e.g., Solaris.
+ minor fixes to NEWS file to simplify scripting to obtain list of
contributors.
+ improve some shared-library configure scripting for Linux, FreeBSD
and NetBSD to make "--with-shlib-version" work.
+ change configure-script rules for FreeBSD shared libraries to allow
for rpath support in versions past 3.
+ use $(DESTDIR) in makefile rules for installing/uninstalling the
package config script (reports/patches by Christian Wiese,
Ralf S Engelschall).
+ fix a warning in the configure script for NetBSD 2.0, working around
spurious blanks embedded in its ${MAKEFLAGS} symbol.
+ change test/Makefile to simplify installing test programs in a
different directory when --enable-rpath is used.
20061014
+ work around bug in bash 3.2 by adding extra quotes (Jim Gifford).
+ add/install a package config script, e.g., "ncurses5-config" or
"ncursesw5-config", according to configuration options.
20061007
+ add several GNU Screen terminfo variations with 16- and 256-colors,
and status line (Alain Bench).
+ change the way shared libraries (other than libtool) are installed.
Rather than copying the build-tree's libraries, link the shared
objects into the install directory. This makes the --with-rpath
option work except with $(DESTDIR) (cf: 20000930).
20060930
+ fix ifdef in c++/internal.h for QNX 6.1
+ test-compiled with (old) egcs-1.1.2, modified configure script to
not unset the $CXX and related variables which would prevent this.
+ fix a few terminfo.src typos exposed by improvments to "-f" option.
+ improve infocmp/tic "-f" option formatting.
20060923
+ make --disable-largefile option work (report by Thomas M Ott).
+ updated html documentation.
+ add ka2, kb1, kb3, kc2 to vt220-keypad as an extension -TD
+ minor improvements to rxvt+pcfkeys -TD
20060916
+ move static data from lib_mouse.c into SCREEN struct.
+ improve ifdef's for _POSIX_VDISABLE in tset to work with Mac OS X
(report by Michail Vidiassov).
+ modify CF_PATH_SYNTAX to ensure it uses the result from --prefix
option (from lynx changes) -TD
+ adapt AC_PROG_EGREP check, noting that this is likely to be another
place aggravated by POSIXLY_CORRECT.
+ modify configure check for awk to ensure that it is found (prompted
by report by Christopher Parker).
+ update config.sub
20060909
+ add kon, kon2 and jfbterm terminfo entry (request by Till Maas) -TD
+ remove invis capability from klone+sgr, mainly used by linux entry,
since it does not really do this -TD
20060903
+ correct logic in wadd_wch() and wecho_wch(), which did not guard
against passing the multi-column attribute into a call on waddch(),
e.g., using data returned by win_wch() (cf: 20041023)
(report by Sadrul H Chowdhury).
20060902
+ fix kterm's acsc string -TD
+ fix for change to tic/infocmp in 20060819 to ensure no blank is
embedded into a termcap description.
+ workaround for 20050806 ifdef's change to allow visbuf.c to compile
when using --with-termlib --with-trace options.
+ improve tgetstr() by making the return value point into the user's
buffer, if provided (patch by Miroslav Lichvar (see Redhat #202480)).
+ correct libraries needed for foldkeys (report by Stanislav Ievlev)
20060826
+ add terminfo entries for xfce terminal (xfce) and multi gnome
terminal (mgt) -TD
+ add test/foldkeys.c
20060819
+ modify tic and infocmp to avoid writing trailing blanks on terminfo
source output (Debian #378783).
+ modify configure script to ensure that if the C compiler is used
rather than the loader in making shared libraries, the $(CFLAGS)
variable is also used (Redhat #199369).
+ port hashed-db code to db2 and db3.
+ fix a bug in tgetent() from 20060625 and 20060715 changes
(patch/analysis by Miroslav Lichvar (see Redhat #202480)).
20060805
+ updated xterm function-keys terminfo to match xterm #216 -TD
+ add configure --with-hashed-db option (tested only with FreeBSD 6.0,
e.g., the db 1.8.5 interface).
20060729
+ modify toe to access termcap data, e.g., via cgetent() functions,
or as a text file if those are not available.
+ use _nc_basename() in tset to improve $SHELL check for csh/sh.
+ modify _nc_read_entry() and _nc_read_termcap_entry() so infocmp,
can access termcap data when the terminfo database is disabled.
20060722
+ widen the test for xterm kmous a little to allow for other strings
than \E[M, e.g., for xterm-sco functionality in xterm.
+ update xterm-related terminfo entries to match xterm patch #216 -TD
+ update config.guess, config.sub
20060715
+ fix for install-rule in Ada95 to add terminal_interface.ads
and terminal_interface.ali (anonymous posting in comp.lang.ada).
+ correction to manpage for getcchar() (report by William McBrine).
+ add test/chgat.c
+ modify wchgat() to mark updated cells as changed so a refresh will
repaint those cells (comments by Sadrul H Chowdhury and William
McBrine).
+ split up dependency of names.c and codes.c in ncurses/Makefile to
work with parallel make (report/analysis by Joseph S Myers).
+ suppress a warning message (which is ignored) for systems without
an ldconfig program (patch by Justin Hibbits).
+ modify configure script --disable-symlinks option to allow one to
disable symlink() in tic even when link() does not work (report by
Nigel Horne).
+ modify MKfallback.sh to use tic -x when constructing fallback tables
to allow extended capabilities to be retrieved from a fallback entry.
+ improve leak-checking logic in tgetent() from 20060625 to ensure that
it does not free the current screen (report by Miroslav Lichvar).
20060708
+ add a check for _POSIX_VDISABLE in tset (NetBSD #33916).
+ correct _nc_free_entries() and related functions used for memory leak
checking of tic.
20060701
+ revert a minor change for magic-cookie support from 20060513, which
caused unexpected reset of attributes, e.g., when resizing test/view
in color mode.
+ note in clear manpage that the program ignores command-line
parameters (prompted by Debian #371855).
+ fixes to make lib_gen.c build properly with changes to the configure
--disable-macros option and NCURSES_NOMACROS (cf: 20060527)
+ update/correct several terminfo entries -TD
+ add some notes regarding copyright to terminfo.src -TD
20060625
+ fixes to build Ada95 binding with gnat-4.1.0
+ modify read_termtype() so the term_names data is always allocated as
part of the str_table, a better fix for a memory leak (cf: 20030809).
+ reduce memory leaks in repeated calls to tgetent() by remembering the
last TERMINAL* value allocated to hold the corresponding data and
freeing that if the tgetent() result buffer is the same as the
previous call (report by "Matt" for FreeBSD gnu/98975).
+ modify tack to test extended capability function-key strings.
+ improved gnome terminfo entry (GenToo #122566).
+ improved xterm-256color terminfo entry (patch by Alain Bench).
20060617
+ fix two small memory leaks related to repeated tgetent() calls
with TERM=screen (report by "Matt" for FreeBSD gnu/98975).
+ add --enable-signed-char to simplify Debian package.
+ reduce name-pollution in term.h by removing #define's for HAVE_xxx
symbols.
+ correct typo in curs_terminfo.3x (Debian #369168).
20060603
+ enable the mouse in test/movewindow.c
+ improve a limit-check in frm_def.c (John Heasley).
+ minor copyright fixes.
+ change configure script to produce test/Makefile from data file.
20060527
+ add a configure option --enable-wgetch-events to enable
NCURSES_WGETCH_EVENTS, and correct the associated loop-logic in
lib_twait.c (report by Bernd Jendrissek).
+ remove include/nomacros.h from build, since the ifdef for
NCURSES_NOMACROS makes that obsolete.
+ add entrypoints for some functions which were only provided as macros
to make NCURSES_NOMACROS ifdef work properly: getcurx(), getcury(),
getbegx(), getbegy(), getmaxx(), getmaxy(), getparx() and getpary(),
wgetbkgrnd().
+ provide ifdef for NCURSES_NOMACROS which suppresses most macro
definitions from curses.h, i.e., where a macro is defined to override
a function to improve performance. Allowing a developer to suppress
these definitions can simplify some application (discussion with
Stanislav Ievlev).
+ improve description of memu/meml in terminfo manpage.
20060520
+ if msgr is false, reset video attributes when doing an automargin
wrap to the next line. This makes the ncurses 'k' test work properly
for hpterm.
+ correct caching of keyname(), which was using only half of its table.
+ minor fixes to memory-leak checking.
+ make SCREEN._acs_map and SCREEN._screen_acs_map pointers rather than
arrays, making ACS_LEN less visible to applications (suggested by
Stanislav Ievlev).
+ move chunk in SCREEN ifdef'd for USE_WIDEC_SUPPORT to the end, so
_screen_acs_map will have the same offset in both ncurses/ncursesw,
making the corresponding tinfo/tinfow libraries binary-compatible
(cf: 20041016, report by Stanislav Ievlev).
20060513
+ improve debug-tracing for EmitRange().
+ change default for --with-develop to "yes". Add NCURSES_NO_HARD_TABS
and NCURSES_NO_MAGIC_COOKIE environment variables to allow runtime
suppression of the related hard-tabs and xmc-glitch features.
+ add ncurses version number to top-level manpages, e.g., ncurses, tic,
infocmp, terminfo as well as form, menu, panel.
+ update config.guess, config.sub
+ modify ncurses.c to work around a bug in NetBSD 3.0 curses
(field_buffer returning null for a valid field). The 'r' test
appears to not work with that configuration since the new_fieldtype()
function is broken in that implementation.
20060506
+ add hpterm-color terminfo entry -TD
+ fixes to compile test-programs with HPUX 11.23
20060422
+ add copyright notices to files other than those that are generated,
data or adapted from pdcurses (reports by William McBrine, David
Taylor).
+ improve rendering on hpterm by not resetting attributes at the end
of doupdate() if the terminal has the magic-cookie feature (report
by Bernd Rieke).
+ add 256color variants of terminfo entries for programs which are
reported to implement this feature -TD
20060416
+ fix typo in change to NewChar() macro from 20060311 changes, which
broke tab-expansion (report by Frederic L W Meunier).
20060415
+ document -U option of tic and infocmp.
+ modify tic/infocmp to suppress smacs/rmacs when acsc is suppressed
due to size limit, e.g., converting to termcap format. Also
suppress them if the output format does not contain acsc and it
was not VT100-like, i.e., a one-one mapping (Novell #163715).
+ add configure check to ensure that SIGWINCH is defined on platforms
such as OS X which exclude that when _XOPEN_SOURCE, etc., are
defined (report by Nicholas Cole)
20060408
+ modify write_object() to not write coincidental extensions of an
entry made due to it being referenced in a use= clause (report by
Alain Bench).
+ another fix for infocmp -i option, which did not ensure that some
escape sequences had comparable prefixes (report by Alain Bench).
20060401
+ improve discussion of init/reset in terminfo and tput manpages
(report by Alain Bench).
+ use is3 string for a fallback of rs3 in the reset program; it was
using is2 (report by Alain Bench).
+ correct logic for infocmp -i option, which did not account for
multiple digits in a parameter (cf: 20040828) (report by Alain
Bench).
+ move _nc_handle_sigwinch() to lib_setup.c to make --with-termlib
option work after 20060114 changes (report by Arkadiusz Miskiewicz).
+ add copyright notices to test-programs as needed (report by William
McBrine).
20060318
+ modify ncurses.c 'F' test to combine the wide-characters with color
and/or video attributes.
+ modify test/ncurses to use CTL/Q or ESC consistently for exiting
a test-screen (some commands used 'x' or 'q').
20060312
+ fix an off-by-one in the scrolling-region change (cf_ 20060311).
20060311
+ add checks in waddchnstr() and wadd_wchnstr() to stop copying when
a null character is found (report by Igor Bogomazov).
+ modify progs/Makefile.in to make "tput init" work properly with
cygwin, i.e., do not pass a ".exe" in the reference string used
in check_aliases (report by Samuel Thibault).
+ add some checks to ensure current position is within scrolling
region before scrolling on a new line (report by Dan Gookin).
+ change some NewChar() usage to static variables to work around
stack garbage introduced when cchar_t is not packed (Redhat #182024).
20060225
+ workarounds to build test/movewindow with PDcurses 2.7.
+ fix for nsterm-16color entry (patch by Alain Bench).
+ correct a typo in infocmp manpage (Debian #354281).
20060218
+ add nsterm-16color entry -TD
+ updated mlterm terminfo entry -TD
+ remove 970913 feature for copying subwindows as they are moved in
mvwin() (discussion with Bryan Christ).
+ modify test/demo_menus.c to demonstrate moving a menu (both the
window and subwindow) using shifted cursor-keys.
+ start implementing recursive mvwin() in movewindow.c (incomplete).
+ add a fallback definition for GCC_PRINTFLIKE() in test.priv.h,
for movewindow.c (report by William McBrine).
+ add help-message to test/movewindow.c
20060211
+ add test/movewindow.c, to test mvderwin().
+ fix ncurses soft-key test so color changes are shown immediately
rather than delayed.
+ modify ncurses soft-key test to hide the keys when exiting the test
screen.
+ fixes to build test programs with PDCurses 2.7, e.g., its headers
rely on autoconf symbols, and it declares stubs for nonfunctional
terminfo and termcap entrypoints.
20060204
+ improved test/configure to build test/ncurses on HPUX 11 using the
vendor curses.
+ documented ALTERNATE CONFIGURATIONS in the ncurses manpage, for the
benefit of developers who do not read INSTALL.
20060128
+ correct form library Window_To_Buffer() change (cf: 20040516), which
should ignore the video attributes (report by Ricardo Cantu).
20060121
+ minor fixes to xmc-glitch experimental code:
+ suppress line-drawing
+ implement max_attributes
tested with xterm.
+ minor fixes for the database iterator.
+ fix some buffer limits in c++ demo (comment by Falk Hueffner in
Debian #348117).
20060114
+ add toe -a option, to show all databases. This uses new private
interfaces in the ncurses library for iterating through the list of
databases.
+ fix toe from 20000909 changes which made it not look at
$HOME/.terminfo
+ make toe's -v option parameter optional as per manpage.
+ improve SIGWINCH handling by postponing its effect during newterm(),
etc., when allocating screens.
20060111
+ modify wgetnstr() to return KEY_RESIZE if a sigwinch occurs. Use
this in test/filter.c
+ fix an error in filter() modification which caused some applications
to fail.
20060107
+ check if filter() was called when getting the screensize. Keep it
at 1 if so (based on Redhat #174498).
+ add extension nofilter().
+ refined the workaround for ACS mapping.
+ make ifdef's consistent in curses.h for the extended colors so the
header file can be used for the normal curses library. The header
file installed for extended colors is a variation of the
wide-character configuration (report by Frederic L W Meunier).
20051231
+ add a workaround to ACS mapping to allow applications such as
test/blue.c to use the "PC ROM" characters by masking them with
A_ALTCHARSET. This worked up til 5.5, but was lost in the revision
of legacy coding (report by Michael Deutschmann).
+ add a null-pointer check in the wide-character version of
calculate_actual_width() (report by Victor Julien).
+ improve test/ncurses 'd' (color-edit) test by allowing the RGB
values to be set independently (patch by William McBrine).
+ modify test/configure script to allow building test programs with
PDCurses/X11.
+ modified test programs to allow some to work with NetBSD curses.
Several do not because NetBSD curses implements a subset of X/Open
curses, and also lacks much of SVr4 additions. But it's enough for
comparison.
+ update config.guess and config.sub
20051224
+ use BSD-specific fix for return-value from cgetent() from CVS where
an unknown terminal type would be reportd as "database not found".
+ make tgetent() return code more readable using new symbols
TGETENT_YES, etc.
+ remove references to non-existent "tctest" program.
+ remove TESTPROGS from progs/Makefile.in (it was referring to code
that was never built in that directory).
+ typos in curs_addchstr.3x, some doc files (noticed in OpenBSD CVS).
20051217
+ add use_legacy_coding() function to support lynx's font-switching
feature.
+ fix formatting in curs_termcap.3x (report by Mike Frysinger).
+ modify MKlib_gen.sh to change preprocessor-expanded _Bool back to
bool.
20051210
+ extend test/ncurses.c 's' (overlay window) test to exercise overlay(),
overwrite() and copywin() with different combinations of colors and
attributes (including background color) to make it easy to see the
effect of the different functions.
+ corrections to menu/m_global.c for wide-characters (report by
Victor Julien).
20051203
+ add configure option --without-dlsym, allowing developers to
configure GPM support without using dlsym() (discussion with Michael
Setzer).
+ fix wins_nwstr(), which did not handle single-column non-8bit codes
(Debian #341661).
20051126
+ move prototypes for wide-character trace functions from curses.tail
to curses.wide to avoid accidental reference to those if
_XOPEN_SOURCE_EXTENDED is defined without ensuring that is
included.
+ add/use NCURSES_INLINE definition.
+ change some internal functions to use int/unsigned rather than the
short equivalents.
20051119
+ remove a redundant check in lib_color.c (Debian #335655).
+ use ld's -search_paths_first option on Darwin to work around odd
search rules on that platform (report by Christian Gennerat, analysis
by Andrea Govoni).
+ remove special case for Darwin in CF_XOPEN_SOURCE configure macro.
+ ignore EINTR in tcgetattr/tcsetattr calls (Debian #339518).
+ fix several bugs in test/bs.c (patch by Stephen Lindholm).
20051112
+ other minor fixes to cygwin based on tack -TD
+ correct smacs in cygwin (Debian #338234, report by Baurzhan
Ismagulov, who noted that it was fixed in Cygwin).
20051029
+ add shifted up/down arrow codes to xterm-new as kind/kri strings -TD
+ modify wbkgrnd() to avoid clearing the A_CHARTEXT attribute bits
since those record the state of multicolumn characters (Debian
#316663).
+ modify werase to clear multicolumn characters that extend into
a derived window (Debian #316663).
20051022
+ move assignment from environment variable ESCDELAY from initscr()
down to newterm() so the environment variable affects timeouts for
terminals opened with newterm() as well.
+ fix a memory leak in keyname().
+ add test/demo_altkeys.c
+ modify test/demo_defkey.c to exit from loop via 'q' to allow
leak-checking, as well as fix a buffer size in winnstr() call.
20051015
+ correct order of use-clauses in rxvt-basic entry which made codes for
f1-f4 vt100-style rather than vt220-style (report by Gabor Z Papp).
+ suppress configure check for gnatmake if Ada95/Makefile.in is not
found.
+ correct a typo in configure --with-bool option for the case where
--without-cxx is used (report by Daniel Jacobowitz).
+ add a note to INSTALL's discussion of --with-normal, pointing out
that one may wish to use --without-gpm to ensure a completely
static link (prompted by report by Felix von Leitner).
20051010 5.5 release for upload to ftp.gnu.org
20051008
+ document in demo_forms.c some portability issues.
20051001
+ document side-effect of werase() which sets the cursor position.
+ save/restore the current position in form field editing to make
overlay mode work.
20050924
+ correct header dependencies in progs, allowing parallel make (report
by Daniel Jacobowitz).
+ modify CF_BUILD_CC to ensure that pre-setting $BUILD_CC overrides
the configure check for --with-build-cc (report by Daniel Jacobowitz).
+ modify CF_CFG_DEFAULTS to not use /usr as the default prefix for
NetBSD.
+ update config.guess and config.sub from
http://subversions.gnu.org/cgi-bin/viewcvs/config/config/
20050917
+ modify sed expression which computes path for /usr/lib/terminfo
symbolic link in install to ensure that it does not change unexpected
levels of the path (Gentoo #42336).
+ modify default for --disable-lp64 configure option to reduce impact
on existing 64-bit builds. Enabling the _LP64 option may change the
size of chtype and mmask_t. However, for ABI 6, it is enabled by
default (report by Mike Frysinger).
+ add configure script check for --enable-ext-mouse, bump ABI to 6 by
default if it is used.
+ improve configure script logic for bumping ABI to omit this if the
--with-abi-version option was used.
+ update address for Free Software Foundation in tack's source.
+ correct wins_wch(), which was not marking the filler-cells of
multi-column characters (cf: 20041023).
20050910
+ modify mouse initialization to ensure that Gpm_Open() is called only
once. Otherwise GPM gets confused in its initialization of signal
handlers (Debian #326709).
20050903
+ modify logic for backspacing in a multiline form field to ensure that
it works even when the preceding line is full (report by Frank van
Vugt).
+ remove comment about BUGS section of ncurses manpage (Debian #325481)
20050827
+ document some workarounds for shared and libtool library
configurations in INSTALL (see --with-shared and --with-libtool).
+ modify CF_GCC_VERSION and CF_GXX_VERSION macros to accommodate
cross-compilers which emit the platform name in their version
message, e.g.,
arm-sa1100-linux-gnu-g++ (GCC) 4.0.1
(report by Frank van Vugt).
20050820
+ start updating documentation for upcoming 5.5 release.
+ fix to make libtool and libtinfo work together again (cf: 20050122).
+ fixes to allow building traces into libtinfo
+ add debug trace to tic that shows if/how ncurses will write to the
lower corner of a terminal's screen.
+ update llib-l* files.
20050813
+ modify initializers in c++ binding to build with old versions of g++.
+ improve special case for 20050115 repainting fix, ensuring that if
the first changed cell is not a character that the range to be
repainted is adjusted to start at a character's beginning (Debian
#316663).
20050806
+ fixes to build on QNX 6.1
+ improve configure script checks for Intel 9.0 compiler.
+ remove #include's for libc.h (obsolete).
+ adjust ifdef's in curses.priv.h so that when cross-compiling to
produce comp_hash and make_keys, no dependency on wchar.h is needed.
That simplifies the build-cppflags (report by Frank van Vugt).
+ move modules related to key-binding into libtinfo to fix linkage
problem caused by 20050430 changes to MKkeyname.sh (report by
Konstantin Andreev).
20050723
+ updates/fixes for configure script macros from vile -TD
+ make prism9's sgr string agree with the rest of the terminfo -TD
+ make vt220's sgr0 string consistent with sgr string, do this for
several related cases -TD
+ improve translation to termcap by filtering the 'me' (sgr0) strings
as in the runtime call to tgetent() (prompted by a discussion with
Thomas Klausner).
+ improve tic check for sgr0 versus sgr(0), to help ensure that sgr0
resets line-drawing.
20050716
+ fix special cases for trimming sgr0 for hurd and vt220 (Debian
#318621).
+ split-out _nc_trim_sgr0() from modifications made to tgetent(), to
allow it to be used by tic to provide information about the runtime
changes that would be made to sgr0 for termcap applications.
+ modify make_sed.sh to make the group-name in the NAME section of
form/menu library manpage agree with the TITLE string when renaming
is done for Debian (Debian #78866).
20050702
+ modify parameter type in c++ binding for insch() and mvwinsch() to
be consistent with underlying ncurses library (was char, is chtype).
+ modify treatment of Intel compiler to allow _GNU_SOURCE to be defined
on Linux.
+ improve configure check for nanosleep(), checking that it works since
some older systems such as AIX 4.3 have a nonworking version.
20050625
+ update config.guess and config.sub from
http://subversions.gnu.org/cgi-bin/viewcvs/config/config/
+ modify misc/shlib to work in test-directory.
+ suppress $suffix in misc/run_tic.sh when cross-compiling. This
allows cross-compiles to use the host's tic program to handle the
"make install.data" step.
+ improve description of $LINES and $COLUMNS variables in manpages
(prompted by report by Dave Ulrick).
+ improve description of cross-compiling in INSTALL
+ add NCURSES-Programming-HOWTO.html by Pradeep Padala
(see http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/).
+ modify configure script to obtain soname for GPM library (discussion
with Daniel Jacobowitz).
+ modify configure script so that --with-chtype option will still
compute the unsigned literals suffix for constants in curses.h
(report by Daniel Jacobowitz:
+ patches from Daniel Jacobowitz:
+ the man_db.renames entry for tack.1 was backwards.
+ tack.1 had some 1m's that should have been 1M's.
+ the section for curs_inwstr.3 was wrong.
20050619
+ correction to --with-chtype option (report by Daniel Jacobowitz).
20050618
+ move build-time edit_man.sh and edit_man.sed scripts to top directory
to simplify reusing them for renaming tack's manpage (prompted by a
review of Debian package).
+ revert minor optimization from 20041030 (Debian #313609).
+ libtool-specific fixes, tested with libtool 1.4.3, 1.5.0, 1.5.6,
1.5.10 and 1.5.18 (all work except as noted previously for the c++
install using libtool 1.5.0):
+ modify the clean-rule in c++/Makefile.in to work with IRIX64 make
program.
+ use $(LIBTOOL_UNINSTALL) symbol, overlooked in 20030830
+ add configure options --with-chtype and --with-mmask-t, to allow
overriding of the non-LP64 model's use of the corresponding types.
+ revise test for size of chtype (and mmask_t), which always returned
"long" due to an uninitialized variable (report by Daniel Jacobowitz).
20050611
+ change _tracef's that used "%p" format for va_list values to ignore
that, since on some platforms those are not pointers.
+ fixes for long-formats in printf's due to largefile support.
20050604
+ fixes for termcap support:
+ reset pointer to _nc_curr_token.tk_name when the input stream is
closed, which could point to free memory (cf: 20030215).
+ delink TERMTYPE data which is used by the termcap reader, so that
extended names data will be freed consistently.
+ free pointer to TERMTYPE data in _nc_free_termtype() rather than
its callers.
+ add some entrypoints for freeing permanently allocated data via
_nc_freeall() when NO_LEAKS is defined.
+ amend 20041030 change to _nc_do_color to ensure that optimization is
applied only when the terminal supports back_color_erase (bce).
20050528
+ add sun-color terminfo entry -TD
+ correct a missing assignment in c++ binding's method
NCursesPanel::UserPointer() from 20050409 changes.
+ improve configure check for large-files, adding check for dirent64
from vile -TD
+ minor change to configure script to improve linker options for the
Ada95 tree.
20050515
+ document error conditions for ncurses library functions (report by
Stanislav Ievlev).
+ regenerated html documentation for ada binding.
see ftp://invisible-island.net/ncurses/patches/gnathtml
20050507
+ regenerated html documentation for manpages.
+ add $(BUILD_EXEEXT) suffix to invocation of make_keys in
ncurses/Makefile (Gentoo #89772).
+ modify c++/demo.cc to build with g++ -fno-implicit-templates option
(patch by Mike Frysinger).
+ modify tic to filter out long extended names when translating to
termcap format. Only two characters are permissible for termcap
capability names.
20050430
+ modify terminfo entries xterm-new and rxvt to add strings for
shift-, control-cursor keys.
+ workaround to allow c++ binding to compile with g++ 2.95.3, which
has a broken implementation of static_cast<> (patch by Jeff Chua).
+ modify initialization of key lookup table so that if an extended
capability (tic -x) string is defined, and its name begins with 'k',
it will automatically be treated as a key.
+ modify test/keynames.c to allow for the possibility of extended
key names, e.g., via define_key(), or via "tic -x".
+ add test/demo_termcap.c to show the contents of given entry via the
termcap interface.
20050423
+ minor fixes for vt100/vt52 entries -TD
+ add configure option --enable-largefile
+ corrected libraries used to build Ada95/gen/gen, found in testing
gcc 4.0.0.
20050416
+ update config.guess, config.sub
+ modify configure script check for _XOPEN_SOURCE, disable that on
Darwin whose header files have problems (patch by Chris Zubrzycki).
+ modify form library Is_Printable_String() to use iswprint() rather
than wcwidth() for determining if a character is printable. The
latter caused it to reject menu items containing non-spacing
characters.
+ modify ncurses test program's F-test to handle non-spacing characters
by combining them with a reverse-video blank.
+ review/fix several gcc -Wconversion warnings.
20050409
+ correct an off-by-one error in m_driver() for mouse-clicks used to
position the mouse to a particular item.
+ implement test/demo_menus.c
+ add some checks in lib_mouse to ensure SP is set.
+ modify C++ binding to make 20050403 changes work with the configure
--enable-const option.
20050403
+ modify start_color() to return ERR if it cannot allocate memory.
+ address g++ compiler warnings in C++ binding by adding explicit
member initialization, assignment operators and copy constructors.
Most of the changes simply preserve the existing semantics of the
binding, which can leak memory, etc., but by making these features
visible, it provides a framework for improving the binding.
+ improve C++ binding using static_cast, etc.
+ modify configure script --enable-warnings to add options to g++ to
correspond to the gcc --enable-warnings.
+ modify C++ binding to use some C internal functions to make it
compile properly on Solaris (and other platforms).
20050327
+ amend change from 20050320 to limit it to configurations with a
valid locale.
+ fix a bug introduced in 20050320 which broke the translation of
nonprinting characters to uparrow form (report by Takahashi Tamotsu).
20050326
+ add ifdef's for _LP64 in curses.h to avoid using wasteful 64-bits for
chtype and mmask_t, but add configure option --disable-lp64 in case
anyone used that configuration.
+ update misc/shlib script to account for Mac OS X (report by Michail
Vidiassov).
+ correct comparison for wrapping multibyte characters in
waddch_literal() (report by Takahashi Tamotsu).
20050320
+ add -c and -w options to tset to allow user to suppress ncurses'
resizing of the terminal emulator window in the special case where it
is not able to detect the true size (report by Win Delvaux, Debian
#300419).
+ modify waddch_nosync() to account for locale zn_CH.GBK, which uses
codes 128-159 as part of multibyte characters (report by Wang
WenRui, Debian #300512).
20050319
+ modify ncurses.c 'd' test to make it work with 88-color
configuration, i.e., by implementing scrolling.
+ improve scrolling in ncurses.c 'c' and 'C' tests, e.g., for 88-color
configuration.
20050312
+ change tracemunch to use strict checking.
+ modify ncurses.c 'p' test to test line-drawing within a pad.
+ implement environment variable NCURSES_NO_UTF8_ACS to support
miscellaneous terminal emulators which ignore alternate character
set escape sequences when in UTF-8 mode.
20050305
+ change NCursesWindow::err_handler() to a virtual function (request by
Steve Beal).
+ modify fty_int.c and fty_num.c to handle wide characters (report by
Wolfgang Gutjahr).
+ adapt fix for fty_alpha.c to fty_alnum.c, which also handled normal
and wide characters inconsistently (report by Wolfgang Gutjahr).
+ update llib-* files to reflect internal interface additions/changes.
20050226
+ improve test/configure script, adding tests for _XOPEN_SOURCE, etc.,
from lynx.
+ add aixterm-16color terminfo entry -TD
+ modified xterm-new terminfo entry to work with tgetent() changes -TD
+ extended changes in tgetent() from 20040710 to allow the substring of
sgr0 which matches rmacs to be at the beginning of the sgr0 string
(request by Thomas Wolff). Wolff says the visual effect in
combination with pre-20040710 ncurses is improved.
+ fix off-by-one in winnstr() call which caused form field validation
of multibyte characters to ignore the last character in a field.
+ correct logic in winsch() for inserting multibyte strings; the code
would clear cells after the insertion rather than push them to the
right (cf: 20040228).
+ fix an inconsistency in Check_Alpha_Field() between normal and wide
character logic (report by Wolfgang Gutjahr).
20050219
+ fix a bug in editing wide-characters in form library: deleting a
nonwide character modified the previous wide-character.
+ update manpage to describe NCURSES_MOUSE_VERSION 2.
+ correct manpage description of mouseinterval() (Debian #280687).
+ add a note to default_colors.3x explaining why this extension was
added (Debian #295083).
+ add traces to panel library.
20050212
+ improve editing of wide-characters in form library: left/right
cursor movement, and single-character deletions work properly.
+ disable GPM mouse support when $TERM happens to be prefixed with
"xterm". Gpm_Open() would otherwise assert that it can deal with
mouse events in this case.
+ modify GPM mouse support so it closes the server connection when
the caller disables the mouse (report by Stanislav Ievlev).
20050205
+ add traces for callback functions in form library.
+ add experimental configure option --enable-ext-mouse, which defines
NCURSES_MOUSE_VERSION 2, and modifies the encoding of mouse events to
support wheel mice, which may transmit buttons 4 and 5. This works
with xterm and similar X terminal emulators (prompted by question by
Andreas Henningsson, this is also related to Debian #230990).
+ improve configure macros CF_XOPEN_SOURCE and CF_POSIX_C_SOURCE to
avoid redefinition warnings on cygwin.
20050129
+ merge remaining development changes for extended colors (mostly
complete, does not appear to break other configurations).
+ add xterm-88color.dat (part of extended colors testing).
+ improve _tracedump() handling of color pairs past 96.
+ modify return-value from start_color() to return OK if colors have
already been started.
+ modify curs_color.3x list error conditions for init_pair(),
pair_content() and color_content().
+ modify pair_content() to return -1 for consistency with init_pair()
if it corresponds to the default-color.
+ change internal representation of default-color to allow application
to use color number 255. This does not affect the total number of
color pairs which are allowed.
+ add a top-level tags rule.
20050122
+ add a null-pointer check in wgetch() in case it is called without
first calling initscr().
+ add some null-pointer checks for SP, which is not set by libtinfo.
+ modify misc/shlib to ensure that absolute pathnames are used.
+ modify test/Makefile.in, etc., to link test programs only against the
libraries needed, e.g., omit form/menu/panel library for the ones
that are curses-specific.
+ change SP->_current_attr to a pointer, adjust ifdef's to ensure that
libtinfo.so and libtinfow.so have the same ABI. The reason for this
is that the corresponding data which belongs to the upper-level
ncurses library has a different size in each model (report by
Stanislav Ievlev).
20050115
+ minor fixes to allow test-compiles with g++.
+ correct column value shown in tic's warnings, which did not account
for leading whitespace.
+ add a check in _nc_trans_string() for improperly ended strings, i.e.,
where a following line begins in column 1.
+ modify _nc_save_str() to return a null pointer on buffer overflow.
+ improve repainting while scrolling wide-character data (Eungkyu Song).
20050108
+ merge some development changes to extend color capabilities.
20050101
+ merge some development changes to extend color capabilities.
+ fix manpage typo (FreeBSD report docs/75544).
+ update config.guess, config.sub
> patches for configure script (Albert Chin-A-Young):
+ improved fix to make mbstate_t recognized on HPUX 11i (cf:
20030705), making vsscanf() prototype visible on IRIX64. Tested for
on HP-UX 11i, Solaris 7, 8, 9, AIX 4.3.3, 5.2, Tru64 UNIX 4.0D, 5.1,
IRIX64 6.5, Redhat Linux 7.1, 9, and RHEL 2.1, 3.0.
+ print the result of the --disable-home-terminfo option.
+ use -rpath when compiling with SGI C compiler.
20041225
+ add trace calls to remaining public functions in form and menu
libraries.
+ fix check for numeric digits in test/ncurses.c 'b' and 'B' tests.
+ fix typo in test/ncurses.c 'c' test from 20041218.
20041218
+ revise test/ncurses.c 'c' color test to improve use for xterm-88color
and xterm-256color, added 'C' test using the wide-character color_set
and attr_set functions.
20041211
+ modify configure script to work with Intel compiler.
+ fix an limit-check in wadd_wchnstr() which caused labels in the
forms-demo to be one character short.
+ fix typo in curs_addchstr.3x (Jared Yanovich).
+ add trace calls to most functions in form and menu libraries.
+ update working-position for adding wide-characters when window is
scrolled (prompted by related report by Eungkyu Song).
20041204
+ replace some references on Linux to wcrtomb() which use it to obtain
the length of a multibyte string with _nc_wcrtomb, since wcrtomb() is
broken in glibc (see Debian #284260).
+ corrected length-computation in wide-character support for
field_buffer().
+ some fixes to frm_driver.c to allow it to accept multibyte input.
+ modify configure script to work with Intel 8.0 compiler.
20041127
+ amend change to setupterm() in 20030405 which would reuse the value
of cur_term if the same output was selected. This now reuses it only
when setupterm() is called from tgetent(), which has no notion of
separate SCREENs. Note that tgetent() must be called after initscr()
or newterm() to use this feature (Redhat #140326).
+ add a check in CF_BUILD_CC macro to ensure that developer has given
the --with-build-cc option when cross-compiling (report by Alexandre
Campo).
+ improved configure script checks for _XOPEN_SOURCE and
_POSIX_C_SOURCE (fix for IRIX 5.3 from Georg Schwarz, _POSIX_C_SOURCE
updates from lynx).
+ cosmetic fix to test/gdc.c to recolor the bottom edge of the box
for consistency (comment by Dan Nelson).
20041120
+ update wsvt25 terminfo entry -TD
+ modify test/ins_wide.c to test all flavors of ins_wstr().
+ ignore filler-cells in wadd_wchnstr() when adding a cchar_t array
which consists of multi-column characters, since this function
constructs them (cf: 20041023).
+ modify winnstr() to return multibyte character strings for the
wide-character configuration.
20041106
+ fixes to make slk_set() and slk_wset() accept and store multibyte
or multicolumn characters.
20041030
+ improve color optimization a little by making _nc_do_color() check
if the old/new pairs are equivalent to the default pair 0.
+ modify assume_default_colors() to not require that
use_default_colors() be called first.
20041023
+ modify term_attrs() to use termattrs(), add the extended attributes
such as enter_horizontal_hl_mode for WA_HORIZONTAL to term_attrs().
+ add logic in waddch_literal() to clear orphaned cells when one
multi-column character partly overwrites another.
+ improved logic for clearing cells when a multi-column character
must be wrapped to a new line.
+ revise storage of cells for multi-column characters to correct a
problem with repainting. In the old scheme, it was possible for
doupdate() to decide that only part of a multi-column character
should be repainted since the filler cells stored only an attribute
to denote them as fillers, rather than the character value and the
attribute.
20041016
+ minor fixes for traces.
+ add SP->_screen_acs_map[], used to ensure that mapping of missing
line-drawing characters is handled properly. For example, ACS_DARROW
is absent from xterm-new, and it was coincidentally displayed the
same as ACS_BTEE.
20041009
+ amend 20021221 workaround for broken acs to reset the sgr, rmacs
and smacs strings as well. Also modify the check for screen's
limitations in that area to allow the multi-character shift-in
and shift-out which seem to work.
+ change GPM initialization, using dl library to load it dynamically
at runtime (Debian #110586).
20041002
+ correct logic for color pair in setcchar() and getcchar() (patch by
Marcin 'Qrczak' Kowalczyk).
+ add t/T commands to ncurses b/B tests to allow a different color to
be tested for the attrset part of the test than is used in the
background color.
20040925
+ fix to make setcchar() to work when its wchar_t* parameter is
pointing to a string which contains more data than can be converted.
+ modify wget_wstr() and example in ncurses.c to work if wchar_t and
wint_t are different sizes (report by Marcin 'Qrczak' Kowalczyk).
20040918
+ remove check in wget_wch() added to fix an infinite loop, appears to
have been working around a transitory glibc bug, and interferes
with normal operation (report by Marcin 'Qrczak' Kowalczyk).
+ correct wadd_wch() and wecho_wch(), which did not pass the rendition
information (report by Marcin 'Qrczak' Kowalczyk).
+ fix aclocal.m4 so that the wide-character version of ncurses gets
compiled as libncursesw.5.dylib, instead of libncurses.5w.dylib
(adapted from patch by James J Ramsey).
+ change configure script for --with-caps option to indicate that it
is no longer experimental.
+ change configure script to reflect the fact that --enable-widec has
not been "experimental" since 5.3 (report by Bruno Lustosa).
20040911
+ add 'B' test to ncurses.c, to exercise some wide-character functions.
20040828
+ modify infocmp -i option to match 8-bit controls against its table
entries, e.g., so it can analyze the xterm-8bit entry.
+ add morphos terminfo entry, improve amiga-8bit entry (Pavel Fedin).
+ correct translation of "%%" in terminfo format to termcap, e.g.,
using "tic -C" (Redhat #130921).
+ modified configure script CF_XOPEN_SOURCE macro to ensure that if
it defines _POSIX_C_SOURCE, that it defines it to a specific value
(comp.os.stratus newsgroup comment).
20040821
+ fixes to build with Ada95 binding with gnat 3.4 (all warnings are
fatal, and gnat does not follow the guidelines for pragmas).
However that did find a coding error in Assume_Default_Colors().
+ modify several terminfo entries to ensure xterm mouse and cursor
visibility are reset in rs2 string: hurd, putty, gnome,
konsole-base, mlterm, Eterm, screen (Debian #265784, Debian #55637).
The xterm entries are left alone - old ones for compatibility, and
the new ones do not require this change. -TD
20040814
+ fake a SIGWINCH in newterm() to accommodate buggy terminal emulators
and window managers (Debian #265631).
> terminfo updates -TD
+ remove dch/dch1 from rxvt because they are implemented inconsistently
with the common usage of bce/ech
+ remove khome from vt220 (vt220's have no home key)
+ add rxvt+pcfkeys
20040807
+ modify test/ncurses.c 'b' test, adding v/V toggles to cycle through
combinations of video attributes so that for instance bold and
underline can be tested. This made the legend too crowded, added
a help window as well.
+ modify test/ncurses.c 'b' test to cycle through default colors if
the -d option is set.
+ update putty terminfo entry (Robert de Bath).
20040731
+ modify test/cardfile.c to allow it to read more data than can be
displayed.
+ correct logic in resizeterm.c which kept it from processing all
levels of window hierarchy (reports by Folkert van Heusden,
Chris Share).
20040724
+ modify "tic -cv" to ignore delays when comparing strings. Also
modify it to ignore a canceled sgr string, e.g., for terminals which
cannot properly combine attributes in one control sequence.
+ corrections for gnome and konsole entries (Redhat #122815, patch by
Hans de Goede)
> terminfo updates -TD
+ make ncsa-m rmacs/smacs consistent with sgr
+ add sgr, rc/sc and ech to syscons entries
+ add function-keys to decansi
+ add sgr to mterm-ansi
+ add sgr, civis, cnorm to emu
+ correct/simplify cup in addrinfo
20040717
> terminfo updates -TD
+ add xterm-pc-fkeys
+ review/update gnome and gnome-rh90 entries (prompted by Redhat
#122815).
+ review/update konsole entries
+ add sgr, correct sgr0 for kterm and mlterm
+ correct tsl string in kterm
20040711
+ add configure option --without-xterm-new
20040710
+ add check in wget_wch() for printable bytes that are not part of a
multibyte character.
+ modify wadd_wchnstr() to render text using window's background
attributes.
+ improve tic's check to compare sgr and sgr0.
+ fix c++ directory's .cc.i rule.
+ modify logic in tgetent() which adjusts the termcap "me" string
to work with ISO-2022 string used in xterm-new (cf: 20010908).
+ modify tic's check for conflicting function keys to omit that if
converting termcap to termcap format.
+ add -U option to tic and infocmp.
+ add rmam/smam to linux terminfo entry (Trevor Van Bremen)
> terminfo updates -TD
+ minor fixes for emu
+ add emu-220
+ change wyse acsc strings to use 'i' map rather than 'I'
+ fixes for avatar0
+ fixes for vp3a+
20040703
+ use tic -x to install terminfo database -TD
+ add -x to infocmp's usage message.
+ correct field used for comparing O_ROWMAJOR in set_menu_format()
(report/patch by Tony Li).
+ fix a missing nul check in set_field_buffer() from 20040508 changes.
> terminfo updates -TD
+ make xterm-xf86-v43 derived from xterm-xf86-v40 rather than
xterm-basic -TD
+ align with xterm patch #192's use of xterm-new -TD
+ update xterm-new and xterm-8bit for cvvis/cnorm strings -TD
+ make xterm-new the default "xterm" entry -TD
20040626
+ correct BUILD_CPPFLAGS substitution in ncurses/Makefile.in, to allow
cross-compiling from a separate directory tree (report/patch by
Dan Engel).
+ modify is_term_resized() to ensure that window sizes are nonzero,
as documented in the manpage (report by Ian Collier).
+ modify CF_XOPEN_SOURCE configure macro to make Hurd port build
(Debian #249214, report/patch by Jeff Bailey).
+ configure-script mods from xterm, e.g., updates to CF_ADD_CFLAGS
+ update config.guess, config.sub
> terminfo updates -TD
+ add mlterm
+ add xterm-xf86-v44
+ modify xterm-new aka xterm-xfree86 to accommodate luit, which
relies on G1 being used via an ISO-2022 escape sequence (report by
Juliusz Chroboczek)
+ add 'hurd' entry
20040619
+ reconsidered winsnstr(), decided after comparing other
implementations that wrapping is an X/Open documentation error.
+ modify test/inserts.c to test all flavors of insstr().
20040605
+ add setlocale() calls to a few test programs which may require it:
demo_forms.c, filter.c, ins_wide.c, inserts.c
+ correct a few misspelled function names in ncurses-intro.html (report
by Tony Li).
+ correct internal name of key_defined() manpage, which conflicted with
define_key().
20040529
+ correct size of internal pad used for holding wide-character
field_buffer() results.
+ modify data_ahead() to work with wide-characters.
20040522
+ improve description of terminfo if-then-else expressions (suggested
by Arne Thomassen).
+ improve test/ncurses.c 'd' test, allow it to use external file for
initial palette (added xterm-16color.dat and linux-color.dat), and
reset colors to the initial palette when starting/ending the test.
+ change limit-check in init_color() to allow r/g/b component to
reach 1000 (cf: 20020928).
20040516
+ modify form library to use cchar_t's rather than char's in the
wide-character configuration for storing data for field buffers.
+ correct logic of win_wchnstr(), which did not work for more than
one cell.
20040508
+ replace memset/memcpy usage in form library with for-loops to
simplify changing the datatype of FIELD.buf, part of wide-character
changes.
+ fix some inconsistent use of #if/#ifdef (report by Alain Guibert).
20040501
+ modify menu library to account for actual number of columns used by
multibyte character strings, in the wide-character configuration
(adapted from patch by Philipp Tomsich).
+ add "-x" option to infocmp like tic's "-x", for use in "-F"
comparisons. This modifies infocmp to only report extended
capabilities if the -x option is given, making this more consistent
with tic. Some scripts may break, since infocmp previous gave this
information without an option.
+ modify termcap-parsing to retain 2-character aliases at the beginning
of an entry if the "-x" option is used in tic.
20040424
+ minor compiler-warning and test-program fixes.
20040417
+ modify tic's missing-sgr warning to apply to terminfo only.
+ free some memory leaks in tic.
+ remove check in post_menu() that prevented menus from extending
beyond the screen (request by Max J. Werner).
+ remove check in newwin() that prevents allocating windows
that extend beyond the screen. Solaris curses does this.
+ add ifdef in test/color_set.c to allow it to compile with older
curses.
+ add napms() calls to test/dots.c to make it not be a CPU hog.
20040403
+ modify unctrl() to return null if its parameter does not correspond
to an unsigned char.
+ add some limit-checks to guard isprint(), etc., from being used on
values that do not fit into an unsigned char (report by Sami Farin).
20040328
+ fix a typo in the _nc_get_locale() change.
20040327
+ modify _nc_get_locale() to use setlocale() to query the program's
current locale rather than using getenv(). This fixes a case in tin
which relies on legacy treatment of 8-bit characters when the locale
is not initialized (reported by Urs Jansen).
+ add sgr string to screen's and rxvt's terminfo entries -TD.
+ add a check in tic for terminfo entries having an sgr0 but no sgr
string. This confuses Tru64 and HPUX curses when combined with
color, e.g., making them leave line-drawing characters in odd places.
+ correct casts used in ABSENT_BOOLEAN, CANCELLED_BOOLEAN, matches the
original definitions used in Debian package to fix PowerPC bug before
20030802 (Debian #237629).
20040320
+ modify PutAttrChar() and PUTC() macro to improve use of
A_ALTCHARSET attribute to prevent line-drawing characters from
being lost in situations where the locale would otherwise treat the
raw data as nonprintable (Debian #227879).
20040313
+ fix a redefinition of CTRL() macro in test/view.c for AIX 5.2 (report
by Jim Idle).
+ remove ".PP" after ".SH NAME" in a few manpages; this confuses
some apropos script (Debian #237831).
20040306
+ modify ncurses.c 'r' test so editing commands, like inserted text,
set the field background, and the state of insert/overlay editing
mode is shown in that test.
+ change syntax of dummy targets in Ada95 makefiles to work with pmake.
+ correct logic in test/ncurses.c 'b' for noncolor terminals which
did not recognize a quit-command (cf: 20030419).
20040228
+ modify _nc_insert_ch() to allow for its input to be part of a
multibyte string.
+ split out lib_insnstr.c, to prepare to rewrite it. X/Open states
that this function performs wrapping, unlike all of the other
insert-functions. Currently it does not wrap.
+ check for nl_langinfo(CODESET), use it if available (report by
Stanislav Ievlev).
+ split-out CF_BUILD_CC macro, actually did this for lynx first.
+ fixes for configure script CF_WITH_DBMALLOC and CF_WITH_DMALLOC,
which happened to work with bash, but not with Bourne shell (report
by Marco d'Itri via tin-dev).
20040221
+ some changes to adapt the form library to wide characters, incomplete
(request by Mike Aubury).
+ add symbol to curses.h which can be used to suppress include of
stdbool.h, e.g.,
#define NCURSES_ENABLE_STDBOOL_H 0
#include
(discussion on XFree86 mailing list).
20040214
+ modify configure --with-termlib option to accept a value which sets
the name of the terminfo library. This would allow a packager to
build libtinfow.so renamed to coincide with libtinfo.so (discussion
with Stanislav Ievlev).
+ improve documentation of --with-install-prefix, --prefix and
$(DESTDIR) in INSTALL (prompted by discussion with Paul Lew).
+ add configure check if the compiler can use -c -o options to rename
its output file, use that to omit the 'cd' command which was used to
ensure object files are created in a separate staging directory
(prompted by comments by Johnny Wezel, Martin Mokrejs).
20040208 5.4 release for upload to ftp.gnu.org
+ update TO-DO.
20040207 pre-release
+ minor fixes to _nc_tparm_analyze(), i.e., do not count %i as a param,
and do not count %d if it follows a %p.
+ correct an inconsistency between handling of codes in the 128-255
range, e.g., as illustrated by test/ncurses.c f/F tests. In POSIX
locale, the latter did not show printable results, while the former
did.
+ modify MKlib_gen.sh to compensate for broken C preprocessor on Mac
OS X, which alters "%%" to "% % " (report by Robert Simms, fix
verified by Scott Corscadden).
20040131 pre-release
+ modify SCREEN struct to align it between normal/wide curses flavors
to simplify future changes to build a single version of libtinfo
(patch by Stanislav Ievlev).
+ document handling of carriage return by addch() in manpage.
+ document special features of unctrl() in manpage.
+ documented interface changes in INSTALL.
+ corrected control-char test in lib_addch.c to account for locale
(Debian #230335, cf: 971206).
+ updated test/configure.in to use AC_EXEEXT and AC_OBJEXT.
+ fixes to compile Ada95 binding with Debian gnat 3.15p-4 package.
+ minor configure-script fixes for older ports, e.g., BeOS R4.5.
20040125 pre-release
+ amend change to PutAttrChar() from 20030614 which computed the number
of cells for a possibly multi-cell character. The 20030614 change
forced the cell to a blank if the result from wcwidth() was not
greater than zero. However, wcwidth() called for parameters in the
range 128-255 can give this return value. The logic now simply
ensures that the number of cells is greater than zero without
modifying the displayed value.
20040124 pre-release
+ looked good for 5.4 release for upload to ftp.gnu.org (but see above)
+ modify configure script check for ranlib to use AC_CHECK_TOOL, since
that works better for cross-compiling.
20040117 pre-release
+ modify lib_get_wch.c to prefer mblen/mbtowc over mbrlen/mbrtowc to
work around core dump in Solaris 8's locale support, e.g., for
zh_CN.GB18030 (report by Saravanan Bellan).
+ add includes for and in configure script macro
to make check work with Tru64 4.0d.
+ add terminfo entry for U/Win -TD
+ add terminfo entries for SFU aka Interix aka OpenNT (Federico
Bianchi).
+ modify tput's error messages to prefix them with the program name
(report by Vincent Lefevre, patch by Daniel Jacobowitz (see Debian
#227586)).
+ correct a place in tack where exit_standout_mode was used instead of
exit_attribute_mode (patch by Jochen Voss (see Debian #224443)).
+ modify c++/cursesf.h to use const in the Enumeration_Field method.
+ remove an ambiguous (actually redundant) method from c++/cursesf.h
+ make $HOME/.terminfo update optional (suggested by Stanislav Ievlev).
+ improve sed script which extracts libtool's version in the
CF_WITH_LIBTOOL macro.
+ add ifdef'd call to AC_PROG_LIBTOOL to CF_WITH_LIBTOOL macro (to
simplify local patch for Albert Chin-A-Young)..
+ add $(CXXFLAGS) to link command in c++/Makefile.in (adapted from
patch by Albert Chin-A-Young)..
+ fix a missing substitution in configure.in for "$target" needed for
HPUX .so/.sl case.
+ resync CF_XOPEN_SOURCE configure macro with lynx; fixes IRIX64 and
NetBSD 1.6 conflicts with _XOPEN_SOURCE.
+ make check for stdbool.h more specific, to ensure that including it
will actually define/declare bool for the configured compiler.
+ rewrite ifdef's in curses.h relating NCURSES_BOOL and bool. The
intention of that is to #define NCURSES_BOOL as bool when the
compiler declares bool, and to #define bool as NCURSES_BOOL when it
does not (reported by Jim Gifford, Sam Varshavchik, cf: 20031213).
20040110 pre-release
+ change minor version to 4, i.e., ncurses 5.4
+ revised/improved terminfo entries for tvi912b, tvi920b (Benjamin C W
Sittler).
+ simplified ncurses/base/version.c by defining the result from the
configure script rather than using sprintf (suggested by Stanislav
Ievlev).
+ remove obsolete casts from c++/cursesw.h (reported by Stanislav
Ievlev).
+ modify configure script so that when configuring for termlib, programs
such as tic are not linked with the upper-level ncurses library
(suggested by Stanislav Ievlev).
+ move version.c from ncurses/base to ncurses/tinfo to allow linking
of tic, etc., using libtinfo (suggested by Stanislav Ievlev).
20040103
+ adjust -D's to build ncursesw on OpenBSD.
+ modify CF_PROG_EXT to make OS/2 build with EXEEXT.
+ add pecho_wchar().
+ remove include from lib_slk_wset.c which is not needed (or
available) on older platforms.
20031227
+ add -D's to build ncursew on FreeBSD 5.1.
+ modify shared library configuration for FreeBSD 4.x/5.x to add the
soname information (request by Marc Glisse).
+ modify _nc_read_tic_entry() to not use MAX_ALIAS, but PATH_MAX only
for limiting the length of a filename in the terminfo database.
+ modify termname() to return the terminal name used by setupterm()
rather than $TERM, without truncating to 14 characters as documented
by X/Open (report by Stanislav Ievlev, cf: 970719).
+ re-add definition for _BSD_TYPES, lost in merge (cf: 20031206).
20031220
+ add configure option --with-manpage-format=catonly to address
behavior of BSDI, allow install of man+cat files on NetBSD, whose
behavior has diverged by requiring both to be present.
+ remove leading blanks from comment-lines in manlinks.sed script to
work with Tru64 4.0d.
+ add screen.linux terminfo entry (discussion on mutt-users mailing
list).
20031213
+ add a check for tic to flag missing backslashes for termcap
continuation lines. ncurses reads the whole entry, but termcap
applications do not.
+ add configure option "--with-manpage-aliases" extending
"--with-manpage-aliases" to provide the option of generating ".so"
files rather than symbolic links for manpage aliases.
+ add bool definition in include/curses.h.in for configurations with no
usable C++ compiler (cf: 20030607).
+ fix pathname of SigAction.h for building with --srcdir (reported by
Mike Castle).
20031206
+ folded ncurses/base/sigaction.c into includes of ncurses/SigAction.h,
since that header is used only within ncurses/tty/lib_tstp.c, for
non-POSIX systems (discussion with Stanislav Ievlev).
+ remove obsolete _nc_outstr() function (report by Stanislav Ievlev
).
+ add test/background.c and test/color_set.c
+ modify color_set() function to work with color pair 0 (report by
George Andreou ).
+ add configure option --with-trace, since defining TRACE seems too
awkward for some cases.
+ remove a call to _nc_free_termtype() from read_termtype(), since the
corresponding buffer contents were already zeroed by a memset (cf:
20000101).
+ improve configure check for _XOPEN_SOURCE and related definitions,
adding special cases for Solaris' __EXTENSIONS__ and FreeBSD's
__BSD_TYPES (reports by Marc Glisse ).
+ small fixes to compile on Solaris and IRIX64 using cc.
+ correct typo in check for pre-POSIX sort options in MKkey_defs.sh
(cf: 20031101).
20031129
+ modify _nc_gettime() to avoid a problem with arithmetic on unsigned
values (Philippe Blain).
+ improve the nanosleep() logic in napms() by checking for EINTR and
restarting (Philippe Blain).
+ correct expression for "%D" in lib_tgoto.c (Juha Jarvi
).
20031122
+ add linux-vt terminfo entry (Andrey V Lukyanov ).
+ allow "\|" escape in terminfo; tic should not warn about this.
+ save the full pathname of the trace-file the first time it is opened,
to avoid creating it in different directories if the application
opens and closes it while changing its working directory.
+ modify configure script to provide a non-empty default for
$BROKEN_LINKER
20031108
+ add DJGPP to special case of DOS-style drive letters potentially
appearing in TERMCAP environment variable.
+ fix some spelling in comments (reports by Jason McIntyre, Jonathon
Gray).
+ update config.guess, config.sub
20031101
+ fix a memory leak in error-return from setupterm() (report by
Stanislav Ievlev ).
+ use EXEEXT and OBJEXT consistently in makefiles.
+ amend fixes for cross-compiling to use separate executable-suffix
BUILD_EXEEXT (cf: 20031018).
+ modify MKkey_defs.sh to check for sort utility that does not
recognize key options, e.g., busybox (report by Peter S Mazinger
).
+ fix potential out-of-bounds indexing in _nc_infotocap() (found by
David Krause using some of the new malloc debugging features
under OpenBSD, patch by Ted Unangst).
+ modify CF_LIB_SUFFIX for Itanium releases of HP-UX, which use a
".so" suffix (patch by Jonathan Ward ).
20031025
+ update terminfo for xterm-xfree86 -TD
+ add check for multiple "tc=" clauses in a termcap to tic.
+ check for missing op/oc in tic.
+ correct _nc_resolve_uses() and _nc_merge_entry() to allow infocmp and
tic to show cancelled capabilities. These functions were ignoring
the state of the target entry, which should be untouched if cancelled.
+ correct comment in tack/output.c (Debian #215806).
+ add some null-pointer checks to lib_options.c (report by Michael
Bienia).
+ regenerated html documentation.
+ correction to tar-copy.sh, remove a trap command that resulted in
leaving temporary files (cf: 20030510).
+ remove contact/maintainer addresses for Juergen Pfeifer (his request).
20031018
+ updated test/configure to reflect changes for libtool (cf: 20030830).
+ fix several places in tack/pad.c which tested and used the parameter-
and parameterless strings inconsistently, i.e., in pad_rin(),
pad_il(), pad_indn() and pad_dl() (Debian #215805).
+ minor fixes for configure script and makefiles to cleanup executables
generated when cross-compiling for DJGPP.
+ modify infocmp to omit check for $TERM for operations that do not
require it, e.g., "infocmp -e" used to build fallback list (report by
Egmont Koblinger).
20031004
+ add terminfo entries for DJGPP.
+ updated note about maintainer in ncurses-intro.html
20030927
+ update terminfo entries for gnome terminal.
+ modify tack to reset colors after each color test, correct a place
where exit_standout_mode was used instead of exit_attribute_mode.
+ improve tack's bce test by making it set colors other than black
on white.
+ plug a potential recursion between napms() and _nc_timed_wait()
(report by Philippe Blain).
20030920
+ add --with-rel-version option to allow workaround to allow making
libtool on Darwin generate the "same" library names as with the
--with-shared option. The Darwin ld program does not work well
with a zero as the minor-version value (request by Chris Zubrzycki).
+ modify CF_MIXEDCASE_FILENAMES macro to work with cross-compiling.
+ modify tack to allow it to run from fallback terminfo data.
> patch by Philippe Blain:
+ improve PutRange() by adjusting call to EmitRange() and corresponding
return-value to not emit unchanged characters on the end of the
range.
+ improve a check for changed-attribute by exiting a loop when the
change is found.
+ improve logic in TransformLine(), eliminating a duplicated comparison
in the clr_bol logic.
20030913
> patch by Philippe Blain:
+ in ncurses/tty/lib_mvcur.c,
move the label 'nonlocal' just before the second gettimeofday() to
be able to compute the diff time when 'goto nonlocal' used.
Rename 'msec' to 'microsec' in the debug-message.
+ in ncurses/tty/lib_mvcur.c,
Use _nc_outch() in carriage return/newline movement instead of
putchar() which goes to stdout. Move test for xold>0 out of loop.
+ in ncurses/tinfo/setbuf.c,
Set the flag SP->_buffered at the end of operations when all has been
successful (typeMalloc can fail).
+ simplify NC_BUFFERED macro by moving check inside _nc_setbuf().
20030906
+ modify configure script to avoid using "head -1", which does not
work if POSIXLY_CORRECT (sic) is set.
+ modify run_tic.in to avoid using wrong shared libraries when
cross-compiling (Dan Kegel).
20030830
+ alter configure script help message to make it clearer that
--with-build-cc does not specify a cross-compiler (suggested by Dan
Kegel ).
+ modify configure script to accommodate libtool 1.5, as well as add an
parameter to the "--with-libtool" option which can specify the
pathname of libtool (report by Chris Zubrzycki). We note that
libtool 1.5 has more than one bug in its C++ support, so it is not
able to install libncurses++, for instance, if $DESTDIR or the option
--with-install-prefix is used.
20030823
> patch by Philippe Blain:
+ move assignments to SP->_cursrow, SP->_curscol into online_mvcur().
+ make baudrate computation in delay_output() consistent with the
assumption in _nc_mvcur_init(), i.e., a byte is 9 bits.
20030816
+ modify logic in waddch_literal() to take into account zh_TW.Big5
whose multibyte sequences may contain "printable" characters, e.g.,
a "g" in the sequence "\247g" (Debian #204889, cf: 20030621).
+ improve storage used by _nc_safe_strcpy() by ensuring that the size
is reset based on the initialization call, in case it were called
after other strcpy/strcat calls (report by Philippe Blain).
> patch by Philippe Blain:
+ remove an unused ifdef for REAL_ATTR & WANT_CHAR
+ correct a place where _cup_cost was used rather than _cuu_cost
20030809
+ fix a small memory leak in _nc_free_termtype().
+ close trace-file if trace() is called with a zero parameter.
+ free memory allocated for soft-key strings, in delscreen().
+ fix an allocation size in safe_sprintf.c for the "*" format code.
+ correct safe_sprintf.c to not return a null pointer if the format
happens to be an empty string. This applies to the "configure
--enable-safe-sprintf" option (Redhat #101486).
20030802
+ modify casts used for ABSENT_BOOLEAN and CANCELLED_BOOLEAN (report by
Daniel Jacobowitz).
> patch by Philippe Blain:
+ change padding for change_scroll_region to not be proportional to
the size of the scroll-region.
+ correct error-return in _nc_safe_strcat().
20030726
+ correct limit-checks in _nc_scroll_window() (report and test-case by
Thomas Graf cf: 20011020).
+ re-order configure checks for _XOPEN_SOURCE to avoid conflict with
_GNU_SOURCE check.
20030719
+ use clr_eol in preference to blanks for bce terminals, so select and
paste will have fewer trailing blanks, e.g., when using xterm
(request by Vincent Lefevre).
+ correct prototype for wunctrl() in manpage.
+ add configure --with-abi-version option (discussion with Charles
Wilson).
> cygwin changes from Charles Wilson:
+ aclocal.m4: on cygwin, use autodetected prefix for import
and static lib, but use "cyg" for DLL.
+ include/ncurses_dll.h: correct the comments to reflect current
status of cygwin/mingw port. Fix compiler warning.
+ misc/run_tic.in: ensure that tic.exe can find the uninstalled
DLL, by adding the lib-directory to the PATH variable.
+ misc/terminfo.src (nxterm|xterm-color): make xterm-color
primary instead of nxterm, to match XFree86's xterm.terminfo
usage and to prevent circular links.
(rxvt): add additional codes from rxvt.org.
(rxvt-color): new alias
(rxvt-xpm): new alias
(rxvt-cygwin): like rxvt, but with special acsc codes.
(rxvt-cygwin-native): ditto. rxvt may be run under XWindows, or
with a "native" MSWin GUI. Each takes different acsc codes,
which are both different from the "normal" rxvt's acsc.
(cygwin): cygwin-in-cmd.exe window. Lots of fixes.
(cygwinDBG): ditto.
+ mk-1st.awk: use "cyg" for the DLL prefix, but "lib" for import
and static libs.
20030712
+ update config.guess, config.sub
+ add triples for configuring shared libraries with the Debian
GNU/FreeBSD packages (patch by Robert Millan ).
20030705
+ modify CF_GCC_WARNINGS so it only applies to gcc, not g++. Some
platforms have installed g++ along with the native C compiler, which
would not accept gcc warning options.
+ add -D_XOPEN_SOURCE=500 when configuring with --enable-widec, to
get mbstate_t declaration on HPUX 11.11 (report by David Ellement).
+ add _nc_pathlast() to get rid of casts in _nc_basename() calls.
+ correct a sign-extension in wadd_wch() and wecho_wchar() from
20030628 (report by Tomohiro Kubota).
+ work around omission of btowc() and wctob() from wide-character
support (sic) in NetBSD 1.6 using mbtowc() and wctomb() (report by
Gabor Z Papp).
+ add portability note to curs_get_wstr.3x (Debian #199957).
20030628
+ rewrite wadd_wch() and wecho_wchar() to call waddch() and wechochar()
respectively, to avoid calling waddch_noecho() with wide-character
data, since that function assumes its input is 8-bit data.
Similarly, modify waddnwstr() to call wadd_wch().
+ remove logic from waddnstr() which transformed multibyte character
strings into wide-characters. Rewrite of waddch_literal() from
20030621 assumes its input is raw multibyte data rather than wide
characters (report by Tomohiro Kubota).
20030621
+ write getyx() and related 2-return macros in terms of getcury(),
getcurx(), etc.
+ modify waddch_literal() in case an application passes bytes of a
multibyte character directly to waddch(). In this case, waddch()
must reassemble the bytes into a wide-character (report by Tomohiro
Kubota ).
20030614
+ modify waddch_literal() in case a multibyte value occupies more than
two cells.
+ modify PutAttrChar() to compute the number of character cells that
are used in multibyte values. This fixes a problem displaying
double-width characters (report/test by Mitsuru Chinen
).
+ add a null-pointer check for result of keyname() in _tracechar()
+ modify _tracechar() to work around glibc sprintf bug.
20030607
+ add a call to setlocale() in cursesmain.cc, making demo display
properly in a UTF-8 locale.
+ add a fallback definition in curses.priv.h for MB_LEN_MAX (prompted
by discussion with Gabor Z Papp).
+ use macros NCURSES_ACS() and NCURSES_WACS() to hide cast needed to
appease -Wchar-subscript with g++ 3.3 (Debian #195732).
+ fix a redefinition of $RANLIB in the configure script when libtool
is used, which broke configure on Mac OS X (report by Chris Zubrzycki
).
+ simplify ifdef for bool declaration in curses.h.in (suggested by
Albert Chin-A-Young).
+ remove configure script check to allow -Wconversion for older
versions of gcc (suggested by Albert Chin-A-Young).
20030531
+ regenerated html manpages.
+ modify ifdef's in curses.h.in that disabled use of __attribute__()
for g++, since recent versions implement the cases which ncurses uses
(Debian #195230).
+ modify _nc_get_token() to handle a case where an entry has no
description, and capabilities begin on the same line as the entry
name.
+ fix a typo in ncurses_dll.h reported by gcc 3.3.
+ add an entry for key_defined.3x to man_db.renames.
20030524
+ modify setcchar() to allow converting control characters to complex
characters (report/test by Mitsuru Chinen ).
+ add tkterm entry -TD
+ modify parse_entry.c to allow a terminfo entry with a leading
2-character name (report by Don Libes).
+ corrected acsc in screen.teraterm, which requires a PC-style mapping.
+ fix trace statements in read_entry.c to use lseek() rather than
tell().
+ fix signed/unsigned warnings from Sun's compiler (gcc should give
these warnings, but it is unpredictable).
+ modify configure script to omit -Winline for gcc 3.3, since that
feature is broken.
+ modify manlinks.sed to add a few functions that were overlooked since
they return function pointers: field_init, field_term, form_init,
form_term, item_init, item_term, menu_init and menu_term.
20030517
+ prevent recursion in wgetch() via wgetnstr() if the connection cannot
be switched between cooked/raw modes because it is not a TTY (report
by Wolfgang Gutjahr ).
+ change parameter of define_key() and key_defined() to const (prompted
by Debian #192860).
+ add a check in test/configure for ncurses extensions, since there
are some older versions, etc., which would not compile with the
current test programs.
+ corrected demo in test/ncurses.c of wgetn_wstr(), which did not
convert wchar_t string to multibyte form before printing it.
+ corrections to lib_get_wstr.c:
+ null-terminate buffer passed to setcchar(), which occasionally
failed.
+ map special characters such as erase- and kill-characters into
key-codes so those will work as expected even if they are not
mentioned in the terminfo.
+ modify PUTC() and Charable() macros to make wide-character line
drawing work for POSIX locale on Linux console (cf: 20021221).
20030510
+ make typography for program options in manpages consistent (report
by Miloslav Trmac ).
+ correct dependencies in Ada95/src/Makefile.in, so the builds with
"--srcdir" work (report by Warren L Dodge).
+ correct missing definition of $(CC) in Ada95/gen/Makefile.in
(reported by Warren L Dodge ).
+ fix typos and whitespace in manpages (patch by Jason McIntyre
).
20030503
+ fix form_driver() cases for REQ_CLR_EOF, REQ_CLR_EOL, REQ_DEL_CHAR,
REQ_DEL_PREV and REQ_NEW_LINE, which did not ensure the cursor was at
the editing position before making modifications.
+ add test/demo_forms and associated test/edit_field.c demos.
+ modify test/configure.in to use test/modules for the list of objects
to compile rather than using the list of programs.
20030419
+ modify logic of acsc to use the original character if no mapping is
defined, noting that Solaris does this.
+ modify ncurses 'b' test to avoid using the acs_map[] array since
20021231 changes it to no longer contain information from the acsc
string.
+ modify makefile rules in c++, progs, tack and test to ensure that
the compiler flags (e.g., $CFLAGS or $CCFLAGS) are used in the link
command (report by Jose Luis Rico Botella ).
+ modify soft-key initialization to use A_REVERSE if A_STANDOUT would
not be shown when colors are used, i.e., if ncv#1 is set in the
terminfo as is done in "screen".
20030412
+ add a test for slk_color(), in ncurses.c
+ fix some issues reported by valgrind in the slk_set() and slk_wset()
code, from recent rewrite.
+ modify ncurses 'E' test to use show previous label via slk_label(),
as in 'e' test.
+ modify wide-character versions of NewChar(), NewChar2() macros to
ensure that the whole struct is initialized.
20030405
+ modify setupterm() to check if the terminfo and terminal-modes have
already been read. This ensures that it does not reinvoke
def_prog_mode() when an application calls more than one function,
such as tgetent() and initscr() (report by Olaf Buddenhagen).
20030329
+ add 'E' test to ncurses.c, to exercise slk_wset().
+ correct handling of carriage-return in wgetn_wstr(), used in demo of
slk_wset().
+ first draft of slk_wset() function.
20030322
+ improved warnings in tic when suppressing items to fit in termcap's
1023-byte limit.
+ built a list in test/README showing which externals are being used
by either programs in the test-directory or via internal library
calls.
+ adjust include-options in CF_ETIP_DEFINES to avoid missing
ncurses_dll.h, fixing special definitions that may be needed for
etip.h (reported by Greg Schafer ).
20030315
+ minor fixes for cardfile.c, to make it write the updated fields to
a file when ^W is given.
+ add/use _nc_trace_bufcat() to eliminate some fixed buffer limits in
trace code.
20030308
+ correct a case in _nc_remove_string(), used by define_key(), to avoid
infinite loop if the given string happens to be a substring of other
strings which are assigned to keys (report by John McCutchan).
+ add key_defined() function, to tell which keycode a string is bound
to (discussion with John McCutchan ).
+ correct keybound(), which reported definitions in the wrong table,
i.e., the list of definitions which are disabled by keyok().
+ modify demo_keydef.c to show the details it changes, and to check
for errors.
20030301
+ restructured test/configure script, make it work for libncursesw.
+ add description of link_fieldtype() to manpage (report by
L Dee Holtsclaw ).
20030222
+ corrected ifdef's relating to configure check for wchar_t, etc.
+ if the output is a socket or other non-tty device, use 1 millisecond
for the cost in mvcur; previously it was 9 milliseconds because the
baudrate was not known.
+ in _nc_get_tty_mode(), initialize the TTY buffer on error, since
glibc copies uninitialized data in that case, as noted by valgrind.
+ modify tput to use the same parameter analysis as tparm() does, to
provide for user-defined strings, e.g., for xterm title, a
corresponding capability might be
title=\E]2;%p1%s^G,
+ modify MKlib_gen.sh to avoid passing "#" tokens through the C
preprocessor. This works around Mac OS X's preprocessor, which
insists on adding a blank on each side of the token (report/analysis
by Kevin Murphy ).
20030215
+ add configure check for wchar_t and wint_t types, rather than rely
on preprocessor definitions. Also work around for gcc fixinclude
bug which creates a shadow copy of curses.h if it sees these symbols
apparently typedef'd.
+ if database is disabled, do not generate run_tic.sh
+ minor fixes for memory-leak checking when termcap is read.
20030208
+ add checking in tic for incomplete line-drawing character mapping.
+ updated configure script to reflect fix for AC_PROG_GCC_TRADITIONAL,
which is broken in autoconf 2.5x for Mac OS X 10.2.3 (report by
Gerben Wierda ).
+ make return value from _nc_printf_string() consistent. Before,
depending on whether --enable-safe-sprintf was used, it might not be
cached for reallocating.
20030201
+ minor fixes for memory-leak checking in lib_tparm.c, hardscroll.c
+ correct a potentially-uninitialized value if _read_termtype() does
not read as much data as expected (report by Wolfgang Rohdewald
).
+ correct several places where the aclocal.m4 macros relied on cache
variable names which were incompatible (as usual) between autoconf
2.13 and 2.5x, causing the test for broken-linker to give incorrect
results (reports by Gerben Wierda and Thomas Esser
).
+ do not try to open gpm mouse driver if standard output is not a tty;
the gpm library does not make this check (bug report for dialog
by David Oliveira ).
20030125
+ modified emx.src to correspond more closely to terminfo.src, added
emx-base to the latter -TD
+ add configure option for FreeBSD sysmouse, --with-sysmouse, and
implement support for that in lib_mouse.c, lib_getch.c
20030118
+ revert 20030105 change to can_clear_with(), does not work for the
case where the update is made on cells which are blanks with
attributes, e.g., reverse.
+ improve ifdef's to guard against redefinition of wchar_t and wint_t
in curses.h (report by Urs Jansen).
20030111
+ improve mvcur() by checking if it is safe to move when video
attributes are set (msgr), and if not, reset/restore attributes
within that function rather than doing it separately in the GoTo()
function in tty_update.c (suggested by Philippe Blain).
+ add a message in run_tic.in to explain more clearly what does not
work when attempting to create a symbolic link for /usr/lib/terminfo
on OS/2 and other platforms with no symbolic links (report by John
Polterak).
+ change several sed scripts to avoid using "\+" since it is not a BRE
(basic regular expression). One instance caused terminfo.5 to be
misformatted on FreeBSD (report by Kazuo Horikawa
(see FreeBSD docs/46709)).
+ correct misspelled 'wint_t' in curs_get_wch.3x (Michael Elkins).
20030105
+ improve description of terminfo operators, especially static/dynamic
variables (comments by Mark I Manning IV ).
+ demonstrate use of FIELDTYPE by modifying test/ncurses 'r' test to
use the predefined TYPE_ALPHA field-type, and by defining a
specialized type for the middle initial/name.
+ fix MKterminfo.sh, another workaround for POSIXLY_CORRECT misfeature
of sed 4.0
> patch by Philippe Blain:
+ optimize can_clear_with() a little by testing first if the parameter
is indeed a "blank".
+ simplify ClrBottom() a little by allowing it to use clr_eos to clear
sections as small as one line.
+ improve ClrToEOL() by checking if clr_eos is available before trying
to use it.
+ use tputs() rather than putp() in a few cases in tty_update.c since
the corresponding delays are proportional to the number of lines
affected: repeat_char, clr_eos, change_scroll_region.
20021231
+ rewrite of lib_acs.c conflicts with copying of SCREEN acs_map to/from
global acs_map[] array; removed the lines that did the copying.
20021228
+ change some overlooked tputs() calls in scrolling code to use putp()
(report by Philippe Blain).
+ modify lib_getch.c to avoid recursion via wgetnstr() when the input
is not a tty and consequently mode-changes do not work (report by
).
+ rewrote lib_acs.c to allow PutAttrChar() to decide how to render
alternate-characters, i.e., to work with Linux console and UTF-8
locale.
+ correct line/column reference in adjust_window(), needed to make
special windows such as curscr track properly when resizing (report
by Lucas Gonze ).
> patch by Philippe Blain:
+ correct the value used for blank in ClrBottom() (broken in 20000708).
+ correct an off-by-one in GoTo() parameter in _nc_scrolln().
20021221
+ change several tputs() calls in scrolling code to use putp(), to
enable padding which may be needed for some terminals (patch by
Philippe Blain).
+ use '%' as sed substitute delimiter in run_tic script to avoid
problems with pathname delimiters such as ':' and '@' (report by John
Polterak).
+ implement a workaround so that line-drawing works with screen's
crippled UTF-8 support (tested with 3.9.13). This only works with
the wide-character support (--enable-widec); the normal library will
simply suppress line-drawing when running in a UTF-8 locale in screen.
20021214
+ allow BUILD_CC and related configure script variables to be
overridden from the environment.
+ make build-tools variables in ncurses/Makefile.in consistent with
the configure script variables (report by Maciej W Rozycki).
+ modify ncurses/modules to allow
configure --disable-leaks --disable-ext-funcs
to build (report by Gary Samuelson).
+ fix a few places in configure.in which lacked quotes (report by
Gary Samuelson ).
+ correct handling of multibyte characters in waddch_literal() which
force wrapping because they are started too late on the line (report
by Sam Varshavchik).
+ small fix for CF_GNAT_VERSION to ignore the help-message which
gnatmake adds to its version-message.
> Maciej W Rozycki :
+ use AC_CHECK_TOOL to get proper values for AR and LD for cross
compiling.
+ use $cross_compiling variable in configure script rather than
comparing $host_alias and $target alias, since "host" is
traditionally misused in autoconf to refer to the target platform.
+ change configure --help message to use "build" rather than "host"
when referring to the --with-build-XXX options.
20021206
+ modify CF_GNAT_VERSION to print gnatmake's version, and to allow for
possible gnat versions such as 3.2 (report by Chris Lingard
).
+ modify #define's for CKILL and other default control characters in
tset to use the system's default values if they are defined.
+ correct interchanged defaults for kill and interrupt characters
in tset, which caused it to report unnecessarily (Debian #171583).
+ repair check for missing C++ compiler, which is broken in autoconf
2.5x by hardcoding it to g++ (report by Martin Mokrejs).
+ update config.guess, config.sub (2002-11-30)
+ modify configure script to skip --with-shared, etc., when the
--with-libtool option is given, since they would be ignored anyway.
+ fix to allow "configure --with-libtool --with-termlib" to build.
+ modify configure script to show version number of libtool, to help
with bug reports. libtool still gets confused if the installed
ncurses libraries are old, since it ignores the -L options at some
point (tested with libtool 1.3.3 and 1.4.3).
+ reorder configure script's updating of $CPPFLAGS and $CFLAGS to
prevent -I options in the user's environment from introducing
conflicts with the build -I options (may be related to reports by
Patrick Ash and George Goffe).
+ rename test/define_key.c to test/demo_defkey.c, test/keyok.c to
test/demo_keyok.c to allow building these with libtool.
20021123
+ add example program test/define_key.c for define_key().
+ add example program test/keyok.c for keyok().
+ add example program test/ins_wide.c for wins_wch() and wins_wstr().
+ modify wins_wch() and wins_wstr() to interpret tabs by using the
winsch() internal function.
+ modify setcchar() to allow for wchar_t input strings that have
more than one spacing character.
20021116
+ fix a boundary check in lib_insch.c (patch by Philippe Blain).
+ change type for *printw functions from NCURSES_CONST to const
(prompted by comment by Pedro Palhoto Matos ,
but really from a note on X/Open's website stating that either is
acceptable, and the latter will be used in a future revision).
+ add xterm-1002, xterm-1003 terminfo entries to demonstrate changes in
lib_mouse.c (20021026) -TD
+ add screen-bce, screen-s entries from screen 3.9.13 (report by
Adam Lazur ) -TD
+ add mterm terminfo entries -TD
20021109
+ split-out useful fragments in terminfo for vt100 and vt220 numeric
keypad, i.e., vt100+keypad, vt100+pfkeys, vt100+fnkeys and
vt220+keypad. The last as embedded in various entries had ka3 and
kb2 interchanged (report/discussion with Leonard den Ottolander
).
+ add check in tic for keypads consistent with vt100 layout.
+ improve checks in tic for color capabilities
20021102
+ check for missing/empty/illegal terminfo name in _nc_read_entry()
(report by Martin Mokrejs, where $TERM was set to an empty string).
+ rewrote lib_insch.c, combining it with lib_insstr.c so both handle
tab and other control characters consistently (report by Philippe
Blain).
+ remove an #undef for KEY_EVENT from curses.tail used in the
experimental NCURSES_WGETCH_EVENTS feature. The #undef confuses
dpkg's build script (Debian #165897).
+ fix MKlib_gen.sh, working around the ironically named POSIXLY_CORRECT
feature of GNU sed 4.0 (reported by Ervin Nemeth ).
20021026
+ implement logic in lib_mouse.c to handle position reports which are
generated when XFree86 xterm is initialized with private modes 1002
or 1003. These are returned to the application as the
REPORT_MOUSE_POSITION mask, which was not implemented. Tested both
with ncurses 'a' menu (prompted by discussion with Larry Riedel
).
+ modify lib_mouse.c to look for "XM" terminfo string, which allows
one to override the escape sequence used to enable/disable mouse
mode. In particular this works for XFree86 xterm private modes
1002 and 1003. If "XM" is missing (note that this is an extended
name), lib_mouse uses the conventional private mode 1000.
+ correct NOT_LOCAL() macro in lib_mvcur.c to refer to screen_columns
where it used screen_lines (report by Philippe Blain).
+ correct makefile rules for the case when both --with-libtool and
--with-gpm are given (report by Mr E_T ).
+ add note to terminfo manpage regarding the differences between
setaf/setab and setf/setb capabilities (report by Pavel Roskin).
20021019
+ remove redundant initialization of TABSIZE in newterm(), since it is
already done in setupterm() (report by Philippe Blain).
+ add test/inserts.c, to test winnstr() and winsch().
+ replace 'sort' in dist.mk with script that sets locale to POSIX.
+ update URLs in announce.html.in (patch by Frederic L W Meunier).
+ remove glibc add-on files, which are no longer needed (report by
Frederic L W Meunier).
20021012 5.3 release for upload to ftp.gnu.org
+ modify ifdef's in etip.h.in to allow the etip.h header to compile
with gcc 3.2 (patch by Dimitar Zhekov ).
+ add logic to setupterm() to make it like initscr() and newterm(),
by checking for $NCURSES_TRACE environment variable and enabling
the debug trace in that case.
+ modify setupterm() to ensure that it initializes the baudrate, for
applications such as tput (report by Frank Henigman).
+ modify definition of bits used for command-line and library debug
traces to avoid overlap, using new definition TRACE_SHIFT to relate
the two.
+ document tput's interpretation of parameterized strings according to
whether parameters are given, etc. (discussion with Robert De Bath).
20021005 pre-release
+ correct winnwstr() to account for non-character cells generated when
a double-width character is added (report by Michael Bienia
).
+ modify _nc_viswbuf2n() to provide better results using wctomb().
+ correct logic in _nc_varargs() which broke tracing of parameters for
formats such as "%.*s".
+ correct scale factor in linux-c and linux-c-nc terminfo entries
(report Floyd Davidson).
+ change tic -A option to -t, add the same option to infocmp for
consistency.
+ correct "%c" implementation in lib_tparm.c, which did not map a null
character to a 128 (cf: 980620) (patch by Frank Henigman
).
20020928 pre-release
+ modify MKkey_defs.sh to check for POSIX sort -k option, use that if
it is found, to accommodate newer utility which dropped the
compatibility support for +number options (reported by Andrey A
Chernov).
+ modify linux terminfo entry to use color palette feature from
linux-c-nc entry (comments by Tomasz Wasiak and Floyd Davidson).
+ restore original color definitions in endwin() if init_color() was
used, and resume those colors on the next doupdate() or refresh()
(report by Tomasz Wasiak ).
+ improve debug-traces by modifying MKlib_gen.sh to generate calls
to returnBool() and returnAttr().
+ add/use _nc_visbufn() and _nc_viswbufn() to limit the debug trace
of waddnstr() and similar functions to match the parameters as used.
+ add/use _nc_retrace_bool() and _nc_retrace_unsigned().
+ correct type used by _nc_retrace_chtype().
+ add debug traces to some functions in lib_mouse.c
+ modify lib_addch.c to handle non-spacing characters.
+ correct parameter of RemAttr() in lib_bkgd.c, which caused the c++
demo's boxes to lose the A_ALTCHARSET flag (broken in 20020629).
+ correct width computed in _tracedump(), which did not account for
the attributes (broken in 20010602).
+ modify test/tracemunch to replace addresses for windows other than
curscr, newscr and stdscr with window0, window1, etc.
20020921 pre-release
+ redid fix for edit_man.sed path.
+ workaround for Cygwin bug which makes subprocess writes to stdout
result in core dump.
+ documented getbegx(), etc.
+ minor fixes to configure script to use '%' consistently as a sed
delimiter rather than '@'.
> patch by Philippe Blain:
+ add check in lib_overlay.c to ensure that the windows to be merged
actually overlap, and in copywin(), limit the area to be touched
to the lines given for the destination window.
20020914 pre-release
+ modified curses.h so that if the wide-character version is installed
overwriting /usr/include/curses.h, and if it relied on libutf8.h,
then applications that use that header for wide-character support
must define HAVE_LIBUTF8_H.
+ modify putwin(), getwin() and dupwin() to allow them to operate on
pads (request by Philippe Blain).
+ correct attribute-merging in wborder(), broken in 20020216 (report
by Tomasz Wasiak ).
> patch by Philippe Blain:
+ corrected pop-counts in tparam_internal() to '!' and '~' cases.
+ use sizeof(NCURSES_CH_T) in one place that used sizeof(chtype).
+ remove some unused variables from mvcur test-driver.
20020907 pre-release
+ change configure script to allow install of widec-character
(ncursesw) headers to overwrite normal (ncurses) headers, since the
latter is a compatible subset of the former.
+ fix path of edit_man.sed in configure script, needed to regenerate
html manpages on Debian.
+ fix mismatched enums in vsscanf.c, which caused warning on Solaris.
+ update README.emx to reflect current patch used for autoconf.
+ change web- and ftp-site to invisible-island.net
> patch by Philippe Blain:
+ change case for 'P' in tparam_internal() to indicate that it pops
a variable from the stack.
+ correct sense of precision and width in parse_format(), to avoid
confusion.
+ modify lib_tparm.c, absorb really_get_space() into get_space().
+ modify getwin() and dupwin() to copy the _notimeout, _idlok and
_idcok window fields.
+ better fix for _nc_set_type(), using typeMalloc().
20020901 pre-release
+ change minor version to 3, i.e., ncurses 5.3
+ update config.guess, config.sub
+ retest build with each configure option; minor ifdef fixes.
+ make keyname() return a null pointer rather than "UNKNOWN STRING" to
match XSI.
+ modify handling of wide line-drawing character functions to use the
normal line-drawing characters when not in UTF-8 locale.
+ add check/fix to comp_parse.c to suppress warning about missing acsc
string. This happens in configurations where raw termcap information
is processed; tic already does this and other checks.
+ modify tic's check for ich/ich1 versus rmir/smir to only warn about
ich1, to match xterm patch #70 notes.
+ moved information for ripped-off lines into SCREEN struct to allow
use in resizeterm().
+ add experimental wgetch_events(), ifdef'd with NCURSES_WGETCH_EVENTS
(adapted from patch by Ilya Zakharevich - see ncurses/README.IZ).
+ amend check in kgetch() from 20020824 to look only for function-keys,
otherwise escape sequences are not resolved properly.
> patch by Philippe Blain:
+ removed redundant assignment to SP->_checkfd from newterm().
+ check return-value of setupterm() in restartterm().
+ use sizeof(NCURSES_CH_T) in a few places that used sizeof(chtype).
+ prevent dupwin() from duplicating a pad.
+ prevent putwin() from writing a pad.
+ use typeRealloc() or typeMalloc() in preference to direct calls on
_nc_doalloc().
20020824
+ add a check in kgetch() for cooked characters in the fifo to avoid
calling fifo_push() when a KEY_RESIZE is available (report/analysis
by Sam Varshavchik ).
+ fix an overlooked case for Redhat #68199 (Philippe Blain).
+ ensure clearerr() is called before using ferror() e.g., in
lib_screen.c (report by Philippe Blain).
20020817
+ modify lib_screen.c and lib_newwin.c to maintain the SCREEN-specific
pointers for curscr/stdscr/newscr when scr_save() and scr_restore()
modify the global curscr/stdscr/newscr variables. Fixes Redhat
#68199.
+ add checks for null pointer in calls to tparm() and tgoto() based on
FreeBSD bug report. If ncurses were built with termcap support, and
the first call to tgoto() were a zero-length string, the result would
be a null pointer, which was not handled properly.
+ correct a typo in terminfo.head, which gave the octal code for colon
rather than comma.
+ remove the "tic -u" option from 20020810, since it did not account
for nested "tc=" clauses, and when that was addressed, was still
unsatisfactory.
20020810
+ add tic -A option to suppress capabilities which are commented out
when translating to termcap.
+ add tic -u option to provide older behavior of "tc=" clauses.
+ modified tic to expand all but the final "tc=" clause in a termcap
entry, to accommodate termcap libraries which do not handle multiple
tc clauses.
+ correct typo in curs_inopts.3x regarding CS8/CS7 usage (report by
Philippe Blain).
+ remove a couple of redundant uses of A_ATTRIBUTES in expressions
using AttrOf(), which already incorporates that mask (report by
Philippe Blain).
+ document TABSIZE variable.
+ add NCURSES_ASSUMED_COLORS environment variable, to allow users to
override compiled-in default black-on-white assumption used in
assume_default_colors().
+ correct an off-by-one comparison against max_colors in COLORFGBG
logic.
+ correct a use of uninitialized memory found by valgrind (reported by
Olaf Buddenhagen ).
+ modified wresize() to ensure that a failed realloc will not corrupt
the window structure, and to make subwindows fit within the resized
window (completes Debian #87678, Debian #101699)
20020803
+ fix an off-by-one in lib_pad.c check for limits of pad (patch by
Philippe Blain).
+ revise logic for BeOS in lib_twait.c altered in 20011013 to restore
logic used by lib_getch.c's support for GPM or EMX mouse (report by
Philippe Blain)
+ remove NCURSES_CONST from several prototypes in curses.wide, to make
the --enable-const --enable-widec configure options to work together
(report by George Goffe ).
20020727
+ finish no-leak checking in cardfile.c, using this for testing changes
to resizeterm().
+ simplify _nc_freeall() using delscreen().
20020720
+ check error-return from _nc_set_tty_mode() in _nc_initscr() and
reset_prog_mode() (report/patch by Philippe Blain).
+ regenerate configure using patch for autoconf 2.52, to address
problem with identifying C++ bool type.
+ correct/improve logic to produce an exit status for errors in tput,
which did not exit with an error when told to put a string not in the
current terminfo entry (report by David Gomez ).
+ modify configure script AC_OUTPUT() call to work around defect in
autoconf 2.52 which adds an ifdef'd include to the generated
configure definitions.
+ remove fstat() check from scr_init(), which also fixes a missing
include for from 20020713 (reported by David Ellement,
fix suggested by Philippe Blain).
+ update curs_scanw.3x manpage to note that XSI curses differs from
SVr4 curses: return-values are incompatible.
+ correct several prototypes in manpages which used const
inconsistently with the curses.h file, and removed spurious const's
in a few places from curses.h, e.g., for wbkgd() (report by Glenn
Maynard ).
+ change internal type used by tparm() to long, to work with LP64 model.
+ modify nc_alloc.h to allow building with g++, for testing.
20020713
+ add resize-handling to cardfile.c test program.
+ altered resizeterm() to avoid having it fail when a child window
cannot be resized because it would be larger than its parent. (More
work must be done on this, but it works well enough to integrate).
+ improve a limit-check in lib_refresh.c
+ remove check in lib_screen.c relating dumptime to file's modification
times, since that would not necessarily work for remotely mounted
filesystems.
+ modify lrtest to simplify debugging changes to resizeterm, e.g.,
t/T commands to enable/disable tracing.
+ updated status of multibyte support in TO-DO.
+ update contact info in source-files (patch by Juergen Pfeifer).
20020706
+ add Caps.hpux11, as an example.
+ modify version_filter(), used to implement -R option for tic and
infocmp, to use computed array offsets based on the Caps.* file which
is actually configured, rather than constants which correspond to
the Caps file.
+ reorganized lib_raw.c to avoid updating SP and cur_term state if the
functions fail (reported by Philippe Blain).
+ add -Wundef to gcc warnings, adjust a few ifdef's to accommodate gcc.
20020629
+ correct parameters to setcchar() in ncurses.c (cf: 20020406).
+ set locale in most test programs (view.c and ncurses.c were the
only ones).
+ add configure option --with-build-cppflags (report by Maksim A
Nikulin ).
+ correct a typo in wide-character logic for lib_bkgnd.c (Philippe
Blain).
+ modify lib_wacs.c to not cancel the acsc, smacs, rmacs strings when
in UTF-8 locale. Wide-character functions use Unicode values, while
narrow-character functions use the terminfo data.
+ fix a couple of places in Ada95/samples which did not compile with
gnat 3.14
+ modify mkinstalldirs so the DOS-pathname case is locale-independent.
+ fix locale problem in MKlib_gen.sh by forcing related variables to
POSIX (C), using same approach as autoconf (set variables only if
they were set before). Update MKterminfo.sh and MKtermsort.sh to
match.
20020622
+ add charset to generated html.
+ add mvterm entry, adapted from a FreeBSD bug-report by Daniel Rudy
-TD
+ add rxvt-16color, ibm+16color entries -TD
+ modify check in --disable-overwrite option so that it is used by
default unless the --prefix/$prefix value is not /usr, in attempt to
work around packagers, e.g., for Sun's freeware, who do not read the
INSTALL notes.
20020615
+ modify wgetch() to allow returning ungetch'd KEY_RESIZE as a function
key code in get_wch().
+ extended resize-handling in test/ncurses 'a' menu to the entire
stack of windows created with 'w' commands.
+ improve $COLORFGBG feature by interpreting an out-of-range color
value as an SGR 39 or 49, for foreground/background respectively.
+ correct a typo in configure --enable-colorfgbg option, and move it
to the experimental section (cf: 20011208).
20020601
+ add logic to dump_entry.c to remove function-key definitions that do
not fit into the 1023-byte limit for generated termcaps. This makes
hds200 fit.
+ more improvements to tic's warnings, including logic to ignore
differences between delay values in sgr strings.
+ move definition of KEY_RESIZE into MKkeydefs.sh script, to
accommodate Caps.osf1r5 which introduced a conflicting definition.
20020525
+ add simple resize-handling in test/ncurses.c 'a' menu.
+ fixes in keyname() and _tracechar() to handle negative values.
+ make tic's warnings about mismatches in sgr strings easier to follow.
+ correct tic checks for number of parameters in smgbp and smglp.
+ improve scoansi terminfo entry, and add scoansi-new entry -TD
+ add pcvt25-color terminfo entry -TD
+ add kf13-kf48 strings to cons25w terminfo entry (reported by Stephen
Hurd in newsgroup lucky.freebsd.bugs) -TD
+ add entrypoint _nc_trace_ttymode(), use this to distinguish the
Ottyb and Nttyb members of terminal (aka cur_term), for tracing.
20020523
+ correct and simplify logic for lib_pad.c change in 20020518 (reported
by Mike Castle).
20020518
+ fix lib_pad.c for case of drawing a double-width character which
falls off the left margin of the pad (patch by Kriang Lerdsuwanakij
)
+ modify configure script to work around broken gcc 3.1 "--version"
option, which adds unnecessary trash to the requested information.
+ adjust ifdef's in case SIGWINCH is not defined, e.g., with DJGPP
(reported by Ben Decker ).
20020511
+ implement vid_puts(), vid_attr(), term_attrs() based on the narrow-
character versions as well.
+ implement erasewchar(), killwchar() based on erasechar() and
killchar().
+ modify erasechar() and killchar() to return ERR if the value was
VDISABLE.
+ correct a bug in wresize() in handling subwindows (based on patch by
Roger Gammans , report by Scott Beck
).
+ improve test/tclock.c by making the second-hand update more often
if gettimeofday() is available.
20020429
+ workaround for Solaris sed with MKlib_gen.sh (reported by Andy
Tsouladze ).
20020427
+ correct return-value from getcchar(), making it consistent with
Solaris and Tru64.
+ reorder loops that generate makefile rules for different models vs
subsets so configure --with-termlib works again. This was broken by
logic added to avoid duplicate rules in changes to accommodate cygwin
dll's (reported by George.R.Goffe@seagate.com).
+ update config.guess, config.sub
20020421
+ modify ifdef's in write_entry.c to allow use of symbolic links on
platforms with no hard links, e.g., BeOS.
+ modify a few includes to allow compile with BeOS, which has stdbool.h
with a conflicting definition for 'bool' versus its OS.h definition.
+ amend MKlib_gen.sh to work with gawk, which defines 'func' as an
alias for 'function'.
20020420
+ correct form of prototype for ripoffline().
+ modify MKlib_gen.sh to test that all functions marked as implemented
can be linked.
20020413
+ add manpages: curs_get_wstr.3x, curs_in_wchstr.3x
+ implement wgetn_wstr().
+ implement win_wchnstr().
+ remove redefinition of unget_wch() in lib_gen.c (reported by
Jungshik Shin ).
20020406
+ modified several of the test programs to allow them to compile with
vendor curses implementations, e.g., Solaris, AIX -TD
20020323
+ modified test/configure to allow configuring against ncursesw.
+ change WACS_xxx definition to use address, to work like Tru64 curses.
20020317
+ add 'e' and 'm' toggles to 'a', 'A' tests in ncurses.c to demonstrate
effect of echo/noecho and meta modes.
+ add 'A' test to ncurses.c to demonstrate wget_wch() and related
functions.
+ add manpage: curs_get_wch.3x
+ implement unget_wch().
+ implement wget_wch().
20020310
+ regenerated html manpages.
+ add manpages: curs_in_wch.3x, curs_ins_wch.3x, curs_ins_wstr.3x
+ implement wins_wch().
+ implement win_wch().
+ implement wins_nwstr(), wins_wstr().
20020309
+ add manpages: curs_addwstr.3x, curs_winwstr.3x
+ implement winnwstr(), winwstr().
20020223
+ add manpages: curs_add_wchstr.3x, curs_bkgrnd.3x
+ document wunctrl, key_name.
+ implement key_name().
+ remove const's in lib_box.c incorrectly leftover after splitting off
lib_box_set.c
+ update llib-lncurses, llib-ncursesw, fix configure script related to
these.
20020218
+ remove quotes on "SYNOPSIS" in man/curs_box_set.3x, which resulted
in spurious symlinks on install.
20020216
+ implement whline_set(), wvline_set(), add manpage curs_border_set.
+ add subtest 'b' to 'F' and 'f' in ncurses.c to demonstrate use of
box() and box_set() functions.
+ add subtest 'u' to 'F' in ncurses.c, to demonstrate use of addstr()
given UTF-8 string equivalents of WACS_xxx symbols.
+ minor fixes to several manpages based on groff -ww output.
+ add descriptions of external variables of termcap interface to
the manpage (report by Bruce Evans ).
> patches by Bernhard Rosenkraenzer:
+ correct configure option --with-bool, which was executed as
--with-ospeed.
+ add quotes for parameters of --with-bool and --with-ospeed configure
options.
> patch by Sven Verdoolaege (report by Gerhard Haering
):
+ correct typos in definitions of several wide-character macros:
waddwstr, wgetbkgrnd, mvaddwstr, mvwadd_wchnstr, mvwadd_wchnstr,
mvwaddwstr.
+ pass $(CPPFLAGS) to MKlib_gen.sh, thereby fixing a missing definition
of _XOPEN_SOURCE_EXTENDED, e.g., on Solaris
20020209
+ implement wide-acs characters for UTF-8 locales. When in UTF-8
locale, ignore narrow version of acs. Add 'F' test to test/ncurses.c
to demonstrate.
+ correct prototype in keybound manpage (noted from a Debian mailing
list item).
20020202
+ add several cases to the wscanw() example in testcurs.c, showing the
format.
+ implement a simple vsscanf() fallback function which uses the %n
conversion to help parse the input data (prompted by discussion with
Albert Chin-A-Young).
+ modify mk-1st.awk and test/Makefile.in to add $(LDFLAGS) when making
shared libraries, and to use $(CFLAGS) when linking test programs
(patch by Albert Chin-A-Young).
+ add a call to _nc_keypad() in keypad() to accommodate applications
such as nvi, which use curses for output but not for input (fixes
Debian #131263, cf: 20011215).
+ add entrypoints to resizeterm.c which provide better control over the
process: is_term_resized() and resize_term(). The latter restores
the original design of resizeterm() before KEY_RESIZE was added in
970906. Do this to accommodate 20010922 changes to view.c, but allow
for programs with their own sigwinch handler, such as lynx (reported
by Russell Ruby ).
20020127
+ fix a typo in change to mk-1st.awk, which broke the shared-library
makefile rules (reported by Martin Mokrejs).
20020126
+ update config.guess, config.sub
+ finish changes needed to build dll's on cygwin.
+ fix a typo in mvwchat() macro (reported by Cy ).
+ add configure check for mbstate_t, needed for wide-character
configuration. On some platforms we must include to
define this (reported by Daniel Jacobowitz).
+ incorporate some of the changes needed to build dll's on cygwin.
20020112a
+ workaround for awk did not work with mawk, adjusted shell script.
20020112
+ add Caps.osf1r5, as an example.
+ modify behavior of can_clear_with() so that if an application is
running in a non-bce terminals with default colors enabled, it
returns true, allowing the user to select/paste text without picking
up extraneous trailing blanks (adapted from patch by Daniel
Jacobowitz ).
+ modify generated curses.h to ifdef-out prototypes for extensions if
they are disabled, and to define curses_version() as a string in that
case. This is needed to make the programs such as tic build in that
configuration.
+ modified generated headers.sh to remove a gzip'd version of the
target file if it exists, in case non-gzip'd manpages are installed
into a directory where gzip'd ones exist. In that case, the latter
would be found.
+ corrected a redundant initialization of signal handlers from 20010922
changes.
+ clarified bug-reporting address in terminfo.src (report by John H
DuBois III ).
> several fixes from Robert Joop:
+ do not use "-v" option of awk in MKkey_defs.sh because it does not
work with SunOS nawk.
+ modify definitions for libutf8 in curses.h to avoid redefinition
warnings for mblen
+ quoted references to compiler in shell command in misc/Makefile, in
case it uses multiple tokens.
20011229
+ restore special case from 20010922 changes to omit SA_RESTART when
setting up SIGWINCH handler, which is needed to allow wgetch() to be
interrupted by that signal.
+ updated configure macro CF_WITH_PATHLIST, to omit some double quotes
not needed with autoconf 2.52
+ revert configure script to autoconf 2.13 patched with
autoconf-2.13-19990117.patch.gz (or later)
from
ftp://invisible-island.net/autoconf/
because autoconf 2.52 macro AC_PROG_AWK does not work on HPUX 11.0
(report by David Ellement ). This also fixes a
different problem configuring with Mac OS X (reported by Marc Smith
).
20011222
+ modify include/edit_cfg.h to eliminate BROKEN_LINKER symbol from
term.h
+ move prototype for _nc_vsscanf() into curses.h.in to omit
HAVE_VSSCANF symbol from curses.h, which was dependent upon the
ncurses_cfg.h file which is not installed.
+ use ACS_LEN rather than SIZEOF(acs_map) in trace code of lib_acs.c,
to work with broken linker configuration, e.g., cygwin (report by
Robert Joop ).
+ make napms() call _nc_timed_wait() rather than poll() or select(),
to work around broken implementations of these on cygwin.
20011218
+ drop configure macro CF_WIDEC_SHIFT, since that was rendered obsolete
by Sven Verdoolaege's rewrite of wide-character support. This makes
libncursesw incompatible again, but makes the header files almost the
same as in the narrow-character configuration.
+ simplify definitions that combine wide/narrow versions of bkgd, etc.,
to eliminate differences between the wide/narrow versions of curses.h
+ correct typo in configure macro CF_FUNC_VSSCANF
+ correct location of call to _nc_keypad() from 20011215 changes which
prevented keypad() from being disabled (reported by Lars Hecking).
20011215
+ rewrote ncurses 'a' test to exercise wgetch() and keypad() functions
better, e.g., by adding a 'w' command to create new windows which
may have different keypad() settings.
+ corrected logic of keypad() by adding internal screen state to track
whether the terminal's keypad-mode has been set. Use this in
wgetch() to update the keypad-mode according to whether the
associated window's keypad-mode has been set with keypad(). This
corrects a related problem restoring terminal state after handling
SIGTSTP (reported by Mike Castle).
+ regenerate configure using patch for autoconf 2.52
autoconf-2.52-patch.gz
at
ftp://invisible-island.net/autoconf/
+ update config.guess, config.sub from
http://subversions.gnu.org/cgi-bin/viewcvs/config/config/
+ minor changes to quoting in configure script to allow it to work
with autoconf 2.52
20011208
+ modify final checks in lib_setup.c for line and col values, making
them independent.
+ modify acs_map[] if configure --broken-linker is specified, to make
it use a function rather than an array (prompted by an incorrect
implementation in cygwin package).
+ correct spelling of configure option --enable-colorfgbg, which
happened to work if --with-develop was set (noted in cygwin package
for ncurses).
+ modify ifdef for genericerror() to compile with SUNWspro Sun WorkShop
6 update 1 C++ 5.2 (patch by Sullivan N Beck ).
+ add configure checks to see if ncurses' fallback vsscanf() will
compile either of the special cases for FILE structs, and if not,
force it to the case which simply returns an error (report by
Sullivan N Beck indicates that Solaris 8 with
64-bits does not allow access to FILE's fields).
+ modify ifdef's for c++/cursesw.cc to use the fallback vsscanf() in
the ncurses library if no better substitute for this can be found
in the C++ runtime.
+ modify the build to name dynamic libraries according to the
convention used on OS X and Darwin. Rather than something like
libncurses.dylib.5.2, Darwin would name it libncurses. 5.dylib.
There are a few additional minor fixes, such as setting the library
version and compatibility version numbers (patch by Jason Evans
).
+ use 'sh' to run mkinstalldirs, to work around problems with buggy
versions of 'make' on OS/2 (report by John Polterak ).
+ correct typo in manpage description of curs_set() (Debian #121548).
+ replace the configure script existence-check for mkstemp() by one
that checks if the function works, needed for older glibc and
AmigaOS.
20011201
+ modify script that generates fallbacks.c to compile a temporary
copy of the terminfo source in case the host does not contain all of
the entries requested for fallbacks (request by Greg Roelofs).
+ modify configure script to accommodate systems such as Mac OS X whose
header defines a 'bool' type inconsistent with ncurses,
which normally makes 'bool' consistent with C++. Include
from curses.h to force consistent usage, define a new type
NCURSES_BOOL and related that to the exported 'bool' as either a
typedef or definition, according to whether is present
(based on a bug report for tin 1.5.9 by Aaron Adams ).
20011124
+ added/updated terminfo entries for M$ telnet and KDE konsole -TD
20011117
+ updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries
(Benjamin C W Sittler).
+ add putty terminfo entry -TD
+ if configuring for wide-curses, define _XOPEN_SOURCE_EXTENDED, since
this may not otherwise be defined to make test/view.c compile.
20011110
+ review/correct several missing/generated items in curses.wide, sorted
the lists to make subsequent diff's easier to track.
20011103
+ add manual pages for add_wch(), echo_wchar(), getcchar(),
mvadd_wch(), mvwadd_wch(), setcchar(), wadd_wch() and wecho_wchar().
+ implement wecho_wchar()
+ modify _tracedump() to handle wide-characters by mapping them to '?'
and control-characters to '.', to make the trace file readable. Also
dynamically allocate the buffer used by _tracedump() for formatting
the results.
+ modify T_CALLED/T_RETURN macros to ease balancing call/return lines
in a trace by using curly braces.
+ implement _nc_viscbuf(), for tracing cchar_t arrays.
+ correct trace-calls in setcchar() and getcchar() functions, which
traced the return values but not the entry to each function.
+ correct usage message in test/view.c, which still mentioned -u flag.
20011027
+ modify configure script to allow building with termcap only, or with
fallbacks only. In this case, we do not build tic and toe.
+ add configure --with-termpath option, to override default TERMPATH
value of /etc/termcap:/usr/share/misc/termcap.
+ cosmetic change to tack: make menu descriptions agree with menu
titles.
20011020
+ rewrote limit-checks in wscrl() and associated _nc_scroll_window(),
to ensure that if the parameter of wscrl() is larger than the size of
the scrolling region, then the scrolling region will be cleared
(report by Ben Kohlen ).
+ add trace/varargs.c, using this to trace parameters in lib_printw.c
+ implement _tracecchar_t2() and _tracecchar_t().
+ split-out trace/visbuf.c
+ correct typo in lib_printw.c changes from 20010922 (report by Mike
Castle).
20011013
+ modify run_tic.sh to check if the build is a cross-compile. In that
case, do not use the build's tic to install the terminfo database
(report by Rafael Rodriguez Velilla ).
+ modify mouse click resolution so that mouseinterval(-1) will disable
it, e.g., to handle touchscreens via a slow connection (request by
Byron Stanoszek ).
+ correct mouseinterval() default value shown in curs_mouse.3x
+ remove conflicting definition of mouse_trafo() (reported by Lars
Hecking, using gcc 2.95.3).
20011001
+ simpler fix for signal_name(), to replace the one overlooked in
20010929 (reported by Larry Virden).
20010929
+ add -i option to view.c, to test ncurses' check for non-default
signal handler for SIGINT, etc.
+ add cases for shared-libraries on Darwin/OS X (patch by Rob Braun
).
+ modify tset to restore original I/O modes if an error is encountered.
Also modify to use buffered stderr consistently rather than mixing
with write().
+ change signal_name() function to use if-then-else rather than case
statement, since signal-values aren't really integers (reported by
Larry Virden).
+ add limit checks in wredrawln(), fixing a problem where lynx was
repainting a pad which was much larger than the screen.
20010922
+ fix: PutRange() was counting the second part of a wide character as
part of a run, resulting in a cursor position that was one too far
(patch by Sven Verdoolaege).
+ modify resizeterm() to not queue a KEY_RESIZE if there was no
SIGWINCH, thereby separating the two styles of SIGWINCH handling
in test/view.c
+ simplified lib_tstp.c, modify it to use SA_RESTART flag for SIGWINCH.
+ eliminate several static buffers in the terminfo compiler, using
allocated buffers.
+ modify MKkeyname.awk so that keyname() does not store its result into
a static buffer that is overwritten by the next call.
+ reorganize the output of infocmp -E and -e options to compile cleanly
with gcc -Wwrite-strings warnings.
+ remove redefinition of chgat/wchgat/mvwchgat from curses.wide
20010915
+ add label to test/view.c, showing the name of the last key or signal
that made the screen repaint, to make it clearer when a sigwinch
does this.
+ use ExitProgram() consistently in the test-programs to make it
simpler to test leaks with dmalloc, etc.
+ move hashtab static data out of hashmap.c into SCREEN struct.
+ make NO_LEAK code compile with revised WINDOWLIST structs.
20010908
+ modify tgetent() to check if exit_attribute_mode resets the alternate
character set, and if so, attempt to adjust the copy of the termcap
"me" string which it will return to eliminate that part. In
particular, 'screen' would lose track of line-drawing characters
(report by Frederic L W Meunier <0@pervalidus.net>, analysis by
Michael Schroeder).
20010901
+ specify DOCTYPE in html manpages.
+ add missing macros for several "generated" functions: attr_get(),
attr_off(), attr_on(), attr_set(), chgat(), mvchgat(), mvwchgat() and
mouse_trafo().
+ modify view.c to agree with non-experimental status of ncurses'
sigwinch handler:
+ change the sense of the -r option, making it default to ncurses'
sigwinch handler.
+ add a note explaining what functions are unsafe in a signal
handler.
+ add a -c option, to set color display, for testing.
+ unset $data variable in MKterminfo.sh script, to address potential
infinite loop if shell malfunction (report by Samuel Mikes
, for bash 2.05.0 on a Linux 2.0.36 system).
+ change kbs in mach terminfo entries to ^? (Marcus Brinkmann
).
+ correct logic for COLORFGBG environment variable: if rxvt is compiled
with xpm support, the variable has three fields, making it slightly
incompatible with itself. In either case, the background color is
the last field.
20010825
+ move calls to def_shell_mode() and def_prog_mode() before loop with
callbacks in lib_set_term.c, since the c++ demo otherwise initialized
the tty modes before saving them (patch by John David Anglin
).
+ duplicate logic used to initialize trace in newterm(), in initscr()
to avoid confusing trace of initscr().
+ simplify allocation of WINDOW and WINDOWLIST structs by making the
first a part of the second rather than storing a pointer. This saves
a call to malloc for each window (discussion with Philippe Blain).
+ remove unused variable 'used_ncv' from lib_vidattr.c (Philippe
Blain).
+ modify c++/Makefile.in to accommodate archive programs that are
different for C++ than for C, and add cases for vendor's C++
compilers on Solaris and IRIX (report by Albert Chin-A-Young).
+ correct manpage description of criteria for deciding if the terminal
supports xterm mouse controls.
+ add several configure script options to aid with cross-compiling:
--with-build-cc, --with-build-cflags, --with-build-ldflags, and
--with-build-libs (request by Greg Roelofs).
+ change criteria for deciding if configure is cross-compiling from
host/build mismatch to host/target mismatch (request by Greg Roelofs
).
+ correct logic for infocmp -e and -E options which writes the data for
the ext_Names[] array. This is needed if one constructs a fallback
table for a terminfo entry which uses extended termcap names, e.g.,
AX in a color xterm.
+ fix undefined NCURSES_PATHSEP when configure --disable-database
option is given.
20010811
+ fix for VALID_BOOLEAN() macro when char is not signed.
+ modify 'clean' rule for C++ binding to work with Sun compiler, which
caches additional information in a subdirectory of the objects.
+ added llib-ncursesw.
20010804
+ add Caps.keys example for experimental extended function keys
(adapted from a patch by Ilya Zakharevich).
+ correct parameter types of vidputs() and vidattr() to agree with
header files (report by William P Setzer).
+ fix typos in several man-pages (patch by William P Setzer).
+ remove unneeded ifdef for __GNUG__ in CF_CPP_VSCAN_FUNC configure
macro, which made ncurses C++ binding fail to build with other
C++ compilers such as HPUX 11.x (report by Albert Chin-A-Young).
+ workaround for bug in HPUX 11.x C compiler: add a blank after
NCURSES_EXPORT macro in form.h (report by Albert Chin-A-Young)
+ ignore blank lines in Caps* files in MKkey_defs.sh script (report by
Albert Chin-A-Young).
+ correct definition of key_end in Caps.aix4, which left KEY_END
undefined (report by Albert Chin-A-Young).
+ remove a QNX-specific fallback prototype for vsscanf(), which is
obsolete with QNX RTP.
+ review/fix some of the T() and TR() macro calls, having noticed that
there was no data for delwin() in a trace of dialog because there was
no returnVoid call for wtimeout(). Also, traces in lib_twait.c are
now selected under TRACE_IEVENT rather than TRACE_CALLS.
20010728
+ add a _nc_access() check before opening files listed via $TERMPATH.
+ using modified man2html, regenerate some of the html manpages to fix
broken HREF's where the link was hyphenated.
20010721
+ add some limit/pointer checks to -S option of tputs.
+ updated/expanded Apple_Terminal and Darwin PowerPC terminfo entries
(Benjamin C W Sittler).
+ add a note in curs_termcap.3x regarding a defect in the XSI
description of tgetent (based on a discussion with Urs Jansen
regarding the HPUX 11.x implementation, whose termcap interface is
not compatible with existing termcap programs).
+ modify manhtml rule in dist.mk to preserve copyright notice on the
generated files, as well as to address HTML style issues reported by
tidy and weblint. Regenerated/updated corresponding html files.
+ comment out use of Protected_Character and related rarely used
attributes in ncurses Ada95 test/demo to compile with wide-character
configuration.
20010714
+ implement a simple example in C++ demo to test scanw().
+ corrected stdio function used to implement scanw() in cursesw.cc
+ correct definition of RemAttr() macro from 20010602 changes, which
caused C++ SillyDemo to not show line-drawing characters.
+ modify C++ binding, adding getKey() which can be overridden by user
to substitute functions other than getch() for keyboard processing
of forms and menus (patch by Juergen Pfeifer).
20010707
+ fix some of the trace calls which needed modification to work with
new wide-character structures.
+ modify magic-cookie code in tty_update.c to compile with new
wide-character structures (report by ).
+ ensure that _XOPEN_SOURCE_EXTENDED is defined in curses.priv.h if
compiling for wide-character configuration.
+ make addwnstr() handle non-spacing characters (patch by Sven
Verdoolaege).
20010630
+ add configure check to define _GNU_SOURCE, needed to prop up glibc
header files.
+ split-out include/curses.wide to solve spurious redefinitions caused
by defining _GNU_SOURCE, and move includes for before
to work around misdefinition of ERR in glibc 2.1.3 header
file.
+ extended ospeed change to NetBSD and OpenBSD -TD
+ modify logic in lib_baudrate.c for ospeed, for FreeBSD to make it
work properly for termcap applications (patch by Andrey A Chernov).
20010623
+ correct an overlooked CharOf/UChar instance (reports by Eugene Lee
, Sven Verdoolaege).
+ correct unneeded ifdef for wunctrl() (reported by Sven Verdoolaege)
20010618
+ change overlooked several CharOf/UChar instances.
> several patches from Sven Verdoolaege:
+ correct a typo in wunctrl(), which made it appear that botwc() was
needed (no such function: use btowc()).
+ reimplement wide-character demo in test/view.c, using new functions.
+ implement getcchar(), setcchar(), wadd_wchnstr() and related macros.
+ fix a syntax problem with do/if/while in PUTC macro (curses.priv.h).
20010616
+ add parentheses in macros for malloc in test.priv.h, fixes an
expression in view.c (report by Wolfgang Gutjahr ).
+ add Caps.uwin, as an example.
+ change the way curses.h is generated, making the list of function
key definitions extracted from the Caps file.
+ add #undef's before possible redefinition of ERR and OK in curses.h
+ modify logic in tic, toe, tput and tset which checks for basename of
argv[0] to work properly on systems such as OS/2 which have
case-independent filenames and/or program suffixes, e.g., ".ext".
20010609
+ add a configure check, if --enable-widec is specified, for putwc(),
which may be in libutf8.
+ remove some unnecessary text from curs_extend.3x and
default_colors.3x which caused man-db to make incorrect symbolic
links (Debian #99550).
+ add configure check if cast for _IO_va_list is needed to compile
C++ vscan code (Debian #97945).
> several patches from Sven Verdoolaege:
+ correct code that used non-standard auto-initialization of a struct,
which gcc allows (report by Larry Virden).
+ use putwc() in PUTC() macro.
+ make addstr() work for the special case where the codeset is
non-stateful (eg. UTF-8), as well as stateful codesets.
20010603
+ correct loop expression in NEXT_CHAR macro for lib_addstr.c changes
from 20010602 (report by Mike Castle).
20010602
+ modify mvcur() to avoid emitting newline characters when nonl() mode
is set. Normally this is not a problem since the actual terminal
mode is set to suppress nl/crlf translations, however it is useful to
allow the caller to manipulate the terminal mode to avoid staircasing
effects after spawning a process which writes messages (for lynx
2.8.4) -TD
> several patches from Sven Verdoolaege :
+ remove redundant type-conversion in fifo_push()
+ correct definition of addwstr() macro in curses.h.in
+ remove _nc_utf8_outch()
+ rename most existing uses of CharOf() to UChar(), e.g., where it is
used to prevent sign-extension in ctype macros.
+ change some chtype's to attr_t's where the corresponding variables
are used to manipulate attributes.
+ UpdateAttr() was applied to both attributes (attr_t) and characters
(chtype). Modify macro and calls to it to make these distinct.
+ add CharEq() macro, use in places where wide-character configuration
implementation uses a struct for cchar_t.
+ moved struct ldat into curses.priv.h, to hide implementation details.
+ change CharOf() macro to use it for masking A_CHARTEXT data from
chtype's.
+ add L() macro to curses.priv.h, for long-character literals.
+ replace several assignments from struct ldat entries to chtype or
char values with combinations of CharOf() and AttrOf() macros.
+ add/use intermediate ChAttrOf() and ChCharOf() macros where we know
we are using chtype data.
+ add/use lowlevel attribute manipulation macros AddAttr(), RemAttr()
and SetAttr().
+ add/use SetChar() macro, to change a cchar_t based on a character and
attributes.
+ convert most internal use of chtype to NCURSES_CH_T, to simplify use
of cchar_t for wide-character configuration. Similarly, use ARG_CH_T
where a pointer would be more useful.
+ add stubs for tracing cchar_t values.
+ add/use macro ISBLANK()
+ add/use constructors for cchar_t's: NewChar(), NewChar2().
+ add/use macros CHREF(), CHDEREF(), AttrOfD(), CharOfD() to facilitate
passing cchar_t's by address.
+ add/use PUTC_DATA, PUTC() macros.
+ for wide-character configuration, move the window background data to
the end of the WINDOW struct so that whether _XOPEN_SOURCE_EXTENDED
is defined or not, the offsets in the struct will not change.
+ modify addch() to work with wide-characters.
+ mark several wide-character functions as generated in curses.h.in
+ implement wunctrl(), wadd_wch(), wbkgrndset(), wbkgrnd(),
wborder_set() and waddnwstr().
20010526
+ add experimental --with-caps=XXX option to customize to similar
terminfo database formats such as AIX 4.x
+ add Caps.aix4 as an example.
+ modify Caps to add columns for the the KEY_xxx symbols.
+ modify configure --with-widec to suppress overwrite of libcurses.so
and curses.h
+ add checks to toe.c to avoid being confused by files and directories
where we would expect the reverse, e.g., source-files in the
top-level terminfo levels as is the case for AIX.
20010519
+ add top-level 'depend' rule for the C sources, assuming that the
makedepend program is available. As a side-effect, this makes
the generated sources, as in "make sources" (prompted by a report
by Mike Castle that "make -j" fails because the resulting parallel
processes race to generate ncurses/names.c).
+ modify configure script so that --disable-overwrite option's action
to add a symbolic link for libcurses applies to the static library as
well as the shared library when both are configured (report by Felix
Natter ).
+ add ELKS terminfo entries (Federico Bianchi
)
+ add u6 (CSR) to Eterm (Michael Jennings).
20010512
+ modify test/ncurses.c to work with xterm-256color, which has fewer
color pairs than colors*colors (report by David Ellement
).
20010505
+ corrected screen.xterm-xfree86 entry.
+ update comment in Caps regarding IBM (AIX) function-key definitions.
20010421
+ modify c++/Makefile.in to link with libncurses++w.a when configured
for wide-characters (patch by Sven Verdoolaege).
+ add check in _nc_trace_buf() to refrain from freeing a null pointer.
+ improve CF_PROG_INSTALL macro using CF_DIRNAME.
+ update config.guess, config.sub from autoconf 2.49e (alpha).
20010414
+ add secondary check in tic.c, similar_sgr() to see if the reason
for mismatch was that the individual capabilities used a time-delay
while sgr did not. Used this to cleanup mismatches, e.g., in vt100,
and remove time-delay from Apple_Terminal entries.
+ add Apple_Terminal terminfo entries (Benjamin C W Sittler
).
+ correct definitions of shifted editing keys for xterm-xfree86 -TD
+ fix a bug in test/bs.c from 20010407 (patch by Erik Sigra).
+ prevent relative_move() from doing an overwrite if it detects 8-bit
characters when configured for UTF-8 (reported by Sven Verdoolaege
).
20010407
+ add configure checks for strstream.h vscan function, and similar
stdio-based function which may be used in C++ binding for gcc 3.0
(reports by George Goffe, Lars Hecking, Mike Castle).
+ rewrite parts of configure.in which used changequote(). That feature
is broken in the latest autoconf alphas (e.g., 2.49d).
+ add a missing pathname for ncurses_dll.h, needed when building in
a directory outside the source tree (patch by Sven Verdoolaege
).
> fix 2 bugs in test/bs.c Erik Sigra :
+ no ships were ever placed in the last row or in the last column.
This made the game very easy to win, because you never had to waste
any shots there, but the computer did.
+ the squares around a sunken ship that belonged to the player were not
displayed as already hit by the computer, like it does for the
player.
20010331
+ add some examples of customizing screen's terminfo:
screen.xterm-xfree86, screen.xterm-r6, screen.teraterm -TD
+ modify screen's terminfo entry to match the khome/kend in screen
3.09.08 (Debian #92215).
+ correct a memory leak in forms library (report by Stefan Vogtner
) (patch by Juergen Pfeifer).
20010324
+ change symbols used to guard against repeated includes to begin
consistently with "NCURSES_" rather than a leading underscore. There
are other symbols defined in the header files which begin with a
leading underscore, but they are part of the legacy interface.
+ reorder includes in c++ binding so that rcs identifiers can be
compiled-in.
+ add .cc.ii rule to c++ makefile, to get preprocessor output for
debugging.
+ correct configure script handling of @keyword@ substitutions when the
--with-manpage-renames option is given (cf: 20000715, fixes Debian
#89939).
+ report stack underflow/overflow in tparm() when tic -cv option is
given.
+ remove spurious "%|" operator from xterm-xfree86 terminfo entry,
(reported by Adam Costello , Debian #89222).
20010310
+ cleanup of newdemo.c, fixing some ambiguous expressions noted by gcc
2.95.2, and correcting some conflicting color pair initializations.
+ add missing copyright notice for cursesw.h
+ review, make minor fixes for use of '::' for referring to C-language
interface from C++ binding.
+ modify configure check for g++ library slightly to accommodate
nonstandard version number, e.g., -2.7 (report by Ronald Ho
).
+ add configure check for c++ header, replace hardcoded
ifdef.
+ workaround for pre-release of gcc 3.0 libstdc++, which has dropped
vscan from strstreambuf to follow standard, use wrapper for C vscanf
instead (report by George Goffe and Matt Taggart
, fixes Debian .
20010303
+ modify interface of _nc_get_token() to pass 'silent' parameter to it,
to make quieter loading of /etc/termcap (patch by Todd C Miller).
+ correct a few typos in curs_slk.3x and curs_outopts.3x manpages
(patch by Todd C Miller).
20010224
+ compiler-warning fixes (reported by Nelson Beebe).
20010210
+ modify screen terminfo entry to use new 3.9.8 feature allowing xterm
mouse controls -TD
20010203
+ broaden patterns used to match OS/2 EMX in configure script to cover
variant used in newer config.guess/config.sub
+ remove changequote() calls from configure script, since this feature
is broken in the autoconf 2.49c alpha, maintainers decline to fix.
+ remove macro callPutChar() from tty_update.c, since this is no longer
needed (reported by Philippe Blain).
+ add a null-pointer check in tic.c to handle the case when the input
file is really empty. Modify the next_char() function in comp_scan.c
to allow arbitrarily long lines, and incidentally supply a newline to
files that do not end in a newline. These changes improve tic's
recovery from attempts to read binary files, e.g., its output from
the terminfo database (reported by Bernhard Rosenkraenzer).
20010127
+ revert change to c++/demo.cc from 20001209, which changed definition
of main() apparently to accommodate cygwin linker, but broke the demo
program.
+ workaround for broken egcs 2.91.66 which calls member functions
(i.e., lines() and colors() of NCursesWindow before calling its
constructor. Add calls to initialize() in a few constructors which
did not do this already.
+ use the GNAT preprocessor to make the necessary switch between TRACE
and NO_TRACE configurations (patch by Juergen Pfeifer).
> patches by Bernhard Rosenkraenzer:
+ modify kterm terminfo entry to use SCS sequence to support alternate
character set (it does not work with SI/SO).
+ --with-ospeed=something didn't work. configure.in checked for a
$enableval where it should check for $withval. Also,
ncurses/llib-lncurses still had a hardcoded short.
20010114
+ correction to my merge of Tom Riddle's patch that broke tic in some
conditions (reported by Enoch Wexler ) -TD
20010113
+ modify view.c to test halfdelay(). Like other tests, this recognizes
the 's' and space commands for stopping/starting polled input, shows
a freerunning clock in the header. If given a parameter to 's', that
makes view.c use halfdelay() with that parameter rather than
nodelay().
+ fix to allow compile with the experimental configure option
--disable-hashmap.
+ modify postprocess_termcap() to avoid overwriting key_backspace,
key_left, key_down when processing a non-base entry (report/patch by
Tom Riddle).
+ modify _nc_wrap_entry(), adding option to reallocate the string
table, needed in _nc_merge_entry() when merging termcap entries.
(adapted from report/patch by Tom Riddle ).
+ modify a few configure script macros to keep $CFLAGS used only for
compiler options, preprocessor options in $CPPFLAGS.
20001230
+ correct marker positions in lrtest.c after receiving a sigwinch.
+ fix ifdef's in ncurses.c to build against pre-5.2 for testing.
+ fixes to tclock for resizing behavior, redundant computation (report
and patch by A M Kuchling ).
20001216
+ improved scoansi terminfo entry -TD
+ modify configure script and makefile in Ada95/src to compile a stub
for the trace functions when ncurses does not provide those.
20001209
+ add ncurses_dll.h and related definitions to support generating DLL's
with cygwin (adapted from a patch by Charles Wilson
, changed NCURSES_EXPORT macro to make it
work with 'indent') -TD
20001202
+ correct prototypes for some functions in curs_termcap.3x, matching
termcap.h, which matches X/Open.
> patch by Juergen Pfeifer:
+ a revised version of the Ada enhancements sent in by "H.
Nanosecond", aka Eugene V Melaragno . This
patch includes
- small fixes to the existing ncurses binding
- addition of some more low-level functions to the binding, including
termcap and terminfo functions
- An Ada implementation of the "ncurses" test application originally
written in C.
20001125
+ modify logic in lib_setup.c to allow either lines or columns value
from terminfo to be used if the screen size cannot be determined
dynamically rather than requiring both (patch by Ehud Karni
).
+ add check in lib_tgoto.c's is_termcap() function to reject null or
empty strings (reported by Valentin Nechayev to
freebsd-bugs).
+ add definition from configure script that denotes the path-separator,
which is normally a colon. The path-separator is a semicolon on
OS/2 EMX and similar systems which may use a colon within pathnames.
+ alter logic to set default for --disable-overwrite option to set it
to 'yes' if the --prefix/$prefix value is not /usr/local, thereby
accommodating the most common cause of problems: gcc's nonstandard
search rules. Other locations such as /usr/local/ncurses will
default to overwriting (report by Lars Hecking ).
20001118
+ modify default for --disable-overwrite configure option to disable
if the --prefix or $prefix value is not /usr.
+ add cygwin to systems for which ncurses is installed by default into
/usr rather than /usr/local.
20001111
+ minor optimization in comp_error.c and lib_termname.c, using
strncat() to replace strncpy() (patch by Solar Designer).
+ add a use_terminfo_vars() check for $HOME/.termcap, and check for
geteuid() to use_terminfo_vars() (patch by Solar Designer
).
+ improved cygwin terminfo entry, based on patch by
.
+ modify _nc_write_entry() to allow for the possibility that linking
aliases on a filesystem that ignores case would not succeed because
the source and destination differ only by case, e.g., NCR260VT300WPP0
on cygwin (report by Neil Zanella).
+ fix a typo in the curs_deleteln.3x man page (patch by Bernhard
Rosenkraenzer ).
20001104
+ add configure option --with-ospeed to assist packagers in transition
to 5.3 change to ospeed type.
+ add/use CharOf() macro to suppress sign-extension of char type on
platforms where this is a problem in ctype macros, e.g., Solaris.
+ change trace output to binary format.
+ correct a missing quote adjustment in CF_PATH_SYNTAX autoconf
macro, for OS/2 EMX configuration.
+ rearrange a few configure macros, moving preprocessor options to
$CPPFLAGS (a now-obsolete version of autoconf did not consistently
use $CPPFLAGS in both the compile and preprocessor checks).
+ add a check in relative_move() to guard against buffer overflow in
the overwrite logic.
20001028
+ add message to configure script showing g++ version.
+ resync config.guess, config.sub
+ modify lib_delwin.c, making it return ERR if the window did not exist
(suggested by Neil Zanella).
+ add cases for FreeBSD 3.1 to tdlint and makellib scripts, used this
to test/review ncurses library. (Would use lclint, but it doesn't
work).
+ reorganized knight.c to avoid forward references. Correct screen
updates when backtracking, especially to the first cell. Add F/B/a
commands.
20001021 5.2 release for upload to ftp.gnu.org
+ update generated html files from manpages.
+ modify dist.mk to use edit_man.sh to substitute autoconf'd variables
in html manpages.
+ fix an uninitialized pointer in read_termcap.c (report by Todd C
Miller, from report/patch by Philip Guenther ).
+ correct help-message and array limit in knight.c (patch by Brian
Raiter ).
> patch by Juergen Pfeifer:
+ fix to avoid warning by GNAT-3.13p about use of inconsistent casing
for some identifiers defined in the standard package.
+ cosmetic change to forms/fty_enum.c
20001014
+ correct an off-by-one position in test/railroad.c which could cause
wrapping at the right margin.
+ test/repair some issues with libtool configuration. Make
--disable-echo force libtool --silent. (Libtool does not work for
OS/2 EMX, works partly for SCO - libtool is still very specific to
gcc).
+ change default of --with-manpage-tbl to "no", since for most of the
platforms which do have tbl installed, the system "man" program
understands how to run tbl automatically.
+ minor improvement to force_bar() in comp_parse.c (Bernhard
Rosenkraenzer ).
+ modify lib_tparm.c to use get_space() before writing terminating
null character, both for consistency as well as to ensure that if
save_char() was called immediately before, that the allocated memory
is enough (patch by Sergei Ivanov).
+ add note about termcap ML capability which is duplicated between two
different capabilities: smgl and smglr (reported by Sergei Ivanov
).
+ correct parameter counts in include/Caps for dclk as well as some
printer-specific capabilities: csnm, defc, scs, scsd, smgtp, smglp.
> patch by Johnny C Lam :
+ add support for building with libtool (apparently version 1.3.5,
since old versions do not handle -L../lib), using new configure
option --with-libtool.
+ add configure option --with-manpage-tbl, which causes the manpages to
be preprocessed by tbl(1) prior to installation,
+ add configure option --without-curses-h, which causes the
installation process to install curses.h as ncurses.h and make
appropriate changes to headers and manpages.
20001009
+ correct order of options/parameters in run_tic.in invocation of tic,
which did not work with standard getopt() (reported by Ethan
Butterfield ).
+ correct logic for 'reverse' variable in lib_vidattr.c, which was
setting it true without checking if newmode had A_REVERSE set, e.g.,
using $TERM=ansi on OS/2 EMX (see 20000917).
> patch by Todd C Miller:
+ add a few missing use_terminfo_vars() and fixes up _nc_tgetent().
Previously, _nc_cgetset() would still get called on cp so the
simplest thing is to set cp to NULL if !use_terminfo_vars().
+ added checks for an empty $HOME environment variable.
> patches for OS/2 EMX (Ilya Zakharevich):
+ modify convert_configure.pl to support INSTALL. Change compiler
options in that script to use multithreading, needed for the mouse.
+ modify OS/2 mouse support, retrying as a 2-button mouse if code fails
to set up a 3-button mouse.
+ improve code for OS/2 mouse support, using _nc_timed_wait() to
replace select() call.
20001007
+ change type of ospeed variable back to short to match its use in
legacy applications (reported by Andrey A Chernov).
+ add case to configure script for --enable-rpath on IRIX (patch by
Albert Chin-A-Young).
+ minor fix to position_check() function, to ensure it gets the whole
cursor report before decoding.
+ add configure option --disable-assumed-color, to allow pre-5.1
convention of default colors used for color-pair 0 to be configured
(see assume_default_colors()).
+ rename configure option --enable-hashmap --disable-hashmap, and
reorder the configure options, splitting the experimental and
development
+ add configure option --disable-root-environ, which tells ncurses to
disregard $TERMINFO and similar environment variables if the current
user is root, or running setuid/setgid (based on discussion with
several people).
+ modified misc/run_tic.in to use tic -o, to eliminate dependency on
$TERMINFO variable for installs.
+ add table entry for plab_norm to tput, so it passes in strings
for that capability.
+ modify parse_format() in lib_tparm.c to ignore precision if it is
longer than 10000 (report by Jouko Pynnonen).
+ rewrote limit checks in lib_mvcur.c using new functions
_nc_safe_strcat(), etc. Made other related changes to check lengths
used for strcat/strcpy (report by Jouko Pynnonen
).
20000930
+ modify several descriptions, including those for setaf, setab, in
include/Caps to indicate that the entries are parameterized. This
information is used to tell which strings are translated when
converting to termcap. Fixes a problem where the generated termcap
would contain a spurious "%p1" for the terminfo "%p1%d".
+ modify ld -rpath options (e.g., Linux, and Solaris) to use an
absolute pathname for the build tree's lib directory (prompted by
discussion with Albert Chin-A-Young).
+ modify "make install.man" and "make uninstall.man" to include tack's
man-page.
+ various fixes for install scripts used to support configure --srcdir
and --with-install-prefix (reported by Matthew Clarke
).
+ make configure script checks on variables $GCC and $GXX consistently
compare against 'yes' rather than test if they are nonnull, since
either may be set to the corresponding name of the C or C++ compiler
(report/patch by Albert Chin-A-Young).
20000923
+ modify rs2 capability in xterm-r6 and similar where cursor
save/restore bracketed the sequence for resetting video attributes.
The cursor restore would undo that (report by John Hawkinson
(see NetBSD misc/11052)).
+ using parameter check added to tic, corrected 27 typos in
terminfo.src -TD
+ modify tic to verify that its inputs are really files, in case
someone tries to read a directory (or /dev/zero).
+ add a check for empty buffers returned by fgets() in comp_scan.c
next_char() function, in case tic is run on a non-text file (fixes
a core dump reported by Aaron Campbell ).
+ add to railroad.c some code exercising tgoto(), providing an
alternate form of display if the terminal supports cursor addressing.
+ split-out tgoto() again, this time into new file lib_tgoto.c, and
implement a conventional BSD-style tgoto() which is used if the
capability string does not contain terminfo-style padding or
parameters (requested by Andrey A Chernov).
+ add check to tic which reports capabilities that do not reference
the expected number of parameters.
+ add error checking to infocmp's -v and -m options to ensure that
the option value is indeed a number.
+ some cleanup of logic in _nc_signal_handler() to verify if SIGWINCH
handler is setup. Separated the old/new sigaction data for SIGTSTP
from the other signals.
20000917
+ add S0, E0 extensions to screen's terminfo entry, which is another
way to solve the misconfiguration issue -TD
+ completed special case for tgoto from 20000916
20000916
+ update xterm terminfo entries to match XFree86 xterm patch #146 -TD
+ add Matrix Orbital terminfo entries (from Eric Z Ayers
).
+ add special case to lib_tparm.c to allow 'screen' program to use a
termcap-style parameter "%." to tgoto() for switching character sets.
+ use LN_S substitution in run_tic.in, to work on OS/2 EMX which has
no symbolic links.
+ updated notes in README.emx regarding autoconf patches.
+ replace a lookup table in lib_vidattr.c used to decode no_color_video
with a logic expression (suggested by Philippe Blain).
+ add a/A toggle to ncurses.c 'b' test, which clears/sets alternate
character set attribute from the displayed text.
+ correct inequality in parameter analysis of rewritten lib_tparm.c
which had the effect of ignoring p9 in set_attributes (sgr), breaking
alternate character set (reported by Piotr Majka ).
+ correct ifdef'ing for GCC_PRINTF, GCC_SCANF which would not compile
with Sun WorkShop compilers since these tokens were empty (cf:
20000902, reported by Albert Chin-A-Young).
20000909
+ correct an uninitialized parameter to open_tempfile() in tic.c which
made "tic -I" give an ambiguous error message about tmpnam.
+ add special case in lib_vidattr.c to reset underline and standout for
devices that have no sgr0 defined (patch by Don Lewis
). Note that this will not work for bold
mode, since there is no exit-bold-mode capability.
+ improved patch for Make_Enum_Type (patch by Juergen Pfeifer).
+ modify tparm to disallow arithmetic on strings, analyze the varargs
list to read strings as strings and numbers as numbers.
+ modify tparm's internal function spop() to treat a null pointer as
an empty string.
+ modify tput program so it can be renamed or invoked via a link as
'reset' or 'init', producing the same effect as 'tput reset' or 'tput
init'.
+ add private entrypoint _nc_basename(), use to consolidate related
code in progs, as well as accommodating OS/2 EMX pathnames.
+ remove NCURSES_CONST line from edit_cfg.sh to compensate for its
removal (except via AC_SUBST) from configure.in, making
--enable-const work again (reported by Juergen Pfeifer).
+ regen'd configure to pick up "hpux*" change from 20000902.
20000902
+ modify tset.c to check for transformed "reset" program name, if any.
+ add a check for null pointer in Make_Enum_Type() (reported by Steven
W Orr ).
+ change functions _nc_parse_entry() and postprocess_termcap() to avoid
using strtok(), because it is non-reentrant (reported by Andrey A
Chernov ).
+ remove "hpux10.*" case from CF_SHARED_OPTS configure script macro.
This differed from the "hpux*" case by using reversed symbolic
links, which made the 5.1 version not match the configuration of
5.0 shared libraries (reported by Albert Chin-A-Young).
+ correct a dependency in Ada95/src/Makefile.in which prevented
building with configure --srcdir (patch by H Nanosecond
).
+ modify ifdef's in curses.h.in to avoid warning if GCC_PRINTF or
GCC_SCANF was not previously defined (reported by Pavel Roskin
).
+ add MKncurses_def.sh to generate fallback definitions for
ncurses_cfg.h, to quiet gcc -Wundef warnings, modified ifdef's in
code to consistently use "#if" rather than "#ifdef".
20000826
+ add QNX qansi entries to terminfo -TD
+ add os2 entry to misc/emx.src ().
+ add configure option --with-database to allow specifying a different
terminfo source-file to install. On OS/2 EMX, this defaults to
misc/emx.src
+ change misc/run_tic.sh to derive it from misc/run_tic.in, to simplify
setting .exe extension on OS/2 EMX.
+ add .exe extension in Ada95/gen/Makefile.in,
Ada95/samples/Makefile.in, for OS/2 EMX (reported by
).
+ add configure check for filesystems (such as OS/2 EMX) which do not
distinguish between upper/lowercase filenames, use this to fix tags
rules in makefiles.
+ initialize fds[] array to 0's in _nc_timed_wait(); apparently poll()
only sets the revents members of that array when there is activity
corresponding to the related file (report by Glenn Cooper
, using Purify on Solaris 5.6).
+ change configure script to use AC_CANONICAL_SYSTEM rather than
AC_CANONICAL_HOST, which means that configure --target will set
a default program-prefix.
+ add note on cross-compiling to INSTALL (which does not rely on the
AC_CANONICAL_* macros).
20000819
+ add cases for EMX OS/2 to config.guess, config.sub
+ new version of config.guess, config.sub from lynx 2.8.4dev.7
+ add definitions via transform.h to allow tic and tput to check for
the transformed aliases rather than the original infotocap, etc.
+ simplify transform-expressions in progs/Makefile.in, make the
uninstall rule work for transformed program names.
+ change symbol used by --install-prefix configure option from
INSTALL_PREFIX to DESTDIR (the latter has become common usage
although the name is misleading).
+ modify programs to use curses_version() string to report the version
of ncurses with which they are compiled rather than the
NCURSES_VERSION string. The function returns the patch level in
addition to the major and minor version numbers.
20000812
+ modify CF_MAN_PAGES configure macro to make transformed program names
a parameter to that macro rather than embedding them in the macro.
+ newer config.guess, config.sub (reference version used in lynx
2.8.4dev.7).
+ add configure option --with-default-terminfo-dir=DIR to allow
specifying the default terminfo database directory (request by Albert
Chin-A-Young).
+ minor updates for terminfo.src from FreeBSD termcap change-history.
+ correct notes in README and INSTALL regarding documentation files
that were moved from misc directory to doc (report by Rich Kulawiec
).
+ change most remaining unquoted parameters of 'test' in configure
script to use quotes, for instance fixing a problem in the
--disable-database option (reported by Christian Mondrup
).
+ minor adjustments to work around some of the incompatibilities/bugs
in autoconf 2.29a alpha.
+ add -I/usr/local/include when --with-ncurses option is used in
test/configure script.
+ correct logic in adjust_cancels(), which did not check both
alternatives when reclassifying an extended name between boolean,
number and string, causing an infinite loop in tic.
20000730
+ correct a missing backslash in curses.priv.h
20000729
+ change handling of non_dest_scroll_region in tty_update.c to clear
text after it is shifted in rather than before shifting out. Also
correct row computation (reported by Ruediger Kuhlmann
).
+ add/use new trace function to display chtype values from winch() and
getbkgd().
+ add trace mask TRACE_ATTRS, alter several existing _tracef calls that
trace attribute changes under TRACE_CALLS to use this.
+ modify MKlib_gen.sh so that functions returning chtype will call
returnChar().
+ add returnChar() trace, for functions returning chtype.
+ change indent.pro to line up parenthesis.
20000722
+ fix a heap problem with the c++ binding (report by
, patch by Juergen Pfeifer).
+ minor adjustment to ClrToEOL() to handle an out-of-bounds parameter.
+ modify the check for big-core to force a couple of memory accesses,
which may work as needed for older/less-capable machines (if not,
there's still the explicit configure option).
> fixes based on diff's for Amiga and BeOS found at
http://www.mathematik.uni-karlsruhe.de/~kuhlmann/cross/ncurses/
+ alter definition of NCURSES_CONST to make it non-empty.
+ add amiga-vnc terminfo entry.
+ redefine 'TEXT' in menu.h for AMIGA, since it is reported to have
an (unspecified) symbol conflict.
+ replaced case-statement in _nc_tracebits() for CSIZE with a table to
simplify working around implementations that define random
combinations of the related macros to zero.
+ modify configure test for tcgetattr() to allow for old
implementations, e.g., on BeOS, which only defined it as a macro.
> patches by Bruno Haible:
+ when checking LC_ALL/LC_CTYPE/LANG environment variables for UTF-8
locale, ignore those which are set to an empty value, as per SUSV2.
+ encode 0xFFFD in UTF-8 with 3 bytes, not 2.
+ modify _nc_utf8_outch() to avoid sign-extension when checking for
out-of-range value.
20000715
+ correct manlinks.sed script to avoid using ERE "\+", which is not
understood by older versions of sed (patch by Albert Chin-A-Young).
+ implement configure script options that transform installed program
names, e.g., --program-prefix, including the manpage names and cross
references (patch by Albert Chin-A-Young ).
+ correct several mismatches between manpage filename and ".TH"
directives, renaming dft_fgbg.3x to default_colors.3x and
menu_attribs.3x to menu_attributes.3x (report by Todd C Miller).
+ correct missing includes for in several places, including
the C++ binding. This is not noted by gcc unless we use the
-fno-builtin option (reported by Igor Schein ).
+ modified progs/tset.c and tack/sysdep.c to build with sgttyb
interface if neither termio or termios is available. Tested this
with FreeBSD 2.1.5 (which does have termios - but the sgttyb does
work).
20000708 5.1 release for upload to ftp.gnu.org
+ document configure options in INSTALL.
+ add man-page for ncurses trace functions.
+ correct return value shown in curs_touch.3x for is_linetouched() and
is_wintouched(), in curs_initscr.3x for isendwin(), and in
curs_termattr.3x for has_ic() and has_il().
+ add prototypes for touchline() and touchwin(), adding them to the
list of generated functions.
+ modify fifo_push() to put ERR into the fifo just like other values to
return from wgetch(). It was returning without doing that, making
end-of-file condition incorrectly return a 0 (reported by Todd C
Miller).
+ uncomment CC_SHARED_OPTS for progs and tack (see 971115), since they
are needed for SCO OpenServer.
+ move _nc_disable_period from free_ttype.c to comp_scan.c to appease
dynamic loaders on SCO and IRIX64.
+ add "-a" option to test/ncurses.c to invoke assume_default_colors()
for testing.
+ correct assignment in assume_default_colors() which tells ncurses
whether to use default colors, or the assumed ones (reported by Gary
Funck ).
+ review/correct logic in mk-1st.awk for making symbolic links for
shared libraries, in particular for FreeBSD, etc.
+ regenerate misc/*.def files for OS/2 EMX dll's.
+ correct quoting of values for CC_SHARED_OPTS in aclocal.m4 for
cases openbsd2*, openbsd*, freebsd* and netbsd* (patch by Peter
Wemm) (err in 20000610).
+ minor updates to release notes, as well as adding/updating URLs for
examples cited in announce.html
> several fixes from Philippe Blain :
+ correct placement of ifdef for NCURSES_XNAMES in function
_nc_free_termtype(), fixes a memory leak.
+ add a call to _nc_synchook() to the end of function whline() like
that in wvline() (difference was in 1.9.4).
+ make ClearScreen() a little faster by moving two instances of
UpdateAttr() out of for-loops.
+ simplify ClrBottom() by eliminating the tstLine data, using for-loops
(cf: 960428).
20000701 pre-release
+ change minor version to 1, i.e., ncurses 5.1
+ add experimental configure option --enable-colorfgbg to check for
$COLORTERM variable as set by rxvt/aterm/Eterm.
+ add Eterm terminfo entry (Michael Jennings ).
+ modify manlinks.sed to pick aliases from the SYNOPSIS section, and
several manpages so manlinks.sed can find aliases for creating
symbolic links.
+ add explanation to run_tic.sh regarding extended terminal
capabilities.
+ change message format for edit_cfg.sh, since some people interpret
it as a warning.
+ correct unescaped '$' in sysv5uw7*|unix_sv* rule for CF_SHARED_OPTS
configure macro (report by Thanh Ma ).
+ correct logic in lib_twait.c as used by lib_mouse.c for GPM mouse
support when poll() is used rather than select() (prompted by
discussion with David Allen ).
20000624 pre-release
+ modify TransformLine() to check for cells with different color pairs
that happen to render the same display colors.
+ apply $NCURSES_NO_PADDING to cost-computation in mvcur().
+ improve cost computation in PutRange() by accounting for the use
of parm_right_cursor in mvcur().
+ correct cost computation in EmitRange(), which was not using the
normalized value for cursor_address.
+ newer config.guess, config.sub (reference version used in TIN 1.5.6).
20000617
+ update config.guess, config.sub (reference version used in PCRE 3.2).
+ resync changes to gnathtml against version 1.22, regenerated html
files under doc/html/ada using this (1.22.1.1).
+ regenerated html files under doc/html/man after correcting top and
bottom margin options for man2html in dist.mk
+ minor fixes to test programs ncurses 'i' and testcurs program to make
the subwindow's background color cover the subwindow.
+ modify configure script so AC_MSG_ERROR is temporarily defined to a
warning in AC_PROG_CXX to make it recover from a missing C++ compiler
without requiring user to add --without-cxx option (adapted from
comment by Akim Demaille to autoconf mailing list).
+ modify headers.sh to avoid creating temporary files in the build
directory when installing headers (reported by Sergei Pokrovsky
)
20000610
+ regenerated the html files under doc/html/ada/files and
doc/html/ada/funcs with a slightly-improved gnathtml.
+ add kmous capability to linux terminfo entry to allow it to use
xterm-style events provided by gpm patch by Joerg Schoen.
+ make the configure macro CF_SHARED_OPTS a little smarter by testing
if -fPIC is supported by gcc rather than -fpic. The former option
allows larger symbol tables.
+ update config.guess and config.sub (patches by
Kevin Buettner (for elf64_ia64),
Bernd Kuemmerlen (for MacOS X)).
+ add warning for 'tic -cv' about use of '^?' in terminfo source, which
is an extension.
20000527
+ modify echo() behavior of getch() to match Solaris curses for
carriage return and backspace (reported by Neil Zanella).
+ change _nc_flush() to a function.
+ modify delscreen() to check if the output stream has been closed, and
if so, free the buffer allocated for setbuf (this provides an
ncurses-specific way to avoid a memory leak when repeatedly calling
newterm reported by Chipp C ).
+ correct typo in curs_getch.3x manpage regarding noecho (reported by
David Malone ).
+ add a "make libs" rule.
+ make the Ada95 interface build with configure --enable-widec.
+ if the configure --enable-widec option is given, append 'w' to names
of the generated libraries (e.g., libncursesw.so) to avoid conflict
with existing ncurses libraries.
20000520
+ modify view.c to make a rudimentary viewer of UTF-8 text if ncurses
is configured with the experimental wide-character support.
+ add a simple UTF-8 output driver to the experimental wide-character
support. If any of the environment variables LC_ALL, LC_CTYPE or
LANG contain the string "UTF-8", this driver will be used to
translate the output to UTF-8. This works with XFree86 xterm.
+ modify configure script to allow building shared libraries on BeOS
(from a patch by Valeriy E Ushakov).
+ modify lib_addch.c to allow repeated update to the lower-right
corner, rather than displaying only the first character written until
the cursor is moved. Recent versions of SVr4 curses can update the
lower-right corner, and behave this way (reported by Neil Zanella).
+ add a limit-check in _nc_do_color(), to avoid using invalid color
pair value (report by Brendan O'Dea ).
20000513
+ the tack program knows how to use smcup and rmcup but the "show caps
that can be tested" feature did not reflect this knowledge. Correct
the display in the menu tack/test/edit/c (patch by Daniel Weaver).
+ xterm-16color does allow bold+colors, removed ncv#32 from that
terminfo entry.
20000506
+ correct assignment to SP->_has_sgr_39_49 in lib_dft_fgbg.c, which
broke check for screen's AX capability (reported by Valeriy E Ushakov
).
+ change man2html rule in dist.mk to workaround bug in some
man-programs that ignores locale when rendering hyphenation.
+ change web- and ftp-site to dickey.his.com
20000429
+ move _nc_curr_token from parse_entry.c to comp_scan.c, to work around
problem linking tack on MacOS X DP3.
+ include in lib_napms.c to compile on MacOS X DP3
(reported by Gerben Wierda ).
+ modify lib_vidattr.c to check for ncv fixes when pair-0 is not
default colors.
+ add -d option to ncurses.c, to turn on default-colors for testing.
+ add a check to _nc_makenew() to ensure that newwin() and newpad()
calls do not silently fail by passing too-large limits.
+ add symbol NCURSES_SIZE_T to use rather than explicit 'short' for
internal window and pad sizes. Note that since this is visible in
the WINDOW struct, it would be an ABI change to make this an 'int'
(prompted by a question by Bastian Trompetter
, who attempted to create a 96000-line pad).
20000422
+ add mgterm terminfo entry from NetBSD, minor adjustments to sun-ss5,
aixterm entries -TD
+ modify tack/ansi.c to make it more tolerant of bad ANSI replies. An
example of an illegal ANSI resonse can be found using Microsoft's
Telnet client. A correct display can be found using a VT-4xx
terminal or XFree86 xterm with:
XTerm*VT100*decTerminalID: 450
(patch by Daniel Weaver).
+ modify gdc.c to recognize 'q' for quit, 's' for single-step and ' '
for resume. Add '-n' option to force gdc's standard input to
/dev/null, to both illustrate the use of newterm() for specifying
alternate inputs as well as for testing signal handling.
+ minor fix for configure option --with-manpage-symlinks, for target
directories that contain a period ('.') (reported by Larry Virden).
20000415
+ minor additions to beterm entry (feedback from Rico Tudor) -TD
+ corrections/updates for some IBM terminfo entries -TD
+ modify _nc_screen_wrap() so that when exiting curses mode with
non-default colors, the last line on the screen will be cleared to
the screen's default colors (request by Alexander V Lukyanov).
+ modify ncurses.c 'r' example to set nonl(), allowing control/M to be
read for demonstrating the REQ_NEW_LINE operation (prompted by a
question by Tony L Keith ).
+ modify ncurses.c 'r' example of field_info() to work on Solaris 2.7,
documented extension of ncurses which allows a zero pointer.
+ modify fmt_complex() to avoid buffer overflow in case of excess
recursion, and to recognize "%e%?" as a synonym for else-if, which
means that it will not recur for that special case.
+ add logic to support $TERMCAP variable in case the USE_GETCAP symbol
is defined (patch by Todd C Miller).
+ modify one of the m4 files used to generate the Ada95 sources,
to avoid using the token "symbols" (patch by Juergen Pfeifer).
20000408
+ add terminfo entries bsdos-pc-m, bsdos-pc-mono (Jeffrey C Honig)
+ correct spelling error in terminfo entry name: bq300-rv was given as
bg300-rv in esr's version.
+ modify redrawwin() macro so its parameter is fully parenthesized
(fixes Debian #61088).
+ correct formatting error in dump_entry() which set incorrect column
value when no newline trimming was needed at the end of an entry,
before appending "use=" clauses (cf: 960406).
20000401
+ add configure option --with-manpage-symlinks
+ change unctrl() to render C1 characters (128-159) as ~@, ~A, etc.
+ change makefiles so trace() function is provided only if TRACE is
defined, e.g., in the debug library. Modify related calls to
_tracechar() to use unctrl() instead.
20000325
+ add screen's AX capability (for ECMA SGR 39 and 49) to applicable
terminfo entries, use presence of this as a check for a small
improvement in setting default colors.
+ improve logic in _nc_do_color() implementing assume_default_colors()
by passing in previous color pair info to eliminate redundant call to
set_original_colors(). (Part of this is from a patch by Alexander
V Lukyanov).
+ modify warning in _nc_trans_string() about a possibly too-long string
to do this once only rather than for each character past the
threshold (600). Change interface of _nc_trans_string() to allow
check for buffer overflow.
+ correct use of memset in _nc_read_entry_source() to initialize ENTRY
struct each time before reading new data into it, rather than once
per loop (cf: 990301). This affects multi-entry in-core operations
such as "infocmp -Fa".
20000319
+ remove a spurious pointer increment in _nc_infotocap() changes from
20000311. Add check for '.' in format of number, since that also
is not permitted in termcap.
+ correct typo in rxvt-basic terminfo from temporary change made while
integrating 20000318.
20000318
+ revert part of the vt220 change (request by Todd C Miller).
+ add ansi-* terminfo entries from ESR's version.
+ add -a option to tic and infocmp, which retains commented-out
capabilities during source translation/comparison, e.g., captoinfo
and infotocap.
+ modify cardfile.c to display an empty card if no input data file is
found, fixes a core dump in that case (reported by Bruno Haible).
+ correct bracketing in CF_MATH_LIB configure macro, which gave wrong
result for OS/2 EMX.
+ supply required parameter for _nc_resolve_uses() call in
read_termcap.c, overlooked in 20000311 (reported by Todd C Miller).
> patches by Bruno Haible :
+ fix a compiler warning in fty_enum.c
+ correct LIB_PREFIX expression for DEPS_CURSES in progs, tack
makefiles, which resulted in redundant linking (cf: 20000122).
20000311
+ make ifdef's for BROKEN_LINKER consistent (patch by Todd C Miller).
+ improved tack/README (patch by Daniel Weaver).
+ modify tput.c to ensure that unspecified parameters are passed to
tparm() as 0's.
+ add a few checks in infocmp to guard against buffer overflow when
displaying string capabilities.
+ add check for zero-uses in infocmp's file_comparison() function
before calling _nc_align_termtype(). Otherwise one parameter is
indexed past the end of the uses-array.
+ add an option -q to infocmp to specify the less verbose output,
keeping the existing format as the default, though not retaining the
previous behavior that made the -F option compare each entry to
itself.
+ adapted patch by ESR to make infocmp -F less verbose -TD
(the submitted patch was unusable because it did not compile
properly)
+ modify write_entry.c to ensure that absent or cancelled booleans
are written as FALSE, for consistency with infocmp which now
assumes this. Note that for the small-core configuration, tic
may not produce the same result as before.
+ change some private library interfaces used by infocmp, e.g.,
_nc_resolve_uses().
+ add a check in _nc_infotocap() to ensure that cm-style capabilities
accept only %d codes when converting the format from terminfo to
termcap.
+ modify ENTRY struct to separate the data in 'parent' into the name
and link values (the original idea to merge both into 'parent' was
not good).
+ discard repair_acsc(tterm);
> patch by Juergen Pfeifer:
+ drop support for gnat 3.10
+ move generated documentation and html files under ./doc directory,
adding makefile rules for this to dist.mk
20000304
+ correct conflicting use of tparm() in 20000226 change to tic, which
made it check only one entry at a time.
+ fix errors in ncurses-intro.html and hackguide.html shown by Dave
Raggett's tidy.
+ make the example in ncurses-intro.html do something plausible, and
corrected misleading comment (reported by Neil Zanella).
+ modify pnoutrefresh() to set newscr->_leaveok as wnoutrefresh() does,
to fix a case where the cursor position was not updated as in
Solaris (patch by David Mosberger ).
+ add a limit-check for wresize() to ensure that a subwindow does not
address out of bounds.
+ correct offsets used for subwindows in wresize() (patch by Michael
Andres ).
+ regenerate html'ized manual pages with man2html 3.0.1 (patch by
Juergen Pfeifer). This generated a file with a space in its name,
which I removed.
+ fix a few spelling errors in tack.
+ modify tack/Makefile.in to match linker options of progs/Makefile.in;
otherwise it does not build properly for older HPUX shared library
configurations.
+ add several terminfo entries from esr's "11.0".
20000226
+ make 'tput flash' work properly for xterm by flushing output in
delay_output() when using napms(), and modifying xterm's terminfo to
specify no padding character. Otherwise, xterm's reported baud rate
can mislead ncurses into producing too few padding characters
(Debian #58530).
+ add a check to tic for consistency between sgr and the separate
capabilities such as smso, use this to check/correct several
terminfo entries (Debian #58530).
+ add a check to tic if cvvis is the same as cnorm, adjusted several
terminfo entries to remove the conflict (Debian #58530).
+ correct prototype shown in attr_set()/wattr_set() manpages (fixes
Debian #53962).
+ minor clarification for curs_set() and leaveok() manpages.
+ use mkstemp() for creating temporary file for tic's processing of
$TERMCAP contents (fixes Debian #56465).
+ correct two errors from integrating Alexander's changes: did not
handle the non-bce case properly in can_erase_with() (noted by
Alexander), and left fg/bg uninitialized in the pair-zero case of
_nc_do_color() (reported by Dr Werner Fink and
Ismael Cordeiro ).
20000219
+ store default-color code consistently as C_MASK, even if given as
-1 for convenience (adapted from patches by Alexander V Lukyanov).
> patches by Alexander V Lukyanov:
+ change can_clear_with() macro to accommodate logic for
assume_default_colors(), making most of the FILL_BCE logic
unnecessary. Made can_clear_with() an inline function to make it
simpler to read.
20000212
+ corrected form of recent copyright dates.
+ minor corrections to xterm-xf86-v333 terminfo entry -TD
> patches by Alexander V Lukyanov:
+ reworded dft_fgbg.3x to avoid assuming that the terminal's default
colors are white on black.
+ fix initialization of tstLine so that it is filled with current blank
character in any case. Previously it was possible to have it filled
with old blank. The wrong over-optimization was introduced in 991002
patch. (it is not very critical as the only bad effect is not using
clr_eos for clearing if blank has changed).
20000205
+ minor corrections/updates to several terminfo entries: rxvt-basic,
vt520, vt525, ibm5151, xterm-xf86-v40 -TD
+ modify ifdef's for poll() to allow it to use , thereby
allowing poll() to be used on Linux.
+ add CF_FUNC_POLL macro to check if poll() is able to select from
standard input. If not we will not use it, preferring select()
(adapted from patch by Michael Pakovic ).
+ update CF_SHARED_OPTS macro for SCO Unixware 7.1 to allow building
shared libraries (reported/tested by Thanh ).
+ override $LANGUAGE in build to avoid incorrect ordering of keynames.
+ correct CF_MATH_LIB parameter, must be sin(x), not sqrt(x).
20000122
+ resync CF_CHECK_ERRNO and CF_LIB_PREFIX macros from tin and xterm -TD
+ modify CF_MATH_LIB configure macro to parameterize the test function
used, for reuse in dialog and similar packages.
+ correct tests for file-descriptors in OS/2 EMX mouse support. A
negative value could be used by FD_SET, causing the select() call
to wait indefinitely.
20000115
+ additional fixes for non-bce terminals (handling of delete_character)
to work when assume_default_colors() is not specified.
+ modify warning message from _nc_parse_entry() regarding extended
capability names to print only if tic/infocmp/toe have the -v flag
set, and not at all in ordinary user applications. Otherwise, this
warning would be shown for screen's extended capabilities in programs
that use the termcap interface (reported by Todd C Miller).
+ modify use of _nc_tracing from programs such as tic so their debug
level is not in the same range as values set by trace() function.
+ small panel header cleanup (patch by Juergen Pfeifer).
+ add 'railroad' demo for termcap interface.
+ modify 'tic' to write its usage message to stderr (patch by Todd C
Miller).
20000108
+ add prototype for erase() to curses.h.in, needed to make test
programs build with c++/g++.
+ add .c.i and .c.h suffix rules to generated makefiles, for debugging.
+ correct install rule for tack.1; it assumed that file was in the
current directory (reported by Mike Castle ).
+ modify terminfo/termcap translation to suppress acsc before trying
sgr if the entry would be too large (patch by Todd C Miller).
+ document a special case of incompatiblity between ncurses 4.2 and
5.0, add a section for this in INSTALL.
+ add TRACE_DATABASE flag for trace().
20000101
+ update mach, add mach-color terminfo entries based on Debian diffs
for ncurses 5.0 -TD
+ add entries for xterm-hp, xterm-vt220, xterm-vt52 and xterm-noapp
terminfo entries -TD
+ change OTrs capabilities to rs2 in terminfo.src -TD
+ add obsolete and extended capabilities to 'screen' terminfo -TD
+ corrected conversion from terminfo rs2 to termcap rs (cf: 980704)
+ make conversion to termcap ug (underline glitch) more consistently
applied.
+ fix out-of-scope use of 'personal[]' buffer in 'toe' (this error
was in the original pre-1.9.7 version, when $HOME/.terminfo was
introduced).
+ modify 'toe' to ignore terminfo directories to which it has no
permissions.
+ modify read_termtype(), fixing 'toe', which could dump core when it
found an incomplete entry such as "dumb" because it did not
initialize its buffer for _nc_read_file_entry().
+ use -fPIC rather than -fpic for shared libraries on Linux, not
needed for i386 but some ports (from Debian diffs for 5.0) -TD
+ use explicit VALID_NUMERIC() checks in a few places that had been
overlooked, and add a check to ensure that init_tabs is nonzero,
to avoid divide-by-zero (reported by Todd C Miller).
+ minor fix for CF_ANSI_CC_CHECK configure macro, for HPUX 10.x (from
tin) -TD
19991218
+ reorder tests during mouse initialization to allow for gpm to run in
xterm, or for xterm to be used under OS/2 EMX. Also drop test for
$DISPLAY in favor of kmous=\E[M or $TERM containing "xterm" (report
by Christian Weisgerber ).
+ modify raw() and noraw() to clear/restore IEXTEN flag which affects
stty lnext on systems such as FreeBSD (report by Bruce Evans
, via Jason Evans ).
+ fix a potential (but unlikely) buffer overflow in failed() function
of tset.c (reported by Todd C Miller).
+ add manual-page for ncurses extensions, documented curses_version(),
use_extended_names().
19991211
+ treat as untranslatable to termcap those terminfo strings which
contain non-decimal formatting, e.g., hexadecimal or octal.
+ correct commented-out capabilities that cannot be translated to
termcap, which did not check if a colon must be escaped.
+ correct termcap translation for "%>" and "%+", which did not check
if a colon must be escaped, for instance.
+ use save_string/save_char for _nc_captoinfo() to eliminate fixed
buffer (originally for _nc_infotocap() in 960301 -TD).
+ correct expression used for terminfo equivalent of termcap %B,
adjust regent100 entry which uses this.
+ some cleanup and commenting of ad hoc cases in _nc_infotocap().
+ eliminate a fixed-buffer in tic, used for translating comments.
+ add manpage for infotocap
19991204
+ add kvt and gnome terminfo entries -TD
+ correct translation of "%%" by infotocap, which was emitted as "%".
+ add "obsolete" termcap strings to terminfo.src
+ modify infocmp to default to showing obsolete capabilities rather
than terminfo only.
+ modify write_entry.c so that if extended names (i.e., configure
--enable-tcap-names) are active, then tic will also write "obsolete"
capabilities that are present in the terminfo source.
+ modify tic so that when running as captoinfo or infotocap, it
initializes the output format as in -C and -I options, respectively.
+ improve infocmp and tic -f option by splitting long strings that do
not have if-then-else construct, but do have parameters, e.g., the
initc for xterm-88color.
+ refine MKtermsort.sh slightly by using bool for the *_from_termcap
arrays.
19991127
+ additional fixes for non-bce terminals (handling of clear_screen,
clr_eol, clr_eos, scrolling) to work when assume_default_colors() is
not specified.
+ several small changes to xterm terminfo entries -TD.
+ move logic for _nc_windows in lib_freeall.c inside check for nonnull
SP, since it is part of that struct.
+ remove obsolete shlib-versions, which was unintentionally re-added
in 970927.
+ modify infocmp -e, -E options to ensure that generated fallback.c
type for Booleans agrees with term.h (reported by Eric Norum
).
+ correct configure script's use of $LIB_PREFIX, which did not work
for installing the c++ directory if $libdir did not end with "/lib"
(reported by Huy Le ).
+ modify infocmp so -L and -f options work together.
+ modify the initialization of SP->_color_table[] in start_color() so
that color_content() will return usable values for COLORS greater
than 8.
+ modify ncurses 'd' test in case COLORS is greater than 16, e.g., for
xterm-88color, to limit the displayed/computed colors to 16.
> patch by Juergen Pfeifer:
+ simplify coding of the panel library according to suggestions by
Philippe Blain.
+ improve macro coding for a few macros in curses.priv.h
19991113
+ modify treatment of color pair 0 so that if ncurses is configured
to support default colors, and they are not active, then ncurses
will set that explicitly, not relying on orig_colors or orig_pair.
+ add new extension, assume_default_colors() to provide better control
over the use of default colors.
+ modify test programs to use more-specific ifdef's for existence of
wresize(), resizeterm() and use_default_colors().
+ modify configure script to add specific ifdef's for some functions
that are included when --enable-ext-funcs is in effect, so their
existence can be ifdef'd in the test programs.
+ reorder some configure options, moving those extensions that have
evolved from experimental status into a new section.
+ change configure --enable-tcap-names to enable this by default.
19991106
+ install tack's manpage (reported by Robert Weiner
)
+ correct worm.c's handling of KEY_RESIZE (patch by Frank Heckenbach).
+ modify curses.h.in, undef'ing some symbols to avoid conflict with C++
STL (reported by Matt Gerassimoff )
19991030
+ modify linux terminfo entry to indicate that dim does not mix with
color (reported by Klaus Weide ).
+ correct several typos in terminfo entries related to missing '['
in CSI's -TD
+ fix several compiler warnings in c++ binding (reported by Tim
Mooney for alphaev56-dec-osf4.0f
+ rename parameter of _nc_free_entries() to accommodate lint.
+ correct lint rule for tack, used incorrect list of source files.
+ add case to config.guess, config.sub for Rhapsody.
+ improve configure tests for libg++ and libstdc++ by omitting the
math library (which is missing on Rhapsody), and improved test for
the math library itself (adapted from path by Nelson H. F. Beebe).
+ explicitly initialize to zero several data items which were
implicitly initialized, e.g., cur_term. If not explicitly
initialized, their storage type is C (common), and causes problems
linking on Rhapsody 5.5 using gcc 2.7.2.1 (reported by Nelson H. F.
Beebe).
+ modify Ada95 binding to not include the linker option for Ada
bindings in the Ada headers, but in the Makefiles instead (patch by
Juergen Pfeifer).
19991023 5.0 release for upload to ftp.gnu.org
+ effective with release of 5.0, change NCURSES_VERSION_PATCH to
4-digit year.
+ add function curses_version(), to return ncurses library version
(request by Bob van der Poel).
+ remove rmam, smam from cygwin terminfo entry.
+ modify FreeBSD cons25 terminfo entry to add cnorm and cvvis, as well
as update ncv to indicate that 'dim' conflicts with colors.
+ modify configure script to use symbolic links for FreeBSD shared
libraries by default.
+ correct ranf() function in rain and worm programs to ensure it does
not return 1.0
+ hide the cursor in hanoi.c if it is running automatically.
+ amend lrtest.c to account for optimizations that exploit margin
wrapping.
+ add a simple terminfo demo, dots.c
+ modify SIGINT/SIGQUIT handler to set a flag used in _nc_outch() to
tell it to use write() rather than putc(), since the latter is not
safe in a signal handler according to POSIX.
+ add/use internal macros _nc_flush() and NC_OUTPUT to hide details
of output-file pointer in ncurses library.
+ uncomment CC_SHARED_OPTS (see 971115), since they are needed for SCO
OpenServer.
+ correct CC_SHARED_OPTS for building shared libraries for SCO
OpenServer.
+ remove usleep() from alternatives in napms(), since it may interact
with alarm(), causing a process to be interrupted by SIGALRM (with
advice from Bela Lubkin).
+ modify terminal_interface-curses-forms.ads.m4 to build/work with
GNAT 3.10 (patch by Juergen Pfeifer).
+ remove part of CF_GPP_LIBRARY configure-script macro, which did not
work with gcc 2.7.2.3
+ minor fix to test/tclock.c to avoid beeping more than once per second
+ add 's' and ' ' decoding to test/rain.c
991016 pre-release
+ corrected BeOS code for lib_twait.c, making nodelay() function work.
991009 pre-release
+ correct ncurses' value for cursor-column in PutCharLR(), which was
off-by-one in one case (patch by Ilya Zakharevich).
+ fix some minor errors in position_check() debugging code, found while
using this to validate the PutCharLR() patch.
+ modify firework, lrtest, worm examples to be resizable, and to
recognize 'q' for quit, 's' for single-step and ' ' for resume.
+ restore reverted change to terminal_interface-curses-forms.ads.m4,
add a note on building with gnat 3.10p to Ada95/TODO.
+ add a copy of the standalone configure script for the test-directory
to simplify testing on SCO and Solaris.
991002 pre-release
+ minor fixes for _nc_msec_cost(), color_content(), pair_content(),
_nc_freewin(), ClrBottom() and onscreen_mvcur() (analysis by Philippe
Blain, comments by Alexander V Lukyanov).
+ simplify definition of PANEL and eliminate internal functions
_nc_calculate_obscure(), _nc_free_obscure() and _nc_override(),
(patch by Juergen Pfeifer, analysis by Philippe Blain
)).
+ change renaming of dft_fgbg.3x to use_default_colors.3ncurses in
man_db.renames, since Debian is not concerned with 14-character
filename limitation (Debian bug report by Josip Rodin
).
+ corrected scoansi terminfo entry by testing with scoterm and console.
+ revert change from 990614 to terminal_interface-curses-forms.ads.m4,
since this does not work for gnat 3.10p
+ modify tclock example to be resizable (if ncurses' sigwinch handler
is used), and in color.
+ use $(CC) rather than 'gcc' in MK_SHARED_LIB symbols, used for Linux
shared library rules.
990925 pre-release
+ add newer NetBSD console terminfo entries
+ add amiga-8bit terminfo entry (from Henning 'Faroul' Peters
)
+ remove -lcurses -ltermcap from configure script's check for the gpm
library, since they are not really necessary (a properly configured
gpm library has no dependency on any curses library), and if the
curses library is not installed, this would cause the test to fail.
+ modify tic's -C option so that terminfo "use=" clauses are translated
to "tc=" clauses even when running it as captoinfo.
+ modify CF_STDCPP_LIBRARY configure macro to perform its check only
for GNU C++, since that library conflicts with SGI's libC on IRIX-6.2
+ modify CF_SHARED_OPTS configure macro to support build on NetBSD with
ELF libraries (patch by Bernd Ernesti ).
+ correct a problem in libpanel, where the _nc_top_panel variable was
not set properly when bottom_panel() is called to hide a panel which
is the only one on the stack (report/analysis by Michael Andres
, patch by Juergen Pfeifer).
990918 pre-release
+ add acsc string to HP 70092 terminfo entry (patch by Joerg Wunsch
).
+ add top-level uninstall.data and uninstall.man makefile rules.
+ correct logic of CF_LINK_FUNCS configure script, from BeOS changes so
that hard-links work on Unix again.
+ change default value of cf_cv_builtin_bool to 1 (suggested by
Jeremy Buhler), making it less likely that a conflicting declaration
of bool will be seen when compiling with C++.
990911 pre-release
+ improved configure checks for builtin.h
+ minor changes to C++ binding (remove static initializations, and make
configure-test for parameter initializations) for features not
allowed by vendor's C++ compilers (reported by Martin Mokrejs, this
applies to SGI, though I found SCO has the same characteristics).
+ corrected quoting of ETIP_xxx definitions which support old versions
of g++, e.g., those using -lg++
+ remove 'L' code from safe_sprintf.c, since 'long double' is not
widely portable. safe_sprintf.c is experimental, however, and
exists mainly as a fallback for systems without snprintf (reported
by Martin Mokrejs , for IRIX 6.2)
+ modify definition of _nc_tinfo_fkeys in broken-linker configuration
so that it is not unnecessarily made extern (Jeffrey C Honig).
990904 pre-release
+ move definition for builtin.h in configure tests to specific check
for libg++, since qt uses the same filename incompatibly.
+ correct logic of lib_termcap.c tgetstr function, which did not copy
the result to the buffer parameter. Testing shows Solaris does
update this, though of course tgetent's buffer is untouched (reported
in Peter Edwards in
mpc.lists.freebsd.current newsgroup.
+ corrected beterm terminfo entry, which lists some capabilities which
are not actually provided by the BeOS Terminal.
+ add special logic to replace select() calls on BeOS, whose select()
function works only for sockets.
+ correct missing escape in mkterm.h.awk.in, which caused part
of the copyright noticed to be omitted (reported by Peter
Wemm ).
> several small changes to make the c++ binding and demo work on OS/2
EMX (related to a clean reinstall of EMX):
+ correct library-prefix for c++ binding; none is needed.
+ add $x suffix to make_hash and make_keys so 'make distclean' works.
+ correct missing $x suffix for tack, c++ demo executables.
+ split CF_CXX_LIBRARY into CF_GPP_LIBRARY (for -lg++) and
CF_STDCPP_LIBRARY (for -lstdc++)
990828 pre-release
+ add cygwin terminfo entry -TD
+ modify CF_PROG_EXT configure macro to set .exe extension for cygwin.
+ add configure option --without-cxx-binding, modifying the existing
--without-cxx option to check only for the C++ compiler
characteristics. Whether or not the C++ binding is needed, the
configure script checks for the size/type of bool, to make ncurses
match. Otherwise C++ applications cannot use ncurses.
990821 pre-release
+ updated configure macros CF_MAKEFLAGS, CF_CHECK_ERRNO
+ minor corrections to beterm terminfo entry.
+ modify lib_setup.c to reject values of $TERM which have a '/' in
them.
+ add ifdef's to guard against CS5, CS6, CS7, CS8 being zero, as more
than one is on BeOS. That would break a switch statement.
+ add configure macro CF_LINK_FUNCS to detect and work around BeOS's
nonfunctional link().
+ improved configure macros CF_BOOL_DECL and CF_BOOL_SIZE to detect
BeOS's bool, which is declared as an unsigned char.
990814 pre-release
+ add ms-vt100 terminfo entry -TD
+ minor fixes for misc/emx.src, based on testing with tack.
+ minor fix for test/ncurses.c, test 'a', in case ncv is not set.
990731 pre-release
+ minor correction for 'screen' terminfo entry.
+ clarify description of errret values for setupterm in manpage.
+ modify tput to allow it to emit capabilities for hardcopy terminals
(patch by Goran Uddeborg