]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/gen/terminal_interface-curses.ads.m4
ncurses 5.4
[ncurses.git] / Ada95 / gen / terminal_interface-curses.ads.m4
1 --  -*- ada -*-
2 define(`HTMLNAME',`terminal_interface-curses__ads.htm')dnl
3 include(M4MACRO)------------------------------------------------------------------------------
4 --                                                                          --
5 --                           GNAT ncurses Binding                           --
6 --                                                                          --
7 --                         Terminal_Interface.Curses                        --
8 --                                                                          --
9 --                                 S P E C                                  --
10 --                                                                          --
11 ------------------------------------------------------------------------------
12 -- Copyright (c) 1998 Free Software Foundation, Inc.                        --
13 --                                                                          --
14 -- Permission is hereby granted, free of charge, to any person obtaining a  --
15 -- copy of this software and associated documentation files (the            --
16 -- "Software"), to deal in the Software without restriction, including      --
17 -- without limitation the rights to use, copy, modify, merge, publish,      --
18 -- distribute, distribute with modifications, sublicense, and/or sell       --
19 -- copies of the Software, and to permit persons to whom the Software is    --
20 -- furnished to do so, subject to the following conditions:                 --
21 --                                                                          --
22 -- The above copyright notice and this permission notice shall be included  --
23 -- in all copies or substantial portions of the Software.                   --
24 --                                                                          --
25 -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --
26 -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --
27 -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --
28 -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --
29 -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --
30 -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --
31 -- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --
32 --                                                                          --
33 -- Except as contained in this notice, the name(s) of the above copyright   --
34 -- holders shall not be used in advertising or otherwise to promote the     --
35 -- sale, use or other dealings in this Software without prior written       --
36 -- authorization.                                                           --
37 ------------------------------------------------------------------------------
38 --  Author:  Juergen Pfeifer, 1996
39 --  Version Control:
40 --  $Revision: 1.31 $
41 --  Binding Version 01.00
42 ------------------------------------------------------------------------------
43 include(`Base_Defs')
44 with System.Storage_Elements;
45 with Interfaces.C;   --  We need this for some assertions.
46
47 package Terminal_Interface.Curses is
48    pragma Preelaborate (Terminal_Interface.Curses);
49 include(`Linker_Options')
50 include(`Version_Info')
51    type Window is private;
52    Null_Window : constant Window;
53
54    type Line_Position   is new Natural; --  line coordinate
55    type Column_Position is new Natural; --  column coordinate
56
57    subtype Line_Count   is Line_Position   range 1 .. Line_Position'Last;
58    --  Type to count lines. We do not allow null windows, so must be positive
59    subtype Column_Count is Column_Position range 1 .. Column_Position'Last;
60    --  Type to count columns. We do not allow null windows, so must be positive
61
62    type Key_Code is new Natural;
63    --  That is anything including real characters, special keys and logical
64    --  request codes.
65
66    subtype Real_Key_Code is Key_Code range 0 .. M4_KEY_MAX;
67    --  This are the codes that potentially represent a real keystroke.
68    --  Not all codes may be possible on a specific terminal. To check the
69    --  availability of a special key, the Has_Key function is provided.
70
71    subtype Special_Key_Code is Real_Key_Code
72      range M4_SPECIAL_FIRST .. Real_Key_Code'Last;
73    --  Type for a function- or special key number
74
75    subtype Normal_Key_Code is Real_Key_Code range
76      Character'Pos (Character'First) .. Character'Pos (Character'Last);
77    --  This are the codes for regular (incl. non-graphical) characters.
78
79    --  Constants for function- and special keys
80    --
81    Key_None                       : constant Special_Key_Code := M4_SPECIAL_FIRST;
82 include(`Key_Definitions')
83    Key_Max                        : constant Special_Key_Code
84      := Special_Key_Code'Last;
85
86    subtype User_Key_Code is Key_Code
87      range (Key_Max + 129) .. Key_Code'Last;
88    --  This is reserved for user defined key codes. The range between Key_Max
89    --  and the first user code is reserved for subsystems like menu and forms.
90
91    --  For those who like to use the original key names we produce them were
92    --  they differ from the original. Please note that they may differ in
93    --  lower/upper case.
94 include(`Old_Keys')dnl
95
96 ------------------------------------------------------------------------------
97
98    type Color_Number is range -1 .. Integer (Interfaces.C.short'Last);
99    for Color_Number'Size use Interfaces.C.short'Size;
100    --  (n)curses uses a short for the color index
101    --  The model is, that a Color_Number is an index into an array of
102    --  (potentially) definable colors. Some of those indices are
103    --  predefined (see below), although they may not really exist.
104
105 include(`Color_Defs')
106    type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last);
107    for RGB_Value'Size use Interfaces.C.short'Size;
108    --  Some system may allow to redefine a color by setting RGB values.
109
110    type Color_Pair is range 0 .. 255;
111    for Color_Pair'Size use 8;
112    subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255;
113    --  (n)curses reserves 1 Byte for the color-pair number. Color Pair 0
114    --  is fixed (Black & White). A color pair is simply a combination of
115    --  two colors described by Color_Numbers, one for the foreground and
116    --  the other for the background
117
118 include(`Character_Attribute_Set_Rep')
119    --  (n)curses uses all but the lowest 16 Bits for Attributes.
120
121    Normal_Video : constant Character_Attribute_Set := (others => False);
122
123    type Attributed_Character is
124       record
125          Attr  : Character_Attribute_Set;
126          Color : Color_Pair;
127          Ch    : Character;
128       end record;
129    pragma Convention (C, Attributed_Character);
130    --  This is the counterpart for the chtype in C.
131
132 include(`AC_Rep')
133    Default_Character : constant Attributed_Character
134      := (Ch    => Character'First,
135          Color => Color_Pair'First,
136          Attr  => (others => False));  --  preelaboratable Normal_Video
137
138    type Attributed_String is array (Positive range <>) of Attributed_Character;
139    pragma Pack (Attributed_String);
140    --  In this binding we allow strings of attributed characters.
141
142    ------------------
143    --  Exceptions  --
144    ------------------
145    Curses_Exception     : exception;
146    Wrong_Curses_Version : exception;
147
148    --  Those exceptions are raised by the ETI (Extended Terminal Interface)
149    --  subpackets for Menu and Forms handling.
150    --
151    Eti_System_Error    : exception;
152    Eti_Bad_Argument    : exception;
153    Eti_Posted          : exception;
154    Eti_Connected       : exception;
155    Eti_Bad_State       : exception;
156    Eti_No_Room         : exception;
157    Eti_Not_Posted      : exception;
158    Eti_Unknown_Command : exception;
159    Eti_No_Match        : exception;
160    Eti_Not_Selectable  : exception;
161    Eti_Not_Connected   : exception;
162    Eti_Request_Denied  : exception;
163    Eti_Invalid_Field   : exception;
164    Eti_Current         : exception;
165
166    --------------------------------------------------------------------------
167    --  External C variables
168    --  Conceptually even in C this are kind of constants, but they are
169    --  initialized and sometimes changed by the library routines at runtime
170    --  depending on the type of terminal. I believe the best way to model
171    --  this is to use functions.
172    --------------------------------------------------------------------------
173
174    function Lines            return Line_Count;
175    pragma Inline (Lines);
176
177    function Columns          return Column_Count;
178    pragma Inline (Columns);
179
180    function Tab_Size         return Natural;
181    pragma Inline (Tab_Size);
182
183    function Number_Of_Colors return Natural;
184    pragma Inline (Number_Of_Colors);
185
186    function Number_Of_Color_Pairs return Natural;
187    pragma Inline (Number_Of_Color_Pairs);
188
189    ACS_Map : array (Character'Val (0) .. Character'Val (127)) of
190      Attributed_Character;
191    pragma Import (C, ACS_Map, "acs_map");
192    --
193    --
194    --  Constants for several characters from the Alternate Character Set
195    --  You must use this constants as indices into the ACS_Map array
196    --  to get the corresponding attributed character at runtime.
197    --
198 include(`ACS_Map')dnl
199
200    --  MANPAGE(`curs_initscr.3x')
201    --  | Not implemented: newterm, set_term, delscreen, curscr
202
203    --  ANCHOR(`stdscr',`Standard_Window')
204    function Standard_Window return Window;
205    --  AKA
206    pragma Inline (Standard_Window);
207
208    --  ANCHOR(`initscr()',`Init_Screen')
209    procedure Init_Screen;
210
211    --  ANCHOR(`initscr()',`Init_Windows')
212    procedure Init_Windows renames Init_Screen;
213    --  AKA
214    pragma Inline (Init_Screen);
215    pragma Inline (Init_Windows);
216
217    --  ANCHOR(`endwin()',`End_Windows')
218    procedure End_Windows;
219    --  AKA
220    procedure End_Screen renames End_Windows;
221    pragma Inline (End_Windows);
222    pragma Inline (End_Screen);
223
224    --  ANCHOR(`isendwin()',`Is_End_Window')
225    function Is_End_Window return Boolean;
226    --  AKA
227    pragma Inline (Is_End_Window);
228
229    --  MANPAGE(`curs_move.3x')
230
231    --  ANCHOR(`wmove()',`Move_Cursor')
232    procedure Move_Cursor (Win    : in Window := Standard_Window;
233                           Line   : in Line_Position;
234                           Column : in Column_Position);
235    --  AKA
236    --  ALIAS(`move()')
237    pragma Inline (Move_Cursor);
238
239    --  MANPAGE(`curs_addch.3x')
240
241    --  ANCHOR(`waddch()',`Add')
242    procedure Add (Win :  in Window := Standard_Window;
243                   Ch  :  in Attributed_Character);
244    --  AKA
245    --  ALIAS(`addch()')
246
247    procedure Add (Win :  in Window := Standard_Window;
248                   Ch  :  in Character);
249    --  Add a single character at the current logical cursor position to
250    --  the window. Use the current windows attributes.
251
252    --  ANCHOR(`mvwaddch()',`Add')
253    procedure Add
254      (Win    : in Window := Standard_Window;
255       Line   : in Line_Position;
256       Column : in Column_Position;
257       Ch     : in Attributed_Character);
258    --  AKA
259    --  ALIAS(`mvaddch()')
260
261    procedure Add
262      (Win    : in Window := Standard_Window;
263       Line   : in Line_Position;
264       Column : in Column_Position;
265       Ch     : in Character);
266    --  Move to the position and add a single character into the window
267    --  There are more Add routines, so the Inline pragma follows later
268
269    --  ANCHOR(`wechochar()',`Add_With_Immediate_Echo')
270    procedure Add_With_Immediate_Echo
271      (Win : in Window := Standard_Window;
272       Ch  : in Attributed_Character);
273    --  AKA
274    --  ALIAS(`echochar()')
275
276    procedure Add_With_Immediate_Echo
277      (Win : in Window := Standard_Window;
278       Ch  : in Character);
279    --  Add a character and do an immediate refresh of the screen.
280    pragma Inline (Add_With_Immediate_Echo);
281
282    --  MANPAGE(`curs_window.3x')
283    --  Not Implemented: wcursyncup
284
285    --  ANCHOR(`newwin()',`Create')
286    function Create
287      (Number_Of_Lines       : Line_Count;
288       Number_Of_Columns     : Column_Count;
289       First_Line_Position   : Line_Position;
290       First_Column_Position : Column_Position) return Window;
291    --  Not Implemented: Default Number_Of_Lines, Number_Of_Columns
292    --  the C version lets them be 0, see the man page.
293    --  AKA
294    pragma Inline (Create);
295
296    function New_Window
297      (Number_Of_Lines       : Line_Count;
298       Number_Of_Columns     : Column_Count;
299       First_Line_Position   : Line_Position;
300       First_Column_Position : Column_Position) return Window
301      renames Create;
302    pragma Inline (New_Window);
303
304    --  ANCHOR(`delwin()',`Delete')
305    procedure Delete (Win : in out Window);
306    --  AKA
307    --  Reset Win to Null_Window
308    pragma Inline (Delete);
309
310    --  ANCHOR(`subwin()',`Sub_Window')
311    function Sub_Window
312      (Win                   : Window := Standard_Window;
313       Number_Of_Lines       : Line_Count;
314       Number_Of_Columns     : Column_Count;
315       First_Line_Position   : Line_Position;
316       First_Column_Position : Column_Position) return Window;
317    --  AKA
318    pragma Inline (Sub_Window);
319
320    --  ANCHOR(`derwin()',`Derived_Window')
321    function Derived_Window
322      (Win                   : Window := Standard_Window;
323       Number_Of_Lines       : Line_Count;
324       Number_Of_Columns     : Column_Count;
325       First_Line_Position   : Line_Position;
326       First_Column_Position : Column_Position) return Window;
327    --  AKA
328    pragma Inline (Derived_Window);
329
330    --  ANCHOR(`dupwin()',`Duplicate')
331    function Duplicate (Win : Window) return Window;
332    --  AKA
333    pragma Inline (Duplicate);
334
335    --  ANCHOR(`mvwin()',`Move_Window')
336    procedure Move_Window (Win    : in Window;
337                           Line   : in Line_Position;
338                           Column : in Column_Position);
339    --  AKA
340    pragma Inline (Move_Window);
341
342    --  ANCHOR(`mvderwin()',`Move_Derived_Window')
343    procedure Move_Derived_Window (Win    : in Window;
344                                   Line   : in Line_Position;
345                                   Column : in Column_Position);
346    --  AKA
347    pragma Inline (Move_Derived_Window);
348
349    --  ANCHOR(`wsyncup()',`Synchronize_Upwards')
350    procedure Synchronize_Upwards (Win : in Window);
351    --  AKA
352    pragma Import (C, Synchronize_Upwards, "wsyncup");
353
354    --  ANCHOR(`wsyncdown()',`Synchronize_Downwards')
355    procedure Synchronize_Downwards (Win : in Window);
356    --  AKA
357    pragma Import (C, Synchronize_Downwards, "wsyncdown");
358
359    --  ANCHOR(`syncok()',`Set_Synch_Mode')
360    procedure Set_Synch_Mode (Win  : in Window := Standard_Window;
361                              Mode : in Boolean := False);
362    --  AKA
363    pragma Inline (Set_Synch_Mode);
364
365    --  MANPAGE(`curs_addstr.3x')
366
367    --  ANCHOR(`waddnstr()',`Add')
368    procedure Add (Win : in Window := Standard_Window;
369                   Str : in String;
370                   Len : in Integer := -1);
371    --  AKA
372    --  ALIAS(`waddstr()')
373    --  ALIAS(`addnstr()')
374    --  ALIAS(`addstr()')
375
376    --  ANCHOR(`mvwaddnstr()',`Add')
377    procedure Add (Win    : in Window := Standard_Window;
378                   Line   : in Line_Position;
379                   Column : in Column_Position;
380                   Str    : in String;
381                   Len    : in Integer := -1);
382    --  AKA
383    --  ALIAS(`mvwaddstr()')
384    --  ALIAS(`mvaddnstr()')
385    --  ALIAS(`mvaddstr()')
386
387    --  MANPAGE(`curs_addchstr.3x')
388
389    --  ANCHOR(`waddchnstr()',`Add')
390    procedure Add (Win : in Window := Standard_Window;
391                   Str : in Attributed_String;
392                   Len : in Integer := -1);
393    --  AKA
394    --  ALIAS(`waddchstr()')
395    --  ALIAS(`addchnstr()')
396    --  ALIAS(`addchstr()')
397
398    --  ANCHOR(`mvwaddchnstr()',`Add')
399    procedure Add (Win    : in Window := Standard_Window;
400                   Line   : in Line_Position;
401                   Column : in Column_Position;
402                   Str    : in Attributed_String;
403                   Len    : in Integer := -1);
404    --  AKA
405    --  ALIAS(`mvwaddchstr()')
406    --  ALIAS(`mvaddchnstr()')
407    --  ALIAS(`mvaddchstr()')
408    pragma Inline (Add);
409
410    --  MANPAGE(`curs_border.3x')
411    --  | Not implemented: mvhline,  mvwhline, mvvline, mvwvline
412    --  | use Move_Cursor then Horizontal_Line or Vertical_Line
413
414    --  ANCHOR(`wborder()',`Border')
415    procedure Border
416      (Win                       : in Window := Standard_Window;
417       Left_Side_Symbol          : in Attributed_Character := Default_Character;
418       Right_Side_Symbol         : in Attributed_Character := Default_Character;
419       Top_Side_Symbol           : in Attributed_Character := Default_Character;
420       Bottom_Side_Symbol        : in Attributed_Character := Default_Character;
421       Upper_Left_Corner_Symbol  : in Attributed_Character := Default_Character;
422       Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character;
423       Lower_Left_Corner_Symbol  : in Attributed_Character := Default_Character;
424       Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character
425      );
426    --  AKA
427    --  ALIAS(`border()')
428    pragma Inline (Border);
429
430    --  ANCHOR(`box()',`Box')
431    procedure Box
432      (Win               : in Window := Standard_Window;
433       Vertical_Symbol   : in Attributed_Character := Default_Character;
434       Horizontal_Symbol : in Attributed_Character := Default_Character);
435    --  AKA
436    pragma Inline (Box);
437
438    --  ANCHOR(`whline()',`Horizontal_Line')
439    procedure Horizontal_Line
440      (Win         : in Window := Standard_Window;
441       Line_Size   : in Natural;
442       Line_Symbol : in Attributed_Character := Default_Character);
443    --  AKA
444    --  ALIAS(`hline()')
445    pragma Inline (Horizontal_Line);
446
447    --  ANCHOR(`wvline()',`Vertical_Line')
448    procedure Vertical_Line
449      (Win         : in Window := Standard_Window;
450       Line_Size   : in Natural;
451       Line_Symbol : in Attributed_Character := Default_Character);
452    --  AKA
453    --  ALIAS(`vline()')
454    pragma Inline (Vertical_Line);
455
456    --  MANPAGE(`curs_getch.3x')
457    --  Not implemented: mvgetch, mvwgetch
458
459    --  ANCHOR(`wgetch()',`Get_Keystroke')
460    function Get_Keystroke (Win : Window := Standard_Window)
461                            return Real_Key_Code;
462    --  AKA
463    --  ALIAS(`getch()')
464    --  Get a character from the keyboard and echo it - if enabled - to the
465    --  window.
466    --  If for any reason (i.e. a timeout) we couldn't get a character the
467    --  returned keycode is Key_None.
468    pragma Inline (Get_Keystroke);
469
470    --  ANCHOR(`ungetch()',`Undo_Keystroke')
471    procedure Undo_Keystroke (Key : in Real_Key_Code);
472    --  AKA
473    pragma Inline (Undo_Keystroke);
474
475    --  ANCHOR(`has_key()',`Has_Key')
476    function Has_Key (Key : Special_Key_Code) return Boolean;
477    --  AKA
478    pragma Inline (Has_Key);
479
480    --  |
481    --  | Some helper functions
482    --  |
483    function Is_Function_Key (Key : Special_Key_Code) return Boolean;
484    --  Return True if the Key is a function key (i.e. one of F0 .. F63)
485    pragma Inline (Is_Function_Key);
486
487    subtype Function_Key_Number is Integer range 0 .. 63;
488    --  (n)curses allows for 64 function keys.
489
490    function Function_Key (Key : Real_Key_Code) return Function_Key_Number;
491    --  Return the number of the function key. If the code is not a
492    --  function key, a CONSTRAINT_ERROR will be raised.
493    pragma Inline (Function_Key);
494
495    function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
496    --  Return the key code for a given function-key number.
497    pragma Inline (Function_Key_Code);
498
499    --  MANPAGE(`curs_attr.3x')
500    --  | Not implemented attr_off,  wattr_off,
501    --  |  attr_on, wattr_on, attr_set, wattr_set
502
503    --  PAIR_NUMBER
504    --  PAIR_NUMBER(c) is the same as c.Color
505
506    --  ANCHOR(`standout()',`Standout')
507    procedure Standout (Win : Window  := Standard_Window;
508                        On  : Boolean := True);
509    --  ALIAS(`wstandout()')
510    --  ALIAS(`wstandend()')
511
512    --  ANCHOR(`wattron()',`Switch_Character_Attribute')
513    procedure Switch_Character_Attribute
514      (Win  : in Window := Standard_Window;
515       Attr : in Character_Attribute_Set := Normal_Video;
516       On   : in Boolean := True); --  if False we switch Off.
517    --  Switches those Attributes set to true in the list.
518    --  AKA
519    --  ALIAS(`wattroff()')
520    --  ALIAS(`attron()')
521    --  ALIAS(`attroff()')
522
523    --  ANCHOR(`wattrset()',`Set_Character_Attributes')
524    procedure Set_Character_Attributes
525      (Win   : in Window := Standard_Window;
526       Attr  : in Character_Attribute_Set := Normal_Video;
527       Color : in Color_Pair := Color_Pair'First);
528    --  AKA
529    --  ALIAS(`attrset()')
530    pragma Inline (Set_Character_Attributes);
531
532    --  ANCHOR(`wattr_get()',`Get_Character_Attributes')
533    function Get_Character_Attribute
534      (Win : in Window := Standard_Window) return Character_Attribute_Set;
535    --  AKA
536    --  ALIAS(`attr_get()')
537
538    --  ANCHOR(`wattr_get()',`Get_Character_Attribute')
539    function Get_Character_Attribute
540      (Win : in Window := Standard_Window) return Color_Pair;
541    --  AKA
542    pragma Inline (Get_Character_Attribute);
543
544    --  ANCHOR(`wcolor_set()',`Set_Color')
545    procedure Set_Color (Win  : in Window := Standard_Window;
546                         Pair : in Color_Pair);
547    --  AKA
548    --  ALIAS(`color_set()')
549    pragma Inline (Set_Color);
550
551    --  ANCHOR(`wchgat()',`Change_Attributes')
552    procedure Change_Attributes
553      (Win   : in Window := Standard_Window;
554       Count : in Integer := -1;
555       Attr  : in Character_Attribute_Set := Normal_Video;
556       Color : in Color_Pair := Color_Pair'First);
557    --  AKA
558    --  ALIAS(`chgat()')
559
560    --  ANCHOR(`mvwchgat()',`Change_Attributes')
561    procedure Change_Attributes
562      (Win    : in Window := Standard_Window;
563       Line   : in Line_Position := Line_Position'First;
564       Column : in Column_Position := Column_Position'First;
565       Count  : in Integer := -1;
566       Attr   : in Character_Attribute_Set := Normal_Video;
567       Color  : in Color_Pair := Color_Pair'First);
568    --  AKA
569    --  ALIAS(`mvchgat()')
570    pragma Inline (Change_Attributes);
571
572    --  MANPAGE(`curs_beep.3x')
573
574    --  ANCHOR(`beep()',`Beep')
575    procedure Beep;
576    --  AKA
577    pragma Inline (Beep);
578
579    --  ANCHOR(`flash()',`Flash_Screen')
580    procedure Flash_Screen;
581    --  AKA
582    pragma Inline (Flash_Screen);
583
584    --  MANPAGE(`curs_inopts.3x')
585
586    --  | Not implemented : typeahead
587    --
588    --  ANCHOR(`cbreak()',`Set_Cbreak_Mode')
589    procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True);
590    --  AKA
591    --  ALIAS(`nocbreak()')
592    pragma Inline (Set_Cbreak_Mode);
593
594    --  ANCHOR(`raw()',`Set_Raw_Mode')
595    procedure Set_Raw_Mode (SwitchOn : in Boolean := True);
596    --  AKA
597    --  ALIAS(`noraw()')
598    pragma Inline (Set_Raw_Mode);
599
600    --  ANCHOR(`echo()',`Set_Echo_Mode')
601    procedure Set_Echo_Mode (SwitchOn : in Boolean := True);
602    --  AKA
603    --  ALIAS(`noecho()')
604    pragma Inline (Set_Echo_Mode);
605
606    --  ANCHOR(`meta()',`Set_Meta_Mode')
607    procedure Set_Meta_Mode (Win      : in Window := Standard_Window;
608                             SwitchOn : in Boolean := True);
609    --  AKA
610    pragma Inline (Set_Meta_Mode);
611
612    --  ANCHOR(`keypad()',`Set_KeyPad_Mode')
613    procedure Set_KeyPad_Mode (Win      : in Window := Standard_Window;
614                               SwitchOn : in Boolean := True);
615    --  AKA
616    pragma Inline (Set_KeyPad_Mode);
617
618    function Get_KeyPad_Mode (Win : in Window := Standard_Window)
619                              return Boolean;
620    --  This has no pendant in C. There you've to look into the WINDOWS
621    --  structure to get the value. Bad practice, not repeated in Ada.
622
623    type Half_Delay_Amount is range 1 .. 255;
624
625    --  ANCHOR(`halfdelay()',`Half_Delay')
626    procedure Half_Delay (Amount : in Half_Delay_Amount);
627    --  AKA
628    pragma Inline (Half_Delay);
629
630    --  ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode')
631    procedure Set_Flush_On_Interrupt_Mode
632      (Win  : in Window := Standard_Window;
633       Mode : in Boolean := True);
634    --  AKA
635    pragma Inline (Set_Flush_On_Interrupt_Mode);
636
637    --  ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode')
638    procedure Set_Queue_Interrupt_Mode
639      (Win   : in Window := Standard_Window;
640       Flush : in Boolean := True);
641    --  AKA
642    --  ALIAS(`noqiflush()')
643    pragma Inline (Set_Queue_Interrupt_Mode);
644
645    --  ANCHOR(`nodelay()',`Set_NoDelay_Mode')
646    procedure Set_NoDelay_Mode
647      (Win  : in Window := Standard_Window;
648       Mode : in Boolean := False);
649    --  AKA
650    pragma Inline (Set_NoDelay_Mode);
651
652    type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
653
654    --  ANCHOR(`wtimeout()',`Set_Timeout_Mode')
655    procedure Set_Timeout_Mode (Win    : in Window := Standard_Window;
656                                Mode   : in Timeout_Mode;
657                                Amount : in Natural); --  in Milliseconds
658    --  AKA
659    --  ALIAS(`timeout()')
660    --  Instead of overloading the semantic of the sign of amount, we
661    --  introduce the Timeout_Mode parameter. This should improve
662    --  readability. For Blocking and Non_Blocking, the Amount is not
663    --  evaluated.
664    --  We don't inline this procedure.
665
666    --  ANCHOR(`notimeout()',`Set_Escape_Time_Mode')
667    procedure Set_Escape_Timer_Mode
668      (Win       : in Window := Standard_Window;
669       Timer_Off : in Boolean := False);
670    --  AKA
671    pragma Inline (Set_Escape_Timer_Mode);
672
673    --  MANPAGE(`curs_outopts.3x')
674
675    --  ANCHOR(`nl()',`Set_NL_Mode')
676    procedure Set_NL_Mode (SwitchOn : in Boolean := True);
677    --  AKA
678    --  ALIAS(`nonl()')
679    pragma Inline (Set_NL_Mode);
680
681    --  ANCHOR(`clearok()',`Clear_On_Next_Update')
682    procedure Clear_On_Next_Update
683      (Win      : in Window := Standard_Window;
684       Do_Clear : in Boolean := True);
685    --  AKA
686    pragma Inline (Clear_On_Next_Update);
687
688    --  ANCHOR(`idlok()',`Use_Insert_Delete_Line')
689    procedure Use_Insert_Delete_Line
690      (Win    : in Window := Standard_Window;
691       Do_Idl : in Boolean := True);
692    --  AKA
693    pragma Inline (Use_Insert_Delete_Line);
694
695    --  ANCHOR(`idcok()',`Use_Insert_Delete_Character')
696    procedure Use_Insert_Delete_Character
697      (Win    : in Window := Standard_Window;
698       Do_Idc : in Boolean := True);
699    --  AKA
700    pragma Inline (Use_Insert_Delete_Character);
701
702    --  ANCHOR(`leaveok()',`Leave_Cursor_After_Update')
703    procedure Leave_Cursor_After_Update
704      (Win      : in Window := Standard_Window;
705       Do_Leave : in Boolean := True);
706    --  AKA
707    pragma Inline (Leave_Cursor_After_Update);
708
709    --  ANCHOR(`immedok()',`Immediate_Update_Mode')
710    procedure Immediate_Update_Mode
711      (Win  : in Window := Standard_Window;
712       Mode : in Boolean := False);
713    --  AKA
714    pragma Inline (Immediate_Update_Mode);
715
716    --  ANCHOR(`scrollok()',`Allow_Scrolling')
717    procedure Allow_Scrolling
718      (Win  : in Window := Standard_Window;
719       Mode : in Boolean := False);
720    --  AKA
721    pragma Inline (Allow_Scrolling);
722
723    function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
724    --  There is no such function in the C interface.
725    pragma Inline (Scrolling_Allowed);
726
727    --  ANCHOR(`wsetscrreg()',`Set_Scroll_Region')
728    procedure Set_Scroll_Region
729      (Win         : in Window := Standard_Window;
730       Top_Line    : in Line_Position;
731       Bottom_Line : in Line_Position);
732    --  AKA
733    --  ALIAS(`setscrreg()')
734    pragma Inline (Set_Scroll_Region);
735
736    --  MANPAGE(`curs_refresh.3x')
737
738    --  ANCHOR(`doupdate()',`Update_Screen')
739    procedure Update_Screen;
740    --  AKA
741    pragma Inline (Update_Screen);
742
743    --  ANCHOR(`wrefresh()',`Refresh')
744    procedure Refresh (Win : in Window := Standard_Window);
745    --  AKA
746    --  There is an overloaded Refresh for Pads.
747    --  The Inline pragma appears there
748    --  ALIAS(`refresh()')
749
750    --  ANCHOR(`wnoutrefresh()',`Refresh_Without_Update')
751    procedure Refresh_Without_Update
752      (Win : in Window := Standard_Window);
753    --  AKA
754    --  There is an overloaded Refresh_Without_Update for Pads.
755    --  The Inline pragma appears there
756
757    --  ANCHOR(`redrawwin()',`Redraw')
758    procedure Redraw (Win : in Window := Standard_Window);
759    --  AKA
760
761    --  ANCHOR(`wredrawln()',`Redraw')
762    procedure Redraw (Win        : in Window := Standard_Window;
763                      Begin_Line : in Line_Position;
764                      Line_Count : in Positive);
765    --  AKA
766    pragma Inline (Redraw);
767
768    --  MANPAGE(`curs_clear.3x')
769
770    --  ANCHOR(`werase()',`Erase')
771    procedure Erase (Win : in Window := Standard_Window);
772    --  AKA
773    --  ALIAS(`erase()')
774    pragma Inline (Erase);
775
776    --  ANCHOR(`wclear()',`Clear')
777    procedure Clear
778      (Win : in Window := Standard_Window);
779    --  AKA
780    --  ALIAS(`clear()')
781    pragma Inline (Clear);
782
783    --  ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen')
784    procedure Clear_To_End_Of_Screen
785      (Win : in Window := Standard_Window);
786    --  AKA
787    --  ALIAS(`clrtobot()')
788    pragma Inline (Clear_To_End_Of_Screen);
789
790    --  ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line')
791    procedure Clear_To_End_Of_Line
792      (Win : in Window := Standard_Window);
793    --  AKA
794    --  ALIAS(`clrtoeol()')
795    pragma Inline (Clear_To_End_Of_Line);
796
797    --  MANPAGE(`curs_bkgd.3x')
798
799    --  ANCHOR(`wbkgdset()',`Set_Background')
800    --  TODO: we could have Set_Background(Window; Character_Attribute_Set)
801    --  because in C it is common to see bkgdset(A_BOLD) or
802    --  bkgdset(COLOR_PAIR(n))
803    procedure Set_Background
804      (Win : in Window := Standard_Window;
805       Ch  : in Attributed_Character);
806    --  AKA
807    --  ALIAS(`bkgdset()')
808    pragma Inline (Set_Background);
809
810    --  ANCHOR(`wbkgd()',`Change_Background')
811    procedure Change_Background
812      (Win : in Window := Standard_Window;
813       Ch  : in Attributed_Character);
814    --  AKA
815    --  ALIAS(`bkgd()')
816    pragma Inline (Change_Background);
817
818    --  ANCHOR(`wbkgdget()',`Get_Background')
819    --  ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough.
820    function Get_Background (Win : Window := Standard_Window)
821      return Attributed_Character;
822    --  AKA
823    --  ALIAS(`bkgdget()')
824    pragma Inline (Get_Background);
825
826    --  MANPAGE(`curs_touch.3x')
827
828    --  ANCHOR(`untouchwin()',`Untouch')
829    procedure Untouch (Win : in Window := Standard_Window);
830    --  AKA
831    pragma Inline (Untouch);
832
833    --  ANCHOR(`touchwin()',`Touch')
834    procedure Touch (Win : in Window := Standard_Window);
835    --  AKA
836
837    --  ANCHOR(`touchline()',`Touch')
838    procedure Touch (Win   : in Window := Standard_Window;
839                     Start : in Line_Position;
840                     Count : in Positive);
841    --  AKA
842    pragma Inline (Touch);
843
844    --  ANCHOR(`wtouchln()',`Change_Line_Status')
845    procedure Change_Lines_Status (Win   : in Window := Standard_Window;
846                                   Start : in Line_Position;
847                                   Count : in Positive;
848                                   State : in Boolean);
849    --  AKA
850    pragma Inline (Change_Lines_Status);
851
852    --  ANCHOR(`is_linetouched()',`Is_Touched')
853    function Is_Touched (Win  : Window := Standard_Window;
854                         Line : Line_Position) return Boolean;
855    --  AKA
856
857    --  ANCHOR(`is_wintouched()',`Is_Touched')
858    function Is_Touched (Win : Window := Standard_Window) return Boolean;
859    --  AKA
860    pragma Inline (Is_Touched);
861
862    --  MANPAGE(`curs_overlay.3x')
863
864    --  ANCHOR(`copywin()',`Copy')
865    procedure Copy
866      (Source_Window            : in Window;
867       Destination_Window       : in Window;
868       Source_Top_Row           : in Line_Position;
869       Source_Left_Column       : in Column_Position;
870       Destination_Top_Row      : in Line_Position;
871       Destination_Left_Column  : in Column_Position;
872       Destination_Bottom_Row   : in Line_Position;
873       Destination_Right_Column : in Column_Position;
874       Non_Destructive_Mode     : in Boolean := True);
875    --  AKA
876    pragma Inline (Copy);
877
878    --  ANCHOR(`overwrite()',`Overwrite')
879    procedure Overwrite (Source_Window      : in Window;
880                         Destination_Window : in Window);
881    --  AKA
882    pragma Inline (Overwrite);
883
884    --  ANCHOR(`overlay()',`Overlay')
885    procedure Overlay (Source_Window      : in Window;
886                       Destination_Window : in Window);
887    --  AKA
888    pragma Inline (Overlay);
889
890    --  MANPAGE(`curs_deleteln.3x')
891
892    --  ANCHOR(`winsdelln()',`Insert_Delete_Lines')
893    procedure Insert_Delete_Lines
894      (Win   : in Window  := Standard_Window;
895       Lines : in Integer := 1); --  default is to insert one line above
896    --  AKA
897    --  ALIAS(`insdelln()')
898    pragma Inline (Insert_Delete_Lines);
899
900    --  ANCHOR(`wdeleteln()',`Delete_Line')
901    procedure Delete_Line (Win : in Window := Standard_Window);
902    --  AKA
903    --  ALIAS(`deleteln()')
904    pragma Inline (Delete_Line);
905
906    --  ANCHOR(`winsertln()',`Insert_Line')
907    procedure Insert_Line (Win : in Window := Standard_Window);
908    --  AKA
909    --  ALIAS(`insertln()')
910    pragma Inline (Insert_Line);
911
912    --  MANPAGE(`curs_getyx.3x')
913
914    --  ANCHOR(`getmaxyx()',`Get_Size')
915    procedure Get_Size
916      (Win               : in Window := Standard_Window;
917       Number_Of_Lines   : out Line_Count;
918       Number_Of_Columns : out Column_Count);
919    --  AKA
920    pragma Inline (Get_Size);
921
922    --  ANCHOR(`getbegyx()',`Get_Window_Position')
923    procedure Get_Window_Position
924      (Win             : in Window := Standard_Window;
925       Top_Left_Line   : out Line_Position;
926       Top_Left_Column : out Column_Position);
927    --  AKA
928    pragma Inline (Get_Window_Position);
929
930    --  ANCHOR(`getyx()',`Get_Cursor_Position')
931    procedure Get_Cursor_Position
932      (Win    : in  Window := Standard_Window;
933       Line   : out Line_Position;
934       Column : out Column_Position);
935    --  AKA
936    pragma Inline (Get_Cursor_Position);
937
938    --  ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent')
939    procedure Get_Origin_Relative_To_Parent
940      (Win                : in  Window;
941       Top_Left_Line      : out Line_Position;
942       Top_Left_Column    : out Column_Position;
943       Is_Not_A_Subwindow : out Boolean);
944    --  AKA
945    --  Instead of placing -1 in the coordinates as return, we use a boolean
946    --  to return the info that the window has no parent.
947    pragma Inline (Get_Origin_Relative_To_Parent);
948
949    --  MANPAGE(`curs_pad.3x')
950
951    --  ANCHOR(`newpad()',`New_Pad')
952    function New_Pad (Lines   : Line_Count;
953                      Columns : Column_Count) return Window;
954    --  AKA
955    pragma Inline (New_Pad);
956
957    --  ANCHOR(`subpad()',`Sub_Pad')
958    function Sub_Pad
959      (Pad                   : Window;
960       Number_Of_Lines       : Line_Count;
961       Number_Of_Columns     : Column_Count;
962       First_Line_Position   : Line_Position;
963       First_Column_Position : Column_Position) return Window;
964    --  AKA
965    pragma Inline (Sub_Pad);
966
967    --  ANCHOR(`prefresh()',`Refresh')
968    procedure Refresh
969      (Pad                      : in Window;
970       Source_Top_Row           : in Line_Position;
971       Source_Left_Column       : in Column_Position;
972       Destination_Top_Row      : in Line_Position;
973       Destination_Left_Column  : in Column_Position;
974       Destination_Bottom_Row   : in Line_Position;
975       Destination_Right_Column : in Column_Position);
976    --  AKA
977    pragma Inline (Refresh);
978
979    --  ANCHOR(`pnoutrefresh()',`Refresh_Without_Update')
980    procedure Refresh_Without_Update
981      (Pad                      : in Window;
982       Source_Top_Row           : in Line_Position;
983       Source_Left_Column       : in Column_Position;
984       Destination_Top_Row      : in Line_Position;
985       Destination_Left_Column  : in Column_Position;
986       Destination_Bottom_Row   : in Line_Position;
987       Destination_Right_Column : in Column_Position);
988    --  AKA
989    pragma Inline (Refresh_Without_Update);
990
991    --  ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It')
992    procedure Add_Character_To_Pad_And_Echo_It
993      (Pad : in Window;
994       Ch  : in Attributed_Character);
995    --  AKA
996
997    procedure Add_Character_To_Pad_And_Echo_It
998      (Pad : in Window;
999       Ch  : in Character);
1000    pragma Inline (Add_Character_To_Pad_And_Echo_It);
1001
1002    --  MANPAGE(`curs_scroll.3x')
1003
1004    --  ANCHOR(`wscrl()',`Scroll')
1005    procedure Scroll (Win    : in Window  := Standard_Window;
1006                      Amount : in Integer := 1);
1007    --  AKA
1008    --  ALIAS(`scroll()')
1009    --  ALIAS(`scrl()')
1010    pragma Inline (Scroll);
1011
1012    --  MANPAGE(`curs_delch.3x')
1013
1014    --  ANCHOR(`wdelch()',`Delete_Character')
1015    procedure Delete_Character (Win : in Window := Standard_Window);
1016    --  AKA
1017    --  ALIAS(`delch()')
1018
1019    --  ANCHOR(`mvwdelch()',`Delete_Character')
1020    procedure Delete_Character
1021      (Win    : in Window := Standard_Window;
1022       Line   : in Line_Position;
1023       Column : in Column_Position);
1024    --  AKA
1025    --  ALIAS(`mvdelch()')
1026    pragma Inline (Delete_Character);
1027
1028    --  MANPAGE(`curs_inch.3x')
1029
1030    --  ANCHOR(`winch()',`Peek')
1031    function Peek (Win : Window := Standard_Window)
1032      return Attributed_Character;
1033    --  ALIAS(`inch()')
1034    --  AKA
1035
1036    --  ANCHOR(`mvwinch()',`Peek')
1037    function Peek
1038      (Win    : Window := Standard_Window;
1039       Line   : Line_Position;
1040       Column : Column_Position) return Attributed_Character;
1041    --  AKA
1042    --  ALIAS(`mvinch()')
1043    --  More Peek's follow, pragma Inline appears later.
1044
1045    --  MANPAGE(`curs_insch.3x')
1046
1047    --  ANCHOR(`winsch()',`Insert')
1048    procedure Insert (Win : in Window := Standard_Window;
1049                      Ch  : in Attributed_Character);
1050    --  AKA
1051    --  ALIAS(`insch()')
1052
1053    --  ANCHOR(`mvwinsch()',`Insert')
1054    procedure Insert (Win    : in Window := Standard_Window;
1055                      Line   : in Line_Position;
1056                      Column : in Column_Position;
1057                      Ch     : in Attributed_Character);
1058    --  AKA
1059    --  ALIAS(`mvinsch()')
1060
1061    --  MANPAGE(`curs_insstr.3x')
1062
1063    --  ANCHOR(`winsnstr()',`Insert')
1064    procedure Insert (Win : in Window := Standard_Window;
1065                      Str : in String;
1066                      Len : in Integer := -1);
1067    --  AKA
1068    --  ALIAS(`winsstr()')
1069    --  ALIAS(`insnstr()')
1070    --  ALIAS(`insstr()')
1071
1072    --  ANCHOR(`mvwinsnstr()',`Insert')
1073    procedure Insert (Win    : in Window := Standard_Window;
1074                      Line   : in Line_Position;
1075                      Column : in Column_Position;
1076                      Str    : in String;
1077                      Len    : in Integer := -1);
1078    --  AKA
1079    --  ALIAS(`mvwinsstr()')
1080    --  ALIAS(`mvinsnstr()')
1081    --  ALIAS(`mvinsstr()')
1082    pragma Inline (Insert);
1083
1084    --  MANPAGE(`curs_instr.3x')
1085
1086    --  ANCHOR(`winnstr()',`Peek')
1087    procedure Peek (Win : in  Window := Standard_Window;
1088                    Str : out String;
1089                    Len : in  Integer := -1);
1090    --  AKA
1091    --  ALIAS(`winstr()')
1092    --  ALIAS(`innstr()')
1093    --  ALIAS(`instr()')
1094
1095    --  ANCHOR(`mvwinnstr()',`Peek')
1096    procedure Peek (Win    : in  Window := Standard_Window;
1097                    Line   : in  Line_Position;
1098                    Column : in  Column_Position;
1099                    Str    : out String;
1100                    Len    : in  Integer := -1);
1101    --  AKA
1102    --  ALIAS(`mvwinstr()')
1103    --  ALIAS(`mvinnstr()')
1104    --  ALIAS(`mvinstr()')
1105
1106    --  MANPAGE(`curs_inchstr.3x')
1107
1108    --  ANCHOR(`winchnstr()',`Peek')
1109    procedure Peek (Win : in  Window := Standard_Window;
1110                    Str : out Attributed_String;
1111                    Len : in  Integer := -1);
1112    --  AKA
1113    --  ALIAS(`winchstr()')
1114    --  ALIAS(`inchnstr()')
1115    --  ALIAS(`inchstr()')
1116
1117    --  ANCHOR(`mvwinchnstr()',`Peek')
1118    procedure Peek (Win    : in  Window := Standard_Window;
1119                    Line   : in  Line_Position;
1120                    Column : in  Column_Position;
1121                    Str    : out Attributed_String;
1122                    Len    : in  Integer := -1);
1123    --  AKA
1124    --  ALIAS(`mvwinchstr()')
1125    --  ALIAS(`mvinchnstr()')
1126    --  ALIAS(`mvinchstr()')
1127    --  We don't inline the Peek procedures
1128
1129    --  MANPAGE(`curs_getstr.3x')
1130
1131    --  ANCHOR(`wgetnstr()',`Get')
1132    procedure Get (Win : in  Window := Standard_Window;
1133                   Str : out String;
1134                   Len : in  Integer := -1);
1135    --  AKA
1136    --  ALIAS(`wgetstr()')
1137    --  ALIAS(`getnstr()')
1138    --  ALIAS(`getstr()')
1139    --  actually getstr is not supported because that results in buffer
1140    --  overflows.
1141
1142    --  ANCHOR(`mvwgetnstr()',`Get')
1143    procedure Get (Win    : in  Window := Standard_Window;
1144                   Line   : in  Line_Position;
1145                   Column : in  Column_Position;
1146                   Str    : out String;
1147                   Len    : in  Integer := -1);
1148    --  AKA
1149    --  ALIAS(`mvwgetstr()')
1150    --  ALIAS(`mvgetnstr()')
1151    --  ALIAS(`mvgetstr()')
1152    --  Get is not inlined
1153
1154    --  MANPAGE(`curs_slk.3x')
1155
1156    --  Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set
1157
1158    type Soft_Label_Key_Format is (Three_Two_Three,
1159                                   Four_Four,
1160                                   PC_Style,              --  ncurses specific
1161                                   PC_Style_With_Index);  --  "
1162    type Label_Number is new Positive range 1 .. 12;
1163    type Label_Justification is (Left, Centered, Right);
1164
1165    --  ANCHOR(`slk_init()',`Init_Soft_Label_Keys')
1166    procedure Init_Soft_Label_Keys
1167      (Format : in Soft_Label_Key_Format := Three_Two_Three);
1168    --  AKA
1169    pragma Inline (Init_Soft_Label_Keys);
1170
1171    --  ANCHOR(`slk_set()',`Set_Soft_Label_Key')
1172    procedure Set_Soft_Label_Key (Label : in Label_Number;
1173                                  Text  : in String;
1174                                  Fmt   : in Label_Justification := Left);
1175    --  AKA
1176    --  We don't inline this procedure
1177
1178    --  ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key')
1179    procedure Refresh_Soft_Label_Keys;
1180    --  AKA
1181    pragma Inline (Refresh_Soft_Label_Keys);
1182
1183    --  ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update')
1184    procedure Refresh_Soft_Label_Keys_Without_Update;
1185    --  AKA
1186    pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
1187
1188    --  ANCHOR(`slk_label()',`Get_Soft_Label_Key')
1189    procedure Get_Soft_Label_Key (Label : in Label_Number;
1190                                  Text  : out String);
1191    --  AKA
1192
1193    --  ANCHOR(`slk_label()',`Get_Soft_Label_Key')
1194    function Get_Soft_Label_Key (Label : in Label_Number) return String;
1195    --  AKA
1196    --  Same as function
1197    pragma Inline (Get_Soft_Label_Key);
1198
1199    --  ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys')
1200    procedure Clear_Soft_Label_Keys;
1201    --  AKA
1202    pragma Inline (Clear_Soft_Label_Keys);
1203
1204    --  ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys')
1205    procedure Restore_Soft_Label_Keys;
1206    --  AKA
1207    pragma Inline (Restore_Soft_Label_Keys);
1208
1209    --  ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys')
1210    procedure Touch_Soft_Label_Keys;
1211    --  AKA
1212    pragma Inline (Touch_Soft_Label_Keys);
1213
1214    --  ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes')
1215    procedure Switch_Soft_Label_Key_Attributes
1216      (Attr : in Character_Attribute_Set;
1217       On   : in Boolean := True);
1218    --  AKA
1219    --  ALIAS(`slk_attroff()')
1220    pragma Inline (Switch_Soft_Label_Key_Attributes);
1221
1222    --  ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes')
1223    procedure Set_Soft_Label_Key_Attributes
1224      (Attr  : in Character_Attribute_Set := Normal_Video;
1225       Color : in Color_Pair := Color_Pair'First);
1226    --  AKA
1227    pragma Inline (Set_Soft_Label_Key_Attributes);
1228
1229    --  ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1230    function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
1231    --  AKA
1232
1233    --  ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1234    function Get_Soft_Label_Key_Attributes return Color_Pair;
1235    --  AKA
1236    pragma Inline (Get_Soft_Label_Key_Attributes);
1237
1238    --  ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color')
1239    procedure Set_Soft_Label_Key_Color (Pair : in Color_Pair);
1240    --  AKA
1241    pragma Inline (Set_Soft_Label_Key_Color);
1242
1243    --  MANPAGE(`keybound.3x')
1244    --  Not Implemented: keybound
1245
1246    --  MANPAGE(`keyok.3x')
1247
1248    --  ANCHOR(`keyok()',`Enable_Key')
1249    procedure Enable_Key (Key    : in Special_Key_Code;
1250                          Enable : in Boolean := True);
1251    --  AKA
1252    pragma Inline (Enable_Key);
1253
1254    --  MANPAGE(`define_key.3x')
1255
1256    --  ANCHOR(`define_key()',`Define_Key')
1257    procedure Define_Key (Definition : in String;
1258                          Key        : in Special_Key_Code);
1259    --  AKA
1260    pragma Inline (Define_Key);
1261
1262    --  MANPAGE(`curs_util.3x')
1263
1264    --  | Not implemented : filter, use_env
1265    --  | putwin, getwin are in the child package PutWin
1266    --
1267
1268    --  ANCHOR(`keyname()',`Key_Name')
1269    procedure Key_Name (Key  : in  Real_Key_Code;
1270                        Name : out String);
1271    --  AKA
1272    --  The external name for a real keystroke.
1273
1274    --  ANCHOR(`keyname()',`Key_Name')
1275    function Key_Name (Key  : in  Real_Key_Code) return String;
1276    --  AKA
1277    --  Same as function
1278    --  We don't inline this routine
1279
1280    --  ANCHOR(`unctrl()',`Un_Control')
1281    procedure Un_Control (Ch  : in Attributed_Character;
1282                          Str : out String);
1283    --  AKA
1284
1285    --  ANCHOR(`unctrl()',`Un_Control')
1286    function Un_Control (Ch  : in Attributed_Character) return String;
1287    --  AKA
1288    --  Same as function
1289    pragma Inline (Un_Control);
1290
1291    --  ANCHOR(`delay_output()',`Delay_Output')
1292    procedure Delay_Output (Msecs : in Natural);
1293    --  AKA
1294    pragma Inline (Delay_Output);
1295
1296    --  ANCHOR(`flushinp()',`Flush_Input')
1297    procedure Flush_Input;
1298    --  AKA
1299    pragma Inline (Flush_Input);
1300
1301    --  MANPAGE(`curs_termattrs.3x')
1302
1303    --  ANCHOR(`baudrate()',`Baudrate')
1304    function Baudrate return Natural;
1305    --  AKA
1306    pragma Inline (Baudrate);
1307
1308    --  ANCHOR(`erasechar()',`Erase_Character')
1309    function Erase_Character return Character;
1310    --  AKA
1311    pragma Inline (Erase_Character);
1312
1313    --  ANCHOR(`killchar()',`Kill_Character')
1314    function Kill_Character return Character;
1315    --  AKA
1316    pragma Inline (Kill_Character);
1317
1318    --  ANCHOR(`has_ic()',`Has_Insert_Character')
1319    function Has_Insert_Character return Boolean;
1320    --  AKA
1321    pragma Inline (Has_Insert_Character);
1322
1323    --  ANCHOR(`has_il()',`Has_Insert_Line')
1324    function Has_Insert_Line return Boolean;
1325    --  AKA
1326    pragma Inline (Has_Insert_Line);
1327
1328    --  ANCHOR(`termattrs()',`Supported_Attributes')
1329    function Supported_Attributes return Character_Attribute_Set;
1330    --  AKA
1331    pragma Inline (Supported_Attributes);
1332
1333    --  ANCHOR(`longname()',`Long_Name')
1334    procedure Long_Name (Name : out String);
1335    --  AKA
1336
1337    --  ANCHOR(`longname()',`Long_Name')
1338    function Long_Name return String;
1339    --  AKA
1340    --  Same as function
1341    pragma Inline (Long_Name);
1342
1343    --  ANCHOR(`termname()',`Terminal_Name')
1344    procedure Terminal_Name (Name : out String);
1345    --  AKA
1346
1347    --  ANCHOR(`termname()',`Terminal_Name')
1348    function Terminal_Name return String;
1349    --  AKA
1350    --  Same as function
1351    pragma Inline (Terminal_Name);
1352
1353    --  MANPAGE(`curs_color.3x')
1354
1355    --  COLOR_PAIR
1356    --  COLOR_PAIR(n) in C is the same as
1357    --  Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video)
1358    --  In C you often see something like c = c | COLOR_PAIR(n);
1359    --  This is equivalent to c.Color := n;
1360
1361    --  ANCHOR(`start_color()',`Start_Color')
1362    procedure Start_Color;
1363    --  AKA
1364    pragma Import (C, Start_Color, "start_color");
1365
1366    --  ANCHOR(`init_pair()',`Init_Pair')
1367    procedure Init_Pair (Pair : in Redefinable_Color_Pair;
1368                         Fore : in Color_Number;
1369                         Back : in Color_Number);
1370    --  AKA
1371    pragma Inline (Init_Pair);
1372
1373    --  ANCHOR(`pair_content()',`Pair_Content')
1374    procedure Pair_Content (Pair : in Color_Pair;
1375                            Fore : out Color_Number;
1376                            Back : out Color_Number);
1377    --  AKA
1378    pragma Inline (Pair_Content);
1379
1380    --  ANCHOR(`has_colors()',`Has_Colors')
1381    function Has_Colors return Boolean;
1382    --  AKA
1383    pragma Inline (Has_Colors);
1384
1385    --  ANCHOR(`init_color()',`Init_Color')
1386    procedure Init_Color (Color : in Color_Number;
1387                          Red   : in RGB_Value;
1388                          Green : in RGB_Value;
1389                          Blue  : in RGB_Value);
1390    --  AKA
1391    pragma Inline (Init_Color);
1392
1393    --  ANCHOR(`can_change_color()',`Can_Change_Color')
1394    function Can_Change_Color return Boolean;
1395    --  AKA
1396    pragma Inline (Can_Change_Color);
1397
1398    --  ANCHOR(`color_content()',`Color_Content')
1399    procedure Color_Content (Color : in  Color_Number;
1400                             Red   : out RGB_Value;
1401                             Green : out RGB_Value;
1402                             Blue  : out RGB_Value);
1403    --  AKA
1404    pragma Inline (Color_Content);
1405
1406    --  MANPAGE(`curs_kernel.3x')
1407    --  | Not implemented: getsyx, setsyx
1408    --
1409    type Curses_Mode is (Curses, Shell);
1410
1411    --  ANCHOR(`def_prog_mode()',`Save_Curses_Mode')
1412    procedure Save_Curses_Mode (Mode : in Curses_Mode);
1413    --  AKA
1414    --  ALIAS(`def_shell_mode()')
1415    pragma Inline (Save_Curses_Mode);
1416
1417    --  ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode')
1418    procedure Reset_Curses_Mode (Mode : in Curses_Mode);
1419    --  AKA
1420    --  ALIAS(`reset_shell_mode()')
1421    pragma Inline (Reset_Curses_Mode);
1422
1423    --  ANCHOR(`savetty()',`Save_Terminal_State')
1424    procedure Save_Terminal_State;
1425    --  AKA
1426    pragma Inline (Save_Terminal_State);
1427
1428    --  ANCHOR(`resetty();',`Reset_Terminal_State')
1429    procedure Reset_Terminal_State;
1430    --  AKA
1431    pragma Inline (Reset_Terminal_State);
1432
1433    type Stdscr_Init_Proc is access
1434       function (Win     : Window;
1435                 Columns : Column_Count) return Integer;
1436    pragma Convention (C, Stdscr_Init_Proc);
1437    --  N.B.: the return value is actually ignored, but it seems to be
1438    --        a good practice to return 0 if you think all went fine
1439    --        and -1 otherwise.
1440
1441    --  ANCHOR(`ripoffline()',`Rip_Off_Lines')
1442    procedure Rip_Off_Lines (Lines : in Integer;
1443                             Proc  : in Stdscr_Init_Proc);
1444    --  AKA
1445    --  N.B.: to be more precise, this uses a ncurses specific enhancement of
1446    --        ripoffline(), in which the Lines argument absolute value is the
1447    --        number of lines to be ripped of. The official ripoffline() only
1448    --        uses the sign of Lines to rip of a single line from bottom or top.
1449    pragma Inline (Rip_Off_Lines);
1450
1451    type Cursor_Visibility is (Invisible, Normal, Very_Visible);
1452
1453    --  ANCHOR(`curs_set()',`Set_Cursor_Visibility')
1454    procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
1455    --  AKA
1456    pragma Inline (Set_Cursor_Visibility);
1457
1458    --  ANCHOR(`napms()',`Nap_Milli_Seconds')
1459    procedure Nap_Milli_Seconds (Ms : in Natural);
1460    --  AKA
1461    pragma Inline (Nap_Milli_Seconds);
1462
1463    --  |=====================================================================
1464    --  | Some useful helpers.
1465    --  |=====================================================================
1466    type Transform_Direction is (From_Screen, To_Screen);
1467    procedure Transform_Coordinates
1468      (W      : in Window := Standard_Window;
1469       Line   : in out Line_Position;
1470       Column : in out Column_Position;
1471       Dir    : in Transform_Direction := From_Screen);
1472    --  This procedure transforms screen coordinates into coordinates relative
1473    --  to the window and vice versa, depending on the Dir parameter.
1474    --  Screen coordinates are the position informations on the physical device.
1475    --  An Curses_Exception will be raised if Line and Column are not in the
1476    --  Window or if you pass the Null_Window as argument.
1477    --  We don't inline this procedure
1478
1479    --  MANPAGE(`dft_fgbg.3x')
1480
1481    --  ANCHOR(`use_default_colors()',`Use_Default_Colors')
1482    procedure Use_Default_Colors;
1483    --  AKA
1484    pragma Inline (Use_Default_Colors);
1485
1486    --  ANCHOR(`assume_default_colors()',`Assume_Default_Colors')
1487    procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
1488                                     Back : Color_Number := Default_Color);
1489    --  AKA
1490    pragma Inline (Assume_Default_Colors);
1491
1492    --  MANPAGE(`curs_extend.3x')
1493
1494    --  ANCHOR(`curses_version()',`Curses_Version')
1495    function Curses_Version return String;
1496    --  AKA
1497
1498    --  ANCHOR(`use_extended_names()',`Use_Extended_Names')
1499    --  The returnvalue is the previous setting of the flag
1500    function Use_Extended_Names (Enable : Boolean) return Boolean;
1501    --  AKA
1502
1503    --  MANPAGE(`curs_scr_dump.3x')
1504
1505    --  ANCHOR(`scr_dump()',`Screen_Dump_To_File')
1506    procedure Screen_Dump_To_File (Filename : in String);
1507    --  AKA
1508
1509    --  ANCHOR(`scr_restore()',`Screen_Restore_From_File')
1510    procedure Screen_Restore_From_File (Filename : in String);
1511    --  AKA
1512
1513    --  ANCHOR(`scr_init()',`Screen_Init_From_File')
1514    procedure Screen_Init_From_File (Filename : in String);
1515    --  AKA
1516
1517    --  ANCHOR(`scr_set()',`Screen_Set_File')
1518    procedure Screen_Set_File (Filename : in String);
1519    --  AKA
1520
1521    --  MANPAGE(`curs_print.3x')
1522    --  Not implemented:  mcprint
1523
1524    --  MANPAGE(`curs_printw.3x')
1525    --  Not implemented: printw,  wprintw, mvprintw, mvwprintw, vwprintw,
1526    --                   vw_printw
1527    --  Please use the Ada style Text_IO child packages for formatted
1528    --  printing. It doesn't make a lot of sense to map the printf style
1529    --  C functions to Ada.
1530
1531    --  MANPAGE(`curs_scanw.3x')
1532    --  Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw
1533
1534
1535    --  MANPAGE(`resizeterm.3x')
1536    --  Not Implemented: resizeterm
1537
1538    --  MANPAGE(`wresize.3x')
1539
1540    --  ANCHOR(`wresize()',`Resize')
1541    procedure Resize (Win               : Window := Standard_Window;
1542                      Number_Of_Lines   : Line_Count;
1543                      Number_Of_Columns : Column_Count);
1544    --  AKA
1545
1546 private
1547    type Window is new System.Storage_Elements.Integer_Address;
1548    Null_Window : constant Window := 0;
1549
1550    --  The next constants are generated and may be different on your
1551    --  architecture.
1552    --
1553 include(`Window_Offsets')dnl
1554    Curses_Bool_False : constant Curses_Bool := 0;
1555
1556 end Terminal_Interface.Curses;