]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/ada_include/terminal_interface-curses-text_io.ads
ncurses 4.2
[ncurses.git] / Ada95 / ada_include / terminal_interface-curses-text_io.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                           GNAT ncurses Binding                           --
4 --                                                                          --
5 --                     Terminal_Interface.Curses.Text_IO                    --
6 --                                                                          --
7 --                                 S P E C                                  --
8 --                                                                          --
9 ------------------------------------------------------------------------------
10 -- Copyright (c) 1998 Free Software Foundation, Inc.                        --
11 --                                                                          --
12 -- Permission is hereby granted, free of charge, to any person obtaining a  --
13 -- copy of this software and associated documentation files (the            --
14 -- "Software"), to deal in the Software without restriction, including      --
15 -- without limitation the rights to use, copy, modify, merge, publish,      --
16 -- distribute, distribute with modifications, sublicense, and/or sell       --
17 -- copies of the Software, and to permit persons to whom the Software is    --
18 -- furnished to do so, subject to the following conditions:                 --
19 --                                                                          --
20 -- The above copyright notice and this permission notice shall be included  --
21 -- in all copies or substantial portions of the Software.                   --
22 --                                                                          --
23 -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
24 -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
25 -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
26 -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
27 -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
28 -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
29 -- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
30 --                                                                          --
31 -- Except as contained in this notice, the name(s) of the above copyright   --
32 -- holders shall not be used in advertising or otherwise to promote the     --
33 -- sale, use or other dealings in this Software without prior written       --
34 -- authorization.                                                           --
35 ------------------------------------------------------------------------------
36 --  Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1996
37 --  Version Control:
38 --  $Revision: 1.8 $
39 --  Binding Version 00.93
40 ------------------------------------------------------------------------------
41 with System;
42 with System.Parameters;
43 with Ada.Text_IO;
44 with Ada.IO_Exceptions;
45
46 package Terminal_Interface.Curses.Text_IO is
47
48    use type Ada.Text_IO.Count;
49    subtype Count is Ada.Text_IO.Count;
50    subtype Positive_Count is Count range 1 .. Count'Last;
51
52    subtype Field is Integer range 0 .. System.Parameters.Field_Max;
53    subtype Number_Base is Integer range 2 .. 16;
54
55    type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
56
57    --  For most of the routines you will see a version without a Window
58    --  type parameter. They will operate on a default window, which can
59    --  be set by the user. It is initially equal to Standard_Window.
60
61    procedure Set_Window (Win : in Window);
62    --  Set Win as the default window
63
64    function Get_Window return Window;
65    --  Get the current default window
66
67    procedure Flush (Win : in Window);
68    procedure Flush;
69
70    --------------------------------------------
71    -- Specification of line and page lengths --
72    --------------------------------------------
73
74    --  There are no set routines in this package. I assume, that you allocate
75    --  the window with an appropriate size.
76    --  A scroll-window is interpreted as an page with unbounded page length,
77    --  i.e. it returns the conventional 0 as page length.
78
79    function Line_Length (Win : in Window) return Count;
80    function Line_Length return Count;
81
82    function Page_Length (Win : in Window) return Count;
83    function Page_Length return Count;
84
85    ------------------------------------
86    -- Column, Line, and Page Control --
87    ------------------------------------
88    procedure New_Line (Win : in Window; Spacing : in Positive_Count := 1);
89    procedure New_Line (Spacing : in Positive_Count := 1);
90
91    procedure New_Page (Win : in Window);
92    procedure New_Page;
93
94    procedure Set_Col (Win : in Window;  To : in Positive_Count);
95    procedure Set_Col (To : in Positive_Count);
96
97    procedure Set_Line (Win : in Window; To : in Positive_Count);
98    procedure Set_Line (To : in Positive_Count);
99
100    function Col (Win : in Window) return Positive_Count;
101    function Col return Positive_Count;
102
103    function Line (Win : in Window) return Positive_Count;
104    function Line return Positive_Count;
105
106    -----------------------
107    -- Characters-Output --
108    -----------------------
109
110    procedure Put (Win  : in Window; Item : in Character);
111    procedure Put (Item : in Character);
112
113    --------------------
114    -- Strings-Output --
115    --------------------
116
117    procedure Put (Win  : in Window; Item : in String);
118    procedure Put (Item : in String);
119
120    procedure Put_Line
121      (Win  : in Window;
122       Item : in String);
123
124    procedure Put_Line
125      (Item : in String);
126
127    --  Exceptions
128
129    Status_Error : exception renames Ada.IO_Exceptions.Status_Error;
130    Mode_Error   : exception renames Ada.IO_Exceptions.Mode_Error;
131    Name_Error   : exception renames Ada.IO_Exceptions.Name_Error;
132    Use_Error    : exception renames Ada.IO_Exceptions.Use_Error;
133    Device_Error : exception renames Ada.IO_Exceptions.Device_Error;
134    End_Error    : exception renames Ada.IO_Exceptions.End_Error;
135    Data_Error   : exception renames Ada.IO_Exceptions.Data_Error;
136    Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error;
137
138 end Terminal_Interface.Curses.Text_IO;