summaryrefslogtreecommitdiff
path: root/doc/html/ada/terminal_interface-curses-text_io__ads.htm
blob: 36f9476f6876c9e6e46e916fe74fc0e3433ad5b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>terminal_interface-curses-text_io.ads</TITLE></HEAD>
<BODY>
<HR><DIV ALIGN="center"><H1> File : terminal_interface-curses-text_io.ads </H1></DIV><HR>
<PRE>
<FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
<FONT COLOR=green><EM>--                                                                          --</EM></FONT>
<FONT COLOR=green><EM>--                           <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding                           --</EM></FONT>
<FONT COLOR=green><EM>--                                                                          --</EM></FONT>
<FONT COLOR=green><EM>--                     Terminal_Interface.Curses.Text_IO                    --</EM></FONT>
<FONT COLOR=green><EM>--                                                                          --</EM></FONT>
<FONT COLOR=green><EM>--                                 S P E C                                  --</EM></FONT>
<FONT COLOR=green><EM>--                                                                          --</EM></FONT>
<FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
<FONT COLOR=green><EM>-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc.              --</EM></FONT>
<FONT COLOR=green><EM>--                                                                          --</EM></FONT>
<FONT COLOR=green><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></FONT>
<FONT COLOR=green><EM>-- copy of this software and associated documentation files (the            --</EM></FONT>
<FONT COLOR=green><EM>-- "Software"), to deal in the Software without restriction, including      --</EM></FONT>
<FONT COLOR=green><EM>-- without limitation the rights to use, copy, modify, merge, publish,      --</EM></FONT>
<FONT COLOR=green><EM>-- distribute, distribute with modifications, sublicense, and/or sell       --</EM></FONT>
<FONT COLOR=green><EM>-- copies of the Software, and to permit persons to whom the Software is    --</EM></FONT>
<FONT COLOR=green><EM>-- furnished to do so, subject to the following conditions:                 --</EM></FONT>
<FONT COLOR=green><EM>--                                                                          --</EM></FONT>
<FONT COLOR=green><EM>-- The above copyright notice and this permission notice shall be included  --</EM></FONT>
<FONT COLOR=green><EM>-- in all copies or substantial portions of the Software.                   --</EM></FONT>
<FONT COLOR=green><EM>--                                                                          --</EM></FONT>
<FONT COLOR=green><EM>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --</EM></FONT>
<FONT COLOR=green><EM>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --</EM></FONT>
<FONT COLOR=green><EM>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --</EM></FONT>
<FONT COLOR=green><EM>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --</EM></FONT>
<FONT COLOR=green><EM>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --</EM></FONT>
<FONT COLOR=green><EM>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --</EM></FONT>
<FONT COLOR=green><EM>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --</EM></FONT>
<FONT COLOR=green><EM>--                                                                          --</EM></FONT>
<FONT COLOR=green><EM>-- Except as contained in this notice, the name(s) of the above copyright   --</EM></FONT>
<FONT COLOR=green><EM>-- holders shall not be used in advertising or otherwise to promote the     --</EM></FONT>
<FONT COLOR=green><EM>-- sale, use or other dealings in this Software without prior written       --</EM></FONT>
<FONT COLOR=green><EM>-- authorization.                                                           --</EM></FONT>
<FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
<FONT COLOR=green><EM>--  Author:  Juergen Pfeifer, 1996</EM></FONT>
<FONT COLOR=green><EM>--  Version Control:</EM></FONT>
<FONT COLOR=green><EM>--  @Revision: 1.14 @</EM></FONT>
<FONT COLOR=green><EM>--  Binding Version 01.00</EM></FONT>
<FONT COLOR=green><EM>------------------------------------------------------------------------------</EM></FONT>
<b>with</b> Ada.Text_IO;
<b>with</b> Ada.IO_Exceptions;

<b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<FONT COLOR=red><A NAME="ref_44_35" HREF="terminal_interface-curses-text_io__adb.htm#ref_42_40">Text_IO</A></FONT> <b>is</b>

   <b>use</b> <b>type</b> Ada.Text_IO.Count;
   <b>subtype</b> <FONT COLOR=red><A NAME="ref_47_12">Count</A></FONT> <b>is</b> Ada.Text_IO.Count;
   <b>subtype</b> <FONT COLOR=red><A NAME="ref_48_12">Positive_Count</A></FONT> <b>is</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A> <b>range</b> 1 .. <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>'Last;

   <b>subtype</b> <FONT COLOR=red><A NAME="ref_50_12">Field</A></FONT> <b>is</b> Ada.Text_IO.Field;
   <b>subtype</b> <FONT COLOR=red><A NAME="ref_51_12">Number_Base</A></FONT> <b>is</b> Integer <b>range</b> 2 .. 16;

   <b>type</b> <FONT COLOR=red><A NAME="ref_53_9">Type_Set</A></FONT> <b>is</b> (<FONT COLOR=red><A NAME="ref_53_22">Lower_Case</A></FONT>, <FONT COLOR=red><A NAME="ref_53_34">Upper_Case</A></FONT>, <FONT COLOR=red><A NAME="ref_53_46">Mixed_Case</A></FONT>);

   <FONT COLOR=green><EM>--  For most of the routines you will see a version without a Window</EM></FONT>
   <FONT COLOR=green><EM>--  type parameter. They will operate on a default window, which can</EM></FONT>
   <FONT COLOR=green><EM>--  be set by the user. It is initially equal to Standard_Window.</EM></FONT>

   <b>procedure</b> <FONT COLOR=red><A NAME="ref_59_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_46_14">Set_Window</A></FONT> (<FONT COLOR=red><A NAME="ref_59_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_46_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
   <FONT COLOR=green><EM>--  Set Win as the default window</EM></FONT>

   <b>function</b> <FONT COLOR=red><A NAME="ref_62_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_52_13">Get_Window</A></FONT> <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
   <FONT COLOR=green><EM>--  Get the current default window</EM></FONT>

   <b>procedure</b> <FONT COLOR=red><A NAME="ref_65_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_63_14">Flush</A></FONT> (<FONT COLOR=red><A NAME="ref_65_21" HREF="terminal_interface-curses-text_io__adb.htm#ref_63_21">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
   <b>procedure</b> <FONT COLOR=red><A NAME="ref_66_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_69_14">Flush</A></FONT>;

   <FONT COLOR=green><EM>--------------------------------------------</EM></FONT>
   <FONT COLOR=green><EM>-- Specification of line and page lengths --</EM></FONT>
   <FONT COLOR=green><EM>--------------------------------------------</EM></FONT>

   <FONT COLOR=green><EM>--  There are no set routines in this package. I assume, that you allocate</EM></FONT>
   <FONT COLOR=green><EM>--  the window with an appropriate size.</EM></FONT>
   <FONT COLOR=green><EM>--  A scroll-window is interpreted as an page with unbounded page length,</EM></FONT>
   <FONT COLOR=green><EM>--  i.e. it returns the conventional 0 as page length.</EM></FONT>

   <b>function</b> <FONT COLOR=red><A NAME="ref_77_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_84_13">Line_Length</A></FONT> (<FONT COLOR=red><A NAME="ref_77_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_84_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>;
   <b>function</b> <FONT COLOR=red><A NAME="ref_78_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_96_13">Line_Length</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>;

   <b>function</b> <FONT COLOR=red><A NAME="ref_80_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_102_13">Page_Length</A></FONT> (<FONT COLOR=red><A NAME="ref_80_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_102_26">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>;
   <b>function</b> <FONT COLOR=red><A NAME="ref_81_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_118_13">Page_Length</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_47_12">Count</A>;

   <FONT COLOR=green><EM>------------------------------------</EM></FONT>
   <FONT COLOR=green><EM>-- Column, Line, and Page Control --</EM></FONT>
   <FONT COLOR=green><EM>------------------------------------</EM></FONT>
   <b>procedure</b> <FONT COLOR=red><A NAME="ref_86_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_127_14">New_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_86_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_127_24">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_86_38" HREF="terminal_interface-curses-text_io__adb.htm#ref_127_38">Spacing</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A> := 1);
   <b>procedure</b> <FONT COLOR=red><A NAME="ref_87_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_144_14">New_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_87_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_144_24">Spacing</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A> := 1);

   <b>procedure</b> <FONT COLOR=red><A NAME="ref_89_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_150_14">New_Page</A></FONT> (<FONT COLOR=red><A NAME="ref_89_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_150_24">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>);
   <b>procedure</b> <FONT COLOR=red><A NAME="ref_90_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_156_14">New_Page</A></FONT>;

   <b>procedure</b> <FONT COLOR=red><A NAME="ref_92_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_162_14">Set_Col</A></FONT> (<FONT COLOR=red><A NAME="ref_92_23" HREF="terminal_interface-curses-text_io__adb.htm#ref_162_23">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;  <FONT COLOR=red><A NAME="ref_92_38" HREF="terminal_interface-curses-text_io__adb.htm#ref_162_38">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);
   <b>procedure</b> <FONT COLOR=red><A NAME="ref_93_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_190_14">Set_Col</A></FONT> (<FONT COLOR=red><A NAME="ref_93_23" HREF="terminal_interface-curses-text_io__adb.htm#ref_190_23">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);

   <b>procedure</b> <FONT COLOR=red><A NAME="ref_95_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_196_14">Set_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_95_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_196_24">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_95_38" HREF="terminal_interface-curses-text_io__adb.htm#ref_196_38">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);
   <b>procedure</b> <FONT COLOR=red><A NAME="ref_96_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_220_14">Set_Line</A></FONT> (<FONT COLOR=red><A NAME="ref_96_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_220_24">To</A></FONT> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>);

   <b>function</b> <FONT COLOR=red><A NAME="ref_98_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_226_13">Col</A></FONT> (<FONT COLOR=red><A NAME="ref_98_18" HREF="terminal_interface-curses-text_io__adb.htm#ref_226_18">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>;
   <b>function</b> <FONT COLOR=red><A NAME="ref_99_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_240_13">Col</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>;

   <b>function</b> <FONT COLOR=red><A NAME="ref_101_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_246_13">Line</A></FONT> (<FONT COLOR=red><A NAME="ref_101_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_246_19">Win</A></FONT> : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>;
   <b>function</b> <FONT COLOR=red><A NAME="ref_102_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_260_13">Line</A></FONT> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Positive_Count</A>;

   <FONT COLOR=green><EM>-----------------------</EM></FONT>
   <FONT COLOR=green><EM>-- Characters-Output --</EM></FONT>
   <FONT COLOR=green><EM>-----------------------</EM></FONT>

   <b>procedure</b> <FONT COLOR=red><A NAME="ref_108_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_270_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_108_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_270_19">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_108_34" HREF="terminal_interface-curses-text_io__adb.htm#ref_270_34">Item</A></FONT> : Character);
   <b>procedure</b> <FONT COLOR=red><A NAME="ref_109_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_288_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_109_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_288_19">Item</A></FONT> : Character);

   <FONT COLOR=green><EM>--------------------</EM></FONT>
   <FONT COLOR=green><EM>-- Strings-Output --</EM></FONT>
   <FONT COLOR=green><EM>--------------------</EM></FONT>

   <b>procedure</b> <FONT COLOR=red><A NAME="ref_115_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_298_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_115_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_298_19">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>; <FONT COLOR=red><A NAME="ref_115_34" HREF="terminal_interface-curses-text_io__adb.htm#ref_298_34">Item</A></FONT> : String);
   <b>procedure</b> <FONT COLOR=red><A NAME="ref_116_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_316_14">Put</A></FONT> (<FONT COLOR=red><A NAME="ref_116_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_316_19">Item</A></FONT> : String);

   <b>procedure</b> <FONT COLOR=red><A NAME="ref_118_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_322_14">Put_Line</A></FONT>
     (<FONT COLOR=red><A NAME="ref_119_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_323_7">Win</A></FONT>  : <A HREF="terminal_interface-curses__ads.htm#ref_57_9">Window</A>;
      <FONT COLOR=red><A NAME="ref_120_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_324_7">Item</A></FONT> : String);

   <b>procedure</b> <FONT COLOR=red><A NAME="ref_122_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_331_14">Put_Line</A></FONT>
     (<FONT COLOR=red><A NAME="ref_123_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_332_7">Item</A></FONT> : String);

   <FONT COLOR=green><EM>--  Exceptions</EM></FONT>

   <FONT COLOR=red><A NAME="ref_127_4">Status_Error</A></FONT> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Status_Error;
   <FONT COLOR=red><A NAME="ref_128_4">Mode_Error</A></FONT>   : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Mode_Error;
   <FONT COLOR=red><A NAME="ref_129_4">Name_Error</A></FONT>   : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Name_Error;
   <FONT COLOR=red><A NAME="ref_130_4">Use_Error</A></FONT>    : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Use_Error;
   <FONT COLOR=red><A NAME="ref_131_4">Device_Error</A></FONT> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Device_Error;
   <FONT COLOR=red><A NAME="ref_132_4">End_Error</A></FONT>    : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.End_Error;
   <FONT COLOR=red><A NAME="ref_133_4">Data_Error</A></FONT>   : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Data_Error;
   <FONT COLOR=red><A NAME="ref_134_4">Layout_Error</A></FONT> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Layout_Error;

<b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_49_28">Curses</A>.<A HREF="terminal_interface-curses-text_io__ads.htm#ref_44_35">Text_IO</A>;
</PRE></BODY></HTML>