]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/gen/terminal_interface-curses-forms.ads.m4
840c5f185810e85fd8d81c7ff1b95f6f4cc12652
[ncurses.git] / Ada95 / gen / terminal_interface-curses-forms.ads.m4
1 --  -*- ada -*-
2 define(`HTMLNAME',`terminal_interface-curses-forms__ads.htm')dnl
3 include(M4MACRO)dnl
4 ------------------------------------------------------------------------------
5 --                                                                          --
6 --                           GNAT ncurses Binding                           --
7 --                                                                          --
8 --                      Terminal_Interface.Curses.Form                      --
9 --                                                                          --
10 --                                 S P E C                                  --
11 --                                                                          --
12 ------------------------------------------------------------------------------
13 -- Copyright (c) 1998 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 <juergen.pfeifer@gmx.net> 1996
40 --  Version Control:
41 --  $Revision: 1.23 $
42 --  Binding Version 01.00
43 ------------------------------------------------------------------------------
44 include(`Form_Base_Defs')
45 with System;
46 with Ada.Characters.Latin_1;
47 with Interfaces.C;
48
49 package Terminal_Interface.Curses.Forms is
50    pragma Preelaborate (Terminal_Interface.Curses.Forms);
51 include(`Form_Linker_Options')dnl
52 include(`Linker_Options')
53    Space : Character renames Ada.Characters.Latin_1.Space;
54
55    type Field        is private;
56    type Form         is private;
57
58    Null_Field        : constant Field;
59    Null_Form         : constant Form;
60
61    type Field_Justification is (None,
62                                 Left,
63                                 Center,
64                                 Right);
65
66    pragma Warnings (Off);
67 include(`Field_Rep')Dnl
68
69    pragma Warnings (On);
70
71    function Default_Field_Options return Field_Option_Set;
72    --  The initial defaults for the field options.
73    pragma Inline (Default_Field_Options);
74
75    pragma Warnings (Off);
76 include(`Form_Opt_Rep')Dnl
77
78    pragma Warnings (On);
79
80    function Default_Form_Options return Form_Option_Set;
81    --  The initial defaults for the form options.
82    pragma Inline (Default_Form_Options);
83
84    type Buffer_Number is new Natural;
85
86    type Field_Array is array (Positive range <>) of aliased Field;
87    pragma Convention (C, Field_Array);
88
89    type Field_Array_Access is access Field_Array;
90
91    procedure Free (FA          : in out Field_Array_Access;
92                    Free_Fields : in Boolean := False);
93    --  Release the memory for an allocated field array
94    --  If Free_Fields is True, call Delete() for all the fields in
95    --  the array.
96
97    subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57);
98
99    --  The prefix F_ stands for "Form Request"
100    F_Next_Page                : constant Form_Request_Code := Key_Max + 1;
101    F_Previous_Page            : constant Form_Request_Code := Key_Max + 2;
102    F_First_Page               : constant Form_Request_Code := Key_Max + 3;
103    F_Last_Page                : constant Form_Request_Code := Key_Max + 4;
104
105    F_Next_Field               : constant Form_Request_Code := Key_Max + 5;
106    F_Previous_Field           : constant Form_Request_Code := Key_Max + 6;
107    F_First_Field              : constant Form_Request_Code := Key_Max + 7;
108    F_Last_Field               : constant Form_Request_Code := Key_Max + 8;
109    F_Sorted_Next_Field        : constant Form_Request_Code := Key_Max + 9;
110    F_Sorted_Previous_Field    : constant Form_Request_Code := Key_Max + 10;
111    F_Sorted_First_Field       : constant Form_Request_Code := Key_Max + 11;
112    F_Sorted_Last_Field        : constant Form_Request_Code := Key_Max + 12;
113    F_Left_Field               : constant Form_Request_Code := Key_Max + 13;
114    F_Right_Field              : constant Form_Request_Code := Key_Max + 14;
115    F_Up_Field                 : constant Form_Request_Code := Key_Max + 15;
116    F_Down_Field               : constant Form_Request_Code := Key_Max + 16;
117
118    F_Next_Char                : constant Form_Request_Code := Key_Max + 17;
119    F_Previous_Char            : constant Form_Request_Code := Key_Max + 18;
120    F_Next_Line                : constant Form_Request_Code := Key_Max + 19;
121    F_Previous_Line            : constant Form_Request_Code := Key_Max + 20;
122    F_Next_Word                : constant Form_Request_Code := Key_Max + 21;
123    F_Previous_Word            : constant Form_Request_Code := Key_Max + 22;
124    F_Begin_Field              : constant Form_Request_Code := Key_Max + 23;
125    F_End_Field                : constant Form_Request_Code := Key_Max + 24;
126    F_Begin_Line               : constant Form_Request_Code := Key_Max + 25;
127    F_End_Line                 : constant Form_Request_Code := Key_Max + 26;
128    F_Left_Char                : constant Form_Request_Code := Key_Max + 27;
129    F_Right_Char               : constant Form_Request_Code := Key_Max + 28;
130    F_Up_Char                  : constant Form_Request_Code := Key_Max + 29;
131    F_Down_Char                : constant Form_Request_Code := Key_Max + 30;
132
133    F_New_Line                 : constant Form_Request_Code := Key_Max + 31;
134    F_Insert_Char              : constant Form_Request_Code := Key_Max + 32;
135    F_Insert_Line              : constant Form_Request_Code := Key_Max + 33;
136    F_Delete_Char              : constant Form_Request_Code := Key_Max + 34;
137    F_Delete_Previous          : constant Form_Request_Code := Key_Max + 35;
138    F_Delete_Line              : constant Form_Request_Code := Key_Max + 36;
139    F_Delete_Word              : constant Form_Request_Code := Key_Max + 37;
140    F_Clear_EOL                : constant Form_Request_Code := Key_Max + 38;
141    F_Clear_EOF                : constant Form_Request_Code := Key_Max + 39;
142    F_Clear_Field              : constant Form_Request_Code := Key_Max + 40;
143    F_Overlay_Mode             : constant Form_Request_Code := Key_Max + 41;
144    F_Insert_Mode              : constant Form_Request_Code := Key_Max + 42;
145
146    --  Vertical Scrolling
147    F_ScrollForward_Line       : constant Form_Request_Code := Key_Max + 43;
148    F_ScrollBackward_Line      : constant Form_Request_Code := Key_Max + 44;
149    F_ScrollForward_Page       : constant Form_Request_Code := Key_Max + 45;
150    F_ScrollBackward_Page      : constant Form_Request_Code := Key_Max + 46;
151    F_ScrollForward_HalfPage   : constant Form_Request_Code := Key_Max + 47;
152    F_ScrollBackward_HalfPage  : constant Form_Request_Code := Key_Max + 48;
153
154    --  Horizontal Scrolling
155    F_HScrollForward_Char      : constant Form_Request_Code := Key_Max + 49;
156    F_HScrollBackward_Char     : constant Form_Request_Code := Key_Max + 50;
157    F_HScrollForward_Line      : constant Form_Request_Code := Key_Max + 51;
158    F_HScrollBackward_Line     : constant Form_Request_Code := Key_Max + 52;
159    F_HScrollForward_HalfLine  : constant Form_Request_Code := Key_Max + 53;
160    F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54;
161
162    F_Validate_Field           : constant Form_Request_Code := Key_Max + 55;
163    F_Next_Choice              : constant Form_Request_Code := Key_Max + 56;
164    F_Previous_Choice          : constant Form_Request_Code := Key_Max + 57;
165
166    --  For those who like the old 'C' style request names
167    REQ_NEXT_PAGE    : Form_Request_Code renames F_Next_Page;
168    REQ_PREV_PAGE    : Form_Request_Code renames F_Previous_Page;
169    REQ_FIRST_PAGE   : Form_Request_Code renames F_First_Page;
170    REQ_LAST_PAGE    : Form_Request_Code renames F_Last_Page;
171
172    REQ_NEXT_FIELD   : Form_Request_Code renames F_Next_Field;
173    REQ_PREV_FIELD   : Form_Request_Code renames F_Previous_Field;
174    REQ_FIRST_FIELD  : Form_Request_Code renames F_First_Field;
175    REQ_LAST_FIELD   : Form_Request_Code renames F_Last_Field;
176    REQ_SNEXT_FIELD  : Form_Request_Code renames F_Sorted_Next_Field;
177    REQ_SPREV_FIELD  : Form_Request_Code renames F_Sorted_Previous_Field;
178    REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field;
179    REQ_SLAST_FIELD  : Form_Request_Code renames F_Sorted_Last_Field;
180    REQ_LEFT_FIELD   : Form_Request_Code renames F_Left_Field;
181    REQ_RIGHT_FIELD  : Form_Request_Code renames F_Right_Field;
182    REQ_UP_FIELD     : Form_Request_Code renames F_Up_Field;
183    REQ_DOWN_FIELD   : Form_Request_Code renames F_Down_Field;
184
185    REQ_NEXT_CHAR    : Form_Request_Code renames F_Next_Char;
186    REQ_PREV_CHAR    : Form_Request_Code renames F_Previous_Char;
187    REQ_NEXT_LINE    : Form_Request_Code renames F_Next_Line;
188    REQ_PREV_LINE    : Form_Request_Code renames F_Previous_Line;
189    REQ_NEXT_WORD    : Form_Request_Code renames F_Next_Word;
190    REQ_PREV_WORD    : Form_Request_Code renames F_Previous_Word;
191    REQ_BEG_FIELD    : Form_Request_Code renames F_Begin_Field;
192    REQ_END_FIELD    : Form_Request_Code renames F_End_Field;
193    REQ_BEG_LINE     : Form_Request_Code renames F_Begin_Line;
194    REQ_END_LINE     : Form_Request_Code renames F_End_Line;
195    REQ_LEFT_CHAR    : Form_Request_Code renames F_Left_Char;
196    REQ_RIGHT_CHAR   : Form_Request_Code renames F_Right_Char;
197    REQ_UP_CHAR      : Form_Request_Code renames F_Up_Char;
198    REQ_DOWN_CHAR    : Form_Request_Code renames F_Down_Char;
199
200    REQ_NEW_LINE     : Form_Request_Code renames F_New_Line;
201    REQ_INS_CHAR     : Form_Request_Code renames F_Insert_Char;
202    REQ_INS_LINE     : Form_Request_Code renames F_Insert_Line;
203    REQ_DEL_CHAR     : Form_Request_Code renames F_Delete_Char;
204    REQ_DEL_PREV     : Form_Request_Code renames F_Delete_Previous;
205    REQ_DEL_LINE     : Form_Request_Code renames F_Delete_Line;
206    REQ_DEL_WORD     : Form_Request_Code renames F_Delete_Word;
207    REQ_CLR_EOL      : Form_Request_Code renames F_Clear_EOL;
208    REQ_CLR_EOF      : Form_Request_Code renames F_Clear_EOF;
209    REQ_CLR_FIELD    : Form_Request_Code renames F_Clear_Field;
210    REQ_OVL_MODE     : Form_Request_Code renames F_Overlay_Mode;
211    REQ_INS_MODE     : Form_Request_Code renames F_Insert_Mode;
212
213    REQ_SCR_FLINE    : Form_Request_Code renames F_ScrollForward_Line;
214    REQ_SCR_BLINE    : Form_Request_Code renames F_ScrollBackward_Line;
215    REQ_SCR_FPAGE    : Form_Request_Code renames F_ScrollForward_Page;
216    REQ_SCR_BPAGE    : Form_Request_Code renames F_ScrollBackward_Page;
217    REQ_SCR_FHPAGE   : Form_Request_Code renames F_ScrollForward_HalfPage;
218    REQ_SCR_BHPAGE   : Form_Request_Code renames F_ScrollBackward_HalfPage;
219
220    REQ_SCR_FCHAR    : Form_Request_Code renames F_HScrollForward_Char;
221    REQ_SCR_BCHAR    : Form_Request_Code renames F_HScrollBackward_Char;
222    REQ_SCR_HFLINE   : Form_Request_Code renames F_HScrollForward_Line;
223    REQ_SCR_HBLINE   : Form_Request_Code renames F_HScrollBackward_Line;
224    REQ_SCR_HFHALF   : Form_Request_Code renames F_HScrollForward_HalfLine;
225    REQ_SCR_HBHALF   : Form_Request_Code renames F_HScrollBackward_HalfLine;
226
227    REQ_VALIDATION   : Form_Request_Code renames F_Validate_Field;
228    REQ_NEXT_CHOICE  : Form_Request_Code renames F_Next_Choice;
229    REQ_PREV_CHOICE  : Form_Request_Code renames F_Previous_Choice;
230
231
232    procedure Request_Name (Key  : in Form_Request_Code;
233                            Name : out String);
234
235    function  Request_Name (Key : Form_Request_Code) return String;
236    --  Same as function
237    pragma Inline (Request_Name);
238
239    ------------------
240    --  Exceptions  --
241    ------------------
242    Form_Exception : exception;
243
244    --  MANPAGE(`form_field_new.3x')
245
246    --  ANCHOR(`new_field()',`Create')
247    function Create (Height       : Line_Count;
248                     Width        : Column_Count;
249                     Top          : Line_Position;
250                     Left         : Column_Position;
251                     Off_Screen   : Natural := 0;
252                     More_Buffers : Buffer_Number := Buffer_Number'First)
253                     return Field;
254    --  AKA
255    --  An overloaded Create is defined later. Pragma Inline appears there.
256
257    --  ANCHOR(`new_field()',`New_Field')
258    function New_Field (Height       : Line_Count;
259                        Width        : Column_Count;
260                        Top          : Line_Position;
261                        Left         : Column_Position;
262                        Off_Screen   : Natural := 0;
263                        More_Buffers : Buffer_Number := Buffer_Number'First)
264                        return Field renames Create;
265    --  AKA
266    pragma Inline (New_Field);
267
268    --  ANCHOR(`free_field()',`Delete')
269    procedure Delete (Fld : in out Field);
270    --  AKA
271    --  Reset Fld to Null_Field
272    --  An overloaded Delete is defined later. Pragma Inline appears there.
273
274    --  ANCHOR(`dup_field()',`Duplicate')
275    function Duplicate (Fld  : Field;
276                        Top  : Line_Position;
277                        Left : Column_Position) return Field;
278    --  AKA
279    pragma Inline (Duplicate);
280
281    --  ANCHOR(`link_field()',`Link')
282    function Link (Fld  : Field;
283                   Top  : Line_Position;
284                   Left : Column_Position) return Field;
285    --  AKA
286    pragma Inline (Link);
287
288    --  MANPAGE(`form_field_just.3x')
289
290    --  ANCHOR(`set_field_just()',`Set_Justification')
291    procedure Set_Justification (Fld  : in Field;
292                                 Just : in Field_Justification := None);
293    --  AKA
294    pragma Inline (Set_Justification);
295
296    --  ANCHOR(`field_just()',`Get_Justification')
297    function Get_Justification (Fld : Field) return Field_Justification;
298    --  AKA
299    pragma Inline (Get_Justification);
300
301    --  MANPAGE(`form_field_buffer.3x')
302
303    --  ANCHOR(`set_field_buffer()',`Set_Buffer')
304    procedure Set_Buffer
305      (Fld    : in Field;
306       Buffer : in Buffer_Number := Buffer_Number'First;
307       Str    : in String);
308    --  AKA
309    --  Not inlined
310
311    --  ANCHOR(`field_buffer()',`Get_Buffer')
312    procedure Get_Buffer
313      (Fld    : in Field;
314       Buffer : in Buffer_Number := Buffer_Number'First;
315       Str    : out String);
316    --  AKA
317
318    function Get_Buffer
319      (Fld    : in Field;
320       Buffer : in Buffer_Number := Buffer_Number'First) return String;
321    --  AKA
322    --  Same but as function
323    pragma Inline (Get_Buffer);
324
325    --  ANCHOR(`set_field_status()',`Set_Status')
326    procedure Set_Status (Fld    : in Field;
327                          Status : in Boolean := True);
328    --  AKA
329    pragma Inline (Set_Status);
330
331    --  ANCHOR(`field_status()',`Changed')
332    function Changed (Fld : Field) return Boolean;
333    --  AKA
334    pragma Inline (Changed);
335
336    --  ANCHOR(`set_field_max()',`Set_Maximum_Size')
337    procedure Set_Maximum_Size (Fld : in Field;
338                                Max : in Natural := 0);
339    --  AKA
340    pragma Inline (Set_Maximum_Size);
341
342    --  MANPAGE(`form_field_opts.3x')
343
344    --  ANCHOR(`set_field_opts()',`Set_Options')
345    procedure Set_Options (Fld     : in Field;
346                           Options : in Field_Option_Set);
347    --  AKA
348    --  An overloaded version is defined later. Pragma Inline appears there
349
350    --  ANCHOR(`field_opts_on()',`Switch_Options')
351    procedure Switch_Options (Fld     : in Field;
352                              Options : in Field_Option_Set;
353                              On      : Boolean := True);
354    --  AKA
355    --  ALIAS(`field_opts_off()')
356    --  An overloaded version is defined later. Pragma Inline appears there
357
358    --  ANCHOR(`field_opts()',`Get_Options')
359    procedure Get_Options (Fld     : in  Field;
360                           Options : out Field_Option_Set);
361    --  AKA
362
363    --  ANCHOR(`field_opts()',`Get_Options')
364    function Get_Options (Fld : Field := Null_Field)
365                          return Field_Option_Set;
366    --  AKA
367    --  An overloaded version is defined later. Pragma Inline appears there
368
369    --  MANPAGE(`form_field_attributes.3x')
370
371    --  ANCHOR(`set_field_fore()',`Set_Foreground')
372    procedure Set_Foreground
373      (Fld   : in Field;
374       Fore  : in Character_Attribute_Set := Normal_Video;
375       Color : in Color_Pair := Color_Pair'First);
376    --  AKA
377    pragma Inline (Set_Foreground);
378
379    --  ANCHOR(`field_fore()',`Foreground')
380    procedure Foreground (Fld  : in  Field;
381                          Fore : out Character_Attribute_Set);
382    --  AKA
383
384    --  ANCHOR(`field_fore()',`Foreground')
385    procedure Foreground (Fld   : in  Field;
386                          Fore  : out Character_Attribute_Set;
387                          Color : out Color_Pair);
388    --  AKA
389    pragma Inline (Foreground);
390
391    --  ANCHOR(`set_field_back()',`Set_Background')
392    procedure Set_Background
393      (Fld   : in Field;
394       Back  : in Character_Attribute_Set := Normal_Video;
395       Color : in Color_Pair := Color_Pair'First);
396    --  AKA
397    pragma Inline (Set_Background);
398
399    --  ANCHOR(`field_back()',`Background')
400    procedure Background (Fld  : in  Field;
401                          Back : out Character_Attribute_Set);
402    --  AKA
403
404    --  ANCHOR(`field_back()',`Background')
405    procedure Background (Fld   : in  Field;
406                          Back  : out Character_Attribute_Set;
407                          Color : out Color_Pair);
408    --  AKA
409    pragma Inline (Background);
410
411    --  ANCHOR(`set_field_pad()',`Set_Pad_Character')
412    procedure Set_Pad_Character (Fld : in Field;
413                                 Pad : in Character := Space);
414    --  AKA
415    pragma Inline (Set_Pad_Character);
416
417    --  ANCHOR(`field_pad()',`Pad_Character')
418    procedure Pad_Character (Fld : in  Field;
419                             Pad : out Character);
420    --  AKA
421    pragma Inline (Pad_Character);
422
423    --  MANPAGE(`form_field_info.3x')
424
425    --  ANCHOR(`field_info()',`Info')
426    procedure Info (Fld                : in  Field;
427                    Lines              : out Line_Count;
428                    Columns            : out Column_Count;
429                    First_Row          : out Line_Position;
430                    First_Column       : out Column_Position;
431                    Off_Screen         : out Natural;
432                    Additional_Buffers : out Buffer_Number);
433    --  AKA
434    pragma Inline (Info);
435
436    --  ANCHOR(`dynamic_field_info()',`Dynamic_Info')
437    procedure Dynamic_Info (Fld     : in Field;
438                            Lines   : out Line_Count;
439                            Columns : out Column_Count;
440                            Max     : out Natural);
441    --  AKA
442    pragma Inline (Dynamic_Info);
443
444    --  MANPAGE(`form_win.3x')
445
446    --  ANCHOR(`set_form_win()',`Set_Window')
447    procedure Set_Window (Frm : in Form;
448                          Win : in Window);
449    --  AKA
450    pragma Inline (Set_Window);
451
452    --  ANCHOR(`form_win()',`Get_Window')
453    function Get_Window (Frm : Form) return Window;
454    --  AKA
455    pragma Inline (Get_Window);
456
457    --  ANCHOR(`set_form_sub()',`Set_Sub_Window')
458    procedure Set_Sub_Window (Frm : in Form;
459                              Win : in Window);
460    --  AKA
461    pragma Inline (Set_Sub_Window);
462
463    --  ANCHOR(`form_sub()',`Get_Sub_Window')
464    function Get_Sub_Window (Frm : Form) return Window;
465    --  AKA
466    pragma Inline (Get_Sub_Window);
467
468    --  ANCHOR(`scale_form()',`Scale')
469    procedure Scale (Frm     : in Form;
470                     Lines   : out Line_Count;
471                     Columns : out Column_Count);
472    --  AKA
473    pragma Inline (Scale);
474
475    --  MANPAGE(`form_hook.3x')
476
477    type Form_Hook_Function is access procedure (Frm : in Form);
478    pragma Convention (C, Form_Hook_Function);
479
480    --  ANCHOR(`set_field_init()',`Set_Field_Init_Hook')
481    procedure Set_Field_Init_Hook (Frm  : in Form;
482                                   Proc : in Form_Hook_Function);
483    --  AKA
484    pragma Inline (Set_Field_Init_Hook);
485
486    --  ANCHOR(`set_field_term()',`Set_Field_Term_Hook')
487    procedure Set_Field_Term_Hook (Frm  : in Form;
488                                   Proc : in Form_Hook_Function);
489    --  AKA
490    pragma Inline (Set_Field_Term_Hook);
491
492    --  ANCHOR(`set_form_init()',`Set_Form_Init_Hook')
493    procedure Set_Form_Init_Hook (Frm  : in Form;
494                                  Proc : in Form_Hook_Function);
495    --  AKA
496    pragma Inline (Set_Form_Init_Hook);
497
498    --  ANCHOR(`set_form_term()',`Set_Form_Term_Hook')
499    procedure Set_Form_Term_Hook (Frm  : in Form;
500                                  Proc : in Form_Hook_Function);
501    --  AKA
502    pragma Inline (Set_Form_Term_Hook);
503
504    --  ANCHOR(`field_init()',`Get_Field_Init_Hook')
505    function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function;
506    --  AKA
507    pragma Import (C, Get_Field_Init_Hook, "field_init");
508
509    --  ANCHOR(`field_term()',`Get_Field_Term_Hook')
510    function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function;
511    --  AKA
512    pragma Import (C, Get_Field_Term_Hook, "field_term");
513
514    --  ANCHOR(`form_init()',`Get_Form_Init_Hook')
515    function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function;
516    --  AKA
517    pragma Import (C, Get_Form_Init_Hook, "form_init");
518
519    --  ANCHOR(`form_term()',`Get_Form_Term_Hook')
520    function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function;
521    --  AKA
522    pragma Import (C, Get_Form_Term_Hook, "form_term");
523
524    --  MANPAGE(`form_field.3x')
525
526    --  ANCHOR(`set_form_fields()',`Redefine')
527    procedure Redefine (Frm  : in Form;
528                        Flds : in Field_Array_Access);
529    --  AKA
530    pragma Inline (Redefine);
531
532    --  ANCHOR(`set_form_fields()',`Set_Fields')
533    procedure Set_Fields (Frm  : in Form;
534                          Flds : in Field_Array_Access) renames Redefine;
535    --  AKA
536    pragma Inline (Set_Fields);
537
538    --  ANCHOR(`form_fields()',`Fields')
539    function Fields (Frm   : Form;
540                     Index : Positive) return Field;
541    --  AKA
542    pragma Inline (Fields);
543
544    --  ANCHOR(`field_count()',`Field_Count')
545    function Field_Count (Frm : Form) return Natural;
546    --  AKA
547    pragma Inline (Field_Count);
548
549    --  ANCHOR(`move_field()',`Move')
550    procedure Move (Fld    : in Field;
551                    Line   : in Line_Position;
552                    Column : in Column_Position);
553    --  AKA
554    pragma Inline (Move);
555
556    --  MANPAGE(`form_new.3x')
557
558    --  ANCHOR(`new_form()',`Create')
559    function Create (Fields : Field_Array_Access) return Form;
560    --  AKA
561    pragma Inline (Create);
562
563    --  ANCHOR(`new_form()',`New_Form')
564    function New_Form (Fields : Field_Array_Access) return Form
565      renames Create;
566    --  AKA
567    pragma Inline (New_Form);
568
569    --  ANCHOR(`free_form()',`Delete')
570    procedure Delete (Frm : in out Form);
571    --  AKA
572    --  Reset Frm to Null_Form
573    pragma Inline (Delete);
574
575    --  MANPAGE(`form_opts.3x')
576
577    --  ANCHOR(`set_form_opts()',`Set_Options')
578    procedure Set_Options (Frm     : in Form;
579                           Options : in Form_Option_Set);
580    --  AKA
581    pragma Inline (Set_Options);
582
583    --  ANCHOR(`form_opts_on()',`Switch_Options')
584    procedure Switch_Options (Frm     : in Form;
585                              Options : in Form_Option_Set;
586                              On      : Boolean := True);
587    --  AKA
588    --  ALIAS(`form_opts_off()')
589    pragma Inline (Switch_Options);
590
591    --  ANCHOR(`form_opts()',`Get_Options')
592    procedure Get_Options (Frm     : in  Form;
593                           Options : out Form_Option_Set);
594    --  AKA
595
596    --  ANCHOR(`form_opts()',`Get_Options')
597    function Get_Options (Frm : Form := Null_Form) return Form_Option_Set;
598    --  AKA
599    pragma Inline (Get_Options);
600
601    --  MANPAGE(`form_post.3x')
602
603    --  ANCHOR(`post_form()',`Post')
604    procedure Post (Frm  : in Form;
605                    Post : in Boolean := True);
606    --  AKA
607    --  ALIAS(`unpost_form()')
608    pragma Inline (Post);
609
610    --  MANPAGE(`form_cursor.3x')
611
612    --  ANCHOR(`pos_form_cursor()',`Position_Cursor')
613    procedure Position_Cursor (Frm : Form);
614    --  AKA
615    pragma Inline (Position_Cursor);
616
617    --  MANPAGE(`form_data.3x')
618
619    --  ANCHOR(`data_ahead()',`Data_Ahead')
620    function Data_Ahead (Frm : Form) return Boolean;
621    --  AKA
622    pragma Inline (Data_Ahead);
623
624    --  ANCHOR(`data_behind()',`Data_Behind')
625    function Data_Behind (Frm : Form) return Boolean;
626    --  AKA
627    pragma Inline (Data_Behind);
628
629    --  MANPAGE(`form_driver.3x')
630
631    type Driver_Result is (Form_Ok,
632                           Request_Denied,
633                           Unknown_Request,
634                           Invalid_Field);
635
636    --  ANCHOR(`form_driver()',`Driver')
637    function Driver (Frm : Form;
638                     Key : Key_Code) return Driver_Result;
639    --  AKA
640    --  Driver not inlined
641
642    --  MANPAGE(`form_page.3x')
643
644    type Page_Number is new Natural;
645
646    --  ANCHOR(`set_current_field()',`Set_Current')
647    procedure Set_Current (Frm : in Form;
648                           Fld : in Field);
649    --  AKA
650    pragma Inline (Set_Current);
651
652    --  ANCHOR(`current_field()',`Current')
653    function Current (Frm : in Form) return Field;
654    --  AKA
655    pragma Inline (Current);
656
657    --  ANCHOR(`set_form_page()',`Set_Page')
658    procedure Set_Page (Frm  : in Form;
659                        Page : in Page_Number := Page_Number'First);
660    --  AKA
661    pragma Inline (Set_Page);
662
663    --  ANCHOR(`form_page()',`Page')
664    function Page (Frm : Form) return Page_Number;
665    --  AKA
666    pragma Inline (Page);
667
668    --  ANCHOR(`field_index()',`Get_Index')
669    function Get_Index (Fld : Field) return Positive;
670    --  AKA
671    --  Please note that in this binding we start the numbering of fields
672    --  with 1. So this is number is one more than you get from the low
673    --  level call.
674    pragma Inline (Get_Index);
675
676    --  MANPAGE(`form_new_page.3x')
677
678    --  ANCHOR(`set_new_page()',`Set_New_Page')
679    procedure Set_New_Page (Fld      : in Field;
680                            New_Page : in Boolean := True);
681    --  AKA
682    pragma Inline (Set_New_Page);
683
684    --  ANCHOR(`new_page()',`Is_New_Page')
685    function Is_New_Page (Fld : Field) return Boolean;
686    --  AKA
687    pragma Inline (Is_New_Page);
688
689 ------------------------------------------------------------------------------
690 private
691    type Field is new System.Storage_Elements.Integer_Address;
692    type Form  is new System.Storage_Elements.Integer_Address;
693
694    Null_Field : constant Field := 0;
695    Null_Form  : constant Form  := 0;
696
697 end Terminal_Interface.Curses.Forms;