blob: 03ee64b71f6fa9a59e35f69c88f3eddb4979db02 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML>
<HEAD>
<TITLE>terminal_interface-curses-text_io.ads</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
*.comment {
color: green;
}
*.symbol {
color: red;
}
</style>
</HEAD>
<BODY>
<HR><DIV style="text-align:center"><H1> File : terminal_interface-curses-text_io.ads </H1></DIV><HR>
<PRE>
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
<span class="comment"><EM>-- --</EM></span>
<span class="comment"><EM>-- <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding --</EM></span>
<span class="comment"><EM>-- --</EM></span>
<span class="comment"><EM>-- Terminal_Interface.Curses.Text_IO --</EM></span>
<span class="comment"><EM>-- --</EM></span>
<span class="comment"><EM>-- S P E C --</EM></span>
<span class="comment"><EM>-- --</EM></span>
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
<span class="comment"><EM>-- Copyright 2020 Thomas E. Dickey --</EM></span>
<span class="comment"><EM>-- Copyright 1999-2003,2009 Free Software Foundation, Inc. --</EM></span>
<span class="comment"><EM>-- --</EM></span>
<span class="comment"><EM>-- Permission is hereby granted, free of charge, to any person obtaining a --</EM></span>
<span class="comment"><EM>-- copy of this software and associated documentation files (the --</EM></span>
<span class="comment"><EM>-- "Software"), to deal in the Software without restriction, including --</EM></span>
<span class="comment"><EM>-- without limitation the rights to use, copy, modify, merge, publish, --</EM></span>
<span class="comment"><EM>-- distribute, distribute with modifications, sublicense, and/or sell --</EM></span>
<span class="comment"><EM>-- copies of the Software, and to permit persons to whom the Software is --</EM></span>
<span class="comment"><EM>-- furnished to do so, subject to the following conditions: --</EM></span>
<span class="comment"><EM>-- --</EM></span>
<span class="comment"><EM>-- The above copyright notice and this permission notice shall be included --</EM></span>
<span class="comment"><EM>-- in all copies or substantial portions of the Software. --</EM></span>
<span class="comment"><EM>-- --</EM></span>
<span class="comment"><EM>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --</EM></span>
<span class="comment"><EM>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --</EM></span>
<span class="comment"><EM>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --</EM></span>
<span class="comment"><EM>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --</EM></span>
<span class="comment"><EM>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --</EM></span>
<span class="comment"><EM>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --</EM></span>
<span class="comment"><EM>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --</EM></span>
<span class="comment"><EM>-- --</EM></span>
<span class="comment"><EM>-- Except as contained in this notice, the name(s) of the above copyright --</EM></span>
<span class="comment"><EM>-- holders shall not be used in advertising or otherwise to promote the --</EM></span>
<span class="comment"><EM>-- sale, use or other dealings in this Software without prior written --</EM></span>
<span class="comment"><EM>-- authorization. --</EM></span>
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
<span class="comment"><EM>-- Author: Juergen Pfeifer, 1996</EM></span>
<span class="comment"><EM>-- Version Control:</EM></span>
<span class="comment"><EM>-- @Revision: 1.15 @</EM></span>
<span class="comment"><EM>-- Binding Version 01.00</EM></span>
<span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
<b>with</b> Ada.Text_IO;
<b>with</b> Ada.IO_Exceptions;
<b>package</b> <A HREF="terminal_interface__ads.htm#ref_43_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_48_28">Curses</A>.<span class="symbol"><A NAME="ref_45_35" HREF="terminal_interface-curses-text_io__adb.htm#ref_43_40">Text_IO</A></span> <b>is</b>
<b>use</b> <b>type</b> Ada.Text_IO.Count;
<b>subtype</b> <span class="symbol"><A NAME="ref_48_12">Count</A></span> <b>is</b> Ada.Text_IO.Count;
<b>subtype</b> <span class="symbol"><A NAME="ref_49_12">Positive_Count</A></span> <b>is</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Count</A> <b>range</b> 1 .. <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Count</A>'Last;
<b>subtype</b> <span class="symbol"><A NAME="ref_51_12">Field</A></span> <b>is</b> Ada.Text_IO.Field;
<b>subtype</b> <span class="symbol"><A NAME="ref_52_12">Number_Base</A></span> <b>is</b> Integer <b>range</b> 2 .. 16;
<b>type</b> <span class="symbol"><A NAME="ref_54_9">Type_Set</A></span> <b>is</b> (<span class="symbol"><A NAME="ref_54_22">Lower_Case</A></span>, <span class="symbol"><A NAME="ref_54_34">Upper_Case</A></span>, <span class="symbol"><A NAME="ref_54_46">Mixed_Case</A></span>);
<span class="comment"><EM>-- For most of the routines you will see a version without a Window</EM></span>
<span class="comment"><EM>-- type parameter. They will operate on a default window, which can</EM></span>
<span class="comment"><EM>-- be set by the user. It is initially equal to Standard_Window.</EM></span>
<b>procedure</b> <span class="symbol"><A NAME="ref_60_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_47_14">Set_Window</A></span> (<span class="symbol"><A NAME="ref_60_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_47_26">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>);
<span class="comment"><EM>-- Set Win as the default window</EM></span>
<b>function</b> <span class="symbol"><A NAME="ref_63_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_53_13">Get_Window</A></span> <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>;
<span class="comment"><EM>-- Get the current default window</EM></span>
<b>procedure</b> <span class="symbol"><A NAME="ref_66_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_64_14">Flush</A></span> (<span class="symbol"><A NAME="ref_66_21" HREF="terminal_interface-curses-text_io__adb.htm#ref_64_21">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>);
<b>procedure</b> <span class="symbol"><A NAME="ref_67_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_70_14">Flush</A></span>;
<span class="comment"><EM>--------------------------------------------</EM></span>
<span class="comment"><EM>-- Specification of line and page lengths --</EM></span>
<span class="comment"><EM>--------------------------------------------</EM></span>
<span class="comment"><EM>-- There are no set routines in this package. I assume, that you allocate</EM></span>
<span class="comment"><EM>-- the window with an appropriate size.</EM></span>
<span class="comment"><EM>-- A scroll-window is interpreted as an page with unbounded page length,</EM></span>
<span class="comment"><EM>-- i.e. it returns the conventional 0 as page length.</EM></span>
<b>function</b> <span class="symbol"><A NAME="ref_78_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_85_13">Line_Length</A></span> (<span class="symbol"><A NAME="ref_78_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_85_26">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Count</A>;
<b>function</b> <span class="symbol"><A NAME="ref_79_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_97_13">Line_Length</A></span> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Count</A>;
<b>function</b> <span class="symbol"><A NAME="ref_81_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_103_13">Page_Length</A></span> (<span class="symbol"><A NAME="ref_81_26" HREF="terminal_interface-curses-text_io__adb.htm#ref_103_26">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Count</A>;
<b>function</b> <span class="symbol"><A NAME="ref_82_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_119_13">Page_Length</A></span> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_48_12">Count</A>;
<span class="comment"><EM>------------------------------------</EM></span>
<span class="comment"><EM>-- Column, Line, and Page Control --</EM></span>
<span class="comment"><EM>------------------------------------</EM></span>
<b>procedure</b> <span class="symbol"><A NAME="ref_87_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_128_14">New_Line</A></span> (<span class="symbol"><A NAME="ref_87_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_128_24">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>; <span class="symbol"><A NAME="ref_87_38" HREF="terminal_interface-curses-text_io__adb.htm#ref_128_38">Spacing</A></span> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_49_12">Positive_Count</A> := 1);
<b>procedure</b> <span class="symbol"><A NAME="ref_88_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_145_14">New_Line</A></span> (<span class="symbol"><A NAME="ref_88_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_145_24">Spacing</A></span> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_49_12">Positive_Count</A> := 1);
<b>procedure</b> <span class="symbol"><A NAME="ref_90_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_151_14">New_Page</A></span> (<span class="symbol"><A NAME="ref_90_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_151_24">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>);
<b>procedure</b> <span class="symbol"><A NAME="ref_91_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_157_14">New_Page</A></span>;
<b>procedure</b> <span class="symbol"><A NAME="ref_93_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_163_14">Set_Col</A></span> (<span class="symbol"><A NAME="ref_93_23" HREF="terminal_interface-curses-text_io__adb.htm#ref_163_23">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>; <span class="symbol"><A NAME="ref_93_38" HREF="terminal_interface-curses-text_io__adb.htm#ref_163_38">To</A></span> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_49_12">Positive_Count</A>);
<b>procedure</b> <span class="symbol"><A NAME="ref_94_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_191_14">Set_Col</A></span> (<span class="symbol"><A NAME="ref_94_23" HREF="terminal_interface-curses-text_io__adb.htm#ref_191_23">To</A></span> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_49_12">Positive_Count</A>);
<b>procedure</b> <span class="symbol"><A NAME="ref_96_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_197_14">Set_Line</A></span> (<span class="symbol"><A NAME="ref_96_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_197_24">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>; <span class="symbol"><A NAME="ref_96_38" HREF="terminal_interface-curses-text_io__adb.htm#ref_197_38">To</A></span> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_49_12">Positive_Count</A>);
<b>procedure</b> <span class="symbol"><A NAME="ref_97_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_221_14">Set_Line</A></span> (<span class="symbol"><A NAME="ref_97_24" HREF="terminal_interface-curses-text_io__adb.htm#ref_221_24">To</A></span> : <A HREF="terminal_interface-curses-text_io__ads.htm#ref_49_12">Positive_Count</A>);
<b>function</b> <span class="symbol"><A NAME="ref_99_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_227_13">Col</A></span> (<span class="symbol"><A NAME="ref_99_18" HREF="terminal_interface-curses-text_io__adb.htm#ref_227_18">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_49_12">Positive_Count</A>;
<b>function</b> <span class="symbol"><A NAME="ref_100_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_241_13">Col</A></span> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_49_12">Positive_Count</A>;
<b>function</b> <span class="symbol"><A NAME="ref_102_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_247_13">Line</A></span> (<span class="symbol"><A NAME="ref_102_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_247_19">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>) <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_49_12">Positive_Count</A>;
<b>function</b> <span class="symbol"><A NAME="ref_103_13" HREF="terminal_interface-curses-text_io__adb.htm#ref_261_13">Line</A></span> <b>return</b> <A HREF="terminal_interface-curses-text_io__ads.htm#ref_49_12">Positive_Count</A>;
<span class="comment"><EM>-----------------------</EM></span>
<span class="comment"><EM>-- Characters-Output --</EM></span>
<span class="comment"><EM>-----------------------</EM></span>
<b>procedure</b> <span class="symbol"><A NAME="ref_109_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_271_14">Put</A></span> (<span class="symbol"><A NAME="ref_109_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_271_19">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>; <span class="symbol"><A NAME="ref_109_34" HREF="terminal_interface-curses-text_io__adb.htm#ref_271_34">Item</A></span> : Character);
<b>procedure</b> <span class="symbol"><A NAME="ref_110_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_289_14">Put</A></span> (<span class="symbol"><A NAME="ref_110_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_289_19">Item</A></span> : Character);
<span class="comment"><EM>--------------------</EM></span>
<span class="comment"><EM>-- Strings-Output --</EM></span>
<span class="comment"><EM>--------------------</EM></span>
<b>procedure</b> <span class="symbol"><A NAME="ref_116_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_299_14">Put</A></span> (<span class="symbol"><A NAME="ref_116_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_299_19">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>; <span class="symbol"><A NAME="ref_116_34" HREF="terminal_interface-curses-text_io__adb.htm#ref_299_34">Item</A></span> : String);
<b>procedure</b> <span class="symbol"><A NAME="ref_117_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_317_14">Put</A></span> (<span class="symbol"><A NAME="ref_117_19" HREF="terminal_interface-curses-text_io__adb.htm#ref_317_19">Item</A></span> : String);
<b>procedure</b> <span class="symbol"><A NAME="ref_119_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_323_14">Put_Line</A></span>
(<span class="symbol"><A NAME="ref_120_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_324_7">Win</A></span> : <A HREF="terminal_interface-curses__ads.htm#ref_56_9">Window</A>;
<span class="symbol"><A NAME="ref_121_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_325_7">Item</A></span> : String);
<b>procedure</b> <span class="symbol"><A NAME="ref_123_14" HREF="terminal_interface-curses-text_io__adb.htm#ref_332_14">Put_Line</A></span>
(<span class="symbol"><A NAME="ref_124_7" HREF="terminal_interface-curses-text_io__adb.htm#ref_333_7">Item</A></span> : String);
<span class="comment"><EM>-- Exceptions</EM></span>
<span class="symbol"><A NAME="ref_128_4">Status_Error</A></span> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Status_Error;
<span class="symbol"><A NAME="ref_129_4">Mode_Error</A></span> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Mode_Error;
<span class="symbol"><A NAME="ref_130_4">Name_Error</A></span> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Name_Error;
<span class="symbol"><A NAME="ref_131_4">Use_Error</A></span> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Use_Error;
<span class="symbol"><A NAME="ref_132_4">Device_Error</A></span> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Device_Error;
<span class="symbol"><A NAME="ref_133_4">End_Error</A></span> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.End_Error;
<span class="symbol"><A NAME="ref_134_4">Data_Error</A></span> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Data_Error;
<span class="symbol"><A NAME="ref_135_4">Layout_Error</A></span> : <b>exception</b> <b>renames</b> Ada.IO_Exceptions.Layout_Error;
<b>end</b> <A HREF="terminal_interface__ads.htm#ref_43_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_48_28">Curses</A>.<A HREF="terminal_interface-curses-text_io__ads.htm#ref_45_35">Text_IO</A>;
</PRE></BODY></HTML>