]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/gen/terminal_interface-curses.ads.m4
e4f7ce9dfbdcffb162fdfad4cf265834892a2dc0
[ncurses.git] / Ada95 / gen / terminal_interface-curses.ads.m4
1 --  -*- ada -*-
2 define(`HTMLNAME',`terminal_interface-curses_s.html')dnl
3 include(M4MACRO)------------------------------------------------------------------------------
4 --                                                                          --
5 --                           GNAT ncurses Binding                           --
6 --                                                                          --
7 --                         Terminal_Interface.Curses                        --
8 --                                                                          --
9 --                                 S P E C                                  --
10 --                                                                          --
11 --  Version 00.92                                                           --
12 --                                                                          --
13 --  The ncurses Ada95 binding is copyrighted 1996 by                        --
14 --  Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                     --
15 --                                                                          --
16 --  Permission is hereby granted to reproduce and distribute this           --
17 --  binding by any means and for any fee, whether alone or as part          --
18 --  of a larger distribution, in source or in binary form, PROVIDED         --
19 --  this notice is included with any such distribution, and is not          --
20 --  removed from any of its header files. Mention of ncurses and the        --
21 --  author of this binding in any applications linked with it is            --
22 --  highly appreciated.                                                     --
23 --                                                                          --
24 --  This binding comes AS IS with no warranty, implied or expressed.        --
25 ------------------------------------------------------------------------------
26 --  Version Control:
27 --  $Revision: 1.7 $
28 ------------------------------------------------------------------------------
29 include(`Base_Defs')
30 with System;
31 with Interfaces.C;   --  We need this for some assertions.
32
33 package Terminal_Interface.Curses is
34
35 include(`Linker_Options')
36    type Window is private;
37    Null_Window : constant Window;
38
39    type Line_Position   is new Natural; --  line coordinate
40    type Column_Position is new Natural; --  column coordinate
41
42    subtype Line_Count   is Line_Position   range 1 .. Line_Position'Last;
43    --  Type to count lines. We do not allow null windows, so must be positive
44    subtype Column_Count is Column_Position range 1 .. Column_Position'Last;
45    --  Type to count columns. We do not allow null windows, so must be positive
46
47    type Key_Code is new Natural;
48    --  That is anything including real characters, special keys and logical
49    --  request codes.
50
51    subtype Real_Key_Code is Key_Code range 0 .. M4_KEY_MAX;
52    --  This are the codes that potentially represent a real keystroke.
53    --  Not all codes may be possible on a specific terminal. To check the
54    --  availability of a special key, the Has_Key function is provided.
55
56    subtype Special_Key_Code is Real_Key_Code
57      range M4_SPECIAL_FIRST .. Real_Key_Code'Last;
58    --  Type for a function- or special key number
59
60    subtype Normal_Key_Code is Real_Key_Code range
61      Character'Pos (Character'First) .. Character'Pos (Character'Last);
62    --  This are the codes for regular (incl. non-graphical) characters.
63
64    --  Constants for function- and special keys
65    --
66    Key_None                       : constant Special_Key_Code := M4_SPECIAL_FIRST;
67 include(`Key_Definitions')
68    Key_Max                        : constant Special_Key_Code
69      := Special_Key_Code'Last;
70
71    subtype User_Key_Code is Key_Code
72      range (Key_Max + 129) .. Key_Code'Last;
73    --  This is reserved for user defined key codes. The range between Key_Max
74    --  and the first user code is reserved for subsystems like menu and forms.
75
76    --  For those who like to use the original key names we produce them were
77    --  they differ from the original. Please note that they may differ in
78    --  lower/upper case.
79 include(`Old_Keys')
80
81 ------------------------------------------------------------------------------
82
83    type Color_Number is range 0 .. Integer (Interfaces.C.short'Last);
84    for Color_Number'Size use Interfaces.C.short'Size;
85    --  (n)curses uses a short for the color index
86    --  The model is, that a Color_Number is an index into an array of
87    --  (potentially) definable colors. Some of those indices are
88    --  predefined (see below), although they may not really exist.
89
90 include(`Color_Defs')
91    type RGB_Value is range 0 .. Integer (Interfaces.C.Short'Last);
92    for RGB_Value'Size use Interfaces.C.short'Size;
93    --  Some system may allow to redefine a color by setting RGB values.
94
95    type Color_Pair is range 0 .. 255;
96    for Color_Pair'Size use 8;
97    subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255;
98    --  (n)curses reserves 1 Byte for the color-pair number. Color Pair 0
99    --  is fixed (Black & White). A color pair is simply a combination of
100    --  two colors described by Color_Numbers, one for the foreground and
101    --  the other for the background
102
103 include(`Character_Attribute_Set_Rep')
104    --  (n)curses uses half of an integer for attributes.
105
106    Normal_Video : constant Character_Attribute_Set := (others => False);
107
108    type Attributed_Character is
109       record
110          Attr  : Character_Attribute_Set := Normal_Video;
111          Color : Color_Pair := 0;
112          Ch    : Character  := ' ';
113       end record;
114    pragma Convention (C, Attributed_Character);
115    --  This is the counterpart for the chtype in C.
116
117 include(`AC_Rep')
118    Default_Character : constant Attributed_Character
119      := (Ch    => Character'First,
120          Color => Color_Pair'First,
121          Attr  => Normal_Video);
122
123    type Attributed_String is array (Positive range <>) of Attributed_Character;
124    pragma Pack (Attributed_String);
125    --  In this binding we allow strings of attributed characters.
126
127    ------------------
128    --  Exceptions  --
129    ------------------
130    Curses_Exception : exception;
131
132    --  Those exceptions are raised by the ETI (Extended Terminal Interface)
133    --  subpackets for Menu and Forms handling.
134    --
135    Eti_System_Error    : exception;
136    Eti_Bad_Argument    : exception;
137    Eti_Posted          : exception;
138    Eti_Connected       : exception;
139    Eti_Bad_State       : exception;
140    Eti_No_Room         : exception;
141    Eti_Not_Posted      : exception;
142    Eti_Unknown_Command : exception;
143    Eti_No_Match        : exception;
144    Eti_Not_Selectable  : exception;
145    Eti_Not_Connected   : exception;
146    Eti_Request_Denied  : exception;
147    Eti_Invalid_Field   : exception;
148    Eti_Current         : exception;
149
150    --------------------------------------------------------------------------
151    --  External C variables
152    --  Conceptually even in C this are kind of constants, but they are
153    --  initialized and sometimes changed by the library routines at runtime
154    --  depending on the type of terminal. I believe the best way to model
155    --  this is to use functions.
156    --------------------------------------------------------------------------
157
158    function Lines            return Line_Count;
159    pragma Inline (Lines);
160
161    function Columns          return Column_Count;
162    pragma Inline (Columns);
163
164    function Tab_Size         return Natural;
165    pragma Inline (Tab_Size);
166
167    function Number_Of_Colors return Natural;
168    pragma Inline (Number_Of_Colors);
169
170    function Number_Of_Color_Pairs return Natural;
171    pragma Inline (Number_Of_Color_Pairs);
172
173    ACS_Map : array (Character'Val (0) .. Character'Val (127)) of
174      Attributed_Character;
175    pragma Import (C, ACS_Map, "acs_map");
176    --
177    --
178    --  Constants for several symbols from the Alternate Character Set
179    --  You must use this constants as indices into the ACS_Map array
180    --  to get the corresponding attributed character at runtime.
181    --
182 include(`ACS_Map')
183
184    --  MANPAGE(`curs_initscr.3x')
185    --  | Not implemented: newterm, set_term, delscreen
186
187    --  ANCHOR(`stdscr',`Standard_Window')
188    function Standard_Window return Window;
189    --  AKA
190    pragma Inline (Standard_Window);
191
192    --  ANCHOR(`initscr()',`Init_Screen')
193    procedure Init_Screen;
194
195    --  ANCHOR(`initscr()',`Init_Windows')
196    procedure Init_Windows renames Init_Screen;
197    --  AKA
198
199    --  ANCHOR(`endwin()',`End_Windows')
200    procedure End_Windows;
201    --  AKA
202    procedure End_Screen renames End_Windows;
203
204    --  ANCHOR(`isendwin()',`Is_End_Window')
205    function Is_End_Window return Boolean;
206    --  AKA
207
208    --  MANPAGE(`curs_move.3x')
209
210    --  ANCHOR(`wmove()',`Move_Cursor')
211    procedure Move_Cursor (Win    : in Window := Standard_Window;
212                           Line   : in Line_Position;
213                           Column : in Column_Position);
214    --  AKA
215
216    --  MANPAGE(`curs_addch.3x')
217
218    --  ANCHOR(`waddch()',`Add')
219    procedure Add (Win :  in Window := Standard_Window;
220                   Ch  :  in Attributed_Character);
221    --  AKA
222
223    procedure Add (Win :  in Window := Standard_Window;
224                   Ch  :  in Character);
225    --  Add a single character at the current logical cursor position to
226    --  the window. Use the current windows attributes.
227
228    --  ANCHOR(`mvwaddch()',`Add')
229    procedure Add
230      (Win    : in Window := Standard_Window;
231       Line   : in Line_Position;
232       Column : in Column_Position;
233       Ch     : in Attributed_Character);
234    --  AKA
235
236    procedure Add
237      (Win    : in Window := Standard_Window;
238       Line   : in Line_Position;
239       Column : in Column_Position;
240       Ch     : in Character);
241    --  Move to the position and add a single character into the window
242
243    --  ANCHOR(`wechochar()',`Add_With_Immediate_Echo')
244    procedure Add_With_Immediate_Echo
245      (Win : in Window := Standard_Window;
246       Ch  : in Attributed_Character);
247    --  AKA
248
249    procedure Add_With_Immediate_Echo
250      (Win : in Window := Standard_Window;
251       Ch  : in Character);
252    --  Add a character and do an immediate resfresh of the screen.
253
254    --  MANPAGE(`curs_window.3x')
255
256    --  ANCHOR(`newwin()',`Create')
257    function Create
258      (Number_Of_Lines       : Line_Count;
259       Number_Of_Columns     : Column_Count;
260       First_Line_Position   : Line_Position;
261       First_Column_Position : Column_Position) return Window;
262    --  AKA
263
264    function New_Window
265      (Number_Of_Lines       : Line_Count;
266       Number_Of_Columns     : Column_Count;
267       First_Line_Position   : Line_Position;
268       First_Column_Position : Column_Position) return Window
269      renames Create;
270
271    --  ANCHOR(`delwin()',`Delete')
272    procedure Delete (Win : in out Window);
273    --  AKA
274    --  Reset Win to Null_Window
275
276    --  ANCHOR(`subwin()',`Sub_Window')
277    function Sub_Window
278      (Win                   : Window := Standard_Window;
279       Number_Of_Lines       : Line_Count;
280       Number_Of_Columns     : Column_Count;
281       First_Line_Position   : Line_Position;
282       First_Column_Position : Column_Position) return Window;
283    --  AKA
284
285    --  ANCHOR(`derwin()',`Derived_Window')
286    function Derived_Window
287      (Win                   : Window := Standard_Window;
288       Number_Of_Lines       : Line_Count;
289       Number_Of_Columns     : Column_Count;
290       First_Line_Position   : Line_Position;
291       First_Column_Position : Column_Position) return Window;
292    --  AKA
293
294    --  ANCHOR(`dupwin()',`Duplicate')
295    function Duplicate (Win : Window) return Window;
296    --  AKA
297
298    --  ANCHOR(`mvwin()',`Move_Window')
299    procedure Move_Window (Win    : in Window;
300                           Line   : in Line_Position;
301                           Column : in Column_Position);
302    --  AKA
303
304    --  ANCHOR(`mvderwin()',`Move_Derived_Window')
305    procedure Move_Derived_Window (Win    : in Window;
306                                   Line   : in Line_Position;
307                                   Column : in Column_Position);
308    --  AKA
309
310    --  ANCHOR(`wsyncup()',`Synchronize_Upwards')
311    procedure Synchronize_Upwards (Win : in Window);
312    --  AKA
313    pragma Import (C, Synchronize_Upwards, "wsyncup");
314
315    --  ANCHOR(`wsyncdown()',`Synchronize_Downwards')
316    procedure Synchronize_Downwards (Win : in Window);
317    --  AKA
318    pragma Import (C, Synchronize_Downwards, "wsyncdown");
319
320    --  ANCHOR(`syncok()',`Set_Synch_Mode')
321    procedure Set_Synch_Mode (Win  : in Window := Standard_Window;
322                              Mode : in Boolean := False);
323    --  AKA
324
325    --  MANPAGE(`curs_addstr.3x')
326
327    --  ANCHOR(`waddnstr()',`Add')
328    procedure Add (Win : in Window := Standard_Window;
329                   Str : in String;
330                   Len : in Integer := -1);
331    --  AKA
332    --  ALIAS(`waddstr()')
333
334    --  ANCHOR(`mvwaddnstr()',`Add')
335    procedure Add (Win    : in Window := Standard_Window;
336                   Line   : in Line_Position;
337                   Column : in Column_Position;
338                   Str    : in String;
339                   Len    : in Integer := -1);
340    --  AKA
341    --  ALIAS(`mvwaddstr()')
342
343    --  MANPAGE(`curs_addchstr.3x')
344
345    --  ANCHOR(`waddchnstr()',`Add')
346    procedure Add (Win : in Window := Standard_Window;
347                   Str : in Attributed_String;
348                   Len : in Integer := -1);
349    --  AKA
350    --  ALIAS(`waddchstr()')
351
352    --  ANCHOR(`mvwaddchnstr()',`Add')
353    procedure Add (Win    : in Window := Standard_Window;
354                   Line   : in Line_Position;
355                   Column : in Column_Position;
356                   Str    : in Attributed_String;
357                   Len    : in Integer := -1);
358    --  AKA
359    --  ALIAS(`mvwaddchstr()')
360
361    --  MANPAGE(`curs_border.3x')
362
363    --  ANCHOR(`wborder()',`Border')
364    procedure Border
365      (Win                       : in Window := Standard_Window;
366       Left_Side_Symbol          : in Attributed_Character := Default_Character;
367       Right_Side_Symbol         : in Attributed_Character := Default_Character;
368       Top_Side_Symbol           : in Attributed_Character := Default_Character;
369       Bottom_Side_Symbol        : in Attributed_Character := Default_Character;
370       Upper_Left_Corner_Symbol  : in Attributed_Character := Default_Character;
371       Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character;
372       Lower_Left_Corner_Symbol  : in Attributed_Character := Default_Character;
373       Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character
374      );
375    --  AKA
376
377    --  ANCHOR(`box()',`Box')
378    procedure Box
379      (Win               : in Window := Standard_Window;
380       Vertical_Symbol   : in Attributed_Character := Default_Character;
381       Horizontal_Symbol : in Attributed_Character := Default_Character);
382    --  AKA
383
384    --  ANCHOR(`whline()',`Horizontal_Line')
385    procedure Horizontal_Line
386      (Win         : in Window := Standard_Window;
387       Line_Size   : in Natural;
388       Line_Symbol : in Attributed_Character := Default_Character);
389    --  AKA
390
391    --  ANCHOR(`wvline()',`Vertical_Line')
392    procedure Vertical_Line
393      (Win         : in Window := Standard_Window;
394       Line_Size   : in Natural;
395       Line_Symbol : in Attributed_Character := Default_Character);
396    --  AKA
397
398    --  MANPAGE(`curs_getch.3x')
399
400    --  ANCHOR(`wgetch()',`Get_Keystroke')
401    function Get_Keystroke (Win : Window := Standard_Window)
402                            return Real_Key_Code;
403    --  AKA
404    --  Get a character from the keyboard and echo it - if enabled - to the
405    --  window.
406    --  If for any reason (i.e. a timeout) we couldn't get a character the
407    --  returned keycode is Key_None.
408
409    --  ANCHOR(`ungetch()',`Undo_Keystroke')
410    procedure Undo_Keystroke (Key : in Real_Key_Code);
411    --  AKA
412
413    --  ANCHOR(`has_key()',`Has_Key')
414    function Has_Key (Key : Special_Key_Code) return Boolean;
415    --  AKA
416    --  |
417    --  | Some helper functions
418    --  |
419    function Is_Function_Key (Key : Special_Key_Code) return Boolean;
420    --  Return True if the Key is a function key (i.e. one of F0 .. F63)
421
422    subtype Function_Key_Number is Integer range 0 .. 63;
423    --  (n)curses allows for 64 function keys.
424
425    function Function_Key (Key : Real_Key_Code) return Function_Key_Number;
426    --  Return the number of the function key. If the code is not a
427    --  function key, a CONSTRAINT_ERROR will be raised.
428
429    function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
430    --  Return the key code for a given functionkey number.
431
432    --  MANPAGE(`curs_attr.3x')
433
434    --  ANCHOR(`wattron()',`Switch_Character_Attribute')
435    procedure Switch_Character_Attribute
436      (Win  : in Window := Standard_Window;
437       Attr : in Character_Attribute_Set := Normal_Video;
438       On   : in Boolean := True); --  if False we switch Off.
439    --  AKA
440    --  ALIAS(`wattroff()')
441
442    --  ANCHOR(`wattrset()',`Set_Character_Attributes')
443    procedure Set_Character_Attributes
444      (Win   : in Window := Standard_Window;
445       Attr  : in Character_Attribute_Set := Normal_Video;
446       Color : in Color_Pair := Color_Pair'First);
447    --  AKA
448
449    --  ANCHOR(`wattr_get()',`Get_Character_Attribute')
450    function Get_Character_Attribute
451      (Win : in Window := Standard_Window) return Character_Attribute_Set;
452    --  AKA
453
454    --  ANCHOR(`wattr_get()',`Get_Character_Attribute')
455    function Get_Character_Attribute
456      (Win : in Window := Standard_Window) return Color_Pair;
457    --  AKA
458
459    --  ANCHOR(`wchgat()',`Change_Attributes')
460    procedure Change_Attributes
461      (Win   : in Window := Standard_Window;
462       Count : in Integer := -1;
463       Attr  : in Character_Attribute_Set := Normal_Video;
464       Color : in Color_Pair := Color_Pair'First);
465    --  AKA
466
467    --  ANCHOR(`mvwchgat()',`Change_Attributes')
468    procedure Change_Attributes
469      (Win    : in Window := Standard_Window;
470       Line   : in Line_Position := Line_Position'First;
471       Column : in Column_Position := Column_Position'First;
472       Count  : in Integer := -1;
473       Attr   : in Character_Attribute_Set := Normal_Video;
474       Color  : in Color_Pair := Color_Pair'First);
475    --  AKA
476
477    --  MANPAGE(`curs_beep.3x')
478
479    --  ANCHOR(`beep()',`Beep')
480    procedure Beep;
481    --  AKA
482
483    --  ANCHOR(`flash()',`Flash_Screen')
484    procedure Flash_Screen;
485    --  AKA
486
487    --  MANPAGE(`curs_inopts.3x')
488
489    --  | Not implemented : typeahead
490    --
491    --  ANCHOR(`cbreak()',`Set_Cbreak_Mode')
492    procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True);
493    --  AKA
494    --  ALIAS(`nocbreak()')
495
496    --  ANCHOR(`raw()',`Set_Raw_Mode')
497    procedure Set_Raw_Mode (SwitchOn : in Boolean := True);
498    --  AKA
499    --  ALIAS(`noraw()')
500
501    --  ANCHOR(`echo()',`Set_Echo_Mode')
502    procedure Set_Echo_Mode (SwitchOn : in Boolean := True);
503    --  AKA
504    --  ALIAS(`noecho()')
505
506    --  ANCHOR(`meta()',`Set_Meta_Mode')
507    procedure Set_Meta_Mode (Win      : in Window := Standard_Window;
508                             SwitchOn : in Boolean := True);
509    --  AKA
510
511    --  ANCHOR(`keypad()',`Set_KeyPad_Mode')
512    procedure Set_KeyPad_Mode (Win      : in Window := Standard_Window;
513                               SwitchOn : in Boolean := True);
514    --  AKA
515
516    type Half_Delay_Amount is range 1 .. 255;
517
518    --  ANCHOR(`halfdelay()',`Half_Delay')
519    procedure Half_Delay (Amount : in Half_Delay_Amount);
520    --  AKA
521
522    --  ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode')
523    procedure Set_Flush_On_Interrupt_Mode
524      (Win  : in Window := Standard_Window;
525       Mode : in Boolean := True);
526    --  AKA
527
528    --  ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode')
529    procedure Set_Queue_Interrupt_Mode
530      (Win   : in Window := Standard_Window;
531       Flush : in Boolean := True);
532    --  AKA
533    --  ALIAS(`noqiflush()')
534
535    --  ANCHOR(`nodelay()',`Set_NoDelay_Mode')
536    procedure Set_NoDelay_Mode
537      (Win  : in Window := Standard_Window;
538       Mode : in Boolean := False);
539    --  AKA
540
541    type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
542
543    --  ANCHOR(`wtimeout()',`Set_Timeout_Mode')
544    procedure Set_Timeout_Mode (Win    : in Window := Standard_Window;
545                                Mode   : in Timeout_Mode;
546                                Amount : in Natural); --  in Miliseconds
547    --  AKA
548    --  Instead of overloading the semantic of the sign of amount, we
549    --  introduce the Timeout_Mode parameter. This should improve
550    --  readability. For Blocking and Non_Blocking, the Amount is not
551    --  evaluated.
552
553    --  ANCHOR(`notimeout()',`Set_Escape_Time_Mode')
554    procedure Set_Escape_Timer_Mode
555      (Win       : in Window := Standard_Window;
556       Timer_Off : in Boolean := False);
557    --  AKA
558
559    --  MANPAGE(`curs_outopts.3x')
560
561    --  ANCHOR(`nl()',`Set_NL_Mode')
562    procedure Set_NL_Mode (SwitchOn : in Boolean := True);
563    --  AKA
564    --  ALIAS(`nonl()')
565
566    --  ANCHOR(`clearok()',`Clear_On_Next_Update')
567    procedure Clear_On_Next_Update
568      (Win      : in Window := Standard_Window;
569       Do_Clear : in Boolean := True);
570    --  AKA
571
572    --  ANCHOR(`idlok()',`Use_Insert_Delete_Line')
573    procedure Use_Insert_Delete_Line
574      (Win    : in Window := Standard_Window;
575       Do_Idl : in Boolean := True);
576    --  AKA
577
578    --  ANCHOR(`idcok()',`Use_Insert_Delete_Character')
579    procedure Use_Insert_Delete_Character
580      (Win    : in Window := Standard_Window;
581       Do_Idc : in Boolean := True);
582    --  AKA
583
584    --  ANCHOR(`leaveok()',`Leave_Cursor_After_Update')
585    procedure Leave_Cursor_After_Update
586      (Win      : in Window := Standard_Window;
587       Do_Leave : in Boolean := True);
588    --  AKA
589
590    --  ANCHOR(`immedok()',`Immediate_Update_Mode')
591    procedure Immediate_Update_Mode
592      (Win  : in Window := Standard_Window;
593       Mode : in Boolean := False);
594    --  AKA
595
596    --  ANCHOR(`scrollok()',`Allow_Scrolling')
597    procedure Allow_Scrolling
598      (Win  : in Window := Standard_Window;
599       Mode : in Boolean := False);
600    --  AKA
601
602    function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
603    --  There is no such function in the C interface.
604
605    --  ANCHOR(`wsetscrreg()',`Set_Scroll_Region')
606    procedure Set_Scroll_Region
607      (Win         : in Window := Standard_Window;
608       Top_Line    : in Line_Position;
609       Bottom_Line : in Line_Position);
610    --  AKA
611
612    --  MANPAGE(`curs_refresh.3x')
613
614    --  ANCHOR(`doupdate()',`Update_Screen')
615    procedure Update_Screen;
616    --  AKA
617
618    --  ANCHOR(`wrefresh()',`Refresh')
619    procedure Refresh (Win : in Window := Standard_Window);
620    --  AKA
621
622    --  ANCHOR(`wnoutrefresh()',`Refresh_Without_Update')
623    procedure Refresh_Without_Update
624      (Win : in Window := Standard_Window);
625    --  AKA
626
627    --  ANCHOR(`redrawwin()',`Redraw')
628    procedure Redraw (Win : in Window := Standard_Window);
629    --  AKA
630
631    --  ANCHOR(`wredrawln()',`Redraw')
632    procedure Redraw (Win        : in Window := Standard_Window;
633                      Begin_Line : in Line_Position;
634                      Line_Count : in Positive);
635    --  AKA
636
637    --  MANPAGE(`curs_clear.3x')
638
639    --  ANCHOR(`werase()',`Erase')
640    procedure Erase (Win : in Window := Standard_Window);
641    --  AKA
642
643    --  ANCHOR(`wclear()',`Clear')
644    procedure Clear
645      (Win : in Window := Standard_Window);
646    --  AKA
647
648    --  ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen')
649    procedure Clear_To_End_Of_Screen
650      (Win : in Window := Standard_Window);
651    --  AKA
652
653    --  ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line')
654    procedure Clear_To_End_Of_Line
655      (Win : in Window := Standard_Window);
656    --  AKA
657
658    --  MANPAGE(`curs_bkgd.3x')
659
660    --  ANCHOR(`wbkgdset()',`Set_Background')
661    procedure Set_Background
662      (Win : in Window := Standard_Window;
663       Ch  : in Attributed_Character);
664    --  AKA
665
666    --  ANCHOR(`wbkgd()',`Change_Background')
667    procedure Change_Background
668      (Win : in Window := Standard_Window;
669       Ch  : in Attributed_Character);
670    --  AKA
671
672    --  ANCHOR(`wbkgdget()',`Get_Background')
673    function Get_Background (Win : Window := Standard_Window)
674      return Attributed_Character;
675    --  AKA
676
677    --  MANPAGE(`curs_touch.3x')
678
679    --  ANCHOR(`touchwin()',`Touch')
680    procedure Touch (Win : in Window := Standard_Window);
681    --  AKA
682
683    --  ANCHOR(`untouchwin()',`Untouch')
684    procedure Untouch (Win : in Window := Standard_Window);
685    --  AKA
686
687    --  ANCHOR(`touchline()',`Touch')
688    procedure Touch (Win   : in Window := Standard_Window;
689                     Start : in Line_Position;
690                     Count : in Positive);
691    --  AKA
692
693    --  ANCHOR(`wtouchln()',`Change_Line_Status')
694    procedure Change_Lines_Status (Win   : in Window := Standard_Window;
695                                   Start : in Line_Position;
696                                   Count : in Positive;
697                                   State : in Boolean);
698    --  AKA
699
700    --  ANCHOR(`is_linetouched()',`Is_Touched')
701    function Is_Touched (Win  : Window := Standard_Window;
702                         Line : Line_Position) return Boolean;
703    --  AKA
704
705    --  ANCHOR(`is_wintouched()',`Is_Touched')
706    function Is_Touched (Win : Window := Standard_Window) return Boolean;
707    --  AKA
708
709    --  MANPAGE(`curs_overlay.3x')
710
711    --  ANCHOR(`copywin()',`Copy')
712    procedure Copy
713      (Source_Window            : in Window;
714       Destination_Window       : in Window;
715       Source_Top_Row           : in Line_Position;
716       Source_Left_Column       : in Column_Position;
717       Destination_Top_Row      : in Line_Position;
718       Destination_Left_Column  : in Column_Position;
719       Destination_Bottom_Row   : in Line_Position;
720       Destination_Right_Column : in Column_Position;
721       Non_Destructive_Mode     : in Boolean := True);
722    --  AKA
723
724    --  ANCHOR(`overwrite()',`Overwrite')
725    procedure Overwrite (Source_Window      : in Window;
726                         Destination_Window : in Window);
727    --  AKA
728
729    --  ANCHOR(`overlay()',`Overlay')
730    procedure Overlay (Source_Window      : in Window;
731                       Destination_Window : in Window);
732    --  AKA
733
734    --  MANPAGE(`curs_deleteln.3x')
735
736    --  ANCHOR(`winsdelln()',`Insert_Delete_Lines')
737    procedure Insert_Delete_Lines
738      (Win   : in Window  := Standard_Window;
739       Lines : in Integer := 1); --  default is to insert one line above
740    --  AKA
741
742    --  ANCHOR(`wdeleteln()',`Delete_Line')
743    procedure Delete_Line (Win : in Window := Standard_Window);
744    --  AKA
745
746    --  ANCHOR(`winsertln()',`Insert_Line')
747    procedure Insert_Line (Win : in Window := Standard_Window);
748    --  AKA
749
750    --  MANPAGE(`curs_getyx.3x')
751
752    --  ANCHOR(`getmaxyx()',`Get_Size')
753    procedure Get_Size
754      (Win               : in Window := Standard_Window;
755       Number_Of_Lines   : out Line_Count;
756       Number_Of_Columns : out Column_Count);
757    --  AKA
758
759    --  ANCHOR(`getbegyx()',`Get_Window_Position')
760    procedure Get_Window_Position
761      (Win             : in Window := Standard_Window;
762       Top_Left_Line   : out Line_Position;
763       Top_Left_Column : out Column_Position);
764    --  AKA
765
766    --  ANCHOR(`getyx()',`Get_Cursor_Position')
767    procedure Get_Cursor_Position
768      (Win    : in  Window := Standard_Window;
769       Line   : out Line_Position;
770       Column : out Column_Position);
771    --  AKA
772
773    --  ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent')
774    procedure Get_Origin_Relative_To_Parent
775      (Win                : in  Window;
776       Top_Left_Line      : out Line_Position;
777       Top_Left_Column    : out Column_Position;
778       Is_Not_A_Subwindow : out Boolean);
779    --  AKA
780    --  Instead of placing -1 in the coordinates as return, we use a boolean
781    --  to return the info that the window has no parent.
782
783    --  MANPAGE(`curs_pad.3x')
784
785    --  ANCHOR(`newpad()',`New_Pad')
786    function New_Pad (Lines   : Line_Count;
787                      Columns : Column_Count) return Window;
788    --  AKA
789
790    --  ANCHOR(`subpad()',`Sub_Pad')
791    function Sub_Pad
792      (Pad                   : Window;
793       Number_Of_Lines       : Line_Count;
794       Number_Of_Columns     : Column_Count;
795       First_Line_Position   : Line_Position;
796       First_Column_Position : Column_Position) return Window;
797    --  AKA
798
799    --  ANCHOR(`prefresh()',`Refresh')
800    procedure Refresh
801      (Pad                      : in Window;
802       Source_Top_Row           : in Line_Position;
803       Source_Left_Column       : in Column_Position;
804       Destination_Top_Row      : in Line_Position;
805       Destination_Left_Column  : in Column_Position;
806       Destination_Bottom_Row   : in Line_Position;
807       Destination_Right_Column : in Column_Position);
808    --  AKA
809
810    --  ANCHOR(`pnoutrefresh()',`Refresh_Without_Update')
811    procedure Refresh_Without_Update
812      (Pad                      : in Window;
813       Source_Top_Row           : in Line_Position;
814       Source_Left_Column       : in Column_Position;
815       Destination_Top_Row      : in Line_Position;
816       Destination_Left_Column  : in Column_Position;
817       Destination_Bottom_Row   : in Line_Position;
818       Destination_Right_Column : in Column_Position);
819    --  AKA
820
821    --  ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It')
822    procedure Add_Character_To_Pad_And_Echo_It
823      (Pad : in Window;
824       Ch  : in Attributed_Character);
825    --  AKA
826
827    procedure Add_Character_To_Pad_And_Echo_It
828      (Pad : in Window;
829       Ch  : in Character);
830
831    --  MANPAGE(`curs_scroll.3x')
832
833    --  ANCHOR(`wscrl()',`Scroll')
834    procedure Scroll (Win    : in Window  := Standard_Window;
835                      Amount : in Integer := 1);
836    --  AKA
837
838    --  MANPAGE(`curs_delch.3x')
839
840    --  ANCHOR(`wdelch()',`Delete_Character')
841    procedure Delete_Character (Win : in Window := Standard_Window);
842    --  AKA
843
844    --  ANCHOR(`mvwdelch()',`Delete_Character')
845    procedure Delete_Character
846      (Win    : in Window := Standard_Window;
847       Line   : in Line_Position;
848       Column : in Column_Position);
849    --  AKA
850
851    --  MANPAGE(`curs_inch.3x')
852
853    --  ANCHOR(`winch()',`Peek')
854    function Peek (Win : Window := Standard_Window)
855      return Attributed_Character;
856    --  AKA
857
858    --  ANCHOR(`mvwinch()',`Peek')
859    function Peek
860      (Win    : Window := Standard_Window;
861       Line   : Line_Position;
862       Column : Column_Position) return Attributed_Character;
863    --  AKA
864
865    --  MANPAGE(`curs_winch.3x')
866
867    --  ANCHOR(`winsch()',`Insert')
868    procedure Insert (Win : in Window := Standard_Window;
869                      Ch  : in Attributed_Character);
870    --  AKA
871
872    --  ANCHOR(`mvwinsch()',`Insert')
873    procedure Insert (Win    : in Window := Standard_Window;
874                      Line   : in Line_Position;
875                      Column : in Column_Position;
876                      Ch     : in Attributed_Character);
877    --  AKA
878
879    --  MANPAGE(`curs_winch.3x')
880
881    --  ANCHOR(`winsnstr()',`Insert')
882    procedure Insert (Win : in Window := Standard_Window;
883                      Str : in String;
884                      Len : in Integer := -1);
885    --  AKA
886    --  ALIAS(`winsstr()')
887
888    --  ANCHOR(`mvwinsnstr()',`Insert')
889    procedure Insert (Win    : in Window := Standard_Window;
890                      Line   : in Line_Position;
891                      Column : in Column_Position;
892                      Str    : in String;
893                      Len    : in Integer := -1);
894    --  AKA
895    --  ALIAS(`mvwinsstr()')
896
897    --  MANPAGE(`curs_instr.3x')
898
899    --  ANCHOR(`winnstr()',`Peek')
900    procedure Peek (Win : in  Window := Standard_Window;
901                    Str : out String;
902                    Len : in  Integer := -1);
903    --  AKA
904    --  ALIAS(`winstr()')
905
906    --  ANCHOR(`mvwinnstr()',`Peek')
907    procedure Peek (Win    : in  Window := Standard_Window;
908                    Line   : in  Line_Position;
909                    Column : in  Column_Position;
910                    Str    : out String;
911                    Len    : in  Integer := -1);
912    --  AKA
913    --  ALIAS(`mvwinstr()')
914
915    --  MANPAGE(`curs_inchstr.3x')
916
917    --  ANCHOR(`winchnstr()',`Peek')
918    procedure Peek (Win : in  Window := Standard_Window;
919                    Str : out Attributed_String;
920                    Len : in  Integer := -1);
921    --  AKA
922    --  ALIAS(`winchstr()')
923
924    --  ANCHOR(`mvwinchnstr()',`Peek')
925    procedure Peek (Win    : in  Window := Standard_Window;
926                    Line   : in  Line_Position;
927                    Column : in  Column_Position;
928                    Str    : out Attributed_String;
929                    Len    : in  Integer := -1);
930    --  AKA
931    --  ALIAS(`mvwinchstr()')
932
933    --  MANPAGE(`curs_getstr.3x')
934
935    --  ANCHOR(`wgetnstr()',`Get')
936    procedure Get (Win : in  Window := Standard_Window;
937                   Str : out String;
938                   Len : in  Integer := -1);
939    --  AKA
940    --  ALIAS(`wgetstr()')
941
942    procedure Get (Win    : in  Window := Standard_Window;
943                   Line   : in  Line_Position;
944                   Column : in  Column_Position;
945                   Str    : out String;
946                   Len    : in  Integer := -1);
947    --  AKA: not specified in ncurses, should be: mvwgetnstr()
948    --       and mvwgetstr() (which exists)
949
950    --  MANPAGE(`curs_slk.3x')
951
952    type Soft_Label_Key_Format is (Three_Two_Three,
953                                   Four_Four,
954                                   PC_Style,              --  ncurses specific
955                                   PC_Style_With_Index);  --  "
956    type Label_Number is new Positive range 1 .. 12;
957    type Label_Justification is (Left, Centered, Right);
958
959    --  ANCHOR(`slk_init()',`Init_Soft_Label_Keys')
960    procedure Init_Soft_Label_Keys
961      (Format : in Soft_Label_Key_Format := Three_Two_Three);
962    --  AKA
963
964    --  ANCHOR(`slk_set()',`Set_Soft_Label_Key')
965    procedure Set_Soft_Label_Key (Label : in Label_Number;
966                                  Text  : in String;
967                                  Fmt   : in Label_Justification := Left);
968    --  AKA
969
970    --  ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key')
971    procedure Refresh_Soft_Label_Keys;
972    --  AKA
973
974    --  ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update')
975    procedure Refresh_Soft_Label_Keys_Without_Update;
976    --  AKA
977
978    --  ANCHOR(`slk_label()',`Get_Soft_Label_Key')
979    procedure Get_Soft_Label_Key (Label : in Label_Number;
980                                  Text  : out String);
981    --  AKA
982
983    --  ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys')
984    procedure Clear_Soft_Label_Keys;
985    --  AKA
986
987    --  ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys')
988    procedure Restore_Soft_Label_Keys;
989    --  AKA
990
991    --  ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys')
992    procedure Touch_Soft_Label_Keys;
993    --  AKA
994
995    --  ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes')
996    procedure Switch_Soft_Label_Key_Attributes
997      (Attr : in Character_Attribute_Set;
998       On   : in Boolean := True);
999    --  AKA
1000    --  ALIAS(`slk_attroff()')
1001
1002    --  ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes')
1003    procedure Set_Soft_Label_Key_Attributes
1004      (Attr  : in Character_Attribute_Set := Normal_Video;
1005       Color : in Color_Pair := Color_Pair'First);
1006    --  AKA
1007
1008    --  ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1009    function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
1010    --  AKA
1011
1012    --  ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1013    function Get_Soft_Label_Key_Attributes return Color_Pair;
1014    --  AKA
1015
1016    --  MANPAGE(`curs_util.3x')
1017
1018    --  | Not implemented : filter, use_env, putwin, getwin
1019    --
1020    --  ANCHOR(`keyname()',`Key_Name')
1021    procedure Key_Name (Key  : in  Real_Key_Code;
1022                        Name : out String);
1023    --  AKA
1024    --  The external name for a real keystroke.
1025
1026    --  ANCHOR(`unctrl()',`Un_Control')
1027    procedure Un_Control (Ch  : in Attributed_Character;
1028                          Str : out String);
1029    --  AKA
1030
1031    --  ANCHOR(`delay_output()',`Delay_Output')
1032    procedure Delay_Output (Msecs : in Natural);
1033    --  AKA
1034
1035    --  ANCHOR(`flushinp()',`Flush_Input')
1036    procedure Flush_Input;
1037    --  AKA
1038
1039    --  MANPAGE(`curs_termattrs.3x')
1040
1041    --  ANCHOR(`baudrate()',`Baudrate')
1042    function Baudrate return Natural;
1043    --  AKA
1044
1045    --  ANCHOR(`erasechar()',`Erase_Character')
1046    function Erase_Character return Character;
1047    --  AKA
1048
1049    --  ANCHOR(`killchar()',`Kill_Character')
1050    function Kill_Character return Character;
1051    --  AKA
1052
1053    --  ANCHOR(`has_ic()',`Has_Insert_Character')
1054    function Has_Insert_Character return Boolean;
1055    --  AKA
1056
1057    --  ANCHOR(`has_il()',`Has_Insert_Line')
1058    function Has_Insert_Line return Boolean;
1059    --  AKA
1060
1061    --  ANCHOR(`termattrs()',`Supported_Attributes')
1062    function Supported_Attributes return Character_Attribute_Set;
1063    --  AKA
1064
1065    --  ANCHOR(`longname()',`Long_Name')
1066    procedure Long_Name (Name : out String);
1067    --  AKA
1068
1069    --  ANCHOR(`termname()',`Terminal_Name')
1070    procedure Terminal_Name (Name : out String);
1071    --  AKA
1072
1073    --  MANPAGE(`curs_color.3x')
1074
1075    --  ANCHOR(`start_clolor()',`Start_Color')
1076    procedure Start_Color;
1077    --  AKA
1078    pragma Import (C, Start_Color, "start_color");
1079
1080    --  ANCHOR(`init_pair()',`Init_Pair')
1081    procedure Init_Pair (Pair : in Redefinable_Color_Pair;
1082                         Fore : in Color_Number;
1083                         Back : in Color_Number);
1084    --  AKA
1085
1086    --  ANCHOR(`pair_content()',`Pair_Content')
1087    procedure Pair_Content (Pair : in Color_Pair;
1088                            Fore : out Color_Number;
1089                            Back : out Color_Number);
1090    --  AKA
1091
1092    --  ANCHOR(`has_colors()',`Has_Colors')
1093    function Has_Colors return Boolean;
1094    --  AKA
1095
1096    --  ANCHOR(`init_color()',`Init_Color')
1097    procedure Init_Color (Color : in Color_Number;
1098                          Red   : in RGB_Value;
1099                          Green : in RGB_Value;
1100                          Blue  : in RGB_Value);
1101    --  AKA
1102
1103    --  ANCHOR(`can_change_color()',`Can_Change_Color')
1104    function Can_Change_Color return Boolean;
1105    --  AKA
1106
1107    --  ANCHOR(`color_content()',`Color_Content')
1108    procedure Color_Content (Color : in  Color_Number;
1109                             Red   : out RGB_Value;
1110                             Green : out RGB_Value;
1111                             Blue  : out RGB_Value);
1112    --  AKA
1113
1114    --  MANPAGE(`curs_kernel.3x')
1115
1116    --  | Not implemented: getsyx, setsyx
1117    --
1118    type Curses_Mode is (Curses, Shell);
1119
1120    --  ANCHOR(`def_prog_mode()',`Save_Curses_Mode')
1121    procedure Save_Curses_Mode (Mode : in Curses_Mode);
1122    --  AKA
1123    --  ALIAS(`def_shell_mode()')
1124
1125    --  ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode')
1126    procedure Reset_Curses_Mode (Mode : in Curses_Mode);
1127    --  AKA
1128    --  ALIAS(`reset_shell_mode()')
1129
1130    --  ANCHOR(`savetty()',`Save_Terminal_State')
1131    procedure Save_Terminal_State;
1132    --  AKA
1133
1134    --  ANCHOR(`resetty();',`Reset_Terminal_State')
1135    procedure Reset_Terminal_State;
1136    --  AKA
1137
1138    type Stdscr_Init_Proc is access
1139       function (Win     : Window;
1140                 Columns : Column_Count) return Integer;
1141    pragma Convention (C, Stdscr_Init_Proc);
1142    --  N.B.: the return value is actually ignored, but it seems to be
1143    --        a good practice to return 0 if you think all went fine
1144    --        and -1 otherwise.
1145
1146    --  ANCHOR(`ripoffline()',`Rip_Off_Lines')
1147    procedure Rip_Off_Lines (Lines : in Integer;
1148                             Proc  : in Stdscr_Init_Proc);
1149    --  AKA
1150    --  N.B.: to be more precise, this uses a ncurses specific enhancement of
1151    --        ripoffline(), in which the Lines argument absolute value is the
1152    --        number of lines to be ripped of. The official ripoffline() only
1153    --        uses the sign of Lines to rip of a single line from bottom or top.
1154
1155    type Cursor_Visibility is (Invisible, Normal, Very_Visible);
1156
1157    --  ANCHOR(`curs_set()',`Set_Cursor_Visibility')
1158    procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
1159    --  AKA
1160
1161    --  ANCHOR(`napms()',`Nap_Milli_Seconds')
1162    procedure Nap_Milli_Seconds (Ms : in Natural);
1163    --  AKA
1164
1165    --  |=====================================================================
1166    --  | Some usefull helpers.
1167    --  |=====================================================================
1168    type Transform_Direction is (From_Screen, To_Screen);
1169    procedure Transform_Coordinates
1170      (W      : in Window := Standard_Window;
1171       Line   : in out Line_Position;
1172       Column : in out Column_Position;
1173       Dir    : in Transform_Direction := From_Screen);
1174    --  This procedure transforms screen coordinates into coordinates relative
1175    --  to the window and vice versa, depending on the Dir parmeter.
1176    --  Screen coordinates are the position informations on the physical device.
1177    --  An Curses_Exception will be raised if Line and Column are not in the
1178    --  Window or if you pass the Null_Window as argument.
1179
1180 private
1181    type Window is new System.Address;
1182    Null_Window : constant Window := Window (System.Null_Address);
1183
1184    Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER;
1185    --  This constant may be different on your system.
1186
1187 end Terminal_Interface.Curses;