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