aboutsummaryrefslogtreecommitdiff
path: root/Ada95/samples
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2024-06-20 08:11:38 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2024-06-20 08:11:38 +0000
commit24fa7a5107c5b75d1c197accf0305be64bc72882 (patch)
tree183f09c93417ac0e5f7f49760329a3d2cfaacda9 /Ada95/samples
parentbf0ab54638a5ef969749f6ceae30e864f9556ea8 (diff)
Diffstat (limited to 'Ada95/samples')
-rw-r--r--Ada95/samples/Makefile.in20
-rw-r--r--Ada95/samples/explain.txt54
-rw-r--r--Ada95/samples/ncurses2-demo_forms.adb8
-rw-r--r--Ada95/samples/ncurses2-overlap_test.adb14
-rw-r--r--Ada95/samples/ncurses2-trace_set.adb10
-rw-r--r--Ada95/samples/sample-menu_demo-aux.adb8
-rw-r--r--Ada95/samples/split-path.awk6
7 files changed, 69 insertions, 51 deletions
diff --git a/Ada95/samples/Makefile.in b/Ada95/samples/Makefile.in
index 3a0c272f4092..3731085a3e51 100644
--- a/Ada95/samples/Makefile.in
+++ b/Ada95/samples/Makefile.in
@@ -29,7 +29,7 @@
#
# Author: Juergen Pfeifer, 1996
#
-# $Id: Makefile.in,v 1.62 2021/01/23 20:42:08 tom Exp $
+# $Id: Makefile.in,v 1.64 2021/07/03 15:45:33 tom Exp $
#
.SUFFIXES:
@@ -107,7 +107,23 @@ THISLIB = sample
CARGS = -cargs $(ADAFLAGS)
LARGS = -largs -L../lib -l@ADA_LIBNAME@ @TEST_ARG2@ $(LD_FLAGS) @TEST_LIBS2@
-PROGS = tour$x ncurses$x @USE_GNAT_SIGINT@ rain$x
+PROGS = tour$x ncurses$x @USE_GNAT_SIGINT@ rain$x
+
+################################################################################
+
+@MAKE_PHONY@.PHONY : all
+@MAKE_PHONY@.PHONY : clean
+@MAKE_PHONY@.PHONY : distclean
+@MAKE_PHONY@.PHONY : install
+@MAKE_PHONY@.PHONY : install.examples
+@MAKE_PHONY@.PHONY : install.libs
+@MAKE_PHONY@.PHONY : libs
+@MAKE_PHONY@.PHONY : mostlyclean
+@MAKE_PHONY@.PHONY : realclean
+@MAKE_PHONY@.PHONY : sources
+@MAKE_PHONY@.PHONY : uninstall
+@MAKE_PHONY@.PHONY : uninstall.examples
+@MAKE_PHONY@.PHONY : uninstall.libs
all :: $(PROGS)
@echo made $@
diff --git a/Ada95/samples/explain.txt b/Ada95/samples/explain.txt
index be2cba154ee2..f05eede302a6 100644
--- a/Ada95/samples/explain.txt
+++ b/Ada95/samples/explain.txt
@@ -27,15 +27,15 @@ In a menu you can use the following Keys in the whole application:
- Cursor Right Right one item
- END Key Go to last item
#FORMKEYS
- - CTRL-X eXit the form
+ - CTRL-X eXit the form
- CTRL-F Go forward to the next field
- CTRL-B Go backward to the previous field
- - CTRL-L Go to the field left of the current one
+ - CTRL-L Go to the field left of the current one
- CTRL-R Go to the field right of the current one
- - CTRL-U Go to the field above the current one
- - CTRL-D Go to the field below the current one
+ - CTRL-U Go to the field above the current one
+ - CTRL-D Go to the field below the current one
- - CTRL-W Go to the next word in the field
+ - CTRL-W Go to the next word in the field
- CTRL-T Go to the previous word in the field
- CTRL-A Go to the beginning of the field
@@ -43,13 +43,13 @@ In a menu you can use the following Keys in the whole application:
- CTRL-I Insert a blank character at the current position
- CTRL-O Insert a line
- - CTRL-V Delete a character
- - CTRL-H Delete previous character
- - CTRL-Y Delete a line
- - CTRL-G Delete a word
- - CTRL-K Clear to end of field
+ - CTRL-V Delete a character
+ - CTRL-H Delete previous character
+ - CTRL-Y Delete a line
+ - CTRL-G Delete a word
+ - CTRL-K Clear to end of field
- - CTRL-N Next choice in a choice field (Enumerations etc.)
+ - CTRL-N Next choice in a choice field (Enumerations etc.)
- CTRL-P Previous choice in a choice field.
#HELP
#HELPKEYS
@@ -61,8 +61,8 @@ You may leave the help with the Function Key labeled 'Quit'.
#MAIN
This is the main menu of the sample program for the ncurses Ada95
binding. The main intention of the demo is not to demonstrate or
-test all the features of ncurses and it's subsystems, but to provide
-to you some sample code how to use the binding with Ada95.
+test all the features of ncurses and its subsystems, but to provide
+to you some sample code how to use the binding with Ada95.
You may select this options:
@@ -71,7 +71,7 @@ You may select this options:
* Look at some features of the form subsystem
* Look at the output of the Ada.Text_IO like functions
for ncurses.
-
+
#MAINPAD
You may press at any place in this demo CTRL-C. This will give you a command
window. You can just type in the Label-String of a function key, then this
@@ -86,13 +86,13 @@ descriptions for the items, a marker and a padding character between
the item name and the description.
#MENU01
This is a demo of the some of the menu layout options. One of them
-is the spacing functionality. Just press the Key labeled "Flip" to
+is the spacing functionality. Just press the Key labeled "Flip" to
flip between the non-spaced and a spaced version of the menu. Please
-note that this functionality is unique for ncurses and is not found
-in the SVr4 menu implementation.
+note that this functionality is unique for ncurses and is not found
+in the SVr4 menu implementation.
-This is a menu that sometimes does not fit into it's window and
-therefore it becomes a scroll menu.
+This is a menu that sometimes does not fit into its window and
+therefore it becomes a scroll menu.
You can also see here very nicely the pattern matching functionality
of menus. Type for example a 'J' and you will be positioned to the
@@ -106,10 +106,10 @@ labeled "4x1", "4x2" or "4x3" to get a menu with that many rows
and columns.
With the Keys "O-Row" or "O-Col" (they occupy the same label and
-switch on selection) you can change the major order scheme for
+switch on selection) you can change the major order scheme for
the menu. If "O-Col" is visible, the menu is currently major
ordered by rows, you can switch to major column order by pressing
-the key. If "O-Row" is visible, it's just the reverse situation.
+the key. If "O-Row" is visible, it is just the reverse situation.
This Key is not visible in "4x1" layout mode, because in this case
the functionality makes no sense.
@@ -136,7 +136,7 @@ For more details press the Key labeled "Help".
This is a demo of the forms package.
#FORM-PAD00
Please note that this demo is far from being complete. It really shows
-only a small part of the functionality of the forms package. Let's hope
+only a small part of the functionality of the forms package. Let's hope
the next version will have a richer demo (You want to contribute ?).
#NOTIMPL
Sorry this functionality of the demo is not implemented at the moment.
@@ -148,7 +148,7 @@ This is a menu where you can select some different demos of the ncurses
functionality.
#CURSES-PAD00
Please note that this demo is far from being complete. It really shows
-only a small part of the functionality of the curses package. Let's hope
+only a small part of the functionality of the curses package. Let's hope
the next version will have a richer demo (You want to contribute ?).
#MOUSEKEYS
In this demo you may use this keys:
@@ -160,16 +160,16 @@ In this demo you may use this keys:
You may click the mouse buttons at any location at the screen and look
at the protocol window !
#MOUSE00
-A rather simple use of a mouse as demo. It's there just to test the
-code and to provide the sample source.
+A rather simple use of a mouse as demo. It is there just to test the
+code and to provide the sample source.
It might be of interest, that the output into the protocol window is
done by the (n)curses Text_IO subpackages. Especially the output of
-the button and state names is done by Ads's enumeration IO, which
+the button and state names is done by Ads's enumeration IO, which
allows you to print the names of enumeration literals. That's really
nice.
#MOUSE-PAD00
-This is a very simple demo of the mouse features of ncurses. It's there
+This is a very simple demo of the mouse features of ncurses. It is there
just to test whether or not the generated code for the binding really
works on the different architectures (seems so).
#ATTRIBDEMO
diff --git a/Ada95/samples/ncurses2-demo_forms.adb b/Ada95/samples/ncurses2-demo_forms.adb
index 5c86af793357..b2d72ba4c6f3 100644
--- a/Ada95/samples/ncurses2-demo_forms.adb
+++ b/Ada95/samples/ncurses2-demo_forms.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright 2020 Thomas E. Dickey --
+-- Copyright 2020,2021 Thomas E. Dickey --
-- Copyright 2000-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
@@ -36,8 +36,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.8 $
--- $Date: 2020/02/02 23:34:34 $
+-- $Revision: 1.9 $
+-- $Date: 2021/09/04 10:52:55 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@@ -381,7 +381,7 @@ procedure ncurses2.demo_forms is
Set_KeyPad_Mode (w, True);
end if;
- -- TODO if Post(f) /= Form_Ok then it's a procedure
+ -- TODO if Post(f) /= Form_Ok then it is a procedure
declare
begin
Post (f);
diff --git a/Ada95/samples/ncurses2-overlap_test.adb b/Ada95/samples/ncurses2-overlap_test.adb
index 11a2d0be782b..6f3341ba2f23 100644
--- a/Ada95/samples/ncurses2-overlap_test.adb
+++ b/Ada95/samples/ncurses2-overlap_test.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright 2020 Thomas E. Dickey --
+-- Copyright 2020-2021,2024 Thomas E. Dickey --
-- Copyright 2000-2014,2015 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
@@ -36,8 +36,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.8 $
--- $Date: 2020/02/02 23:34:34 $
+-- $Revision: 1.10 $
+-- $Date: 2024/03/30 13:21:15 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@@ -73,8 +73,8 @@ procedure ncurses2.overlap_test is
Get_Size (win, y1, x1);
for y in 0 .. y1 - 1 loop
for x in 0 .. x1 - 1 loop
- if ((x > (x1 - 1) / 3) and (x <= (2 * (x1 - 1)) / 3)) or
- (((y > (y1 - 1) / 3) and (y <= (2 * (y1 - 1)) / 3)))
+ if (x > (x1 - 1) / 3 and x <= (2 * (x1 - 1)) / 3) or
+ (y > (y1 - 1) / 3 and y <= (2 * (y1 - 1)) / 3)
then
Move_Cursor (win, y, x);
Add (win, Ch => ch);
@@ -130,9 +130,9 @@ begin
Refresh_Without_Update (win2);
Refresh_Without_Update (win1);
Update_Screen;
- when 'c' => -- fill window A so it's visible
+ when 'c' => -- fill window A so it is visible
fillwin (win1, 'A');
- when 'd' => -- fill window B so it's visible
+ when 'd' => -- fill window B so it is visible
fillwin (win2, 'B');
when 'e' => -- cross test pattern in window A
crosswin (win1, 'A');
diff --git a/Ada95/samples/ncurses2-trace_set.adb b/Ada95/samples/ncurses2-trace_set.adb
index d2739809dad4..3b1983daf592 100644
--- a/Ada95/samples/ncurses2-trace_set.adb
+++ b/Ada95/samples/ncurses2-trace_set.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright 2020 Thomas E. Dickey --
+-- Copyright 2020,2023 Thomas E. Dickey --
-- Copyright 2000-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
@@ -36,8 +36,8 @@
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.7 $
--- $Date: 2020/02/02 23:34:34 $
+-- $Revision: 1.8 $
+-- $Date: 2023/06/17 17:21:47 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
@@ -121,7 +121,7 @@ procedure ncurses2.trace_set is
Trace_Attribute_Set'(Character_Calls => True, others => False)),
(new String'("Termcap_TermInfo"),
Trace_Attribute_Set'(Termcap_TermInfo => True, others => False)),
- (new String'("Maximium"),
+ (new String'("Maximum"),
Trace_Maximum)
);
@@ -353,7 +353,7 @@ procedure ncurses2.trace_set is
if subset (tlevel,
Trace_Maximum)
then
- Append (buf, "Maximium");
+ Append (buf, "Maximum");
Append (buf, ", ");
end if;
end if;
diff --git a/Ada95/samples/sample-menu_demo-aux.adb b/Ada95/samples/sample-menu_demo-aux.adb
index f430c88cd7c6..f64e41da8f73 100644
--- a/Ada95/samples/sample-menu_demo-aux.adb
+++ b/Ada95/samples/sample-menu_demo-aux.adb
@@ -7,7 +7,7 @@
-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright 2020 Thomas E. Dickey --
+-- Copyright 2020,2023 Thomas E. Dickey --
-- Copyright 1998-2006,2009 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
@@ -36,8 +36,8 @@
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
--- $Revision: 1.15 $
--- $Date: 2020/02/02 23:34:34 $
+-- $Revision: 1.16 $
+-- $Date: 2023/06/17 17:21:59 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
@@ -79,7 +79,7 @@ package body Sample.Menu_Demo.Aux is
-- Calculate horizontal coordinate at the screen center
X := (Columns - C) / 2;
- Y := 1; -- always startin line 1
+ Y := 1; -- always starting on line 1
end Geometry;
diff --git a/Ada95/samples/split-path.awk b/Ada95/samples/split-path.awk
index 86e8ccdc10f1..5b340ba5cd6a 100644
--- a/Ada95/samples/split-path.awk
+++ b/Ada95/samples/split-path.awk
@@ -1,5 +1,5 @@
##############################################################################
-# Copyright 2020 Thomas E. Dickey #
+# Copyright 2020,2022 Thomas E. Dickey #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
# copy of this software and associated documentation files (the "Software"), #
@@ -28,9 +28,11 @@
#
# Author: Thomas E. Dickey
#
-# $Id: split-path.awk,v 1.3 2020/02/02 23:34:34 tom Exp $
+# $Id: split-path.awk,v 1.4 2022/11/26 23:46:20 tom Exp $
BEGIN { cols = 72; }
/[$]THIS_DATADIR/ {
+ if (substr(this_datadir, length(this_datadir)) != "/")
+ this_datadir = this_datadir "/";
gsub("[$]THIS_DATADIR", "\"" this_datadir "\"");
if ( length ($0) > cols ) {
indent = index($0, "\"") - 1;