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-2009,2011 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: 2011/03/19 23:05:56 $
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 Integer; -- line coordinate
56 type Column_Position is new Integer; -- 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 include(`ACS_Map')dnl
193 -- MANPAGE(`curs_initscr.3x')
194 -- | Not implemented: newterm, set_term, delscreen
196 -- ANCHOR(`stdscr',`Standard_Window')
197 function Standard_Window return Window;
199 pragma Inline (Standard_Window);
201 -- ANCHOR(`curscr',`Current_Window')
202 function Current_Window return Window;
204 pragma Inline (Current_Window);
206 -- ANCHOR(`initscr()',`Init_Screen')
207 procedure Init_Screen;
209 -- ANCHOR(`initscr()',`Init_Windows')
210 procedure Init_Windows renames Init_Screen;
212 pragma Inline (Init_Screen);
213 -- pragma Inline (Init_Windows);
215 -- ANCHOR(`endwin()',`End_Windows')
216 procedure End_Windows;
218 procedure End_Screen renames End_Windows;
219 pragma Inline (End_Windows);
220 -- pragma Inline (End_Screen);
222 -- ANCHOR(`isendwin()',`Is_End_Window')
223 function Is_End_Window return Boolean;
225 pragma Inline (Is_End_Window);
227 -- MANPAGE(`curs_move.3x')
229 -- ANCHOR(`wmove()',`Move_Cursor')
230 procedure Move_Cursor (Win : Window := Standard_Window;
231 Line : Line_Position;
232 Column : Column_Position);
235 pragma Inline (Move_Cursor);
237 -- MANPAGE(`curs_addch.3x')
239 -- ANCHOR(`waddch()',`Add')
240 procedure Add (Win : Window := Standard_Window;
241 Ch : Attributed_Character);
245 procedure Add (Win : Window := Standard_Window;
247 -- Add a single character at the current logical cursor position to
248 -- the window. Use the current windows attributes.
250 -- ANCHOR(`mvwaddch()',`Add')
252 (Win : Window := Standard_Window;
253 Line : Line_Position;
254 Column : Column_Position;
255 Ch : Attributed_Character);
257 -- ALIAS(`mvaddch()')
260 (Win : Window := Standard_Window;
261 Line : Line_Position;
262 Column : Column_Position;
264 -- Move to the position and add a single character into the window
265 -- There are more Add routines, so the Inline pragma follows later
267 -- ANCHOR(`wechochar()',`Add_With_Immediate_Echo')
268 procedure Add_With_Immediate_Echo
269 (Win : Window := Standard_Window;
270 Ch : Attributed_Character);
272 -- ALIAS(`echochar()')
274 procedure Add_With_Immediate_Echo
275 (Win : Window := Standard_Window;
277 -- Add a character and do an immediate refresh of the screen.
278 pragma Inline (Add_With_Immediate_Echo);
280 -- MANPAGE(`curs_window.3x')
281 -- Not Implemented: wcursyncup
283 -- ANCHOR(`newwin()',`Create')
285 (Number_Of_Lines : Line_Count;
286 Number_Of_Columns : Column_Count;
287 First_Line_Position : Line_Position;
288 First_Column_Position : Column_Position) return Window;
289 -- Not Implemented: Default Number_Of_Lines, Number_Of_Columns
290 -- the C version lets them be 0, see the man page.
292 pragma Inline (Create);
295 (Number_Of_Lines : Line_Count;
296 Number_Of_Columns : Column_Count;
297 First_Line_Position : Line_Position;
298 First_Column_Position : Column_Position) return Window
300 -- pragma Inline (New_Window);
302 -- ANCHOR(`delwin()',`Delete')
303 procedure Delete (Win : in out Window);
305 -- Reset Win to Null_Window
306 pragma Inline (Delete);
308 -- ANCHOR(`subwin()',`Sub_Window')
310 (Win : Window := Standard_Window;
311 Number_Of_Lines : Line_Count;
312 Number_Of_Columns : Column_Count;
313 First_Line_Position : Line_Position;
314 First_Column_Position : Column_Position) return Window;
316 pragma Inline (Sub_Window);
318 -- ANCHOR(`derwin()',`Derived_Window')
319 function Derived_Window
320 (Win : Window := Standard_Window;
321 Number_Of_Lines : Line_Count;
322 Number_Of_Columns : Column_Count;
323 First_Line_Position : Line_Position;
324 First_Column_Position : Column_Position) return Window;
326 pragma Inline (Derived_Window);
328 -- ANCHOR(`dupwin()',`Duplicate')
329 function Duplicate (Win : Window) return Window;
331 pragma Inline (Duplicate);
333 -- ANCHOR(`mvwin()',`Move_Window')
334 procedure Move_Window (Win : Window;
335 Line : Line_Position;
336 Column : Column_Position);
338 pragma Inline (Move_Window);
340 -- ANCHOR(`mvderwin()',`Move_Derived_Window')
341 procedure Move_Derived_Window (Win : Window;
342 Line : Line_Position;
343 Column : Column_Position);
345 pragma Inline (Move_Derived_Window);
347 -- ANCHOR(`wsyncup()',`Synchronize_Upwards')
348 procedure Synchronize_Upwards (Win : Window);
350 pragma Import (C, Synchronize_Upwards, "wsyncup");
352 -- ANCHOR(`wsyncdown()',`Synchronize_Downwards')
353 procedure Synchronize_Downwards (Win : Window);
355 pragma Import (C, Synchronize_Downwards, "wsyncdown");
357 -- ANCHOR(`syncok()',`Set_Synch_Mode')
358 procedure Set_Synch_Mode (Win : Window := Standard_Window;
359 Mode : Boolean := False);
361 pragma Inline (Set_Synch_Mode);
363 -- MANPAGE(`curs_addstr.3x')
365 -- ANCHOR(`waddnstr()',`Add')
366 procedure Add (Win : Window := Standard_Window;
368 Len : Integer := -1);
370 -- ALIAS(`waddstr()')
371 -- ALIAS(`addnstr()')
374 -- ANCHOR(`mvwaddnstr()',`Add')
375 procedure Add (Win : Window := Standard_Window;
376 Line : Line_Position;
377 Column : Column_Position;
379 Len : Integer := -1);
381 -- ALIAS(`mvwaddstr()')
382 -- ALIAS(`mvaddnstr()')
383 -- ALIAS(`mvaddstr()')
385 -- MANPAGE(`curs_addchstr.3x')
387 -- ANCHOR(`waddchnstr()',`Add')
388 procedure Add (Win : Window := Standard_Window;
389 Str : Attributed_String;
390 Len : Integer := -1);
392 -- ALIAS(`waddchstr()')
393 -- ALIAS(`addchnstr()')
394 -- ALIAS(`addchstr()')
396 -- ANCHOR(`mvwaddchnstr()',`Add')
397 procedure Add (Win : Window := Standard_Window;
398 Line : Line_Position;
399 Column : Column_Position;
400 Str : Attributed_String;
401 Len : Integer := -1);
403 -- ALIAS(`mvwaddchstr()')
404 -- ALIAS(`mvaddchnstr()')
405 -- ALIAS(`mvaddchstr()')
408 -- MANPAGE(`curs_border.3x')
409 -- | Not implemented: mvhline, mvwhline, mvvline, mvwvline
410 -- | use Move_Cursor then Horizontal_Line or Vertical_Line
412 -- ANCHOR(`wborder()',`Border')
414 (Win : Window := Standard_Window;
415 Left_Side_Symbol : Attributed_Character := Default_Character;
416 Right_Side_Symbol : Attributed_Character := Default_Character;
417 Top_Side_Symbol : Attributed_Character := Default_Character;
418 Bottom_Side_Symbol : Attributed_Character := Default_Character;
419 Upper_Left_Corner_Symbol : Attributed_Character := Default_Character;
420 Upper_Right_Corner_Symbol : Attributed_Character := Default_Character;
421 Lower_Left_Corner_Symbol : Attributed_Character := Default_Character;
422 Lower_Right_Corner_Symbol : Attributed_Character := Default_Character
426 pragma Inline (Border);
428 -- ANCHOR(`box()',`Box')
430 (Win : Window := Standard_Window;
431 Vertical_Symbol : Attributed_Character := Default_Character;
432 Horizontal_Symbol : Attributed_Character := Default_Character);
436 -- ANCHOR(`whline()',`Horizontal_Line')
437 procedure Horizontal_Line
438 (Win : Window := Standard_Window;
440 Line_Symbol : Attributed_Character := Default_Character);
443 pragma Inline (Horizontal_Line);
445 -- ANCHOR(`wvline()',`Vertical_Line')
446 procedure Vertical_Line
447 (Win : Window := Standard_Window;
449 Line_Symbol : Attributed_Character := Default_Character);
452 pragma Inline (Vertical_Line);
454 -- MANPAGE(`curs_getch.3x')
455 -- Not implemented: mvgetch, mvwgetch
457 -- ANCHOR(`wgetch()',`Get_Keystroke')
458 function Get_Keystroke (Win : Window := Standard_Window)
459 return Real_Key_Code;
462 -- Get a character from the keyboard and echo it - if enabled - to the
464 -- If for any reason (i.e. a timeout) we could not get a character the
465 -- returned keycode is Key_None.
466 pragma Inline (Get_Keystroke);
468 -- ANCHOR(`ungetch()',`Undo_Keystroke')
469 procedure Undo_Keystroke (Key : Real_Key_Code);
471 pragma Inline (Undo_Keystroke);
473 -- ANCHOR(`has_key()',`Has_Key')
474 function Has_Key (Key : Special_Key_Code) return Boolean;
476 pragma Inline (Has_Key);
479 -- | Some helper functions
481 function Is_Function_Key (Key : Special_Key_Code) return Boolean;
482 -- Return True if the Key is a function key (i.e. one of F0 .. F63)
483 pragma Inline (Is_Function_Key);
485 subtype Function_Key_Number is Integer range 0 .. 63;
486 -- (n)curses allows for 64 function keys.
488 function Function_Key (Key : Real_Key_Code) return Function_Key_Number;
489 -- Return the number of the function key. If the code is not a
490 -- function key, a CONSTRAINT_ERROR will be raised.
491 pragma Inline (Function_Key);
493 function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code;
494 -- Return the key code for a given function-key number.
495 pragma Inline (Function_Key_Code);
497 -- MANPAGE(`curs_attr.3x')
498 -- | Not implemented attr_off, wattr_off,
499 -- | attr_on, wattr_on, attr_set, wattr_set
502 -- PAIR_NUMBER(c) is the same as c.Color
504 -- ANCHOR(`standout()',`Standout')
505 procedure Standout (Win : Window := Standard_Window;
506 On : Boolean := True);
507 -- ALIAS(`wstandout()')
508 -- ALIAS(`wstandend()')
510 -- ANCHOR(`wattron()',`Switch_Character_Attribute')
511 procedure Switch_Character_Attribute
512 (Win : Window := Standard_Window;
513 Attr : Character_Attribute_Set := Normal_Video;
514 On : Boolean := True); -- if False we switch Off.
515 -- Switches those Attributes set to true in the list.
517 -- ALIAS(`wattroff()')
519 -- ALIAS(`attroff()')
521 -- ANCHOR(`wattrset()',`Set_Character_Attributes')
522 procedure Set_Character_Attributes
523 (Win : Window := Standard_Window;
524 Attr : Character_Attribute_Set := Normal_Video;
525 Color : Color_Pair := Color_Pair'First);
527 -- ALIAS(`attrset()')
528 pragma Inline (Set_Character_Attributes);
530 -- ANCHOR(`wattr_get()',`Get_Character_Attributes')
531 function Get_Character_Attribute
532 (Win : Window := Standard_Window) return Character_Attribute_Set;
534 -- ALIAS(`attr_get()')
536 -- ANCHOR(`wattr_get()',`Get_Character_Attribute')
537 function Get_Character_Attribute
538 (Win : Window := Standard_Window) return Color_Pair;
540 pragma Inline (Get_Character_Attribute);
542 -- ANCHOR(`wcolor_set()',`Set_Color')
543 procedure Set_Color (Win : Window := Standard_Window;
546 -- ALIAS(`color_set()')
547 pragma Inline (Set_Color);
549 -- ANCHOR(`wchgat()',`Change_Attributes')
550 procedure Change_Attributes
551 (Win : Window := Standard_Window;
552 Count : Integer := -1;
553 Attr : Character_Attribute_Set := Normal_Video;
554 Color : Color_Pair := Color_Pair'First);
558 -- ANCHOR(`mvwchgat()',`Change_Attributes')
559 procedure Change_Attributes
560 (Win : Window := Standard_Window;
561 Line : Line_Position := Line_Position'First;
562 Column : Column_Position := Column_Position'First;
563 Count : Integer := -1;
564 Attr : Character_Attribute_Set := Normal_Video;
565 Color : Color_Pair := Color_Pair'First);
567 -- ALIAS(`mvchgat()')
568 pragma Inline (Change_Attributes);
570 -- MANPAGE(`curs_beep.3x')
572 -- ANCHOR(`beep()',`Beep')
575 pragma Inline (Beep);
577 -- ANCHOR(`flash()',`Flash_Screen')
578 procedure Flash_Screen;
580 pragma Inline (Flash_Screen);
582 -- MANPAGE(`curs_inopts.3x')
584 -- | Not implemented : typeahead
586 -- ANCHOR(`cbreak()',`Set_Cbreak_Mode')
587 procedure Set_Cbreak_Mode (SwitchOn : Boolean := True);
589 -- ALIAS(`nocbreak()')
590 pragma Inline (Set_Cbreak_Mode);
592 -- ANCHOR(`raw()',`Set_Raw_Mode')
593 procedure Set_Raw_Mode (SwitchOn : Boolean := True);
596 pragma Inline (Set_Raw_Mode);
598 -- ANCHOR(`echo()',`Set_Echo_Mode')
599 procedure Set_Echo_Mode (SwitchOn : Boolean := True);
602 pragma Inline (Set_Echo_Mode);
604 -- ANCHOR(`meta()',`Set_Meta_Mode')
605 procedure Set_Meta_Mode (Win : Window := Standard_Window;
606 SwitchOn : Boolean := True);
608 pragma Inline (Set_Meta_Mode);
610 -- ANCHOR(`keypad()',`Set_KeyPad_Mode')
611 procedure Set_KeyPad_Mode (Win : Window := Standard_Window;
612 SwitchOn : Boolean := True);
614 pragma Inline (Set_KeyPad_Mode);
616 function Get_KeyPad_Mode (Win : Window := Standard_Window)
618 -- This has no pendant in C. There you've to look into the WINDOWS
619 -- structure to get the value. Bad practice, not repeated in Ada.
621 type Half_Delay_Amount is range 1 .. 255;
623 -- ANCHOR(`halfdelay()',`Half_Delay')
624 procedure Half_Delay (Amount : Half_Delay_Amount);
626 pragma Inline (Half_Delay);
628 -- ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode')
629 procedure Set_Flush_On_Interrupt_Mode
630 (Win : Window := Standard_Window;
631 Mode : Boolean := True);
633 pragma Inline (Set_Flush_On_Interrupt_Mode);
635 -- ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode')
636 procedure Set_Queue_Interrupt_Mode
637 (Win : Window := Standard_Window;
638 Flush : Boolean := True);
640 -- ALIAS(`noqiflush()')
641 pragma Inline (Set_Queue_Interrupt_Mode);
643 -- ANCHOR(`nodelay()',`Set_NoDelay_Mode')
644 procedure Set_NoDelay_Mode
645 (Win : Window := Standard_Window;
646 Mode : Boolean := False);
648 pragma Inline (Set_NoDelay_Mode);
650 type Timeout_Mode is (Blocking, Non_Blocking, Delayed);
652 -- ANCHOR(`wtimeout()',`Set_Timeout_Mode')
653 procedure Set_Timeout_Mode (Win : Window := Standard_Window;
655 Amount : Natural); -- in Milliseconds
657 -- ALIAS(`timeout()')
658 -- Instead of overloading the semantic of the sign of amount, we
659 -- introduce the Timeout_Mode parameter. This should improve
660 -- readability. For Blocking and Non_Blocking, the Amount is not
662 -- We do not inline this procedure.
664 -- ANCHOR(`notimeout()',`Set_Escape_Time_Mode')
665 procedure Set_Escape_Timer_Mode
666 (Win : Window := Standard_Window;
667 Timer_Off : Boolean := False);
669 pragma Inline (Set_Escape_Timer_Mode);
671 -- MANPAGE(`curs_outopts.3x')
673 -- ANCHOR(`nl()',`Set_NL_Mode')
674 procedure Set_NL_Mode (SwitchOn : Boolean := True);
677 pragma Inline (Set_NL_Mode);
679 -- ANCHOR(`clearok()',`Clear_On_Next_Update')
680 procedure Clear_On_Next_Update
681 (Win : Window := Standard_Window;
682 Do_Clear : Boolean := True);
684 pragma Inline (Clear_On_Next_Update);
686 -- ANCHOR(`idlok()',`Use_Insert_Delete_Line')
687 procedure Use_Insert_Delete_Line
688 (Win : Window := Standard_Window;
689 Do_Idl : Boolean := True);
691 pragma Inline (Use_Insert_Delete_Line);
693 -- ANCHOR(`idcok()',`Use_Insert_Delete_Character')
694 procedure Use_Insert_Delete_Character
695 (Win : Window := Standard_Window;
696 Do_Idc : Boolean := True);
698 pragma Inline (Use_Insert_Delete_Character);
700 -- ANCHOR(`leaveok()',`Leave_Cursor_After_Update')
701 procedure Leave_Cursor_After_Update
702 (Win : Window := Standard_Window;
703 Do_Leave : Boolean := True);
705 pragma Inline (Leave_Cursor_After_Update);
707 -- ANCHOR(`immedok()',`Immediate_Update_Mode')
708 procedure Immediate_Update_Mode
709 (Win : Window := Standard_Window;
710 Mode : Boolean := False);
712 pragma Inline (Immediate_Update_Mode);
714 -- ANCHOR(`scrollok()',`Allow_Scrolling')
715 procedure Allow_Scrolling
716 (Win : Window := Standard_Window;
717 Mode : Boolean := False);
719 pragma Inline (Allow_Scrolling);
721 function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean;
722 -- There is no such function in the C interface.
723 pragma Inline (Scrolling_Allowed);
725 -- ANCHOR(`wsetscrreg()',`Set_Scroll_Region')
726 procedure Set_Scroll_Region
727 (Win : Window := Standard_Window;
728 Top_Line : Line_Position;
729 Bottom_Line : Line_Position);
731 -- ALIAS(`setscrreg()')
732 pragma Inline (Set_Scroll_Region);
734 -- MANPAGE(`curs_refresh.3x')
736 -- ANCHOR(`doupdate()',`Update_Screen')
737 procedure Update_Screen;
739 pragma Inline (Update_Screen);
741 -- ANCHOR(`wrefresh()',`Refresh')
742 procedure Refresh (Win : Window := Standard_Window);
744 -- There is an overloaded Refresh for Pads.
745 -- The Inline pragma appears there
746 -- ALIAS(`refresh()')
748 -- ANCHOR(`wnoutrefresh()',`Refresh_Without_Update')
749 procedure Refresh_Without_Update
750 (Win : Window := Standard_Window);
752 -- There is an overloaded Refresh_Without_Update for Pads.
753 -- The Inline pragma appears there
755 -- ANCHOR(`redrawwin()',`Redraw')
756 procedure Redraw (Win : Window := Standard_Window);
759 -- ANCHOR(`wredrawln()',`Redraw')
760 procedure Redraw (Win : Window := Standard_Window;
761 Begin_Line : Line_Position;
762 Line_Count : Positive);
764 pragma Inline (Redraw);
766 -- MANPAGE(`curs_clear.3x')
768 -- ANCHOR(`werase()',`Erase')
769 procedure Erase (Win : Window := Standard_Window);
772 pragma Inline (Erase);
774 -- ANCHOR(`wclear()',`Clear')
776 (Win : Window := Standard_Window);
779 pragma Inline (Clear);
781 -- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen')
782 procedure Clear_To_End_Of_Screen
783 (Win : Window := Standard_Window);
785 -- ALIAS(`clrtobot()')
786 pragma Inline (Clear_To_End_Of_Screen);
788 -- ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line')
789 procedure Clear_To_End_Of_Line
790 (Win : Window := Standard_Window);
792 -- ALIAS(`clrtoeol()')
793 pragma Inline (Clear_To_End_Of_Line);
795 -- MANPAGE(`curs_bkgd.3x')
797 -- ANCHOR(`wbkgdset()',`Set_Background')
798 -- TODO: we could have Set_Background(Window; Character_Attribute_Set)
799 -- because in C it is common to see bkgdset(A_BOLD) or
800 -- bkgdset(COLOR_PAIR(n))
801 procedure Set_Background
802 (Win : Window := Standard_Window;
803 Ch : Attributed_Character);
805 -- ALIAS(`bkgdset()')
806 pragma Inline (Set_Background);
808 -- ANCHOR(`wbkgd()',`Change_Background')
809 procedure Change_Background
810 (Win : Window := Standard_Window;
811 Ch : Attributed_Character);
814 pragma Inline (Change_Background);
816 -- ANCHOR(`wbkgdget()',`Get_Background')
817 -- ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough.
818 function Get_Background (Win : Window := Standard_Window)
819 return Attributed_Character;
821 -- ALIAS(`bkgdget()')
822 pragma Inline (Get_Background);
824 -- MANPAGE(`curs_touch.3x')
826 -- ANCHOR(`untouchwin()',`Untouch')
827 procedure Untouch (Win : Window := Standard_Window);
829 pragma Inline (Untouch);
831 -- ANCHOR(`touchwin()',`Touch')
832 procedure Touch (Win : Window := Standard_Window);
835 -- ANCHOR(`touchline()',`Touch')
836 procedure Touch (Win : Window := Standard_Window;
837 Start : Line_Position;
840 pragma Inline (Touch);
842 -- ANCHOR(`wtouchln()',`Change_Line_Status')
843 procedure Change_Lines_Status (Win : Window := Standard_Window;
844 Start : Line_Position;
848 pragma Inline (Change_Lines_Status);
850 -- ANCHOR(`is_linetouched()',`Is_Touched')
851 function Is_Touched (Win : Window := Standard_Window;
852 Line : Line_Position) return Boolean;
855 -- ANCHOR(`is_wintouched()',`Is_Touched')
856 function Is_Touched (Win : Window := Standard_Window) return Boolean;
858 pragma Inline (Is_Touched);
860 -- MANPAGE(`curs_overlay.3x')
862 -- ANCHOR(`copywin()',`Copy')
864 (Source_Window : Window;
865 Destination_Window : Window;
866 Source_Top_Row : Line_Position;
867 Source_Left_Column : Column_Position;
868 Destination_Top_Row : Line_Position;
869 Destination_Left_Column : Column_Position;
870 Destination_Bottom_Row : Line_Position;
871 Destination_Right_Column : Column_Position;
872 Non_Destructive_Mode : Boolean := True);
874 pragma Inline (Copy);
876 -- ANCHOR(`overwrite()',`Overwrite')
877 procedure Overwrite (Source_Window : Window;
878 Destination_Window : Window);
880 pragma Inline (Overwrite);
882 -- ANCHOR(`overlay()',`Overlay')
883 procedure Overlay (Source_Window : Window;
884 Destination_Window : Window);
886 pragma Inline (Overlay);
888 -- MANPAGE(`curs_deleteln.3x')
890 -- ANCHOR(`winsdelln()',`Insert_Delete_Lines')
891 procedure Insert_Delete_Lines
892 (Win : Window := Standard_Window;
893 Lines : Integer := 1); -- default is to insert one line above
895 -- ALIAS(`insdelln()')
896 pragma Inline (Insert_Delete_Lines);
898 -- ANCHOR(`wdeleteln()',`Delete_Line')
899 procedure Delete_Line (Win : Window := Standard_Window);
901 -- ALIAS(`deleteln()')
902 pragma Inline (Delete_Line);
904 -- ANCHOR(`winsertln()',`Insert_Line')
905 procedure Insert_Line (Win : Window := Standard_Window);
907 -- ALIAS(`insertln()')
908 pragma Inline (Insert_Line);
910 -- MANPAGE(`curs_getyx.3x')
912 -- ANCHOR(`getmaxyx()',`Get_Size')
914 (Win : Window := Standard_Window;
915 Number_Of_Lines : out Line_Count;
916 Number_Of_Columns : out Column_Count);
918 pragma Inline (Get_Size);
920 -- ANCHOR(`getbegyx()',`Get_Window_Position')
921 procedure Get_Window_Position
922 (Win : Window := Standard_Window;
923 Top_Left_Line : out Line_Position;
924 Top_Left_Column : out Column_Position);
926 pragma Inline (Get_Window_Position);
928 -- ANCHOR(`getyx()',`Get_Cursor_Position')
929 procedure Get_Cursor_Position
930 (Win : Window := Standard_Window;
931 Line : out Line_Position;
932 Column : out Column_Position);
934 pragma Inline (Get_Cursor_Position);
936 -- ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent')
937 procedure Get_Origin_Relative_To_Parent
939 Top_Left_Line : out Line_Position;
940 Top_Left_Column : out Column_Position;
941 Is_Not_A_Subwindow : out Boolean);
943 -- Instead of placing -1 in the coordinates as return, we use a Boolean
944 -- to return the info that the window has no parent.
945 pragma Inline (Get_Origin_Relative_To_Parent);
947 -- MANPAGE(`curs_pad.3x')
949 -- ANCHOR(`newpad()',`New_Pad')
950 function New_Pad (Lines : Line_Count;
951 Columns : Column_Count) return Window;
953 pragma Inline (New_Pad);
955 -- ANCHOR(`subpad()',`Sub_Pad')
958 Number_Of_Lines : Line_Count;
959 Number_Of_Columns : Column_Count;
960 First_Line_Position : Line_Position;
961 First_Column_Position : Column_Position) return Window;
963 pragma Inline (Sub_Pad);
965 -- ANCHOR(`prefresh()',`Refresh')
968 Source_Top_Row : Line_Position;
969 Source_Left_Column : Column_Position;
970 Destination_Top_Row : Line_Position;
971 Destination_Left_Column : Column_Position;
972 Destination_Bottom_Row : Line_Position;
973 Destination_Right_Column : Column_Position);
975 pragma Inline (Refresh);
977 -- ANCHOR(`pnoutrefresh()',`Refresh_Without_Update')
978 procedure Refresh_Without_Update
980 Source_Top_Row : Line_Position;
981 Source_Left_Column : Column_Position;
982 Destination_Top_Row : Line_Position;
983 Destination_Left_Column : Column_Position;
984 Destination_Bottom_Row : Line_Position;
985 Destination_Right_Column : Column_Position);
987 pragma Inline (Refresh_Without_Update);
989 -- ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It')
990 procedure Add_Character_To_Pad_And_Echo_It
992 Ch : Attributed_Character);
995 procedure Add_Character_To_Pad_And_Echo_It
998 pragma Inline (Add_Character_To_Pad_And_Echo_It);
1000 -- MANPAGE(`curs_scroll.3x')
1002 -- ANCHOR(`wscrl()',`Scroll')
1003 procedure Scroll (Win : Window := Standard_Window;
1004 Amount : Integer := 1);
1006 -- ALIAS(`scroll()')
1008 pragma Inline (Scroll);
1010 -- MANPAGE(`curs_delch.3x')
1012 -- ANCHOR(`wdelch()',`Delete_Character')
1013 procedure Delete_Character (Win : Window := Standard_Window);
1017 -- ANCHOR(`mvwdelch()',`Delete_Character')
1018 procedure Delete_Character
1019 (Win : Window := Standard_Window;
1020 Line : Line_Position;
1021 Column : Column_Position);
1023 -- ALIAS(`mvdelch()')
1024 pragma Inline (Delete_Character);
1026 -- MANPAGE(`curs_inch.3x')
1028 -- ANCHOR(`winch()',`Peek')
1029 function Peek (Win : Window := Standard_Window)
1030 return Attributed_Character;
1034 -- ANCHOR(`mvwinch()',`Peek')
1036 (Win : Window := Standard_Window;
1037 Line : Line_Position;
1038 Column : Column_Position) return Attributed_Character;
1040 -- ALIAS(`mvinch()')
1041 -- More Peek's follow, pragma Inline appears later.
1043 -- MANPAGE(`curs_insch.3x')
1045 -- ANCHOR(`winsch()',`Insert')
1046 procedure Insert (Win : Window := Standard_Window;
1047 Ch : Attributed_Character);
1051 -- ANCHOR(`mvwinsch()',`Insert')
1052 procedure Insert (Win : Window := Standard_Window;
1053 Line : Line_Position;
1054 Column : Column_Position;
1055 Ch : Attributed_Character);
1057 -- ALIAS(`mvinsch()')
1059 -- MANPAGE(`curs_insstr.3x')
1061 -- ANCHOR(`winsnstr()',`Insert')
1062 procedure Insert (Win : Window := Standard_Window;
1064 Len : Integer := -1);
1066 -- ALIAS(`winsstr()')
1067 -- ALIAS(`insnstr()')
1068 -- ALIAS(`insstr()')
1070 -- ANCHOR(`mvwinsnstr()',`Insert')
1071 procedure Insert (Win : Window := Standard_Window;
1072 Line : Line_Position;
1073 Column : Column_Position;
1075 Len : Integer := -1);
1077 -- ALIAS(`mvwinsstr()')
1078 -- ALIAS(`mvinsnstr()')
1079 -- ALIAS(`mvinsstr()')
1080 pragma Inline (Insert);
1082 -- MANPAGE(`curs_instr.3x')
1084 -- ANCHOR(`winnstr()',`Peek')
1085 procedure Peek (Win : Window := Standard_Window;
1087 Len : Integer := -1);
1089 -- ALIAS(`winstr()')
1090 -- ALIAS(`innstr()')
1093 -- ANCHOR(`mvwinnstr()',`Peek')
1094 procedure Peek (Win : Window := Standard_Window;
1095 Line : Line_Position;
1096 Column : Column_Position;
1098 Len : Integer := -1);
1100 -- ALIAS(`mvwinstr()')
1101 -- ALIAS(`mvinnstr()')
1102 -- ALIAS(`mvinstr()')
1104 -- MANPAGE(`curs_inchstr.3x')
1106 -- ANCHOR(`winchnstr()',`Peek')
1107 procedure Peek (Win : Window := Standard_Window;
1108 Str : out Attributed_String;
1109 Len : Integer := -1);
1111 -- ALIAS(`winchstr()')
1112 -- ALIAS(`inchnstr()')
1113 -- ALIAS(`inchstr()')
1115 -- ANCHOR(`mvwinchnstr()',`Peek')
1116 procedure Peek (Win : Window := Standard_Window;
1117 Line : Line_Position;
1118 Column : Column_Position;
1119 Str : out Attributed_String;
1120 Len : Integer := -1);
1122 -- ALIAS(`mvwinchstr()')
1123 -- ALIAS(`mvinchnstr()')
1124 -- ALIAS(`mvinchstr()')
1125 -- We do not inline the Peek procedures
1127 -- MANPAGE(`curs_getstr.3x')
1129 -- ANCHOR(`wgetnstr()',`Get')
1130 procedure Get (Win : Window := Standard_Window;
1132 Len : Integer := -1);
1134 -- ALIAS(`wgetstr()')
1135 -- ALIAS(`getnstr()')
1136 -- ALIAS(`getstr()')
1137 -- actually getstr is not supported because that results in buffer
1140 -- ANCHOR(`mvwgetnstr()',`Get')
1141 procedure Get (Win : Window := Standard_Window;
1142 Line : Line_Position;
1143 Column : Column_Position;
1145 Len : Integer := -1);
1147 -- ALIAS(`mvwgetstr()')
1148 -- ALIAS(`mvgetnstr()')
1149 -- ALIAS(`mvgetstr()')
1150 -- Get is not inlined
1152 -- MANPAGE(`curs_slk.3x')
1154 -- Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set
1156 type Soft_Label_Key_Format is (Three_Two_Three,
1158 PC_Style, -- ncurses specific
1159 PC_Style_With_Index); -- "
1160 type Label_Number is new Positive range 1 .. 12;
1161 type Label_Justification is (Left, Centered, Right);
1163 -- ANCHOR(`slk_init()',`Init_Soft_Label_Keys')
1164 procedure Init_Soft_Label_Keys
1165 (Format : Soft_Label_Key_Format := Three_Two_Three);
1167 pragma Inline (Init_Soft_Label_Keys);
1169 -- ANCHOR(`slk_set()',`Set_Soft_Label_Key')
1170 procedure Set_Soft_Label_Key (Label : Label_Number;
1172 Fmt : Label_Justification := Left);
1174 -- We do not inline this procedure
1176 -- ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key')
1177 procedure Refresh_Soft_Label_Keys;
1179 pragma Inline (Refresh_Soft_Label_Keys);
1181 -- ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update')
1182 procedure Refresh_Soft_Label_Keys_Without_Update;
1184 pragma Inline (Refresh_Soft_Label_Keys_Without_Update);
1186 -- ANCHOR(`slk_label()',`Get_Soft_Label_Key')
1187 procedure Get_Soft_Label_Key (Label : Label_Number;
1191 -- ANCHOR(`slk_label()',`Get_Soft_Label_Key')
1192 function Get_Soft_Label_Key (Label : Label_Number) return String;
1195 pragma Inline (Get_Soft_Label_Key);
1197 -- ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys')
1198 procedure Clear_Soft_Label_Keys;
1200 pragma Inline (Clear_Soft_Label_Keys);
1202 -- ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys')
1203 procedure Restore_Soft_Label_Keys;
1205 pragma Inline (Restore_Soft_Label_Keys);
1207 -- ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys')
1208 procedure Touch_Soft_Label_Keys;
1210 pragma Inline (Touch_Soft_Label_Keys);
1212 -- ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes')
1213 procedure Switch_Soft_Label_Key_Attributes
1214 (Attr : Character_Attribute_Set;
1215 On : Boolean := True);
1217 -- ALIAS(`slk_attroff()')
1218 pragma Inline (Switch_Soft_Label_Key_Attributes);
1220 -- ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes')
1221 procedure Set_Soft_Label_Key_Attributes
1222 (Attr : Character_Attribute_Set := Normal_Video;
1223 Color : Color_Pair := Color_Pair'First);
1225 pragma Inline (Set_Soft_Label_Key_Attributes);
1227 -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1228 function Get_Soft_Label_Key_Attributes return Character_Attribute_Set;
1231 -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes')
1232 function Get_Soft_Label_Key_Attributes return Color_Pair;
1234 pragma Inline (Get_Soft_Label_Key_Attributes);
1236 -- ANCHOR(`slk_color()',`Set_Soft_Label_Key_Color')
1237 procedure Set_Soft_Label_Key_Color (Pair : Color_Pair);
1239 pragma Inline (Set_Soft_Label_Key_Color);
1241 -- MANPAGE(`keybound.3x')
1242 -- Not Implemented: keybound
1244 -- MANPAGE(`keyok.3x')
1246 -- ANCHOR(`keyok()',`Enable_Key')
1247 procedure Enable_Key (Key : Special_Key_Code;
1248 Enable : Boolean := True);
1250 pragma Inline (Enable_Key);
1252 -- MANPAGE(`define_key.3x')
1254 -- ANCHOR(`define_key()',`Define_Key')
1255 procedure Define_Key (Definition : String;
1256 Key : Special_Key_Code);
1258 pragma Inline (Define_Key);
1260 -- MANPAGE(`curs_util.3x')
1262 -- | Not implemented : filter, use_env
1263 -- | putwin, getwin are in the child package PutWin
1266 -- ANCHOR(`keyname()',`Key_Name')
1267 procedure Key_Name (Key : Real_Key_Code;
1270 -- The external name for a real keystroke.
1272 -- ANCHOR(`keyname()',`Key_Name')
1273 function Key_Name (Key : Real_Key_Code) return String;
1276 -- We do not inline this routine
1278 -- ANCHOR(`unctrl()',`Un_Control')
1279 procedure Un_Control (Ch : Attributed_Character;
1283 -- ANCHOR(`unctrl()',`Un_Control')
1284 function Un_Control (Ch : Attributed_Character) return String;
1287 pragma Inline (Un_Control);
1289 -- ANCHOR(`delay_output()',`Delay_Output')
1290 procedure Delay_Output (Msecs : Natural);
1292 pragma Inline (Delay_Output);
1294 -- ANCHOR(`flushinp()',`Flush_Input')
1295 procedure Flush_Input;
1297 pragma Inline (Flush_Input);
1299 -- MANPAGE(`curs_termattrs.3x')
1301 -- ANCHOR(`baudrate()',`Baudrate')
1302 function Baudrate return Natural;
1304 pragma Inline (Baudrate);
1306 -- ANCHOR(`erasechar()',`Erase_Character')
1307 function Erase_Character return Character;
1309 pragma Inline (Erase_Character);
1311 -- ANCHOR(`killchar()',`Kill_Character')
1312 function Kill_Character return Character;
1314 pragma Inline (Kill_Character);
1316 -- ANCHOR(`has_ic()',`Has_Insert_Character')
1317 function Has_Insert_Character return Boolean;
1319 pragma Inline (Has_Insert_Character);
1321 -- ANCHOR(`has_il()',`Has_Insert_Line')
1322 function Has_Insert_Line return Boolean;
1324 pragma Inline (Has_Insert_Line);
1326 -- ANCHOR(`termattrs()',`Supported_Attributes')
1327 function Supported_Attributes return Character_Attribute_Set;
1329 pragma Inline (Supported_Attributes);
1331 -- ANCHOR(`longname()',`Long_Name')
1332 procedure Long_Name (Name : out String);
1335 -- ANCHOR(`longname()',`Long_Name')
1336 function Long_Name return String;
1339 pragma Inline (Long_Name);
1341 -- ANCHOR(`termname()',`Terminal_Name')
1342 procedure Terminal_Name (Name : out String);
1345 -- ANCHOR(`termname()',`Terminal_Name')
1346 function Terminal_Name return String;
1349 pragma Inline (Terminal_Name);
1351 -- MANPAGE(`curs_color.3x')
1354 -- COLOR_PAIR(n) in C is the same as
1355 -- Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video)
1356 -- In C you often see something like c = c | COLOR_PAIR(n);
1357 -- This is equivalent to c.Color := n;
1359 -- ANCHOR(`start_color()',`Start_Color')
1360 procedure Start_Color;
1362 pragma Import (C, Start_Color, "start_color");
1364 -- ANCHOR(`init_pair()',`Init_Pair')
1365 procedure Init_Pair (Pair : Redefinable_Color_Pair;
1366 Fore : Color_Number;
1367 Back : Color_Number);
1369 pragma Inline (Init_Pair);
1371 -- ANCHOR(`pair_content()',`Pair_Content')
1372 procedure Pair_Content (Pair : Color_Pair;
1373 Fore : out Color_Number;
1374 Back : out Color_Number);
1376 pragma Inline (Pair_Content);
1378 -- ANCHOR(`has_colors()',`Has_Colors')
1379 function Has_Colors return Boolean;
1381 pragma Inline (Has_Colors);
1383 -- ANCHOR(`init_color()',`Init_Color')
1384 procedure Init_Color (Color : Color_Number;
1389 pragma Inline (Init_Color);
1391 -- ANCHOR(`can_change_color()',`Can_Change_Color')
1392 function Can_Change_Color return Boolean;
1394 pragma Inline (Can_Change_Color);
1396 -- ANCHOR(`color_content()',`Color_Content')
1397 procedure Color_Content (Color : Color_Number;
1398 Red : out RGB_Value;
1399 Green : out RGB_Value;
1400 Blue : out RGB_Value);
1402 pragma Inline (Color_Content);
1404 -- MANPAGE(`curs_kernel.3x')
1405 -- | Not implemented: getsyx, setsyx
1407 type Curses_Mode is (Curses, Shell);
1409 -- ANCHOR(`def_prog_mode()',`Save_Curses_Mode')
1410 procedure Save_Curses_Mode (Mode : Curses_Mode);
1412 -- ALIAS(`def_shell_mode()')
1413 pragma Inline (Save_Curses_Mode);
1415 -- ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode')
1416 procedure Reset_Curses_Mode (Mode : Curses_Mode);
1418 -- ALIAS(`reset_shell_mode()')
1419 pragma Inline (Reset_Curses_Mode);
1421 -- ANCHOR(`savetty()',`Save_Terminal_State')
1422 procedure Save_Terminal_State;
1424 pragma Inline (Save_Terminal_State);
1426 -- ANCHOR(`resetty();',`Reset_Terminal_State')
1427 procedure Reset_Terminal_State;
1429 pragma Inline (Reset_Terminal_State);
1431 type Stdscr_Init_Proc is access
1432 function (Win : Window;
1433 Columns : Column_Count) return Integer;
1434 pragma Convention (C, Stdscr_Init_Proc);
1435 -- N.B.: the return value is actually ignored, but it seems to be
1436 -- a good practice to return 0 if you think all went fine
1437 -- and -1 otherwise.
1439 -- ANCHOR(`ripoffline()',`Rip_Off_Lines')
1440 procedure Rip_Off_Lines (Lines : Integer;
1441 Proc : Stdscr_Init_Proc);
1443 -- N.B.: to be more precise, this uses a ncurses specific enhancement of
1444 -- ripoffline(), in which the Lines argument absolute value is the
1445 -- number of lines to be ripped of. The official ripoffline() only
1446 -- uses the sign of Lines to remove a single line from bottom or top.
1447 pragma Inline (Rip_Off_Lines);
1449 type Cursor_Visibility is (Invisible, Normal, Very_Visible);
1451 -- ANCHOR(`curs_set()',`Set_Cursor_Visibility')
1452 procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility);
1454 pragma Inline (Set_Cursor_Visibility);
1456 -- ANCHOR(`napms()',`Nap_Milli_Seconds')
1457 procedure Nap_Milli_Seconds (Ms : Natural);
1459 pragma Inline (Nap_Milli_Seconds);
1461 -- |=====================================================================
1462 -- | Some useful helpers.
1463 -- |=====================================================================
1464 type Transform_Direction is (From_Screen, To_Screen);
1465 procedure Transform_Coordinates
1466 (W : Window := Standard_Window;
1467 Line : in out Line_Position;
1468 Column : in out Column_Position;
1469 Dir : Transform_Direction := From_Screen);
1470 -- This procedure transforms screen coordinates into coordinates relative
1471 -- to the window and vice versa, depending on the Dir parameter.
1472 -- Screen coordinates are the position information for the physical device.
1473 -- An Curses_Exception will be raised if Line and Column are not in the
1474 -- Window or if you pass the Null_Window as argument.
1475 -- We do not inline this procedure
1477 -- MANPAGE(`default_colors.3x')
1479 -- ANCHOR(`use_default_colors()',`Use_Default_Colors')
1480 procedure Use_Default_Colors;
1482 pragma Inline (Use_Default_Colors);
1484 -- ANCHOR(`assume_default_colors()',`Assume_Default_Colors')
1485 procedure Assume_Default_Colors (Fore : Color_Number := Default_Color;
1486 Back : Color_Number := Default_Color);
1488 pragma Inline (Assume_Default_Colors);
1490 -- MANPAGE(`curs_extend.3x')
1492 -- ANCHOR(`curses_version()',`Curses_Version')
1493 function Curses_Version return String;
1496 -- ANCHOR(`use_extended_names()',`Use_Extended_Names')
1497 -- The returnvalue is the previous setting of the flag
1498 function Use_Extended_Names (Enable : Boolean) return Boolean;
1501 -- MANPAGE(`curs_trace.3x')
1503 -- ANCHOR(`_nc_freeall()',`Curses_Free_All')
1504 procedure Curses_Free_All;
1507 -- MANPAGE(`curs_scr_dump.3x')
1509 -- ANCHOR(`scr_dump()',`Screen_Dump_To_File')
1510 procedure Screen_Dump_To_File (Filename : String);
1513 -- ANCHOR(`scr_restore()',`Screen_Restore_From_File')
1514 procedure Screen_Restore_From_File (Filename : String);
1517 -- ANCHOR(`scr_init()',`Screen_Init_From_File')
1518 procedure Screen_Init_From_File (Filename : String);
1521 -- ANCHOR(`scr_set()',`Screen_Set_File')
1522 procedure Screen_Set_File (Filename : String);
1525 -- MANPAGE(`curs_print.3x')
1526 -- Not implemented: mcprint
1528 -- MANPAGE(`curs_printw.3x')
1529 -- Not implemented: printw, wprintw, mvprintw, mvwprintw, vwprintw,
1531 -- Please use the Ada style Text_IO child packages for formatted
1532 -- printing. It does not make a lot of sense to map the printf style
1533 -- C functions to Ada.
1535 -- MANPAGE(`curs_scanw.3x')
1536 -- Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw
1538 -- MANPAGE(`resizeterm.3x')
1539 -- Not Implemented: resizeterm
1541 -- MANPAGE(`wresize.3x')
1543 -- ANCHOR(`wresize()',`Resize')
1544 procedure Resize (Win : Window := Standard_Window;
1545 Number_Of_Lines : Line_Count;
1546 Number_Of_Columns : Column_Count);
1550 type Window is new System.Storage_Elements.Integer_Address;
1551 Null_Window : constant Window := 0;
1553 -- The next constants are generated and may be different on your
1556 include(`Window_Offsets')dnl
1557 Curses_Bool_False : constant Curses_Bool := 0;
1559 end Terminal_Interface.Curses;