X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=doc%2Fhtml%2Fada%2Fterminal_interface-curses-forms-field_types__adb.htm;h=e12eab6b3d7cfe981a8cce6f4ae6dbcdc07b4e8f;hp=2a48f9c5410c30fecd90b42147efee6478acbd45;hb=2e5d72d6396bb38a8d1d1b3534f62e28aebaa600;hpb=2b635f090ec43c82958cef9369464aee4dd8975f diff --git a/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm b/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm index 2a48f9c5..e12eab6b 100644 --- a/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm +++ b/doc/html/ada/terminal_interface-curses-forms-field_types__adb.htm @@ -1,81 +1,93 @@ - -
------------------------------------------------------------------------------- --- -- --- GNAT ncurses Binding -- --- -- --- Terminal_Interface.Curses.Forms.Field_Types -- --- -- --- B O D Y -- --- -- ------------------------------------------------------------------------------- --- Copyright (c) 1998-2009,2011 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 -- --- "Software"), to deal in the Software without restriction, including -- --- without limitation the rights to use, copy, modify, merge, publish, -- --- distribute, distribute with modifications, sublicense, and/or sell -- --- copies of the Software, and to permit persons to whom the Software is -- --- furnished to do so, subject to the following conditions: -- --- -- --- The above copyright notice and this permission notice shall be included -- --- in all copies or substantial portions of the Software. -- --- -- --- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- --- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- --- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- --- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- --- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- --- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- --- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- --- -- --- Except as contained in this notice, the name(s) of the above copyright -- --- holders shall not be used in advertising or otherwise to promote the -- --- sale, use or other dealings in this Software without prior written -- --- authorization. -- ------------------------------------------------------------------------------- --- Author: Juergen Pfeifer, 1996 --- Version Control: --- @Revision: 1.25 @ --- @Date: 2011/03/22 23:22:27 @ --- Binding Version 01.00 ------------------------------------------------------------------------------- +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types -- +-- -- +-- B O D Y -- +-- -- +------------------------------------------------------------------------------ +-- Copyright (c) 1998-2009,2011 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 -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell -- +-- copies of the Software, and to permit persons to whom the Software is -- +-- furnished to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- +-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- +-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------ +-- Author: Juergen Pfeifer, 1996 +-- Version Control: +-- @Revision: 1.25 @ +-- @Date: 2011/03/22 23:22:27 @ +-- Binding Version 01.00 +------------------------------------------------------------------------------ with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; with Ada.Unchecked_Deallocation; with System.Address_To_Access_Conversions; --- | --- |===================================================================== --- | man page form_fieldtype.3x --- |===================================================================== --- | -package body Terminal_Interface.Curses.Forms.Field_Types is +-- | +-- |===================================================================== +-- | man page form_fieldtype.3x +-- |===================================================================== +-- | +package body Terminal_Interface.Curses.Forms.Field_Types is use type System.Address; package Argument_Conversions is new System.Address_To_Access_Conversions (Argument); - function Get_Fieldtype (F : Field) return C_Field_Type; + function Get_Fieldtype (F : Field) return C_Field_Type; pragma Import (C, Get_Fieldtype, "field_type"); - function Get_Arg (F : Field) return System.Address; + function Get_Arg (F : Field) return System.Address; pragma Import (C, Get_Arg, "field_arg"); - -- | - -- |===================================================================== - -- | man page form_field_validation.3x - -- |===================================================================== - -- | - -- | - -- | - function Get_Type (Fld : Field) return Field_Type_Access + -- | + -- |===================================================================== + -- | man page form_field_validation.3x + -- |===================================================================== + -- | + -- | + -- | + function Get_Type (Fld : Field) return Field_Type_Access is - Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); - Arg : Argument_Access; + Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); + Arg : Argument_Access; begin if Low_Level = Null_Field_Type then return null; @@ -87,32 +99,32 @@ Arg := Argument_Access (Argument_Conversions.To_Pointer (Get_Arg (Fld))); if Arg = null then - raise Form_Exception; + raise Form_Exception; else return Arg.all.Typ; end if; else - raise Form_Exception; + raise Form_Exception; end if; end if; end Get_Type; - function Copy_Arg (Usr : System.Address) return System.Address + function Copy_Arg (Usr : System.Address) return System.Address is begin return Usr; end Copy_Arg; - procedure Free_Arg (Usr : System.Address) + procedure Free_Arg (Usr : System.Address) is procedure Free_Type is new Ada.Unchecked_Deallocation (Field_Type'Class, Field_Type_Access); procedure Freeargs is new Ada.Unchecked_Deallocation (Argument, Argument_Access); - To_Be_Free : Argument_Access + To_Be_Free : Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); - Low_Level : C_Field_Type; + Low_Level : C_Field_Type; begin if To_Be_Free /= null then if To_Be_Free.all.Usr /= System.Null_Address then @@ -128,23 +140,23 @@ end if; end Free_Arg; - procedure Wrap_Builtin (Fld : Field; - Typ : Field_Type'Class; - Cft : C_Field_Type := C_Builtin_Router) + procedure Wrap_Builtin (Fld : Field; + Typ : Field_Type'Class; + Cft : C_Field_Type := C_Builtin_Router) is - Usr_Arg : constant System.Address := Get_Arg (Fld); - Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); - Arg : Argument_Access; - Res : Eti_Error; - function Set_Fld_Type (F : Field := Fld; - Cf : C_Field_Type := Cft; - Arg1 : Argument_Access) return C_Int; + Usr_Arg : constant System.Address := Get_Arg (Fld); + Low_Level : constant C_Field_Type := Get_Fieldtype (Fld); + Arg : Argument_Access; + Res : Eti_Error; + function Set_Fld_Type (F : Field := Fld; + Cf : C_Field_Type := Cft; + Arg1 : Argument_Access) return C_Int; pragma Import (C, Set_Fld_Type, "set_field_type_user"); begin pragma Assert (Low_Level /= Null_Field_Type); if Cft /= C_Builtin_Router and then Cft /= C_Choice_Router then - raise Form_Exception; + raise Form_Exception; else Arg := new Argument'(Usr => System.Null_Address, Typ => new Field_Type'Class'(Typ), @@ -164,10 +176,10 @@ end if; end Wrap_Builtin; - function Field_Check_Router (Fld : Field; - Usr : System.Address) return Curses_Bool + function Field_Check_Router (Fld : Field; + Usr : System.Address) return Curses_Bool is - Arg : constant Argument_Access + Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type @@ -179,10 +191,10 @@ end if; end Field_Check_Router; - function Char_Check_Router (Ch : C_Int; - Usr : System.Address) return Curses_Bool + function Char_Check_Router (Ch : C_Int; + Usr : System.Address) return Curses_Bool is - Arg : constant Argument_Access + Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type @@ -194,10 +206,10 @@ end if; end Char_Check_Router; - function Next_Router (Fld : Field; - Usr : System.Address) return Curses_Bool + function Next_Router (Fld : Field; + Usr : System.Address) return Curses_Bool is - Arg : constant Argument_Access + Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type @@ -209,10 +221,10 @@ end if; end Next_Router; - function Prev_Router (Fld : Field; - Usr : System.Address) return Curses_Bool + function Prev_Router (Fld : Field; + Usr : System.Address) return Curses_Bool is - Arg : constant Argument_Access := + Arg : constant Argument_Access := Argument_Access (Argument_Conversions.To_Pointer (Usr)); begin pragma Assert (Arg /= null and then Arg.all.Cft /= Null_Field_Type @@ -224,18 +236,18 @@ end if; end Prev_Router; - -- ----------------------------------------------------------------------- - -- - function C_Builtin_Router return C_Field_Type + -- ----------------------------------------------------------------------- + -- + function C_Builtin_Router return C_Field_Type is - Res : Eti_Error; - T : C_Field_Type; + Res : Eti_Error; + T : C_Field_Type; begin if M_Builtin_Router = Null_Field_Type then T := New_Fieldtype (Field_Check_Router'Access, Char_Check_Router'Access); if T = Null_Field_Type then - raise Form_Exception; + raise Form_Exception; else Res := Set_Fieldtype_Arg (T, Make_Arg'Access, @@ -251,18 +263,18 @@ return M_Builtin_Router; end C_Builtin_Router; - -- ----------------------------------------------------------------------- - -- - function C_Choice_Router return C_Field_Type + -- ----------------------------------------------------------------------- + -- + function C_Choice_Router return C_Field_Type is - Res : Eti_Error; - T : C_Field_Type; + Res : Eti_Error; + T : C_Field_Type; begin if M_Choice_Router = Null_Field_Type then T := New_Fieldtype (Field_Check_Router'Access, Char_Check_Router'Access); if T = Null_Field_Type then - raise Form_Exception; + raise Form_Exception; else Res := Set_Fieldtype_Arg (T, Make_Arg'Access,