terminal_interface-curses-menus.ads.m4 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. -- -*- ada -*-
  2. define(`HTMLNAME',`terminal_interface-curses-menus__ads.htm')dnl
  3. include(M4MACRO)dnl
  4. ------------------------------------------------------------------------------
  5. -- --
  6. -- GNAT ncurses Binding --
  7. -- --
  8. -- Terminal_Interface.Curses.Menu --
  9. -- --
  10. -- S P E C --
  11. -- --
  12. ------------------------------------------------------------------------------
  13. -- Copyright (c) 1998,2006 Free Software Foundation, Inc. --
  14. -- --
  15. -- Permission is hereby granted, free of charge, to any person obtaining a --
  16. -- copy of this software and associated documentation files (the --
  17. -- "Software"), to deal in the Software without restriction, including --
  18. -- without limitation the rights to use, copy, modify, merge, publish, --
  19. -- distribute, distribute with modifications, sublicense, and/or sell --
  20. -- copies of the Software, and to permit persons to whom the Software is --
  21. -- furnished to do so, subject to the following conditions: --
  22. -- --
  23. -- The above copyright notice and this permission notice shall be included --
  24. -- in all copies or substantial portions of the Software. --
  25. -- --
  26. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
  27. -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
  28. -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
  29. -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
  30. -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
  31. -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
  32. -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
  33. -- --
  34. -- Except as contained in this notice, the name(s) of the above copyright --
  35. -- holders shall not be used in advertising or otherwise to promote the --
  36. -- sale, use or other dealings in this Software without prior written --
  37. -- authorization. --
  38. ------------------------------------------------------------------------------
  39. -- Author: Juergen Pfeifer, 1996
  40. -- Version Control:
  41. -- $Revision: 1.27 $
  42. -- $Date: 2007/05/05 20:20:52 $
  43. -- Binding Version 01.00
  44. ------------------------------------------------------------------------------
  45. include(`Menu_Base_Defs')
  46. with System;
  47. with Ada.Characters.Latin_1;
  48. package Terminal_Interface.Curses.Menus is
  49. pragma Preelaborate (Terminal_Interface.Curses.Menus);
  50. include(`Menu_Linker_Options')dnl
  51. include(`Linker_Options')
  52. Space : Character renames Ada.Characters.Latin_1.Space;
  53. type Item is private;
  54. type Menu is private;
  55. ---------------------------
  56. -- Interface constants --
  57. ---------------------------
  58. Null_Item : constant Item;
  59. Null_Menu : constant Menu;
  60. subtype Menu_Request_Code is Key_Code
  61. range (Key_Max + 1) .. (Key_Max + 17);
  62. -- The prefix M_ stands for "Menu Request"
  63. M_Left_Item : constant Menu_Request_Code := Key_Max + 1;
  64. M_Right_Item : constant Menu_Request_Code := Key_Max + 2;
  65. M_Up_Item : constant Menu_Request_Code := Key_Max + 3;
  66. M_Down_Item : constant Menu_Request_Code := Key_Max + 4;
  67. M_ScrollUp_Line : constant Menu_Request_Code := Key_Max + 5;
  68. M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6;
  69. M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7;
  70. M_ScrollUp_Page : constant Menu_Request_Code := Key_Max + 8;
  71. M_First_Item : constant Menu_Request_Code := Key_Max + 9;
  72. M_Last_Item : constant Menu_Request_Code := Key_Max + 10;
  73. M_Next_Item : constant Menu_Request_Code := Key_Max + 11;
  74. M_Previous_Item : constant Menu_Request_Code := Key_Max + 12;
  75. M_Toggle_Item : constant Menu_Request_Code := Key_Max + 13;
  76. M_Clear_Pattern : constant Menu_Request_Code := Key_Max + 14;
  77. M_Back_Pattern : constant Menu_Request_Code := Key_Max + 15;
  78. M_Next_Match : constant Menu_Request_Code := Key_Max + 16;
  79. M_Previous_Match : constant Menu_Request_Code := Key_Max + 17;
  80. -- For those who like the old 'C' names for the request codes
  81. REQ_LEFT_ITEM : Menu_Request_Code renames M_Left_Item;
  82. REQ_RIGHT_ITEM : Menu_Request_Code renames M_Right_Item;
  83. REQ_UP_ITEM : Menu_Request_Code renames M_Up_Item;
  84. REQ_DOWN_ITEM : Menu_Request_Code renames M_Down_Item;
  85. REQ_SCR_ULINE : Menu_Request_Code renames M_ScrollUp_Line;
  86. REQ_SCR_DLINE : Menu_Request_Code renames M_ScrollDown_Line;
  87. REQ_SCR_DPAGE : Menu_Request_Code renames M_ScrollDown_Page;
  88. REQ_SCR_UPAGE : Menu_Request_Code renames M_ScrollUp_Page;
  89. REQ_FIRST_ITEM : Menu_Request_Code renames M_First_Item;
  90. REQ_LAST_ITEM : Menu_Request_Code renames M_Last_Item;
  91. REQ_NEXT_ITEM : Menu_Request_Code renames M_Next_Item;
  92. REQ_PREV_ITEM : Menu_Request_Code renames M_Previous_Item;
  93. REQ_TOGGLE_ITEM : Menu_Request_Code renames M_Toggle_Item;
  94. REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern;
  95. REQ_BACK_PATTERN : Menu_Request_Code renames M_Back_Pattern;
  96. REQ_NEXT_MATCH : Menu_Request_Code renames M_Next_Match;
  97. REQ_PREV_MATCH : Menu_Request_Code renames M_Previous_Match;
  98. procedure Request_Name (Key : in Menu_Request_Code;
  99. Name : out String);
  100. function Request_Name (Key : Menu_Request_Code) return String;
  101. -- Same as function
  102. ------------------
  103. -- Exceptions --
  104. ------------------
  105. Menu_Exception : exception;
  106. --
  107. -- Menu options
  108. --
  109. pragma Warnings (Off);
  110. include(`Menu_Opt_Rep')dnl
  111. pragma Warnings (On);
  112. function Default_Menu_Options return Menu_Option_Set;
  113. -- Initial default options for a menu.
  114. pragma Inline (Default_Menu_Options);
  115. --
  116. -- Item options
  117. --
  118. pragma Warnings (Off);
  119. include(`Item_Rep')dnl
  120. pragma Warnings (On);
  121. function Default_Item_Options return Item_Option_Set;
  122. -- Initial default options for an item.
  123. pragma Inline (Default_Item_Options);
  124. --
  125. -- Item Array
  126. --
  127. type Item_Array is array (Positive range <>) of aliased Item;
  128. pragma Convention (C, Item_Array);
  129. type Item_Array_Access is access Item_Array;
  130. procedure Free (IA : in out Item_Array_Access;
  131. Free_Items : Boolean := False);
  132. -- Release the memory for an allocated item array
  133. -- If Free_Items is True, call Delete() for all the items in
  134. -- the array.
  135. -- MANPAGE(`mitem_new.3x')
  136. -- ANCHOR(`new_item()',`Create')
  137. function Create (Name : String;
  138. Description : String := "") return Item;
  139. -- AKA
  140. -- Not inlined.
  141. -- ANCHOR(`new_item()',`New_Item')
  142. function New_Item (Name : String;
  143. Description : String := "") return Item
  144. renames Create;
  145. -- AKA
  146. -- ANCHOR(`free_item()',`Delete')
  147. procedure Delete (Itm : in out Item);
  148. -- AKA
  149. -- Resets Itm to Null_Item
  150. -- MANPAGE(`mitem_value.3x')
  151. -- ANCHOR(`set_item_value()',`Set_Value')
  152. procedure Set_Value (Itm : in Item;
  153. Value : in Boolean := True);
  154. -- AKA
  155. pragma Inline (Set_Value);
  156. -- ANCHOR(`item_value()',`Value')
  157. function Value (Itm : Item) return Boolean;
  158. -- AKA
  159. pragma Inline (Value);
  160. -- MANPAGE(`mitem_visible.3x')
  161. -- ANCHOR(`item_visible()',`Visible')
  162. function Visible (Itm : Item) return Boolean;
  163. -- AKA
  164. pragma Inline (Visible);
  165. -- MANPAGE(`mitem_opts.3x')
  166. -- ANCHOR(`set_item_opts()',`Set_Options')
  167. procedure Set_Options (Itm : in Item;
  168. Options : in Item_Option_Set);
  169. -- AKA
  170. -- An overloaded Set_Options is defined later. Pragma Inline appears there
  171. -- ANCHOR(`item_opts_on()',`Switch_Options')
  172. procedure Switch_Options (Itm : in Item;
  173. Options : in Item_Option_Set;
  174. On : Boolean := True);
  175. -- AKA
  176. -- ALIAS(`item_opts_off()')
  177. -- An overloaded Switch_Options is defined later.
  178. -- Pragma Inline appears there
  179. -- ANCHOR(`item_opts()',`Get_Options')
  180. procedure Get_Options (Itm : in Item;
  181. Options : out Item_Option_Set);
  182. -- AKA
  183. -- ANCHOR(`item_opts()',`Get_Options')
  184. function Get_Options (Itm : Item := Null_Item) return Item_Option_Set;
  185. -- AKA
  186. -- An overloaded Get_Options is defined later. Pragma Inline appears there
  187. -- MANPAGE(`mitem_name.3x')
  188. -- ANCHOR(`item_name()',`Name')
  189. procedure Name (Itm : in Item;
  190. Name : out String);
  191. -- AKA
  192. function Name (Itm : Item) return String;
  193. -- AKA
  194. -- Implemented as function
  195. pragma Inline (Name);
  196. -- ANCHOR(`item_description();',`Description')
  197. procedure Description (Itm : in Item;
  198. Description : out String);
  199. -- AKA
  200. function Description (Itm : Item) return String;
  201. -- AKA
  202. -- Implemented as function
  203. pragma Inline (Description);
  204. -- MANPAGE(`mitem_current.3x')
  205. -- ANCHOR(`set_current_item()',`Set_Current')
  206. procedure Set_Current (Men : in Menu;
  207. Itm : in Item);
  208. -- AKA
  209. pragma Inline (Set_Current);
  210. -- ANCHOR(`current_item()',`Current')
  211. function Current (Men : Menu) return Item;
  212. -- AKA
  213. pragma Inline (Current);
  214. -- ANCHOR(`set_top_row()',`Set_Top_Row')
  215. procedure Set_Top_Row (Men : in Menu;
  216. Line : in Line_Position);
  217. -- AKA
  218. pragma Inline (Set_Top_Row);
  219. -- ANCHOR(`top_row()',`Top_Row')
  220. function Top_Row (Men : Menu) return Line_Position;
  221. -- AKA
  222. pragma Inline (Top_Row);
  223. -- ANCHOR(`item_index()',`Get_Index')
  224. function Get_Index (Itm : Item) return Positive;
  225. -- AKA
  226. -- Please note that in this binding we start the numbering of items
  227. -- with 1. So this is number is one more than you get from the low
  228. -- level call.
  229. pragma Inline (Get_Index);
  230. -- MANPAGE(`menu_post.3x')
  231. -- ANCHOR(`post_menu()',`Post')
  232. procedure Post (Men : in Menu;
  233. Post : in Boolean := True);
  234. -- AKA
  235. -- ALIAS(`unpost_menu()')
  236. pragma Inline (Post);
  237. -- MANPAGE(`menu_opts.3x')
  238. -- ANCHOR(`set_menu_opts()',`Set_Options')
  239. procedure Set_Options (Men : in Menu;
  240. Options : in Menu_Option_Set);
  241. -- AKA
  242. pragma Inline (Set_Options);
  243. -- ANCHOR(`menu_opts_on()',`Switch_Options')
  244. procedure Switch_Options (Men : in Menu;
  245. Options : in Menu_Option_Set;
  246. On : Boolean := True);
  247. -- AKA
  248. -- ALIAS(`menu_opts_off()')
  249. pragma Inline (Switch_Options);
  250. -- ANCHOR(`menu_opts()',`Get_Options')
  251. procedure Get_Options (Men : in Menu;
  252. Options : out Menu_Option_Set);
  253. -- AKA
  254. -- ANCHOR(`menu_opts()',`Get_Options')
  255. function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set;
  256. -- AKA
  257. pragma Inline (Get_Options);
  258. -- MANPAGE(`menu_win.3x')
  259. -- ANCHOR(`set_menu_win()',`Set_Window')
  260. procedure Set_Window (Men : in Menu;
  261. Win : in Window);
  262. -- AKA
  263. pragma Inline (Set_Window);
  264. -- ANCHOR(`menu_win()',`Get_Window')
  265. function Get_Window (Men : Menu) return Window;
  266. -- AKA
  267. pragma Inline (Get_Window);
  268. -- ANCHOR(`set_menu_sub()',`Set_Sub_Window')
  269. procedure Set_Sub_Window (Men : in Menu;
  270. Win : in Window);
  271. -- AKA
  272. pragma Inline (Set_Sub_Window);
  273. -- ANCHOR(`menu_sub()',`Get_Sub_Window')
  274. function Get_Sub_Window (Men : Menu) return Window;
  275. -- AKA
  276. pragma Inline (Get_Sub_Window);
  277. -- ANCHOR(`scale_menu()',`Scale')
  278. procedure Scale (Men : in Menu;
  279. Lines : out Line_Count;
  280. Columns : out Column_Count);
  281. -- AKA
  282. pragma Inline (Scale);
  283. -- MANPAGE(`menu_cursor.3x')
  284. -- ANCHOR(`pos_menu_cursor()',`Position_Cursor')
  285. procedure Position_Cursor (Men : Menu);
  286. -- AKA
  287. pragma Inline (Position_Cursor);
  288. -- MANPAGE(`menu_mark.3x')
  289. -- ANCHOR(`set_menu_mark()',`Set_Mark')
  290. procedure Set_Mark (Men : in Menu;
  291. Mark : in String);
  292. -- AKA
  293. pragma Inline (Set_Mark);
  294. -- ANCHOR(`menu_mark()',`Mark')
  295. procedure Mark (Men : in Menu;
  296. Mark : out String);
  297. -- AKA
  298. function Mark (Men : Menu) return String;
  299. -- AKA
  300. -- Implemented as function
  301. pragma Inline (Mark);
  302. -- MANPAGE(`menu_attributes.3x')
  303. -- ANCHOR(`set_menu_fore()',`Set_Foreground')
  304. procedure Set_Foreground
  305. (Men : in Menu;
  306. Fore : in Character_Attribute_Set := Normal_Video;
  307. Color : in Color_Pair := Color_Pair'First);
  308. -- AKA
  309. pragma Inline (Set_Foreground);
  310. -- ANCHOR(`menu_fore()',`Foreground')
  311. procedure Foreground (Men : in Menu;
  312. Fore : out Character_Attribute_Set);
  313. -- AKA
  314. -- ANCHOR(`menu_fore()',`Foreground')
  315. procedure Foreground (Men : in Menu;
  316. Fore : out Character_Attribute_Set;
  317. Color : out Color_Pair);
  318. -- AKA
  319. pragma Inline (Foreground);
  320. -- ANCHOR(`set_menu_back()',`Set_Background')
  321. procedure Set_Background
  322. (Men : in Menu;
  323. Back : in Character_Attribute_Set := Normal_Video;
  324. Color : in Color_Pair := Color_Pair'First);
  325. -- AKA
  326. pragma Inline (Set_Background);
  327. -- ANCHOR(`menu_back()',`Background')
  328. procedure Background (Men : in Menu;
  329. Back : out Character_Attribute_Set);
  330. -- AKA
  331. -- ANCHOR(`menu_back()',`Background')
  332. procedure Background (Men : in Menu;
  333. Back : out Character_Attribute_Set;
  334. Color : out Color_Pair);
  335. -- AKA
  336. pragma Inline (Background);
  337. -- ANCHOR(`set_menu_grey()',`Set_Grey')
  338. procedure Set_Grey
  339. (Men : in Menu;
  340. Grey : in Character_Attribute_Set := Normal_Video;
  341. Color : in Color_Pair := Color_Pair'First);
  342. -- AKA
  343. pragma Inline (Set_Grey);
  344. -- ANCHOR(`menu_grey()',`Grey')
  345. procedure Grey (Men : in Menu;
  346. Grey : out Character_Attribute_Set);
  347. -- AKA
  348. -- ANCHOR(`menu_grey()',`Grey')
  349. procedure Grey
  350. (Men : in Menu;
  351. Grey : out Character_Attribute_Set;
  352. Color : out Color_Pair);
  353. -- AKA
  354. pragma Inline (Grey);
  355. -- ANCHOR(`set_menu_pad()',`Set_Pad_Character')
  356. procedure Set_Pad_Character (Men : in Menu;
  357. Pad : in Character := Space);
  358. -- AKA
  359. pragma Inline (Set_Pad_Character);
  360. -- ANCHOR(`menu_pad()',`Pad_Character')
  361. procedure Pad_Character (Men : in Menu;
  362. Pad : out Character);
  363. -- AKA
  364. pragma Inline (Pad_Character);
  365. -- MANPAGE(`menu_spacing.3x')
  366. -- ANCHOR(`set_menu_spacing()',`Set_Spacing')
  367. procedure Set_Spacing (Men : in Menu;
  368. Descr : in Column_Position := 0;
  369. Row : in Line_Position := 0;
  370. Col : in Column_Position := 0);
  371. -- AKA
  372. pragma Inline (Set_Spacing);
  373. -- ANCHOR(`menu_spacing()',`Spacing')
  374. procedure Spacing (Men : in Menu;
  375. Descr : out Column_Position;
  376. Row : out Line_Position;
  377. Col : out Column_Position);
  378. -- AKA
  379. pragma Inline (Spacing);
  380. -- MANPAGE(`menu_pattern.3x')
  381. -- ANCHOR(`set_menu_pattern()',`Set_Pattern')
  382. function Set_Pattern (Men : Menu;
  383. Text : String) return Boolean;
  384. -- AKA
  385. -- Return TRUE if the pattern matches, FALSE otherwise
  386. pragma Inline (Set_Pattern);
  387. -- ANCHOR(`menu_pattern()',`Pattern')
  388. procedure Pattern (Men : in Menu;
  389. Text : out String);
  390. -- AKA
  391. pragma Inline (Pattern);
  392. -- MANPAGE(`menu_format.3x')
  393. -- ANCHOR(`set_menu_format()',`Set_Format')
  394. procedure Set_Format (Men : in Menu;
  395. Lines : in Line_Count;
  396. Columns : in Column_Count);
  397. -- Not implemented: 0 argument for Lines or Columns;
  398. -- instead use Format to get the current sizes
  399. -- The default format is 16 rows, 1 column. Calling
  400. -- set_menu_format with a null menu pointer will change this
  401. -- default. A zero row or column argument to set_menu_format
  402. -- is interpreted as a request not to change the current
  403. -- value.
  404. -- AKA
  405. pragma Inline (Set_Format);
  406. -- ANCHOR(`menu_format()',`Format')
  407. procedure Format (Men : in Menu;
  408. Lines : out Line_Count;
  409. Columns : out Column_Count);
  410. -- AKA
  411. pragma Inline (Format);
  412. -- MANPAGE(`menu_hook.3x')
  413. type Menu_Hook_Function is access procedure (Men : in Menu);
  414. pragma Convention (C, Menu_Hook_Function);
  415. -- ANCHOR(`set_item_init()',`Set_Item_Init_Hook')
  416. procedure Set_Item_Init_Hook (Men : in Menu;
  417. Proc : in Menu_Hook_Function);
  418. -- AKA
  419. pragma Inline (Set_Item_Init_Hook);
  420. -- ANCHOR(`set_item_term()',`Set_Item_Term_Hook')
  421. procedure Set_Item_Term_Hook (Men : in Menu;
  422. Proc : in Menu_Hook_Function);
  423. -- AKA
  424. pragma Inline (Set_Item_Term_Hook);
  425. -- ANCHOR(`set_menu_init()',`Set_Menu_Init_Hook')
  426. procedure Set_Menu_Init_Hook (Men : in Menu;
  427. Proc : in Menu_Hook_Function);
  428. -- AKA
  429. pragma Inline (Set_Menu_Init_Hook);
  430. -- ANCHOR(`set_menu_term()',`Set_Menu_Term_Hook')
  431. procedure Set_Menu_Term_Hook (Men : in Menu;
  432. Proc : in Menu_Hook_Function);
  433. -- AKA
  434. pragma Inline (Set_Menu_Term_Hook);
  435. -- ANCHOR(`item_init()',`Get_Item_Init_Hook')
  436. function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function;
  437. -- AKA
  438. pragma Inline (Get_Item_Init_Hook);
  439. -- ANCHOR(`item_term()',`Get_Item_Term_Hook')
  440. function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function;
  441. -- AKA
  442. pragma Inline (Get_Item_Term_Hook);
  443. -- ANCHOR(`menu_init()',`Get_Menu_Init_Hook')
  444. function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function;
  445. -- AKA
  446. pragma Inline (Get_Menu_Init_Hook);
  447. -- ANCHOR(`menu_term()',`Get_Menu_Term_Hook')
  448. function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function;
  449. -- AKA
  450. pragma Inline (Get_Menu_Term_Hook);
  451. -- MANPAGE(`menu_items.3x')
  452. -- ANCHOR(`set_menu_items()',`Redefine')
  453. procedure Redefine (Men : in Menu;
  454. Items : in Item_Array_Access);
  455. -- AKA
  456. pragma Inline (Redefine);
  457. procedure Set_Items (Men : in Menu;
  458. Items : in Item_Array_Access) renames Redefine;
  459. -- pragma Inline (Set_Items);
  460. -- ANCHOR(`menu_items()',`Items')
  461. function Items (Men : Menu;
  462. Index : Positive) return Item;
  463. -- AKA
  464. pragma Inline (Items);
  465. -- ANCHOR(`item_count()',`Item_Count')
  466. function Item_Count (Men : Menu) return Natural;
  467. -- AKA
  468. pragma Inline (Item_Count);
  469. -- MANPAGE(`menu_new.3x')
  470. -- ANCHOR(`new_menu()',`Create')
  471. function Create (Items : Item_Array_Access) return Menu;
  472. -- AKA
  473. -- Not inlined
  474. function New_Menu (Items : Item_Array_Access) return Menu renames Create;
  475. -- ANCHOR(`free_menu()',`Delete')
  476. procedure Delete (Men : in out Menu);
  477. -- AKA
  478. -- Reset Men to Null_Menu
  479. -- Not inlined
  480. -- MANPAGE(`menu_driver.3x')
  481. type Driver_Result is (Menu_Ok,
  482. Request_Denied,
  483. Unknown_Request,
  484. No_Match);
  485. -- ANCHOR(`menu_driver()',`Driver')
  486. function Driver (Men : Menu;
  487. Key : Key_Code) return Driver_Result;
  488. -- AKA
  489. -- Driver is not inlined
  490. -- ANCHOR(`menu_requestname.3x')
  491. -- Not Implemented: menu_request_name, menu_request_by_name
  492. -------------------------------------------------------------------------------
  493. private
  494. type Item is new System.Storage_Elements.Integer_Address;
  495. type Menu is new System.Storage_Elements.Integer_Address;
  496. Null_Item : constant Item := 0;
  497. Null_Menu : constant Menu := 0;
  498. end Terminal_Interface.Curses.Menus;