1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding --
5 -- Terminal_Interface.Curses.Text_IO --
11 -- The ncurses Ada95 binding is copyrighted 1996 by --
12 -- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de --
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. --
22 -- This binding comes AS IS with no warranty, implied or expressed. --
23 ------------------------------------------------------------------------------
26 ------------------------------------------------------------------------------
28 with System.Parameters;
30 with Ada.IO_Exceptions;
32 package Terminal_Interface.Curses.Text_IO is
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;
38 subtype Field is Integer range 0 .. System.Parameters.Field_Max;
39 subtype Number_Base is Integer range 2 .. 16;
41 type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
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.
47 procedure Set_Window (Win : in Window);
48 -- Set Win as the default window
50 function Get_Window return Window;
51 -- Get the current default window
53 procedure Flush (Win : in Window);
56 --------------------------------------------
57 -- Specification of line and page lengths --
58 --------------------------------------------
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.
65 function Line_Length (Win : in Window) return Count;
66 function Line_Length return Count;
68 function Page_Length (Win : in Window) return Count;
69 function Page_Length return Count;
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);
77 procedure New_Page (Win : in Window);
80 procedure Set_Col (Win : in Window; To : in Positive_Count);
81 procedure Set_Col (To : in Positive_Count);
83 procedure Set_Line (Win : in Window; To : in Positive_Count);
84 procedure Set_Line (To : in Positive_Count);
86 function Col (Win : in Window) return Positive_Count;
87 function Col return Positive_Count;
89 function Line (Win : in Window) return Positive_Count;
90 function Line return Positive_Count;
92 -----------------------
93 -- Characters-Output --
94 -----------------------
96 procedure Put (Win : in Window; Item : in Character);
97 procedure Put (Item : in Character);
103 procedure Put (Win : in Window; Item : in String);
104 procedure Put (Item : in String);
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;
124 end Terminal_Interface.Curses.Text_IO;