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
41 -- Binding Version 01.00
42 ------------------------------------------------------------------------------
44 with System.Storage_Elements;
45 with Interfaces.C; -- We need this for some assertions.
47 package Terminal_Interface.Curses is
48 pragma Preelaborate (Terminal_Interface.Curses);
49 include(`Linker_Options')
50 include(`Version_Info')
51 type Window is private;
52 Null_Window : constant Window;
54 type Line_Position is new Natural; -- line coordinate
55 type Column_Position is new Natural; -- column coordinate
57 subtype Line_Count is Line_Position range 1 .. Line_Position'Last;
58 -- Type to count lines. We do not allow null windows, so must be positive
59 subtype Column_Count is Column_Position range 1 .. Column_Position'Last;
60 -- Type to count columns. We do not allow null windows, so must be positive
62 type Key_Code is new Natural;
63 -- That is anything including real characters, special keys and logical
66 subtype Real_Key_Code is Key_Code range 0 .. M4_KEY_MAX;
67 -- This are the codes that potentially represent a real keystroke.
68 -- Not all codes may be possible on a specific terminal. To check the
69 -- availability of a special key, the Has_Key function is provided.
71 subtype Special_Key_Code is Real_Key_Code
72 range M4_SPECIAL_FIRST .. Real_Key_Code'Last;
73 -- Type for a function- or special key number
75 subtype Normal_Key_Code is Real_Key_Code range
76 Character'Pos (Character'First) .. Character'Pos (Character'Last);
77 -- This are the codes for regular (incl. non-graphical) characters.
79 -- Constants for function- and special keys
81 Key_None : constant Special_Key_Code := M4_SPECIAL_FIRST;
82 include(`Key_Definitions')
83 Key_Max : constant Special_Key_Code
84 := Special_Key_Code'Last;
86 subtype User_Key_Code is Key_Code
87 range (Key_Max + 129) .. Key_Code'Last;
88 -- This is reserved for user defined key codes. The range between Key_Max
89 -- and the first user code is reserved for subsystems like menu and forms.
91 -- For those who like to use the original key names we produce them were
92 -- they differ from the original. Please note that they may differ in
94 include(`Old_Keys')dnl
96 ------------------------------------------------------------------------------
98 type Color_Number is range -1 .. Integer (Interfaces.C.short'Last);
99 for Color_Number'Size use Interfaces.C.short'Size;
100 -- (n)curses uses a short for the color index
101 -- The model is, that a Color_Number is an index into an array of
102 -- (potentially) definable colors. Some of those indices are
103 -- predefined (see below), although they may not really exist.
105 include(`Color_Defs')
106 type RGB_Value is range 0 .. Integer (Interfaces.C.short'Last);
107 for RGB_Value'Size use Interfaces.C.short'Size;
108 -- Some system may allow to redefine a color by setting RGB values.
110 type Color_Pair is range 0 .. 255;
111 for Color_Pair'Size use 8;
112 subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255;
113 -- (n)curses reserves 1 Byte for the color-pair number. Color Pair 0
114 -- is fixed (Black & White). A color pair is simply a combination of
115 -- two colors described by Color_Numbers, one for the foreground and
116 -- the other for the background
118 include(`Character_Attribute_Set_Rep')
119 -- (n)curses uses all but the lowest 16 Bits for Attributes.
121 Normal_Video : constant Character_Attribute_Set := (others => False);
123 type Attributed_Character is
125 Attr : Character_Attribute_Set;
129 pragma Convention (C, Attributed_Character);
130 -- This is the counterpart for the chtype in C.
133 Default_Character : constant Attributed_Character
134 := (Ch => Character'First,
135 Color => Color_Pair'First,
136 Attr => (others => False)); -- preelaboratable Normal_Video
138 type Attributed_String is array (Positive range <>) of Attributed_Character;
139 pragma Pack (Attributed_String);
140 -- In this binding we allow strings of attributed characters.
145 Curses_Exception : exception;
146 Wrong_Curses_Version : exception;
148 -- Those exceptions are raised by the ETI (Extended Terminal Interface)
149 -- subpackets for Menu and Forms handling.
151 Eti_System_Error : exception;
152 Eti_Bad_Argument : exception;
153 Eti_Posted : exception;
154 Eti_Connected : exception;
155 Eti_Bad_State : exception;
156 Eti_No_Room : exception;
157 Eti_Not_Posted : exception;
158 Eti_Unknown_Command : exception;
159 Eti_No_Match : exception;
160 Eti_Not_Selectable : exception;
161 Eti_Not_Connected : exception;
162 Eti_Request_Denied : exception;
163 Eti_Invalid_Field : exception;
164 Eti_Current : exception;
166 --------------------------------------------------------------------------
167 -- External C variables
168 -- Conceptually even in C this are kind of constants, but they are
169 -- initialized and sometimes changed by the library routines at runtime
170 -- depending on the type of terminal. I believe the best way to model
171 -- this is to use functions.
172 --------------------------------------------------------------------------
174 function Lines return Line_Count;
175 pragma Inline (Lines);
177 function Columns return Column_Count;
178 pragma Inline (Columns);
180 function Tab_Size return Natural;
181 pragma Inline (Tab_Size);
183 function Number_Of_Colors return Natural;
184 pragma Inline (Number_Of_Colors);
186 function Number_Of_Color_Pairs return Natural;
187 pragma Inline (Number_Of_Color_Pairs);
189 ACS_Map : array (Character'Val (0) .. Character'Val (127)) of
190 Attributed_Character;
191 pragma Import (C, ACS_Map, "acs_map");
194 -- Constants for several characters from the Alternate Character Set
195 -- You must use this constants as indices into the ACS_Map array
196 -- to get the corresponding attributed character at runtime.
198 include(`ACS_Map')dnl
200 -- MANPAGE(`curs_initscr.3x')
201 -- | Not implemented: newterm, set_term, delscreen, curscr
203 -- ANCHOR(`stdscr',`Standard_Window')
204 function Standard_Window return Window;
206 pragma Inline (Standard_Window);
208 -- ANCHOR(`initscr()',`Init_Screen')
209 procedure Init_Screen;
211 -- ANCHOR(`initscr()',`Init_Windows')
212 procedure Init_Windows renames Init_Screen;
214 pragma Inline (Init_Screen);
215 pragma Inline (Init_Windows);
217 -- ANCHOR(`endwin()',`End_Windows')
218 procedure End_Windows;
220 procedure End_Screen renames End_Windows;
221 pragma Inline (End_Windows);
222 pragma Inline (End_Screen);
224 -- ANCHOR(`isendwin()',`Is_End_Window')
225 function Is_End_Window return Boolean;
227 pragma Inline (Is_End_Window);
229 -- MANPAGE(`curs_move.3x')
231 -- ANCHOR(`wmove()',`Move_Cursor')
232 procedure Move_Cursor (Win : in Window := Standard_Window;
233 Line : in Line_Position;
234 Column : in Column_Position);
237 pragma Inline (Move_Cursor);
239 -- MANPAGE(`curs_addch.3x')
241 -- ANCHOR(`waddch()',`Add')
242 procedure Add (Win : in Window := Standard_Window;
243 Ch : in Attributed_Character);
247 procedure Add (Win : in Window := Standard_Window;
249 -- Add a single character at the current logical cursor position to
250 -- the window. Use the current windows attributes.
252 -- ANCHOR(`mvwaddch()',`Add')
254 (Win : in Window := Standard_Window;
255 Line : in Line_Position;
256 Column : in Column_Position;
257 Ch : in Attributed_Character);
259 -- ALIAS(`mvaddch()')
262 (Win : in Window := Standard_Window;
263 Line : in Line_Position;
264 Column : in Column_Position;
266 -- Move to the position and add a single character into the window
267 -- There are more Add routines, so the Inline pragma follows later
269 -- ANCHOR(`wechochar()',`Add_With_Immediate_Echo')
270 procedure Add_With_Immediate_Echo
271 (Win : in Window := Standard_Window;
272 Ch : in Attributed_Character);
274 -- ALIAS(`echochar()')
276 procedure Add_With_Immediate_Echo
277 (Win : in Window := Standard_Window;
279 -- Add a character and do an immediate refresh of the screen.
280 pragma Inline (Add_With_Immediate_Echo);
282 -- MANPAGE(`curs_window.3x')
283 -- Not Implemented: wcursyncup
285 -- ANCHOR(`newwin()',`Create')
287 (Number_Of_Lines : Line_Count;
288 Number_Of_Columns : Column_Count;
289 First_Line_Position : Line_Position;
290 First_Column_Position : Column_Position) return Window;
291 -- Not Implemented: Default Number_Of_Lines, Number_Of_Columns
292 -- the C version lets them be 0, see the man page.
294 pragma Inline (Create);
297 (Number_Of_Lines : Line_Count;
298 Number_Of_Columns : Column_Count;
299 First_Line_Position : Line_Position;
300 First_Column_Position : Column_Position) return Window
302 pragma Inline (New_Window);
304 -- ANCHOR(`delwin()',`Delete')
305 procedure Delete (Win : in out Window);
307 -- Reset Win to Null_Window
308 pragma Inline (Delete);
310 -- ANCHOR(`subwin()',`Sub_Window')
312 (Win : Window := Standard_Window;
313 Number_Of_Lines : Line_Count;
314 Number_Of_Columns : Column_Count;
315 First_Line_Position : Line_Position;
316 First_Column_Position : Column_Position) return Window;
318 pragma Inline (Sub_Window);
320 -- ANCHOR(`derwin()',`Derived_Window')
321 function Derived_Window
322 (Win : Window := Standard_Window;
323 Number_Of_Lines : Line_Count;
324 Number_Of_Columns : Column_Count;
325 First_Line_Position : Line_Position;
326 First_Column_Position : Column_Position) return Window;
328 pragma Inline (Derived_Window);
330 -- ANCHOR(`dupwin()',`Duplicate')
331 function Duplicate (Win : Window) return Window;
333 pragma Inline (Duplicate);
335 -- ANCHOR(`mvwin()',`Move_Window')
336 procedure Move_Window (Win : in Window;
337 Line : in Line_Position;
338 Column : in Column_Position);
340 pragma Inline (Move_Window);
342 -- ANCHOR(`mvderwin()',`Move_Derived_Window')
343 procedure Move_Derived_Window (Win : in Window;
344 Line : in Line_Position;
345 Column : in Column_Position);
347 pragma Inline (Move_Derived_Window);
349 -- ANCHOR(`wsyncup()',`Synchronize_Upwards')
350 procedure Synchronize_Upwards (Win : in Window);
352 pragma Import (C, Synchronize_Upwards, "wsyncup");
354 -- ANCHOR(`wsyncdown()',`Synchronize_Downwards')
355 procedure Synchronize_Downwards (Win : in Window);
357 pragma Import (C, Synchronize_Downwards, "wsyncdown");
359 -- ANCHOR(`syncok()',`Set_Synch_Mode')
360 procedure Set_Synch_Mode (Win : in Window := Standard_Window;
361 Mode : in Boolean := False);
363 pragma Inline (Set_Synch_Mode);
365 -- MANPAGE(`curs_addstr.3x')
367 -- ANCHOR(`waddnstr()',`Add')
368 procedure Add (Win : in Window := Standard_Window;
370 Len : in Integer := -1);
372 -- ALIAS(`waddstr()')
373 -- ALIAS(`addnstr()')
376 -- ANCHOR(`mvwaddnstr()',`Add')
377 procedure Add (Win : in Window := Standard_Window;
378 Line : in Line_Position;
379 Column : in Column_Position;
381 Len : in Integer := -1);
383 -- ALIAS(`mvwaddstr()')
384 -- ALIAS(`mvaddnstr()')
385 -- ALIAS(`mvaddstr()')
387 -- MANPAGE(`curs_addchstr.3x')
389 -- ANCHOR(`waddchnstr()',`Add')
390 procedure Add (Win : in Window := Standard_Window;
391 Str : in Attributed_String;
392 Len : in Integer := -1);
394 -- ALIAS(`waddchstr()')
395 -- ALIAS(`addchnstr()')
396 -- ALIAS(`addchstr()')
398 -- ANCHOR(`mvwaddchnstr()',`Add')
399 procedure Add (Win : in Window := Standard_Window;
400 Line : in Line_Position;
401 Column : in Column_Position;
402 Str : in Attributed_String;
403 Len : in Integer := -1);
405 -- ALIAS(`mvwaddchstr()')
406 -- ALIAS(`mvaddchnstr()')
407 -- ALIAS(`mvaddchstr()')
410 -- MANPAGE(`curs_border.3x')
411 -- | Not implemented: mvhline, mvwhline, mvvline, mvwvline
412 -- | use Move_Cursor then Horizontal_Line or Vertical_Line
414 -- ANCHOR(`wborder()',`Border')
416 (Win : in Window := Standard_Window;
417 Left_Side_Symbol : in Attributed_Character := Default_Character;
418 Right_Side_Symbol : in Attributed_Character := Default_Character;
419 Top_Side_Symbol : in Attributed_Character := Default_Character;
420 Bottom_Side_Symbol : in Attributed_Character := Default_Character;
421 Upper_Left_Corner_Symbol : in Attributed_Character := Default_Character;
422 Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character;
423 Lower_Left_Corner_Symbol : in Attributed_Character := Default_Character;
424 Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character
428 pragma Inline (Border);
430 -- ANCHOR(`box()',`Box')
432 (Win : in Window := Standard_Window;
433 Vertical_Symbol : in Attributed_Character := Default_Character;
434 Horizontal_Symbol : in Attributed_Character := Default_Character);
438 -- ANCHOR(`whline()',`Horizontal_Line')
439 procedure Horizontal_Line
440 (Win : in Window := Standard_Window;
441 Line_Size : in Natural;
442 Line_Symbol : in Attributed_Character := Default_Character);
445 pragma Inline (Horizontal_Line);
447 -- ANCHOR(`wvline()',`Vertical_Line')
448 procedure Vertical_Line
449 (Win : in Window := Standard_Window;
450 Line_Size : in Natural;
451 Line_Symbol : in Attributed_Character := Default_Character);
454 pragma Inline (Vertical_Line);
456 -- MANPAGE(`curs_getch.3x')
457 -- Not implemented: mvgetch, mvwgetch
459 -- ANCHOR(`wgetch()',`Get_Keystroke')
460 function Get_Keystroke (Win : Window := Standard_Window)
461 return Real_Key_Code;
464 -- Get a character from the keyboard and echo it - if enabled - to the
466 -- If for any reason (i.e. a timeout) we couldn't get a character the
467 -- returned keycode is Key_None.
468 pragma Inline (Get_Keystroke);
470 -- ANCHOR(`ungetch()',`Undo_Keystroke')
471 procedure Undo_Keystroke (Key : in Real_Key_Code);
473 pragma Inline (Undo_Keystroke);
475 -- ANCHOR(`has_key()',`Has_Key')
476 function Has_Key (Key : Special_Key_Code) return Boolean;
478 pragma Inline (Has_Key);
481 -- | Some helper functions
483 function Is_Function_Key (Key : Special_Key_Code) return Boolean;
484 -- Return True if the Key is a function key (i.e. one of F0 .. F63)
485 pragma Inline (Is_Function_Key);
487 subtype Function_Key_Number is Integer range 0 .. 63;
488 -- (n)curses allows for 64 function keys.
490 function Function_Key (Key : Real_Key_Code) return Function_Key_Number;
491 -- Return the number of the function key. If the code is not a
492 -- function key, a CONSTRAINT_ERROR will be raised.
493 pragma Inline (Function_Key);
495 function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
496 -- Return the key code for a given function-key number.
497 pragma Inline (Function_Key_Code);
499 -- MANPAGE(`curs_attr.3x')
500 -- | Not implemented attr_off, wattr_off,
501 -- | attr_on, wattr_on, attr_set, wattr_set
504 -- PAIR_NUMBER(c) is the same as c.Color
506 -- ANCHOR(`standout()',`Standout')
507 procedure Standout (Win : Window := Standard_Window;
508 On : Boolean := True);
509 -- ALIAS(`wstandout()')
510 -- ALIAS(`wstandend()')
512 -- ANCHOR(`wattron()',`Switch_Character_Attribute')
513 procedure Switch_Character_Attribute
514 (Win : in Window := Standard_Window;
515 Attr : in Character_Attribute_Set := Normal_Video;
516 On : in Boolean := True); -- if False we switch Off.
517 -- Switches those Attributes set to true in the list.
519 -- ALIAS(`wattroff()')
521 -- ALIAS(`attroff()')
523 -- ANCHOR(`wattrset()',`Set_Character_Attributes')
524 procedure Set_Character_Attributes
525 (Win : in Window := Standard_Window;
526 Attr : in Character_Attribute_Set := Normal_Video;
527 Color : in Color_Pair := Color_Pair'First);
529 -- ALIAS(`attrset()')
530 pragma Inline (Set_Character_Attributes);
532 -- ANCHOR(`wattr_get()',`Get_Character_Attributes')
533 function Get_Character_Attribute
534 (Win : in Window := Standard_Window) return Character_Attribute_Set;
536 -- ALIAS(`attr_get()')
538 -- ANCHOR(`wattr_get()',`Get_Character_Attribute')
539 function Get_Character_Attribute
540 (Win : in Window := Standard_Window) return Color_Pair;
542 pragma Inline (Get_Character_Attribute);
544 -- ANCHOR(`wcolor_set()',`Set_Color')
545 procedure Set_Color (Win : in Window := Standard_Window;
546 Pair : in Color_Pair);
548 -- ALIAS(`color_set()')
549 pragma Inline (Set_Color);
551 -- ANCHOR(`wchgat()',`Change_Attributes')
552 procedure Change_Attributes
553 (Win : in Window := Standard_Window;
554 Count : in Integer := -1;
555 Attr : in Character_Attribute_Set := Normal_Video;
556 Color : in Color_Pair := Color_Pair'First);
560 -- ANCHOR(`mvwchgat()',`Change_Attributes')
561 procedure Change_Attributes
562 (Win : in Window := Standard_Window;
563 Line : in Line_Position := Line_Position'First;
564 Column : in Column_Position := Column_Position'First;
565 Count : in Integer := -1;
566 Attr : in Character_Attribute_Set := Normal_Video;
567 Color : in Color_Pair := Color_Pair'First);
569 -- ALIAS(`mvchgat()')
570 pragma Inline (Change_Attributes);
572 -- MANPAGE(`curs_beep.3x')
574 -- ANCHOR(`beep()',`Beep')
577 pragma Inline (Beep);
579 -- ANCHOR(`flash()',`Flash_Screen')
580 procedure Flash_Screen;
582 pragma Inline (Flash_Screen);
584 -- MANPAGE(`curs_inopts.3x')
586 -- | Not implemented : typeahead
588 -- ANCHOR(`cbreak()',`Set_Cbreak_Mode')
589 procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True);
591 -- ALIAS(`nocbreak()')
592 pragma Inline (Set_Cbreak_Mode);
594 -- ANCHOR(`raw()',`Set_Raw_Mode')
595 procedure Set_Raw_Mode (SwitchOn : in Boolean := True);
598 pragma Inline (Set_Raw_Mode);
600 -- ANCHOR(`echo()',`Set_Echo_Mode')
601 procedure Set_Echo_Mode (SwitchOn : in Boolean := True);
604 pragma Inline (Set_Echo_Mode);
606 -- ANCHOR(`meta()',`Set_Meta_Mode')
607 procedure Set_Meta_Mode (Win : in Window := Standard_Window;
608 SwitchOn : in Boolean := True);
610 pragma Inline (Set_Meta_Mode);
612 -- ANCHOR(`keypad()',`Set_KeyPad_Mode')
613 procedure Set_KeyPad_Mode (Win : in Window := Standard_Window;
614 SwitchOn : in Boolean := True);
616 pragma Inline (Set_KeyPad_Mode);
618 function Get_KeyPad_Mode (Win : in Window := Standard_Window)
620 -- This has no pendant in C. There you've to look into the WINDOWS
621 -- structure to get the value. Bad practice, not repeated in Ada.
623 type Half_Delay_Amount is range 1 .. 255;
625 -- ANCHOR(`halfdelay()',`Half_Delay')
626 procedure Half_Delay (Amount : in Half_Delay_Amount);
628 pragma Inline (Half_Delay);
630 -- ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode')
631 procedure Set_Flush_On_Interrupt_Mode
632 (Win : in Window := Standard_Window;
633 Mode : in Boolean := True);
635 pragma Inline (Set_Flush_On_Interrupt_Mode);
637 -- ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode')
638 procedure Set_Queue_Interrupt_Mode
639 (Win : in Window := Standard_Window;
640 Flush : in Boolean := True);
642 -- ALIAS(`noqiflush()')
643 pragma Inline (Set_Queue_Interrupt_Mode);
645 -- ANCHOR(`nodelay()',`Set_NoDelay_Mode')
646 procedure Set_NoDelay_Mode
647 (Win : in Window := Standard_Window;
648 Mode : in Boolean := False);
650 pragma Inline (Set_NoDelay_Mode);
652 type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
654 -- ANCHOR(`wtimeout()',`Set_Timeout_Mode')
655 procedure Set_Timeout_Mode (Win : in Window := Standard_Window;
656 Mode : in Timeout_Mode;
657 Amount : in Natural); -- in Milliseconds
659 -- ALIAS(`timeout()')
660 -- Instead of overloading the semantic of the sign of amount, we
661 -- introduce the Timeout_Mode parameter. This should improve
662 -- readability. For Blocking and Non_Blocking, the Amount is not
664 -- We don't inline this procedure.
666 -- ANCHOR(`notimeout()',`Set_Escape_Time_Mode')
667 procedure Set_Escape_Timer_Mode
668 (Win : in Window := Standard_Window;
669 Timer_Off : in Boolean := False);
671 pragma Inline (Set_Escape_Timer_Mode);
673 -- MANPAGE(`curs_outopts.3x')
675 -- ANCHOR(`nl()',`Set_NL_Mode')
676 procedure Set_NL_Mode (SwitchOn : in Boolean := True);
679 pragma Inline (Set_NL_Mode);
681 -- ANCHOR(`clearok()',`Clear_On_Next_Update')
682 procedure Clear_On_Next_Update
683 (Win : in Window := Standard_Window;
684 Do_Clear : in Boolean := True);
686 pragma Inline (Clear_On_Next_Update);
688 -- ANCHOR(`idlok()',`Use_Insert_Delete_Line')
689 procedure Use_Insert_Delete_Line
690 (Win : in Window := Standard_Window;
691 Do_Idl : in Boolean := True);
693 pragma Inline (Use_Insert_Delete_Line);
695 -- ANCHOR(`idcok()',`Use_Insert_Delete_Character')
696 procedure Use_Insert_Delete_Character
697 (Win : in Window := Standard_Window;
698 Do_Idc : in Boolean := True);
700 pragma Inline (Use_Insert_Delete_Character);
702 -- ANCHOR(`leaveok()',`Leave_Cursor_After_Update')
703 procedure Leave_Cursor_After_Update
704 (Win : in Window := Standard_Window;
705 Do_Leave : in Boolean := True);
707 pragma Inline (Leave_Cursor_After_Update);
709 -- ANCHOR(`immedok()',`Immediate_Update_Mode')
710 procedure Immediate_Update_Mode
711 (Win : in Window := Standard_Window;
712 Mode : in Boolean := False);
714 pragma Inline (Immediate_Update_Mode);
716 -- ANCHOR(`scrollok()',`Allow_Scrolling')
717 procedure Allow_Scrolling
718 (Win : in Window := Standard_Window;
719 Mode : in Boolean := False);
721 pragma Inline (Allow_Scrolling);
723 function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
724 -- There is no such function in the C interface.
725 pragma Inline (Scrolling_Allowed);
727 -- ANCHOR(`wsetscrreg()',`Set_Scroll_Region')
728 procedure Set_Scroll_Region
729 (Win : in Window := Standard_Window;
730 Top_Line : in Line_Position;
731 Bottom_Line : in Line_Position);
733 -- ALIAS(`setscrreg()')
734 pragma Inline (Set_Scroll_Region);
736 -- MANPAGE(`curs_refresh.3x')
738 -- ANCHOR(`doupdate()',`Update_Screen')
739 procedure Update_Screen;
741 pragma Inline (Update_Screen);
743 -- ANCHOR(`wrefresh()',`Refresh')
744 procedure Refresh (Win : in Window := Standard_Window);
746 -- There is an overloaded Refresh for Pads.
747 -- The Inline pragma appears there
748 -- ALIAS(`refresh()')
750 -- ANCHOR(`wnoutrefresh()',`Refresh_Without_Update')
751 procedure Refresh_Without_Update
752 (Win : in Window := Standard_Window);
754 -- There is an overloaded Refresh_Without_Update for Pads.
755 -- The Inline pragma appears there
757 -- ANCHOR(`redrawwin()',`Redraw')
758 procedure Redraw (Win : in Window := Standard_Window);
761 -- ANCHOR(`wredrawln()',`Redraw')
762 procedure Redraw (Win : in Window := Standard_Window;
763 Begin_Line : in Line_Position;
764 Line_Count : in Positive);
766 pragma Inline (Redraw);
768 -- MANPAGE(`curs_clear.3x')
770 -- ANCHOR(`werase()',`Erase')
771 procedure Erase (Win : in Window := Standard_Window);
774 pragma Inline (Erase);
776 -- ANCHOR(`wclear()',`Clear')
778 (Win : in Window := Standard_Window);
781 pragma Inline (Clear);
783 -- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen')
784 procedure Clear_To_End_Of_Screen
785 (Win : in Window := Standard_Window);
787 -- ALIAS(`clrtobot()')
788 pragma Inline (Clear_To_End_Of_Screen);
790 -- ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line')
791 procedure Clear_To_End_Of_Line
792 (Win : in Window := Standard_Window);
794 -- ALIAS(`clrtoeol()')
795 pragma Inline (Clear_To_End_Of_Line);
797 -- MANPAGE(`curs_bkgd.3x')
799 -- ANCHOR(`wbkgdset()',`Set_Background')
800 -- TODO: we could have Set_Background(Window; Character_Attribute_Set)
801 -- because in C it is common to see bkgdset(A_BOLD) or
802 -- bkgdset(COLOR_PAIR(n))
803 procedure Set_Background
804 (Win : in Window := Standard_Window;
805 Ch : in Attributed_Character);
807 -- ALIAS(`bkgdset()')
808 pragma Inline (Set_Background);
810 -- ANCHOR(`wbkgd()',`Change_Background')
811 procedure Change_Background
812 (Win : in Window := Standard_Window;
813 Ch : in Attributed_Character);
816 pragma Inline (Change_Background);
818 -- ANCHOR(`wbkgdget()',`Get_Background')
819 -- ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough.
820 function Get_Background (Win : Window := Standard_Window)
821 return Attributed_Character;
823 -- ALIAS(`bkgdget()')
824 pragma Inline (Get_Background);
826 -- MANPAGE(`curs_touch.3x')
828 -- ANCHOR(`untouchwin()',`Untouch')
829 procedure Untouch (Win : in Window := Standard_Window);
831 pragma Inline (Untouch);
833 -- ANCHOR(`touchwin()',`Touch')
834 procedure Touch (Win : in Window := Standard_Window);
837 -- ANCHOR(`touchline()',`Touch')
838 procedure Touch (Win : in Window := Standard_Window;
839 Start : in Line_Position;
840 Count : in Positive);
842 pragma Inline (Touch);
844 -- ANCHOR(`wtouchln()',`Change_Line_Status')
845 procedure Change_Lines_Status (Win : in Window := Standard_Window;
846 Start : in Line_Position;
850 pragma Inline (Change_Lines_Status);
852 -- ANCHOR(`is_linetouched()',`Is_Touched')
853 function Is_Touched (Win : Window := Standard_Window;
854 Line : Line_Position) return Boolean;
857 -- ANCHOR(`is_wintouched()',`Is_Touched')
858 function Is_Touched (Win : Window := Standard_Window) return Boolean;
860 pragma Inline (Is_Touched);
862 -- MANPAGE(`curs_overlay.3x')
864 -- ANCHOR(`copywin()',`Copy')
866 (Source_Window : in Window;
867 Destination_Window : in Window;
868 Source_Top_Row : in Line_Position;
869 Source_Left_Column : in Column_Position;
870 Destination_Top_Row : in Line_Position;
871 Destination_Left_Column : in Column_Position;
872 Destination_Bottom_Row : in Line_Position;
873 Destination_Right_Column : in Column_Position;
874 Non_Destructive_Mode : in Boolean := True);
876 pragma Inline (Copy);
878 -- ANCHOR(`overwrite()',`Overwrite')
879 procedure Overwrite (Source_Window : in Window;
880 Destination_Window : in Window);
882 pragma Inline (Overwrite);
884 -- ANCHOR(`overlay()',`Overlay')
885 procedure Overlay (Source_Window : in Window;
886 Destination_Window : in Window);
888 pragma Inline (Overlay);
890 -- MANPAGE(`curs_deleteln.3x')
892 -- ANCHOR(`winsdelln()',`Insert_Delete_Lines')
893 procedure Insert_Delete_Lines
894 (Win : in Window := Standard_Window;
895 Lines : in Integer := 1); -- default is to insert one line above
897 -- ALIAS(`insdelln()')
898 pragma Inline (Insert_Delete_Lines);
900 -- ANCHOR(`wdeleteln()',`Delete_Line')
901 procedure Delete_Line (Win : in Window := Standard_Window);
903 -- ALIAS(`deleteln()')
904 pragma Inline (Delete_Line);
906 -- ANCHOR(`winsertln()',`Insert_Line')
907 procedure Insert_Line (Win : in Window := Standard_Window);
909 -- ALIAS(`insertln()')
910 pragma Inline (Insert_Line);
912 -- MANPAGE(`curs_getyx.3x')
914 -- ANCHOR(`getmaxyx()',`Get_Size')
916 (Win : in Window := Standard_Window;
917 Number_Of_Lines : out Line_Count;
918 Number_Of_Columns : out Column_Count);
920 pragma Inline (Get_Size);
922 -- ANCHOR(`getbegyx()',`Get_Window_Position')
923 procedure Get_Window_Position
924 (Win : in Window := Standard_Window;
925 Top_Left_Line : out Line_Position;
926 Top_Left_Column : out Column_Position);
928 pragma Inline (Get_Window_Position);
930 -- ANCHOR(`getyx()',`Get_Cursor_Position')
931 procedure Get_Cursor_Position
932 (Win : in Window := Standard_Window;
933 Line : out Line_Position;
934 Column : out Column_Position);
936 pragma Inline (Get_Cursor_Position);
938 -- ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent')
939 procedure Get_Origin_Relative_To_Parent
941 Top_Left_Line : out Line_Position;
942 Top_Left_Column : out Column_Position;
943 Is_Not_A_Subwindow : out Boolean);
945 -- Instead of placing -1 in the coordinates as return, we use a boolean
946 -- to return the info that the window has no parent.
947 pragma Inline (Get_Origin_Relative_To_Parent);
949 -- MANPAGE(`curs_pad.3x')
951 -- ANCHOR(`newpad()',`New_Pad')
952 function New_Pad (Lines : Line_Count;
953 Columns : Column_Count) return Window;
955 pragma Inline (New_Pad);
957 -- ANCHOR(`subpad()',`Sub_Pad')
960 Number_Of_Lines : Line_Count;
961 Number_Of_Columns : Column_Count;
962 First_Line_Position : Line_Position;
963 First_Column_Position : Column_Position) return Window;
965 pragma Inline (Sub_Pad);
967 -- ANCHOR(`prefresh()',`Refresh')
970 Source_Top_Row : in Line_Position;
971 Source_Left_Column : in Column_Position;
972 Destination_Top_Row : in Line_Position;
973 Destination_Left_Column : in Column_Position;
974 Destination_Bottom_Row : in Line_Position;
975 Destination_Right_Column : in Column_Position);
977 pragma Inline (Refresh);
979 -- ANCHOR(`pnoutrefresh()',`Refresh_Without_Update')
980 procedure Refresh_Without_Update
982 Source_Top_Row : in Line_Position;
983 Source_Left_Column : in Column_Position;
984 Destination_Top_Row : in Line_Position;
985 Destination_Left_Column : in Column_Position;
986 Destination_Bottom_Row : in Line_Position;
987 Destination_Right_Column : in Column_Position);
989 pragma Inline (Refresh_Without_Update);
991 -- ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It')
992 procedure Add_Character_To_Pad_And_Echo_It
994 Ch : in Attributed_Character);
997 procedure Add_Character_To_Pad_And_Echo_It
1000 pragma Inline (Add_Character_To_Pad_And_Echo_It);
1002 -- MANPAGE(`curs_scroll.3x')
1004 -- ANCHOR(`wscrl()',`Scroll')
1005 procedure Scroll (Win : in Window := Standard_Window;
1006 Amount : in Integer := 1);
1008 -- ALIAS(`scroll()')
1010 pragma Inline (Scroll);
1012 -- MANPAGE(`curs_delch.3x')
1014 -- ANCHOR(`wdelch()',`Delete_Character')
1015 procedure Delete_Character (Win : in Window := Standard_Window);
1019 -- ANCHOR(`mvwdelch()',`Delete_Character')
1020 procedure Delete_Character
1021 (Win : in Window := Standard_Window;
1022 Line : in Line_Position;
1023 Column : in Column_Position);
1025 -- ALIAS(`mvdelch()')
1026 pragma Inline (Delete_Character);
1028 -- MANPAGE(`curs_inch.3x')
1030 -- ANCHOR(`winch()',`Peek')
1031 function Peek (Win : Window := Standard_Window)
1032 return Attributed_Character;
1036 -- ANCHOR(`mvwinch()',`Peek')
1038 (Win : Window := Standard_Window;
1039 Line : Line_Position;
1040 Column : Column_Position) return Attributed_Character;
1042 -- ALIAS(`mvinch()')
1043 -- More Peek's follow, pragma Inline appears later.
1045 -- MANPAGE(`curs_insch.3x')
1047 -- ANCHOR(`winsch()',`Insert')
1048 procedure Insert (Win : in Window := Standard_Window;
1049 Ch : in Attributed_Character);
1053 -- ANCHOR(`mvwinsch()',`Insert')
1054 procedure Insert (Win : in Window := Standard_Window;
1055 Line : in Line_Position;
1056 Column : in Column_Position;
1057 Ch : in Attributed_Character);
1059 -- ALIAS(`mvinsch()')
1061 -- MANPAGE(`curs_insstr.3x')
1063 -- ANCHOR(`winsnstr()',`Insert')
1064 procedure Insert (Win : in Window := Standard_Window;
1066 Len : in Integer := -1);
1068 -- ALIAS(`winsstr()')
1069 -- ALIAS(`insnstr()')
1070 -- ALIAS(`insstr()')
1072 -- ANCHOR(`mvwinsnstr()',`Insert')
1073 procedure Insert (Win : in Window := Standard_Window;
1074 Line : in Line_Position;
1075 Column : in Column_Position;
1077 Len : in Integer := -1);
1079 -- ALIAS(`mvwinsstr()')
1080 -- ALIAS(`mvinsnstr()')
1081 -- ALIAS(`mvinsstr()')
1082 pragma Inline (Insert);
1084 -- MANPAGE(`curs_instr.3x')
1086 -- ANCHOR(`winnstr()',`Peek')
1087 procedure Peek (Win : in Window := Standard_Window;
1089 Len : in Integer := -1);
1091 -- ALIAS(`winstr()')
1092 -- ALIAS(`innstr()')
1095 -- ANCHOR(`mvwinnstr()',`Peek')
1096 procedure Peek (Win : in Window := Standard_Window;
1097 Line : in Line_Position;
1098 Column : in Column_Position;
1100 Len : in Integer := -1);
1102 -- ALIAS(`mvwinstr()')
1103 -- ALIAS(`mvinnstr()')
1104 -- ALIAS(`mvinstr()')
1106 -- MANPAGE(`curs_inchstr.3x')
1108 -- ANCHOR(`winchnstr()',`Peek')
1109 procedure Peek (Win : in Window := Standard_Window;
1110 Str : out Attributed_String;
1111 Len : in Integer := -1);
1113 -- ALIAS(`winchstr()')
1114 -- ALIAS(`inchnstr()')
1115 -- ALIAS(`inchstr()')
1117 -- ANCHOR(`mvwinchnstr()',`Peek')
1118 procedure Peek (Win : in Window := Standard_Window;
1119 Line : in Line_Position;
1120 Column : in Column_Position;
1121 Str : out Attributed_String;
1122 Len : in Integer := -1);
1124 -- ALIAS(`mvwinchstr()')
1125 -- ALIAS(`mvinchnstr()')
1126 -- ALIAS(`mvinchstr()')
1127 -- We don't inline the Peek procedures
1129 -- MANPAGE(`curs_getstr.3x')
1131 -- ANCHOR(`wgetnstr()',`Get')
1132 procedure Get (Win : in Window := Standard_Window;
1134 Len : in Integer := -1);
1136 -- ALIAS(`wgetstr()')
1137 -- ALIAS(`getnstr()')
1138 -- ALIAS(`getstr()')
1139 -- actually getstr is not supported because that results in buffer
1142 -- ANCHOR(`mvwgetnstr()',`Get')
1143 procedure Get (Win : in Window := Standard_Window;
1144 Line : in Line_Position;
1145 Column : in Column_Position;
1147 Len : in Integer := -1);
1149 -- ALIAS(`mvwgetstr()')
1150 -- ALIAS(`mvgetnstr()')
1151 -- ALIAS(`mvgetstr()')
1152 -- Get is not inlined
1154 -- MANPAGE(`curs_slk.3x')
1156 -- Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set
1158 type Soft_Label_Key_Format is (Three_Two_Three,
1160 PC_Style, -- ncurses specific
1161 PC_Style_With_Index); -- "
1162 type Label_Number is new Positive range 1 .. 12;
1163 type Label_Justification is (Left, Centered, Right);
1165 -- ANCHOR(`slk_init()',`Init_Soft_Label_Keys')
1166 procedure Init_Soft_Label_Keys
1167 (Format : in Soft_Label_Key_Format := Three_Two_Three);
1169 pragma Inline (Init_Soft_Label_Keys);
1171 -- ANCHOR(`slk_set()',`Set_Soft_Label_Key')
1172 procedure Set_Soft_Label_Key (Label : in Label_Number;
1174 Fmt : in Label_Justification := Left);
1176 -- We don't inline this procedure
1178 -- ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key')
1179 procedure Refresh_Soft_Label_Keys;
1181 pragma Inline (Refresh_Soft_Label_Keys);
1183 -- ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update')
1184 procedure Refresh_Soft_Label_Keys_Without_Update;
1186 pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
1188 -- ANCHOR(`slk_label()',`Get_Soft_Label_Key')
1189 procedure Get_Soft_Label_Key (Label : in Label_Number;
1193 -- ANCHOR(`slk_label()',`Get_Soft_Label_Key')
1194 function Get_Soft_Label_Key (Label : in Label_Number) return String;
1197 pragma Inline (Get_Soft_Label_Key);
1199 -- ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys')
1200 procedure Clear_Soft_Label_Keys;
1202 pragma Inline (Clear_Soft_Label_Keys);
1204 -- ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys')
1205 procedure Restore_Soft_Label_Keys;
1207 pragma Inline (Restore_Soft_Label_Keys);
1209 -- ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys')
1210 procedure Touch_Soft_Label_Keys;
1212 pragma Inline (Touch_Soft_Label_Keys);
1214 -- ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes')
1215 procedure Switch_Soft_Label_Key_Attributes
1216 (Attr : in Character_Attribute_Set;
1217 On : in Boolean := True);
1219 -- ALIAS(`slk_attroff()')
1220 pragma Inline (Switch_Soft_Label_Key_Attributes);
1222 -- ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes')
1223 procedure Set_Soft_Label_Key_Attributes
1224 (Attr : in Character_Attribute_Set := Normal_Video;
1225 Color : in Color_Pair := Color_Pair'First);
1227 pragma Inline (Set_Soft_Label_Key_Attributes);
1229 -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1230 function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
1233 -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1234 function Get_Soft_Label_Key_Attributes return Color_Pair;
1236 pragma Inline (Get_Soft_Label_Key_Attributes);
1238 -- ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color')
1239 procedure Set_Soft_Label_Key_Color (Pair : in Color_Pair);
1241 pragma Inline (Set_Soft_Label_Key_Color);
1243 -- MANPAGE(`keybound.3x')
1244 -- Not Implemented: keybound
1246 -- MANPAGE(`keyok.3x')
1248 -- ANCHOR(`keyok()',`Enable_Key')
1249 procedure Enable_Key (Key : in Special_Key_Code;
1250 Enable : in Boolean := True);
1252 pragma Inline (Enable_Key);
1254 -- MANPAGE(`define_key.3x')
1256 -- ANCHOR(`define_key()',`Define_Key')
1257 procedure Define_Key (Definition : in String;
1258 Key : in Special_Key_Code);
1260 pragma Inline (Define_Key);
1262 -- MANPAGE(`curs_util.3x')
1264 -- | Not implemented : filter, use_env
1265 -- | putwin, getwin are in the child package PutWin
1268 -- ANCHOR(`keyname()',`Key_Name')
1269 procedure Key_Name (Key : in Real_Key_Code;
1272 -- The external name for a real keystroke.
1274 -- ANCHOR(`keyname()',`Key_Name')
1275 function Key_Name (Key : in Real_Key_Code) return String;
1278 -- We don't inline this routine
1280 -- ANCHOR(`unctrl()',`Un_Control')
1281 procedure Un_Control (Ch : in Attributed_Character;
1285 -- ANCHOR(`unctrl()',`Un_Control')
1286 function Un_Control (Ch : in Attributed_Character) return String;
1289 pragma Inline (Un_Control);
1291 -- ANCHOR(`delay_output()',`Delay_Output')
1292 procedure Delay_Output (Msecs : in Natural);
1294 pragma Inline (Delay_Output);
1296 -- ANCHOR(`flushinp()',`Flush_Input')
1297 procedure Flush_Input;
1299 pragma Inline (Flush_Input);
1301 -- MANPAGE(`curs_termattrs.3x')
1303 -- ANCHOR(`baudrate()',`Baudrate')
1304 function Baudrate return Natural;
1306 pragma Inline (Baudrate);
1308 -- ANCHOR(`erasechar()',`Erase_Character')
1309 function Erase_Character return Character;
1311 pragma Inline (Erase_Character);
1313 -- ANCHOR(`killchar()',`Kill_Character')
1314 function Kill_Character return Character;
1316 pragma Inline (Kill_Character);
1318 -- ANCHOR(`has_ic()',`Has_Insert_Character')
1319 function Has_Insert_Character return Boolean;
1321 pragma Inline (Has_Insert_Character);
1323 -- ANCHOR(`has_il()',`Has_Insert_Line')
1324 function Has_Insert_Line return Boolean;
1326 pragma Inline (Has_Insert_Line);
1328 -- ANCHOR(`termattrs()',`Supported_Attributes')
1329 function Supported_Attributes return Character_Attribute_Set;
1331 pragma Inline (Supported_Attributes);
1333 -- ANCHOR(`longname()',`Long_Name')
1334 procedure Long_Name (Name : out String);
1337 -- ANCHOR(`longname()',`Long_Name')
1338 function Long_Name return String;
1341 pragma Inline (Long_Name);
1343 -- ANCHOR(`termname()',`Terminal_Name')
1344 procedure Terminal_Name (Name : out String);
1347 -- ANCHOR(`termname()',`Terminal_Name')
1348 function Terminal_Name return String;
1351 pragma Inline (Terminal_Name);
1353 -- MANPAGE(`curs_color.3x')
1356 -- COLOR_PAIR(n) in C is the same as
1357 -- Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video)
1358 -- In C you often see something like c = c | COLOR_PAIR(n);
1359 -- This is equivalent to c.Color := n;
1361 -- ANCHOR(`start_color()',`Start_Color')
1362 procedure Start_Color;
1364 pragma Import (C, Start_Color, "start_color");
1366 -- ANCHOR(`init_pair()',`Init_Pair')
1367 procedure Init_Pair (Pair : in Redefinable_Color_Pair;
1368 Fore : in Color_Number;
1369 Back : in Color_Number);
1371 pragma Inline (Init_Pair);
1373 -- ANCHOR(`pair_content()',`Pair_Content')
1374 procedure Pair_Content (Pair : in Color_Pair;
1375 Fore : out Color_Number;
1376 Back : out Color_Number);
1378 pragma Inline (Pair_Content);
1380 -- ANCHOR(`has_colors()',`Has_Colors')
1381 function Has_Colors return Boolean;
1383 pragma Inline (Has_Colors);
1385 -- ANCHOR(`init_color()',`Init_Color')
1386 procedure Init_Color (Color : in Color_Number;
1388 Green : in RGB_Value;
1389 Blue : in RGB_Value);
1391 pragma Inline (Init_Color);
1393 -- ANCHOR(`can_change_color()',`Can_Change_Color')
1394 function Can_Change_Color return Boolean;
1396 pragma Inline (Can_Change_Color);
1398 -- ANCHOR(`color_content()',`Color_Content')
1399 procedure Color_Content (Color : in Color_Number;
1400 Red : out RGB_Value;
1401 Green : out RGB_Value;
1402 Blue : out RGB_Value);
1404 pragma Inline (Color_Content);
1406 -- MANPAGE(`curs_kernel.3x')
1407 -- | Not implemented: getsyx, setsyx
1409 type Curses_Mode is (Curses, Shell);
1411 -- ANCHOR(`def_prog_mode()',`Save_Curses_Mode')
1412 procedure Save_Curses_Mode (Mode : in Curses_Mode);
1414 -- ALIAS(`def_shell_mode()')
1415 pragma Inline (Save_Curses_Mode);
1417 -- ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode')
1418 procedure Reset_Curses_Mode (Mode : in Curses_Mode);
1420 -- ALIAS(`reset_shell_mode()')
1421 pragma Inline (Reset_Curses_Mode);
1423 -- ANCHOR(`savetty()',`Save_Terminal_State')
1424 procedure Save_Terminal_State;
1426 pragma Inline (Save_Terminal_State);
1428 -- ANCHOR(`resetty();',`Reset_Terminal_State')
1429 procedure Reset_Terminal_State;
1431 pragma Inline (Reset_Terminal_State);
1433 type Stdscr_Init_Proc is access
1434 function (Win : Window;
1435 Columns : Column_Count) return Integer;
1436 pragma Convention (C, Stdscr_Init_Proc);
1437 -- N.B.: the return value is actually ignored, but it seems to be
1438 -- a good practice to return 0 if you think all went fine
1439 -- and -1 otherwise.
1441 -- ANCHOR(`ripoffline()',`Rip_Off_Lines')
1442 procedure Rip_Off_Lines (Lines : in Integer;
1443 Proc : in Stdscr_Init_Proc);
1445 -- N.B.: to be more precise, this uses a ncurses specific enhancement of
1446 -- ripoffline(), in which the Lines argument absolute value is the
1447 -- number of lines to be ripped of. The official ripoffline() only
1448 -- uses the sign of Lines to rip of a single line from bottom or top.
1449 pragma Inline (Rip_Off_Lines);
1451 type Cursor_Visibility is (Invisible, Normal, Very_Visible);
1453 -- ANCHOR(`curs_set()',`Set_Cursor_Visibility')
1454 procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
1456 pragma Inline (Set_Cursor_Visibility);
1458 -- ANCHOR(`napms()',`Nap_Milli_Seconds')
1459 procedure Nap_Milli_Seconds (Ms : in Natural);
1461 pragma Inline (Nap_Milli_Seconds);
1463 -- |=====================================================================
1464 -- | Some useful helpers.
1465 -- |=====================================================================
1466 type Transform_Direction is (From_Screen, To_Screen);
1467 procedure Transform_Coordinates
1468 (W : in Window := Standard_Window;
1469 Line : in out Line_Position;
1470 Column : in out Column_Position;
1471 Dir : in Transform_Direction := From_Screen);
1472 -- This procedure transforms screen coordinates into coordinates relative
1473 -- to the window and vice versa, depending on the Dir parameter.
1474 -- Screen coordinates are the position informations on the physical device.
1475 -- An Curses_Exception will be raised if Line and Column are not in the
1476 -- Window or if you pass the Null_Window as argument.
1477 -- We don't inline this procedure
1479 -- MANPAGE(`dft_fgbg.3x')
1481 -- ANCHOR(`use_default_colors()',`Use_Default_Colors')
1482 procedure Use_Default_Colors;
1484 pragma Inline (Use_Default_Colors);
1486 -- ANCHOR(`assume_default_colors()',`Assume_Default_Colors')
1487 procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
1488 Back : Color_Number := Default_Color);
1490 pragma Inline (Assume_Default_Colors);
1492 -- MANPAGE(`curs_extend.3x')
1494 -- ANCHOR(`curses_version()',`Curses_Version')
1495 function Curses_Version return String;
1498 -- ANCHOR(`use_extended_names()',`Use_Extended_Names')
1499 -- The returnvalue is the previous setting of the flag
1500 function Use_Extended_Names (Enable : Boolean) return Boolean;
1503 -- MANPAGE(`curs_scr_dump.3x')
1505 -- ANCHOR(`scr_dump()',`Screen_Dump_To_File')
1506 procedure Screen_Dump_To_File (Filename : in String);
1509 -- ANCHOR(`scr_restore()',`Screen_Restore_From_File')
1510 procedure Screen_Restore_From_File (Filename : in String);
1513 -- ANCHOR(`scr_init()',`Screen_Init_From_File')
1514 procedure Screen_Init_From_File (Filename : in String);
1517 -- ANCHOR(`scr_set()',`Screen_Set_File')
1518 procedure Screen_Set_File (Filename : in String);
1521 -- MANPAGE(`curs_print.3x')
1522 -- Not implemented: mcprint
1524 -- MANPAGE(`curs_printw.3x')
1525 -- Not implemented: printw, wprintw, mvprintw, mvwprintw, vwprintw,
1527 -- Please use the Ada style Text_IO child packages for formatted
1528 -- printing. It doesn't make a lot of sense to map the printf style
1529 -- C functions to Ada.
1531 -- MANPAGE(`curs_scanw.3x')
1532 -- Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw
1535 -- MANPAGE(`resizeterm.3x')
1536 -- Not Implemented: resizeterm
1538 -- MANPAGE(`wresize.3x')
1540 -- ANCHOR(`wresize()',`Resize')
1541 procedure Resize (Win : Window := Standard_Window;
1542 Number_Of_Lines : Line_Count;
1543 Number_Of_Columns : Column_Count);
1547 type Window is new System.Storage_Elements.Integer_Address;
1548 Null_Window : constant Window := 0;
1550 -- The next constants are generated and may be different on your
1553 include(`Window_Offsets')dnl
1554 Curses_Bool_False : constant Curses_Bool := 0;
1556 end Terminal_Interface.Curses;