X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=doc%2Fhtml%2Fada%2Fterminal_interface-curses-text_io__adb.htm;h=fdeafd3c121b19234a89c6de9bc68dae838ee4cf;hp=d4008b75bf8d6660064e811256d9cbe9538cf4f6;hb=77afe78361875f531dc2bf8d73f2e781c8e76176;hpb=027ae42953e3186daed8f3882da73de48291b606;ds=sidebyside diff --git a/doc/html/ada/terminal_interface-curses-text_io__adb.htm b/doc/html/ada/terminal_interface-curses-text_io__adb.htm index d4008b75..fdeafd3c 100644 --- a/doc/html/ada/terminal_interface-curses-text_io__adb.htm +++ b/doc/html/ada/terminal_interface-curses-text_io__adb.htm @@ -12,7 +12,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2004,2006 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -40,15 +40,15 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- @Revision: 1.18 @ --- @Date: 2006/06/25 14:24:40 @ +-- @Revision: 1.19 @ +-- @Date: 2009/12/26 17:40:46 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ package body Terminal_Interface.Curses.Text_IO is Default_Window : Window := Null_Window; - procedure Set_Window (Win : in Window) + procedure Set_Window (Win : Window) is begin Default_Window := Win; @@ -58,17 +58,17 @@ is begin if Default_Window = Null_Window then - return Standard_Window; + return Standard_Window; else return Default_Window; end if; end Get_Window; pragma Inline (Get_Window); - procedure Flush (Win : in Window) + procedure Flush (Win : Window) is begin - Refresh (Win); + Refresh (Win); end Flush; procedure Flush @@ -86,12 +86,12 @@ -- A scroll-window is interpreted as an page with unbounded page length, -- i.e. it returns the conventional 0 as page length. - function Line_Length (Win : in Window) return Count + function Line_Length (Win : Window) return Count is N_Lines : Line_Count; N_Cols : Column_Count; begin - Get_Size (Win, N_Lines, N_Cols); + Get_Size (Win, N_Lines, N_Cols); -- if Natural (N_Cols) > Natural (Count'Last) then -- raise Layout_Error; -- end if; @@ -104,15 +104,15 @@ return Line_Length (Get_Window); end Line_Length; - function Page_Length (Win : in Window) return Count + function Page_Length (Win : Window) return Count is N_Lines : Line_Count; N_Cols : Column_Count; begin - if Scrolling_Allowed (Win) then + if Scrolling_Allowed (Win) then return 0; else - Get_Size (Win, N_Lines, N_Cols); + Get_Size (Win, N_Lines, N_Cols); -- if Natural (N_Lines) > Natural (Count'Last) then -- raise Layout_Error; -- end if; @@ -129,33 +129,33 @@ ------------------------------------ -- Column, Line, and Page Control -- ------------------------------------ - procedure New_Line (Win : in Window; Spacing : in Positive_Count := 1) + procedure New_Line (Win : Window; Spacing : Positive_Count := 1) is P_Size : constant Count := Page_Length (Win); begin - if not Spacing'Valid then + if not Spacing'Valid then raise Constraint_Error; end if; - for I in 1 .. Spacing loop + for I in 1 .. Spacing loop if P_Size > 0 and then Line (Win) >= P_Size then New_Page (Win); else - Add (Win, ASCII.LF); + Add (Win, ASCII.LF); end if; end loop; end New_Line; - procedure New_Line (Spacing : in Positive_Count := 1) + procedure New_Line (Spacing : Positive_Count := 1) is begin New_Line (Get_Window, Spacing); end New_Line; - procedure New_Page (Win : in Window) + procedure New_Page (Win : Window) is begin - Clear (Win); + Clear (Win); end New_Page; procedure New_Page @@ -164,19 +164,19 @@ New_Page (Get_Window); end New_Page; - procedure Set_Col (Win : in Window; To : in Positive_Count) + procedure Set_Col (Win : Window; To : Positive_Count) is Y : Line_Position; X1 : Column_Position; X2 : Column_Position; N : Natural; begin - if not To'Valid then + if not To'Valid then raise Constraint_Error; end if; - Get_Cursor_Position (Win, Y, X1); - N := Natural (To); N := N - 1; + Get_Cursor_Position (Win, Y, X1); + N := Natural (To); N := N - 1; X2 := Column_Position (N); if X1 > X2 then New_Line (Win, 1); @@ -192,25 +192,25 @@ end if; end Set_Col; - procedure Set_Col (To : in Positive_Count) + procedure Set_Col (To : Positive_Count) is begin Set_Col (Get_Window, To); end Set_Col; - procedure Set_Line (Win : in Window; To : in Positive_Count) + procedure Set_Line (Win : Window; To : Positive_Count) is Y1 : Line_Position; Y2 : Line_Position; X : Column_Position; N : Natural; begin - if not To'Valid then + if not To'Valid then raise Constraint_Error; end if; - Get_Cursor_Position (Win, Y1, X); - N := Natural (To); N := N - 1; + Get_Cursor_Position (Win, Y1, X); + N := Natural (To); N := N - 1; Y2 := Line_Position (N); if Y2 < Y1 then New_Page (Win); @@ -221,19 +221,19 @@ end if; end Set_Line; - procedure Set_Line (To : in Positive_Count) + procedure Set_Line (To : Positive_Count) is begin Set_Line (Get_Window, To); end Set_Line; - function Col (Win : in Window) return Positive_Count + function Col (Win : Window) return Positive_Count is Y : Line_Position; X : Column_Position; N : Natural; begin - Get_Cursor_Position (Win, Y, X); + Get_Cursor_Position (Win, Y, X); N := Natural (X); N := N + 1; -- if N > Natural (Count'Last) then -- raise Layout_Error; @@ -247,13 +247,13 @@ return Col (Get_Window); end Col; - function Line (Win : in Window) return Positive_Count + function Line (Win : Window) return Positive_Count is Y : Line_Position; X : Column_Position; N : Natural; begin - Get_Cursor_Position (Win, Y, X); + Get_Cursor_Position (Win, Y, X); N := Natural (Y); N := N + 1; -- if N > Natural (Count'Last) then -- raise Layout_Error; @@ -271,7 +271,7 @@ -- Characters Output -- ----------------------- - procedure Put (Win : in Window; Item : in Character) + procedure Put (Win : Window; Item : Character) is P_Size : constant Count := Page_Length (Win); Y : Line_Position; @@ -280,16 +280,16 @@ C : Column_Count; begin if P_Size > 0 then - Get_Cursor_Position (Win, Y, X); - Get_Size (Win, L, C); + Get_Cursor_Position (Win, Y, X); + Get_Size (Win, L, C); if (Y + 1) = L and then (X + 1) = C then New_Page (Win); end if; end if; - Add (Win, Item); + Add (Win, Item); end Put; - procedure Put (Item : in Character) + procedure Put (Item : Character) is begin Put (Get_Window, Item); @@ -299,7 +299,7 @@ -- Strings-Output -- -------------------- - procedure Put (Win : in Window; Item : in String) + procedure Put (Win : Window; Item : String) is P_Size : constant Count := Page_Length (Win); Y : Line_Position; @@ -308,24 +308,24 @@ C : Column_Count; begin if P_Size > 0 then - Get_Cursor_Position (Win, Y, X); - Get_Size (Win, L, C); - if (Y + 1) = L and then (X + 1 + Item'Length) >= C then + Get_Cursor_Position (Win, Y, X); + Get_Size (Win, L, C); + if (Y + 1) = L and then (X + 1 + Item'Length) >= C then New_Page (Win); end if; end if; - Add (Win, Item); + Add (Win, Item); end Put; - procedure Put (Item : in String) + procedure Put (Item : String) is begin Put (Get_Window, Item); end Put; procedure Put_Line - (Win : in Window; - Item : in String) + (Win : Window; + Item : String) is begin Put (Win, Item); @@ -333,7 +333,7 @@ end Put_Line; procedure Put_Line - (Item : in String) + (Item : String) is begin Put_Line (Get_Window, Item);