]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/ada_include/terminal_interface-curses-text_io.ads
ncurses 4.1
[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 --  Version 00.92                                                           --
10 --                                                                          --
11 --  The ncurses Ada95 binding is copyrighted 1996 by                        --
12 --  Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                     --
13 --                                                                          --
14 --  Permission is hereby granted to reproduce and distribute this           --
15 --  binding by any means and for any fee, whether alone or as part          --
16 --  of a larger distribution, in source or in binary form, PROVIDED         --
17 --  this notice is included with any such distribution, and is not          --
18 --  removed from any of its header files. Mention of ncurses and the        --
19 --  author of this binding in any applications linked with it is            --
20 --  highly appreciated.                                                     --
21 --                                                                          --
22 --  This binding comes AS IS with no warranty, implied or expressed.        --
23 ------------------------------------------------------------------------------
24 --  Version Control:
25 --  $Revision: 1.5 $
26 ------------------------------------------------------------------------------
27 with System;
28 with System.Parameters;
29 with Ada.Text_IO;
30 with Ada.IO_Exceptions;
31
32 package Terminal_Interface.Curses.Text_IO is
33
34    use type Ada.Text_IO.Count;
35    subtype Count is Ada.Text_IO.Count;
36    subtype Positive_Count is Count range 1 .. Count'Last;
37
38    subtype Field is Integer range 0 .. System.Parameters.Field_Max;
39    subtype Number_Base is Integer range 2 .. 16;
40
41    type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
42
43    --  For most of the routines you will see a version without a Window
44    --  type parameter. They will operate on a default window, which can
45    --  be set by the user. It is initially equal to Standard_Window.
46
47    procedure Set_Window (Win : in Window);
48    --  Set Win as the default window
49
50    function Get_Window return Window;
51    --  Get the current default window
52
53    procedure Flush (Win : in Window);
54    procedure Flush;
55
56    --------------------------------------------
57    -- Specification of line and page lengths --
58    --------------------------------------------
59
60    --  There are no set routines in this package. I assume, that you allocate
61    --  the window with an appropriate size.
62    --  A scroll-window is interpreted as an page with unbounded page length,
63    --  i.e. it returns the conventional 0 as page length.
64
65    function Line_Length (Win : in Window) return Count;
66    function Line_Length return Count;
67
68    function Page_Length (Win : in Window) return Count;
69    function Page_Length return Count;
70
71    ------------------------------------
72    -- Column, Line, and Page Control --
73    ------------------------------------
74    procedure New_Line (Win : in Window; Spacing : in Positive_Count := 1);
75    procedure New_Line (Spacing : in Positive_Count := 1);
76
77    procedure New_Page (Win : in Window);
78    procedure New_Page;
79
80    procedure Set_Col (Win : in Window;  To : in Positive_Count);
81    procedure Set_Col (To : in Positive_Count);
82
83    procedure Set_Line (Win : in Window; To : in Positive_Count);
84    procedure Set_Line (To : in Positive_Count);
85
86    function Col (Win : in Window) return Positive_Count;
87    function Col return Positive_Count;
88
89    function Line (Win : in Window) return Positive_Count;
90    function Line return Positive_Count;
91
92    -----------------------
93    -- Characters-Output --
94    -----------------------
95
96    procedure Put (Win  : in Window; Item : in Character);
97    procedure Put (Item : in Character);
98
99    --------------------
100    -- Strings-Output --
101    --------------------
102
103    procedure Put (Win  : in Window; Item : in String);
104    procedure Put (Item : in String);
105
106    procedure Put_Line
107      (Win  : in Window;
108       Item : in String);
109
110    procedure Put_Line
111      (Item : in String);
112
113    --  Exceptions
114
115    Status_Error : exception renames Ada.IO_Exceptions.Status_Error;
116    Mode_Error   : exception renames Ada.IO_Exceptions.Mode_Error;
117    Name_Error   : exception renames Ada.IO_Exceptions.Name_Error;
118    Use_Error    : exception renames Ada.IO_Exceptions.Use_Error;
119    Device_Error : exception renames Ada.IO_Exceptions.Device_Error;
120    End_Error    : exception renames Ada.IO_Exceptions.End_Error;
121    Data_Error   : exception renames Ada.IO_Exceptions.Data_Error;
122    Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error;
123
124 end Terminal_Interface.Curses.Text_IO;