bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Additions to the Ada binding


From: From:H. Nanosecond
Subject: Additions to the Ada binding
Date: Sat, 28 Oct 2000 19:15:33 -0400 (EDT)

Hello,

I have written some additional functions for the Ada binding of ncurses.
Please use them in the standard release, thanks.

The patch below also has some documentation fixes such as extra Alias
lines. Also, I changed the use of chars_ptr to just char_array because
Ada treats them the same when passing them to a C function.

diff -u --recursive ncurses-5.2/Ada95/gen/Makefile.in 
ncurses-5.2.new/Ada95/gen/Makefile.in
--- ncurses-5.2/Ada95/gen/Makefile.in   Sat Sep 30 15:13:01 2000
+++ ncurses-5.2.new/Ada95/gen/Makefile.in       Sat Oct 28 18:57:40 2000
@@ -101,7 +101,8 @@
                  Linker_Options                        \
                  Base_Defs                             \
                  Window_Offsets                        \
-                 Version_Info
+                 Version_Info                          \
+                 Window_Record
 
 GEN_FILES2      = Menu_Opt_Rep                         \
                  Menu_Base_Defs                        \
@@ -132,7 +133,9 @@
                  $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads       \
                  $(ADA_SRCDIR)/$(ABASE)-forms-field_types.ads          \
                  $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads      \
-                 $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads
+                 $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads           \
+                 $(ADA_SRCDIR)/$(ABASE)-putwin.adb                     \
+                 $(ADA_SRCDIR)/$(ABASE)-putwin.ads
 
 GEN_SRC                = $(srcdir)/$(ABASE).ads.m4                             
\
                  $(srcdir)/$(ABASE)-aux.ads.m4                         \
@@ -145,8 +148,9 @@
                  $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4        \
                  $(srcdir)/$(ABASE)-forms-field_types.ads.m4           \
                  $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4       \
-                 $(srcdir)/$(ABASE)-panels-user_data.ads.m4
-
+                 $(srcdir)/$(ABASE)-panels-user_data.ads.m4            \
+                 $(srcdir)/$(ABASE)-putwin.adb.m4                      \
+                 $(srcdir)/$(ABASE)-putwin.ads.m4
 
 all \
 libs : $(GEN_TARGETS)
@@ -187,6 +191,9 @@
 gen.o: $(srcdir)/gen.c
        $(HOST_CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c
 
+Window_Record: gen
+       $(GENERATE) B X >$@
+
 Character_Attribute_Set_Rep: gen$x
        $(GENERATE) B A >$@
 
@@ -335,6 +342,20 @@
                $(srcdir)/normal.m4
        $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
        $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\
+       $(DEL_ADAMODE) >$@
+
+$(ADA_SRCDIR)/$(ABASE)-putwin.adb: \
+               $(srcdir)/$(ABASE)-putwin.adb.m4 \
+               $(srcdir)/normal.m4
+       $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
+       $(srcdir)/$(ABASE)-putwin.adb.m4 |\
+       $(DEL_ADAMODE) >$@
+
+$(ADA_SRCDIR)/$(ABASE)-putwin.ads: \
+               $(srcdir)/$(ABASE)-putwin.ads.m4 \
+               $(srcdir)/normal.m4
+       $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \
+       $(srcdir)/$(ABASE)-putwin.ads.m4 |\
        $(DEL_ADAMODE) >$@
 
 install.progs ::
diff -u --recursive ncurses-5.2/Ada95/gen/gen.c ncurses-5.2.new/Ada95/gen/gen.c
--- ncurses-5.2/Ada95/gen/gen.c Sat Aug 26 18:13:47 2000
+++ ncurses-5.2.new/Ada95/gen/gen.c     Sat Oct 28 18:56:13 2000
@@ -285,6 +285,47 @@
   gen_reps (nap, name, (len+7)/8, little_endian?start:0);
 }
 
+static void gen_trace()
+{
+
+/*
+#define TRACE_DISABLE   0x0000   turn off tracing 
+#define TRACE_TIMES     0x0001   trace user and system times of updates 
+#define TRACE_TPUTS     0x0002  trace tputs calls 
+#define TRACE_UPDATE    0x0004   trace update actions, old & new screens 
+#define TRACE_MOVE      0x0008   trace cursor moves and scrolls 
+#define TRACE_CHARPUT   0x0010   trace all character outputs 
+#define TRACE_ORDINARY  0x001F   trace all update actions 
+#define TRACE_CALLS     0x0020   trace all curses calls 
+#define TRACE_VIRTPUT   0x0040   trace virtual character puts 
+#define TRACE_IEVENT    0x0080   trace low-level input processing 
+#define TRACE_BITS      0x0100   trace state of TTY control bits 
+#define TRACE_ICALLS    0x0200   trace internal/nested calls 
+#define TRACE_CCALLS    0x0400   trace per-character calls 
+#define TRACE_DATABASE  0x0800   trace read/write of terminfo/termcap data 
+#define TRACE_MAXIMUM   0xffff   maximum trace level 
+*/
+/*  
+  static const name_attribute_pair nap[] = {
+    {"Times",               TRACE_TIMES},
+    {"Tputs",               TRACE_TPUTS},
+    {"Update",              TRACE_UPDATE},
+    {"Cursor_Move",         TRACE_MOVE},
+    {"Character_Output",    TRACE_CHARPUT},
+    {"Calls",               TRACE_CALLS},
+    {"Vitual_Puts",         TRACE_VIRTPUT},
+    {"Input_Events",        TRACE_IEVENT},
+    {"TTY_State",           TRACE_BITS},
+    {"Internal_Calls",      TRACE_ICALLS},
+    {"Character_Calls",     TRACE_CCALS},
+    {"Termcap_TermInfo",    TRACE_DATABASE},
+    {(char *)0,                0}
+  }; */
+  /*                      2 bytes */
+  /* gen_reps (nap, name, 2 , 0); */
+  1;
+}
+
 static void gen_menu_opt_rep(const char *name)
 {
   static const name_attribute_pair nap[] = {
@@ -940,6 +981,9 @@
 #ifdef ALL_MOUSE_EVENTS
   GEN_MEVENT(ALL_MOUSE_EVENTS);
 #endif
+#ifdef REPORT_MOUSE_POSITION
+  GEN_MEVENT(REPORT_MOUSE_POSITION);
+#endif   
 
 GEN_EVENT(BUTTON1_EVENTS,all1);
 GEN_EVENT(BUTTON2_EVENTS,all2);
@@ -1015,11 +1059,21 @@
   printf("   %-8s : constant Color_Number := %d;\n",name,value);
 }
 
+
+/* #ifdef HAVE_CONFIG_H */ 
+/* #include <ncurses_cfg.h> */ /* For HAVE_USE_DEFAULT_COLORS */
+/* #endif */
+/* Oh well I can't figure it out. */
+#define HAVE_USE_DEFAULT_COLORS 1
+
 /*
  * Generate all color definitions
  */
 static void gen_color (void)
 {
+#ifdef HAVE_USE_DEFAULT_COLORS
+  color_def ("Default",-1);
+#endif
 #ifdef COLOR_BLACK
   color_def ("Black",COLOR_BLACK);
 #endif
@@ -1148,6 +1202,134 @@
   printf("   type Curses_Bool is mod 2 ** Interfaces.C.%s'Size;\n",s_bool);
 }
 
+#include <limits.h>
+
+static void 
+add1( const char *s1 ,  char *s2 )
+{
+  printf("\t%10s : %s;\n", s2, s1);
+}
+
+static void 
+add2( size_t size,  char *s1, size_t pos)
+{
+  /*const int bytesize = 8;*/
+
+  printf("%16s                   at 0 range  %d ..  %d;\n",
+            s1, (pos)*CHAR_BIT, (pos + size)*CHAR_BIT - 1  );
+          
+}
+
+
+
+      /*  struct pdat
+        {
+            NCURSES_SIZE_T _pad_y,      _pad_x;
+            NCURSES_SIZE_T _pad_top,    _pad_left;
+            NCURSES_SIZE_T _pad_bottom, _pad_right;
+        } _pad;
+         */   
+
+static void
+gen_window_record(void)
+{
+  int count = 0;
+
+  puts("type pdat is record");
+       add1("Interfaces.C.short", "x_pad_y");
+       add1("Interfaces.C.short", "x_pad_x");
+       add1("Interfaces.C.short", "x_pad_top");
+       add1("Interfaces.C.short", "x_pad_left");
+       add1("Interfaces.C.short", "x_pad_bottom");
+       add1("Interfaces.C.short", "x_pad_right");
+  puts("end record;");
+  puts("pragma Pack(pdat);");
+  puts("pragma Convention (C, pdat);");
+
+  puts("for pdat use record");
+       add2(sizeof(NCURSES_SIZE_T), "x_pad_y", offsetof(struct pdat, _pad_y)); 
 
+       add2(sizeof(NCURSES_SIZE_T), "x_pad_x", offsetof(struct pdat, _pad_x)); 
 
+       add2(sizeof(NCURSES_SIZE_T), "x_pad_top", offsetof(struct pdat, 
_pad_top));  
+       add2(sizeof(NCURSES_SIZE_T), "x_pad_left", offsetof(struct pdat, 
_pad_left) );  
+       add2(sizeof(NCURSES_SIZE_T), "x_pad_bottom", offsetof(struct pdat, 
_pad_bottom) );  
+       add2(sizeof(NCURSES_SIZE_T), "x_pad_right", offsetof(struct pdat, 
_pad_right));  
+  puts("end record;");
+
+
+  count = 0;
+
+  puts("-- Identifiers cannot start with an underline\n");
+  puts("type Window_Record is record");
+       add1("Interfaces.C.short", "x_cury");  
+       add1("Interfaces.C.short", "x_curx");  
+       add1("Interfaces.C.short", "x_maxy");  
+       add1("Interfaces.C.short", "x_maxx");  
+       add1("Interfaces.C.short", "x_begy");  
+       add1("Interfaces.C.short", "x_begx");  
+       add1("Interfaces.C.short", "x_flags");  
+       add1("Interfaces.C.int", "x_attrs");  
+       add1("Interfaces.C.unsigned_long", "x_bkgd");  
+       add1("Interfaces.C.signed_char", "x_notimeout");  
+       add1("Interfaces.C.signed_char", "x_clear");  
+       add1("Interfaces.C.signed_char", "x_leaveok");  
+       add1("Interfaces.C.signed_char", "x_scroll");  
+       add1("Interfaces.C.signed_char", "x_idlok");  
+       add1("Interfaces.C.signed_char", "x_idcok");  
+       add1("Interfaces.C.signed_char", "x_immed");  
+       add1("Interfaces.C.signed_char", "x_sync");  
+       add1("Interfaces.C.signed_char", "x_use_keypad");  
+       add1("Interfaces.C.int", "x_delay");  
+       add1("System.Storage_Elements.Integer_Address", "x_line");  
+       add1("Interfaces.C.short", "x_regtop");  
+       add1("Interfaces.C.short", "x_regbottom");  
+       add1("Interfaces.C.int", "x_parx");  
+       add1("Interfaces.C.int", "x_pary");  
+       add1("System.Storage_Elements.Integer_Address", "x_parent");  
+       add1("pdat", "x_pad");  
+       add1("Interfaces.C.short", "x_yoffset");
+  puts("end record;");
+  puts("pragma Pack(Window_Record);");
+  puts("pragma Convention (C, Window_Record);");
+
+  puts("for Window_Record use record");
+       add2(sizeof(NCURSES_SIZE_T), "x_cury", offsetof(WINDOW, _cury));  
+       add2(sizeof(NCURSES_SIZE_T), "x_curx", offsetof(WINDOW, _curx));  
+       add2(sizeof(NCURSES_SIZE_T), "x_maxy", offsetof(WINDOW, _maxy));  
+       add2(sizeof(NCURSES_SIZE_T), "x_maxx", offsetof(WINDOW, _maxx));  
+       add2(sizeof(NCURSES_SIZE_T), "x_begy", offsetof(WINDOW, _begy));  
+       add2(sizeof(NCURSES_SIZE_T), "x_begx", offsetof(WINDOW, _begx));  
+       add2(sizeof(short), "x_flags", offsetof(WINDOW, _flags));  
+       add2(sizeof(attr_t), "x_attrs", offsetof(WINDOW, _attrs));  
+       add2(sizeof(chtype), "x_bkgd", offsetof(WINDOW, _bkgd));  
+       add2(sizeof(bool), "x_notimeout", offsetof(WINDOW, _notimeout));  
+       add2(sizeof(bool), "x_clear", offsetof(WINDOW, _clear));  
+       add2(sizeof(bool), "x_leaveok", offsetof(WINDOW, _leaveok));  
+       add2(sizeof(bool), "x_scroll", offsetof(WINDOW, _scroll));  
+       add2(sizeof(bool), "x_idlok", offsetof(WINDOW, _idlok));  
+       add2(sizeof(bool), "x_idcok", offsetof(WINDOW, _idcok));  
+       add2(sizeof(bool), "x_immed", offsetof(WINDOW, _immed));  
+       add2(sizeof(bool), "x_sync", offsetof(WINDOW, _sync));  
+       add2(sizeof(bool), "x_use_keypad", offsetof(WINDOW, _use_keypad));  
+       add2(sizeof(int), "x_delay", offsetof(WINDOW, _delay));  
+       add2(sizeof(struct ldat *), "x_line", offsetof(WINDOW, _line));  
+       add2(sizeof(NCURSES_SIZE_T), "x_regtop", offsetof(WINDOW, _regtop));  
+       add2(sizeof(NCURSES_SIZE_T), "x_regbottom", offsetof(WINDOW, 
_regbottom));  
+       add2(sizeof(int), "x_parx", offsetof(WINDOW, _parx));  
+       add2(sizeof(int), "x_pary", offsetof(WINDOW, _pary));  
+       add2(sizeof(WINDOW *), "x_parent", offsetof(WINDOW, _parent));  
+       add2(sizeof(struct pdat), "x_pad", offsetof(WINDOW, _pad));  
+       add2(sizeof(NCURSES_SIZE_T), "x_yoffset", offsetof(WINDOW, _yoffset));  
+  puts("end record;\n");
+
+  puts("type ldat is record\n");
+  puts("  text : System.Storage_Elements.Integer_Address;\n");
+  puts("  firstchar : Interfaces.C.short;\n");
+  puts("  lastchar : Interfaces.C.short;\n");
+  puts("  oldindex : Interfaces.C.short;\n");
+  puts("end record;\n");
+
+}
+
 /*
  * main() expects two arguments on the commandline, both single characters.
  * The first character denotes the facility for which we generate output.
@@ -1212,6 +1394,12 @@
        case 'V': /* generate version info */
          gen_version_info();
          break;
+       case 'T': /* generate the Trace stuff */
+         gen_trace();
+         break;
+       case 'X':
+         gen_window_record(); /* like D but make a record */
+         break; 
        default:
          break;
        }
diff -u --recursive 
ncurses-5.2/Ada95/gen/terminal_interface-curses-forms.ads.m4 
ncurses-5.2.new/Ada95/gen/terminal_interface-curses-forms.ads.m4
--- ncurses-5.2/Ada95/gen/terminal_interface-curses-forms.ads.m4        Wed Oct 
18 05:28:19 2000
+++ ncurses-5.2.new/Ada95/gen/terminal_interface-curses-forms.ads.m4    Sat Oct 
28 18:56:13 2000
@@ -685,6 +685,9 @@
    --  AKA
    pragma Inline (Is_New_Page);
 
+   --  MANPAGE(`form_requestname.3x')
+   --  Not Implemented: form_request_name, form_request_by_name
+
 ------------------------------------------------------------------------------
 private
    type Field is new System.Storage_Elements.Integer_Address;
diff -u --recursive 
ncurses-5.2/Ada95/gen/terminal_interface-curses-menus.ads.m4 
ncurses-5.2.new/Ada95/gen/terminal_interface-curses-menus.ads.m4
--- ncurses-5.2/Ada95/gen/terminal_interface-curses-menus.ads.m4        Wed Oct 
18 05:28:19 2000
+++ ncurses-5.2.new/Ada95/gen/terminal_interface-curses-menus.ads.m4    Sat Oct 
28 18:56:13 2000
@@ -473,6 +473,13 @@
    procedure Set_Format (Men     : in Menu;
                          Lines   : in Line_Count;
                          Columns : in Column_Count);
+   -- Not implemented: 0 argument for Lines or Columns; 
+   -- instead use Format to get the current sizes
+--      The  default  format  is  16  rows,  1  column.    Calling
+--      set_menu_format  with a null menu pointer will change this
+--      default.  A zero row or column argument to set_menu_format
+--      is  interpreted  as  a  request  not to change the current
+--      value.
    --  AKA
    pragma Inline (Set_Format);
 
@@ -570,7 +577,7 @@
    --  Reset Men to Null_Menu
    --  Not inlined
 
-   --  MANPAGE(`menu_new.3x')
+   --  MANPAGE(`menu_driver.3x')
 
    type Driver_Result is (Menu_Ok,
                           Request_Denied,
@@ -582,6 +589,9 @@
                     Key : Key_Code) return Driver_Result;
    --  AKA
    --  Driver is not inlined
+
+   --  ANCHOR(`menu_requestname.3x')
+   --  Not Implemented: menu_request_name, menu_request_by_name
 
 -------------------------------------------------------------------------------
 private
diff -u --recursive 
ncurses-5.2/Ada95/gen/terminal_interface-curses-mouse.ads.m4 
ncurses-5.2.new/Ada95/gen/terminal_interface-curses-mouse.ads.m4
--- ncurses-5.2/Ada95/gen/terminal_interface-curses-mouse.ads.m4        Mon Jun 
14 21:20:53 1999
+++ ncurses-5.2.new/Ada95/gen/terminal_interface-curses-mouse.ads.m4    Sat Oct 
28 19:04:39 2000
@@ -52,6 +52,9 @@
    --  is still marked as experimental. So also this binding will change
    --  if the ncurses methods change.
    --
+   --  Not Implemented: mouse_trafo, wmouse_trafo, 
+   --  REPORT_MOUSE_POSITION (i.e. as a parameter to Register_Reportable_Event
+   --  or Start_Mouse)
    type Event_Mask is private;
    No_Events  : constant Event_Mask;
    All_Events : constant Event_Mask;
@@ -107,6 +110,8 @@
    --  ANCHOR(`mousemask()',`Start_Mouse')
    --  There is one difference to mousmask(): we return the value of the
    --  old mask, that means the event mask value before this call.
+   --  Not Implemented: The library version
+   --  returns a Mouse_Mask that tells which events are reported.
    function Start_Mouse (Mask : Event_Mask := All_Events)
                          return Event_Mask;
    --  AKA
@@ -128,6 +133,8 @@
                         State  : out Button_State);
    --  !!! Warning: X and Y are screen coordinates. Due to ripped of lines they
    --  may not be identical to window coordinates.
+   --  Not Implemented: Get_Event ony reports one event, the C library
+   --  version supports multiple events, e.g. {click-1, click-3}
    pragma Inline (Get_Event);
 
    --  ANCHOR(`ungetmouse()',`Unget_Mouse')
diff -u --recursive ncurses-5.2/Ada95/gen/terminal_interface-curses.ads.m4 
ncurses-5.2.new/Ada95/gen/terminal_interface-curses.ads.m4
--- ncurses-5.2/Ada95/gen/terminal_interface-curses.ads.m4      Sat May 27 
17:39:54 2000
+++ ncurses-5.2.new/Ada95/gen/terminal_interface-curses.ads.m4  Sat Oct 28 
18:56:13 2000
@@ -95,7 +95,7 @@
 
 ------------------------------------------------------------------------------
 
-   type Color_Number is range 0 .. Integer (Interfaces.C.short'Last);
+   type Color_Number is range -1 .. Integer (Interfaces.C.short'Last);
    for Color_Number'Size use Interfaces.C.short'Size;
    --  (n)curses uses a short for the color index
    --  The model is, that a Color_Number is an index into an array of
@@ -198,7 +198,7 @@
 include(`ACS_Map')dnl
 
    --  MANPAGE(`curs_initscr.3x')
-   --  | Not implemented: newterm, set_term, delscreen
+   --  | Not implemented: newterm, set_term, delscreen, curscr
 
    --  ANCHOR(`stdscr',`Standard_Window')
    function Standard_Window return Window;
@@ -233,6 +233,7 @@
                           Line   : in Line_Position;
                           Column : in Column_Position);
    --  AKA
+   --  ALIAS(`move()')
    pragma Inline (Move_Cursor);
 
    --  MANPAGE(`curs_addch.3x')
@@ -241,6 +242,7 @@
    procedure Add (Win :  in Window := Standard_Window;
                   Ch  :  in Attributed_Character);
    --  AKA
+   --  ALIAS(`addch()')
 
    procedure Add (Win :  in Window := Standard_Window;
                   Ch  :  in Character);
@@ -254,6 +256,7 @@
       Column : in Column_Position;
       Ch     : in Attributed_Character);
    --  AKA
+   --  ALIAS(`mvaddch()')
 
    procedure Add
      (Win    : in Window := Standard_Window;
@@ -268,6 +271,7 @@
      (Win : in Window := Standard_Window;
       Ch  : in Attributed_Character);
    --  AKA
+   --  ALIAS(`echochar()')
 
    procedure Add_With_Immediate_Echo
      (Win : in Window := Standard_Window;
@@ -277,6 +281,8 @@
 
    --  MANPAGE(`curs_window.3x')
 
+   --  Not Implemented: wcursyncup
+
    --  ANCHOR(`newwin()',`Create')
    function Create
      (Number_Of_Lines       : Line_Count;
@@ -284,6 +290,8 @@
       First_Line_Position   : Line_Position;
       First_Column_Position : Column_Position) return Window;
    --  AKA
+   --  Not Implemented: Default Number_Of_Lines, Number_Of_Columns 
+   --  the C version lets them be 0, see the man page.
    pragma Inline (Create);
 
    function New_Window
@@ -363,6 +371,8 @@
                   Len : in Integer := -1);
    --  AKA
    --  ALIAS(`waddstr()')
+   --  ALIAS(`addnstr()')
+   --  ALIAS(`addstr()')
 
    --  ANCHOR(`mvwaddnstr()',`Add')
    procedure Add (Win    : in Window := Standard_Window;
@@ -372,6 +382,8 @@
                   Len    : in Integer := -1);
    --  AKA
    --  ALIAS(`mvwaddstr()')
+   --  ALIAS(`mvaddnstr()')
+   --  ALIAS(`mvaddstr()')
 
    --  MANPAGE(`curs_addchstr.3x')
 
@@ -381,6 +393,8 @@
                   Len : in Integer := -1);
    --  AKA
    --  ALIAS(`waddchstr()')
+   --  ALIAS(`addchnstr()')
+   --  ALIAS(`addchstr()')
 
    --  ANCHOR(`mvwaddchnstr()',`Add')
    procedure Add (Win    : in Window := Standard_Window;
@@ -390,10 +404,15 @@
                   Len    : in Integer := -1);
    --  AKA
    --  ALIAS(`mvwaddchstr()')
+   --  ALIAS(`mvaddchnstr()')
+   --  ALIAS(`mvaddchstr()')
    pragma Inline (Add);
 
    --  MANPAGE(`curs_border.3x')
 
+   -- | Not implemented: mvhline,  mvwhline, mvvline, mvwvline
+   -- | use Move_Cursor then Horizontal_Line or Vertical_Line
+
    --  ANCHOR(`wborder()',`Border')
    procedure Border
      (Win                       : in Window := Standard_Window;
@@ -407,6 +426,7 @@
       Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character
      );
    --  AKA
+   --  ALIAS(`border()')
    pragma Inline (Border);
 
    --  ANCHOR(`box()',`Box')
@@ -423,6 +443,7 @@
       Line_Size   : in Natural;
       Line_Symbol : in Attributed_Character := Default_Character);
    --  AKA
+   --  ALIAS(`hline()')
    pragma Inline (Horizontal_Line);
 
    --  ANCHOR(`wvline()',`Vertical_Line')
@@ -431,14 +452,18 @@
       Line_Size   : in Natural;
       Line_Symbol : in Attributed_Character := Default_Character);
    --  AKA
+   --  ALIAS(`vline()')
    pragma Inline (Vertical_Line);
 
    --  MANPAGE(`curs_getch.3x')
 
+   --  Not implemented: mvgetch, mvwgetch
+
    --  ANCHOR(`wgetch()',`Get_Keystroke')
    function Get_Keystroke (Win : Window := Standard_Window)
                            return Real_Key_Code;
    --  AKA
+   --  ALIAS(`getch()')
    --  Get a character from the keyboard and echo it - if enabled - to the
    --  window.
    --  If for any reason (i.e. a timeout) we couldn't get a character the
@@ -475,14 +500,32 @@
    pragma Inline (Function_Key_Code);
 
    --  MANPAGE(`curs_attr.3x')
+   --  | Not implemented attr_off,  wattr_off,
+   --  |  attr_on, wattr_on, attr_set, wattr_set 
+
+   -- PAIR_NUMBER
+   -- PAIR_NUMBER(c) is the same as c.Color
+
+   --  ANCHOR(`standout()',`Standout')
+   procedure Standout(win : Window := Standard_Window);
+   --  ALIAS(`wstandout()')
+   --  Note: to fit the idiom of this binding perhaps these should be one 
+   --  function, standout(win : Window; On : Boolean := True)  ?
+
+   --  ANCHOR(`standend()',`Standout_End')
+   procedure Standout_End(win : Window := Standard_Window);
+   --  ALIAS(`wstandend()')
 
    --  ANCHOR(`wattron()',`Switch_Character_Attribute')
    procedure Switch_Character_Attribute
      (Win  : in Window := Standard_Window;
       Attr : in Character_Attribute_Set := Normal_Video;
       On   : in Boolean := True); --  if False we switch Off.
+   --  Switches those Attributes set to true in the list.
    --  AKA
    --  ALIAS(`wattroff()')
+   --  ALIAS(`attron()')
+   --  ALIAS(`attroff()')
 
    --  ANCHOR(`wattrset()',`Set_Character_Attributes')
    procedure Set_Character_Attributes
@@ -490,6 +533,7 @@
       Attr  : in Character_Attribute_Set := Normal_Video;
       Color : in Color_Pair := Color_Pair'First);
    --  AKA
+   --  ALIAS(`attrset()')
    pragma Inline (Set_Character_Attributes);
 
    --  ANCHOR(`wattr_get()',`Get_Character_Attributes')
@@ -501,12 +545,14 @@
    function Get_Character_Attribute
      (Win : in Window := Standard_Window) return Color_Pair;
    --  AKA
+   --  ALIAS(`attr_get()')
    pragma Inline (Get_Character_Attribute);
 
    --  ANCHOR(`wcolor_set()',`Set_Color')
    procedure Set_Color (Win  : in Window := Standard_Window;
                         Pair : in Color_Pair);
    --  AKA
+   --  ALIAS(`color_set()')
    pragma Inline (Set_Color);
 
    --  ANCHOR(`wchgat()',`Change_Attributes')
@@ -516,6 +562,7 @@
       Attr  : in Character_Attribute_Set := Normal_Video;
       Color : in Color_Pair := Color_Pair'First);
    --  AKA
+   --  ALIAS(`chgat()')
 
    --  ANCHOR(`mvwchgat()',`Change_Attributes')
    procedure Change_Attributes
@@ -526,6 +573,7 @@
       Attr   : in Character_Attribute_Set := Normal_Video;
       Color  : in Color_Pair := Color_Pair'First);
    --  AKA
+   --  ALIAS(`mvchgat()')
    pragma Inline (Change_Attributes);
 
    --  MANPAGE(`curs_beep.3x')
@@ -610,6 +658,7 @@
                                Mode   : in Timeout_Mode;
                                Amount : in Natural); --  in Milliseconds
    --  AKA
+   --  ALIAS(`timeout()')
    --  Instead of overloading the semantic of the sign of amount, we
    --  introduce the Timeout_Mode parameter. This should improve
    --  readability. For Blocking and Non_Blocking, the Amount is not
@@ -683,6 +732,7 @@
       Top_Line    : in Line_Position;
       Bottom_Line : in Line_Position);
    --  AKA
+   --  ALIAS(`setscrreg()')
    pragma Inline (Set_Scroll_Region);
 
    --  MANPAGE(`curs_refresh.3x')
@@ -697,6 +747,7 @@
    --  AKA
    --  There is an overloaded Refresh for Pads.
    --  The Inline pragma appears there
+   --  ALIAS(`refresh()')
 
    --  ANCHOR(`wnoutrefresh()',`Refresh_Without_Update')
    procedure Refresh_Without_Update
@@ -721,33 +772,41 @@
    --  ANCHOR(`werase()',`Erase')
    procedure Erase (Win : in Window := Standard_Window);
    --  AKA
+   --  ALIAS(`erase()')
    pragma Inline (Erase);
 
    --  ANCHOR(`wclear()',`Clear')
    procedure Clear
      (Win : in Window := Standard_Window);
    --  AKA
+   --  ALIAS(`clear()')
    pragma Inline (Clear);
 
    --  ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen')
    procedure Clear_To_End_Of_Screen
      (Win : in Window := Standard_Window);
    --  AKA
+   --  ALIAS(`clrtobot()')
    pragma Inline (Clear_To_End_Of_Screen);
 
    --  ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line')
    procedure Clear_To_End_Of_Line
      (Win : in Window := Standard_Window);
    --  AKA
+   --  ALIAS(`clrtoeol()')
    pragma Inline (Clear_To_End_Of_Line);
 
    --  MANPAGE(`curs_bkgd.3x')
 
+   --  TODO: we could have Set_Background(Window; Character_Attribute_Set)
+   --  because in C it is common to see bkgdset(A_BOLD) or
+   --  bkgdset(COLOR_PAIR(n))
    --  ANCHOR(`wbkgdset()',`Set_Background')
    procedure Set_Background
      (Win : in Window := Standard_Window;
       Ch  : in Attributed_Character);
    --  AKA
+   --  ALIAS(`bkgdset()')
    pragma Inline (Set_Background);
 
    --  ANCHOR(`wbkgd()',`Change_Background')
@@ -755,12 +814,16 @@
      (Win : in Window := Standard_Window;
       Ch  : in Attributed_Character);
    --  AKA
+   --  ALIAS(`bkgd()')
    pragma Inline (Change_Background);
 
    --  ANCHOR(`wbkgdget()',`Get_Background')
+   --  ? wbkgdget is not listed in curs_bkgd, getbkgd is thpough.
    function Get_Background (Win : Window := Standard_Window)
      return Attributed_Character;
    --  AKA
+   --  ALIAS(`bkgdget()')
+
    pragma Inline (Get_Background);
 
    --  MANPAGE(`curs_touch.3x')
@@ -834,16 +897,19 @@
      (Win   : in Window  := Standard_Window;
       Lines : in Integer := 1); --  default is to insert one line above
    --  AKA
+   --  ALIAS(`insdelln()')
    pragma Inline (Insert_Delete_Lines);
 
    --  ANCHOR(`wdeleteln()',`Delete_Line')
    procedure Delete_Line (Win : in Window := Standard_Window);
    --  AKA
+   --  ALIAS(`deleteln()')
    pragma Inline (Delete_Line);
 
    --  ANCHOR(`winsertln()',`Insert_Line')
    procedure Insert_Line (Win : in Window := Standard_Window);
    --  AKA
+   --  ALIAS(`insertln()')
    pragma Inline (Insert_Line);
 
    --  MANPAGE(`curs_getyx.3x')
@@ -942,6 +1008,8 @@
    procedure Scroll (Win    : in Window  := Standard_Window;
                      Amount : in Integer := 1);
    --  AKA
+   --  ALIAS(`scroll()')
+   --  ALIAS(`scrl()')
    pragma Inline (Scroll);
 
    --  MANPAGE(`curs_delch.3x')
@@ -949,6 +1017,7 @@
    --  ANCHOR(`wdelch()',`Delete_Character')
    procedure Delete_Character (Win : in Window := Standard_Window);
    --  AKA
+   --  ALIAS(`delch()')
 
    --  ANCHOR(`mvwdelch()',`Delete_Character')
    procedure Delete_Character
@@ -956,6 +1025,7 @@
       Line   : in Line_Position;
       Column : in Column_Position);
    --  AKA
+   --  ALIAS(`mvdelch()')
    pragma Inline (Delete_Character);
 
    --  MANPAGE(`curs_inch.3x')
@@ -964,6 +1034,7 @@
    function Peek (Win : Window := Standard_Window)
      return Attributed_Character;
    --  AKA
+   --  ALIAS(`inch()')
 
    --  ANCHOR(`mvwinch()',`Peek')
    function Peek
@@ -971,14 +1042,16 @@
       Line   : Line_Position;
       Column : Column_Position) return Attributed_Character;
    --  AKA
+   --  ALIAS(`mvinch()')
    --  More Peek's follow, pragma Inline appears later.
 
-   --  MANPAGE(`curs_winch.3x')
+   --  MANPAGE(`curs_insch.3x')
 
    --  ANCHOR(`winsch()',`Insert')
    procedure Insert (Win : in Window := Standard_Window;
                      Ch  : in Attributed_Character);
    --  AKA
+   --  ALIAS(`insch()')
 
    --  ANCHOR(`mvwinsch()',`Insert')
    procedure Insert (Win    : in Window := Standard_Window;
@@ -986,8 +1059,9 @@
                      Column : in Column_Position;
                      Ch     : in Attributed_Character);
    --  AKA
+   --  ALIAS(`mvinsch()')
 
-   --  MANPAGE(`curs_winch.3x')
+   --  MANPAGE(`curs_insstr.3x')
 
    --  ANCHOR(`winsnstr()',`Insert')
    procedure Insert (Win : in Window := Standard_Window;
@@ -995,6 +1069,8 @@
                      Len : in Integer := -1);
    --  AKA
    --  ALIAS(`winsstr()')
+   --  ALIAS(`insnstr()')
+   --  ALIAS(`insstr()')
 
    --  ANCHOR(`mvwinsnstr()',`Insert')
    procedure Insert (Win    : in Window := Standard_Window;
@@ -1004,6 +1080,8 @@
                      Len    : in Integer := -1);
    --  AKA
    --  ALIAS(`mvwinsstr()')
+   --  ALIAS(`mvinsnstr()')
+   --  ALIAS(`mvinsstr()')
    pragma Inline (Insert);
 
    --  MANPAGE(`curs_instr.3x')
@@ -1014,6 +1092,8 @@
                    Len : in  Integer := -1);
    --  AKA
    --  ALIAS(`winstr()')
+   --  ALIAS(`innstr()')
+   --  ALIAS(`instr()')
 
    --  ANCHOR(`mvwinnstr()',`Peek')
    procedure Peek (Win    : in  Window := Standard_Window;
@@ -1023,6 +1103,8 @@
                    Len    : in  Integer := -1);
    --  AKA
    --  ALIAS(`mvwinstr()')
+   --  ALIAS(`mvinnstr()')
+   --  ALIAS(`mvinstr()')
 
    --  MANPAGE(`curs_inchstr.3x')
 
@@ -1032,6 +1114,8 @@
                    Len : in  Integer := -1);
    --  AKA
    --  ALIAS(`winchstr()')
+   --  ALIAS(`inchnstr()')
+   --  ALIAS(`inchstr()')
 
    --  ANCHOR(`mvwinchnstr()',`Peek')
    procedure Peek (Win    : in  Window := Standard_Window;
@@ -1041,6 +1125,8 @@
                    Len    : in  Integer := -1);
    --  AKA
    --  ALIAS(`mvwinchstr()')
+   --  ALIAS(`mvinchnstr()')
+   --  ALIAS(`mvinchstr()')
    --  We don't inline the Peek procedures
 
    --  MANPAGE(`curs_getstr.3x')
@@ -1051,19 +1137,27 @@
                   Len : in  Integer := -1);
    --  AKA
    --  ALIAS(`wgetstr()')
+   --  ALIAS(`getnstr()')
+   --  ALIAS(`getstr()')
+   --  actually getstr is not supported because that results in buffer
+   --  overflows.
 
+   --  ANCHOR(`mvwgetnstr()',`Get')
    procedure Get (Win    : in  Window := Standard_Window;
                   Line   : in  Line_Position;
                   Column : in  Column_Position;
                   Str    : out String;
                   Len    : in  Integer := -1);
    --  AKA
-   --  not specified in ncurses, should be: mvwgetnstr()
-   --       and mvwgetstr() (which exists)
+   --  ALIAS(`mvwgetstr()')
+   --  ALIAS(`mvgetnstr()')
+   --  ALIAS(`mvgetstr()')
    --  Get is not inlined
 
    --  MANPAGE(`curs_slk.3x')
 
+   --  Not Implemented: slk_attr_on, slk_attr_off, slk_attr_set
+
    type Soft_Label_Key_Format is (Three_Two_Three,
                                   Four_Four,
                                   PC_Style,              --  ncurses specific
@@ -1149,6 +1243,10 @@
    --  AKA
    pragma Inline (Set_Soft_Label_Key_Color);
 
+   --  MANPAGE(`keybound.3x')
+
+   --  Not Implemented: keybound
+
    --  MANPAGE(`keyok.3x')
 
    --  ANCHOR(`keyok()',`Enable_Key')
@@ -1168,7 +1266,7 @@
    --  MANPAGE(`curs_util.3x')
 
    --  | Not implemented : filter, use_env, putwin, getwin
-   --
+
    --  ANCHOR(`keyname()',`Key_Name')
    procedure Key_Name (Key  : in  Real_Key_Code;
                        Name : out String);
@@ -1256,6 +1354,12 @@
 
    --  MANPAGE(`curs_color.3x')
 
+   -- COLOR_PAIR
+   -- COLOR_PAIR(n) in C is the same as 
+   --  Attributed_Character(Ch => Nul, Color => n, Attr => Normal_Video)
+   -- In C you often see something like c = c | COLOR_PAIR(n); 
+   -- This is equivalent to c.Color := n;
+
    --  ANCHOR(`start_color()',`Start_Color')
    procedure Start_Color;
    --  AKA
@@ -1304,7 +1408,8 @@
    --  MANPAGE(`curs_kernel.3x')
 
    --  | Not implemented: getsyx, setsyx
-   --
+   -- 
+
    type Curses_Mode is (Curses, Shell);
 
    --  ANCHOR(`def_prog_mode()',`Save_Curses_Mode')
@@ -1375,6 +1480,127 @@
    --  Window or if you pass the Null_Window as argument.
    --  We don't inline this procedure
 
+   --  MANPAGE(`dft_fgbg.3x')
+
+   --  ANCHOR(`use_default_colors()',`Use_Default_Colors')
+   function Use_Default_Colors return Boolean;
+   --  AKA 
+   pragma Inline (Use_Default_Colors);
+
+   --  ANCHOR(`assume_default_colors()',`Assume_Default_Colors')
+   function Assume_Default_Colors(Fore : Color_Number;
+                                 Back : Color_Number) return Boolean;
+   --  AKA 
+   pragma Inline (Assume_Default_Colors);
+
+   --  MANPAGE(`curs_extend.3x')
+
+   --  ANCHOR(`curses_version()',`Curses_Version')
+   function Curses_Version return String;
+   --  AKA
+
+   --  ANCHOR(`use_extended_names()',`Use_Extended_Names')
+   --   the return val is not explained in the man page. Weird.
+   function Use_Extended_Names(Enable : Boolean) return Integer;
+   --  AKA
+
+   --  MANPAGE(`curs_scr_dump.3x')
+
+   --  ANCHOR(`scr_dump()',`Screen_Dump_To_File')
+   function Screen_Dump_To_File (Filename : String) return Boolean;
+   --  AKA
+
+   --  ANCHOR(`scr_restore()',`Screen_Restore_From_File')
+   function Screen_Restore_From_File (Filename : String) return Boolean;
+   --  AKA
+
+   --  ANCHOR(`scr_init()',`Screen_Init_From_File')
+   function Screen_Init_From_File (Filename : String) return Boolean;
+   --  AKA
+
+   --  ANCHOR(`scr_set()',`Screen_Set_File')
+   function Screen_Set_File (Filename : String) return Boolean;
+   --  AKA
+
+
+   --  MANPAGE(`curs_termcap.3x')
+   --  Not implemented:  tgoto, tputs (see curs_terminfo)
+
+   type Termcap_String is new String;
+
+   --  ANCHOR(`tgoto()', `Termcap_Goto')
+   function Termcap_Goto(cap : String; col : Column_Position; 
+               row : Line_Position) return Termcap_String;
+   --  AKA
+
+   --  ANCHOR(`tgetent()',`Termcap_Get_Entry')
+   procedure Termcap_Get_Entry (Name : String; Found : out Boolean);
+   --  AKA
+
+   --  ANCHOR(`tgetflag()',`Termcap_Get_Flag')
+   procedure Termcap_Get_Flag (Name : String; Val : out Boolean);
+   --  AKA
+
+   --  ANCHOR(`tgetnum()',`Termcap_Get_Number')
+   procedure Termcap_Get_Number (Name : String; Val : out Integer; Result :
+   out Boolean);
+   --  AKA
+
+   --  ANCHOR(`tgetstr()',`Termcap_Get_String')
+   procedure Termcap_Get_String (Name : String; Value : out String; b : out 
Boolean);
+   function Termcap_Get_String (Name : String) return Boolean;
+   --  Returns True if the string is found.
+   --  AKA
+
+   --  MANPAGE(`curs_print.3x')
+   --  Not implemented:  mcprint
+
+   --  MANPAGE(`curs_printw.3x')
+   --  Not implemented: printw,  wprintw, mvprintw, mvwprintw, vwprintw, 
vw_printw
+
+
+
+   --  MANPAGE(`curs_scanw.3x')
+   --  Not implemented: scanw, wscanw, mvscanw, mvwscanw, vwscanw, vw_scanw
+
+
+   --  MANPAGE(`curs_terminfo.3x')
+   --  Not implemented:  setupterm, setterm, set_curterm, del_curterm, 
restartterm,
+   --  tparm, putp, vidputs,  vidattr,  mvcur,  tigetflag
+
+
+   --  ANCHOR(`tigetstr()',`Terminfo_Get_String')
+-- I wanted to do this 
+-- function Terminfo_Get_String (Name : String; Value : out String) return 
Boolean;
+   procedure Terminfo_Get_String (Name : String; Value : out Termcap_String; b 
: out Boolean);
+   function Terminfo_Has_String (Name : String) return Boolean;
+   --  AKA
+
+   --  ANCHOR(`tigetnum()',`Terminfo_Get_Number')
+   function Terminfo_Get_Number (Name : String) return Integer;
+   --  AKA
+
+
+   type putctype is access function (c : Integer) return Integer;
+
+   --  ANCHOR(`tputs()',`Term_Put_String')
+   procedure Term_Put_String(str : Termcap_String; affcnt : Natural;
+       putc : putctype);
+   --  AKA
+   --  Interestingly, the result of putc does not appear to be used
+   --  in the C library source code.
+   
+   --  MANPAGE(`resizeterm.3x')
+   --  Not Implemented: resizeterm
+
+   --  MANPAGE(`wresize.3x')
+
+   --  ANCHOR(`wresize()',`Resize')
+   procedure Resize(
+                Win : Window := Standard_Window;
+                Number_Of_Lines : Line_Count;
+                Number_Of_Columns : Column_Count);
+   --  AKA
 private
    type Window is new System.Storage_Elements.Integer_Address;
    Null_Window : constant Window := 0;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]