Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1 | .\"*************************************************************************** |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2 | .\" Copyright 2019-2023,2024 Thomas E. Dickey * |
| 3 | .\" Copyright 2010-2014,2016 Free Software Foundation, Inc. * |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 4 | .\" * |
| 5 | .\" Permission is hereby granted, free of charge, to any person obtaining a * |
| 6 | .\" copy of this software and associated documentation files (the * |
| 7 | .\" "Software"), to deal in the Software without restriction, including * |
| 8 | .\" without limitation the rights to use, copy, modify, merge, publish, * |
| 9 | .\" distribute, distribute with modifications, sublicense, and/or sell * |
| 10 | .\" copies of the Software, and to permit persons to whom the Software is * |
| 11 | .\" furnished to do so, subject to the following conditions: * |
| 12 | .\" * |
| 13 | .\" The above copyright notice and this permission notice shall be included * |
| 14 | .\" in all copies or substantial portions of the Software. * |
| 15 | .\" * |
| 16 | .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 17 | .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 18 | .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 19 | .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 20 | .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 21 | .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 22 | .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 23 | .\" * |
| 24 | .\" Except as contained in this notice, the name(s) of the above copyright * |
| 25 | .\" holders shall not be used in advertising or otherwise to promote the * |
| 26 | .\" sale, use or other dealings in this Software without prior written * |
| 27 | .\" authorization. * |
| 28 | .\"*************************************************************************** |
| 29 | .\" |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 30 | .\" $Id: MKada_config.in,v 1.35 2024/04/20 21:13:27 tom Exp $ |
| 31 | .TH adacurses@USE_CFG_SUFFIX@\-config 1 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "User commands" |
| 32 | .ds C adacurses@USE_CFG_SUFFIX@\-config |
| 33 | .ie \n(.g \{\ |
| 34 | .ds `` \(lq |
| 35 | .ds '' \(rq |
| 36 | .ds ' \(aq |
| 37 | .\} |
| 38 | .el \{\ |
| 39 | .ie t .ds `` `` |
| 40 | .el .ds `` "" |
| 41 | .ie t .ds '' '' |
| 42 | .el .ds '' "" |
| 43 | .ie t .ds ' \(aq |
| 44 | .el .ds ' ' |
| 45 | .\} |
| 46 | . |
| 47 | .\" Fix broken EX/EE macros on DWB troff. |
| 48 | .\" Detect it: only DWB sets up a `)Y` register. |
| 49 | .if !\n(.g .if \n()Y \{\ |
| 50 | .\" Revert the undesired changes to indentation. |
| 51 | .am EX |
| 52 | .in -5n |
| 53 | .. |
| 54 | .am EE |
| 55 | .in +5n |
| 56 | .. |
| 57 | .\} |
| 58 | . |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 59 | .SH NAME |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 60 | \fB\%adacurses@USE_CFG_SUFFIX@\-config\fP \- |
| 61 | configuration helper for \fI@ADA_LIBNAME@\fP libraries |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 62 | .SH SYNOPSIS |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 63 | .B \*C |
| 64 | .RB [ \-\-cflags ] |
| 65 | .RB [ \-\-libs ] |
| 66 | .PP |
| 67 | .B \*C \-\-version |
| 68 | .PP |
| 69 | .B \*C \-\-help |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 70 | .SH DESCRIPTION |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 71 | This program development aid simplifies the process of configuring |
| 72 | applications to use the \fI@ADA_LIBNAME@\fP library binding to |
| 73 | \fI\%ncurses\fP. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 74 | .SH OPTIONS |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 75 | .TP 11 \" "--version" + 2n |
| 76 | \fB\-\-cflags\fP |
| 77 | reports the GNAT (Ada compiler) flags needed to compile with |
| 78 | \fI@ADA_LIBNAME@\fP. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 79 | .TP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 80 | \fB\-\-libs\fP |
| 81 | reports the GNAT libraries needed to link with \fI@ADA_LIBNAME@\fP. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 82 | .TP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 83 | \fB\-\-version\fP |
| 84 | reports the release and patch date information of the \fI\%ncurses\fP |
| 85 | libraries used to configure and build \fI@ADA_LIBNAME@\fP and exits |
| 86 | successfully. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 87 | .TP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 88 | \fB\-\-help\fP |
| 89 | issues a usage message and exits successfully. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 90 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 91 | Omitting options implies \*(``\fB\-\-cflags \-\-libs\fP\*(''. |
| 92 | .SH EXAMPLES |
| 93 | Consider a program using \fI@ADA_LIBNAME@\fP to write the message |
| 94 | \*(``Hello, world!\*('' in the center of the screen and wait for the |
| 95 | user to press the \*(``q\*('' key before exiting. |
| 96 | Populate a file \fIhello.adb\fP with the following. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 97 | .PP |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 98 | .if \n(LL>67n .RS 4 |
| 99 | .EX |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 100 | with Terminal_Interface.Curses; use Terminal_Interface.Curses; |
| 101 | |
| 102 | procedure Hello is |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 103 | Visibility : Cursor_Visibility := Invisible; |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 104 | Message : constant String := "Hello, World!"; |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 105 | done : Boolean := False; |
| 106 | c : Key_Code; |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 107 | begin |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 108 | Init_Screen; |
| 109 | Set_Echo_Mode (False); |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 110 | Set_Cursor_Visibility (Visibility); |
| 111 | Set_Timeout_Mode (Standard_Window, Non_Blocking, 0); |
| 112 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 113 | Move_Cursor (Line => Lines / 2, |
| 114 | Column => (Columns \- Message\*'Length) / 2); |
| 115 | Add (Str => Message); |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 116 | |
| 117 | while not done loop |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 118 | c := Get_Keystroke (Standard_Window); |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 119 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 120 | case c is |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 121 | when Character\*'Pos (\*'q\*') => done := True; |
| 122 | when others => null; |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 123 | end case; |
| 124 | |
| 125 | Nap_Milli_Seconds (50); |
| 126 | end loop; |
| 127 | |
| 128 | End_Windows; |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 129 | end Hello; |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 130 | .EE |
| 131 | .if \n(LL>67n .RE |
| 132 | .ne 2 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 133 | .PP |
| 134 | Then, using |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 135 | .RS 4 |
| 136 | .EX |
| 137 | gnatmake \(gaadacurses@USE_CFG_SUFFIX@\-config \-\-cflags\(ga hello \e |
| 138 | \-largs \(gaadacurses@USE_CFG_SUFFIX@\-config \-\-libs\(ga |
| 139 | .EE |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 140 | .RE |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 141 | or, more simply, |
| 142 | .RS 4 |
| 143 | .EX |
| 144 | gnatmake hello \(gaadacurses@USE_CFG_SUFFIX@\-config\(ga |
| 145 | .EE |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 146 | .RE |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 147 | you can compile and link the program. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 148 | .SH "SEE ALSO" |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 149 | \fB\%curses\fP(3X) |