1997-05-15 12:00:00 +08:00
|
|
|
-- -*- ada -*-
|
1999-10-24 12:32:42 +08:00
|
|
|
define(`HTMLNAME',`terminal_interface-curses-menus__ads.htm')dnl
|
1997-05-15 12:00:00 +08:00
|
|
|
include(M4MACRO)dnl
|
|
|
|
------------------------------------------------------------------------------
|
|
|
|
-- --
|
|
|
|
-- GNAT ncurses Binding --
|
|
|
|
-- --
|
|
|
|
-- Terminal_Interface.Curses.Menu --
|
|
|
|
-- --
|
|
|
|
-- S P E C --
|
|
|
|
-- --
|
1998-03-01 12:21:12 +08:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
-- Copyright (c) 1998 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: --
|
1997-05-15 12:00:00 +08:00
|
|
|
-- --
|
1998-03-01 12:21:12 +08:00
|
|
|
-- The above copyright notice and this permission notice shall be included --
|
|
|
|
-- in all copies or substantial portions of the Software. --
|
1997-05-15 12:00:00 +08:00
|
|
|
-- --
|
1998-03-01 12:21:12 +08:00
|
|
|
-- 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. --
|
1997-05-15 12:00:00 +08:00
|
|
|
-- --
|
1998-03-01 12:21:12 +08:00
|
|
|
-- 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. --
|
1997-05-15 12:00:00 +08:00
|
|
|
------------------------------------------------------------------------------
|
2002-10-13 11:35:53 +08:00
|
|
|
-- Author: Juergen Pfeifer, 1996
|
1997-05-15 12:00:00 +08:00
|
|
|
-- Version Control:
|
2004-02-09 10:15:26 +08:00
|
|
|
-- $Revision: 1.24 $
|
1999-10-24 12:32:42 +08:00
|
|
|
-- Binding Version 01.00
|
1997-05-15 12:00:00 +08:00
|
|
|
------------------------------------------------------------------------------
|
|
|
|
include(`Menu_Base_Defs')
|
|
|
|
with System;
|
|
|
|
with Ada.Characters.Latin_1;
|
|
|
|
|
|
|
|
package Terminal_Interface.Curses.Menus is
|
1999-10-24 12:32:42 +08:00
|
|
|
pragma Preelaborate (Terminal_Interface.Curses.Menus);
|
|
|
|
include(`Menu_Linker_Options')dnl
|
|
|
|
include(`Linker_Options')
|
1997-05-15 12:00:00 +08:00
|
|
|
Space : Character renames Ada.Characters.Latin_1.Space;
|
|
|
|
|
|
|
|
type Item is private;
|
|
|
|
type Menu is private;
|
|
|
|
|
|
|
|
---------------------------
|
|
|
|
-- Interface constants --
|
|
|
|
---------------------------
|
|
|
|
Null_Item : constant Item;
|
|
|
|
Null_Menu : constant Menu;
|
|
|
|
|
|
|
|
subtype Menu_Request_Code is Key_Code
|
|
|
|
range (Key_Max + 1) .. (Key_Max + 17);
|
|
|
|
|
|
|
|
-- The prefix M_ stands for "Menu Request"
|
|
|
|
M_Left_Item : constant Menu_Request_Code := Key_Max + 1;
|
|
|
|
M_Right_Item : constant Menu_Request_Code := Key_Max + 2;
|
|
|
|
M_Up_Item : constant Menu_Request_Code := Key_Max + 3;
|
|
|
|
M_Down_Item : constant Menu_Request_Code := Key_Max + 4;
|
|
|
|
M_ScrollUp_Line : constant Menu_Request_Code := Key_Max + 5;
|
|
|
|
M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6;
|
|
|
|
M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7;
|
|
|
|
M_ScrollUp_Page : constant Menu_Request_Code := Key_Max + 8;
|
|
|
|
M_First_Item : constant Menu_Request_Code := Key_Max + 9;
|
|
|
|
M_Last_Item : constant Menu_Request_Code := Key_Max + 10;
|
|
|
|
M_Next_Item : constant Menu_Request_Code := Key_Max + 11;
|
|
|
|
M_Previous_Item : constant Menu_Request_Code := Key_Max + 12;
|
|
|
|
M_Toggle_Item : constant Menu_Request_Code := Key_Max + 13;
|
|
|
|
M_Clear_Pattern : constant Menu_Request_Code := Key_Max + 14;
|
|
|
|
M_Back_Pattern : constant Menu_Request_Code := Key_Max + 15;
|
|
|
|
M_Next_Match : constant Menu_Request_Code := Key_Max + 16;
|
|
|
|
M_Previous_Match : constant Menu_Request_Code := Key_Max + 17;
|
|
|
|
|
|
|
|
-- For those who like the old 'C' names for the request codes
|
|
|
|
REQ_LEFT_ITEM : Menu_Request_Code renames M_Left_Item;
|
|
|
|
REQ_RIGHT_ITEM : Menu_Request_Code renames M_Right_Item;
|
|
|
|
REQ_UP_ITEM : Menu_Request_Code renames M_Up_Item;
|
|
|
|
REQ_DOWN_ITEM : Menu_Request_Code renames M_Down_Item;
|
|
|
|
REQ_SCR_ULINE : Menu_Request_Code renames M_ScrollUp_Line;
|
|
|
|
REQ_SCR_DLINE : Menu_Request_Code renames M_ScrollDown_Line;
|
|
|
|
REQ_SCR_DPAGE : Menu_Request_Code renames M_ScrollDown_Page;
|
|
|
|
REQ_SCR_UPAGE : Menu_Request_Code renames M_ScrollUp_Page;
|
|
|
|
REQ_FIRST_ITEM : Menu_Request_Code renames M_First_Item;
|
|
|
|
REQ_LAST_ITEM : Menu_Request_Code renames M_Last_Item;
|
|
|
|
REQ_NEXT_ITEM : Menu_Request_Code renames M_Next_Item;
|
|
|
|
REQ_PREV_ITEM : Menu_Request_Code renames M_Previous_Item;
|
|
|
|
REQ_TOGGLE_ITEM : Menu_Request_Code renames M_Toggle_Item;
|
|
|
|
REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern;
|
|
|
|
REQ_BACK_PATTERN : Menu_Request_Code renames M_Back_Pattern;
|
|
|
|
REQ_NEXT_MATCH : Menu_Request_Code renames M_Next_Match;
|
|
|
|
REQ_PREV_MATCH : Menu_Request_Code renames M_Previous_Match;
|
|
|
|
|
|
|
|
procedure Request_Name (Key : in Menu_Request_Code;
|
|
|
|
Name : out String);
|
|
|
|
|
1998-03-01 12:21:12 +08:00
|
|
|
function Request_Name (Key : Menu_Request_Code) return String;
|
|
|
|
-- Same as function
|
|
|
|
|
1997-05-15 12:00:00 +08:00
|
|
|
------------------
|
|
|
|
-- Exceptions --
|
|
|
|
------------------
|
|
|
|
|
|
|
|
Menu_Exception : exception;
|
|
|
|
--
|
|
|
|
-- Menu options
|
|
|
|
--
|
1999-10-24 12:32:42 +08:00
|
|
|
pragma Warnings (Off);
|
|
|
|
include(`Menu_Opt_Rep')dnl
|
1997-05-15 12:00:00 +08:00
|
|
|
|
1999-10-24 12:32:42 +08:00
|
|
|
pragma Warnings (On);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
1998-03-01 12:21:12 +08:00
|
|
|
function Default_Menu_Options return Menu_Option_Set;
|
1997-05-15 12:00:00 +08:00
|
|
|
-- Initial default options for a menu.
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Default_Menu_Options);
|
1997-05-15 12:00:00 +08:00
|
|
|
--
|
|
|
|
-- Item options
|
|
|
|
--
|
1999-10-24 12:32:42 +08:00
|
|
|
pragma Warnings (Off);
|
|
|
|
include(`Item_Rep')dnl
|
|
|
|
|
|
|
|
pragma Warnings (On);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
1998-03-01 12:21:12 +08:00
|
|
|
function Default_Item_Options return Item_Option_Set;
|
1997-05-15 12:00:00 +08:00
|
|
|
-- Initial default options for an item.
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Default_Item_Options);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Item Array
|
|
|
|
--
|
|
|
|
type Item_Array is array (Positive range <>) of aliased Item;
|
|
|
|
pragma Convention (C, Item_Array);
|
|
|
|
|
1998-03-01 12:21:12 +08:00
|
|
|
type Item_Array_Access is access Item_Array;
|
|
|
|
|
|
|
|
procedure Free (IA : in out Item_Array_Access;
|
|
|
|
Free_Items : Boolean := False);
|
|
|
|
-- Release the memory for an allocated item array
|
|
|
|
-- If Free_Items is True, call Delete() for all the items in
|
|
|
|
-- the array.
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`mitem_new.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`new_item()',`Create')
|
|
|
|
function Create (Name : String;
|
|
|
|
Description : String := "") return Item;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
-- Not inlined.
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`new_item()',`New_Item')
|
|
|
|
function New_Item (Name : String;
|
|
|
|
Description : String := "") return Item
|
|
|
|
renames Create;
|
|
|
|
-- AKA
|
|
|
|
|
|
|
|
-- ANCHOR(`free_item()',`Delete')
|
|
|
|
procedure Delete (Itm : in out Item);
|
|
|
|
-- AKA
|
|
|
|
-- Resets Itm to Null_Item
|
|
|
|
|
|
|
|
-- MANPAGE(`mitem_value.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_item_value()',`Set_Value')
|
|
|
|
procedure Set_Value (Itm : in Item;
|
|
|
|
Value : in Boolean := True);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Value);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`item_value()',`Value')
|
|
|
|
function Value (Itm : Item) return Boolean;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Value);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`mitem_visible.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`item_visible()',`Visible')
|
|
|
|
function Visible (Itm : Item) return Boolean;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Visible);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`mitem_opts.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_item_opts()',`Set_Options')
|
|
|
|
procedure Set_Options (Itm : in Item;
|
|
|
|
Options : in Item_Option_Set);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
-- An overloaded Set_Options is defined later. Pragma Inline appears there
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`item_opts_on()',`Switch_Options')
|
|
|
|
procedure Switch_Options (Itm : in Item;
|
|
|
|
Options : in Item_Option_Set;
|
|
|
|
On : Boolean := True);
|
|
|
|
-- AKA
|
|
|
|
-- ALIAS(`item_opts_off()')
|
1998-03-01 12:21:12 +08:00
|
|
|
-- An overloaded Switch_Options is defined later.
|
|
|
|
-- Pragma Inline appears there
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`item_opts()',`Get_Options')
|
|
|
|
procedure Get_Options (Itm : in Item;
|
|
|
|
Options : out Item_Option_Set);
|
|
|
|
-- AKA
|
|
|
|
|
|
|
|
-- ANCHOR(`item_opts()',`Get_Options')
|
|
|
|
function Get_Options (Itm : Item := Null_Item) return Item_Option_Set;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
-- An overloaded Get_Options is defined later. Pragma Inline appears there
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`mitem_name.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`item_name()',`Name')
|
|
|
|
procedure Name (Itm : in Item;
|
|
|
|
Name : out String);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
function Name (Itm : Item) return String;
|
|
|
|
-- AKA
|
|
|
|
-- Implemented as function
|
|
|
|
pragma Inline (Name);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`item_description();',`Description')
|
|
|
|
procedure Description (Itm : in Item;
|
|
|
|
Description : out String);
|
|
|
|
-- AKA
|
|
|
|
|
1998-03-01 12:21:12 +08:00
|
|
|
function Description (Itm : Item) return String;
|
|
|
|
-- AKA
|
|
|
|
-- Implemented as function
|
|
|
|
pragma Inline (Description);
|
|
|
|
|
1997-05-15 12:00:00 +08:00
|
|
|
-- MANPAGE(`mitem_current.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_current_item()',`Set_Current')
|
|
|
|
procedure Set_Current (Men : in Menu;
|
|
|
|
Itm : in Item);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Current);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`current_item()',`Current')
|
|
|
|
function Current (Men : Menu) return Item;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Current);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`set_top_row()',`Set_Top_Row')
|
|
|
|
procedure Set_Top_Row (Men : in Menu;
|
|
|
|
Line : in Line_Position);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Top_Row);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`top_row()',`Top_Row')
|
|
|
|
function Top_Row (Men : Menu) return Line_Position;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Top_Row);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`item_index()',`Get_Index')
|
|
|
|
function Get_Index (Itm : Item) return Positive;
|
|
|
|
-- AKA
|
|
|
|
-- Please note that in this binding we start the numbering of items
|
|
|
|
-- with 1. So this is number is one more than you get from the low
|
|
|
|
-- level call.
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Get_Index);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_post.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`post_menu()',`Post')
|
|
|
|
procedure Post (Men : in Menu;
|
|
|
|
Post : in Boolean := True);
|
|
|
|
-- AKA
|
|
|
|
-- ALIAS(`unpost_menu()')
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Post);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_opts.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_opts()',`Set_Options')
|
|
|
|
procedure Set_Options (Men : in Menu;
|
|
|
|
Options : in Menu_Option_Set);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Options);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_opts_on()',`Switch_Options')
|
|
|
|
procedure Switch_Options (Men : in Menu;
|
|
|
|
Options : in Menu_Option_Set;
|
|
|
|
On : Boolean := True);
|
|
|
|
-- AKA
|
|
|
|
-- ALIAS(`menu_opts_off()')
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Switch_Options);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_opts()',`Get_Options')
|
|
|
|
procedure Get_Options (Men : in Menu;
|
|
|
|
Options : out Menu_Option_Set);
|
|
|
|
-- AKA
|
|
|
|
|
|
|
|
-- ANCHOR(`menu_opts()',`Get_Options')
|
|
|
|
function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Get_Options);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_win.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_win()',`Set_Window')
|
|
|
|
procedure Set_Window (Men : in Menu;
|
|
|
|
Win : in Window);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Window);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_win()',`Get_Window')
|
|
|
|
function Get_Window (Men : Menu) return Window;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Get_Window);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_sub()',`Set_Sub_Window')
|
|
|
|
procedure Set_Sub_Window (Men : in Menu;
|
|
|
|
Win : in Window);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Sub_Window);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_sub()',`Get_Sub_Window')
|
|
|
|
function Get_Sub_Window (Men : Menu) return Window;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Get_Sub_Window);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`scale_menu()',`Scale')
|
|
|
|
procedure Scale (Men : in Menu;
|
|
|
|
Lines : out Line_Count;
|
|
|
|
Columns : out Column_Count);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Scale);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_cursor.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`pos_menu_cursor()',`Position_Cursor')
|
|
|
|
procedure Position_Cursor (Men : Menu);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Position_Cursor);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_mark.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_mark()',`Set_Mark')
|
|
|
|
procedure Set_Mark (Men : in Menu;
|
|
|
|
Mark : in String);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Mark);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_mark()',`Mark')
|
|
|
|
procedure Mark (Men : in Menu;
|
|
|
|
Mark : out String);
|
|
|
|
-- AKA
|
|
|
|
|
1998-03-01 12:21:12 +08:00
|
|
|
function Mark (Men : Menu) return String;
|
|
|
|
-- AKA
|
|
|
|
-- Implemented as function
|
|
|
|
pragma Inline (Mark);
|
|
|
|
|
1997-05-15 12:00:00 +08:00
|
|
|
-- MANPAGE(`menu_attribs.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_fore()',`Set_Foreground')
|
|
|
|
procedure Set_Foreground
|
|
|
|
(Men : in Menu;
|
|
|
|
Fore : in Character_Attribute_Set := Normal_Video;
|
|
|
|
Color : in Color_Pair := Color_Pair'First);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Foreground);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_fore()',`Foreground')
|
|
|
|
procedure Foreground (Men : in Menu;
|
|
|
|
Fore : out Character_Attribute_Set);
|
|
|
|
-- AKA
|
|
|
|
|
|
|
|
-- ANCHOR(`menu_fore()',`Foreground')
|
|
|
|
procedure Foreground (Men : in Menu;
|
|
|
|
Fore : out Character_Attribute_Set;
|
|
|
|
Color : out Color_Pair);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Foreground);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_back()',`Set_Background')
|
|
|
|
procedure Set_Background
|
|
|
|
(Men : in Menu;
|
|
|
|
Back : in Character_Attribute_Set := Normal_Video;
|
|
|
|
Color : in Color_Pair := Color_Pair'First);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Background);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_back()',`Background')
|
|
|
|
procedure Background (Men : in Menu;
|
|
|
|
Back : out Character_Attribute_Set);
|
|
|
|
-- AKA
|
|
|
|
-- ANCHOR(`menu_back()',`Background')
|
|
|
|
|
|
|
|
procedure Background (Men : in Menu;
|
|
|
|
Back : out Character_Attribute_Set;
|
|
|
|
Color : out Color_Pair);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Background);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_grey()',`Set_Grey')
|
|
|
|
procedure Set_Grey
|
|
|
|
(Men : in Menu;
|
|
|
|
Grey : in Character_Attribute_Set := Normal_Video;
|
|
|
|
Color : in Color_Pair := Color_Pair'First);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Grey);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_grey()',`Grey')
|
|
|
|
procedure Grey (Men : in Menu;
|
|
|
|
Grey : out Character_Attribute_Set);
|
|
|
|
-- AKA
|
|
|
|
|
|
|
|
-- ANCHOR(`menu_grey()',`Grey')
|
|
|
|
procedure Grey
|
|
|
|
(Men : in Menu;
|
|
|
|
Grey : out Character_Attribute_Set;
|
|
|
|
Color : out Color_Pair);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Grey);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_pad()',`Set_Pad_Character')
|
|
|
|
procedure Set_Pad_Character (Men : in Menu;
|
|
|
|
Pad : in Character := Space);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Pad_Character);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_pad()',`Pad_Character')
|
|
|
|
procedure Pad_Character (Men : in Menu;
|
|
|
|
Pad : out Character);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Pad_Character);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_spacing.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_spacing()',`Set_Spacing')
|
|
|
|
procedure Set_Spacing (Men : in Menu;
|
|
|
|
Descr : in Column_Position := 0;
|
|
|
|
Row : in Line_Position := 0;
|
|
|
|
Col : in Column_Position := 0);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Spacing);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_spacing()',`Spacing')
|
|
|
|
procedure Spacing (Men : in Menu;
|
|
|
|
Descr : out Column_Position;
|
|
|
|
Row : out Line_Position;
|
|
|
|
Col : out Column_Position);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Spacing);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_pattern.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_pattern()',`Set_Pattern')
|
|
|
|
function Set_Pattern (Men : Menu;
|
|
|
|
Text : String) return Boolean;
|
|
|
|
-- AKA
|
|
|
|
-- Return TRUE if the pattern matches, FALSE otherwise
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Pattern);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_pattern()',`Pattern')
|
|
|
|
procedure Pattern (Men : in Menu;
|
|
|
|
Text : out String);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Pattern);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_format.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_format()',`Set_Format')
|
|
|
|
procedure Set_Format (Men : in Menu;
|
|
|
|
Lines : in Line_Count;
|
|
|
|
Columns : in Column_Count);
|
2002-10-13 11:35:53 +08:00
|
|
|
-- Not implemented: 0 argument for Lines or Columns;
|
|
|
|
-- instead use Format to get the current sizes
|
|
|
|
-- The default format is 16 rows, 1 column. Calling
|
|
|
|
-- set_menu_format with a null menu pointer will change this
|
|
|
|
-- default. A zero row or column argument to set_menu_format
|
|
|
|
-- is interpreted as a request not to change the current
|
|
|
|
-- value.
|
1997-05-15 12:00:00 +08:00
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Format);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_format()',`Format')
|
|
|
|
procedure Format (Men : in Menu;
|
|
|
|
Lines : out Line_Count;
|
|
|
|
Columns : out Column_Count);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Format);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_hook.3x')
|
|
|
|
|
|
|
|
type Menu_Hook_Function is access procedure (Men : in Menu);
|
|
|
|
pragma Convention (C, Menu_Hook_Function);
|
|
|
|
|
|
|
|
-- ANCHOR(`set_item_init()',`Set_Item_Init_Hook')
|
|
|
|
procedure Set_Item_Init_Hook (Men : in Menu;
|
|
|
|
Proc : in Menu_Hook_Function);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Item_Init_Hook);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`set_item_term()',`Set_Item_Term_Hook')
|
|
|
|
procedure Set_Item_Term_Hook (Men : in Menu;
|
|
|
|
Proc : in Menu_Hook_Function);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Item_Term_Hook);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_init()',`Set_Menu_Init_Hook')
|
|
|
|
procedure Set_Menu_Init_Hook (Men : in Menu;
|
|
|
|
Proc : in Menu_Hook_Function);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Menu_Init_Hook);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_term()',`Set_Menu_Term_Hook')
|
|
|
|
procedure Set_Menu_Term_Hook (Men : in Menu;
|
|
|
|
Proc : in Menu_Hook_Function);
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Set_Menu_Term_Hook);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`item_init()',`Get_Item_Init_Hook')
|
|
|
|
function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Get_Item_Init_Hook);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`item_term()',`Get_Item_Term_Hook')
|
|
|
|
function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Get_Item_Term_Hook);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_init()',`Get_Menu_Init_Hook')
|
|
|
|
function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Get_Menu_Init_Hook);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_term()',`Get_Menu_Term_Hook')
|
|
|
|
function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Get_Menu_Term_Hook);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_items.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`set_menu_items()',`Redefine')
|
|
|
|
procedure Redefine (Men : in Menu;
|
1998-03-01 12:21:12 +08:00
|
|
|
Items : in Item_Array_Access);
|
1997-05-15 12:00:00 +08:00
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Redefine);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
procedure Set_Items (Men : in Menu;
|
1998-03-01 12:21:12 +08:00
|
|
|
Items : in Item_Array_Access) renames Redefine;
|
|
|
|
pragma Inline (Set_Items);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`menu_items()',`Items')
|
1998-03-01 12:21:12 +08:00
|
|
|
function Items (Men : Menu;
|
|
|
|
Index : Positive) return Item;
|
1997-05-15 12:00:00 +08:00
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Items);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`item_count()',`Item_Count')
|
|
|
|
function Item_Count (Men : Menu) return Natural;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
pragma Inline (Item_Count);
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- MANPAGE(`menu_new.3x')
|
|
|
|
|
|
|
|
-- ANCHOR(`new_menu()',`Create')
|
1998-03-01 12:21:12 +08:00
|
|
|
function Create (Items : Item_Array_Access) return Menu;
|
1997-05-15 12:00:00 +08:00
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
-- Not inlined
|
1997-05-15 12:00:00 +08:00
|
|
|
|
1998-03-01 12:21:12 +08:00
|
|
|
function New_Menu (Items : Item_Array_Access) return Menu renames Create;
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
-- ANCHOR(`free_menu()',`Delete')
|
|
|
|
procedure Delete (Men : in out Menu);
|
|
|
|
-- AKA
|
|
|
|
-- Reset Men to Null_Menu
|
1998-03-01 12:21:12 +08:00
|
|
|
-- Not inlined
|
1997-05-15 12:00:00 +08:00
|
|
|
|
2002-10-13 11:35:53 +08:00
|
|
|
-- MANPAGE(`menu_driver.3x')
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
type Driver_Result is (Menu_Ok,
|
|
|
|
Request_Denied,
|
|
|
|
Unknown_Request,
|
|
|
|
No_Match);
|
|
|
|
|
|
|
|
-- ANCHOR(`menu_driver()',`Driver')
|
|
|
|
function Driver (Men : Menu;
|
|
|
|
Key : Key_Code) return Driver_Result;
|
|
|
|
-- AKA
|
1998-03-01 12:21:12 +08:00
|
|
|
-- Driver is not inlined
|
1997-05-15 12:00:00 +08:00
|
|
|
|
2002-10-13 11:35:53 +08:00
|
|
|
-- ANCHOR(`menu_requestname.3x')
|
|
|
|
-- Not Implemented: menu_request_name, menu_request_by_name
|
1997-05-15 12:00:00 +08:00
|
|
|
-------------------------------------------------------------------------------
|
|
|
|
private
|
1999-10-24 12:32:42 +08:00
|
|
|
type Item is new System.Storage_Elements.Integer_Address;
|
|
|
|
type Menu is new System.Storage_Elements.Integer_Address;
|
1997-05-15 12:00:00 +08:00
|
|
|
|
1999-10-24 12:32:42 +08:00
|
|
|
Null_Item : constant Item := 0;
|
|
|
|
Null_Menu : constant Menu := 0;
|
1997-05-15 12:00:00 +08:00
|
|
|
|
|
|
|
end Terminal_Interface.Curses.Menus;
|