X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=doc%2Fhtml%2Fada%2Fterminal_interface-curses-menus__adb.htm;fp=doc%2Fhtml%2Fada%2Fterminal_interface-curses-menus__adb.htm;h=86b3fb280f423fc55d5e9a5fa2d3fac8f71eccf7;hp=216210aca1765a2614ce15eac79eb17374b0cef5;hb=77afe78361875f531dc2bf8d73f2e781c8e76176;hpb=40cf934fff2d2790c060619e3a29bd54c20994b0 diff --git a/doc/html/ada/terminal_interface-curses-menus__adb.htm b/doc/html/ada/terminal_interface-curses-menus__adb.htm index 216210ac..86b3fb28 100644 --- a/doc/html/ada/terminal_interface-curses-menus__adb.htm +++ b/doc/html/ada/terminal_interface-curses-menus__adb.htm @@ -12,7 +12,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998-2004,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2008,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,16 +40,16 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: --- @Revision: 1.26 @ --- @Date: 2008/07/26 18:50:58 @ +-- @Revision: 1.27 @ +-- @Date: 2009/12/26 17:38:58 @ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; -with Interfaces.C; use Interfaces.C; -with Interfaces.C.Strings; use Interfaces.C.Strings; -with Interfaces.C.Pointers; +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Interfaces.C.Pointers; with Ada.Unchecked_Conversion; @@ -57,10 +57,10 @@ type C_Item_Array is array (Natural range <>) of aliased Item; package I_Array is new - Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item); + Interfaces.C.Pointers (Natural, Item, C_Item_Array, Null_Item); use type System.Bit_Order; - subtype chars_ptr is Interfaces.C.Strings.chars_ptr; + subtype chars_ptr is Interfaces.C.Strings.chars_ptr; function MOS_2_CInt is new Ada.Unchecked_Conversion (Menu_Option_Set, @@ -79,7 +79,7 @@ Item_Option_Set); ------------------------------------------------------------------------------ - procedure Request_Name (Key : in Menu_Request_Code; + procedure Request_Name (Key : Menu_Request_Code; Name : out String) is function Request_Name (Key : C_Int) return chars_ptr; @@ -99,7 +99,7 @@ function Create (Name : String; Description : String := "") return Item is - type Char_Ptr is access all Interfaces.C.char; + type Char_Ptr is access all Interfaces.C.char; function Newitem (Name, Desc : Char_Ptr) return Item; pragma Import (C, Newitem, "new_item"); @@ -141,11 +141,11 @@ begin Ptr := Descname (Itm); if Ptr /= Null_Ptr then - Interfaces.C.Strings.Free (Ptr); + Interfaces.C.Strings.Free (Ptr); end if; Ptr := Itemname (Itm); if Ptr /= Null_Ptr then - Interfaces.C.Strings.Free (Ptr); + Interfaces.C.Strings.Free (Ptr); end if; Res := Freeitem (Itm); if Res /= E_Ok then @@ -154,8 +154,8 @@ Itm := Null_Item; end Delete; ------------------------------------------------------------------------------- - procedure Set_Value (Itm : in Item; - Value : in Boolean := True) + procedure Set_Value (Itm : Item; + Value : Boolean := True) is function Set_Item_Val (Itm : Item; Val : C_Int) return C_Int; @@ -193,8 +193,8 @@ end if; end Visible; ------------------------------------------------------------------------------- - procedure Set_Options (Itm : in Item; - Options : in Item_Option_Set) + procedure Set_Options (Itm : Item; + Options : Item_Option_Set) is function Set_Item_Opts (Itm : Item; Opt : C_Int) return C_Int; @@ -209,8 +209,8 @@ end if; end Set_Options; - procedure Switch_Options (Itm : in Item; - Options : in Item_Option_Set; + procedure Switch_Options (Itm : Item; + Options : Item_Option_Set; On : Boolean := True) is function Item_Opts_On (Itm : Item; @@ -233,7 +233,7 @@ end if; end Switch_Options; - procedure Get_Options (Itm : in Item; + procedure Get_Options (Itm : Item; Options : out Item_Option_Set) is function Item_Opts (Itm : Item) return C_Int; @@ -252,7 +252,7 @@ return Ios; end Get_Options; ------------------------------------------------------------------------------- - procedure Name (Itm : in Item; + procedure Name (Itm : Item; Name : out String) is function Itemname (Itm : Item) return chars_ptr; @@ -261,7 +261,7 @@ Fill_String (Itemname (Itm), Name); end Name; - function Name (Itm : in Item) return String + function Name (Itm : Item) return String is function Itemname (Itm : Item) return chars_ptr; pragma Import (C, Itemname, "item_name"); @@ -269,7 +269,7 @@ return Fill_String (Itemname (Itm)); end Name; - procedure Description (Itm : in Item; + procedure Description (Itm : Item; Description : out String) is function Descname (Itm : Item) return chars_ptr; @@ -278,7 +278,7 @@ Fill_String (Descname (Itm), Description); end Description; - function Description (Itm : in Item) return String + function Description (Itm : Item) return String is function Descname (Itm : Item) return chars_ptr; pragma Import (C, Descname, "item_description"); @@ -286,8 +286,8 @@ return Fill_String (Descname (Itm)); end Description; ------------------------------------------------------------------------------- - procedure Set_Current (Men : in Menu; - Itm : in Item) + procedure Set_Current (Men : Menu; + Itm : Item) is function Set_Curr_Item (Men : Menu; Itm : Item) return C_Int; @@ -313,8 +313,8 @@ return Res; end Current; - procedure Set_Top_Row (Men : in Menu; - Line : in Line_Position) + procedure Set_Top_Row (Men : Menu; + Line : Line_Position) is function Set_Toprow (Men : Menu; Line : C_Int) return C_Int; @@ -353,8 +353,8 @@ return Positive (Natural (Res) + Positive'First); end Get_Index; ------------------------------------------------------------------------------- - procedure Post (Men : in Menu; - Post : in Boolean := True) + procedure Post (Men : Menu; + Post : Boolean := True) is function M_Post (Men : Menu) return C_Int; pragma Import (C, M_Post, "post_menu"); @@ -373,8 +373,8 @@ end if; end Post; ------------------------------------------------------------------------------- - procedure Set_Options (Men : in Menu; - Options : in Menu_Option_Set) + procedure Set_Options (Men : Menu; + Options : Menu_Option_Set) is function Set_Menu_Opts (Men : Menu; Opt : C_Int) return C_Int; @@ -389,9 +389,9 @@ end if; end Set_Options; - procedure Switch_Options (Men : in Menu; - Options : in Menu_Option_Set; - On : in Boolean := True) + procedure Switch_Options (Men : Menu; + Options : Menu_Option_Set; + On : Boolean := True) is function Menu_Opts_On (Men : Menu; Opt : C_Int) return C_Int; @@ -413,8 +413,8 @@ end if; end Switch_Options; - procedure Get_Options (Men : in Menu; - Options : out Menu_Option_Set) + procedure Get_Options (Men : Menu; + Options : out Menu_Option_Set) is function Menu_Opts (Men : Menu) return C_Int; pragma Import (C, Menu_Opts, "menu_opts"); @@ -432,8 +432,8 @@ return Mos; end Get_Options; ------------------------------------------------------------------------------- - procedure Set_Window (Men : in Menu; - Win : in Window) + procedure Set_Window (Men : Menu; + Win : Window) is function Set_Menu_Win (Men : Menu; Win : Window) return C_Int; @@ -456,8 +456,8 @@ return W; end Get_Window; - procedure Set_Sub_Window (Men : in Menu; - Win : in Window) + procedure Set_Sub_Window (Men : Menu; + Win : Window) is function Set_Menu_Sub (Men : Menu; Win : Window) return C_Int; @@ -480,7 +480,7 @@ return W; end Get_Sub_Window; - procedure Scale (Men : in Menu; + procedure Scale (Men : Menu; Lines : out Line_Count; Columns : out Column_Count) is @@ -512,10 +512,10 @@ end Position_Cursor; ------------------------------------------------------------------------------- - procedure Set_Mark (Men : in Menu; - Mark : in String) + procedure Set_Mark (Men : Menu; + Mark : String) is - type Char_Ptr is access all Interfaces.C.char; + type Char_Ptr is access all Interfaces.C.char; function Set_Mark (Men : Menu; Mark : Char_Ptr) return C_Int; pragma Import (C, Set_Mark, "set_menu_mark"); @@ -531,7 +531,7 @@ end if; end Set_Mark; - procedure Mark (Men : in Menu; + procedure Mark (Men : Menu; Mark : out String) is function Get_Menu_Mark (Men : Menu) return chars_ptr; @@ -550,9 +550,9 @@ ------------------------------------------------------------------------------- procedure Set_Foreground - (Men : in Menu; - Fore : in Character_Attribute_Set := Normal_Video; - Color : in Color_Pair := Color_Pair'First) + (Men : Menu; + Fore : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) is function Set_Menu_Fore (Men : Menu; Attr : C_Chtype) return C_Int; @@ -568,7 +568,7 @@ end if; end Set_Foreground; - procedure Foreground (Men : in Menu; + procedure Foreground (Men : Menu; Fore : out Character_Attribute_Set) is function Menu_Fore (Men : Menu) return C_Chtype; @@ -577,7 +577,7 @@ Fore := Chtype_To_AttrChar (Menu_Fore (Men)).Attr; end Foreground; - procedure Foreground (Men : in Menu; + procedure Foreground (Men : Menu; Fore : out Character_Attribute_Set; Color : out Color_Pair) is @@ -589,9 +589,9 @@ end Foreground; procedure Set_Background - (Men : in Menu; - Back : in Character_Attribute_Set := Normal_Video; - Color : in Color_Pair := Color_Pair'First) + (Men : Menu; + Back : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) is function Set_Menu_Back (Men : Menu; Attr : C_Chtype) return C_Int; @@ -607,7 +607,7 @@ end if; end Set_Background; - procedure Background (Men : in Menu; + procedure Background (Men : Menu; Back : out Character_Attribute_Set) is function Menu_Back (Men : Menu) return C_Chtype; @@ -616,7 +616,7 @@ Back := Chtype_To_AttrChar (Menu_Back (Men)).Attr; end Background; - procedure Background (Men : in Menu; + procedure Background (Men : Menu; Back : out Character_Attribute_Set; Color : out Color_Pair) is @@ -627,9 +627,9 @@ Color := Chtype_To_AttrChar (Menu_Back (Men)).Color; end Background; - procedure Set_Grey (Men : in Menu; - Grey : in Character_Attribute_Set := Normal_Video; - Color : in Color_Pair := Color_Pair'First) + procedure Set_Grey (Men : Menu; + Grey : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := Color_Pair'First) is function Set_Menu_Grey (Men : Menu; Attr : C_Chtype) return C_Int; @@ -646,7 +646,7 @@ end if; end Set_Grey; - procedure Grey (Men : in Menu; + procedure Grey (Men : Menu; Grey : out Character_Attribute_Set) is function Menu_Grey (Men : Menu) return C_Chtype; @@ -655,7 +655,7 @@ Grey := Chtype_To_AttrChar (Menu_Grey (Men)).Attr; end Grey; - procedure Grey (Men : in Menu; + procedure Grey (Men : Menu; Grey : out Character_Attribute_Set; Color : out Color_Pair) is @@ -666,8 +666,8 @@ Color := Chtype_To_AttrChar (Menu_Grey (Men)).Color; end Grey; - procedure Set_Pad_Character (Men : in Menu; - Pad : in Character := Space) + procedure Set_Pad_Character (Men : Menu; + Pad : Character := Space) is function Set_Menu_Pad (Men : Menu; Ch : C_Int) return C_Int; @@ -681,7 +681,7 @@ end if; end Set_Pad_Character; - procedure Pad_Character (Men : in Menu; + procedure Pad_Character (Men : Menu; Pad : out Character) is function Menu_Pad (Men : Menu) return C_Int; @@ -690,10 +690,10 @@ Pad := Character'Val (Menu_Pad (Men)); end Pad_Character; ------------------------------------------------------------------------------- - procedure Set_Spacing (Men : in Menu; - Descr : in Column_Position := 0; - Row : in Line_Position := 0; - Col : in Column_Position := 0) + procedure Set_Spacing (Men : Menu; + Descr : Column_Position := 0; + Row : Line_Position := 0; + Col : Column_Position := 0) is function Set_Spacing (Men : Menu; D, R, C : C_Int) return C_Int; @@ -709,7 +709,7 @@ end if; end Set_Spacing; - procedure Spacing (Men : in Menu; + procedure Spacing (Men : Menu; Descr : out Column_Position; Row : out Line_Position; Col : out Column_Position) @@ -737,7 +737,7 @@ function Set_Pattern (Men : Menu; Text : String) return Boolean is - type Char_Ptr is access all Interfaces.C.char; + type Char_Ptr is access all Interfaces.C.char; function Set_Pattern (Men : Menu; Pattern : Char_Ptr) return C_Int; pragma Import (C, Set_Pattern, "set_menu_pattern"); @@ -757,7 +757,7 @@ end case; end Set_Pattern; - procedure Pattern (Men : in Menu; + procedure Pattern (Men : Menu; Text : out String) is function Get_Pattern (Men : Menu) return chars_ptr; @@ -766,9 +766,9 @@ Fill_String (Get_Pattern (Men), Text); end Pattern; ------------------------------------------------------------------------------- - procedure Set_Format (Men : in Menu; - Lines : in Line_Count; - Columns : in Column_Count) + procedure Set_Format (Men : Menu; + Lines : Line_Count; + Columns : Column_Count) is function Set_Menu_Fmt (Men : Menu; Lin : C_Int; @@ -784,7 +784,7 @@ end if; end Set_Format; - procedure Format (Men : in Menu; + procedure Format (Men : Menu; Lines : out Line_Count; Columns : out Column_Count) is @@ -804,8 +804,8 @@ end if; end Format; ------------------------------------------------------------------------------- - procedure Set_Item_Init_Hook (Men : in Menu; - Proc : in Menu_Hook_Function) + procedure Set_Item_Init_Hook (Men : Menu; + Proc : Menu_Hook_Function) is function Set_Item_Init (Men : Menu; Proc : Menu_Hook_Function) return C_Int; @@ -818,8 +818,8 @@ end if; end Set_Item_Init_Hook; - procedure Set_Item_Term_Hook (Men : in Menu; - Proc : in Menu_Hook_Function) + procedure Set_Item_Term_Hook (Men : Menu; + Proc : Menu_Hook_Function) is function Set_Item_Term (Men : Menu; Proc : Menu_Hook_Function) return C_Int; @@ -832,8 +832,8 @@ end if; end Set_Item_Term_Hook; - procedure Set_Menu_Init_Hook (Men : in Menu; - Proc : in Menu_Hook_Function) + procedure Set_Menu_Init_Hook (Men : Menu; + Proc : Menu_Hook_Function) is function Set_Menu_Init (Men : Menu; Proc : Menu_Hook_Function) return C_Int; @@ -846,8 +846,8 @@ end if; end Set_Menu_Init_Hook; - procedure Set_Menu_Term_Hook (Men : in Menu; - Proc : in Menu_Hook_Function) + procedure Set_Menu_Term_Hook (Men : Menu; + Proc : Menu_Hook_Function) is function Set_Menu_Term (Men : Menu; Proc : Menu_Hook_Function) return C_Int; @@ -892,8 +892,8 @@ return Menu_Term (Men); end Get_Menu_Term_Hook; ------------------------------------------------------------------------------- - procedure Redefine (Men : in Menu; - Items : in Item_Array_Access) + procedure Redefine (Men : Menu; + Items : Item_Array_Access) is function Set_Items (Men : Menu; Items : System.Address) return C_Int; @@ -995,7 +995,7 @@ end Driver; procedure Free (IA : in out Item_Array_Access; - Free_Items : in Boolean := False) + Free_Items : Boolean := False) is procedure Release is new Ada.Unchecked_Deallocation (Item_Array, Item_Array_Access);