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