2 define(`HTMLNAME',`terminal_interface-curses__ads.htm')dnl
3 include(M4MACRO)------------------------------------------------------------------------------
5 -- GNAT ncurses Binding --
7 -- Terminal_Interface.Curses --
11 ------------------------------------------------------------------------------
12 -- Copyright (c) 1998,2004 Free Software Foundation, Inc. --
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: --
22 -- The above copyright notice and this permission notice shall be included --
23 -- in all copies or substantial portions of the Software. --
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. --
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 --
37 ------------------------------------------------------------------------------
38 -- Author: Juergen Pfeifer, 1996
41 -- $Date: 2004/08/21 21:37:00 $
42 -- Binding Version 01.00
43 ------------------------------------------------------------------------------
45 with System.Storage_Elements;
46 with Interfaces.C; -- We need this for some assertions.
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;
55 type Line_Position is new Natural; -- line coordinate
56 type Column_Position is new Natural; -- column coordinate
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
63 type Key_Code is new Integer;
64 -- That is anything including real characters, special keys and logical
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.
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
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.
81 -- Constants for function- and special keys
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;
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.
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
96 include(`Old_Keys')dnl
98 ------------------------------------------------------------------------------
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.
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.
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
120 include(`Character_Attribute_Set_Rep')
121 -- (n)curses uses all but the lowest 16 Bits for Attributes.
123 Normal_Video : constant Character_Attribute_Set := (others => False);
125 type Attributed_Character is
127 Attr : Character_Attribute_Set;
131 pragma Convention (C, Attributed_Character);
132 -- This is the counterpart for the chtype in C.
135 Default_Character : constant Attributed_Character
136 := (Ch => Character'First,
137 Color => Color_Pair'First,
138 Attr => (others => False)); -- preelaboratable Normal_Video
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.
147 Curses_Exception : exception;
148 Wrong_Curses_Version : exception;
150 -- Those exceptions are raised by the ETI (Extended Terminal Interface)
151 -- subpackets for Menu and Forms handling.
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;
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 --------------------------------------------------------------------------
176 function Lines return Line_Count;
177 pragma Inline (Lines);
179 function Columns return Column_Count;
180 pragma Inline (Columns);
182 function Tab_Size return Natural;
183 pragma Inline (Tab_Size);
185 function Number_Of_Colors return Natural;
186 pragma Inline (Number_Of_Colors);
188 function Number_Of_Color_Pairs return Natural;
189 pragma Inline (Number_Of_Color_Pairs);
191 ACS_Map : array (Character'Val (0) .. Character'Val (127)) of
192 Attributed_Character;
193 pragma Import (C, ACS_Map, "acs_map");
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.
200 include(`ACS_Map')dnl
202 -- MANPAGE(`curs_initscr.3x')
203 -- | Not implemented: newterm, set_term, delscreen, curscr
205 -- ANCHOR(`stdscr',`Standard_Window')
206 function Standard_Window return Window;
208 pragma Inline (Standard_Window);
210 -- ANCHOR(`initscr()',`Init_Screen')
211 procedure Init_Screen;
213 -- ANCHOR(`initscr()',`Init_Windows')
214 procedure Init_Windows renames Init_Screen;
216 pragma Inline (Init_Screen);
217 pragma Inline (Init_Windows);
219 -- ANCHOR(`endwin()',`End_Windows')
220 procedure End_Windows;
222 procedure End_Screen renames End_Windows;
223 pragma Inline (End_Windows);
224 pragma Inline (End_Screen);
226 -- ANCHOR(`isendwin()',`Is_End_Window')
227 function Is_End_Window return Boolean;
229 pragma Inline (Is_End_Window);
231 -- MANPAGE(`curs_move.3x')
233 -- ANCHOR(`wmove()',`Move_Cursor')
234 procedure Move_Cursor (Win : in Window := Standard_Window;
235 Line : in Line_Position;
236 Column : in Column_Position);
239 pragma Inline (Move_Cursor);
241 -- MANPAGE(`curs_addch.3x')
243 -- ANCHOR(`waddch()',`Add')
244 procedure Add (Win : in Window := Standard_Window;
245 Ch : in Attributed_Character);
249 procedure Add (Win : in Window := Standard_Window;
251 -- Add a single character at the current logical cursor position to
252 -- the window. Use the current windows attributes.
254 -- ANCHOR(`mvwaddch()',`Add')
256 (Win : in Window := Standard_Window;
257 Line : in Line_Position;
258 Column : in Column_Position;
259 Ch : in Attributed_Character);
261 -- ALIAS(`mvaddch()')
264 (Win : in Window := Standard_Window;
265 Line : in Line_Position;
266 Column : in Column_Position;
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
271 -- ANCHOR(`wechochar()',`Add_With_Immediate_Echo')
272 procedure Add_With_Immediate_Echo
273 (Win : in Window := Standard_Window;
274 Ch : in Attributed_Character);
276 -- ALIAS(`echochar()')
278 procedure Add_With_Immediate_Echo
279 (Win : in Window := Standard_Window;
281 -- Add a character and do an immediate refresh of the screen.
282 pragma Inline (Add_With_Immediate_Echo);
284 -- MANPAGE(`curs_window.3x')
285 -- Not Implemented: wcursyncup
287 -- ANCHOR(`newwin()',`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.
296 pragma Inline (Create);
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
304 pragma Inline (New_Window);
306 -- ANCHOR(`delwin()',`Delete')
307 procedure Delete (Win : in out Window);
309 -- Reset Win to Null_Window
310 pragma Inline (Delete);
312 -- ANCHOR(`subwin()',`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;
320 pragma Inline (Sub_Window);
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;
330 pragma Inline (Derived_Window);
332 -- ANCHOR(`dupwin()',`Duplicate')
333 function Duplicate (Win : Window) return Window;
335 pragma Inline (Duplicate);
337 -- ANCHOR(`mvwin()',`Move_Window')
338 procedure Move_Window (Win : in Window;
339 Line : in Line_Position;
340 Column : in Column_Position);
342 pragma Inline (Move_Window);
344 -- ANCHOR(`mvderwin()',`Move_Derived_Window')
345 procedure Move_Derived_Window (Win : in Window;
346 Line : in Line_Position;
347 Column : in Column_Position);
349 pragma Inline (Move_Derived_Window);
351 -- ANCHOR(`wsyncup()',`Synchronize_Upwards')
352 procedure Synchronize_Upwards (Win : in Window);
354 pragma Import (C, Synchronize_Upwards, "wsyncup");
356 -- ANCHOR(`wsyncdown()',`Synchronize_Downwards')
357 procedure Synchronize_Downwards (Win : in Window);
359 pragma Import (C, Synchronize_Downwards, "wsyncdown");
361 -- ANCHOR(`syncok()',`Set_Synch_Mode')
362 procedure Set_Synch_Mode (Win : in Window := Standard_Window;
363 Mode : in Boolean := False);
365 pragma Inline (Set_Synch_Mode);
367 -- MANPAGE(`curs_addstr.3x')
369 -- ANCHOR(`waddnstr()',`Add')
370 procedure Add (Win : in Window := Standard_Window;
372 Len : in Integer := -1);
374 -- ALIAS(`waddstr()')
375 -- ALIAS(`addnstr()')
378 -- ANCHOR(`mvwaddnstr()',`Add')
379 procedure Add (Win : in Window := Standard_Window;
380 Line : in Line_Position;
381 Column : in Column_Position;
383 Len : in Integer := -1);
385 -- ALIAS(`mvwaddstr()')
386 -- ALIAS(`mvaddnstr()')
387 -- ALIAS(`mvaddstr()')
389 -- MANPAGE(`curs_addchstr.3x')
391 -- ANCHOR(`waddchnstr()',`Add')
392 procedure Add (Win : in Window := Standard_Window;
393 Str : in Attributed_String;
394 Len : in Integer := -1);
396 -- ALIAS(`waddchstr()')
397 -- ALIAS(`addchnstr()')
398 -- ALIAS(`addchstr()')
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);
407 -- ALIAS(`mvwaddchstr()')
408 -- ALIAS(`mvaddchnstr()')
409 -- ALIAS(`mvaddchstr()')
412 -- MANPAGE(`curs_border.3x')
413 -- | Not implemented: mvhline, mvwhline, mvvline, mvwvline
414 -- | use Move_Cursor then Horizontal_Line or Vertical_Line
416 -- ANCHOR(`wborder()',`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
430 pragma Inline (Border);
432 -- ANCHOR(`box()',`Box')
434 (Win : in Window := Standard_Window;
435 Vertical_Symbol : in Attributed_Character := Default_Character;
436 Horizontal_Symbol : in Attributed_Character := Default_Character);
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);
447 pragma Inline (Horizontal_Line);
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);
456 pragma Inline (Vertical_Line);
458 -- MANPAGE(`curs_getch.3x')
459 -- Not implemented: mvgetch, mvwgetch
461 -- ANCHOR(`wgetch()',`Get_Keystroke')
462 function Get_Keystroke (Win : Window := Standard_Window)
463 return Real_Key_Code;
466 -- Get a character from the keyboard and echo it - if enabled - to the
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);
472 -- ANCHOR(`ungetch()',`Undo_Keystroke')
473 procedure Undo_Keystroke (Key : in Real_Key_Code);
475 pragma Inline (Undo_Keystroke);
477 -- ANCHOR(`has_key()',`Has_Key')
478 function Has_Key (Key : Special_Key_Code) return Boolean;
480 pragma Inline (Has_Key);
483 -- | Some helper functions
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);
489 subtype Function_Key_Number is Integer range 0 .. 63;
490 -- (n)curses allows for 64 function keys.
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);
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);
501 -- MANPAGE(`curs_attr.3x')
502 -- | Not implemented attr_off, wattr_off,
503 -- | attr_on, wattr_on, attr_set, wattr_set
506 -- PAIR_NUMBER(c) is the same as c.Color
508 -- ANCHOR(`standout()',`Standout')
509 procedure Standout (Win : Window := Standard_Window;
510 On : Boolean := True);
511 -- ALIAS(`wstandout()')
512 -- ALIAS(`wstandend()')
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.
521 -- ALIAS(`wattroff()')
523 -- ALIAS(`attroff()')
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);
531 -- ALIAS(`attrset()')
532 pragma Inline (Set_Character_Attributes);
534 -- ANCHOR(`wattr_get()',`Get_Character_Attributes')
535 function Get_Character_Attribute
536 (Win : in Window := Standard_Window) return Character_Attribute_Set;
538 -- ALIAS(`attr_get()')
540 -- ANCHOR(`wattr_get()',`Get_Character_Attribute')
541 function Get_Character_Attribute
542 (Win : in Window := Standard_Window) return Color_Pair;
544 pragma Inline (Get_Character_Attribute);
546 -- ANCHOR(`wcolor_set()',`Set_Color')
547 procedure Set_Color (Win : in Window := Standard_Window;
548 Pair : in Color_Pair);
550 -- ALIAS(`color_set()')
551 pragma Inline (Set_Color);
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);
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);
571 -- ALIAS(`mvchgat()')
572 pragma Inline (Change_Attributes);
574 -- MANPAGE(`curs_beep.3x')
576 -- ANCHOR(`beep()',`Beep')
579 pragma Inline (Beep);
581 -- ANCHOR(`flash()',`Flash_Screen')
582 procedure Flash_Screen;
584 pragma Inline (Flash_Screen);
586 -- MANPAGE(`curs_inopts.3x')
588 -- | Not implemented : typeahead
590 -- ANCHOR(`cbreak()',`Set_Cbreak_Mode')
591 procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True);
593 -- ALIAS(`nocbreak()')
594 pragma Inline (Set_Cbreak_Mode);
596 -- ANCHOR(`raw()',`Set_Raw_Mode')
597 procedure Set_Raw_Mode (SwitchOn : in Boolean := True);
600 pragma Inline (Set_Raw_Mode);
602 -- ANCHOR(`echo()',`Set_Echo_Mode')
603 procedure Set_Echo_Mode (SwitchOn : in Boolean := True);
606 pragma Inline (Set_Echo_Mode);
608 -- ANCHOR(`meta()',`Set_Meta_Mode')
609 procedure Set_Meta_Mode (Win : in Window := Standard_Window;
610 SwitchOn : in Boolean := True);
612 pragma Inline (Set_Meta_Mode);
614 -- ANCHOR(`keypad()',`Set_KeyPad_Mode')
615 procedure Set_KeyPad_Mode (Win : in Window := Standard_Window;
616 SwitchOn : in Boolean := True);
618 pragma Inline (Set_KeyPad_Mode);
620 function Get_KeyPad_Mode (Win : in Window := Standard_Window)
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.
625 type Half_Delay_Amount is range 1 .. 255;
627 -- ANCHOR(`halfdelay()',`Half_Delay')
628 procedure Half_Delay (Amount : in Half_Delay_Amount);
630 pragma Inline (Half_Delay);
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);
637 pragma Inline (Set_Flush_On_Interrupt_Mode);
639 -- ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode')
640 procedure Set_Queue_Interrupt_Mode
641 (Win : in Window := Standard_Window;
642 Flush : in Boolean := True);
644 -- ALIAS(`noqiflush()')
645 pragma Inline (Set_Queue_Interrupt_Mode);
647 -- ANCHOR(`nodelay()',`Set_NoDelay_Mode')
648 procedure Set_NoDelay_Mode
649 (Win : in Window := Standard_Window;
650 Mode : in Boolean := False);
652 pragma Inline (Set_NoDelay_Mode);
654 type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
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
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
666 -- We don't inline this procedure.
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);
673 pragma Inline (Set_Escape_Timer_Mode);
675 -- MANPAGE(`curs_outopts.3x')
677 -- ANCHOR(`nl()',`Set_NL_Mode')
678 procedure Set_NL_Mode (SwitchOn : in Boolean := True);
681 pragma Inline (Set_NL_Mode);
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);
688 pragma Inline (Clear_On_Next_Update);
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);
695 pragma Inline (Use_Insert_Delete_Line);
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);
702 pragma Inline (Use_Insert_Delete_Character);
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);
709 pragma Inline (Leave_Cursor_After_Update);
711 -- ANCHOR(`immedok()',`Immediate_Update_Mode')
712 procedure Immediate_Update_Mode
713 (Win : in Window := Standard_Window;
714 Mode : in Boolean := False);
716 pragma Inline (Immediate_Update_Mode);
718 -- ANCHOR(`scrollok()',`Allow_Scrolling')
719 procedure Allow_Scrolling
720 (Win : in Window := Standard_Window;
721 Mode : in Boolean := False);
723 pragma Inline (Allow_Scrolling);
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);
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);
735 -- ALIAS(`setscrreg()')
736 pragma Inline (Set_Scroll_Region);
738 -- MANPAGE(`curs_refresh.3x')
740 -- ANCHOR(`doupdate()',`Update_Screen')
741 procedure Update_Screen;
743 pragma Inline (Update_Screen);
745 -- ANCHOR(`wrefresh()',`Refresh')
746 procedure Refresh (Win : in Window := Standard_Window);
748 -- There is an overloaded Refresh for Pads.
749 -- The Inline pragma appears there
750 -- ALIAS(`refresh()')
752 -- ANCHOR(`wnoutrefresh()',`Refresh_Without_Update')
753 procedure Refresh_Without_Update
754 (Win : in Window := Standard_Window);
756 -- There is an overloaded Refresh_Without_Update for Pads.
757 -- The Inline pragma appears there
759 -- ANCHOR(`redrawwin()',`Redraw')
760 procedure Redraw (Win : in Window := Standard_Window);
763 -- ANCHOR(`wredrawln()',`Redraw')
764 procedure Redraw (Win : in Window := Standard_Window;
765 Begin_Line : in Line_Position;
766 Line_Count : in Positive);
768 pragma Inline (Redraw);
770 -- MANPAGE(`curs_clear.3x')
772 -- ANCHOR(`werase()',`Erase')
773 procedure Erase (Win : in Window := Standard_Window);
776 pragma Inline (Erase);
778 -- ANCHOR(`wclear()',`Clear')
780 (Win : in Window := Standard_Window);
783 pragma Inline (Clear);
785 -- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen')
786 procedure Clear_To_End_Of_Screen
787 (Win : in Window := Standard_Window);
789 -- ALIAS(`clrtobot()')
790 pragma Inline (Clear_To_End_Of_Screen);
792 -- ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line')
793 procedure Clear_To_End_Of_Line
794 (Win : in Window := Standard_Window);
796 -- ALIAS(`clrtoeol()')
797 pragma Inline (Clear_To_End_Of_Line);
799 -- MANPAGE(`curs_bkgd.3x')
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);
809 -- ALIAS(`bkgdset()')
810 pragma Inline (Set_Background);
812 -- ANCHOR(`wbkgd()',`Change_Background')
813 procedure Change_Background
814 (Win : in Window := Standard_Window;
815 Ch : in Attributed_Character);
818 pragma Inline (Change_Background);
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;
825 -- ALIAS(`bkgdget()')
826 pragma Inline (Get_Background);
828 -- MANPAGE(`curs_touch.3x')
830 -- ANCHOR(`untouchwin()',`Untouch')
831 procedure Untouch (Win : in Window := Standard_Window);
833 pragma Inline (Untouch);
835 -- ANCHOR(`touchwin()',`Touch')
836 procedure Touch (Win : in Window := Standard_Window);
839 -- ANCHOR(`touchline()',`Touch')
840 procedure Touch (Win : in Window := Standard_Window;
841 Start : in Line_Position;
842 Count : in Positive);
844 pragma Inline (Touch);
846 -- ANCHOR(`wtouchln()',`Change_Line_Status')
847 procedure Change_Lines_Status (Win : in Window := Standard_Window;
848 Start : in Line_Position;
852 pragma Inline (Change_Lines_Status);
854 -- ANCHOR(`is_linetouched()',`Is_Touched')
855 function Is_Touched (Win : Window := Standard_Window;
856 Line : Line_Position) return Boolean;
859 -- ANCHOR(`is_wintouched()',`Is_Touched')
860 function Is_Touched (Win : Window := Standard_Window) return Boolean;
862 pragma Inline (Is_Touched);
864 -- MANPAGE(`curs_overlay.3x')
866 -- ANCHOR(`copywin()',`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);
878 pragma Inline (Copy);
880 -- ANCHOR(`overwrite()',`Overwrite')
881 procedure Overwrite (Source_Window : in Window;
882 Destination_Window : in Window);
884 pragma Inline (Overwrite);
886 -- ANCHOR(`overlay()',`Overlay')
887 procedure Overlay (Source_Window : in Window;
888 Destination_Window : in Window);
890 pragma Inline (Overlay);
892 -- MANPAGE(`curs_deleteln.3x')
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
899 -- ALIAS(`insdelln()')
900 pragma Inline (Insert_Delete_Lines);
902 -- ANCHOR(`wdeleteln()',`Delete_Line')
903 procedure Delete_Line (Win : in Window := Standard_Window);
905 -- ALIAS(`deleteln()')
906 pragma Inline (Delete_Line);
908 -- ANCHOR(`winsertln()',`Insert_Line')
909 procedure Insert_Line (Win : in Window := Standard_Window);
911 -- ALIAS(`insertln()')
912 pragma Inline (Insert_Line);
914 -- MANPAGE(`curs_getyx.3x')
916 -- ANCHOR(`getmaxyx()',`Get_Size')
918 (Win : in Window := Standard_Window;
919 Number_Of_Lines : out Line_Count;
920 Number_Of_Columns : out Column_Count);
922 pragma Inline (Get_Size);
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);
930 pragma Inline (Get_Window_Position);
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);
938 pragma Inline (Get_Cursor_Position);
940 -- ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent')
941 procedure Get_Origin_Relative_To_Parent
943 Top_Left_Line : out Line_Position;
944 Top_Left_Column : out Column_Position;
945 Is_Not_A_Subwindow : out Boolean);
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);
951 -- MANPAGE(`curs_pad.3x')
953 -- ANCHOR(`newpad()',`New_Pad')
954 function New_Pad (Lines : Line_Count;
955 Columns : Column_Count) return Window;
957 pragma Inline (New_Pad);
959 -- ANCHOR(`subpad()',`Sub_Pad')
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;
967 pragma Inline (Sub_Pad);
969 -- ANCHOR(`prefresh()',`Refresh')
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);
979 pragma Inline (Refresh);
981 -- ANCHOR(`pnoutrefresh()',`Refresh_Without_Update')
982 procedure Refresh_Without_Update
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);
991 pragma Inline (Refresh_Without_Update);
993 -- ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It')
994 procedure Add_Character_To_Pad_And_Echo_It
996 Ch : in Attributed_Character);
999 procedure Add_Character_To_Pad_And_Echo_It
1002 pragma Inline (Add_Character_To_Pad_And_Echo_It);
1004 -- MANPAGE(`curs_scroll.3x')
1006 -- ANCHOR(`wscrl()',`Scroll')
1007 procedure Scroll (Win : in Window := Standard_Window;
1008 Amount : in Integer := 1);
1010 -- ALIAS(`scroll()')
1012 pragma Inline (Scroll);
1014 -- MANPAGE(`curs_delch.3x')
1016 -- ANCHOR(`wdelch()',`Delete_Character')
1017 procedure Delete_Character (Win : in Window := Standard_Window);
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);
1027 -- ALIAS(`mvdelch()')
1028 pragma Inline (Delete_Character);
1030 -- MANPAGE(`curs_inch.3x')
1032 -- ANCHOR(`winch()',`Peek')
1033 function Peek (Win : Window := Standard_Window)
1034 return Attributed_Character;
1038 -- ANCHOR(`mvwinch()',`Peek')
1040 (Win : Window := Standard_Window;
1041 Line : Line_Position;
1042 Column : Column_Position) return Attributed_Character;
1044 -- ALIAS(`mvinch()')
1045 -- More Peek's follow, pragma Inline appears later.
1047 -- MANPAGE(`curs_insch.3x')
1049 -- ANCHOR(`winsch()',`Insert')
1050 procedure Insert (Win : in Window := Standard_Window;
1051 Ch : in Attributed_Character);
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);
1061 -- ALIAS(`mvinsch()')
1063 -- MANPAGE(`curs_insstr.3x')
1065 -- ANCHOR(`winsnstr()',`Insert')
1066 procedure Insert (Win : in Window := Standard_Window;
1068 Len : in Integer := -1);
1070 -- ALIAS(`winsstr()')
1071 -- ALIAS(`insnstr()')
1072 -- ALIAS(`insstr()')
1074 -- ANCHOR(`mvwinsnstr()',`Insert')
1075 procedure Insert (Win : in Window := Standard_Window;
1076 Line : in Line_Position;
1077 Column : in Column_Position;
1079 Len : in Integer := -1);
1081 -- ALIAS(`mvwinsstr()')
1082 -- ALIAS(`mvinsnstr()')
1083 -- ALIAS(`mvinsstr()')
1084 pragma Inline (Insert);
1086 -- MANPAGE(`curs_instr.3x')
1088 -- ANCHOR(`winnstr()',`Peek')
1089 procedure Peek (Win : in Window := Standard_Window;
1091 Len : in Integer := -1);
1093 -- ALIAS(`winstr()')
1094 -- ALIAS(`innstr()')
1097 -- ANCHOR(`mvwinnstr()',`Peek')
1098 procedure Peek (Win : in Window := Standard_Window;
1099 Line : in Line_Position;
1100 Column : in Column_Position;
1102 Len : in Integer := -1);
1104 -- ALIAS(`mvwinstr()')
1105 -- ALIAS(`mvinnstr()')
1106 -- ALIAS(`mvinstr()')
1108 -- MANPAGE(`curs_inchstr.3x')
1110 -- ANCHOR(`winchnstr()',`Peek')
1111 procedure Peek (Win : in Window := Standard_Window;
1112 Str : out Attributed_String;
1113 Len : in Integer := -1);
1115 -- ALIAS(`winchstr()')
1116 -- ALIAS(`inchnstr()')
1117 -- ALIAS(`inchstr()')
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);
1126 -- ALIAS(`mvwinchstr()')
1127 -- ALIAS(`mvinchnstr()')
1128 -- ALIAS(`mvinchstr()')
1129 -- We don't inline the Peek procedures
1131 -- MANPAGE(`curs_getstr.3x')
1133 -- ANCHOR(`wgetnstr()',`Get')
1134 procedure Get (Win : in Window := Standard_Window;
1136 Len : in Integer := -1);
1138 -- ALIAS(`wgetstr()')
1139 -- ALIAS(`getnstr()')
1140 -- ALIAS(`getstr()')
1141 -- actually getstr is not supported because that results in buffer
1144 -- ANCHOR(`mvwgetnstr()',`Get')
1145 procedure Get (Win : in Window := Standard_Window;
1146 Line : in Line_Position;
1147 Column : in Column_Position;
1149 Len : in Integer := -1);
1151 -- ALIAS(`mvwgetstr()')
1152 -- ALIAS(`mvgetnstr()')
1153 -- ALIAS(`mvgetstr()')
1154 -- Get is not inlined
1156 -- MANPAGE(`curs_slk.3x')
1158 -- Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set
1160 type Soft_Label_Key_Format is (Three_Two_Three,
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);
1167 -- ANCHOR(`slk_init()',`Init_Soft_Label_Keys')
1168 procedure Init_Soft_Label_Keys
1169 (Format : in Soft_Label_Key_Format := Three_Two_Three);
1171 pragma Inline (Init_Soft_Label_Keys);
1173 -- ANCHOR(`slk_set()',`Set_Soft_Label_Key')
1174 procedure Set_Soft_Label_Key (Label : in Label_Number;
1176 Fmt : in Label_Justification := Left);
1178 -- We don't inline this procedure
1180 -- ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key')
1181 procedure Refresh_Soft_Label_Keys;
1183 pragma Inline (Refresh_Soft_Label_Keys);
1185 -- ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update')
1186 procedure Refresh_Soft_Label_Keys_Without_Update;
1188 pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
1190 -- ANCHOR(`slk_label()',`Get_Soft_Label_Key')
1191 procedure Get_Soft_Label_Key (Label : in Label_Number;
1195 -- ANCHOR(`slk_label()',`Get_Soft_Label_Key')
1196 function Get_Soft_Label_Key (Label : in Label_Number) return String;
1199 pragma Inline (Get_Soft_Label_Key);
1201 -- ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys')
1202 procedure Clear_Soft_Label_Keys;
1204 pragma Inline (Clear_Soft_Label_Keys);
1206 -- ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys')
1207 procedure Restore_Soft_Label_Keys;
1209 pragma Inline (Restore_Soft_Label_Keys);
1211 -- ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys')
1212 procedure Touch_Soft_Label_Keys;
1214 pragma Inline (Touch_Soft_Label_Keys);
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);
1221 -- ALIAS(`slk_attroff()')
1222 pragma Inline (Switch_Soft_Label_Key_Attributes);
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);
1229 pragma Inline (Set_Soft_Label_Key_Attributes);
1231 -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1232 function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
1235 -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1236 function Get_Soft_Label_Key_Attributes return Color_Pair;
1238 pragma Inline (Get_Soft_Label_Key_Attributes);
1240 -- ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color')
1241 procedure Set_Soft_Label_Key_Color (Pair : in Color_Pair);
1243 pragma Inline (Set_Soft_Label_Key_Color);
1245 -- MANPAGE(`keybound.3x')
1246 -- Not Implemented: keybound
1248 -- MANPAGE(`keyok.3x')
1250 -- ANCHOR(`keyok()',`Enable_Key')
1251 procedure Enable_Key (Key : in Special_Key_Code;
1252 Enable : in Boolean := True);
1254 pragma Inline (Enable_Key);
1256 -- MANPAGE(`define_key.3x')
1258 -- ANCHOR(`define_key()',`Define_Key')
1259 procedure Define_Key (Definition : in String;
1260 Key : in Special_Key_Code);
1262 pragma Inline (Define_Key);
1264 -- MANPAGE(`curs_util.3x')
1266 -- | Not implemented : filter, use_env
1267 -- | putwin, getwin are in the child package PutWin
1270 -- ANCHOR(`keyname()',`Key_Name')
1271 procedure Key_Name (Key : in Real_Key_Code;
1274 -- The external name for a real keystroke.
1276 -- ANCHOR(`keyname()',`Key_Name')
1277 function Key_Name (Key : in Real_Key_Code) return String;
1280 -- We don't inline this routine
1282 -- ANCHOR(`unctrl()',`Un_Control')
1283 procedure Un_Control (Ch : in Attributed_Character;
1287 -- ANCHOR(`unctrl()',`Un_Control')
1288 function Un_Control (Ch : in Attributed_Character) return String;
1291 pragma Inline (Un_Control);
1293 -- ANCHOR(`delay_output()',`Delay_Output')
1294 procedure Delay_Output (Msecs : in Natural);
1296 pragma Inline (Delay_Output);
1298 -- ANCHOR(`flushinp()',`Flush_Input')
1299 procedure Flush_Input;
1301 pragma Inline (Flush_Input);
1303 -- MANPAGE(`curs_termattrs.3x')
1305 -- ANCHOR(`baudrate()',`Baudrate')
1306 function Baudrate return Natural;
1308 pragma Inline (Baudrate);
1310 -- ANCHOR(`erasechar()',`Erase_Character')
1311 function Erase_Character return Character;
1313 pragma Inline (Erase_Character);
1315 -- ANCHOR(`killchar()',`Kill_Character')
1316 function Kill_Character return Character;
1318 pragma Inline (Kill_Character);
1320 -- ANCHOR(`has_ic()',`Has_Insert_Character')
1321 function Has_Insert_Character return Boolean;
1323 pragma Inline (Has_Insert_Character);
1325 -- ANCHOR(`has_il()',`Has_Insert_Line')
1326 function Has_Insert_Line return Boolean;
1328 pragma Inline (Has_Insert_Line);
1330 -- ANCHOR(`termattrs()',`Supported_Attributes')
1331 function Supported_Attributes return Character_Attribute_Set;
1333 pragma Inline (Supported_Attributes);
1335 -- ANCHOR(`longname()',`Long_Name')
1336 procedure Long_Name (Name : out String);
1339 -- ANCHOR(`longname()',`Long_Name')
1340 function Long_Name return String;
1343 pragma Inline (Long_Name);
1345 -- ANCHOR(`termname()',`Terminal_Name')
1346 procedure Terminal_Name (Name : out String);
1349 -- ANCHOR(`termname()',`Terminal_Name')
1350 function Terminal_Name return String;
1353 pragma Inline (Terminal_Name);
1355 -- MANPAGE(`curs_color.3x')
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;
1363 -- ANCHOR(`start_color()',`Start_Color')
1364 procedure Start_Color;
1366 pragma Import (C, Start_Color, "start_color");
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);
1373 pragma Inline (Init_Pair);
1375 -- ANCHOR(`pair_content()',`Pair_Content')
1376 procedure Pair_Content (Pair : in Color_Pair;
1377 Fore : out Color_Number;
1378 Back : out Color_Number);
1380 pragma Inline (Pair_Content);
1382 -- ANCHOR(`has_colors()',`Has_Colors')
1383 function Has_Colors return Boolean;
1385 pragma Inline (Has_Colors);
1387 -- ANCHOR(`init_color()',`Init_Color')
1388 procedure Init_Color (Color : in Color_Number;
1390 Green : in RGB_Value;
1391 Blue : in RGB_Value);
1393 pragma Inline (Init_Color);
1395 -- ANCHOR(`can_change_color()',`Can_Change_Color')
1396 function Can_Change_Color return Boolean;
1398 pragma Inline (Can_Change_Color);
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);
1406 pragma Inline (Color_Content);
1408 -- MANPAGE(`curs_kernel.3x')
1409 -- | Not implemented: getsyx, setsyx
1411 type Curses_Mode is (Curses, Shell);
1413 -- ANCHOR(`def_prog_mode()',`Save_Curses_Mode')
1414 procedure Save_Curses_Mode (Mode : in Curses_Mode);
1416 -- ALIAS(`def_shell_mode()')
1417 pragma Inline (Save_Curses_Mode);
1419 -- ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode')
1420 procedure Reset_Curses_Mode (Mode : in Curses_Mode);
1422 -- ALIAS(`reset_shell_mode()')
1423 pragma Inline (Reset_Curses_Mode);
1425 -- ANCHOR(`savetty()',`Save_Terminal_State')
1426 procedure Save_Terminal_State;
1428 pragma Inline (Save_Terminal_State);
1430 -- ANCHOR(`resetty();',`Reset_Terminal_State')
1431 procedure Reset_Terminal_State;
1433 pragma Inline (Reset_Terminal_State);
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.
1443 -- ANCHOR(`ripoffline()',`Rip_Off_Lines')
1444 procedure Rip_Off_Lines (Lines : in Integer;
1445 Proc : in Stdscr_Init_Proc);
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);
1453 type Cursor_Visibility is (Invisible, Normal, Very_Visible);
1455 -- ANCHOR(`curs_set()',`Set_Cursor_Visibility')
1456 procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
1458 pragma Inline (Set_Cursor_Visibility);
1460 -- ANCHOR(`napms()',`Nap_Milli_Seconds')
1461 procedure Nap_Milli_Seconds (Ms : in Natural);
1463 pragma Inline (Nap_Milli_Seconds);
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
1481 -- MANPAGE(`dft_fgbg.3x')
1483 -- ANCHOR(`use_default_colors()',`Use_Default_Colors')
1484 procedure Use_Default_Colors;
1486 pragma Inline (Use_Default_Colors);
1488 -- ANCHOR(`assume_default_colors()',`Assume_Default_Colors')
1489 procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
1490 Back : Color_Number := Default_Color);
1492 pragma Inline (Assume_Default_Colors);
1494 -- MANPAGE(`curs_extend.3x')
1496 -- ANCHOR(`curses_version()',`Curses_Version')
1497 function Curses_Version return String;
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;
1505 -- MANPAGE(`curs_scr_dump.3x')
1507 -- ANCHOR(`scr_dump()',`Screen_Dump_To_File')
1508 procedure Screen_Dump_To_File (Filename : in String);
1511 -- ANCHOR(`scr_restore()',`Screen_Restore_From_File')
1512 procedure Screen_Restore_From_File (Filename : in String);
1515 -- ANCHOR(`scr_init()',`Screen_Init_From_File')
1516 procedure Screen_Init_From_File (Filename : in String);
1519 -- ANCHOR(`scr_set()',`Screen_Set_File')
1520 procedure Screen_Set_File (Filename : in String);
1523 -- MANPAGE(`curs_print.3x')
1524 -- Not implemented: mcprint
1526 -- MANPAGE(`curs_printw.3x')
1527 -- Not implemented: printw, wprintw, mvprintw, mvwprintw, vwprintw,
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.
1533 -- MANPAGE(`curs_scanw.3x')
1534 -- Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw
1537 -- MANPAGE(`resizeterm.3x')
1538 -- Not Implemented: resizeterm
1540 -- MANPAGE(`wresize.3x')
1542 -- ANCHOR(`wresize()',`Resize')
1543 procedure Resize (Win : Window := Standard_Window;
1544 Number_Of_Lines : Line_Count;
1545 Number_Of_Columns : Column_Count);
1549 type Window is new System.Storage_Elements.Integer_Address;
1550 Null_Window : constant Window := 0;
1552 -- The next constants are generated and may be different on your
1555 include(`Window_Offsets')dnl
1556 Curses_Bool_False : constant Curses_Bool := 0;
1558 end Terminal_Interface.Curses;