------------------------------------------------------------------------------ -- -- -- XVIEW ADA LIBRARY COMPONENTS -- -- -- -- XV_TEXTSW_PACKAGE -- -- -- -- S p e c -- -- -- -- Copyright (c) 1995 Andreas Almroth, All Rights Reserved -- -- -- -- The XVIEW ADA library is free software; you can redistribute it and/or -- -- modify it under terms of the GNU Library General Public License as -- -- published by the Free Software Foundation; either version 2, or (at your -- -- option) any later version. The XVIEW ADA library is distributed in the -- -- hope that it will be useful, but WITHOUT ANY WARRANTY; without even the -- -- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- See the GNU Library General Public License for more details. -- -- You should have received a copy of the GNU Library General Public -- -- License along with the XVIEW ADA library; see the file COPYING.LIB. If -- -- not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, -- -- MA 02139, USA. -- -- -- ------------------------------------------------------------------------------ with Ada.Finalization,Xv_Base_Package,Xv_Frame_Package,Xv_Font_Package; use Ada.Finalization,Xv_Base_Package,Xv_Frame_Package,Xv_Font_Package; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; package Xv_Textsw_Package is type Textsw is new Xv_Opaque; type Textsw_Index is new Integer; -- When deleting text and want to delete to end of file, use TEXTSW_INFINITY -- instead of a number for last character to be deleted. TEXTSW_INFINITY : constant := 2004318071; type Callback_Textsw_Ptr is access function (item : Textsw; event : Integer) return Integer; type Int_Ptr is access all Integer; --------------- -- Xv_Textsw -- --------------- type Xv_Textsw (Owner : Frame) is new Controlled with private; -- type Xv_Textsw (Owner : Frame := 0) is new Controlled with private; type Xv_Textsw_Ptr is access all Xv_Textsw; procedure Initialize (V : in out Xv_Textsw); procedure Finalize (V : in out Xv_Textsw); procedure Set_Size (V : in Xv_Textsw ; W, H : Integer); procedure Set_Pos (V : in Xv_Textsw ; X, Y : Integer); function Get_Textsw (V : in Xv_Textsw) return Textsw; function Load_File (V : in Xv_Textsw; File_Name : String; Position : Integer) return Boolean; function Save_File (V : in Xv_Textsw) return Boolean; function Store_File (V : in Xv_Textsw; File_Name : String) return Boolean; procedure Discard (V : in Xv_Textsw); function Is_Modified (V : in Xv_Textsw) return Boolean; function Insert_Text (V : in Xv_Textsw; Txt : String) return Textsw_Index; procedure Move_Point (V : in Xv_Textsw; Position : Textsw_Index); function Get_Point (V : in Xv_Textsw) return Textsw_Index; function Delete_Char (V : in Xv_Textsw; Count, Direction : Integer) return Textsw_Index; function Delete_Word (V : in Xv_Textsw; Count, Direction : Integer) return Textsw_Index; function Delete_Line (V : in Xv_Textsw; Count, Direction : Integer) return Textsw_Index; function Replace_Text (V : in Xv_Textsw; First, Last : Textsw_Index; Txt : String) return Textsw_Index; function Get_Text_Size (V : in Xv_Textsw) return Textsw_Index; procedure Set_Font (V : in Xv_Textsw; Fnt : Font); procedure File_Contents (V : in Xv_Textsw; File_Name : String; Position : Integer); procedure Contents (V : in Xv_Textsw; Txt : String; Position : Integer); function Get_Contents (V : in Xv_Textsw; From : Textsw_Index; Max_Len : Integer) return String; function Insert_File (V : in Xv_Textsw; File_Name : String) return Boolean; procedure Set_Line_Break (V : in Xv_Textsw; State : Boolean); procedure Scroll_Line (V : in Xv_Textsw; Lines : Integer); function Get_Screen_Lines (V : in Xv_Textsw) return Integer; procedure Get_Visible_File_Lines (V : in Xv_Textsw; Top : in out integer; Bottom : in out Integer); procedure Find_Text (V : in Xv_Textsw; Start : in out Textsw_Index; Finish : in out Textsw_Index; Txt : String); ------------------------------------------------------------------------------- private type Xv_Textsw (Owner : Frame) is new Controlled with record Base : Textsw; Parent : Frame := Owner; end record; end Xv_Textsw_Package;