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 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
39 -- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en
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 Natural;
64 -- That is anything including real characters, special keys and logical
67 subtype Real_Key_Code is Key_Code range 0 .. M4_KEY_MAX;
68 -- This are the codes that potentially represent a real keystroke.
69 -- Not all codes may be possible on a specific terminal. To check the
70 -- availability of a special key, the Has_Key function is provided.
72 subtype Special_Key_Code is Real_Key_Code
73 range M4_SPECIAL_FIRST .. Real_Key_Code'Last;
74 -- Type for a function- or special key number
76 subtype Normal_Key_Code is Real_Key_Code range
77 Character'Pos (Character'First) .. Character'Pos (Character'Last);
78 -- This are the codes for regular (incl. non-graphical) characters.
80 -- Constants for function- and special keys
82 Key_None : constant Special_Key_Code := M4_SPECIAL_FIRST;
83 include(`Key_Definitions')
84 Key_Max : constant Special_Key_Code
85 := Special_Key_Code'Last;
87 subtype User_Key_Code is Key_Code
88 range (Key_Max + 129) .. Key_Code'Last;
89 -- This is reserved for user defined key codes. The range between Key_Max
90 -- and the first user code is reserved for subsystems like menu and forms.
92 -- For those who like to use the original key names we produce them were
93 -- they differ from the original. Please note that they may differ in
95 include(`Old_Keys')dnl
97 ------------------------------------------------------------------------------
99 type Color_Number is range -1 .. Integer (Interfaces.C.short'Last);
100 for Color_Number'Size use Interfaces.C.short'Size;
101 -- (n)curses uses a short for the color index
102 -- The model is, that a Color_Number is an index into an array of
103 -- (potentially) definable colors. Some of those indices are
104 -- predefined (see below), although they may not really exist.
106 include(`Color_Defs')
107 type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last);
108 for RGB_Value'Size use Interfaces.C.short'Size;
109 -- Some system may allow to redefine a color by setting RGB values.
111 type Color_Pair is range 0 .. 255;
112 for Color_Pair'Size use 8;
113 subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255;
114 -- (n)curses reserves 1 Byte for the color-pair number. Color Pair 0
115 -- is fixed (Black & White). A color pair is simply a combination of
116 -- two colors described by Color_Numbers, one for the foreground and
117 -- the other for the background
119 include(`Character_Attribute_Set_Rep')
120 -- (n)curses uses all but the lowest 16 Bits for Attributes.
122 Normal_Video : constant Character_Attribute_Set := (others => False);
124 type Attributed_Character is
126 Attr : Character_Attribute_Set;
130 pragma Convention (C, Attributed_Character);
131 -- This is the counterpart for the chtype in C.
134 Default_Character : constant Attributed_Character
135 := (Ch => Character'First,
136 Color => Color_Pair'First,
137 Attr => (others => False)); -- preelaboratable Normal_Video
139 type Attributed_String is array (Positive range <>) of Attributed_Character;
140 pragma Pack (Attributed_String);
141 -- In this binding we allow strings of attributed characters.
146 Curses_Exception : exception;
147 Wrong_Curses_Version : exception;
149 -- Those exceptions are raised by the ETI (Extended Terminal Interface)
150 -- subpackets for Menu and Forms handling.
152 Eti_System_Error : exception;
153 Eti_Bad_Argument : exception;
154 Eti_Posted : exception;
155 Eti_Connected : exception;
156 Eti_Bad_State : exception;
157 Eti_No_Room : exception;
158 Eti_Not_Posted : exception;
159 Eti_Unknown_Command : exception;
160 Eti_No_Match : exception;
161 Eti_Not_Selectable : exception;
162 Eti_Not_Connected : exception;
163 Eti_Request_Denied : exception;
164 Eti_Invalid_Field : exception;
165 Eti_Current : exception;
167 --------------------------------------------------------------------------
168 -- External C variables
169 -- Conceptually even in C this are kind of constants, but they are
170 -- initialized and sometimes changed by the library routines at runtime
171 -- depending on the type of terminal. I believe the best way to model
172 -- this is to use functions.
173 --------------------------------------------------------------------------
175 function Lines return Line_Count;
176 pragma Inline (Lines);
178 function Columns return Column_Count;
179 pragma Inline (Columns);
181 function Tab_Size return Natural;
182 pragma Inline (Tab_Size);
184 function Number_Of_Colors return Natural;
185 pragma Inline (Number_Of_Colors);
187 function Number_Of_Color_Pairs return Natural;
188 pragma Inline (Number_Of_Color_Pairs);
190 ACS_Map : array (Character'Val (0) .. Character'Val (127)) of
191 Attributed_Character;
192 pragma Import (C, ACS_Map, "acs_map");
195 -- Constants for several characters from the Alternate Character Set
196 -- You must use this constants as indices into the ACS_Map array
197 -- to get the corresponding attributed character at runtime.
199 include(`ACS_Map')dnl
201 -- MANPAGE(`curs_initscr.3x')
202 -- | Not implemented: newterm, set_term, delscreen, curscr
204 -- ANCHOR(`stdscr',`Standard_Window')
205 function Standard_Window return Window;
207 pragma Inline (Standard_Window);
209 -- ANCHOR(`initscr()',`Init_Screen')
210 procedure Init_Screen;
212 -- ANCHOR(`initscr()',`Init_Windows')
213 procedure Init_Windows renames Init_Screen;
215 pragma Inline (Init_Screen);
216 pragma Inline (Init_Windows);
218 -- ANCHOR(`endwin()',`End_Windows')
219 procedure End_Windows;
221 procedure End_Screen renames End_Windows;
222 pragma Inline (End_Windows);
223 pragma Inline (End_Screen);
225 -- ANCHOR(`isendwin()',`Is_End_Window')
226 function Is_End_Window return Boolean;
228 pragma Inline (Is_End_Window);
230 -- MANPAGE(`curs_move.3x')
232 -- ANCHOR(`wmove()',`Move_Cursor')
233 procedure Move_Cursor (Win : in Window := Standard_Window;
234 Line : in Line_Position;
235 Column : in Column_Position);
238 pragma Inline (Move_Cursor);
240 -- MANPAGE(`curs_addch.3x')
242 -- ANCHOR(`waddch()',`Add')
243 procedure Add (Win : in Window := Standard_Window;
244 Ch : in Attributed_Character);
248 procedure Add (Win : in Window := Standard_Window;
250 -- Add a single character at the current logical cursor position to
251 -- the window. Use the current windows attributes.
253 -- ANCHOR(`mvwaddch()',`Add')
255 (Win : in Window := Standard_Window;
256 Line : in Line_Position;
257 Column : in Column_Position;
258 Ch : in Attributed_Character);
260 -- ALIAS(`mvaddch()')
263 (Win : in Window := Standard_Window;
264 Line : in Line_Position;
265 Column : in Column_Position;
267 -- Move to the position and add a single character into the window
268 -- There are more Add routines, so the Inline pragma follows later
270 -- ANCHOR(`wechochar()',`Add_With_Immediate_Echo')
271 procedure Add_With_Immediate_Echo
272 (Win : in Window := Standard_Window;
273 Ch : in Attributed_Character);
275 -- ALIAS(`echochar()')
277 procedure Add_With_Immediate_Echo
278 (Win : in Window := Standard_Window;
280 -- Add a character and do an immediate refresh of the screen.
281 pragma Inline (Add_With_Immediate_Echo);
283 -- MANPAGE(`curs_window.3x')
284 -- Not Implemented: wcursyncup
286 -- ANCHOR(`newwin()',`Create')
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 -- Not Implemented: Default Number_Of_Lines, Number_Of_Columns
293 -- the C version lets them be 0, see the man page.
295 pragma Inline (Create);
298 (Number_Of_Lines : Line_Count;
299 Number_Of_Columns : Column_Count;
300 First_Line_Position : Line_Position;
301 First_Column_Position : Column_Position) return Window
303 pragma Inline (New_Window);
305 -- ANCHOR(`delwin()',`Delete')
306 procedure Delete (Win : in out Window);
308 -- Reset Win to Null_Window
309 pragma Inline (Delete);
311 -- ANCHOR(`subwin()',`Sub_Window')
313 (Win : Window := Standard_Window;
314 Number_Of_Lines : Line_Count;
315 Number_Of_Columns : Column_Count;
316 First_Line_Position : Line_Position;
317 First_Column_Position : Column_Position) return Window;
319 pragma Inline (Sub_Window);
321 -- ANCHOR(`derwin()',`Derived_Window')
322 function Derived_Window
323 (Win : Window := Standard_Window;
324 Number_Of_Lines : Line_Count;
325 Number_Of_Columns : Column_Count;
326 First_Line_Position : Line_Position;
327 First_Column_Position : Column_Position) return Window;
329 pragma Inline (Derived_Window);
331 -- ANCHOR(`dupwin()',`Duplicate')
332 function Duplicate (Win : Window) return Window;
334 pragma Inline (Duplicate);
336 -- ANCHOR(`mvwin()',`Move_Window')
337 procedure Move_Window (Win : in Window;
338 Line : in Line_Position;
339 Column : in Column_Position);
341 pragma Inline (Move_Window);
343 -- ANCHOR(`mvderwin()',`Move_Derived_Window')
344 procedure Move_Derived_Window (Win : in Window;
345 Line : in Line_Position;
346 Column : in Column_Position);
348 pragma Inline (Move_Derived_Window);
350 -- ANCHOR(`wsyncup()',`Synchronize_Upwards')
351 procedure Synchronize_Upwards (Win : in Window);
353 pragma Import (C, Synchronize_Upwards, "wsyncup");
355 -- ANCHOR(`wsyncdown()',`Synchronize_Downwards')
356 procedure Synchronize_Downwards (Win : in Window);
358 pragma Import (C, Synchronize_Downwards, "wsyncdown");
360 -- ANCHOR(`syncok()',`Set_Synch_Mode')
361 procedure Set_Synch_Mode (Win : in Window := Standard_Window;
362 Mode : in Boolean := False);
364 pragma Inline (Set_Synch_Mode);
366 -- MANPAGE(`curs_addstr.3x')
368 -- ANCHOR(`waddnstr()',`Add')
369 procedure Add (Win : in Window := Standard_Window;
371 Len : in Integer := -1);
373 -- ALIAS(`waddstr()')
374 -- ALIAS(`addnstr()')
377 -- ANCHOR(`mvwaddnstr()',`Add')
378 procedure Add (Win : in Window := Standard_Window;
379 Line : in Line_Position;
380 Column : in Column_Position;
382 Len : in Integer := -1);
384 -- ALIAS(`mvwaddstr()')
385 -- ALIAS(`mvaddnstr()')
386 -- ALIAS(`mvaddstr()')
388 -- MANPAGE(`curs_addchstr.3x')
390 -- ANCHOR(`waddchnstr()',`Add')
391 procedure Add (Win : in Window := Standard_Window;
392 Str : in Attributed_String;
393 Len : in Integer := -1);
395 -- ALIAS(`waddchstr()')
396 -- ALIAS(`addchnstr()')
397 -- ALIAS(`addchstr()')
399 -- ANCHOR(`mvwaddchnstr()',`Add')
400 procedure Add (Win : in Window := Standard_Window;
401 Line : in Line_Position;
402 Column : in Column_Position;
403 Str : in Attributed_String;
404 Len : in Integer := -1);
406 -- ALIAS(`mvwaddchstr()')
407 -- ALIAS(`mvaddchnstr()')
408 -- ALIAS(`mvaddchstr()')
411 -- MANPAGE(`curs_border.3x')
412 -- | Not implemented: mvhline, mvwhline, mvvline, mvwvline
413 -- | use Move_Cursor then Horizontal_Line or Vertical_Line
415 -- ANCHOR(`wborder()',`Border')
417 (Win : in Window := Standard_Window;
418 Left_Side_Symbol : in Attributed_Character := Default_Character;
419 Right_Side_Symbol : in Attributed_Character := Default_Character;
420 Top_Side_Symbol : in Attributed_Character := Default_Character;
421 Bottom_Side_Symbol : in Attributed_Character := Default_Character;
422 Upper_Left_Corner_Symbol : in Attributed_Character := Default_Character;
423 Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character;
424 Lower_Left_Corner_Symbol : in Attributed_Character := Default_Character;
425 Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character
429 pragma Inline (Border);
431 -- ANCHOR(`box()',`Box')
433 (Win : in Window := Standard_Window;
434 Vertical_Symbol : in Attributed_Character := Default_Character;
435 Horizontal_Symbol : in Attributed_Character := Default_Character);
439 -- ANCHOR(`whline()',`Horizontal_Line')
440 procedure Horizontal_Line
441 (Win : in Window := Standard_Window;
442 Line_Size : in Natural;
443 Line_Symbol : in Attributed_Character := Default_Character);
446 pragma Inline (Horizontal_Line);
448 -- ANCHOR(`wvline()',`Vertical_Line')
449 procedure Vertical_Line
450 (Win : in Window := Standard_Window;
451 Line_Size : in Natural;
452 Line_Symbol : in Attributed_Character := Default_Character);
455 pragma Inline (Vertical_Line);
457 -- MANPAGE(`curs_getch.3x')
458 -- Not implemented: mvgetch, mvwgetch
460 -- ANCHOR(`wgetch()',`Get_Keystroke')
461 function Get_Keystroke (Win : Window := Standard_Window)
462 return Real_Key_Code;
465 -- Get a character from the keyboard and echo it - if enabled - to the
467 -- If for any reason (i.e. a timeout) we couldn't get a character the
468 -- returned keycode is Key_None.
469 pragma Inline (Get_Keystroke);
471 -- ANCHOR(`ungetch()',`Undo_Keystroke')
472 procedure Undo_Keystroke (Key : in Real_Key_Code);
474 pragma Inline (Undo_Keystroke);
476 -- ANCHOR(`has_key()',`Has_Key')
477 function Has_Key (Key : Special_Key_Code) return Boolean;
479 pragma Inline (Has_Key);
482 -- | Some helper functions
484 function Is_Function_Key (Key : Special_Key_Code) return Boolean;
485 -- Return True if the Key is a function key (i.e. one of F0 .. F63)
486 pragma Inline (Is_Function_Key);
488 subtype Function_Key_Number is Integer range 0 .. 63;
489 -- (n)curses allows for 64 function keys.
491 function Function_Key (Key : Real_Key_Code) return Function_Key_Number;
492 -- Return the number of the function key. If the code is not a
493 -- function key, a CONSTRAINT_ERROR will be raised.
494 pragma Inline (Function_Key);
496 function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
497 -- Return the key code for a given function-key number.
498 pragma Inline (Function_Key_Code);
500 -- MANPAGE(`curs_attr.3x')
501 -- | Not implemented attr_off, wattr_off,
502 -- | attr_on, wattr_on, attr_set, wattr_set
505 -- PAIR_NUMBER(c) is the same as c.Color
507 -- ANCHOR(`standout()',`Standout')
508 procedure Standout (Win : Window := Standard_Window;
509 On : Boolean := True);
510 -- ALIAS(`wstandout()')
511 -- ALIAS(`wstandend()')
513 -- ANCHOR(`wattron()',`Switch_Character_Attribute')
514 procedure Switch_Character_Attribute
515 (Win : in Window := Standard_Window;
516 Attr : in Character_Attribute_Set := Normal_Video;
517 On : in Boolean := True); -- if False we switch Off.
518 -- Switches those Attributes set to true in the list.
520 -- ALIAS(`wattroff()')
522 -- ALIAS(`attroff()')
524 -- ANCHOR(`wattrset()',`Set_Character_Attributes')
525 procedure Set_Character_Attributes
526 (Win : in Window := Standard_Window;
527 Attr : in Character_Attribute_Set := Normal_Video;
528 Color : in Color_Pair := Color_Pair'First);
530 -- ALIAS(`attrset()')
531 pragma Inline (Set_Character_Attributes);
533 -- ANCHOR(`wattr_get()',`Get_Character_Attributes')
534 function Get_Character_Attribute
535 (Win : in Window := Standard_Window) return Character_Attribute_Set;
537 -- ALIAS(`attr_get()')
539 -- ANCHOR(`wattr_get()',`Get_Character_Attribute')
540 function Get_Character_Attribute
541 (Win : in Window := Standard_Window) return Color_Pair;
543 pragma Inline (Get_Character_Attribute);
545 -- ANCHOR(`wcolor_set()',`Set_Color')
546 procedure Set_Color (Win : in Window := Standard_Window;
547 Pair : in Color_Pair);
549 -- ALIAS(`color_set()')
550 pragma Inline (Set_Color);
552 -- ANCHOR(`wchgat()',`Change_Attributes')
553 procedure Change_Attributes
554 (Win : in Window := Standard_Window;
555 Count : in Integer := -1;
556 Attr : in Character_Attribute_Set := Normal_Video;
557 Color : in Color_Pair := Color_Pair'First);
561 -- ANCHOR(`mvwchgat()',`Change_Attributes')
562 procedure Change_Attributes
563 (Win : in Window := Standard_Window;
564 Line : in Line_Position := Line_Position'First;
565 Column : in Column_Position := Column_Position'First;
566 Count : in Integer := -1;
567 Attr : in Character_Attribute_Set := Normal_Video;
568 Color : in Color_Pair := Color_Pair'First);
570 -- ALIAS(`mvchgat()')
571 pragma Inline (Change_Attributes);
573 -- MANPAGE(`curs_beep.3x')
575 -- ANCHOR(`beep()',`Beep')
578 pragma Inline (Beep);
580 -- ANCHOR(`flash()',`Flash_Screen')
581 procedure Flash_Screen;
583 pragma Inline (Flash_Screen);
585 -- MANPAGE(`curs_inopts.3x')
587 -- | Not implemented : typeahead
589 -- ANCHOR(`cbreak()',`Set_Cbreak_Mode')
590 procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True);
592 -- ALIAS(`nocbreak()')
593 pragma Inline (Set_Cbreak_Mode);
595 -- ANCHOR(`raw()',`Set_Raw_Mode')
596 procedure Set_Raw_Mode (SwitchOn : in Boolean := True);
599 pragma Inline (Set_Raw_Mode);
601 -- ANCHOR(`echo()',`Set_Echo_Mode')
602 procedure Set_Echo_Mode (SwitchOn : in Boolean := True);
605 pragma Inline (Set_Echo_Mode);
607 -- ANCHOR(`meta()',`Set_Meta_Mode')
608 procedure Set_Meta_Mode (Win : in Window := Standard_Window;
609 SwitchOn : in Boolean := True);
611 pragma Inline (Set_Meta_Mode);
613 -- ANCHOR(`keypad()',`Set_KeyPad_Mode')
614 procedure Set_KeyPad_Mode (Win : in Window := Standard_Window;
615 SwitchOn : in Boolean := True);
617 pragma Inline (Set_KeyPad_Mode);
619 function Get_KeyPad_Mode (Win : in Window := Standard_Window)
621 -- This has no pendant in C. There you've to look into the WINDOWS
622 -- structure to get the value. Bad practice, not repeated in Ada.
624 type Half_Delay_Amount is range 1 .. 255;
626 -- ANCHOR(`halfdelay()',`Half_Delay')
627 procedure Half_Delay (Amount : in Half_Delay_Amount);
629 pragma Inline (Half_Delay);
631 -- ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode')
632 procedure Set_Flush_On_Interrupt_Mode
633 (Win : in Window := Standard_Window;
634 Mode : in Boolean := True);
636 pragma Inline (Set_Flush_On_Interrupt_Mode);
638 -- ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode')
639 procedure Set_Queue_Interrupt_Mode
640 (Win : in Window := Standard_Window;
641 Flush : in Boolean := True);
643 -- ALIAS(`noqiflush()')
644 pragma Inline (Set_Queue_Interrupt_Mode);
646 -- ANCHOR(`nodelay()',`Set_NoDelay_Mode')
647 procedure Set_NoDelay_Mode
648 (Win : in Window := Standard_Window;
649 Mode : in Boolean := False);
651 pragma Inline (Set_NoDelay_Mode);
653 type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
655 -- ANCHOR(`wtimeout()',`Set_Timeout_Mode')
656 procedure Set_Timeout_Mode (Win : in Window := Standard_Window;
657 Mode : in Timeout_Mode;
658 Amount : in Natural); -- in Milliseconds
660 -- ALIAS(`timeout()')
661 -- Instead of overloading the semantic of the sign of amount, we
662 -- introduce the Timeout_Mode parameter. This should improve
663 -- readability. For Blocking and Non_Blocking, the Amount is not
665 -- We don't inline this procedure.
667 -- ANCHOR(`notimeout()',`Set_Escape_Time_Mode')
668 procedure Set_Escape_Timer_Mode
669 (Win : in Window := Standard_Window;
670 Timer_Off : in Boolean := False);
672 pragma Inline (Set_Escape_Timer_Mode);
674 -- MANPAGE(`curs_outopts.3x')
676 -- ANCHOR(`nl()',`Set_NL_Mode')
677 procedure Set_NL_Mode (SwitchOn : in Boolean := True);
680 pragma Inline (Set_NL_Mode);
682 -- ANCHOR(`clearok()',`Clear_On_Next_Update')
683 procedure Clear_On_Next_Update
684 (Win : in Window := Standard_Window;
685 Do_Clear : in Boolean := True);
687 pragma Inline (Clear_On_Next_Update);
689 -- ANCHOR(`idlok()',`Use_Insert_Delete_Line')
690 procedure Use_Insert_Delete_Line
691 (Win : in Window := Standard_Window;
692 Do_Idl : in Boolean := True);
694 pragma Inline (Use_Insert_Delete_Line);
696 -- ANCHOR(`idcok()',`Use_Insert_Delete_Character')
697 procedure Use_Insert_Delete_Character
698 (Win : in Window := Standard_Window;
699 Do_Idc : in Boolean := True);
701 pragma Inline (Use_Insert_Delete_Character);
703 -- ANCHOR(`leaveok()',`Leave_Cursor_After_Update')
704 procedure Leave_Cursor_After_Update
705 (Win : in Window := Standard_Window;
706 Do_Leave : in Boolean := True);
708 pragma Inline (Leave_Cursor_After_Update);
710 -- ANCHOR(`immedok()',`Immediate_Update_Mode')
711 procedure Immediate_Update_Mode
712 (Win : in Window := Standard_Window;
713 Mode : in Boolean := False);
715 pragma Inline (Immediate_Update_Mode);
717 -- ANCHOR(`scrollok()',`Allow_Scrolling')
718 procedure Allow_Scrolling
719 (Win : in Window := Standard_Window;
720 Mode : in Boolean := False);
722 pragma Inline (Allow_Scrolling);
724 function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
725 -- There is no such function in the C interface.
726 pragma Inline (Scrolling_Allowed);
728 -- ANCHOR(`wsetscrreg()',`Set_Scroll_Region')
729 procedure Set_Scroll_Region
730 (Win : in Window := Standard_Window;
731 Top_Line : in Line_Position;
732 Bottom_Line : in Line_Position);
734 -- ALIAS(`setscrreg()')
735 pragma Inline (Set_Scroll_Region);
737 -- MANPAGE(`curs_refresh.3x')
739 -- ANCHOR(`doupdate()',`Update_Screen')
740 procedure Update_Screen;
742 pragma Inline (Update_Screen);
744 -- ANCHOR(`wrefresh()',`Refresh')
745 procedure Refresh (Win : in Window := Standard_Window);
747 -- There is an overloaded Refresh for Pads.
748 -- The Inline pragma appears there
749 -- ALIAS(`refresh()')
751 -- ANCHOR(`wnoutrefresh()',`Refresh_Without_Update')
752 procedure Refresh_Without_Update
753 (Win : in Window := Standard_Window);
755 -- There is an overloaded Refresh_Without_Update for Pads.
756 -- The Inline pragma appears there
758 -- ANCHOR(`redrawwin()',`Redraw')
759 procedure Redraw (Win : in Window := Standard_Window);
762 -- ANCHOR(`wredrawln()',`Redraw')
763 procedure Redraw (Win : in Window := Standard_Window;
764 Begin_Line : in Line_Position;
765 Line_Count : in Positive);
767 pragma Inline (Redraw);
769 -- MANPAGE(`curs_clear.3x')
771 -- ANCHOR(`werase()',`Erase')
772 procedure Erase (Win : in Window := Standard_Window);
775 pragma Inline (Erase);
777 -- ANCHOR(`wclear()',`Clear')
779 (Win : in Window := Standard_Window);
782 pragma Inline (Clear);
784 -- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen')
785 procedure Clear_To_End_Of_Screen
786 (Win : in Window := Standard_Window);
788 -- ALIAS(`clrtobot()')
789 pragma Inline (Clear_To_End_Of_Screen);
791 -- ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line')
792 procedure Clear_To_End_Of_Line
793 (Win : in Window := Standard_Window);
795 -- ALIAS(`clrtoeol()')
796 pragma Inline (Clear_To_End_Of_Line);
798 -- MANPAGE(`curs_bkgd.3x')
800 -- ANCHOR(`wbkgdset()',`Set_Background')
801 -- TODO: we could have Set_Background(Window; Character_Attribute_Set)
802 -- because in C it is common to see bkgdset(A_BOLD) or
803 -- bkgdset(COLOR_PAIR(n))
804 procedure Set_Background
805 (Win : in Window := Standard_Window;
806 Ch : in Attributed_Character);
808 -- ALIAS(`bkgdset()')
809 pragma Inline (Set_Background);
811 -- ANCHOR(`wbkgd()',`Change_Background')
812 procedure Change_Background
813 (Win : in Window := Standard_Window;
814 Ch : in Attributed_Character);
817 pragma Inline (Change_Background);
819 -- ANCHOR(`wbkgdget()',`Get_Background')
820 -- ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough.
821 function Get_Background (Win : Window := Standard_Window)
822 return Attributed_Character;
824 -- ALIAS(`bkgdget()')
825 pragma Inline (Get_Background);
827 -- MANPAGE(`curs_touch.3x')
829 -- ANCHOR(`untouchwin()',`Untouch')
830 procedure Untouch (Win : in Window := Standard_Window);
832 pragma Inline (Untouch);
834 -- ANCHOR(`touchwin()',`Touch')
835 procedure Touch (Win : in Window := Standard_Window);
838 -- ANCHOR(`touchline()',`Touch')
839 procedure Touch (Win : in Window := Standard_Window;
840 Start : in Line_Position;
841 Count : in Positive);
843 pragma Inline (Touch);
845 -- ANCHOR(`wtouchln()',`Change_Line_Status')
846 procedure Change_Lines_Status (Win : in Window := Standard_Window;
847 Start : in Line_Position;
851 pragma Inline (Change_Lines_Status);
853 -- ANCHOR(`is_linetouched()',`Is_Touched')
854 function Is_Touched (Win : Window := Standard_Window;
855 Line : Line_Position) return Boolean;
858 -- ANCHOR(`is_wintouched()',`Is_Touched')
859 function Is_Touched (Win : Window := Standard_Window) return Boolean;
861 pragma Inline (Is_Touched);
863 -- MANPAGE(`curs_overlay.3x')
865 -- ANCHOR(`copywin()',`Copy')
867 (Source_Window : in Window;
868 Destination_Window : in Window;
869 Source_Top_Row : in Line_Position;
870 Source_Left_Column : in Column_Position;
871 Destination_Top_Row : in Line_Position;
872 Destination_Left_Column : in Column_Position;
873 Destination_Bottom_Row : in Line_Position;
874 Destination_Right_Column : in Column_Position;
875 Non_Destructive_Mode : in Boolean := True);
877 pragma Inline (Copy);
879 -- ANCHOR(`overwrite()',`Overwrite')
880 procedure Overwrite (Source_Window : in Window;
881 Destination_Window : in Window);
883 pragma Inline (Overwrite);
885 -- ANCHOR(`overlay()',`Overlay')
886 procedure Overlay (Source_Window : in Window;
887 Destination_Window : in Window);
889 pragma Inline (Overlay);
891 -- MANPAGE(`curs_deleteln.3x')
893 -- ANCHOR(`winsdelln()',`Insert_Delete_Lines')
894 procedure Insert_Delete_Lines
895 (Win : in Window := Standard_Window;
896 Lines : in Integer := 1); -- default is to insert one line above
898 -- ALIAS(`insdelln()')
899 pragma Inline (Insert_Delete_Lines);
901 -- ANCHOR(`wdeleteln()',`Delete_Line')
902 procedure Delete_Line (Win : in Window := Standard_Window);
904 -- ALIAS(`deleteln()')
905 pragma Inline (Delete_Line);
907 -- ANCHOR(`winsertln()',`Insert_Line')
908 procedure Insert_Line (Win : in Window := Standard_Window);
910 -- ALIAS(`insertln()')
911 pragma Inline (Insert_Line);
913 -- MANPAGE(`curs_getyx.3x')
915 -- ANCHOR(`getmaxyx()',`Get_Size')
917 (Win : in Window := Standard_Window;
918 Number_Of_Lines : out Line_Count;
919 Number_Of_Columns : out Column_Count);
921 pragma Inline (Get_Size);
923 -- ANCHOR(`getbegyx()',`Get_Window_Position')
924 procedure Get_Window_Position
925 (Win : in Window := Standard_Window;
926 Top_Left_Line : out Line_Position;
927 Top_Left_Column : out Column_Position);
929 pragma Inline (Get_Window_Position);
931 -- ANCHOR(`getyx()',`Get_Cursor_Position')
932 procedure Get_Cursor_Position
933 (Win : in Window := Standard_Window;
934 Line : out Line_Position;
935 Column : out Column_Position);
937 pragma Inline (Get_Cursor_Position);
939 -- ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent')
940 procedure Get_Origin_Relative_To_Parent
942 Top_Left_Line : out Line_Position;
943 Top_Left_Column : out Column_Position;
944 Is_Not_A_Subwindow : out Boolean);
946 -- Instead of placing -1 in the coordinates as return, we use a boolean
947 -- to return the info that the window has no parent.
948 pragma Inline (Get_Origin_Relative_To_Parent);
950 -- MANPAGE(`curs_pad.3x')
952 -- ANCHOR(`newpad()',`New_Pad')
953 function New_Pad (Lines : Line_Count;
954 Columns : Column_Count) return Window;
956 pragma Inline (New_Pad);
958 -- ANCHOR(`subpad()',`Sub_Pad')
961 Number_Of_Lines : Line_Count;
962 Number_Of_Columns : Column_Count;
963 First_Line_Position : Line_Position;
964 First_Column_Position : Column_Position) return Window;
966 pragma Inline (Sub_Pad);
968 -- ANCHOR(`prefresh()',`Refresh')
971 Source_Top_Row : in Line_Position;
972 Source_Left_Column : in Column_Position;
973 Destination_Top_Row : in Line_Position;
974 Destination_Left_Column : in Column_Position;
975 Destination_Bottom_Row : in Line_Position;
976 Destination_Right_Column : in Column_Position);
978 pragma Inline (Refresh);
980 -- ANCHOR(`pnoutrefresh()',`Refresh_Without_Update')
981 procedure Refresh_Without_Update
983 Source_Top_Row : in Line_Position;
984 Source_Left_Column : in Column_Position;
985 Destination_Top_Row : in Line_Position;
986 Destination_Left_Column : in Column_Position;
987 Destination_Bottom_Row : in Line_Position;
988 Destination_Right_Column : in Column_Position);
990 pragma Inline (Refresh_Without_Update);
992 -- ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It')
993 procedure Add_Character_To_Pad_And_Echo_It
995 Ch : in Attributed_Character);
998 procedure Add_Character_To_Pad_And_Echo_It
1001 pragma Inline (Add_Character_To_Pad_And_Echo_It);
1003 -- MANPAGE(`curs_scroll.3x')
1005 -- ANCHOR(`wscrl()',`Scroll')
1006 procedure Scroll (Win : in Window := Standard_Window;
1007 Amount : in Integer := 1);
1009 -- ALIAS(`scroll()')
1011 pragma Inline (Scroll);
1013 -- MANPAGE(`curs_delch.3x')
1015 -- ANCHOR(`wdelch()',`Delete_Character')
1016 procedure Delete_Character (Win : in Window := Standard_Window);
1020 -- ANCHOR(`mvwdelch()',`Delete_Character')
1021 procedure Delete_Character
1022 (Win : in Window := Standard_Window;
1023 Line : in Line_Position;
1024 Column : in Column_Position);
1026 -- ALIAS(`mvdelch()')
1027 pragma Inline (Delete_Character);
1029 -- MANPAGE(`curs_inch.3x')
1031 -- ANCHOR(`winch()',`Peek')
1032 function Peek (Win : Window := Standard_Window)
1033 return Attributed_Character;
1037 -- ANCHOR(`mvwinch()',`Peek')
1039 (Win : Window := Standard_Window;
1040 Line : Line_Position;
1041 Column : Column_Position) return Attributed_Character;
1043 -- ALIAS(`mvinch()')
1044 -- More Peek's follow, pragma Inline appears later.
1046 -- MANPAGE(`curs_insch.3x')
1048 -- ANCHOR(`winsch()',`Insert')
1049 procedure Insert (Win : in Window := Standard_Window;
1050 Ch : in Attributed_Character);
1054 -- ANCHOR(`mvwinsch()',`Insert')
1055 procedure Insert (Win : in Window := Standard_Window;
1056 Line : in Line_Position;
1057 Column : in Column_Position;
1058 Ch : in Attributed_Character);
1060 -- ALIAS(`mvinsch()')
1062 -- MANPAGE(`curs_insstr.3x')
1064 -- ANCHOR(`winsnstr()',`Insert')
1065 procedure Insert (Win : in Window := Standard_Window;
1067 Len : in Integer := -1);
1069 -- ALIAS(`winsstr()')
1070 -- ALIAS(`insnstr()')
1071 -- ALIAS(`insstr()')
1073 -- ANCHOR(`mvwinsnstr()',`Insert')
1074 procedure Insert (Win : in Window := Standard_Window;
1075 Line : in Line_Position;
1076 Column : in Column_Position;
1078 Len : in Integer := -1);
1080 -- ALIAS(`mvwinsstr()')
1081 -- ALIAS(`mvinsnstr()')
1082 -- ALIAS(`mvinsstr()')
1083 pragma Inline (Insert);
1085 -- MANPAGE(`curs_instr.3x')
1087 -- ANCHOR(`winnstr()',`Peek')
1088 procedure Peek (Win : in Window := Standard_Window;
1090 Len : in Integer := -1);
1092 -- ALIAS(`winstr()')
1093 -- ALIAS(`innstr()')
1096 -- ANCHOR(`mvwinnstr()',`Peek')
1097 procedure Peek (Win : in Window := Standard_Window;
1098 Line : in Line_Position;
1099 Column : in Column_Position;
1101 Len : in Integer := -1);
1103 -- ALIAS(`mvwinstr()')
1104 -- ALIAS(`mvinnstr()')
1105 -- ALIAS(`mvinstr()')
1107 -- MANPAGE(`curs_inchstr.3x')
1109 -- ANCHOR(`winchnstr()',`Peek')
1110 procedure Peek (Win : in Window := Standard_Window;
1111 Str : out Attributed_String;
1112 Len : in Integer := -1);
1114 -- ALIAS(`winchstr()')
1115 -- ALIAS(`inchnstr()')
1116 -- ALIAS(`inchstr()')
1118 -- ANCHOR(`mvwinchnstr()',`Peek')
1119 procedure Peek (Win : in Window := Standard_Window;
1120 Line : in Line_Position;
1121 Column : in Column_Position;
1122 Str : out Attributed_String;
1123 Len : in Integer := -1);
1125 -- ALIAS(`mvwinchstr()')
1126 -- ALIAS(`mvinchnstr()')
1127 -- ALIAS(`mvinchstr()')
1128 -- We don't inline the Peek procedures
1130 -- MANPAGE(`curs_getstr.3x')
1132 -- ANCHOR(`wgetnstr()',`Get')
1133 procedure Get (Win : in Window := Standard_Window;
1135 Len : in Integer := -1);
1137 -- ALIAS(`wgetstr()')
1138 -- ALIAS(`getnstr()')
1139 -- ALIAS(`getstr()')
1140 -- actually getstr is not supported because that results in buffer
1143 -- ANCHOR(`mvwgetnstr()',`Get')
1144 procedure Get (Win : in Window := Standard_Window;
1145 Line : in Line_Position;
1146 Column : in Column_Position;
1148 Len : in Integer := -1);
1150 -- ALIAS(`mvwgetstr()')
1151 -- ALIAS(`mvgetnstr()')
1152 -- ALIAS(`mvgetstr()')
1153 -- Get is not inlined
1155 -- MANPAGE(`curs_slk.3x')
1157 -- Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set
1159 type Soft_Label_Key_Format is (Three_Two_Three,
1161 PC_Style, -- ncurses specific
1162 PC_Style_With_Index); -- "
1163 type Label_Number is new Positive range 1 .. 12;
1164 type Label_Justification is (Left, Centered, Right);
1166 -- ANCHOR(`slk_init()',`Init_Soft_Label_Keys')
1167 procedure Init_Soft_Label_Keys
1168 (Format : in Soft_Label_Key_Format := Three_Two_Three);
1170 pragma Inline (Init_Soft_Label_Keys);
1172 -- ANCHOR(`slk_set()',`Set_Soft_Label_Key')
1173 procedure Set_Soft_Label_Key (Label : in Label_Number;
1175 Fmt : in Label_Justification := Left);
1177 -- We don't inline this procedure
1179 -- ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key')
1180 procedure Refresh_Soft_Label_Keys;
1182 pragma Inline (Refresh_Soft_Label_Keys);
1184 -- ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update')
1185 procedure Refresh_Soft_Label_Keys_Without_Update;
1187 pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
1189 -- ANCHOR(`slk_label()',`Get_Soft_Label_Key')
1190 procedure Get_Soft_Label_Key (Label : in Label_Number;
1194 -- ANCHOR(`slk_label()',`Get_Soft_Label_Key')
1195 function Get_Soft_Label_Key (Label : in Label_Number) return String;
1198 pragma Inline (Get_Soft_Label_Key);
1200 -- ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys')
1201 procedure Clear_Soft_Label_Keys;
1203 pragma Inline (Clear_Soft_Label_Keys);
1205 -- ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys')
1206 procedure Restore_Soft_Label_Keys;
1208 pragma Inline (Restore_Soft_Label_Keys);
1210 -- ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys')
1211 procedure Touch_Soft_Label_Keys;
1213 pragma Inline (Touch_Soft_Label_Keys);
1215 -- ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes')
1216 procedure Switch_Soft_Label_Key_Attributes
1217 (Attr : in Character_Attribute_Set;
1218 On : in Boolean := True);
1220 -- ALIAS(`slk_attroff()')
1221 pragma Inline (Switch_Soft_Label_Key_Attributes);
1223 -- ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes')
1224 procedure Set_Soft_Label_Key_Attributes
1225 (Attr : in Character_Attribute_Set := Normal_Video;
1226 Color : in Color_Pair := Color_Pair'First);
1228 pragma Inline (Set_Soft_Label_Key_Attributes);
1230 -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1231 function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
1234 -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1235 function Get_Soft_Label_Key_Attributes return Color_Pair;
1237 pragma Inline (Get_Soft_Label_Key_Attributes);
1239 -- ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color')
1240 procedure Set_Soft_Label_Key_Color (Pair : in Color_Pair);
1242 pragma Inline (Set_Soft_Label_Key_Color);
1244 -- MANPAGE(`keybound.3x')
1245 -- Not Implemented: keybound
1247 -- MANPAGE(`keyok.3x')
1249 -- ANCHOR(`keyok()',`Enable_Key')
1250 procedure Enable_Key (Key : in Special_Key_Code;
1251 Enable : in Boolean := True);
1253 pragma Inline (Enable_Key);
1255 -- MANPAGE(`define_key.3x')
1257 -- ANCHOR(`define_key()',`Define_Key')
1258 procedure Define_Key (Definition : in String;
1259 Key : in Special_Key_Code);
1261 pragma Inline (Define_Key);
1263 -- MANPAGE(`curs_util.3x')
1265 -- | Not implemented : filter, use_env
1266 -- | putwin, getwin are in the child package PutWin
1269 -- ANCHOR(`keyname()',`Key_Name')
1270 procedure Key_Name (Key : in Real_Key_Code;
1273 -- The external name for a real keystroke.
1275 -- ANCHOR(`keyname()',`Key_Name')
1276 function Key_Name (Key : in Real_Key_Code) return String;
1279 -- We don't inline this routine
1281 -- ANCHOR(`unctrl()',`Un_Control')
1282 procedure Un_Control (Ch : in Attributed_Character;
1286 -- ANCHOR(`unctrl()',`Un_Control')
1287 function Un_Control (Ch : in Attributed_Character) return String;
1290 pragma Inline (Un_Control);
1292 -- ANCHOR(`delay_output()',`Delay_Output')
1293 procedure Delay_Output (Msecs : in Natural);
1295 pragma Inline (Delay_Output);
1297 -- ANCHOR(`flushinp()',`Flush_Input')
1298 procedure Flush_Input;
1300 pragma Inline (Flush_Input);
1302 -- MANPAGE(`curs_termattrs.3x')
1304 -- ANCHOR(`baudrate()',`Baudrate')
1305 function Baudrate return Natural;
1307 pragma Inline (Baudrate);
1309 -- ANCHOR(`erasechar()',`Erase_Character')
1310 function Erase_Character return Character;
1312 pragma Inline (Erase_Character);
1314 -- ANCHOR(`killchar()',`Kill_Character')
1315 function Kill_Character return Character;
1317 pragma Inline (Kill_Character);
1319 -- ANCHOR(`has_ic()',`Has_Insert_Character')
1320 function Has_Insert_Character return Boolean;
1322 pragma Inline (Has_Insert_Character);
1324 -- ANCHOR(`has_il()',`Has_Insert_Line')
1325 function Has_Insert_Line return Boolean;
1327 pragma Inline (Has_Insert_Line);
1329 -- ANCHOR(`termattrs()',`Supported_Attributes')
1330 function Supported_Attributes return Character_Attribute_Set;
1332 pragma Inline (Supported_Attributes);
1334 -- ANCHOR(`longname()',`Long_Name')
1335 procedure Long_Name (Name : out String);
1338 -- ANCHOR(`longname()',`Long_Name')
1339 function Long_Name return String;
1342 pragma Inline (Long_Name);
1344 -- ANCHOR(`termname()',`Terminal_Name')
1345 procedure Terminal_Name (Name : out String);
1348 -- ANCHOR(`termname()',`Terminal_Name')
1349 function Terminal_Name return String;
1352 pragma Inline (Terminal_Name);
1354 -- MANPAGE(`curs_color.3x')
1357 -- COLOR_PAIR(n) in C is the same as
1358 -- Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video)
1359 -- In C you often see something like c = c | COLOR_PAIR(n);
1360 -- This is equivalent to c.Color := n;
1362 -- ANCHOR(`start_color()',`Start_Color')
1363 procedure Start_Color;
1365 pragma Import (C, Start_Color, "start_color");
1367 -- ANCHOR(`init_pair()',`Init_Pair')
1368 procedure Init_Pair (Pair : in Redefinable_Color_Pair;
1369 Fore : in Color_Number;
1370 Back : in Color_Number);
1372 pragma Inline (Init_Pair);
1374 -- ANCHOR(`pair_content()',`Pair_Content')
1375 procedure Pair_Content (Pair : in Color_Pair;
1376 Fore : out Color_Number;
1377 Back : out Color_Number);
1379 pragma Inline (Pair_Content);
1381 -- ANCHOR(`has_colors()',`Has_Colors')
1382 function Has_Colors return Boolean;
1384 pragma Inline (Has_Colors);
1386 -- ANCHOR(`init_color()',`Init_Color')
1387 procedure Init_Color (Color : in Color_Number;
1389 Green : in RGB_Value;
1390 Blue : in RGB_Value);
1392 pragma Inline (Init_Color);
1394 -- ANCHOR(`can_change_color()',`Can_Change_Color')
1395 function Can_Change_Color return Boolean;
1397 pragma Inline (Can_Change_Color);
1399 -- ANCHOR(`color_content()',`Color_Content')
1400 procedure Color_Content (Color : in Color_Number;
1401 Red : out RGB_Value;
1402 Green : out RGB_Value;
1403 Blue : out RGB_Value);
1405 pragma Inline (Color_Content);
1407 -- MANPAGE(`curs_kernel.3x')
1408 -- | Not implemented: getsyx, setsyx
1410 type Curses_Mode is (Curses, Shell);
1412 -- ANCHOR(`def_prog_mode()',`Save_Curses_Mode')
1413 procedure Save_Curses_Mode (Mode : in Curses_Mode);
1415 -- ALIAS(`def_shell_mode()')
1416 pragma Inline (Save_Curses_Mode);
1418 -- ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode')
1419 procedure Reset_Curses_Mode (Mode : in Curses_Mode);
1421 -- ALIAS(`reset_shell_mode()')
1422 pragma Inline (Reset_Curses_Mode);
1424 -- ANCHOR(`savetty()',`Save_Terminal_State')
1425 procedure Save_Terminal_State;
1427 pragma Inline (Save_Terminal_State);
1429 -- ANCHOR(`resetty();',`Reset_Terminal_State')
1430 procedure Reset_Terminal_State;
1432 pragma Inline (Reset_Terminal_State);
1434 type Stdscr_Init_Proc is access
1435 function (Win : Window;
1436 Columns : Column_Count) return Integer;
1437 pragma Convention (C, Stdscr_Init_Proc);
1438 -- N.B.: the return value is actually ignored, but it seems to be
1439 -- a good practice to return 0 if you think all went fine
1440 -- and -1 otherwise.
1442 -- ANCHOR(`ripoffline()',`Rip_Off_Lines')
1443 procedure Rip_Off_Lines (Lines : in Integer;
1444 Proc : in Stdscr_Init_Proc);
1446 -- N.B.: to be more precise, this uses a ncurses specific enhancement of
1447 -- ripoffline(), in which the Lines argument absolute value is the
1448 -- number of lines to be ripped of. The official ripoffline() only
1449 -- uses the sign of Lines to rip of a single line from bottom or top.
1450 pragma Inline (Rip_Off_Lines);
1452 type Cursor_Visibility is (Invisible, Normal, Very_Visible);
1454 -- ANCHOR(`curs_set()',`Set_Cursor_Visibility')
1455 procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
1457 pragma Inline (Set_Cursor_Visibility);
1459 -- ANCHOR(`napms()',`Nap_Milli_Seconds')
1460 procedure Nap_Milli_Seconds (Ms : in Natural);
1462 pragma Inline (Nap_Milli_Seconds);
1464 -- |=====================================================================
1465 -- | Some useful helpers.
1466 -- |=====================================================================
1467 type Transform_Direction is (From_Screen, To_Screen);
1468 procedure Transform_Coordinates
1469 (W : in Window := Standard_Window;
1470 Line : in out Line_Position;
1471 Column : in out Column_Position;
1472 Dir : in Transform_Direction := From_Screen);
1473 -- This procedure transforms screen coordinates into coordinates relative
1474 -- to the window and vice versa, depending on the Dir parameter.
1475 -- Screen coordinates are the position informations on the physical device.
1476 -- An Curses_Exception will be raised if Line and Column are not in the
1477 -- Window or if you pass the Null_Window as argument.
1478 -- We don't inline this procedure
1480 -- MANPAGE(`dft_fgbg.3x')
1482 -- ANCHOR(`use_default_colors()',`Use_Default_Colors')
1483 procedure Use_Default_Colors;
1485 pragma Inline (Use_Default_Colors);
1487 -- ANCHOR(`assume_default_colors()',`Assume_Default_Colors')
1488 procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
1489 Back : Color_Number := Default_Color);
1491 pragma Inline (Assume_Default_Colors);
1493 -- MANPAGE(`curs_extend.3x')
1495 -- ANCHOR(`curses_version()',`Curses_Version')
1496 function Curses_Version return String;
1499 -- ANCHOR(`use_extended_names()',`Use_Extended_Names')
1500 -- The returnvalue is the previous setting of the flag
1501 function Use_Extended_Names (Enable : Boolean) return Boolean;
1504 -- MANPAGE(`curs_scr_dump.3x')
1506 -- ANCHOR(`scr_dump()',`Screen_Dump_To_File')
1507 procedure Screen_Dump_To_File (Filename : in String);
1510 -- ANCHOR(`scr_restore()',`Screen_Restore_From_File')
1511 procedure Screen_Restore_From_File (Filename : in String);
1514 -- ANCHOR(`scr_init()',`Screen_Init_From_File')
1515 procedure Screen_Init_From_File (Filename : in String);
1518 -- ANCHOR(`scr_set()',`Screen_Set_File')
1519 procedure Screen_Set_File (Filename : in String);
1522 -- MANPAGE(`curs_print.3x')
1523 -- Not implemented: mcprint
1525 -- MANPAGE(`curs_printw.3x')
1526 -- Not implemented: printw, wprintw, mvprintw, mvwprintw, vwprintw,
1528 -- Please use the Ada style Text_IO child packages for formatted
1529 -- printing. It doesn't make a lot of sense to map the printf style
1530 -- C functions to Ada.
1532 -- MANPAGE(`curs_scanw.3x')
1533 -- Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw
1536 -- MANPAGE(`resizeterm.3x')
1537 -- Not Implemented: resizeterm
1539 -- MANPAGE(`wresize.3x')
1541 -- ANCHOR(`wresize()',`Resize')
1542 procedure Resize (Win : Window := Standard_Window;
1543 Number_Of_Lines : Line_Count;
1544 Number_Of_Columns : Column_Count);
1548 type Window is new System.Storage_Elements.Integer_Address;
1549 Null_Window : constant Window := 0;
1551 -- The next constants are generated and may be different on your
1554 include(`Window_Offsets')dnl
1555 Curses_Bool_False : constant Curses_Bool := 0;
1557 end Terminal_Interface.Curses;