1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding --
5 -- Terminal_Interface.Curses.Text_IO --
9 ------------------------------------------------------------------------------
10 -- Copyright 2020 Thomas E. Dickey --
11 -- Copyright 1999-2003,2009 Free Software Foundation, Inc. --
13 -- Permission is hereby granted, free of charge, to any person obtaining a --
14 -- copy of this software and associated documentation files (the --
15 -- "Software"), to deal in the Software without restriction, including --
16 -- without limitation the rights to use, copy, modify, merge, publish, --
17 -- distribute, distribute with modifications, sublicense, and/or sell --
18 -- copies of the Software, and to permit persons to whom the Software is --
19 -- furnished to do so, subject to the following conditions: --
21 -- The above copyright notice and this permission notice shall be included --
22 -- in all copies or substantial portions of the Software. --
24 -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
25 -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
26 -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
27 -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
28 -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
29 -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
30 -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
32 -- Except as contained in this notice, the name(s) of the above copyright --
33 -- holders shall not be used in advertising or otherwise to promote the --
34 -- sale, use or other dealings in this Software without prior written --
36 ------------------------------------------------------------------------------
37 -- Author: Juergen Pfeifer, 1996
40 -- Binding Version 01.00
41 ------------------------------------------------------------------------------
43 with Ada.IO_Exceptions;
45 package Terminal_Interface.Curses.Text_IO is
47 use type Ada.Text_IO.Count;
48 subtype Count is Ada.Text_IO.Count;
49 subtype Positive_Count is Count range 1 .. Count'Last;
51 subtype Field is Ada.Text_IO.Field;
52 subtype Number_Base is Integer range 2 .. 16;
54 type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
56 -- For most of the routines you will see a version without a Window
57 -- type parameter. They will operate on a default window, which can
58 -- be set by the user. It is initially equal to Standard_Window.
60 procedure Set_Window (Win : Window);
61 -- Set Win as the default window
63 function Get_Window return Window;
64 -- Get the current default window
66 procedure Flush (Win : Window);
69 --------------------------------------------
70 -- Specification of line and page lengths --
71 --------------------------------------------
73 -- There are no set routines in this package. I assume, that you allocate
74 -- the window with an appropriate size.
75 -- A scroll-window is interpreted as an page with unbounded page length,
76 -- i.e. it returns the conventional 0 as page length.
78 function Line_Length (Win : Window) return Count;
79 function Line_Length return Count;
81 function Page_Length (Win : Window) return Count;
82 function Page_Length return Count;
84 ------------------------------------
85 -- Column, Line, and Page Control --
86 ------------------------------------
87 procedure New_Line (Win : Window; Spacing : Positive_Count := 1);
88 procedure New_Line (Spacing : Positive_Count := 1);
90 procedure New_Page (Win : Window);
93 procedure Set_Col (Win : Window; To : Positive_Count);
94 procedure Set_Col (To : Positive_Count);
96 procedure Set_Line (Win : Window; To : Positive_Count);
97 procedure Set_Line (To : Positive_Count);
99 function Col (Win : Window) return Positive_Count;
100 function Col return Positive_Count;
102 function Line (Win : Window) return Positive_Count;
103 function Line return Positive_Count;
105 -----------------------
106 -- Characters-Output --
107 -----------------------
109 procedure Put (Win : Window; Item : Character);
110 procedure Put (Item : Character);
116 procedure Put (Win : Window; Item : String);
117 procedure Put (Item : String);
128 Status_Error : exception renames Ada.IO_Exceptions.Status_Error;
129 Mode_Error : exception renames Ada.IO_Exceptions.Mode_Error;
130 Name_Error : exception renames Ada.IO_Exceptions.Name_Error;
131 Use_Error : exception renames Ada.IO_Exceptions.Use_Error;
132 Device_Error : exception renames Ada.IO_Exceptions.Device_Error;
133 End_Error : exception renames Ada.IO_Exceptions.End_Error;
134 Data_Error : exception renames Ada.IO_Exceptions.Data_Error;
135 Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error;
137 end Terminal_Interface.Curses.Text_IO;