Update to ncurses-6.0
Change-Id: I98ab2ea8a5e13cca9f8b7cf6277b9b14a4da4299
diff --git a/Ada95/gen/Makefile.in b/Ada95/gen/Makefile.in
index b7e3bec..48df318 100644
--- a/Ada95/gen/Makefile.in
+++ b/Ada95/gen/Makefile.in
@@ -1,5 +1,5 @@
##############################################################################
-# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. #
+# Copyright (c) 1998-2014,2015 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"), #
@@ -28,14 +28,15 @@
#
# Author: Juergen Pfeifer, 1996
#
-# $Id: Makefile.in,v 1.61 2008/10/04 22:58:31 tom Exp $
+# $Id: Makefile.in,v 1.85 2015/08/05 23:06:31 tom Exp $
#
.SUFFIXES:
-SHELL = /bin/sh
+SHELL = @SHELL@
+VPATH = @srcdir@
THIS = Makefile
-x = @PROG_EXT@
+x = @EXEEXT@
top_srcdir = @top_srcdir@
DESTDIR = @DESTDIR@
@@ -43,9 +44,7 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
-
-ADA_INCLUDE = $(DESTDIR)@ADA_INCLUDE@
-ADA_OBJECTS = $(DESTDIR)@ADA_OBJECTS@
+includedir = @includedir@
INSTALL = @INSTALL@
INSTALL_PROG = @INSTALL_PROGRAM@
@@ -56,12 +55,15 @@
CC = @CC@
HOST_CC = @BUILD_CC@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @ACPPFLAGS@ \
+CFLAGS = @CFLAGS@
+HOST_CFLAGS = @BUILD_CFLAGS@
+
+CPPFLAGS = @CPPFLAGS@
+HOST_CPPFLAGS = @ACPPFLAGS@ @BUILD_CPPFLAGS@ \
-DHAVE_CONFIG_H -I$(srcdir)
-CCFLAGS = $(CPPFLAGS) $(CFLAGS)
+CCFLAGS = $(HOST_CPPFLAGS) $(HOST_CFLAGS)
CFLAGS_NORMAL = $(CCFLAGS)
CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
CFLAGS_PROFILE = $(CCFLAGS) -pg
@@ -74,20 +76,32 @@
LOCAL_LIBDIR = @top_builddir@/lib
LINK = $(HOST_CC)
-LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_ARGS2@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+
+# For the wide-character configuration combined with broken_linker, we need
+# addresses of ACS_xxx constants, which requires linking with the newly built
+# ncurses library. If cross-compiling, the developer has to fill in a workable
+# native library for this purpose.
+NATIVE_LDFLAGS = @LD_MODEL@ $(LOCAL_LIBS) @TINFO_LDFLAGS2@ $(LDFLAGS) @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) @TINFO_LIBS@
+CROSS_LDFLAGS = @BUILD_LDFLAGS@ @BUILD_LIBS@
+
+ACTUAL_LDFLAGS = @ADAGEN_LDFLAGS@
RANLIB = @RANLIB@
M4 = m4
M4FLAGS = -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@
-ADACURSES_CONFIG = adacurses-config
+ADACURSES_CONFIG = adacurses@USE_CFG_SUFFIX@-config
-WRAPPER = sh $(top_srcdir)/misc/shlib
-GENERATE = ./gen$x '@DFT_ARG_SUFFIX@'
+WRAPPER = @NCURSES_SHLIB2@
+
+PROG_GENERATE = ./generate$x
+GENERATE = $(PROG_GENERATE) '@DFT_ARG_SUFFIX@'
DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d'
-GNATHTML = `type -p gnathtml || type -p gnathtml.pl`
+GNATHTML = `type -p gnathtml || type -p gnathtml.pl 2>/dev/null`
GNATHP = www.gnat.com
################################################################################
@@ -96,39 +110,6 @@
ADA_SRCDIR = ../src
-GEN_FILES0 = Base_Defs
-
-GEN_FILES1 = ACS_Map \
- AC_Rep \
- Base_Defs \
- Character_Attribute_Set_Rep \
- Color_Defs \
- Key_Definitions \
- Linker_Options \
- Old_Keys \
- Public_Variables \
- Trace_Defs \
- Version_Info \
- Window_Offsets
-
-GEN_FILES2 = Menu_Opt_Rep \
- Menu_Base_Defs \
- Menu_Linker_Options \
- Item_Rep
-
-GEN_FILES3 = Form_Opt_Rep \
- Form_Base_Defs \
- Form_Linker_Options \
- Field_Rep
-
-GEN_FILES4 = Mouse_Base_Defs \
- Mouse_Event_Rep \
- Mouse_Events \
- Panel_Linker_Options
-
-GEN_FILES5 = Chtype_Def \
- Eti_Defs
-
GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \
$(ADA_SRCDIR)/$(ABASE).adb \
$(ADA_SRCDIR)/$(ABASE)-aux.ads \
@@ -142,7 +123,8 @@
$(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads \
$(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads \
$(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads \
- $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads
+ $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads \
+ $(ADA_SRCDIR)/$(ABASE)_constants.ads
GEN_SRC = $(srcdir)/$(ABASE).ads.m4 \
$(srcdir)/$(ABASE).adb.m4 \
@@ -166,166 +148,64 @@
sources:
-$(ADA_INCLUDE) \
-$(ADA_OBJECTS) :
- sh $(top_srcdir)/mkdirs.sh $@
+$(DESTDIR)$(bindir) :
+ mkdir -p $@
install \
-install.libs :: $(ADA_INCLUDE)
- @echo installing package $(ALIB) in $(ADA_INCLUDE)
- @$(top_srcdir)/tar-copy.sh '$(ALIB)*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE)
- @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(ADA_SRCDIR) $(ADA_INCLUDE)
- @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)*.ad?' $(srcdir)/../src $(ADA_INCLUDE)
- @test $(srcdir) != ./ && $(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ad?' $(srcdir)/../src $(ADA_INCLUDE)
-
-install \
-install.libs :: $(ADA_OBJECTS)
- @echo installing package $(ALIB) in $(ADA_OBJECTS)
- @-chmod a-wx $(ADA_SRCDIR)/*.ali
- @$(top_srcdir)/tar-copy.sh '$(ALIB)*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS)
- @$(top_srcdir)/tar-copy.sh '$(ALIB)[-.]*.ali' $(ADA_SRCDIR) $(ADA_OBJECTS)
- @-chmod u+x $(ADA_SRCDIR)/*.ali
-
-install \
-install.libs :: $(DESTDIR)$(bindir) adacurses-config
- $(INSTALL_PROG) adacurses-config $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
-
-uninstall \
-uninstall.libs ::
- @echo removing package $(ALIB) from $(ADA_INCLUDE)
- -@cd $(ADA_INCLUDE) && rm -f $(ALIB)[-.]*
-
-uninstall \
-uninstall.libs ::
- @echo removing package $(ALIB) from $(ADA_OBJECTS)
- -@cd $(ADA_OBJECTS) && rm -f $(ALIB)[-.]*
+install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
+ $(INSTALL_PROG) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
uninstall \
uninstall.libs ::
-rm -f $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
-gen$x: gen.o
- @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@
+$(PROG_GENERATE): gen.o
+ @ECHO_LD@ $(LINK) $(CFLAGS_NORMAL) gen.o $(ACTUAL_LDFLAGS) -o $@
gen.o: $(srcdir)/gen.c
$(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
-################################################################################
-Character_Attribute_Set_Rep: gen$x
- $(WRAPPER) "$(GENERATE) B A" >$@
-Base_Defs: gen$x
- $(WRAPPER) "$(GENERATE) B B" >$@
-
-Color_Defs: gen$x
- $(WRAPPER) "$(GENERATE) B C" >$@
-
-Window_Offsets: gen$x
- $(WRAPPER) "$(GENERATE) B D" >$@
-
-Key_Definitions: gen$x
- $(WRAPPER) "$(GENERATE) B K" >$@
-
-Linker_Options: gen$x
- $(WRAPPER) "$(GENERATE) B L" >$@
-
-ACS_Map: gen$x
- $(WRAPPER) "$(GENERATE) B M" >$@
-
-Old_Keys: gen$x
- $(WRAPPER) "$(GENERATE) B O" >$@
-
-Public_Variables: gen$x
- $(WRAPPER) "$(GENERATE) B P" >$@
-
-AC_Rep: gen$x
- $(WRAPPER) "$(GENERATE) B R" >$@
-
-Version_Info: gen$x
- $(WRAPPER) "$(GENERATE) B V" >$@
-
-Trace_Defs: gen$x
- $(WRAPPER) "$(GENERATE) B T" >$@
-################################################################################
-Menu_Opt_Rep: gen$x
- $(WRAPPER) "$(GENERATE) M R" >$@
-
-Menu_Base_Defs: gen$x
- $(WRAPPER) "$(GENERATE) M B" >$@
-
-Menu_Linker_Options: gen$x
- $(WRAPPER) "$(GENERATE) M L" >$@
-
-Item_Rep: gen$x
- $(WRAPPER) "$(GENERATE) M I" >$@
-################################################################################
-Form_Opt_Rep: gen$x
- $(WRAPPER) "$(GENERATE) F R" >$@
-
-Form_Base_Defs: gen$x
- $(WRAPPER) "$(GENERATE) F B" >$@
-
-Form_Linker_Options: gen$x
- $(WRAPPER) "$(GENERATE) F L" >$@
-
-Field_Rep: gen$x
- $(WRAPPER) "$(GENERATE) F I" >$@
-################################################################################
-Mouse_Base_Defs: gen$x
- $(WRAPPER) "$(GENERATE) P B" >$@
-
-Mouse_Event_Rep: gen$x
- $(WRAPPER) "$(GENERATE) P M" >$@
-
-Mouse_Events: gen$x
- $(WRAPPER) "$(GENERATE) B E" >$@
-
-Panel_Linker_Options: gen$x
- $(WRAPPER) "$(GENERATE) P L" >$@
-
-Chtype_Def: gen$x
- $(WRAPPER) "$(GENERATE) E C" >$@
-
-Eti_Defs: gen$x
- $(WRAPPER) "$(GENERATE) E E" >$@
+$(ADA_SRCDIR)/$(ABASE)_constants.ads: $(PROG_GENERATE)
+ $(WRAPPER) "$(GENERATE)" >$@
################################################################################
$(ADA_SRCDIR)/$(ABASE).ads: $(srcdir)/$(ABASE).ads.m4 \
- $(GEN_FILES1) $(srcdir)/normal.m4
+ $(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE).ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE).adb: $(srcdir)/$(ABASE).adb.m4 \
- $(GEN_FILES1) $(srcdir)/normal.m4
+ $(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE).adb.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-aux.ads: $(srcdir)/$(ABASE)-aux.ads.m4 \
- $(GEN_FILES5) $(srcdir)/normal.m4
+ $(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-aux.ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-trace.ads: $(srcdir)/$(ABASE)-trace.ads.m4 \
- $(GEN_FILES5) $(srcdir)/normal.m4
+ $(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-trace.ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \
- $(GEN_FILES2) $(srcdir)/normal.m4
+ $(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-menus.ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \
- $(GEN_FILES3) $(srcdir)/normal.m4
+ $(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-forms.ads.m4 |\
$(DEL_ADAMODE) >$@
$(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \
- $(GEN_FILES4) $(srcdir)/normal.m4
+ $(srcdir)/normal.m4
$(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
$(srcdir)/$(ABASE)-mouse.ads.m4 |\
$(DEL_ADAMODE) >$@
@@ -387,23 +267,18 @@
@MAKE_UPPER_TAGS@ etags *.[ch]
mostlyclean ::
- -rm -f a.out core gen$x *.o
- -rm -f $(GEN_FILES1)
- -rm -f $(GEN_FILES2)
- -rm -f $(GEN_FILES3)
- -rm -f $(GEN_FILES4)
- -rm -f $(GEN_FILES5)
+ -rm -f a.out core $(PROG_GENERATE) *.o
clean :: mostlyclean
-rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
distclean :: clean
- -rm -f adacurses-config
+ -rm -f $(ADACURSES_CONFIG)
-rm -f Makefile
realclean :: distclean
-HTML_DIR = ../../doc/html/ada
+HTML_DIR = @ADAHTML_DIR@
instab.tmp : table.m4 $(GEN_SRC)
@rm -f $@
@@ -431,10 +306,12 @@
@rm -f instab.tmp
adahtml:
+ test -n "$(GNATHTML)" || exit 1
@find $(HTML_DIR) -type f -exec rm -f {} \;
@mkdir -p $(HTML_DIR)
cp -p ../src/*.ad[sb] . && chmod +w *.ad[sb]
- ln -sf ../src/*.ali .
+@USE_OLD_MAKERULES@ ln -sf ../src/*.ali .
+@USE_GNAT_PROJECTS@ ln -sf ../static-ali/*.ali .
@echo "Filtering generated files"
@for f in $(GEN_SRC); do \
h=`basename $$f` ;\
diff --git a/Ada95/gen/adacurses-config b/Ada95/gen/adacurses-config
deleted file mode 100644
index b7e9a0e..0000000
--- a/Ada95/gen/adacurses-config
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh
-# $Id: adacurses-config.in,v 1.2 2007/04/07 21:06:50 tom Exp $
-#
-# This script will return the option to add to `gnatmake' for using
-# AdaCurses.
-#
-
-prefix="/usr/local"
-exec_prefix="${prefix}"
-libdir="${exec_prefix}/lib"
-
-VERSION="5.7.20081102"
-
-CFLAGS="-I$libdir/adacurses -L$libdir/adacurses"
-LIBS="-L$prefix/lib -lAdaCurses"
-
-case "x$1" in
- x--version)
- echo AdaCurses $VERSION
- ;;
- x--cflags)
- echo $CFLAGS
- ;;
- x--libs)
- echo $LIBS
- ;;
- x)
- # if no parameter is given, give what gnatmake needs
- echo $CFLAGS -largs $LIBS
- ;;
- *)
- echo 'Usage: adacurses-config [--version | --cflags | --libs]' >&2
- exit 1
- ;;
-esac
diff --git a/Ada95/gen/adacurses-config.in b/Ada95/gen/adacurses-config.in
index c88d85b..e29c309 100644
--- a/Ada95/gen/adacurses-config.in
+++ b/Ada95/gen/adacurses-config.in
@@ -1,35 +1,81 @@
#! /bin/sh
-# $Id: adacurses-config.in,v 1.2 2007/04/07 21:06:50 tom Exp $
+# $Id: adacurses-config.in,v 1.9 2014/06/07 19:32:22 Pascal.Pignard Exp $
+##############################################################################
+# Copyright (c) 2007-2010,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. #
+##############################################################################
#
-# This script will return the option to add to `gnatmake' for using
-# AdaCurses.
-#
+# This script returns the options to add to `gnatmake' for using AdaCurses.
-prefix="@prefix@"
-exec_prefix="@exec_prefix@"
-libdir="@libdir@"
+DESTDIR=@DESTDIR@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
-VERSION="@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
+ADA_INCLUDE=@ADA_INCLUDE@
+ADA_OBJECTS=@ADA_OBJECTS@
-CFLAGS="-I$libdir/adacurses -L$libdir/adacurses"
-LIBS="-L$prefix/lib -lAdaCurses"
+VERSION=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
+
+CFLAGS="-aI$ADA_INCLUDE -aO$ADA_OBJECTS"
+LIBS="-L$ADA_OBJECTS -lAdaCurses"
+
+THIS="adacurses"
case "x$1" in
- x--version)
- echo AdaCurses $VERSION
- ;;
- x--cflags)
- echo $CFLAGS
- ;;
- x--libs)
- echo $LIBS
- ;;
- x)
- # if no parameter is given, give what gnatmake needs
- echo $CFLAGS -largs $LIBS
- ;;
- *)
- echo 'Usage: adacurses-config [--version | --cflags | --libs]' >&2
- exit 1
- ;;
+ x--version)
+ echo AdaCurses $VERSION
+ ;;
+ x--cflags)
+ echo $CFLAGS
+ ;;
+ x--libs)
+ echo $LIBS
+ ;;
+ x)
+ # if no parameter is given, give what gnatmake needs
+ echo "$CFLAGS -largs $LIBS"
+ ;;
+ x--help)
+ cat <<ENDHELP
+Usage: ${THIS}-config [options]
+
+Options:
+ --cflags echos the gnat (Ada compiler) flags needed to compile with ${THIS}
+ --libs echos the gnat libraries needed to link with ${THIS}
+
+ --version echos the release+patchdate version of ${THIS}
+
+ --help prints this message
+
+If no options are given, echos the full set of flags needed by gnatmake.
+ENDHELP
+ ;;
+ *)
+ echo 'Usage: adacurses@DFT_ARG_SUFFIX@-config [--version | --cflags | --libs]' >&2
+ exit 1
+ ;;
esac
diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c
index d8ea44f..4e986a4 100644
--- a/Ada95/gen/gen.c
+++ b/Ada95/gen/gen.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998,2007,2008 Free Software Foundation, Inc. *
+ * 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 *
@@ -32,1492 +32,503 @@
/*
Version Control
- $Id: gen.c,v 1.49 2008/10/04 21:59:37 tom Exp $
+ $Id: gen.c,v 1.69 2014/05/31 21:00:08 tom Exp $
--------------------------------------------------------------------------*/
/*
- This program generates various record structures and constants from the
- ncurses header file for the Ada95 packages. Essentially it produces
- Ada95 source on stdout, which is then merged using m4 into a template
- to produce the real source.
- */
+ This program prints on its standard output the source for the
+ Terminal_Interface.Curses_Constants Ada package specification. This pure
+ package only exports C constants to the Ada compiler.
+ */
+#ifdef HAVE_CONFIG_H
#include <ncurses_cfg.h>
+#else
+#include <ncurses.h>
+#endif
#include <stdlib.h>
-#include <stddef.h>
#include <string.h>
-#include <assert.h>
-#include <ctype.h>
#include <menu.h>
#include <form.h>
-#define RES_NAME "Reserved"
+#undef UCHAR
+#undef UINT
-static const char *model = "";
-static int little_endian = 0;
+typedef unsigned char UCHAR;
+typedef unsigned int UINT;
-typedef struct
- {
- const char *name;
- unsigned long attr;
- }
-name_attribute_pair;
+/* These global variables will be set by main () */
+static int little_endian;
+static const char *my_program_invocation_name = NULL;
-static int
-find_pos(char *s, unsigned len, int *low, int *high)
+static void
+my_error(const char *message)
{
- unsigned int i, j;
- int l = 0;
+ fprintf(stderr, "%s: %s\n", my_program_invocation_name, message);
+ exit(EXIT_FAILURE);
+}
- *high = -1;
- *low = 8 * len;
+static void
+print_constant(const char *name,
+ long value)
+{
+ printf(" %-28s : constant := %ld;\n", name, value);
+}
- for (i = 0; i < len; i++, s++)
- {
- if (*s)
- {
- for (j = 0; j < 8 * sizeof(char); j++)
+#define PRINT_NAMED_CONSTANT(name) \
+ print_constant (#name, name)
- {
- if (((little_endian && ((*s) & 0x01)) ||
- (!little_endian && ((*s) & 0x80))))
- {
- if (l > *high)
- *high = l;
- if (l < *low)
- *low = l;
- }
- l++;
- if (little_endian)
- *s >>= 1;
- else
- *s <<= 1;
- }
- }
- else
- l += 8;
- }
- return (*high >= 0 && (*low <= *high)) ? *low : -1;
+static void
+print_comment(const char *message)
+{
+ printf("\n -- %s\n\n", message);
}
/*
- * This helper routine generates a representation clause for a
- * record type defined in the binding.
- * We are only dealing with record types which are of 32 or 16
- * bit size, i.e. they fit into an (u)int or a (u)short.
+ * Make sure that KEY_MIN and KEY_MAX are defined.
+ * main () will protest if KEY_MIN == 256
*/
-static void
- gen_reps
- (const name_attribute_pair * nap, /* array of name_attribute_pair records */
- const char *name, /* name of the represented record type */
- int len, /* size of the record in bytes */
- int bias)
-{
- int i, n, l, cnt = 0, low, high;
- int width = strlen(RES_NAME) + 3;
- unsigned long a;
- unsigned long mask = 0;
-
- assert(nap != NULL);
-
- for (i = 0; nap[i].name != (char *)0; i++)
- {
- cnt++;
- l = strlen(nap[i].name);
- if (l > width)
- width = l;
- }
- assert(width > 0);
-
- printf(" type %s is\n", name);
- printf(" record\n");
- for (i = 0; nap[i].name != (char *)0; i++)
- {
- printf(" %-*s : Boolean;\n", width, nap[i].name);
- }
- printf(" end record;\n");
- printf(" pragma Convention (C, %s);\n\n", name);
-
- printf(" for %s use\n", name);
- printf(" record\n");
-
- for (i = 0; nap[i].name != (char *)0; i++)
- {
- a = nap[i].attr;
- mask |= a;
- l = find_pos((char *)&a, sizeof(a), &low, &high);
- if (l >= 0)
- printf(" %-*s at 0 range %2d .. %2d;\n", width, nap[i].name,
- low - bias, high - bias);
- }
- i = 1;
- n = cnt;
- printf(" end record;\n");
- printf(" for %s'Size use %d;\n", name, 8 * len);
- printf(" -- Please note: this rep. clause is generated and may be\n");
- printf(" -- different on your system.");
-}
-
-static void
-chtype_rep(const char *name, attr_t mask)
-{
- attr_t x = -1;
- attr_t t = x & mask;
- int low, high;
- int l = find_pos((char *)&t, sizeof(t), &low, &high);
-
- if (l >= 0)
- printf(" %-5s at 0 range %2d .. %2d;\n", name, low, high);
-}
-
-static void
-gen_chtype_rep(const char *name)
-{
- printf(" for %s use\n record\n", name);
- chtype_rep("Ch", A_CHARTEXT);
- chtype_rep("Color", A_COLOR);
- chtype_rep("Attr", (A_ATTRIBUTES & ~A_COLOR));
- printf(" end record;\n for %s'Size use %ld;\n",
- name, (long)(8 * sizeof(chtype)));
-
- printf(" -- Please note: this rep. clause is generated and may be\n");
- printf(" -- different on your system.\n");
-}
-
-static void
-mrep_rep(const char *name, void *rec)
-{
- int low, high;
- int l = find_pos((char *)rec, sizeof(MEVENT), &low, &high);
-
- if (l >= 0)
- printf(" %-7s at 0 range %3d .. %3d;\n", name, low, high);
-}
-
-static void
-gen_mrep_rep(const char *name)
-{
- MEVENT x;
-
- printf(" for %s use\n record\n", name);
-
- memset(&x, 0, sizeof(x));
- x.id = -1;
- mrep_rep("Id", &x);
-
- memset(&x, 0, sizeof(x));
- x.x = -1;
- mrep_rep("X", &x);
-
- memset(&x, 0, sizeof(x));
- x.y = -1;
- mrep_rep("Y", &x);
-
- memset(&x, 0, sizeof(x));
- x.z = -1;
- mrep_rep("Z", &x);
-
- memset(&x, 0, sizeof(x));
- x.bstate = -1;
- mrep_rep("Bstate", &x);
-
- printf(" end record;\n");
- printf(" -- Please note: this rep. clause is generated and may be\n");
- printf(" -- different on your system.\n");
-}
-
-static void
-gen_attr_set(const char *name)
-{
- /* All of the A_xxx symbols are defined in ncurses, but not all are nonzero
- * if "configure --enable-widec" is specified.
- */
- static const name_attribute_pair nap[] =
- {
-#if A_STANDOUT
- {"Stand_Out", A_STANDOUT},
-#endif
-#if A_UNDERLINE
- {"Under_Line", A_UNDERLINE},
-#endif
-#if A_REVERSE
- {"Reverse_Video", A_REVERSE},
-#endif
-#if A_BLINK
- {"Blink", A_BLINK},
-#endif
-#if A_DIM
- {"Dim_Character", A_DIM},
-#endif
-#if A_BOLD
- {"Bold_Character", A_BOLD},
-#endif
-#if A_ALTCHARSET
- {"Alternate_Character_Set", A_ALTCHARSET},
-#endif
-#if A_INVIS
- {"Invisible_Character", A_INVIS},
-#endif
-#if A_PROTECT
- {"Protected_Character", A_PROTECT},
-#endif
-#if A_HORIZONTAL
- {"Horizontal", A_HORIZONTAL},
-#endif
-#if A_LEFT
- {"Left", A_LEFT},
-#endif
-#if A_LOW
- {"Low", A_LOW},
-#endif
-#if A_RIGHT
- {"Right", A_RIGHT},
-#endif
-#if A_TOP
- {"Top", A_TOP},
-#endif
-#if A_VERTICAL
- {"Vertical", A_VERTICAL},
-#endif
- {(char *)0, 0}
- };
- chtype attr = A_ATTRIBUTES & ~A_COLOR;
- int start = -1;
- int len = 0;
- int i, set;
- for (i = 0; i < (int)(8 * sizeof(chtype)); i++)
-
- {
- set = attr & 1;
- if (set)
- {
- if (start < 0)
- start = i;
- if (start >= 0)
- {
- len++;
- }
- }
- attr = attr >> 1;
- }
- gen_reps(nap, name, (len + 7) / 8, little_endian ? start : 0);
-}
-
-static void
-gen_trace(const char *name)
-{
- static const name_attribute_pair nap[] =
- {
- {"Times", TRACE_TIMES},
- {"Tputs", TRACE_TPUTS},
- {"Update", TRACE_UPDATE},
- {"Cursor_Move", TRACE_MOVE},
- {"Character_Output", TRACE_CHARPUT},
- {"Calls", TRACE_CALLS},
- {"Virtual_Puts", TRACE_VIRTPUT},
- {"Input_Events", TRACE_IEVENT},
- {"TTY_State", TRACE_BITS},
- {"Internal_Calls", TRACE_ICALLS},
- {"Character_Calls", TRACE_CCALLS},
- {"Termcap_TermInfo", TRACE_DATABASE},
- {(char *)0, 0}
- };
- gen_reps(nap, name, sizeof(int), 0);
-}
-
-static void
-gen_menu_opt_rep(const char *name)
-{
- static const name_attribute_pair nap[] =
- {
-#ifdef O_ONEVALUE
- {"One_Valued", O_ONEVALUE},
-#endif
-#ifdef O_SHOWDESC
- {"Show_Descriptions", O_SHOWDESC},
-#endif
-#ifdef O_ROWMAJOR
- {"Row_Major_Order", O_ROWMAJOR},
-#endif
-#ifdef O_IGNORECASE
- {"Ignore_Case", O_IGNORECASE},
-#endif
-#ifdef O_SHOWMATCH
- {"Show_Matches", O_SHOWMATCH},
-#endif
-#ifdef O_NONCYCLIC
- {"Non_Cyclic", O_NONCYCLIC},
-#endif
- {(char *)0, 0}
- };
- gen_reps(nap, name, sizeof(int), 0);
-}
-
-static void
-gen_item_opt_rep(const char *name)
-{
- static const name_attribute_pair nap[] =
- {
-#ifdef O_SELECTABLE
- {"Selectable", O_SELECTABLE},
-#endif
- {(char *)0, 0}
- };
- gen_reps(nap, name, sizeof(int), 0);
-}
-
-static void
-gen_form_opt_rep(const char *name)
-{
- static const name_attribute_pair nap[] =
- {
-#ifdef O_NL_OVERLOAD
- {"NL_Overload", O_NL_OVERLOAD},
-#endif
-#ifdef O_BS_OVERLOAD
- {"BS_Overload", O_BS_OVERLOAD},
-#endif
- {(char *)0, 0}
- };
- gen_reps(nap, name, sizeof(int), 0);
-}
-
-/*
- * Generate the representation clause for the Field_Option_Set record
- */
-static void
-gen_field_opt_rep(const char *name)
-{
- static const name_attribute_pair nap[] =
- {
-#ifdef O_VISIBLE
- {"Visible", O_VISIBLE},
-#endif
-#ifdef O_ACTIVE
- {"Active", O_ACTIVE},
-#endif
-#ifdef O_PUBLIC
- {"Public", O_PUBLIC},
-#endif
-#ifdef O_EDIT
- {"Edit", O_EDIT},
-#endif
-#ifdef O_WRAP
- {"Wrap", O_WRAP},
-#endif
-#ifdef O_BLANK
- {"Blank", O_BLANK},
-#endif
-#ifdef O_AUTOSKIP
- {"Auto_Skip", O_AUTOSKIP},
-#endif
-#ifdef O_NULLOK
- {"Null_Ok", O_NULLOK},
-#endif
-#ifdef O_PASSOK
- {"Pass_Ok", O_PASSOK},
-#endif
-#ifdef O_STATIC
- {"Static", O_STATIC},
-#endif
- {(char *)0, 0}
- };
- gen_reps(nap, name, sizeof(int), 0);
-}
-
-/*
- * Generate a single key code constant definition.
- */
-static void
-keydef(const char *name, const char *old_name, int value, int mode)
-{
- if (mode == 0) /* Generate the new name */
- printf(" %-30s : constant Special_Key_Code := 8#%3o#;\n", name, value);
- else
- { /* generate the old name, but only if it doesn't conflict with the old
- * name (Ada95 isn't case sensitive!)
- */
- const char *s = old_name;
- const char *t = name;
-
- while (*s && *t && (toupper(*s++) == toupper(*t++)));
- if (*s || *t)
- printf(" %-16s : Special_Key_Code renames %s;\n", old_name, name);
- }
-}
-
-/*
- * Generate constants for the key codes. When called with mode==0, a
- * complete list with nice constant names in proper casing style will
- * be generated. Otherwise a list of old (i.e. C-style) names will be
- * generated, given that the name wasn't already defined in the "nice"
- * list.
- */
-static void
-gen_keydefs(int mode)
-{
- char buf[16];
- char obuf[16];
- int i;
-
-#ifdef KEY_CODE_YES
- keydef("Key_Code_Yes", "KEY_CODE_YES", KEY_CODE_YES, mode);
-#endif
-#ifdef KEY_MIN
- keydef("Key_Min", "KEY_MIN", KEY_MIN, mode);
-#endif
-#ifdef KEY_BREAK
- keydef("Key_Break", "KEY_BREAK", KEY_BREAK, mode);
-#endif
-#ifdef KEY_DOWN
- keydef("Key_Cursor_Down", "KEY_DOWN", KEY_DOWN, mode);
-#endif
-#ifdef KEY_UP
- keydef("Key_Cursor_Up", "KEY_UP", KEY_UP, mode);
-#endif
-#ifdef KEY_LEFT
- keydef("Key_Cursor_Left", "KEY_LEFT", KEY_LEFT, mode);
-#endif
-#ifdef KEY_RIGHT
- keydef("Key_Cursor_Right", "KEY_RIGHT", KEY_RIGHT, mode);
-#endif
-#ifdef KEY_HOME
- keydef("Key_Home", "KEY_HOME", KEY_HOME, mode);
-#endif
-#ifdef KEY_BACKSPACE
- keydef("Key_Backspace", "KEY_BACKSPACE", KEY_BACKSPACE, mode);
-#endif
-#ifdef KEY_F0
- keydef("Key_F0", "KEY_F0", KEY_F0, mode);
-#endif
-#ifdef KEY_F
- for (i = 1; i <= 24; i++)
- {
- sprintf(buf, "Key_F%d", i);
- sprintf(obuf, "KEY_F%d", i);
- keydef(buf, obuf, KEY_F(i), mode);
- }
-#endif
-#ifdef KEY_DL
- keydef("Key_Delete_Line", "KEY_DL", KEY_DL, mode);
-#endif
-#ifdef KEY_IL
- keydef("Key_Insert_Line", "KEY_IL", KEY_IL, mode);
-#endif
-#ifdef KEY_DC
- keydef("Key_Delete_Char", "KEY_DC", KEY_DC, mode);
-#endif
-#ifdef KEY_IC
- keydef("Key_Insert_Char", "KEY_IC", KEY_IC, mode);
-#endif
-#ifdef KEY_EIC
- keydef("Key_Exit_Insert_Mode", "KEY_EIC", KEY_EIC, mode);
-#endif
-#ifdef KEY_CLEAR
- keydef("Key_Clear_Screen", "KEY_CLEAR", KEY_CLEAR, mode);
-#endif
-#ifdef KEY_EOS
- keydef("Key_Clear_End_Of_Screen", "KEY_EOS", KEY_EOS, mode);
-#endif
-#ifdef KEY_EOL
- keydef("Key_Clear_End_Of_Line", "KEY_EOL", KEY_EOL, mode);
-#endif
-#ifdef KEY_SF
- keydef("Key_Scroll_1_Forward", "KEY_SF", KEY_SF, mode);
-#endif
-#ifdef KEY_SR
- keydef("Key_Scroll_1_Backward", "KEY_SR", KEY_SR, mode);
-#endif
-#ifdef KEY_NPAGE
- keydef("Key_Next_Page", "KEY_NPAGE", KEY_NPAGE, mode);
-#endif
-#ifdef KEY_PPAGE
- keydef("Key_Previous_Page", "KEY_PPAGE", KEY_PPAGE, mode);
-#endif
-#ifdef KEY_STAB
- keydef("Key_Set_Tab", "KEY_STAB", KEY_STAB, mode);
-#endif
-#ifdef KEY_CTAB
- keydef("Key_Clear_Tab", "KEY_CTAB", KEY_CTAB, mode);
-#endif
-#ifdef KEY_CATAB
- keydef("Key_Clear_All_Tabs", "KEY_CATAB", KEY_CATAB, mode);
-#endif
-#ifdef KEY_ENTER
- keydef("Key_Enter_Or_Send", "KEY_ENTER", KEY_ENTER, mode);
-#endif
-#ifdef KEY_SRESET
- keydef("Key_Soft_Reset", "KEY_SRESET", KEY_SRESET, mode);
-#endif
-#ifdef KEY_RESET
- keydef("Key_Reset", "KEY_RESET", KEY_RESET, mode);
-#endif
-#ifdef KEY_PRINT
- keydef("Key_Print", "KEY_PRINT", KEY_PRINT, mode);
-#endif
-#ifdef KEY_LL
- keydef("Key_Bottom", "KEY_LL", KEY_LL, mode);
-#endif
-#ifdef KEY_A1
- keydef("Key_Upper_Left_Of_Keypad", "KEY_A1", KEY_A1, mode);
-#endif
-#ifdef KEY_A3
- keydef("Key_Upper_Right_Of_Keypad", "KEY_A3", KEY_A3, mode);
-#endif
-#ifdef KEY_B2
- keydef("Key_Center_Of_Keypad", "KEY_B2", KEY_B2, mode);
-#endif
-#ifdef KEY_C1
- keydef("Key_Lower_Left_Of_Keypad", "KEY_C1", KEY_C1, mode);
-#endif
-#ifdef KEY_C3
- keydef("Key_Lower_Right_Of_Keypad", "KEY_C3", KEY_C3, mode);
-#endif
-#ifdef KEY_BTAB
- keydef("Key_Back_Tab", "KEY_BTAB", KEY_BTAB, mode);
-#endif
-#ifdef KEY_BEG
- keydef("Key_Beginning", "KEY_BEG", KEY_BEG, mode);
-#endif
-#ifdef KEY_CANCEL
- keydef("Key_Cancel", "KEY_CANCEL", KEY_CANCEL, mode);
-#endif
-#ifdef KEY_CLOSE
- keydef("Key_Close", "KEY_CLOSE", KEY_CLOSE, mode);
-#endif
-#ifdef KEY_COMMAND
- keydef("Key_Command", "KEY_COMMAND", KEY_COMMAND, mode);
-#endif
-#ifdef KEY_COPY
- keydef("Key_Copy", "KEY_COPY", KEY_COPY, mode);
-#endif
-#ifdef KEY_CREATE
- keydef("Key_Create", "KEY_CREATE", KEY_CREATE, mode);
-#endif
-#ifdef KEY_END
- keydef("Key_End", "KEY_END", KEY_END, mode);
-#endif
-#ifdef KEY_EXIT
- keydef("Key_Exit", "KEY_EXIT", KEY_EXIT, mode);
-#endif
-#ifdef KEY_FIND
- keydef("Key_Find", "KEY_FIND", KEY_FIND, mode);
-#endif
-#ifdef KEY_HELP
- keydef("Key_Help", "KEY_HELP", KEY_HELP, mode);
-#endif
-#ifdef KEY_MARK
- keydef("Key_Mark", "KEY_MARK", KEY_MARK, mode);
-#endif
-#ifdef KEY_MESSAGE
- keydef("Key_Message", "KEY_MESSAGE", KEY_MESSAGE, mode);
-#endif
-#ifdef KEY_MOVE
- keydef("Key_Move", "KEY_MOVE", KEY_MOVE, mode);
-#endif
-#ifdef KEY_NEXT
- keydef("Key_Next", "KEY_NEXT", KEY_NEXT, mode);
-#endif
-#ifdef KEY_OPEN
- keydef("Key_Open", "KEY_OPEN", KEY_OPEN, mode);
-#endif
-#ifdef KEY_OPTIONS
- keydef("Key_Options", "KEY_OPTIONS", KEY_OPTIONS, mode);
-#endif
-#ifdef KEY_PREVIOUS
- keydef("Key_Previous", "KEY_PREVIOUS", KEY_PREVIOUS, mode);
-#endif
-#ifdef KEY_REDO
- keydef("Key_Redo", "KEY_REDO", KEY_REDO, mode);
-#endif
-#ifdef KEY_REFERENCE
- keydef("Key_Reference", "KEY_REFERENCE", KEY_REFERENCE, mode);
-#endif
-#ifdef KEY_REFRESH
- keydef("Key_Refresh", "KEY_REFRESH", KEY_REFRESH, mode);
-#endif
-#ifdef KEY_REPLACE
- keydef("Key_Replace", "KEY_REPLACE", KEY_REPLACE, mode);
-#endif
-#ifdef KEY_RESTART
- keydef("Key_Restart", "KEY_RESTART", KEY_RESTART, mode);
-#endif
-#ifdef KEY_RESUME
- keydef("Key_Resume", "KEY_RESUME", KEY_RESUME, mode);
-#endif
-#ifdef KEY_SAVE
- keydef("Key_Save", "KEY_SAVE", KEY_SAVE, mode);
-#endif
-#ifdef KEY_SBEG
- keydef("Key_Shift_Begin", "KEY_SBEG", KEY_SBEG, mode);
-#endif
-#ifdef KEY_SCANCEL
- keydef("Key_Shift_Cancel", "KEY_SCANCEL", KEY_SCANCEL, mode);
-#endif
-#ifdef KEY_SCOMMAND
- keydef("Key_Shift_Command", "KEY_SCOMMAND", KEY_SCOMMAND, mode);
-#endif
-#ifdef KEY_SCOPY
- keydef("Key_Shift_Copy", "KEY_SCOPY", KEY_SCOPY, mode);
-#endif
-#ifdef KEY_SCREATE
- keydef("Key_Shift_Create", "KEY_SCREATE", KEY_SCREATE, mode);
-#endif
-#ifdef KEY_SDC
- keydef("Key_Shift_Delete_Char", "KEY_SDC", KEY_SDC, mode);
-#endif
-#ifdef KEY_SDL
- keydef("Key_Shift_Delete_Line", "KEY_SDL", KEY_SDL, mode);
-#endif
-#ifdef KEY_SELECT
- keydef("Key_Select", "KEY_SELECT", KEY_SELECT, mode);
-#endif
-#ifdef KEY_SEND
- keydef("Key_Shift_End", "KEY_SEND", KEY_SEND, mode);
-#endif
-#ifdef KEY_SEOL
- keydef("Key_Shift_Clear_End_Of_Line", "KEY_SEOL", KEY_SEOL, mode);
-#endif
-#ifdef KEY_SEXIT
- keydef("Key_Shift_Exit", "KEY_SEXIT", KEY_SEXIT, mode);
-#endif
-#ifdef KEY_SFIND
- keydef("Key_Shift_Find", "KEY_SFIND", KEY_SFIND, mode);
-#endif
-#ifdef KEY_SHELP
- keydef("Key_Shift_Help", "KEY_SHELP", KEY_SHELP, mode);
-#endif
-#ifdef KEY_SHOME
- keydef("Key_Shift_Home", "KEY_SHOME", KEY_SHOME, mode);
-#endif
-#ifdef KEY_SIC
- keydef("Key_Shift_Insert_Char", "KEY_SIC", KEY_SIC, mode);
-#endif
-#ifdef KEY_SLEFT
- keydef("Key_Shift_Cursor_Left", "KEY_SLEFT", KEY_SLEFT, mode);
-#endif
-#ifdef KEY_SMESSAGE
- keydef("Key_Shift_Message", "KEY_SMESSAGE", KEY_SMESSAGE, mode);
-#endif
-#ifdef KEY_SMOVE
- keydef("Key_Shift_Move", "KEY_SMOVE", KEY_SMOVE, mode);
-#endif
-#ifdef KEY_SNEXT
- keydef("Key_Shift_Next_Page", "KEY_SNEXT", KEY_SNEXT, mode);
-#endif
-#ifdef KEY_SOPTIONS
- keydef("Key_Shift_Options", "KEY_SOPTIONS", KEY_SOPTIONS, mode);
-#endif
-#ifdef KEY_SPREVIOUS
- keydef("Key_Shift_Previous_Page", "KEY_SPREVIOUS", KEY_SPREVIOUS, mode);
-#endif
-#ifdef KEY_SPRINT
- keydef("Key_Shift_Print", "KEY_SPRINT", KEY_SPRINT, mode);
-#endif
-#ifdef KEY_SREDO
- keydef("Key_Shift_Redo", "KEY_SREDO", KEY_SREDO, mode);
-#endif
-#ifdef KEY_SREPLACE
- keydef("Key_Shift_Replace", "KEY_SREPLACE", KEY_SREPLACE, mode);
-#endif
-#ifdef KEY_SRIGHT
- keydef("Key_Shift_Cursor_Right", "KEY_SRIGHT", KEY_SRIGHT, mode);
-#endif
-#ifdef KEY_SRSUME
- keydef("Key_Shift_Resume", "KEY_SRSUME", KEY_SRSUME, mode);
-#endif
-#ifdef KEY_SSAVE
- keydef("Key_Shift_Save", "KEY_SSAVE", KEY_SSAVE, mode);
-#endif
-#ifdef KEY_SSUSPEND
- keydef("Key_Shift_Suspend", "KEY_SSUSPEND", KEY_SSUSPEND, mode);
-#endif
-#ifdef KEY_SUNDO
- keydef("Key_Shift_Undo", "KEY_SUNDO", KEY_SUNDO, mode);
-#endif
-#ifdef KEY_SUSPEND
- keydef("Key_Suspend", "KEY_SUSPEND", KEY_SUSPEND, mode);
-#endif
-#ifdef KEY_UNDO
- keydef("Key_Undo", "KEY_UNDO", KEY_UNDO, mode);
-#endif
-#ifdef KEY_MOUSE
- keydef("Key_Mouse", "KEY_MOUSE", KEY_MOUSE, mode);
-#endif
-#ifdef KEY_RESIZE
- keydef("Key_Resize", "KEY_RESIZE", KEY_RESIZE, mode);
-#endif
-}
-
-/*
- * Generate a constant with the given name. The second parameter
- * is a reference to the ACS character in the acs_map[] array and
- * will be translated into an index.
- */
-static void
-acs_def(const char *name, chtype *a)
-{
- int c = a - &acs_map[0];
-
- printf(" %-24s : constant Character := ", name);
- if (isprint(c) && (c != '`'))
- printf("'%c';\n", c);
- else
- printf("Character'Val (%d);\n", c);
-}
-
-/*
- * Generate the constants for the ACS characters
- */
-static void
-gen_acs(void)
-{
- printf(" type C_ACS_Map is array (Character'Val (0) .. Character'Val (127))\n");
- printf(" of Attributed_Character;\n");
-#if USE_REENTRANT || BROKEN_LINKER
- printf(" type C_ACS_Ptr is access C_ACS_Map;\n");
- printf(" function ACS_Map return C_ACS_Ptr;\n");
- printf(" pragma Import (C, ACS_Map, \"_nc_acs_map\");\n");
-#else
- printf(" ACS_Map : C_ACS_Map;\n");
- printf(" pragma Import (C, ACS_Map, \"acs_map\");\n");
-#endif
- printf(" --\n");
- printf(" --\n");
- printf(" -- Constants for several characters from the Alternate Character Set\n");
- printf(" -- You must use these constants as indices into the ACS_Map array\n");
- printf(" -- to get the corresponding attributed character at runtime.\n");
- printf(" --\n");
-
-#ifdef ACS_ULCORNER
- acs_def("ACS_Upper_Left_Corner", &ACS_ULCORNER);
-#endif
-#ifdef ACS_LLCORNER
- acs_def("ACS_Lower_Left_Corner", &ACS_LLCORNER);
-#endif
-#ifdef ACS_URCORNER
- acs_def("ACS_Upper_Right_Corner", &ACS_URCORNER);
-#endif
-#ifdef ACS_LRCORNER
- acs_def("ACS_Lower_Right_Corner", &ACS_LRCORNER);
-#endif
-#ifdef ACS_LTEE
- acs_def("ACS_Left_Tee", &ACS_LTEE);
-#endif
-#ifdef ACS_RTEE
- acs_def("ACS_Right_Tee", &ACS_RTEE);
-#endif
-#ifdef ACS_BTEE
- acs_def("ACS_Bottom_Tee", &ACS_BTEE);
-#endif
-#ifdef ACS_TTEE
- acs_def("ACS_Top_Tee", &ACS_TTEE);
-#endif
-#ifdef ACS_HLINE
- acs_def("ACS_Horizontal_Line", &ACS_HLINE);
-#endif
-#ifdef ACS_VLINE
- acs_def("ACS_Vertical_Line", &ACS_VLINE);
-#endif
-#ifdef ACS_PLUS
- acs_def("ACS_Plus_Symbol", &ACS_PLUS);
-#endif
-#ifdef ACS_S1
- acs_def("ACS_Scan_Line_1", &ACS_S1);
-#endif
-#ifdef ACS_S9
- acs_def("ACS_Scan_Line_9", &ACS_S9);
-#endif
-#ifdef ACS_DIAMOND
- acs_def("ACS_Diamond", &ACS_DIAMOND);
-#endif
-#ifdef ACS_CKBOARD
- acs_def("ACS_Checker_Board", &ACS_CKBOARD);
-#endif
-#ifdef ACS_DEGREE
- acs_def("ACS_Degree", &ACS_DEGREE);
-#endif
-#ifdef ACS_PLMINUS
- acs_def("ACS_Plus_Minus", &ACS_PLMINUS);
-#endif
-#ifdef ACS_BULLET
- acs_def("ACS_Bullet", &ACS_BULLET);
-#endif
-#ifdef ACS_LARROW
- acs_def("ACS_Left_Arrow", &ACS_LARROW);
-#endif
-#ifdef ACS_RARROW
- acs_def("ACS_Right_Arrow", &ACS_RARROW);
-#endif
-#ifdef ACS_DARROW
- acs_def("ACS_Down_Arrow", &ACS_DARROW);
-#endif
-#ifdef ACS_UARROW
- acs_def("ACS_Up_Arrow", &ACS_UARROW);
-#endif
-#ifdef ACS_BOARD
- acs_def("ACS_Board_Of_Squares", &ACS_BOARD);
-#endif
-#ifdef ACS_LANTERN
- acs_def("ACS_Lantern", &ACS_LANTERN);
-#endif
-#ifdef ACS_BLOCK
- acs_def("ACS_Solid_Block", &ACS_BLOCK);
-#endif
-#ifdef ACS_S3
- acs_def("ACS_Scan_Line_3", &ACS_S3);
-#endif
-#ifdef ACS_S7
- acs_def("ACS_Scan_Line_7", &ACS_S7);
-#endif
-#ifdef ACS_LEQUAL
- acs_def("ACS_Less_Or_Equal", &ACS_LEQUAL);
-#endif
-#ifdef ACS_GEQUAL
- acs_def("ACS_Greater_Or_Equal", &ACS_GEQUAL);
-#endif
-#ifdef ACS_PI
- acs_def("ACS_PI", &ACS_PI);
-#endif
-#ifdef ACS_NEQUAL
- acs_def("ACS_Not_Equal", &ACS_NEQUAL);
-#endif
-#ifdef ACS_STERLING
- acs_def("ACS_Sterling", &ACS_STERLING);
-#endif
-}
-
-#define GEN_EVENT(name,value) \
- printf(" %-25s : constant Event_Mask := 8#%011lo#;\n", \
- #name, value)
-
-#define GEN_MEVENT(name) \
- printf(" %-25s : constant Event_Mask := 8#%011lo#;\n", \
- #name, name)
-
-static void
-gen_mouse_events(void)
-{
- mmask_t all1 = 0;
- mmask_t all2 = 0;
- mmask_t all3 = 0;
- mmask_t all4 = 0;
-
-#ifdef BUTTON1_RELEASED
- GEN_MEVENT(BUTTON1_RELEASED);
- all1 |= BUTTON1_RELEASED;
-#endif
-#ifdef BUTTON1_PRESSED
- GEN_MEVENT(BUTTON1_PRESSED);
- all1 |= BUTTON1_PRESSED;
-#endif
-#ifdef BUTTON1_CLICKED
- GEN_MEVENT(BUTTON1_CLICKED);
- all1 |= BUTTON1_CLICKED;
-#endif
-#ifdef BUTTON1_DOUBLE_CLICKED
- GEN_MEVENT(BUTTON1_DOUBLE_CLICKED);
- all1 |= BUTTON1_DOUBLE_CLICKED;
-#endif
-#ifdef BUTTON1_TRIPLE_CLICKED
- GEN_MEVENT(BUTTON1_TRIPLE_CLICKED);
- all1 |= BUTTON1_TRIPLE_CLICKED;
-#endif
-#ifdef BUTTON1_RESERVED_EVENT
- GEN_MEVENT(BUTTON1_RESERVED_EVENT);
- all1 |= BUTTON1_RESERVED_EVENT;
-#endif
-#ifdef BUTTON2_RELEASED
- GEN_MEVENT(BUTTON2_RELEASED);
- all2 |= BUTTON2_RELEASED;
-#endif
-#ifdef BUTTON2_PRESSED
- GEN_MEVENT(BUTTON2_PRESSED);
- all2 |= BUTTON2_PRESSED;
-#endif
-#ifdef BUTTON2_CLICKED
- GEN_MEVENT(BUTTON2_CLICKED);
- all2 |= BUTTON2_CLICKED;
-#endif
-#ifdef BUTTON2_DOUBLE_CLICKED
- GEN_MEVENT(BUTTON2_DOUBLE_CLICKED);
- all2 |= BUTTON2_DOUBLE_CLICKED;
-#endif
-#ifdef BUTTON2_TRIPLE_CLICKED
- GEN_MEVENT(BUTTON2_TRIPLE_CLICKED);
- all2 |= BUTTON2_TRIPLE_CLICKED;
-#endif
-#ifdef BUTTON2_RESERVED_EVENT
- GEN_MEVENT(BUTTON2_RESERVED_EVENT);
- all2 |= BUTTON2_RESERVED_EVENT;
-#endif
-#ifdef BUTTON3_RELEASED
- GEN_MEVENT(BUTTON3_RELEASED);
- all3 |= BUTTON3_RELEASED;
-#endif
-#ifdef BUTTON3_PRESSED
- GEN_MEVENT(BUTTON3_PRESSED);
- all3 |= BUTTON3_PRESSED;
-#endif
-#ifdef BUTTON3_CLICKED
- GEN_MEVENT(BUTTON3_CLICKED);
- all3 |= BUTTON3_CLICKED;
-#endif
-#ifdef BUTTON3_DOUBLE_CLICKED
- GEN_MEVENT(BUTTON3_DOUBLE_CLICKED);
- all3 |= BUTTON3_DOUBLE_CLICKED;
-#endif
-#ifdef BUTTON3_TRIPLE_CLICKED
- GEN_MEVENT(BUTTON3_TRIPLE_CLICKED);
- all3 |= BUTTON3_TRIPLE_CLICKED;
-#endif
-#ifdef BUTTON3_RESERVED_EVENT
- GEN_MEVENT(BUTTON3_RESERVED_EVENT);
- all3 |= BUTTON3_RESERVED_EVENT;
-#endif
-#ifdef BUTTON4_RELEASED
- GEN_MEVENT(BUTTON4_RELEASED);
- all4 |= BUTTON4_RELEASED;
-#endif
-#ifdef BUTTON4_PRESSED
- GEN_MEVENT(BUTTON4_PRESSED);
- all4 |= BUTTON4_PRESSED;
-#endif
-#ifdef BUTTON4_CLICKED
- GEN_MEVENT(BUTTON4_CLICKED);
- all4 |= BUTTON4_CLICKED;
-#endif
-#ifdef BUTTON4_DOUBLE_CLICKED
- GEN_MEVENT(BUTTON4_DOUBLE_CLICKED);
- all4 |= BUTTON4_DOUBLE_CLICKED;
-#endif
-#ifdef BUTTON4_TRIPLE_CLICKED
- GEN_MEVENT(BUTTON4_TRIPLE_CLICKED);
- all4 |= BUTTON4_TRIPLE_CLICKED;
-#endif
-#ifdef BUTTON4_RESERVED_EVENT
- GEN_MEVENT(BUTTON4_RESERVED_EVENT);
- all4 |= BUTTON4_RESERVED_EVENT;
-#endif
-#ifdef BUTTON_CTRL
- GEN_MEVENT(BUTTON_CTRL);
-#endif
-#ifdef BUTTON_SHIFT
- GEN_MEVENT(BUTTON_SHIFT);
-#endif
-#ifdef BUTTON_ALT
- GEN_MEVENT(BUTTON_ALT);
-#endif
-#ifdef REPORT_MOUSE_POSITION
- GEN_MEVENT(REPORT_MOUSE_POSITION);
-#endif
-#ifdef ALL_MOUSE_EVENTS
- GEN_MEVENT(ALL_MOUSE_EVENTS);
-#endif
-
- GEN_EVENT(BUTTON1_EVENTS, all1);
- GEN_EVENT(BUTTON2_EVENTS, all2);
- GEN_EVENT(BUTTON3_EVENTS, all3);
- GEN_EVENT(BUTTON4_EVENTS, all4);
-}
-
-static void
-wrap_one_var(const char *c_var,
- const char *c_type,
- const char *ada_func,
- const char *ada_type)
-{
-#if USE_REENTRANT
- /* must wrap variables */
- printf("\n");
- printf(" function %s return %s\n", ada_func, ada_type);
- printf(" is\n");
- printf(" function Result return %s;\n", c_type);
- printf(" pragma Import (C, Result, \"_nc_%s\");\n", c_var);
- printf(" begin\n");
- if (strcmp(c_type, ada_type))
- printf(" return %s (Result);\n", ada_type);
- else
- printf(" return Result;\n");
- printf(" end %s;\n", ada_func);
-#else
- /* global variables are really global */
- printf("\n");
- printf(" function %s return %s\n", ada_func, ada_type);
- printf(" is\n");
- printf(" Result : %s;\n", c_type);
- printf(" pragma Import (C, Result, \"%s\");\n", c_var);
- printf(" begin\n");
- if (strcmp(c_type, ada_type))
- printf(" return %s (Result);\n", ada_type);
- else
- printf(" return Result;\n");
- printf(" end %s;\n", ada_func);
-#endif
-}
-
-#define GEN_PUBLIC_VAR(c_var, c_type, ada_func, ada_type) \
- wrap_one_var(#c_var, #c_type, #ada_func, #ada_type)
-
-static void
-gen_public_vars(void)
-{
- GEN_PUBLIC_VAR(stdscr, Window, Standard_Window, Window);
- GEN_PUBLIC_VAR(curscr, Window, Current_Window, Window);
- GEN_PUBLIC_VAR(LINES, C_Int, Lines, Line_Count);
- GEN_PUBLIC_VAR(COLS, C_Int, Columns, Column_Count);
- GEN_PUBLIC_VAR(TABSIZE, C_Int, Tab_Size, Natural);
- GEN_PUBLIC_VAR(COLORS, C_Int, Number_Of_Colors, Natural);
- GEN_PUBLIC_VAR(COLOR_PAIRS, C_Int, Number_Of_Color_Pairs, Natural);
-}
-
-/*
- * Output some comment lines indicating that the file is generated.
- * The name parameter is the name of the facility to be used in
- * the comment.
- */
-static void
-prologue(const char *name)
-{
- printf("-- %s binding.\n", name);
- printf("-- This module is generated. Please don't change it manually!\n");
- printf("-- Run the generator instead.\n-- |");
-
- printf("define(`M4_BIT_ORDER',`%s_Order_First')",
- little_endian ? "Low" : "High");
-}
-
-/*
- * Write the prologue for the curses facility and make sure that
- * KEY_MIN and KEY_MAX are defined for the rest of this source.
- */
-static void
-basedefs(void)
-{
- prologue("curses");
#ifndef KEY_MAX
# define KEY_MAX 0777
#endif
- printf("define(`M4_KEY_MAX',`8#%o#')", KEY_MAX);
#ifndef KEY_MIN
# define KEY_MIN 0401
#endif
- if (KEY_MIN == 256)
- {
- fprintf(stderr, "Unexpected value for KEY_MIN: %d\n", KEY_MIN);
- exit(1);
- }
- printf("define(`M4_SPECIAL_FIRST',`8#%o#')", KEY_MIN - 1);
-}
-/*
- * Write out the comment lines for the menu facility
- */
-static void
-menu_basedefs(void)
+static UCHAR
+bit_is_set(const UCHAR * const data,
+ const UINT offset)
{
- prologue("menu");
+ const UCHAR byte = data[offset >> 3];
+ UINT bit;
+
+ if (little_endian)
+ bit = offset; /* offset */
+ else /* or */
+ bit = ~offset; /* 7 - offset */
+ bit &= 7; /* modulo 8 */
+ return byte & (UCHAR) (1 << bit);
}
-/*
- * Write out the comment lines for the form facility
- */
-static void
-form_basedefs(void)
-{
- prologue("form");
-}
-
-/*
- * Write out the comment lines for the mouse facility
- */
-static void
-mouse_basedefs(void)
-{
- prologue("mouse");
-}
-
-/*
- * Write the definition of a single color
- */
-static void
-color_def(const char *name, int value)
-{
- printf(" %-16s : constant Color_Number := %d;\n", name, value);
-}
-
-/*
- * Generate all color definitions
- */
-static void
-gen_color(void)
-{
-#if HAVE_USE_DEFAULT_COLORS
- color_def("Default_Color", -1);
-#endif
-#ifdef COLOR_BLACK
- color_def("Black", COLOR_BLACK);
-#endif
-#ifdef COLOR_RED
- color_def("Red", COLOR_RED);
-#endif
-#ifdef COLOR_GREEN
- color_def("Green", COLOR_GREEN);
-#endif
-#ifdef COLOR_YELLOW
- color_def("Yellow", COLOR_YELLOW);
-#endif
-#ifdef COLOR_BLUE
- color_def("Blue", COLOR_BLUE);
-#endif
-#ifdef COLOR_MAGENTA
- color_def("Magenta", COLOR_MAGENTA);
-#endif
-#ifdef COLOR_CYAN
- color_def("Cyan", COLOR_CYAN);
-#endif
-#ifdef COLOR_WHITE
- color_def("White", COLOR_WHITE);
-#endif
-}
-
-/*
- * Generate the linker options for the base facility
- */
-static void
-gen_linkopts(void)
-{
- printf(" pragma Linker_Options (\"-lncurses%s\");\n", model);
-}
-
-/*
- * Generate the linker options for the menu facility
- */
-static void
-gen_menu_linkopts(void)
-{
- printf(" pragma Linker_Options (\"-lmenu%s\");\n", model);
-}
-
-/*
- * Generate the linker options for the form facility
- */
-static void
-gen_form_linkopts(void)
-{
- printf(" pragma Linker_Options (\"-lform%s\");\n", model);
-}
-
-/*
- * Generate the linker options for the panel facility
- */
-static void
-gen_panel_linkopts(void)
-{
- printf(" pragma Linker_Options (\"-lpanel%s\");\n", model);
-}
-
-static void
-gen_version_info(void)
-{
- static const char *v1 =
- " NC_Major_Version : constant := %d; -- Major version of the library\n";
- static const char *v2 =
- " NC_Minor_Version : constant := %d; -- Minor version of the library\n";
- static const char *v3 =
- " NC_Version : constant String := %c%d.%d%c; -- Version of library\n";
-
- printf(v1, NCURSES_VERSION_MAJOR);
- printf(v2, NCURSES_VERSION_MINOR);
- printf(v3, '"', NCURSES_VERSION_MAJOR, NCURSES_VERSION_MINOR, '"');
-}
-
+/* Find lowest and highest used offset in a byte array. */
+/* Returns 0 if and only if all bits are unset. */
static int
-eti_gen(char *buf, int code, const char *name, int *etimin, int *etimax)
+find_pos(const UCHAR * const data,
+ const UINT sizeof_data,
+ UINT * const low,
+ UINT * const high)
{
- sprintf(buf, " E_%-16s : constant Eti_Error := %d;\n", name, code);
- if (code < *etimin)
- *etimin = code;
- if (code > *etimax)
- *etimax = code;
- return strlen(buf);
+ const UINT last = (sizeof_data << 3) - 1;
+ UINT offset;
+
+ for (offset = last; !bit_is_set(data, offset); offset--)
+ if (!offset) /* All bits are 0. */
+ return 0;
+ *high = offset;
+
+ for (offset = 0; !bit_is_set(data, offset); offset++)
+ {
+ }
+ *low = offset;
+
+ return -1;
}
-static void
-gen_offsets(void)
-{
- const char *s_bool = "";
+#define PRINT_BITMASK(c_type, ada_name, mask_macro) \
+ { \
+ UINT first, last; \
+ c_type mask = (mask_macro); \
+ if (!find_pos ((UCHAR *)&mask, sizeof (mask), &first, &last)) \
+ my_error ("failed to locate " ada_name); \
+ print_constant (ada_name "_First", first); \
+ print_constant (ada_name "_Last", last); \
+ }
- if (sizeof(bool) == sizeof(char))
- {
- s_bool = "char";
- }
- else if (sizeof(bool) == sizeof(short))
- {
- s_bool = "short";
- }
- else if (sizeof(bool) == sizeof(int))
- {
- s_bool = "int";
- }
- printf(" Sizeof%-*s : constant Natural := %2ld; -- %s\n",
- 12, "_bool", (long)sizeof(bool), "bool");
+#define PRINT_NAMED_BITMASK(c_type, mask_macro) \
+ PRINT_BITMASK (c_type, #mask_macro, mask_macro)
- /* In ncurses _maxy and _maxx needs an offset for the "public"
- * value
- */
- printf(" Offset%-*s : constant Natural := %2d; -- %s\n",
- 12, "_XY", 1, "int");
- printf("\n");
- printf(" type Curses_Bool is mod 2 ** Interfaces.C.%s'Size;\n", s_bool);
-}
+#define STRUCT_OFFSET(record, field) \
+ { \
+ UINT first, last; \
+ record mask; \
+ memset (&mask, 0, sizeof (mask)); \
+ memset (&mask.field, 0xff, sizeof(mask.field)); \
+ if (!find_pos ((UCHAR *)&mask, sizeof (mask), &first, &last)) \
+ my_error ("failed to locate" #record "_" #field); \
+ print_constant (#record "_" #field "_First", first); \
+ print_constant (#record "_" #field "_Last", last); \
+ }
-/*
- * main() expects two arguments on the commandline, both single characters.
- * The first character denotes the facility for which we generate output.
- * Possible values are
- * B - Base
- * M - Menus
- * F - Forms
- * P - Pointer Device (Mouse)
- * E - ETI base definitions
- *
- * The second character then denotes the specific output that should be
- * generated for the selected facility.
- */
+/*--------------------*/
+/* Start of main (). */
+/*--------------------*/
+
int
-main(int argc, char *argv[])
+main(int argc, const char *argv[])
{
- int x = 0x12345678;
- char *s = (char *)&x;
+ const int x = 0x12345678;
- if (*s == 0x78)
- little_endian = 1;
+ little_endian = (*((const char *)&x) == 0x78);
- if (argc != 4)
- exit(1);
- model = *++argv;
+ my_program_invocation_name = argv[0];
- switch (argv[1][0])
- {
- /* --------------------------------------------------------------- */
- case 'B': /* The Base facility */
- switch (argv[2][0])
- {
- case 'A': /* chtype translation into Ada95 record type */
- gen_attr_set("Character_Attribute_Set");
- break;
- case 'B': /* write some initial comment lines */
- basedefs();
- break;
- case 'C': /* generate color constants */
- gen_color();
- break;
- case 'D': /* generate displacements of fields in WINDOW struct. */
- gen_offsets();
- break;
- case 'E': /* generate Mouse Event codes */
- gen_mouse_events();
- break;
- case 'K': /* translation of keycodes */
- gen_keydefs(0);
- break;
- case 'L': /* generate the Linker_Options pragma */
- gen_linkopts();
- break;
- case 'M': /* generate constants for the ACS characters */
- gen_acs();
- break;
- case 'O': /* generate definitions of the old key code names */
- gen_keydefs(1);
- break;
- case 'P': /* generate definitions of the public variables */
- gen_public_vars();
- break;
- case 'R': /* generate representation clause for Attributed character */
- gen_chtype_rep("Attributed_Character");
- break;
- case 'T': /* generate the Trace info */
- gen_trace("Trace_Attribute_Set");
- break;
- case 'V': /* generate version info */
- gen_version_info();
- break;
- default:
- break;
- }
- break;
- /* --------------------------------------------------------------- */
- case 'M': /* The Menu facility */
- switch (argv[2][0])
- {
- case 'R': /* generate representation clause for Menu_Option_Set */
- gen_menu_opt_rep("Menu_Option_Set");
- break;
- case 'B': /* write some initial comment lines */
- menu_basedefs();
- break;
- case 'L': /* generate the Linker_Options pragma */
- gen_menu_linkopts();
- break;
- case 'I': /* generate representation clause for Item_Option_Set */
- gen_item_opt_rep("Item_Option_Set");
- break;
- default:
- break;
- }
- break;
- /* --------------------------------------------------------------- */
- case 'F': /* The Form facility */
- switch (argv[2][0])
- {
- case 'R': /* generate representation clause for Form_Option_Set */
- gen_form_opt_rep("Form_Option_Set");
- break;
- case 'B': /* write some initial comment lines */
- form_basedefs();
- break;
- case 'L': /* generate the Linker_Options pragma */
- gen_form_linkopts();
- break;
- case 'I': /* generate representation clause for Field_Option_Set */
- gen_field_opt_rep("Field_Option_Set");
- break;
- default:
- break;
- }
- break;
- /* --------------------------------------------------------------- */
- case 'P': /* The Pointer(=Mouse) facility */
- switch (argv[2][0])
- {
- case 'B': /* write some initial comment lines */
- mouse_basedefs();
- break;
- case 'M': /* generate representation clause for Mouse_Event */
- gen_mrep_rep("Mouse_Event");
- break;
- case 'L': /* generate the Linker_Options pragma */
- gen_panel_linkopts();
- break;
- default:
- break;
- }
- break;
- /* --------------------------------------------------------------- */
- case 'E': /* chtype size detection */
- switch (argv[2][0])
- {
- case 'C':
- {
- const char *fmt = " type C_Chtype is new %s;\n";
- const char *afmt = " type C_AttrType is new %s;\n";
+ if (KEY_MIN == 256)
+ my_error("unexpected value for KEY_MIN: 256");
- if (sizeof(chtype) == sizeof(int))
- {
- if (sizeof(int) == sizeof(long))
- printf(fmt, "C_ULong");
+ if (argc != 2)
+ my_error("Only one argument expected (DFT_ARG_SUFFIX)");
- else
- printf(fmt, "C_UInt");
- }
- else if (sizeof(chtype) == sizeof(long))
- {
- printf(fmt, "C_ULong");
- }
- else
- printf("Error\n");
+ printf("-- Generated by the C program %s (source " __FILE__ ").\n",
+ my_program_invocation_name);
+ printf("-- Do not edit this file directly.\n");
+ printf("-- The values provided here may vary on your system.\n");
+ printf("\n");
+ printf("with System;\n");
+ printf("package Terminal_Interface.Curses_Constants is\n");
+ printf(" pragma Pure;\n");
+ printf("\n");
- if (sizeof(attr_t) == sizeof(int))
- {
- if (sizeof(int) == sizeof(long))
- printf(afmt, "C_ULong");
+ printf(" DFT_ARG_SUFFIX : constant String := \"%s\";\n", argv[1]);
+ printf(" Bit_Order : constant System.Bit_Order := System.%s_Order_First;\n",
+ little_endian ? "Low" : "High");
+ print_constant("Sizeof_Bool", 8 * sizeof(bool));
- else
- printf(afmt, "C_UInt");
- }
- else if (sizeof(attr_t) == sizeof(long))
- {
- printf(afmt, "C_ULong");
- }
- else
- printf("Error\n");
+ PRINT_NAMED_CONSTANT(OK);
+ PRINT_NAMED_CONSTANT(ERR);
+ printf(" pragma Warnings (Off); -- redefinition of Standard.True and False\n");
+ PRINT_NAMED_CONSTANT(TRUE);
+ PRINT_NAMED_CONSTANT(FALSE);
+ printf(" pragma Warnings (On);\n");
- printf("define(`CF_CURSES_OK',`%d')", OK);
- printf("define(`CF_CURSES_ERR',`%d')", ERR);
- printf("define(`CF_CURSES_TRUE',`%d')", TRUE);
- printf("define(`CF_CURSES_FALSE',`%d')", FALSE);
- }
- break;
- case 'E':
- {
- char *buf = (char *)malloc(2048);
- char *p = buf;
- int etimin = E_OK;
- int etimax = E_OK;
+ print_comment("Version of the ncurses library from extensions(3NCURSES)");
+ PRINT_NAMED_CONSTANT(NCURSES_VERSION_MAJOR);
+ PRINT_NAMED_CONSTANT(NCURSES_VERSION_MINOR);
+ printf(" Version : constant String := \"%d.%d\";\n",
+ NCURSES_VERSION_MAJOR, NCURSES_VERSION_MINOR);
- if (p)
- {
- p += eti_gen(p, E_OK, "Ok", &etimin, &etimax);
- p += eti_gen(p, E_SYSTEM_ERROR, "System_Error", &etimin, &etimax);
- p += eti_gen(p, E_BAD_ARGUMENT, "Bad_Argument", &etimin, &etimax);
- p += eti_gen(p, E_POSTED, "Posted", &etimin, &etimax);
- p += eti_gen(p, E_CONNECTED, "Connected", &etimin, &etimax);
- p += eti_gen(p, E_BAD_STATE, "Bad_State", &etimin, &etimax);
- p += eti_gen(p, E_NO_ROOM, "No_Room", &etimin, &etimax);
- p += eti_gen(p, E_NOT_POSTED, "Not_Posted", &etimin, &etimax);
- p += eti_gen(p, E_UNKNOWN_COMMAND,
- "Unknown_Command", &etimin, &etimax);
- p += eti_gen(p, E_NO_MATCH, "No_Match", &etimin, &etimax);
- p += eti_gen(p, E_NOT_SELECTABLE,
- "Not_Selectable", &etimin, &etimax);
- p += eti_gen(p, E_NOT_CONNECTED,
- "Not_Connected", &etimin, &etimax);
- p += eti_gen(p, E_REQUEST_DENIED,
- "Request_Denied", &etimin, &etimax);
- p += eti_gen(p, E_INVALID_FIELD,
- "Invalid_Field", &etimin, &etimax);
- p += eti_gen(p, E_CURRENT,
- "Current", &etimin, &etimax);
- }
- printf(" subtype Eti_Error is C_Int range %d .. %d;\n\n",
- etimin, etimax);
- printf(buf);
- }
- break;
- default:
- break;
- }
- break;
- /* --------------------------------------------------------------- */
- case 'V': /* plain version dump */
- {
- switch (argv[2][0])
- {
- case '1': /* major version */
-#ifdef NCURSES_VERSION_MAJOR
- printf("%d", NCURSES_VERSION_MAJOR);
+ print_comment("Character non-color attributes from attr(3NCURSES)");
+ printf(" -- attr_t and chtype may be signed in C.\n");
+ printf(" type attr_t is mod 2 ** %lu;\n", (long unsigned)(8 * sizeof(attr_t)));
+ PRINT_NAMED_BITMASK(attr_t, A_CHARTEXT);
+ PRINT_NAMED_BITMASK(attr_t, A_COLOR);
+ PRINT_BITMASK(attr_t, "Attr", A_ATTRIBUTES & ~A_COLOR);
+ PRINT_NAMED_BITMASK(attr_t, A_STANDOUT);
+ PRINT_NAMED_BITMASK(attr_t, A_UNDERLINE);
+ PRINT_NAMED_BITMASK(attr_t, A_REVERSE);
+ PRINT_NAMED_BITMASK(attr_t, A_BLINK);
+ PRINT_NAMED_BITMASK(attr_t, A_DIM);
+ PRINT_NAMED_BITMASK(attr_t, A_BOLD);
+ PRINT_NAMED_BITMASK(attr_t, A_PROTECT);
+ PRINT_NAMED_BITMASK(attr_t, A_INVIS);
+ PRINT_NAMED_BITMASK(attr_t, A_ALTCHARSET);
+ PRINT_NAMED_BITMASK(attr_t, A_HORIZONTAL);
+ PRINT_NAMED_BITMASK(attr_t, A_LEFT);
+ PRINT_NAMED_BITMASK(attr_t, A_LOW);
+ PRINT_NAMED_BITMASK(attr_t, A_RIGHT);
+ PRINT_NAMED_BITMASK(attr_t, A_TOP);
+ PRINT_NAMED_BITMASK(attr_t, A_VERTICAL);
+ print_constant("chtype_Size", 8 * sizeof(chtype));
+
+ print_comment("predefined color numbers from color(3NCURSES)");
+ PRINT_NAMED_CONSTANT(COLOR_BLACK);
+ PRINT_NAMED_CONSTANT(COLOR_RED);
+ PRINT_NAMED_CONSTANT(COLOR_GREEN);
+ PRINT_NAMED_CONSTANT(COLOR_YELLOW);
+ PRINT_NAMED_CONSTANT(COLOR_BLUE);
+ PRINT_NAMED_CONSTANT(COLOR_MAGENTA);
+ PRINT_NAMED_CONSTANT(COLOR_CYAN);
+ PRINT_NAMED_CONSTANT(COLOR_WHITE);
+
+ print_comment("ETI return codes from ncurses.h");
+ PRINT_NAMED_CONSTANT(E_OK);
+ PRINT_NAMED_CONSTANT(E_SYSTEM_ERROR);
+ PRINT_NAMED_CONSTANT(E_BAD_ARGUMENT);
+ PRINT_NAMED_CONSTANT(E_POSTED);
+ PRINT_NAMED_CONSTANT(E_CONNECTED);
+ PRINT_NAMED_CONSTANT(E_BAD_STATE);
+ PRINT_NAMED_CONSTANT(E_NO_ROOM);
+ PRINT_NAMED_CONSTANT(E_NOT_POSTED);
+ PRINT_NAMED_CONSTANT(E_UNKNOWN_COMMAND);
+ PRINT_NAMED_CONSTANT(E_NO_MATCH);
+ PRINT_NAMED_CONSTANT(E_NOT_SELECTABLE);
+ PRINT_NAMED_CONSTANT(E_NOT_CONNECTED);
+ PRINT_NAMED_CONSTANT(E_REQUEST_DENIED);
+ PRINT_NAMED_CONSTANT(E_INVALID_FIELD);
+ PRINT_NAMED_CONSTANT(E_CURRENT);
+
+ print_comment("Input key codes not defined in any ncurses manpage");
+ PRINT_NAMED_CONSTANT(KEY_MIN);
+ PRINT_NAMED_CONSTANT(KEY_MAX);
+#ifdef KEY_CODE_YES
+ PRINT_NAMED_CONSTANT(KEY_CODE_YES);
#endif
- break;
- case '2': /* minor version */
-#ifdef NCURSES_VERSION_MINOR
- printf("%d", NCURSES_VERSION_MINOR);
+
+ print_comment("Input key codes from getch(3NCURSES)");
+ PRINT_NAMED_CONSTANT(KEY_BREAK);
+ PRINT_NAMED_CONSTANT(KEY_DOWN);
+ PRINT_NAMED_CONSTANT(KEY_UP);
+ PRINT_NAMED_CONSTANT(KEY_LEFT);
+ PRINT_NAMED_CONSTANT(KEY_RIGHT);
+ PRINT_NAMED_CONSTANT(KEY_HOME);
+ PRINT_NAMED_CONSTANT(KEY_BACKSPACE);
+ PRINT_NAMED_CONSTANT(KEY_F0);
+ print_constant("KEY_F1", KEY_F(1));
+ print_constant("KEY_F2", KEY_F(2));
+ print_constant("KEY_F3", KEY_F(3));
+ print_constant("KEY_F4", KEY_F(4));
+ print_constant("KEY_F5", KEY_F(5));
+ print_constant("KEY_F6", KEY_F(6));
+ print_constant("KEY_F7", KEY_F(7));
+ print_constant("KEY_F8", KEY_F(8));
+ print_constant("KEY_F9", KEY_F(9));
+ print_constant("KEY_F10", KEY_F(10));
+ print_constant("KEY_F11", KEY_F(11));
+ print_constant("KEY_F12", KEY_F(12));
+ print_constant("KEY_F13", KEY_F(13));
+ print_constant("KEY_F14", KEY_F(14));
+ print_constant("KEY_F15", KEY_F(15));
+ print_constant("KEY_F16", KEY_F(16));
+ print_constant("KEY_F17", KEY_F(17));
+ print_constant("KEY_F18", KEY_F(18));
+ print_constant("KEY_F19", KEY_F(19));
+ print_constant("KEY_F20", KEY_F(20));
+ print_constant("KEY_F21", KEY_F(21));
+ print_constant("KEY_F22", KEY_F(22));
+ print_constant("KEY_F23", KEY_F(23));
+ print_constant("KEY_F24", KEY_F(24));
+ PRINT_NAMED_CONSTANT(KEY_DL);
+ PRINT_NAMED_CONSTANT(KEY_IL);
+ PRINT_NAMED_CONSTANT(KEY_DC);
+ PRINT_NAMED_CONSTANT(KEY_IC);
+ PRINT_NAMED_CONSTANT(KEY_EIC);
+ PRINT_NAMED_CONSTANT(KEY_CLEAR);
+ PRINT_NAMED_CONSTANT(KEY_EOS);
+ PRINT_NAMED_CONSTANT(KEY_EOL);
+ PRINT_NAMED_CONSTANT(KEY_SF);
+ PRINT_NAMED_CONSTANT(KEY_SR);
+ PRINT_NAMED_CONSTANT(KEY_NPAGE);
+ PRINT_NAMED_CONSTANT(KEY_PPAGE);
+ PRINT_NAMED_CONSTANT(KEY_STAB);
+ PRINT_NAMED_CONSTANT(KEY_CTAB);
+ PRINT_NAMED_CONSTANT(KEY_CATAB);
+ PRINT_NAMED_CONSTANT(KEY_ENTER);
+ PRINT_NAMED_CONSTANT(KEY_SRESET);
+ PRINT_NAMED_CONSTANT(KEY_RESET);
+ PRINT_NAMED_CONSTANT(KEY_PRINT);
+ PRINT_NAMED_CONSTANT(KEY_LL);
+ PRINT_NAMED_CONSTANT(KEY_A1);
+ PRINT_NAMED_CONSTANT(KEY_A3);
+ PRINT_NAMED_CONSTANT(KEY_B2);
+ PRINT_NAMED_CONSTANT(KEY_C1);
+ PRINT_NAMED_CONSTANT(KEY_C3);
+ PRINT_NAMED_CONSTANT(KEY_BTAB);
+ PRINT_NAMED_CONSTANT(KEY_BEG);
+ PRINT_NAMED_CONSTANT(KEY_CANCEL);
+ PRINT_NAMED_CONSTANT(KEY_CLOSE);
+ PRINT_NAMED_CONSTANT(KEY_COMMAND);
+ PRINT_NAMED_CONSTANT(KEY_COPY);
+ PRINT_NAMED_CONSTANT(KEY_CREATE);
+ PRINT_NAMED_CONSTANT(KEY_END);
+ PRINT_NAMED_CONSTANT(KEY_EXIT);
+ PRINT_NAMED_CONSTANT(KEY_FIND);
+ PRINT_NAMED_CONSTANT(KEY_HELP);
+ PRINT_NAMED_CONSTANT(KEY_MARK);
+ PRINT_NAMED_CONSTANT(KEY_MESSAGE);
+ PRINT_NAMED_CONSTANT(KEY_MOVE);
+ PRINT_NAMED_CONSTANT(KEY_NEXT);
+ PRINT_NAMED_CONSTANT(KEY_OPEN);
+ PRINT_NAMED_CONSTANT(KEY_OPTIONS);
+ PRINT_NAMED_CONSTANT(KEY_PREVIOUS);
+ PRINT_NAMED_CONSTANT(KEY_REDO);
+ PRINT_NAMED_CONSTANT(KEY_REFERENCE);
+ PRINT_NAMED_CONSTANT(KEY_REFRESH);
+ PRINT_NAMED_CONSTANT(KEY_REPLACE);
+ PRINT_NAMED_CONSTANT(KEY_RESTART);
+ PRINT_NAMED_CONSTANT(KEY_RESUME);
+ PRINT_NAMED_CONSTANT(KEY_SAVE);
+ PRINT_NAMED_CONSTANT(KEY_SBEG);
+ PRINT_NAMED_CONSTANT(KEY_SCANCEL);
+ PRINT_NAMED_CONSTANT(KEY_SCOMMAND);
+ PRINT_NAMED_CONSTANT(KEY_SCOPY);
+ PRINT_NAMED_CONSTANT(KEY_SCREATE);
+ PRINT_NAMED_CONSTANT(KEY_SDC);
+ PRINT_NAMED_CONSTANT(KEY_SDL);
+ PRINT_NAMED_CONSTANT(KEY_SELECT);
+ PRINT_NAMED_CONSTANT(KEY_SEND);
+ PRINT_NAMED_CONSTANT(KEY_SEOL);
+ PRINT_NAMED_CONSTANT(KEY_SEXIT);
+ PRINT_NAMED_CONSTANT(KEY_SFIND);
+ PRINT_NAMED_CONSTANT(KEY_SHELP);
+ PRINT_NAMED_CONSTANT(KEY_SHOME);
+ PRINT_NAMED_CONSTANT(KEY_SIC);
+ PRINT_NAMED_CONSTANT(KEY_SLEFT);
+ PRINT_NAMED_CONSTANT(KEY_SMESSAGE);
+ PRINT_NAMED_CONSTANT(KEY_SMOVE);
+ PRINT_NAMED_CONSTANT(KEY_SNEXT);
+ PRINT_NAMED_CONSTANT(KEY_SOPTIONS);
+ PRINT_NAMED_CONSTANT(KEY_SPREVIOUS);
+ PRINT_NAMED_CONSTANT(KEY_SPRINT);
+ PRINT_NAMED_CONSTANT(KEY_SREDO);
+ PRINT_NAMED_CONSTANT(KEY_SREPLACE);
+ PRINT_NAMED_CONSTANT(KEY_SRIGHT);
+ PRINT_NAMED_CONSTANT(KEY_SRSUME);
+ PRINT_NAMED_CONSTANT(KEY_SSAVE);
+ PRINT_NAMED_CONSTANT(KEY_SSUSPEND);
+ PRINT_NAMED_CONSTANT(KEY_SUNDO);
+ PRINT_NAMED_CONSTANT(KEY_SUSPEND);
+ PRINT_NAMED_CONSTANT(KEY_UNDO);
+ PRINT_NAMED_CONSTANT(KEY_MOUSE);
+ PRINT_NAMED_CONSTANT(KEY_RESIZE);
+
+ print_comment("alternate character codes (ACS) from addch(3NCURSES)");
+#define PRINT_ACS(name) print_constant (#name, &name - &acs_map[0])
+ PRINT_ACS(ACS_ULCORNER);
+ PRINT_ACS(ACS_LLCORNER);
+ PRINT_ACS(ACS_URCORNER);
+ PRINT_ACS(ACS_LRCORNER);
+ PRINT_ACS(ACS_LTEE);
+ PRINT_ACS(ACS_RTEE);
+ PRINT_ACS(ACS_BTEE);
+ PRINT_ACS(ACS_TTEE);
+ PRINT_ACS(ACS_HLINE);
+ PRINT_ACS(ACS_VLINE);
+ PRINT_ACS(ACS_PLUS);
+ PRINT_ACS(ACS_S1);
+ PRINT_ACS(ACS_S9);
+ PRINT_ACS(ACS_DIAMOND);
+ PRINT_ACS(ACS_CKBOARD);
+ PRINT_ACS(ACS_DEGREE);
+ PRINT_ACS(ACS_PLMINUS);
+ PRINT_ACS(ACS_BULLET);
+ PRINT_ACS(ACS_LARROW);
+ PRINT_ACS(ACS_RARROW);
+ PRINT_ACS(ACS_DARROW);
+ PRINT_ACS(ACS_UARROW);
+ PRINT_ACS(ACS_BOARD);
+ PRINT_ACS(ACS_LANTERN);
+ PRINT_ACS(ACS_BLOCK);
+ PRINT_ACS(ACS_S3);
+ PRINT_ACS(ACS_S7);
+ PRINT_ACS(ACS_LEQUAL);
+ PRINT_ACS(ACS_GEQUAL);
+ PRINT_ACS(ACS_PI);
+ PRINT_ACS(ACS_NEQUAL);
+ PRINT_ACS(ACS_STERLING);
+
+ print_comment("Menu_Options from opts(3MENU)");
+ PRINT_NAMED_BITMASK(Menu_Options, O_ONEVALUE);
+ PRINT_NAMED_BITMASK(Menu_Options, O_SHOWDESC);
+ PRINT_NAMED_BITMASK(Menu_Options, O_ROWMAJOR);
+ PRINT_NAMED_BITMASK(Menu_Options, O_IGNORECASE);
+ PRINT_NAMED_BITMASK(Menu_Options, O_SHOWMATCH);
+ PRINT_NAMED_BITMASK(Menu_Options, O_NONCYCLIC);
+ print_constant("Menu_Options_Size", 8 * sizeof(Menu_Options));
+
+ print_comment("Item_Options from menu_opts(3MENU)");
+ PRINT_NAMED_BITMASK(Item_Options, O_SELECTABLE);
+ print_constant("Item_Options_Size", 8 * sizeof(Item_Options));
+
+ print_comment("Field_Options from field_opts(3FORM)");
+ PRINT_NAMED_BITMASK(Field_Options, O_VISIBLE);
+ PRINT_NAMED_BITMASK(Field_Options, O_ACTIVE);
+ PRINT_NAMED_BITMASK(Field_Options, O_PUBLIC);
+ PRINT_NAMED_BITMASK(Field_Options, O_EDIT);
+ PRINT_NAMED_BITMASK(Field_Options, O_WRAP);
+ PRINT_NAMED_BITMASK(Field_Options, O_BLANK);
+ PRINT_NAMED_BITMASK(Field_Options, O_AUTOSKIP);
+ PRINT_NAMED_BITMASK(Field_Options, O_NULLOK);
+ PRINT_NAMED_BITMASK(Field_Options, O_PASSOK);
+ PRINT_NAMED_BITMASK(Field_Options, O_STATIC);
+ print_constant("Field_Options_Size", 8 * sizeof(Field_Options));
+
+ print_comment("Field_Options from opts(3FORM)");
+ PRINT_NAMED_BITMASK(Field_Options, O_NL_OVERLOAD);
+ PRINT_NAMED_BITMASK(Field_Options, O_BS_OVERLOAD);
+ /* Field_Options_Size is defined below */
+
+ print_comment("MEVENT structure from mouse(3NCURSES)");
+ STRUCT_OFFSET(MEVENT, id);
+ STRUCT_OFFSET(MEVENT, x);
+ STRUCT_OFFSET(MEVENT, y);
+ STRUCT_OFFSET(MEVENT, z);
+ STRUCT_OFFSET(MEVENT, bstate);
+ print_constant("MEVENT_Size", 8 * sizeof(MEVENT));
+
+ print_comment("mouse events from mouse(3NCURSES)");
+ {
+ mmask_t all_events;
+
+#define PRINT_MOUSE_EVENT(event) \
+ print_constant (#event, event); \
+ all_events |= event
+
+ all_events = 0;
+ PRINT_MOUSE_EVENT(BUTTON1_RELEASED);
+ PRINT_MOUSE_EVENT(BUTTON1_PRESSED);
+ PRINT_MOUSE_EVENT(BUTTON1_CLICKED);
+ PRINT_MOUSE_EVENT(BUTTON1_DOUBLE_CLICKED);
+ PRINT_MOUSE_EVENT(BUTTON1_TRIPLE_CLICKED);
+#ifdef BUTTON1_RESERVED_EVENT
+ PRINT_MOUSE_EVENT(BUTTON1_RESERVED_EVENT);
#endif
- break;
- case '3': /* patch level */
-#ifdef NCURSES_VERSION_PATCH
- printf("%d", NCURSES_VERSION_PATCH);
+ print_constant("all_events_button_1", (long)all_events);
+
+ all_events = 0;
+ PRINT_MOUSE_EVENT(BUTTON2_RELEASED);
+ PRINT_MOUSE_EVENT(BUTTON2_PRESSED);
+ PRINT_MOUSE_EVENT(BUTTON2_CLICKED);
+ PRINT_MOUSE_EVENT(BUTTON2_DOUBLE_CLICKED);
+ PRINT_MOUSE_EVENT(BUTTON2_TRIPLE_CLICKED);
+#ifdef BUTTON2_RESERVED_EVENT
+ PRINT_MOUSE_EVENT(BUTTON2_RESERVED_EVENT);
#endif
- break;
- default:
- break;
- }
- }
- break;
- /* --------------------------------------------------------------- */
- default:
- break;
- }
- return 0;
+ print_constant("all_events_button_2", (long)all_events);
+
+ all_events = 0;
+ PRINT_MOUSE_EVENT(BUTTON3_RELEASED);
+ PRINT_MOUSE_EVENT(BUTTON3_PRESSED);
+ PRINT_MOUSE_EVENT(BUTTON3_CLICKED);
+ PRINT_MOUSE_EVENT(BUTTON3_DOUBLE_CLICKED);
+ PRINT_MOUSE_EVENT(BUTTON3_TRIPLE_CLICKED);
+#ifdef BUTTON3_RESERVED_EVENT
+ PRINT_MOUSE_EVENT(BUTTON3_RESERVED_EVENT);
+#endif
+ print_constant("all_events_button_3", (long)all_events);
+
+ all_events = 0;
+ PRINT_MOUSE_EVENT(BUTTON4_RELEASED);
+ PRINT_MOUSE_EVENT(BUTTON4_PRESSED);
+ PRINT_MOUSE_EVENT(BUTTON4_CLICKED);
+ PRINT_MOUSE_EVENT(BUTTON4_DOUBLE_CLICKED);
+ PRINT_MOUSE_EVENT(BUTTON4_TRIPLE_CLICKED);
+#ifdef BUTTON4_RESERVED_EVENT
+ PRINT_MOUSE_EVENT(BUTTON4_RESERVED_EVENT);
+#endif
+ print_constant("all_events_button_4", (long)all_events);
+ }
+ PRINT_NAMED_CONSTANT(BUTTON_CTRL);
+ PRINT_NAMED_CONSTANT(BUTTON_SHIFT);
+ PRINT_NAMED_CONSTANT(BUTTON_ALT);
+ PRINT_NAMED_CONSTANT(REPORT_MOUSE_POSITION);
+ PRINT_NAMED_CONSTANT(ALL_MOUSE_EVENTS);
+
+ print_comment("trace selection from trace(3NCURSES)");
+ PRINT_NAMED_BITMASK(UINT, TRACE_TIMES);
+ PRINT_NAMED_BITMASK(UINT, TRACE_TPUTS);
+ PRINT_NAMED_BITMASK(UINT, TRACE_UPDATE);
+ PRINT_NAMED_BITMASK(UINT, TRACE_MOVE);
+ PRINT_NAMED_BITMASK(UINT, TRACE_CHARPUT);
+ PRINT_NAMED_BITMASK(UINT, TRACE_CALLS);
+ PRINT_NAMED_BITMASK(UINT, TRACE_VIRTPUT);
+ PRINT_NAMED_BITMASK(UINT, TRACE_IEVENT);
+ PRINT_NAMED_BITMASK(UINT, TRACE_BITS);
+ PRINT_NAMED_BITMASK(UINT, TRACE_ICALLS);
+ PRINT_NAMED_BITMASK(UINT, TRACE_CCALLS);
+ PRINT_NAMED_BITMASK(UINT, TRACE_DATABASE);
+ PRINT_NAMED_BITMASK(UINT, TRACE_ATTRS);
+ print_constant("Trace_Size", 8 * sizeof(UINT));
+
+ printf("end Terminal_Interface.Curses_Constants;\n");
+ exit(EXIT_SUCCESS);
}
diff --git a/Ada95/gen/terminal_interface-curses-aux.ads.m4 b/Ada95/gen/terminal_interface-curses-aux.ads.m4
index e0c9348..b90b8dd 100644
--- a/Ada95/gen/terminal_interface-curses-aux.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-aux.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- 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 --
@@ -38,14 +38,12 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.16 $
+-- $Revision: 1.23 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-include(`Base_Defs')
with System;
with Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
-with Unchecked_Conversion;
package Terminal_Interface.Curses.Aux is
pragma Preelaborate (Terminal_Interface.Curses.Aux);
@@ -60,41 +58,41 @@
subtype C_ULong is Interfaces.C.unsigned_long;
subtype C_Char_Ptr is Interfaces.C.Strings.chars_ptr;
type C_Void_Ptr is new System.Address;
-include(`Chtype_Def')
+
-- This is how those constants are defined in ncurses. I see them also
-- exactly like this in all ETI implementations I ever tested. So it
-- could be that this is quite general, but please check with your curses.
- -- This is critical, because curses sometime mixes boolean returns with
+ -- This is critical, because curses sometime mixes Boolean returns with
-- returning an error status.
- Curses_Ok : constant C_Int := CF_CURSES_OK;
- Curses_Err : constant C_Int := CF_CURSES_ERR;
+ Curses_Ok : constant C_Int := Curses_Constants.OK;
+ Curses_Err : constant C_Int := Curses_Constants.ERR;
- Curses_True : constant C_Int := CF_CURSES_TRUE;
- Curses_False : constant C_Int := CF_CURSES_FALSE;
+ Curses_True : constant C_Int := Curses_Constants.TRUE;
+ Curses_False : constant C_Int := Curses_Constants.FALSE;
-- Eti_Error: type for error codes returned by the menu and form subsystem
-include(`Eti_Defs')
+ type Eti_Error is
+ (E_Current,
+ E_Invalid_Field,
+ E_Request_Denied,
+ E_Not_Connected,
+ E_Not_Selectable,
+ E_No_Match,
+ E_Unknown_Command,
+ E_Not_Posted,
+ E_No_Room,
+ E_Bad_State,
+ E_Connected,
+ E_Posted,
+ E_Bad_Argument,
+ E_System_Error,
+ E_Ok);
+
procedure Eti_Exception (Code : Eti_Error);
- -- Dispatch the error code and raise the appropriate exception
- --
- --
- -- Some helpers
- function Chtype_To_AttrChar is new
- Unchecked_Conversion (Source => C_Chtype,
- Target => Attributed_Character);
- function AttrChar_To_Chtype is new
- Unchecked_Conversion (Source => Attributed_Character,
- Target => C_Chtype);
+ -- Do nothing if Code = E_Ok.
+ -- Else dispatch the error code and raise the appropriate exception.
- function AttrChar_To_AttrType is new
- Unchecked_Conversion (Source => Attributed_Character,
- Target => C_AttrType);
-
- function AttrType_To_AttrChar is new
- Unchecked_Conversion (Source => C_AttrType,
- Target => Attributed_Character);
-
- procedure Fill_String (Cp : in chars_ptr;
+ procedure Fill_String (Cp : chars_ptr;
Str : out String);
-- Fill the Str parameter with the string denoted by the chars_ptr
-- C-Style string.
@@ -102,4 +100,23 @@
function Fill_String (Cp : chars_ptr) return String;
-- Same but as function.
+private
+ for Eti_Error'Size use C_Int'Size;
+ pragma Convention (C, Eti_Error);
+ for Eti_Error use
+ (E_Current => Curses_Constants.E_CURRENT,
+ E_Invalid_Field => Curses_Constants.E_INVALID_FIELD,
+ E_Request_Denied => Curses_Constants.E_REQUEST_DENIED,
+ E_Not_Connected => Curses_Constants.E_NOT_CONNECTED,
+ E_Not_Selectable => Curses_Constants.E_NOT_SELECTABLE,
+ E_No_Match => Curses_Constants.E_NO_MATCH,
+ E_Unknown_Command => Curses_Constants.E_UNKNOWN_COMMAND,
+ E_Not_Posted => Curses_Constants.E_NOT_POSTED,
+ E_No_Room => Curses_Constants.E_NO_ROOM,
+ E_Bad_State => Curses_Constants.E_BAD_STATE,
+ E_Connected => Curses_Constants.E_CONNECTED,
+ E_Posted => Curses_Constants.E_POSTED,
+ E_Bad_Argument => Curses_Constants.E_BAD_ARGUMENT,
+ E_System_Error => Curses_Constants.E_SYSTEM_ERROR,
+ E_Ok => Curses_Constants.E_OK);
end Terminal_Interface.Curses.Aux;
diff --git a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4
index 8819844..51682cd 100644
--- a/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-forms-field_types.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- 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 --
@@ -38,10 +38,11 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.14 $
+-- $Revision: 1.19 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C;
+with Terminal_Interface.Curses.Aux;
package Terminal_Interface.Curses.Forms.Field_Types is
pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types);
@@ -64,8 +65,8 @@
type Field_Type_Access is access all Field_Type'Class;
-- ANCHOR(`set_field_type()',`Set_Type')
- procedure Set_Field_Type (Fld : in Field;
- Fld_Type : in Field_Type) is abstract;
+ procedure Set_Field_Type (Fld : Field;
+ Fld_Type : Field_Type) is abstract;
-- AKA
-- But: we hide the vararg mechanism of the C interface. You always
-- have to pass a single Field_Type parameter.
@@ -75,7 +76,7 @@
-- MANPAGE(`form_field_validation.3x')
-- ANCHOR(`field_type()',`Get_Type')
- function Get_Type (Fld : in Field) return Field_Type_Access;
+ function Get_Type (Fld : Field) return Field_Type_Access;
-- AKA
-- ALIAS(`field_arg()')
-- In Ada95 we can combine these. If you try to retrieve the field type
@@ -101,15 +102,15 @@
pragma Convention (C, Freearg_Function);
type Field_Check_Function is access
- function (Fld : Field; Usr : System.Address) return C_Int;
+ function (Fld : Field; Usr : System.Address) return Curses_Bool;
pragma Convention (C, Field_Check_Function);
type Char_Check_Function is access
- function (Ch : C_Int; Usr : System.Address) return C_Int;
+ function (Ch : C_Int; Usr : System.Address) return Curses_Bool;
pragma Convention (C, Char_Check_Function);
type Choice_Function is access
- function (Fld : Field; Usr : System.Address) return C_Int;
+ function (Fld : Field; Usr : System.Address) return Curses_Bool;
pragma Convention (C, Choice_Function);
-- +----------------------------------------------------------------------
@@ -117,7 +118,7 @@
-- |
type Low_Level_Field_Type is
record
- Status : Interfaces.C.short;
+ Status : Interfaces.C.unsigned_short;
Ref_Count : Interfaces.C.long;
Left, Right : System.Address;
Makearg : Makearg_Function;
@@ -159,7 +160,7 @@
-- Any other value will raise a Form_Exception.
function Make_Arg (Args : System.Address) return System.Address;
- pragma Convention (C, Make_Arg);
+ pragma Import (C, Make_Arg, "void_star_make_arg");
-- This is the Makearg_Function for the internal low-level types
-- introduced by this binding.
@@ -174,7 +175,7 @@
-- introduced by this binding.
function Field_Check_Router (Fld : Field;
- Usr : System.Address) return C_Int;
+ Usr : System.Address) return Curses_Bool;
pragma Convention (C, Field_Check_Router);
-- This is the Field_Check_Function for the internal low-level types
-- introduced to wrap the low-level types by a Field_Type derived
@@ -182,7 +183,7 @@
-- function.
function Char_Check_Router (Ch : C_Int;
- Usr : System.Address) return C_Int;
+ Usr : System.Address) return Curses_Bool;
pragma Convention (C, Char_Check_Router);
-- This is the Char_Check_Function for the internal low-level types
-- introduced to wrap the low-level types by a Field_Type derived
@@ -190,7 +191,7 @@
-- function.
function Next_Router (Fld : Field;
- Usr : System.Address) return C_Int;
+ Usr : System.Address) return Curses_Bool;
pragma Convention (C, Next_Router);
-- This is the Choice_Function for the internal low-level types
-- introduced to wrap the low-level types by a Field_Type derived
@@ -198,7 +199,7 @@
-- function.
function Prev_Router (Fld : Field;
- Usr : System.Address) return C_Int;
+ Usr : System.Address) return Curses_Bool;
pragma Convention (C, Prev_Router);
-- This is the Choice_Function for the internal low-level types
-- introduced to wrap the low-level types by a Field_Type derived
@@ -227,12 +228,12 @@
Mak : Makearg_Function := Make_Arg'Access;
Cop : Copyarg_Function := Copy_Arg'Access;
Fre : Freearg_Function := Free_Arg'Access)
- return C_Int;
+ return Aux.Eti_Error;
pragma Import (C, Set_Fieldtype_Arg, "set_fieldtype_arg");
function Set_Fieldtype_Choice (Cft : C_Field_Type;
Next, Prev : Choice_Function)
- return C_Int;
+ return Aux.Eti_Error;
pragma Import (C, Set_Fieldtype_Choice, "set_fieldtype_choice");
end Terminal_Interface.Curses.Forms.Field_Types;
diff --git a/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4
index 4139883..9de700b 100644
--- a/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- 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 --
@@ -38,7 +38,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.15 $
+-- $Revision: 1.16 $
-- Binding Version 01.00
------------------------------------------------------------------------------
@@ -51,18 +51,18 @@
-- MANPAGE(`form_field_userptr.3x')
-- ANCHOR(`set_field_userptr',`Set_User_Data')
- procedure Set_User_Data (Fld : in Field;
- Data : in User_Access);
+ procedure Set_User_Data (Fld : Field;
+ Data : User_Access);
-- AKA
pragma Inline (Set_User_Data);
-- ANCHOR(`field_userptr',`Get_User_Data')
- procedure Get_User_Data (Fld : in Field;
+ procedure Get_User_Data (Fld : Field;
Data : out User_Access);
-- AKA
-- ANCHOR(`field_userptr',`Get_User_Data')
- function Get_User_Data (Fld : in Field) return User_Access;
+ function Get_User_Data (Fld : Field) return User_Access;
-- AKA
-- Sama as function
pragma Inline (Get_User_Data);
diff --git a/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4
index 0c4420d..f7fb1a7 100644
--- a/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- 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 --
@@ -38,7 +38,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.14 $
+-- $Revision: 1.15 $
-- Binding Version 01.00
------------------------------------------------------------------------------
@@ -51,18 +51,18 @@
-- MANPAGE(`form_userptr.3x')
-- ANCHOR(`set_form_userptr',`Set_User_Data')
- procedure Set_User_Data (Frm : in Form;
- Data : in User_Access);
+ procedure Set_User_Data (Frm : Form;
+ Data : User_Access);
-- AKA
pragma Inline (Set_User_Data);
-- ANCHOR(`form_userptr',`Get_User_Data')
- procedure Get_User_Data (Frm : in Form;
+ procedure Get_User_Data (Frm : Form;
Data : out User_Access);
-- AKA
-- ANCHOR(`form_userptr',`Get_User_Data')
- function Get_User_Data (Frm : in Form) return User_Access;
+ function Get_User_Data (Frm : Form) return User_Access;
-- AKA
-- Same as function
pragma Inline (Get_User_Data);
diff --git a/Ada95/gen/terminal_interface-curses-forms.ads.m4 b/Ada95/gen/terminal_interface-curses-forms.ads.m4
index 5b75edb..b269f4c 100644
--- a/Ada95/gen/terminal_interface-curses-forms.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-forms.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc. --
+-- 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 --
@@ -38,18 +38,17 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.29 $
--- $Date: 2006/06/25 14:30:21 $
+-- $Revision: 1.33 $
+-- $Date: 2014/05/24 21:31:57 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-include(`Form_Base_Defs')
with System;
with Ada.Characters.Latin_1;
package Terminal_Interface.Curses.Forms is
pragma Preelaborate (Terminal_Interface.Curses.Forms);
-include(`Form_Linker_Options')dnl
-include(`Linker_Options')
+ pragma Linker_Options ("-lform" & Curses_Constants.DFT_ARG_SUFFIX);
+
Space : Character renames Ada.Characters.Latin_1.Space;
type Field is private;
@@ -63,18 +62,68 @@
Center,
Right);
- pragma Warnings (Off);
-include(`Field_Rep')Dnl
+ type Field_Option_Set is
+ record
+ Visible : Boolean;
+ Active : Boolean;
+ Public : Boolean;
+ Edit : Boolean;
+ Wrap : Boolean;
+ Blank : Boolean;
+ Auto_Skip : Boolean;
+ Null_Ok : Boolean;
+ Pass_Ok : Boolean;
+ Static : Boolean;
+ end record;
+ pragma Convention (C_Pass_By_Copy, Field_Option_Set);
+ for Field_Option_Set use
+ record
+ Visible at 0 range Curses_Constants.O_VISIBLE_First
+ .. Curses_Constants.O_VISIBLE_Last;
+ Active at 0 range Curses_Constants.O_ACTIVE_First
+ .. Curses_Constants.O_ACTIVE_Last;
+ Public at 0 range Curses_Constants.O_PUBLIC_First
+ .. Curses_Constants.O_PUBLIC_Last;
+ Edit at 0 range Curses_Constants.O_EDIT_First
+ .. Curses_Constants.O_EDIT_Last;
+ Wrap at 0 range Curses_Constants.O_WRAP_First
+ .. Curses_Constants.O_WRAP_Last;
+ Blank at 0 range Curses_Constants.O_BLANK_First
+ .. Curses_Constants.O_BLANK_Last;
+ Auto_Skip at 0 range Curses_Constants.O_AUTOSKIP_First
+ .. Curses_Constants.O_AUTOSKIP_Last;
+ Null_Ok at 0 range Curses_Constants.O_NULLOK_First
+ .. Curses_Constants.O_NULLOK_Last;
+ Pass_Ok at 0 range Curses_Constants.O_PASSOK_First
+ .. Curses_Constants.O_PASSOK_Last;
+ Static at 0 range Curses_Constants.O_STATIC_First
+ .. Curses_Constants.O_STATIC_Last;
+ end record;
+ pragma Warnings (Off);
+ for Field_Option_Set'Size use Curses_Constants.Field_Options_Size;
pragma Warnings (On);
function Default_Field_Options return Field_Option_Set;
-- The initial defaults for the field options.
pragma Inline (Default_Field_Options);
- pragma Warnings (Off);
-include(`Form_Opt_Rep')Dnl
+ type Form_Option_Set is
+ record
+ NL_Overload : Boolean;
+ BS_Overload : Boolean;
+ end record;
+ pragma Convention (C_Pass_By_Copy, Form_Option_Set);
+ for Form_Option_Set use
+ record
+ NL_Overload at 0 range Curses_Constants.O_NL_OVERLOAD_First
+ .. Curses_Constants.O_NL_OVERLOAD_Last;
+ BS_Overload at 0 range Curses_Constants.O_BS_OVERLOAD_First
+ .. Curses_Constants.O_BS_OVERLOAD_Last;
+ end record;
+ pragma Warnings (Off);
+ for Form_Option_Set'Size use Curses_Constants.Field_Options_Size;
pragma Warnings (On);
function Default_Form_Options return Form_Option_Set;
@@ -89,7 +138,7 @@
type Field_Array_Access is access Field_Array;
procedure Free (FA : in out Field_Array_Access;
- Free_Fields : in Boolean := False);
+ Free_Fields : Boolean := False);
-- Release the memory for an allocated field array
-- If Free_Fields is True, call Delete() for all the fields in
-- the array.
@@ -228,7 +277,7 @@
REQ_NEXT_CHOICE : Form_Request_Code renames F_Next_Choice;
REQ_PREV_CHOICE : Form_Request_Code renames F_Previous_Choice;
- procedure Request_Name (Key : in Form_Request_Code;
+ procedure Request_Name (Key : Form_Request_Code;
Name : out String);
function Request_Name (Key : Form_Request_Code) return String;
@@ -287,8 +336,8 @@
-- MANPAGE(`form_field_just.3x')
-- ANCHOR(`set_field_just()',`Set_Justification')
- procedure Set_Justification (Fld : in Field;
- Just : in Field_Justification := None);
+ procedure Set_Justification (Fld : Field;
+ Just : Field_Justification := None);
-- AKA
pragma Inline (Set_Justification);
@@ -301,29 +350,29 @@
-- ANCHOR(`set_field_buffer()',`Set_Buffer')
procedure Set_Buffer
- (Fld : in Field;
- Buffer : in Buffer_Number := Buffer_Number'First;
- Str : in String);
+ (Fld : Field;
+ Buffer : Buffer_Number := Buffer_Number'First;
+ Str : String);
-- AKA
-- Not inlined
-- ANCHOR(`field_buffer()',`Get_Buffer')
procedure Get_Buffer
- (Fld : in Field;
- Buffer : in Buffer_Number := Buffer_Number'First;
+ (Fld : Field;
+ Buffer : Buffer_Number := Buffer_Number'First;
Str : out String);
-- AKA
function Get_Buffer
- (Fld : in Field;
- Buffer : in Buffer_Number := Buffer_Number'First) return String;
+ (Fld : Field;
+ Buffer : Buffer_Number := Buffer_Number'First) return String;
-- AKA
-- Same but as function
pragma Inline (Get_Buffer);
-- ANCHOR(`set_field_status()',`Set_Status')
- procedure Set_Status (Fld : in Field;
- Status : in Boolean := True);
+ procedure Set_Status (Fld : Field;
+ Status : Boolean := True);
-- AKA
pragma Inline (Set_Status);
@@ -333,29 +382,29 @@
pragma Inline (Changed);
-- ANCHOR(`set_field_max()',`Set_Maximum_Size')
- procedure Set_Maximum_Size (Fld : in Field;
- Max : in Natural := 0);
+ procedure Set_Maximum_Size (Fld : Field;
+ Max : Natural := 0);
-- AKA
pragma Inline (Set_Maximum_Size);
-- MANPAGE(`form_field_opts.3x')
-- ANCHOR(`set_field_opts()',`Set_Options')
- procedure Set_Options (Fld : in Field;
- Options : in Field_Option_Set);
+ procedure Set_Options (Fld : Field;
+ Options : Field_Option_Set);
-- AKA
-- An overloaded version is defined later. Pragma Inline appears there
-- ANCHOR(`field_opts_on()',`Switch_Options')
- procedure Switch_Options (Fld : in Field;
- Options : in Field_Option_Set;
+ procedure Switch_Options (Fld : Field;
+ Options : Field_Option_Set;
On : Boolean := True);
-- AKA
-- ALIAS(`field_opts_off()')
-- An overloaded version is defined later. Pragma Inline appears there
-- ANCHOR(`field_opts()',`Get_Options')
- procedure Get_Options (Fld : in Field;
+ procedure Get_Options (Fld : Field;
Options : out Field_Option_Set);
-- AKA
@@ -369,19 +418,19 @@
-- ANCHOR(`set_field_fore()',`Set_Foreground')
procedure Set_Foreground
- (Fld : in Field;
- Fore : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First);
+ (Fld : Field;
+ Fore : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First);
-- AKA
pragma Inline (Set_Foreground);
-- ANCHOR(`field_fore()',`Foreground')
- procedure Foreground (Fld : in Field;
+ procedure Foreground (Fld : Field;
Fore : out Character_Attribute_Set);
-- AKA
-- ANCHOR(`field_fore()',`Foreground')
- procedure Foreground (Fld : in Field;
+ procedure Foreground (Fld : Field;
Fore : out Character_Attribute_Set;
Color : out Color_Pair);
-- AKA
@@ -389,32 +438,32 @@
-- ANCHOR(`set_field_back()',`Set_Background')
procedure Set_Background
- (Fld : in Field;
- Back : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First);
+ (Fld : Field;
+ Back : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First);
-- AKA
pragma Inline (Set_Background);
-- ANCHOR(`field_back()',`Background')
- procedure Background (Fld : in Field;
+ procedure Background (Fld : Field;
Back : out Character_Attribute_Set);
-- AKA
-- ANCHOR(`field_back()',`Background')
- procedure Background (Fld : in Field;
+ procedure Background (Fld : Field;
Back : out Character_Attribute_Set;
Color : out Color_Pair);
-- AKA
pragma Inline (Background);
-- ANCHOR(`set_field_pad()',`Set_Pad_Character')
- procedure Set_Pad_Character (Fld : in Field;
- Pad : in Character := Space);
+ procedure Set_Pad_Character (Fld : Field;
+ Pad : Character := Space);
-- AKA
pragma Inline (Set_Pad_Character);
-- ANCHOR(`field_pad()',`Pad_Character')
- procedure Pad_Character (Fld : in Field;
+ procedure Pad_Character (Fld : Field;
Pad : out Character);
-- AKA
pragma Inline (Pad_Character);
@@ -422,7 +471,7 @@
-- MANPAGE(`form_field_info.3x')
-- ANCHOR(`field_info()',`Info')
- procedure Info (Fld : in Field;
+ procedure Info (Fld : Field;
Lines : out Line_Count;
Columns : out Column_Count;
First_Row : out Line_Position;
@@ -433,7 +482,7 @@
pragma Inline (Info);
-- ANCHOR(`dynamic_field_info()',`Dynamic_Info')
- procedure Dynamic_Info (Fld : in Field;
+ procedure Dynamic_Info (Fld : Field;
Lines : out Line_Count;
Columns : out Column_Count;
Max : out Natural);
@@ -443,8 +492,8 @@
-- MANPAGE(`form_win.3x')
-- ANCHOR(`set_form_win()',`Set_Window')
- procedure Set_Window (Frm : in Form;
- Win : in Window);
+ procedure Set_Window (Frm : Form;
+ Win : Window);
-- AKA
pragma Inline (Set_Window);
@@ -454,8 +503,8 @@
pragma Inline (Get_Window);
-- ANCHOR(`set_form_sub()',`Set_Sub_Window')
- procedure Set_Sub_Window (Frm : in Form;
- Win : in Window);
+ procedure Set_Sub_Window (Frm : Form;
+ Win : Window);
-- AKA
pragma Inline (Set_Sub_Window);
@@ -465,7 +514,7 @@
pragma Inline (Get_Sub_Window);
-- ANCHOR(`scale_form()',`Scale')
- procedure Scale (Frm : in Form;
+ procedure Scale (Frm : Form;
Lines : out Line_Count;
Columns : out Column_Count);
-- AKA
@@ -473,30 +522,30 @@
-- MANPAGE(`form_hook.3x')
- type Form_Hook_Function is access procedure (Frm : in Form);
+ type Form_Hook_Function is access procedure (Frm : Form);
pragma Convention (C, Form_Hook_Function);
-- ANCHOR(`set_field_init()',`Set_Field_Init_Hook')
- procedure Set_Field_Init_Hook (Frm : in Form;
- Proc : in Form_Hook_Function);
+ procedure Set_Field_Init_Hook (Frm : Form;
+ Proc : Form_Hook_Function);
-- AKA
pragma Inline (Set_Field_Init_Hook);
-- ANCHOR(`set_field_term()',`Set_Field_Term_Hook')
- procedure Set_Field_Term_Hook (Frm : in Form;
- Proc : in Form_Hook_Function);
+ procedure Set_Field_Term_Hook (Frm : Form;
+ Proc : Form_Hook_Function);
-- AKA
pragma Inline (Set_Field_Term_Hook);
-- ANCHOR(`set_form_init()',`Set_Form_Init_Hook')
- procedure Set_Form_Init_Hook (Frm : in Form;
- Proc : in Form_Hook_Function);
+ procedure Set_Form_Init_Hook (Frm : Form;
+ Proc : Form_Hook_Function);
-- AKA
pragma Inline (Set_Form_Init_Hook);
-- ANCHOR(`set_form_term()',`Set_Form_Term_Hook')
- procedure Set_Form_Term_Hook (Frm : in Form;
- Proc : in Form_Hook_Function);
+ procedure Set_Form_Term_Hook (Frm : Form;
+ Proc : Form_Hook_Function);
-- AKA
pragma Inline (Set_Form_Term_Hook);
@@ -523,14 +572,14 @@
-- MANPAGE(`form_field.3x')
-- ANCHOR(`set_form_fields()',`Redefine')
- procedure Redefine (Frm : in Form;
- Flds : in Field_Array_Access);
+ procedure Redefine (Frm : Form;
+ Flds : Field_Array_Access);
-- AKA
pragma Inline (Redefine);
-- ANCHOR(`set_form_fields()',`Set_Fields')
- procedure Set_Fields (Frm : in Form;
- Flds : in Field_Array_Access) renames Redefine;
+ procedure Set_Fields (Frm : Form;
+ Flds : Field_Array_Access) renames Redefine;
-- AKA
-- pragma Inline (Set_Fields);
@@ -546,9 +595,9 @@
pragma Inline (Field_Count);
-- ANCHOR(`move_field()',`Move')
- procedure Move (Fld : in Field;
- Line : in Line_Position;
- Column : in Column_Position);
+ procedure Move (Fld : Field;
+ Line : Line_Position;
+ Column : Column_Position);
-- AKA
pragma Inline (Move);
@@ -574,21 +623,21 @@
-- MANPAGE(`form_opts.3x')
-- ANCHOR(`set_form_opts()',`Set_Options')
- procedure Set_Options (Frm : in Form;
- Options : in Form_Option_Set);
+ procedure Set_Options (Frm : Form;
+ Options : Form_Option_Set);
-- AKA
pragma Inline (Set_Options);
-- ANCHOR(`form_opts_on()',`Switch_Options')
- procedure Switch_Options (Frm : in Form;
- Options : in Form_Option_Set;
+ procedure Switch_Options (Frm : Form;
+ Options : Form_Option_Set;
On : Boolean := True);
-- AKA
-- ALIAS(`form_opts_off()')
pragma Inline (Switch_Options);
-- ANCHOR(`form_opts()',`Get_Options')
- procedure Get_Options (Frm : in Form;
+ procedure Get_Options (Frm : Form;
Options : out Form_Option_Set);
-- AKA
@@ -600,8 +649,8 @@
-- MANPAGE(`form_post.3x')
-- ANCHOR(`post_form()',`Post')
- procedure Post (Frm : in Form;
- Post : in Boolean := True);
+ procedure Post (Frm : Form;
+ Post : Boolean := True);
-- AKA
-- ALIAS(`unpost_form()')
pragma Inline (Post);
@@ -643,19 +692,19 @@
type Page_Number is new Natural;
-- ANCHOR(`set_current_field()',`Set_Current')
- procedure Set_Current (Frm : in Form;
- Fld : in Field);
+ procedure Set_Current (Frm : Form;
+ Fld : Field);
-- AKA
pragma Inline (Set_Current);
-- ANCHOR(`current_field()',`Current')
- function Current (Frm : in Form) return Field;
+ function Current (Frm : Form) return Field;
-- AKA
pragma Inline (Current);
-- ANCHOR(`set_form_page()',`Set_Page')
- procedure Set_Page (Frm : in Form;
- Page : in Page_Number := Page_Number'First);
+ procedure Set_Page (Frm : Form;
+ Page : Page_Number := Page_Number'First);
-- AKA
pragma Inline (Set_Page);
@@ -675,8 +724,8 @@
-- MANPAGE(`form_new_page.3x')
-- ANCHOR(`set_new_page()',`Set_New_Page')
- procedure Set_New_Page (Fld : in Field;
- New_Page : in Boolean := True);
+ procedure Set_New_Page (Fld : Field;
+ New_Page : Boolean := True);
-- AKA
pragma Inline (Set_New_Page);
diff --git a/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4
index 14b2466..4ffa41b 100644
--- a/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc. --
+-- 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 --
@@ -38,8 +38,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.16 $
--- $Date: 2006/06/25 14:30:22 $
+-- $Revision: 1.17 $
+-- $Date: 2009/12/26 17:31:35 $
-- Binding Version 01.00
------------------------------------------------------------------------------
@@ -56,18 +56,18 @@
-- MANPAGE(`mitem_userptr.3x')
-- ANCHOR(`set_item_userptr',`Set_User_Data')
- procedure Set_User_Data (Itm : in Item;
- Data : in User_Access);
+ procedure Set_User_Data (Itm : Item;
+ Data : User_Access);
-- AKA
pragma Inline (Set_User_Data);
-- ANCHOR(`item_userptr',`Get_User_Data')
- procedure Get_User_Data (Itm : in Item;
+ procedure Get_User_Data (Itm : Item;
Data : out User_Access);
-- AKA
-- ANCHOR(`item_userptr',`Get_User_Data')
- function Get_User_Data (Itm : in Item) return User_Access;
+ function Get_User_Data (Itm : Item) return User_Access;
-- AKA
-- Same as function
pragma Inline (Get_User_Data);
diff --git a/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4
index 696149b..9138ba6 100644
--- a/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- 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 --
@@ -38,7 +38,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.14 $
+-- $Revision: 1.15 $
-- Binding Version 01.00
------------------------------------------------------------------------------
@@ -51,18 +51,18 @@
-- MANPAGE(`menu_userptr.3x')
-- ANCHOR(`set_menu_userptr',`Set_User_Data')
- procedure Set_User_Data (Men : in Menu;
- Data : in User_Access);
+ procedure Set_User_Data (Men : Menu;
+ Data : User_Access);
-- AKA
pragma Inline (Set_User_Data);
-- ANCHOR(`menu_userptr',`Get_User_Data')
- procedure Get_User_Data (Men : in Menu;
+ procedure Get_User_Data (Men : Menu;
Data : out User_Access);
-- AKA
-- ANCHOR(`menu_userptr',`Get_User_Data')
- function Get_User_Data (Men : in Menu) return User_Access;
+ function Get_User_Data (Men : Menu) return User_Access;
-- AKA
-- Same as function
pragma Inline (Get_User_Data);
diff --git a/Ada95/gen/terminal_interface-curses-menus.ads.m4 b/Ada95/gen/terminal_interface-curses-menus.ads.m4
index 17993e1..0ad9c45 100644
--- a/Ada95/gen/terminal_interface-curses-menus.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-menus.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc. --
+-- 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 --
@@ -38,18 +38,17 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.27 $
--- $Date: 2007/05/05 20:20:52 $
+-- $Revision: 1.31 $
+-- $Date: 2014/05/24 21:31:57 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-include(`Menu_Base_Defs')
with System;
with Ada.Characters.Latin_1;
package Terminal_Interface.Curses.Menus is
pragma Preelaborate (Terminal_Interface.Curses.Menus);
-include(`Menu_Linker_Options')dnl
-include(`Linker_Options')
+ pragma Linker_Options ("-lmenu" & Curses_Constants.DFT_ARG_SUFFIX);
+
Space : Character renames Ada.Characters.Latin_1.Space;
type Item is private;
@@ -102,7 +101,7 @@
REQ_NEXT_MATCH : Menu_Request_Code renames M_Next_Match;
REQ_PREV_MATCH : Menu_Request_Code renames M_Previous_Match;
- procedure Request_Name (Key : in Menu_Request_Code;
+ procedure Request_Name (Key : Menu_Request_Code;
Name : out String);
function Request_Name (Key : Menu_Request_Code) return String;
@@ -116,9 +115,34 @@
--
-- Menu options
--
- pragma Warnings (Off);
-include(`Menu_Opt_Rep')dnl
+ type Menu_Option_Set is
+ record
+ One_Valued : Boolean;
+ Show_Descriptions : Boolean;
+ Row_Major_Order : Boolean;
+ Ignore_Case : Boolean;
+ Show_Matches : Boolean;
+ Non_Cyclic : Boolean;
+ end record;
+ pragma Convention (C_Pass_By_Copy, Menu_Option_Set);
+ for Menu_Option_Set use
+ record
+ One_Valued at 0 range Curses_Constants.O_ONEVALUE_First
+ .. Curses_Constants.O_ONEVALUE_Last;
+ Show_Descriptions at 0 range Curses_Constants.O_SHOWDESC_First
+ .. Curses_Constants.O_SHOWDESC_Last;
+ Row_Major_Order at 0 range Curses_Constants.O_ROWMAJOR_First
+ .. Curses_Constants.O_ROWMAJOR_Last;
+ Ignore_Case at 0 range Curses_Constants.O_IGNORECASE_First
+ .. Curses_Constants.O_IGNORECASE_Last;
+ Show_Matches at 0 range Curses_Constants.O_SHOWMATCH_First
+ .. Curses_Constants.O_SHOWMATCH_Last;
+ Non_Cyclic at 0 range Curses_Constants.O_NONCYCLIC_First
+ .. Curses_Constants.O_NONCYCLIC_Last;
+ end record;
+ pragma Warnings (Off);
+ for Menu_Option_Set'Size use Curses_Constants.Menu_Options_Size;
pragma Warnings (On);
function Default_Menu_Options return Menu_Option_Set;
@@ -127,9 +151,19 @@
--
-- Item options
--
- pragma Warnings (Off);
-include(`Item_Rep')dnl
+ type Item_Option_Set is
+ record
+ Selectable : Boolean;
+ end record;
+ pragma Convention (C_Pass_By_Copy, Item_Option_Set);
+ for Item_Option_Set use
+ record
+ Selectable at 0 range Curses_Constants.O_SELECTABLE_First
+ .. Curses_Constants.O_SELECTABLE_Last;
+ end record;
+ pragma Warnings (Off);
+ for Item_Option_Set'Size use Curses_Constants.Item_Options_Size;
pragma Warnings (On);
function Default_Item_Options return Item_Option_Set;
@@ -172,8 +206,8 @@
-- MANPAGE(`mitem_value.3x')
-- ANCHOR(`set_item_value()',`Set_Value')
- procedure Set_Value (Itm : in Item;
- Value : in Boolean := True);
+ procedure Set_Value (Itm : Item;
+ Value : Boolean := True);
-- AKA
pragma Inline (Set_Value);
@@ -192,14 +226,14 @@
-- MANPAGE(`mitem_opts.3x')
-- ANCHOR(`set_item_opts()',`Set_Options')
- procedure Set_Options (Itm : in Item;
- Options : in Item_Option_Set);
+ procedure Set_Options (Itm : Item;
+ Options : Item_Option_Set);
-- AKA
-- An overloaded Set_Options is defined later. Pragma Inline appears there
-- ANCHOR(`item_opts_on()',`Switch_Options')
- procedure Switch_Options (Itm : in Item;
- Options : in Item_Option_Set;
+ procedure Switch_Options (Itm : Item;
+ Options : Item_Option_Set;
On : Boolean := True);
-- AKA
-- ALIAS(`item_opts_off()')
@@ -207,7 +241,7 @@
-- Pragma Inline appears there
-- ANCHOR(`item_opts()',`Get_Options')
- procedure Get_Options (Itm : in Item;
+ procedure Get_Options (Itm : Item;
Options : out Item_Option_Set);
-- AKA
@@ -219,7 +253,7 @@
-- MANPAGE(`mitem_name.3x')
-- ANCHOR(`item_name()',`Name')
- procedure Name (Itm : in Item;
+ procedure Name (Itm : Item;
Name : out String);
-- AKA
function Name (Itm : Item) return String;
@@ -228,7 +262,7 @@
pragma Inline (Name);
-- ANCHOR(`item_description();',`Description')
- procedure Description (Itm : in Item;
+ procedure Description (Itm : Item;
Description : out String);
-- AKA
@@ -240,8 +274,8 @@
-- MANPAGE(`mitem_current.3x')
-- ANCHOR(`set_current_item()',`Set_Current')
- procedure Set_Current (Men : in Menu;
- Itm : in Item);
+ procedure Set_Current (Men : Menu;
+ Itm : Item);
-- AKA
pragma Inline (Set_Current);
@@ -251,8 +285,8 @@
pragma Inline (Current);
-- ANCHOR(`set_top_row()',`Set_Top_Row')
- procedure Set_Top_Row (Men : in Menu;
- Line : in Line_Position);
+ procedure Set_Top_Row (Men : Menu;
+ Line : Line_Position);
-- AKA
pragma Inline (Set_Top_Row);
@@ -272,8 +306,8 @@
-- MANPAGE(`menu_post.3x')
-- ANCHOR(`post_menu()',`Post')
- procedure Post (Men : in Menu;
- Post : in Boolean := True);
+ procedure Post (Men : Menu;
+ Post : Boolean := True);
-- AKA
-- ALIAS(`unpost_menu()')
pragma Inline (Post);
@@ -281,21 +315,21 @@
-- MANPAGE(`menu_opts.3x')
-- ANCHOR(`set_menu_opts()',`Set_Options')
- procedure Set_Options (Men : in Menu;
- Options : in Menu_Option_Set);
+ procedure Set_Options (Men : Menu;
+ Options : Menu_Option_Set);
-- AKA
pragma Inline (Set_Options);
-- ANCHOR(`menu_opts_on()',`Switch_Options')
- procedure Switch_Options (Men : in Menu;
- Options : in Menu_Option_Set;
+ procedure Switch_Options (Men : Menu;
+ Options : Menu_Option_Set;
On : Boolean := True);
-- AKA
-- ALIAS(`menu_opts_off()')
pragma Inline (Switch_Options);
-- ANCHOR(`menu_opts()',`Get_Options')
- procedure Get_Options (Men : in Menu;
+ procedure Get_Options (Men : Menu;
Options : out Menu_Option_Set);
-- AKA
@@ -307,8 +341,8 @@
-- MANPAGE(`menu_win.3x')
-- ANCHOR(`set_menu_win()',`Set_Window')
- procedure Set_Window (Men : in Menu;
- Win : in Window);
+ procedure Set_Window (Men : Menu;
+ Win : Window);
-- AKA
pragma Inline (Set_Window);
@@ -318,8 +352,8 @@
pragma Inline (Get_Window);
-- ANCHOR(`set_menu_sub()',`Set_Sub_Window')
- procedure Set_Sub_Window (Men : in Menu;
- Win : in Window);
+ procedure Set_Sub_Window (Men : Menu;
+ Win : Window);
-- AKA
pragma Inline (Set_Sub_Window);
@@ -329,7 +363,7 @@
pragma Inline (Get_Sub_Window);
-- ANCHOR(`scale_menu()',`Scale')
- procedure Scale (Men : in Menu;
+ procedure Scale (Men : Menu;
Lines : out Line_Count;
Columns : out Column_Count);
-- AKA
@@ -345,13 +379,13 @@
-- MANPAGE(`menu_mark.3x')
-- ANCHOR(`set_menu_mark()',`Set_Mark')
- procedure Set_Mark (Men : in Menu;
- Mark : in String);
+ procedure Set_Mark (Men : Menu;
+ Mark : String);
-- AKA
pragma Inline (Set_Mark);
-- ANCHOR(`menu_mark()',`Mark')
- procedure Mark (Men : in Menu;
+ procedure Mark (Men : Menu;
Mark : out String);
-- AKA
@@ -364,19 +398,19 @@
-- ANCHOR(`set_menu_fore()',`Set_Foreground')
procedure Set_Foreground
- (Men : in Menu;
- Fore : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First);
+ (Men : Menu;
+ Fore : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First);
-- AKA
pragma Inline (Set_Foreground);
-- ANCHOR(`menu_fore()',`Foreground')
- procedure Foreground (Men : in Menu;
+ procedure Foreground (Men : Menu;
Fore : out Character_Attribute_Set);
-- AKA
-- ANCHOR(`menu_fore()',`Foreground')
- procedure Foreground (Men : in Menu;
+ procedure Foreground (Men : Menu;
Fore : out Character_Attribute_Set;
Color : out Color_Pair);
-- AKA
@@ -384,19 +418,19 @@
-- ANCHOR(`set_menu_back()',`Set_Background')
procedure Set_Background
- (Men : in Menu;
- Back : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First);
+ (Men : Menu;
+ Back : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First);
-- AKA
pragma Inline (Set_Background);
-- ANCHOR(`menu_back()',`Background')
- procedure Background (Men : in Menu;
+ procedure Background (Men : Menu;
Back : out Character_Attribute_Set);
-- AKA
-- ANCHOR(`menu_back()',`Background')
- procedure Background (Men : in Menu;
+ procedure Background (Men : Menu;
Back : out Character_Attribute_Set;
Color : out Color_Pair);
-- AKA
@@ -404,33 +438,33 @@
-- ANCHOR(`set_menu_grey()',`Set_Grey')
procedure Set_Grey
- (Men : in Menu;
- Grey : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First);
+ (Men : Menu;
+ Grey : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First);
-- AKA
pragma Inline (Set_Grey);
-- ANCHOR(`menu_grey()',`Grey')
- procedure Grey (Men : in Menu;
+ procedure Grey (Men : Menu;
Grey : out Character_Attribute_Set);
-- AKA
-- ANCHOR(`menu_grey()',`Grey')
procedure Grey
- (Men : in Menu;
+ (Men : Menu;
Grey : out Character_Attribute_Set;
Color : out Color_Pair);
-- AKA
pragma Inline (Grey);
-- ANCHOR(`set_menu_pad()',`Set_Pad_Character')
- procedure Set_Pad_Character (Men : in Menu;
- Pad : in Character := Space);
+ procedure Set_Pad_Character (Men : Menu;
+ Pad : Character := Space);
-- AKA
pragma Inline (Set_Pad_Character);
-- ANCHOR(`menu_pad()',`Pad_Character')
- procedure Pad_Character (Men : in Menu;
+ procedure Pad_Character (Men : Menu;
Pad : out Character);
-- AKA
pragma Inline (Pad_Character);
@@ -438,15 +472,15 @@
-- MANPAGE(`menu_spacing.3x')
-- ANCHOR(`set_menu_spacing()',`Set_Spacing')
- procedure Set_Spacing (Men : in Menu;
- Descr : in Column_Position := 0;
- Row : in Line_Position := 0;
- Col : in Column_Position := 0);
+ procedure Set_Spacing (Men : Menu;
+ Descr : Column_Position := 0;
+ Row : Line_Position := 0;
+ Col : Column_Position := 0);
-- AKA
pragma Inline (Set_Spacing);
-- ANCHOR(`menu_spacing()',`Spacing')
- procedure Spacing (Men : in Menu;
+ procedure Spacing (Men : Menu;
Descr : out Column_Position;
Row : out Line_Position;
Col : out Column_Position);
@@ -463,7 +497,7 @@
pragma Inline (Set_Pattern);
-- ANCHOR(`menu_pattern()',`Pattern')
- procedure Pattern (Men : in Menu;
+ procedure Pattern (Men : Menu;
Text : out String);
-- AKA
pragma Inline (Pattern);
@@ -471,9 +505,9 @@
-- MANPAGE(`menu_format.3x')
-- ANCHOR(`set_menu_format()',`Set_Format')
- procedure Set_Format (Men : in Menu;
- Lines : in Line_Count;
- Columns : in Column_Count);
+ procedure Set_Format (Men : Menu;
+ Lines : Line_Count;
+ Columns : Column_Count);
-- Not implemented: 0 argument for Lines or Columns;
-- instead use Format to get the current sizes
-- The default format is 16 rows, 1 column. Calling
@@ -485,7 +519,7 @@
pragma Inline (Set_Format);
-- ANCHOR(`menu_format()',`Format')
- procedure Format (Men : in Menu;
+ procedure Format (Men : Menu;
Lines : out Line_Count;
Columns : out Column_Count);
-- AKA
@@ -493,30 +527,30 @@
-- MANPAGE(`menu_hook.3x')
- type Menu_Hook_Function is access procedure (Men : in Menu);
+ type Menu_Hook_Function is access procedure (Men : Menu);
pragma Convention (C, Menu_Hook_Function);
-- ANCHOR(`set_item_init()',`Set_Item_Init_Hook')
- procedure Set_Item_Init_Hook (Men : in Menu;
- Proc : in Menu_Hook_Function);
+ procedure Set_Item_Init_Hook (Men : Menu;
+ Proc : Menu_Hook_Function);
-- AKA
pragma Inline (Set_Item_Init_Hook);
-- ANCHOR(`set_item_term()',`Set_Item_Term_Hook')
- procedure Set_Item_Term_Hook (Men : in Menu;
- Proc : in Menu_Hook_Function);
+ procedure Set_Item_Term_Hook (Men : Menu;
+ Proc : Menu_Hook_Function);
-- AKA
pragma Inline (Set_Item_Term_Hook);
-- ANCHOR(`set_menu_init()',`Set_Menu_Init_Hook')
- procedure Set_Menu_Init_Hook (Men : in Menu;
- Proc : in Menu_Hook_Function);
+ procedure Set_Menu_Init_Hook (Men : Menu;
+ Proc : Menu_Hook_Function);
-- AKA
pragma Inline (Set_Menu_Init_Hook);
-- ANCHOR(`set_menu_term()',`Set_Menu_Term_Hook')
- procedure Set_Menu_Term_Hook (Men : in Menu;
- Proc : in Menu_Hook_Function);
+ procedure Set_Menu_Term_Hook (Men : Menu;
+ Proc : Menu_Hook_Function);
-- AKA
pragma Inline (Set_Menu_Term_Hook);
@@ -543,13 +577,13 @@
-- MANPAGE(`menu_items.3x')
-- ANCHOR(`set_menu_items()',`Redefine')
- procedure Redefine (Men : in Menu;
- Items : in Item_Array_Access);
+ procedure Redefine (Men : Menu;
+ Items : Item_Array_Access);
-- AKA
pragma Inline (Redefine);
- procedure Set_Items (Men : in Menu;
- Items : in Item_Array_Access) renames Redefine;
+ procedure Set_Items (Men : Menu;
+ Items : Item_Array_Access) renames Redefine;
-- pragma Inline (Set_Items);
-- ANCHOR(`menu_items()',`Items')
diff --git a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 b/Ada95/gen/terminal_interface-curses-mouse.ads.m4
index b59ebbf..8d3f8ed 100644
--- a/Ada95/gen/terminal_interface-curses-mouse.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-mouse.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. --
+-- Copyright (c) 1998-2014,2015 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 --
@@ -38,21 +38,16 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.27 $
--- $Date: 2006/06/25 14:30:22 $
+-- $Revision: 1.32 $
+-- $Date: 2015/05/30 23:19:19 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-include(`Mouse_Base_Defs')
with System;
package Terminal_Interface.Curses.Mouse is
pragma Preelaborate (Terminal_Interface.Curses.Mouse);
-- MANPAGE(`curs_mouse.3x')
- -- Please note, that in ncurses-1.9.9e documentation mouse support
- -- is still marked as experimental. So also this binding will change
- -- if the ncurses methods change.
- --
-- mouse_trafo, wmouse_trafo are implemented as Transform_Coordinates
-- in the parent package.
--
@@ -95,20 +90,20 @@
-- Return true if a mouse device is supported, false otherwise.
procedure Register_Reportable_Event
- (Button : in Mouse_Button;
- State : in Button_State;
+ (Button : Mouse_Button;
+ State : Button_State;
Mask : in out Event_Mask);
-- Stores the event described by the button and the state in the mask.
- -- Before you call this the first time, you should init the mask
+ -- Before you call this the first time, you should initialize the mask
-- with the Empty_Mask constant
pragma Inline (Register_Reportable_Event);
procedure Register_Reportable_Events
- (Button : in Mouse_Button;
- State : in Button_States;
+ (Button : Mouse_Button;
+ State : Button_States;
Mask : in out Event_Mask);
-- Register all events described by the Button and the State bitmap.
- -- Before you call this the first time, you should init the mask
+ -- Before you call this the first time, you should initialize the mask
-- with the Empty_Mask constant
-- ANCHOR(`mousemask()',`Start_Mouse')
@@ -121,7 +116,7 @@
-- AKA
pragma Inline (Start_Mouse);
- procedure End_Mouse (Mask : in Event_Mask := No_Events);
+ procedure End_Mouse (Mask : Event_Mask := No_Events);
-- Terminates the mouse, restores the specified event mask
pragma Inline (End_Mouse);
@@ -130,7 +125,7 @@
-- AKA
pragma Inline (Get_Mouse);
- procedure Get_Event (Event : in Mouse_Event;
+ procedure Get_Event (Event : Mouse_Event;
Y : out Line_Position;
X : out Column_Position;
Button : out Mouse_Button;
@@ -142,7 +137,7 @@
pragma Inline (Get_Event);
-- ANCHOR(`ungetmouse()',`Unget_Mouse')
- procedure Unget_Mouse (Event : in Mouse_Event);
+ procedure Unget_Mouse (Event : Mouse_Event);
-- AKA
pragma Inline (Unget_Mouse);
@@ -159,7 +154,10 @@
pragma Inline (Mouse_Interval);
private
- type Event_Mask is new Interfaces.C.unsigned_long;
+ -- This can be as little as 32 bits (unsigned), or as long as the system's
+ -- unsigned long. Declare it as the minimum size to handle all valid
+ -- sizes.
+ type Event_Mask is mod 4294967296;
type Mouse_Event is
record
@@ -171,12 +169,35 @@
end record;
pragma Convention (C, Mouse_Event);
-include(`Mouse_Event_Rep')
- Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER;
- -- This constant may be different on your system.
+ for Mouse_Event use
+ record
+ Id at 0 range Curses_Constants.MEVENT_id_First
+ .. Curses_Constants.MEVENT_id_Last;
+ X at 0 range Curses_Constants.MEVENT_x_First
+ .. Curses_Constants.MEVENT_x_Last;
+ Y at 0 range Curses_Constants.MEVENT_y_First
+ .. Curses_Constants.MEVENT_y_Last;
+ Z at 0 range Curses_Constants.MEVENT_z_First
+ .. Curses_Constants.MEVENT_z_Last;
+ Bstate at 0 range Curses_Constants.MEVENT_bstate_First
+ .. Curses_Constants.MEVENT_bstate_Last;
+ end record;
+ for Mouse_Event'Size use Curses_Constants.MEVENT_Size;
+ Generation_Bit_Order : System.Bit_Order renames Curses_Constants.Bit_Order;
-include(`Mouse_Events')
- No_Events : constant Event_Mask := 0;
- All_Events : constant Event_Mask := ALL_MOUSE_EVENTS;
+ BUTTON_CTRL : constant Event_Mask := Curses_Constants.BUTTON_CTRL;
+ BUTTON_SHIFT : constant Event_Mask := Curses_Constants.BUTTON_SHIFT;
+ BUTTON_ALT : constant Event_Mask := Curses_Constants.BUTTON_ALT;
+ BUTTON1_EVENTS : constant Event_Mask
+ := Curses_Constants.all_events_button_1;
+ BUTTON2_EVENTS : constant Event_Mask
+ := Curses_Constants.all_events_button_2;
+ BUTTON3_EVENTS : constant Event_Mask
+ := Curses_Constants.all_events_button_3;
+ BUTTON4_EVENTS : constant Event_Mask
+ := Curses_Constants.all_events_button_4;
+ ALL_MOUSE_EVENTS : constant Event_Mask := Curses_Constants.ALL_MOUSE_EVENTS;
+ No_Events : constant Event_Mask := 0;
+ All_Events : constant Event_Mask := ALL_MOUSE_EVENTS;
end Terminal_Interface.Curses.Mouse;
diff --git a/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4
index e6def9b..03d8114 100644
--- a/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc. --
+-- 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 --
@@ -38,7 +38,7 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.14 $
+-- $Revision: 1.15 $
-- Binding Version 01.00
------------------------------------------------------------------------------
@@ -51,18 +51,18 @@
-- MANPAGE(`panel.3x')
-- ANCHOR(`set_panel_userptr',`Set_User_Data')
- procedure Set_User_Data (Pan : in Panel;
- Data : in User_Access);
+ procedure Set_User_Data (Pan : Panel;
+ Data : User_Access);
-- AKA
pragma Inline (Set_User_Data);
-- ANCHOR(`panel_userptr',`Get_User_Data')
- procedure Get_User_Data (Pan : in Panel;
+ procedure Get_User_Data (Pan : Panel;
Data : out User_Access);
-- AKA
-- ANCHOR(`panel_userptr',`Get_User_Data')
- function Get_User_Data (Pan : in Panel) return User_Access;
+ function Get_User_Data (Pan : Panel) return User_Access;
-- AKA
-- Same as function
pragma Inline (Get_User_Data);
diff --git a/Ada95/gen/terminal_interface-curses-panels.ads.m4 b/Ada95/gen/terminal_interface-curses-panels.ads.m4
index 39b7260..b0eda4d 100644
--- a/Ada95/gen/terminal_interface-curses-panels.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-panels.ads.m4
@@ -10,7 +10,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998,2006 Free Software Foundation, Inc. --
+-- 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 --
@@ -38,16 +38,16 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.19 $
--- $Date: 2006/06/25 14:30:22 $
+-- $Revision: 1.22 $
+-- $Date: 2014/05/24 21:31:57 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with System;
package Terminal_Interface.Curses.Panels is
pragma Preelaborate (Terminal_Interface.Curses.Panels);
-include(`Panel_Linker_Options')dnl
-include(`Linker_Options')
+ pragma Linker_Options ("-lpanel" & Curses_Constants.DFT_ARG_SUFFIX);
+
type Panel is private;
---------------------------
@@ -74,17 +74,17 @@
-- pragma Inline (New_Panel);
-- ANCHOR(`bottom_panel()',`Bottom')
- procedure Bottom (Pan : in Panel);
+ procedure Bottom (Pan : Panel);
-- AKA
pragma Inline (Bottom);
-- ANCHOR(`top_panel()',`Top')
- procedure Top (Pan : in Panel);
+ procedure Top (Pan : Panel);
-- AKA
pragma Inline (Top);
-- ANCHOR(`show_panel()',`Show')
- procedure Show (Pan : in Panel);
+ procedure Show (Pan : Panel);
-- AKA
pragma Inline (Show);
@@ -94,7 +94,7 @@
pragma Import (C, Update_Panels, "update_panels");
-- ANCHOR(`hide_panel()',`Hide')
- procedure Hide (Pan : in Panel);
+ procedure Hide (Pan : Panel);
-- AKA
pragma Inline (Hide);
@@ -108,15 +108,15 @@
-- pragma Inline (Panel_Window);
-- ANCHOR(`replace_panel()',`Replace')
- procedure Replace (Pan : in Panel;
- Win : in Window);
+ procedure Replace (Pan : Panel;
+ Win : Window);
-- AKA
pragma Inline (Replace);
-- ANCHOR(`move_panel()',`Move')
- procedure Move (Pan : in Panel;
- Line : in Line_Position;
- Column : in Column_Position);
+ procedure Move (Pan : Panel;
+ Line : Line_Position;
+ Column : Column_Position);
-- AKA
pragma Inline (Move);
diff --git a/Ada95/gen/terminal_interface-curses-trace.ads.m4 b/Ada95/gen/terminal_interface-curses-trace.ads.m4
index 546004f..e227343 100644
--- a/Ada95/gen/terminal_interface-curses-trace.ads.m4
+++ b/Ada95/gen/terminal_interface-curses-trace.ads.m4
@@ -9,7 +9,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc. --
+-- Copyright (c) 2000,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 --
@@ -37,16 +37,62 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control:
--- $Revision: 1.1 $
+-- $Revision: 1.4 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Trace is
pragma Preelaborate (Terminal_Interface.Curses.Trace);
- pragma Warnings (Off);
-include(`Trace_Defs')
+ type Trace_Attribute_Set is
+ record
+ Times : Boolean;
+ Tputs : Boolean;
+ Update : Boolean;
+ Cursor_Move : Boolean;
+ Character_Output : Boolean;
+ Calls : Boolean;
+ Virtual_Puts : Boolean;
+ Input_Events : Boolean;
+ TTY_State : Boolean;
+ Internal_Calls : Boolean;
+ Character_Calls : Boolean;
+ Termcap_TermInfo : Boolean;
+ Attribute_Color : Boolean;
+ end record;
+ pragma Convention (C_Pass_By_Copy, Trace_Attribute_Set);
+ for Trace_Attribute_Set use
+ record
+ Times at 0 range Curses_Constants.TRACE_TIMES_First
+ .. Curses_Constants.TRACE_TIMES_Last;
+ Tputs at 0 range Curses_Constants.TRACE_TPUTS_First
+ .. Curses_Constants.TRACE_TPUTS_Last;
+ Update at 0 range Curses_Constants.TRACE_UPDATE_First
+ .. Curses_Constants.TRACE_UPDATE_Last;
+ Cursor_Move at 0 range Curses_Constants.TRACE_MOVE_First
+ .. Curses_Constants.TRACE_MOVE_Last;
+ Character_Output at 0 range Curses_Constants.TRACE_CHARPUT_First
+ .. Curses_Constants.TRACE_CHARPUT_Last;
+ Calls at 0 range Curses_Constants.TRACE_CALLS_First
+ .. Curses_Constants.TRACE_CALLS_Last;
+ Virtual_Puts at 0 range Curses_Constants.TRACE_VIRTPUT_First
+ .. Curses_Constants.TRACE_VIRTPUT_Last;
+ Input_Events at 0 range Curses_Constants.TRACE_IEVENT_First
+ .. Curses_Constants.TRACE_IEVENT_Last;
+ TTY_State at 0 range Curses_Constants.TRACE_BITS_First
+ .. Curses_Constants.TRACE_BITS_Last;
+ Internal_Calls at 0 range Curses_Constants.TRACE_ICALLS_First
+ .. Curses_Constants.TRACE_ICALLS_Last;
+ Character_Calls at 0 range Curses_Constants.TRACE_CCALLS_First
+ .. Curses_Constants.TRACE_CCALLS_Last;
+ Termcap_TermInfo at 0 range Curses_Constants.TRACE_DATABASE_First
+ .. Curses_Constants.TRACE_DATABASE_Last;
+ Attribute_Color at 0 range Curses_Constants.TRACE_ATTRS_First
+ .. Curses_Constants.TRACE_ATTRS_Last;
+ end record;
+ pragma Warnings (Off);
+ for Trace_Attribute_Set'Size use Curses_Constants.Trace_Size;
pragma Warnings (On);
Trace_Disable : constant Trace_Attribute_Set := (others => False);
diff --git a/Ada95/gen/terminal_interface-curses.adb.m4 b/Ada95/gen/terminal_interface-curses.adb.m4
index 75ddb96..b98782b 100644
--- a/Ada95/gen/terminal_interface-curses.adb.m4
+++ b/Ada95/gen/terminal_interface-curses.adb.m4
@@ -9,7 +9,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. --
+-- 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 --
@@ -37,8 +37,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.5 $
--- $Date: 2008/07/26 18:46:32 $
+-- $Revision: 1.14 $
+-- $Date: 2014/05/24 21:31:05 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with System;
@@ -61,7 +61,7 @@
pragma Convention (C, chtype_array);
------------------------------------------------------------------------------
- function Key_Name (Key : in Real_Key_Code) return String
+ function Key_Name (Key : Real_Key_Code) return String
is
function Keyname (K : C_Int) return chars_ptr;
pragma Import (C, Keyname, "keyname");
@@ -89,7 +89,7 @@
end if;
end Key_Name;
- procedure Key_Name (Key : in Real_Key_Code;
+ procedure Key_Name (Key : Real_Key_Code;
Name : out String)
is
begin
@@ -132,9 +132,9 @@
end if;
end Is_End_Window;
------------------------------------------------------------------------------
- procedure Move_Cursor (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position)
+ procedure Move_Cursor (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position)
is
function Wmove (Win : Window;
Line : C_Int;
@@ -147,20 +147,20 @@
end if;
end Move_Cursor;
------------------------------------------------------------------------------
- procedure Add (Win : in Window := Standard_Window;
- Ch : in Attributed_Character)
+ procedure Add (Win : Window := Standard_Window;
+ Ch : Attributed_Character)
is
function Waddch (W : Window;
- Ch : C_Chtype) return C_Int;
+ Ch : Attributed_Character) return C_Int;
pragma Import (C, Waddch, "waddch");
begin
- if Waddch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
+ if Waddch (Win, Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Add;
- procedure Add (Win : in Window := Standard_Window;
- Ch : in Character)
+ procedure Add (Win : Window := Standard_Window;
+ Ch : Character)
is
begin
Add (Win,
@@ -170,29 +170,30 @@
end Add;
procedure Add
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Ch : in Attributed_Character)
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Ch : Attributed_Character)
is
function mvwaddch (W : Window;
Y : C_Int;
X : C_Int;
- Ch : C_Chtype) return C_Int;
+ Ch : Attributed_Character) return C_Int;
pragma Import (C, mvwaddch, "mvwaddch");
begin
if mvwaddch (Win, C_Int (Line),
C_Int (Column),
- AttrChar_To_Chtype (Ch)) = Curses_Err then
+ Ch) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Add;
procedure Add
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Ch : in Character)
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Ch : Character)
is
begin
Add (Win,
@@ -204,21 +205,21 @@
end Add;
procedure Add_With_Immediate_Echo
- (Win : in Window := Standard_Window;
- Ch : in Attributed_Character)
+ (Win : Window := Standard_Window;
+ Ch : Attributed_Character)
is
function Wechochar (W : Window;
- Ch : C_Chtype) return C_Int;
+ Ch : Attributed_Character) return C_Int;
pragma Import (C, Wechochar, "wechochar");
begin
- if Wechochar (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
+ if Wechochar (Win, Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Add_With_Immediate_Echo;
procedure Add_With_Immediate_Echo
- (Win : in Window := Standard_Window;
- Ch : in Character)
+ (Win : Window := Standard_Window;
+ Ch : Character)
is
begin
Add_With_Immediate_Echo
@@ -331,9 +332,9 @@
return W;
end Duplicate;
- procedure Move_Window (Win : in Window;
- Line : in Line_Position;
- Column : in Column_Position)
+ procedure Move_Window (Win : Window;
+ Line : Line_Position;
+ Column : Column_Position)
is
function Mvwin (Win : Window;
Line : C_Int;
@@ -345,9 +346,9 @@
end if;
end Move_Window;
- procedure Move_Derived_Window (Win : in Window;
- Line : in Line_Position;
- Column : in Column_Position)
+ procedure Move_Derived_Window (Win : Window;
+ Line : Line_Position;
+ Column : Column_Position)
is
function Mvderwin (Win : Window;
Line : C_Int;
@@ -359,8 +360,8 @@
end if;
end Move_Derived_Window;
- procedure Set_Synch_Mode (Win : in Window := Standard_Window;
- Mode : in Boolean := False)
+ procedure Set_Synch_Mode (Win : Window := Standard_Window;
+ Mode : Boolean := False)
is
function Syncok (Win : Window;
Mode : Curses_Bool) return C_Int;
@@ -371,9 +372,9 @@
end if;
end Set_Synch_Mode;
------------------------------------------------------------------------------
- procedure Add (Win : in Window := Standard_Window;
- Str : in String;
- Len : in Integer := -1)
+ procedure Add (Win : Window := Standard_Window;
+ Str : String;
+ Len : Integer := -1)
is
function Waddnstr (Win : Window;
Str : char_array;
@@ -390,11 +391,11 @@
end Add;
procedure Add
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Str : in String;
- Len : in Integer := -1)
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Str : String;
+ Len : Integer := -1)
is
begin
Move_Cursor (Win, Line, Column);
@@ -402,9 +403,9 @@
end Add;
------------------------------------------------------------------------------
procedure Add
- (Win : in Window := Standard_Window;
- Str : in Attributed_String;
- Len : in Integer := -1)
+ (Win : Window := Standard_Window;
+ Str : Attributed_String;
+ Len : Integer := -1)
is
function Waddchnstr (Win : Window;
Str : chtype_array;
@@ -419,17 +420,18 @@
Txt (Str'Length) := Default_Character;
if Waddchnstr (Win,
Txt,
- C_Int (Len)) = Curses_Err then
+ C_Int (Len)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Add;
procedure Add
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Str : in Attributed_String;
- Len : in Integer := -1)
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Str : Attributed_String;
+ Len : Integer := -1)
is
begin
Move_Cursor (Win, Line, Column);
@@ -437,46 +439,45 @@
end Add;
------------------------------------------------------------------------------
procedure Border
- (Win : in Window := Standard_Window;
- Left_Side_Symbol : in Attributed_Character := Default_Character;
- Right_Side_Symbol : in Attributed_Character := Default_Character;
- Top_Side_Symbol : in Attributed_Character := Default_Character;
- Bottom_Side_Symbol : in Attributed_Character := Default_Character;
- Upper_Left_Corner_Symbol : in Attributed_Character := Default_Character;
- Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character;
- Lower_Left_Corner_Symbol : in Attributed_Character := Default_Character;
- Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character)
+ (Win : Window := Standard_Window;
+ Left_Side_Symbol : Attributed_Character := Default_Character;
+ Right_Side_Symbol : Attributed_Character := Default_Character;
+ Top_Side_Symbol : Attributed_Character := Default_Character;
+ Bottom_Side_Symbol : Attributed_Character := Default_Character;
+ Upper_Left_Corner_Symbol : Attributed_Character := Default_Character;
+ Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
+ Lower_Left_Corner_Symbol : Attributed_Character := Default_Character;
+ Lower_Right_Corner_Symbol : Attributed_Character := Default_Character)
is
function Wborder (W : Window;
- LS : C_Chtype;
- RS : C_Chtype;
- TS : C_Chtype;
- BS : C_Chtype;
- ULC : C_Chtype;
- URC : C_Chtype;
- LLC : C_Chtype;
- LRC : C_Chtype) return C_Int;
+ LS : Attributed_Character;
+ RS : Attributed_Character;
+ TS : Attributed_Character;
+ BS : Attributed_Character;
+ ULC : Attributed_Character;
+ URC : Attributed_Character;
+ LLC : Attributed_Character;
+ LRC : Attributed_Character) return C_Int;
pragma Import (C, Wborder, "wborder");
begin
if Wborder (Win,
- AttrChar_To_Chtype (Left_Side_Symbol),
- AttrChar_To_Chtype (Right_Side_Symbol),
- AttrChar_To_Chtype (Top_Side_Symbol),
- AttrChar_To_Chtype (Bottom_Side_Symbol),
- AttrChar_To_Chtype (Upper_Left_Corner_Symbol),
- AttrChar_To_Chtype (Upper_Right_Corner_Symbol),
- AttrChar_To_Chtype (Lower_Left_Corner_Symbol),
- AttrChar_To_Chtype (Lower_Right_Corner_Symbol)
- ) = Curses_Err
+ Left_Side_Symbol,
+ Right_Side_Symbol,
+ Top_Side_Symbol,
+ Bottom_Side_Symbol,
+ Upper_Left_Corner_Symbol,
+ Upper_Right_Corner_Symbol,
+ Lower_Left_Corner_Symbol,
+ Lower_Right_Corner_Symbol) = Curses_Err
then
raise Curses_Exception;
end if;
end Border;
procedure Box
- (Win : in Window := Standard_Window;
- Vertical_Symbol : in Attributed_Character := Default_Character;
- Horizontal_Symbol : in Attributed_Character := Default_Character)
+ (Win : Window := Standard_Window;
+ Vertical_Symbol : Attributed_Character := Default_Character;
+ Horizontal_Symbol : Attributed_Character := Default_Character)
is
begin
Border (Win,
@@ -485,35 +486,37 @@
end Box;
procedure Horizontal_Line
- (Win : in Window := Standard_Window;
- Line_Size : in Natural;
- Line_Symbol : in Attributed_Character := Default_Character)
+ (Win : Window := Standard_Window;
+ Line_Size : Natural;
+ Line_Symbol : Attributed_Character := Default_Character)
is
function Whline (W : Window;
- Ch : C_Chtype;
+ Ch : Attributed_Character;
Len : C_Int) return C_Int;
pragma Import (C, Whline, "whline");
begin
if Whline (Win,
- AttrChar_To_Chtype (Line_Symbol),
- C_Int (Line_Size)) = Curses_Err then
+ Line_Symbol,
+ C_Int (Line_Size)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Horizontal_Line;
procedure Vertical_Line
- (Win : in Window := Standard_Window;
- Line_Size : in Natural;
- Line_Symbol : in Attributed_Character := Default_Character)
+ (Win : Window := Standard_Window;
+ Line_Size : Natural;
+ Line_Symbol : Attributed_Character := Default_Character)
is
function Wvline (W : Window;
- Ch : C_Chtype;
+ Ch : Attributed_Character;
Len : C_Int) return C_Int;
pragma Import (C, Wvline, "wvline");
begin
if Wvline (Win,
- AttrChar_To_Chtype (Line_Symbol),
- C_Int (Line_Size)) = Curses_Err then
+ Line_Symbol,
+ C_Int (Line_Size)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Vertical_Line;
@@ -534,7 +537,7 @@
end if;
end Get_Keystroke;
- procedure Undo_Keystroke (Key : in Real_Key_Code)
+ procedure Undo_Keystroke (Key : Real_Key_Code)
is
function Ungetch (Ch : C_Int) return C_Int;
pragma Import (C, Ungetch, "ungetch");
@@ -606,15 +609,15 @@
end Standout;
procedure Switch_Character_Attribute
- (Win : in Window := Standard_Window;
- Attr : in Character_Attribute_Set := Normal_Video;
- On : in Boolean := True)
+ (Win : Window := Standard_Window;
+ Attr : Character_Attribute_Set := Normal_Video;
+ On : Boolean := True)
is
function Wattron (Win : Window;
- C_Attr : C_AttrType) return C_Int;
+ C_Attr : Attributed_Character) return C_Int;
pragma Import (C, Wattron, "wattr_on");
function Wattroff (Win : Window;
- C_Attr : C_AttrType) return C_Int;
+ C_Attr : Attributed_Character) return C_Int;
pragma Import (C, Wattroff, "wattr_off");
-- In Ada we use the On Boolean to control whether or not we want to
-- switch on or off the attributes in the set.
@@ -624,9 +627,9 @@
Attr => Attr);
begin
if On then
- Err := Wattron (Win, AttrChar_To_AttrType (AC));
+ Err := Wattron (Win, AC);
else
- Err := Wattroff (Win, AttrChar_To_AttrType (AC));
+ Err := Wattroff (Win, AC);
end if;
if Err = Curses_Err then
raise Curses_Exception;
@@ -634,19 +637,18 @@
end Switch_Character_Attribute;
procedure Set_Character_Attributes
- (Win : in Window := Standard_Window;
- Attr : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First)
+ (Win : Window := Standard_Window;
+ Attr : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First)
is
function Wattrset (Win : Window;
- C_Attr : C_AttrType) return C_Int;
+ C_Attr : Attributed_Character) return C_Int;
pragma Import (C, Wattrset, "wattrset"); -- ??? wattr_set
begin
- if Wattrset (Win,
- AttrChar_To_AttrType (Attributed_Character'
- (Ch => Character'First,
- Color => Color,
- Attr => Attr))) = Curses_Err then
+ if Wattrset (Win, (Ch => Character'First,
+ Color => Color,
+ Attr => Attr)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Set_Character_Attributes;
@@ -655,20 +657,18 @@
return Character_Attribute_Set
is
function Wattrget (Win : Window;
- Atr : access C_AttrType;
+ Atr : access Attributed_Character;
Col : access C_Short;
Opt : System.Address) return C_Int;
pragma Import (C, Wattrget, "wattr_get");
- Attr : aliased C_AttrType;
+ Attr : aliased Attributed_Character;
Col : aliased C_Short;
Res : constant C_Int := Wattrget (Win, Attr'Access, Col'Access,
System.Null_Address);
- Ch : Attributed_Character;
begin
if Res = Curses_Ok then
- Ch := AttrType_To_AttrChar (Attr);
- return Ch.Attr;
+ return Attr.Attr;
else
raise Curses_Exception;
end if;
@@ -678,27 +678,25 @@
return Color_Pair
is
function Wattrget (Win : Window;
- Atr : access C_AttrType;
+ Atr : access Attributed_Character;
Col : access C_Short;
Opt : System.Address) return C_Int;
pragma Import (C, Wattrget, "wattr_get");
- Attr : aliased C_AttrType;
+ Attr : aliased Attributed_Character;
Col : aliased C_Short;
Res : constant C_Int := Wattrget (Win, Attr'Access, Col'Access,
System.Null_Address);
- Ch : Attributed_Character;
begin
if Res = Curses_Ok then
- Ch := AttrType_To_AttrChar (Attr);
- return Ch.Color;
+ return Attr.Color;
else
raise Curses_Exception;
end if;
end Get_Character_Attribute;
- procedure Set_Color (Win : in Window := Standard_Window;
- Pair : in Color_Pair)
+ procedure Set_Color (Win : Window := Standard_Window;
+ Pair : Color_Pair)
is
function Wset_Color (Win : Window;
Color : C_Short;
@@ -707,41 +705,44 @@
begin
if Wset_Color (Win,
C_Short (Pair),
- C_Void_Ptr (System.Null_Address)) = Curses_Err then
+ C_Void_Ptr (System.Null_Address)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Set_Color;
procedure Change_Attributes
- (Win : in Window := Standard_Window;
- Count : in Integer := -1;
- Attr : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First)
+ (Win : Window := Standard_Window;
+ Count : Integer := -1;
+ Attr : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First)
is
function Wchgat (Win : Window;
Cnt : C_Int;
- Attr : C_AttrType;
+ Attr : Attributed_Character;
Color : C_Short;
Opts : System.Address := System.Null_Address)
return C_Int;
pragma Import (C, Wchgat, "wchgat");
-
- Ch : constant Attributed_Character :=
- (Ch => Character'First, Color => Color_Pair'First, Attr => Attr);
begin
- if Wchgat (Win, C_Int (Count), AttrChar_To_AttrType (Ch),
- C_Short (Color)) = Curses_Err then
+ if Wchgat (Win,
+ C_Int (Count),
+ (Ch => Character'First,
+ Color => Color_Pair'First,
+ Attr => Attr),
+ C_Short (Color)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Change_Attributes;
procedure Change_Attributes
- (Win : in Window := Standard_Window;
- Line : in Line_Position := Line_Position'First;
- Column : in Column_Position := Column_Position'First;
- Count : in Integer := -1;
- Attr : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First)
+ (Win : Window := Standard_Window;
+ Line : Line_Position := Line_Position'First;
+ Column : Column_Position := Column_Position'First;
+ Count : Integer := -1;
+ Attr : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First)
is
begin
Move_Cursor (Win, Line, Column);
@@ -768,7 +769,7 @@
end if;
end Flash_Screen;
------------------------------------------------------------------------------
- procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True)
+ procedure Set_Cbreak_Mode (SwitchOn : Boolean := True)
is
function Cbreak return C_Int;
pragma Import (C, Cbreak, "cbreak");
@@ -787,7 +788,7 @@
end if;
end Set_Cbreak_Mode;
- procedure Set_Raw_Mode (SwitchOn : in Boolean := True)
+ procedure Set_Raw_Mode (SwitchOn : Boolean := True)
is
function Raw return C_Int;
pragma Import (C, Raw, "raw");
@@ -806,7 +807,7 @@
end if;
end Set_Raw_Mode;
- procedure Set_Echo_Mode (SwitchOn : in Boolean := True)
+ procedure Set_Echo_Mode (SwitchOn : Boolean := True)
is
function Echo return C_Int;
pragma Import (C, Echo, "echo");
@@ -825,8 +826,8 @@
end if;
end Set_Echo_Mode;
- procedure Set_Meta_Mode (Win : in Window := Standard_Window;
- SwitchOn : in Boolean := True)
+ procedure Set_Meta_Mode (Win : Window := Standard_Window;
+ SwitchOn : Boolean := True)
is
function Meta (W : Window; Mode : Curses_Bool) return C_Int;
pragma Import (C, Meta, "meta");
@@ -836,8 +837,8 @@
end if;
end Set_Meta_Mode;
- procedure Set_KeyPad_Mode (Win : in Window := Standard_Window;
- SwitchOn : in Boolean := True)
+ procedure Set_KeyPad_Mode (Win : Window := Standard_Window;
+ SwitchOn : Boolean := True)
is
function Keypad (W : Window; Mode : Curses_Bool) return C_Int;
pragma Import (C, Keypad, "keypad");
@@ -847,7 +848,7 @@
end if;
end Set_KeyPad_Mode;
- function Get_KeyPad_Mode (Win : in Window := Standard_Window)
+ function Get_KeyPad_Mode (Win : Window := Standard_Window)
return Boolean
is
function Is_Keypad (W : Window) return Curses_Bool;
@@ -856,7 +857,7 @@
return (Is_Keypad (Win) /= Curses_Bool_False);
end Get_KeyPad_Mode;
- procedure Half_Delay (Amount : in Half_Delay_Amount)
+ procedure Half_Delay (Amount : Half_Delay_Amount)
is
function Halfdelay (Amount : C_Int) return C_Int;
pragma Import (C, Halfdelay, "halfdelay");
@@ -867,8 +868,8 @@
end Half_Delay;
procedure Set_Flush_On_Interrupt_Mode
- (Win : in Window := Standard_Window;
- Mode : in Boolean := True)
+ (Win : Window := Standard_Window;
+ Mode : Boolean := True)
is
function Intrflush (Win : Window; Mode : Curses_Bool) return C_Int;
pragma Import (C, Intrflush, "intrflush");
@@ -879,8 +880,8 @@
end Set_Flush_On_Interrupt_Mode;
procedure Set_Queue_Interrupt_Mode
- (Win : in Window := Standard_Window;
- Flush : in Boolean := True)
+ (Win : Window := Standard_Window;
+ Flush : Boolean := True)
is
procedure Qiflush;
pragma Import (C, Qiflush, "qiflush");
@@ -898,8 +899,8 @@
end Set_Queue_Interrupt_Mode;
procedure Set_NoDelay_Mode
- (Win : in Window := Standard_Window;
- Mode : in Boolean := False)
+ (Win : Window := Standard_Window;
+ Mode : Boolean := False)
is
function Nodelay (Win : Window; Mode : Curses_Bool) return C_Int;
pragma Import (C, Nodelay, "nodelay");
@@ -909,9 +910,9 @@
end if;
end Set_NoDelay_Mode;
- procedure Set_Timeout_Mode (Win : in Window := Standard_Window;
- Mode : in Timeout_Mode;
- Amount : in Natural)
+ procedure Set_Timeout_Mode (Win : Window := Standard_Window;
+ Mode : Timeout_Mode;
+ Amount : Natural)
is
procedure Wtimeout (Win : Window; Amount : C_Int);
pragma Import (C, Wtimeout, "wtimeout");
@@ -931,20 +932,21 @@
end Set_Timeout_Mode;
procedure Set_Escape_Timer_Mode
- (Win : in Window := Standard_Window;
- Timer_Off : in Boolean := False)
+ (Win : Window := Standard_Window;
+ Timer_Off : Boolean := False)
is
function Notimeout (Win : Window; Mode : Curses_Bool) return C_Int;
pragma Import (C, Notimeout, "notimeout");
begin
if Notimeout (Win, Curses_Bool (Boolean'Pos (Timer_Off)))
- = Curses_Err then
+ = Curses_Err
+ then
raise Curses_Exception;
end if;
end Set_Escape_Timer_Mode;
------------------------------------------------------------------------------
- procedure Set_NL_Mode (SwitchOn : in Boolean := True)
+ procedure Set_NL_Mode (SwitchOn : Boolean := True)
is
function NL return C_Int;
pragma Import (C, NL, "nl");
@@ -964,8 +966,8 @@
end Set_NL_Mode;
procedure Clear_On_Next_Update
- (Win : in Window := Standard_Window;
- Do_Clear : in Boolean := True)
+ (Win : Window := Standard_Window;
+ Do_Clear : Boolean := True)
is
function Clear_Ok (W : Window; Flag : Curses_Bool) return C_Int;
pragma Import (C, Clear_Ok, "clearok");
@@ -976,8 +978,8 @@
end Clear_On_Next_Update;
procedure Use_Insert_Delete_Line
- (Win : in Window := Standard_Window;
- Do_Idl : in Boolean := True)
+ (Win : Window := Standard_Window;
+ Do_Idl : Boolean := True)
is
function IDL_Ok (W : Window; Flag : Curses_Bool) return C_Int;
pragma Import (C, IDL_Ok, "idlok");
@@ -988,8 +990,8 @@
end Use_Insert_Delete_Line;
procedure Use_Insert_Delete_Character
- (Win : in Window := Standard_Window;
- Do_Idc : in Boolean := True)
+ (Win : Window := Standard_Window;
+ Do_Idc : Boolean := True)
is
procedure IDC_Ok (W : Window; Flag : Curses_Bool);
pragma Import (C, IDC_Ok, "idcok");
@@ -998,8 +1000,8 @@
end Use_Insert_Delete_Character;
procedure Leave_Cursor_After_Update
- (Win : in Window := Standard_Window;
- Do_Leave : in Boolean := True)
+ (Win : Window := Standard_Window;
+ Do_Leave : Boolean := True)
is
function Leave_Ok (W : Window; Flag : Curses_Bool) return C_Int;
pragma Import (C, Leave_Ok, "leaveok");
@@ -1010,8 +1012,8 @@
end Leave_Cursor_After_Update;
procedure Immediate_Update_Mode
- (Win : in Window := Standard_Window;
- Mode : in Boolean := False)
+ (Win : Window := Standard_Window;
+ Mode : Boolean := False)
is
procedure Immedok (Win : Window; Mode : Curses_Bool);
pragma Import (C, Immedok, "immedok");
@@ -1020,8 +1022,8 @@
end Immediate_Update_Mode;
procedure Allow_Scrolling
- (Win : in Window := Standard_Window;
- Mode : in Boolean := False)
+ (Win : Window := Standard_Window;
+ Mode : Boolean := False)
is
function Scrollok (Win : Window; Mode : Curses_Bool) return C_Int;
pragma Import (C, Scrollok, "scrollok");
@@ -1041,9 +1043,9 @@
end Scrolling_Allowed;
procedure Set_Scroll_Region
- (Win : in Window := Standard_Window;
- Top_Line : in Line_Position;
- Bottom_Line : in Line_Position)
+ (Win : Window := Standard_Window;
+ Top_Line : Line_Position;
+ Bottom_Line : Line_Position)
is
function Wsetscrreg (Win : Window;
Lin : C_Int;
@@ -1051,7 +1053,8 @@
pragma Import (C, Wsetscrreg, "wsetscrreg");
begin
if Wsetscrreg (Win, C_Int (Top_Line), C_Int (Bottom_Line))
- = Curses_Err then
+ = Curses_Err
+ then
raise Curses_Exception;
end if;
end Set_Scroll_Region;
@@ -1066,7 +1069,7 @@
end if;
end Update_Screen;
- procedure Refresh (Win : in Window := Standard_Window)
+ procedure Refresh (Win : Window := Standard_Window)
is
function Wrefresh (W : Window) return C_Int;
pragma Import (C, Wrefresh, "wrefresh");
@@ -1077,7 +1080,7 @@
end Refresh;
procedure Refresh_Without_Update
- (Win : in Window := Standard_Window)
+ (Win : Window := Standard_Window)
is
function Wnoutrefresh (W : Window) return C_Int;
pragma Import (C, Wnoutrefresh, "wnoutrefresh");
@@ -1087,7 +1090,7 @@
end if;
end Refresh_Without_Update;
- procedure Redraw (Win : in Window := Standard_Window)
+ procedure Redraw (Win : Window := Standard_Window)
is
function Redrawwin (Win : Window) return C_Int;
pragma Import (C, Redrawwin, "redrawwin");
@@ -1098,9 +1101,9 @@
end Redraw;
procedure Redraw
- (Win : in Window := Standard_Window;
- Begin_Line : in Line_Position;
- Line_Count : in Positive)
+ (Win : Window := Standard_Window;
+ Begin_Line : Line_Position;
+ Line_Count : Positive)
is
function Wredrawln (Win : Window; First : C_Int; Cnt : C_Int)
return C_Int;
@@ -1108,13 +1111,14 @@
begin
if Wredrawln (Win,
C_Int (Begin_Line),
- C_Int (Line_Count)) = Curses_Err then
+ C_Int (Line_Count)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Redraw;
------------------------------------------------------------------------------
- procedure Erase (Win : in Window := Standard_Window)
+ procedure Erase (Win : Window := Standard_Window)
is
function Werase (W : Window) return C_Int;
pragma Import (C, Werase, "werase");
@@ -1124,7 +1128,7 @@
end if;
end Erase;
- procedure Clear (Win : in Window := Standard_Window)
+ procedure Clear (Win : Window := Standard_Window)
is
function Wclear (W : Window) return C_Int;
pragma Import (C, Wclear, "wclear");
@@ -1134,7 +1138,7 @@
end if;
end Clear;
- procedure Clear_To_End_Of_Screen (Win : in Window := Standard_Window)
+ procedure Clear_To_End_Of_Screen (Win : Window := Standard_Window)
is
function Wclearbot (W : Window) return C_Int;
pragma Import (C, Wclearbot, "wclrtobot");
@@ -1144,7 +1148,7 @@
end if;
end Clear_To_End_Of_Screen;
- procedure Clear_To_End_Of_Line (Win : in Window := Standard_Window)
+ procedure Clear_To_End_Of_Line (Win : Window := Standard_Window)
is
function Wcleareol (W : Window) return C_Int;
pragma Import (C, Wcleareol, "wclrtoeol");
@@ -1155,23 +1159,24 @@
end Clear_To_End_Of_Line;
------------------------------------------------------------------------------
procedure Set_Background
- (Win : in Window := Standard_Window;
- Ch : in Attributed_Character)
+ (Win : Window := Standard_Window;
+ Ch : Attributed_Character)
is
- procedure WBackground (W : in Window; Ch : in C_Chtype);
+ procedure WBackground (W : Window; Ch : Attributed_Character);
pragma Import (C, WBackground, "wbkgdset");
begin
- WBackground (Win, AttrChar_To_Chtype (Ch));
+ WBackground (Win, Ch);
end Set_Background;
procedure Change_Background
- (Win : in Window := Standard_Window;
- Ch : in Attributed_Character)
+ (Win : Window := Standard_Window;
+ Ch : Attributed_Character)
is
- function WChangeBkgd (W : Window; Ch : C_Chtype) return C_Int;
+ function WChangeBkgd (W : Window; Ch : Attributed_Character)
+ return C_Int;
pragma Import (C, WChangeBkgd, "wbkgd");
begin
- if WChangeBkgd (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
+ if WChangeBkgd (Win, Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Change_Background;
@@ -1179,16 +1184,16 @@
function Get_Background (Win : Window := Standard_Window)
return Attributed_Character
is
- function Wgetbkgd (Win : Window) return C_Chtype;
+ function Wgetbkgd (Win : Window) return Attributed_Character;
pragma Import (C, Wgetbkgd, "getbkgd");
begin
- return Chtype_To_AttrChar (Wgetbkgd (Win));
+ return Wgetbkgd (Win);
end Get_Background;
------------------------------------------------------------------------------
- procedure Change_Lines_Status (Win : in Window := Standard_Window;
- Start : in Line_Position;
- Count : in Positive;
- State : in Boolean)
+ procedure Change_Lines_Status (Win : Window := Standard_Window;
+ Start : Line_Position;
+ Count : Positive;
+ State : Boolean)
is
function Wtouchln (Win : Window;
Sta : C_Int;
@@ -1197,32 +1202,35 @@
pragma Import (C, Wtouchln, "wtouchln");
begin
if Wtouchln (Win, C_Int (Start), C_Int (Count),
- C_Int (Boolean'Pos (State))) = Curses_Err then
+ C_Int (Boolean'Pos (State))) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Change_Lines_Status;
- procedure Touch (Win : in Window := Standard_Window)
+ procedure Touch (Win : Window := Standard_Window)
is
Y : Line_Position;
X : Column_Position;
begin
Get_Size (Win, Y, X);
+ pragma Warnings (Off, X); -- unreferenced
Change_Lines_Status (Win, 0, Positive (Y), True);
end Touch;
- procedure Untouch (Win : in Window := Standard_Window)
+ procedure Untouch (Win : Window := Standard_Window)
is
Y : Line_Position;
X : Column_Position;
begin
Get_Size (Win, Y, X);
+ pragma Warnings (Off, X); -- unreferenced
Change_Lines_Status (Win, 0, Positive (Y), False);
end Untouch;
- procedure Touch (Win : in Window := Standard_Window;
- Start : in Line_Position;
- Count : in Positive)
+ procedure Touch (Win : Window := Standard_Window;
+ Start : Line_Position;
+ Count : Positive)
is
begin
Change_Lines_Status (Win, Start, Count, True);
@@ -1256,15 +1264,15 @@
end Is_Touched;
------------------------------------------------------------------------------
procedure Copy
- (Source_Window : in Window;
- Destination_Window : in Window;
- Source_Top_Row : in Line_Position;
- Source_Left_Column : in Column_Position;
- Destination_Top_Row : in Line_Position;
- Destination_Left_Column : in Column_Position;
- Destination_Bottom_Row : in Line_Position;
- Destination_Right_Column : in Column_Position;
- Non_Destructive_Mode : in Boolean := True)
+ (Source_Window : Window;
+ Destination_Window : Window;
+ Source_Top_Row : Line_Position;
+ Source_Left_Column : Column_Position;
+ Destination_Top_Row : Line_Position;
+ Destination_Left_Column : Column_Position;
+ Destination_Bottom_Row : Line_Position;
+ Destination_Right_Column : Column_Position;
+ Non_Destructive_Mode : Boolean := True)
is
function Copywin (Src : Window;
Dst : Window;
@@ -1286,14 +1294,15 @@
C_Int (Destination_Bottom_Row),
C_Int (Destination_Right_Column),
Boolean'Pos (Non_Destructive_Mode)
- ) = Curses_Err then
+ ) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Copy;
procedure Overwrite
- (Source_Window : in Window;
- Destination_Window : in Window)
+ (Source_Window : Window;
+ Destination_Window : Window)
is
function Overwrite (Src : Window; Dst : Window) return C_Int;
pragma Import (C, Overwrite, "overwrite");
@@ -1304,8 +1313,8 @@
end Overwrite;
procedure Overlay
- (Source_Window : in Window;
- Destination_Window : in Window)
+ (Source_Window : Window;
+ Destination_Window : Window)
is
function Overlay (Src : Window; Dst : Window) return C_Int;
pragma Import (C, Overlay, "overlay");
@@ -1317,8 +1326,8 @@
------------------------------------------------------------------------------
procedure Insert_Delete_Lines
- (Win : in Window := Standard_Window;
- Lines : in Integer := 1) -- default is to insert one line above
+ (Win : Window := Standard_Window;
+ Lines : Integer := 1) -- default is to insert one line above
is
function Winsdelln (W : Window; N : C_Int) return C_Int;
pragma Import (C, Winsdelln, "winsdelln");
@@ -1328,13 +1337,13 @@
end if;
end Insert_Delete_Lines;
- procedure Delete_Line (Win : in Window := Standard_Window)
+ procedure Delete_Line (Win : Window := Standard_Window)
is
begin
Insert_Delete_Lines (Win, -1);
end Delete_Line;
- procedure Insert_Line (Win : in Window := Standard_Window)
+ procedure Insert_Line (Win : Window := Standard_Window)
is
begin
Insert_Delete_Lines (Win, 1);
@@ -1342,7 +1351,7 @@
------------------------------------------------------------------------------
procedure Get_Size
- (Win : in Window := Standard_Window;
+ (Win : Window := Standard_Window;
Number_Of_Lines : out Line_Count;
Number_Of_Columns : out Column_Count)
is
@@ -1352,17 +1361,15 @@
function GetMaxX (W : Window) return C_Int;
pragma Import (C, GetMaxX, "getmaxx");
- Y : constant C_Int := GetMaxY (Win)
- + C_Int (Offset_XY);
- X : constant C_Int := GetMaxX (Win)
- + C_Int (Offset_XY);
+ Y : constant C_Int := GetMaxY (Win);
+ X : constant C_Int := GetMaxX (Win);
begin
Number_Of_Lines := Line_Count (Y);
Number_Of_Columns := Column_Count (X);
end Get_Size;
procedure Get_Window_Position
- (Win : in Window := Standard_Window;
+ (Win : Window := Standard_Window;
Top_Left_Line : out Line_Position;
Top_Left_Column : out Column_Position)
is
@@ -1380,7 +1387,7 @@
end Get_Window_Position;
procedure Get_Cursor_Position
- (Win : in Window := Standard_Window;
+ (Win : Window := Standard_Window;
Line : out Line_Position;
Column : out Column_Position)
is
@@ -1398,7 +1405,7 @@
end Get_Cursor_Position;
procedure Get_Origin_Relative_To_Parent
- (Win : in Window;
+ (Win : Window;
Top_Left_Line : out Line_Position;
Top_Left_Column : out Column_Position;
Is_Not_A_Subwindow : out Boolean)
@@ -1467,13 +1474,13 @@
end Sub_Pad;
procedure Refresh
- (Pad : in Window;
- Source_Top_Row : in Line_Position;
- Source_Left_Column : in Column_Position;
- Destination_Top_Row : in Line_Position;
- Destination_Left_Column : in Column_Position;
- Destination_Bottom_Row : in Line_Position;
- Destination_Right_Column : in Column_Position)
+ (Pad : Window;
+ Source_Top_Row : Line_Position;
+ Source_Left_Column : Column_Position;
+ Destination_Top_Row : Line_Position;
+ Destination_Left_Column : Column_Position;
+ Destination_Bottom_Row : Line_Position;
+ Destination_Right_Column : Column_Position)
is
function Prefresh
(Pad : Window;
@@ -1491,19 +1498,20 @@
C_Int (Destination_Top_Row),
C_Int (Destination_Left_Column),
C_Int (Destination_Bottom_Row),
- C_Int (Destination_Right_Column)) = Curses_Err then
+ C_Int (Destination_Right_Column)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Refresh;
procedure Refresh_Without_Update
- (Pad : in Window;
- Source_Top_Row : in Line_Position;
- Source_Left_Column : in Column_Position;
- Destination_Top_Row : in Line_Position;
- Destination_Left_Column : in Column_Position;
- Destination_Bottom_Row : in Line_Position;
- Destination_Right_Column : in Column_Position)
+ (Pad : Window;
+ Source_Top_Row : Line_Position;
+ Source_Left_Column : Column_Position;
+ Destination_Top_Row : Line_Position;
+ Destination_Left_Column : Column_Position;
+ Destination_Bottom_Row : Line_Position;
+ Destination_Right_Column : Column_Position)
is
function Pnoutrefresh
(Pad : Window;
@@ -1521,27 +1529,28 @@
C_Int (Destination_Top_Row),
C_Int (Destination_Left_Column),
C_Int (Destination_Bottom_Row),
- C_Int (Destination_Right_Column)) = Curses_Err then
+ C_Int (Destination_Right_Column)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Refresh_Without_Update;
procedure Add_Character_To_Pad_And_Echo_It
- (Pad : in Window;
- Ch : in Attributed_Character)
+ (Pad : Window;
+ Ch : Attributed_Character)
is
- function Pechochar (Pad : Window; Ch : C_Chtype)
+ function Pechochar (Pad : Window; Ch : Attributed_Character)
return C_Int;
pragma Import (C, Pechochar, "pechochar");
begin
- if Pechochar (Pad, AttrChar_To_Chtype (Ch)) = Curses_Err then
+ if Pechochar (Pad, Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Add_Character_To_Pad_And_Echo_It;
procedure Add_Character_To_Pad_And_Echo_It
- (Pad : in Window;
- Ch : in Character)
+ (Pad : Window;
+ Ch : Character)
is
begin
Add_Character_To_Pad_And_Echo_It
@@ -1551,8 +1560,8 @@
Attr => Normal_Video));
end Add_Character_To_Pad_And_Echo_It;
------------------------------------------------------------------------------
- procedure Scroll (Win : in Window := Standard_Window;
- Amount : in Integer := 1)
+ procedure Scroll (Win : Window := Standard_Window;
+ Amount : Integer := 1)
is
function Wscrl (Win : Window; N : C_Int) return C_Int;
pragma Import (C, Wscrl, "wscrl");
@@ -1564,7 +1573,7 @@
end Scroll;
------------------------------------------------------------------------------
- procedure Delete_Character (Win : in Window := Standard_Window)
+ procedure Delete_Character (Win : Window := Standard_Window)
is
function Wdelch (Win : Window) return C_Int;
pragma Import (C, Wdelch, "wdelch");
@@ -1575,9 +1584,9 @@
end Delete_Character;
procedure Delete_Character
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position)
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position)
is
function Mvwdelch (Win : Window;
Lin : C_Int;
@@ -1592,10 +1601,10 @@
function Peek (Win : Window := Standard_Window)
return Attributed_Character
is
- function Winch (Win : Window) return C_Chtype;
+ function Winch (Win : Window) return Attributed_Character;
pragma Import (C, Winch, "winch");
begin
- return Chtype_To_AttrChar (Winch (Win));
+ return Winch (Win);
end Peek;
function Peek
@@ -1605,46 +1614,47 @@
is
function Mvwinch (Win : Window;
Lin : C_Int;
- Col : C_Int) return C_Chtype;
+ Col : C_Int) return Attributed_Character;
pragma Import (C, Mvwinch, "mvwinch");
begin
- return Chtype_To_AttrChar (Mvwinch (Win, C_Int (Line), C_Int (Column)));
+ return Mvwinch (Win, C_Int (Line), C_Int (Column));
end Peek;
------------------------------------------------------------------------------
- procedure Insert (Win : in Window := Standard_Window;
- Ch : in Attributed_Character)
+ procedure Insert (Win : Window := Standard_Window;
+ Ch : Attributed_Character)
is
- function Winsch (Win : Window; Ch : C_Chtype) return C_Int;
+ function Winsch (Win : Window; Ch : Attributed_Character) return C_Int;
pragma Import (C, Winsch, "winsch");
begin
- if Winsch (Win, AttrChar_To_Chtype (Ch)) = Curses_Err then
+ if Winsch (Win, Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Insert;
procedure Insert
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Ch : in Attributed_Character)
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Ch : Attributed_Character)
is
function Mvwinsch (Win : Window;
Lin : C_Int;
Col : C_Int;
- Ch : C_Chtype) return C_Int;
+ Ch : Attributed_Character) return C_Int;
pragma Import (C, Mvwinsch, "mvwinsch");
begin
if Mvwinsch (Win,
C_Int (Line),
C_Int (Column),
- AttrChar_To_Chtype (Ch)) = Curses_Err then
+ Ch) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Insert;
------------------------------------------------------------------------------
- procedure Insert (Win : in Window := Standard_Window;
- Str : in String;
- Len : in Integer := -1)
+ procedure Insert (Win : Window := Standard_Window;
+ Str : String;
+ Len : Integer := -1)
is
function Winsnstr (Win : Window;
Str : char_array;
@@ -1661,11 +1671,11 @@
end Insert;
procedure Insert
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Str : in String;
- Len : in Integer := -1)
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Str : String;
+ Len : Integer := -1)
is
function Mvwinsnstr (Win : Window;
Line : C_Int;
@@ -1679,14 +1689,15 @@
begin
To_C (Str, Txt, Length);
if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), Txt, C_Int (Len))
- = Curses_Err then
+ = Curses_Err
+ then
raise Curses_Exception;
end if;
end Insert;
------------------------------------------------------------------------------
- procedure Peek (Win : in Window := Standard_Window;
+ procedure Peek (Win : Window := Standard_Window;
Str : out String;
- Len : in Integer := -1)
+ Len : Integer := -1)
is
function Winnstr (Win : Window;
Str : char_array;
@@ -1714,11 +1725,11 @@
end Peek;
procedure Peek
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
Str : out String;
- Len : in Integer := -1)
+ Len : Integer := -1)
is
begin
Move_Cursor (Win, Line, Column);
@@ -1726,9 +1737,9 @@
end Peek;
------------------------------------------------------------------------------
procedure Peek
- (Win : in Window := Standard_Window;
+ (Win : Window := Standard_Window;
Str : out Attributed_String;
- Len : in Integer := -1)
+ Len : Integer := -1)
is
function Winchnstr (Win : Window;
Str : chtype_array; -- out
@@ -1763,20 +1774,20 @@
end Peek;
procedure Peek
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
Str : out Attributed_String;
- Len : in Integer := -1)
+ Len : Integer := -1)
is
begin
Move_Cursor (Win, Line, Column);
Peek (Win, Str, Len);
end Peek;
------------------------------------------------------------------------------
- procedure Get (Win : in Window := Standard_Window;
+ procedure Get (Win : Window := Standard_Window;
Str : out String;
- Len : in Integer := -1)
+ Len : Integer := -1)
is
function Wgetnstr (Win : Window;
Str : char_array;
@@ -1804,11 +1815,11 @@
end Get;
procedure Get
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
Str : out String;
- Len : in Integer := -1)
+ Len : Integer := -1)
is
begin
Move_Cursor (Win, Line, Column);
@@ -1816,7 +1827,7 @@
end Get;
------------------------------------------------------------------------------
procedure Init_Soft_Label_Keys
- (Format : in Soft_Label_Key_Format := Three_Two_Three)
+ (Format : Soft_Label_Key_Format := Three_Two_Three)
is
function Slk_Init (Fmt : C_Int) return C_Int;
pragma Import (C, Slk_Init, "slk_init");
@@ -1826,9 +1837,9 @@
end if;
end Init_Soft_Label_Keys;
- procedure Set_Soft_Label_Key (Label : in Label_Number;
- Text : in String;
- Fmt : in Label_Justification := Left)
+ procedure Set_Soft_Label_Key (Label : Label_Number;
+ Text : String;
+ Fmt : Label_Justification := Left)
is
function Slk_Set (Label : C_Int;
Txt : char_array;
@@ -1840,7 +1851,8 @@
begin
To_C (Text, Txt, Len);
if Slk_Set (C_Int (Label), Txt,
- C_Int (Label_Justification'Pos (Fmt))) = Curses_Err then
+ C_Int (Label_Justification'Pos (Fmt))) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Set_Soft_Label_Key;
@@ -1865,7 +1877,7 @@
end if;
end Refresh_Soft_Label_Keys_Without_Update;
- procedure Get_Soft_Label_Key (Label : in Label_Number;
+ procedure Get_Soft_Label_Key (Label : Label_Number;
Text : out String)
is
function Slk_Label (Label : C_Int) return chars_ptr;
@@ -1874,7 +1886,7 @@
Fill_String (Slk_Label (C_Int (Label)), Text);
end Get_Soft_Label_Key;
- function Get_Soft_Label_Key (Label : in Label_Number) return String
+ function Get_Soft_Label_Key (Label : Label_Number) return String
is
function Slk_Label (Label : C_Int) return chars_ptr;
pragma Import (C, Slk_Label, "slk_label");
@@ -1913,12 +1925,12 @@
end Touch_Soft_Label_Keys;
procedure Switch_Soft_Label_Key_Attributes
- (Attr : in Character_Attribute_Set;
- On : in Boolean := True)
+ (Attr : Character_Attribute_Set;
+ On : Boolean := True)
is
- function Slk_Attron (Ch : C_Chtype) return C_Int;
+ function Slk_Attron (Ch : Attributed_Character) return C_Int;
pragma Import (C, Slk_Attron, "slk_attron");
- function Slk_Attroff (Ch : C_Chtype) return C_Int;
+ function Slk_Attroff (Ch : Attributed_Character) return C_Int;
pragma Import (C, Slk_Attroff, "slk_attroff");
Err : C_Int;
@@ -1927,9 +1939,9 @@
Color => Color_Pair'First);
begin
if On then
- Err := Slk_Attron (AttrChar_To_Chtype (Ch));
+ Err := Slk_Attron (Ch);
else
- Err := Slk_Attroff (AttrChar_To_Chtype (Ch));
+ Err := Slk_Attroff (Ch);
end if;
if Err = Curses_Err then
raise Curses_Exception;
@@ -1937,44 +1949,44 @@
end Switch_Soft_Label_Key_Attributes;
procedure Set_Soft_Label_Key_Attributes
- (Attr : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First)
+ (Attr : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First)
is
- function Slk_Attrset (Ch : C_Chtype) return C_Int;
+ function Slk_Attrset (Ch : Attributed_Character) return C_Int;
pragma Import (C, Slk_Attrset, "slk_attrset");
Ch : constant Attributed_Character := (Ch => Character'First,
Attr => Attr,
Color => Color);
begin
- if Slk_Attrset (AttrChar_To_Chtype (Ch)) = Curses_Err then
+ if Slk_Attrset (Ch) = Curses_Err then
raise Curses_Exception;
end if;
end Set_Soft_Label_Key_Attributes;
function Get_Soft_Label_Key_Attributes return Character_Attribute_Set
is
- function Slk_Attr return C_Chtype;
+ function Slk_Attr return Attributed_Character;
pragma Import (C, Slk_Attr, "slk_attr");
- Attr : constant C_Chtype := Slk_Attr;
+ Attr : constant Attributed_Character := Slk_Attr;
begin
- return Chtype_To_AttrChar (Attr).Attr;
+ return Attr.Attr;
end Get_Soft_Label_Key_Attributes;
function Get_Soft_Label_Key_Attributes return Color_Pair
is
- function Slk_Attr return C_Chtype;
+ function Slk_Attr return Attributed_Character;
pragma Import (C, Slk_Attr, "slk_attr");
- Attr : constant C_Chtype := Slk_Attr;
+ Attr : constant Attributed_Character := Slk_Attr;
begin
- return Chtype_To_AttrChar (Attr).Color;
+ return Attr.Color;
end Get_Soft_Label_Key_Attributes;
- procedure Set_Soft_Label_Key_Color (Pair : in Color_Pair)
+ procedure Set_Soft_Label_Key_Color (Pair : Color_Pair)
is
- function Slk_Color (Color : in C_Short) return C_Int;
+ function Slk_Color (Color : C_Short) return C_Int;
pragma Import (C, Slk_Color, "slk_color");
begin
if Slk_Color (C_Short (Pair)) = Curses_Err then
@@ -1983,21 +1995,22 @@
end Set_Soft_Label_Key_Color;
------------------------------------------------------------------------------
- procedure Enable_Key (Key : in Special_Key_Code;
- Enable : in Boolean := True)
+ procedure Enable_Key (Key : Special_Key_Code;
+ Enable : Boolean := True)
is
function Keyok (Keycode : C_Int;
On_Off : Curses_Bool) return C_Int;
pragma Import (C, Keyok, "keyok");
begin
if Keyok (C_Int (Key), Curses_Bool (Boolean'Pos (Enable)))
- = Curses_Err then
+ = Curses_Err
+ then
raise Curses_Exception;
end if;
end Enable_Key;
------------------------------------------------------------------------------
- procedure Define_Key (Definition : in String;
- Key : in Special_Key_Code)
+ procedure Define_Key (Definition : String;
+ Key : Special_Key_Code)
is
function Defkey (Def : char_array;
Key : C_Int) return C_Int;
@@ -2012,24 +2025,24 @@
end if;
end Define_Key;
------------------------------------------------------------------------------
- procedure Un_Control (Ch : in Attributed_Character;
+ procedure Un_Control (Ch : Attributed_Character;
Str : out String)
is
- function Unctrl (Ch : C_Chtype) return chars_ptr;
+ function Unctrl (Ch : Attributed_Character) return chars_ptr;
pragma Import (C, Unctrl, "unctrl");
begin
- Fill_String (Unctrl (AttrChar_To_Chtype (Ch)), Str);
+ Fill_String (Unctrl (Ch), Str);
end Un_Control;
- function Un_Control (Ch : in Attributed_Character) return String
+ function Un_Control (Ch : Attributed_Character) return String
is
- function Unctrl (Ch : C_Chtype) return chars_ptr;
+ function Unctrl (Ch : Attributed_Character) return chars_ptr;
pragma Import (C, Unctrl, "unctrl");
begin
- return Fill_String (Unctrl (AttrChar_To_Chtype (Ch)));
+ return Fill_String (Unctrl (Ch));
end Un_Control;
- procedure Delay_Output (Msecs : in Natural)
+ procedure Delay_Output (Msecs : Natural)
is
function Delayoutput (Msecs : C_Int) return C_Int;
pragma Import (C, Delayoutput, "delay_output");
@@ -2099,10 +2112,10 @@
function Supported_Attributes return Character_Attribute_Set
is
- function Termattrs return C_Chtype;
+ function Termattrs return Attributed_Character;
pragma Import (C, Termattrs, "termattrs");
- Ch : constant Attributed_Character := Chtype_To_AttrChar (Termattrs);
+ Ch : constant Attributed_Character := Termattrs;
begin
return Ch.Attr;
end Supported_Attributes;
@@ -2139,9 +2152,9 @@
return Fill_String (Termname);
end Terminal_Name;
------------------------------------------------------------------------------
- procedure Init_Pair (Pair : in Redefinable_Color_Pair;
- Fore : in Color_Number;
- Back : in Color_Number)
+ procedure Init_Pair (Pair : Redefinable_Color_Pair;
+ Fore : Color_Number;
+ Back : Color_Number)
is
function Initpair (Pair : C_Short;
Fore : C_Short;
@@ -2152,16 +2165,18 @@
raise Constraint_Error;
end if;
if Integer (Fore) >= Number_Of_Colors or else
- Integer (Back) >= Number_Of_Colors then
+ Integer (Back) >= Number_Of_Colors
+ then
raise Constraint_Error;
end if;
if Initpair (C_Short (Pair), C_Short (Fore), C_Short (Back))
- = Curses_Err then
+ = Curses_Err
+ then
raise Curses_Exception;
end if;
end Init_Pair;
- procedure Pair_Content (Pair : in Color_Pair;
+ procedure Pair_Content (Pair : Color_Pair;
Fore : out Color_Number;
Back : out Color_Number)
is
@@ -2193,10 +2208,10 @@
end if;
end Has_Colors;
- procedure Init_Color (Color : in Color_Number;
- Red : in RGB_Value;
- Green : in RGB_Value;
- Blue : in RGB_Value)
+ procedure Init_Color (Color : Color_Number;
+ Red : RGB_Value;
+ Green : RGB_Value;
+ Blue : RGB_Value)
is
function Initcolor (Col : C_Short;
Red : C_Short;
@@ -2205,7 +2220,8 @@
pragma Import (C, Initcolor, "init_color");
begin
if Initcolor (C_Short (Color), C_Short (Red), C_Short (Green),
- C_Short (Blue)) = Curses_Err then
+ C_Short (Blue)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Init_Color;
@@ -2222,7 +2238,7 @@
end if;
end Can_Change_Color;
- procedure Color_Content (Color : in Color_Number;
+ procedure Color_Content (Color : Color_Number;
Red : out RGB_Value;
Green : out RGB_Value;
Blue : out RGB_Value)
@@ -2236,7 +2252,8 @@
R, G, B : aliased C_Short;
begin
if Colorcontent (C_Short (Color), R'Access, G'Access, B'Access) =
- Curses_Err then
+ Curses_Err
+ then
raise Curses_Exception;
else
Red := RGB_Value (R);
@@ -2246,7 +2263,7 @@
end Color_Content;
------------------------------------------------------------------------------
- procedure Save_Curses_Mode (Mode : in Curses_Mode)
+ procedure Save_Curses_Mode (Mode : Curses_Mode)
is
function Def_Prog_Mode return C_Int;
pragma Import (C, Def_Prog_Mode, "def_prog_mode");
@@ -2264,7 +2281,7 @@
end if;
end Save_Curses_Mode;
- procedure Reset_Curses_Mode (Mode : in Curses_Mode)
+ procedure Reset_Curses_Mode (Mode : Curses_Mode)
is
function Reset_Prog_Mode return C_Int;
pragma Import (C, Reset_Prog_Mode, "reset_prog_mode");
@@ -2302,8 +2319,8 @@
end if;
end Reset_Terminal_State;
- procedure Rip_Off_Lines (Lines : in Integer;
- Proc : in Stdscr_Init_Proc)
+ procedure Rip_Off_Lines (Lines : Integer;
+ Proc : Stdscr_Init_Proc)
is
function Ripoffline (Lines : C_Int;
Proc : Stdscr_Init_Proc) return C_Int;
@@ -2327,7 +2344,7 @@
end if;
end Set_Cursor_Visibility;
- procedure Nap_Milli_Seconds (Ms : in Natural)
+ procedure Nap_Milli_Seconds (Ms : Natural)
is
function Napms (Ms : C_Int) return C_Int;
pragma Import (C, Napms, "napms");
@@ -2337,13 +2354,52 @@
end if;
end Nap_Milli_Seconds;
------------------------------------------------------------------------------
-include(`Public_Variables')
+ function Lines return Line_Count
+ is
+ function LINES_As_Function return Interfaces.C.int;
+ pragma Import (C, LINES_As_Function, "LINES_as_function");
+ begin
+ return Line_Count (LINES_As_Function);
+ end Lines;
+
+ function Columns return Column_Count
+ is
+ function COLS_As_Function return Interfaces.C.int;
+ pragma Import (C, COLS_As_Function, "COLS_as_function");
+ begin
+ return Column_Count (COLS_As_Function);
+ end Columns;
+
+ function Tab_Size return Natural
+ is
+ function TABSIZE_As_Function return Interfaces.C.int;
+ pragma Import (C, TABSIZE_As_Function, "TABSIZE_as_function");
+
+ begin
+ return Natural (TABSIZE_As_Function);
+ end Tab_Size;
+
+ function Number_Of_Colors return Natural
+ is
+ function COLORS_As_Function return Interfaces.C.int;
+ pragma Import (C, COLORS_As_Function, "COLORS_as_function");
+ begin
+ return Natural (COLORS_As_Function);
+ end Number_Of_Colors;
+
+ function Number_Of_Color_Pairs return Natural
+ is
+ function COLOR_PAIRS_As_Function return Interfaces.C.int;
+ pragma Import (C, COLOR_PAIRS_As_Function, "COLOR_PAIRS_as_function");
+ begin
+ return Natural (COLOR_PAIRS_As_Function);
+ end Number_Of_Color_Pairs;
------------------------------------------------------------------------------
procedure Transform_Coordinates
- (W : in Window := Standard_Window;
+ (W : Window := Standard_Window;
Line : in out Line_Position;
Column : in out Column_Position;
- Dir : in Transform_Direction := From_Screen)
+ Dir : Transform_Direction := From_Screen)
is
type Int_Access is access all C_Int;
function Transform (W : Window;
@@ -2431,7 +2487,7 @@
end if;
end Use_Extended_Names;
------------------------------------------------------------------------------
- procedure Screen_Dump_To_File (Filename : in String)
+ procedure Screen_Dump_To_File (Filename : String)
is
function scr_dump (f : char_array) return C_Int;
pragma Import (C, scr_dump, "scr_dump");
@@ -2444,7 +2500,7 @@
end if;
end Screen_Dump_To_File;
- procedure Screen_Restore_From_File (Filename : in String)
+ procedure Screen_Restore_From_File (Filename : String)
is
function scr_restore (f : char_array) return C_Int;
pragma Import (C, scr_restore, "scr_restore");
@@ -2457,7 +2513,7 @@
end if;
end Screen_Restore_From_File;
- procedure Screen_Init_From_File (Filename : in String)
+ procedure Screen_Init_From_File (Filename : String)
is
function scr_init (f : char_array) return C_Int;
pragma Import (C, scr_init, "scr_init");
@@ -2470,7 +2526,7 @@
end if;
end Screen_Init_From_File;
- procedure Screen_Set_File (Filename : in String)
+ procedure Screen_Set_File (Filename : String)
is
function scr_set (f : char_array) return C_Int;
pragma Import (C, scr_set, "scr_set");
@@ -2493,7 +2549,8 @@
begin
if wresize (Win,
C_Int (Number_Of_Lines),
- C_Int (Number_Of_Columns)) = Curses_Err then
+ C_Int (Number_Of_Columns)) = Curses_Err
+ then
raise Curses_Exception;
end if;
end Resize;
diff --git a/Ada95/gen/terminal_interface-curses.ads.m4 b/Ada95/gen/terminal_interface-curses.ads.m4
index 4abc55e..25bb5d9 100644
--- a/Ada95/gen/terminal_interface-curses.ads.m4
+++ b/Ada95/gen/terminal_interface-curses.ads.m4
@@ -9,7 +9,7 @@
-- S P E C --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. --
+-- 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 --
@@ -37,23 +37,28 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
--- $Revision: 1.41 $
--- $Date: 2007/05/05 20:33:52 $
+-- $Revision: 1.47 $
+-- $Date: 2014/05/24 21:31:57 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-include(`Base_Defs')
with System.Storage_Elements;
with Interfaces.C; -- We need this for some assertions.
+with Terminal_Interface.Curses_Constants;
+
package Terminal_Interface.Curses is
pragma Preelaborate (Terminal_Interface.Curses);
-include(`Linker_Options')
-include(`Version_Info')
+ pragma Linker_Options ("-lncurses" & Curses_Constants.DFT_ARG_SUFFIX);
+
+ Major_Version : constant := Curses_Constants.NCURSES_VERSION_MAJOR;
+ Minor_Version : constant := Curses_Constants.NCURSES_VERSION_MINOR;
+ NC_Version : String renames Curses_Constants.Version;
+
type Window is private;
Null_Window : constant Window;
- type Line_Position is new Natural; -- line coordinate
- type Column_Position is new Natural; -- column coordinate
+ type Line_Position is new Integer; -- line coordinate
+ type Column_Position is new Integer; -- column coordinate
subtype Line_Count is Line_Position range 1 .. Line_Position'Last;
-- Type to count lines. We do not allow null windows, so must be positive
@@ -65,24 +70,315 @@
-- request codes.
-- FIXME: The "-1" should be Curses_Err
- subtype Real_Key_Code is Key_Code range -1 .. M4_KEY_MAX;
+ subtype Real_Key_Code is Key_Code range -1 .. Curses_Constants.KEY_MAX;
-- This are the codes that potentially represent a real keystroke.
-- Not all codes may be possible on a specific terminal. To check the
-- availability of a special key, the Has_Key function is provided.
subtype Special_Key_Code is Real_Key_Code
- range M4_SPECIAL_FIRST .. Real_Key_Code'Last;
+ range Curses_Constants. KEY_MIN - 1 .. Real_Key_Code'Last;
-- Type for a function- or special key number
subtype Normal_Key_Code is Real_Key_Code range
Character'Pos (Character'First) .. Character'Pos (Character'Last);
-- This are the codes for regular (incl. non-graphical) characters.
+ -- For those who like to use the original key names we produce them were
+ -- they differ from the original.
+
-- Constants for function- and special keys
- --
- Key_None : constant Special_Key_Code := M4_SPECIAL_FIRST;
-include(`Key_Definitions')
- Key_Max : constant Special_Key_Code
+ Key_None : constant Special_Key_Code
+ := Curses_Constants.KEY_MIN - 1;
+ Key_Min : constant Special_Key_Code
+ := Curses_Constants.KEY_MIN;
+ Key_Break : constant Special_Key_Code
+ := Curses_Constants.KEY_BREAK;
+ KEY_DOWN : constant Special_Key_Code
+ := Curses_Constants.KEY_DOWN;
+ Key_Cursor_Down : Special_Key_Code renames KEY_DOWN;
+ KEY_UP : constant Special_Key_Code
+ := Curses_Constants.KEY_UP;
+ Key_Cursor_Up : Special_Key_Code renames KEY_UP;
+ KEY_LEFT : constant Special_Key_Code
+ := Curses_Constants.KEY_LEFT;
+ Key_Cursor_Left : Special_Key_Code renames KEY_LEFT;
+ KEY_RIGHT : constant Special_Key_Code
+ := Curses_Constants.KEY_RIGHT;
+ Key_Cursor_Right : Special_Key_Code renames KEY_RIGHT;
+ Key_Home : constant Special_Key_Code
+ := Curses_Constants.KEY_HOME;
+ Key_Backspace : constant Special_Key_Code
+ := Curses_Constants.KEY_BACKSPACE;
+ Key_F0 : constant Special_Key_Code
+ := Curses_Constants.KEY_F0;
+ Key_F1 : constant Special_Key_Code
+ := Curses_Constants.KEY_F1;
+ Key_F2 : constant Special_Key_Code
+ := Curses_Constants.KEY_F2;
+ Key_F3 : constant Special_Key_Code
+ := Curses_Constants.KEY_F3;
+ Key_F4 : constant Special_Key_Code
+ := Curses_Constants.KEY_F4;
+ Key_F5 : constant Special_Key_Code
+ := Curses_Constants.KEY_F5;
+ Key_F6 : constant Special_Key_Code
+ := Curses_Constants.KEY_F6;
+ Key_F7 : constant Special_Key_Code
+ := Curses_Constants.KEY_F7;
+ Key_F8 : constant Special_Key_Code
+ := Curses_Constants.KEY_F8;
+ Key_F9 : constant Special_Key_Code
+ := Curses_Constants.KEY_F9;
+ Key_F10 : constant Special_Key_Code
+ := Curses_Constants.KEY_F10;
+ Key_F11 : constant Special_Key_Code
+ := Curses_Constants.KEY_F11;
+ Key_F12 : constant Special_Key_Code
+ := Curses_Constants.KEY_F12;
+ Key_F13 : constant Special_Key_Code
+ := Curses_Constants.KEY_F13;
+ Key_F14 : constant Special_Key_Code
+ := Curses_Constants.KEY_F14;
+ Key_F15 : constant Special_Key_Code
+ := Curses_Constants.KEY_F15;
+ Key_F16 : constant Special_Key_Code
+ := Curses_Constants.KEY_F16;
+ Key_F17 : constant Special_Key_Code
+ := Curses_Constants.KEY_F17;
+ Key_F18 : constant Special_Key_Code
+ := Curses_Constants.KEY_F18;
+ Key_F19 : constant Special_Key_Code
+ := Curses_Constants.KEY_F19;
+ Key_F20 : constant Special_Key_Code
+ := Curses_Constants.KEY_F20;
+ Key_F21 : constant Special_Key_Code
+ := Curses_Constants.KEY_F21;
+ Key_F22 : constant Special_Key_Code
+ := Curses_Constants.KEY_F22;
+ Key_F23 : constant Special_Key_Code
+ := Curses_Constants.KEY_F23;
+ Key_F24 : constant Special_Key_Code
+ := Curses_Constants.KEY_F24;
+ KEY_DL : constant Special_Key_Code
+ := Curses_Constants.KEY_DL;
+ Key_Delete_Line : Special_Key_Code renames KEY_DL;
+ KEY_IL : constant Special_Key_Code
+ := Curses_Constants.KEY_IL;
+ Key_Insert_Line : Special_Key_Code renames KEY_IL;
+ KEY_DC : constant Special_Key_Code
+ := Curses_Constants.KEY_DC;
+ Key_Delete_Char : Special_Key_Code renames KEY_DC;
+ KEY_IC : constant Special_Key_Code
+ := Curses_Constants.KEY_IC;
+ Key_Insert_Char : Special_Key_Code renames KEY_IC;
+ KEY_EIC : constant Special_Key_Code
+ := Curses_Constants.KEY_EIC;
+ Key_Exit_Insert_Mode : Special_Key_Code renames KEY_EIC;
+ KEY_CLEAR : constant Special_Key_Code
+ := Curses_Constants.KEY_CLEAR;
+ Key_Clear_Screen : Special_Key_Code renames KEY_CLEAR;
+ KEY_EOS : constant Special_Key_Code
+ := Curses_Constants.KEY_EOS;
+ Key_Clear_End_Of_Screen : Special_Key_Code renames KEY_EOS;
+ KEY_EOL : constant Special_Key_Code
+ := Curses_Constants.KEY_EOL;
+ Key_Clear_End_Of_Line : Special_Key_Code renames KEY_EOL;
+ KEY_SF : constant Special_Key_Code
+ := Curses_Constants.KEY_SF;
+ Key_Scroll_1_Forward : Special_Key_Code renames KEY_SF;
+ KEY_SR : constant Special_Key_Code
+ := Curses_Constants.KEY_SR;
+ Key_Scroll_1_Backward : Special_Key_Code renames KEY_SR;
+ KEY_NPAGE : constant Special_Key_Code
+ := Curses_Constants.KEY_NPAGE;
+ Key_Next_Page : Special_Key_Code renames KEY_NPAGE;
+ KEY_PPAGE : constant Special_Key_Code
+ := Curses_Constants.KEY_PPAGE;
+ Key_Previous_Page : Special_Key_Code renames KEY_PPAGE;
+ KEY_STAB : constant Special_Key_Code
+ := Curses_Constants.KEY_STAB;
+ Key_Set_Tab : Special_Key_Code renames KEY_STAB;
+ KEY_CTAB : constant Special_Key_Code
+ := Curses_Constants.KEY_CTAB;
+ Key_Clear_Tab : Special_Key_Code renames KEY_CTAB;
+ KEY_CATAB : constant Special_Key_Code
+ := Curses_Constants.KEY_CATAB;
+ Key_Clear_All_Tabs : Special_Key_Code renames KEY_CATAB;
+ KEY_ENTER : constant Special_Key_Code
+ := Curses_Constants.KEY_ENTER;
+ Key_Enter_Or_Send : Special_Key_Code renames KEY_ENTER;
+ KEY_SRESET : constant Special_Key_Code
+ := Curses_Constants.KEY_SRESET;
+ Key_Soft_Reset : Special_Key_Code renames KEY_SRESET;
+ Key_Reset : constant Special_Key_Code
+ := Curses_Constants.KEY_RESET;
+ Key_Print : constant Special_Key_Code
+ := Curses_Constants.KEY_PRINT;
+ KEY_LL : constant Special_Key_Code
+ := Curses_Constants.KEY_LL;
+ Key_Bottom : Special_Key_Code renames KEY_LL;
+ KEY_A1 : constant Special_Key_Code
+ := Curses_Constants.KEY_A1;
+ Key_Upper_Left_Of_Keypad : Special_Key_Code renames KEY_A1;
+ KEY_A3 : constant Special_Key_Code
+ := Curses_Constants.KEY_A3;
+ Key_Upper_Right_Of_Keypad : Special_Key_Code renames KEY_A3;
+ KEY_B2 : constant Special_Key_Code
+ := Curses_Constants.KEY_B2;
+ Key_Center_Of_Keypad : Special_Key_Code renames KEY_B2;
+ KEY_C1 : constant Special_Key_Code
+ := Curses_Constants.KEY_C1;
+ Key_Lower_Left_Of_Keypad : Special_Key_Code renames KEY_C1;
+ KEY_C3 : constant Special_Key_Code
+ := Curses_Constants.KEY_C3;
+ Key_Lower_Right_Of_Keypad : Special_Key_Code renames KEY_C3;
+ KEY_BTAB : constant Special_Key_Code
+ := Curses_Constants.KEY_BTAB;
+ Key_Back_Tab : Special_Key_Code renames KEY_BTAB;
+ KEY_BEG : constant Special_Key_Code
+ := Curses_Constants.KEY_BEG;
+ Key_Beginning : Special_Key_Code renames KEY_BEG;
+ Key_Cancel : constant Special_Key_Code
+ := Curses_Constants.KEY_CANCEL;
+ Key_Close : constant Special_Key_Code
+ := Curses_Constants.KEY_CLOSE;
+ Key_Command : constant Special_Key_Code
+ := Curses_Constants.KEY_COMMAND;
+ Key_Copy : constant Special_Key_Code
+ := Curses_Constants.KEY_COPY;
+ Key_Create : constant Special_Key_Code
+ := Curses_Constants.KEY_CREATE;
+ Key_End : constant Special_Key_Code
+ := Curses_Constants.KEY_END;
+ Key_Exit : constant Special_Key_Code
+ := Curses_Constants.KEY_EXIT;
+ Key_Find : constant Special_Key_Code
+ := Curses_Constants.KEY_FIND;
+ Key_Help : constant Special_Key_Code
+ := Curses_Constants.KEY_HELP;
+ Key_Mark : constant Special_Key_Code
+ := Curses_Constants.KEY_MARK;
+ Key_Message : constant Special_Key_Code
+ := Curses_Constants.KEY_MESSAGE;
+ Key_Move : constant Special_Key_Code
+ := Curses_Constants.KEY_MOVE;
+ Key_Next : constant Special_Key_Code
+ := Curses_Constants.KEY_NEXT;
+ Key_Open : constant Special_Key_Code
+ := Curses_Constants.KEY_OPEN;
+ Key_Options : constant Special_Key_Code
+ := Curses_Constants.KEY_OPTIONS;
+ Key_Previous : constant Special_Key_Code
+ := Curses_Constants.KEY_PREVIOUS;
+ Key_Redo : constant Special_Key_Code
+ := Curses_Constants.KEY_REDO;
+ Key_Reference : constant Special_Key_Code
+ := Curses_Constants.KEY_REFERENCE;
+ Key_Refresh : constant Special_Key_Code
+ := Curses_Constants.KEY_REFRESH;
+ Key_Replace : constant Special_Key_Code
+ := Curses_Constants.KEY_REPLACE;
+ Key_Restart : constant Special_Key_Code
+ := Curses_Constants.KEY_RESTART;
+ Key_Resume : constant Special_Key_Code
+ := Curses_Constants.KEY_RESUME;
+ Key_Save : constant Special_Key_Code
+ := Curses_Constants.KEY_SAVE;
+ KEY_SBEG : constant Special_Key_Code
+ := Curses_Constants.KEY_SBEG;
+ Key_Shift_Begin : Special_Key_Code renames KEY_SBEG;
+ KEY_SCANCEL : constant Special_Key_Code
+ := Curses_Constants.KEY_SCANCEL;
+ Key_Shift_Cancel : Special_Key_Code renames KEY_SCANCEL;
+ KEY_SCOMMAND : constant Special_Key_Code
+ := Curses_Constants.KEY_SCOMMAND;
+ Key_Shift_Command : Special_Key_Code renames KEY_SCOMMAND;
+ KEY_SCOPY : constant Special_Key_Code
+ := Curses_Constants.KEY_SCOPY;
+ Key_Shift_Copy : Special_Key_Code renames KEY_SCOPY;
+ KEY_SCREATE : constant Special_Key_Code
+ := Curses_Constants.KEY_SCREATE;
+ Key_Shift_Create : Special_Key_Code renames KEY_SCREATE;
+ KEY_SDC : constant Special_Key_Code
+ := Curses_Constants.KEY_SDC;
+ Key_Shift_Delete_Char : Special_Key_Code renames KEY_SDC;
+ KEY_SDL : constant Special_Key_Code
+ := Curses_Constants.KEY_SDL;
+ Key_Shift_Delete_Line : Special_Key_Code renames KEY_SDL;
+ Key_Select : constant Special_Key_Code
+ := Curses_Constants.KEY_SELECT;
+ KEY_SEND : constant Special_Key_Code
+ := Curses_Constants.KEY_SEND;
+ Key_Shift_End : Special_Key_Code renames KEY_SEND;
+ KEY_SEOL : constant Special_Key_Code
+ := Curses_Constants.KEY_SEOL;
+ Key_Shift_Clear_End_Of_Line : Special_Key_Code renames KEY_SEOL;
+ KEY_SEXIT : constant Special_Key_Code
+ := Curses_Constants.KEY_SEXIT;
+ Key_Shift_Exit : Special_Key_Code renames KEY_SEXIT;
+ KEY_SFIND : constant Special_Key_Code
+ := Curses_Constants.KEY_SFIND;
+ Key_Shift_Find : Special_Key_Code renames KEY_SFIND;
+ KEY_SHELP : constant Special_Key_Code
+ := Curses_Constants.KEY_SHELP;
+ Key_Shift_Help : Special_Key_Code renames KEY_SHELP;
+ KEY_SHOME : constant Special_Key_Code
+ := Curses_Constants.KEY_SHOME;
+ Key_Shift_Home : Special_Key_Code renames KEY_SHOME;
+ KEY_SIC : constant Special_Key_Code
+ := Curses_Constants.KEY_SIC;
+ Key_Shift_Insert_Char : Special_Key_Code renames KEY_SIC;
+ KEY_SLEFT : constant Special_Key_Code
+ := Curses_Constants.KEY_SLEFT;
+ Key_Shift_Cursor_Left : Special_Key_Code renames KEY_SLEFT;
+ KEY_SMESSAGE : constant Special_Key_Code
+ := Curses_Constants.KEY_SMESSAGE;
+ Key_Shift_Message : Special_Key_Code renames KEY_SMESSAGE;
+ KEY_SMOVE : constant Special_Key_Code
+ := Curses_Constants.KEY_SMOVE;
+ Key_Shift_Move : Special_Key_Code renames KEY_SMOVE;
+ KEY_SNEXT : constant Special_Key_Code
+ := Curses_Constants.KEY_SNEXT;
+ Key_Shift_Next_Page : Special_Key_Code renames KEY_SNEXT;
+ KEY_SOPTIONS : constant Special_Key_Code
+ := Curses_Constants.KEY_SOPTIONS;
+ Key_Shift_Options : Special_Key_Code renames KEY_SOPTIONS;
+ KEY_SPREVIOUS : constant Special_Key_Code
+ := Curses_Constants.KEY_SPREVIOUS;
+ Key_Shift_Previous_Page : Special_Key_Code renames KEY_SPREVIOUS;
+ KEY_SPRINT : constant Special_Key_Code
+ := Curses_Constants.KEY_SPRINT;
+ Key_Shift_Print : Special_Key_Code renames KEY_SPRINT;
+ KEY_SREDO : constant Special_Key_Code
+ := Curses_Constants.KEY_SREDO;
+ Key_Shift_Redo : Special_Key_Code renames KEY_SREDO;
+ KEY_SREPLACE : constant Special_Key_Code
+ := Curses_Constants.KEY_SREPLACE;
+ Key_Shift_Replace : Special_Key_Code renames KEY_SREPLACE;
+ KEY_SRIGHT : constant Special_Key_Code
+ := Curses_Constants.KEY_SRIGHT;
+ Key_Shift_Cursor_Right : Special_Key_Code renames KEY_SRIGHT;
+ KEY_SRSUME : constant Special_Key_Code
+ := Curses_Constants.KEY_SRSUME;
+ Key_Shift_Resume : Special_Key_Code renames KEY_SRSUME;
+ KEY_SSAVE : constant Special_Key_Code
+ := Curses_Constants.KEY_SSAVE;
+ Key_Shift_Save : Special_Key_Code renames KEY_SSAVE;
+ KEY_SSUSPEND : constant Special_Key_Code
+ := Curses_Constants.KEY_SSUSPEND;
+ Key_Shift_Suspend : Special_Key_Code renames KEY_SSUSPEND;
+ KEY_SUNDO : constant Special_Key_Code
+ := Curses_Constants.KEY_SUNDO;
+ Key_Shift_Undo : Special_Key_Code renames KEY_SUNDO;
+ Key_Suspend : constant Special_Key_Code
+ := Curses_Constants.KEY_SUSPEND;
+ Key_Undo : constant Special_Key_Code
+ := Curses_Constants.KEY_UNDO;
+ Key_Mouse : constant Special_Key_Code
+ := Curses_Constants.KEY_MOUSE;
+ Key_Resize : constant Special_Key_Code
+ := Curses_Constants.KEY_RESIZE;
+ Key_Max : constant Special_Key_Code
:= Special_Key_Code'Last;
subtype User_Key_Code is Key_Code
@@ -90,12 +386,7 @@
-- This is reserved for user defined key codes. The range between Key_Max
-- and the first user code is reserved for subsystems like menu and forms.
- -- For those who like to use the original key names we produce them were
- -- they differ from the original. Please note that they may differ in
- -- lower/upper case.
-include(`Old_Keys')dnl
-
-------------------------------------------------------------------------------
+ --------------------------------------------------------------------------
type Color_Number is range -1 .. Integer (Interfaces.C.short'Last);
for Color_Number'Size use Interfaces.C.short'Size;
@@ -104,7 +395,15 @@
-- (potentially) definable colors. Some of those indices are
-- predefined (see below), although they may not really exist.
-include(`Color_Defs')
+ Black : constant Color_Number := Curses_Constants.COLOR_BLACK;
+ Red : constant Color_Number := Curses_Constants.COLOR_RED;
+ Green : constant Color_Number := Curses_Constants.COLOR_GREEN;
+ Yellow : constant Color_Number := Curses_Constants.COLOR_YELLOW;
+ Blue : constant Color_Number := Curses_Constants.COLOR_BLUE;
+ Magenta : constant Color_Number := Curses_Constants.COLOR_MAGENTA;
+ Cyan : constant Color_Number := Curses_Constants.COLOR_CYAN;
+ White : constant Color_Number := Curses_Constants.COLOR_WHITE;
+
type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last);
for RGB_Value'Size use Interfaces.C.short'Size;
-- Some system may allow to redefine a color by setting RGB values.
@@ -117,8 +416,73 @@
-- two colors described by Color_Numbers, one for the foreground and
-- the other for the background
-include(`Character_Attribute_Set_Rep')
- -- (n)curses uses all but the lowest 16 Bits for Attributes.
+ type Character_Attribute_Set is
+ record
+ Stand_Out : Boolean;
+ Under_Line : Boolean;
+ Reverse_Video : Boolean;
+ Blink : Boolean;
+ Dim_Character : Boolean;
+ Bold_Character : Boolean;
+ Protected_Character : Boolean;
+ Invisible_Character : Boolean;
+ Alternate_Character_Set : Boolean;
+ Horizontal : Boolean;
+ Left : Boolean;
+ Low : Boolean;
+ Right : Boolean;
+ Top : Boolean;
+ Vertical : Boolean;
+ end record;
+
+ for Character_Attribute_Set use
+ record
+ Stand_Out at 0 range
+ Curses_Constants.A_STANDOUT_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_STANDOUT_Last - Curses_Constants.Attr_First;
+ Under_Line at 0 range
+ Curses_Constants.A_UNDERLINE_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_UNDERLINE_Last - Curses_Constants.Attr_First;
+ Reverse_Video at 0 range
+ Curses_Constants.A_REVERSE_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_REVERSE_Last - Curses_Constants.Attr_First;
+ Blink at 0 range
+ Curses_Constants.A_BLINK_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_BLINK_Last - Curses_Constants.Attr_First;
+ Dim_Character at 0 range
+ Curses_Constants.A_DIM_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_DIM_Last - Curses_Constants.Attr_First;
+ Bold_Character at 0 range
+ Curses_Constants.A_BOLD_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_BOLD_Last - Curses_Constants.Attr_First;
+ Protected_Character at 0 range
+ Curses_Constants.A_PROTECT_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_PROTECT_Last - Curses_Constants.Attr_First;
+ Invisible_Character at 0 range
+ Curses_Constants.A_INVIS_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_INVIS_Last - Curses_Constants.Attr_First;
+ Alternate_Character_Set at 0 range
+ Curses_Constants.A_ALTCHARSET_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_ALTCHARSET_Last - Curses_Constants.Attr_First;
+ Horizontal at 0 range
+ Curses_Constants.A_HORIZONTAL_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_HORIZONTAL_Last - Curses_Constants.Attr_First;
+ Left at 0 range
+ Curses_Constants.A_LEFT_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_LEFT_Last - Curses_Constants.Attr_First;
+ Low at 0 range
+ Curses_Constants.A_LOW_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_LOW_Last - Curses_Constants.Attr_First;
+ Right at 0 range
+ Curses_Constants.A_RIGHT_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_RIGHT_Last - Curses_Constants.Attr_First;
+ Top at 0 range
+ Curses_Constants.A_TOP_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_TOP_Last - Curses_Constants.Attr_First;
+ Vertical at 0 range
+ Curses_Constants.A_VERTICAL_First - Curses_Constants.Attr_First
+ .. Curses_Constants.A_VERTICAL_Last - Curses_Constants.Attr_First;
+ end record;
Normal_Video : constant Character_Attribute_Set := (others => False);
@@ -128,17 +492,29 @@
Color : Color_Pair;
Ch : Character;
end record;
- pragma Convention (C, Attributed_Character);
+ pragma Convention (C_Pass_By_Copy, Attributed_Character);
-- This is the counterpart for the chtype in C.
-include(`AC_Rep')
+ for Attributed_Character use
+ record
+ Ch at 0 range Curses_Constants.A_CHARTEXT_First
+ .. Curses_Constants.A_CHARTEXT_Last;
+ Color at 0 range Curses_Constants.A_COLOR_First
+ .. Curses_Constants.A_COLOR_Last;
+ pragma Warnings (Off);
+ Attr at 0 range Curses_Constants.Attr_First
+ .. Curses_Constants.Attr_Last;
+ pragma Warnings (On);
+ end record;
+ for Attributed_Character'Size use Curses_Constants.chtype_Size;
+
Default_Character : constant Attributed_Character
:= (Ch => Character'First,
Color => Color_Pair'First,
Attr => (others => False)); -- preelaboratable Normal_Video
type Attributed_String is array (Positive range <>) of Attributed_Character;
- pragma Pack (Attributed_String);
+ pragma Convention (C, Attributed_String);
-- In this binding we allow strings of attributed characters.
------------------
@@ -188,7 +564,78 @@
function Number_Of_Color_Pairs return Natural;
pragma Inline (Number_Of_Color_Pairs);
-include(`ACS_Map')dnl
+ subtype ACS_Index is Character range
+ Character'Val (0) .. Character'Val (127);
+ function ACS_Map (Index : ACS_Index) return Attributed_Character;
+ pragma Import (C, ACS_Map, "acs_map_as_function");
+
+ -- Constants for several characters from the Alternate Character Set
+ -- You must use these constants as indices into the ACS_Map function
+ -- to get the corresponding attributed character at runtime
+ ACS_Upper_Left_Corner : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_ULCORNER);
+ ACS_Lower_Left_Corner : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_LLCORNER);
+ ACS_Upper_Right_Corner : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_URCORNER);
+ ACS_Lower_Right_Corner : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_LRCORNER);
+ ACS_Left_Tee : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_LTEE);
+ ACS_Right_Tee : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_RTEE);
+ ACS_Bottom_Tee : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_BTEE);
+ ACS_Top_Tee : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_TTEE);
+ ACS_Horizontal_Line : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_HLINE);
+ ACS_Vertical_Line : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_VLINE);
+ ACS_Plus_Symbol : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_PLUS);
+ ACS_Scan_Line_1 : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_S1);
+ ACS_Scan_Line_9 : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_S9);
+ ACS_Diamond : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_DIAMOND);
+ ACS_Checker_Board : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_CKBOARD);
+ ACS_Degree : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_DEGREE);
+ ACS_Plus_Minus : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_PLMINUS);
+ ACS_Bullet : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_BULLET);
+ ACS_Left_Arrow : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_LARROW);
+ ACS_Right_Arrow : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_RARROW);
+ ACS_Down_Arrow : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_DARROW);
+ ACS_Up_Arrow : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_UARROW);
+ ACS_Board_Of_Squares : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_BOARD);
+ ACS_Lantern : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_LANTERN);
+ ACS_Solid_Block : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_BLOCK);
+ ACS_Scan_Line_3 : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_S3);
+ ACS_Scan_Line_7 : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_S7);
+ ACS_Less_Or_Equal : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_LEQUAL);
+ ACS_Greater_Or_Equal : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_GEQUAL);
+ ACS_PI : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_PI);
+ ACS_Not_Equal : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_NEQUAL);
+ ACS_Sterling : constant ACS_Index
+ := Character'Val (Curses_Constants.ACS_STERLING);
-- MANPAGE(`curs_initscr.3x')
-- | Not implemented: newterm, set_term, delscreen
@@ -196,11 +643,13 @@
-- ANCHOR(`stdscr',`Standard_Window')
function Standard_Window return Window;
-- AKA
+ pragma Import (C, Standard_Window, "stdscr_as_function");
pragma Inline (Standard_Window);
-- ANCHOR(`curscr',`Current_Window')
function Current_Window return Window;
-- AKA
+ pragma Import (C, Current_Window, "curscr_as_function");
pragma Inline (Current_Window);
-- ANCHOR(`initscr()',`Init_Screen')
@@ -227,9 +676,9 @@
-- MANPAGE(`curs_move.3x')
-- ANCHOR(`wmove()',`Move_Cursor')
- procedure Move_Cursor (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position);
+ procedure Move_Cursor (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position);
-- AKA
-- ALIAS(`move()')
pragma Inline (Move_Cursor);
@@ -237,43 +686,43 @@
-- MANPAGE(`curs_addch.3x')
-- ANCHOR(`waddch()',`Add')
- procedure Add (Win : in Window := Standard_Window;
- Ch : in Attributed_Character);
+ procedure Add (Win : Window := Standard_Window;
+ Ch : Attributed_Character);
-- AKA
-- ALIAS(`addch()')
- procedure Add (Win : in Window := Standard_Window;
- Ch : in Character);
+ procedure Add (Win : Window := Standard_Window;
+ Ch : Character);
-- Add a single character at the current logical cursor position to
-- the window. Use the current windows attributes.
-- ANCHOR(`mvwaddch()',`Add')
procedure Add
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Ch : in Attributed_Character);
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Ch : Attributed_Character);
-- AKA
-- ALIAS(`mvaddch()')
procedure Add
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Ch : in Character);
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Ch : Character);
-- Move to the position and add a single character into the window
-- There are more Add routines, so the Inline pragma follows later
-- ANCHOR(`wechochar()',`Add_With_Immediate_Echo')
procedure Add_With_Immediate_Echo
- (Win : in Window := Standard_Window;
- Ch : in Attributed_Character);
+ (Win : Window := Standard_Window;
+ Ch : Attributed_Character);
-- AKA
-- ALIAS(`echochar()')
procedure Add_With_Immediate_Echo
- (Win : in Window := Standard_Window;
- Ch : in Character);
+ (Win : Window := Standard_Window;
+ Ch : Character);
-- Add a character and do an immediate refresh of the screen.
pragma Inline (Add_With_Immediate_Echo);
@@ -331,52 +780,52 @@
pragma Inline (Duplicate);
-- ANCHOR(`mvwin()',`Move_Window')
- procedure Move_Window (Win : in Window;
- Line : in Line_Position;
- Column : in Column_Position);
+ procedure Move_Window (Win : Window;
+ Line : Line_Position;
+ Column : Column_Position);
-- AKA
pragma Inline (Move_Window);
-- ANCHOR(`mvderwin()',`Move_Derived_Window')
- procedure Move_Derived_Window (Win : in Window;
- Line : in Line_Position;
- Column : in Column_Position);
+ procedure Move_Derived_Window (Win : Window;
+ Line : Line_Position;
+ Column : Column_Position);
-- AKA
pragma Inline (Move_Derived_Window);
-- ANCHOR(`wsyncup()',`Synchronize_Upwards')
- procedure Synchronize_Upwards (Win : in Window);
+ procedure Synchronize_Upwards (Win : Window);
-- AKA
pragma Import (C, Synchronize_Upwards, "wsyncup");
-- ANCHOR(`wsyncdown()',`Synchronize_Downwards')
- procedure Synchronize_Downwards (Win : in Window);
+ procedure Synchronize_Downwards (Win : Window);
-- AKA
pragma Import (C, Synchronize_Downwards, "wsyncdown");
-- ANCHOR(`syncok()',`Set_Synch_Mode')
- procedure Set_Synch_Mode (Win : in Window := Standard_Window;
- Mode : in Boolean := False);
+ procedure Set_Synch_Mode (Win : Window := Standard_Window;
+ Mode : Boolean := False);
-- AKA
pragma Inline (Set_Synch_Mode);
-- MANPAGE(`curs_addstr.3x')
-- ANCHOR(`waddnstr()',`Add')
- procedure Add (Win : in Window := Standard_Window;
- Str : in String;
- Len : in Integer := -1);
+ procedure Add (Win : Window := Standard_Window;
+ Str : String;
+ Len : Integer := -1);
-- AKA
-- ALIAS(`waddstr()')
-- ALIAS(`addnstr()')
-- ALIAS(`addstr()')
-- ANCHOR(`mvwaddnstr()',`Add')
- procedure Add (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Str : in String;
- Len : in Integer := -1);
+ procedure Add (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Str : String;
+ Len : Integer := -1);
-- AKA
-- ALIAS(`mvwaddstr()')
-- ALIAS(`mvaddnstr()')
@@ -385,20 +834,20 @@
-- MANPAGE(`curs_addchstr.3x')
-- ANCHOR(`waddchnstr()',`Add')
- procedure Add (Win : in Window := Standard_Window;
- Str : in Attributed_String;
- Len : in Integer := -1);
+ procedure Add (Win : Window := Standard_Window;
+ Str : Attributed_String;
+ Len : Integer := -1);
-- AKA
-- ALIAS(`waddchstr()')
-- ALIAS(`addchnstr()')
-- ALIAS(`addchstr()')
-- ANCHOR(`mvwaddchnstr()',`Add')
- procedure Add (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Str : in Attributed_String;
- Len : in Integer := -1);
+ procedure Add (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Str : Attributed_String;
+ Len : Integer := -1);
-- AKA
-- ALIAS(`mvwaddchstr()')
-- ALIAS(`mvaddchnstr()')
@@ -411,15 +860,15 @@
-- ANCHOR(`wborder()',`Border')
procedure Border
- (Win : in Window := Standard_Window;
- Left_Side_Symbol : in Attributed_Character := Default_Character;
- Right_Side_Symbol : in Attributed_Character := Default_Character;
- Top_Side_Symbol : in Attributed_Character := Default_Character;
- Bottom_Side_Symbol : in Attributed_Character := Default_Character;
- Upper_Left_Corner_Symbol : in Attributed_Character := Default_Character;
- Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character;
- Lower_Left_Corner_Symbol : in Attributed_Character := Default_Character;
- Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character
+ (Win : Window := Standard_Window;
+ Left_Side_Symbol : Attributed_Character := Default_Character;
+ Right_Side_Symbol : Attributed_Character := Default_Character;
+ Top_Side_Symbol : Attributed_Character := Default_Character;
+ Bottom_Side_Symbol : Attributed_Character := Default_Character;
+ Upper_Left_Corner_Symbol : Attributed_Character := Default_Character;
+ Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
+ Lower_Left_Corner_Symbol : Attributed_Character := Default_Character;
+ Lower_Right_Corner_Symbol : Attributed_Character := Default_Character
);
-- AKA
-- ALIAS(`border()')
@@ -427,26 +876,26 @@
-- ANCHOR(`box()',`Box')
procedure Box
- (Win : in Window := Standard_Window;
- Vertical_Symbol : in Attributed_Character := Default_Character;
- Horizontal_Symbol : in Attributed_Character := Default_Character);
+ (Win : Window := Standard_Window;
+ Vertical_Symbol : Attributed_Character := Default_Character;
+ Horizontal_Symbol : Attributed_Character := Default_Character);
-- AKA
pragma Inline (Box);
-- ANCHOR(`whline()',`Horizontal_Line')
procedure Horizontal_Line
- (Win : in Window := Standard_Window;
- Line_Size : in Natural;
- Line_Symbol : in Attributed_Character := Default_Character);
+ (Win : Window := Standard_Window;
+ Line_Size : Natural;
+ Line_Symbol : Attributed_Character := Default_Character);
-- AKA
-- ALIAS(`hline()')
pragma Inline (Horizontal_Line);
-- ANCHOR(`wvline()',`Vertical_Line')
procedure Vertical_Line
- (Win : in Window := Standard_Window;
- Line_Size : in Natural;
- Line_Symbol : in Attributed_Character := Default_Character);
+ (Win : Window := Standard_Window;
+ Line_Size : Natural;
+ Line_Symbol : Attributed_Character := Default_Character);
-- AKA
-- ALIAS(`vline()')
pragma Inline (Vertical_Line);
@@ -461,12 +910,12 @@
-- ALIAS(`getch()')
-- Get a character from the keyboard and echo it - if enabled - to the
-- window.
- -- If for any reason (i.e. a timeout) we couldn't get a character the
+ -- If for any reason (i.e. a timeout) we could not get a character the
-- returned keycode is Key_None.
pragma Inline (Get_Keystroke);
-- ANCHOR(`ungetch()',`Undo_Keystroke')
- procedure Undo_Keystroke (Key : in Real_Key_Code);
+ procedure Undo_Keystroke (Key : Real_Key_Code);
-- AKA
pragma Inline (Undo_Keystroke);
@@ -509,9 +958,9 @@
-- ANCHOR(`wattron()',`Switch_Character_Attribute')
procedure Switch_Character_Attribute
- (Win : in Window := Standard_Window;
- Attr : in Character_Attribute_Set := Normal_Video;
- On : in Boolean := True); -- if False we switch Off.
+ (Win : Window := Standard_Window;
+ Attr : Character_Attribute_Set := Normal_Video;
+ On : Boolean := True); -- if False we switch Off.
-- Switches those Attributes set to true in the list.
-- AKA
-- ALIAS(`wattroff()')
@@ -520,49 +969,49 @@
-- ANCHOR(`wattrset()',`Set_Character_Attributes')
procedure Set_Character_Attributes
- (Win : in Window := Standard_Window;
- Attr : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First);
+ (Win : Window := Standard_Window;
+ Attr : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First);
-- AKA
-- ALIAS(`attrset()')
pragma Inline (Set_Character_Attributes);
-- ANCHOR(`wattr_get()',`Get_Character_Attributes')
function Get_Character_Attribute
- (Win : in Window := Standard_Window) return Character_Attribute_Set;
+ (Win : Window := Standard_Window) return Character_Attribute_Set;
-- AKA
-- ALIAS(`attr_get()')
-- ANCHOR(`wattr_get()',`Get_Character_Attribute')
function Get_Character_Attribute
- (Win : in Window := Standard_Window) return Color_Pair;
+ (Win : Window := Standard_Window) return Color_Pair;
-- AKA
pragma Inline (Get_Character_Attribute);
-- ANCHOR(`wcolor_set()',`Set_Color')
- procedure Set_Color (Win : in Window := Standard_Window;
- Pair : in Color_Pair);
+ procedure Set_Color (Win : Window := Standard_Window;
+ Pair : Color_Pair);
-- AKA
-- ALIAS(`color_set()')
pragma Inline (Set_Color);
-- ANCHOR(`wchgat()',`Change_Attributes')
procedure Change_Attributes
- (Win : in Window := Standard_Window;
- Count : in Integer := -1;
- Attr : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First);
+ (Win : Window := Standard_Window;
+ Count : Integer := -1;
+ Attr : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First);
-- AKA
-- ALIAS(`chgat()')
-- ANCHOR(`mvwchgat()',`Change_Attributes')
procedure Change_Attributes
- (Win : in Window := Standard_Window;
- Line : in Line_Position := Line_Position'First;
- Column : in Column_Position := Column_Position'First;
- Count : in Integer := -1;
- Attr : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First);
+ (Win : Window := Standard_Window;
+ Line : Line_Position := Line_Position'First;
+ Column : Column_Position := Column_Position'First;
+ Count : Integer := -1;
+ Attr : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First);
-- AKA
-- ALIAS(`mvchgat()')
pragma Inline (Change_Attributes);
@@ -584,36 +1033,36 @@
-- | Not implemented : typeahead
--
-- ANCHOR(`cbreak()',`Set_Cbreak_Mode')
- procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True);
+ procedure Set_Cbreak_Mode (SwitchOn : Boolean := True);
-- AKA
-- ALIAS(`nocbreak()')
pragma Inline (Set_Cbreak_Mode);
-- ANCHOR(`raw()',`Set_Raw_Mode')
- procedure Set_Raw_Mode (SwitchOn : in Boolean := True);
+ procedure Set_Raw_Mode (SwitchOn : Boolean := True);
-- AKA
-- ALIAS(`noraw()')
pragma Inline (Set_Raw_Mode);
-- ANCHOR(`echo()',`Set_Echo_Mode')
- procedure Set_Echo_Mode (SwitchOn : in Boolean := True);
+ procedure Set_Echo_Mode (SwitchOn : Boolean := True);
-- AKA
-- ALIAS(`noecho()')
pragma Inline (Set_Echo_Mode);
-- ANCHOR(`meta()',`Set_Meta_Mode')
- procedure Set_Meta_Mode (Win : in Window := Standard_Window;
- SwitchOn : in Boolean := True);
+ procedure Set_Meta_Mode (Win : Window := Standard_Window;
+ SwitchOn : Boolean := True);
-- AKA
pragma Inline (Set_Meta_Mode);
-- ANCHOR(`keypad()',`Set_KeyPad_Mode')
- procedure Set_KeyPad_Mode (Win : in Window := Standard_Window;
- SwitchOn : in Boolean := True);
+ procedure Set_KeyPad_Mode (Win : Window := Standard_Window;
+ SwitchOn : Boolean := True);
-- AKA
pragma Inline (Set_KeyPad_Mode);
- function Get_KeyPad_Mode (Win : in Window := Standard_Window)
+ function Get_KeyPad_Mode (Win : Window := Standard_Window)
return Boolean;
-- This has no pendant in C. There you've to look into the WINDOWS
-- structure to get the value. Bad practice, not repeated in Ada.
@@ -621,100 +1070,100 @@
type Half_Delay_Amount is range 1 .. 255;
-- ANCHOR(`halfdelay()',`Half_Delay')
- procedure Half_Delay (Amount : in Half_Delay_Amount);
+ procedure Half_Delay (Amount : Half_Delay_Amount);
-- AKA
pragma Inline (Half_Delay);
-- ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode')
procedure Set_Flush_On_Interrupt_Mode
- (Win : in Window := Standard_Window;
- Mode : in Boolean := True);
+ (Win : Window := Standard_Window;
+ Mode : Boolean := True);
-- AKA
pragma Inline (Set_Flush_On_Interrupt_Mode);
-- ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode')
procedure Set_Queue_Interrupt_Mode
- (Win : in Window := Standard_Window;
- Flush : in Boolean := True);
+ (Win : Window := Standard_Window;
+ Flush : Boolean := True);
-- AKA
-- ALIAS(`noqiflush()')
pragma Inline (Set_Queue_Interrupt_Mode);
-- ANCHOR(`nodelay()',`Set_NoDelay_Mode')
procedure Set_NoDelay_Mode
- (Win : in Window := Standard_Window;
- Mode : in Boolean := False);
+ (Win : Window := Standard_Window;
+ Mode : Boolean := False);
-- AKA
pragma Inline (Set_NoDelay_Mode);
type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
-- ANCHOR(`wtimeout()',`Set_Timeout_Mode')
- procedure Set_Timeout_Mode (Win : in Window := Standard_Window;
- Mode : in Timeout_Mode;
- Amount : in Natural); -- in Milliseconds
+ procedure Set_Timeout_Mode (Win : Window := Standard_Window;
+ Mode : Timeout_Mode;
+ Amount : Natural); -- in Milliseconds
-- AKA
-- ALIAS(`timeout()')
-- Instead of overloading the semantic of the sign of amount, we
-- introduce the Timeout_Mode parameter. This should improve
-- readability. For Blocking and Non_Blocking, the Amount is not
-- evaluated.
- -- We don't inline this procedure.
+ -- We do not inline this procedure.
-- ANCHOR(`notimeout()',`Set_Escape_Time_Mode')
procedure Set_Escape_Timer_Mode
- (Win : in Window := Standard_Window;
- Timer_Off : in Boolean := False);
+ (Win : Window := Standard_Window;
+ Timer_Off : Boolean := False);
-- AKA
pragma Inline (Set_Escape_Timer_Mode);
-- MANPAGE(`curs_outopts.3x')
-- ANCHOR(`nl()',`Set_NL_Mode')
- procedure Set_NL_Mode (SwitchOn : in Boolean := True);
+ procedure Set_NL_Mode (SwitchOn : Boolean := True);
-- AKA
-- ALIAS(`nonl()')
pragma Inline (Set_NL_Mode);
-- ANCHOR(`clearok()',`Clear_On_Next_Update')
procedure Clear_On_Next_Update
- (Win : in Window := Standard_Window;
- Do_Clear : in Boolean := True);
+ (Win : Window := Standard_Window;
+ Do_Clear : Boolean := True);
-- AKA
pragma Inline (Clear_On_Next_Update);
-- ANCHOR(`idlok()',`Use_Insert_Delete_Line')
procedure Use_Insert_Delete_Line
- (Win : in Window := Standard_Window;
- Do_Idl : in Boolean := True);
+ (Win : Window := Standard_Window;
+ Do_Idl : Boolean := True);
-- AKA
pragma Inline (Use_Insert_Delete_Line);
-- ANCHOR(`idcok()',`Use_Insert_Delete_Character')
procedure Use_Insert_Delete_Character
- (Win : in Window := Standard_Window;
- Do_Idc : in Boolean := True);
+ (Win : Window := Standard_Window;
+ Do_Idc : Boolean := True);
-- AKA
pragma Inline (Use_Insert_Delete_Character);
-- ANCHOR(`leaveok()',`Leave_Cursor_After_Update')
procedure Leave_Cursor_After_Update
- (Win : in Window := Standard_Window;
- Do_Leave : in Boolean := True);
+ (Win : Window := Standard_Window;
+ Do_Leave : Boolean := True);
-- AKA
pragma Inline (Leave_Cursor_After_Update);
-- ANCHOR(`immedok()',`Immediate_Update_Mode')
procedure Immediate_Update_Mode
- (Win : in Window := Standard_Window;
- Mode : in Boolean := False);
+ (Win : Window := Standard_Window;
+ Mode : Boolean := False);
-- AKA
pragma Inline (Immediate_Update_Mode);
-- ANCHOR(`scrollok()',`Allow_Scrolling')
procedure Allow_Scrolling
- (Win : in Window := Standard_Window;
- Mode : in Boolean := False);
+ (Win : Window := Standard_Window;
+ Mode : Boolean := False);
-- AKA
pragma Inline (Allow_Scrolling);
@@ -724,9 +1173,9 @@
-- ANCHOR(`wsetscrreg()',`Set_Scroll_Region')
procedure Set_Scroll_Region
- (Win : in Window := Standard_Window;
- Top_Line : in Line_Position;
- Bottom_Line : in Line_Position);
+ (Win : Window := Standard_Window;
+ Top_Line : Line_Position;
+ Bottom_Line : Line_Position);
-- AKA
-- ALIAS(`setscrreg()')
pragma Inline (Set_Scroll_Region);
@@ -739,7 +1188,7 @@
pragma Inline (Update_Screen);
-- ANCHOR(`wrefresh()',`Refresh')
- procedure Refresh (Win : in Window := Standard_Window);
+ procedure Refresh (Win : Window := Standard_Window);
-- AKA
-- There is an overloaded Refresh for Pads.
-- The Inline pragma appears there
@@ -747,47 +1196,47 @@
-- ANCHOR(`wnoutrefresh()',`Refresh_Without_Update')
procedure Refresh_Without_Update
- (Win : in Window := Standard_Window);
+ (Win : Window := Standard_Window);
-- AKA
-- There is an overloaded Refresh_Without_Update for Pads.
-- The Inline pragma appears there
-- ANCHOR(`redrawwin()',`Redraw')
- procedure Redraw (Win : in Window := Standard_Window);
+ procedure Redraw (Win : Window := Standard_Window);
-- AKA
-- ANCHOR(`wredrawln()',`Redraw')
- procedure Redraw (Win : in Window := Standard_Window;
- Begin_Line : in Line_Position;
- Line_Count : in Positive);
+ procedure Redraw (Win : Window := Standard_Window;
+ Begin_Line : Line_Position;
+ Line_Count : Positive);
-- AKA
pragma Inline (Redraw);
-- MANPAGE(`curs_clear.3x')
-- ANCHOR(`werase()',`Erase')
- procedure Erase (Win : in Window := Standard_Window);
+ procedure Erase (Win : Window := Standard_Window);
-- AKA
-- ALIAS(`erase()')
pragma Inline (Erase);
-- ANCHOR(`wclear()',`Clear')
procedure Clear
- (Win : in Window := Standard_Window);
+ (Win : Window := Standard_Window);
-- AKA
-- ALIAS(`clear()')
pragma Inline (Clear);
-- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen')
procedure Clear_To_End_Of_Screen
- (Win : in Window := Standard_Window);
+ (Win : Window := Standard_Window);
-- AKA
-- ALIAS(`clrtobot()')
pragma Inline (Clear_To_End_Of_Screen);
-- ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line')
procedure Clear_To_End_Of_Line
- (Win : in Window := Standard_Window);
+ (Win : Window := Standard_Window);
-- AKA
-- ALIAS(`clrtoeol()')
pragma Inline (Clear_To_End_Of_Line);
@@ -799,16 +1248,16 @@
-- because in C it is common to see bkgdset(A_BOLD) or
-- bkgdset(COLOR_PAIR(n))
procedure Set_Background
- (Win : in Window := Standard_Window;
- Ch : in Attributed_Character);
+ (Win : Window := Standard_Window;
+ Ch : Attributed_Character);
-- AKA
-- ALIAS(`bkgdset()')
pragma Inline (Set_Background);
-- ANCHOR(`wbkgd()',`Change_Background')
procedure Change_Background
- (Win : in Window := Standard_Window;
- Ch : in Attributed_Character);
+ (Win : Window := Standard_Window;
+ Ch : Attributed_Character);
-- AKA
-- ALIAS(`bkgd()')
pragma Inline (Change_Background);
@@ -824,26 +1273,26 @@
-- MANPAGE(`curs_touch.3x')
-- ANCHOR(`untouchwin()',`Untouch')
- procedure Untouch (Win : in Window := Standard_Window);
+ procedure Untouch (Win : Window := Standard_Window);
-- AKA
pragma Inline (Untouch);
-- ANCHOR(`touchwin()',`Touch')
- procedure Touch (Win : in Window := Standard_Window);
+ procedure Touch (Win : Window := Standard_Window);
-- AKA
-- ANCHOR(`touchline()',`Touch')
- procedure Touch (Win : in Window := Standard_Window;
- Start : in Line_Position;
- Count : in Positive);
+ procedure Touch (Win : Window := Standard_Window;
+ Start : Line_Position;
+ Count : Positive);
-- AKA
pragma Inline (Touch);
-- ANCHOR(`wtouchln()',`Change_Line_Status')
- procedure Change_Lines_Status (Win : in Window := Standard_Window;
- Start : in Line_Position;
- Count : in Positive;
- State : in Boolean);
+ procedure Change_Lines_Status (Win : Window := Standard_Window;
+ Start : Line_Position;
+ Count : Positive;
+ State : Boolean);
-- AKA
pragma Inline (Change_Lines_Status);
@@ -861,27 +1310,27 @@
-- ANCHOR(`copywin()',`Copy')
procedure Copy
- (Source_Window : in Window;
- Destination_Window : in Window;
- Source_Top_Row : in Line_Position;
- Source_Left_Column : in Column_Position;
- Destination_Top_Row : in Line_Position;
- Destination_Left_Column : in Column_Position;
- Destination_Bottom_Row : in Line_Position;
- Destination_Right_Column : in Column_Position;
- Non_Destructive_Mode : in Boolean := True);
+ (Source_Window : Window;
+ Destination_Window : Window;
+ Source_Top_Row : Line_Position;
+ Source_Left_Column : Column_Position;
+ Destination_Top_Row : Line_Position;
+ Destination_Left_Column : Column_Position;
+ Destination_Bottom_Row : Line_Position;
+ Destination_Right_Column : Column_Position;
+ Non_Destructive_Mode : Boolean := True);
-- AKA
pragma Inline (Copy);
-- ANCHOR(`overwrite()',`Overwrite')
- procedure Overwrite (Source_Window : in Window;
- Destination_Window : in Window);
+ procedure Overwrite (Source_Window : Window;
+ Destination_Window : Window);
-- AKA
pragma Inline (Overwrite);
-- ANCHOR(`overlay()',`Overlay')
- procedure Overlay (Source_Window : in Window;
- Destination_Window : in Window);
+ procedure Overlay (Source_Window : Window;
+ Destination_Window : Window);
-- AKA
pragma Inline (Overlay);
@@ -889,20 +1338,20 @@
-- ANCHOR(`winsdelln()',`Insert_Delete_Lines')
procedure Insert_Delete_Lines
- (Win : in Window := Standard_Window;
- Lines : in Integer := 1); -- default is to insert one line above
+ (Win : Window := Standard_Window;
+ Lines : Integer := 1); -- default is to insert one line above
-- AKA
-- ALIAS(`insdelln()')
pragma Inline (Insert_Delete_Lines);
-- ANCHOR(`wdeleteln()',`Delete_Line')
- procedure Delete_Line (Win : in Window := Standard_Window);
+ procedure Delete_Line (Win : Window := Standard_Window);
-- AKA
-- ALIAS(`deleteln()')
pragma Inline (Delete_Line);
-- ANCHOR(`winsertln()',`Insert_Line')
- procedure Insert_Line (Win : in Window := Standard_Window);
+ procedure Insert_Line (Win : Window := Standard_Window);
-- AKA
-- ALIAS(`insertln()')
pragma Inline (Insert_Line);
@@ -911,7 +1360,7 @@
-- ANCHOR(`getmaxyx()',`Get_Size')
procedure Get_Size
- (Win : in Window := Standard_Window;
+ (Win : Window := Standard_Window;
Number_Of_Lines : out Line_Count;
Number_Of_Columns : out Column_Count);
-- AKA
@@ -919,7 +1368,7 @@
-- ANCHOR(`getbegyx()',`Get_Window_Position')
procedure Get_Window_Position
- (Win : in Window := Standard_Window;
+ (Win : Window := Standard_Window;
Top_Left_Line : out Line_Position;
Top_Left_Column : out Column_Position);
-- AKA
@@ -927,7 +1376,7 @@
-- ANCHOR(`getyx()',`Get_Cursor_Position')
procedure Get_Cursor_Position
- (Win : in Window := Standard_Window;
+ (Win : Window := Standard_Window;
Line : out Line_Position;
Column : out Column_Position);
-- AKA
@@ -935,12 +1384,12 @@
-- ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent')
procedure Get_Origin_Relative_To_Parent
- (Win : in Window;
+ (Win : Window;
Top_Left_Line : out Line_Position;
Top_Left_Column : out Column_Position;
Is_Not_A_Subwindow : out Boolean);
-- AKA
- -- Instead of placing -1 in the coordinates as return, we use a boolean
+ -- Instead of placing -1 in the coordinates as return, we use a Boolean
-- to return the info that the window has no parent.
pragma Inline (Get_Origin_Relative_To_Parent);
@@ -964,44 +1413,44 @@
-- ANCHOR(`prefresh()',`Refresh')
procedure Refresh
- (Pad : in Window;
- Source_Top_Row : in Line_Position;
- Source_Left_Column : in Column_Position;
- Destination_Top_Row : in Line_Position;
- Destination_Left_Column : in Column_Position;
- Destination_Bottom_Row : in Line_Position;
- Destination_Right_Column : in Column_Position);
+ (Pad : Window;
+ Source_Top_Row : Line_Position;
+ Source_Left_Column : Column_Position;
+ Destination_Top_Row : Line_Position;
+ Destination_Left_Column : Column_Position;
+ Destination_Bottom_Row : Line_Position;
+ Destination_Right_Column : Column_Position);
-- AKA
pragma Inline (Refresh);
-- ANCHOR(`pnoutrefresh()',`Refresh_Without_Update')
procedure Refresh_Without_Update
- (Pad : in Window;
- Source_Top_Row : in Line_Position;
- Source_Left_Column : in Column_Position;
- Destination_Top_Row : in Line_Position;
- Destination_Left_Column : in Column_Position;
- Destination_Bottom_Row : in Line_Position;
- Destination_Right_Column : in Column_Position);
+ (Pad : Window;
+ Source_Top_Row : Line_Position;
+ Source_Left_Column : Column_Position;
+ Destination_Top_Row : Line_Position;
+ Destination_Left_Column : Column_Position;
+ Destination_Bottom_Row : Line_Position;
+ Destination_Right_Column : Column_Position);
-- AKA
pragma Inline (Refresh_Without_Update);
-- ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It')
procedure Add_Character_To_Pad_And_Echo_It
- (Pad : in Window;
- Ch : in Attributed_Character);
+ (Pad : Window;
+ Ch : Attributed_Character);
-- AKA
procedure Add_Character_To_Pad_And_Echo_It
- (Pad : in Window;
- Ch : in Character);
+ (Pad : Window;
+ Ch : Character);
pragma Inline (Add_Character_To_Pad_And_Echo_It);
-- MANPAGE(`curs_scroll.3x')
-- ANCHOR(`wscrl()',`Scroll')
- procedure Scroll (Win : in Window := Standard_Window;
- Amount : in Integer := 1);
+ procedure Scroll (Win : Window := Standard_Window;
+ Amount : Integer := 1);
-- AKA
-- ALIAS(`scroll()')
-- ALIAS(`scrl()')
@@ -1010,15 +1459,15 @@
-- MANPAGE(`curs_delch.3x')
-- ANCHOR(`wdelch()',`Delete_Character')
- procedure Delete_Character (Win : in Window := Standard_Window);
+ procedure Delete_Character (Win : Window := Standard_Window);
-- AKA
-- ALIAS(`delch()')
-- ANCHOR(`mvwdelch()',`Delete_Character')
procedure Delete_Character
- (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position);
+ (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position);
-- AKA
-- ALIAS(`mvdelch()')
pragma Inline (Delete_Character);
@@ -1043,36 +1492,36 @@
-- MANPAGE(`curs_insch.3x')
-- ANCHOR(`winsch()',`Insert')
- procedure Insert (Win : in Window := Standard_Window;
- Ch : in Attributed_Character);
+ procedure Insert (Win : Window := Standard_Window;
+ Ch : Attributed_Character);
-- AKA
-- ALIAS(`insch()')
-- ANCHOR(`mvwinsch()',`Insert')
- procedure Insert (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Ch : in Attributed_Character);
+ procedure Insert (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Ch : Attributed_Character);
-- AKA
-- ALIAS(`mvinsch()')
-- MANPAGE(`curs_insstr.3x')
-- ANCHOR(`winsnstr()',`Insert')
- procedure Insert (Win : in Window := Standard_Window;
- Str : in String;
- Len : in Integer := -1);
+ procedure Insert (Win : Window := Standard_Window;
+ Str : String;
+ Len : Integer := -1);
-- AKA
-- ALIAS(`winsstr()')
-- ALIAS(`insnstr()')
-- ALIAS(`insstr()')
-- ANCHOR(`mvwinsnstr()',`Insert')
- procedure Insert (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
- Str : in String;
- Len : in Integer := -1);
+ procedure Insert (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
+ Str : String;
+ Len : Integer := -1);
-- AKA
-- ALIAS(`mvwinsstr()')
-- ALIAS(`mvinsnstr()')
@@ -1082,20 +1531,20 @@
-- MANPAGE(`curs_instr.3x')
-- ANCHOR(`winnstr()',`Peek')
- procedure Peek (Win : in Window := Standard_Window;
+ procedure Peek (Win : Window := Standard_Window;
Str : out String;
- Len : in Integer := -1);
+ Len : Integer := -1);
-- AKA
-- ALIAS(`winstr()')
-- ALIAS(`innstr()')
-- ALIAS(`instr()')
-- ANCHOR(`mvwinnstr()',`Peek')
- procedure Peek (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
+ procedure Peek (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
Str : out String;
- Len : in Integer := -1);
+ Len : Integer := -1);
-- AKA
-- ALIAS(`mvwinstr()')
-- ALIAS(`mvinnstr()')
@@ -1104,32 +1553,32 @@
-- MANPAGE(`curs_inchstr.3x')
-- ANCHOR(`winchnstr()',`Peek')
- procedure Peek (Win : in Window := Standard_Window;
+ procedure Peek (Win : Window := Standard_Window;
Str : out Attributed_String;
- Len : in Integer := -1);
+ Len : Integer := -1);
-- AKA
-- ALIAS(`winchstr()')
-- ALIAS(`inchnstr()')
-- ALIAS(`inchstr()')
-- ANCHOR(`mvwinchnstr()',`Peek')
- procedure Peek (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
+ procedure Peek (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
Str : out Attributed_String;
- Len : in Integer := -1);
+ Len : Integer := -1);
-- AKA
-- ALIAS(`mvwinchstr()')
-- ALIAS(`mvinchnstr()')
-- ALIAS(`mvinchstr()')
- -- We don't inline the Peek procedures
+ -- We do not inline the Peek procedures
-- MANPAGE(`curs_getstr.3x')
-- ANCHOR(`wgetnstr()',`Get')
- procedure Get (Win : in Window := Standard_Window;
+ procedure Get (Win : Window := Standard_Window;
Str : out String;
- Len : in Integer := -1);
+ Len : Integer := -1);
-- AKA
-- ALIAS(`wgetstr()')
-- ALIAS(`getnstr()')
@@ -1138,11 +1587,11 @@
-- overflows.
-- ANCHOR(`mvwgetnstr()',`Get')
- procedure Get (Win : in Window := Standard_Window;
- Line : in Line_Position;
- Column : in Column_Position;
+ procedure Get (Win : Window := Standard_Window;
+ Line : Line_Position;
+ Column : Column_Position;
Str : out String;
- Len : in Integer := -1);
+ Len : Integer := -1);
-- AKA
-- ALIAS(`mvwgetstr()')
-- ALIAS(`mvgetnstr()')
@@ -1162,16 +1611,16 @@
-- ANCHOR(`slk_init()',`Init_Soft_Label_Keys')
procedure Init_Soft_Label_Keys
- (Format : in Soft_Label_Key_Format := Three_Two_Three);
+ (Format : Soft_Label_Key_Format := Three_Two_Three);
-- AKA
pragma Inline (Init_Soft_Label_Keys);
-- ANCHOR(`slk_set()',`Set_Soft_Label_Key')
- procedure Set_Soft_Label_Key (Label : in Label_Number;
- Text : in String;
- Fmt : in Label_Justification := Left);
+ procedure Set_Soft_Label_Key (Label : Label_Number;
+ Text : String;
+ Fmt : Label_Justification := Left);
-- AKA
- -- We don't inline this procedure
+ -- We do not inline this procedure
-- ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key')
procedure Refresh_Soft_Label_Keys;
@@ -1184,12 +1633,12 @@
pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
-- ANCHOR(`slk_label()',`Get_Soft_Label_Key')
- procedure Get_Soft_Label_Key (Label : in Label_Number;
+ procedure Get_Soft_Label_Key (Label : Label_Number;
Text : out String);
-- AKA
-- ANCHOR(`slk_label()',`Get_Soft_Label_Key')
- function Get_Soft_Label_Key (Label : in Label_Number) return String;
+ function Get_Soft_Label_Key (Label : Label_Number) return String;
-- AKA
-- Same as function
pragma Inline (Get_Soft_Label_Key);
@@ -1211,16 +1660,16 @@
-- ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes')
procedure Switch_Soft_Label_Key_Attributes
- (Attr : in Character_Attribute_Set;
- On : in Boolean := True);
+ (Attr : Character_Attribute_Set;
+ On : Boolean := True);
-- AKA
-- ALIAS(`slk_attroff()')
pragma Inline (Switch_Soft_Label_Key_Attributes);
-- ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes')
procedure Set_Soft_Label_Key_Attributes
- (Attr : in Character_Attribute_Set := Normal_Video;
- Color : in Color_Pair := Color_Pair'First);
+ (Attr : Character_Attribute_Set := Normal_Video;
+ Color : Color_Pair := Color_Pair'First);
-- AKA
pragma Inline (Set_Soft_Label_Key_Attributes);
@@ -1234,7 +1683,7 @@
pragma Inline (Get_Soft_Label_Key_Attributes);
-- ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color')
- procedure Set_Soft_Label_Key_Color (Pair : in Color_Pair);
+ procedure Set_Soft_Label_Key_Color (Pair : Color_Pair);
-- AKA
pragma Inline (Set_Soft_Label_Key_Color);
@@ -1244,16 +1693,16 @@
-- MANPAGE(`keyok.3x')
-- ANCHOR(`keyok()',`Enable_Key')
- procedure Enable_Key (Key : in Special_Key_Code;
- Enable : in Boolean := True);
+ procedure Enable_Key (Key : Special_Key_Code;
+ Enable : Boolean := True);
-- AKA
pragma Inline (Enable_Key);
-- MANPAGE(`define_key.3x')
-- ANCHOR(`define_key()',`Define_Key')
- procedure Define_Key (Definition : in String;
- Key : in Special_Key_Code);
+ procedure Define_Key (Definition : String;
+ Key : Special_Key_Code);
-- AKA
pragma Inline (Define_Key);
@@ -1264,30 +1713,30 @@
--
-- ANCHOR(`keyname()',`Key_Name')
- procedure Key_Name (Key : in Real_Key_Code;
+ procedure Key_Name (Key : Real_Key_Code;
Name : out String);
-- AKA
-- The external name for a real keystroke.
-- ANCHOR(`keyname()',`Key_Name')
- function Key_Name (Key : in Real_Key_Code) return String;
+ function Key_Name (Key : Real_Key_Code) return String;
-- AKA
-- Same as function
- -- We don't inline this routine
+ -- We do not inline this routine
-- ANCHOR(`unctrl()',`Un_Control')
- procedure Un_Control (Ch : in Attributed_Character;
+ procedure Un_Control (Ch : Attributed_Character;
Str : out String);
-- AKA
-- ANCHOR(`unctrl()',`Un_Control')
- function Un_Control (Ch : in Attributed_Character) return String;
+ function Un_Control (Ch : Attributed_Character) return String;
-- AKA
-- Same as function
pragma Inline (Un_Control);
-- ANCHOR(`delay_output()',`Delay_Output')
- procedure Delay_Output (Msecs : in Natural);
+ procedure Delay_Output (Msecs : Natural);
-- AKA
pragma Inline (Delay_Output);
@@ -1362,14 +1811,14 @@
pragma Import (C, Start_Color, "start_color");
-- ANCHOR(`init_pair()',`Init_Pair')
- procedure Init_Pair (Pair : in Redefinable_Color_Pair;
- Fore : in Color_Number;
- Back : in Color_Number);
+ procedure Init_Pair (Pair : Redefinable_Color_Pair;
+ Fore : Color_Number;
+ Back : Color_Number);
-- AKA
pragma Inline (Init_Pair);
-- ANCHOR(`pair_content()',`Pair_Content')
- procedure Pair_Content (Pair : in Color_Pair;
+ procedure Pair_Content (Pair : Color_Pair;
Fore : out Color_Number;
Back : out Color_Number);
-- AKA
@@ -1381,10 +1830,10 @@
pragma Inline (Has_Colors);
-- ANCHOR(`init_color()',`Init_Color')
- procedure Init_Color (Color : in Color_Number;
- Red : in RGB_Value;
- Green : in RGB_Value;
- Blue : in RGB_Value);
+ procedure Init_Color (Color : Color_Number;
+ Red : RGB_Value;
+ Green : RGB_Value;
+ Blue : RGB_Value);
-- AKA
pragma Inline (Init_Color);
@@ -1394,7 +1843,7 @@
pragma Inline (Can_Change_Color);
-- ANCHOR(`color_content()',`Color_Content')
- procedure Color_Content (Color : in Color_Number;
+ procedure Color_Content (Color : Color_Number;
Red : out RGB_Value;
Green : out RGB_Value;
Blue : out RGB_Value);
@@ -1407,13 +1856,13 @@
type Curses_Mode is (Curses, Shell);
-- ANCHOR(`def_prog_mode()',`Save_Curses_Mode')
- procedure Save_Curses_Mode (Mode : in Curses_Mode);
+ procedure Save_Curses_Mode (Mode : Curses_Mode);
-- AKA
-- ALIAS(`def_shell_mode()')
pragma Inline (Save_Curses_Mode);
-- ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode')
- procedure Reset_Curses_Mode (Mode : in Curses_Mode);
+ procedure Reset_Curses_Mode (Mode : Curses_Mode);
-- AKA
-- ALIAS(`reset_shell_mode()')
pragma Inline (Reset_Curses_Mode);
@@ -1437,13 +1886,13 @@
-- and -1 otherwise.
-- ANCHOR(`ripoffline()',`Rip_Off_Lines')
- procedure Rip_Off_Lines (Lines : in Integer;
- Proc : in Stdscr_Init_Proc);
+ procedure Rip_Off_Lines (Lines : Integer;
+ Proc : Stdscr_Init_Proc);
-- AKA
-- N.B.: to be more precise, this uses a ncurses specific enhancement of
-- ripoffline(), in which the Lines argument absolute value is the
-- number of lines to be ripped of. The official ripoffline() only
- -- uses the sign of Lines to rip of a single line from bottom or top.
+ -- uses the sign of Lines to remove a single line from bottom or top.
pragma Inline (Rip_Off_Lines);
type Cursor_Visibility is (Invisible, Normal, Very_Visible);
@@ -1454,7 +1903,7 @@
pragma Inline (Set_Cursor_Visibility);
-- ANCHOR(`napms()',`Nap_Milli_Seconds')
- procedure Nap_Milli_Seconds (Ms : in Natural);
+ procedure Nap_Milli_Seconds (Ms : Natural);
-- AKA
pragma Inline (Nap_Milli_Seconds);
@@ -1463,19 +1912,21 @@
-- |=====================================================================
type Transform_Direction is (From_Screen, To_Screen);
procedure Transform_Coordinates
- (W : in Window := Standard_Window;
+ (W : Window := Standard_Window;
Line : in out Line_Position;
Column : in out Column_Position;
- Dir : in Transform_Direction := From_Screen);
+ Dir : Transform_Direction := From_Screen);
-- This procedure transforms screen coordinates into coordinates relative
-- to the window and vice versa, depending on the Dir parameter.
- -- Screen coordinates are the position informations on the physical device.
+ -- Screen coordinates are the position information for the physical device.
-- An Curses_Exception will be raised if Line and Column are not in the
-- Window or if you pass the Null_Window as argument.
- -- We don't inline this procedure
+ -- We do not inline this procedure
-- MANPAGE(`default_colors.3x')
+ Default_Color : constant Color_Number := -1;
+
-- ANCHOR(`use_default_colors()',`Use_Default_Colors')
procedure Use_Default_Colors;
-- AKA
@@ -1507,29 +1958,29 @@
-- MANPAGE(`curs_scr_dump.3x')
-- ANCHOR(`scr_dump()',`Screen_Dump_To_File')
- procedure Screen_Dump_To_File (Filename : in String);
+ procedure Screen_Dump_To_File (Filename : String);
-- AKA
-- ANCHOR(`scr_restore()',`Screen_Restore_From_File')
- procedure Screen_Restore_From_File (Filename : in String);
+ procedure Screen_Restore_From_File (Filename : String);
-- AKA
-- ANCHOR(`scr_init()',`Screen_Init_From_File')
- procedure Screen_Init_From_File (Filename : in String);
+ procedure Screen_Init_From_File (Filename : String);
-- AKA
-- ANCHOR(`scr_set()',`Screen_Set_File')
- procedure Screen_Set_File (Filename : in String);
+ procedure Screen_Set_File (Filename : String);
-- AKA
-- MANPAGE(`curs_print.3x')
- -- Not implemented: mcprint
+ -- Not implemented: mcprint
-- MANPAGE(`curs_printw.3x')
-- Not implemented: printw, wprintw, mvprintw, mvwprintw, vwprintw,
-- vw_printw
-- Please use the Ada style Text_IO child packages for formatted
- -- printing. It doesn't make a lot of sense to map the printf style
+ -- printing. It does not make a lot of sense to map the printf style
-- C functions to Ada.
-- MANPAGE(`curs_scanw.3x')
@@ -1553,7 +2004,11 @@
-- The next constants are generated and may be different on your
-- architecture.
--
-include(`Window_Offsets')dnl
+
+ Sizeof_Bool : constant := Curses_Constants.Sizeof_Bool;
+
+ type Curses_Bool is mod 2 ** Sizeof_Bool;
+
Curses_Bool_False : constant Curses_Bool := 0;
end Terminal_Interface.Curses;