• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1------------------------------------------------------------------------------
2--                                                                          --
3--                           GNAT ncurses Binding                           --
4--                                                                          --
5--                     Terminal_Interface.Curses.Text_IO                    --
6--                                                                          --
7--                                 S P E C                                  --
8--                                                                          --
9------------------------------------------------------------------------------
10-- Copyright 2020 Thomas E. Dickey                                          --
11-- Copyright 1999-2003,2009 Free Software Foundation, Inc.                  --
12--                                                                          --
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:                 --
20--                                                                          --
21-- The above copyright notice and this permission notice shall be included  --
22-- in all copies or substantial portions of the Software.                   --
23--                                                                          --
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.                               --
31--                                                                          --
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       --
35-- authorization.                                                           --
36------------------------------------------------------------------------------
37--  Author:  Juergen Pfeifer, 1996
38--  Version Control:
39--  $Revision: 1.15 $
40--  Binding Version 01.00
41------------------------------------------------------------------------------
42with Ada.Text_IO;
43with Ada.IO_Exceptions;
44
45package Terminal_Interface.Curses.Text_IO is
46
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;
50
51   subtype Field is Ada.Text_IO.Field;
52   subtype Number_Base is Integer range 2 .. 16;
53
54   type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
55
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.
59
60   procedure Set_Window (Win : Window);
61   --  Set Win as the default window
62
63   function Get_Window return Window;
64   --  Get the current default window
65
66   procedure Flush (Win : Window);
67   procedure Flush;
68
69   --------------------------------------------
70   -- Specification of line and page lengths --
71   --------------------------------------------
72
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.
77
78   function Line_Length (Win : Window) return Count;
79   function Line_Length return Count;
80
81   function Page_Length (Win : Window) return Count;
82   function Page_Length return Count;
83
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);
89
90   procedure New_Page (Win : Window);
91   procedure New_Page;
92
93   procedure Set_Col (Win : Window;  To : Positive_Count);
94   procedure Set_Col (To : Positive_Count);
95
96   procedure Set_Line (Win : Window; To : Positive_Count);
97   procedure Set_Line (To : Positive_Count);
98
99   function Col (Win : Window) return Positive_Count;
100   function Col return Positive_Count;
101
102   function Line (Win : Window) return Positive_Count;
103   function Line return Positive_Count;
104
105   -----------------------
106   -- Characters-Output --
107   -----------------------
108
109   procedure Put (Win  : Window; Item : Character);
110   procedure Put (Item : Character);
111
112   --------------------
113   -- Strings-Output --
114   --------------------
115
116   procedure Put (Win  : Window; Item : String);
117   procedure Put (Item : String);
118
119   procedure Put_Line
120     (Win  : Window;
121      Item : String);
122
123   procedure Put_Line
124     (Item : String);
125
126   --  Exceptions
127
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;
136
137end Terminal_Interface.Curses.Text_IO;
138