From 3a9b6a3bf0269231bef7de74757a910dedd04e0c Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Wed, 14 May 1997 23:00:00 -0500 Subject: [PATCH] ncurses 4.1 --- ANNOUNCE | 231 + Ada95/Makefile.in | 56 + Ada95/README | 29 + Ada95/TODO | 25 + Ada95/ada_include/Makefile.in | 207 + .../terminal_interface-curses-aux.adb | 81 + .../terminal_interface-curses-aux.ads | 90 + ...erface-curses-forms-choice_field_types.adb | 88 + ...erface-curses-forms-choice_field_types.ads | 46 + ...nal_interface-curses-forms-field_types.adb | 182 + ...nal_interface-curses-forms-field_types.ads | 50 + ...interface-curses-forms-field_user_data.adb | 81 + ..._interface-curses-forms-form_user_data.adb | 68 + .../terminal_interface-curses-forms.adb | 1693 ++ ..._interface-curses-menus-item_user_data.adb | 57 + ..._interface-curses-menus-menu_user_data.adb | 67 + .../terminal_interface-curses-menus.adb | 984 ++ .../terminal_interface-curses-mouse.adb | 152 + ...inal_interface-curses-panels-user_data.adb | 58 + .../terminal_interface-curses-panels.adb | 150 + .../terminal_interface-curses-text_io-aux.adb | 114 + .../terminal_interface-curses-text_io-aux.ads | 40 + ...al_interface-curses-text_io-complex_io.adb | 59 + ...al_interface-curses-text_io-complex_io.ads | 56 + ...al_interface-curses-text_io-decimal_io.adb | 61 + ...al_interface-curses-text_io-decimal_io.ads | 52 + ...nterface-curses-text_io-enumeration_io.adb | 66 + ...nterface-curses-text_io-enumeration_io.ads | 49 + ...inal_interface-curses-text_io-fixed_io.adb | 61 + ...inal_interface-curses-text_io-fixed_io.ads | 52 + ...inal_interface-curses-text_io-float_io.adb | 62 + ...inal_interface-curses-text_io-float_io.ads | 52 + ...al_interface-curses-text_io-integer_io.adb | 56 + ...al_interface-curses-text_io-integer_io.ads | 49 + ...al_interface-curses-text_io-modular_io.adb | 56 + ...al_interface-curses-text_io-modular_io.ads | 49 + .../terminal_interface-curses-text_io.adb | 327 + .../terminal_interface-curses-text_io.ads | 124 + .../ada_include/terminal_interface-curses.adb | 2271 +++ Ada95/ada_include/terminal_interface.ads | 31 + Ada95/gen/Makefile.in | 285 + Ada95/gen/gen.c | 977 ++ Ada95/gen/normal.m4 | 8 + ...erface-curses-forms-field_user_data.ads.m4 | 59 + ...terface-curses-forms-form_user_data.ads.m4 | 60 + .../terminal_interface-curses-forms.ads.m4 | 812 + ...terface-curses-menus-item_user_data.ads.m4 | 54 + ...terface-curses-menus-menu_user_data.ads.m4 | 59 + .../terminal_interface-curses-menus.ads.m4 | 519 + .../terminal_interface-curses-mouse.ads.m4 | 125 + ...l_interface-curses-panels-user_data.ads.m4 | 50 + .../terminal_interface-curses-panels.ads.m4 | 120 + Ada95/gen/terminal_interface-curses.ads.m4 | 1187 ++ Ada95/html/Makefile | 19 + Ada95/html/curs_addch.3x.html | 176 + Ada95/html/curs_addchstr.3x.html | 70 + Ada95/html/curs_addstr.3x.html | 70 + Ada95/html/curs_attr.3x.html | 172 + Ada95/html/curs_beep.3x.html | 70 + Ada95/html/curs_bkgd.3x.html | 122 + Ada95/html/curs_border.3x.html | 120 + Ada95/html/curs_clear.3x.html | 122 + Ada95/html/curs_color.3x.html | 226 + Ada95/html/curs_delch.3x.html | 70 + Ada95/html/curs_deleteln.3x.html | 70 + Ada95/html/curs_getch.3x.html | 226 + Ada95/html/curs_getstr.3x.html | 122 + Ada95/html/curs_getyx.3x.html | 70 + Ada95/html/curs_inch.3x.html | 68 + Ada95/html/curs_inchstr.3x.html | 70 + Ada95/html/curs_initscr.3x.html | 122 + Ada95/html/curs_inopts.3x.html | 226 + Ada95/html/curs_insch.3x.html | 70 + Ada95/html/curs_insstr.3x.html | 120 + Ada95/html/curs_instr.3x.html | 70 + Ada95/html/curs_kernel.3x.html | 172 + Ada95/html/curs_mouse.3x.html | 174 + Ada95/html/curs_move.3x.html | 70 + Ada95/html/curs_outopts.3x.html | 172 + Ada95/html/curs_overlay.3x.html | 70 + Ada95/html/curs_pad.3x.html | 122 + Ada95/html/curs_print.3x.html | 70 + Ada95/html/curs_printw.3x.html | 68 + Ada95/html/curs_refresh.3x.html | 122 + Ada95/html/curs_scanw.3x.html | 68 + Ada95/html/curs_scr_dmp.3x.html | 122 + Ada95/html/curs_scroll.3x.html | 70 + Ada95/html/curs_slk.3x.html | 122 + Ada95/html/curs_termattrs.3x.html | 122 + Ada95/html/curs_termcap.3x.html | 122 + Ada95/html/curs_terminfo.3x.html | 226 + Ada95/html/curs_touch.3x.html | 120 + Ada95/html/curs_util.3x.html | 122 + Ada95/html/curs_window.3x.html | 176 + Ada95/html/dft_fgbg.3x.html | 72 + Ada95/html/form.3x.html | 176 + Ada95/html/form_cursor.3x.html | 72 + Ada95/html/form_data.3x.html | 70 + Ada95/html/form_driver.3x.html | 280 + Ada95/html/form_field.3x.html | 124 + Ada95/html/form_field_attributes.3x.html | 124 + Ada95/html/form_field_buffer.3x.html | 122 + Ada95/html/form_field_info.3x.html | 72 + Ada95/html/form_field_just.3x.html | 72 + Ada95/html/form_field_new.3x.html | 122 + Ada95/html/form_field_opts.3x.html | 122 + Ada95/html/form_field_userptr.3x.html | 72 + Ada95/html/form_field_validation.3x.html | 176 + Ada95/html/form_fieldtype.3x.html | 124 + Ada95/html/form_hook.3x.html | 124 + Ada95/html/form_new.3x.html | 72 + Ada95/html/form_new_page.3x.html | 72 + Ada95/html/form_opts.3x.html | 124 + Ada95/html/form_page.3x.html | 122 + Ada95/html/form_post.3x.html | 122 + Ada95/html/form_requestname.3x.html | 72 + Ada95/html/form_userptr.3x.html | 72 + Ada95/html/form_win.3x.html | 122 + Ada95/html/index.html | 179 + Ada95/html/menu.3x.html | 176 + Ada95/html/menu_attribs.3x.html | 122 + Ada95/html/menu_cursor.3x.html | 72 + Ada95/html/menu_driver.3x.html | 176 + Ada95/html/menu_format.3x.html | 72 + Ada95/html/menu_hook.3x.html | 124 + Ada95/html/menu_items.3x.html | 124 + Ada95/html/menu_mark.3x.html | 72 + Ada95/html/menu_new.3x.html | 72 + Ada95/html/menu_opts.3x.html | 124 + Ada95/html/menu_pattern.3x.html | 72 + Ada95/html/menu_post.3x.html | 122 + Ada95/html/menu_requestname.3x.html | 72 + Ada95/html/menu_spacing.3x.html | 72 + Ada95/html/menu_userptr.3x.html | 72 + Ada95/html/menu_win.3x.html | 122 + Ada95/html/mitem_current.3x.html | 122 + Ada95/html/mitem_name.3x.html | 72 + Ada95/html/mitem_new.3x.html | 72 + Ada95/html/mitem_opts.3x.html | 72 + Ada95/html/mitem_userptr.3x.html | 72 + Ada95/html/mitem_value.3x.html | 72 + Ada95/html/mitem_visible.3x.html | 70 + Ada95/html/ncurses.3x.html | 490 + Ada95/html/panel.3x.html | 180 + Ada95/html/resizeterm.3x.html | 70 + Ada95/html/table.html | 311 + ...ace-curses-forms-choice_field_types_s.html | 64 + ..._interface-curses-forms-field_types_s.html | 68 + ...erface-curses-forms-field_user_data_s.html | 77 + ...terface-curses-forms-form_user_data_s.html | 78 + .../terminal_interface-curses-forms_s.html | 920 + ...terface-curses-menus-item_user_data_s.html | 72 + ...terface-curses-menus-menu_user_data_s.html | 77 + .../terminal_interface-curses-menus_s.html | 617 + .../terminal_interface-curses-mouse_s.html | 158 + ...l_interface-curses-panels-user_data_s.html | 68 + .../terminal_interface-curses-panels_s.html | 139 + ...interface-curses-text_io-complex_io_s.html | 74 + ...interface-curses-text_io-decimal_io_s.html | 70 + ...rface-curses-text_io-enumeration_io_s.html | 67 + ...l_interface-curses-text_io-fixed_io_s.html | 70 + ...l_interface-curses-text_io-float_io_s.html | 70 + ...interface-curses-text_io-integer_io_s.html | 67 + ...interface-curses-text_io-modular_io_s.html | 67 + .../terminal_interface-curses-text_io_s.html | 142 + Ada95/html/terminal_interface-curses_s.html | 1541 ++ Ada95/html/terminal_interface_s.html | 49 + Ada95/html/wresize.3x.html | 70 + Ada95/samples/Makefile.in | 112 + Ada95/samples/README | 6 + Ada95/samples/explain.txt | 185 + .../samples/sample-curses_demo-attributes.adb | 113 + .../samples/sample-curses_demo-attributes.ads | 31 + Ada95/samples/sample-curses_demo-mouse.adb | 207 + Ada95/samples/sample-curses_demo-mouse.ads | 31 + Ada95/samples/sample-curses_demo.adb | 116 + Ada95/samples/sample-curses_demo.ads | 31 + Ada95/samples/sample-explanation.adb | 395 + Ada95/samples/sample-explanation.ads | 49 + Ada95/samples/sample-form_demo-aux.adb | 241 + Ada95/samples/sample-form_demo-aux.ads | 78 + Ada95/samples/sample-form_demo-handler.adb | 85 + Ada95/samples/sample-form_demo-handler.ads | 50 + Ada95/samples/sample-form_demo.adb | 124 + Ada95/samples/sample-form_demo.ads | 31 + Ada95/samples/sample-function_key_setting.adb | 199 + Ada95/samples/sample-function_key_setting.ads | 68 + Ada95/samples/sample-header_handler.adb | 166 + Ada95/samples/sample-header_handler.ads | 39 + Ada95/samples/sample-helpers.adb | 55 + Ada95/samples/sample-helpers.ads | 40 + Ada95/samples/sample-keyboard_handler.adb | 175 + Ada95/samples/sample-keyboard_handler.ads | 41 + Ada95/samples/sample-manifest.ads | 53 + Ada95/samples/sample-menu_demo-aux.adb | 190 + Ada95/samples/sample-menu_demo-aux.ads | 57 + Ada95/samples/sample-menu_demo-handler.adb | 74 + Ada95/samples/sample-menu_demo-handler.ads | 50 + Ada95/samples/sample-menu_demo.adb | 386 + Ada95/samples/sample-menu_demo.ads | 31 + Ada95/samples/sample-my_field_type.adb | 49 + Ada95/samples/sample-my_field_type.ads | 51 + Ada95/samples/sample-text_io_demo.adb | 168 + Ada95/samples/sample-text_io_demo.ads | 31 + Ada95/samples/sample.adb | 204 + Ada95/samples/sample.ads | 29 + Ada95/samples/tour.adb | 32 + Ada95/samples/tour.ads | 27 + INSTALL | 467 + MANIFEST | 581 + Makefile.glibc | 224 + Makefile.in | 70 + NEWS | 1503 ++ README | 170 + README.glibc | 5 + TO-DO | 254 + aclocal.m4 | 1219 ++ announce.html | 258 + announce.html.in | 258 + c++/Makefile.in | 88 + c++/NEWS | 17 + c++/PROBLEMS | 8 + c++/README-first | 57 + c++/cursesm.cc | 314 + c++/cursesm.h | 621 + c++/cursesp.cc | 95 + c++/cursesp.h | 130 + c++/cursesw.cc | 344 + c++/cursesw.h | 730 + c++/demo.cc | 240 + c++/etip.h | 148 + c++/internal.h | 14 + c++/modules | 24 + configure | 4829 ++++++ configure.in | 658 + dist.mk | 56 + form/Makefile.in | 126 + form/READ.ME | 19 + form/fld_def.c | 661 + form/fld_stat.c | 63 + form/fld_type.c | 222 + form/fld_user.c | 57 + form/form.h | 380 + form/form.priv.h | 94 + form/frm_adabind.c | 61 + form/frm_data.c | 171 + form/frm_def.c | 391 + form/frm_driver.c | 4307 +++++ form/frm_hook.c | 130 + form/frm_opts.c | 103 + form/frm_req_name.c | 153 + form/frm_user.c | 57 + form/frm_win.c | 91 + form/fty_alnum.c | 137 + form/fty_alpha.c | 138 + form/fty_enum.c | 287 + form/fty_int.c | 160 + form/fty_ipv4.c | 81 + form/fty_num.c | 195 + form/fty_regex.c | 257 + form/headers | 20 + form/llib-lform | 580 + form/modules | 40 + include/Caps | 1302 ++ include/MKhashsize.sh | 14 + include/MKparametrized.sh | 34 + include/MKterm.h.awk.in | 237 + include/Makefile.in | 93 + include/capdefaults.c | 72 + include/config_h.in | 26 + include/curses.h.in | 1285 ++ include/edit_cfg.sh | 49 + include/headers | 23 + include/nc_alloc.h | 60 + include/term_entry.h | 77 + include/termcap.h.in | 54 + include/tic.h | 199 + include/unctrl.h.in | 54 + install-sh | 238 + man/MKterminfo.sh | 36 + man/Makefile.in | 57 + man/captoinfo.1m | 159 + man/clear.1 | 19 + man/curs_addch.3x | 146 + man/curs_addchstr.3x | 55 + man/curs_addstr.3x | 48 + man/curs_attr.3x | 172 + man/curs_beep.3x | 34 + man/curs_bkgd.3x | 74 + man/curs_border.3x | 80 + man/curs_clear.3x | 65 + man/curs_color.3x | 162 + man/curs_delch.3x | 39 + man/curs_deleteln.3x | 55 + man/curs_getch.3x | 239 + man/curs_getstr.3x | 73 + man/curs_getyx.3x | 43 + man/curs_inch.3x | 44 + man/curs_inchstr.3x | 55 + man/curs_initscr.3x | 87 + man/curs_inopts.3x | 183 + man/curs_insch.3x | 39 + man/curs_insstr.3x | 61 + man/curs_instr.3x | 56 + man/curs_kernel.3x | 123 + man/curs_mouse.3x | 151 + man/curs_move.3x | 34 + man/curs_outopts.3x | 135 + man/curs_overlay.3x | 46 + man/curs_pad.3x | 82 + man/curs_print.3x | 45 + man/curs_printw.3x | 47 + man/curs_refresh.3x | 84 + man/curs_scanw.3x | 48 + man/curs_scr_dmp.3x | 64 + man/curs_scroll.3x | 49 + man/curs_slk.3x | 104 + man/curs_termattrs.3x | 78 + man/curs_termcap.3x | 80 + man/curs_terminfo.3x | 213 + man/curs_touch.3x | 64 + man/curs_util.3x | 85 + man/curs_window.3x | 123 + man/dft_fgbg.3x | 74 + man/form.3x | 170 + man/form_cursor.3x | 45 + man/form_data.3x | 34 + man/form_driver.3x | 244 + man/form_field.3x | 68 + man/form_field_attributes.3x | 62 + man/form_field_buffer.3x | 63 + man/form_field_info.3x | 51 + man/form_field_just.3x | 49 + man/form_field_new.3x | 67 + man/form_field_opts.3x | 90 + man/form_field_userptr.3x | 44 + man/form_field_validation.3x | 99 + man/form_fieldtype.3x | 94 + man/form_hook.3x | 71 + man/form_new.3x | 50 + man/form_new_page.3x | 48 + man/form_opts.3x | 61 + man/form_page.3x | 66 + man/form_post.3x | 61 + man/form_requestname.3x | 40 + man/form_userptr.3x | 44 + man/form_win.3x | 66 + man/infocmp.1m | 298 + man/man_db.renames | 103 + man/menu.3x | 162 + man/menu_attribs.3x | 71 + man/menu_cursor.3x | 44 + man/menu_driver.3x | 122 + man/menu_format.3x | 54 + man/menu_hook.3x | 72 + man/menu_items.3x | 62 + man/menu_mark.3x | 55 + man/menu_new.3x | 50 + man/menu_opts.3x | 75 + man/menu_pattern.3x | 54 + man/menu_post.3x | 61 + man/menu_requestname.3x | 40 + man/menu_spacing.3x | 55 + man/menu_userptr.3x | 44 + man/menu_win.3x | 66 + man/mitem_current.3x | 72 + man/mitem_name.3x | 35 + man/mitem_new.3x | 49 + man/mitem_opts.3x | 55 + man/mitem_userptr.3x | 43 + man/mitem_value.3x | 48 + man/mitem_visible.3x | 30 + man/ncurses.3x | 631 + man/panel.3x | 155 + man/resizeterm.3x | 69 + man/term.5 | 179 + man/term.7 | 175 + man/terminfo.head | 67 + man/terminfo.tail | 1387 ++ man/tic.1m | 211 + man/toe.1m | 52 + man/tput.1 | 209 + man/tset.1 | 218 + man/wresize.3x | 60 + menu/Makefile.in | 131 + menu/READ.ME | 18 + menu/eti.h | 42 + menu/headers | 21 + menu/llib-lmenu | 483 + menu/m_adabind.c | 46 + menu/m_attribs.c | 172 + menu/m_cursor.c | 79 + menu/m_driver.c | 512 + menu/m_format.c | 115 + menu/m_global.c | 473 + menu/m_hook.c | 139 + menu/m_item_cur.c | 156 + menu/m_item_nam.c | 58 + menu/m_item_new.c | 242 + menu/m_item_opt.c | 133 + menu/m_item_use.c | 62 + menu/m_item_val.c | 90 + menu/m_item_vis.c | 56 + menu/m_items.c | 93 + menu/m_new.c | 97 + menu/m_opts.c | 156 + menu/m_post.c | 356 + menu/m_req_name.c | 109 + menu/m_spacing.c | 88 + menu/m_userptr.c | 62 + menu/m_win.c | 136 + menu/menu.h | 240 + menu/menu.priv.h | 99 + menu/mf_common.h | 85 + menu/modules | 42 + misc/Makefile.in | 89 + misc/hackguide.doc | 723 + misc/hackguide.html | 855 + misc/makellib | 151 + misc/ncurses-intro.doc | 2508 +++ misc/ncurses-intro.html | 2639 +++ misc/run_tic.sh | 138 + misc/shlib | 62 + misc/tabset/std | 1 + misc/tabset/stdcrt | 1 + misc/tabset/vt100 | 3 + misc/tabset/vt300 | 3 + misc/tdlint | 100 + misc/terminfo.src | 13911 ++++++++++++++++ mk-0th.awk | 70 + mk-1st.awk | 165 + mk-2nd.awk | 75 + mkinstalldirs | 32 + ncurses.lsm | 30 + ncurses/MKcaptab.awk | 66 + ncurses/MKexpanded.sh | 96 + ncurses/MKfallback.sh | 68 + ncurses/MKkeyname.awk | 32 + ncurses/MKkeys.awk | 1 + ncurses/MKlib_gen.sh | 212 + ncurses/MKnames.awk | 98 + ncurses/MKunctrl.awk | 54 + ncurses/Makefile.in | 180 + ncurses/README | 19 + ncurses/SigAction.h | 83 + ncurses/alloc_entry.c | 160 + ncurses/captoinfo.c | 791 + ncurses/comp_error.c | 108 + ncurses/comp_hash.c | 320 + ncurses/comp_parse.c | 492 + ncurses/comp_scan.c | 696 + ncurses/curses.priv.h | 541 + ncurses/hardscroll.c | 420 + ncurses/hashmap.c | 319 + ncurses/keys.list | 150 + ncurses/lib_acs.c | 133 + ncurses/lib_adabind.c | 220 + ncurses/lib_addch.c | 310 + ncurses/lib_addstr.c | 90 + ncurses/lib_baudrate.c | 135 + ncurses/lib_beep.c | 81 + ncurses/lib_bkgd.c | 52 + ncurses/lib_box.c | 160 + ncurses/lib_clear.c | 42 + ncurses/lib_clrbot.c | 72 + ncurses/lib_clreol.c | 77 + ncurses/lib_color.c | 380 + ncurses/lib_data.c | 79 + ncurses/lib_delch.c | 58 + ncurses/lib_delwin.c | 60 + ncurses/lib_dft_fgbg.c | 48 + ncurses/lib_doupdate.c | 1208 ++ ncurses/lib_endwin.c | 68 + ncurses/lib_erase.c | 68 + ncurses/lib_freeall.c | 123 + ncurses/lib_getch.c | 381 + ncurses/lib_getstr.c | 162 + ncurses/lib_inchstr.c | 45 + ncurses/lib_initscr.c | 106 + ncurses/lib_insch.c | 56 + ncurses/lib_insdel.c | 48 + ncurses/lib_insstr.c | 63 + ncurses/lib_instr.c | 56 + ncurses/lib_isendwin.c | 39 + ncurses/lib_kernel.c | 173 + ncurses/lib_longname.c | 46 + ncurses/lib_mouse.c | 670 + ncurses/lib_move.c | 50 + ncurses/lib_mvcur.c | 1448 ++ ncurses/lib_mvwin.c | 57 + ncurses/lib_newterm.c | 155 + ncurses/lib_newwin.c | 259 + ncurses/lib_options.c | 400 + ncurses/lib_overlay.c | 139 + ncurses/lib_pad.c | 248 + ncurses/lib_print.c | 84 + ncurses/lib_printw.c | 95 + ncurses/lib_raw.c | 435 + ncurses/lib_refresh.c | 180 + ncurses/lib_restart.c | 154 + ncurses/lib_scanw.c | 95 + ncurses/lib_screen.c | 182 + ncurses/lib_scroll.c | 111 + ncurses/lib_scrreg.c | 49 + ncurses/lib_set_term.c | 281 + ncurses/lib_setup.c | 300 + ncurses/lib_slk.c | 443 + ncurses/lib_termcap.c | 226 + ncurses/lib_ti.c | 67 + ncurses/lib_touch.c | 70 + ncurses/lib_tparm.c | 533 + ncurses/lib_tputs.c | 213 + ncurses/lib_trace.c | 179 + ncurses/lib_traceatr.c | 230 + ncurses/lib_tracechr.c | 52 + ncurses/lib_tracedmp.c | 115 + ncurses/lib_tracemse.c | 82 + ncurses/lib_tstp.c | 282 + ncurses/lib_twait.c | 267 + ncurses/lib_vidattr.c | 215 + ncurses/lib_window.c | 222 + ncurses/llib-lncurses | 2560 +++ ncurses/modules | 117 + ncurses/parse_entry.c | 896 + ncurses/read_entry.c | 327 + ncurses/read_termcap.c | 966 ++ ncurses/resizeterm.c | 99 + ncurses/sigaction.c | 86 + ncurses/vsscanf.c | 47 + ncurses/wresize.c | 159 + ncurses/write_entry.c | 408 + panel/Makefile.in | 121 + panel/headers | 20 + panel/llib-lpanel | 102 + panel/modules | 21 + panel/panel.c | 664 + panel/panel.h | 71 + panel/panel.priv.h | 52 + progs/MKtermsort.sh | 121 + progs/Makefile.in | 246 + progs/capconvert | 190 + progs/clear.c | 47 + progs/clear.sh | 1 + progs/dump_entry.c | 848 + progs/dump_entry.h | 49 + progs/infocmp.c | 1169 ++ progs/modules | 27 + progs/progs.priv.h | 136 + progs/tic.c | 570 + progs/toe.c | 284 + progs/tput.c | 277 + progs/tset.c | 1161 ++ sysdeps/unix/sysv/linux/Makefile | 10 + sysdeps/unix/sysv/linux/configure | 273 + sysdeps/unix/sysv/linux/edit_man.sed | 100 + sysdeps/unix/sysv/linux/edit_man.sh | 37 + sysdeps/unix/sysv/linux/run_tic.sh | 132 + test/Makefile.in | 133 + test/README | 22 + test/blue.c | 436 + test/bs.6 | 42 + test/bs.c | 1248 ++ test/configure.in | 182 + test/firework.c | 154 + test/gdc.6 | 22 + test/gdc.c | 215 + test/hanoi.c | 297 + test/hashtest.c | 193 + test/knight.c | 565 + test/lrtest.c | 49 + test/modules | 37 + test/ncurses.c | 3000 ++++ test/newdemo.c | 357 + test/rain.c | 106 + test/tclock.c | 177 + test/test.priv.h | 76 + test/testcurs.c | 495 + test/tracemunch | 98 + test/view.c | 297 + test/worm.c | 371 + test/xmas.c | 1069 ++ 581 files changed, 135278 insertions(+) create mode 100644 ANNOUNCE create mode 100644 Ada95/Makefile.in create mode 100644 Ada95/README create mode 100644 Ada95/TODO create mode 100644 Ada95/ada_include/Makefile.in create mode 100644 Ada95/ada_include/terminal_interface-curses-aux.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-aux.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-forms-choice_field_types.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-forms-choice_field_types.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-forms-field_types.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-forms-field_types.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-forms-field_user_data.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-forms-form_user_data.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-forms.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-menus-item_user_data.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-menus-menu_user_data.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-menus.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-mouse.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-panels-user_data.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-panels.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-aux.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-aux.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-complex_io.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-complex_io.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-float_io.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-float_io.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-integer_io.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-integer_io.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-modular_io.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io-modular_io.ads create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io.adb create mode 100644 Ada95/ada_include/terminal_interface-curses-text_io.ads create mode 100644 Ada95/ada_include/terminal_interface-curses.adb create mode 100644 Ada95/ada_include/terminal_interface.ads create mode 100644 Ada95/gen/Makefile.in create mode 100644 Ada95/gen/gen.c create mode 100644 Ada95/gen/normal.m4 create mode 100644 Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-forms.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-menus.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-mouse.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses-panels.ads.m4 create mode 100644 Ada95/gen/terminal_interface-curses.ads.m4 create mode 100644 Ada95/html/Makefile create mode 100644 Ada95/html/curs_addch.3x.html create mode 100644 Ada95/html/curs_addchstr.3x.html create mode 100644 Ada95/html/curs_addstr.3x.html create mode 100644 Ada95/html/curs_attr.3x.html create mode 100644 Ada95/html/curs_beep.3x.html create mode 100644 Ada95/html/curs_bkgd.3x.html create mode 100644 Ada95/html/curs_border.3x.html create mode 100644 Ada95/html/curs_clear.3x.html create mode 100644 Ada95/html/curs_color.3x.html create mode 100644 Ada95/html/curs_delch.3x.html create mode 100644 Ada95/html/curs_deleteln.3x.html create mode 100644 Ada95/html/curs_getch.3x.html create mode 100644 Ada95/html/curs_getstr.3x.html create mode 100644 Ada95/html/curs_getyx.3x.html create mode 100644 Ada95/html/curs_inch.3x.html create mode 100644 Ada95/html/curs_inchstr.3x.html create mode 100644 Ada95/html/curs_initscr.3x.html create mode 100644 Ada95/html/curs_inopts.3x.html create mode 100644 Ada95/html/curs_insch.3x.html create mode 100644 Ada95/html/curs_insstr.3x.html create mode 100644 Ada95/html/curs_instr.3x.html create mode 100644 Ada95/html/curs_kernel.3x.html create mode 100644 Ada95/html/curs_mouse.3x.html create mode 100644 Ada95/html/curs_move.3x.html create mode 100644 Ada95/html/curs_outopts.3x.html create mode 100644 Ada95/html/curs_overlay.3x.html create mode 100644 Ada95/html/curs_pad.3x.html create mode 100644 Ada95/html/curs_print.3x.html create mode 100644 Ada95/html/curs_printw.3x.html create mode 100644 Ada95/html/curs_refresh.3x.html create mode 100644 Ada95/html/curs_scanw.3x.html create mode 100644 Ada95/html/curs_scr_dmp.3x.html create mode 100644 Ada95/html/curs_scroll.3x.html create mode 100644 Ada95/html/curs_slk.3x.html create mode 100644 Ada95/html/curs_termattrs.3x.html create mode 100644 Ada95/html/curs_termcap.3x.html create mode 100644 Ada95/html/curs_terminfo.3x.html create mode 100644 Ada95/html/curs_touch.3x.html create mode 100644 Ada95/html/curs_util.3x.html create mode 100644 Ada95/html/curs_window.3x.html create mode 100644 Ada95/html/dft_fgbg.3x.html create mode 100644 Ada95/html/form.3x.html create mode 100644 Ada95/html/form_cursor.3x.html create mode 100644 Ada95/html/form_data.3x.html create mode 100644 Ada95/html/form_driver.3x.html create mode 100644 Ada95/html/form_field.3x.html create mode 100644 Ada95/html/form_field_attributes.3x.html create mode 100644 Ada95/html/form_field_buffer.3x.html create mode 100644 Ada95/html/form_field_info.3x.html create mode 100644 Ada95/html/form_field_just.3x.html create mode 100644 Ada95/html/form_field_new.3x.html create mode 100644 Ada95/html/form_field_opts.3x.html create mode 100644 Ada95/html/form_field_userptr.3x.html create mode 100644 Ada95/html/form_field_validation.3x.html create mode 100644 Ada95/html/form_fieldtype.3x.html create mode 100644 Ada95/html/form_hook.3x.html create mode 100644 Ada95/html/form_new.3x.html create mode 100644 Ada95/html/form_new_page.3x.html create mode 100644 Ada95/html/form_opts.3x.html create mode 100644 Ada95/html/form_page.3x.html create mode 100644 Ada95/html/form_post.3x.html create mode 100644 Ada95/html/form_requestname.3x.html create mode 100644 Ada95/html/form_userptr.3x.html create mode 100644 Ada95/html/form_win.3x.html create mode 100644 Ada95/html/index.html create mode 100644 Ada95/html/menu.3x.html create mode 100644 Ada95/html/menu_attribs.3x.html create mode 100644 Ada95/html/menu_cursor.3x.html create mode 100644 Ada95/html/menu_driver.3x.html create mode 100644 Ada95/html/menu_format.3x.html create mode 100644 Ada95/html/menu_hook.3x.html create mode 100644 Ada95/html/menu_items.3x.html create mode 100644 Ada95/html/menu_mark.3x.html create mode 100644 Ada95/html/menu_new.3x.html create mode 100644 Ada95/html/menu_opts.3x.html create mode 100644 Ada95/html/menu_pattern.3x.html create mode 100644 Ada95/html/menu_post.3x.html create mode 100644 Ada95/html/menu_requestname.3x.html create mode 100644 Ada95/html/menu_spacing.3x.html create mode 100644 Ada95/html/menu_userptr.3x.html create mode 100644 Ada95/html/menu_win.3x.html create mode 100644 Ada95/html/mitem_current.3x.html create mode 100644 Ada95/html/mitem_name.3x.html create mode 100644 Ada95/html/mitem_new.3x.html create mode 100644 Ada95/html/mitem_opts.3x.html create mode 100644 Ada95/html/mitem_userptr.3x.html create mode 100644 Ada95/html/mitem_value.3x.html create mode 100644 Ada95/html/mitem_visible.3x.html create mode 100644 Ada95/html/ncurses.3x.html create mode 100644 Ada95/html/panel.3x.html create mode 100644 Ada95/html/resizeterm.3x.html create mode 100644 Ada95/html/table.html create mode 100644 Ada95/html/terminal_interface-curses-forms-choice_field_types_s.html create mode 100644 Ada95/html/terminal_interface-curses-forms-field_types_s.html create mode 100644 Ada95/html/terminal_interface-curses-forms-field_user_data_s.html create mode 100644 Ada95/html/terminal_interface-curses-forms-form_user_data_s.html create mode 100644 Ada95/html/terminal_interface-curses-forms_s.html create mode 100644 Ada95/html/terminal_interface-curses-menus-item_user_data_s.html create mode 100644 Ada95/html/terminal_interface-curses-menus-menu_user_data_s.html create mode 100644 Ada95/html/terminal_interface-curses-menus_s.html create mode 100644 Ada95/html/terminal_interface-curses-mouse_s.html create mode 100644 Ada95/html/terminal_interface-curses-panels-user_data_s.html create mode 100644 Ada95/html/terminal_interface-curses-panels_s.html create mode 100644 Ada95/html/terminal_interface-curses-text_io-complex_io_s.html create mode 100644 Ada95/html/terminal_interface-curses-text_io-decimal_io_s.html create mode 100644 Ada95/html/terminal_interface-curses-text_io-enumeration_io_s.html create mode 100644 Ada95/html/terminal_interface-curses-text_io-fixed_io_s.html create mode 100644 Ada95/html/terminal_interface-curses-text_io-float_io_s.html create mode 100644 Ada95/html/terminal_interface-curses-text_io-integer_io_s.html create mode 100644 Ada95/html/terminal_interface-curses-text_io-modular_io_s.html create mode 100644 Ada95/html/terminal_interface-curses-text_io_s.html create mode 100644 Ada95/html/terminal_interface-curses_s.html create mode 100644 Ada95/html/terminal_interface_s.html create mode 100644 Ada95/html/wresize.3x.html create mode 100644 Ada95/samples/Makefile.in create mode 100644 Ada95/samples/README create mode 100644 Ada95/samples/explain.txt create mode 100644 Ada95/samples/sample-curses_demo-attributes.adb create mode 100644 Ada95/samples/sample-curses_demo-attributes.ads create mode 100644 Ada95/samples/sample-curses_demo-mouse.adb create mode 100644 Ada95/samples/sample-curses_demo-mouse.ads create mode 100644 Ada95/samples/sample-curses_demo.adb create mode 100644 Ada95/samples/sample-curses_demo.ads create mode 100644 Ada95/samples/sample-explanation.adb create mode 100644 Ada95/samples/sample-explanation.ads create mode 100644 Ada95/samples/sample-form_demo-aux.adb create mode 100644 Ada95/samples/sample-form_demo-aux.ads create mode 100644 Ada95/samples/sample-form_demo-handler.adb create mode 100644 Ada95/samples/sample-form_demo-handler.ads create mode 100644 Ada95/samples/sample-form_demo.adb create mode 100644 Ada95/samples/sample-form_demo.ads create mode 100644 Ada95/samples/sample-function_key_setting.adb create mode 100644 Ada95/samples/sample-function_key_setting.ads create mode 100644 Ada95/samples/sample-header_handler.adb create mode 100644 Ada95/samples/sample-header_handler.ads create mode 100644 Ada95/samples/sample-helpers.adb create mode 100644 Ada95/samples/sample-helpers.ads create mode 100644 Ada95/samples/sample-keyboard_handler.adb create mode 100644 Ada95/samples/sample-keyboard_handler.ads create mode 100644 Ada95/samples/sample-manifest.ads create mode 100644 Ada95/samples/sample-menu_demo-aux.adb create mode 100644 Ada95/samples/sample-menu_demo-aux.ads create mode 100644 Ada95/samples/sample-menu_demo-handler.adb create mode 100644 Ada95/samples/sample-menu_demo-handler.ads create mode 100644 Ada95/samples/sample-menu_demo.adb create mode 100644 Ada95/samples/sample-menu_demo.ads create mode 100644 Ada95/samples/sample-my_field_type.adb create mode 100644 Ada95/samples/sample-my_field_type.ads create mode 100644 Ada95/samples/sample-text_io_demo.adb create mode 100644 Ada95/samples/sample-text_io_demo.ads create mode 100644 Ada95/samples/sample.adb create mode 100644 Ada95/samples/sample.ads create mode 100644 Ada95/samples/tour.adb create mode 100644 Ada95/samples/tour.ads create mode 100644 INSTALL create mode 100644 MANIFEST create mode 100644 Makefile.glibc create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 README create mode 100644 README.glibc create mode 100644 TO-DO create mode 100644 aclocal.m4 create mode 100644 announce.html create mode 100644 announce.html.in create mode 100644 c++/Makefile.in create mode 100644 c++/NEWS create mode 100644 c++/PROBLEMS create mode 100644 c++/README-first create mode 100644 c++/cursesm.cc create mode 100644 c++/cursesm.h create mode 100644 c++/cursesp.cc create mode 100644 c++/cursesp.h create mode 100644 c++/cursesw.cc create mode 100644 c++/cursesw.h create mode 100644 c++/demo.cc create mode 100644 c++/etip.h create mode 100644 c++/internal.h create mode 100644 c++/modules create mode 100755 configure create mode 100644 configure.in create mode 100644 dist.mk create mode 100644 form/Makefile.in create mode 100644 form/READ.ME create mode 100644 form/fld_def.c create mode 100644 form/fld_stat.c create mode 100644 form/fld_type.c create mode 100644 form/fld_user.c create mode 100644 form/form.h create mode 100644 form/form.priv.h create mode 100644 form/frm_adabind.c create mode 100644 form/frm_data.c create mode 100644 form/frm_def.c create mode 100644 form/frm_driver.c create mode 100644 form/frm_hook.c create mode 100644 form/frm_opts.c create mode 100644 form/frm_req_name.c create mode 100644 form/frm_user.c create mode 100644 form/frm_win.c create mode 100644 form/fty_alnum.c create mode 100644 form/fty_alpha.c create mode 100644 form/fty_enum.c create mode 100644 form/fty_int.c create mode 100644 form/fty_ipv4.c create mode 100644 form/fty_num.c create mode 100644 form/fty_regex.c create mode 100644 form/headers create mode 100644 form/llib-lform create mode 100644 form/modules create mode 100644 include/Caps create mode 100755 include/MKhashsize.sh create mode 100755 include/MKparametrized.sh create mode 100644 include/MKterm.h.awk.in create mode 100644 include/Makefile.in create mode 100644 include/capdefaults.c create mode 100644 include/config_h.in create mode 100644 include/curses.h.in create mode 100755 include/edit_cfg.sh create mode 100644 include/headers create mode 100644 include/nc_alloc.h create mode 100644 include/term_entry.h create mode 100644 include/termcap.h.in create mode 100644 include/tic.h create mode 100644 include/unctrl.h.in create mode 100755 install-sh create mode 100755 man/MKterminfo.sh create mode 100644 man/Makefile.in create mode 100644 man/captoinfo.1m create mode 100644 man/clear.1 create mode 100644 man/curs_addch.3x create mode 100644 man/curs_addchstr.3x create mode 100644 man/curs_addstr.3x create mode 100644 man/curs_attr.3x create mode 100644 man/curs_beep.3x create mode 100644 man/curs_bkgd.3x create mode 100644 man/curs_border.3x create mode 100644 man/curs_clear.3x create mode 100644 man/curs_color.3x create mode 100644 man/curs_delch.3x create mode 100644 man/curs_deleteln.3x create mode 100644 man/curs_getch.3x create mode 100644 man/curs_getstr.3x create mode 100644 man/curs_getyx.3x create mode 100644 man/curs_inch.3x create mode 100644 man/curs_inchstr.3x create mode 100644 man/curs_initscr.3x create mode 100644 man/curs_inopts.3x create mode 100644 man/curs_insch.3x create mode 100644 man/curs_insstr.3x create mode 100644 man/curs_instr.3x create mode 100644 man/curs_kernel.3x create mode 100644 man/curs_mouse.3x create mode 100644 man/curs_move.3x create mode 100644 man/curs_outopts.3x create mode 100644 man/curs_overlay.3x create mode 100644 man/curs_pad.3x create mode 100644 man/curs_print.3x create mode 100644 man/curs_printw.3x create mode 100644 man/curs_refresh.3x create mode 100644 man/curs_scanw.3x create mode 100644 man/curs_scr_dmp.3x create mode 100644 man/curs_scroll.3x create mode 100644 man/curs_slk.3x create mode 100644 man/curs_termattrs.3x create mode 100644 man/curs_termcap.3x create mode 100644 man/curs_terminfo.3x create mode 100644 man/curs_touch.3x create mode 100644 man/curs_util.3x create mode 100644 man/curs_window.3x create mode 100644 man/dft_fgbg.3x create mode 100644 man/form.3x create mode 100644 man/form_cursor.3x create mode 100644 man/form_data.3x create mode 100644 man/form_driver.3x create mode 100644 man/form_field.3x create mode 100644 man/form_field_attributes.3x create mode 100644 man/form_field_buffer.3x create mode 100644 man/form_field_info.3x create mode 100644 man/form_field_just.3x create mode 100644 man/form_field_new.3x create mode 100644 man/form_field_opts.3x create mode 100644 man/form_field_userptr.3x create mode 100644 man/form_field_validation.3x create mode 100644 man/form_fieldtype.3x create mode 100644 man/form_hook.3x create mode 100644 man/form_new.3x create mode 100644 man/form_new_page.3x create mode 100644 man/form_opts.3x create mode 100644 man/form_page.3x create mode 100644 man/form_post.3x create mode 100644 man/form_requestname.3x create mode 100644 man/form_userptr.3x create mode 100644 man/form_win.3x create mode 100644 man/infocmp.1m create mode 100644 man/man_db.renames create mode 100644 man/menu.3x create mode 100644 man/menu_attribs.3x create mode 100644 man/menu_cursor.3x create mode 100644 man/menu_driver.3x create mode 100644 man/menu_format.3x create mode 100644 man/menu_hook.3x create mode 100644 man/menu_items.3x create mode 100644 man/menu_mark.3x create mode 100644 man/menu_new.3x create mode 100644 man/menu_opts.3x create mode 100644 man/menu_pattern.3x create mode 100644 man/menu_post.3x create mode 100644 man/menu_requestname.3x create mode 100644 man/menu_spacing.3x create mode 100644 man/menu_userptr.3x create mode 100644 man/menu_win.3x create mode 100644 man/mitem_current.3x create mode 100644 man/mitem_name.3x create mode 100644 man/mitem_new.3x create mode 100644 man/mitem_opts.3x create mode 100644 man/mitem_userptr.3x create mode 100644 man/mitem_value.3x create mode 100644 man/mitem_visible.3x create mode 100644 man/ncurses.3x create mode 100644 man/panel.3x create mode 100644 man/resizeterm.3x create mode 100644 man/term.5 create mode 100644 man/term.7 create mode 100644 man/terminfo.head create mode 100644 man/terminfo.tail create mode 100644 man/tic.1m create mode 100644 man/toe.1m create mode 100644 man/tput.1 create mode 100644 man/tset.1 create mode 100644 man/wresize.3x create mode 100644 menu/Makefile.in create mode 100644 menu/READ.ME create mode 100644 menu/eti.h create mode 100644 menu/headers create mode 100644 menu/llib-lmenu create mode 100644 menu/m_adabind.c create mode 100644 menu/m_attribs.c create mode 100644 menu/m_cursor.c create mode 100644 menu/m_driver.c create mode 100644 menu/m_format.c create mode 100644 menu/m_global.c create mode 100644 menu/m_hook.c create mode 100644 menu/m_item_cur.c create mode 100644 menu/m_item_nam.c create mode 100644 menu/m_item_new.c create mode 100644 menu/m_item_opt.c create mode 100644 menu/m_item_use.c create mode 100644 menu/m_item_val.c create mode 100644 menu/m_item_vis.c create mode 100644 menu/m_items.c create mode 100644 menu/m_new.c create mode 100644 menu/m_opts.c create mode 100644 menu/m_post.c create mode 100644 menu/m_req_name.c create mode 100644 menu/m_spacing.c create mode 100644 menu/m_userptr.c create mode 100644 menu/m_win.c create mode 100644 menu/menu.h create mode 100644 menu/menu.priv.h create mode 100644 menu/mf_common.h create mode 100644 menu/modules create mode 100644 misc/Makefile.in create mode 100644 misc/hackguide.doc create mode 100644 misc/hackguide.html create mode 100755 misc/makellib create mode 100644 misc/ncurses-intro.doc create mode 100644 misc/ncurses-intro.html create mode 100755 misc/run_tic.sh create mode 100755 misc/shlib create mode 100644 misc/tabset/std create mode 100644 misc/tabset/stdcrt create mode 100644 misc/tabset/vt100 create mode 100644 misc/tabset/vt300 create mode 100755 misc/tdlint create mode 100644 misc/terminfo.src create mode 100644 mk-0th.awk create mode 100644 mk-1st.awk create mode 100644 mk-2nd.awk create mode 100755 mkinstalldirs create mode 100644 ncurses.lsm create mode 100644 ncurses/MKcaptab.awk create mode 100755 ncurses/MKexpanded.sh create mode 100755 ncurses/MKfallback.sh create mode 100644 ncurses/MKkeyname.awk create mode 100644 ncurses/MKkeys.awk create mode 100755 ncurses/MKlib_gen.sh create mode 100644 ncurses/MKnames.awk create mode 100644 ncurses/MKunctrl.awk create mode 100644 ncurses/Makefile.in create mode 100644 ncurses/README create mode 100644 ncurses/SigAction.h create mode 100644 ncurses/alloc_entry.c create mode 100644 ncurses/captoinfo.c create mode 100644 ncurses/comp_error.c create mode 100644 ncurses/comp_hash.c create mode 100644 ncurses/comp_parse.c create mode 100644 ncurses/comp_scan.c create mode 100644 ncurses/curses.priv.h create mode 100644 ncurses/hardscroll.c create mode 100644 ncurses/hashmap.c create mode 100644 ncurses/keys.list create mode 100644 ncurses/lib_acs.c create mode 100644 ncurses/lib_adabind.c create mode 100644 ncurses/lib_addch.c create mode 100644 ncurses/lib_addstr.c create mode 100644 ncurses/lib_baudrate.c create mode 100644 ncurses/lib_beep.c create mode 100644 ncurses/lib_bkgd.c create mode 100644 ncurses/lib_box.c create mode 100644 ncurses/lib_clear.c create mode 100644 ncurses/lib_clrbot.c create mode 100644 ncurses/lib_clreol.c create mode 100644 ncurses/lib_color.c create mode 100644 ncurses/lib_data.c create mode 100644 ncurses/lib_delch.c create mode 100644 ncurses/lib_delwin.c create mode 100644 ncurses/lib_dft_fgbg.c create mode 100644 ncurses/lib_doupdate.c create mode 100644 ncurses/lib_endwin.c create mode 100644 ncurses/lib_erase.c create mode 100644 ncurses/lib_freeall.c create mode 100644 ncurses/lib_getch.c create mode 100644 ncurses/lib_getstr.c create mode 100644 ncurses/lib_inchstr.c create mode 100644 ncurses/lib_initscr.c create mode 100644 ncurses/lib_insch.c create mode 100644 ncurses/lib_insdel.c create mode 100644 ncurses/lib_insstr.c create mode 100644 ncurses/lib_instr.c create mode 100644 ncurses/lib_isendwin.c create mode 100644 ncurses/lib_kernel.c create mode 100644 ncurses/lib_longname.c create mode 100644 ncurses/lib_mouse.c create mode 100644 ncurses/lib_move.c create mode 100644 ncurses/lib_mvcur.c create mode 100644 ncurses/lib_mvwin.c create mode 100644 ncurses/lib_newterm.c create mode 100644 ncurses/lib_newwin.c create mode 100644 ncurses/lib_options.c create mode 100644 ncurses/lib_overlay.c create mode 100644 ncurses/lib_pad.c create mode 100644 ncurses/lib_print.c create mode 100644 ncurses/lib_printw.c create mode 100644 ncurses/lib_raw.c create mode 100644 ncurses/lib_refresh.c create mode 100644 ncurses/lib_restart.c create mode 100644 ncurses/lib_scanw.c create mode 100644 ncurses/lib_screen.c create mode 100644 ncurses/lib_scroll.c create mode 100644 ncurses/lib_scrreg.c create mode 100644 ncurses/lib_set_term.c create mode 100644 ncurses/lib_setup.c create mode 100644 ncurses/lib_slk.c create mode 100644 ncurses/lib_termcap.c create mode 100644 ncurses/lib_ti.c create mode 100644 ncurses/lib_touch.c create mode 100644 ncurses/lib_tparm.c create mode 100644 ncurses/lib_tputs.c create mode 100644 ncurses/lib_trace.c create mode 100644 ncurses/lib_traceatr.c create mode 100644 ncurses/lib_tracechr.c create mode 100644 ncurses/lib_tracedmp.c create mode 100644 ncurses/lib_tracemse.c create mode 100644 ncurses/lib_tstp.c create mode 100644 ncurses/lib_twait.c create mode 100644 ncurses/lib_vidattr.c create mode 100644 ncurses/lib_window.c create mode 100644 ncurses/llib-lncurses create mode 100644 ncurses/modules create mode 100644 ncurses/parse_entry.c create mode 100644 ncurses/read_entry.c create mode 100644 ncurses/read_termcap.c create mode 100644 ncurses/resizeterm.c create mode 100644 ncurses/sigaction.c create mode 100644 ncurses/vsscanf.c create mode 100644 ncurses/wresize.c create mode 100644 ncurses/write_entry.c create mode 100644 panel/Makefile.in create mode 100644 panel/headers create mode 100644 panel/llib-lpanel create mode 100644 panel/modules create mode 100644 panel/panel.c create mode 100644 panel/panel.h create mode 100644 panel/panel.priv.h create mode 100755 progs/MKtermsort.sh create mode 100644 progs/Makefile.in create mode 100755 progs/capconvert create mode 100644 progs/clear.c create mode 100755 progs/clear.sh create mode 100644 progs/dump_entry.c create mode 100644 progs/dump_entry.h create mode 100644 progs/infocmp.c create mode 100644 progs/modules create mode 100644 progs/progs.priv.h create mode 100644 progs/tic.c create mode 100644 progs/toe.c create mode 100644 progs/tput.c create mode 100644 progs/tset.c create mode 100644 sysdeps/unix/sysv/linux/Makefile create mode 100644 sysdeps/unix/sysv/linux/configure create mode 100644 sysdeps/unix/sysv/linux/edit_man.sed create mode 100644 sysdeps/unix/sysv/linux/edit_man.sh create mode 100755 sysdeps/unix/sysv/linux/run_tic.sh create mode 100644 test/Makefile.in create mode 100644 test/README create mode 100644 test/blue.c create mode 100644 test/bs.6 create mode 100644 test/bs.c create mode 100644 test/configure.in create mode 100644 test/firework.c create mode 100644 test/gdc.6 create mode 100644 test/gdc.c create mode 100644 test/hanoi.c create mode 100644 test/hashtest.c create mode 100644 test/knight.c create mode 100644 test/lrtest.c create mode 100644 test/modules create mode 100644 test/ncurses.c create mode 100644 test/newdemo.c create mode 100644 test/rain.c create mode 100644 test/tclock.c create mode 100644 test/test.priv.h create mode 100644 test/testcurs.c create mode 100755 test/tracemunch create mode 100644 test/view.c create mode 100644 test/worm.c create mode 100644 test/xmas.c diff --git a/ANNOUNCE b/ANNOUNCE new file mode 100644 index 00000000..95ae5be2 --- /dev/null +++ b/ANNOUNCE @@ -0,0 +1,231 @@ + + Announcing ncurses 4.1 + + The ncurses (new curses) library is a freeware emulation of System V + Release 4.0 curses. It uses terminfo format, supports pads and color + and multiple highlights and forms characters and function-key mapping, + and has all the other SYSV-curses enhancements over BSD curses. + + In mid-June 1995, the maintainer of 4.4BSD curses declared that he + considered 4.4BSD curses obsolete, and is encouraging the keepers of + Unix releases such as BSD/OS, freeBSD and netBSD to switch over to + ncurses. + + The ncurses code was developed under Linux. It should port easily to + any ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 Warp! + + The distribution includes the library and support utilities, including + a terminfo compiler tic(1), a decompiler infocmp(1), clear(1), + tput(1), tset(1), and a termcap conversion tool captoinfo(1). Full + manual pages are provided for the library and tools. + + The ncurses distribution is available via anonymous FTP at: + [1]ftp://ftp.clark.net/pub/dickey/ncurses. and + [2]ftp://ftp.netcom.com/pub/zm/zmbenhal/ncurses. It is also carried on + the GNU distribution site at [3]ftp://prep.ai.mit.edu/pub/gnu. + + Features of ncurses + + The ncurses package is fully compatible with SVr4 curses: + + * All 257 of the SVr4 calls have been implemented (and are + documented). + * Full support for SVr4 curses features including keyboard mapping, + color, forms-drawing with ACS characters, and automatic + recognition of keypad and function keys. + * An emulation of the System V Release 4 panels library, supporting + a stack of windows with backing store, is included. + * An emulation of the System V Release 4 menus library, supporting a + uniform but flexible interface for menu programming, is included. + * An emulation of the System V Release 4 form library, supporting + data collection through on-screen forms, is included. + * Binary terminfo entries generated by the ncurses tic(1) + implementation are bit-for-bit-compatible with the entry format + SVr4 curses uses. + * The utilities have options to allow you to filter terminfo entries + for use with less capable curses/terminfo versions such as the + HP/UX and AIX ports. + + The ncurses package also has many useful extensions over SVr4: + + * The API is 8-bit clean and base-level conformant with the X/OPEN + curses specification, XSI Curses (that is, it implements all BASE + level features, but not all EXTENDED features). Most + EXTENDED-level features not directly concerned with wide-character + support are implemented, including many function calls not + supported under SVr4 curses (but portability of all calls is + documented so you can use the SVr4 subset only). + * Unlike SVr4 curses, ncurses can write to the rightmost-bottommost + corner of the screen if your terminal has an insert-character + capability. + * (PC-clone boxes only) Support for access to the IBM PC ROM + characters 0-32 through the highlight A_ALTCHARSET. + * Support for mouse event reporting under xterm. + * The function wresize() allows you to resize windows, preserving + their data. + * Better cursor-movement optimization. The package now features a + cursor-local-movement computation more efficient than either BSD's + or System V's. + * Super hardware scrolling support. The screen-update code + incorporates a novel, simple, and cheap algorithm that enables it + to make optimal use of hardware scrolling, line-insertion, and + line-deletion for screen-line movements. This algorithm is more + powerful than the 4.4BSD curses quickch() routine. + * Real support for terminals with the magic-cookie glitch. The + screen-update code will refrain from drawing a highlight if the + magic- cookie unattributed spaces required just before the + beginning and after the end would step on a non-space character. + It will automatically shift highlight boundaries when doing so + would make it possible to draw the highlight without changing the + visual appearance of the screen. + * It is possible to generate the library with a list of pre-loaded + fallback entries linked to it so that it can serve those terminal + types even when no terminfo tree or termcap file is accessible + (this may be useful for support of screen-oriented programs that + must run in single-user mode). + * The tic(1)/captoinfo utility provided with ncurses has the ability + to translate many termcaps from the XENIX, IBM and AT&T extension + sets. + * A BSD-like tset(1) utility is provided. + * The ncurses library and utilities will automatically read terminfo + entries from $HOME/.terminfo if it exists, and compile to that + directory if it exists and the user has no write access to the + system directory. This feature makes it easier for users to have + personal terminfo entries without giving up access to the system + terminfo directory. + * You may specify a path of directories to search for compiled + descriptions with the environment variable TERMINFO_DIRS (this + generalizes the feature provided by TERMINFO under stock System + V.) + * In terminfo source files, use capabilities may refer not just to + other entries in the same source file (as in System V) but also to + compiled entries in either the system terminfo directory or the + user's $HOME/.terminfo directory. + * A script (capconvert) is provided to help BSD users transition + from termcap to terminfo. It gathers the information in a TERMCAP + environment variable and/or a ~/.termcap local entries file and + converts it to an equivalent local terminfo tree under + $HOME/.terminfo. + * Automatic fallback to the /etc/termcap file can be compiled in + when it is not possible to build a terminfo tree. This feature is + neither fast nor cheap, you don't want to use it unless you have + to, but it's there. + * The table-of-entries utility toe makes it easy for users to see + exactly what terminal types are available on the system. + * The library meets the XSI requirement that every macro entry point + have a corresponding function which may be linked (and will be + prototype-checked) if the macro definition is disabled with + #undef. + * An HTML "Introduction to Programming with NCURSES" document + provides a narrative introduction to the curses programming + interface. + + State of the Package + + Numerous bugs present in earlier versions have been fixed; the library + is far more reliable than it used to be. Bounds checking in many + `dangerous' entry points has been improved. The code is now type-safe + according to gcc -Wall. The library has been checked for malloc leaks + and arena corruption by the Purify memory-allocation tester. + + The ncurses code has been tested with a wide variety of applications + including: + + ded + directory-editor [4]ftp://ftp.clark.net/pub/dickey/ded. + + dialog + the underlying application used in Slackware's setup, and the + basis for similar applications on Linux. + + lynx-2.7 + the character-screen WWW browser + + ncftp 2.0 + file-transfer utility + + nvi + New vi versions 1.50 are able to use ncurses versions 1.9.7 and + later. + + taper + tape archive utility + + vh-1.6 + Volks-Hypertext browser for the Jargon File + + as well as some that use ncurses for the terminfo support alone: + + minicom-1.75 + terminal emulator + + tin-unoff + tin (unofficial) newsreader, supporting color, MIME + [5]ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff. + + vile + vi-like-emacs [6]ftp://ftp.clark.net/pub/dickey/vile. + + The ncurses distribution includes a selection of test programs + (including a few games). + +Who's Who and What's What + + The original maintainer of ncurses is [7]Zeyd Ben-Halim. + Unfortunately, he can only work on the package part time. As a result, + since 1.8.1, much of the enhancement work and documentation has been + done by [8]Eric S. Raymond. The current primary maintainers are + [9]Thomas Dickey and [10]Juergen Pfeifer. + + There is an ncurses mailing list. It is a majordomo list; to join, + write to ncurses-request@mailgate.bsdi.com with a message containing + the line: + + subscribe @ + + This list is open to anyone interested in helping with the development + and testing of this package. + + Beta versions of ncurses and patches to the current release are made + available at [11]ftp://ftp.clark.net/pub/dickey/ncurses. + +Future Plans + + * Extended mouse support via Alessandro Rubini's gpm package. + * Extended-level XPG4 conformance, with internationalization + support. + * Ports to more systems, including DOS and Windows. + + We need people to help with these projects. If you are interested in + working on them, please join the ncurses list. + +The terminfo/termcap Database + + The distribution includes and uses a copy of the terminfo-format + terminal description file maintained by Eric Raymond. You can download + either the [12]termcap or [13]terminfo versions of the terminal-type + database from Eric's ncurses page, + [14]http://www.ccil.org/~esr/ncurses.html. + +Other Related Resources + + You can find lots of information on terminal-related topics not + covered in the terminfo file at [15]Richard Shuford's archive. + +References + + 1. ftp://ftp.clark.net/pub/dickey/ncurses + 2. ftp://ftp.netcom.com/pub/zm/zmbenhal/ncurses + 3. ftp://prep.ai.mit.edu/pub/gnu + 4. ftp://ftp.clark.net/pub/dickey/ded + 5. ftp://ftp.akk.uni-karlsruhe.de/pub/news/clients/tin-unoff + 6. ftp://ftp.clark.net/pub/dickey/vile + 7. mailto:zmbenhal@netcom.com + 8. http://www.ccil.org/~esr/home.html + 9. mailto:dickey@clark.net + 10. mailto:Juergen.Pfeifer@T-Online.de + 11. ftp://ftp.clark.net/pub/dickey/ncurses + 12. http://www.ccil.org/~esr/terminfo/termtypes.tc.gz + 13. http://www.ccil.org/~esr/terminfo/termtypes.ti.gz + 14. http://www.ccil.org/~esr/ncurses.html + 15. http://www.cs.utk.edu/~shuford/terminal_index.html diff --git a/Ada95/Makefile.in b/Ada95/Makefile.in new file mode 100644 index 00000000..f4f6a816 --- /dev/null +++ b/Ada95/Makefile.in @@ -0,0 +1,56 @@ +#---------------------------------------------------------------------------- +# -- +# GNAT ncurses Binding -- +# Makefile -- +# -- +# Version 00.92 -- +# -- +# The ncurses Ada95 binding is copyrighted 1996 by -- +# Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +# -- +# Permission is hereby granted to reproduce and distribute this -- +# binding by any means and for any fee, whether alone or as part -- +# of a larger distribution, in source or in binary form, PROVIDED -- +# this notice is included with any such distribution, and is not -- +# removed from any of its header files. Mention of ncurses and the -- +# author of this binding in any applications linked with it is -- +# highly appreciated. -- +# -- +# This binding comes AS IS with no warranty, implied or expressed. -- +#---------------------------------------------------------------------------- +# Version Control +# $Revision: 1.3 $ +# +SHELL = /bin/sh +THIS = Makefile + +SUBDIRS = @ADA_SUBDIRS@ + +all :: + for d in $(SUBDIRS); do \ + (cd $$d ; $(MAKE) $@) ;\ + done + +clean :: + for d in $(SUBDIRS); do \ + (cd $$d ; $(MAKE) $@) ;\ + done + +distclean :: + for d in $(SUBDIRS); do \ + (cd $$d ; $(MAKE) $@) ;\ + done + rm -f Makefile + +realclean :: + for d in $(SUBDIRS); do \ + (cd $$d ; $(MAKE) $@) ;\ + done + rm -f Makefile + +mostlyclean :: + for d in $(SUBDIRS); do \ + (cd $$d ; $(MAKE) $@) ;\ + done + +install :: diff --git a/Ada95/README b/Ada95/README new file mode 100644 index 00000000..6a5362df --- /dev/null +++ b/Ada95/README @@ -0,0 +1,29 @@ +The ncurses Ada95 binding is copyrighted 1996 by Juergen Pfeifer +Email: Juergen.Pfeifer@T-Online.de + +Permission is hereby granted to reproduce and distribute this +binding by any means and for any fee, whether alone or as part +of a larger distribution, in source or in binary form, PROVIDED +this notice is included with any such distribution, and is not +removed from any of its header files. Mention of ncurses and the +author of this binding in any applications linked with it is +highly appreciated. + +This binding comes AS IS with no warranty, implied or expressed. +---------------------------------------------------------------------- +Caveats: + + This is the first delivery of this binding. It has not been + extensively tested. So I declare this as BETA level software, + although it is delivered with an official release of ncurses. + + You should install the ncurses distribution around this binding + first before you try to run the sample. + + This Binding is currently strictly for the GNAT compiler, because + in one place I use a GNAT specfic runtime module (see doc.) + + +The documentation is provided in HTML format in the ./html +subdirectory. The main document is named index.html + diff --git a/Ada95/TODO b/Ada95/TODO new file mode 100644 index 00000000..8516d227 --- /dev/null +++ b/Ada95/TODO @@ -0,0 +1,25 @@ +-- Intensive testing + Perhaps the delivery of the Beta will help a bit. + +-- Documentation + Like most WEB pages: under continous construction + +-- Style cleanup + +-- Alternate functions for procedures with out params + Comfort purpose + +-- Sample program + Under continous construction (and it's not a WEB page!!!) + +-- Make the binding objects a shared libray + They are rather large, so it would make sense, otherwise Ada95 + would look too large, although the generated code is as compact + as C or C++. I'll wait a bit until the GNAT people provide some + better support to construct shared libraries. + +-- Think about more inlining + +-- Check for memory leaks. + Oh I would like it so much if the GNAT guys would put an optional + GC into their system. diff --git a/Ada95/ada_include/Makefile.in b/Ada95/ada_include/Makefile.in new file mode 100644 index 00000000..7cb92304 --- /dev/null +++ b/Ada95/ada_include/Makefile.in @@ -0,0 +1,207 @@ +#---------------------------------------------------------------------------- +# -- +# GNAT ncurses Binding -- +# src/Makefile -- +# -- +# Version 00.92 -- +# -- +# The ncurses Ada95 binding is copyrighted 1996 by -- +# Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +# -- +# Permission is hereby granted to reproduce and distribute this -- +# binding by any means and for any fee, whether alone or as part -- +# of a larger distribution, in source or in binary form, PROVIDED -- +# this notice is included with any such distribution, and is not -- +# removed from any of its header files. Mention of ncurses and the -- +# author of this binding in any applications linked with it is -- +# highly appreciated. -- +# -- +# This binding comes AS IS with no warranty, implied or expressed. -- +#---------------------------------------------------------------------------- +# Version Control +# $Revision: 1.6 $ +# +.SUFFIXES: + +SHELL = /bin/sh +THIS = Makefile + +MODEL = ../../@DFT_OBJ_SUBDIR@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ +datadir = @datadir@ +ticdir = $(datadir)/terminfo + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +AWK = @AWK@ +LN_S = @LN_S@ + +CC = @CC@ +CFLAGS = @CFLAGS@ + +CPPFLAGS = @ACPPFLAGS@ \ + -DHAVE_CONFIG_H -I$(srcdir) + +CCFLAGS = $(CPPFLAGS) $(CFLAGS) + +CFLAGS_NORMAL = $(CCFLAGS) +CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE +CFLAGS_PROFILE = $(CCFLAGS) -pg +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ + +CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) + +LINK = $(CC) +LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ + +RANLIB = @RANLIB@ +################################################################################ +ADA = @nc_ada_compiler@ +ADAFLAGS = @ADAFLAGS@ -I. -I$(srcdir) + +ADAMAKE = @nc_ada_make@ +ADAMAKEFLAGS = + +CARGS = -cargs $(ADAFLAGS) +LARGS = + +ALIB = @nc_ada_package@ +ABASE = $(ALIB)-curses + +ADA_OBJDIR = ../ada_objects +OBJDIR = ../objects + +LIBALIS=$(ADA_OBJDIR)/$(ALIB).ali \ + $(ADA_OBJDIR)/$(ABASE)-aux.ali \ + $(ADA_OBJDIR)/$(ABASE).ali \ + $(ADA_OBJDIR)/$(ABASE)-mouse.ali \ + $(ADA_OBJDIR)/$(ABASE)-panels.ali \ + $(ADA_OBJDIR)/$(ABASE)-menus.ali \ + $(ADA_OBJDIR)/$(ABASE)-forms.ali \ + $(ADA_OBJDIR)/$(ABASE)-text_io.ali \ + $(ADA_OBJDIR)/$(ABASE)-text_io-aux.ali + +LIBOBJS=$(ADA_OBJDIR)/$(ALIB).o \ + $(ADA_OBJDIR)/$(ABASE)-aux.o \ + $(ADA_OBJDIR)/$(ABASE).o \ + $(ADA_OBJDIR)/$(ABASE)-mouse.o \ + $(ADA_OBJDIR)/$(ABASE)-panels.o \ + $(ADA_OBJDIR)/$(ABASE)-menus.o \ + $(ADA_OBJDIR)/$(ABASE)-forms.o \ + $(ADA_OBJDIR)/$(ABASE)-text_io.o \ + $(ADA_OBJDIR)/$(ABASE)-text_io-aux.o + + +all :: $(LIBALIS) + @echo done + +clean :: + rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] *.a + +mostlyclean :: clean + rm -f $(LIBALIS) $(LIBOBJS) + +distclean :: mostlyclean + rm -f Makefile + +realclean :: distclean + +BASEDEPS=$(ABASE).ads $(srcdir)/$(ABASE)-aux.ads + +$(ADA_OBJDIR)/$(ALIB).o: $(srcdir)/$(ALIB).ads + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ALIB).ads + +$(ADA_OBJDIR)/$(ALIB).ali: $(ADA_OBJDIR)/$(ALIB).o + if [ -f $(ALIB).ali ]; then \ + ln -f $(ALIB).ali $@ ;\ + rm -f $(ALIB).ali ;\ + fi + +$(ADA_OBJDIR)/$(ABASE)-aux.o: $(srcdir)/$(ABASE)-aux.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-aux.adb + +$(ADA_OBJDIR)/$(ABASE)-aux.ali: $(ADA_OBJDIR)/$(ABASE)-aux.o + if [ -f $(ABASE)-aux.ali ]; then \ + ln -f $(ABASE)-aux.ali $@ ;\ + rm -f $(ABASE)-aux.ali ;\ + fi + +$(ADA_OBJDIR)/$(ABASE).o: $(srcdir)/$(ABASE).adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE).adb + +$(ADA_OBJDIR)/$(ABASE).ali: $(ADA_OBJDIR)/$(ABASE).o + if [ -f $(ABASE).ali ]; then \ + ln -f $(ABASE).ali $@ ;\ + rm -f $(ABASE).ali ;\ + fi + +$(ADA_OBJDIR)/$(ABASE)-mouse.o: \ + $(ABASE)-mouse.ads \ + $(srcdir)/$(ABASE)-mouse.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-mouse.adb + +$(ADA_OBJDIR)/$(ABASE)-mouse.ali: $(ADA_OBJDIR)/$(ABASE)-mouse.o + if [ -f $(ABASE)-mouse.ali ]; then \ + ln -f $(ABASE)-mouse.ali $@ ;\ + rm -f $(ABASE)-mouse.ali ;\ + fi + +$(ADA_OBJDIR)/$(ABASE)-panels.o: \ + $(ABASE)-panels.ads \ + $(srcdir)/$(ABASE)-panels.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-panels.adb + +$(ADA_OBJDIR)/$(ABASE)-panels.ali: $(ADA_OBJDIR)/$(ABASE)-panels.o + if [ -f $(ABASE)-panels.ali ]; then \ + ln -f $(ABASE)-panels.ali $@ ;\ + rm -f $(ABASE)-panels.ali ;\ + fi + +$(ADA_OBJDIR)/$(ABASE)-menus.o: \ + $(ABASE)-menus.ads \ + $(srcdir)/$(ABASE)-menus.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-menus.adb + +$(ADA_OBJDIR)/$(ABASE)-menus.ali: $(ADA_OBJDIR)/$(ABASE)-menus.o + if [ -f $(ABASE)-menus.ali ]; then \ + ln -f $(ABASE)-menus.ali $@ ;\ + rm -f $(ABASE)-menus.ali ;\ + fi + +$(ADA_OBJDIR)/$(ABASE)-forms.o: \ + $(ABASE)-forms.ads \ + $(srcdir)/$(ABASE)-forms.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-forms.adb + +$(ADA_OBJDIR)/$(ABASE)-forms.ali: $(ADA_OBJDIR)/$(ABASE)-forms.o + if [ -f $(ABASE)-forms.ali ]; then \ + ln -f $(ABASE)-forms.ali $@ ;\ + rm -f $(ABASE)-forms.ali ;\ + fi + +$(ADA_OBJDIR)/$(ABASE)-text_io.o: \ + $(srcdir)/$(ABASE)-text_io.ads \ + $(srcdir)/$(ABASE)-text_io.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io.adb + +$(ADA_OBJDIR)/$(ABASE)-text_io.ali: $(ADA_OBJDIR)/$(ABASE)-text_io.o + if [ -f $(ABASE)-text_io.ali ]; then \ + ln -f $(ABASE)-text_io.ali $@ ;\ + rm -f $(ABASE)-text_io.ali ;\ + fi + +$(ADA_OBJDIR)/$(ABASE)-text_io-aux.o: \ + $(srcdir)/$(ABASE)-text_io-aux.ads \ + $(srcdir)/$(ABASE)-text_io-aux.adb $(BASEDEPS) + $(ADA) $(ADAFLAGS) -c -o $@ $(srcdir)/$(ABASE)-text_io-aux.adb + +$(ADA_OBJDIR)/$(ABASE)-text_io-aux.ali: $(ADA_OBJDIR)/$(ABASE)-text_io-aux.o + if [ -f $(ABASE)-text_io-aux.ali ]; then \ + ln -f $(ABASE)-text_io-aux.ali $@ ;\ + rm -f $(ABASE)-text_io-aux.ali ;\ + fi diff --git a/Ada95/ada_include/terminal_interface-curses-aux.adb b/Ada95/ada_include/terminal_interface-curses-aux.adb new file mode 100644 index 00000000..e6fac3b9 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-aux.adb @@ -0,0 +1,81 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Aux -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +package body Terminal_Interface.Curses.Aux is + -- + -- Some helpers + procedure Fill_String (Cp : in chars_ptr; + Str : out String) + is + -- Fill the string with the characters referenced by the + -- chars_ptr. + -- + Len : Natural; + begin + if Cp /= Null_Ptr then + Len := Natural (Strlen (Cp)); + if Str'Length < Len then + raise Constraint_Error; + end if; + declare + S : String (1 .. Len); + begin + S := Value (Cp); + Str (Str'First .. (Str'First + Len - 1)) := S (S'Range); + end; + else + Len := 0; + end if; + + if Len < Str'Length then + Str ((Str'First + Len) .. Str'Last) := (others => ' '); + end if; + + end Fill_String; + + procedure Eti_Exception (Code : Eti_Error) + is + begin + case Code is + when E_Ok => null; + when E_System_Error => raise Eti_System_Error; + when E_Bad_Argument => raise Eti_Bad_Argument; + when E_Posted => raise Eti_Posted; + when E_Connected => raise Eti_Connected; + when E_Bad_State => raise Eti_Bad_State; + when E_No_Room => raise Eti_No_Room; + when E_Not_Posted => raise Eti_Not_Posted; + when E_Unknown_Command => raise Eti_Unknown_Command; + when E_No_Match => raise Eti_No_Match; + when E_Not_Selectable => raise Eti_Not_Selectable; + when E_Not_Connected => raise Eti_Not_Connected; + when E_Request_Denied => raise Eti_Request_Denied; + when E_Invalid_Field => raise Eti_Invalid_Field; + when E_Current => raise Eti_Current; + end case; + end Eti_Exception; + +end Terminal_Interface.Curses.Aux; diff --git a/Ada95/ada_include/terminal_interface-curses-aux.ads b/Ada95/ada_include/terminal_interface-curses-aux.ads new file mode 100644 index 00000000..834ad7dc --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-aux.ads @@ -0,0 +1,90 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Aux -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +with System; +with Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Unchecked_Conversion; + +package Terminal_Interface.Curses.Aux is + + use type Interfaces.C.Int; + + subtype C_Int is Interfaces.C.Int; + subtype C_Short is Interfaces.C.Short; + subtype C_Long_Int is Interfaces.C.Long; + subtype C_Size_T is Interfaces.C.Size_T; + subtype C_Char_Ptr is Interfaces.C.Strings.Chars_Ptr; + type C_Void_Ptr is new System.Address; + + -- This is how those constants are defined in ncurses. I see them also + -- exactly like this in all ETI implementations I ever tested. So it + -- could be that this is quite general, but please check with your curses. + -- This is critical, because curses sometime mixes boolean returns with + -- returning an error status. + Curses_Ok : constant C_Int := 0; + Curses_Err : constant C_Int := -1; + + Curses_True : constant C_Int := 1; + Curses_False : constant C_Int := 0; + + subtype Eti_Error is C_Int range -14 .. 0; + -- Type for error codes returned by the menu and forms subsystem + + E_Ok : constant Eti_Error := 0; + E_System_Error : constant Eti_Error := -1; + E_Bad_Argument : constant Eti_Error := -2; + E_Posted : constant Eti_Error := -3; + E_Connected : constant Eti_Error := -4; + E_Bad_State : constant Eti_Error := -5; + E_No_Room : constant Eti_Error := -6; + E_Not_Posted : constant Eti_Error := -7; + E_Unknown_Command : constant Eti_Error := -8; + E_No_Match : constant Eti_Error := -9; + E_Not_Selectable : constant Eti_Error := -10; + E_Not_Connected : constant Eti_Error := -11; + E_Request_Denied : constant Eti_Error := -12; + E_Invalid_Field : constant Eti_Error := -13; + E_Current : constant Eti_Error := -14; + + procedure Eti_Exception (Code : Eti_Error); + -- Dispatch the error code and raise the appropriate exception + -- + -- + -- Some helpers + function CInt_To_Chtype is new + Unchecked_Conversion (Source => C_Int, + Target => Attributed_Character); + function Chtype_To_CInt is new + Unchecked_Conversion (Source => Attributed_Character, + Target => C_Int); + + procedure Fill_String (Cp : in chars_ptr; + Str : out String); + -- Fill the Str parameter with the string denoted by the chars_ptr + -- C-Style string. + +end Terminal_Interface.Curses.Aux; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-choice_field_types.adb b/Ada95/ada_include/terminal_interface-curses-forms-choice_field_types.adb new file mode 100644 index 00000000..396287ec --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-forms-choice_field_types.adb @@ -0,0 +1,88 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Choice_Field_Types -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.5 $ +------------------------------------------------------------------------------ +with Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Terminal_Interface.Curses.Forms.Field_Types; + +-- | +-- |===================================================================== +-- | man page form_fieldtype.3x +-- |===================================================================== +-- | +package body Terminal_Interface.Curses.Forms.Choice_Field_Types is + + use type Interfaces.C.int; + + package Ft is new Terminal_Interface.Curses.Forms.Field_Types + (User, User_Access, Field_Check, Character_Check); + + type N_Check is access + function (Fld : Field; Info : User_Access) return Boolean; + pragma Convention (C, N_Check); + + type P_Check is access + function (Fld : Field; Info : User_Access) return Boolean; + pragma Convention (C, P_Check); + + function Nc (Fld : Field; Info : User_Access) return Boolean; + pragma Convention (C, Nc); + + function Pc (Fld : Field; Info : User_Access) return Boolean; + pragma Convention (C, Pc); + + function Nc (Fld : Field; Info : User_Access) return Boolean + is + begin + return Next_Choice (Fld, Info); + end Nc; + + function Pc (Fld : Field; Info : User_Access) return Boolean + is + begin + return Prev_Choice (Fld, Info); + end Pc; + -- | + -- | + -- | + function Set_Choice (Ft : C_Field_Type; + Nc : N_Check; + Pc : P_Check) return C_Int; + pragma Import (C, Set_Choice, "set_fieldtype_choice"); + + procedure Define_Choices + is + R : Eti_Error; + begin + R := Set_Choice (Search_Type (User'Tag), Nc'Access, Pc'Access); + if (R /= E_OK) then + Eti_Exception (R); + end if; + end Define_Choices; + +begin + Define_Choices; +end Terminal_Interface.Curses.Forms.Choice_Field_Types; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-choice_field_types.ads b/Ada95/ada_include/terminal_interface-curses-forms-choice_field_types.ads new file mode 100644 index 00000000..24a9375f --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-forms-choice_field_types.ads @@ -0,0 +1,46 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Choice_Field_Types -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.6 $ +------------------------------------------------------------------------------ +-- You must instantiate this package for any user defined field type +-- to make it visible to the runtime. +-- +generic + type User is new Ada_Defined_Field_Type with private; + type User_Access is access User; + with function Field_Check (Fld : Field; + Info : User_Access) return Boolean; + with function Character_Check (Ch : Character; + Info : User_Access) return Boolean; + with function Next_Choice (Fld : Field; + Info : User_Access) return Boolean; + with function Prev_Choice (Fld : Field; + Info : User_Access) return Boolean; +package Terminal_Interface.Curses.Forms.Choice_Field_Types is +-- +-- Nothing public. +-- But we need the body. + pragma Elaborate_Body; +end Terminal_Interface.Curses.Forms.Choice_Field_Types; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types.adb b/Ada95/ada_include/terminal_interface-curses-forms-field_types.adb new file mode 100644 index 00000000..13d2885f --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-forms-field_types.adb @@ -0,0 +1,182 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +with Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Unchecked_Deallocation; + +-- | +-- |===================================================================== +-- | man page form_fieldtype.3x +-- |===================================================================== +-- | +package body Terminal_Interface.Curses.Forms.Field_Types is + + use type Interfaces.C.int; + + type F_Check is access + function (Fld : Field; Info : User_Access) return C_Int; + pragma Convention (C, F_Check); + + type C_Check is access + function (Ch : Character; Info : User_Access) return C_Int; + pragma Convention (C, C_Check); + + procedure Free is new + Unchecked_Deallocation (User, User_Access); + + -- Forward decls. + procedure Register_Field_Type; + procedure Unregister_Field_Type; + + procedure Initialize (Obj : in out Tracker) + is + begin + Register_Field_Type; + end Initialize; + + procedure Finalize (Obj : in out Tracker) + is + begin + Unregister_Field_Type; + end Finalize; + + function Fc (Fld : Field; Info : User_Access) return C_Int; + pragma Convention (C, Fc); + + function Cc (Ch : Character; Info : User_Access) return C_Int; + pragma Convention (C, Cc); + + function Make_Arg (U : User_Access) return User_Access; + pragma Convention (C, Make_Arg); + + function Copy_Arg (U : User_Access) return User_Access; + pragma Convention (C, Copy_Arg); + + procedure Free_Arg (U : User_Access); + pragma Convention (C, Free_Arg); + + function New_Fieldtype (Fc : F_Check; + Cc : C_Check) return C_Field_Type; + pragma Import (C, New_Fieldtype, "new_fieldtype"); + + function Fc (Fld : Field; Info : User_Access) return C_Int + is + begin + return C_Int (Boolean'Pos (Field_Check (Fld, Info))); + end Fc; + + function Cc (Ch : Character; Info : User_Access) return C_Int + is + begin + return C_Int (Boolean'Pos (Character_Check (Ch, Info))); + end Cc; + + function Make_Arg (U : User_Access) return User_Access + is + function Fixme (U : User_Access) return User_Access; + pragma Import (C, Fixme, "_nc_ada_getvarg"); + V : constant User_Access := Fixme (U); + I : constant User_Access := new User'(V.all); + begin + return I; + end Make_Arg; + + function Copy_Arg (U : User_Access) return User_Access + is + I : constant User_Access := new User'(U.all); + begin + return I; + end Copy_Arg; + + procedure Free_Arg (U : User_Access) + is + begin + null; + end Free_Arg; + + type M_Arg is access function (U : User_Access) return User_Access; + pragma Convention (C, M_Arg); + + type C_Arg is access function (U : User_Access) return User_Access; + pragma Convention (C, C_Arg); + + type F_Arg is access procedure (U : User_Access); + pragma Convention (C, F_Arg); + + function Set_Fieldtype_Arg (Typ : C_Field_Type; + Ma : M_Arg; + Ca : C_Arg; + Fa : F_Arg) return C_Int; + pragma Import (C, Set_Fieldtype_Arg, "set_fieldtype_arg"); + -- | + -- | + -- | + + procedure Register_Field_Type + is + Res : Eti_Error; + Cft : C_Field_Type; + P : User_Access := new User; + -- we need an instance to call + -- the Register_Type procedure + begin + Cft := New_Fieldtype (Fc'Access, + Cc'Access); + if Cft = Null_Field_Type then + raise Form_Exception; + end if; + Res := Set_Fieldtype_Arg (Cft, + Make_Arg'Access, + Copy_Arg'Access, + Free_Arg'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + + Register_Type (P.all, Cft); + Free (P); + end Register_Field_Type; + -- | + -- | + -- | + procedure Unregister_Field_Type + is + P : User_Access := new User; + -- we need an instance to call + -- the Unregister_Type procedure + begin + Unregister_Type (P.all); + Free (P); + end Unregister_Field_Type; + + Hook : Tracker; +end Terminal_Interface.Curses.Forms.Field_Types; + + + + + diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_types.ads b/Ada95/ada_include/terminal_interface-curses-forms-field_types.ads new file mode 100644 index 00000000..70589948 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-forms-field_types.ads @@ -0,0 +1,50 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_Types -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Ada.Finalization; use Ada.Finalization; + +-- You must instantiate this package for any user defined field type +-- to make it visible to the runtime. +-- +generic + type User is new Ada_Defined_Field_Type with private; + type User_Access is access User; + with function Field_Check (Fld : Field; + Info : User_Access) return Boolean; + with function Character_Check (Ch : Character; + Info : User_Access) return Boolean; +package Terminal_Interface.Curses.Forms.Field_Types is +-- +-- Nothing public. All happens magically. +-- +private + type Tracker is new Limited_Controlled with null record; + + procedure Initialize (Obj : in out Tracker); + procedure Finalize (Obj : in out Tracker); + +end Terminal_Interface.Curses.Forms.Field_Types; + diff --git a/Ada95/ada_include/terminal_interface-curses-forms-field_user_data.adb b/Ada95/ada_include/terminal_interface-curses-forms-field_user_data.adb new file mode 100644 index 00000000..dd8aba56 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-forms-field_user_data.adb @@ -0,0 +1,81 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_User_Data -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Unchecked_Conversion; +with Terminal_Interface.Curses.Aux; +use Terminal_Interface.Curses.Aux; + +-- | +-- |===================================================================== +-- | man page form_field_userptr.3x +-- |===================================================================== +-- | +package body Terminal_Interface.Curses.Forms.Field_User_Data is + + function To_Address is new Unchecked_Conversion (User_Access, + System.Address); + function To_Pointer is new Unchecked_Conversion (System.Address, + User_Access); + -- | + -- | + -- | + procedure Set_User_Data (Fld : in Field; + Data : in User_Access) + is + A : constant Field_User_Wrapper_Access := Field_Userptr (Fld); + B : Field_User_Wrapper_Access; + R : C_Int; + begin + if A = null then + raise Form_Exception; + else + if A.N > 1 then + B := new Field_User_Wrapper'(T => A.T, + N => 1, + U => To_Address (Data)); + R := Set_Field_Userptr (Fld, B); + A.N := A.N - 1; + else + A.U := To_Address (Data); + end if; + end if; + end Set_User_Data; + -- | + -- | + -- | + procedure Get_User_Data (Fld : in Field; + Data : out User_Access) + is + A : constant Field_User_Wrapper_Access := Field_Userptr (Fld); + begin + if A = null then + raise Form_Exception; + else + Data := To_Pointer (A.U); + end if; + end Get_User_Data; + +end Terminal_Interface.Curses.Forms.Field_User_Data; diff --git a/Ada95/ada_include/terminal_interface-curses-forms-form_user_data.adb b/Ada95/ada_include/terminal_interface-curses-forms-form_user_data.adb new file mode 100644 index 00000000..9022a044 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-forms-form_user_data.adb @@ -0,0 +1,68 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Form_User_Data -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Unchecked_Conversion; +-- | +-- |===================================================================== +-- | man page form__userptr.3x +-- |===================================================================== +-- | +package body Terminal_Interface.Curses.Forms.Form_User_Data is + + function To_Address is new Unchecked_Conversion (User_Access, + System.Address); + function To_Pointer is new Unchecked_Conversion (System.Address, + User_Access); + -- | + -- | + -- | + procedure Set_User_Data (Frm : in Form; + Data : in User_Access) + is + A : constant Form_User_Wrapper_Access := Form_Userptr (Frm); + begin + if A = null then + raise Form_Exception; + else + A.U := To_Address (Data); + end if; + end Set_User_Data; + -- | + -- | + -- | + procedure Get_User_Data (Frm : in Form; + Data : out User_Access) + is + A : constant Form_User_Wrapper_Access := Form_Userptr (Frm); + begin + if A = null then + raise Form_Exception; + else + Data := To_Pointer (A.U); + end if; + end Get_User_Data; + +end Terminal_Interface.Curses.Forms.Form_User_Data; diff --git a/Ada95/ada_include/terminal_interface-curses-forms.adb b/Ada95/ada_include/terminal_interface-curses-forms.adb new file mode 100644 index 00000000..059ae238 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-forms.adb @@ -0,0 +1,1693 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.9 $ +------------------------------------------------------------------------------ +with Ada.Tags; use Ada.Tags; +with Ada.Unchecked_Deallocation; +with Unchecked_Conversion; + +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; + +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with GNAT.Htable; + +package body Terminal_Interface.Curses.Forms is + +------------------------------------------------------------------------------ + -- | + -- | + -- | + -- subtype chars_ptr is Interfaces.C.Strings.chars_ptr; + + function FOS_2_CInt is new + Unchecked_Conversion (Field_Option_Set, + C_Int); + + function CInt_2_FOS is new + Unchecked_Conversion (C_Int, + Field_Option_Set); + + function FrmOS_2_CInt is new + Unchecked_Conversion (Form_Option_Set, + C_Int); + + function CInt_2_FrmOS is new + Unchecked_Conversion (C_Int, + Form_Option_Set); + + procedure Request_Name (Key : in Form_Request_Code; + Name : out String) + is + function Form_Request_Name (Key : C_Int) return chars_ptr; + pragma Import (C, Form_Request_Name, "form_request_name"); + begin + Fill_String (Form_Request_Name (C_Int (Key)), Name); + end Request_Name; +------------------------------------------------------------------------------ + procedure Free_Field_User_Wrapper is + new Ada.Unchecked_Deallocation (Field_User_Wrapper, + Field_User_Wrapper_Access); + + procedure Release_User_Wrapper (A : in out Field_User_Wrapper_Access); + procedure Dup_User_Wrapper (A : in out Field_User_Wrapper_Access); + + procedure Release_User_Wrapper (A : in out Field_User_Wrapper_Access) + is + begin + A.N := A.N - 1; + if A.N = 0 then + Free_Field_User_Wrapper (A); + end if; + end Release_User_Wrapper; + pragma Inline (Release_User_Wrapper); + + procedure Dup_User_Wrapper (A : in out Field_User_Wrapper_Access) + is + begin + A.N := A.N + 1; + end Dup_User_Wrapper; + pragma Inline (Dup_User_Wrapper); +------------------------------------------------------------------------------ + procedure Free_Form_User_Wrapper is + new Ada.Unchecked_Deallocation (Form_User_Wrapper, + Form_User_Wrapper_Access); + -- | + -- | + -- | + -- | + -- |===================================================================== + -- | man page form_field_new.3x + -- |===================================================================== + -- | + -- | + -- | + function Create (Height : Line_Count; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0; + More_Buffers : Buffer_Number := Buffer_Number'First) + return Field + is + function Newfield (H, W, T, L, O, M : C_Int) return Field; + pragma Import (C, Newfield, "new_field"); + Fld : constant Field := Newfield (C_Int (Height), C_Int (Width), + C_Int (Top), C_Int (Left), + C_Int (Off_Screen), + C_Int (More_Buffers)); + + A : Field_User_Wrapper_Access; + Res : Eti_Error; + begin + if Fld = Null_Field then + raise Form_Exception; + else + A := new Field_User_Wrapper'(U => System.Null_Address, + T => null, + N => 1); + Res := Set_Field_Userptr (Fld, A); + if Res /= E_Ok then + Free_Field_User_Wrapper (A); + Eti_Exception (Res); + end if; + end if; + return Fld; + end Create; +-- | +-- | +-- | + procedure Delete (Fld : in out Field) + is + function Free_Field (Fld : Field) return C_Int; + pragma Import (C, Free_Field, "free_field"); + procedure Free_Field_Type is + new Ada.Unchecked_Deallocation (Field_Type'Class, + Field_Type_Access); + + A : Field_User_Wrapper_Access := Field_Userptr (Fld); + Res : Eti_Error; + begin + if A /= null then + if A.T /= null then + Free_Field_Type (A.T); + end if; + Release_User_Wrapper (A); + end if; + Res := Free_Field (Fld); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Fld := Null_Field; + end Delete; + -- | + -- | + -- | + function Duplicate (Fld : Field; + Top : Line_Position; + Left : Column_Position) return Field + is + function Dup_Field (Fld : Field; + Top : C_Int; + Left : C_Int) return Field; + pragma Import (C, Dup_Field, "dup_field"); + + A : Field_User_Wrapper_Access := Field_Userptr (Fld); + F : constant Field := Dup_Field (Fld, + C_Int (Top), + C_Int (Left)); + begin + if F = Null_Field then + raise Form_Exception; + else + Dup_User_Wrapper (A); + end if; + return F; + end Duplicate; + -- | + -- | + -- | + function Link (Fld : Field; + Top : Line_Position; + Left : Column_Position) return Field + is + function Lnk_Field (Fld : Field; + Top : C_Int; + Left : C_Int) return Field; + pragma Import (C, Lnk_Field, "link_field"); + + A : Field_User_Wrapper_Access := Field_Userptr (Fld); + F : constant Field := Lnk_Field (Fld, + C_Int (Top), + C_Int (Left)); + begin + if F = Null_Field then + raise Form_Exception; + else + Dup_User_Wrapper (A); + end if; + return F; + end Link; + -- | + -- |===================================================================== + -- | man page form_field_just.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Justification (Fld : in Field; + Just : in Field_Justification := None) + is + function Set_Field_Just (Fld : Field; + Just : C_Int) return C_Int; + pragma Import (C, Set_Field_Just, "set_field_just"); + + Res : constant Eti_Error := + Set_Field_Just (Fld, + C_Int (Field_Justification'Pos (Just))); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Justification; + -- | + -- | + -- | + function Get_Justification (Fld : Field) return Field_Justification + is + function Field_Just (Fld : Field) return C_Int; + pragma Import (C, Field_Just, "field_just"); + begin + return Field_Justification'Val (Field_Just (Fld)); + end Get_Justification; + -- | + -- |===================================================================== + -- | man page form_field_buffer.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Buffer + (Fld : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; + Str : in String) + is + type Char_Ptr is access all Interfaces.C.Char; + function Set_Fld_Buffer (Fld : Field; + Bufnum : C_Int; + S : Char_Ptr) + return C_Int; + pragma Import (C, Set_Fld_Buffer, "set_field_buffer"); + + Txt : char_array (0 .. Str'Length); + Len : size_t; + Res : Eti_Error; + begin + To_C (Str, Txt, Len); + Res := Set_Fld_Buffer (Fld, C_Int (Buffer), Txt (Txt'First)'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Buffer; + -- | + -- | + -- | + procedure Get_Buffer + (Fld : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; + Str : out String) + is + function Field_Buffer (Fld : Field; + B : C_Int) return chars_ptr; + pragma Import (C, Field_Buffer, "field_buffer"); + begin + Fill_String (Field_Buffer (Fld, C_Int (Buffer)), Str); + end Get_Buffer; + -- | + -- | + -- | + procedure Set_Status (Fld : in Field; + Status : in Boolean := True) + is + function Set_Fld_Status (Fld : Field; + St : C_Int) return C_Int; + pragma Import (C, Set_Fld_Status, "set_field_status"); + + Res : constant Eti_Error := Set_Fld_Status (Fld, Boolean'Pos (Status)); + begin + if Res /= E_Ok then + raise Form_Exception; + end if; + end Set_Status; + -- | + -- | + -- | + function Changed (Fld : Field) return Boolean + is + function Field_Status (Fld : Field) return C_Int; + pragma Import (C, Field_Status, "field_status"); + + Res : constant C_Int := Field_Status (Fld); + begin + if Res = Curses_False then + return False; + else + return True; + end if; + end Changed; + -- | + -- | + -- | + procedure Set_Maximum_Size (Fld : in Field; + Max : in Natural := 0) + is + function Set_Field_Max (Fld : Field; + M : C_Int) return C_Int; + pragma Import (C, Set_Field_Max, "set_max_field"); + + Res : constant Eti_Error := Set_Field_Max (Fld, C_Int (Max)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Maximum_Size; + -- | + -- |===================================================================== + -- | man page form_field_opts.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Normalize_Field_Options (Options : in out C_Int); + pragma Import (C, Normalize_Field_Options, "_nc_ada_normalize_field_opts"); + + procedure Set_Options (Fld : in Field; + Options : in Field_Option_Set) + is + function Set_Field_Opts (Fld : Field; + Opt : C_Int) return C_Int; + pragma Import (C, Set_Field_Opts, "set_field_opts"); + + Opt : C_Int := FOS_2_CInt (Options); + Res : Eti_Error; + begin + Normalize_Field_Options (Opt); + Res := Set_Field_Opts (Fld, Opt); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Options; + -- | + -- | + -- | + procedure Switch_Options (Fld : in Field; + Options : in Field_Option_Set; + On : Boolean := True) + is + function Field_Opts_On (Fld : Field; + Opt : C_Int) return C_Int; + pragma Import (C, Field_Opts_On, "field_opts_on"); + function Field_Opts_Off (Fld : Field; + Opt : C_Int) return C_Int; + pragma Import (C, Field_Opts_Off, "field_opts_off"); + + Err : Eti_Error; + Opt : C_Int := FOS_2_CInt (Options); + begin + Normalize_Field_Options (Opt); + if On then + Err := Field_Opts_On (Fld, Opt); + else + Err := Field_Opts_Off (Fld, Opt); + end if; + if Err /= E_Ok then + Eti_Exception (Err); + end if; + end Switch_Options; + -- | + -- | + -- | + procedure Get_Options (Fld : in Field; + Options : out Field_Option_Set) + is + function Field_Opts (Fld : Field) return C_Int; + pragma Import (C, Field_Opts, "field_opts"); + + Res : C_Int := Field_Opts (Fld); + begin + Normalize_Field_Options (Res); + Options := CInt_2_FOS (Res); + end Get_Options; + -- | + -- | + -- | + function Get_Options (Fld : Field := Null_Field) + return Field_Option_Set + is + Fos : Field_Option_Set; + begin + Get_Options (Fld, Fos); + return Fos; + end Get_Options; + -- | + -- |===================================================================== + -- | man page form_field_attributes.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Foreground + (Fld : in Field; + Fore : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) + is + function Set_Field_Fore (Fld : Field; + Attr : C_Int) return C_Int; + pragma Import (C, Set_Field_Fore, "set_field_fore"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Color => Color, + Attr => Fore); + Res : constant Eti_Error := Set_Field_Fore (Fld, Chtype_To_CInt (Ch)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Foreground; + -- | + -- | + -- | + procedure Foreground (Fld : in Field; + Fore : out Character_Attribute_Set) + is + function Field_Fore (Fld : Field) return C_Int; + pragma Import (C, Field_Fore, "field_fore"); + begin + Fore := CInt_To_Chtype (Field_Fore (Fld)).Attr; + end Foreground; + + procedure Foreground (Fld : in Field; + Fore : out Character_Attribute_Set; + Color : out Color_Pair) + is + function Field_Fore (Fld : Field) return C_Int; + pragma Import (C, Field_Fore, "field_fore"); + begin + Fore := CInt_To_Chtype (Field_Fore (Fld)).Attr; + Color := CInt_To_Chtype (Field_Fore (Fld)).Color; + end Foreground; + -- | + -- | + -- | + procedure Set_Background + (Fld : in Field; + Back : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) + is + function Set_Field_Back (Fld : Field; + Attr : C_Int) return C_Int; + pragma Import (C, Set_Field_Back, "set_field_back"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Color => Color, + Attr => Back); + Res : constant Eti_Error := Set_Field_Back (Fld, Chtype_To_CInt (Ch)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Background; + -- | + -- | + -- | + procedure Background (Fld : in Field; + Back : out Character_Attribute_Set) + is + function Field_Back (Fld : Field) return C_Int; + pragma Import (C, Field_Back, "field_back"); + begin + Back := CInt_To_Chtype (Field_Back (Fld)).Attr; + end Background; + + procedure Background (Fld : in Field; + Back : out Character_Attribute_Set; + Color : out Color_Pair) + is + function Field_Back (Fld : Field) return C_Int; + pragma Import (C, Field_Back, "field_back"); + begin + Back := CInt_To_Chtype (Field_Back (Fld)).Attr; + Color := CInt_To_Chtype (Field_Back (Fld)).Color; + end Background; + -- | + -- | + -- | + procedure Set_Pad_Character (Fld : in Field; + Pad : in Character := Space) + is + function Set_Field_Pad (Fld : Field; + Ch : C_Int) return C_Int; + pragma Import (C, Set_Field_Pad, "set_field_pad"); + + Res : constant Eti_Error := Set_Field_Pad (Fld, + C_Int (Character'Pos (Pad))); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Pad_Character; + -- | + -- | + -- | + procedure Pad_Character (Fld : in Field; + Pad : out Character) + is + function Field_Pad (Fld : Field) return C_Int; + pragma Import (C, Field_Pad, "field_pad"); + begin + Pad := Character'Val (Field_Pad (Fld)); + end Pad_Character; + -- | + -- |===================================================================== + -- | man page form_field_info.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Info (Fld : in Field; + Lines : out Line_Count; + Columns : out Column_Count; + First_Row : out Line_Position; + First_Column : out Column_Position; + Off_Screen : out Natural; + Additional_Buffers : out Buffer_Number) + is + type C_Int_Access is access all C_Int; + function Fld_Info (Fld : Field; + L, C, Fr, Fc, Os, Ab : C_Int_Access) + return C_Int; + pragma Import (C, Fld_Info, "field_info"); + + L, C, Fr, Fc, Os, Ab : aliased C_Int; + Res : constant Eti_Error := Fld_Info (Fld, + L'Access, C'Access, + Fr'Access, Fc'Access, + Os'Access, Ab'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + else + Lines := Line_Count (L); + Columns := Column_Count (C); + First_Row := Line_Position (Fr); + First_Column := Column_Position (Fc); + Off_Screen := Natural (Os); + Additional_Buffers := Buffer_Number (Ab); + end if; + end Info; +-- | +-- | +-- | + procedure Dynamic_Info (Fld : in Field; + Lines : out Line_Count; + Columns : out Column_Count; + Max : out Natural) + is + type C_Int_Access is access all C_Int; + function Dyn_Info (Fld : Field; L, C, M : C_Int_Access) return C_Int; + pragma Import (C, Dyn_Info, "dynamic_field_info"); + + L, C, M : aliased C_Int; + Res : constant Eti_Error := Dyn_Info (Fld, + L'Access, C'Access, + M'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + else + Lines := Line_Count (L); + Columns := Column_Count (C); + Max := Natural (M); + end if; + end Dynamic_Info; + -- | + -- |===================================================================== + -- | man page form_win.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Window (Frm : in Form; + Win : in Window) + is + function Set_Form_Win (Frm : Form; + Win : Window) return C_Int; + pragma Import (C, Set_Form_Win, "set_form_win"); + + Res : constant Eti_Error := Set_Form_Win (Frm, Win); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Window; + -- | + -- | + -- | + function Get_Window (Frm : Form) return Window + is + function Form_Win (Frm : Form) return Window; + pragma Import (C, Form_Win, "form_win"); + + W : constant Window := Form_Win (Frm); + begin + return W; + end Get_Window; + -- | + -- | + -- | + procedure Set_Sub_Window (Frm : in Form; + Win : in Window) + is + function Set_Form_Sub (Frm : Form; + Win : Window) return C_Int; + pragma Import (C, Set_Form_Sub, "set_form_sub"); + + Res : constant Eti_Error := Set_Form_Sub (Frm, Win); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Sub_Window; + -- | + -- | + -- | + function Get_Sub_Window (Frm : Form) return Window + is + function Form_Sub (Frm : Form) return Window; + pragma Import (C, Form_Sub, "form_sub"); + + W : constant Window := Form_Sub (Frm); + begin + return W; + end Get_Sub_Window; + -- | + -- | + -- | + procedure Scale (Frm : in Form; + Lines : out Line_Count; + Columns : out Column_Count) + is + type C_Int_Access is access all C_Int; + function M_Scale (Frm : Form; Yp, Xp : C_Int_Access) return C_Int; + pragma Import (C, M_Scale, "scale_form"); + + X, Y : aliased C_Int; + Res : constant Eti_Error := M_Scale (Frm, Y'Access, X'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Lines := Line_Count (Y); + Columns := Column_Count (X); + end Scale; + -- | + -- |===================================================================== + -- | man page menu_hook.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Field_Init_Hook (Frm : in Form; + Proc : in Form_Hook_Function) + is + function Set_Field_Init (Frm : Form; + Proc : Form_Hook_Function) return C_Int; + pragma Import (C, Set_Field_Init, "set_field_init"); + + Res : constant Eti_Error := Set_Field_Init (Frm, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Field_Init_Hook; + -- | + -- | + -- | + procedure Set_Field_Term_Hook (Frm : in Form; + Proc : in Form_Hook_Function) + is + function Set_Field_Term (Frm : Form; + Proc : Form_Hook_Function) return C_Int; + pragma Import (C, Set_Field_Term, "set_field_term"); + + Res : constant Eti_Error := Set_Field_Term (Frm, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Field_Term_Hook; + -- | + -- | + -- | + procedure Set_Form_Init_Hook (Frm : in Form; + Proc : in Form_Hook_Function) + is + function Set_Form_Init (Frm : Form; + Proc : Form_Hook_Function) return C_Int; + pragma Import (C, Set_Form_Init, "set_form_init"); + + Res : constant Eti_Error := Set_Form_Init (Frm, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Form_Init_Hook; + -- | + -- | + -- | + procedure Set_Form_Term_Hook (Frm : in Form; + Proc : in Form_Hook_Function) + is + function Set_Form_Term (Frm : Form; + Proc : Form_Hook_Function) return C_Int; + pragma Import (C, Set_Form_Term, "set_form_term"); + + Res : constant Eti_Error := Set_Form_Term (Frm, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Form_Term_Hook; + -- | + -- |===================================================================== + -- | man page form_fields.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Free_Allocated_Fields is + new Ada.Unchecked_Deallocation (Field_Array, Field_Array_Access); + -- | + -- | + -- | + -- This is a bit delicate if we want to manipulate an Ada created form + -- from C routines or vice versa. + -- In Ada created forms we use the low level user pointer to maintain + -- binding internal additional informations about the form. This + -- internal information contains a hook for the Ada provided user pointer. + -- Unless you understand this implementation, the safest way in mixed + -- language programs to deal with user pointers is, that only the language + -- that created the form should also manipulate the user pointer for that + -- form. + procedure Redefine (Frm : in Form; + Flds : in Field_Array) + is + function Set_Frm_Fields (Frm : Form; + Items : Field_Array) return C_Int; + pragma Import (C, Set_Frm_Fields, "set_form_fields"); + + A : constant Form_User_Wrapper_Access := Form_Userptr (Frm); + I : Field_Array_Access; + Res : Eti_Error; + begin + if A = null or else A.I = null then raise Form_Exception; + else + I := new Field_Array (1 .. (Flds'Length + 1)); + I.all (1 .. Flds'Length) := Flds (Flds'First .. Flds'Last); + I.all (Flds'Length + 1) := Null_Field; + Res := Set_Frm_Fields (Frm, I.all); + if Res /= E_Ok then + Free_Allocated_Fields (I); + Eti_Exception (Res); + else + Free_Allocated_Fields (A.I); + A.I := I; + end if; + end if; + end Redefine; + -- | + -- | + -- | + function Fields (Frm : Form) return Field_Array_Access + is + A : constant Form_User_Wrapper_Access := Form_Userptr (Frm); + begin + if A = null or else A.I = null then + raise Form_Exception; + else + return A.I; + end if; + end Fields; + -- | + -- | + -- | + function Field_Count (Frm : Form) return Natural + is + function Count (Frm : Form) return C_Int; + pragma Import (C, Count, "field_count"); + begin + return Natural (Count (Frm)); + end Field_Count; + -- | + -- | + -- | + procedure Move (Fld : in Field; + Line : in Line_Position; + Column : in Column_Position) + is + function Move (Fld : Field; L, C : C_Int) return C_Int; + pragma Import (C, Move, "move_field"); + + Res : constant Eti_Error := Move (Fld, C_Int (Line), C_Int (Column)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Move; + -- | + -- |===================================================================== + -- | man page form_new.3x + -- |===================================================================== + -- | + -- | + -- | + function Create (Fields : Field_Array) return Form + is + function NewForm (Fields : Field_Array) return Form; + pragma Import (C, NewForm, "new_form"); + + M : Form; + I : Field_Array_Access; + U : Form_User_Wrapper_Access; + Res : Eti_Error; + begin + I := new Field_Array (1 .. (Fields'Length + 1)); + I.all (1 .. Fields'Length) := Fields (Fields'First .. Fields'Last); + I.all (Fields'Length + 1) := Null_Field; + M := NewForm (I.all); + if M = Null_Form then + Free_Allocated_Fields (I); + raise Form_Exception; + end if; + U := new Form_User_Wrapper'(U => System.Null_Address, I => I); + Res := Set_Form_Userptr (M, U); + if Res /= E_Ok then + Free_Allocated_Fields (I); + Free_Form_User_Wrapper (U); + Eti_Exception (Res); + end if; + return M; + end Create; + -- | + -- | + -- | + procedure Delete (Frm : in out Form) + is + function Free (Frm : Form) return C_Int; + pragma Import (C, Free, "free_form"); + + U : Form_User_Wrapper_Access := Form_Userptr (Frm); + Res : constant Eti_Error := Free (Frm); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + if U = null or else U.I = null then + raise Form_Exception; + end if; + Free_Allocated_Fields (U.I); + Free_Form_User_Wrapper (U); + Frm := Null_Form; + end Delete; + -- | + -- |===================================================================== + -- | man page form_opts.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Normalize_Form_Options (Options : in out C_Int); + pragma Import (C, Normalize_Form_Options, "_nc_ada_normalize_form_opts"); + + procedure Set_Options (Frm : in Form; + Options : in Form_Option_Set) + is + function Set_Form_Opts (Frm : Form; + Opt : C_Int) return C_Int; + pragma Import (C, Set_Form_Opts, "set_form_opts"); + + Opt : C_Int := FrmOS_2_CInt (Options); + Res : Eti_Error; + begin + Normalize_Form_Options (Opt); + Res := Set_Form_Opts (Frm, Opt); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Options; + -- | + -- | + -- | + procedure Switch_Options (Frm : in Form; + Options : in Form_Option_Set; + On : Boolean := True) + is + function Form_Opts_On (Frm : Form; + Opt : C_Int) return C_Int; + pragma Import (C, Form_Opts_On, "form_opts_on"); + function Form_Opts_Off (Frm : Form; + Opt : C_Int) return C_Int; + pragma Import (C, Form_Opts_Off, "form_opts_off"); + + Err : Eti_Error; + Opt : C_Int := FrmOS_2_CInt (Options); + begin + Normalize_Form_Options (Opt); + if On then + Err := Form_Opts_On (Frm, Opt); + else + Err := Form_Opts_Off (Frm, Opt); + end if; + if Err /= E_Ok then + Eti_Exception (Err); + end if; + end Switch_Options; + -- | + -- | + -- | + procedure Get_Options (Frm : in Form; + Options : out Form_Option_Set) + is + function Form_Opts (Frm : Form) return C_Int; + pragma Import (C, Form_Opts, "form_opts"); + + Res : C_Int := Form_Opts (Frm); + begin + Normalize_Form_Options (Res); + Options := CInt_2_FrmOS (Res); + end Get_Options; + -- | + -- | + -- | + function Get_Options (Frm : Form := Null_Form) return Form_Option_Set + is + Fos : Form_Option_Set; + begin + Get_Options (Frm, Fos); + return Fos; + end Get_Options; + -- | + -- |===================================================================== + -- | man page form_post.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Post (Frm : in Form; + Post : in Boolean := True) + is + function M_Post (Frm : Form) return C_Int; + pragma Import (C, M_Post, "post_form"); + function M_Unpost (Frm : Form) return C_Int; + pragma Import (C, M_Unpost, "unpost_form"); + + Res : Eti_Error; + begin + if Post then + Res := M_Post (Frm); + else + Res := M_Unpost (Frm); + end if; + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Post; + -- | + -- |===================================================================== + -- | man page form_cursor.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Position_Cursor (Frm : Form) + is + function Pos_Form_Cursor (Frm : Form) return C_Int; + pragma Import (C, Pos_Form_Cursor, "pos_form_cursor"); + + Res : constant Eti_Error := Pos_Form_Cursor (Frm); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Position_Cursor; + -- | + -- |===================================================================== + -- | man page form_data.3x + -- |===================================================================== + -- | + -- | + -- | + function Data_Ahead (Frm : Form) return Boolean + is + function Ahead (Frm : Form) return C_Int; + pragma Import (C, Ahead, "data_ahead"); + + Res : constant C_Int := Ahead (Frm); + begin + if Res = Curses_False then + return False; + else + return True; + end if; + end Data_Ahead; + -- | + -- | + -- | + function Data_Behind (Frm : Form) return Boolean + is + function Behind (Frm : Form) return C_Int; + pragma Import (C, Behind, "data_behind"); + + Res : constant C_Int := Behind (Frm); + begin + if Res = Curses_False then + return False; + else + return True; + end if; + end Data_Behind; + -- | + -- |===================================================================== + -- | man page form_driver.3x + -- |===================================================================== + -- | + -- | + -- | + function Driver (Frm : Form; + Key : Key_Code) return Driver_Result + is + function Frm_Driver (Frm : Form; Key : C_Int) return C_Int; + pragma Import (C, Frm_Driver, "form_driver"); + + R : Eti_Error := Frm_Driver (Frm, C_Int (Key)); + begin + if R /= E_Ok then + if R = E_Unknown_Command then + return Unknown_Request; + elsif R = E_Invalid_Field then + return Invalid_Field; + elsif R = E_Request_Denied then + return Request_Denied; + else + Eti_Exception (R); + return Form_Ok; + end if; + else + return Form_Ok; + end if; + end Driver; + -- | + -- |===================================================================== + -- | man page form_page.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_Current (Frm : in Form; + Fld : in Field) + is + function Set_Current_Fld (Frm : Form; Fld : Field) return C_Int; + pragma Import (C, Set_Current_Fld, "set_current_field"); + + Res : constant Eti_Error := Set_Current_Fld (Frm, Fld); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Current; + -- | + -- | + -- | + function Current (Frm : in Form) return Field + is + function Current_Fld (Frm : Form) return Field; + pragma Import (C, Current_Fld, "current_field"); + + Fld : constant Field := Current_Fld (Frm); + begin + if Fld = Null_Field then + raise Form_Exception; + end if; + return Fld; + end Current; + -- | + -- | + -- | + procedure Set_Page (Frm : in Form; + Page : in Page_Number := Page_Number'First) + is + function Set_Frm_Page (Frm : Form; Pg : C_Int) return C_Int; + pragma Import (C, Set_Frm_Page, "set_form_page"); + + Res : constant Eti_Error := Set_Frm_Page (Frm, C_Int (Page)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Page; + -- | + -- | + -- | + function Page (Frm : Form) return Page_Number + is + function Get_Page (Frm : Form) return C_Int; + pragma Import (C, Get_Page, "form_page"); + + P : constant C_Int := Get_Page (Frm); + begin + if P < 0 then + raise Form_Exception; + else + return Page_Number (P); + end if; + end Page; + + function Get_Index (Fld : Field) return Positive + is + function Get_Fieldindex (Fld : Field) return C_Int; + pragma Import (C, Get_Fieldindex, "field_index"); + + Res : constant C_Int := Get_Fieldindex (Fld); + begin + if Res = Curses_Err then + raise Form_Exception; + end if; + return Positive (Natural (Res) + Positive'First); + end Get_Index; + + -- | + -- |===================================================================== + -- | man page form_new_page.3x + -- |===================================================================== + -- | + -- | + -- | + procedure Set_New_Page (Fld : in Field; + New_Page : in Boolean := True) + is + function Set_Page (Fld : Field; Flg : C_Int) return C_Int; + pragma Import (C, Set_Page, "set_new_page"); + + Res : constant Eti_Error := Set_Page (Fld, Boolean'Pos (New_Page)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_New_Page; + -- | + -- | + -- | + function Is_New_Page (Fld : Field) return Boolean + is + function Is_New (Fld : Field) return C_Int; + pragma Import (C, Is_New, "new_page"); + + Res : constant C_Int := Is_New (Fld); + begin + if Res = Curses_False then + return False; + else + return True; + end if; + end Is_New_Page; + +------------------------------------------------------------------------------ + -- We use a GNAT internal hash table mechanism to create an association + -- between an Ada_Defined_Field_Type and it's low level C_Field_Type + -- peer. + -- It shouldn´t be too complicated to reimplent this hashing mechanism + -- for other compilers. + -- + type Tag_Type_Pair; + type Tag_Pair_Access is access all Tag_Type_Pair; + pragma Controlled (Tag_Pair_Access); + + Null_Tag_Pair : constant Tag_Pair_Access := Tag_Pair_Access'(null); + + type Tag_Type_Pair is + record + Ada_Tag : Tag; + Cft : C_Field_Type; + Next : Tag_Pair_Access; + end record; + + type Htable_Headers is range 1 .. 31; + procedure Free_Tag_Type_Pair is + new Ada.Unchecked_Deallocation (Tag_Type_Pair, Tag_Pair_Access); + + procedure Set_Pair_Link (T : Tag_Pair_Access; Next : Tag_Pair_Access); + function Get_Pair_Link (T : Tag_Pair_Access) return Tag_Pair_Access; + function Get_Pair_Tag (T : Tag_Pair_Access) return Tag; + + function Hash (T : Tag) return Htable_Headers; + function Equal (A, B : Tag) return Boolean; + + package External_Pair_Htable is new GNAT.Htable.Static_Htable + (Header_Num => Htable_Headers, + Element => Tag_Type_Pair, + Elmt_Ptr => Tag_Pair_Access, + Null_Ptr => Null_Tag_Pair, + Set_Next => Set_Pair_Link, + Next => Get_Pair_Link, + Key => Tag, + Get_Key => Get_Pair_Tag, + Hash => Hash, + Equal => Equal); + + procedure Set_Pair_Link (T : Tag_Pair_Access; Next : Tag_Pair_Access) + is + begin + T.all.Next := Next; + end Set_Pair_Link; + + function Get_Pair_Link (T : Tag_Pair_Access) return Tag_Pair_Access + is + begin + return T.all.Next; + end Get_Pair_Link; + + function Get_Pair_Tag (T : Tag_Pair_Access) return Tag + is + begin + return T.all.Ada_Tag; + end Get_Pair_Tag; + + function Equal (A, B : Tag) return Boolean + is + begin + return A = B; + end Equal; + + function Hash (T : Tag) return Htable_Headers + is + function H is new GNAT.Htable.Hash (Htable_Headers); + begin + return H (External_Tag (T)); + end Hash; + + function Search_Type (T : Ada_Defined_Field_Type'Class) + return C_Field_Type + is + P : Tag_Pair_Access := External_Pair_Htable.Get (T'Tag); + begin + if P /= null then + return P.Cft; + else + return Null_Field_Type; + end if; + end Search_Type; + + -- Register an Ada_Defined_Field_Type given by its Tag + -- with it's associated C_Field_Type. + procedure Register_Type (T : in Ada_Defined_Field_Type'Class; + Cft : in C_Field_Type) + is + C : C_Field_Type := Search_Type (T); + P : Tag_Pair_Access; + begin + if C /= Null_Field_Type then + raise Form_Exception; + else + P := new Tag_Type_Pair'(T'Tag, Cft, null); + External_Pair_Htable.Set (P); + end if; + end Register_Type; + + -- Unregister an Ada_Defined_Field_Type given by it's tag + procedure Unregister_Type (T : in Ada_Defined_Field_Type'Class) + is + function Free_Fieldtype (Ft : C_Field_Type) return C_Int; + pragma Import (C, Free_Fieldtype, "free_fieldtype"); + + P : Tag_Pair_Access := External_Pair_Htable.Get (T'Tag); + Ft : C_Field_Type; + Res : C_Int; + begin + if P = null then + raise Form_Exception; + else + Ft := P.Cft; + External_Pair_Htable.Remove (T'Tag); + Free_Tag_Type_Pair (P); + Res := Free_Fieldtype (Ft); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end if; + end Unregister_Type; + +---------------------------------------------------------------------------- + -- | + -- | + -- | + procedure Set_Type (Fld : Field; + Fld_Type : Ada_Defined_Field_Type) + is + function Set_Fld_Type (F : Field := Fld; + Ct : C_Field_Type; + Arg1 : Ada_Defined_Field_Type'Class) + return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + function Field_Userptr (Fld : Field) + return Field_User_Wrapper_Access; + pragma Import (C, Field_Userptr, "field_userptr"); + + Res : Eti_Error; + C : constant C_Field_Type := Search_Type (Fld_Type); + begin + if C = Null_Field_Type then + raise Form_Exception; + else + Res := Set_Fld_Type (Fld, C, Fld_Type); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end if; + end Set_Type; + -- | + -- | + -- | + function Native_Type (Ftype : Ada_Defined_Field_Type) + return C_Field_Type + is + C : constant C_Field_Type := Search_Type (Ftype); + begin + if C = Null_Field_Type then + raise Form_Exception; + else + return C; + end if; + end Native_Type; + -- | + -- | + -- | + function Native_Type (Ftype : Alpha_Field) + return C_Field_Type + is + C_Alpha_Field_Type : C_Field_Type; + pragma Import (C, C_Alpha_Field_Type, "TYPE_ALPHA"); + begin + return C_Alpha_Field_Type; + end Native_Type; + pragma Inline (Native_Type); + -- | + -- | + -- | + procedure Set_Type (Fld : in Field; + Fld_Type : in Alpha_Field) + is + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := Native_Type (Fld_Type); + Arg1 : C_Int) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + function Field_Userptr (Fld : Field) + return Field_User_Wrapper_Access; + pragma Import (C, Field_Userptr, "field_userptr"); + + A : constant Field_User_Wrapper_Access := Field_Userptr (Fld); + Res : Eti_Error; + begin + Res := Set_Fld_Type (Arg1 => C_Int (Fld_Type.Minimum_Field_Width)); + if Res /= E_Ok then + Eti_Exception (Res); + else + A.T := new Alpha_Field'(Fld_Type); + end if; + end Set_Type; + -- | + -- | + -- | + function Native_Type (Ftype : Alpha_Numeric_Field) + return C_Field_Type + is + C_Alpha_Numeric_Field_Type : C_Field_Type; + pragma Import (C, C_Alpha_Numeric_Field_Type, "TYPE_ALNUM"); + begin + return C_Alpha_Numeric_Field_Type; + end Native_Type; + pragma Inline (Native_Type); + -- | + -- | + -- | + procedure Set_Type (Fld : in Field; + Fld_Type : in Alpha_Numeric_Field) + is + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := Native_Type (Fld_Type); + Arg1 : C_Int) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + function Field_Userptr (Fld : Field) + return Field_User_Wrapper_Access; + pragma Import (C, Field_Userptr, "field_userptr"); + + A : constant Field_User_Wrapper_Access := Field_Userptr (Fld); + Res : Eti_Error; + begin + Res := Set_Fld_Type (Arg1 => C_Int (Fld_Type.Minimum_Field_Width)); + if Res /= E_Ok then + Eti_Exception (Res); + else + A.T := new Alpha_Numeric_Field'(Fld_Type); + end if; + end Set_Type; + -- | + -- | + -- | + function Native_Type (Ftype : Integer_Field) + return C_Field_Type + is + C_Integer_Field_Type : C_Field_Type; + pragma Import (C, C_Integer_Field_Type, "TYPE_INTEGER"); + begin + return C_Integer_Field_Type; + end Native_Type; + pragma Inline (Native_Type); + -- | + -- | + -- | + procedure Set_Type (Fld : in Field; + Fld_Type : in Integer_Field) + is + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := Native_Type (Fld_Type); + Arg1 : C_Int; + Arg2 : C_Long_Int; + Arg3 : C_Long_Int) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + function Field_Userptr (Fld : Field) + return Field_User_Wrapper_Access; + pragma Import (C, Field_Userptr, "field_userptr"); + + A : constant Field_User_Wrapper_Access := Field_Userptr (Fld); + Res : Eti_Error; + begin + Res := Set_Fld_Type (Arg1 => C_Int (Fld_Type.Precision), + Arg2 => C_Long_Int (Fld_Type.Lower_Limit), + Arg3 => C_Long_Int (Fld_Type.Upper_Limit)); + if Res /= E_Ok then + Eti_Exception (Res); + else + A.T := new Integer_Field'(Fld_Type); + end if; + end Set_Type; + -- | + -- | + -- | + function Native_Type (Ftype : Numeric_Field) + return C_Field_Type + is + C_Numeric_Field_Type : C_Field_Type; + pragma Import (C, C_Numeric_Field_Type, "TYPE_NUMERIC"); + begin + return C_Numeric_Field_Type; + end Native_Type; + pragma Inline (Native_Type); + -- | + -- | + -- | + procedure Set_Type (Fld : in Field; + Fld_Type : in Numeric_Field) + is + type Double is new Interfaces.C.double; + + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := Native_Type (Fld_Type); + Arg1 : Double; + Arg2 : Double; + Arg3 : Double) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + function Field_Userptr (Fld : Field) + return Field_User_Wrapper_Access; + pragma Import (C, Field_Userptr, "field_userptr"); + + A : constant Field_User_Wrapper_Access := Field_Userptr (Fld); + Res : Eti_Error; + begin + Res := Set_Fld_Type (Arg1 => Double (Fld_Type.Precision), + Arg2 => Double (Fld_Type.Lower_Limit), + Arg3 => Double (Fld_Type.Upper_Limit)); + if Res /= E_Ok then + Eti_Exception (Res); + else + A.T := new Numeric_Field'(Fld_Type); + end if; + end Set_Type; + -- | + -- | + -- | + function Native_Type (Ftype : Regular_Expression_Field) + return C_Field_Type + is + C_Regexp_Field_Type : C_Field_Type; + pragma Import (C, C_Regexp_Field_Type, "TYPE_REGEXP"); + begin + return C_Regexp_Field_Type; + end Native_Type; + pragma Inline (Native_Type); + -- | + -- | + -- | + procedure Set_Type (Fld : in Field; + Fld_Type : in Regular_Expression_Field) + is + type Char_Ptr is access all Interfaces.C.Char; + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := Native_Type (Fld_Type); + Arg1 : Char_Ptr) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + function Field_Userptr (Fld : Field) + return Field_User_Wrapper_Access; + pragma Import (C, Field_Userptr, "field_userptr"); + + A : constant Field_User_Wrapper_Access := Field_Userptr (Fld); + Txt : char_array (0 .. Fld_Type.Regular_Expression.all'Length); + Len : size_t; + Res : Eti_Error; + begin + To_C (Fld_Type.Regular_Expression.all, Txt, Len); + Res := Set_Fld_Type (Arg1 => Txt (Txt'First)'Access); + if Res /= E_Ok then + Eti_Exception (Res); + else + A.T := new Regular_Expression_Field'(Fld_Type); + end if; + end Set_Type; + -- | + -- | + -- | + function Native_Type (Ftype : Enumeration_Field) + return C_Field_Type + is + C_Enum_Type : C_Field_Type; + pragma Import (C, C_Enum_Type, "TYPE_ENUM"); + begin + return C_Enum_Type; + end Native_Type; + pragma Inline (Native_Type); + -- | + -- | + -- | + function Create (Info : Enumeration_Info; + Auto_Release_Names : Boolean := False) + return Enumeration_Field + is + procedure Release_String is + new Ada.Unchecked_Deallocation (String, + String_Access); + E : Enumeration_Field; + L : constant size_t := 1 + size_t (Info.C); + S : String_Access; + begin + E.Case_Sensitive := Info.Case_Sensitive; + E.Match_Must_Be_Unique := Info.Match_Must_Be_Unique; + E.Arr := new chars_ptr_array (size_t (1) .. L); + for I in 1 .. Positive (L - 1) loop + if Info.Names (I) = null then + raise Form_Exception; + end if; + E.Arr (size_t (I)) := New_String (Info.Names (I).all); + if Auto_Release_Names then + S := Info.Names (I); + Release_String (S); + end if; + end loop; + E.Arr (L) := Null_Ptr; + return E; + end Create; + + procedure Release (Enum : in out Enumeration_Field) + is + I : size_t := 0; + P : chars_ptr; + begin + loop + P := Enum.Arr (I); + exit when P = Null_Ptr; + Free (P); + Enum.Arr (I) := Null_Ptr; + I := I + 1; + end loop; + Enum.Arr := null; + end Release; + + procedure Set_Type (Fld : in Field; + Fld_Type : in Enumeration_Field) + is + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := Native_Type (Fld_Type); + Arg1 : chars_ptr_array; + Arg2 : C_Int; -- case + Arg3 : C_Int) return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + function Field_Userptr (Fld : Field) + return Field_User_Wrapper_Access; + pragma Import (C, Field_Userptr, "field_userptr"); + + A : constant Field_User_Wrapper_Access := Field_Userptr (Fld); + Res : Eti_Error; + begin + if Fld_Type.Arr = null then + raise Form_Exception; + end if; + Res := Set_Fld_Type (Arg1 => Fld_Type.Arr.all, + Arg2 => C_Int (Boolean'Pos + (Fld_Type.Case_Sensitive)), + Arg3 => + C_Int (Boolean'Pos + (Fld_Type.Match_Must_Be_Unique))); + if Res /= E_Ok then + Eti_Exception (Res); + else + A.T := new Enumeration_Field'(Fld_Type); + end if; + end Set_Type; + + + function Native_Type (Ftype : Internet_V4_Address_Field) + return C_Field_Type + is + C_IPV4_Field_Type : C_Field_Type; + pragma Import (C, C_IPV4_Field_Type, "TYPE_IPV4"); + begin + return C_IPV4_Field_Type; + end Native_Type; + pragma Inline (Native_Type); + -- | + -- | + -- | + procedure Set_Type (Fld : in Field; + Fld_Type : in Internet_V4_Address_Field) + is + function Set_Fld_Type (F : Field := Fld; + Cft : C_Field_Type := Native_Type (Fld_Type)) + return C_Int; + pragma Import (C, Set_Fld_Type, "set_field_type"); + function Field_Userptr (Fld : Field) + return Field_User_Wrapper_Access; + pragma Import (C, Field_Userptr, "field_userptr"); + + A : constant Field_User_Wrapper_Access := Field_Userptr (Fld); + Res : Eti_Error; + begin + Res := Set_Fld_Type; + if Res /= E_Ok then + Eti_Exception (Res); + else + A.T := new Internet_V4_Address_Field'(Fld_Type); + end if; + end Set_Type; + + -- | + -- |===================================================================== + -- | man page form_field_validation.3x + -- |===================================================================== + -- | + -- | + -- | + function Get_Type (Fld : in Field) return Field_Type_Access + is + A : constant Field_User_Wrapper_Access := Field_Userptr (Fld); + begin + if A = null then + return null; + else + return A.T; + end if; + end Get_Type; + +begin + Default_Field_Options := Get_Options (Null_Field); + Default_Form_Options := Get_Options (Null_Form); +end Terminal_Interface.Curses.Forms; diff --git a/Ada95/ada_include/terminal_interface-curses-menus-item_user_data.adb b/Ada95/ada_include/terminal_interface-curses-menus-item_user_data.adb new file mode 100644 index 00000000..9e56187d --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-menus-item_user_data.adb @@ -0,0 +1,57 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus.Item_User_Data -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Interfaces.C; +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +package body Terminal_Interface.Curses.Menus.Item_User_Data is + + use type Interfaces.C.int; + + procedure Set_User_Data (Itm : in Item; + Data : in User_Access) + is + function Set_Item_Userptr (Itm : Item; + Addr : User_Access) return C_Int; + pragma Import (C, Set_Item_Userptr, "set_item_userptr"); + + Res : constant Eti_Error := Set_Item_Userptr (Itm, Data); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_User_Data; + + procedure Get_User_Data (Itm : in Item; + Data : out User_Access) + is + function Item_Userptr (Itm : Item) return User_Access; + pragma Import (C, Item_Userptr, "item_userptr"); + begin + Data := Item_Userptr (Itm); + end Get_User_Data; + +end Terminal_Interface.Curses.Menus.Item_User_Data; diff --git a/Ada95/ada_include/terminal_interface-curses-menus-menu_user_data.adb b/Ada95/ada_include/terminal_interface-curses-menus-menu_user_data.adb new file mode 100644 index 00000000..98dc039d --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-menus-menu_user_data.adb @@ -0,0 +1,67 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus.Menu_User_Data -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Unchecked_Conversion; + +package body Terminal_Interface.Curses.Menus.Menu_User_Data is + + function To_Address is new + Unchecked_Conversion (User_Access, + System.Address); + function To_Pointer is new + Unchecked_Conversion (System.Address, + User_Access); + + procedure Set_User_Data (Men : in Menu; + Data : in User_Access) + is + function Menu_Userptr (Men : Menu) return Ada_User_Wrapper_Access; + pragma Import (C, Menu_Userptr, "menu_userptr"); + + U : Ada_User_Wrapper_Access := Menu_Userptr (Men); + begin + if U = null or else U.I = null then + raise Menu_Exception; + end if; + U.U := To_Address (Data); + end Set_User_Data; + + procedure Get_User_Data (Men : in Menu; + Data : out User_Access) + is + function Menu_Userptr (Men : Menu) return Ada_User_Wrapper_Access; + pragma Import (C, Menu_Userptr, "menu_userptr"); + + U : Ada_User_Wrapper_Access := Menu_Userptr (Men); + begin + if U = null then + raise Menu_Exception; + else + Data := To_Pointer (U.U); + end if; + end Get_User_Data; + +end Terminal_Interface.Curses.Menus.Menu_User_Data; diff --git a/Ada95/ada_include/terminal_interface-curses-menus.adb b/Ada95/ada_include/terminal_interface-curses-menus.adb new file mode 100644 index 00000000..33f06603 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-menus.adb @@ -0,0 +1,984 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.7 $ +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; + +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; +with Terminal_Interface.Curses; + +with Ada.Unchecked_Deallocation; +with Unchecked_Conversion; + +package body Terminal_Interface.Curses.Menus is + + use type System.Bit_Order; + subtype chars_ptr is Interfaces.C.Strings.chars_ptr; + + function MOS_2_CInt is new + Unchecked_Conversion (Menu_Option_Set, + C_Int); + + function CInt_2_MOS is new + Unchecked_Conversion (C_Int, + Menu_Option_Set); + + function IOS_2_CInt is new + Unchecked_Conversion (Item_Option_Set, + C_Int); + + function CInt_2_IOS is new + Unchecked_Conversion (C_Int, + Item_Option_Set); + +------------------------------------------------------------------------------ + procedure Free_Allocated_Items is + new Ada.Unchecked_Deallocation (Item_Array, Item_Array_Access); + + procedure Free_User_Wrapper is + new Ada.Unchecked_Deallocation (Ada_User_Wrapper, + Ada_User_Wrapper_Access); + +------------------------------------------------------------------------------ + procedure Request_Name (Key : in Menu_Request_Code; + Name : out String) + is + function Request_Name (Key : C_Int) return chars_ptr; + pragma Import (C, Request_Name, "menu_request_name"); + begin + Fill_String (Request_Name (C_Int (Key)), Name); + end Request_Name; + + -- !!! W A R N I N G !!! + -- If you want to port this binding to a non ncurses version of the + -- ETI, this must be rewritten. In ncurses the menu items and + -- descriptions may be automatic variables, because ncurses copies + -- the parameters into private allocated internal structures. + -- Other implementations don't do that usually, so depending on + -- scopes you may see unexpected results. + function Create (Name : String; + Description : String := "") return Item + is + type Char_Ptr is access all Interfaces.C.Char; + function Newitem (Name, Desc : Char_Ptr) return Item; + pragma Import (C, Newitem, "new_item"); + + Name_Str : char_array (0 .. Name'Length); + Desc_Str : char_array (0 .. Description'Length); + Name_Len, Desc_Len : size_t; + Result : Item; + begin + To_C (Name, Name_Str, Name_Len); + To_C (Description, Desc_Str, Desc_Len); + Result := Newitem (Name_Str (Name_Str'First)'Access, + Desc_Str (Desc_Str'First)'Access); + if Result = Null_Item then + raise Eti_System_Error; + end if; + return Result; + end Create; + + procedure Delete (Itm : in out Item) + is + function Freeitem (Itm : Item) return C_Int; + pragma Import (C, Freeitem, "free_item"); + + Res : constant Eti_Error := Freeitem (Itm); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Itm := Null_Item; + end Delete; +------------------------------------------------------------------------------- + procedure Set_Value (Itm : in Item; + Value : in Boolean := True) + is + function Set_Item_Val (Itm : Item; + Val : C_Int) return C_Int; + pragma Import (C, Set_Item_Val, "set_item_value"); + + Res : constant Eti_Error := Set_Item_Val (Itm, Boolean'Pos (Value)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Value; + + function Value (Itm : Item) return Boolean + is + function Item_Val (Itm : Item) return C_Int; + pragma Import (C, Item_Val, "item_value"); + begin + if Item_Val (Itm) = Curses_False then + return False; + else + return True; + end if; + end Value; + +------------------------------------------------------------------------------- + function Visible (Itm : Item) return Boolean + is + function Item_Vis (Itm : Item) return C_Int; + pragma Import (C, Item_Vis, "item_visible"); + begin + if Item_Vis (Itm) = Curses_False then + return False; + else + return True; + end if; + end Visible; +------------------------------------------------------------------------------- + procedure Normalize_Item_Options (Options : in out C_Int); + pragma Import (C, Normalize_Item_Options, "_nc_ada_normalize_item_opts"); + + procedure Set_Options (Itm : in Item; + Options : in Item_Option_Set) + is + function Set_Item_Opts (Itm : Item; + Opt : C_Int) return C_Int; + pragma Import (C, Set_Item_Opts, "set_item_opts"); + + Opt : C_Int := IOS_2_CInt (Options); + Res : Eti_Error; + begin + Normalize_Item_Options (Opt); + Res := Set_Item_Opts (Itm, Opt); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Options; + + procedure Switch_Options (Itm : in Item; + Options : in Item_Option_Set; + On : Boolean := True) + is + function Item_Opts_On (Itm : Item; + Opt : C_Int) return C_Int; + pragma Import (C, Item_Opts_On, "item_opts_on"); + function Item_Opts_Off (Itm : Item; + Opt : C_Int) return C_Int; + pragma Import (C, Item_Opts_Off, "item_opts_off"); + + Opt : C_Int := IOS_2_CInt (Options); + Err : Eti_Error; + begin + Normalize_Item_Options (Opt); + if On then + Err := Item_Opts_On (Itm, Opt); + else + Err := Item_Opts_Off (Itm, Opt); + end if; + if Err /= E_Ok then + Eti_Exception (Err); + end if; + end Switch_Options; + + procedure Get_Options (Itm : in Item; + Options : out Item_Option_Set) + is + function Item_Opts (Itm : Item) return C_Int; + pragma Import (C, Item_Opts, "item_opts"); + + Res : C_Int := Item_Opts (Itm); + begin + Normalize_Item_Options (Res); + Options := CInt_2_IOS (Res); + end Get_Options; + + function Get_Options (Itm : Item := Null_Item) return Item_Option_Set + is + Ios : Item_Option_Set; + begin + Get_Options (Itm, Ios); + return Ios; + end Get_Options; +------------------------------------------------------------------------------- + procedure Name (Itm : in Item; + Name : out String) + is + function Itemname (Itm : Item) return chars_ptr; + pragma Import (C, Itemname, "item_name"); + begin + Fill_String (Itemname (Itm), Name); + end Name; + + procedure Description (Itm : in Item; + Description : out String) + is + function Descname (Itm : Item) return chars_ptr; + pragma Import (C, Descname, "item_description"); + begin + Fill_String (Descname (Itm), Description); + end Description; +------------------------------------------------------------------------------- + procedure Set_Current (Men : in Menu; + Itm : in Item) + is + function Set_Curr_Item (Men : Menu; + Itm : Item) return C_Int; + pragma Import (C, Set_Curr_Item, "set_current_item"); + + Res : constant Eti_Error := Set_Curr_Item (Men, Itm); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Current; + + function Current (Men : Menu) return Item + is + function Curr_Item (Men : Menu) return Item; + pragma Import (C, Curr_Item, "current_item"); + + Res : constant Item := Curr_Item (Men); + begin + if Res = Null_Item then + raise Menu_Exception; + end if; + return Res; + end Current; + + procedure Set_Top_Row (Men : in Menu; + Line : in Line_Position) + is + function Set_Toprow (Men : Menu; + Line : C_Int) return C_Int; + pragma Import (C, Set_Toprow, "set_top_row"); + + Res : constant Eti_Error := Set_Toprow (Men, C_Int (Line)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Top_Row; + + function Top_Row (Men : Menu) return Line_Position + is + function Toprow (Men : Menu) return C_Int; + pragma Import (C, Toprow, "top_row"); + + Res : constant C_Int := Toprow (Men); + begin + if Res = Curses_Err then + raise Menu_Exception; + end if; + return Line_Position (Res); + end Top_Row; + + function Get_Index (Itm : Item) return Positive + is + function Get_Itemindex (Itm : Item) return C_Int; + pragma Import (C, Get_Itemindex, "item_index"); + + Res : constant C_Int := Get_Itemindex (Itm); + begin + if Res = Curses_Err then + raise Menu_Exception; + end if; + return Positive (Natural (Res) + Positive'First); + end Get_Index; +------------------------------------------------------------------------------- + procedure Post (Men : in Menu; + Post : in Boolean := True) + is + function M_Post (Men : Menu) return C_Int; + pragma Import (C, M_Post, "post_menu"); + function M_Unpost (Men : Menu) return C_Int; + pragma Import (C, M_Unpost, "unpost_menu"); + + Res : Eti_Error; + begin + if Post then + Res := M_Post (Men); + else + Res := M_Unpost (Men); + end if; + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Post; +------------------------------------------------------------------------------- + procedure Normalize_Menu_Options (Options : in out C_Int); + pragma Import (C, Normalize_Menu_Options, "_nc_ada_normalize_menu_opts"); + + procedure Set_Options (Men : in Menu; + Options : in Menu_Option_Set) + is + function Set_Menu_Opts (Men : Menu; + Opt : C_Int) return C_Int; + pragma Import (C, Set_Menu_Opts, "set_menu_opts"); + + Opt : C_Int := MOS_2_CInt (Options); + Res : Eti_Error; + begin + Normalize_Menu_Options (Opt); + Res := Set_Menu_Opts (Men, Opt); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Options; + + procedure Switch_Options (Men : in Menu; + Options : in Menu_Option_Set; + On : in Boolean := True) + is + function Menu_Opts_On (Men : Menu; + Opt : C_Int) return C_Int; + pragma Import (C, Menu_Opts_On, "menu_opts_on"); + function Menu_Opts_Off (Men : Menu; + Opt : C_Int) return C_Int; + pragma Import (C, Menu_Opts_Off, "menu_opts_off"); + + Opt : C_Int := MOS_2_CInt (Options); + Err : Eti_Error; + begin + Normalize_Menu_Options (Opt); + if On then + Err := Menu_Opts_On (Men, Opt); + else + Err := Menu_Opts_Off (Men, Opt); + end if; + if Err /= E_Ok then + Eti_Exception (Err); + end if; + end Switch_Options; + + procedure Get_Options (Men : in Menu; + Options : out Menu_Option_Set) + is + function Menu_Opts (Men : Menu) return C_Int; + pragma Import (C, Menu_Opts, "menu_opts"); + + Res : C_Int := Menu_Opts (Men); + begin + Normalize_Menu_Options (Res); + Options := CInt_2_MOS (Res); + end Get_Options; + + function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set + is + Mos : Menu_Option_Set; + begin + Get_Options (Men, Mos); + return Mos; + end Get_Options; +------------------------------------------------------------------------------- + procedure Set_Window (Men : in Menu; + Win : in Window) + is + function Set_Menu_Win (Men : Menu; + Win : Window) return C_Int; + pragma Import (C, Set_Menu_Win, "set_menu_win"); + + Res : constant Eti_Error := Set_Menu_Win (Men, Win); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Window; + + function Get_Window (Men : Menu) return Window + is + function Menu_Win (Men : Menu) return Window; + pragma Import (C, Menu_Win, "menu_win"); + + W : constant Window := Menu_Win (Men); + begin + return W; + end Get_Window; + + procedure Set_Sub_Window (Men : in Menu; + Win : in Window) + is + function Set_Menu_Sub (Men : Menu; + Win : Window) return C_Int; + pragma Import (C, Set_Menu_Sub, "set_menu_sub"); + + Res : constant Eti_Error := Set_Menu_Sub (Men, Win); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Sub_Window; + + function Get_Sub_Window (Men : Menu) return Window + is + function Menu_Sub (Men : Menu) return Window; + pragma Import (C, Menu_Sub, "menu_sub"); + + W : constant Window := Menu_Sub (Men); + begin + return W; + end Get_Sub_Window; + + procedure Scale (Men : in Menu; + Lines : out Line_Count; + Columns : out Column_Count) + is + type C_Int_Access is access all C_Int; + function M_Scale (Men : Menu; + Yp, Xp : C_Int_Access) return C_Int; + pragma Import (C, M_Scale, "scale_menu"); + + X, Y : aliased C_Int; + Res : constant Eti_Error := M_Scale (Men, Y'Access, X'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + Lines := Line_Count (Y); + Columns := Column_Count (X); + end Scale; +------------------------------------------------------------------------------- + procedure Position_Cursor (Men : Menu) + is + function Pos_Menu_Cursor (Men : Menu) return C_Int; + pragma Import (C, Pos_Menu_Cursor, "pos_menu_cursor"); + + Res : constant Eti_Error := Pos_Menu_Cursor (Men); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Position_Cursor; + +------------------------------------------------------------------------------- + procedure Set_Mark (Men : in Menu; + Mark : in String) + is + type Char_Ptr is access all Interfaces.C.Char; + function Set_Mark (Men : Menu; + Mark : Char_Ptr) return C_Int; + pragma Import (C, Set_Mark, "set_menu_mark"); + + Txt : char_array (0 .. Mark'Length); + Len : size_t; + Res : Eti_Error; + begin + To_C (Mark, Txt, Len); + Res := Set_Mark (Men, Txt (Txt'First)'Access); + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Mark; + + procedure Mark (Men : in Menu; + Mark : out String) + is + function Get_Menu_Mark (Men : Menu) return chars_ptr; + pragma Import (C, Get_Menu_Mark, "menu_mark"); + begin + Fill_String (Get_Menu_Mark (Men), Mark); + end Mark; + +------------------------------------------------------------------------------- + procedure Set_Foreground + (Men : in Menu; + Fore : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) + is + function Set_Menu_Fore (Men : Menu; + Attr : C_Int) return C_Int; + pragma Import (C, Set_Menu_Fore, "set_menu_fore"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Color => Color, + Attr => Fore); + Res : constant Eti_Error := Set_Menu_Fore (Men, Chtype_To_CInt (Ch)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Foreground; + + procedure Foreground (Men : in Menu; + Fore : out Character_Attribute_Set) + is + function Menu_Fore (Men : Menu) return C_Int; + pragma Import (C, Menu_Fore, "menu_fore"); + begin + Fore := CInt_To_Chtype (Menu_Fore (Men)).Attr; + end Foreground; + + procedure Foreground (Men : in Menu; + Fore : out Character_Attribute_Set; + Color : out Color_Pair) + is + function Menu_Fore (Men : Menu) return C_Int; + pragma Import (C, Menu_Fore, "menu_fore"); + begin + Fore := CInt_To_Chtype (Menu_Fore (Men)).Attr; + Color := CInt_To_Chtype (Menu_Fore (Men)).Color; + end Foreground; + + procedure Set_Background + (Men : in Menu; + Back : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) + is + function Set_Menu_Back (Men : Menu; + Attr : C_Int) return C_Int; + pragma Import (C, Set_Menu_Back, "set_menu_back"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Color => Color, + Attr => Back); + Res : constant Eti_Error := Set_Menu_Back (Men, Chtype_To_CInt (Ch)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Background; + + procedure Background (Men : in Menu; + Back : out Character_Attribute_Set) + is + function Menu_Back (Men : Menu) return C_Int; + pragma Import (C, Menu_Back, "menu_back"); + begin + Back := CInt_To_Chtype (Menu_Back (Men)).Attr; + end Background; + + procedure Background (Men : in Menu; + Back : out Character_Attribute_Set; + Color : out Color_Pair) + is + function Menu_Back (Men : Menu) return C_Int; + pragma Import (C, Menu_Back, "menu_back"); + begin + Back := CInt_To_Chtype (Menu_Back (Men)).Attr; + Color := CInt_To_Chtype (Menu_Back (Men)).Color; + end Background; + + procedure Set_Grey (Men : in Menu; + Grey : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) + is + function Set_Menu_Grey (Men : Menu; + Attr : C_Int) return C_Int; + pragma Import (C, Set_Menu_Grey, "set_menu_grey"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Color => Color, + Attr => Grey); + + Res : constant Eti_Error := Set_Menu_Grey (Men, Chtype_To_CInt (Ch)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Grey; + + procedure Grey (Men : in Menu; + Grey : out Character_Attribute_Set) + is + function Menu_Grey (Men : Menu) return C_Int; + pragma Import (C, Menu_Grey, "menu_grey"); + begin + Grey := CInt_To_Chtype (Menu_Grey (Men)).Attr; + end Grey; + + procedure Grey (Men : in Menu; + Grey : out Character_Attribute_Set; + Color : out Color_Pair) + is + function Menu_Grey (Men : Menu) return C_Int; + pragma Import (C, Menu_Grey, "menu_grey"); + begin + Grey := CInt_To_Chtype (Menu_Grey (Men)).Attr; + Color := CInt_To_Chtype (Menu_Grey (Men)).Color; + end Grey; + + procedure Set_Pad_Character (Men : in Menu; + Pad : in Character := Space) + is + function Set_Menu_Pad (Men : Menu; + Ch : C_Int) return C_Int; + pragma Import (C, Set_Menu_Pad, "set_menu_pad"); + + Res : constant Eti_Error := Set_Menu_Pad (Men, + C_Int (Character'Pos (Pad))); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Pad_Character; + + procedure Pad_Character (Men : in Menu; + Pad : out Character) + is + function Menu_Pad (Men : Menu) return C_Int; + pragma Import (C, Menu_Pad, "menu_pad"); + begin + Pad := Character'Val (Menu_Pad (Men)); + end Pad_Character; +------------------------------------------------------------------------------- + procedure Set_Spacing (Men : in Menu; + Descr : in Column_Position := 0; + Row : in Line_Position := 0; + Col : in Column_Position := 0) + is + function Set_Spacing (Men : Menu; + D, R, C : C_Int) return C_Int; + pragma Import (C, Set_Spacing, "set_menu_spacing"); + + Res : constant Eti_Error := Set_Spacing (Men, + C_Int (Descr), + C_Int (Row), + C_Int (Col)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Spacing; + + procedure Spacing (Men : in Menu; + Descr : out Column_Position; + Row : out Line_Position; + Col : out Column_Position) + is + type C_Int_Access is access all C_Int; + function Get_Spacing (Men : Menu; + D, R, C : C_Int_Access) return C_Int; + pragma Import (C, Get_Spacing, "menu_spacing"); + + D, R, C : aliased C_Int; + Res : constant Eti_Error := Get_Spacing (Men, + D'Access, + R'Access, + C'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + else + Descr := Column_Position (D); + Row := Line_Position (R); + Col := Column_Position (C); + end if; + end Spacing; +------------------------------------------------------------------------------- + function Set_Pattern (Men : Menu; + Text : String) return Boolean + is + type Char_Ptr is access all Interfaces.C.Char; + function Set_Pattern (Men : Menu; + Pattern : Char_Ptr) return C_Int; + pragma Import (C, Set_Pattern, "set_menu_pattern"); + + S : char_array (0 .. Text'Length); + L : size_t; + Res : Eti_Error; + begin + To_C (Text, S, L); + Res := Set_Pattern (Men, S (S'First)'Access); + case Res is + when E_No_Match => return False; + when E_Ok => return True; + when others => + Eti_Exception (Res); + return False; + end case; + end Set_Pattern; + + procedure Pattern (Men : in Menu; + Text : out String) + is + function Get_Pattern (Men : Menu) return chars_ptr; + pragma Import (C, Get_Pattern, "menu_pattern"); + begin + Fill_String (Get_Pattern (Men), Text); + end Pattern; +------------------------------------------------------------------------------- + procedure Set_Format (Men : in Menu; + Lines : in Line_Count; + Columns : in Column_Count) + is + function Set_Menu_Fmt (Men : Menu; + Lin : C_Int; + Col : C_Int) return C_Int; + pragma Import (C, Set_Menu_Fmt, "set_menu_format"); + + Res : constant Eti_Error := Set_Menu_Fmt (Men, + C_Int (Lines), + C_Int (Columns)); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Format; + + procedure Format (Men : in Menu; + Lines : out Line_Count; + Columns : out Column_Count) + is + type C_Int_Access is access all C_Int; + function Menu_Fmt (Men : Menu; + Y, X : C_Int_Access) return C_Int; + pragma Import (C, Menu_Fmt, "menu_format"); + + L, C : aliased C_Int; + Res : constant Eti_Error := Menu_Fmt (Men, L'Access, C'Access); + begin + if Res /= E_Ok then + Eti_Exception (Res); + else + Lines := Line_Count (L); + Columns := Column_Count (C); + end if; + end Format; +------------------------------------------------------------------------------- + procedure Set_Item_Init_Hook (Men : in Menu; + Proc : in Menu_Hook_Function) + is + function Set_Item_Init (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; + pragma Import (C, Set_Item_Init, "set_item_init"); + + Res : constant Eti_Error := Set_Item_Init (Men, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Item_Init_Hook; + + procedure Set_Item_Term_Hook (Men : in Menu; + Proc : in Menu_Hook_Function) + is + function Set_Item_Term (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; + pragma Import (C, Set_Item_Term, "set_item_term"); + + Res : constant Eti_Error := Set_Item_Term (Men, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Item_Term_Hook; + + procedure Set_Menu_Init_Hook (Men : in Menu; + Proc : in Menu_Hook_Function) + is + function Set_Menu_Init (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; + pragma Import (C, Set_Menu_Init, "set_menu_init"); + + Res : constant Eti_Error := Set_Menu_Init (Men, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Menu_Init_Hook; + + procedure Set_Menu_Term_Hook (Men : in Menu; + Proc : in Menu_Hook_Function) + is + function Set_Menu_Term (Men : Menu; + Proc : Menu_Hook_Function) return C_Int; + pragma Import (C, Set_Menu_Term, "set_menu_term"); + + Res : constant Eti_Error := Set_Menu_Term (Men, Proc); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + end Set_Menu_Term_Hook; + + function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function + is + function Item_Init (Men : Menu) return Menu_Hook_Function; + pragma Import (C, Item_Init, "item_init"); + begin + return Item_Init (Men); + end Get_Item_Init_Hook; + + function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function + is + function Item_Term (Men : Menu) return Menu_Hook_Function; + pragma Import (C, Item_Term, "item_term"); + begin + return Item_Term (Men); + end Get_Item_Term_Hook; + + function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function + is + function Menu_Init (Men : Menu) return Menu_Hook_Function; + pragma Import (C, Menu_Init, "menu_init"); + begin + return Menu_Init (Men); + end Get_Menu_Init_Hook; + + function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function + is + function Menu_Term (Men : Menu) return Menu_Hook_Function; + pragma Import (C, Menu_Term, "menu_term"); + begin + return Menu_Term (Men); + end Get_Menu_Term_Hook; +------------------------------------------------------------------------------- + -- This is a bit delicate if we want to manipulate an Ada created menu + -- from C routines or vice versa. + -- In Ada created menus we use the low level user pointer to maintain + -- binding internal additional informations about the menu. This + -- internal information contains a hook for the Ada provided user pointer. + -- Unless you understand this implementation, the safest way in mixed + -- language programs to deal with user pointers is, that only the language + -- that created the menu should also manipulate the user pointer for that + -- menu. + procedure Redefine (Men : in Menu; + Items : in Item_Array) + is + function Set_Items (Men : Menu; + Items : Item_Array_Access) return C_Int; + pragma Import (C, Set_Items, "set_menu_items"); + + function Menu_Userptr (Men : Menu) return Ada_User_Wrapper_Access; + pragma Import (C, Menu_Userptr, "menu_userptr"); + + U : Ada_User_Wrapper_Access := Menu_Userptr (Men); + I : Item_Array_Access; + Res : Eti_Error; + begin + if U = null or else U.I = null then raise Menu_Exception; + else + -- create internally an array of items that contains an + -- additional place for the terminating null item. + I := new Item_Array (1 .. (Items'Length + 1)); + I.all (1 .. Items'Length) := Items (Items'First .. Items'Last); + I.all (Items'Length + 1) := Null_Item; + Res := Set_Items (Men, I); + if Res /= E_Ok then + Free_Allocated_Items (I); + Eti_Exception (Res); + else + Free_Allocated_Items (U.I); + U.I := I; + end if; + end if; + end Redefine; + + function Item_Count (Men : Menu) return Natural + is + function Count (Men : Menu) return C_Int; + pragma Import (C, Count, "item_count"); + begin + return Natural (Count (Men)); + end Item_Count; + + function Items (Men : Menu) return Item_Array_Access + is + function M_Items (Men : Menu) return Item_Array_Access; + pragma Import (C, M_Items, "menu_items"); + begin + return M_Items (Men); + end Items; + +------------------------------------------------------------------------------- + function Create (Items : Item_Array) return Menu + is + function Newmenu (Items : Item_Array_Access) return Menu; + pragma Import (C, Newmenu, "new_menu"); + + function Set_Menu_Userptr (Men : Menu; + Addr : Ada_User_Wrapper_Access) return C_Int; + pragma Import (C, Set_Menu_Userptr, "set_menu_userptr"); + + M : Menu; + I : Item_Array_Access; + U : Ada_User_Wrapper_Access; + Res : Eti_Error; + begin + I := new Item_Array (1 .. (Items'Length + 1)); + I.all (1 .. Items'Length) := Items (Items'First .. Items'Last); + I.all (Items'Length + 1) := Null_Item; + M := Newmenu (I); + if M = Null_Menu then + Free_Allocated_Items (I); + raise Menu_Exception; + end if; + U := new Ada_User_Wrapper' (System.Null_Address, I); + Res := Set_Menu_Userptr (M, U); + if Res /= E_Ok then + Free_Allocated_Items (I); + Free_User_Wrapper (U); + Eti_Exception (Res); + end if; + return M; + end Create; + + procedure Delete (Men : in out Menu) + is + function Free (Men : Menu) return C_Int; + pragma Import (C, Free, "free_menu"); + function Menu_Userptr (Men : Menu) return Ada_User_Wrapper_Access; + pragma Import (C, Menu_Userptr, "menu_userptr"); + + U : Ada_User_Wrapper_Access := Menu_Userptr (Men); + Res : constant Eti_Error := Free (Men); + begin + if Res /= E_Ok then + Eti_Exception (Res); + end if; + if U = null or else U.I = null then + raise Menu_Exception; + end if; + Free_Allocated_Items (U.I); + Free_User_Wrapper (U); + Men := Null_Menu; + end Delete; + +------------------------------------------------------------------------------ + function Driver (Men : Menu; + Key : Key_Code) return Driver_Result + is + function Driver (Men : Menu; + Key : C_Int) return C_Int; + pragma Import (C, Driver, "menu_driver"); + + R : Eti_Error := Driver (Men, C_Int (Key)); + begin + if R /= E_Ok then + case R is + when E_Unknown_Command => return Unknown_Request; + when E_No_Match => return No_Match; + when E_Request_Denied | + E_Not_Selectable => return Request_Denied; + when others => + Eti_Exception (R); + end case; + end if; + return Menu_Ok; + end Driver; +------------------------------------------------------------------------------- +begin + if Generation_Bit_Order /= System.Default_Bit_Order then + raise Constraint_Error; + end if; + + Default_Menu_Options := Get_Options (Null_Menu); + Default_Item_Options := Get_Options (Null_Item); +end Terminal_Interface.Curses.Menus; diff --git a/Ada95/ada_include/terminal_interface-curses-mouse.adb b/Ada95/ada_include/terminal_interface-curses-mouse.adb new file mode 100644 index 00000000..67aa6495 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-mouse.adb @@ -0,0 +1,152 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Mouse -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with System; + +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Interfaces; +with Interfaces.C; +with Unchecked_Conversion; + +package body Terminal_Interface.Curses.Mouse is + + use type System.Bit_Order; + use type Interfaces.C.int; + + function CInt_To_Mask is new + Unchecked_Conversion (Source => C_Int, + Target => Event_Mask); + + function Mask_To_CInt is new + Unchecked_Conversion (Source => Event_Mask, + Target => C_Int); + + function Get_Mouse return Mouse_Event + is + type Event_Access is access all Mouse_Event; + + function Getmouse (Ev : Event_Access) return C_Int; + pragma Import (C, Getmouse, "getmouse"); + + Event : aliased Mouse_Event; + begin + if Getmouse (Event'Access) = Curses_Err then + raise Curses_Exception; + end if; + return Event; + end Get_Mouse; + + procedure Register_Reportable_Event (B : in Mouse_Button; + S : in Button_State; + Mask : in out Event_Mask) + is + type Evt_Access is access all Event_Mask; + function Register (B : C_Int; + S : C_Int; + M : Evt_Access) return C_Int; + pragma Import (C, Register, "_nc_ada_mouse_mask"); + + T : aliased Event_Mask := Mask; + M : Evt_Access := T'Access; + R : constant C_Int := Register (C_Int (Mouse_Button'Pos (B)), + C_Int (Button_State'Pos (S)), + M); + begin + if R = Curses_Err then + raise Curses_Exception; + end if; + Mask := T; + end Register_Reportable_Event; + + function Start_Mouse (Mask : Event_Mask := All_Events) + return Event_Mask + is + type Int_Access is access all C_Int; + function MMask (M : C_Int; O : Int_Access := null) return C_Int; + pragma Import (C, MMask, "mousemask"); + R : C_Int; + begin + R := MMask (Mask_To_CInt (Mask)); + return CInt_To_Mask (R); + end Start_Mouse; + + procedure Get_Event (Event : in Mouse_Event; + Y : out Line_Position; + X : out Column_Position; + Button : out Mouse_Button; + State : out Button_State) + is + procedure Dispatch_Event (M : in C_Int; + B : out C_Int; + S : out C_Int); + pragma Import (C, Dispatch_Event, "_nc_ada_mouse_event"); + + Mask : constant Interfaces.C.int := Mask_To_CInt (Event.Bstate); + B, S : C_Int; + begin + X := Column_Position (Event.X); + Y := Line_Position (Event.Y); + Dispatch_Event (Mask, B, S); + Button := Mouse_Button'Val (B); + State := Button_State'Val (S); + end Get_Event; + + procedure Unget_Mouse (Event : in Mouse_Event) + is + function Ungetmouse (Ev : Mouse_Event) return C_Int; + pragma Import (C, Ungetmouse, "ungetmouse"); + begin + if Ungetmouse (Event) = Curses_Err then + raise Curses_Exception; + end if; + end Unget_Mouse; + + function Enclosed_In_Window (Win : Window := Standard_Window; + Event : Mouse_Event) return Boolean + is + function Wenclose (Win : Window; Y : C_Int; X : C_Int) return C_Int; + pragma Import (C, Wenclose, "wenclose"); + begin + if Wenclose (Win, C_Int (Event.Y), C_Int (Event.X)) = Curses_False then + return False; + else + return True; + end if; + end Enclosed_In_Window; + + function Mouse_Interval (Msec : Natural := 200) return Natural + is + function Mouseinterval (Msec : C_Int) return C_Int; + pragma Import (C, Mouseinterval, "mouseinterval"); + begin + return Natural (Mouseinterval (C_Int (Msec))); + end Mouse_Interval; + +begin + if Generation_Bit_Order /= System.Default_Bit_Order then + raise Constraint_Error; + end if; +end Terminal_Interface.Curses.Mouse; diff --git a/Ada95/ada_include/terminal_interface-curses-panels-user_data.adb b/Ada95/ada_include/terminal_interface-curses-panels-user_data.adb new file mode 100644 index 00000000..5d1c7e94 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-panels-user_data.adb @@ -0,0 +1,58 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Panels.User_Data -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Interfaces.C; +with Terminal_Interface.Curses.Aux; +use Terminal_Interface.Curses.Aux; +with Terminal_Interface.Curses.Panels; +use Terminal_Interface.Curses.Panels; + +package body Terminal_Interface.Curses.Panels.User_Data is + + use type Interfaces.C.int; + + procedure Set_User_Data (Pan : in Panel; + Data : in User_Access) + is + function Set_Panel_Userptr (Pan : Panel; + Addr : User_Access) return C_Int; + pragma Import (C, Set_Panel_Userptr, "set_panel_userptr"); + begin + if Set_Panel_Userptr (Pan, Data) = Curses_Err then + raise Panel_Exception; + end if; + end Set_User_Data; + + procedure Get_User_Data (Pan : in Panel; + Data : out User_Access) + is + function Panel_Userptr (Pan : Panel) return User_Access; + pragma Import (C, Panel_Userptr, "panel_userptr"); + begin + Data := Panel_Userptr (Pan); + end Get_User_Data; + +end Terminal_Interface.Curses.Panels.User_Data; diff --git a/Ada95/ada_include/terminal_interface-curses-panels.adb b/Ada95/ada_include/terminal_interface-curses-panels.adb new file mode 100644 index 00000000..74f7c1bd --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-panels.adb @@ -0,0 +1,150 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Panels -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Interfaces.C; + +package body Terminal_Interface.Curses.Panels is + + use type Interfaces.C.int; + + function Create (Win : Window) return Panel + is + function Newpanel (Win : Window) return Panel; + pragma Import (C, Newpanel, "new_panel"); + + Pan : Panel; + begin + Pan := Newpanel (Win); + if Pan = Null_Panel then + raise Panel_Exception; + end if; + return Pan; + end Create; + + procedure Bottom (Pan : in Panel) + is + function Bottompanel (Pan : Panel) return C_Int; + pragma Import (C, Bottompanel, "bottom_panel"); + begin + if Bottompanel (Pan) = Curses_Err then + raise Panel_Exception; + end if; + end Bottom; + + procedure Top (Pan : in Panel) + is + function Toppanel (Pan : Panel) return C_Int; + pragma Import (C, Toppanel, "top_panel"); + begin + if Toppanel (Pan) = Curses_Err then + raise Panel_Exception; + end if; + end Top; + + procedure Show (Pan : in Panel) + is + function Showpanel (Pan : Panel) return C_Int; + pragma Import (C, Showpanel, "show_panel"); + begin + if Showpanel (Pan) = Curses_Err then + raise Panel_Exception; + end if; + end Show; + + procedure Hide (Pan : in Panel) + is + function Hidepanel (Pan : Panel) return C_Int; + pragma Import (C, Hidepanel, "hide_panel"); + begin + if Hidepanel (Pan) = Curses_Err then + raise Panel_Exception; + end if; + end Hide; + + function Get_Window (Pan : Panel) return Window + is + function Panel_Win (Pan : Panel) return Window; + pragma Import (C, Panel_Win, "panel_window"); + + Win : Window := Panel_Win (Pan); + begin + if Win = Null_Window then + raise Panel_Exception; + end if; + return Win; + end Get_Window; + + procedure Replace (Pan : in Panel; + Win : in Window) + is + function Replace_Pan (Pan : Panel; + Win : Window) return C_Int; + pragma Import (C, Replace_Pan, "replace_panel"); + begin + if Replace_Pan (Pan, Win) = Curses_Err then + raise Panel_Exception; + end if; + end Replace; + + procedure Move (Pan : in Panel; + Line : in Line_Position; + Column : in Column_Position) + is + function Move (Pan : Panel; + Line : C_Int; + Column : C_Int) return C_Int; + pragma Import (C, Move, "move_panel"); + begin + if Move (Pan, C_Int (Line), C_Int (Column)) = Curses_Err then + raise Panel_Exception; + end if; + end Move; + + function Is_Hidden (Pan : Panel) return Boolean + is + function Panel_Hidden (Pan : Panel) return C_Int; + pragma Import (C, Panel_Hidden, "panel_hidden"); + begin + if Panel_Hidden (Pan) = Curses_False then + return False; + else + return True; + end if; + end Is_Hidden; + + procedure Delete (Pan : in out Panel) + is + function Del_Panel (Pan : Panel) return C_Int; + pragma Import (C, Del_Panel, "del_panel"); + begin + if Del_Panel (Pan) = Curses_Err then + raise Panel_Exception; + end if; + Pan := Null_Panel; + end Delete; + +end Terminal_Interface.Curses.Panels; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-aux.adb b/Ada95/ada_include/terminal_interface-curses-text_io-aux.adb new file mode 100644 index 00000000..8be84489 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-aux.adb @@ -0,0 +1,114 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Aux -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +package body Terminal_Interface.Curses.Text_IO.Aux is + + procedure Put_Buf + (Win : in Window; + Buf : in String; + Width : in Field; + Signal : in Boolean := True; + Ljust : in Boolean := False) + is + L : Field; + Len : Field; + W : Field := Width; + LC : Line_Count; + CC : Column_Count; + Y : Line_Position; + X : Column_Position; + + procedure Output (From, To : Field); + + procedure Output (From, To : Field) + is + begin + if Len > 0 then + if W = 0 then + W := Len; + end if; + if Len > W then + -- LRM A10.6 (7) says this + W := Len; + end if; + + pragma Assert (Len <= W); + Get_Size (Win, LC, CC); + if Column_Count (Len) > CC then + if Signal then + raise Layout_Error; + else + return; + end if; + else + if Len < W and then not Ljust then + declare + Filler : constant String (1 .. (W - Len)) + := (others => ' '); + begin + Put (Win, Filler); + end; + end if; + Get_Cursor_Position (Win, Y, X); + if (X + Column_Position (Len)) > CC then + New_Line (Win); + end if; + Put (Win, Buf (From .. To)); + if Len < W and then Ljust then + declare + Filler : constant String (1 .. (W - Len)) + := (others => ' '); + begin + Put (Win, Filler); + end; + end if; + end if; + end if; + end Output; + + begin + pragma Assert (Win /= Null_Window); + if Ljust then + L := 1; + for I in 1 .. Buf'Length loop + exit when Buf (L) = ' '; + L := L + 1; + end loop; + Len := L - 1; + Output (1, Len); + else -- input buffer is not left justified + L := Buf'Length; + for I in 1 .. Buf'Length loop + exit when Buf (L) = ' '; + L := L - 1; + end loop; + Len := Buf'Length - L; + Output (L + 1, Buf'Length); + end if; + end Put_Buf; + +end Terminal_Interface.Curses.Text_IO.Aux; + diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-aux.ads b/Ada95/ada_include/terminal_interface-curses-text_io-aux.ads new file mode 100644 index 00000000..1582e6b0 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-aux.ads @@ -0,0 +1,40 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Aux -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +private package Terminal_Interface.Curses.Text_IO.Aux is + + -- This routine is called from the Text_IO output routines for numeric + -- and enumeration types. + -- + procedure Put_Buf + (Win : in Window; -- The output window + Buf : in String; -- The buffer containing the text + Width : in Field; -- The width of the output field + Signal : in Boolean := True; -- If true, we raise Layout_Error + Ljust : in Boolean := False); -- The Buf is left justified + +end Terminal_Interface.Curses.Text_IO.Aux; + diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-complex_io.adb b/Ada95/ada_include/terminal_interface-curses-text_io-complex_io.adb new file mode 100644 index 00000000..a71ca20c --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-complex_io.adb @@ -0,0 +1,59 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Complex_IO -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Terminal_Interface.Curses.Text_IO.Float_IO; + +package body Terminal_Interface.Curses.Text_IO.Complex_IO is + + package FIO is new + Terminal_Interface.Curses.Text_IO.Float_IO (Complex_Types.Real'Base); + + procedure Put + (Win : in Window; + Item : in Complex; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp) + is + begin + Put (Win, '('); + FIO.Put (Win, Item.Re, Fore, Aft, Exp); + Put (Win, ','); + FIO.Put (Win, Item.Im, Fore, Aft, Exp); + Put (Win, ')'); + end Put; + + procedure Put + (Item : in Complex; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp) + is + begin + Put (Get_Window, Item, Fore, Aft, Exp); + end Put; + +end Terminal_Interface.Curses.Text_IO.Complex_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-complex_io.ads b/Ada95/ada_include/terminal_interface-curses-text_io-complex_io.ads new file mode 100644 index 00000000..dd895e97 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-complex_io.ads @@ -0,0 +1,56 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Complex_IO -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Ada.Numerics.Generic_Complex_Types; + +generic + with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>); + +package Terminal_Interface.Curses.Text_IO.Complex_IO is + + use Complex_Types; + + Default_Fore : Field := 2; + Default_Aft : Field := Real'Digits - 1; + Default_Exp : Field := 3; + + procedure Put + (Win : in Window; + Item : in Complex; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + + procedure Put + (Item : in Complex; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Complex_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.adb b/Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.adb new file mode 100644 index 00000000..40596004 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.adb @@ -0,0 +1,61 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Decimal_IO -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Decimal_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package DIO is new Ada.Text_IO.Decimal_IO (Num); + + procedure Put + (Win : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp) + is + Buf : String (1 .. Field'Last); + Len : Field := Fore + 1 + Aft; + begin + if Exp > 0 then + Len := Len + 1 + Exp; + end if; + DIO.Put (Buf, Item, Aft, Exp); + Aux.Put_Buf (Win, Buf, Len, False); + end Put; + + procedure Put + (Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp) is + begin + Put (Get_Window, Item, Fore, Aft, Exp); + end Put; + +end Terminal_Interface.Curses.Text_IO.Decimal_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.ads b/Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.ads new file mode 100644 index 00000000..d1e92453 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-decimal_io.ads @@ -0,0 +1,52 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Decimal_IO -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +generic + type Num is delta <> digits <>; + +package Terminal_Interface.Curses.Text_IO.Decimal_IO is + + Default_Fore : Field := Num'Fore; + Default_Aft : Field := Num'Aft; + Default_Exp : Field := 0; + + procedure Put + (Win : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + + procedure Put + (Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Decimal_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.adb b/Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.adb new file mode 100644 index 00000000..633c1d87 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.adb @@ -0,0 +1,66 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Ada.Characters.Handling; use Ada.Characters.Handling; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Enumeration_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package EIO is new Ada.Text_IO.Enumeration_IO (Enum); + + procedure Put + (Win : in Window; + Item : in Enum; + Width : in Field := Default_Width; + Set : in Type_Set := Default_Setting) + is + Buf : String (1 .. Field'Last); + Tset : Ada.Text_IO.Type_Set; + begin + if Set /= Mixed_Case then + Tset := Ada.Text_IO.Type_Set'Val (Type_Set'Pos (Set)); + else + Tset := Ada.Text_IO.Lower_Case; + end if; + EIO.Put (Buf, Item, Tset); + if Set = Mixed_Case then + Buf (Buf'First) := To_Upper (Buf (Buf'First)); + end if; + Aux.Put_Buf (Win, Buf, Width, True, True); + end Put; + + procedure Put + (Item : in Enum; + Width : in Field := Default_Width; + Set : in Type_Set := Default_Setting) + is + begin + Put (Get_Window, Item, Width, Set); + end Put; + +end Terminal_Interface.Curses.Text_IO.Enumeration_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.ads b/Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.ads new file mode 100644 index 00000000..d715517c --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-enumeration_io.ads @@ -0,0 +1,49 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Enumeration_IO -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +generic + type Enum is (<>); + +package Terminal_Interface.Curses.Text_IO.Enumeration_IO is + + Default_Width : Field := 0; + Default_Setting : Type_Set := Mixed_Case; + + procedure Put + (Win : in Window; + Item : in Enum; + Width : in Field := Default_Width; + Set : in Type_Set := Default_Setting); + + procedure Put + (Item : in Enum; + Width : in Field := Default_Width; + Set : in Type_Set := Default_Setting); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Enumeration_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.adb b/Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.adb new file mode 100644 index 00000000..76703f34 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.adb @@ -0,0 +1,61 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Fixed_IO -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Fixed_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package FIXIO is new Ada.Text_IO.Fixed_IO (Num); + + procedure Put + (Win : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp) + is + Buf : String (1 .. Field'Last); + Len : Field := Fore + 1 + Aft; + begin + if Exp > 0 then + Len := Len + 1 + Exp; + end if; + FIXIO.Put (Buf, Item, Aft, Exp); + Aux.Put_Buf (Win, Buf, Len, False); + end Put; + + procedure Put + (Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp) is + begin + Put (Get_Window, Item, Fore, Aft, Exp); + end Put; + +end Terminal_Interface.Curses.Text_IO.Fixed_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.ads b/Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.ads new file mode 100644 index 00000000..f3c12647 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-fixed_io.ads @@ -0,0 +1,52 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Fixed_IO -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +generic + type Num is delta <>; + +package Terminal_Interface.Curses.Text_IO.Fixed_IO is + + Default_Fore : Field := Num'Fore; + Default_Aft : Field := Num'Aft; + Default_Exp : Field := 0; + + procedure Put + (Win : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + + procedure Put + (Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Fixed_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-float_io.adb b/Ada95/ada_include/terminal_interface-curses-text_io-float_io.adb new file mode 100644 index 00000000..a6403743 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-float_io.adb @@ -0,0 +1,62 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Float_IO -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Float_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package FIO is new Ada.Text_IO.Float_IO (Num); + + procedure Put + (Win : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp) + is + Buf : String (1 .. Field'Last); + Len : Field := Fore + 1 + Aft; + begin + if Exp > 0 then + Len := Len + 1 + Exp; + end if; + FIO.Put (Buf, Item, Aft, Exp); + Aux.Put_Buf (Win, Buf, Len, False); + end Put; + + procedure Put + (Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp) + is + begin + Put (Get_Window, Item, Fore, Aft, Exp); + end Put; + +end Terminal_Interface.Curses.Text_IO.Float_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-float_io.ads b/Ada95/ada_include/terminal_interface-curses-text_io-float_io.ads new file mode 100644 index 00000000..670407a5 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-float_io.ads @@ -0,0 +1,52 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Float_IO -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +generic + type Num is digits <>; + +package Terminal_Interface.Curses.Text_IO.Float_IO is + + Default_Fore : Field := 2; + Default_Aft : Field := Num'Digits - 1; + Default_Exp : Field := 3; + + procedure Put + (Win : in Window; + Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + + procedure Put + (Item : in Num; + Fore : in Field := Default_Fore; + Aft : in Field := Default_Aft; + Exp : in Field := Default_Exp); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Float_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-integer_io.adb b/Ada95/ada_include/terminal_interface-curses-text_io-integer_io.adb new file mode 100644 index 00000000..6f4ab6ee --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-integer_io.adb @@ -0,0 +1,56 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Integer_IO -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Integer_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package IIO is new Ada.Text_IO.Integer_IO (Num); + + procedure Put + (Win : in Window; + Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base) + is + Buf : String (1 .. Field'Last); + begin + IIO.Put (Buf, Item, Base); + Aux.Put_Buf (Win, Buf, Width); + end Put; + + procedure Put + (Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base) + is + begin + Put (Get_Window, Item, Width, Base); + end Put; + +end Terminal_Interface.Curses.Text_IO.Integer_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-integer_io.ads b/Ada95/ada_include/terminal_interface-curses-text_io-integer_io.ads new file mode 100644 index 00000000..69e9661f --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-integer_io.ads @@ -0,0 +1,49 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Integer_IO -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +generic + type Num is range <>; + +package Terminal_Interface.Curses.Text_IO.Integer_IO is + + Default_Width : Field := Num'Width; + Default_Base : Number_Base := 10; + + procedure Put + (Win : in Window; + Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base); + + procedure Put + (Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Integer_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-modular_io.adb b/Ada95/ada_include/terminal_interface-curses-text_io-modular_io.adb new file mode 100644 index 00000000..d4399c4b --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-modular_io.adb @@ -0,0 +1,56 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Modular_IO -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +with Ada.Text_IO; +with Terminal_Interface.Curses.Text_IO.Aux; + +package body Terminal_Interface.Curses.Text_IO.Modular_IO is + + package Aux renames Terminal_Interface.Curses.Text_IO.Aux; + package MIO is new Ada.Text_IO.Modular_IO (Num); + + procedure Put + (Win : in Window; + Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base) + is + Buf : String (1 .. Field'Last); + begin + MIO.Put (Buf, Item, Base); + Aux.Put_Buf (Win, Buf, Width); + end Put; + + procedure Put + (Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base) + is + begin + Put (Get_Window, Item, Width, Base); + end Put; + +end Terminal_Interface.Curses.Text_IO.Modular_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io-modular_io.ads b/Ada95/ada_include/terminal_interface-curses-text_io-modular_io.ads new file mode 100644 index 00000000..1f0b3467 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io-modular_io.ads @@ -0,0 +1,49 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO.Modular_IO -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +generic + type Num is mod <>; + +package Terminal_Interface.Curses.Text_IO.Modular_IO is + + Default_Width : Field := Num'Width; + Default_Base : Number_Base := 10; + + procedure Put + (Win : in Window; + Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base); + + procedure Put + (Item : in Num; + Width : in Field := Default_Width; + Base : in Number_Base := Default_Base); + +private + pragma Inline (Put); + +end Terminal_Interface.Curses.Text_IO.Modular_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io.adb b/Ada95/ada_include/terminal_interface-curses-text_io.adb new file mode 100644 index 00000000..794d6830 --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io.adb @@ -0,0 +1,327 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.4 $ +------------------------------------------------------------------------------ +with System; + +package body Terminal_Interface.Curses.Text_IO is + + Default_Window : Window; + + procedure Set_Window (Win : in Window) + is + begin + Default_Window := Win; + end Set_Window; + + function Get_Window return Window + is + begin + if Default_Window = Null_Window then + return Standard_Window; + else + return Default_Window; + end if; + end Get_Window; + pragma Inline (Get_Window); + + procedure Flush (Win : in Window) + is + begin + Refresh (Win); + end Flush; + + procedure Flush + is + begin + Flush (Get_Window); + end Flush; + + -------------------------------------------- + -- Specification of line and page lengths -- + -------------------------------------------- + + -- There are no set routines in this package. I assume, that you allocate + -- the window with an appropriate size. + -- A scroll-window is interpreted as an page with unbounded page length, + -- i.e. it returns the conventional 0 as page length. + + function Line_Length (Win : in Window) return Count + is + N_Lines : Line_Count; + N_Cols : Column_Count; + begin + Get_Size (Win, N_Lines, N_Cols); + if Natural (N_Cols) > Natural (Count'Last) then + raise Layout_Error; + end if; + return Count (N_Cols); + end Line_Length; + + function Line_Length return Count + is + begin + return Line_Length (Get_Window); + end Line_Length; + + function Page_Length (Win : in Window) return Count + is + N_Lines : Line_Count; + N_Cols : Column_Count; + begin + if Scrolling_Allowed (Win) then + return 0; + else + Get_Size (Win, N_Lines, N_Cols); + if Natural (N_Lines) > Natural (Count'Last) then + raise Layout_Error; + end if; + return Count (N_Lines); + end if; + end Page_Length; + + function Page_Length return Count + is + begin + return Page_Length (Get_Window); + end Page_Length; + + ------------------------------------ + -- Column, Line, and Page Control -- + ------------------------------------ + procedure New_Line (Win : in Window; Spacing : in Positive_Count := 1) + is + P_Size : constant Count := Page_Length (Win); + begin + if Spacing not in Positive_Count then + raise Constraint_Error; + end if; + + for I in 1 .. Spacing loop + if P_Size > 0 and then Line (Win) >= P_Size then + New_Page (Win); + else + Add (Win, Ascii.LF); + end if; + end loop; + end New_Line; + + procedure New_Line (Spacing : in Positive_Count := 1) + is + begin + New_Line (Get_Window, Spacing); + end New_Line; + + procedure New_Page (Win : in Window) + is + begin + Clear (Win); + end New_Page; + + procedure New_Page + is + begin + New_Page (Get_Window); + end New_Page; + + procedure Set_Col (Win : in Window; To : in Positive_Count) + is + Y : Line_Position; + X1 : Column_Position; + X2 : Column_Position; + N : Natural; + begin + if To not in Positive_Count then + raise Constraint_Error; + end if; + + Get_Cursor_Position (Win, Y, X1); + N := Natural (To); N := N - 1; + X2 := Column_Position (N); + if X1 > X2 then + New_Line (Win, 1); + X1 := 0; + end if; + if X1 < X2 then + declare + Filler : constant String (Integer (X1) .. (Integer (X2) - 1)) + := (others => ' '); + begin + Put (Win, Filler); + end; + end if; + end Set_Col; + + procedure Set_Col (To : in Positive_Count) + is + begin + Set_Col (Get_Window, To); + end Set_Col; + + procedure Set_Line (Win : in Window; To : in Positive_Count) + is + Y1 : Line_Position; + Y2 : Line_Position; + X : Column_Position; + N : Natural; + begin + if To not in Positive_Count then + raise Constraint_Error; + end if; + + Get_Cursor_Position (Win, Y1, X); + N := Natural (To); N := N - 1; + Y2 := Line_Position (N); + if Y2 < Y1 then + New_Page (Win); + Y1 := 0; + end if; + if Y1 < Y2 then + New_Line (Win, Positive_Count (Y2 - Y1)); + end if; + end Set_Line; + + procedure Set_Line (To : in Positive_Count) + is + begin + Set_Line (Get_Window, To); + end Set_Line; + + function Col (Win : in Window) return Positive_Count + is + Y : Line_Position; + X : Column_Position; + N : Natural; + begin + Get_Cursor_Position (Win, Y, X); + N := Natural (X); N := N + 1; + if N > Natural (Count'Last) then + raise Layout_Error; + end if; + return Positive_Count (N); + end Col; + + function Col return Positive_Count + is + begin + return Col (Get_Window); + end Col; + + function Line (Win : in Window) return Positive_Count + is + Y : Line_Position; + X : Column_Position; + N : Natural; + begin + Get_Cursor_Position (Win, Y, X); + N := Natural (Y); N := N + 1; + if N > Natural (Count'Last) then + raise Layout_Error; + end if; + return Positive_Count (N); + end Line; + + function Line return Positive_Count + is + begin + return Line (Get_Window); + end Line; + + ----------------------- + -- Characters Output -- + ----------------------- + + procedure Put (Win : in Window; Item : in Character) + is + P_Size : constant Count := Page_Length (Win); + Y : Line_Position; + X : Column_Position; + L : Line_Count; + C : Column_Count; + begin + if P_Size > 0 then + Get_Cursor_Position (Win, Y, X); + Get_Size (Win, L, C); + if (Y + 1) = L and then (X + 1) = C then + New_Page (Win); + end if; + end if; + Add (Win, Item); + end Put; + + procedure Put (Item : in Character) + is + begin + Put (Get_Window, Item); + end Put; + + -------------------- + -- Strings-Output -- + -------------------- + + procedure Put (Win : in Window; Item : in String) + is + P_Size : constant Count := Page_Length (Win); + Y : Line_Position; + X : Column_Position; + L : Line_Count; + C : Column_Count; + begin + if P_Size > 0 then + Get_Cursor_Position (Win, Y, X); + Get_Size (Win, L, C); + if (Y + 1) = L and then (X + 1 + Item'Length) >= C then + New_Page (Win); + end if; + end if; + Add (Win, Item); + end Put; + + procedure Put (Item : in String) + is + begin + Put (Get_Window, Item); + end Put; + + procedure Put_Line + (Win : in Window; + Item : in String) + is + begin + Put (Win, Item); + New_Line (Win, 1); + end Put_Line; + + procedure Put_Line + (Item : in String) + is + begin + Put_Line (Get_Window, Item); + end Put_Line; + +begin + Default_Window := Null_Window; + +end Terminal_Interface.Curses.Text_IO; diff --git a/Ada95/ada_include/terminal_interface-curses-text_io.ads b/Ada95/ada_include/terminal_interface-curses-text_io.ads new file mode 100644 index 00000000..7b057aaf --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses-text_io.ads @@ -0,0 +1,124 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Text_IO -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.5 $ +------------------------------------------------------------------------------ +with System; +with System.Parameters; +with Ada.Text_IO; +with Ada.IO_Exceptions; + +package Terminal_Interface.Curses.Text_IO is + + use type Ada.Text_IO.Count; + subtype Count is Ada.Text_IO.Count; + subtype Positive_Count is Count range 1 .. Count'Last; + + subtype Field is Integer range 0 .. System.Parameters.Field_Max; + subtype Number_Base is Integer range 2 .. 16; + + type Type_Set is (Lower_Case, Upper_Case, Mixed_Case); + + -- For most of the routines you will see a version without a Window + -- type parameter. They will operate on a default window, which can + -- be set by the user. It is initially equal to Standard_Window. + + procedure Set_Window (Win : in Window); + -- Set Win as the default window + + function Get_Window return Window; + -- Get the current default window + + procedure Flush (Win : in Window); + procedure Flush; + + -------------------------------------------- + -- Specification of line and page lengths -- + -------------------------------------------- + + -- There are no set routines in this package. I assume, that you allocate + -- the window with an appropriate size. + -- A scroll-window is interpreted as an page with unbounded page length, + -- i.e. it returns the conventional 0 as page length. + + function Line_Length (Win : in Window) return Count; + function Line_Length return Count; + + function Page_Length (Win : in Window) return Count; + function Page_Length return Count; + + ------------------------------------ + -- Column, Line, and Page Control -- + ------------------------------------ + procedure New_Line (Win : in Window; Spacing : in Positive_Count := 1); + procedure New_Line (Spacing : in Positive_Count := 1); + + procedure New_Page (Win : in Window); + procedure New_Page; + + procedure Set_Col (Win : in Window; To : in Positive_Count); + procedure Set_Col (To : in Positive_Count); + + procedure Set_Line (Win : in Window; To : in Positive_Count); + procedure Set_Line (To : in Positive_Count); + + function Col (Win : in Window) return Positive_Count; + function Col return Positive_Count; + + function Line (Win : in Window) return Positive_Count; + function Line return Positive_Count; + + ----------------------- + -- Characters-Output -- + ----------------------- + + procedure Put (Win : in Window; Item : in Character); + procedure Put (Item : in Character); + + -------------------- + -- Strings-Output -- + -------------------- + + procedure Put (Win : in Window; Item : in String); + procedure Put (Item : in String); + + procedure Put_Line + (Win : in Window; + Item : in String); + + procedure Put_Line + (Item : in String); + + -- Exceptions + + Status_Error : exception renames Ada.IO_Exceptions.Status_Error; + Mode_Error : exception renames Ada.IO_Exceptions.Mode_Error; + Name_Error : exception renames Ada.IO_Exceptions.Name_Error; + Use_Error : exception renames Ada.IO_Exceptions.Use_Error; + Device_Error : exception renames Ada.IO_Exceptions.Device_Error; + End_Error : exception renames Ada.IO_Exceptions.End_Error; + Data_Error : exception renames Ada.IO_Exceptions.Data_Error; + Layout_Error : exception renames Ada.IO_Exceptions.Layout_Error; + +end Terminal_Interface.Curses.Text_IO; diff --git a/Ada95/ada_include/terminal_interface-curses.adb b/Ada95/ada_include/terminal_interface-curses.adb new file mode 100644 index 00000000..f5d2478b --- /dev/null +++ b/Ada95/ada_include/terminal_interface-curses.adb @@ -0,0 +1,2271 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses -- +-- -- +-- B O D Y -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.7 $ +------------------------------------------------------------------------------ +with System; + +with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux; +with Interfaces.C; use Interfaces.C; +with Interfaces.C.Strings; use Interfaces.C.Strings; +with Ada.Characters.Handling; use Ada.Characters.Handling; +with Unchecked_Conversion; + +package body Terminal_Interface.Curses is + + use type System.Bit_Order; + + type chtype_array is array (size_t range <>) + of aliased Attributed_Character; + pragma Pack (chtype_array); + pragma Convention (C, chtype_array); + +------------------------------------------------------------------------------ + procedure Key_Name (Key : in Real_Key_Code; + Name : out String) + is + function Keyname (K : C_Int) return chars_ptr; + pragma Import (C, Keyname, "keyname"); + + Ch : Character; + begin + if Key <= Character'Pos (Character'Last) then + Ch := Character'Val (Key); + if Is_Control (Ch) then + Un_Control (Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video), + Name); + elsif Is_Graphic (Ch) then + Fill_String (Null_Ptr, Name); + Name (Name'First) := Ch; + else + Fill_String (Null_Ptr, Name); + end if; + else + Fill_String (Keyname (C_Int (Key)), Name); + end if; + end Key_Name; +------------------------------------------------------------------------------ + procedure Init_Screen + is + function Initscr return Window; + pragma Import (C, Initscr, "initscr"); + + W : Window; + begin + W := Initscr; + if W = Null_Window then + raise Curses_Exception; + end if; + end Init_Screen; + + procedure End_Windows + is + function Endwin return C_Int; + pragma Import (C, Endwin, "endwin"); + begin + if Endwin = Curses_Err then + raise Curses_Exception; + end if; + end End_Windows; + + function Is_End_Window return Boolean + is + function Isendwin return C_Int; + pragma Import (C, Isendwin, "isendwin"); + begin + if Isendwin = Curses_False then + return False; + else + return True; + end if; + end Is_End_Window; +------------------------------------------------------------------------------ + procedure Move_Cursor (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position) + is + function Wmove (Win : Window; + Line : C_Int; + Column : C_Int + ) return C_Int; + pragma Import (C, Wmove, "wmove"); + begin + if Wmove (Win, C_Int (Line), C_Int (Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Move_Cursor; +------------------------------------------------------------------------------ + procedure Add (Win : in Window := Standard_Window; + Ch : in Attributed_Character) + is + function Waddch (W : Window; + Ch : C_Int) return C_Int; + pragma Import (C, Waddch, "waddch"); + begin + if Waddch (Win, Chtype_To_Cint (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Add; + + procedure Add (Win : in Window := Standard_Window; + Ch : in Character) + is + begin + Add (Win, + Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video)); + end Add; + + procedure Add + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in Attributed_Character) + is + function mvwaddch (W : Window; + Y : C_Int; + X : C_Int; + Ch : C_Int) return C_Int; + pragma Import (C, mvwaddch, "mvwaddch"); + begin + if mvwaddch (Win, C_Int (Line), + C_Int (Column), + Chtype_To_CInt (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Add; + + procedure Add + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in Character) + is + begin + Add (Win, + Line, + Column, + Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video)); + end Add; + + procedure Add_With_Immediate_Echo + (Win : in Window := Standard_Window; + Ch : in Attributed_Character) + is + function Wechochar (W : Window; + Ch : C_Int) return C_Int; + pragma Import (C, Wechochar, "wechochar"); + begin + if Wechochar (Win, Chtype_To_CInt (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Add_With_Immediate_Echo; + + procedure Add_With_Immediate_Echo + (Win : in Window := Standard_Window; + Ch : in Character) + is + begin + Add_With_Immediate_Echo + (Win, + Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video)); + end Add_With_Immediate_Echo; +------------------------------------------------------------------------------ + function Create (Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window + is + function Newwin (Number_Of_Lines : C_Int; + Number_Of_Columns : C_Int; + First_Line_Position : C_Int; + First_Column_Position : C_Int) return Window; + pragma Import (C, Newwin, "newwin"); + + W : Window; + begin + W := Newwin (C_Int (Number_Of_Lines), + C_Int (Number_Of_Columns), + C_Int (First_Line_Position), + C_Int (First_Column_Position)); + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Create; + + procedure Delete (Win : in out Window) + is + function Wdelwin (W : Window) return C_Int; + pragma Import (C, Wdelwin, "delwin"); + begin + if Wdelwin (Win) = Curses_Err then + raise Curses_Exception; + end if; + Win := Null_Window; + end Delete; + + function Sub_Window + (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window + is + function Subwin + (Win : Window; + Number_Of_Lines : C_Int; + Number_Of_Columns : C_Int; + First_Line_Position : C_Int; + First_Column_Position : C_Int) return Window; + pragma Import (C, Subwin, "subwin"); + + W : Window; + begin + W := Subwin (Win, + C_Int (Number_Of_Lines), + C_Int (Number_Of_Columns), + C_Int (First_Line_Position), + C_Int (First_Column_Position)); + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Sub_Window; + + function Derived_Window + (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window + is + function Derwin + (Win : Window; + Number_Of_Lines : C_Int; + Number_Of_Columns : C_Int; + First_Line_Position : C_Int; + First_Column_Position : C_Int) return Window; + pragma Import (C, Derwin, "derwin"); + + W : Window; + begin + W := Derwin (Win, + C_Int (Number_Of_Lines), + C_Int (Number_Of_Columns), + C_Int (First_Line_Position), + C_Int (First_Column_Position)); + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Derived_Window; + + function Duplicate (Win : Window) return Window + is + function Dupwin (Win : Window) return Window; + pragma Import (C, Dupwin, "dupwin"); + + W : Window := Dupwin (Win); + begin + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Duplicate; + + procedure Move_Window (Win : in Window; + Line : in Line_Position; + Column : in Column_Position) + is + function Mvwin (Win : Window; + Line : C_Int; + Column : C_Int) return C_Int; + pragma Import (C, Mvwin, "mvwin"); + begin + if Mvwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Move_Window; + + procedure Move_Derived_Window (Win : in Window; + Line : in Line_Position; + Column : in Column_Position) + is + function Mvderwin (Win : Window; + Line : C_Int; + Column : C_Int) return C_Int; + pragma Import (C, Mvderwin, "mvderwin"); + begin + if Mvderwin (Win, C_Int (Line), C_Int (Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Move_Derived_Window; + + procedure Set_Synch_Mode (Win : in Window := Standard_Window; + Mode : in Boolean := False) + is + function Syncok (Win : Window; + Mode : C_Int) return C_Int; + pragma Import (C, Syncok, "syncok"); + begin + if Syncok (Win, Boolean'Pos (Mode)) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Synch_Mode; +------------------------------------------------------------------------------ + procedure Add (Win : in Window := Standard_Window; + Str : in String; + Len : in Integer := -1) + is + type Char_Ptr is access all Interfaces.C.Char; + function Waddnstr (Win : Window; + Str : Char_Ptr; + Len : Integer := -1) return C_Int; + pragma Import (C, Waddnstr, "waddnstr"); + + Txt : char_array (0 .. Str'Length); + Length : size_t; + begin + To_C (Str, Txt, Length); + if Waddnstr (Win, Txt (Txt'First)'Access, Len) = Curses_Err then + raise Curses_Exception; + end if; + end Add; + + procedure Add + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in String; + Len : in Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Add (Win, Str, Len); + end Add; +------------------------------------------------------------------------------ + procedure Add + (Win : in Window := Standard_Window; + Str : in Attributed_String; + Len : in Integer := -1) + is + type Chtype_Ptr is access all Attributed_Character; + function Waddchnstr (Win : Window; + Str : Chtype_Ptr; + Len : Integer := -1) return C_Int; + pragma Import (C, Waddchnstr, "waddchnstr"); + + Txt : chtype_array (0 .. Str'Length); + begin + for Length in 1 .. size_t (Str'Length) loop + Txt (Length - 1) := Str (Natural (Length)); + end loop; + Txt (Str'Length) := Default_Character; + if Waddchnstr (Win, Txt (Txt'First)'Access, Len) = Curses_Err then + raise Curses_Exception; + end if; + end Add; + + procedure Add + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in Attributed_String; + Len : in Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Add (Win, Str, Len); + end Add; +------------------------------------------------------------------------------ + procedure Border + (Win : in Window := Standard_Window; + Left_Side_Symbol : in Attributed_Character := Default_Character; + Right_Side_Symbol : in Attributed_Character := Default_Character; + Top_Side_Symbol : in Attributed_Character := Default_Character; + Bottom_Side_Symbol : in Attributed_Character := Default_Character; + Upper_Left_Corner_Symbol : in Attributed_Character := Default_Character; + Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character; + Lower_Left_Corner_Symbol : in Attributed_Character := Default_Character; + Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character) + is + function Wborder (W : Window; + LS : C_Int; + RS : C_Int; + TS : C_Int; + BS : C_Int; + ULC : C_Int; + URC : C_Int; + LLC : C_Int; + LRC : C_Int) return C_Int; + pragma Import (C, Wborder, "wborder"); + begin + if Wborder (Win, + Chtype_To_CInt (Left_Side_Symbol), + Chtype_To_CInt (Right_Side_Symbol), + Chtype_To_CInt (Top_Side_Symbol), + Chtype_To_CInt (Bottom_Side_Symbol), + Chtype_To_CInt (Upper_Left_Corner_Symbol), + Chtype_To_CInt (Upper_Right_Corner_Symbol), + Chtype_To_CInt (Lower_Left_Corner_Symbol), + Chtype_To_CInt (Lower_Right_Corner_Symbol) + ) = Curses_Err + then + raise Curses_Exception; + end if; + end Border; + + procedure Box + (Win : in Window := Standard_Window; + Vertical_Symbol : in Attributed_Character := Default_Character; + Horizontal_Symbol : in Attributed_Character := Default_Character) + is + begin + Border (Win, + Vertical_Symbol, Vertical_Symbol, + Horizontal_Symbol, Horizontal_Symbol); + end Box; + + procedure Horizontal_Line + (Win : in Window := Standard_Window; + Line_Size : in Natural; + Line_Symbol : in Attributed_Character := Default_Character) + is + function Whline (W : Window; + Ch : C_Int; + Len : C_Int) return C_Int; + pragma Import (C, Whline, "whline"); + begin + if Whline (Win, + Chtype_To_CInt (Line_Symbol), + C_Int (Line_Size)) = Curses_Err then + raise Curses_Exception; + end if; + end Horizontal_Line; + + procedure Vertical_Line + (Win : in Window := Standard_Window; + Line_Size : in Natural; + Line_Symbol : in Attributed_Character := Default_Character) + is + function Wvline (W : Window; + Ch : C_Int; + Len : C_Int) return C_Int; + pragma Import (C, Wvline, "wvline"); + begin + if Wvline (Win, + Chtype_To_CInt (Line_Symbol), + C_Int (Line_Size)) = Curses_Err then + raise Curses_Exception; + end if; + end Vertical_Line; + +------------------------------------------------------------------------------ + function Get_Keystroke (Win : Window := Standard_Window) + return Real_Key_Code + is + function Wgetch (W : Window) return C_Int; + pragma Import (C, Wgetch, "wgetch"); + + C : constant C_Int := Wgetch (Win); + begin + if C = Curses_Err then + return Key_None; + else + return Real_Key_Code (C); + end if; + end Get_Keystroke; + + procedure Undo_Keystroke (Key : in Real_Key_Code) + is + function Ungetch (Ch : C_Int) return C_Int; + pragma Import (C, Ungetch, "ungetch"); + begin + if Ungetch (C_Int (Key)) = Curses_Err then + raise Curses_Exception; + end if; + end Undo_Keystroke; + + function Has_Key (Key : Special_Key_Code) return Boolean + is + function Haskey (Key : C_Int) return C_Int; + pragma Import (C, Haskey, "has_key"); + begin + if Haskey (C_Int (Key)) = Curses_False then + return False; + else + return True; + end if; + end Has_Key; + + function Is_Function_Key (Key : Special_Key_Code) return Boolean + is + L : constant Special_Key_Code := Special_Key_Code (Natural (Key_F0) + + Natural (Function_Key_Number'Last)); + begin + if (Key >= Key_F0) and then (Key <= L) then + return True; + else + return False; + end if; + end Is_Function_Key; + + function Function_Key (Key : Real_Key_Code) + return Function_Key_Number + is + begin + if Is_Function_Key (Key) then + return Function_Key_Number (Key - Key_F0); + else + raise Constraint_Error; + end if; + end Function_Key; + + function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code + is + begin + return Real_Key_Code (Natural (Key_F0) + Natural (Key)); + end Function_Key_Code; +------------------------------------------------------------------------------ + procedure Switch_Character_Attribute + (Win : in Window := Standard_Window; + Attr : in Character_Attribute_Set := Normal_Video; + On : in Boolean := True) + is + function Wattron (Win : Window; + C_Attr : C_Int) return C_Int; + pragma Import (C, Wattron, "wattr_on"); + function Wattroff (Win : Window; + C_Attr : C_Int) return C_Int; + pragma Import (C, Wattroff, "wattr_off"); + -- In Ada we use the On Boolean to control whether or not we want to + -- switch on or off the attributes in the set. + Err : C_Int; + AC : constant Attributed_Character := (Ch => Character'First, + Color => Color_Pair'First, + Attr => Attr); + begin + if On then + Err := Wattron (Win, Chtype_To_CInt (AC)); + else + Err := Wattroff (Win, Chtype_To_CInt (AC)); + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Switch_Character_Attribute; + + procedure Set_Character_Attributes + (Win : in Window := Standard_Window; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) + is + function Wattrset (Win : Window; + C_Attr : C_Int) return C_Int; + pragma Import (C, Wattrset, "wattrset"); -- ??? wattr_set + begin + if Wattrset (Win, + Chtype_To_CInt (Attributed_Character' + (Ch => Character'First, + Color => Color, + Attr => Attr))) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Character_Attributes; + + function Get_Character_Attribute (Win : Window := Standard_Window) + return Character_Attribute_Set + is + function Wattrget (Win : Window) return C_Int; + pragma Import (C, Wattrget, "wattr_get"); + + Ch : Attributed_Character := CInt_To_Chtype (Wattrget (Win)); + begin + return Ch.Attr; + end Get_Character_Attribute; + + function Get_Character_Attribute (Win : Window := Standard_Window) + return Color_Pair + is + function Wattrget (Win : Window) return C_Int; + pragma Import (C, Wattrget, "wattr_get"); + + Ch : Attributed_Character := CInt_To_Chtype (Wattrget (Win)); + begin + return Ch.Color; + end Get_Character_Attribute; + + procedure Change_Attributes + (Win : in Window := Standard_Window; + Count : in Integer := -1; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) + is + function Wchgat (Win : Window; + Cnt : C_Int; + Attr : C_Int; + Color : C_Short; + Opts : System.Address := System.Null_Address) + return C_Int; + pragma Import (C, Wchgat, "wchgat"); + + Ch : constant Attributed_Character := + (Ch => Character'First, Color => Color_Pair'First, Attr => Attr); + begin + if Wchgat (Win, C_Int (Count), Chtype_To_CInt (Ch), + C_Short (Color)) = Curses_Err then + raise Curses_Exception; + end if; + end Change_Attributes; + + procedure Change_Attributes + (Win : in Window := Standard_Window; + Line : in Line_Position := Line_Position'First; + Column : in Column_Position := Column_Position'First; + Count : in Integer := -1; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) + is + begin + Move_Cursor (Win, Line, Column); + Change_Attributes (Win, Count, Attr, Color); + end Change_Attributes; +------------------------------------------------------------------------------ + procedure Beep + is + function Beeper return C_Int; + pragma Import (C, Beeper, "beep"); + begin + if Beeper = Curses_Err then + raise Curses_Exception; + end if; + end Beep; + + procedure Flash_Screen + is + function Flash return C_Int; + pragma Import (C, Flash, "flash"); + begin + if Flash = Curses_Err then + raise Curses_Exception; + end if; + end Flash_Screen; +------------------------------------------------------------------------------ + procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True) + is + function Cbreak return C_Int; + pragma Import (C, Cbreak, "cbreak"); + function NoCbreak return C_Int; + pragma Import (C, NoCbreak, "nocbreak"); + + Err : C_Int; + begin + if SwitchOn then + Err := Cbreak; + else + Err := NoCbreak; + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Set_Cbreak_Mode; + + procedure Set_Raw_Mode (SwitchOn : in Boolean := True) + is + function Raw return C_Int; + pragma Import (C, Raw, "raw"); + function NoRaw return C_Int; + pragma Import (C, NoRaw, "noraw"); + + Err : C_Int; + begin + if SwitchOn then + Err := Raw; + else + Err := NoRaw; + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Set_Raw_Mode; + + procedure Set_Echo_Mode (SwitchOn : in Boolean := True) + is + function Echo return C_Int; + pragma Import (C, Echo, "echo"); + function NoEcho return C_Int; + pragma Import (C, NoEcho, "noecho"); + + Err : C_Int; + begin + if SwitchOn then + Err := Echo; + else + Err := NoEcho; + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Set_Echo_Mode; + + procedure Set_Meta_Mode (Win : in Window := Standard_Window; + SwitchOn : in Boolean := True) + is + function Meta (W : Window; Mode : C_Int) return C_Int; + pragma Import (C, Meta, "meta"); + begin + if Meta (Win, Boolean'Pos (SwitchOn)) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Meta_Mode; + + procedure Set_KeyPad_Mode (Win : in Window := Standard_Window; + SwitchOn : in Boolean := True) + is + function Keypad (W : Window; Mode : C_Int) return C_Int; + pragma Import (C, Keypad, "keypad"); + begin + if Keypad (Win, Boolean'Pos (SwitchOn)) = Curses_Err then + raise Curses_Exception; + end if; + end Set_KeyPad_Mode; + + procedure Half_Delay (Amount : in Half_Delay_Amount) + is + function Halfdelay (Amount : C_Int) return C_Int; + pragma Import (C, Halfdelay, "halfdelay"); + begin + if Halfdelay (C_Int (Amount)) = Curses_Err then + raise Curses_Exception; + end if; + end Half_Delay; + + procedure Set_Flush_On_Interrupt_Mode + (Win : in Window := Standard_Window; + Mode : in Boolean := True) + is + function Intrflush (Win : Window; Mode : C_Int) return C_Int; + pragma Import (C, Intrflush, "intrflush"); + begin + if Intrflush (Win, Boolean'Pos (Mode)) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Flush_On_Interrupt_Mode; + + procedure Set_Queue_Interrupt_Mode + (Win : in Window := Standard_Window; + Flush : in Boolean := True) + is + procedure Qiflush; + pragma Import (C, Qiflush, "qiflush"); + procedure No_Qiflush; + pragma Import (C, No_Qiflush, "noqiflush"); + begin + if Flush then + Qiflush; + else + No_Qiflush; + end if; + end Set_Queue_Interrupt_Mode; + + procedure Set_NoDelay_Mode + (Win : in Window := Standard_Window; + Mode : in Boolean := False) + is + function Nodelay (Win : Window; Mode : C_Int) return C_Int; + pragma Import (C, Nodelay, "nodelay"); + begin + if Nodelay (Win, Boolean'Pos (Mode)) = Curses_Err then + raise Curses_Exception; + end if; + end Set_NoDelay_Mode; + + procedure Set_Timeout_Mode (Win : in Window := Standard_Window; + Mode : in Timeout_Mode; + Amount : in Natural) + is + function Wtimeout (Win : Window; Amount : C_Int) return C_Int; + pragma Import (C, Wtimeout, "wtimeout"); + + Time : C_Int; + begin + case Mode is + when Blocking => Time := -1; + when Non_Blocking => Time := 0; + when Delayed => + if Amount = 0 then + raise CONSTRAINT_ERROR; + end if; + Time := C_Int (Amount); + end case; + if Wtimeout (Win, Time) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Timeout_Mode; + + procedure Set_Escape_Timer_Mode + (Win : in Window := Standard_Window; + Timer_Off : in Boolean := False) + is + function Notimeout (Win : Window; Mode : C_Int) return C_Int; + pragma Import (C, Notimeout, "notimeout"); + begin + if Notimeout (Win, Boolean'Pos (Timer_Off)) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Escape_Timer_Mode; + +------------------------------------------------------------------------------ + procedure Set_NL_Mode (SwitchOn : in Boolean := True) + is + function NL return C_Int; + pragma Import (C, NL, "nl"); + function NoNL return C_Int; + pragma Import (C, NoNL, "nonl"); + + Err : C_Int; + begin + if SwitchOn then + Err := NL; + else + Err := NoNL; + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Set_NL_Mode; + + procedure Clear_On_Next_Update + (Win : in Window := Standard_Window; + Do_Clear : in Boolean := True) + is + function Clear_Ok (W : Window; Flag : C_Int) return C_Int; + pragma Import (C, Clear_Ok, "clearok"); + begin + if Clear_Ok (Win, Boolean'Pos (Do_Clear)) = Curses_Err then + raise Curses_Exception; + end if; + end Clear_On_Next_Update; + + procedure Use_Insert_Delete_Line + (Win : in Window := Standard_Window; + Do_Idl : in Boolean := True) + is + function IDL_Ok (W : Window; Flag : C_Int) return C_Int; + pragma Import (C, IDL_Ok, "idlok"); + begin + if IDL_Ok (Win, Boolean'Pos (Do_Idl)) = Curses_Err then + raise Curses_Exception; + end if; + end Use_Insert_Delete_Line; + + procedure Use_Insert_Delete_Character + (Win : in Window := Standard_Window; + Do_Idc : in Boolean := True) + is + function IDC_Ok (W : Window; Flag : C_Int) return C_Int; + pragma Import (C, IDC_Ok, "idcok"); + begin + if IDC_Ok (Win, Boolean'Pos (Do_Idc)) = Curses_Err then + raise Curses_Exception; + end if; + end Use_Insert_Delete_Character; + + procedure Leave_Cursor_After_Update + (Win : in Window := Standard_Window; + Do_Leave : in Boolean := True) + is + function Leave_Ok (W : Window; Flag : C_Int) return C_Int; + pragma Import (C, Leave_Ok, "leaveok"); + begin + if Leave_Ok (Win, Boolean'Pos (Do_Leave)) = Curses_Err then + raise Curses_Exception; + end if; + end Leave_Cursor_After_Update; + + procedure Immediate_Update_Mode + (Win : in Window := Standard_Window; + Mode : in Boolean := False) + is + function Immedok (Win : Window; Mode : C_Int) return C_Int; + pragma Import (C, Immedok, "immedok"); + begin + if Immedok (Win, Boolean'Pos (Mode)) = Curses_Err then + raise Curses_Exception; + end if; + end Immediate_Update_Mode; + + procedure Allow_Scrolling + (Win : in Window := Standard_Window; + Mode : in Boolean := False) + is + function Scrollok (Win : Window; Mode : C_Int) return C_Int; + pragma Import (C, Scrollok, "scrollok"); + begin + if Scrollok (Win, Boolean'Pos (Mode)) = Curses_Err then + raise Curses_Exception; + end if; + end Allow_Scrolling; + + function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean + is + function Is_Scroll (Win : Window) return C_Int; + pragma Import (C, Is_Scroll, "_nc_ada_isscroll"); + + Res : constant C_Int := Is_Scroll (Win); + begin + case Res is + when Curses_True => return True; + when Curses_False => return False; + when others => raise Curses_Exception; + end case; + end Scrolling_Allowed; + + procedure Set_Scroll_Region + (Win : in Window := Standard_Window; + Top_Line : in Line_Position; + Bottom_Line : in Line_Position) + is + function Wsetscrreg (Win : Window; + Lin : C_Int; + Col : C_Int) return C_Int; + pragma Import (C, Wsetscrreg, "wsetscrreg"); + begin + if Wsetscrreg (Win, C_Int (Top_Line), C_Int (Bottom_Line)) + = Curses_Err then + raise Curses_Exception; + end if; + end Set_Scroll_Region; +------------------------------------------------------------------------------ + procedure Update_Screen + is + function Do_Update return C_Int; + pragma Import (C, Do_Update, "doupdate"); + begin + if Do_Update = Curses_Err then + raise Curses_Exception; + end if; + end Update_Screen; + + procedure Refresh (Win : in Window := Standard_Window) + is + function Wrefresh (W : Window) return C_Int; + pragma Import (C, Wrefresh, "wrefresh"); + begin + if Wrefresh (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Refresh; + + procedure Refresh_Without_Update + (Win : in Window := Standard_Window) + is + function Wnoutrefresh (W : Window) return C_Int; + pragma Import (C, Wnoutrefresh, "wnoutrefresh"); + begin + if Wnoutrefresh (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Refresh_Without_Update; + + procedure Redraw (Win : in Window := Standard_Window) + is + function Redrawwin (Win : Window) return C_Int; + pragma Import (C, Redrawwin, "redrawwin"); + begin + if Redrawwin (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Redraw; + + procedure Redraw + (Win : in Window := Standard_Window; + Begin_Line : in Line_Position; + Line_Count : in Positive) + is + function Wredrawln (Win : Window; First : C_Int; Cnt : C_Int) + return C_Int; + pragma Import (C, Wredrawln, "wredrawln"); + begin + if Wredrawln (Win, + C_Int (Begin_Line), + C_Int (Line_Count)) = Curses_Err then + raise Curses_Exception; + end if; + end Redraw; + +------------------------------------------------------------------------------ + procedure Erase (Win : in Window := Standard_Window) + is + function Werase (W : Window) return C_Int; + pragma Import (C, Werase, "werase"); + begin + if Werase (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Erase; + + procedure Clear (Win : in Window := Standard_Window) + is + function Wclear (W : Window) return C_Int; + pragma Import (C, Wclear, "wclear"); + begin + if Wclear (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Clear; + + procedure Clear_To_End_Of_Screen (Win : in Window := Standard_Window) + is + function Wclearbot (W : Window) return C_Int; + pragma Import (C, Wclearbot, "wclrtobot"); + begin + if Wclearbot (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Clear_To_End_Of_Screen; + + procedure Clear_To_End_Of_Line (Win : in Window := Standard_Window) + is + function Wcleareol (W : Window) return C_Int; + pragma Import (C, Wcleareol, "wclrtoeol"); + begin + if Wcleareol (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Clear_To_End_Of_Line; +------------------------------------------------------------------------------ + procedure Set_Background + (Win : in Window := Standard_Window; + Ch : in Attributed_Character) + is + procedure WBackground (W : in Window; Ch : in C_Int); + pragma Import (C, WBackground, "wbkgdset"); + begin + WBackground (Win, Chtype_To_CInt (Ch)); + end Set_Background; + + procedure Change_Background + (Win : in Window := Standard_Window; + Ch : in Attributed_Character) + is + function WChangeBkgd (W : Window; Ch : C_Int) + return C_Int; + pragma Import (C, WChangeBkgd, "wbkgd"); + begin + if WChangeBkgd (Win, Chtype_To_CInt (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Change_Background; + + function Get_Background (Win : Window := Standard_Window) + return Attributed_Character + is + function Wgetbkgd (Win : Window) return C_Int; + pragma Import (C, Wgetbkgd, "getbkgd"); + begin + return CInt_To_Chtype (Wgetbkgd (Win)); + end Get_Background; +------------------------------------------------------------------------------ + procedure Change_Lines_Status (Win : in Window := Standard_Window; + Start : in Line_Position; + Count : in Positive; + State : in Boolean) + is + function Wtouchln (Win : Window; + Sta : C_Int; + Cnt : C_Int; + Chg : C_Int) return C_Int; + pragma Import (C, Wtouchln, "wtouchln"); + begin + if Wtouchln (Win, C_Int (Start), C_Int (Count), + C_Int (Boolean'Pos (State))) = Curses_Err then + raise Curses_Exception; + end if; + end Change_Lines_Status; + + procedure Touch (Win : in Window := Standard_Window) + is + Y : Line_Position; + X : Column_Position; + begin + Get_Size (Win, Y, X); + Change_Lines_Status (Win, 0, Positive (Y), True); + end Touch; + + procedure Untouch (Win : in Window := Standard_Window) + is + Y : Line_Position; + X : Column_Position; + begin + Get_Size (Win, Y, X); + Change_Lines_Status (Win, 0, Positive (Y), False); + end Untouch; + + procedure Touch (Win : in Window := Standard_Window; + Start : in Line_Position; + Count : in Positive) + is + begin + Change_Lines_Status (Win, Start, Count, True); + end Touch; + + function Is_Touched + (Win : Window := Standard_Window; + Line : Line_Position) return Boolean + is + function WLineTouched (W : Window; L : C_Int) return C_Int; + pragma Import (C, WLineTouched, "is_linetouched"); + begin + if WLineTouched (Win, C_Int (Line)) = Curses_False then + return False; + else + return True; + end if; + end Is_Touched; + + function Is_Touched + (Win : Window := Standard_Window) return Boolean + is + function WWinTouched (W : Window) return C_Int; + pragma Import (C, WWinTouched, "is_wintouched"); + begin + if WWinTouched (Win) = Curses_False then + return False; + else + return True; + end if; + end Is_Touched; +------------------------------------------------------------------------------ + procedure Copy + (Source_Window : in Window; + Destination_Window : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in Column_Position; + Non_Destructive_Mode : in Boolean := True) + is + function Copywin (Src : Window; + Dst : Window; + Str : C_Int; + Slc : C_Int; + Dtr : C_Int; + Dlc : C_Int; + Dbr : C_Int; + Drc : C_Int; + Ndm : C_Int) return C_Int; + pragma Import (C, Copywin, "copywin"); + begin + if Copywin (Source_Window, + Destination_Window, + C_Int (Source_Top_Row), + C_Int (Source_Left_Column), + C_Int (Destination_Top_Row), + C_Int (Destination_Left_Column), + C_Int (Destination_Bottom_Row), + C_Int (Destination_Right_Column), + Boolean'Pos (Non_Destructive_Mode) + ) = Curses_Err then + raise Curses_Exception; + end if; + end Copy; + + procedure Overwrite + (Source_Window : in Window; + Destination_Window : in Window) + is + function Overwrite (Src : Window; Dst : Window) return C_Int; + pragma Import (C, Overwrite, "overwrite"); + begin + if Overwrite (Source_Window, Destination_Window) = Curses_Err then + raise Curses_Exception; + end if; + end Overwrite; + + procedure Overlay + (Source_Window : in Window; + Destination_Window : in Window) + is + function Overlay (Src : Window; Dst : Window) return C_Int; + pragma Import (C, Overlay, "overlay"); + begin + if Overlay (Source_Window, Destination_Window) = Curses_Err then + raise Curses_Exception; + end if; + end Overlay; + +------------------------------------------------------------------------------ + procedure Insert_Delete_Lines + (Win : in Window := Standard_Window; + Lines : in Integer := 1) -- default is to insert one line above + is + function Winsdelln (W : Window; N : C_Int) return C_Int; + pragma Import (C, Winsdelln, "winsdelln"); + begin + if Winsdelln (Win, C_Int (Lines)) = Curses_Err then + raise Curses_Exception; + end if; + end Insert_Delete_Lines; + + procedure Delete_Line (Win : in Window := Standard_Window) + is + begin + Insert_Delete_Lines (Win, -1); + end Delete_Line; + + procedure Insert_Line (Win : in Window := Standard_Window) + is + begin + Insert_Delete_Lines (Win, 1); + end Insert_Line; +------------------------------------------------------------------------------ + procedure Get_Size + (Win : in Window := Standard_Window; + Number_Of_Lines : out Line_Count; + Number_Of_Columns : out Column_Count) + is + type Int_Access is access all C_Int; + function Getmaxyx (W : Window; Y, X : Int_Access) return C_Int; + pragma Import (C, Getmaxyx, "_nc_ada_getmaxyx"); + + Y, X : aliased C_Int; + Err : constant C_Int := Getmaxyx (Win, Y'Access, X'Access); + begin + if Err = Curses_Err then + raise Curses_Exception; + else + Number_Of_Lines := Line_Count (Y); + Number_Of_Columns := Column_Count (X); + end if; + end Get_Size; + + procedure Get_Window_Position + (Win : in Window := Standard_Window; + Top_Left_Line : out Line_Position; + Top_Left_Column : out Column_Position) + is + type Int_Access is access all C_Int; + function Getbegyx (W : Window; Y, X : Int_Access) return C_Int; + pragma Import (C, Getbegyx, "_nc_ada_getbegyx"); + + Y, X : aliased C_Int; + Err : constant C_Int := Getbegyx (Win, Y'Access, X'Access); + begin + if Err = Curses_Err then + raise Curses_Exception; + else + Top_Left_Line := Line_Position (Y); + Top_Left_Column := Column_Position (X); + end if; + end Get_Window_Position; + + procedure Get_Cursor_Position + (Win : in Window := Standard_Window; + Line : out Line_Position; + Column : out Column_Position) + is + type Int_Access is access all C_Int; + function Getyx (W : Window; Y, X : Int_Access) return C_Int; + pragma Import (C, Getyx, "_nc_ada_getyx"); + + Y, X : aliased C_Int; + Err : constant C_Int := Getyx (Win, Y'Access, X'Access); + begin + if Err = Curses_Err then + raise Curses_Exception; + else + Line := Line_Position (Y); + Column := Column_Position (X); + end if; + end Get_Cursor_Position; + + procedure Get_Origin_Relative_To_Parent + (Win : in Window; + Top_Left_Line : out Line_Position; + Top_Left_Column : out Column_Position; + Is_Not_A_Subwindow : out Boolean) + is + type Int_Access is access all C_Int; + function Getparyx (W : Window; Y, X : Int_Access) return C_Int; + pragma Import (C, Getparyx, "_nc_ada_getparyx"); + + Y, X : aliased C_Int; + Err : constant C_Int := Getparyx (Win, Y'Access, X'Access); + begin + if Err = Curses_Err then + raise Curses_Exception; + else + if Y = -1 then + Top_Left_Line := Line_Position'Last; + Top_Left_Column := Column_Position'Last; + Is_Not_A_Subwindow := True; + else + Top_Left_Line := Line_Position (Y); + Top_Left_Column := Column_Position (X); + Is_Not_A_Subwindow := False; + end if; + end if; + end Get_Origin_Relative_To_Parent; +------------------------------------------------------------------------------ + function New_Pad (Lines : Line_Count; + Columns : Column_Count) return Window + is + function Newpad (Lines : C_Int; Columns : C_Int) return Window; + pragma Import (C, Newpad, "newpad"); + + W : Window; + begin + W := Newpad (C_Int (Lines), C_Int (Columns)); + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end New_Pad; + + function Sub_Pad + (Pad : Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window + is + function Subpad + (Pad : Window; + Number_Of_Lines : C_Int; + Number_Of_Columns : C_Int; + First_Line_Position : C_Int; + First_Column_Position : C_Int) return Window; + pragma Import (C, Subpad, "subpad"); + + W : Window; + begin + W := Subpad (Pad, + C_Int (Number_Of_Lines), + C_Int (Number_Of_Columns), + C_Int (First_Line_Position), + C_Int (First_Column_Position)); + if W = Null_Window then + raise Curses_Exception; + end if; + return W; + end Sub_Pad; + + procedure Refresh + (Pad : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in Column_Position) + is + function Prefresh + (Pad : Window; + Source_Top_Row : C_Int; + Source_Left_Column : C_Int; + Destination_Top_Row : C_Int; + Destination_Left_Column : C_Int; + Destination_Bottom_Row : C_Int; + Destination_Right_Column : C_Int) return C_Int; + pragma Import (C, Prefresh, "prefresh"); + begin + if Prefresh (Pad, + C_Int (Source_Top_Row), + C_Int (Source_Left_Column), + C_Int (Destination_Top_Row), + C_Int (Destination_Left_Column), + C_Int (Destination_Bottom_Row), + C_Int (Destination_Right_Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Refresh; + + procedure Refresh_Without_Update + (Pad : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in Column_Position) + is + function Pnoutrefresh + (Pad : Window; + Source_Top_Row : C_Int; + Source_Left_Column : C_Int; + Destination_Top_Row : C_Int; + Destination_Left_Column : C_Int; + Destination_Bottom_Row : C_Int; + Destination_Right_Column : C_Int) return C_Int; + pragma Import (C, Pnoutrefresh, "pnoutrefresh"); + begin + if Pnoutrefresh (Pad, + C_Int (Source_Top_Row), + C_Int (Source_Left_Column), + C_Int (Destination_Top_Row), + C_Int (Destination_Left_Column), + C_Int (Destination_Bottom_Row), + C_Int (Destination_Right_Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Refresh_Without_Update; + + procedure Add_Character_To_Pad_And_Echo_It + (Pad : in Window; + Ch : in Attributed_Character) + is + function Pechochar (Pad : Window; Ch : C_Int) + return C_Int; + pragma Import (C, Pechochar, "pechochar"); + begin + if Pechochar (Pad, Chtype_To_CInt (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Add_Character_To_Pad_And_Echo_It; + + procedure Add_Character_To_Pad_And_Echo_It + (Pad : in Window; + Ch : in Character) + is + begin + Add_Character_To_Pad_And_Echo_It + (Pad, + Attributed_Character'(Ch => Ch, + Color => Color_Pair'First, + Attr => Normal_Video)); + end Add_Character_To_Pad_And_Echo_It; +------------------------------------------------------------------------------ + procedure Scroll (Win : in Window := Standard_Window; + Amount : in Integer := 1) + is + function Wscrl (Win : Window; N : C_Int) return C_Int; + pragma Import (C, Wscrl, "wscrl"); + + begin + if Wscrl (Win, C_Int (Amount)) = Curses_Err then + raise Curses_Exception; + end if; + end Scroll; + +------------------------------------------------------------------------------ + procedure Delete_Character (Win : in Window := Standard_Window) + is + function Wdelch (Win : Window) return C_Int; + pragma Import (C, Wdelch, "wdelch"); + begin + if Wdelch (Win) = Curses_Err then + raise Curses_Exception; + end if; + end Delete_Character; + + procedure Delete_Character + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position) + is + function Mvwdelch (Win : Window; + Lin : C_Int; + Col : C_Int) return C_Int; + pragma Import (C, Mvwdelch, "mvwdelch"); + begin + if Mvwdelch (Win, C_Int (Line), C_Int (Column)) = Curses_Err then + raise Curses_Exception; + end if; + end Delete_Character; +------------------------------------------------------------------------------ + function Peek (Win : Window := Standard_Window) + return Attributed_Character + is + function Winch (Win : Window) return C_Int; + pragma Import (C, Winch, "winch"); + begin + return CInt_To_Chtype (Winch (Win)); + end Peek; + + function Peek + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position) return Attributed_Character + is + function Mvwinch (Win : Window; + Lin : C_Int; + Col : C_Int) return C_Int; + pragma Import (C, Mvwinch, "mvwinch"); + begin + return CInt_To_Chtype (Mvwinch (Win, C_Int (Line), C_Int (Column))); + end Peek; +------------------------------------------------------------------------------ + procedure Insert (Win : in Window := Standard_Window; + Ch : in Attributed_Character) + is + function Winsch (Win : Window; Ch : C_Int) return C_Int; + pragma Import (C, Winsch, "winsch"); + begin + if Winsch (Win, Chtype_To_CInt (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Insert; + + procedure Insert + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in Attributed_Character) + is + function Mvwinsch (Win : Window; + Lin : C_Int; + Col : C_Int; + Ch : C_Int) return C_Int; + pragma Import (C, Mvwinsch, "mvwinsch"); + begin + if Mvwinsch (Win, + C_Int (Line), + C_Int (Column), + Chtype_To_CInt (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Insert; +------------------------------------------------------------------------------ + procedure Insert (Win : in Window := Standard_Window; + Str : in String; + Len : in Integer := -1) + is + type Char_Ptr is access all Interfaces.C.Char; + function Winsnstr (Win : Window; + Str : Char_Ptr; + Len : Integer := -1) return C_Int; + pragma Import (C, Winsnstr, "winsnstr"); + + Txt : char_array (0 .. Str'Length); + Length : size_t; + begin + To_C (Str, Txt, Length); + if Winsnstr (Win, Txt (Txt'First)'Access, Len) = Curses_Err then + raise Curses_Exception; + end if; + end Insert; + + procedure Insert + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in String; + Len : in Integer := -1) + is + type Char_Ptr is access all Interfaces.C.Char; + function Mvwinsnstr (Win : Window; + Line : C_Int; + Column : C_Int; + Str : Char_Ptr; + Len : C_Int) return C_Int; + pragma Import (C, Mvwinsnstr, "mvwinsnstr"); + + Txt : char_array (0 .. Str'Length); + Length : size_t; + begin + To_C (Str, Txt, Length); + if Mvwinsnstr (Win, C_Int (Line), C_Int (Column), + Txt (Txt'First)'Access, C_Int (Len)) + = Curses_Err then + raise Curses_Exception; + end if; + end Insert; +------------------------------------------------------------------------------ + procedure Peek (Win : in Window := Standard_Window; + Str : out String; + Len : in Integer := -1) + is + function Winnstr (Win : Window; + Str : char_array; + Len : C_Int) return C_Int; + pragma Import (C, Winnstr, "winnstr"); + + N : Integer := Len; + Txt : char_array (0 .. Str'Length); + Cnt : Natural; + begin + if N < 0 then + N := Str'Length; + end if; + if N > Str'Length then + raise Constraint_Error; + end if; + Txt (0) := Interfaces.C.char'First; + if Winnstr (Win, Txt, C_Int (N)) = Curses_Err then + raise Curses_Exception; + end if; + To_Ada (Txt, Str, Cnt, True); + if Cnt < Str'Length then + Str ((Str'First + Cnt) .. Str'Last) := (others => ' '); + end if; + end Peek; + + procedure Peek + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out String; + Len : in Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Peek (Win, Str, Len); + end Peek; +------------------------------------------------------------------------------ + procedure Peek + (Win : in Window := Standard_Window; + Str : out Attributed_String; + Len : in Integer := -1) + is + type Chtype_Ptr is access all Attributed_Character; + function Winchnstr (Win : Window; + Str : Chtype_Ptr; + Len : C_Int) return C_Int; + pragma Import (C, Winchnstr, "winchnstr"); + + N : Integer := Len; + Txt : chtype_array (0 .. Str'Length); + Cnt : Natural := 0; + begin + if N < 0 then + N := Str'Length; + end if; + if N > Str'Length then + raise Constraint_Error; + end if; + if Winchnstr (Win, Txt (Txt'First)'Access, C_Int (N)) = Curses_Err then + raise Curses_Exception; + end if; + for To in Str'Range loop + exit when Txt (size_t (Cnt)) = Default_Character; + Str (To) := Txt (size_t (Cnt)); + Cnt := Cnt + 1; + end loop; + if Cnt < Str'Length then + Str ((Str'First + Cnt) .. Str'Last) := + (others => (Ch => ' ', + Color => Color_Pair'First, + Attr => Normal_Video)); + end if; + end Peek; + + procedure Peek + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out Attributed_String; + Len : in Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Peek (Win, Str, Len); + end Peek; +------------------------------------------------------------------------------ + procedure Get (Win : in Window := Standard_Window; + Str : out String; + Len : in Integer := -1) + is + function Wgetnstr (Win : Window; + Str : char_array; + Len : C_Int) return C_Int; + pragma Import (C, Wgetnstr, "wgetnstr"); + + N : Integer := Len; + Txt : char_array (0 .. Str'Length); + Cnt : Natural; + begin + if N < 0 then + N := Str'Length; + end if; + if N > Str'Length then + raise Constraint_Error; + end if; + Txt (0) := Interfaces.C.char'First; + if Wgetnstr (Win, Txt, C_Int (N)) = Curses_Err then + raise Curses_Exception; + end if; + To_Ada (Txt, Str, Cnt, True); + if Cnt < Str'Length then + Str ((Str'First + Cnt) .. Str'Last) := (others => ' '); + end if; + end Get; + + procedure Get + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out String; + Len : in Integer := -1) + is + begin + Move_Cursor (Win, Line, Column); + Get (Win, Str, Len); + end Get; +------------------------------------------------------------------------------ + procedure Init_Soft_Label_Keys + (Format : in Soft_Label_Key_Format := Three_Two_Three) + is + function Slk_Init (Fmt : C_Int) return C_Int; + pragma Import (C, Slk_Init, "slk_init"); + begin + if Slk_Init (Soft_Label_Key_Format'Pos (Format)) = Curses_Err then + raise Curses_Exception; + end if; + end Init_Soft_Label_Keys; + + procedure Set_Soft_Label_Key (Label : in Label_Number; + Text : in String; + Fmt : in Label_Justification := Left) + is + type Char_Ptr is access all Interfaces.C.Char; + function Slk_Set (Label : C_Int; + Txt : Char_Ptr; + Fmt : C_Int) return C_Int; + pragma Import (C, Slk_Set, "slk_set"); + + Txt : char_array (0 .. Text'Length); + Len : size_t; + begin + To_C (Text, Txt, Len); + if Slk_Set (C_Int (Label), + Txt (Txt'First)'Access, + C_Int (Label_Justification'Pos (Fmt))) + = Curses_Err then + raise Curses_Exception; + end if; + end Set_Soft_Label_Key; + + procedure Refresh_Soft_Label_Keys + is + function Slk_Refresh return C_Int; + pragma Import (C, Slk_Refresh, "slk_refresh"); + begin + if Slk_Refresh = Curses_Err then + raise Curses_Exception; + end if; + end Refresh_Soft_Label_Keys; + + procedure Refresh_Soft_Label_Keys_Without_Update + is + function Slk_Noutrefresh return C_Int; + pragma Import (C, Slk_Noutrefresh, "slk_noutrefresh"); + begin + if Slk_Noutrefresh = Curses_Err then + raise Curses_Exception; + end if; + end Refresh_Soft_Label_Keys_Without_Update; + + procedure Get_Soft_Label_Key (Label : in Label_Number; + Text : out String) + is + function Slk_Label (Label : C_Int) return chars_ptr; + pragma Import (C, Slk_Label, "slk_label"); + begin + Fill_String (Slk_Label (C_Int (Label)), Text); + end Get_Soft_Label_Key; + + procedure Clear_Soft_Label_Keys + is + function Slk_Clear return C_Int; + pragma Import (C, Slk_Clear, "slk_clear"); + begin + if Slk_Clear = Curses_Err then + raise Curses_Exception; + end if; + end Clear_Soft_Label_Keys; + + procedure Restore_Soft_Label_Keys + is + function Slk_Restore return C_Int; + pragma Import (C, Slk_Restore, "slk_restore"); + begin + if Slk_Restore = Curses_Err then + raise Curses_Exception; + end if; + end Restore_Soft_Label_Keys; + + procedure Touch_Soft_Label_Keys + is + function Slk_Touch return C_Int; + pragma Import (C, Slk_Touch, "slk_touch"); + begin + if Slk_Touch = Curses_Err then + raise Curses_Exception; + end if; + end Touch_Soft_Label_Keys; + + procedure Switch_Soft_Label_Key_Attributes + (Attr : in Character_Attribute_Set; + On : in Boolean := True) + is + function Slk_Attron (Ch : C_Int) return C_Int; + pragma Import (C, Slk_Attron, "slk_attron"); + function Slk_Attroff (Ch : C_Int) return C_Int; + pragma Import (C, Slk_Attroff, "slk_attroff"); + + Err : C_Int; + Ch : constant Attributed_Character := (Ch => Character'First, + Attr => Attr, + Color => Color_Pair'First); + begin + if On then + Err := Slk_Attron (Chtype_To_CInt (Ch)); + else + Err := Slk_Attroff (Chtype_To_CInt (Ch)); + end if; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Switch_Soft_Label_Key_Attributes; + + procedure Set_Soft_Label_Key_Attributes + (Attr : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First) + is + function Slk_Attrset (Ch : C_Int) return C_Int; + pragma Import (C, Slk_Attrset, "slk_attrset"); + + Ch : constant Attributed_Character := (Ch => Character'First, + Attr => Attr, + Color => Color); + begin + if Slk_Attrset (Chtype_To_CInt (Ch)) = Curses_Err then + raise Curses_Exception; + end if; + end Set_Soft_Label_Key_Attributes; + + function Get_Soft_Label_Key_Attributes return Character_Attribute_Set + is + function Slk_Attr return C_Int; + pragma Import (C, Slk_Attr, "slk_attr"); + + Attr : constant C_Int := Slk_Attr; + begin + return CInt_To_Chtype (Attr).Attr; + end Get_Soft_Label_Key_Attributes; + + function Get_Soft_Label_Key_Attributes return Color_Pair + is + function Slk_Attr return C_Int; + pragma Import (C, Slk_Attr, "slk_attr"); + + Attr : constant C_Int := Slk_Attr; + begin + return CInt_To_Chtype (Attr).Color; + end Get_Soft_Label_Key_Attributes; +------------------------------------------------------------------------------ + procedure Un_Control (Ch : in Attributed_Character; + Str : out String) + is + function Unctrl (Ch : C_Int) return chars_ptr; + pragma Import (C, Unctrl, "unctrl"); + begin + Fill_String (Unctrl (Chtype_To_CInt (Ch)), Str); + end Un_Control; + + procedure Delay_Output (Msecs : in Natural) + is + function Delayoutput (Msecs : C_Int) return C_Int; + pragma Import (C, Delayoutput, "delay_output"); + begin + if Delayoutput (C_Int (Msecs)) = Curses_Err then + raise Curses_Exception; + end if; + end Delay_Output; + + procedure Flush_Input + is + function Flushinp return C_Int; + pragma Import (C, Flushinp, "flushinp"); + begin + if Flushinp = Curses_Err then -- docu says that never happens, but... + raise Curses_Exception; + end if; + end Flush_Input; +------------------------------------------------------------------------------ + function Baudrate return Natural + is + function Baud return C_Int; + pragma Import (C, Baud, "baudrate"); + begin + return Natural (Baud); + end Baudrate; + + function Erase_Character return Character + is + function Erasechar return C_Int; + pragma Import (C, Erasechar, "erasechar"); + begin + return Character'Val (Erasechar); + end Erase_Character; + + function Kill_Character return Character + is + function Killchar return C_Int; + pragma Import (C, Killchar, "killchar"); + begin + return Character'Val (Killchar); + end Kill_Character; + + function Has_Insert_Character return Boolean + is + function Has_Ic return C_Int; + pragma Import (C, Has_Ic, "has_ic"); + begin + if Has_Ic = Curses_False then + return False; + else + return True; + end if; + end Has_Insert_Character; + + function Has_Insert_Line return Boolean + is + function Has_Il return C_Int; + pragma Import (C, Has_Il, "has_il"); + begin + if Has_Il = Curses_False then + return False; + else + return True; + end if; + end Has_Insert_Line; + + function Supported_Attributes return Character_Attribute_Set + is + function Termattrs return C_Int; + pragma Import (C, Termattrs, "termattrs"); + + Ch : constant Attributed_Character := CInt_To_Chtype (Termattrs); + begin + return Ch.Attr; + end Supported_Attributes; + + procedure Long_Name (Name : out String) + is + function Longname return chars_ptr; + pragma Import (C, Longname, "longname"); + begin + Fill_String (Longname, Name); + end Long_Name; + + procedure Terminal_Name (Name : out String) + is + function Termname return chars_ptr; + pragma Import (C, Termname, "termname"); + begin + Fill_String (Termname, Name); + end Terminal_Name; +------------------------------------------------------------------------------ + procedure Init_Pair (Pair : in Redefinable_Color_Pair; + Fore : in Color_Number; + Back : in Color_Number) + is + function Initpair (Pair : C_Short; + Fore : C_Short; + Back : C_Short) return C_Int; + pragma Import (C, Initpair, "init_pair"); + begin + if Integer (Pair) >= Number_Of_Color_Pairs then + raise Constraint_Error; + end if; + if Integer (Fore) >= Number_Of_Colors or else + Integer (Back) >= Number_Of_Colors then raise Constraint_Error; + end if; + if Initpair (C_Short (Pair), C_Short (Fore), C_Short (Back)) + = Curses_Err then + raise Curses_Exception; + end if; + end Init_Pair; + + procedure Pair_Content (Pair : in Color_Pair; + Fore : out Color_Number; + Back : out Color_Number) + is + type C_Short_Access is access all C_Short; + function Paircontent (Pair : C_Short; + Fp : C_Short_Access; + Bp : C_Short_Access) return C_Int; + pragma Import (C, Paircontent, "pair_content"); + + F, B : aliased C_Short; + begin + if Paircontent (C_Short (Pair), F'Access, B'Access) = Curses_Err then + raise Curses_Exception; + else + Fore := Color_Number (F); + Back := Color_Number (B); + end if; + end Pair_Content; + + function Has_Colors return Boolean + is + function Hascolors return C_Int; + pragma Import (C, Hascolors, "has_colors"); + begin + if Hascolors = Curses_False then + return False; + else + return True; + end if; + end Has_Colors; + + procedure Init_Color (Color : in Color_Number; + Red : in RGB_Value; + Green : in RGB_Value; + Blue : in RGB_Value) + is + function Initcolor (Col : C_Short; + Red : C_Short; + Green : C_Short; + Blue : C_Short) return C_Int; + pragma Import (C, Initcolor, "init_color"); + begin + if Initcolor (C_Short (Color), C_Short (Red), C_Short (Green), + C_Short (Blue)) = Curses_Err then + raise Curses_Exception; + end if; + end Init_Color; + + function Can_Change_Color return Boolean + is + function Canchangecolor return C_Int; + pragma Import (C, Canchangecolor, "can_change_color"); + begin + if Canchangecolor = Curses_False then + return False; + else + return True; + end if; + end Can_Change_Color; + + procedure Color_Content (Color : in Color_Number; + Red : out RGB_Value; + Green : out RGB_Value; + Blue : out RGB_Value) + is + type C_Short_Access is access all C_Short; + + function Colorcontent (Color : C_Short; R, G, B : C_Short_Access) + return C_Int; + pragma Import (C, Colorcontent, "color_content"); + + R, G, B : aliased C_Short; + begin + if Colorcontent (C_Short (Color), R'Access, G'Access, B'Access) = + Curses_Err then + raise Curses_Exception; + else + Red := RGB_Value (R); + Green := RGB_Value (G); + Blue := RGB_Value (B); + end if; + end Color_Content; + +------------------------------------------------------------------------------ + procedure Save_Curses_Mode (Mode : in Curses_Mode) + is + function Def_Prog_Mode return C_Int; + pragma Import (C, Def_Prog_Mode, "def_prog_mode"); + function Def_Shell_Mode return C_Int; + pragma Import (C, Def_Shell_Mode, "def_shell_mode"); + + Err : C_Int; + begin + case Mode is + when Curses => Err := Def_Prog_Mode; + when Shell => Err := Def_Shell_Mode; + end case; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Save_Curses_Mode; + + procedure Reset_Curses_Mode (Mode : in Curses_Mode) + is + function Reset_Prog_Mode return C_Int; + pragma Import (C, Reset_Prog_Mode, "reset_prog_mode"); + function Reset_Shell_Mode return C_Int; + pragma Import (C, Reset_Shell_Mode, "reset_shell_mode"); + + Err : C_Int; + begin + case Mode is + when Curses => Err := Reset_Prog_Mode; + when Shell => Err := Reset_Shell_Mode; + end case; + if Err = Curses_Err then + raise Curses_Exception; + end if; + end Reset_Curses_Mode; + + procedure Save_Terminal_State + is + function Savetty return C_Int; + pragma Import (C, Savetty, "savetty"); + begin + if Savetty = Curses_Err then + raise Curses_Exception; + end if; + end Save_Terminal_State; + + procedure Reset_Terminal_State + is + function Resetty return C_Int; + pragma Import (C, Resetty, "resetty"); + begin + if Resetty = Curses_Err then + raise Curses_Exception; + end if; + end Reset_Terminal_State; + + procedure Rip_Off_Lines (Lines : in Integer; + Proc : in Stdscr_Init_Proc) + is + function Ripoffline (Lines : C_Int; + Proc : Stdscr_Init_Proc) return C_Int; + pragma Import (C, Ripoffline, "_nc_ripoffline"); + begin + if Ripoffline (C_Int (Lines), Proc) = Curses_Err then + raise Curses_Exception; + end if; + end Rip_Off_Lines; + + procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility) + is + function Curs_Set (Curs : C_Int) return C_Int; + pragma Import (C, Curs_Set, "curs_set"); + + Res : C_Int; + begin + Res := Curs_Set (Cursor_Visibility'Pos (Visibility)); + if Res /= Curses_Err then + Visibility := Cursor_Visibility'Val (Res); + end if; + end Set_Cursor_Visibility; + + procedure Nap_Milli_Seconds (Ms : in Natural) + is + function Napms (Ms : C_Int) return C_Int; + pragma Import (C, Napms, "napms"); + begin + if Napms (C_Int (Ms)) = Curses_Err then + raise Curses_Exception; + end if; + end Nap_Milli_Seconds; +------------------------------------------------------------------------------ + + function Standard_Window return Window + is + Stdscr : Window; + pragma Import (C, Stdscr, "stdscr"); + begin + return Stdscr; + end Standard_Window; + + function Lines return Line_Count + is + C_Lines : C_Int; + pragma Import (C, C_Lines, "LINES"); + begin + return Line_Count (C_Lines); + end Lines; + + function Columns return Column_Count + is + C_Columns : C_Int; + pragma Import (C, C_Columns, "COLS"); + begin + return Column_Count (C_Columns); + end Columns; + + function Tab_Size return Natural + is + C_Tab_Size : C_Int; + pragma Import (C, C_Tab_Size, "TABSIZE"); + begin + return Natural (C_Tab_Size); + end Tab_Size; + + function Number_Of_Colors return Natural + is + C_Number_Of_Colors : C_Int; + pragma Import (C, C_Number_Of_Colors, "COLORS"); + begin + return Natural (C_Number_Of_Colors); + end Number_Of_Colors; + + function Number_Of_Color_Pairs return Natural + is + C_Number_Of_Color_Pairs : C_Int; + pragma Import (C, C_Number_Of_Color_Pairs, "COLOR_PAIRS"); + begin + return Natural (C_Number_Of_Color_Pairs); + end Number_Of_Color_Pairs; +------------------------------------------------------------------------------ + procedure Transform_Coordinates + (W : in Window := Standard_Window; + Line : in out Line_Position; + Column : in out Column_Position; + Dir : in Transform_Direction := From_Screen) + is + type Int_Access is access all C_Int; + function Transform (W : Window; + Y, X : Int_Access; + Dir : C_Int) return C_Int; + pragma Import (C, Transform, "_nc_ada_coord_transform"); + + X : aliased C_Int := C_Int (Column); + Y : aliased C_Int := C_Int (Line); + D : C_Int := 0; + R : C_Int; + begin + if Dir = To_Screen then + D := 1; + end if; + R := Transform (W, Y'Access, X'Access, D); + if R = Curses_False then + raise Curses_Exception; + else + Line := Line_Position (Y); + Column := Column_Position (X); + end if; + end Transform_Coordinates; + +begin + if Generation_Bit_Order /= System.Default_Bit_Order then + raise Constraint_Error; + end if; +end Terminal_Interface.Curses; diff --git a/Ada95/ada_include/terminal_interface.ads b/Ada95/ada_include/terminal_interface.ads new file mode 100644 index 00000000..dabec0ba --- /dev/null +++ b/Ada95/ada_include/terminal_interface.ads @@ -0,0 +1,31 @@ +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ +package Terminal_Interface is +-- +-- Everything is in the child units +-- +end Terminal_Interface; diff --git a/Ada95/gen/Makefile.in b/Ada95/gen/Makefile.in new file mode 100644 index 00000000..775c344f --- /dev/null +++ b/Ada95/gen/Makefile.in @@ -0,0 +1,285 @@ +#---------------------------------------------------------------------------- +# -- +# GNAT ncurses Binding -- +# gen/Makefile -- +# -- +# Version 00.92 -- +# -- +# The ncurses Ada95 binding is copyrighted 1996 by -- +# Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +# -- +# Permission is hereby granted to reproduce and distribute this -- +# binding by any means and for any fee, whether alone or as part -- +# of a larger distribution, in source or in binary form, PROVIDED -- +# this notice is included with any such distribution, and is not -- +# removed from any of its header files. Mention of ncurses and the -- +# author of this binding in any applications linked with it is -- +# highly appreciated. -- +# -- +# This binding comes AS IS with no warranty, implied or expressed. -- +#---------------------------------------------------------------------------- +# Version Control +# $Revision: 1.8 $ +# +.SUFFIXES: + +SHELL = /bin/sh +THIS = Makefile + +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ +datadir = @datadir@ +ticdir = $(datadir)/terminfo + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +AWK = @AWK@ +LN_S = @LN_S@ + +CC = @CC@ +CFLAGS = @CFLAGS@ + +CPPFLAGS = @ACPPFLAGS@ \ + -DHAVE_CONFIG_H -I$(srcdir) + +CCFLAGS = $(CPPFLAGS) $(CFLAGS) + +CFLAGS_NORMAL = $(CCFLAGS) +CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE +CFLAGS_PROFILE = $(CCFLAGS) -pg +CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ + +CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) + +LINK = $(CC) +LD_FLAGS = @LD_MODEL@ $(LOCAL_LIBS) @LDFLAGS@ @LIBS@ @LOCAL_LDFLAGS2@ $(LDFLAGS) + +RANLIB = @RANLIB@ + +LIB_CURSES = -L ../../lib -lncurses + +M4 = m4 +M4FLAGS = + +DEL_ADAMODE = sed -e '/^\-\-\ \ \-\*\-\ ada\ \-\*\-.*/d' + +################################################################################ +ALIB = @nc_ada_package@ +ABASE = $(ALIB)-curses + +ADA_SRCDIR = ../ada_include +ADA_OBJDIR = ../ada_objects +OBJDIR = ../objects + +GEN_FILES0 = Base_Defs + +GEN_FILES1 = Key_Definitions \ + Old_Keys \ + Character_Attribute_Set_Rep \ + AC_Rep \ + Color_Defs \ + ACS_Map \ + Linker_Options \ + Base_Defs + +GEN_FILES2 = Menu_Opt_Rep \ + Menu_Base_Defs \ + Menu_Linker_Options \ + Item_Rep + +GEN_FILES3 = Form_Opt_Rep \ + Form_Base_Defs \ + Form_Linker_Options \ + Field_Rep + +GEN_FILES4 = Mouse_Base_Defs \ + Mouse_Event_Rep \ + Panel_Linker_Options + +GEN_TARGETS = $(ADA_SRCDIR)/$(ABASE).ads \ + $(ADA_SRCDIR)/$(ABASE)-menus.ads \ + $(ADA_SRCDIR)/$(ABASE)-forms.ads \ + $(ADA_SRCDIR)/$(ABASE)-mouse.ads \ + $(ADA_SRCDIR)/$(ABASE)-panels.ads \ + $(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads \ + $(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads \ + $(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads \ + $(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads \ + $(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads + +GEN_SRC = $(srcdir)/$(ABASE).ads.m4 \ + $(srcdir)/$(ABASE)-menus.ads.m4 \ + $(srcdir)/$(ABASE)-forms.ads.m4 \ + $(srcdir)/$(ABASE)-mouse.ads.m4 \ + $(srcdir)/$(ABASE)-panels.ads.m4 \ + $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \ + $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \ + $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \ + $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \ + $(srcdir)/$(ABASE)-panels-user_data.ads.m4 + + +all: $(GEN_TARGETS) dirs + @ + +dirs: + @-mkdir $(OBJDIR) $(ADA_OBJDIR) + +gen: gen.o + @ECHO_LINK@ $(LINK) $(CFLAGS_NORMAL) gen.o $(LD_FLAGS) -o $@ $(LIB_CURSES) + +gen.o: $(srcdir)/gen.c + $(CC) $(CFLAGS_NORMAL) -c -o $@ $(srcdir)/gen.c + +Character_Attribute_Set_Rep: gen + ./gen B A >$@ + +Base_Defs: gen + ./gen B B >$@ + +Color_Defs: gen + ./gen B C >$@ + +Key_Definitions: gen + ./gen B K >$@ + +Old_Keys: gen + ./gen B O >$@ + +ACS_Map: gen + ./gen B M >$@ + +AC_Rep: gen + ./gen B R >$@ + +Linker_Options: gen + ./gen B L >$@ + +Menu_Opt_Rep: gen + ./gen M R >$@ + +Menu_Base_Defs: gen + ./gen M B >$@ + +Menu_Linker_Options: gen + ./gen M L >$@ + +Item_Rep: gen + ./gen M I >$@ + +Form_Opt_Rep: gen + ./gen F R >$@ + +Form_Base_Defs: gen + ./gen F B >$@ + +Form_Linker_Options: gen + ./gen F L >$@ + +Field_Rep: gen + ./gen F I >$@ + +Mouse_Base_Defs: gen + ./gen P B >$@ + +Mouse_Event_Rep: gen + ./gen P M >$@ + +Panel_Linker_Options: gen + ./gen P L >$@ + +$(ADA_SRCDIR)/$(ABASE).ads: $(srcdir)/$(ABASE).ads.m4 \ + $(GEN_FILES1) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE).ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-menus.ads: $(srcdir)/$(ABASE)-menus.ads.m4 \ + $(GEN_FILES2) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-menus.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-forms.ads: $(srcdir)/$(ABASE)-forms.ads.m4 \ + $(GEN_FILES3) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-forms.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-mouse.ads: $(srcdir)/$(ABASE)-mouse.ads.m4 \ + $(GEN_FILES4) $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-mouse.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-panels.ads: $(srcdir)/$(ABASE)-panels.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-panels.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-menus-menu_user_data.ads: \ + $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-menus-menu_user_data.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-menus-item_user_data.ads: \ + $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-menus-item_user_data.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-forms-form_user_data.ads: \ + $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-forms-form_user_data.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-forms-field_user_data.ads: \ + $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-forms-field_user_data.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +$(ADA_SRCDIR)/$(ABASE)-panels-user_data.ads: \ + $(srcdir)/$(ABASE)-panels-user_data.ads.m4 \ + $(srcdir)/normal.m4 + $(M4) $(M4FLAGS) -DM4MACRO=$(srcdir)/normal.m4 \ + $(srcdir)/$(ABASE)-panels-user_data.ads.m4 |\ + $(DEL_ADAMODE) >$@ + +install :: + +install.libs :: + +install.progs :: + +tags: + ctags *.[ch] + +TAGS: + etags *.[ch] + +clean :: + rm -f a.out core gen *.o $(GEN_FILES1) $(GEN_FILES2) $(GEN_FILES3) \ + $(GEN_FILES4) $(GEN_TARGETS) + +mostlyclean :: clean + +distclean :: mostlyclean + rm -f Makefile + +realclean :: distclean + +############################################################################### +# The remainder of this file is automatically generated during configuration +############################################################################### diff --git a/Ada95/gen/gen.c b/Ada95/gen/gen.c new file mode 100644 index 00000000..3a1426f4 --- /dev/null +++ b/Ada95/gen/gen.c @@ -0,0 +1,977 @@ +/*---------------------------------------------------------------------------- +// -- +// GNAT ncurses Binding -- +// -- +// gen.c -- +// -- +// B O D Y -- +// -- +// Version 00.92 -- +// -- +// The ncurses Ada95 binding is copyrighted 1996 by -- +// Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +// -- +// Permission is hereby granted to reproduce and distribute this -- +// binding by any means and for any fee, whether alone or as part -- +// of a larger distribution, in source or in binary form, PROVIDED -- +// this notice is included with any such distribution, and is not -- +// removed from any of its header files. Mention of ncurses and the -- +// author of this binding in any applications linked with it is -- +// highly appreciated. -- +// -- +// This binding comes AS IS with no warranty, implied or expressed. -- +//---------------------------------------------------------------------------- + Version Control + $Revision: 1.8 $ + --------------------------------------------------------------------------*/ +/* + This program generates various record structures and constants from the + ncurses header file for the Ada95 packages. Essentially it produces + Ada95 source on stdout, which is then merged using m4 into a template + to produce the real source. + */ + +#include +#include +#include +#include + +#include +#include + +#define RES_NAME "Reserved" + +static int little_endian = 0; + +typedef struct { + const char *name; + unsigned int attr; +} name_attribute_pair; + +static int find_pos (char *s, unsigned len, int *low, int *high) +{ + unsigned int i,j; + int l = 0; + + *high = -1; + *low = 8*len; + + for(i=0; i < len; i++,s++) + { + if (*s) + { + for(j=0;j<8*sizeof(char);j++) + { + if ((( little_endian && ((*s)&0x01)) || + (!little_endian && ((*s)&0x80))) ) + { + if (l > *high) + *high = l; + if (l < *low) + *low = l; + } + l++; + if (little_endian) + *s >>= 1; + else + *s <<= 1; + } + } + else + l += 8; + } + return (*high >= 0 && (*low <= *high)) ? *low : -1; +} + +static void gen_reps ( const name_attribute_pair *nap, + const char *name, + int len) +{ + int i,l,cnt = 0,low,high; + int width = strlen(RES_NAME); + int bias = 0; + unsigned int a; + unsigned int mask = 0; + char *suffix; + + assert (nap); + + if (len == sizeof(int)/2) + { + bias = little_endian ? 8 * len : 0; + suffix = " / 2"; + } + else + { + assert(len==sizeof(int)); + suffix = ""; + } + + for (i=0; nap[i].name != (char *)0; i++) + { + cnt++; + l = strlen(nap[i].name); + if (l>width) + width = l; + } + assert (width > 0); + + printf(" type %s is\n",name); + printf(" record\n"); + for (i=0; nap[i].name != (char *)0; i++) + { + printf(" %-*s : Boolean;\n",width,nap[i].name); + } + if (cnt != 8*len) + { + printf(" %-*s : Boolean;\n",width,RES_NAME); + } + printf(" end record;\n"); + printf(" pragma Pack (%s);\n",name); + printf(" pragma Convention (C, %s);\n\n",name); + + printf(" for %s use\n",name); + printf(" record\n"); + + for (i=0; nap[i].name != (char *)0; i++) + { + a = nap[i].attr; + mask |= a; + l = find_pos( (char *)&a,sizeof(a),&low,&high ); + if (l>=0) + printf(" %-*s at 0 range %2d .. %2d;\n",width,nap[i].name,low-bias,high-bias); + } + if (cnt != 8*len) + { + mask = ~mask; + assert(mask); + if (little_endian) + l = 8*len - 1; + else + l = 0; + printf(" %-*s at 0 range %2d .. %2d;\n",width,RES_NAME,l,l); + } + printf(" end record;\n"); + printf(" for %s'Size use Interfaces.C.int'Size%s;\n", name, suffix); + printf(" -- Please note: this rep. clause is generated and may be\n"); + printf(" -- different on your system."); +} + + +static void chtype_rep (const char *name, int mask) +{ + int x = -1; + int t = x & mask; + int low, high; + int l = find_pos ((char *)&t, sizeof(t), &low, &high); + if (l>=0) + printf(" %-5s at 0 range %2d .. %2d;\n",name,low,high); +} + +static void gen_chtype_rep(const char *name) +{ + printf(" for %s use\n record\n",name); + chtype_rep("Ch",A_CHARTEXT); + chtype_rep("Color",A_COLOR); + chtype_rep("Attr",(A_ATTRIBUTES&~A_COLOR)); + printf(" end record;\n for %s'Size use Interfaces.C.int'Size;\n",name); + printf(" -- Please note: this rep. clause is generated and may be\n"); + printf(" -- different on your system.\n"); +} + + +static void mrep_rep (const char *name, void *rec) +{ + int low, high; + int l = find_pos((char *)rec, sizeof(MEVENT), &low, &high); + if (l>=0) + printf(" %-7s at 0 range %3d .. %3d;\n",name,low,high); +} + + +static void gen_mrep_rep(const char *name) +{ + MEVENT x; + + printf(" for %s use\n record\n",name); + + memset(&x,0,sizeof(x)); + x.id = -1; + mrep_rep("Id",&x); + + memset(&x,0,sizeof(x)); + x.x = -1; + mrep_rep("X",&x); + + memset(&x,0,sizeof(x)); + x.y = -1; + mrep_rep("Y",&x); + + memset(&x,0,sizeof(x)); + x.z = -1; + mrep_rep("Z",&x); + + memset(&x,0,sizeof(x)); + x.bstate = -1; + mrep_rep("Bstate",&x); + + printf(" end record;\n"); + printf(" -- Please note: this rep. clause is generated and may be\n"); + printf(" -- different on your system.\n"); +} + +static void gen_attr_set( const char *name ) +{ + static const name_attribute_pair nap[] = { +#ifdef A_STANDOUT + {"Stand_Out", A_STANDOUT}, +#endif +#ifdef A_UNDERLINE + {"Under_Line", A_UNDERLINE}, +#endif +#ifdef A_REVERSE + {"Reverse_Video", A_REVERSE}, +#endif +#ifdef A_BLINK + {"Blink", A_BLINK}, +#endif +#ifdef A_DIM + {"Dim_Character", A_DIM}, +#endif +#ifdef A_BOLD + {"Bold_Character", A_BOLD}, +#endif +#ifdef A_ALTCHARSET + {"Alternate_Character_Set", A_ALTCHARSET}, +#endif +#ifdef A_INVIS + {"Invisible_Character", A_INVIS}, +#endif +#ifdef A_PROTECT + {"Protected_Character", A_PROTECT}, +#endif +#ifdef A_HORIZONTAL + {"Horizontal", A_HORIZONTAL}, +#endif +#ifdef A_LEFT + {"Left", A_LEFT}, +#endif +#ifdef A_LOW + {"Low", A_LOW}, +#endif +#ifdef A_RIGHT + {"Right", A_RIGHT}, +#endif +#ifdef A_TOP + {"Top", A_TOP}, +#endif +#ifdef A_VERTICAL + {"Vertical", A_VERTICAL}, +#endif + {(char *)0, 0} + }; + gen_reps (nap, name, sizeof(int)/2); +} + +static void gen_menu_opt_rep(const char *name) +{ + static const name_attribute_pair nap[] = { +#ifdef O_ONEVALUE + {"One_Valued", O_ONEVALUE}, +#endif +#ifdef O_SHOWDESC + {"Show_Descriptions", O_SHOWDESC}, +#endif +#ifdef O_ROWMAJOR + {"Row_Major_Order", O_ROWMAJOR}, +#endif +#ifdef O_IGNORECASE + {"Ignore_Case", O_IGNORECASE}, +#endif +#ifdef O_SHOWMATCH + {"Show_Matches", O_SHOWMATCH}, +#endif +#ifdef O_NONCYCLIC + {"Non_Cyclic", O_NONCYCLIC}, +#endif + {(char *)0, 0} + }; + gen_reps (nap, name, sizeof(int)); +} + +static void gen_item_opt_rep(const char *name) +{ + static const name_attribute_pair nap[] = { +#ifdef O_SELECTABLE + {"Selectable", O_SELECTABLE}, +#endif + {(char *)0 , 0} + }; + gen_reps (nap, name, sizeof(int)); +} + +static void gen_form_opt_rep(const char *name) +{ + static const name_attribute_pair nap[] = { +#ifdef O_NL_OVERLOAD + {"NL_Overload", O_NL_OVERLOAD}, +#endif +#ifdef O_BS_OVERLOAD + {"BS_Overload", O_BS_OVERLOAD}, +#endif + {(char *)0 , 0} + }; + gen_reps (nap, name, sizeof(int)); +} + +static void gen_field_opt_rep(const char *name) +{ + static const name_attribute_pair nap[] = { +#ifdef O_VISIBLE + {"Visible",O_VISIBLE}, +#endif +#ifdef O_ACTIVE + {"Active",O_ACTIVE}, +#endif +#ifdef O_PUBLIC + {"Public",O_PUBLIC}, +#endif +#ifdef O_EDIT + {"Edit",O_EDIT}, +#endif +#ifdef O_WRAP + {"Wrap",O_WRAP}, +#endif +#ifdef O_BLANK + {"Blank",O_BLANK}, +#endif +#ifdef O_AUTOSKIP + {"Auto_Skip",O_AUTOSKIP}, +#endif +#ifdef O_NULLOK + {"Null_Ok",O_NULLOK}, +#endif +#ifdef O_PASSOK + {"Pass_Ok",O_PASSOK}, +#endif +#ifdef O_STATIC + {"Static",O_STATIC}, +#endif + {(char *)0, 0} + }; + gen_reps (nap, name, sizeof(int)); +} + +static void keydef(const char *name, const char *old_name, int value, int mode) +{ + if (mode==0) + printf(" %-30s : constant Special_Key_Code := 8#%3o#;\n",name,value); + else + { + const char *s = old_name; const char *t = name; + while ( *s && *t && (toupper(*s++) == toupper(*t++))); + if (*s || *t) + printf(" %-16s : Special_Key_Code renames %s;\n",old_name,name); + } +} + +static void gen_keydefs (int mode) +{ + char buf[16]; + char obuf[16]; + int i; + +#ifdef KEY_CODE_YES + keydef("Key_Code_Yes","KEY_CODE_YES",KEY_CODE_YES,mode); +#endif +#ifdef KEY_MIN + keydef("Key_Min","KEY_MIN",KEY_MIN,mode); +#endif +#ifdef KEY_BREAK + keydef("Key_Break","KEY_BREAK",KEY_BREAK,mode); +#endif +#ifdef KEY_DOWN + keydef("Key_Cursor_Down","KEY_DOWN",KEY_DOWN,mode); +#endif +#ifdef KEY_UP + keydef("Key_Cursor_Up","KEY_UP",KEY_UP,mode); +#endif +#ifdef KEY_LEFT + keydef("Key_Cursor_Left","KEY_LEFT",KEY_LEFT,mode); +#endif +#ifdef KEY_RIGHT + keydef("Key_Cursor_Right","KEY_RIGHT",KEY_RIGHT,mode); +#endif +#ifdef KEY_HOME + keydef("Key_Home","KEY_HOME",KEY_HOME,mode); +#endif +#ifdef KEY_BACKSPACE + keydef("Key_Backspace","KEY_BACKSPACE",KEY_BACKSPACE,mode); +#endif +#ifdef KEY_F0 + keydef("Key_F0","KEY_F0",KEY_F0,mode); +#endif +#ifdef KEY_F + for(i=1;i<=24;i++) + { + sprintf(buf ,"Key_F%d",i); + sprintf(obuf,"KEY_F%d",i); + keydef(buf,obuf,KEY_F(i),mode); + } +#endif +#ifdef KEY_DL + keydef("Key_Delete_Line","KEY_DL",KEY_DL,mode); +#endif +#ifdef KEY_IL + keydef("Key_Insert_Line","KEY_IL",KEY_IL,mode); +#endif +#ifdef KEY_DC + keydef("Key_Delete_Char","KEY_DC",KEY_DC,mode); +#endif +#ifdef KEY_IC + keydef("Key_Insert_Char","KEY_IC",KEY_IC,mode); +#endif +#ifdef KEY_EIC + keydef("Key_Exit_Insert_Mode","KEY_EIC",KEY_EIC,mode); +#endif +#ifdef KEY_CLEAR + keydef("Key_Clear_Screen","KEY_CLEAR",KEY_CLEAR,mode); +#endif +#ifdef KEY_EOS + keydef("Key_Clear_End_Of_Screen","KEY_EOS",KEY_EOS,mode); +#endif +#ifdef KEY_EOL + keydef("Key_Clear_End_Of_Line","KEY_EOL",KEY_EOL,mode); +#endif +#ifdef KEY_SF + keydef("Key_Scroll_1_Forward","KEY_SF",KEY_SF,mode); +#endif +#ifdef KEY_SR + keydef("Key_Scroll_1_Backward","KEY_SR",KEY_SR,mode); +#endif +#ifdef KEY_NPAGE + keydef("Key_Next_Page","KEY_NPAGE",KEY_NPAGE,mode); +#endif +#ifdef KEY_PPAGE + keydef("Key_Previous_Page","KEY_PPAGE",KEY_PPAGE,mode); +#endif +#ifdef KEY_STAB + keydef("Key_Set_Tab","KEY_STAB",KEY_STAB,mode); +#endif +#ifdef KEY_CTAB + keydef("Key_Clear_Tab","KEY_CTAB",KEY_CTAB,mode); +#endif +#ifdef KEY_CATAB + keydef("Key_Clear_All_Tabs","KEY_CATAB",KEY_CATAB,mode); +#endif +#ifdef KEY_ENTER + keydef("Key_Enter_Or_Send","KEY_ENTER",KEY_ENTER,mode); +#endif +#ifdef KEY_SRESET + keydef("Key_Soft_Reset","KEY_SRESET",KEY_SRESET,mode); +#endif +#ifdef KEY_RESET + keydef("Key_Reset","KEY_RESET",KEY_RESET,mode); +#endif +#ifdef KEY_PRINT + keydef("Key_Print","KEY_PRINT",KEY_PRINT,mode); +#endif +#ifdef KEY_LL + keydef("Key_Bottom","KEY_LL",KEY_LL,mode); +#endif +#ifdef KEY_A1 + keydef("Key_Upper_Left_Of_Keypad","KEY_A1",KEY_A1,mode); +#endif +#ifdef KEY_A3 + keydef("Key_Upper_Right_Of_Keypad","KEY_A3",KEY_A3,mode); +#endif +#ifdef KEY_B2 + keydef("Key_Center_Of_Keypad","KEY_B2",KEY_B2,mode); +#endif +#ifdef KEY_C1 + keydef("Key_Lower_Left_Of_Keypad","KEY_C1",KEY_C1,mode); +#endif +#ifdef KEY_C3 + keydef("Key_Lower_Right_Of_Keypad","KEY_C3",KEY_C3,mode); +#endif +#ifdef KEY_BTAB + keydef("Key_Back_Tab","KEY_BTAB",KEY_BTAB,mode); +#endif +#ifdef KEY_BEG + keydef("Key_Beginning","KEY_BEG",KEY_BEG,mode); +#endif +#ifdef KEY_CANCEL + keydef("Key_Cancel","KEY_CANCEL",KEY_CANCEL,mode); +#endif +#ifdef KEY_CLOSE + keydef("Key_Close","KEY_CLOSE",KEY_CLOSE,mode); +#endif +#ifdef KEY_COMMAND + keydef("Key_Command","KEY_COMMAND",KEY_COMMAND,mode); +#endif +#ifdef KEY_COPY + keydef("Key_Copy","KEY_COPY",KEY_COPY,mode); +#endif +#ifdef KEY_CREATE + keydef("Key_Create","KEY_CREATE",KEY_CREATE,mode); +#endif +#ifdef KEY_END + keydef("Key_End","KEY_END",KEY_END,mode); +#endif +#ifdef KEY_EXIT + keydef("Key_Exit","KEY_EXIT",KEY_EXIT,mode); +#endif +#ifdef KEY_FIND + keydef("Key_Find","KEY_FIND",KEY_FIND,mode); +#endif +#ifdef KEY_HELP + keydef("Key_Help","KEY_HELP",KEY_HELP,mode); +#endif +#ifdef KEY_MARK + keydef("Key_Mark","KEY_MARK",KEY_MARK,mode); +#endif +#ifdef KEY_MESSAGE + keydef("Key_Message","KEY_MESSAGE",KEY_MESSAGE,mode); +#endif +#ifdef KEY_MOVE + keydef("Key_Move","KEY_MOVE",KEY_MOVE,mode); +#endif +#ifdef KEY_NEXT + keydef("Key_Next","KEY_NEXT",KEY_NEXT,mode); +#endif +#ifdef KEY_OPEN + keydef("Key_Open","KEY_OPEN",KEY_OPEN,mode); +#endif +#ifdef KEY_OPTIONS + keydef("Key_Options","KEY_OPTIONS",KEY_OPTIONS,mode); +#endif +#ifdef KEY_PREVIOUS + keydef("Key_Previous","KEY_PREVIOUS",KEY_PREVIOUS,mode); +#endif +#ifdef KEY_REDO + keydef("Key_Redo","KEY_REDO",KEY_REDO,mode); +#endif +#ifdef KEY_REFERENCE + keydef("Key_Reference","KEY_REFERENCE",KEY_REFERENCE,mode); +#endif +#ifdef KEY_REFRESH + keydef("Key_Refresh","KEY_REFRESH",KEY_REFRESH,mode); +#endif +#ifdef KEY_REPLACE + keydef("Key_Replace","KEY_REPLACE",KEY_REPLACE,mode); +#endif +#ifdef KEY_RESTART + keydef("Key_Restart","KEY_RESTART",KEY_RESTART,mode); +#endif +#ifdef KEY_RESUME + keydef("Key_Resume","KEY_RESUME",KEY_RESUME,mode); +#endif +#ifdef KEY_SAVE + keydef("Key_Save","KEY_SAVE",KEY_SAVE,mode); +#endif +#ifdef KEY_SBEG + keydef("Key_Shift_Begin","KEY_SBEG",KEY_SBEG,mode); +#endif +#ifdef KEY_SCANCEL + keydef("Key_Shift_Cancel","KEY_SCANCEL",KEY_SCANCEL,mode); +#endif +#ifdef KEY_SCOMMAND + keydef("Key_Shift_Command","KEY_SCOMMAND",KEY_SCOMMAND,mode); +#endif +#ifdef KEY_SCOPY + keydef("Key_Shift_Copy","KEY_SCOPY",KEY_SCOPY,mode); +#endif +#ifdef KEY_SCREATE + keydef("Key_Shift_Create","KEY_SCREATE",KEY_SCREATE,mode); +#endif +#ifdef KEY_SDC + keydef("Key_Shift_Delete_Char","KEY_SDC",KEY_SDC,mode); +#endif +#ifdef KEY_SDL + keydef("Key_Shift_Delete_Line","KEY_SDL",KEY_SDL,mode); +#endif +#ifdef KEY_SELECT + keydef("Key_Select","KEY_SELECT",KEY_SELECT,mode); +#endif +#ifdef KEY_SEND + keydef("Key_Shift_End","KEY_SEND",KEY_SEND,mode); +#endif +#ifdef KEY_SEOL + keydef("Key_Shift_Clear_End_Of_Line","KEY_SEOL",KEY_SEOL,mode); +#endif +#ifdef KEY_SEXIT + keydef("Key_Shift_Exit","KEY_SEXIT",KEY_SEXIT,mode); +#endif +#ifdef KEY_SFIND + keydef("Key_Shift_Find","KEY_SFIND",KEY_SFIND,mode); +#endif +#ifdef KEY_SHELP + keydef("Key_Shift_Help","KEY_SHELP",KEY_SHELP,mode); +#endif +#ifdef KEY_SHOME + keydef("Key_Shift_Home","KEY_SHOME",KEY_SHOME,mode); +#endif +#ifdef KEY_SIC + keydef("Key_Shift_Insert_Char","KEY_SIC",KEY_SIC,mode); +#endif +#ifdef KEY_SLEFT + keydef("Key_Shift_Cursor_Left","KEY_SLEFT",KEY_SLEFT,mode); +#endif +#ifdef KEY_SMESSAGE + keydef("Key_Shift_Message","KEY_SMESSAGE",KEY_SMESSAGE,mode); +#endif +#ifdef KEY_SMOVE + keydef("Key_Shift_Move","KEY_SMOVE",KEY_SMOVE,mode); +#endif +#ifdef KEY_SNEXT + keydef("Key_Shift_Next_Page","KEY_SNEXT",KEY_SNEXT,mode); +#endif +#ifdef KEY_SOPTIONS + keydef("Key_Shift_Options","KEY_SOPTIONS",KEY_SOPTIONS,mode); +#endif +#ifdef KEY_SPREVIOUS + keydef("Key_Shift_Previous_Page","KEY_SPREVIOUS",KEY_SPREVIOUS,mode); +#endif +#ifdef KEY_SPRINT + keydef("Key_Shift_Print","KEY_SPRINT",KEY_SPRINT,mode); +#endif +#ifdef KEY_SREDO + keydef("Key_Shift_Redo","KEY_SREDO",KEY_SREDO,mode); +#endif +#ifdef KEY_SREPLACE + keydef("Key_Shift_Replace","KEY_SREPLACE",KEY_SREPLACE,mode); +#endif +#ifdef KEY_SRIGHT + keydef("Key_Shift_Cursor_Right","KEY_SRIGHT",KEY_SRIGHT,mode); +#endif +#ifdef KEY_SRSUME + keydef("Key_Shift_Resume","KEY_SRSUME",KEY_SRSUME,mode); +#endif +#ifdef KEY_SSAVE + keydef("Key_Shift_Save","KEY_SSAVE",KEY_SSAVE,mode); +#endif +#ifdef KEY_SSUSPEND + keydef("Key_Shift_Suspend","KEY_SSUSPEND",KEY_SSUSPEND,mode); +#endif +#ifdef KEY_SUNDO + keydef("Key_Shift_Undo","KEY_SUNDO",KEY_SUNDO,mode); +#endif +#ifdef KEY_SUSPEND + keydef("Key_Suspend","KEY_SUSPEND",KEY_SUSPEND,mode); +#endif +#ifdef KEY_UNDO + keydef("Key_Undo","KEY_UNDO",KEY_UNDO,mode); +#endif +#ifdef KEY_MOUSE + keydef("Key_Mouse","KEY_MOUSE",KEY_MOUSE,mode); +#endif +} + +static void acs_def (const char *name, chtype *a) +{ + int c = a - &acs_map[0]; + printf(" %-24s : constant Character := ",name); + if (isprint(c) && (c!='`')) + printf("'%c';\n",c); + else + printf("Character'Val (%d);\n",c); +} + + +static void gen_acs (void) +{ +#ifdef ACS_ULCORNER + acs_def("ACS_Upper_Left_Corner",&ACS_ULCORNER); +#endif +#ifdef ACS_LLCORNER + acs_def("ACS_Lower_Left_Corner",&ACS_LLCORNER); +#endif +#ifdef ACS_URCORNER + acs_def("ACS_Upper_Right_Corner",&ACS_URCORNER); +#endif +#ifdef ACS_LRCORNER + acs_def("ACS_Lower_Right_Corner",&ACS_LRCORNER); +#endif +#ifdef ACS_LTEE + acs_def("ACS_Left_Tee",&ACS_LTEE); +#endif +#ifdef ACS_RTEE + acs_def("ACS_Right_Tee",&ACS_RTEE); +#endif +#ifdef ACS_BTEE + acs_def("ACS_Bottom_Tee",&ACS_BTEE); +#endif +#ifdef ACS_TTEE + acs_def("ACS_Top_Tee",&ACS_TTEE); +#endif +#ifdef ACS_HLINE + acs_def("ACS_Horizontal_Line",&ACS_HLINE); +#endif +#ifdef ACS_VLINE + acs_def("ACS_Vertical_Line",&ACS_VLINE); +#endif +#ifdef ACS_PLUS + acs_def("ACS_Plus_Symbol",&ACS_PLUS); +#endif +#ifdef ACS_S1 + acs_def("ACS_Scan_Line_1",&ACS_S1); +#endif +#ifdef ACS_S9 + acs_def("ACS_Scan_Line_9",&ACS_S9); +#endif +#ifdef ACS_DIAMOND + acs_def("ACS_Diamond",&ACS_DIAMOND); +#endif +#ifdef ACS_CKBOARD + acs_def("ACS_Checker_Board",&ACS_CKBOARD); +#endif +#ifdef ACS_DEGREE + acs_def("ACS_Degree",&ACS_DEGREE); +#endif +#ifdef ACS_PLMINUS + acs_def("ACS_Plus_Minus",&ACS_PLMINUS); +#endif +#ifdef ACS_BULLET + acs_def("ACS_Bullet",&ACS_BULLET); +#endif +#ifdef ACS_LARROW + acs_def("ACS_Left_Arrow",&ACS_LARROW); +#endif +#ifdef ACS_RARROW + acs_def("ACS_Right_Arrow",&ACS_RARROW); +#endif +#ifdef ACS_DARROW + acs_def("ACS_Down_Arrow",&ACS_DARROW); +#endif +#ifdef ACS_UARROW + acs_def("ACS_Up_Arrow",&ACS_UARROW); +#endif +#ifdef ACS_BOARD + acs_def("ACS_Board_Of_Squares",&ACS_BOARD); +#endif +#ifdef ACS_LANTERN + acs_def("ACS_Lantern",&ACS_LANTERN); +#endif +#ifdef ACS_BLOCK + acs_def("ACS_Solid_Block",&ACS_BLOCK); +#endif +#ifdef ACS_S3 + acs_def("ACS_Scan_Line_3",&ACS_S3); +#endif +#ifdef ACS_S7 + acs_def("ACS_Scan_Line_7",&ACS_S7); +#endif +#ifdef ACS_LEQUAL + acs_def("ACS_Less_Or_Equal",&ACS_LEQUAL); +#endif +#ifdef ACS_GEQUAL + acs_def("ACS_Greater_Or_Equal",&ACS_GEQUAL); +#endif +#ifdef ACS_PI + acs_def("ACS_PI",&ACS_PI); +#endif +#ifdef ACS_NEQUAL + acs_def("ACS_Not_Equal",&ACS_NEQUAL); +#endif +#ifdef ACS_STERLING + acs_def("ACS_Sterling",&ACS_STERLING); +#endif +} + +static void prologue(const char *name) +{ + time_t t = time(NULL); + printf("-- %s binding, generated at %s",name,ctime(&t)); + printf("-- This module is generated. Please don't change it manually!\n"); + printf("-- Run the generator instead.\n-- |"); + + printf("define(`M4_BIT_ORDER',`%s_Order_First')",little_endian ? "Low":"High"); +} + +static void basedefs (void) +{ + prologue("curses"); +#ifndef KEY_MAX +# define KEY_MAX 0777 +#endif + printf("define(`M4_KEY_MAX',`8#%o#')",KEY_MAX); +#ifndef KEY_MIN +# define KEY_MIN 0401 +#endif + if (KEY_MIN == 256) + abort(); + printf("define(`M4_SPECIAL_FIRST',`8#%o#')",KEY_MIN - 1); +} + +static void menu_basedefs (void) +{ + prologue("menu"); +} + +static void form_basedefs (void) +{ + prologue("form"); +} + +static void mouse_basedefs(void) +{ + prologue("mouse"); +} + +static void color_def (const char *name, int value) +{ + printf(" %-8s : constant Color_Number := %d;\n",name,value); +} + +static void gen_color (void) +{ +#ifdef COLOR_BLACK + color_def ("Black",COLOR_BLACK); +#endif +#ifdef COLOR_RED + color_def ("Red",COLOR_RED); +#endif +#ifdef COLOR_GREEN + color_def ("Green",COLOR_GREEN); +#endif +#ifdef COLOR_YELLOW + color_def ("Yellow",COLOR_YELLOW); +#endif +#ifdef COLOR_BLUE + color_def ("Blue",COLOR_BLUE); +#endif +#ifdef COLOR_MAGENTA + color_def ("Magenta",COLOR_MAGENTA); +#endif +#ifdef COLOR_CYAN + color_def ("Cyan",COLOR_CYAN); +#endif +#ifdef COLOR_WHITE + color_def ("White",COLOR_WHITE); +#endif +} + +static void gen_linkopts (void) +{ + printf(" pragma Linker_Options (\"-lncurses\");\n"); +} + +static void gen_menu_linkopts (void) +{ + printf(" pragma Linker_Options (\"-lmenu\");\n"); +} + +static void gen_form_linkopts (void) +{ + printf(" pragma Linker_Options (\"-lform\");\n"); +} + +static void gen_panel_linkopts (void) +{ + printf(" pragma Linker_Options (\"-lpanel\");\n"); +} + + +int main(int argc, char *argv[]) +{ + int x = 0x12345678; + char *s = (char *)&x; + + if (*s == 0x78) + little_endian = 1; + + if (argc!=3) + exit(1); + + switch(argv[1][0]) + { + case 'B': + switch(argv[2][0]) + { + case 'A': + gen_attr_set("Character_Attribute_Set"); + break; + case 'K': + gen_keydefs(0); + break; + case 'B': + basedefs(); + break; + case 'C': + gen_color(); + break; + case 'M': + gen_acs(); + break; + case 'L': + gen_linkopts(); + break; + case 'O': + gen_keydefs(1); + break; + case 'R': + gen_chtype_rep("Attributed_Character"); + break; + default: + break; + } + break; + case 'M': + switch(argv[2][0]) + { + case 'R': + gen_menu_opt_rep("Menu_Option_Set"); + break; + case 'B': + menu_basedefs(); + break; + case 'L': + gen_menu_linkopts(); + break; + case 'I': + gen_item_opt_rep("Item_Option_Set"); + break; + default: + break; + } + break; + case 'F': + switch(argv[2][0]) + { + case 'R': + gen_form_opt_rep("Form_Option_Set"); + break; + case 'B': + form_basedefs(); + break; + case 'L': + gen_form_linkopts(); + break; + case 'I': + gen_field_opt_rep("Field_Option_Set"); + break; + default: + break; + } + break; + case 'P': + switch(argv[2][0]) + { + case 'B': + mouse_basedefs(); + break; + case 'M': + gen_mrep_rep("Mouse_Event"); + break; + case 'L': + gen_panel_linkopts(); + break; + default: + break; + } + break; + default: + break; + } + return 0; +} diff --git a/Ada95/gen/normal.m4 b/Ada95/gen/normal.m4 new file mode 100644 index 00000000..f884c465 --- /dev/null +++ b/Ada95/gen/normal.m4 @@ -0,0 +1,8 @@ +define(`MANPAGE',`define(`MANPG',$1)dnl +|===================================================================== + -- | Man page MANPG + -- |=====================================================================')dnl +define(`ANCHOR',`define(`CFUNAME',`$1')define(`AFUNAME',`$2')'dnl +|)dnl +define(`AKA',``AKA': CFUNAME')dnl +define(`ALIAS',``AKA': $1')dnl diff --git a/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 new file mode 100644 index 00000000..3fdeecb1 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-forms-field_user_data.ads.m4 @@ -0,0 +1,59 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-forms-field_user_data_s.html')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Field_User_Data -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ + +generic + type User is limited private; + type User_Access is access User; +package Terminal_Interface.Curses.Forms.Field_User_Data is + + -- The binding uses the C level user pointer already for its own + -- internal purposes. So you can´t easily manipulate the user pointer + -- with the low level C routines for this field without taking care of + -- this special situation. If you want to read or write with C routines + -- the user pointer of this field, you should get first the low level + -- user pointer. This points to a record, that always has as its first + -- member the Ada95 user pointer for this field. You should never change + -- the low level user pointer of an Ada created field. + -- + -- MANPAGE(`form_field_userptr.3x') + + -- ANCHOR(`set_field_userptr',`Set_User_Data') + procedure Set_User_Data (Fld : in Field; + Data : in User_Access); + -- AKA + pragma Convention (C, Set_User_Data); + + -- ANCHOR(`field_userptr',`Get_User_Data') + procedure Get_User_Data (Fld : in Field; + Data : out User_Access); + -- AKA + pragma Convention (C, Get_User_Data); + +end Terminal_Interface.Curses.Forms.Field_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 new file mode 100644 index 00000000..da9b0c5f --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-forms-form_user_data.ads.m4 @@ -0,0 +1,60 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-forms-form_user_data_s.html')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Forms.Form_User_Data -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.3 $ +------------------------------------------------------------------------------ + +generic + type User is limited private; + type User_Access is access User; +package Terminal_Interface.Curses.Forms.Form_User_Data is + + -- The binding uses the C level user pointer already for its own + -- internal purposes. So you can´t easily manipulate the user pointer + -- with the low level C routines for this form without taking care of + -- this special situation. If you want to read or write with C routines + -- the user pointer of this form, you should get first the low level + -- user pointer. This points to a record, that always has as its first + -- member the Ada95 user pointer for this form. You should never change + -- the low level user pointer of an Ada created form. + -- + -- MANPAGE(`form_userptr.3x') + + -- ANCHOR(`set_form_userptr',`Set_User_Data') + procedure Set_User_Data (Frm : in Form; + Data : in User_Access); + -- AKA + pragma Convention (C, Set_User_Data); + + -- ANCHOR(`form_userptr',`Get_User_Data') + procedure Get_User_Data (Frm : in Form; + Data : out User_Access); + -- AKA + pragma Convention (C, Get_User_Data); + +end Terminal_Interface.Curses.Forms.Form_User_Data; + diff --git a/Ada95/gen/terminal_interface-curses-forms.ads.m4 b/Ada95/gen/terminal_interface-curses-forms.ads.m4 new file mode 100644 index 00000000..998fdba1 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-forms.ads.m4 @@ -0,0 +1,812 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-forms_s.html')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Form -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.9 $ +------------------------------------------------------------------------------ +include(`Form_Base_Defs') +with System; +with Ada.Tags; use Ada.Tags; +with Ada.Characters.Latin_1; +with Interfaces.C; +with Interfaces.C.Strings; + +package Terminal_Interface.Curses.Forms is + +include(`Form_Linker_Options') + + Space : Character renames Ada.Characters.Latin_1.Space; + + type Field is private; + type Form is private; + type C_Field_Type is private; + + Null_Field : constant Field; + Null_Form : constant Form; + Null_Field_Type : constant C_Field_Type; + + + type Field_Justification is (None, + Left, + Center, + Right); + +include(`Field_Rep') + + Default_Field_Options : Field_Option_Set; + -- The initial defaults for the field options. + +include(`Form_Opt_Rep') + + Default_Form_Options : Form_Option_Set; + -- The initial defaults for the form options. + + type Buffer_Number is new Natural; + + type Field_Array is array (Positive range <>) of aliased Field; + pragma Convention (C, Field_Array); + + type Field_Array_Access is access all Field_Array; + + subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57); + + -- The prefix F_ stands for "Form Request" + F_Next_Page : constant Form_Request_Code := Key_Max + 1; + F_Previous_Page : constant Form_Request_Code := Key_Max + 2; + F_First_Page : constant Form_Request_Code := Key_Max + 3; + F_Last_Page : constant Form_Request_Code := Key_Max + 4; + + F_Next_Field : constant Form_Request_Code := Key_Max + 5; + F_Previous_Field : constant Form_Request_Code := Key_Max + 6; + F_First_Field : constant Form_Request_Code := Key_Max + 7; + F_Last_Field : constant Form_Request_Code := Key_Max + 8; + F_Sorted_Next_Field : constant Form_Request_Code := Key_Max + 9; + F_Sorted_Previous_Field : constant Form_Request_Code := Key_Max + 10; + F_Sorted_First_Field : constant Form_Request_Code := Key_Max + 11; + F_Sorted_Last_Field : constant Form_Request_Code := Key_Max + 12; + F_Left_Field : constant Form_Request_Code := Key_Max + 13; + F_Right_Field : constant Form_Request_Code := Key_Max + 14; + F_Up_Field : constant Form_Request_Code := Key_Max + 15; + F_Down_Field : constant Form_Request_Code := Key_Max + 16; + + F_Next_Char : constant Form_Request_Code := Key_Max + 17; + F_Previous_Char : constant Form_Request_Code := Key_Max + 18; + F_Next_Line : constant Form_Request_Code := Key_Max + 19; + F_Previous_Line : constant Form_Request_Code := Key_Max + 20; + F_Next_Word : constant Form_Request_Code := Key_Max + 21; + F_Previous_Word : constant Form_Request_Code := Key_Max + 22; + F_Begin_Field : constant Form_Request_Code := Key_Max + 23; + F_End_Field : constant Form_Request_Code := Key_Max + 24; + F_Begin_Line : constant Form_Request_Code := Key_Max + 25; + F_End_Line : constant Form_Request_Code := Key_Max + 26; + F_Left_Char : constant Form_Request_Code := Key_Max + 27; + F_Right_Char : constant Form_Request_Code := Key_Max + 28; + F_Up_Char : constant Form_Request_Code := Key_Max + 29; + F_Down_Char : constant Form_Request_Code := Key_Max + 30; + + F_New_Line : constant Form_Request_Code := Key_Max + 31; + F_Insert_Char : constant Form_Request_Code := Key_Max + 32; + F_Insert_Line : constant Form_Request_Code := Key_Max + 33; + F_Delete_Char : constant Form_Request_Code := Key_Max + 34; + F_Delete_Previous : constant Form_Request_Code := Key_Max + 35; + F_Delete_Line : constant Form_Request_Code := Key_Max + 36; + F_Delete_Word : constant Form_Request_Code := Key_Max + 37; + F_Clear_EOL : constant Form_Request_Code := Key_Max + 38; + F_Clear_EOF : constant Form_Request_Code := Key_Max + 39; + F_Clear_Field : constant Form_Request_Code := Key_Max + 40; + F_Overlay_Mode : constant Form_Request_Code := Key_Max + 41; + F_Insert_Mode : constant Form_Request_Code := Key_Max + 42; + + -- Vertical Scrolling + F_ScrollForward_Line : constant Form_Request_Code := Key_Max + 43; + F_ScrollBackward_Line : constant Form_Request_Code := Key_Max + 44; + F_ScrollForward_Page : constant Form_Request_Code := Key_Max + 45; + F_ScrollBackward_Page : constant Form_Request_Code := Key_Max + 46; + F_ScrollForward_HalfPage : constant Form_Request_Code := Key_Max + 47; + F_ScrollBackward_HalfPage : constant Form_Request_Code := Key_Max + 48; + + -- Horizontal Scrolling + F_HScrollForward_Char : constant Form_Request_Code := Key_Max + 49; + F_HScrollBackward_Char : constant Form_Request_Code := Key_Max + 50; + F_HScrollForward_Line : constant Form_Request_Code := Key_Max + 51; + F_HScrollBackward_Line : constant Form_Request_Code := Key_Max + 52; + F_HScrollForward_HalfLine : constant Form_Request_Code := Key_Max + 53; + F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54; + + F_Validate_Field : constant Form_Request_Code := Key_Max + 55; + F_Next_Choice : constant Form_Request_Code := Key_Max + 56; + F_Previous_Choice : constant Form_Request_Code := Key_Max + 57; + + -- For those who like the old 'C' style request names + REQ_NEXT_PAGE : Form_Request_Code renames F_Next_Page; + REQ_PREV_PAGE : Form_Request_Code renames F_Previous_Page; + REQ_FIRST_PAGE : Form_Request_Code renames F_First_Page; + REQ_LAST_PAGE : Form_Request_Code renames F_Last_Page; + + REQ_NEXT_FIELD : Form_Request_Code renames F_Next_Field; + REQ_PREV_FIELD : Form_Request_Code renames F_Previous_Field; + REQ_FIRST_FIELD : Form_Request_Code renames F_First_Field; + REQ_LAST_FIELD : Form_Request_Code renames F_Last_Field; + REQ_SNEXT_FIELD : Form_Request_Code renames F_Sorted_Next_Field; + REQ_SPREV_FIELD : Form_Request_Code renames F_Sorted_Previous_Field; + REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field; + REQ_SLAST_FIELD : Form_Request_Code renames F_Sorted_Last_Field; + REQ_LEFT_FIELD : Form_Request_Code renames F_Left_Field; + REQ_RIGHT_FIELD : Form_Request_Code renames F_Right_Field; + REQ_UP_FIELD : Form_Request_Code renames F_Up_Field; + REQ_DOWN_FIELD : Form_Request_Code renames F_Down_Field; + + REQ_NEXT_CHAR : Form_Request_Code renames F_Next_Char; + REQ_PREV_CHAR : Form_Request_Code renames F_Previous_Char; + REQ_NEXT_LINE : Form_Request_Code renames F_Next_Line; + REQ_PREV_LINE : Form_Request_Code renames F_Previous_Line; + REQ_NEXT_WORD : Form_Request_Code renames F_Next_Word; + REQ_PREV_WORD : Form_Request_Code renames F_Previous_Word; + REQ_BEG_FIELD : Form_Request_Code renames F_Begin_Field; + REQ_END_FIELD : Form_Request_Code renames F_End_Field; + REQ_BEG_LINE : Form_Request_Code renames F_Begin_Line; + REQ_END_LINE : Form_Request_Code renames F_End_Line; + REQ_LEFT_CHAR : Form_Request_Code renames F_Left_Char; + REQ_RIGHT_CHAR : Form_Request_Code renames F_Right_Char; + REQ_UP_CHAR : Form_Request_Code renames F_Up_Char; + REQ_DOWN_CHAR : Form_Request_Code renames F_Down_Char; + + REQ_NEW_LINE : Form_Request_Code renames F_New_Line; + REQ_INS_CHAR : Form_Request_Code renames F_Insert_Char; + REQ_INS_LINE : Form_Request_Code renames F_Insert_Line; + REQ_DEL_CHAR : Form_Request_Code renames F_Delete_Char; + REQ_DEL_PREV : Form_Request_Code renames F_Delete_Previous; + REQ_DEL_LINE : Form_Request_Code renames F_Delete_Line; + REQ_DEL_WORD : Form_Request_Code renames F_Delete_Word; + REQ_CLR_EOL : Form_Request_Code renames F_Clear_EOL; + REQ_CLR_EOF : Form_Request_Code renames F_Clear_EOF; + REQ_CLR_FIELD : Form_Request_Code renames F_Clear_Field; + REQ_OVL_MODE : Form_Request_Code renames F_Overlay_Mode; + REQ_INS_MODE : Form_Request_Code renames F_Insert_Mode; + + REQ_SCR_FLINE : Form_Request_Code renames F_ScrollForward_Line; + REQ_SCR_BLINE : Form_Request_Code renames F_ScrollBackward_Line; + REQ_SCR_FPAGE : Form_Request_Code renames F_ScrollForward_Page; + REQ_SCR_BPAGE : Form_Request_Code renames F_ScrollBackward_Page; + REQ_SCR_FHPAGE : Form_Request_Code renames F_ScrollForward_HalfPage; + REQ_SCR_BHPAGE : Form_Request_Code renames F_ScrollBackward_HalfPage; + + REQ_SCR_FCHAR : Form_Request_Code renames F_HScrollForward_Char; + REQ_SCR_BCHAR : Form_Request_Code renames F_HScrollBackward_Char; + REQ_SCR_HFLINE : Form_Request_Code renames F_HScrollForward_Line; + REQ_SCR_HBLINE : Form_Request_Code renames F_HScrollBackward_Line; + REQ_SCR_HFHALF : Form_Request_Code renames F_HScrollForward_HalfLine; + REQ_SCR_HBHALF : Form_Request_Code renames F_HScrollBackward_HalfLine; + + REQ_VALIDATION : Form_Request_Code renames F_Validate_Field; + REQ_NEXT_CHOICE : Form_Request_Code renames F_Next_Choice; + REQ_PREV_CHOICE : Form_Request_Code renames F_Previous_Choice; + + + procedure Request_Name (Key : in Form_Request_Code; + Name : out String); + + ------------------ + -- Exceptions -- + ------------------ + Form_Exception : exception; + + -- MANPAGE(`form_field_new.3x') + + -- ANCHOR(`new_field()',`Create') + function Create (Height : Line_Count; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0; + More_Buffers : Buffer_Number := Buffer_Number'First) + return Field; + -- AKA + + -- ANCHOR(`new_field()',`New_Field') + function New_Field (Height : Line_Count; + Width : Column_Count; + Top : Line_Position; + Left : Column_Position; + Off_Screen : Natural := 0; + More_Buffers : Buffer_Number := Buffer_Number'First) + return Field renames Create; + -- AKA + + -- ANCHOR(`free_field()',`Delete') + procedure Delete (Fld : in out Field); + -- AKA + -- Reset Fld to Null_Field + + -- ANCHOR(`dup_field()',`Duplicate') + function Duplicate (Fld : Field; + Top : Line_Position; + Left : Column_Position) return Field; + -- AKA + + -- ANCHOR(`link_field()',`Link') + function Link (Fld : Field; + Top : Line_Position; + Left : Column_Position) return Field; + -- AKA + + -- MANPAGE(`form_field_just.3x') + + -- ANCHOR(`set_field_just()',`Set_Justification') + procedure Set_Justification (Fld : in Field; + Just : in Field_Justification := None); + -- AKA + + -- ANCHOR(`field_just()',`Get_Justification') + function Get_Justification (Fld : Field) return Field_Justification; + -- AKA + + -- MANPAGE(`form_field_buffer.3x') + + -- ANCHOR(`set_field_buffer()',`Set_Buffer') + procedure Set_Buffer + (Fld : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; + Str : in String); + -- AKA + + -- ANCHOR(`field_buffer()',`Get_Buffer') + procedure Get_Buffer + (Fld : in Field; + Buffer : in Buffer_Number := Buffer_Number'First; + Str : out String); + -- AKA + + -- ANCHOR(`set_field_status()',`Set_Status') + procedure Set_Status (Fld : in Field; + Status : in Boolean := True); + -- AKA + + -- ANCHOR(`field_status()',`Changed') + function Changed (Fld : Field) return Boolean; + -- AKA + + -- ANCHOR(`set_field_max()',`Set_Maximum_Size') + procedure Set_Maximum_Size (Fld : in Field; + Max : in Natural := 0); + -- AKA + + -- MANPAGE(`form_field_opts.3x') + + -- ANCHOR(`set_field_opts()',`Set_Options') + procedure Set_Options (Fld : in Field; + Options : in Field_Option_Set); + -- AKA + + -- ANCHOR(`field_opts_on()',`Switch_Options') + procedure Switch_Options (Fld : in Field; + Options : in Field_Option_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`field_opts_off()') + + -- ANCHOR(`field_opts()',`Get_Options') + procedure Get_Options (Fld : in Field; + Options : out Field_Option_Set); + -- AKA + + -- ANCHOR(`field_opts()',`Get_Options') + function Get_Options (Fld : Field := Null_Field) + return Field_Option_Set; + -- AKA + + -- MANPAGE(`form_field_attributes.3x') + + -- ANCHOR(`set_field_fore()',`Set_Foreground') + procedure Set_Foreground + (Fld : in Field; + Fore : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + + -- ANCHOR(`field_fore()',`Foreground') + procedure Foreground (Fld : in Field; + Fore : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`field_fore()',`Foreground') + procedure Foreground (Fld : in Field; + Fore : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + + -- ANCHOR(`set_field_back()',`Set_Background') + procedure Set_Background + (Fld : in Field; + Back : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + + -- ANCHOR(`field_back()',`Background') + procedure Background (Fld : in Field; + Back : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`field_back()',`Background') + procedure Background (Fld : in Field; + Back : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + + -- ANCHOR(`set_field_pad()',`Set_Pad_Character') + procedure Set_Pad_Character (Fld : in Field; + Pad : in Character := Space); + -- AKA + + -- ANCHOR(`field_pad()',`Pad_Character') + procedure Pad_Character (Fld : in Field; + Pad : out Character); + -- AKA + + -- MANPAGE(`form_field_info.3x') + + -- ANCHOR(`field_info()',`Info') + procedure Info (Fld : in Field; + Lines : out Line_Count; + Columns : out Column_Count; + First_Row : out Line_Position; + First_Column : out Column_Position; + Off_Screen : out Natural; + Additional_Buffers : out Buffer_Number); + -- AKA + + -- ANCHOR(`dynamic_field_info()',`Dynamic_Info') + procedure Dynamic_Info (Fld : in Field; + Lines : out Line_Count; + Columns : out Column_Count; + Max : out Natural); + -- AKA + + -- MANPAGE(`form_win.3x') + + -- ANCHOR(`set_form_win()',`Set_Window') + procedure Set_Window (Frm : in Form; + Win : in Window); + -- AKA + + -- ANCHOR(`form_win()',`Get_Window') + function Get_Window (Frm : Form) return Window; + -- AKA + + -- ANCHOR(`set_form_sub()',`Set_Sub_Window') + procedure Set_Sub_Window (Frm : in Form; + Win : in Window); + -- AKA + + -- ANCHOR(`form_sub()',`Get_Sub_Window') + function Get_Sub_Window (Frm : Form) return Window; + -- AKA + + -- ANCHOR(`scale_form()',`Scale') + procedure Scale (Frm : in Form; + Lines : out Line_Count; + Columns : out Column_Count); + -- AKA + + -- MANPAGE(`form_hook.3x') + + type Form_Hook_Function is access procedure (Frm : in Form); + pragma Convention (C, Form_Hook_Function); + + -- ANCHOR(`set_field_init()',`Set_Field_Init_Hook') + procedure Set_Field_Init_Hook (Frm : in Form; + Proc : in Form_Hook_Function); + -- AKA + + -- ANCHOR(`set_field_term()',`Set_Field_Term_Hook') + procedure Set_Field_Term_Hook (Frm : in Form; + Proc : in Form_Hook_Function); + -- AKA + + -- ANCHOR(`set_form_init()',`Set_Form_Init_Hook') + procedure Set_Form_Init_Hook (Frm : in Form; + Proc : in Form_Hook_Function); + -- AKA + + -- ANCHOR(`set_form_term()',`Set_Form_Term_Hook') + procedure Set_Form_Term_Hook (Frm : in Form; + Proc : in Form_Hook_Function); + -- AKA + + -- ANCHOR(`field_init()',`Get_Field_Init_Hook') + function Get_Field_Init_Hook (Frm : Form) return Form_Hook_Function; + -- AKA + pragma Import (C, Get_Field_Init_Hook, "field_init"); + + -- ANCHOR(`field_term()',`Get_Field_Term_Hook') + function Get_Field_Term_Hook (Frm : Form) return Form_Hook_Function; + -- AKA + pragma Import (C, Get_Field_Term_Hook, "field_term"); + + -- ANCHOR(`form_init()',`Get_Form_Init_Hook') + function Get_Form_Init_Hook (Frm : Form) return Form_Hook_Function; + -- AKA + pragma Import (C, Get_Form_Init_Hook, "form_init"); + + -- ANCHOR(`form_term()',`Get_Form_Term_Hook') + function Get_Form_Term_Hook (Frm : Form) return Form_Hook_Function; + -- AKA + pragma Import (C, Get_Form_Term_Hook, "form_term"); + + -- MANPAGE(`form_field.3x') + + -- ANCHOR(`set_form_fields()',`Redefine') + procedure Redefine (Frm : in Form; + Flds : in Field_Array); + -- AKA + -- With a bit more comfort. You don´t need to terminate the Field_Array + -- with a null entry. This is handled internally in the binding. + + -- ANCHOR(`set_form_fields()',`Set_Fields') + procedure Set_Fields (Frm : in Form; + Flds : in Field_Array) renames Redefine; + -- AKA + + -- ANCHOR(`form_fields()',`Fields') + function Fields (Frm : Form) return Field_Array_Access; + -- AKA + + -- ANCHOR(`field_count()',`Field_Count') + function Field_Count (Frm : Form) return Natural; + -- AKA + + -- ANCHOR(`move_field()',`Move') + procedure Move (Fld : in Field; + Line : in Line_Position; + Column : in Column_Position); + -- AKA + + -- MANPAGE(`form_new.3x') + + -- ANCHOR(`new_form()',`Create') + function Create (Fields : Field_Array) return Form; + -- AKA + + -- ANCHOR(`new_form()',`New_Form') + function New_Form (Fields : Field_Array) return Form renames Create; + -- AKA + + -- ANCHOR(`free_form()',`Delete') + procedure Delete (Frm : in out Form); + -- AKA + -- Reset Frm to Null_Form + + -- MANPAGE(`form_opts.3x') + + -- ANCHOR(`set_form_opts()',`Set_Options') + procedure Set_Options (Frm : in Form; + Options : in Form_Option_Set); + -- AKA + + -- ANCHOR(`form_opts_on()',`Switch_Options') + procedure Switch_Options (Frm : in Form; + Options : in Form_Option_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`form_opts_off()') + + -- ANCHOR(`form_opts()',`Get_Options') + procedure Get_Options (Frm : in Form; + Options : out Form_Option_Set); + -- AKA + + -- ANCHOR(`form_opts()',`Get_Options') + function Get_Options (Frm : Form := Null_Form) return Form_Option_Set; + -- AKA + + -- MANPAGE(`form_post.3x') + + -- ANCHOR(`post_form()',`Post') + procedure Post (Frm : in Form; + Post : in Boolean := True); + -- AKA + -- ALIAS(`unpost_form()') + + -- MANPAGE(`form_cursor.3x') + + -- ANCHOR(`pos_form_cursor()',`Position_Cursor') + procedure Position_Cursor (Frm : Form); + -- AKA + + -- MANPAGE(`form_data.3x') + + -- ANCHOR(`data_ahead()',`Data_Ahead') + function Data_Ahead (Frm : Form) return Boolean; + -- AKA + + -- ANCHOR(`data_behind()',`Data_Behind') + function Data_Behind (Frm : Form) return Boolean; + -- AKA + + -- MANPAGE(`form_driver.3x') + + type Driver_Result is (Form_Ok, + Request_Denied, + Unknown_Request, + Invalid_Field); + + -- ANCHOR(`form_driver()',`Driver') + function Driver (Frm : Form; + Key : Key_Code) return Driver_Result; + -- AKA + + -- MANPAGE(`form_page.3x') + + type Page_Number is new Natural; + + -- ANCHOR(`set_current_field()',`Set_Current') + procedure Set_Current (Frm : in Form; + Fld : in Field); + -- AKA + + -- ANCHOR(`current_field()',`Current') + function Current (Frm : in Form) return Field; + -- AKA + + -- ANCHOR(`set_form_page()',`Set_Page') + procedure Set_Page (Frm : in Form; + Page : in Page_Number := Page_Number'First); + -- AKA + + -- ANCHOR(`form_page()',`Page') + function Page (Frm : Form) return Page_Number; + -- AKA + + -- ANCHOR(`field_index()',`Get_Index') + function Get_Index (Fld : Field) return Positive; + -- AKA + -- Please note that in this binding we start the numbering of fields + -- with 1. So this is number is one more than you get from the low + -- level call. + + -- MANPAGE(`form_new_page.3x') + + -- ANCHOR(`set_new_page()',`Set_New_Page') + procedure Set_New_Page (Fld : in Field; + New_Page : in Boolean := True); + -- AKA + + -- ANCHOR(`new_page()',`Is_New_Page') + function Is_New_Page (Fld : Field) return Boolean; + -- AKA + + -- MANPAGE(`form_fieldtype.3x') + + type Field_Type is abstract tagged null record; + type Field_Type_Access is access all Field_Type'Class; + + function Native_Type (Ftype : Field_Type) + return C_Field_Type is abstract; + -- This function returns the C libraries handle to the field type. + -- May be you need this if you want to interface to lower level + -- routines in the form library. + + -- ANCHOR(`set_field_type()',`Set_Type') + procedure Set_Type (Fld : in Field; + Fld_Type : in Field_Type) is abstract; + -- AKA + -- But: we hide the vararg mechanism of the C interface. You always + -- have to pass a single Field_Type parameter. + + type C_Defined_Field_Type is abstract new Field_Type with null record; + -- This is the root of all field typed defined in C, i.e. this are + -- the predefined field types in the form library. + + type Alpha_Field is new C_Defined_Field_Type + with record + Minimum_Field_Width : Natural := 0; + end record; + procedure Set_Type (Fld : in Field; + Fld_Type : in Alpha_Field); + function Native_Type (Ftype : Alpha_Field) + return C_Field_Type; + + type Alpha_Numeric_Field is new C_Defined_Field_Type with + record + Minimum_Field_Width : Natural := 0; + end record; + procedure Set_Type (Fld : in Field; + Fld_Type : in Alpha_Numeric_Field); + function Native_Type (Ftype : Alpha_Numeric_Field) + return C_Field_Type; + + type Integer_Field is new C_Defined_Field_Type with + record + Precision : Natural; + Lower_Limit : Integer; + Upper_Limit : Integer; + end record; + procedure Set_Type (Fld : in Field; + Fld_Type : in Integer_Field); + function Native_Type (Ftype : Integer_Field) + return C_Field_Type; + + type Numeric_Field is new C_Defined_Field_Type with + record + Precision : Natural; + Lower_Limit : Float; + Upper_Limit : Float; + end record; + procedure Set_Type (Fld : in Field; + Fld_Type : in Numeric_Field); + function Native_Type (Ftype : Numeric_Field) + return C_Field_Type; + + type String_Access is access String; + + type Regular_Expression_Field is new C_Defined_Field_Type with + record + Regular_Expression : String_Access; + end record; + procedure Set_Type (Fld : in Field; + Fld_Type : in Regular_Expression_Field); + function Native_Type (Ftype : Regular_Expression_Field) + return C_Field_Type; + + type Enum_Array is array (Positive range <>) + of String_Access; + + type Enumeration_Info (C : Positive) is + record + Names : Enum_Array (1 .. C); + Case_Sensitive : Boolean := False; + Match_Must_Be_Unique : Boolean := False; + end record; + + type Enumeration_Field is new C_Defined_Field_Type with private; + + function Create (Info : Enumeration_Info; + Auto_Release_Names : Boolean := False) + return Enumeration_Field; + -- Make an fieldtype from the info. Enumerations are special, because + -- they normally don't copy the enum values into a private store, so + -- we have to care for the lifetime of the info we provide. + -- The Auto_Release_Names flag may be used to automatically releases + -- the strings in the Names array of the Enumeration_Info. + + function Make_Enumeration_Type (Info : Enumeration_Info; + Auto_Release_Names : Boolean := False) + return Enumeration_Field renames Create; + + procedure Release (Enum : in out Enumeration_Field); + -- But we may want to release the field to release the memory allocated + -- by it internally. After that the Enumeration field is no longer usable. + + procedure Set_Type (Fld : in Field; + Fld_Type : in Enumeration_Field); + function Native_Type (Ftype : Enumeration_Field) + return C_Field_Type; + + -- The next type defintions are all ncurses extensions. They are typically + -- not available in other curses implementations. + + type Internet_V4_Address_Field is new C_Defined_Field_Type + with null record; + procedure Set_Type (Fld : in Field; + Fld_Type : in Internet_V4_Address_Field); + function Native_Type (Ftype : Internet_V4_Address_Field) + return C_Field_Type; + + + type Ada_Defined_Field_Type is abstract new Field_Type with null record; + -- This is the root of the mechanism we use to create field types in + -- Ada95. You don't have to redefine the Set_Field_Type and + -- Native_Field_Type methods, because they work generically on this + -- class. + + procedure Set_Type (Fld : Field; + Fld_Type : Ada_Defined_Field_Type); + + function Native_Type (Ftype : Ada_Defined_Field_Type) + return C_Field_Type; + + -- MANPAGE(`form_field_validation.3x') + + -- ANCHOR(`field_type()',`Get_Type') + function Get_Type (Fld : in Field) return Field_Type_Access; + -- AKA + -- ALIAS(`field_arg()') + -- In Ada95 we can combine these + +------------------------------------------------------------------------------ +private + + type Field is new System.Address; + type Form is new System.Address; + type C_Field_Type is new System.Address; + + Null_Field : constant Field := Field (System.Null_Address); + Null_Form : constant Form := Form (System.Null_Address); + Null_Field_Type : constant C_Field_Type := + C_Field_Type (System.Null_Address); + + type CPA_Access is access Interfaces.C.Strings.chars_ptr_array; + + type Enumeration_Field is new C_Defined_Field_Type with + record + Case_Sensitive : Boolean := False; + Match_Must_Be_Unique : Boolean := False; + Arr : CPA_Access := null; + end record; + + -- In our binding we use the fields user pointer as hook to maintain + -- our own info structure about the field type. To be able to still + -- provide a user pointer, we use this wrapper. + -- + type Field_User_Wrapper is + record + U : System.Address; -- the hook we provide for the user + T : Field_Type_Access; -- may be null + N : Natural; -- use counter + end record; + pragma Convention (C, Field_User_Wrapper); + type Field_User_Wrapper_Access is access all Field_User_Wrapper; + pragma Controlled (Field_User_Wrapper_Access); + + function Set_Field_Userptr (Fld : Field; + Wrp : Field_User_Wrapper_Access) + return Interfaces.C.int; + pragma Import (C, Set_Field_Userptr, "set_field_userptr"); + + function Field_Userptr (Fld : Field) return Field_User_Wrapper_Access; + pragma Import (C, Field_Userptr, "field_userptr"); + + -- In our binding we use the forms user pointer as hook to maintain + -- our own info structure about the field association. To be able to still + -- provide a user pointer, we use this wrapper. + -- + type Form_User_Wrapper is + record + U : System.Address; -- the hook we provide for the user + I : Field_Array_Access; + end record; + pragma Convention (C, Form_User_Wrapper); + type Form_User_Wrapper_Access is access all Form_User_Wrapper; + pragma Controlled (Form_User_Wrapper_Access); + + function Set_Form_Userptr (Frm : Form; + Wrp : Form_User_Wrapper_Access) + return Interfaces.C.int; + pragma Import (C, Set_Form_Userptr, "set_form_userptr"); + + function Form_Userptr (Frm : Form) return Form_User_Wrapper_Access; + pragma Import (C, Form_Userptr, "form_userptr"); + + procedure Register_Type (T : in Ada_Defined_Field_Type'Class; + Cft : in C_Field_Type); + procedure Unregister_Type (T : in Ada_Defined_Field_Type'Class); + function Search_Type (T : Ada_Defined_Field_Type'Class) + return C_Field_Type; + + Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER; + -- This constant may be different on your system. + +end Terminal_Interface.Curses.Forms; diff --git a/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 new file mode 100644 index 00000000..c32e764a --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-menus-item_user_data.ads.m4 @@ -0,0 +1,54 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-menus-item_user_data_s.html')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus.Item_User_Data -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.2 $ +------------------------------------------------------------------------------ + +generic + type User is limited private; + type User_Access is access User; +package Terminal_Interface.Curses.Menus.Item_User_Data is + + -- The binding uses the same user pointer for menu items + -- as the low level C implementation. So you can safely + -- read or write the user pointer also with the C routines + -- + -- MANPAGE(`mitem_userptr.3x') + + -- ANCHOR(`set_item_userptr',`Set_User_Data') + procedure Set_User_Data (Itm : in Item; + Data : in User_Access); + -- AKA + pragma Convention (C, Set_User_Data); + + -- ANCHOR(`item_userptr',`Get_User_Data') + procedure Get_User_Data (Itm : in Item; + Data : out User_Access); + -- AKA + pragma Convention (C, Get_User_Data); + +end Terminal_Interface.Curses.Menus.Item_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 new file mode 100644 index 00000000..79a702b0 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-menus-menu_user_data.ads.m4 @@ -0,0 +1,59 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-menus-menu_user_data_s.html')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menus.Menu_User_Data -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.2 $ +------------------------------------------------------------------------------ + +generic + type User is limited private; + type User_Access is access User; +package Terminal_Interface.Curses.Menus.Menu_User_Data is + + -- The binding uses the C level user pointer already for its own + -- internal purposes. So you can´t easily manipulate the user pointer + -- with the low level C routines for this menu without taking care of + -- this special situation. If you want to read or write with C routines + -- the user pointer of this menu, you should get first the low level + -- user pointer. This points to a record, that always has as its first + -- member the Ada95 user pointer for this menu. You should never change + -- the low level user pointer of an Ada created menu. + -- + -- MANPAGE(`menu_userptr.3x') + + -- ANCHOR(`set_menu_userptr',`Set_User_Data') + procedure Set_User_Data (Men : in Menu; + Data : in User_Access); + -- AKA + pragma Convention (C, Set_User_Data); + + -- ANCHOR(`menu_userptr',`Get_User_Data') + procedure Get_User_Data (Men : in Menu; + Data : out User_Access); + -- AKA + pragma Convention (C, Get_User_Data); + +end Terminal_Interface.Curses.Menus.Menu_User_Data; diff --git a/Ada95/gen/terminal_interface-curses-menus.ads.m4 b/Ada95/gen/terminal_interface-curses-menus.ads.m4 new file mode 100644 index 00000000..2c1c42f1 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-menus.ads.m4 @@ -0,0 +1,519 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-menus_s.html')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Menu -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.7 $ +------------------------------------------------------------------------------ +include(`Menu_Base_Defs') +with System; +with Interfaces.C; +with Ada.Characters.Latin_1; + +package Terminal_Interface.Curses.Menus is + +include(`Menu_Linker_Options') + + + Space : Character renames Ada.Characters.Latin_1.Space; + + type Item is private; + type Menu is private; + + --------------------------- + -- Interface constants -- + --------------------------- + Null_Item : constant Item; + Null_Menu : constant Menu; + + subtype Menu_Request_Code is Key_Code + range (Key_Max + 1) .. (Key_Max + 17); + + -- The prefix M_ stands for "Menu Request" + M_Left_Item : constant Menu_Request_Code := Key_Max + 1; + M_Right_Item : constant Menu_Request_Code := Key_Max + 2; + M_Up_Item : constant Menu_Request_Code := Key_Max + 3; + M_Down_Item : constant Menu_Request_Code := Key_Max + 4; + M_ScrollUp_Line : constant Menu_Request_Code := Key_Max + 5; + M_ScrollDown_Line : constant Menu_Request_Code := Key_Max + 6; + M_ScrollDown_Page : constant Menu_Request_Code := Key_Max + 7; + M_ScrollUp_Page : constant Menu_Request_Code := Key_Max + 8; + M_First_Item : constant Menu_Request_Code := Key_Max + 9; + M_Last_Item : constant Menu_Request_Code := Key_Max + 10; + M_Next_Item : constant Menu_Request_Code := Key_Max + 11; + M_Previous_Item : constant Menu_Request_Code := Key_Max + 12; + M_Toggle_Item : constant Menu_Request_Code := Key_Max + 13; + M_Clear_Pattern : constant Menu_Request_Code := Key_Max + 14; + M_Back_Pattern : constant Menu_Request_Code := Key_Max + 15; + M_Next_Match : constant Menu_Request_Code := Key_Max + 16; + M_Previous_Match : constant Menu_Request_Code := Key_Max + 17; + + -- For those who like the old 'C' names for the request codes + REQ_LEFT_ITEM : Menu_Request_Code renames M_Left_Item; + REQ_RIGHT_ITEM : Menu_Request_Code renames M_Right_Item; + REQ_UP_ITEM : Menu_Request_Code renames M_Up_Item; + REQ_DOWN_ITEM : Menu_Request_Code renames M_Down_Item; + REQ_SCR_ULINE : Menu_Request_Code renames M_ScrollUp_Line; + REQ_SCR_DLINE : Menu_Request_Code renames M_ScrollDown_Line; + REQ_SCR_DPAGE : Menu_Request_Code renames M_ScrollDown_Page; + REQ_SCR_UPAGE : Menu_Request_Code renames M_ScrollUp_Page; + REQ_FIRST_ITEM : Menu_Request_Code renames M_First_Item; + REQ_LAST_ITEM : Menu_Request_Code renames M_Last_Item; + REQ_NEXT_ITEM : Menu_Request_Code renames M_Next_Item; + REQ_PREV_ITEM : Menu_Request_Code renames M_Previous_Item; + REQ_TOGGLE_ITEM : Menu_Request_Code renames M_Toggle_Item; + REQ_CLEAR_PATTERN : Menu_Request_Code renames M_Clear_Pattern; + REQ_BACK_PATTERN : Menu_Request_Code renames M_Back_Pattern; + REQ_NEXT_MATCH : Menu_Request_Code renames M_Next_Match; + REQ_PREV_MATCH : Menu_Request_Code renames M_Previous_Match; + + procedure Request_Name (Key : in Menu_Request_Code; + Name : out String); + + ------------------ + -- Exceptions -- + ------------------ + + Menu_Exception : exception; + -- + -- Menu options + -- + +include(`Menu_Opt_Rep') + + Default_Menu_Options : Menu_Option_Set; + -- Initial default options for a menu. + + -- + -- Item options + -- +include(`Item_Rep') + + Default_Item_Options : Item_Option_Set; + -- Initial default options for an item. + + -- + -- Item Array + -- + type Item_Array is array (Positive range <>) of aliased Item; + pragma Convention (C, Item_Array); + + type Item_Array_Access is access all Item_Array; + + -- MANPAGE(`mitem_new.3x') + + -- ANCHOR(`new_item()',`Create') + function Create (Name : String; + Description : String := "") return Item; + -- AKA + + -- ANCHOR(`new_item()',`New_Item') + function New_Item (Name : String; + Description : String := "") return Item + renames Create; + -- AKA + + -- ANCHOR(`free_item()',`Delete') + procedure Delete (Itm : in out Item); + -- AKA + -- Resets Itm to Null_Item + + -- MANPAGE(`mitem_value.3x') + + -- ANCHOR(`set_item_value()',`Set_Value') + procedure Set_Value (Itm : in Item; + Value : in Boolean := True); + -- AKA + + -- ANCHOR(`item_value()',`Value') + function Value (Itm : Item) return Boolean; + -- AKA + + -- MANPAGE(`mitem_visible.3x') + + -- ANCHOR(`item_visible()',`Visible') + function Visible (Itm : Item) return Boolean; + -- AKA + + -- MANPAGE(`mitem_opts.3x') + + -- ANCHOR(`set_item_opts()',`Set_Options') + procedure Set_Options (Itm : in Item; + Options : in Item_Option_Set); + -- AKA + + -- ANCHOR(`item_opts_on()',`Switch_Options') + procedure Switch_Options (Itm : in Item; + Options : in Item_Option_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`item_opts_off()') + + -- ANCHOR(`item_opts()',`Get_Options') + procedure Get_Options (Itm : in Item; + Options : out Item_Option_Set); + -- AKA + + -- ANCHOR(`item_opts()',`Get_Options') + function Get_Options (Itm : Item := Null_Item) return Item_Option_Set; + -- AKA + + -- MANPAGE(`mitem_name.3x') + + -- ANCHOR(`item_name()',`Name') + procedure Name (Itm : in Item; + Name : out String); + -- AKA + + -- ANCHOR(`item_description();',`Description') + procedure Description (Itm : in Item; + Description : out String); + -- AKA + + -- MANPAGE(`mitem_current.3x') + + -- ANCHOR(`set_current_item()',`Set_Current') + procedure Set_Current (Men : in Menu; + Itm : in Item); + -- AKA + + -- ANCHOR(`current_item()',`Current') + function Current (Men : Menu) return Item; + -- AKA + + -- ANCHOR(`set_top_row()',`Set_Top_Row') + procedure Set_Top_Row (Men : in Menu; + Line : in Line_Position); + -- AKA + + -- ANCHOR(`top_row()',`Top_Row') + function Top_Row (Men : Menu) return Line_Position; + -- AKA + + -- ANCHOR(`item_index()',`Get_Index') + function Get_Index (Itm : Item) return Positive; + -- AKA + -- Please note that in this binding we start the numbering of items + -- with 1. So this is number is one more than you get from the low + -- level call. + + -- MANPAGE(`menu_post.3x') + + -- ANCHOR(`post_menu()',`Post') + procedure Post (Men : in Menu; + Post : in Boolean := True); + -- AKA + -- ALIAS(`unpost_menu()') + + -- MANPAGE(`menu_opts.3x') + + -- ANCHOR(`set_menu_opts()',`Set_Options') + procedure Set_Options (Men : in Menu; + Options : in Menu_Option_Set); + -- AKA + + -- ANCHOR(`menu_opts_on()',`Switch_Options') + procedure Switch_Options (Men : in Menu; + Options : in Menu_Option_Set; + On : Boolean := True); + -- AKA + -- ALIAS(`menu_opts_off()') + + -- ANCHOR(`menu_opts()',`Get_Options') + procedure Get_Options (Men : in Menu; + Options : out Menu_Option_Set); + -- AKA + + -- ANCHOR(`menu_opts()',`Get_Options') + function Get_Options (Men : Menu := Null_Menu) return Menu_Option_Set; + -- AKA + + -- MANPAGE(`menu_win.3x') + + -- ANCHOR(`set_menu_win()',`Set_Window') + procedure Set_Window (Men : in Menu; + Win : in Window); + -- AKA + + -- ANCHOR(`menu_win()',`Get_Window') + function Get_Window (Men : Menu) return Window; + -- AKA + + -- ANCHOR(`set_menu_sub()',`Set_Sub_Window') + procedure Set_Sub_Window (Men : in Menu; + Win : in Window); + -- AKA + + -- ANCHOR(`menu_sub()',`Get_Sub_Window') + function Get_Sub_Window (Men : Menu) return Window; + -- AKA + + -- ANCHOR(`scale_menu()',`Scale') + procedure Scale (Men : in Menu; + Lines : out Line_Count; + Columns : out Column_Count); + -- AKA + + -- MANPAGE(`menu_cursor.3x') + + -- ANCHOR(`pos_menu_cursor()',`Position_Cursor') + procedure Position_Cursor (Men : Menu); + -- AKA + + -- MANPAGE(`menu_mark.3x') + + -- ANCHOR(`set_menu_mark()',`Set_Mark') + procedure Set_Mark (Men : in Menu; + Mark : in String); + -- AKA + + -- ANCHOR(`menu_mark()',`Mark') + procedure Mark (Men : in Menu; + Mark : out String); + -- AKA + + -- MANPAGE(`menu_attribs.3x') + + -- ANCHOR(`set_menu_fore()',`Set_Foreground') + procedure Set_Foreground + (Men : in Menu; + Fore : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + + -- ANCHOR(`menu_fore()',`Foreground') + procedure Foreground (Men : in Menu; + Fore : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`menu_fore()',`Foreground') + procedure Foreground (Men : in Menu; + Fore : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + + -- ANCHOR(`set_menu_back()',`Set_Background') + procedure Set_Background + (Men : in Menu; + Back : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + + -- ANCHOR(`menu_back()',`Background') + procedure Background (Men : in Menu; + Back : out Character_Attribute_Set); + -- AKA + -- ANCHOR(`menu_back()',`Background') + + procedure Background (Men : in Menu; + Back : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + + -- ANCHOR(`set_menu_grey()',`Set_Grey') + procedure Set_Grey + (Men : in Menu; + Grey : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + + -- ANCHOR(`menu_grey()',`Grey') + procedure Grey (Men : in Menu; + Grey : out Character_Attribute_Set); + -- AKA + + -- ANCHOR(`menu_grey()',`Grey') + procedure Grey + (Men : in Menu; + Grey : out Character_Attribute_Set; + Color : out Color_Pair); + -- AKA + + -- ANCHOR(`set_menu_pad()',`Set_Pad_Character') + procedure Set_Pad_Character (Men : in Menu; + Pad : in Character := Space); + -- AKA + + -- ANCHOR(`menu_pad()',`Pad_Character') + procedure Pad_Character (Men : in Menu; + Pad : out Character); + -- AKA + + -- MANPAGE(`menu_spacing.3x') + + -- ANCHOR(`set_menu_spacing()',`Set_Spacing') + procedure Set_Spacing (Men : in Menu; + Descr : in Column_Position := 0; + Row : in Line_Position := 0; + Col : in Column_Position := 0); + -- AKA + + -- ANCHOR(`menu_spacing()',`Spacing') + procedure Spacing (Men : in Menu; + Descr : out Column_Position; + Row : out Line_Position; + Col : out Column_Position); + -- AKA + + -- MANPAGE(`menu_pattern.3x') + + -- ANCHOR(`set_menu_pattern()',`Set_Pattern') + function Set_Pattern (Men : Menu; + Text : String) return Boolean; + -- AKA + -- Return TRUE if the pattern matches, FALSE otherwise + + -- ANCHOR(`menu_pattern()',`Pattern') + procedure Pattern (Men : in Menu; + Text : out String); + -- AKA + + -- MANPAGE(`menu_format.3x') + + -- ANCHOR(`set_menu_format()',`Set_Format') + procedure Set_Format (Men : in Menu; + Lines : in Line_Count; + Columns : in Column_Count); + -- AKA + + -- ANCHOR(`menu_format()',`Format') + procedure Format (Men : in Menu; + Lines : out Line_Count; + Columns : out Column_Count); + -- AKA + + -- MANPAGE(`menu_hook.3x') + + type Menu_Hook_Function is access procedure (Men : in Menu); + pragma Convention (C, Menu_Hook_Function); + + -- ANCHOR(`set_item_init()',`Set_Item_Init_Hook') + procedure Set_Item_Init_Hook (Men : in Menu; + Proc : in Menu_Hook_Function); + -- AKA + + -- ANCHOR(`set_item_term()',`Set_Item_Term_Hook') + procedure Set_Item_Term_Hook (Men : in Menu; + Proc : in Menu_Hook_Function); + -- AKA + + -- ANCHOR(`set_menu_init()',`Set_Menu_Init_Hook') + procedure Set_Menu_Init_Hook (Men : in Menu; + Proc : in Menu_Hook_Function); + -- AKA + + -- ANCHOR(`set_menu_term()',`Set_Menu_Term_Hook') + procedure Set_Menu_Term_Hook (Men : in Menu; + Proc : in Menu_Hook_Function); + -- AKA + + -- ANCHOR(`item_init()',`Get_Item_Init_Hook') + function Get_Item_Init_Hook (Men : Menu) return Menu_Hook_Function; + -- AKA + + -- ANCHOR(`item_term()',`Get_Item_Term_Hook') + function Get_Item_Term_Hook (Men : Menu) return Menu_Hook_Function; + -- AKA + + -- ANCHOR(`menu_init()',`Get_Menu_Init_Hook') + function Get_Menu_Init_Hook (Men : Menu) return Menu_Hook_Function; + -- AKA + + -- ANCHOR(`menu_term()',`Get_Menu_Term_Hook') + function Get_Menu_Term_Hook (Men : Menu) return Menu_Hook_Function; + -- AKA + + -- MANPAGE(`menu_items.3x') + + -- ANCHOR(`set_menu_items()',`Redefine') + procedure Redefine (Men : in Menu; + Items : in Item_Array); + -- AKA + -- With a bit more comfort. You don´t need to terminate the Item_Array + -- with a null entry. This is handled internally in the binding. + + procedure Set_Items (Men : in Menu; + Items : in Item_Array) renames Redefine; + + -- ANCHOR(`menu_items()',`Items') + function Items (Men : Menu) return Item_Array_Access; + -- AKA + + -- ANCHOR(`item_count()',`Item_Count') + function Item_Count (Men : Menu) return Natural; + -- AKA + + -- MANPAGE(`menu_new.3x') + + -- ANCHOR(`new_menu()',`Create') + function Create (Items : Item_Array) return Menu; + -- AKA + + function New_Menu (Items : Item_Array) return Menu renames Create; + + -- ANCHOR(`free_menu()',`Delete') + procedure Delete (Men : in out Menu); + -- AKA + -- Reset Men to Null_Menu + + -- MANPAGE(`menu_new.3x') + + type Driver_Result is (Menu_Ok, + Request_Denied, + Unknown_Request, + No_Match); + + -- ANCHOR(`menu_driver()',`Driver') + function Driver (Men : Menu; + Key : Key_Code) return Driver_Result; + -- AKA + +------------------------------------------------------------------------------- +private + type Item is new System.Address; + type Menu is new System.Address; + + Null_Item : constant Item := Item (System.Null_Address); + Null_Menu : constant Menu := Menu (System.Null_Address); + + -- This binding uses the original user pointer mechanism of a menu to store + -- specific informations about a menu. This wrapper record carries this + -- specifics and contains a field to maintain a new user pointer. Please + -- note that you must take this into account if you wan't to use the user + -- pointer mechanism of a menu created with this binding in low-level C + -- routines. + type Ada_User_Wrapper is + record + U : System.Address; + I : Item_Array_Access; + end record; + pragma Convention (C, Ada_User_Wrapper); + type Ada_User_Wrapper_Access is access all Ada_User_Wrapper; + pragma Controlled (Ada_User_Wrapper_Access); + + Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER; + -- This constant may be different on your system. + +end Terminal_Interface.Curses.Menus; diff --git a/Ada95/gen/terminal_interface-curses-mouse.ads.m4 b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 new file mode 100644 index 00000000..f4a5928f --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-mouse.ads.m4 @@ -0,0 +1,125 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-mouse_s.html')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Mouse -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.6 $ +------------------------------------------------------------------------------ +include(`Mouse_Base_Defs') +with System; + +package Terminal_Interface.Curses.Mouse is + + -- MANPAGE(`curs_mouse.3x') + -- Please note, that in ncurses-1.9.9e documentation mouse support + -- is still marked as experimental. So also this binding will change + -- if the ncurses methods change. + -- + type Event_Mask is private; + No_Events : constant Event_Mask; + All_Events : constant Event_Mask; + + type Mouse_Button is (Left, -- aka: Button 1 + Middle, -- aka: Button 2 + Right, -- aka: Button 3 + Button4, -- aka: Button 4 + Control, -- Control Key + Shift, -- Shift Key + Alt); -- ALT Key + + type Button_State is (Released, + Pressed, + Clicked, + Double_Clicked, + Triple_Clicked); + + type Mouse_Event is private; + + -- MANPAGE(`curs_mouse.3x') + + procedure Register_Reportable_Event + (B : in Mouse_Button; + S : in Button_State; + Mask : in out Event_Mask); + -- Stores the event described by the button and the state in the mask. + -- Before you call this the first time, you should init the mask + -- with the Empty_Mask constant + + -- ANCHOR(`mousemask()',`Start_Mouse') + function Start_Mouse (Mask : Event_Mask := All_Events) + return Event_Mask; + -- AKA + + procedure End_Mouse; + pragma Import (C, End_Mouse, "_nc_ada_unregister_mouse"); + -- Terminates the mouse + + -- ANCHOR(`getmouse()',`Get_Mouse') + function Get_Mouse return Mouse_Event; + -- AKA + + procedure Get_Event (Event : in Mouse_Event; + Y : out Line_Position; + X : out Column_Position; + Button : out Mouse_Button; + State : out Button_State); + -- !!! Warning: X and Y are screen coordinates. Due to ripped of lines they + -- may not be identical to window coordinates. + + -- ANCHOR(`ungetmouse()',`Unget_Mouse') + procedure Unget_Mouse (Event : in Mouse_Event); + -- AKA + + -- ANCHOR(`wenclose()',`Enclosed_In_Window') + function Enclosed_In_Window (Win : Window := Standard_Window; + Event : Mouse_Event) return Boolean; + -- AKA + -- But : use event instead of screen coordinates. + + -- ANCHOR(`mouseinterval()',`Mouse_Interval') + function Mouse_Interval (Msec : Natural := 200) return Natural; + -- AKA + +private + type Event_Mask is new Interfaces.C.int; + No_Events : constant Event_Mask := 0; + All_Events : constant Event_Mask := -1; + + type Mouse_Event is + record + Id : Integer range Integer (Interfaces.C.short'First) .. + Integer (Interfaces.C.Short'Last); + X, Y, Z : Integer range Integer (Interfaces.C.int'First) .. + Integer (Interfaces.C.int'Last); + Bstate : Event_Mask; + end record; + pragma Convention (C, Mouse_Event); + pragma Pack (Mouse_Event); + +include(`Mouse_Event_Rep') + Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER; + -- This constant may be different on your system. + +end Terminal_Interface.Curses.Mouse; diff --git a/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 new file mode 100644 index 00000000..6d68cc23 --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-panels-user_data.ads.m4 @@ -0,0 +1,50 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-panels-user_data_s.html')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Panels.User_Data -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.2 $ +------------------------------------------------------------------------------ + +generic + type User is limited private; + type User_Access is access all User; +package Terminal_Interface.Curses.Panels.User_Data is + + -- MANPAGE(`panel.3x') + + -- ANCHOR(`set_panel_userptr',`Set_User_Data') + procedure Set_User_Data (Pan : in Panel; + Data : in User_Access); + -- AKA + pragma Convention (C, Set_User_Data); + + -- ANCHOR(`panel_userptr',`Get_User_Data') + procedure Get_User_Data (Pan : in Panel; + Data : out User_Access); + -- AKA + pragma Convention (C, Get_User_Data); + +end Terminal_Interface.Curses.Panels.User_Data; diff --git a/Ada95/gen/terminal_interface-curses-panels.ads.m4 b/Ada95/gen/terminal_interface-curses-panels.ads.m4 new file mode 100644 index 00000000..c2503b1a --- /dev/null +++ b/Ada95/gen/terminal_interface-curses-panels.ads.m4 @@ -0,0 +1,120 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses-panels_s.html')dnl +include(M4MACRO)dnl +------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses.Panels -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.2 $ +------------------------------------------------------------------------------ +with System; + +package Terminal_Interface.Curses.Panels is + +include(`Panel_Linker_Options') + + type Panel is private; + + --------------------------- + -- Interface constants -- + --------------------------- + Null_Panel : constant Panel; + + ------------------- + -- Exceptions -- + ------------------- + + Panel_Exception : exception; + + -- MANPAGE(`panel.3x') + + -- ANCHOR(`new_panel()',`Create') + function Create (Win : Window) return Panel; + -- AKA + + -- ANCHOR(`new_panel()',`New_Panel') + function New_Panel (Win : Window) return Panel renames Create; + -- AKA + + -- ANCHOR(`bottom_panel()',`Bottom') + procedure Bottom (Pan : in Panel); + -- AKA + + -- ANCHOR(`top_panel()',`Top') + procedure Top (Pan : in Panel); + -- AKA + + -- ANCHOR(`show_panel()',`Show') + procedure Show (Pan : in Panel); + -- AKA + + -- ANCHOR(`update_panels()',`Update_Panels') + procedure Update_Panels; + -- AKA + pragma Import (C, Update_Panels, "update_panels"); + + -- ANCHOR(`hide_panel()',`Hide') + procedure Hide (Pan : in Panel); + -- AKA + + -- ANCHOR(`panel_window()',`Get_Window') + function Get_Window (Pan : Panel) return Window; + -- AKA + + -- ANCHOR(`panel_window()',`Panel_Window') + function Panel_Window (Pan : Panel) return Window renames Get_Window; + + -- ANCHOR(`replace_panel()',`Replace') + procedure Replace (Pan : in Panel; + Win : in Window); + -- AKA + + -- ANCHOR(`move_panel()',`Move') + procedure Move (Pan : in Panel; + Line : in Line_Position; + Column : in Column_Position); + -- AKA + + -- ANCHOR(`panel_hidden()',`Is_Hidden') + function Is_Hidden (Pan : Panel) return Boolean; + -- AKA + + -- ANCHOR(`panel_above()',`Above') + function Above (Pan : Panel) return Panel; + -- AKA + pragma Import (C, Above, "panel_above"); + + -- ANCHOR(`panel_below()',`Below') + function Below (Pan : Panel) return Panel; + -- AKA + pragma Import (C, Below, "panel_below"); + + -- ANCHOR(`del_panel()',`Delete') + procedure Delete (Pan : in out Panel); + -- AKA + + private + type Panel is new System.Address; + Null_Panel : constant Panel := Panel (System.Null_Address); + +end Terminal_Interface.Curses.Panels; diff --git a/Ada95/gen/terminal_interface-curses.ads.m4 b/Ada95/gen/terminal_interface-curses.ads.m4 new file mode 100644 index 00000000..e4f7ce9d --- /dev/null +++ b/Ada95/gen/terminal_interface-curses.ads.m4 @@ -0,0 +1,1187 @@ +-- -*- ada -*- +define(`HTMLNAME',`terminal_interface-curses_s.html')dnl +include(M4MACRO)------------------------------------------------------------------------------ +-- -- +-- GNAT ncurses Binding -- +-- -- +-- Terminal_Interface.Curses -- +-- -- +-- S P E C -- +-- -- +-- Version 00.92 -- +-- -- +-- The ncurses Ada95 binding is copyrighted 1996 by -- +-- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de -- +-- -- +-- Permission is hereby granted to reproduce and distribute this -- +-- binding by any means and for any fee, whether alone or as part -- +-- of a larger distribution, in source or in binary form, PROVIDED -- +-- this notice is included with any such distribution, and is not -- +-- removed from any of its header files. Mention of ncurses and the -- +-- author of this binding in any applications linked with it is -- +-- highly appreciated. -- +-- -- +-- This binding comes AS IS with no warranty, implied or expressed. -- +------------------------------------------------------------------------------ +-- Version Control: +-- $Revision: 1.7 $ +------------------------------------------------------------------------------ +include(`Base_Defs') +with System; +with Interfaces.C; -- We need this for some assertions. + +package Terminal_Interface.Curses is + +include(`Linker_Options') + type Window is private; + Null_Window : constant Window; + + type Line_Position is new Natural; -- line coordinate + type Column_Position is new Natural; -- column coordinate + + subtype Line_Count is Line_Position range 1 .. Line_Position'Last; + -- Type to count lines. We do not allow null windows, so must be positive + subtype Column_Count is Column_Position range 1 .. Column_Position'Last; + -- Type to count columns. We do not allow null windows, so must be positive + + type Key_Code is new Natural; + -- That is anything including real characters, special keys and logical + -- request codes. + + subtype Real_Key_Code is Key_Code range 0 .. M4_KEY_MAX; + -- This are the codes that potentially represent a real keystroke. + -- Not all codes may be possible on a specific terminal. To check the + -- availability of a special key, the Has_Key function is provided. + + subtype Special_Key_Code is Real_Key_Code + range M4_SPECIAL_FIRST .. Real_Key_Code'Last; + -- Type for a function- or special key number + + subtype Normal_Key_Code is Real_Key_Code range + Character'Pos (Character'First) .. Character'Pos (Character'Last); + -- This are the codes for regular (incl. non-graphical) characters. + + -- Constants for function- and special keys + -- + Key_None : constant Special_Key_Code := M4_SPECIAL_FIRST; +include(`Key_Definitions') + Key_Max : constant Special_Key_Code + := Special_Key_Code'Last; + + subtype User_Key_Code is Key_Code + range (Key_Max + 129) .. Key_Code'Last; + -- This is reserved for user defined key codes. The range between Key_Max + -- and the first user code is reserved for subsystems like menu and forms. + + -- For those who like to use the original key names we produce them were + -- they differ from the original. Please note that they may differ in + -- lower/upper case. +include(`Old_Keys') + +------------------------------------------------------------------------------ + + type Color_Number is range 0 .. 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 + -- (potentially) definable colors. Some of those indices are + -- predefined (see below), although they may not really exist. + +include(`Color_Defs') + type RGB_Value is range 0 .. Integer (Interfaces.C.Short'Last); + for RGB_Value'Size use Interfaces.C.short'Size; + -- Some system may allow to redefine a color by setting RGB values. + + type Color_Pair is range 0 .. 255; + for Color_Pair'Size use 8; + subtype Redefinable_Color_Pair is Color_Pair range 1 .. 255; + -- (n)curses reserves 1 Byte for the color-pair number. Color Pair 0 + -- is fixed (Black & White). A color pair is simply a combination of + -- two colors described by Color_Numbers, one for the foreground and + -- the other for the background + +include(`Character_Attribute_Set_Rep') + -- (n)curses uses half of an integer for attributes. + + Normal_Video : constant Character_Attribute_Set := (others => False); + + type Attributed_Character is + record + Attr : Character_Attribute_Set := Normal_Video; + Color : Color_Pair := 0; + Ch : Character := ' '; + end record; + pragma Convention (C, Attributed_Character); + -- This is the counterpart for the chtype in C. + +include(`AC_Rep') + Default_Character : constant Attributed_Character + := (Ch => Character'First, + Color => Color_Pair'First, + Attr => Normal_Video); + + type Attributed_String is array (Positive range <>) of Attributed_Character; + pragma Pack (Attributed_String); + -- In this binding we allow strings of attributed characters. + + ------------------ + -- Exceptions -- + ------------------ + Curses_Exception : exception; + + -- Those exceptions are raised by the ETI (Extended Terminal Interface) + -- subpackets for Menu and Forms handling. + -- + Eti_System_Error : exception; + Eti_Bad_Argument : exception; + Eti_Posted : exception; + Eti_Connected : exception; + Eti_Bad_State : exception; + Eti_No_Room : exception; + Eti_Not_Posted : exception; + Eti_Unknown_Command : exception; + Eti_No_Match : exception; + Eti_Not_Selectable : exception; + Eti_Not_Connected : exception; + Eti_Request_Denied : exception; + Eti_Invalid_Field : exception; + Eti_Current : exception; + + -------------------------------------------------------------------------- + -- External C variables + -- Conceptually even in C this are kind of constants, but they are + -- initialized and sometimes changed by the library routines at runtime + -- depending on the type of terminal. I believe the best way to model + -- this is to use functions. + -------------------------------------------------------------------------- + + function Lines return Line_Count; + pragma Inline (Lines); + + function Columns return Column_Count; + pragma Inline (Columns); + + function Tab_Size return Natural; + pragma Inline (Tab_Size); + + function Number_Of_Colors return Natural; + pragma Inline (Number_Of_Colors); + + function Number_Of_Color_Pairs return Natural; + pragma Inline (Number_Of_Color_Pairs); + + ACS_Map : array (Character'Val (0) .. Character'Val (127)) of + Attributed_Character; + pragma Import (C, ACS_Map, "acs_map"); + -- + -- + -- Constants for several symbols from the Alternate Character Set + -- You must use this constants as indices into the ACS_Map array + -- to get the corresponding attributed character at runtime. + -- +include(`ACS_Map') + + -- MANPAGE(`curs_initscr.3x') + -- | Not implemented: newterm, set_term, delscreen + + -- ANCHOR(`stdscr',`Standard_Window') + function Standard_Window return Window; + -- AKA + pragma Inline (Standard_Window); + + -- ANCHOR(`initscr()',`Init_Screen') + procedure Init_Screen; + + -- ANCHOR(`initscr()',`Init_Windows') + procedure Init_Windows renames Init_Screen; + -- AKA + + -- ANCHOR(`endwin()',`End_Windows') + procedure End_Windows; + -- AKA + procedure End_Screen renames End_Windows; + + -- ANCHOR(`isendwin()',`Is_End_Window') + function Is_End_Window return Boolean; + -- AKA + + -- MANPAGE(`curs_move.3x') + + -- ANCHOR(`wmove()',`Move_Cursor') + procedure Move_Cursor (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position); + -- AKA + + -- MANPAGE(`curs_addch.3x') + + -- ANCHOR(`waddch()',`Add') + procedure Add (Win : in Window := Standard_Window; + Ch : in Attributed_Character); + -- AKA + + procedure Add (Win : in Window := Standard_Window; + Ch : in Character); + -- Add a single character at the current logical cursor position to + -- the window. Use the current windows attributes. + + -- ANCHOR(`mvwaddch()',`Add') + procedure Add + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in Attributed_Character); + -- AKA + + procedure Add + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in Character); + -- Move to the position and add a single character into the window + + -- ANCHOR(`wechochar()',`Add_With_Immediate_Echo') + procedure Add_With_Immediate_Echo + (Win : in Window := Standard_Window; + Ch : in Attributed_Character); + -- AKA + + procedure Add_With_Immediate_Echo + (Win : in Window := Standard_Window; + Ch : in Character); + -- Add a character and do an immediate resfresh of the screen. + + -- MANPAGE(`curs_window.3x') + + -- ANCHOR(`newwin()',`Create') + function Create + (Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window; + -- AKA + + function New_Window + (Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window + renames Create; + + -- ANCHOR(`delwin()',`Delete') + procedure Delete (Win : in out Window); + -- AKA + -- Reset Win to Null_Window + + -- ANCHOR(`subwin()',`Sub_Window') + function Sub_Window + (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window; + -- AKA + + -- ANCHOR(`derwin()',`Derived_Window') + function Derived_Window + (Win : Window := Standard_Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window; + -- AKA + + -- ANCHOR(`dupwin()',`Duplicate') + function Duplicate (Win : Window) return Window; + -- AKA + + -- ANCHOR(`mvwin()',`Move_Window') + procedure Move_Window (Win : in Window; + Line : in Line_Position; + Column : in Column_Position); + -- AKA + + -- ANCHOR(`mvderwin()',`Move_Derived_Window') + procedure Move_Derived_Window (Win : in Window; + Line : in Line_Position; + Column : in Column_Position); + -- AKA + + -- ANCHOR(`wsyncup()',`Synchronize_Upwards') + procedure Synchronize_Upwards (Win : in Window); + -- AKA + pragma Import (C, Synchronize_Upwards, "wsyncup"); + + -- ANCHOR(`wsyncdown()',`Synchronize_Downwards') + procedure Synchronize_Downwards (Win : in Window); + -- AKA + pragma Import (C, Synchronize_Downwards, "wsyncdown"); + + -- ANCHOR(`syncok()',`Set_Synch_Mode') + procedure Set_Synch_Mode (Win : in Window := Standard_Window; + Mode : in Boolean := False); + -- AKA + + -- MANPAGE(`curs_addstr.3x') + + -- ANCHOR(`waddnstr()',`Add') + procedure Add (Win : in Window := Standard_Window; + Str : in String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`waddstr()') + + -- ANCHOR(`mvwaddnstr()',`Add') + procedure Add (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`mvwaddstr()') + + -- MANPAGE(`curs_addchstr.3x') + + -- ANCHOR(`waddchnstr()',`Add') + procedure Add (Win : in Window := Standard_Window; + Str : in Attributed_String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`waddchstr()') + + -- ANCHOR(`mvwaddchnstr()',`Add') + procedure Add (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in Attributed_String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`mvwaddchstr()') + + -- MANPAGE(`curs_border.3x') + + -- ANCHOR(`wborder()',`Border') + procedure Border + (Win : in Window := Standard_Window; + Left_Side_Symbol : in Attributed_Character := Default_Character; + Right_Side_Symbol : in Attributed_Character := Default_Character; + Top_Side_Symbol : in Attributed_Character := Default_Character; + Bottom_Side_Symbol : in Attributed_Character := Default_Character; + Upper_Left_Corner_Symbol : in Attributed_Character := Default_Character; + Upper_Right_Corner_Symbol : in Attributed_Character := Default_Character; + Lower_Left_Corner_Symbol : in Attributed_Character := Default_Character; + Lower_Right_Corner_Symbol : in Attributed_Character := Default_Character + ); + -- AKA + + -- ANCHOR(`box()',`Box') + procedure Box + (Win : in Window := Standard_Window; + Vertical_Symbol : in Attributed_Character := Default_Character; + Horizontal_Symbol : in Attributed_Character := Default_Character); + -- AKA + + -- ANCHOR(`whline()',`Horizontal_Line') + procedure Horizontal_Line + (Win : in Window := Standard_Window; + Line_Size : in Natural; + Line_Symbol : in Attributed_Character := Default_Character); + -- AKA + + -- ANCHOR(`wvline()',`Vertical_Line') + procedure Vertical_Line + (Win : in Window := Standard_Window; + Line_Size : in Natural; + Line_Symbol : in Attributed_Character := Default_Character); + -- AKA + + -- MANPAGE(`curs_getch.3x') + + -- ANCHOR(`wgetch()',`Get_Keystroke') + function Get_Keystroke (Win : Window := Standard_Window) + return Real_Key_Code; + -- AKA + -- 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 + -- returned keycode is Key_None. + + -- ANCHOR(`ungetch()',`Undo_Keystroke') + procedure Undo_Keystroke (Key : in Real_Key_Code); + -- AKA + + -- ANCHOR(`has_key()',`Has_Key') + function Has_Key (Key : Special_Key_Code) return Boolean; + -- AKA + -- | + -- | Some helper functions + -- | + function Is_Function_Key (Key : Special_Key_Code) return Boolean; + -- Return True if the Key is a function key (i.e. one of F0 .. F63) + + subtype Function_Key_Number is Integer range 0 .. 63; + -- (n)curses allows for 64 function keys. + + function Function_Key (Key : Real_Key_Code) return Function_Key_Number; + -- Return the number of the function key. If the code is not a + -- function key, a CONSTRAINT_ERROR will be raised. + + function Function_Key_Code (Key : Function_Key_Number) return Real_Key_Code; + -- Return the key code for a given functionkey number. + + -- MANPAGE(`curs_attr.3x') + + -- 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. + -- AKA + -- ALIAS(`wattroff()') + + -- ANCHOR(`wattrset()',`Set_Character_Attributes') + procedure Set_Character_Attributes + (Win : in Window := Standard_Window; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + + -- ANCHOR(`wattr_get()',`Get_Character_Attribute') + function Get_Character_Attribute + (Win : in Window := Standard_Window) return Character_Attribute_Set; + -- AKA + + -- ANCHOR(`wattr_get()',`Get_Character_Attribute') + function Get_Character_Attribute + (Win : in Window := Standard_Window) return Color_Pair; + -- AKA + + -- ANCHOR(`wchgat()',`Change_Attributes') + procedure Change_Attributes + (Win : in Window := Standard_Window; + Count : in Integer := -1; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + + -- ANCHOR(`mvwchgat()',`Change_Attributes') + procedure Change_Attributes + (Win : in Window := Standard_Window; + Line : in Line_Position := Line_Position'First; + Column : in Column_Position := Column_Position'First; + Count : in Integer := -1; + Attr : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + + -- MANPAGE(`curs_beep.3x') + + -- ANCHOR(`beep()',`Beep') + procedure Beep; + -- AKA + + -- ANCHOR(`flash()',`Flash_Screen') + procedure Flash_Screen; + -- AKA + + -- MANPAGE(`curs_inopts.3x') + + -- | Not implemented : typeahead + -- + -- ANCHOR(`cbreak()',`Set_Cbreak_Mode') + procedure Set_Cbreak_Mode (SwitchOn : in Boolean := True); + -- AKA + -- ALIAS(`nocbreak()') + + -- ANCHOR(`raw()',`Set_Raw_Mode') + procedure Set_Raw_Mode (SwitchOn : in Boolean := True); + -- AKA + -- ALIAS(`noraw()') + + -- ANCHOR(`echo()',`Set_Echo_Mode') + procedure Set_Echo_Mode (SwitchOn : in Boolean := True); + -- AKA + -- ALIAS(`noecho()') + + -- ANCHOR(`meta()',`Set_Meta_Mode') + procedure Set_Meta_Mode (Win : in Window := Standard_Window; + SwitchOn : in Boolean := True); + -- AKA + + -- ANCHOR(`keypad()',`Set_KeyPad_Mode') + procedure Set_KeyPad_Mode (Win : in Window := Standard_Window; + SwitchOn : in Boolean := True); + -- AKA + + type Half_Delay_Amount is range 1 .. 255; + + -- ANCHOR(`halfdelay()',`Half_Delay') + procedure Half_Delay (Amount : in Half_Delay_Amount); + -- AKA + + -- ANCHOR(`intrflush()',`Set_Flush_On_Interrupt_Mode') + procedure Set_Flush_On_Interrupt_Mode + (Win : in Window := Standard_Window; + Mode : in Boolean := True); + -- AKA + + -- ANCHOR(`qiflush()',`Set_Queue_Interrupt_Mode') + procedure Set_Queue_Interrupt_Mode + (Win : in Window := Standard_Window; + Flush : in Boolean := True); + -- AKA + -- ALIAS(`noqiflush()') + + -- ANCHOR(`nodelay()',`Set_NoDelay_Mode') + procedure Set_NoDelay_Mode + (Win : in Window := Standard_Window; + Mode : in Boolean := False); + -- AKA + + type Timeout_Mode is (Blocking, Non_Blocking, Delayed); + + -- ANCHOR(`wtimeout()',`Set_Timeout_Mode') + procedure Set_Timeout_Mode (Win : in Window := Standard_Window; + Mode : in Timeout_Mode; + Amount : in Natural); -- in Miliseconds + -- AKA + -- 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 + -- evaluated. + + -- ANCHOR(`notimeout()',`Set_Escape_Time_Mode') + procedure Set_Escape_Timer_Mode + (Win : in Window := Standard_Window; + Timer_Off : in Boolean := False); + -- AKA + + -- MANPAGE(`curs_outopts.3x') + + -- ANCHOR(`nl()',`Set_NL_Mode') + procedure Set_NL_Mode (SwitchOn : in Boolean := True); + -- AKA + -- ALIAS(`nonl()') + + -- ANCHOR(`clearok()',`Clear_On_Next_Update') + procedure Clear_On_Next_Update + (Win : in Window := Standard_Window; + Do_Clear : in Boolean := True); + -- AKA + + -- ANCHOR(`idlok()',`Use_Insert_Delete_Line') + procedure Use_Insert_Delete_Line + (Win : in Window := Standard_Window; + Do_Idl : in Boolean := True); + -- AKA + + -- ANCHOR(`idcok()',`Use_Insert_Delete_Character') + procedure Use_Insert_Delete_Character + (Win : in Window := Standard_Window; + Do_Idc : in Boolean := True); + -- AKA + + -- ANCHOR(`leaveok()',`Leave_Cursor_After_Update') + procedure Leave_Cursor_After_Update + (Win : in Window := Standard_Window; + Do_Leave : in Boolean := True); + -- AKA + + -- ANCHOR(`immedok()',`Immediate_Update_Mode') + procedure Immediate_Update_Mode + (Win : in Window := Standard_Window; + Mode : in Boolean := False); + -- AKA + + -- ANCHOR(`scrollok()',`Allow_Scrolling') + procedure Allow_Scrolling + (Win : in Window := Standard_Window; + Mode : in Boolean := False); + -- AKA + + function Scrolling_Allowed (Win : Window := Standard_Window) return Boolean; + -- There is no such function in the C interface. + + -- ANCHOR(`wsetscrreg()',`Set_Scroll_Region') + procedure Set_Scroll_Region + (Win : in Window := Standard_Window; + Top_Line : in Line_Position; + Bottom_Line : in Line_Position); + -- AKA + + -- MANPAGE(`curs_refresh.3x') + + -- ANCHOR(`doupdate()',`Update_Screen') + procedure Update_Screen; + -- AKA + + -- ANCHOR(`wrefresh()',`Refresh') + procedure Refresh (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`wnoutrefresh()',`Refresh_Without_Update') + procedure Refresh_Without_Update + (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`redrawwin()',`Redraw') + procedure Redraw (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`wredrawln()',`Redraw') + procedure Redraw (Win : in Window := Standard_Window; + Begin_Line : in Line_Position; + Line_Count : in Positive); + -- AKA + + -- MANPAGE(`curs_clear.3x') + + -- ANCHOR(`werase()',`Erase') + procedure Erase (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`wclear()',`Clear') + procedure Clear + (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`wclrtobot()',`Clear_To_End_Of_Screen') + procedure Clear_To_End_Of_Screen + (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`wclrtoeol()',`Clear_To_End_Of_Line') + procedure Clear_To_End_Of_Line + (Win : in Window := Standard_Window); + -- AKA + + -- MANPAGE(`curs_bkgd.3x') + + -- ANCHOR(`wbkgdset()',`Set_Background') + procedure Set_Background + (Win : in Window := Standard_Window; + Ch : in Attributed_Character); + -- AKA + + -- ANCHOR(`wbkgd()',`Change_Background') + procedure Change_Background + (Win : in Window := Standard_Window; + Ch : in Attributed_Character); + -- AKA + + -- ANCHOR(`wbkgdget()',`Get_Background') + function Get_Background (Win : Window := Standard_Window) + return Attributed_Character; + -- AKA + + -- MANPAGE(`curs_touch.3x') + + -- ANCHOR(`touchwin()',`Touch') + procedure Touch (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`untouchwin()',`Untouch') + procedure Untouch (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`touchline()',`Touch') + procedure Touch (Win : in Window := Standard_Window; + Start : in Line_Position; + Count : in Positive); + -- AKA + + -- ANCHOR(`wtouchln()',`Change_Line_Status') + procedure Change_Lines_Status (Win : in Window := Standard_Window; + Start : in Line_Position; + Count : in Positive; + State : in Boolean); + -- AKA + + -- ANCHOR(`is_linetouched()',`Is_Touched') + function Is_Touched (Win : Window := Standard_Window; + Line : Line_Position) return Boolean; + -- AKA + + -- ANCHOR(`is_wintouched()',`Is_Touched') + function Is_Touched (Win : Window := Standard_Window) return Boolean; + -- AKA + + -- MANPAGE(`curs_overlay.3x') + + -- ANCHOR(`copywin()',`Copy') + procedure Copy + (Source_Window : in Window; + Destination_Window : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in Column_Position; + Non_Destructive_Mode : in Boolean := True); + -- AKA + + -- ANCHOR(`overwrite()',`Overwrite') + procedure Overwrite (Source_Window : in Window; + Destination_Window : in Window); + -- AKA + + -- ANCHOR(`overlay()',`Overlay') + procedure Overlay (Source_Window : in Window; + Destination_Window : in Window); + -- AKA + + -- MANPAGE(`curs_deleteln.3x') + + -- ANCHOR(`winsdelln()',`Insert_Delete_Lines') + procedure Insert_Delete_Lines + (Win : in Window := Standard_Window; + Lines : in Integer := 1); -- default is to insert one line above + -- AKA + + -- ANCHOR(`wdeleteln()',`Delete_Line') + procedure Delete_Line (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`winsertln()',`Insert_Line') + procedure Insert_Line (Win : in Window := Standard_Window); + -- AKA + + -- MANPAGE(`curs_getyx.3x') + + -- ANCHOR(`getmaxyx()',`Get_Size') + procedure Get_Size + (Win : in Window := Standard_Window; + Number_Of_Lines : out Line_Count; + Number_Of_Columns : out Column_Count); + -- AKA + + -- ANCHOR(`getbegyx()',`Get_Window_Position') + procedure Get_Window_Position + (Win : in Window := Standard_Window; + Top_Left_Line : out Line_Position; + Top_Left_Column : out Column_Position); + -- AKA + + -- ANCHOR(`getyx()',`Get_Cursor_Position') + procedure Get_Cursor_Position + (Win : in Window := Standard_Window; + Line : out Line_Position; + Column : out Column_Position); + -- AKA + + -- ANCHOR(`getparyx()',`Get_Origin_Relative_To_Parent') + procedure Get_Origin_Relative_To_Parent + (Win : in Window; + Top_Left_Line : out Line_Position; + Top_Left_Column : out Column_Position; + Is_Not_A_Subwindow : out Boolean); + -- AKA + -- Instead of placing -1 in the coordinates as return, we use a boolean + -- to return the info that the window has no parent. + + -- MANPAGE(`curs_pad.3x') + + -- ANCHOR(`newpad()',`New_Pad') + function New_Pad (Lines : Line_Count; + Columns : Column_Count) return Window; + -- AKA + + -- ANCHOR(`subpad()',`Sub_Pad') + function Sub_Pad + (Pad : Window; + Number_Of_Lines : Line_Count; + Number_Of_Columns : Column_Count; + First_Line_Position : Line_Position; + First_Column_Position : Column_Position) return Window; + -- AKA + + -- ANCHOR(`prefresh()',`Refresh') + procedure Refresh + (Pad : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in Column_Position); + -- AKA + + -- ANCHOR(`pnoutrefresh()',`Refresh_Without_Update') + procedure Refresh_Without_Update + (Pad : in Window; + Source_Top_Row : in Line_Position; + Source_Left_Column : in Column_Position; + Destination_Top_Row : in Line_Position; + Destination_Left_Column : in Column_Position; + Destination_Bottom_Row : in Line_Position; + Destination_Right_Column : in Column_Position); + -- AKA + + -- ANCHOR(`pechochar()',`Add_Character_To_Pad_And_Echo_It') + procedure Add_Character_To_Pad_And_Echo_It + (Pad : in Window; + Ch : in Attributed_Character); + -- AKA + + procedure Add_Character_To_Pad_And_Echo_It + (Pad : in Window; + Ch : in Character); + + -- MANPAGE(`curs_scroll.3x') + + -- ANCHOR(`wscrl()',`Scroll') + procedure Scroll (Win : in Window := Standard_Window; + Amount : in Integer := 1); + -- AKA + + -- MANPAGE(`curs_delch.3x') + + -- ANCHOR(`wdelch()',`Delete_Character') + procedure Delete_Character (Win : in Window := Standard_Window); + -- AKA + + -- ANCHOR(`mvwdelch()',`Delete_Character') + procedure Delete_Character + (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position); + -- AKA + + -- MANPAGE(`curs_inch.3x') + + -- ANCHOR(`winch()',`Peek') + function Peek (Win : Window := Standard_Window) + return Attributed_Character; + -- AKA + + -- ANCHOR(`mvwinch()',`Peek') + function Peek + (Win : Window := Standard_Window; + Line : Line_Position; + Column : Column_Position) return Attributed_Character; + -- AKA + + -- MANPAGE(`curs_winch.3x') + + -- ANCHOR(`winsch()',`Insert') + procedure Insert (Win : in Window := Standard_Window; + Ch : in Attributed_Character); + -- AKA + + -- ANCHOR(`mvwinsch()',`Insert') + procedure Insert (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Ch : in Attributed_Character); + -- AKA + + -- MANPAGE(`curs_winch.3x') + + -- ANCHOR(`winsnstr()',`Insert') + procedure Insert (Win : in Window := Standard_Window; + Str : in String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`winsstr()') + + -- ANCHOR(`mvwinsnstr()',`Insert') + procedure Insert (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : in String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`mvwinsstr()') + + -- MANPAGE(`curs_instr.3x') + + -- ANCHOR(`winnstr()',`Peek') + procedure Peek (Win : in Window := Standard_Window; + Str : out String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`winstr()') + + -- ANCHOR(`mvwinnstr()',`Peek') + procedure Peek (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`mvwinstr()') + + -- MANPAGE(`curs_inchstr.3x') + + -- ANCHOR(`winchnstr()',`Peek') + procedure Peek (Win : in Window := Standard_Window; + Str : out Attributed_String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`winchstr()') + + -- ANCHOR(`mvwinchnstr()',`Peek') + procedure Peek (Win : in Window := Standard_Window; + Line : in Line_Position; + Column : in Column_Position; + Str : out Attributed_String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`mvwinchstr()') + + -- MANPAGE(`curs_getstr.3x') + + -- ANCHOR(`wgetnstr()',`Get') + procedure Get (Win : in Window := Standard_Window; + Str : out String; + Len : in Integer := -1); + -- AKA + -- ALIAS(`wgetstr()') + + 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) + + -- MANPAGE(`curs_slk.3x') + + type Soft_Label_Key_Format is (Three_Two_Three, + Four_Four, + PC_Style, -- ncurses specific + PC_Style_With_Index); -- " + type Label_Number is new Positive range 1 .. 12; + type Label_Justification is (Left, Centered, Right); + + -- ANCHOR(`slk_init()',`Init_Soft_Label_Keys') + procedure Init_Soft_Label_Keys + (Format : in Soft_Label_Key_Format := Three_Two_Three); + -- AKA + + -- ANCHOR(`slk_set()',`Set_Soft_Label_Key') + procedure Set_Soft_Label_Key (Label : in Label_Number; + Text : in String; + Fmt : in Label_Justification := Left); + -- AKA + + -- ANCHOR(`slk_refresh()',`Refresh_Soft_Label_Key') + procedure Refresh_Soft_Label_Keys; + -- AKA + + -- ANCHOR(`slk_noutrefresh()',`Refresh_Soft_Label_Keys_Without_Update') + procedure Refresh_Soft_Label_Keys_Without_Update; + -- AKA + + -- ANCHOR(`slk_label()',`Get_Soft_Label_Key') + procedure Get_Soft_Label_Key (Label : in Label_Number; + Text : out String); + -- AKA + + -- ANCHOR(`slk_clear()',`Clear_Soft_Label_Keys') + procedure Clear_Soft_Label_Keys; + -- AKA + + -- ANCHOR(`slk_restore()',`Restore_Soft_Label_Keys') + procedure Restore_Soft_Label_Keys; + -- AKA + + -- ANCHOR(`slk_touch()',`Touch_Soft_Label_Keys') + procedure Touch_Soft_Label_Keys; + -- AKA + + -- ANCHOR(`slk_attron()',`Switch_Soft_Label_Key_Attributes') + procedure Switch_Soft_Label_Key_Attributes + (Attr : in Character_Attribute_Set; + On : in Boolean := True); + -- AKA + -- ALIAS(`slk_attroff()') + + -- ANCHOR(`slk_attrset()',`Set_Soft_Label_Key_Attributes') + procedure Set_Soft_Label_Key_Attributes + (Attr : in Character_Attribute_Set := Normal_Video; + Color : in Color_Pair := Color_Pair'First); + -- AKA + + -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes') + function Get_Soft_Label_Key_Attributes return Character_Attribute_Set; + -- AKA + + -- ANCHOR(`slk_attr()',`Get_Soft_Label_Key_Attributes') + function Get_Soft_Label_Key_Attributes return Color_Pair; + -- AKA + + -- 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); + -- AKA + -- The external name for a real keystroke. + + -- ANCHOR(`unctrl()',`Un_Control') + procedure Un_Control (Ch : in Attributed_Character; + Str : out String); + -- AKA + + -- ANCHOR(`delay_output()',`Delay_Output') + procedure Delay_Output (Msecs : in Natural); + -- AKA + + -- ANCHOR(`flushinp()',`Flush_Input') + procedure Flush_Input; + -- AKA + + -- MANPAGE(`curs_termattrs.3x') + + -- ANCHOR(`baudrate()',`Baudrate') + function Baudrate return Natural; + -- AKA + + -- ANCHOR(`erasechar()',`Erase_Character') + function Erase_Character return Character; + -- AKA + + -- ANCHOR(`killchar()',`Kill_Character') + function Kill_Character return Character; + -- AKA + + -- ANCHOR(`has_ic()',`Has_Insert_Character') + function Has_Insert_Character return Boolean; + -- AKA + + -- ANCHOR(`has_il()',`Has_Insert_Line') + function Has_Insert_Line return Boolean; + -- AKA + + -- ANCHOR(`termattrs()',`Supported_Attributes') + function Supported_Attributes return Character_Attribute_Set; + -- AKA + + -- ANCHOR(`longname()',`Long_Name') + procedure Long_Name (Name : out String); + -- AKA + + -- ANCHOR(`termname()',`Terminal_Name') + procedure Terminal_Name (Name : out String); + -- AKA + + -- MANPAGE(`curs_color.3x') + + -- ANCHOR(`start_clolor()',`Start_Color') + procedure Start_Color; + -- AKA + pragma Import (C, Start_Color, "start_color"); + + -- ANCHOR(`init_pair()',`Init_Pair') + procedure Init_Pair (Pair : in Redefinable_Color_Pair; + Fore : in Color_Number; + Back : in Color_Number); + -- AKA + + -- ANCHOR(`pair_content()',`Pair_Content') + procedure Pair_Content (Pair : in Color_Pair; + Fore : out Color_Number; + Back : out Color_Number); + -- AKA + + -- ANCHOR(`has_colors()',`Has_Colors') + function Has_Colors return Boolean; + -- AKA + + -- ANCHOR(`init_color()',`Init_Color') + procedure Init_Color (Color : in Color_Number; + Red : in RGB_Value; + Green : in RGB_Value; + Blue : in RGB_Value); + -- AKA + + -- ANCHOR(`can_change_color()',`Can_Change_Color') + function Can_Change_Color return Boolean; + -- AKA + + -- ANCHOR(`color_content()',`Color_Content') + procedure Color_Content (Color : in Color_Number; + Red : out RGB_Value; + Green : out RGB_Value; + Blue : out RGB_Value); + -- AKA + + -- MANPAGE(`curs_kernel.3x') + + -- | Not implemented: getsyx, setsyx + -- + type Curses_Mode is (Curses, Shell); + + -- ANCHOR(`def_prog_mode()',`Save_Curses_Mode') + procedure Save_Curses_Mode (Mode : in Curses_Mode); + -- AKA + -- ALIAS(`def_shell_mode()') + + -- ANCHOR(`reset_prog_mode()',`Reset_Curses_Mode') + procedure Reset_Curses_Mode (Mode : in Curses_Mode); + -- AKA + -- ALIAS(`reset_shell_mode()') + + -- ANCHOR(`savetty()',`Save_Terminal_State') + procedure Save_Terminal_State; + -- AKA + + -- ANCHOR(`resetty();',`Reset_Terminal_State') + procedure Reset_Terminal_State; + -- AKA + + type Stdscr_Init_Proc is access + function (Win : Window; + Columns : Column_Count) return Integer; + pragma Convention (C, Stdscr_Init_Proc); + -- N.B.: the return value is actually ignored, but it seems to be + -- a good practice to return 0 if you think all went fine + -- and -1 otherwise. + + -- ANCHOR(`ripoffline()',`Rip_Off_Lines') + procedure Rip_Off_Lines (Lines : in Integer; + Proc : in Stdscr_Init_Proc); + -- AKA + -- N.B.: to be more precise, this uses a ncurses specific enhancement of + -- ripoffline(), in which the Lines argument absolute value is the + -- number of lines to be ripped of. The official ripoffline() only + -- uses the sign of Lines to rip of a single line from bottom or top. + + type Cursor_Visibility is (Invisible, Normal, Very_Visible); + + -- ANCHOR(`curs_set()',`Set_Cursor_Visibility') + procedure Set_Cursor_Visibility (Visibility : in out Cursor_Visibility); + -- AKA + + -- ANCHOR(`napms()',`Nap_Milli_Seconds') + procedure Nap_Milli_Seconds (Ms : in Natural); + -- AKA + + -- |===================================================================== + -- | Some usefull helpers. + -- |===================================================================== + type Transform_Direction is (From_Screen, To_Screen); + procedure Transform_Coordinates + (W : in Window := Standard_Window; + Line : in out Line_Position; + Column : in out Column_Position; + Dir : in Transform_Direction := From_Screen); + -- This procedure transforms screen coordinates into coordinates relative + -- to the window and vice versa, depending on the Dir parmeter. + -- Screen coordinates are the position informations on the physical device. + -- An Curses_Exception will be raised if Line and Column are not in the + -- Window or if you pass the Null_Window as argument. + +private + type Window is new System.Address; + Null_Window : constant Window := Window (System.Null_Address); + + Generation_Bit_Order : constant System.Bit_Order := System.M4_BIT_ORDER; + -- This constant may be different on your system. + +end Terminal_Interface.Curses; diff --git a/Ada95/html/Makefile b/Ada95/html/Makefile new file mode 100644 index 00000000..caf46e35 --- /dev/null +++ b/Ada95/html/Makefile @@ -0,0 +1,19 @@ +# Nothing to do in this directory + +all:: + @ + +clean:: + @ + +distclean:: clean + @ + +realclean:: clean + @ + +mostlyclean:: clean + @ + +install:: + @ diff --git a/Ada95/html/curs_addch.3x.html b/Ada95/html/curs_addch.3x.html new file mode 100644 index 00000000..e739fc42 --- /dev/null +++ b/Ada95/html/curs_addch.3x.html @@ -0,0 +1,176 @@ + + +
+       addch,  waddch,  mvaddch,  mvwaddch, echochar, wechochar -
+       add a character (with attributes) to a curses window, then
+       advance the cursor
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int addch(chtype ch);
+       int waddch(WINDOW *win, chtype ch);
+       int mvaddch(int y, int x, chtype ch);
+       int mvwaddch(WINDOW *win, int y, int x, chtype ch);
+       int echochar(chtype ch);
+       int wechochar(WINDOW *win, chtype ch);
+
+
+
+

DESCRIPTION

+       The  addch,  waddch, mvaddch and mvwaddch routines put the
+       character ch into the given window at its  current  window
+       position,  which  is then advanced.  They are analogous to
+       putchar in stdio(3).  If the advance is at the right  mar-
+       gin,  the  cursor  automatically wraps to the beginning of
+       the next line.  At the bottom  of  the  current  scrolling
+       region,  if  scrollok  is enabled, the scrolling region is
+       scrolled up one line.
+
+       If ch is a tab, newline, or backspace, the cursor is moved
+       appropriately within the window.  Backspace moves the cur-
+       sor one character left; at the left edge of  a  window  it
+       does  nothing.   Newline  does  a clrtoeol, then moves the
+       cursor to  the  window  left  margin  on  the  next  line,
+       scrolling  the window if on the last line).  Tabs are con-
+       sidered to be at every eighth column.
+
+       If ch is any control character other than tab, newline, or
+       backspace,  it  is  drawn  in  ^X notation.  Calling winch
+       after adding a control character does not return the char-
+       acter  itself, but instead returns the ^-representation of
+       the control character.  (To emit control characters liter-
+       ally, use echochar.)
+
+       Video attributes can be combined with a character argument
+       passed to addch or related functions by logical-ORing them
+       into  the  character.   (Thus, text, including attributes,
+       can be copied from one place to  another  using  inch  and
+       addch.).   See the curs_attr(3X) page for values of prede-
+       fined video attribute constants that can be usefully OR'ed
+       into characters.
+
+       The  echochar  and  wechochar routines are equivalent to a
+       call to addch followed by a call to refresh, or a call  to
+       waddch followed by a call to wrefresh.  The knowledge that
+       only a single character is being output is used  and,  for
+       non-control  characters,  a  considerable performance gain
+
+   Line Graphics
+       The  following  variables  may be used to add line drawing
+       characters to the screen with routines of the  addch  fam-
+       ily.   The  default  character listed below is used if the
+       acsc  capability  doesn't   define   a   terminal-specific
+       replacement for it (but see the EXTENSIONS section below).
+       The names are taken from VT100 nomenclature.
+
+       l  l  l  _  _  _  l   l   l.    Name Default   Description
+       ACS_ULCORNER   +    upper         left-hand         corner
+       ACS_LLCORNER   +    lower         left-hand         corner
+       ACS_URCORNER   +    upper         right-hand        corner
+       ACS_LRCORNER   +    lower        right-hand         corner
+       ACS_RTEE  +    right     tee    ACS_LTEE  +    left    tee
+       ACS_BTEE  +    bottom    tee    ACS_TTEE  +    top     tee
+       ACS_HLINE -    horizontal   line   ACS_VLINE |    vertical
+       line ACS_PLUS  +    plus ACS_S1    -    scan line 1 ACS_S9
+         _    scan     line     9     ACS_DIAMOND    +    diamond
+       ACS_CKBOARD    :    checker        board         (stipple)
+       ACS_DEGREE     '    degree                          symbol
+       ACS_PLMINUS    #    plus/minus  ACS_BULLET     o    bullet
+       ACS_LARROW     <    arrow           pointing          left
+       ACS_RARROW     >    arrow          pointing          right
+       ACS_DARROW     v    arrow           pointing          down
+       ACS_UARROW     ^    arrow pointing up ACS_BOARD #    board
+       of      squares     ACS_LANTERN    #    lantern     symbol
+       ACS_BLOCK #    solid square block ACS_S3    -    scan line
+       3  ACS_S7     -    scan  line  7 ACS_LEQUAL     <    less-
+       than-or-equal-to      ACS_GEQUAL     >    greater-than-or-
+       equal-to  ACS_PI    *    greek pi ACS_NEQUAL     !    not-
+       equal ACS_STERLING   f    pound-sterling symbol
+
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon failure and OK on
+       success  (the  SVr4 manuals specify only "an integer value
+       other than ERR") upon successful completion, unless other-
+       wise noted in the preceding routine descriptions.
+
+
+
+

NOTES

+       Note  that  addch,  mvaddch, mvwaddch, and echochar may be
+       macros.
+
+
+
+

EXTENSIONS

+       The following extended curses features are available  only
+       on  PC-clone consoles and compatible terminals obeying the
+       ANSI.SYS de-facto standard for terminal control sequences.
+       They are not part of XSI curses.
+
+       The attribute A_ALTCHARSET actually forces literal display
+       of PC ROM characters  including  the  high-half  graphics.
+       the card-suit characters, up and down-arrow, and most oth-
+       ers in the range 0-32.  (In a terminfo entry designed  for
+       use  with  ncurses,  the high-half characters are obtained
+       using this attribute with an acsc string in which the sec-
+       ond of each pair is a high-half character.)
+
+       Giving  wechochar  an  argument with its high bit set will
+       produce the corresponding high-half  ASCII  graphic  (SVr4
+       curses also has this feature but does not document it).  A
+       control-character argument, however,  will  not  typically
+       produce  the corresponding graphic; characters such as CR,
+       NL, FF and TAB are typically interpreted  by  the  console
+       driver  itself,  and ESC will be interpreted as the leader
+       of a control sequence.
+
+
+
+

PORTABILITY

+       All these functions are described in the XSI Curses  stan-
+       dard,  Issue  4.  The defaults specified for forms-drawing
+       characters apply in the POSIX locale.
+
+       The seven ACS symbols starting with ACS_S3 were not  docu-
+       mented  in  any publicly released System V.  However, many
+       publicly available terminfos include acsc strings in which
+       their key characters (pryz{|}) are embedded, and a second-
+       hand list of their  character  descriptions  has  come  to
+       light.   The ACS-prefixed names for them were invented for
+       ncurses(3X).
+
+
+
+

SEE ALSO

+       curses(3X), curs_attr(3X), curs_clear(3X),  curs_inch(3X),
+       curs_outopts(3X), curs_refresh(3X), putc(3S).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_addchstr.3x.html b/Ada95/html/curs_addchstr.3x.html new file mode 100644 index 00000000..3572b8c3 --- /dev/null +++ b/Ada95/html/curs_addchstr.3x.html @@ -0,0 +1,70 @@ + + +
+       addchstr,  addchnstr,  waddchstr,  waddchnstr, mvaddchstr,
+       mvaddchnstr, mvwaddchstr, mvwaddchnstr - add a  string  of
+       characters (and attributes) to a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int addchstr(const chtype *chstr);
+       int addchnstr(const chtype *chstr, int n);
+       int waddchstr(WINDOW *win, const chtype *chstr);
+       int waddchnstr(WINDOW *win, const chtype *chstr, int n);
+       int mvaddchstr(int y, int x, const chtype *chstr);
+       int mvaddchnstr(int y, int x, const chtype *chstr, int n);
+       int mvwaddchstr(WINDOW *win, int y, int  x,  const  chtype
+       *chstr);
+       int  mvwaddchnstr(WINDOW  *win, int y, int x, const chtype
+       *chstr, int n);
+
+
+
+

DESCRIPTION

+       These routines copy chstr into the window image  structure
+       at  and  after the current cursor position.  The four rou-
+       tines with n as the last argument copy at most n elements,
+       but  no  more than will fit on the line.  If n=-1 then the
+       whole string is copied, to the maximum number  of  charac-
+       ters that will fit on the line.
+
+       The window cursor is not advanced, and these routines work
+       faster than waddnstr.  On the other hand, they don't  per-
+       form  any  kind  of  checking  (such  as  for the newline,
+       backspace, or  carriage  return  characters),  they  don't
+       advance  the  current  cursor  position, they don't expand
+       other control characters to ^-escapes, and  they  truncate
+       the  string  if  it  crosses the right margin, rather then
+       wrapping it around to the new line.
+
+
+
+
+

RETURN VALUES

+       All routines return the integer ERR upon failure and OK on
+       success  (the  SVr4 manuals specify only "an integer value
+       other than ERR") upon successful completion, unless other-
+       wise noted in the preceding routine descriptions.
+
+
+
+

NOTES

+       Note that all routines except waddchnstr may be macros.
+
+
+
+

PORTABILITY

+       All  these  entry  points  are described in the XSI Curses
+       standard, Issue 4.
+
+
+
+

SEE ALSO

+       curses(3X).
+
+
+ + diff --git a/Ada95/html/curs_addstr.3x.html b/Ada95/html/curs_addstr.3x.html new file mode 100644 index 00000000..916aafb9 --- /dev/null +++ b/Ada95/html/curs_addstr.3x.html @@ -0,0 +1,70 @@ + + +
+       addstr,  addnstr,  waddstr, waddnstr, mvaddstr, mvaddnstr,
+       mvwaddstr, mvwaddnstr - add a string of  characters  to  a
+       curses window and advance cursor
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int addstr(const char *str);
+       int addnstr(const char *str, int n);
+       int waddstr(WINDOW *win, const char *str);
+       int waddnstr(WINDOW *win, const char *str, int n);
+       int mvaddstr(int y, int x, const char *str);
+       int mvaddnstr(int y, int x, const char *str, int n);
+       int mvwaddstr(WINDOW *win, int y, int x, const char *str);
+       int mvwaddnstr(WINDOW *win, int y, int x, const char *str,
+       int n);
+
+
+
+

DESCRIPTION

+       These  routines  write  the characters of the (null-termi-
+       nated) character string str on the given  window.   It  is
+       similar  to  calling waddch once for each character in the
+       string.  The four routines with n  as  the  last  argument
+       write  at  most n characters.  If n is -1, then the entire
+       string will be added.
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon failure and OK on
+       success  (the  SVr4 manuals specify only "an integer value
+       other than ERR") upon successful completion.
+
+
+
+

NOTES

+       Note  that  all  of  these  routines  except  waddstr  and
+       waddnstr may be macros.
+
+
+
+

PORTABILITY

+       All  these  entry  points  are described in the XSI Curses
+       standard, Issue 4.  The XSI errors EILSEQ  and  EOVERFLOW,
+       associated  with  extended-level  conformance, are not yet
+       detected.
+
+
+
+

SEE ALSO

+       curses(3X), curs_addch(3X).
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_attr.3x.html b/Ada95/html/curs_attr.3x.html new file mode 100644 index 00000000..6fe234c7 --- /dev/null +++ b/Ada95/html/curs_attr.3x.html @@ -0,0 +1,172 @@ + + +
+       attroff,  wattroff,  attron,  wattron,  attrset, wattrset,
+       standend, wstandend, standout, wstandout - curses  charac-
+       ter and window attribute control routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       int attroff(int attrs);
+       int wattroff(WINDOW *win, int attrs);
+       int attron(int attrs);
+       int wattron(WINDOW *win, int attrs);
+       int attrset(int attrs);
+       int wattrset(WINDOW *win, int attrs);
+       int standend(void);
+       int wstandend(WINDOW *win);
+       int standout(void);
+       int wstandout(WINDOW *win);
+       attr_t attr_get(void);
+       attr_t wattr_get(WINDOW *);
+       int attr_off(attr_t attrs);
+       int wattr_off(WINDOW *, attr_t attrs);
+       int attr_on(attr_t attrs);
+       int wattr_on(WINDOW *, attr_t attrs);
+       int attr_set(attr_t attrs);
+       int wattr_set(WINDOW *, attr_t attrs);
+       int  chgat(int  n,  attr_t  attr,  short color, const void
+       *opts)
+       int wchgat(WINDOW *, int n, attr_t attr,
+             short color, const void *opts)
+       int mvchgat(int y, int x, int n, attr_t attr,
+             short color, const void *opts)
+       int mvwchgat(WINDOW *, int y, int x, int n, attr_t attr,
+             short color, const void *opts)
+
+
+
+

DESCRIPTION

+       These routines manipulate the current  attributes  of  the
+       named window.  The current attributes of a window apply to
+       all characters that are written into the window with  wad-
+       dch,  waddstr  and  wprintw.  Attributes are a property of
+       the character, and move with  the  character  through  any
+       scrolling and insert/delete line/character operations.  To
+       the extent possible, they  are  displayed  as  appropriate
+       modifications  to  the graphic rendition of characters put
+       on the screen.
+
+       The routine attrset sets the  current  attributes  of  the
+       given  window to attrs.  The routine attroff turns off the
+       named attributes without turning any other  attributes  on
+       or  off.  The routine attron turns on the named attributes
+       without affecting any others.  The routine standout is the
+       same  as  attron(A_STANDOUT).  The routine standend is the
+       same as attrset(A_NORMAL) or attrset(0), that is, it turns
+       off all attributes.
+       the given window; attr_get returns the  current  attribute
+       for   stdscr.   The  remaining  attr_*  functions  operate
+       exactly like the  corresponding  attr*  functions,  except
+       that they take arguments of type attr_t rather than int.
+
+       The routine chgat changes the attributes of a given number
+       of characters starting at the current cursor  location  of
+       stdscr.   It  does not update the cursor and does not per-
+       form wrapping.  A character count of -1  or  greater  than
+       the  remaining window width means to change attributes all
+       the way to the end of the current line.  The wchgat  func-
+       tion generalizes this to any window; the mvwchgat function
+       does a cursor move before acting.  In these functions, the
+       color  argument  is  a  color-pair  index (as in the first
+       argument of  init_pair,  see  curs_color(3x)).   The  opts
+       argument  is  not  presently used, but is reserved for the
+       future (leave it NULL).
+
+   Attributes
+       The following video attributes, defined in <curses.h>, can
+       be passed to the routines attron, attroff, and attrset, or
+       OR'ed with the characters passed to addch.
+
+       center ; l l .  A_NORMAL  Normal  display  (no  highlight)
+       A_STANDOUT     Best  highlighting  mode  of  the terminal.
+       A_UNDERLINE    Underlining     A_REVERSE Reverse     video
+       A_BLINK   Blinking  A_DIM     Half  bright A_BOLD    Extra
+       bright or bold A_PROTECT Protected mode  A_INVIS   Invisi-
+       ble  or  blank mode A_ALTCHARSET   Alternate character set
+       A_CHARTEXT     Bit-mask    to    extract    a    character
+       COLOR_PAIR(n)  Color-pair number n
+
+       The following macro is the reverse of COLOR_PAIR(n):
+
+       PAIR_NUMBER(attrs) Returns the pair number associated
+                          with the COLOR_PAIR(n) attribute.
+
+       The  return values of many of these routines are not mean-
+       ingful (they are implemented as macro-expanded assignments
+       and  simply  return their argument).  The SVr4 manual page
+       claims (falsely) that these routines always return 1.
+
+
+
+
+

NOTES

+       Note that attroff,  wattroff,  attron,  wattron,  attrset,
+       wattrset, standend and standout may be macros.
+
+
+
+

PORTABILITY

+       All  these functions are supported in the XSI Curses stan-
+       dard, Issue 4.  The standard defined  the  dedicated  type
+       for  highlights,  attr_t,  which  is  not  defined in SVr4
+       curses. The functions taking attr_t arguments are not sup-
+       tional  functions  attron/attroff/attrset  can  manipulate
+       attributes  other  than A_BLINK, A_BOLD, A_DIM, A_REVERSE,
+       A_STANDOUT, or A_UNDERLINE is "unspecified".   Under  this
+       implementation  as  well  as  SVr4 curses, these functions
+       correctly manipulate all other  highlights  (specifically,
+       A_ALTCHARSET, A_PROTECT, and A_INVIS).
+
+       XSI  Curses added the new entry points, attr_get, attr_on,
+       attr_off,  attr_set,   wattr_on,   wattr_off,   wattr_get,
+       wattr_set.   These  are intended to work with a new series
+       of highlight macros prefixed with WA_.
+
+       center ; l l .  WA_NORMAL Normal  display  (no  highlight)
+       WA_STANDOUT    Best  highlighting  mode  of  the terminal.
+       WA_UNDERLINE   Underlining  WA_REVERSE     Reverse   video
+       WA_BLINK  Blinking  WA_DIM    Half  bright WA_BOLD   Extra
+       bright or bold WA_ALTCHARSET  Alternate character set
+
+       The XSI curses standard specifies that each pair of corre-
+       sponding  A_  and WA_-using functions operates on the same
+       current-highlight information.
+
+       The XSI standard extended conformance level adds new high-
+       lights A_HORIZONTAL, A_LEFT, A_LOW, A_RIGHT, A_TOP, A_VER-
+       TICAL (and corresponding WA_ macros for each)  which  this
+       curses does not yet support.
+
+
+
+

SEE ALSO

+       curses(3X),        curs_addch(3X),        curs_addstr(3X),
+       curs_printw(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_beep.3x.html b/Ada95/html/curs_beep.3x.html new file mode 100644 index 00000000..1abad227 --- /dev/null +++ b/Ada95/html/curs_beep.3x.html @@ -0,0 +1,70 @@ + + +
+       beep, flash - curses bell and screen flash routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int beep(void);
+       int flash(void);
+
+
+
+

DESCRIPTION

+       The beep and flash routines are used to alert the terminal
+       user.  The routine beep sounds an  audible  alarm  on  the
+       terminal,  if  possible;  otherwise  it flashes the screen
+       (visible bell).  The routine flash flashes the screen, and
+       if  that  is  not  possible, sounds the alert.  If neither
+       alert is possible, nothing happens.  Nearly all  terminals
+       have  an  audible  alert (bell or beep), but only some can
+       flash the screen.
+
+
+
+

RETURN VALUE

+       These routines return OK if they  succeed  in  beeping  or
+       flashing, ERR otherwise.
+
+
+
+

EXTENSIONS

+       SVr4's  beep  and flash routines always returned OK, so it
+       was not possible to tell when the beep or flash failed.
+
+
+
+

PORTABILITY

+       These functions are defined in the  XSI  Curses  standard,
+       Issue  4.  Like SVr4, it specifies that they always return
+       OK.
+
+
+
+

SEE ALSO

+       curses(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_bkgd.3x.html b/Ada95/html/curs_bkgd.3x.html new file mode 100644 index 00000000..6a3396ca --- /dev/null +++ b/Ada95/html/curs_bkgd.3x.html @@ -0,0 +1,122 @@ + + +
+       bkgdset,  wbkgdset, bkgd, wbkgd - curses window background
+       manipulation routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       void bkgdset(const chtype ch);
+       void wbkgdset(WINDOW *win, const chtype ch);
+       int bkgd(const chtype ch);
+       int wbkgd(WINDOW *win, const chtype ch);
+       chtype getbkgd(WINDOW *win);
+
+
+
+

DESCRIPTION

+       The bkgdset and wbkgdset  routines  manipulate  the  back-
+       ground  of  the  named window.  The window background is a
+       chtype consisting of any combination of attributes  (i.e.,
+       rendition)  and  a  character.   The attribute part of the
+       background is combined (OR'ed) with all non-blank  charac-
+       ters  that  are written into the window with waddch.  Both
+       the character and attribute parts of  the  background  are
+       combined   with  the  blank  characters.   The  background
+       becomes a property of the character  and  moves  with  the
+       character   through   any   scrolling   and  insert/delete
+       line/character operations.
+
+       To the extent  possible  on  a  particular  terminal,  the
+       attribute  part  of  the  background  is  displayed as the
+       graphic rendition of the character put on the screen.
+
+       The bkgd and wbkgd functions set the  background  property
+       of  the  current  or  specified window and then apply this
+       setting to every character position in that window:
+
+              The rendition of every character on the  screen  is
+              changed to the new background rendition.
+
+              Wherever  the  former background character appears,
+              it is changed to the new background character.
+
+       The getbkgd function returns the  given  window's  current
+       background character/attribute pair.
+
+
+
+

RETURN VALUE

+       The  routines  bkgd  and wbkgd return the integer OK.  The
+       SVr4.0 manual says "or a non-negative integer  if  immedok
+       is set", but this appears to be an error.
+
+
+
+

NOTES

+       Note that bkgdset and bkgd may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       return ERR, on failure. but gives no failure conditions.
+
+
+
+

SEE ALSO

+       curses(3X), curs_addch(3X), curs_outopts(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_border.3x.html b/Ada95/html/curs_border.3x.html new file mode 100644 index 00000000..1d45fa20 --- /dev/null +++ b/Ada95/html/curs_border.3x.html @@ -0,0 +1,120 @@ + + +
+       border,  wborder, box, hline, whline, vline, wvline - cre-
+       ate curses borders, horizontal and vertical lines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       int border(chtype ls, chtype rs, chtype ts, chtype bs,
+          chtype tl, chtype tr, chtype bl, chtype br);
+       int wborder(WINDOW *win, chtype ls, chtype rs,
+          chtype ts, chtype bs, chtype tl, chtype tr,
+          chtype bl, chtype br);
+       int box(WINDOW *win, chtype verch, chtype horch);
+       int hline(chtype ch, int n);
+       int whline(WINDOW *win, chtype ch, int n);
+       int vline(chtype ch, int n);
+       int wvline(WINDOW *win, chtype ch, int n);
+       mvhline(int y, int x, chtype ch, int n);
+       mvwhline(WINDOW *, int y, int x, chtype ch, int n);
+       int mvvline(int y, int x, chtype ch, int n);
+       int mvwvline(WINDOW *, int y, int x, chtype ch, int n);
+
+
+
+

DESCRIPTION

+       The border, wborder and box routines draw a box around the
+       edges  of  a  window.   The argument ls is a character and
+       attributes used for the left side  of  the  border,  rs  -
+       right  side,  ts  -  top  side, bs - bottom side, tl - top
+       left-hand corner, tr - top right-hand corner, bl -  bottom
+       left-hand  corner,  and br - bottom right-hand corner.  If
+       any of these arguments is zero, then the following default
+       values  (defined in curses.h) are used instead: ACS_VLINE,
+       ACS_VLINE,     ACS_HLINE,     ACS_HLINE,     ACS_ULCORNER,
+       ACS_URCORNER, ACS_BLCORNER, ACS_BRCORNER.
+
+       box(win,  verch,  horch)  is a shorthand for the following
+       call: wborder(win, verch, verch, horch, horch,  0,  0,  0,
+       0).
+
+       The  hline and whline functions draw a horizontal (left to
+       right) line using ch starting at the current cursor  posi-
+       tion  in  the  window.  The current cursor position is not
+       changed.  The line is at most n  characters  long,  or  as
+       many as fit into the window.
+
+       The  vline  and  wvline  functions draw a vertical (top to
+       bottom) line using ch starting at the current cursor posi-
+       tion  in  the  window.  The current cursor position is not
+       changed.  The line is at most n  characters  long,  or  as
+       many as fit into the window.
+
+
+
+

RETURN VALUE

+       All  routines  return  the  integer OK.  The SVr4.0 manual
+       says "or a non-negative integer if immedok  is  set",  but
+       this appears to be an error.
+       The  borders  generated by these functions are inside bor-
+       ders (this is also true of SVr4 curses, though the fact is
+       not documented).
+
+       Note that border and box may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  Additional functions mvhline, mvvline, mvwhline,
+       and mvwvline are described there which this implementation
+       does not yet support.  The standard  specifies  that  they
+       return  ERR on failure, but specifies no error conditions.
+
+
+
+

SEE ALSO

+       curses(3X), curs_outopts(3X).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_clear.3x.html b/Ada95/html/curs_clear.3x.html new file mode 100644 index 00000000..f2f3edf3 --- /dev/null +++ b/Ada95/html/curs_clear.3x.html @@ -0,0 +1,122 @@ + + +
+       erase,  werase,  clear,  wclear, clrtobot, wclrtobot, clr-
+       toeol, wclrtoeol - clear all or part of a curses window
+
+
+
+

SYNOPSIS

+       # include <curses.h>
+
+       int erase(void);
+       int werase(WINDOW *win);
+       int clear(void);
+       int wclear(WINDOW *win);
+       int clrtobot(void);
+       int wclrtobot(WINDOW *win);
+       int clrtoeol(void);
+       int wclrtoeol(WINDOW *win);
+
+
+
+

DESCRIPTION

+       The erase and werase routines copy blanks to  every  posi-
+       tion in the window, clearing the screen.
+
+       The  clear  and wclear routines are like erase and werase,
+       but they also call clearok, so that the screen is  cleared
+       completely  on  the  next call to wrefresh for that window
+       and repainted from scratch.
+
+       The clrtobot and wclrtobot routines erase from the  cursor
+       to the end of screen.  That is, they erase all lines below
+       the cursor in the window.  Also, the current line  to  the
+       right of the cursor, inclusive, is erased.
+
+       The clrtoeol and wclrtoeol routines erase the current line
+       to the right of the cursor, inclusive, to the end  of  the
+       current line.
+
+       Blanks created by erasure have the current background ren-
+       dition (as set by wbkgdset) merged into them.
+
+
+
+

RETURN VALUE

+       All routines return the integer  OK.   The  SVr4.0  manual
+       says  "or  a  non-negative integer if immedok is set", but
+       this appears to be an error.
+
+
+
+

NOTES

+       Note that erase, werase, clear, wclear, clrtobot, and clr-
+       toeol may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  The standard specifies that they return  ERR  on
+       failure, but specifies no error conditions.
+
+       Some  historic  curses  implementations had, as an undocu-
+       mented feature,  the  ability  to  do  the  equivalent  of
+
+
+
+

SEE ALSO

+       curses(3X), curs_outopts(3X), curs_refresh(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_color.3x.html b/Ada95/html/curs_color.3x.html new file mode 100644 index 00000000..a1f877be --- /dev/null +++ b/Ada95/html/curs_color.3x.html @@ -0,0 +1,226 @@ + + +
+       start_color,     init_pair,     init_color,    has_colors,
+       can_change_color,  color_content,  pair_content  -  curses
+       color manipulation routines
+
+
+
+

SYNOPSIS

+       # include <curses.h>
+       int start_color(void);
+       int init_pair(short pair, short f, short b);
+       int init_color(short color, short r, short g, short b);
+       bool has_colors(void);
+       bool can_change_color(void);
+       int  color_content(short  color, short *r, short *g, short
+       *b);
+       int pair_content(short pair, short *f, short *b);
+
+
+
+

DESCRIPTION

+   Overview
+       curses support color attributes  on  terminals  with  that
+       capability.   To  use  these  routines start_color must be
+       called, usually right after initscr.   Colors  are  always
+       used  in pairs (referred to as color-pairs).  A color-pair
+       consists of a foreground  color  (for  characters)  and  a
+       background color (for the blank field on which the charac-
+       ters are displayed).  A programmer  initializes  a  color-
+       pair  with  the routine init_pair.  After it has been ini-
+       tialized, COLOR_PAIR(n), a macro  defined  in  <curses.h>,
+       can be used as a new video attribute.
+
+       If  a  terminal  is capable of redefining colors, the pro-
+       grammer can use the routine init_color to change the defi-
+       nition   of   a   color.    The  routines  has_colors  and
+       can_change_color  return  TRUE  or  FALSE,  depending   on
+       whether  the  terminal  has color capabilities and whether
+       the  programmer  can  change  the  colors.   The   routine
+       color_content  allows  a programmer to extract the amounts
+       of red, green,  and  blue  components  in  an  initialized
+       color.   The  routine  pair_content allows a programmer to
+       find out how a given color-pair is currently defined.
+
+   Routine Descriptions
+       The start_color routine requires no arguments.  It must be
+       called  if  the programmer wants to use colors, and before
+       any other color manipulation routine  is  called.   It  is
+       good  practice  to  call this routine right after initscr.
+       start_color initializes eight basic  colors  (black,  red,
+       green,  yellow,  blue,  magenta, cyan, and white), and two
+       global variables,  COLORS  and  COLOR_PAIRS  (respectively
+       defining  the maximum number of colors and color-pairs the
+       terminal can support).  It also restores the colors on the
+       terminal to the values they had when the terminal was just
+       turned on.
+
+       pair to be changed, the foreground color number,  and  the
+       background  color number.  The value of the first argument
+       must be between 1 and COLOR_PAIRS-1.   The  value  of  the
+       second  and  third  arguments must be between 0 and COLORS
+       (the 0 color pair is wired to white on black and cannot be
+       changed).   If  the color-pair was previously initialized,
+       the screen is refreshed and all occurrences of that color-
+       pair is changed to the new definition.
+
+       The  init_color routine changes the definition of a color.
+       It takes four arguments: the number of  the  color  to  be
+       changed  followed  by three RGB values (for the amounts of
+       red, green, and blue components).  The value of the  first
+       argument  must  be between 0 and COLORS.  (See the section
+       Colors for the default color index.)   Each  of  the  last
+       three  arguments must be a value between 0 and 1000.  When
+       init_color is used, all occurrences of that color  on  the
+       screen immediately change to the new definition.
+
+       The  has_colors routine requires no arguments.  It returns
+       TRUE if the terminal can manipulate colors; otherwise,  it
+       returns FALSE.  This routine facilitates writing terminal-
+       independent programs.  For example, a programmer  can  use
+       it  to  decide  whether  to  use color or some other video
+       attribute.
+
+       The can_change_color routine requires  no  arguments.   It
+       returns  TRUE  if  the  terminal  supports  colors and can
+       change their definitions; other, it returns  FALSE.   This
+       routine facilitates writing terminal-independent programs.
+
+       The color_content routine gives programmers a way to  find
+       the intensity of the red, green, and blue (RGB) components
+       in a color.  It requires four arguments: the color number,
+       and  three addresses of shorts for storing the information
+       about the amounts of red, green, and  blue  components  in
+       the  given color.  The value of the first argument must be
+       between 0 and COLORS.  The values that are stored  at  the
+       addresses  pointed  to  by  the  last  three arguments are
+       between 0 (no component) and 1000 (maximum amount of  com-
+       ponent).
+
+       The  pair_content  routine  allows programmers to find out
+       what colors a given color-pair consists of.   It  requires
+       three  arguments: the color-pair number, and two addresses
+       of shorts for storing the foreground  and  the  background
+       color  numbers.   The  value of the first argument must be
+       between 1 and COLOR_PAIRS-1.  The values that  are  stored
+       at  the addresses pointed to by the second and third argu-
+       ments are between 0 and COLORS.
+
+   Colors
+       is the default background color for all terminals.
+
+             COLOR_BLACK
+             COLOR_RED
+             COLOR_GREEN
+             COLOR_YELLOW
+             COLOR_BLUE
+             COLOR_MAGENTA
+             COLOR_CYAN
+             COLOR_WHITE
+
+
+
+

RETURN VALUE

+       The routines can_change_color()  and  has_colors()  return
+       TRUE or FALSE.
+
+       All other routines return the integer ERR upon failure and
+       an OK (SVr4 specifies only "an integer  value  other  than
+       ERR") upon successful completion.
+
+
+
+

NOTES

+       In  the  ncurses implementation, there is a separate color
+       activation flag, color palette,  color  pairs  table,  and
+       associated  COLORS and COLOR_PAIRS counts for each screen;
+       the start_color function only affects the current  screen.
+       The SVr4/XSI interface is not really designed with this in
+       mind, and historical  implementations  may  use  a  single
+       shared color palette.
+
+       Note that setting an implicit background color via a color
+       pair affects only character cells that a  character  write
+       operation  explicitly  touches.   To change the background
+       color used when parts of a window are blanked  by  erasing
+       or scrolling operations, see curs_bkgd(3x).
+
+       Several  caveats  apply  on 386 and 486 machines with VGA-
+       compatible graphics:
+
+       COLOR_YELLOW  is  actually  brown.   To  get  yellow,  use
+       COLOR_YELLOW combined with the A_BOLD attribute.
+
+       The  A_BLINK  attribute  should  in theory cause the back-
+       ground to go bright.  This often fails to work,  and  even
+       some cards for which it mostly works (such as the Paradise
+       and compatibles) do the wrong thing when you try to set  a
+       bright  "yellow"  background  (you  get  a blinking yellow
+       foreground instead).
+
+       Color RGB values are not settable.
+
+
+
+

PORTABILITY

+       This implementation satisfies XSI Curses's  minimum  maxi-
+       mums for COLORS and COLOR_PAIRS.
+       ground   and   background    color    to    support    the
+       use_default_colors extension, but only if that routine has
+       been first invoked.
+
+
+
+

SEE ALSO

+       curses(3X), curs_initscr(3X), curs_attr(3X), dft_fgbg(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_delch.3x.html b/Ada95/html/curs_delch.3x.html new file mode 100644 index 00000000..ebc85781 --- /dev/null +++ b/Ada95/html/curs_delch.3x.html @@ -0,0 +1,70 @@ + + +
+       delch,  wdelch, mvdelch, mvwdelch - delete character under
+       the cursor in a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int delch(void);
+       int wdelch(WINDOW *win);
+       int mvdelch(int y, int x);
+       int mvwdelch(WINDOW *win, int y, int x);
+
+
+
+

DESCRIPTION

+       These routines delete the character under the cursor;  all
+       characters to the right of the cursor on the same line are
+       moved to the left one position and the last  character  on
+       the line is filled with a blank.  The cursor position does
+       not change (after moving to y, x,  if  specified).   (This
+       does  not  imply use of the hardware delete character fea-
+       ture.)
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon failure and an OK
+       (SVr4  specifies  only  "an integer value other than ERR")
+       upon successful completion.
+
+
+
+

NOTES

+       Note that delch, mvdelch, and mvwdelch may be macros.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue  4.   The standard specifies that they return ERR on
+       failure, but specifies no error conditions.
+
+
+
+

SEE ALSO

+       curses(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_deleteln.3x.html b/Ada95/html/curs_deleteln.3x.html new file mode 100644 index 00000000..b0a74abf --- /dev/null +++ b/Ada95/html/curs_deleteln.3x.html @@ -0,0 +1,70 @@ + + +
+       deleteln,  wdeleteln,  insdelln, winsdelln, insertln, win-
+       sertln - delete and insert lines in a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int deleteln(void);
+       int wdeleteln(WINDOW *win);
+       int insdelln(int n);
+       int winsdelln(WINDOW *win, int n);
+       int insertln(void);
+       int winsertln(WINDOW *win);
+
+
+
+

DESCRIPTION

+       The deleteln and wdeleteln routines delete the line  under
+       the cursor in the window; all lines below the current line
+       are moved up one line.  The bottom line of the  window  is
+       cleared.  The cursor position does not change.
+
+       The  insdelln  and  winsdelln  routines,  for  positive n,
+       insert n lines into the specified window above the current
+       line.   The  n  bottom  lines  are  lost.  For negative n,
+       delete n lines (starting with the one under  the  cursor),
+       and  move  the remaining lines up.  The bottom n lines are
+       cleared.  The current cursor position remains the same.
+
+       The insertln and insertln routines, insert  a  blank  line
+       above the current line and the bottom line is lost.
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon failure and an OK
+       (SVr4 specifies only "an integer value  other  than  ERR")
+       upon successful completion.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  The standard specifies that they return  ERR  on
+       failure, but specifies no error conditions.
+
+
+
+

NOTES

+       Note that all but winsdelln may be a macros.
+
+       These  routines  do  not require a hardware line delete or
+       insert feature in the terminal.  In fact, they  won't  use
+       hardware  line  delete/insert  unless idlok(..., TRUE) has
+       been set on the current window.
+
+
+
+

SEE ALSO

+       curses(3X)
+
+
+
+
+ + diff --git a/Ada95/html/curs_getch.3x.html b/Ada95/html/curs_getch.3x.html new file mode 100644 index 00000000..a89c96e7 --- /dev/null +++ b/Ada95/html/curs_getch.3x.html @@ -0,0 +1,226 @@ + + +
+       getch,  wgetch,  mvgetch, mvwgetch, ungetch - get (or push
+       back) characters from curses terminal keyboard
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int getch(void);
+       int wgetch(WINDOW *win);
+       int mvgetch(int y, int x);
+       int mvwgetch(WINDOW *win, int y, int x);
+       int ungetch(int ch);
+       int has_key(int ch);
+
+
+
+

DESCRIPTION

+       The getch, wgetch, mvgetch and mvwgetch, routines  read  a
+       character  from the window.  In no-delay mode, if no input
+       is waiting, the value ERR is returned.  In delay mode, the
+       program  waits until the system passes text through to the
+       program.  Depending on the  setting  of  cbreak,  this  is
+       after one character (cbreak mode), or after the first new-
+       line (nocbreak mode).  In  half-delay  mode,  the  program
+       waits  until a character is typed or the specified timeout
+       has been reached.
+
+       If noecho has been set, then the character  will  also  be
+       echoed into the designated window according to the follow-
+       ing rules: If the character is the current  erase  charac-
+       ter,  left  arrow,  or  backspace, the cursor is moved one
+       space to the left and that screen position is erased as if
+       delch  had  been  called.   If  the character value is any
+       other KEY_ define, the user is alerted with a  beep  call.
+       Otherwise the character is simply output to the screen.
+
+       If the window is not a pad, and it has been moved or modi-
+       fied since the last call to  wrefresh,  wrefresh  will  be
+       called before another character is read.
+
+       If  keypad  is  TRUE,  and  a function key is pressed, the
+       token for that function key is returned instead of the raw
+       characters.    Possible   function  keys  are  defined  in
+       <curses.h> as macros with  values  outside  the  range  of
+       8-bit  characters  whose  names  begin  with KEY_. Thus, a
+       variable intended to hold the return value of  a  function
+       key must be of short size or larger.
+
+       When a character that could be the beginning of a function
+       key is received (which,  on  modern  terminals,  means  an
+       escape  character), curses sets a timer.  If the remainder
+       of the sequence does not come  in  within  the  designated
+       time,  the  character  is  passed  through; otherwise, the
+       function key value is returned.   For  this  reason,  many
+       terminals  experience  a  delay  between  the  time a user
+
+       The ungetch routine places ch back onto the input queue to
+       be returned by the next call to wgetch.  Note  that  there
+       is, in effect, just one input queue for all windows.
+
+
+   Function Keys
+       The  following function keys, defined in <curses.h>, might
+       be returned by getch if keypad  has  been  enabled.   Note
+       that  not  all  of  these are necessarily supported on any
+       particular terminal.
+
+       center tab(/) ; l l l l .  Name/Key name
+
+       KEY_BREAK/Break  key  KEY_DOWN/The  four  arrow  keys  ...
+       KEY_UP  KEY_LEFT  KEY_RIGHT KEY_HOME/Home key (upward+left
+       arrow) KEY_BACKSPACE/Backspace  KEY_F0/T{  Function  keys;
+       space  for 64 keys is reserved.  T} KEY_F(n)/T{ For 0 <= n
+       <=   63   T}   KEY_DL/Delete   line   KEY_IL/Insert   line
+       KEY_DC/Delete character KEY_IC/Insert char or enter insert
+       mode KEY_EIC/Exit insert char mode KEY_CLEAR/Clear  screen
+       KEY_EOS/Clear  to  end  of  screen KEY_EOL/Clear to end of
+       line KEY_SF/Scroll 1 line  forward  KEY_SR/Scroll  1  line
+       backward  (reverse) KEY_NPAGE/Next page KEY_PPAGE/Previous
+       page KEY_STAB/Set tab KEY_CTAB/Clear  tab  KEY_CATAB/Clear
+       all tabs KEY_ENTER/Enter or send KEY_SRESET/Soft (partial)
+       reset KEY_RESET/Reset or  hard  reset  KEY_PRINT/Print  or
+       copy    KEY_LL/Home   down   or   bottom   (lower   left).
+       KEY_A1/Upper left of keypad KEY_A3/Upper right  of  keypad
+       KEY_B2/Center   of  keypad  KEY_C1/Lower  left  of  keypad
+       KEY_C3/Lower  right  of  keypad  KEY_BTAB/Back   tab   key
+       KEY_BEG/Beg(inning)      key     KEY_CANCEL/Cancel     key
+       KEY_CLOSE/Close   key   KEY_COMMAND/Cmd   (command)    key
+       KEY_COPY/Copy  key  KEY_CREATE/Create  key KEY_END/End key
+       KEY_EXIT/Exit  key  KEY_FIND/Find  key  KEY_HELP/Help  key
+       KEY_MARK/Mark  key  KEY_MESSAGE/Message  key KEY_MOVE/Move
+       key   KEY_NEXT/Next   object   key    KEY_OPEN/Open    key
+       KEY_OPTIONS/Options  key  KEY_PREVIOUS/Previous object key
+       KEY_REDO/Redo    key     KEY_REFERENCE/Ref(erence)     key
+       KEY_REFRESH/Refresh     key     KEY_REPLACE/Replace    key
+       KEY_RESTART/Restart     key     KEY_RESUME/Resume      key
+       KEY_SAVE/Save key KEY_SBEG/Shifted beginning key KEY_SCAN-
+       CEL/Shifted cancel key  KEY_SCOMMAND/Shifted  command  key
+       KEY_SCOPY/Shifted  copy key KEY_SCREATE/Shifted create key
+       KEY_SDC/Shifted delete  char  key  KEY_SDL/Shifted  delete
+       line  key  KEY_SELECT/Select  key KEY_SEND/Shifted end key
+       KEY_SEOL/Shifted clear line key KEY_SEXIT/Shifted exit key
+       KEY_SFIND/Shifted  find  key  KEY_SHELP/Shifted  help  key
+       KEY_SHOME/Shifted  home  key  KEY_SIC/Shifted  input   key
+       KEY_SLEFT/Shifted left arrow key KEY_SMESSAGE/Shifted mes-
+       sage key KEY_SMOVE/Shifted move key KEY_SNEXT/Shifted next
+       key KEY_SOPTIONS/Shifted options key KEY_SPREVIOUS/Shifted
+       KEY_SRIGHT/Shifted right arrow  KEY_SRSUME/Shifted  resume
+       key  KEY_SSAVE/Shifted  save key KEY_SSUSPEND/Shifted sus-
+       pend key KEY_SUNDO/Shifted  undo  key  KEY_SUSPEND/Suspend
+       key KEY_UNDO/Undo key
+
+       Keypad is arranged like this:
+
+       center  allbox  tab(/)  ;  c c c .  A1/up/A3 left/B2/right
+       C1/down/C3
+
+       The has_key routine takes a key value from the above list,
+       and  returns TRUE or FALSE according as the current termi-
+       nal type recognizes a key with that value.
+
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon  failure  and  an
+       integer value other than ERR (OK in the case of ungetch())
+       upon successful completion.
+
+
+
+

NOTES

+       Use of the escape key by a programmer for a single charac-
+       ter  function  is discouraged, as it will cause a delay of
+       up to one second while the keypad code looks for a follow-
+       ing function-key sequence.
+
+       When  using  getch, wgetch, mvgetch, or mvwgetch, nocbreak
+       mode (nocbreak) and echo mode (echo) should not be used at
+       the  same  time.  Depending on the state of the tty driver
+       when each character is  typed,  the  program  may  produce
+       undesirable results.
+
+       Note that getch, mvgetch, and mvwgetch may be macros.
+
+       Historically, the set of keypad macros was largely defined
+       by the extremely function-key-rich keyboard  of  the  AT&T
+       7300,  aka  3B1,  aka Safari 4.  Modern personal computers
+       usually have only a small subset of these.   IBM  PC-style
+       consoles   typically  support  little  more  than  KEY_UP,
+       KEY_DOWN,   KEY_LEFT,   KEY_RIGHT,   KEY_HOME,    KEY_END,
+       KEY_NPAGE, KEY_PPAGE, and function keys 1 through 12.  The
+       Ins key is usually mapped to KEY_IC.
+
+
+
+

PORTABILITY

+       The *get* functions are described in the XSI Curses  stan-
+       dard,  Issue  4.   They  read single-byte characters only.
+       The standard specifies that they return  ERR  on  failure,
+       but specifies no error conditions.
+
+       The  echo  behavior of these functions on input of KEY_ or
+       backspace characters was not specified in the  SVr4  docu-
+       mentation.   This  description  is  adopted  from  the XSI
+       dled  signals  is  unspecified  in the SVr4 and XSI Curses
+       documentation.  Under historical  curses  implementations,
+       it  varied  depending  on  whether  the operating system's
+       implementation of  handled  signal  receipt  interrupts  a
+       read(2)  call in progress or not, and also (in some imple-
+       mentations) depending on whether an input timeout or  non-
+       blocking mode hsd been set.
+
+       Programmers concerned about portability should be prepared
+       for either of two  cases:  (a)  signal  receipt  does  not
+       interrupt  getch;  (b) signal receipt interrupts getch and
+       causes it to return ERR with errno set  to  EINTR.   Under
+       the  ncurses  implementation, handled signals never inter-
+       rupt getch.
+
+       The has_key function is unique to ncurses.   We  recommend
+       that  any  code using it be conditionalized on the NCURSES
+       feature macro.
+
+
+
+

SEE ALSO

+       curses(3X),        curs_inopts(3X),         curs_move(3X),
+       curs_refresh(3X).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_getstr.3x.html b/Ada95/html/curs_getstr.3x.html new file mode 100644 index 00000000..9d14eb7c --- /dev/null +++ b/Ada95/html/curs_getstr.3x.html @@ -0,0 +1,122 @@ + + +
+       getstr,  wgetstr,  mvgetstr,  mvwgetstr, wgetnstr - accept
+       character strings from curses terminal keyboard
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int getstr(char *str);
+       int getnstr(char *str, int n);
+       int wgetstr(WINDOW *win, char *str);
+       int mvgetstr(int y, int x, char *str);
+       int mvwgetstr(WINDOW *win, int y, int x, char *str);
+       int mvgetnstr(int y, int x, char *str, int n);
+       int mvwgetnstr(WINDOW *, int y, int x, char *str, int n);
+       int wgetnstr(WINDOW *win, char *str, int n);
+
+
+
+

DESCRIPTION

+       The function getstr is equivalent to a series of calls  to
+       getch, until a newline or carriage return is received (the
+       terminating character is  not  included  in  the  returned
+       string).   The  resulting  value  is  placed  in  the area
+       pointed to by the character pointer str.
+
+       wgetnstr reads at most n  characters,  thus  preventing  a
+       possible  overflow  of  the  input buffer.  Any attempt to
+       enter more characters (other than the terminating  newline
+       or  carriage  return)  causes  a beep.  Function keys also
+       cause a beep and are ignored.  The getnstr function  reads
+       from the stdscr default window.
+
+       The  user's erase and kill characters are interpreted.  If
+       keypad  mode  is  on  for   the   window,   KEY_LEFT   and
+       KEY_BACKSPACE are both considered equivalent to the user's
+       kill character.
+
+       Characters input are echoed only if echo is currently  on.
+       In  that case, backspace is echoed as deletion of the pre-
+       vious character (typically a left motion).
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon failure and an OK
+       (SVr4  specifies  only  "an integer value other than ERR")
+       upon successful completion.
+
+
+
+

NOTES

+       Note that getstr, mvgetstr, and mvwgetstr may be macros.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue  4.   They  read  single-byte  characters only.  The
+       standard specifies that they return ERR  on  failure,  but
+       the  single  error  condition  EOVERFLOW  associated  with
+       extended-level conformance is not yet  returned  (the  XSI
+
+       SVr3 and early SVr4 curses implementations did not  reject
+       function keys; the SVr4.0 documentation claimed that "spe-
+       cial keys" (such as function  keys,  "home"  key,  "clear"
+       key,  etc.)  are  interpreted" without giving details.  It
+       lied.  In fact, the  `character'  value  appended  to  the
+       string  by  those  implementations was predictable but not
+       useful (being, in fact, the low-order eight  bits  of  the
+       key's KEY_ value).
+
+       The functions getnstr, mvgetnstr, and mvwgetnstr were pre-
+       sent but not documented in SVr4.
+
+
+
+

SEE ALSO

+       curses(3X), curs_getch(3X).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_getyx.3x.html b/Ada95/html/curs_getyx.3x.html new file mode 100644 index 00000000..89231567 --- /dev/null +++ b/Ada95/html/curs_getyx.3x.html @@ -0,0 +1,70 @@ + + +
+       getyx,  getparyx,  getbegyx,  getmaxyx - get curses cursor
+       and window coordinates
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       void getyx(WINDOW *win, int y, int x);
+       void getparyx(WINDOW *win, int y, int x);
+       void getbegyx(WINDOW *win, int y, int x);
+       void getmaxyx(WINDOW *win, int y, int x);
+
+
+
+

DESCRIPTION

+       The getyx macro places the current cursor position of  the
+       given window in the two integer variables y and x.
+
+       If  win  is  a  subwindow,  the  getparyx macro places the
+       beginning coordinates of the  subwindow  relative  to  the
+       parent  window into two integer variables y and x.  Other-
+       wise, -1 is placed into y and x.
+
+       Like getyx, the getbegyx and  getmaxyx  macros  store  the
+       current  beginning  coordinates  and size of the specified
+       window.
+
+
+
+

RETURN VALUE

+       The return values of these  macros  are  undefined  (i.e.,
+       they  should not be used as the right-hand side of assign-
+       ment statements).
+
+
+
+

NOTES

+       All of these interfaces are macros and  that  "&"  is  not
+       necessary before the variables y and x.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.
+
+
+
+

SEE ALSO

+       curses(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_inch.3x.html b/Ada95/html/curs_inch.3x.html new file mode 100644 index 00000000..093f99ad --- /dev/null +++ b/Ada95/html/curs_inch.3x.html @@ -0,0 +1,68 @@ + + +
+       inch,  winch,  mvinch,  mvwinch  -  get  a  character  and
+       attributes from a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       chtype inch(void);
+       chtype winch(WINDOW *win);
+       chtype mvinch(int y, int x);
+       chtype mvwinch(WINDOW *win, int y, int x);
+
+
+
+

DESCRIPTION

+       These routines return the character, of  type  chtype,  at
+       the   current  position  in  the  named  window.   If  any
+       attributes are set for that  position,  their  values  are
+       OR'ed  into  the  value  returned.   Constants  defined in
+       <curses.h> can be used with the & (logical  AND)  operator
+       to extract the character or attributes alone.
+
+
+   Attributes
+       The  following  bit-masks  may  be  AND-ed with characters
+       returned by winch.
+
+       l  l  .   A_CHARTEXT     Bit-mask  to  extract   character
+       A_ATTRIBUTES   Bit-mask   to  extract  attributes  A_COLOR
+            Bit-mask to extract color-pair field information
+
+
+
+

NOTES

+       Note that all of these routines may be macros.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue 4.
+
+
+
+

SEE ALSO

+       curses(3X).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_inchstr.3x.html b/Ada95/html/curs_inchstr.3x.html new file mode 100644 index 00000000..c8b5fde8 --- /dev/null +++ b/Ada95/html/curs_inchstr.3x.html @@ -0,0 +1,70 @@ + + +
+       inchstr,   inchnstr,   winchstr,   winchnstr,   mvinchstr,
+       mvinchnstr, mvwinchstr, mvwinchnstr  -  get  a  string  of
+       characters (and attributes) from a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int inchstr(chtype *chstr);
+       int inchnstr(chtype *chstr, int n);
+       int winchstr(WINDOW *win, chtype *chstr);
+       int winchnstr(WINDOW *win, chtype *chstr, int n);
+       int mvinchstr(int y, int x, chtype *chstr);
+       int mvinchnstr(int y, int x, chtype *chstr, int n);
+       int mvwinchstr(WINDOW *win, int y, int x, chtype *chstr);
+       int  mvwinchnstr(WINDOW *win, int y, int x, chtype *chstr,
+       int n);
+
+
+
+

DESCRIPTION

+       These routines return a NULL-terminated  array  of  chtype
+       quantities, starting at the current cursor position in the
+       named window and ending at the right margin of the window.
+       The  four  functions with n as the last argument, return a
+       leading substring at most n characters long (exclusive  of
+       the  trailing (chtype)0).  Constants defined in <curses.h>
+       can be used with the & (logical AND) operator  to  extract
+       the  character or the attribute alone from any position in
+       the chstr [see curs_inch(3X)].
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon  failure  and  an
+       integer  value  other  than ERR upon successful completion
+       (the number of  characters  retrieved,  exclusive  of  the
+       trailing 0).
+
+
+
+

NOTES

+       Note  that  all  routines  except winchnstr may be macros.
+       SVr4 does not document whether the result string is 0-ter-
+       minated; it does not document whether a length limit argu-
+       ment includes any trailing 0; and it does not document the
+       meaning of the return value.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  It is no more specific than the SVr4  documenta-
+       tion on the trailing 0.  It does specify that the success-
+       ful return of the functions is OK.
+
+
+
+

SEE ALSO

+       curses(3X), curs_inch(3X).
+
+
+
+
+ + diff --git a/Ada95/html/curs_initscr.3x.html b/Ada95/html/curs_initscr.3x.html new file mode 100644 index 00000000..78d883ab --- /dev/null +++ b/Ada95/html/curs_initscr.3x.html @@ -0,0 +1,122 @@ + + +
+       initscr,  newterm, endwin, isendwin, set_term, delscreen -
+       curses screen initialization and manipulation routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       WINDOW *initscr(void);
+       int endwin(void);
+       int isendwin(void);
+       SCREEN  *newterm(const  char  *type,  FILE  *outfd,   FILE
+       *infd);
+       SCREEN *set_term(SCREEN *new);
+       void delscreen(SCREEN* sp);
+
+
+
+

DESCRIPTION

+       initscr  is normally the first curses routine to call when
+       initializing a program.  A few special routines  sometimes
+       need  to  be called before it; these are slk_init, filter,
+       ripoffline, use_env.  For multiple-terminal  applications,
+       newterm may be called before initscr.
+
+       The initscr code determines the terminal type and initial-
+       izes all curses data structures.  initscr also causes  the
+       first  call  to  refresh  to  clear the screen.  If errors
+       occur, initscr writes  an  appropriate  error  message  to
+       standard error and exits; otherwise, a pointer is returned
+       to stdscr.
+
+       A program that outputs to more than  one  terminal  should
+       use  the  newterm  routine  for  each  terminal instead of
+       initscr.  A program that needs to inspect capabilities, so
+       it can continue to run in a line-oriented mode if the ter-
+       minal cannot support a screen-oriented program, would also
+       use  newterm.   The  routine newterm should be called once
+       for each terminal.  It returns a variable of type SCREEN *
+       which  should  be  saved  as a reference to that terminal.
+       The arguments are the type of the terminal to be  used  in
+       place of $TERM, a file pointer for output to the terminal,
+       and another file pointer for input from the  terminal  (if
+       type  is NULL, $TERM will be used).  The program must also
+       call endwin for each terminal being  used  before  exiting
+       from  curses.  If newterm is called more than once for the
+       same terminal, the first terminal referred to must be  the
+       last one for which endwin is called.
+
+       A  program  should  always  call  endwin before exiting or
+       escaping  from  curses  mode  temporarily.   This  routine
+       restores  tty  modes,  moves the cursor to the lower left-
+       hand corner of the screen and resets the terminal into the
+       proper non-visual mode.  Calling refresh or doupdate after
+       a temporary escape causes the  program  to  resume  visual
+       mode.
+       called without any subsequent calls to wrefresh, and FALSE
+       otherwise.
+
+       The  set_term  routine is used to switch between different
+       terminals.  The screen reference new becomes the new  cur-
+       rent  terminal.   The previous terminal is returned by the
+       routine.  This  is  the  only  routine  which  manipulates
+       SCREEN  pointers;  all other routines affect only the cur-
+       rent terminal.
+
+       The delscreen routine frees storage  associated  with  the
+       SCREEN  data  structure.   The  endwin routine does not do
+       this, so delscreen should be called after endwin if a par-
+       ticular SCREEN is no longer needed.
+
+
+
+

RETURN VALUE

+       endwin  returns  the  integer ERR upon failure and OK upon
+       successful completion.
+
+       Routines that return pointers always return NULL on error.
+
+
+
+

NOTES

+       Note that initscr and newterm may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  It specifies that portable applications must not
+       call initscr more than once.
+
+
+
+

SEE ALSO

+       curses(3X),       curs_kernel(3X),       curs_refresh(3X),
+       curs_slk(3X), curs_util(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_inopts.3x.html b/Ada95/html/curs_inopts.3x.html new file mode 100644 index 00000000..47eab78c --- /dev/null +++ b/Ada95/html/curs_inopts.3x.html @@ -0,0 +1,226 @@ + + +
+       cbreak, nocbreak, echo, noecho, halfdelay, intrflush, key-
+       pad, meta,  nodelay,  notimeout,  raw,  noraw,  noqiflush,
+       qiflush,  timeout,  wtimeout,  typeahead  -  curses  input
+       options
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int cbreak(void);
+       int nocbreak(void);
+       int echo(void);
+       int noecho(void);
+       int halfdelay(int tenths);
+       int intrflush(WINDOW *win, bool bf);
+       int keypad(WINDOW *win, bool bf);
+       int meta(WINDOW *win, bool bf);
+       int nodelay(WINDOW *win, bool bf);
+       int raw(void);
+       int noraw(void);
+       void noqiflush(void);
+       void qiflush(void);
+       int notimeout(WINDOW *win, bool bf);
+       void timeout(int delay);
+       void wtimeout(WINDOW *win, int delay);
+       int typeahead(int fd);
+
+
+
+

DESCRIPTION

+       Normally, the tty driver buffers typed characters until  a
+       newline  or  carriage return is typed.  The cbreak routine
+       disables line buffering and erase/kill  character-process-
+       ing  (interrupt  and  flow  control  characters  are unaf-
+       fected), making characters typed by the  user  immediately
+       available  to  the  program.  The nocbreak routine returns
+       the terminal to normal (cooked) mode.
+
+       Initially the terminal may or may not be in  cbreak  mode,
+       as the mode is inherited; therefore, a program should call
+       cbreak or nocbreak explicitly.  Most interactive  programs
+       using  curses set the cbreak mode.  Note that cbreak over-
+       rides raw.  [See curs_getch(3X) for a  discussion  of  how
+       these routines interact with echo and noecho.]
+
+       The  echo  and  noecho routines control whether characters
+       typed by the user are echoed by getch as they  are  typed.
+       Echoing  by  the  tty  driver is always disabled, but ini-
+       tially getch is in echo  mode,  so  characters  typed  are
+       echoed.  Authors of most interactive programs prefer to do
+       their own echoing in a controlled area of the  screen,  or
+       not  to  echo  at  all, so they disable echoing by calling
+       noecho.  [See curs_getch(3X) for a discussion of how these
+       routines interact with cbreak and nocbreak.]
+
+       user  are  immediately available to the program.  However,
+       after blocking  for  tenths  tenths  of  seconds,  ERR  is
+       returned  if  nothing has been typed.  The value of tenths
+       must be a number between 1 and 255.  Use nocbreak to leave
+       half-delay mode.
+
+       If  the intrflush option is enabled, (bf is TRUE), when an
+       interrupt key  is  pressed  on  the  keyboard  (interrupt,
+       break,  quit)  all  output in the tty driver queue will be
+       flushed, giving the  effect  of  faster  response  to  the
+       interrupt,  but  causing  curses to have the wrong idea of
+       what is on the  screen.   Disabling  (bf  is  FALSE),  the
+       option  prevents the flush.  The default for the option is
+       inherited from the tty driver settings.  The window  argu-
+       ment is ignored.
+
+       The  keypad option enables the keypad of the user's termi-
+       nal.  If enabled (bf is TRUE), the user can press a  func-
+       tion  key (such as an arrow key) and wgetch returns a sin-
+       gle value representing the function key, as  in  KEY_LEFT.
+       If  disabled (bf is FALSE), curses does not treat function
+       keys specially and the program has to interpret the escape
+       sequences  itself.   If  the keypad in the terminal can be
+       turned on  (made  to  transmit)  and  off  (made  to  work
+       locally),  turning on this option causes the terminal key-
+       pad to be turned on when wgetch is  called.   The  default
+       value for keypad is false.
+
+       Initially, whether the terminal returns 7 or 8 significant
+       bits on input depends on  the  control  mode  of  the  tty
+       driver  [see  termio(7)].  To force 8 bits to be returned,
+       invoke meta(win, TRUE); this is equivalent,  under  POSIX,
+       to  setting the CS8 flag on the terminal.  To force 7 bits
+       to be returned, invoke meta(win, FALSE); this  is  equiva-
+       lent,  under  POSIX, to setting the CS8 flag on the termi-
+       nal.  The window argument, win, is always ignored.  If the
+       terminfo capabilities smm (meta_on) and rmm (meta_off) are
+       defined for the terminal, smm is sent to the terminal when
+       meta(win,  TRUE)  is called and rmm is sent when meta(win,
+       FALSE) is called.
+
+       The nodelay option causes getch to be a non-blocking call.
+       If  no input is ready, getch returns ERR.  If disabled (bf
+       is FALSE), getch waits until a key is pressed.
+
+       While interpreting an input escape sequence, wgetch sets a
+       timer  while  waiting  for the next character.  If notime-
+       out(win, TRUE) is called,  then  wgetch  does  not  set  a
+       timer.   The  purpose  of  the timeout is to differentiate
+       between sequences received from a function key  and  those
+       typed by a user.
+
+       characters  typed  are  immediately  passed through to the
+       user program.  The differences are that in raw  mode,  the
+       interrupt,  quit, suspend, and flow control characters are
+       all passed through uninterpreted, instead of generating  a
+       signal.   The  behavior  of the BREAK key depends on other
+       bits in the tty driver that are not set by curses.
+
+       When the noqiflush routine is used, normal flush of  input
+       and  output queues associated with the INTR, QUIT and SUSP
+       characters will not be done [see termio(7)].  When qiflush
+       is  called,  the queues will be flushed when these control
+       characters are read.  You may want to call noqiflush()  in
+       a  signal handler if you want output to continue as though
+       the interrupt had not occurred, after the handler exits.
+
+       The timeout and wtimeout routines  set  blocking  or  non-
+       blocking  read  for a given window.  If delay is negative,
+       blocking  read  is  used  (i.e.,  waits  indefinitely  for
+       input).   If delay is zero, then non-blocking read is used
+       (i.e., read returns ERR if no input is waiting).  If delay
+       is  positive, then read blocks for delay milliseconds, and
+       returns ERR if there is still no input.  Hence, these rou-
+       tines  provide the same functionality as nodelay, plus the
+       additional capability of being  able  to  block  for  only
+       delay milliseconds (where delay is positive).
+
+       The  curses library does ``line-breakout optimization'' by
+       looking for  typeahead  periodically  while  updating  the
+       screen.   If  input is found, and it is coming from a tty,
+       the current update is postponed until refresh or  doupdate
+       is  called again.  This allows faster response to commands
+       typed in advance.  Normally, the input FILE pointer passed
+       to  newterm,  or  stdin in the case that initscr was used,
+       will be used to do this typeahead checking.  The typeahead
+       routine  specifies  that  the  file descriptor fd is to be
+       used to check for typeahead instead.  If fd is -1, then no
+       typeahead checking is done.
+
+
+
+

RETURN VALUE

+       All  routines that return an integer return ERR upon fail-
+       ure and OK (SVr4 specifies only "an  integer  value  other
+       than  ERR")  upon  successful completion, unless otherwise
+       noted in the preceding routine descriptions.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue 4.
+
+       The  ncurses  library obeys the XPG4 standard and the his-
+       torical practice of the AT&T  curses  implementations,  in
+       that  the  echo bit is cleared when curses initializes the
+       terminal state.  BSD curses differed from  this  slightly;
+       ity,  set echo or noecho explicitly just after initializa-
+       tion, even if your program remains in cooked mode.
+
+
+
+

NOTES

+       Note that echo, noecho, halfdelay, intrflush, meta,  node-
+       lay,  notimeout, noqiflush, qiflush, timeout, and wtimeout
+       may be macros.
+
+       The noraw and nocbreak calls follow historical practice in
+       that  they  attempt  to  restore to normal (`cooked') mode
+       from raw and cbreak modes respectively.  Mixing  raw/noraw
+       and  cbreak/nocbreak  calls  leads  to  tty driver control
+       states that are hard to predict or understand; it  is  not
+       recommended.
+
+
+
+

SEE ALSO

+       curses(3X), curs_getch(3X), curs_initscr(3X), termio(7)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_insch.3x.html b/Ada95/html/curs_insch.3x.html new file mode 100644 index 00000000..36b7f32b --- /dev/null +++ b/Ada95/html/curs_insch.3x.html @@ -0,0 +1,70 @@ + + +
+       insch,  winsch,  mvinsch,  mvwinsch  -  insert a character
+       before cursor in a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int insch(chtype ch);
+       int winsch(WINDOW *win, chtype ch);
+       int mvinsch(int y, int x, chtype ch);
+       int mvwinsch(WINDOW *win, int y, int x, chtype ch);
+
+
+
+

DESCRIPTION

+       These routines, insert the character ch before the charac-
+       ter  under the cursor.  All characters to the right of the
+       cursor are moved one space to the right, with  the  possi-
+       bility  of the rightmost character on the line being lost.
+       The insertion operation does not change the  cursor  posi-
+       tion.
+
+
+
+

RETURN VALUE

+       All  routines that return an integer return ERR upon fail-
+       ure and OK (SVr4 specifies only "an  integer  value  other
+       than  ERR")  upon  successful completion, unless otherwise
+       noted in the preceding routine descriptions.
+
+
+
+

NOTES

+       These routines do not necessarily imply use of a  hardware
+       insert character feature.
+
+       Note that insch, mvinsch, and mvwinsch may be macros.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.
+
+
+
+

SEE ALSO

+       curses(3X).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_insstr.3x.html b/Ada95/html/curs_insstr.3x.html new file mode 100644 index 00000000..a6fe2b45 --- /dev/null +++ b/Ada95/html/curs_insstr.3x.html @@ -0,0 +1,120 @@ + + +
+       insstr,  insnstr,  winsstr, winsnstr, mvinsstr, mvinsnstr,
+       mvwinsstr, mvwinsnstr - insert string before cursor  in  a
+       curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       int insstr(const char *str);
+       int insnstr(const char *str, int n);
+       int winsstr(WINDOW *win, const char *str);
+       int winsnstr(WINDOW *win, const char *str, int n);
+       int mvinsstr(int y, int x, const char *str);
+       int mvinsnstr(int y, int x, const char *str, int n);
+       int mvwinsstr(WINDOW *win, int y, int x, const char *str);
+       int mvwinsnstr(WINDOW *win, int y, int x, const char *str,
+       int n);
+
+
+
+

DESCRIPTION

+       These  routines insert a character string (as many charac-
+       ters as will fit on the line) before the  character  under
+       the cursor.  All characters to the right of the cursor are
+       shifted right, with the possibility of the rightmost char-
+       acters  on  the line being lost.  The cursor position does
+       not change (after moving to y, x, if specified). The  four
+       routines with n as the last argument insert a leading sub-
+       string of at most n characters.  If n<=0, then the  entire
+       string is inserted.
+
+       If  a  character in str is a tab, newline, carriage return
+       or backspace, the cursor is moved appropriately within the
+       window.   A  newline  also  does a clrtoeol before moving.
+       Tabs are considered to be at every eighth  column.   If  a
+       character in str is another control character, it is drawn
+       in the ^X notation.  Calling winch after adding a  control
+       character (and moving to it, if necessary) does not return
+       the control character, but instead returns a character  in
+       the the ^-representation of the control character.
+
+
+
+

RETURN VALUE

+       All  routines that return an integer return ERR upon fail-
+       ure and OK (SVr4 specifies only "an  integer  value  other
+       than  ERR")  upon  successful completion, unless otherwise
+       noted in the preceding routine descriptions.
+
+
+
+

NOTES

+       Note that all but winsnstr may be macros.
+
+
+
+

PORTABILITY

+       These functions are described in the XSI Curses  standard,
+       Issue  4,  which  adds  const qualifiers to the arguments.
+       The XSI Curses error  conditions  EILSEQ  and  EILOVERFLOW
+       associated  with  extended-level  conformance  are not yet
+       detected (this implementation does not  yet  support  XPG4
+       curses(3X), curs_clear(3X), curs_inch(3X).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_instr.3x.html b/Ada95/html/curs_instr.3x.html new file mode 100644 index 00000000..487bd07c --- /dev/null +++ b/Ada95/html/curs_instr.3x.html @@ -0,0 +1,70 @@ + + +
+       instr,  innstr, winstr, winnstr, mvinstr, mvinnstr, mvwin-
+       str, mvwinnstr - get a string of characters from a  curses
+       window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int instr(char *str);
+       int innstr(char *str, int n);
+       int winstr(WINDOW *win, char *str);
+       int winnstr(WINDOW *win, char *str, int n);
+       int mvinstr(int y, int x, char *str);
+       int mvinnstr(int y, int x, char *str, int n);
+       int mvwinstr(WINDOW *win, int y, int x, char *str);
+       int  mvwinnstr(WINDOW  *win,  int y, int x, char *str, int
+       n);
+
+
+
+

DESCRIPTION

+       These routines return  a  string  of  characters  in  str,
+       extracted  starting  at the current cursor position in the
+       named window.  Attributes are stripped  from  the  charac-
+       ters.   The  four  functions  with  n as the last argument
+       return a leading  substring  at  most  n  characters  long
+       (exclusive of the trailing NUL).
+
+
+
+

RETURN VALUE

+       All  of the functions return ERR upon failure, or the num-
+       ber of characters actually read into the string.
+
+
+
+

NOTES

+       Note that all routines except winnstr may be macros.
+
+
+
+

PORTABILITY

+       The XSI Curses error  conditions  EILSEQ  and  EILOVERFLOW
+       associated  with  extended-level  conformance  are not yet
+       detected (this implementation does not  yet  support  XPG4
+       multi-byte  characters).  SVr4 does not document whether a
+       length limit includes or excludes the trailing NUL.
+
+       The ncurses library extends the XSI description by  allow-
+       ing  a  negative value for n.  In this case, the functions
+       return the string ending at the right margin.
+
+
+
+

SEE ALSO

+       curses(3X).
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_kernel.3x.html b/Ada95/html/curs_kernel.3x.html new file mode 100644 index 00000000..82b012f7 --- /dev/null +++ b/Ada95/html/curs_kernel.3x.html @@ -0,0 +1,172 @@ + + +
+       def_prog_mode,       def_shell_mode,      reset_prog_mode,
+       reset_shell_mode, resetty, savetty, getsyx, setsyx, ripof-
+       fline, curs_set, napms - low-level xscurses routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int def_prog_mode(void);
+       int def_shell_mode(void);
+       int reset_prog_mode(void);
+       int reset_shell_mode(void);
+       int resetty(void);
+       int savetty(void);
+       void getsyx(int y, int x);
+       void setsyx(int y, int x);
+       int ripoffline(int line, int (*init)(WINDOW *, int));
+       int curs_set(int visibility);
+       int napms(int ms);
+
+
+
+

DESCRIPTION

+       The  following  routines  give low-level access to various
+       curses capabilities.  Theses routines typically  are  used
+       inside library routines.
+
+       The  def_prog_mode  and  def_shell_mode  routines save the
+       current terminal modes as the  "program"  (in  curses)  or
+       "shell"   (not   in   curses)   state   for   use  by  the
+       reset_prog_mode and reset_shell_mode  routines.   This  is
+       done  automatically  by  initscr.   There is one such save
+       area for each screen context allocated by newterm().
+
+       The reset_prog_mode and reset_shell_mode routines  restore
+       the  terminal  to "program" (in curses) or "shell" (out of
+       curses) state.  These are  done  automatically  by  endwin
+       and,  after  an  endwin, by doupdate, so they normally are
+       not called.
+
+       The resetty and savetty  routines  save  and  restore  the
+       state  of  the  terminal modes.  savetty saves the current
+       state in a buffer and resetty restores the state  to  what
+       it was at the last call to savetty.
+
+       The  getsyx routine returns the current coordinates of the
+       virtual screen cursor in y and x.  If leaveok is currently
+       TRUE,  then -1,-1 is returned.  If lines have been removed
+       from the top of the screen,  using  ripoffline,  y  and  x
+       include  these  lines;  therefore,  y and x should be used
+       only as arguments for setsyx.
+
+       The setsyx routine sets the virtual screen cursor to y, x.
+       If y and x are both -1, then leaveok is set.  The two rou-
+       tines getsyx and setsyx are  designed  to  be  used  by  a
+       cursor.   The  library  routine  would  call getsyx at the
+       beginning, do its manipulation of its own  windows,  do  a
+       wnoutrefresh  on  its  windows, call setsyx, and then call
+       doupdate.
+
+       The ripoffline routine provides access to the same  facil-
+       ity  that  slk_init  [see curs_slk(3X)] uses to reduce the
+       size of the screen.   ripoffline  must  be  called  before
+       initscr or newterm is called.  If line is positive, a line
+       is removed from the top of stdscr; if line is negative,  a
+       line is removed from the bottom.  When this is done inside
+       initscr, the routine init (supplied by the user) is called
+       with  two arguments: a window pointer to the one-line win-
+       dow that has been allocated and an integer with the number
+       of columns in the window.  Inside this initialization rou-
+       tine, the integer variables LINES  and  COLS  (defined  in
+       <curses.h>) are not guaranteed to be accurate and wrefresh
+       or doupdate must not be called.  It is allowable  to  call
+       wnoutrefresh during the initialization routine.
+
+       ripoffline  can  be called up to five times before calling
+       initscr or newterm.
+
+       The curs_set routine sets  the  cursor  state  is  set  to
+       invisible, normal, or very visible for visibility equal to
+       0, 1, or 2 respectively.  If  the  terminal  supports  the
+       visibility   requested,   the  previous  cursor  state  is
+       returned; otherwise, ERR is returned.
+
+       The napms routine is used to sleep for ms milliseconds.
+
+
+
+

RETURN VALUE

+       Except for curs_set,  these  routines  always  return  OK.
+       curs_set  returns the previous cursor state, or ERR if the
+       requested visibility is not supported.
+
+
+
+

NOTES

+       Note that getsyx is a macro, so & is not necessary  before
+       the variables y and x.
+
+       The  SVr4 man pages warn that the return value of curs_set
+       "is currently incorrect".   This  implementation  gets  it
+       right, but it may be unwise to count on the correctness of
+       the return value anywhere else.
+
+
+
+

PORTABILITY

+       The functions setsyx and getsyx are not described  in  the
+       XSI  Curses standard, Issue 4.  All other functions are as
+       described in XSI Curses.
+
+       The SVr4 documentation describes setsyx and getsyx as hav-
+       ing  return  type  int.  This  is  misleading, as they are
+       curses(3X),       curs_initscr(3X),      curs_outopts(3X),
+       curs_refresh(3X), curs_scr_dump(3X), curs_slk(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_mouse.3x.html b/Ada95/html/curs_mouse.3x.html new file mode 100644 index 00000000..d328f533 --- /dev/null +++ b/Ada95/html/curs_mouse.3x.html @@ -0,0 +1,174 @@ + + +
+       getmouse,  ungetmouse, mousemask - mouse interface through
+       curses
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       typedef unsigned long mmask_t;
+
+       typedef struct
+       {
+           short id;         /* ID to distinguish multiple devices */
+           int x, y, z;      /* event coordinates */
+           mmask_t bstate;   /* button state bits */
+       }
+       MEVENT;
+       int getmouse(MEVENT *event);
+       int ungetmouse(MEVENT *event);
+       mmask_t mousemask(mmask_t newmask, mmask_t *oldmask);
+       bool wenclose(WINDOW *win, int y, int x)
+       int mouseinterval(int erval)
+
+
+
+

DESCRIPTION

+       These functions provide an interface to mouse events  from
+       ncurses(3x).   Mouse  events  are represented by KEY_MOUSE
+       pseudo-key values in the wgetch input stream.
+
+       To make mouse events visible, use the mousemask  function.
+       This  will  set  the  mouse  events  to  be  reported.  By
+       default, no mouse events are reported.  The function  will
+       return  a  mask  to  indicate which of the specified mouse
+       events can be reported; on complete failure it returns  0.
+       If  oldmask is non-NULL, this function fills the indicated
+       location with the previous value  of  the  given  window's
+       mouse event mask.
+
+       As  a  side  effect, setting a zero mousemask may turn off
+       the mouse pointer; setting a nonzero mask may turn it  on.
+       Whether this happens is device-dependent.
+
+       Here are the mouse event type masks:
+
+       l  l  _ _ l l.  Name Description BUTTON1_PRESSED     mouse
+       button 1 down BUTTON1_RELEASED    mouse button 1  up  BUT-
+       TON1_CLICKED        mouse       button      1      clicked
+       BUTTON1_DOUBLE_CLICKED   mouse  button  1  double  clicked
+       BUTTON1_TRIPLE_CLICKED   mouse  button  1  triple  clicked
+       BUTTON2_PRESSED       mouse      button       2       down
+       BUTTON2_RELEASED    mouse   button  2  up  BUTTON2_CLICKED
+           mouse button 2 clicked  BUTTON2_DOUBLE_CLICKED   mouse
+       button  2  double  clicked  BUTTON2_TRIPLE_CLICKED   mouse
+       button 2 triple clicked BUTTON3_PRESSED     mouse button 3
+       down BUTTON3_RELEASED    mouse button 3 up BUTTON3_CLICKED
+       button 3 triple clicked BUTTON4_PRESSED     mouse button 4
+       down BUTTON4_RELEASED    mouse button 4 up BUTTON4_CLICKED
+           mouse button 4 clicked  BUTTON4_DOUBLE_CLICKED   mouse
+       button  4  double  clicked  BUTTON4_TRIPLE_CLICKED   mouse
+       button 4 triple clicked BUTTON_SHIFT   shift was down dur-
+       ing  button  state  change BUTTON_CTRL    control was down
+       during button state  change  BUTTON_ALT     alt  was  down
+       during  button state change ALL_MOUSE_EVENTS    report all
+       button state changes REPORT_MOUSE_POSITION    report mouse
+       movement
+
+       Once  a  class of mouse events have been made visible in a
+       window, calling the wgetch function  on  that  window  may
+       return  KEY_MOUSE  as  an indicator that a mouse event has
+       been queued.  To read the event data and pop the event off
+       the queue, call getmouse.  This function will return OK if
+       a mouse event is actually visible in the given window, ERR
+       otherwise.   When  getmouse returns OK, the data deposited
+       as y and x in the  event  structure  coordinates  will  be
+       screen-relative  character-cell coordinates.  The returned
+       state mask will have exactly one bit set to  indicate  the
+       event type.
+
+       The  ungetmouse  function  behaves analogously to ungetch.
+       It pushes a KEY_MOUSE event  onto  the  input  queue,  and
+       associates  with  that  event  the  given  state  data and
+       screen-relative character-cell coordinates.
+
+       The wenclose  function  tests  whether  a  given  pair  of
+       screen-relative  character-cell coordinates is enclosed by
+       a given window, returning TRUE if it is and  FALSE  other-
+       wise.   It  is  useful  for determining what subset of the
+       screen windows enclose the location of a mouse event.
+
+       The mouseinterval function sets the maximum time (in thou-
+       sands  of  a  second)  that  can  elapse between press and
+       release events in order for them to  be  recognized  as  a
+       click.  This function returns the previous interval value.
+       The default is one fifth of a second.
+
+       Note that mouse events will be ignored when  input  is  in
+       cooked mode, and will cause an error beep when cooked mode
+       is being simulated in a window by a function such as  get-
+       str that expects a linefeed for input-loop termination.
+
+
+
+
+

RETURN VALUE

+       All  routines  return  the  integer ERR upon failure or OK
+       upon successful completion.
+
+
+
+

PORTABILITY

+       These calls were designed for  ncurses(3x),  and  are  not
+
+       The feature macro NCURSES_MOUSE_VERSION is provided so the
+       preprocessor  can  be  used to test whether these features
+       are present (its value is 1).   NOTE:  THIS  INTERFACE  IS
+       EXPERIMENTAL  AND IS SUBJECT TO CHANGE WITHOUT NOTICE!  If
+       the interface is changed, the value of  NCURSES_MOUSE_VER-
+       SION will be incremented.
+
+       The  order  of the MEVENT structure members is not guaran-
+       teed.  Additional fields may be added to the structure  in
+       the future.
+
+       Under  ncurses(3x),  these  calls  are  implemented  using
+       either xterm's built-in mouse-tracking API  or  Alessandro
+       Rubini's  gpm  server.   If  you are using something other
+       than xterm there is no gpm daemon running on your machine,
+       mouse  events  will not be visible to ncurses(3x) (and the
+       wmousemask function will always return 0).
+
+       The z member in the event structure is not presently used.
+       It  is  intended  for use with touch screens (which may be
+       pressure-sensitive)   or   with   3D-mice/trackballs/power
+       gloves.
+
+
+
+

BUGS

+       Mouse  events under xterm will not in fact be ignored dur-
+       ing cooked mode, if they have been enabled by  wmousemask.
+       Instead,  the  xterm  mouse report sequence will appear in
+       the string read.
+
+       Mouse events under xterm will not be detected correctly in
+       a window with its keypad bit off.
+
+
+
+

SEE ALSO

+       curses(3X).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_move.3x.html b/Ada95/html/curs_move.3x.html new file mode 100644 index 00000000..4edbae80 --- /dev/null +++ b/Ada95/html/curs_move.3x.html @@ -0,0 +1,70 @@ + + +
+       move, wmove - move curses window cursor
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int move(int y, int x);
+       int wmove(WINDOW *win, int y, int x);
+
+
+
+

DESCRIPTION

+       These  routines move the cursor associated with the window
+       to line y and column x.  This routine does  not  move  the
+       physical  cursor  of the terminal until refresh is called.
+       The position specified is relative to the upper  left-hand
+       corner of the window, which is (0,0).
+
+
+
+

RETURN VALUE

+       These routines return ERR upon failure and OK (SVr4 speci-
+       fies only "an integer value other than ERR") upon success-
+       ful completion.
+
+
+
+

NOTES

+       Note that move may be a macro.
+
+
+
+

PORTABILITY

+       These  functions are described in the XSI Curses standard,
+       Issue 4.  The standard specifies that if (y,x) is within a
+       multi-column  character,  the cursor is moved to the first
+       column of that  character;  however,  this  implementation
+       does  not  yet  support  the extended-level XSI multi-byte
+       characters.
+
+
+
+

SEE ALSO

+       curses(3X), curs_refresh(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_outopts.3x.html b/Ada95/html/curs_outopts.3x.html new file mode 100644 index 00000000..54e8aa71 --- /dev/null +++ b/Ada95/html/curs_outopts.3x.html @@ -0,0 +1,172 @@ + + +
+       clearok,   idlok,   idcok   immedok,  leaveok,  setscrreg,
+       wsetscrreg, scrollok, nl, nonl - curses output options
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int clearok(WINDOW *win, bool bf);
+       int idlok(WINDOW *win, bool bf);
+       void idcok(WINDOW *win, bool bf);
+       void immedok(WINDOW *win, bool bf);
+       int leaveok(WINDOW *win, bool bf);
+       int setscrreg(int top, int bot);
+       int wsetscrreg(WINDOW *win, int top, int bot);
+       int scrollok(WINDOW *win, bool bf);
+       int nl(void);
+       int nonl(void);
+
+
+
+

DESCRIPTION

+       These routines set options that change the style of output
+       within  curses.   All  options are initially FALSE, unless
+       otherwise stated.  It  is  not  necessary  to  turn  these
+       options off before calling endwin.
+
+       If  clearok is called with TRUE as argument, the next call
+       to wrefresh with this window will clear  the  screen  com-
+       pletely  and  redraw the entire screen from scratch.  This
+       is useful when the contents of the screen  are  uncertain,
+       or  in  some  cases for a more pleasing visual effect.  If
+       the win argument to clearok is the global variable curscr,
+       the  next  call  to  wrefresh  with  any window causes the
+       screen to be cleared and repainted from scratch.
+
+       If idlok is called with TRUE as  second  argument,  curses
+       considers using the hardware insert/delete line feature of
+       terminals so equipped.  Calling idlok with FALSE as second
+       argument  disables  use  of  line  insertion and deletion.
+       This option should be  enabled  only  if  the  application
+       needs  insert/delete  line, for example, for a screen edi-
+       tor.  It is disabled by default because insert/delete line
+       tends  to  be  visually annoying when used in applications
+       where it isn't really needed.  If insert/delete line  can-
+       not  be  used,  curses redraws the changed portions of all
+       lines.
+
+       If idcok is called with FALSE as second  argument,  curses
+       no longer considers using the hardware insert/delete char-
+       acter feature of terminals so equipped.  Use of  character
+       insert/delete  is  enabled by default.  Calling idcok with
+       TRUE as second argument re-enables use of character inser-
+       tion and deletion.
+
+       If  immedok is called with TRUE as argument, any change in
+       fresh.  However, it may degrade performance  considerably,
+       due  to  repeated  calls  to  wrefresh.  It is disabled by
+       default.
+
+       Normally, the hardware cursor is left at the  location  of
+       the  window  cursor  being  refreshed.  The leaveok option
+       allows the cursor to be left wherever the  update  happens
+       to leave it.  It is useful for applications where the cur-
+       sor is not used, since it  reduces  the  need  for  cursor
+       motions.   If  possible, the cursor is made invisible when
+       this option is enabled.
+
+       The setscrreg and wsetscrreg routines allow  the  applica-
+       tion  programmer  to  set a software scrolling region in a
+       window.  top and bot are the line numbers of the  top  and
+       bottom margin of the scrolling region.  (Line 0 is the top
+       line of the window.)  If  this  option  and  scrollok  are
+       enabled,  an  attempt  to  move off the bottom margin line
+       causes all lines in the scrolling  region  to  scroll  one
+       line in the direction of the first line.  Only the text of
+       the window is scrolled.  (Note that this has nothing to do
+       with  the use of a physical scrolling region capability in
+       the terminal, like that in the VT100.  If idlok is enabled
+       and   the  terminal  has  either  a  scrolling  region  or
+       insert/delete line capability, they will probably be  used
+       by the output routines.)
+
+       The  scrollok option controls what happens when the cursor
+       of a window is  moved  off  the  edge  of  the  window  or
+       scrolling  region,  either as a result of a newline action
+       on the bottom line, or typing the last  character  of  the
+       last line.  If disabled, (bf is FALSE), the cursor is left
+       on the bottom line.  If enabled, (bf is TRUE), the  window
+       is  scrolled  up  one  line (Note that in order to get the
+       physical scrolling effect on the terminal, it is also nec-
+       essary to call idlok).
+
+       The  nl  and  nonl routines control whether the underlying
+       display device translates the return key into  newline  on
+       input,  and  whether it translates newline into return and
+       line-feed on output (in either case,  the  call  addch('0)
+       does the equivalent of return and line feed on the virtual
+       screen).  Initially, these translations do occur.  If  you
+       disable  them using nonl, curses will be able to make bet-
+       ter use of the line-feed capability, resulting  in  faster
+       cursor  motion.   Also, curses will then be able to detect
+       the return key.
+
+
+
+

RETURN VALUE

+       The functions setscrreg and wsetscrreg return OK upon suc-
+       cess  and ERR upon failure. All other routines that return
+       an integer always return OK.
+       These functions are described in the XSI Curses  standard,
+       Issue 4.
+
+       The  XSI  Curses  standard is ambiguous on the question of
+       whether raw() should disable the  CRLF  translations  con-
+       trolled by nl() and nonl().  BSD curses did turn off these
+       translations; AT&T curses (at least as late as  SVr1)  did
+       not.   We choose to do so, on the theory that a programmer
+       requesting raw input wants a clean (ideally  8-bit  clean)
+       connection that the operating system does not mess with.
+
+       Some  historic  curses  implementations had, as an undocu-
+       mented feature,  the  ability  to  do  the  equivalent  of
+       clearok(...,  1)  by saying touchwin(stdscr) or clear(std-
+       scr).  This will not work under ncurses.
+
+       Earlier System V  curses  implementations  specified  that
+       with  scrollok enabled, any window modification triggering
+       a scroll also forced a physical refresh.  XSI Curses  does
+       not  require this, and ncurses avoids doing it in order to
+       perform better vertical-motion  optimization  at  wrefresh
+       time.
+
+
+
+

NOTES

+       Note  that clearok, leaveok, scrollok, idcok, nl, nonl and
+       setscrreg may be macros.
+
+       The immedok routine is useful for windows that are used as
+       terminal emulators.
+
+
+
+

SEE ALSO

+       curses(3X),         curs_addch(3X),        curs_clear(3X),
+       curs_initscr(3X), curs_scroll(3X), curs_refresh(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_overlay.3x.html b/Ada95/html/curs_overlay.3x.html new file mode 100644 index 00000000..4c892d66 --- /dev/null +++ b/Ada95/html/curs_overlay.3x.html @@ -0,0 +1,70 @@ + + +
+       overlay, overwrite, copywin - overlay and manipulate over-
+       lapped curses windows
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int overlay(const WINDOW *srcwin, WINDOW *dstwin);
+       int overwrite(const WINDOW *srcwin, WINDOW *dstwin);
+       int copywin(WINDOW *srcwin, WINDOW *dstwin, int sminrow,
+             int smincol, int dminrow, int dmincol, int dmaxrow,
+             int dmaxcol, int overlay);
+
+
+
+

DESCRIPTION

+       The overlay and overwrite routines overlay srcwin  on  top
+       of  dstwin.   scrwin and dstwin are not required to be the
+       same size; only text where  the  two  windows  overlap  is
+       copied.  The difference is that overlay is non-destructive
+       (blanks are not copied) whereas overwrite is  destructive.
+
+       The  copywin  routine provides a finer granularity of con-
+       trol over the overlay and overwrite routines.  Like in the
+       prefresh routine, a rectangle is specified in the destina-
+       tion window, (dminrow, dmincol)  and  (dmaxrow,  dmaxcol),
+       and  the  upper-left-corner coordinates of the source win-
+       dow, (sminrow, smincol).  If the argument overlay is true,
+       then copying is non-destructive, as in overlay.
+
+
+
+

RETURN VALUE

+       Routines  that  return an integer return ERR upon failure,
+       and OK (SVr4 only specifies "an integer value  other  than
+       ERR") upon successful completion.
+
+
+
+

NOTES

+       Note that overlay and overwrite may be macros.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue 4 describes these functions
+       (adding the const qualifiers).  It further specifies their
+       behavior  in  the  presence  of characters with multi-byte
+       renditions (not yet supported in this implementation).
+
+
+
+

SEE ALSO

+       curses(3X), curs_pad(3X), curs_refresh(3X)
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_pad.3x.html b/Ada95/html/curs_pad.3x.html new file mode 100644 index 00000000..721b8ed9 --- /dev/null +++ b/Ada95/html/curs_pad.3x.html @@ -0,0 +1,122 @@ + + +
+       newpad, subpad, prefresh, pnoutrefresh, pechochar - create
+       and display curses pads
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       WINDOW *newpad(int nlines, int ncols);
+       WINDOW *subpad(WINDOW *orig, int nlines, int ncols,
+             int begin_y, int begin_x);
+       int prefresh(WINDOW *pad, int pminrow, int pmincol,
+             int sminrow, int smincol, int smaxrow, int smaxcol);
+       int pnoutrefresh(WINDOW *pad, int pminrow, int pmincol,
+             int sminrow, int smincol, int smaxrow, int smaxcol);
+       int pechochar(WINDOW *pad, chtype ch);
+
+
+
+

DESCRIPTION

+       The newpad routine creates and returns a pointer to a  new
+       pad data structure with the given number of lines, nlines,
+       and columns, ncols.  A pad is like a window,  except  that
+       it is not restricted by the screen size, and is not neces-
+       sarily associated with a particular part  of  the  screen.
+       Pads can be used when a large window is needed, and only a
+       part of the window will be on  the  screen  at  one  time.
+       Automatic refreshes of pads (e.g., from scrolling or echo-
+       ing of input) do not occur.  It is not legal to call  wre-
+       fresh  with a pad as an argument; the routines prefresh or
+       pnoutrefresh should be called instead.   Note  that  these
+       routines require additional parameters to specify the part
+       of the pad to be displayed and the location on the  screen
+       to be used for the display.
+
+       The subpad routine creates and returns a pointer to a sub-
+       window within a  pad  with  the  given  number  of  lines,
+       nlines,  and  columns,  ncols.   Unlike subwin, which uses
+       screen coordinates, the window is  at  position  (begin_x,
+       begin_y)  on the pad.  The window is made in the middle of
+       the window orig, so that changes made to one window affect
+       both  windows.   During  the  use of this routine, it will
+       often be necessary to call touchwin or touchline  on  orig
+       before calling prefresh.
+
+       The  prefresh  and  pnoutrefresh routines are analogous to
+       wrefresh and wnoutrefresh except that they relate to  pads
+       instead  of windows.  The additional parameters are needed
+       to indicate what part of the pad and screen are  involved.
+       pminrow  and pmincol specify the upper left-hand corner of
+       the rectangle to be displayed in the pad.  sminrow,  smin-
+       col, smaxrow, and smaxcol specify the edges of the rectan-
+       gle to be displayed on the screen.  The  lower  right-hand
+       corner of the rectangle to be displayed in the pad is cal-
+       culated from the screen coordinates, since the  rectangles
+       must  be  the same size.  Both rectangles must be entirely
+       treated as if they were zero.
+
+       The pechochar routine is functionally equivalent to a call
+       to  addch  followed by a call to refresh, a call to waddch
+       followed by a call to wrefresh, or a call to  waddch  fol-
+       lowed  by  a  call  to prefresh. The knowledge that only a
+       single character is being output is taken into  considera-
+       tion  and, for non-control characters, a considerable per-
+       formance gain  might  be  seen  by  using  these  routines
+       instead  of  their equivalents.  In the case of pechochar,
+       the last location of the pad on the screen is  reused  for
+       the arguments to prefresh.
+
+
+
+

RETURN VALUE

+       Routines  that  return  an integer return ERR upon failure
+       and OK (SVr4 only specifies "an integer value  other  than
+       ERR") upon successful completion.
+
+       Routines  that  return  pointers return NULL on error, and
+       set errno to ENOMEM.
+
+
+
+

NOTES

+       Note that pechochar may be a macro.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.
+
+
+
+

SEE ALSO

+       curses(3X),        curs_refresh(3X),       curs_touch(3X),
+       curs_addch(3X).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_print.3x.html b/Ada95/html/curs_print.3x.html new file mode 100644 index 00000000..fcf16ee0 --- /dev/null +++ b/Ada95/html/curs_print.3x.html @@ -0,0 +1,70 @@ + + +
+       mcprint - ship binary data to printer
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int mcprint(char *data, int len);
+
+
+
+

DESCRIPTION

+       This  function  uses the mc5p or mc4 and mc5 capabilities,
+       if they are present, to  ship  given  data  to  a  printer
+       attached to the terminal.
+
+       Note  that  the mcprint code has no way to do flow control
+       with the printer or to know how  much  buffering  it  has.
+       Your  application  is  responsible for keeping the rate of
+       writes to the printer below its continuous throughput rate
+       (typically  about  half  of its nominal cps rating).  Dot-
+       matrix printers and 6-page-per-minute lasers can typically
+       handle  80cps,  so a good conservative rule of thumb is to
+       sleep for a second after shipping each 80-character  line.
+
+
+
+
+

RETURN VALUE

+       The  mcprint  function  returns ERR if the write operation
+       aborted for some reason.  In this case, errno will contain
+       either  an  error  associated  with write(2) or one of the
+       following:
+
+       ENODEV
+            Capabilities for printer redirection don't exist.
+
+       ENOMEM
+            Couldn't allocate sufficient  memory  to  buffer  the
+            printer write.
+
+            When mcprint succeeds, it returns the number of char-
+            acters actually sent to the printer.
+
+
+
+

PORTABILITY

+       The mcprint call was designed for ncurses(3x), and is  not
+       found in SVr4 curses, 4.4BSD curses, or any other previous
+       version of curses.
+
+
+
+

BUGS

+       Padding in the mc5p, mc4 and mc5 capabilities will not  be
+       interpreted.
+
+
+
+

SEE ALSO

+       curses(3X)
+
+
+
+
+ + diff --git a/Ada95/html/curs_printw.3x.html b/Ada95/html/curs_printw.3x.html new file mode 100644 index 00000000..899d9741 --- /dev/null +++ b/Ada95/html/curs_printw.3x.html @@ -0,0 +1,68 @@ + + +
+       printw,  wprintw,  mvprintw,  mvwprintw,  vwprintw - print
+       formatted output in curses windows
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int printw(char *fmt [, arg] ...);
+       int wprintw(WINDOW *win, char *fmt [, arg] ...);
+       int mvprintw(int y, int x, char *fmt [, arg] ...);
+       int mvwprintw(WINDOW *win, int y, int x,
+             char *fmt [, arg] ...);
+
+       #include <varargs.h>
+       int vwprintw(WINDOW *win, char *fmt, varglist);
+
+
+
+

DESCRIPTION

+       The printw, wprintw, mvprintw and mvwprintw  routines  are
+       analogous  to  printf  [see  printf(3S)].   In effect, the
+       string that would be output by printf is output instead as
+       though waddstr were used on the given window.
+
+       The   vwprintw   routine  is  analogous  to  vprintf  [see
+       printf(3S)] and performs a wprintw using a variable  argu-
+       ment  list.  The third argument is a va_list, a pointer to
+       a list of arguments, as defined in <varargs.h>.
+
+
+
+

RETURN VALUE

+       Routines that return an integer return  ERR  upon  failure
+       and  OK  (SVr4 only specifies "an integer value other than
+       ERR") upon successful completion.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.   The  function vwprintw is marked TO BE WITHDRAWN,
+       and is to be replaced by a function  vw_printw  using  the
+       <stdarg.h> interface.
+
+
+
+

SEE ALSO

+       curses(3X), printf(3S), vprintf(3S)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_refresh.3x.html b/Ada95/html/curs_refresh.3x.html new file mode 100644 index 00000000..ff6d9a33 --- /dev/null +++ b/Ada95/html/curs_refresh.3x.html @@ -0,0 +1,122 @@ + + +
+       refresh, wrefresh, wnoutrefresh, doupdate, redrawwin, wre-
+       drawln - refresh curses windows and lines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int refresh(void);
+       int wrefresh(WINDOW *win);
+       int wnoutrefresh(WINDOW *win);
+       int doupdate(void);
+       int redrawwin(WINDOW *win);
+       int wredrawln(WINDOW *win, int beg_line, int num_lines);
+
+
+
+

DESCRIPTION

+       The refresh and wrefresh  routines  (or  wnoutrefresh  and
+       doupdate)  must be called to get actual output to the ter-
+       minal, as other routines  merely  manipulate  data  struc-
+       tures.   The  routine  wrefresh copies the named window to
+       the physical terminal screen, taking into account what  is
+       already  there  in order to do optimizations.  The refresh
+       routine is the same, using stdscr as the  default  window.
+       Unless  leaveok  has  been enabled, the physical cursor of
+       the terminal is left at the location  of  the  cursor  for
+       that window.
+
+       The  wnoutrefresh  and  doupdate  routines  allow multiple
+       updates with more  efficiency  than  wrefresh  alone.   In
+       addition  to  all  the window structures, curses keeps two
+       data structures representing the terminal screen: a physi-
+       cal screen, describing what is actually on the screen, and
+       a virtual screen, describing what the programmer wants  to
+       have on the screen.
+
+       The  routine wrefresh works by first calling wnoutrefresh,
+       which copies the named window to the virtual  screen,  and
+       then  calling  doupdate, which compares the virtual screen
+       to the physical screen and does the actual update.  If the
+       programmer  wishes  to  output  several windows at once, a
+       series of calls to wrefresh results in  alternating  calls
+       to  wnoutrefresh  and  doupdate, causing several bursts of
+       output to the screen.  By first calling  wnoutrefresh  for
+       each  window,  it  is then possible to call doupdate once,
+       resulting in only one burst of output,  with  fewer  total
+       characters transmitted and less CPU time used.  If the win
+       argument to wrefresh is the global  variable  curscr,  the
+       screen  is immediately cleared and repainted from scratch.
+
+       The phrase "copies the named window to the virtual screen"
+       above  is  ambiguous.   What  actually happens is that all
+       touched (changed) lines in the window are  copied  to  the
+       virtual  screen.   This affects programs that use overlap-
+       ping windows; it means that if two  windows  overlap,  you
+       see  the  section on PORTABILITY below for a warning about
+       exploiting this behavior.)
+
+       The wredrawln routine indicates to curses that some screen
+       lines  are corrupted and should be thrown away before any-
+       thing is written over them it touches the indicated  lines
+       (marking  them changed) then does a refresh of the window.
+       The routine redrawwin() touches the entire window and then
+       refreshes it.
+
+
+
+

RETURN VALUE

+       Routines  that  return an integer return ERR upon failure,
+       and OK (SVr4 only specifies "an integer value  other  than
+       ERR") upon successful completion.
+
+
+
+

NOTES

+       Note that refresh and redrawwin may be macros.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard,  Issue 4 describes these func-
+       tions.
+
+       Whether wnoutrefresh() copies to the  virtual  screen  the
+       entire  contents  of a window or just its changed portions
+       has never been well-documented in historic curses versions
+       (including  SVr4).   It  might be unwise to rely on either
+       behavior in programs that might have  to  be  linked  with
+       other  curses  implementations.   Instead,  you  can do an
+       explicit touchwin()  before  the  wnoutrefresh()  call  to
+       guarantee an entire-contents copy anywhere.
+
+
+
+

SEE ALSO

+       curses(3X), curs_outopts(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_scanw.3x.html b/Ada95/html/curs_scanw.3x.html new file mode 100644 index 00000000..c15106f6 --- /dev/null +++ b/Ada95/html/curs_scanw.3x.html @@ -0,0 +1,68 @@ + + +
+       scanw,  wscanw,  mvscanw, mvwscanw, vwscanw - convert for-
+       matted input from a curses widow
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int scanw(char *fmt [, arg] ...);
+       int wscanw(WINDOW *win, char *fmt [, arg] ...);
+       int mvscanw(int y, int x, char *fmt [, arg] ...);
+       int mvwscanw(WINDOW *win, int y, int x,
+             char *fmt [, arg] ...);
+       int vwscanw(WINDOW *win, char *fmt, va_list varglist);
+
+
+
+

DESCRIPTION

+       The scanw, wscanw and mvscanw routines  are  analogous  to
+       scanf [see scanf(3S)].  The effect of these routines is as
+       though wgetstr were called on the window, and the  result-
+       ing line used as input for sscanf(3).  Fields which do not
+       map to a variable in the fmt field are lost.
+
+       The vwscanw routine is similar to vwprintw in that it per-
+       forms  a wscanw using a variable argument list.  The third
+       argument is a va_list, a pointer to a list  of  arguments,
+       as defined in <varargs.h>.
+
+
+
+

RETURN VALUE

+       vwscanw returns ERR on failure and an integer equal to the
+       number of fields scanned on success.
+
+       Applications may use the  return  value  from  the  scanw,
+       wscanw,  mvscanw  and  mvwscanw  routines to determine the
+       number of fields which were mapped in the call.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.   The  function  vwscanw is marked TO BE WITHDRAWN,
+       and is to be replaced by a  function  vw_scanw  using  the
+       <stdarg.h> interface.
+
+
+
+

SEE ALSO

+       curses(3X), curs_getstr, curs_printw, scanf(3S)
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_scr_dmp.3x.html b/Ada95/html/curs_scr_dmp.3x.html new file mode 100644 index 00000000..5565d235 --- /dev/null +++ b/Ada95/html/curs_scr_dmp.3x.html @@ -0,0 +1,122 @@ + + +
+       scr_dump,  scr_restore, scr_init, scr_set - read (write) a
+       curses screen from (to) a file
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int scr_dump(const char *filename);
+       int scr_restore(const char *filename);
+       int scr_init(const char *filename);
+       int scr_set(const char *filename);
+
+
+
+

DESCRIPTION

+       The scr_dump routine dumps the  current  contents  of  the
+       virtual screen to the file filename.
+
+       The  scr_restore  routine  sets  the virtual screen to the
+       contents of filename, which must have been  written  using
+       scr_dump.   The  next call to doupdate restores the screen
+       to the way it looked in the dump file.
+
+       The scr_init routine reads in the contents of filename and
+       uses  them  to initialize the curses data structures about
+       what the terminal currently has on  its  screen.   If  the
+       data  is  determined  to  be  valid, curses bases its next
+       update of the  screen  on  this  information  rather  than
+       clearing  the  screen and starting from scratch.  scr_init
+       is used after initscr or  a  system  [see  system(BA_LIB)]
+       call  to  share  the screen with another process which has
+       done a scr_dump  after  its  endwin  call.   The  data  is
+       declared  invalid  if  the terminfo capabilities rmcup and
+       nrrmc exist; also if the  terminal  has  been  written  to
+       since the preceding scr_dump call.
+
+       The  scr_set  routine  is a combination of scr_restore and
+       scr_init.  It tells the program that  the  information  in
+       filename is what is currently on the screen, and also what
+       the program wants on the screen.  This can be  thought  of
+       as a screen inheritance function.
+
+       To  read (write) a window from (to) a file, use the getwin
+       and putwin routines [see curs_util(3X)].
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon  failure  and  OK
+       upon success.
+
+
+
+

NOTES

+       Note  that  scr_init,  scr_set,  and  scr_restore  may  be
+       macros.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue 4,  describes  these  func-
+       is also considered invalid "if the time-stamp of  the  tty
+       is old" but don't define "old".
+
+
+
+

SEE ALSO

+       curses(3X),       curs_initscr(3X),      curs_refresh(3X),
+       curs_util(3X), system(3S)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_scroll.3x.html b/Ada95/html/curs_scroll.3x.html new file mode 100644 index 00000000..9c3ebe7f --- /dev/null +++ b/Ada95/html/curs_scroll.3x.html @@ -0,0 +1,70 @@ + + +
+       scroll, srcl, wscrl - scroll a curses window
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int scroll(WINDOW *win);
+       int scrl(int n);
+       int wscrl(WINDOW *win, int n);
+
+
+
+

DESCRIPTION

+       The  scroll  routine scrolls the window up one line.  This
+       involves moving the lines in the  window  data  structure.
+       As  an optimization, if the scrolling region of the window
+       is the entire screen, the physical screen may be  scrolled
+       at the same time.
+
+       For  positive  n,  the  scrl and wscrl routines scroll the
+       window up n lines (line i+n becomes i);  otherwise  scroll
+       the  window  down n lines.  This involves moving the lines
+       in the window character image structure.  The current cur-
+       sor position is not changed.
+
+       For these functions to work, scrolling must be enabled via
+       scrollok.
+
+
+
+

RETURN VALUE

+       These routines return ERR upon failure, and OK (SVr4  only
+       specifies "an integer value other than ERR") upon success-
+       ful completion.
+
+
+
+

NOTES

+       Note that scrl and scroll may be macros.
+
+       The SVr4 documentation says that the optimization of phys-
+       ically  scrolling  immediately if the scroll region is the
+       entire screen "is"  performed,  not  "may  be"  performed.
+       This  implementation  deliberately does not guarantee that
+       this will occur, in order to leave open the possibility of
+       smarter  optimization  of  multiple  scroll actions on the
+       next update.
+
+       Neither the SVr4 documentation specifies whether the  cur-
+       rent  attribute  or current color-pair of blanks generated
+       by the scroll function is zeroed.  Under this  implementa-
+       tion it is.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard,  Issue 4 describes these func-
+       tions.
+
+
+
+

SEE ALSO

+       curses(3X), curs_outopts(3X)
+
+ + diff --git a/Ada95/html/curs_slk.3x.html b/Ada95/html/curs_slk.3x.html new file mode 100644 index 00000000..ea4a16af --- /dev/null +++ b/Ada95/html/curs_slk.3x.html @@ -0,0 +1,122 @@ + + +
+       slk_init,     slk_set,    slk_refresh,    slk_noutrefresh,
+       slk_label, slk_clear, slk_restore, slk_touch,  slk_attron,
+       slk_attrset, slk_attroff - curses soft label routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int slk_init(int fmt);
+       int slk_set(int labnum, const char *label, int fmt);
+       int slk_refresh(void);
+       int slk_noutrefresh(void);
+       char *slk_label(int labnum);
+       int slk_clear(void);
+       int slk_restore(void);
+       int slk_touch(void);
+       int slk_attron(attr_t attrs);
+       int slk_attrset(attr_t attrs);
+       attr_t slk_attr(void);
+       int slk_attroff(attr_t attrs);
+
+
+
+

DESCRIPTION

+       The slk* functions manipulate the set of soft function-key
+       labels that exist on many terminals.  For those  terminals
+       that do not have soft labels, curses takes over the bottom
+       line of stdscr, reducing the size of stdscr and the  vari-
+       able  LINES.  curses standardizes on eight labels of up to
+       eight characters each. In addition to  this,  the  ncurses
+       implementation  supports  a  mode  where  it  simulates 12
+       labels of up to five characters each. This is most  common
+       for  todays  PC  like  enduser  devices.  Please note that
+       ncurses simulates this mode by taking over up to two lines
+       at  the  bottom  of  the screen, it doesn't try to use any
+       hardware support for this mode.
+
+       The slk_init routine must  be  called  before  initscr  or
+       newterm is called.  If initscr eventually uses a line from
+       stdscr to emulate the soft labels, then fmt determines how
+       the  labels  are arranged on the screen.  Setting fmt to 0
+       indicates a 3-2-3 arrangement of the labels, 1 indicates a
+       4-4 arrangement and 2 indicates the PC like 4-4-4 mode. If
+       fmt is set to 3, it is again the PC like 4-4-4  mode,  but
+       in  addition  an index line is generated, helping the user
+       to identify the key numbers easily.
+
+       The slk_set routine requires labnum to be a label  number,
+       from 1 to 8 (resp. 12); label must be the string to be put
+       on the label, up  to  eight  (resp.  five)  characters  in
+       length.   A  null string or a null pointer sets up a blank
+       label. fmt is either 0, 1, or 2,  indicating  whether  the
+       label  is  to be left-justified, centered, or right-justi-
+       fied, respectively, within the label.
+
+
+       The  slk_label routine returns the current label for label
+       number labnum, with leading and trailing blanks  stripped.
+
+       The  slk_clear  routine  clears  the  soft labels from the
+       screen.
+
+       The slk_restore routine, restores the soft labels  to  the
+       screen after a slk_clear has been performed.
+
+       The  slk_touch  routine  forces  all the soft labels to be
+       output the next time a slk_noutrefresh is performed.
+
+       The slk_attron, slk_attrset, slk_attroff and slk_attr rou-
+       tines correspond to attron, attrset, attroff and attr_get.
+       They have an effect only if soft labels are  simulated  on
+       the  bottom line of the screen.  The default highlight for
+       soft keys is A_STANDOUT (as in System V curses, which does
+       not document this fact).
+
+
+
+

RETURN VALUE

+       These routines return ERR upon failure and OK (SVr4 speci-
+       fies only "an integer value other than ERR") upon success-
+       ful  completion.  slk_attr  returns the attribute used for
+       the soft keys.
+
+       slk_label returns NULL on error.
+
+
+
+

NOTES

+       Most applications would use slk_noutrefresh because a wre-
+       fresh is likely to follow soon.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard, Issue 4, describes these func-
+       tions.  It changes the argument  type  of  the  attribute-
+       manipulation     functions     slk_attron,    slk_attroff,
+       slk_attrset to be attr_t, and adds const  qualifiers.  The
+       format  codes  2  and  3  for  slk_init() and the function
+       slk_attr are specific to ncurses.
+
+
+
+

SEE ALSO

+       curses(3X),        curs_attr(3X),        curs_initscr(3X),
+       curs_refresh(3X)
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_termattrs.3x.html b/Ada95/html/curs_termattrs.3x.html new file mode 100644 index 00000000..d0a17431 --- /dev/null +++ b/Ada95/html/curs_termattrs.3x.html @@ -0,0 +1,122 @@ + + +
+       baudrate,  erasechar,  has_ic, has_il, killchar, longname,
+       termattrs, termname - curses environment query routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int baudrate(void);
+       char erasechar(void);
+       int has_ic(void);
+       int has_il(void);
+       char killchar(void);
+       char *longname(void);
+       attr_t termattrs(void);
+       char *termname(void);
+
+
+
+

DESCRIPTION

+       The baudrate routine returns the output speed of the  ter-
+       minal.   The  number  returned  is in bits per second, for
+       example 9600, and is an integer.
+
+       The erasechar routine returns  the  user's  current  erase
+       character.
+
+       The has_ic routine is true if the terminal has insert- and
+       delete- character capabilities.
+
+       The has_il routine is true if the terminal has insert- and
+       delete-line  capabilities,  or  can  simulate  them  using
+       scrolling regions.  This might be used to determine if  it
+       would  be  appropriate to turn on physical scrolling using
+       scrollok.
+
+       The killchar routine returns the user's current line  kill
+       character.
+
+       The  longname  routine  returns a pointer to a static area
+       containing a verbose description of the current  terminal.
+       The maximum length of a verbose description is 128 charac-
+       ters.  It is defined only after the  call  to  initscr  or
+       newterm.   The area is overwritten by each call to newterm
+       and is not restored by set_term, so the  value  should  be
+       saved  between calls to newterm if longname is going to be
+       used with multiple terminals.
+
+       If a given terminal doesn't support a video attribute that
+       an  application  program is trying to use, curses may sub-
+       stitute a different video attribute for it.  The termattrs
+       function returns a logical OR of all video attributes sup-
+       ported by the terminal.  This information is useful when a
+       curses  program needs complete control over the appearance
+       of the screen.
+
+
+
+
+

RETURN VALUE

+       longname and termname return NULL on error.
+
+       Routines that return an integer return  ERR  upon  failure
+       and  OK  (SVr4 only specifies "an integer value other than
+       ERR") upon successful completion.
+
+
+
+

NOTES

+       Note that termattrs may be a macro.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.  It changes the return type of termattrs to the new
+       type attr_t.
+
+
+
+

SEE ALSO

+       curses(3X), curs_initscr(3X), curs_outopts(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_termcap.3x.html b/Ada95/html/curs_termcap.3x.html new file mode 100644 index 00000000..1e336333 --- /dev/null +++ b/Ada95/html/curs_termcap.3x.html @@ -0,0 +1,122 @@ + + +
+       tgetent, tgetflag, tgetnum, tgetstr, tgoto, tputs - direct
+       curses interface to the terminfo capability database
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       #include <term.h>
+       int tgetent(const char *bp, char *name);
+       int tgetflag(const char *id);
+       int tgetnum(const char *id);
+       char *tgetstr(const char *id, char **area);
+       char *tgoto(const char *cap, int col, int row);
+       int tputs(const char *str, int affcnt, int (*putc)(int));
+
+
+
+

DESCRIPTION

+       These routines are included as a conversion aid  for  pro-
+       grams  that use the termcap library.  Their parameters are
+       the same and the routines are emulated using the  terminfo
+       database.   Thus, they can only be used to query the capa-
+       bilities of entries for which a terminfo  entry  has  been
+       compiled.
+
+       The  tgetent routine loads the entry for name.  It returns
+       1 on success, 0 if there is no such entry, and -1  if  the
+       terminfo  database  could  not  be  found.   The emulation
+       ignores the buffer pointer bp.
+
+       The tgetflag routine gets the boolean entry for id.
+
+       The tgetnum routine gets the numeric entry for id.
+
+       The tgetstr routine returns the string entry for id.   Use
+       tputs to output the returned string.
+
+       The  tgoto  routine  instantiates  the parameters into the
+       given capability.  The output from this routine is  to  be
+       passed to tputs.
+
+       The  tputs  routine  is described on the curs_terminfo(3X)
+       manual page.  It can retrieve capabilities by either term-
+       cap or terminfo name.
+
+
+
+
+

RETURN VALUE

+       Except  where  explicitly  noted,  routines that return an
+       integer return ERR upon failure and OK (SVr4  only  speci-
+       fies  "an  integer  value other than ERR") upon successful
+       completion.
+
+       Routines that return pointers return NULL on error.
+
+
+
+

BUGS

+       If you call tgetstr to fetch ca or any other parameterized
+       notation.  This won't cause problems if all you do with it
+       is call tgoto or tparm, which both expand  terminfo-style.
+
+       Because  terminfo  conventions for representing padding in
+       string capabilities differ  from  termcap's,  tputs("50");
+       will  put  out a literal "50" rather than busy-waiting for
+       50 milliseconds.  Cope with it.
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.   However,  they are marked TO BE WITHDRAWN and may
+       be removed in future versions.
+
+       Neither the XSI Curses standard nor  the  SVr4  man  pages
+       documented  the return values of tgetent correctly, though
+       all three were in fact returned ever since SVr1.
+
+
+
+

SEE ALSO

+       curses(3X), curs_terminfo(5), putc(3S).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_terminfo.3x.html b/Ada95/html/curs_terminfo.3x.html new file mode 100644 index 00000000..e125d997 --- /dev/null +++ b/Ada95/html/curs_terminfo.3x.html @@ -0,0 +1,226 @@ + + +
+       setupterm, setterm, set_curterm, del_curterm, restartterm,
+       tparm, tputs, putp, vidputs,  vidattr,  mvcur,  tigetflag,
+       tigetnum,   tigetstr   -  curses  interfaces  to  terminfo
+       database
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       #include <term.h>
+
+       int setupterm(const char *term, int fildes, int *errret);
+       int setterm(const char *term);
+       TERMINAL *set_curterm(TERMINAL *nterm);
+       int del_curterm(TERMINAL *oterm);
+       int  restartterm(const  char  *term,   int   fildes,   int
+       *errret);
+       char *tparm(const char *str, ...);
+       char  *tparam(const  char  *str,  char  *buffer, int size,
+       ...);
+       int tputs(const char *str, int affcnt, int (*putc)(int));
+       int putp(const char *str);
+       int vidputs(chtype attrs, int (*putc)(char));
+       int vidattr(chtype attrs);
+       int mvcur(int oldrow, int oldcol, int newrow, int newcol);
+       int tigetflag(const char *capname);
+       int tigetnum(const char *capname);
+       char *tigetstr(const char *capname);
+
+
+
+

DESCRIPTION

+       These  low-level  routines must be called by programs that
+       have to deal directly with the terminfo database to handle
+       certain  terminal  capabilities, such as programming func-
+       tion keys.  For all other functionality,  curses  routines
+       are more suitable and their use is recommended.
+
+       Initially,   setupterm   should   be  called.   Note  that
+       setupterm is automatically called by initscr and  newterm.
+       This  defines  the  set  of  terminal-dependent  variables
+       [listed in terminfo(5)].  The terminfo variables lines and
+       columns  are  initialized  by  setupterm  as  follows:  If
+       use_env(FALSE) has  been  called,  values  for  lines  and
+       columns specified in terminfo are used.  Otherwise, if the
+       environment variables LINES and COLUMNS exist, their  val-
+       ues are used.  If these environment variables do not exist
+       and the program is running in a window, the current window
+       size  is used.  Otherwise, if the environment variables do
+       not exist, the values for lines and columns  specified  in
+       the terminfo database are used.
+
+       The  header  files  curses.h and term.h should be included
+       (in this order) to get the definitions for these  strings,
+       numbers,  and  flags.   Parameterized  strings  should  be
+       passed through tparm to instantiate  them.   All  terminfo
+       the  tty modes before exiting [see curs_kernel(3X)].  Pro-
+       grams  which   use   cursor   addressing   should   output
+       enter_ca_mode  upon startup and should output exit_ca_mode
+       before exiting.  Programs desiring  shell  escapes  should
+       call
+
+       reset_shell_mode  and output exit_ca_mode before the shell
+       is  called  and  should  output  enter_ca_mode  and   call
+       reset_prog_mode after returning from the shell.
+
+       The setupterm routine reads in the terminfo database, ini-
+       tializing the terminfo structures, but does not set up the
+       output virtualization structures used by curses.  The ter-
+       minal type is the character string term; if term is  null,
+       the  environment  variable TERM is used.  All output is to
+       file descriptor fildes which is  initialized  for  output.
+       If  errret  is  not null, then setupterm returns OK or ERR
+       and stores a status value in the  integer  pointed  to  by
+       errret.   A  status of 1 in errret is normal, 0 means that
+       the terminal could not be found, and  -1  means  that  the
+       terminfo  database could not be found.  If errret is null,
+       setupterm prints an error message upon  finding  an  error
+       and exits.  Thus, the simplest call is:
+
+             setupterm((char *)0, 1, (int *)0);,
+
+       which  uses  all the defaults and sends the output to std-
+       out.
+
+       The setterm routine is being replaced by  setupterm.   The
+       call:
+
+             setupterm(term, 1, (int *)0)
+
+       provides  the  same  functionality  as setterm(term).  The
+       setterm routine is included here  for  BSD  compatibility,
+       and is not recommended for new programs.
+
+       The  set_curterm  routine  sets  the  variable cur_term to
+       nterm, and makes all of the terminfo boolean, numeric, and
+       string  variables  use  the values from nterm.  It returns
+       the old value of cur_term.
+
+       The del_curterm routine frees  the  space  pointed  to  by
+       oterm and makes it available for further use.  If oterm is
+       the same as cur_term, references to any  of  the  terminfo
+       boolean,  numeric,  and  string  variables  thereafter may
+       refer to invalid memory locations until another  setupterm
+       has been called.
+
+       The  restartterm  routine  is  similar  to  setupterm  and
+       initscr, except that it is called after  restoring  memory
+       and the input and output options are the same as when mem-
+       ory was saved, but the terminal type and baud rate may  be
+       different.   Accordingly, it saves various tty state bits,
+       does a setupterm, and then restores the bits.
+
+       The tparm routine instantiates the string str with parame-
+       ters  pi.  A pointer is returned to the result of str with
+       the parameters applied.
+
+       The tparam routine is included for compatibility with  the
+       GNU  termcap  implementation.  It works like tparm but you
+       specify a buffer and buffer size to  be  filled  with  the
+       expanded string.
+
+       The  tputs  routine  applies  padding  information  to the
+       string str and outputs it.  The str  must  be  a  terminfo
+       string  variable  or the return value from tparm, tgetstr,
+       or tgoto.  affcnt is the number of lines affected, or 1 if
+       not  applicable.   putc is a putchar-like routine to which
+       the characters are passed, one at a time.
+
+       The putp routine calls tputs(str, 1, putchar).  Note  that
+       the  output  of  putp  always  goes  to stdout, not to the
+       fildes specified in setupterm.
+
+       The vidputs routine displays the string on the terminal in
+       the  video  attribute mode attrs, which is any combination
+       of the attributes listed in  curses(3X).   The  characters
+       are passed to the putchar-like routine putc.
+
+       The  vidattr  routine  is like the vidputs routine, except
+       that it outputs through putchar.
+
+       The mvcur routine provides low-level  cursor  motion.   It
+       takes   effect   immediately  (rather  than  at  the  next
+       refresh).
+
+       The tigetflag, tigetnum and tigetstr routines  return  the
+       value of the capability corresponding to the terminfo cap-
+       name passed to them, such as xenl.
+
+       The tigetflag routine returns the value -1 if  capname  is
+       not a boolean capability.
+
+       The  tigetnum  routine  returns the value -2 if capname is
+       not a numeric capability.
+
+       The tigetstr routine returns the value (char *)-1 if  cap-
+       name is not a string capability.
+
+       The capname for each capability is given in the table col-
+       umn entitled capname code in the capabilities  section  of
+
+       char *numnames, *numcodes, *numfnames
+
+       char *strnames, *strcodes, *strfnames
+
+       These  null-terminated  arrays  contain  the capnames, the
+       termcap codes, and the full C names, for each of the  ter-
+       minfo variables.
+
+
+
+

RETURN VALUE

+       Routines  that  return  an integer return ERR upon failure
+       and OK (SVr4 only specifies "an integer value  other  than
+       ERR")  upon  successful completion, unless otherwise noted
+       in the preceding routine descriptions.
+
+       Routines that return pointers always return NULL on error.
+
+
+
+

NOTES

+       The  setupterm routine should be used in place of setterm.
+       It may be useful when you want to test for terminal  capa-
+       bilities  without  committing to the allocation of storage
+       involved in initscr.
+
+       Note that vidattr and vidputs may be macros.
+
+
+
+

PORTABILITY

+       The function setterm is not described in  the  XSI  Curses
+       standard  and  must be considered non-portable.  All other
+       functions are as described in the XSI curses standard.
+
+       In System V Release 4, set_curterm has an int return  type
+       and  returns  OK  or ERR.  We have chosen to implement the
+       XSI Curses semantics.
+
+       In System V Release 4, the third argument of tputs has the
+       type int (*putc)(char).
+
+       The XSI Curses standard prototypes tparm with a fixed num-
+       ber of parameters, rather than a variable argument list.
+
+
+
+

SEE ALSO

+       curses(3X), curs_initscr(3X), curs_kernel(3X),  curs_term-
+       cap(3X), putc(3S), terminfo(5)
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_touch.3x.html b/Ada95/html/curs_touch.3x.html new file mode 100644 index 00000000..b38a2566 --- /dev/null +++ b/Ada95/html/curs_touch.3x.html @@ -0,0 +1,120 @@ + + +
+       touchwin, touchline, untouchwin, wtouchln, is_linetouched,
+       is_wintouched - curses refresh control routines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+       int touchwin(WINDOW *win);
+       int touchline(WINDOW *win, int start, int count);
+       int untouchwin(WINDOW *win);
+       int wtouchln(WINDOW *win, int y, int n, int changed);
+       int is_linetouched(WINDOW *win, int line);
+       int is_wintouched(WINDOW *win);
+
+
+
+

DESCRIPTION

+       The touchwin and touchline routines throw away  all  opti-
+       mization  information about which parts of the window have
+       been touched, by pretending that  the  entire  window  has
+       been  drawn  on.   This  is sometimes necessary when using
+       overlapping windows, since a change to one window  affects
+       the other window, but the records of which lines have been
+       changed in the other window do  not  reflect  the  change.
+       The  routine touchline only pretends that count lines have
+       been changed, beginning with line start.
+
+       The untouchwin routine marks all lines in  the  window  as
+       unchanged since the last call to wrefresh.
+
+       The wtouchln routine makes n lines in the window, starting
+       at line y, look as if they have (changed=1)  or  have  not
+       (changed=0)  been changed since the last call to wrefresh.
+
+       The is_linetouched and is_wintouched routines return  TRUE
+       if  the  specified line/window was modified since the last
+       call to wrefresh; otherwise they return FALSE.   In  addi-
+       tion,  is_linetouched returns ERR if line is not valid for
+       the given window.
+
+
+
+

RETURN VALUE

+       All routines return the integer ERR upon  failure  and  an
+       integer  value  other than ERR upon successful completion,
+       unless otherwise noted in the preceding  routine  descrip-
+       tions.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard,  Issue 4 describes these func-
+       tions.
+
+       Some historic curses implementations had,  as  an  undocu-
+       mented  feature,  the  ability  to  do  the  equivalent of
+       clearok(..., 1) by saying touchwin(stdscr)  or  clear(std-
+       scr).  This will not work under ncurses.
+
+
+
+

NOTES

+       curses(3X), curs_refresh(3X).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_util.3x.html b/Ada95/html/curs_util.3x.html new file mode 100644 index 00000000..34d167d1 --- /dev/null +++ b/Ada95/html/curs_util.3x.html @@ -0,0 +1,122 @@ + + +
+       unctrl,   keyname,   filter,   use_env,   putwin,  getwin,
+       delay_output, flushinp - miscellaneous curses utility rou-
+       tines
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       char *unctrl(chtype c);
+       char *keyname(int c);
+       void filter(void);
+       void use_env(char bool);
+       int putwin(WINDOW *win, FILE *filep);
+       WINDOW *getwin(FILE *filep);
+       int delay_output(int ms);
+       int flushinp(void);
+
+
+
+

DESCRIPTION

+       The  unctrl macro expands to a character string which is a
+       printable representation  of  the  character  c.   Control
+       characters  are  displayed  in  the ^X notation.  Printing
+       characters are displayed as is.
+
+       The keyname routine returns a character string correspond-
+       ing to the key c.
+
+       The filter routine, if used, must be called before initscr
+       or newterm are called.  The effect is that,  during  those
+       calls,  LINES  is  set  to 1; the capabilities clear, cup,
+       cud, cud1, cuu1, cuu,  vpa  are  disabled;  and  the  home
+       string is set to the value of cr.
+
+       The  use_env routine, if used, is called before initscr or
+       newterm are called.  When called with FALSE  as  an  argu-
+       ment,  the  values  of  lines and columns specified in the
+       terminfo database will be used, even if environment  vari-
+       ables  LINES  and COLUMNS (used by default) are set, or if
+       curses is running in  a  window  (in  which  case  default
+       behavior  would  be  to  use  the window size if LINES and
+       COLUMNS are not set).
+
+       The putwin routine writes all data associated with  window
+       win into the file to which filep points.  This information
+       can be later retrieved using the getwin function.
+
+       The getwin routine reads window related data stored in the
+       file  by putwin.  The routine then creates and initializes
+       a new window using that data.  It returns a pointer to the
+       new window.
+
+       The  delay_output  routine inserts an ms millisecond pause
+       in output.  This routine should not  be  used  extensively
+       because  padding  characters  are  used  rather than a CPU
+       been  typed  by  the user and has not yet been read by the
+       program.
+
+
+
+

RETURN VALUE

+       Except for  flushinp,  routines  that  return  an  integer
+       return  ERR  upon  failure and OK (SVr4 specifies only "an
+       integer value other than ERR") upon successful completion.
+
+       flushinp always returns OK.
+
+       Routines that return pointers return NULL on error.
+
+
+
+

PORTABILITY

+       The  XSI  Curses  standard,  Issue 4 describes these func-
+       tions.
+
+       The SVr4 documentation describes the action of filter only
+       in  the  vaguest  terms.   The description here is adapted
+       from the XSI Curses standard (which erroneously  fails  to
+       describe the disabling of cuu).
+
+
+
+

NOTES

+       Note  that  unctrl  is  a macro, which is defined in <unc-
+       trl.h>.
+
+
+
+

SEE ALSO

+       curses(3X), curs_initscr(3X), curs_scr_dump(3X).
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/curs_window.3x.html b/Ada95/html/curs_window.3x.html new file mode 100644 index 00000000..70a2236c --- /dev/null +++ b/Ada95/html/curs_window.3x.html @@ -0,0 +1,176 @@ + + +
+       newwin,  delwin,  mvwin, subwin, derwin, mvderwin, dupwin,
+       wsyncup, syncok, wcursyncup,  wsyncdown  -  create  curses
+       windows
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       WINDOW *newwin(int nlines, int ncols, int begin_y,
+             intbegin_x);
+       int delwin(WINDOW *win);
+       int mvwin(WINDOW *win, int y, int x);
+       WINDOW *subwin(WINDOW *orig, int nlines, int ncols,
+             int begin_y, int begin_x);
+       WINDOW *derwin(WINDOW *orig, int nlines, int ncols,
+             int begin_y, int begin_x);
+       int mvderwin(WINDOW *win, int par_y, int par_x);
+       WINDOW *dupwin(WINDOW *win);
+       void wsyncup(WINDOW *win);
+       int syncok(WINDOW *win, bool bf);
+       void wcursyncup(WINDOW *win);
+       void wsyncdown(WINDOW *win);
+
+
+
+

DESCRIPTION

+       Calling newwin creates and returns a pointer to a new win-
+       dow with the given number of lines and columns.  The upper
+       left-hand  corner of the window is at line begin_y, column
+       begin_x.  If either nlines or ncols is zero, they  default
+       to  LINES - begin_y and COLS - begin_x.  A new full-screen
+       window is created by calling newwin(0,0,0,0).
+
+       Calling delwin deletes the named window, freeing all  mem-
+       ory  associated  with  it  (it does not actually erase the
+       window's screen image).  Subwindows must be deleted before
+       the main window can be deleted.
+
+       Calling mvwin moves the window so that the upper left-hand
+       corner is at position (x, y).  If the move would cause the
+       window to be off the screen, it is an error and the window
+       is not moved.  Moving subwindows is allowed, but should be
+       avoided.
+
+       Calling subwin creates and returns a pointer to a new win-
+       dow with the given number of lines, nlines,  and  columns,
+       ncols.   The  window  is at position (begin_y, begin_x) on
+       the screen.  (This position is relative to the screen, and
+       not to the window orig.)  The window is made in the middle
+       of the window orig, so that changes  made  to  one  window
+       will  affect  both  windows.   The subwindow shares memory
+       with the window orig.  When using this routine, it is nec-
+       essary  to call touchwin or touchline on orig before call-
+       ing wrefresh on the subwindow.
+
+       dow orig rather than the screen.  There is  no  difference
+       between the subwindows and the derived windows.
+
+       Calling  mvderwin  moves  a  derived window (or subwindow)
+       inside its parent window.  The screen-relative  parameters
+       of  the  window  are not changed.  This routine is used to
+       display different parts of the parent window at  the  same
+       physical position on the screen.
+
+       Calling  dupwin  creates  an exact duplicate of the window
+       win.
+
+       Calling wsyncup touches all locations in ancestors of  win
+       that  are changed in win.  If syncok is called with second
+       argument TRUE then wsyncup is called  automatically  when-
+       ever there is a change in the window.
+
+       The  wsyncdown  routine  touches each location in win that
+       has been touched in any of  its  ancestor  windows.   This
+       routine  is  called by wrefresh, so it should almost never
+       be necessary to call it manually.
+
+       The routine wcursyncup updates the current cursor position
+       of  all the ancestors of the window to reflect the current
+       cursor position of the window.
+
+
+
+

RETURN VALUE

+       Routines that return an integer  return  the  integer  ERR
+       upon failure and OK (SVr4 only specifies "an integer value
+       other than ERR") upon successful completion.
+
+       delwin returns the integer ERR upon failure  and  OK  upon
+       successful completion.
+
+       Routines that return pointers return NULL on error.
+
+
+
+

NOTES

+       If  many small changes are made to the window, the wsyncup
+       option could degrade performance.
+
+       Note that syncok may be a macro.
+
+
+
+

BUGS

+       The subwindow functions (subwin, derwin,  mvderwin,  wsyn-
+       cup,  wsyncdown,  wcursyncup,  syncok)  are  flaky, incom-
+       pletely implemented, and not well tested.
+
+       The System V curses documentation is  very  unclear  about
+       what wsyncup and wsyncdown actually do.  It seems to imply
+       that they are only supposed to touch exactly  those  lines
+       that are affected by ancestor changes.  The language here,
+       and the behavior of the  curses  implementation,  is  pat-
+
+
+
+

PORTABILITY

+       The XSI Curses standard, Issue  4  describes  these  func-
+       tions.
+
+
+
+

SEE ALSO

+       curses(3X), curs_refresh(3X), curs_touch(3X)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/dft_fgbg.3x.html b/Ada95/html/dft_fgbg.3x.html new file mode 100644 index 00000000..02ddbcf2 --- /dev/null +++ b/Ada95/html/dft_fgbg.3x.html @@ -0,0 +1,72 @@ + + +
+       use_default_colors - use terminal's default colors
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int use_default_colors(void);
+
+
+
+

DESCRIPTION

+       This  is  an  extension to the curses library.  It is used
+       with terminals that support ISO 6429 color, or equivalent.
+       These terminals allow the application to reset color to an
+       unspecified default value (e.g., with SGR 39 or  SGR  49).
+       Because  they  are  designed to support this, their design
+       usually includes features to change the default foreground
+       or background colors so that they do not match the assump-
+       tion in XSI curses of white on black.
+
+       Applications that paint  a  colored  background  over  the
+       whole  screen  are  not adversely impacted by this type of
+       terminal design.  However, there are applications that are
+       designed to work with the default background.
+
+
+
+

RETURN VALUE

+       The  function  returns the integer ERR upon failure and OK
+       on success.  It will fail if either the terminal does  not
+       support  the  orig_pair or orig_colors capability.  If the
+       initialize_pair capability is found, this causes an  error
+       as well.
+
+
+
+

NOTES

+       Associated with this extension, the init_pair(3x) function
+       accepts negative arguments to specify  default  foreground
+       or background colors.
+
+
+
+

PORTABILITY

+       These  routines  are  specific  to ncurses.  They were not
+       supported on Version 7, BSD or System  V  implementations.
+       It  is recommended that any code depending on them be con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

SEE ALSO

+       curs_color(3x), ded(1).
+
+
+
+

AUTHOR

+       Thomas Dickey (from an analysis of  the  requirements  for
+       color xterm for XFree86 3.1.2C, February 1996).
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form.3x.html b/Ada95/html/form.3x.html new file mode 100644 index 00000000..f2c3e19e --- /dev/null +++ b/Ada95/html/form.3x.html @@ -0,0 +1,176 @@ + + +
+       forms - curses extension for programming forms
+
+
+
+

SYNOPSIS

+       #include <form.h>
+
+
+
+

DESCRIPTION

+       The forms library provides terminal-independent facilities
+       for composing form screens  on  character-cell  terminals.
+       The  library  includes:  field  routines, which create and
+       modify form fields; and form routines, which group  fields
+       into forms, display forms on the screen, and handle inter-
+       action with the user.
+
+       The forms library uses the curses libraries, and a  curses
+       initialization  routine  such  as  initscr  must be called
+       before using any of these functions.   To  use  the  forms
+       library, link with the options -lform -lcurses.
+
+
+   Current Default Values for Field Attributes
+       The  forms  library  maintains  a  default value for field
+       attributes.  You can get or set this  default  by  calling
+       the  appropriate  get_  or  set_ routine with a NULL field
+       pointer.  Changing  this  default  with  a  set_  function
+       affects  future  field  creations, but does not change the
+       rendering of fields already created.
+
+
+   Routine Name Index
+       The following table lists each form routine and  the  name
+       of the manual page on which it is described.
+
+       l  l  l  l  .   curses  Routine  Name Manual  Page  Name =
+       current_field  form_page(3X)  data_ahead     form_data(3X)
+       data_behind    form_data(3X)  dup_field form_field_new(3X)
+       dynamic_fieldinfo   form_field_info(3X)
+       field_arg form_field_validation(3X)
+       field_back     form_field_attributes(3X)
+       field_buffer   form_field_buffer(3X)
+       field_count    form_field(3X)
+       field_fore     form_field_attributes(3X)
+       field_index    form_page(3X)
+       field_info     form_field_info(3X)
+       field_init     form_hook(3X)
+       field_just     form_field_just(3X)
+       field_opts     form_field_opts(3X)
+       field_opts_off form_field_opts(3X)
+       field_opts_on  form_field_opts(3X)
+       field_pad form_field_attributes(3X)
+       field_status   form_field_buffer(3X)
+       field_term     form_hook(3X)
+       field_type     form_field_validation(3X)
+       form_fields    form_field(3X)      form_init form_hook(3X)
+       form_opts form_opts(3X)       form_opts_off  form_opts(3X)
+       form_opts_on   form_opts(3X)       form_page form_page(3X)
+       form_request_by_name     form_requestname(3X)
+       form_request_name   form_requestname(3X)
+       form_sub  form_win(3X)             form_term form_hook(3X)
+       form_userptr   form_userptr(3X)     form_win  form_win(3X)
+       free_field     form_field_new(3X)   free_form form_new(3X)
+       link_field     form_field_new(3X)
+       link_fieldtype link_fieldtype(3X)
+       move_field     form_field(3X) new_field form_field_new(3X)
+       new_form  form_new(3X)         new_page  form_new_page(3X)
+       pos_form_cursor     form_cursor(3X)
+       post_form form_post(3X)        scale_form     form_win(3X)
+       set_current_field   form_page(3X)
+       set_field_back form_field_attributes(3X)
+       set_field_buffer    form_field_buffer(3X)
+       set_field_fore form_field_attributes(3X)
+       set_field_init form_hook(3X)
+       set_field_just form_field_just(3X)
+       set_field_opts form_field_opts(3X)
+       set_field_pad  form_field_attributes(3X)
+       set_field_status    form_field_buffer(3X)
+       set_field_term form_hook(3X)
+       set_field_type form_field_validation(3X)
+       set_field_userptr   form_field_userptr(3X)
+       set_fieldtype_arg   form_fieldtype(3X)
+       set_fieldtype_choice     form_fieldtype(3X)
+       set_form_fields     form_field(3X)
+       set_form_init  form_hook(3X)
+       set_form_opts  form_field_opts(3X)
+       set_form_page  form_page(3X)   set_form_sub   form_win(3X)
+       set_form_term  form_hook(3X)
+       set_form_userptr    form_userptr(3X)
+       set_form_win   form_win(3X)
+       set_max_field  form_field_buffer(3X)
+       set_new_page   form_new_page(3X)
+       unpost_form    form_post(3X)
+
+
+
+

RETURN VALUE

+       Routines that return pointers return NULL on error.   Rou-
+       tines  that  return an integer return one of the following
+       error codes:
+
+       E_OK The routine succeeded.
+
+       E_CONNECTED
+            The field is already connected to a form.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The form is already posted.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NO_ROOM
+            Form is too large for its window.
+
+       E_NOT_POSTED
+            The form has not been posted.
+
+       E_UNKNOWN_COMMAND
+            The form driver code saw an unknown request code.
+
+       E_INVALID_FIELD
+            Contents of a field are not valid.
+
+       E_NOT_CONNECTED
+            No fields are connected to the form.
+
+       E_REQUEST_DENIED
+            The form driver could not process the request.
+
+
+
+

SEE ALSO

+       curses(3X) and 3X pages  whose  names  begin  "form_"  for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       files <curses.h> and <eti.h>.
+
+       In your library list, libform.a  should  be  before  libn-
+       curses.a; that is, you want to say `-lform -lncurses', not
+       the other way around (which would give you  a  link  error
+       using GNU ld(1) and many other linkers).
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual pages and adaptation for  ncurses
+       by Eric S. Raymond.
+
+
+
+
+
+ + diff --git a/Ada95/html/form_cursor.3x.html b/Ada95/html/form_cursor.3x.html new file mode 100644 index 00000000..6afc48ca --- /dev/null +++ b/Ada95/html/form_cursor.3x.html @@ -0,0 +1,72 @@ + + +
+       form_cursor - position a form window cursor
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int pos_form_cursor(FORM *form);
+
+
+
+

DESCRIPTION

+       The  function  pos_form_cursor  restores the cursor to the
+       position required for the forms driver  to  continue  pro-
+       cessing  requests.   This  is useful after curses routines
+       have been called to do screen-painting in  response  to  a
+       form operation.
+
+
+
+

RETURN VALUE

+       This routine returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_NOT_POSTED
+            The form has not been posted.
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_data.3x.html b/Ada95/html/form_data.3x.html new file mode 100644 index 00000000..72eef44e --- /dev/null +++ b/Ada95/html/form_data.3x.html @@ -0,0 +1,70 @@ + + +
+       form_data -
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       bool data_ahead(const FORM *form);
+       bool data_behind(const FORM *form);
+
+
+
+

DESCRIPTION

+       The  function data_ahead tests whether there is off-screen
+       data ahead in the given form.   It  returns  TRUE  (1)  or
+       FALSE (0).
+
+       The function data_behind tests whether there is off-screen
+       data behind in the given form.  It  returns  TRUE  (1)  or
+       FALSE (0).
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_driver.3x.html b/Ada95/html/form_driver.3x.html new file mode 100644 index 00000000..524917c4 --- /dev/null +++ b/Ada95/html/form_driver.3x.html @@ -0,0 +1,280 @@ + + +
+       form_driver - command-processing loop of the form system
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int form_driver(FORM *form, int c);
+
+
+
+

DESCRIPTION

+       Once a form has been posted (displayed), you should funnel
+       input events to it through form_driver.  This routine  has
+       two  major input cases; either the input is a form naviga-
+       tion request or it's a  printable  ASCII  character.   The
+       form driver requests are as follows:
+
+       REQ_NEXT_PAGE
+            Move to the next page.
+
+       REQ_PREV_PAGE
+            Move to the previous page.
+
+       REQ_FIRST_PAGE
+            Move to the first page.
+
+       REQ_LAST_PAGE
+            Move to the last field.
+
+
+       REQ_NEXT_FIELD
+            Move to the next field.
+
+       REQ_PREV_FIELD
+            Move to the previous field.
+
+       REQ_FIRST_FIELD
+            Move to the first field.
+
+       REQ_LAST_FIELD
+            Move to the last field.
+
+       REQ_SNEXT_FIELD
+            Move to the sorted next field.
+
+       REQ_SPREV_FIELD
+            Move to the sorted previous field.
+
+       REQ_SFIRST_FIELD
+            Move to the sorted first field.
+
+       REQ_SLAST_FIELD
+            Move to the sorted last field.
+
+       REQ_LEFT_FIELD
+            Move left to a field.
+            Move right to a field.
+
+       REQ_UP_FIELD
+            Move up to a field.
+
+       REQ_DOWN_FIELD
+            Move down to a field.
+
+
+       REQ_NEXT_CHAR
+            Move to the next char.
+
+       REQ_PREV_CHAR
+            Move to the previous char.
+
+       REQ_NEXT_LINE
+            Move to the next line.
+
+       REQ_PREV_LINE
+            Move to the previous line.
+
+       REQ_NEXT_WORD
+            Move to the next word.
+
+       REQ_PREV_WORD
+            Move to the previous word.
+
+       REQ_BEG_FIELD
+            Move to the beginning of the field.
+
+       REQ_END_FIELD
+            Move to the end of the field.
+
+       REQ_BEG_LINE
+            Move to the beginning of the line.
+
+       REQ_END_LINE
+            Move to the end of the line.
+
+       REQ_LEFT_CHAR
+            Move left in the field.
+
+       REQ_RIGHT_CHAR
+            Move right in the field.
+
+       REQ_UP_CHAR
+            Move up in the field.
+
+       REQ_DOWN_CHAR
+            Move down in the field.
+
+
+            Insert or overlay a new line.
+
+       REQ_INS_CHAR
+            Insert a blank at the cursor.
+
+       REQ_INS_LINE
+            Insert a blank line at the cursor.
+
+       REQ_DEL_CHAR
+            Delete character at the cursor.
+
+       REQ_DEL_PREV
+            Delete character before the cursor.
+
+       REQ_DEL_LINE
+            Delete line at the cursor.
+
+       REQ_DEL_WORD
+            Delete blank-delimited word at the cursor.
+
+       REQ_CLR_EOL
+            Clear to end of line from cursor.
+
+       REQ_CLR_EOF
+            Clear to end of field from cursor.
+
+       REQ_CLR_FIELD
+            Clear the entire field.
+
+       REQ_OVL_MODE
+            Enter overlay mode.
+
+       REQ_INS_MODE
+            Enter insert mode.
+
+
+       REQ_SCR_FLINE
+            Scroll the field forward a line.
+
+       REQ_SCR_BLINE
+            Scroll the field backward a line.
+
+       REQ_SCR_FPAGE
+            Scroll the field forward a page.
+
+       REQ_SCR_BPAGE
+            Scroll the field backward a page.
+
+       REQ_SCR_FHPAGE
+            Scroll the field forward half a page.
+
+       REQ_SCR_BHPAGE
+            Scroll the field forward a character.
+
+       REQ_SCR_BCHAR
+            Scroll the field backward a character.
+
+       REQ_SCR_HFLINE
+            Horizontal scroll the field forward a line.
+
+       REQ_SCR_HBLINE
+            Horizontal scroll the field backward a line.
+
+       REQ_SCR_HFHALF
+            Horizontal scroll the field forward half a line.
+
+       REQ_SCR_HBHALF
+            Horizontal scroll the field backward half a line.
+
+
+       REQ_VALIDATION
+            Validate field.
+
+       REQ_NEXT_CHOICE
+            Display next field choice.
+
+       REQ_PREV_CHOICE
+            Display previous field choice.
+
+       If the second argument is a printable ASCII character, the
+       driver places it in the current position  in  the  current
+       field.   If  it is one of the forms requests listed above,
+       that request is executed.
+
+       If the second argument is neither printable ASCII nor  one
+       of  the above pre-defined form requests, the drive assumes
+       it  is  an  application-specific   command   and   returns
+       E_UNKNOWN_COMMAND.  Application-defined commands should be
+       defined relative to  MAX_COMMAND,  the  maximum  value  of
+       these pre-defined requests.
+
+
+
+

RETURN VALUE

+       form_driver return one of the following error codes:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_BAD_STATE
+
+       E_NOT_POSTED
+            The form has not been posted.
+
+       E_UNKNOWN_COMMAND
+            The form driver code saw an unknown request code.
+
+       E_INVALID_FIELD
+            Contents of field is invalid.
+
+       E_REQUEST_DENIED
+            The form driver could not process the request.
+
+
+
+

SEE ALSO

+       curses(3X), forms(3x).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       files <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_field.3x.html b/Ada95/html/form_field.3x.html new file mode 100644 index 00000000..df9822f9 --- /dev/null +++ b/Ada95/html/form_field.3x.html @@ -0,0 +1,124 @@ + + +
+       form_field - make and break connections between fields and
+       forms
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_form_fields(FORM *form, FIELD **fields);
+       FIELD **form_fields(const FORM *form);
+       int field_count(const FORM *form);
+       int move_field(FIELD *field, int frow, int fcol);
+
+
+
+

DESCRIPTION

+       The function set_form_fields  changes  the  field  pointer
+       array  of the given form.  The array must be terminated by
+       a NULL.
+
+       The function form_fields returns the field  array  of  the
+       given form.
+
+       The  function  field_count  returns the count of fields in
+       form.
+
+       The function move_field move the given field  (which  must
+       be disconnected) to a specified location on the screen.
+
+
+
+

RETURN VALUES

+       The function form_fields returns NULL on error.
+
+       The  function  field_count returns ERR (the general curses
+       error return value) on error.
+
+       The functions set_form_fields and move_field return one of
+       the following codes on error:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_POSTED
+            The form is already posted.
+
+       E_CONNECTED
+            The field is already connected to a form.
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+       The  SVr4  forms  library  documentation   specifies   the
+       field_count error value as -1 (which is the value of ERR).
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_field_attributes.3x.html b/Ada95/html/form_field_attributes.3x.html new file mode 100644 index 00000000..3cef5851 --- /dev/null +++ b/Ada95/html/form_field_attributes.3x.html @@ -0,0 +1,124 @@ + + +
+       form_field_attributes  -  color  and attribute control for
+       form fields
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_fore(FIELD *field, chtype attr);
+       chtype field_fore(const FIELD *field);
+       int set_field_back(FIELD *field, chtype attr);
+       chtype field_back(const FIELD *field);
+       int set_field_pad(FIELD *field, int pad);
+       chtype field_pad(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The function set_field_fore sets the foreground  attribute
+       of  field. This is the highlight used to display the field
+       contents.  The function field_fore returns the  foreground
+       attribute.  The default is A_STANDOUT.
+
+       The  function set_field_back sets the background attribute
+       of form. This is the highlight used to display the  extent
+       fields  in  the form.  The function field_back returns the
+       background attribute.  The default is A_NORMAL.
+
+       The function set_field_pad sets the character used to fill
+       the  field.   The  function  field_pad  returns  the given
+       form's pad character.  The default is a blank.
+
+
+
+

RETURN VALUE

+       These routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3X)  and  3X  pages  whose  names begin "form_" for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_field_buffer.3x.html b/Ada95/html/form_field_buffer.3x.html new file mode 100644 index 00000000..32ebdce6 --- /dev/null +++ b/Ada95/html/form_field_buffer.3x.html @@ -0,0 +1,122 @@ + + +
+       form_field_buffer - field buffer control
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int  set_field_buffer(FIELD  *field,  int  buf, const char
+       *value);
+       char *field_buffer(const FIELD *field, int buffer);
+       int set_field_status(FIELD *field, bool status);
+       bool field_status(const FIELD *field);
+       int set_max_field(FIELD *field, int max);
+
+
+
+

DESCRIPTION

+       The function set_field_buffer sets the numbered buffer  of
+       the  given  field  to contain a given string.  Buffer 0 is
+       the displayed value of the field; other  numbered  buffers
+       may be allocated by applications through the nbuf argument
+       of (see field_new(3X)) but  are  not  manipulated  by  the
+       forms  library.   The  function  field_buffer  returns the
+       foreground attribute.
+
+       The function set_field_status sets the  associated  status
+       flag  of  field; field_status gets the current value.  The
+       status flag is set to a nonzero value whenever  the  field
+       changes.
+
+       The  function  set_max_field  sets  the maximum size for a
+       dynamic field.  An argument of 0  turns  off  any  maximum
+       size threshold for that field.
+
+
+
+

RETURN VALUE

+       The field_buffer function returns NULL on error.
+
+       The field_status function returns TRUE or FALSE.
+
+       The remaining routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3X) and 3X pages  whose  names  begin  "form_"  for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_field_info.3x.html b/Ada95/html/form_field_info.3x.html new file mode 100644 index 00000000..334f0588 --- /dev/null +++ b/Ada95/html/form_field_info.3x.html @@ -0,0 +1,72 @@ + + +
+       form_field_info - retrieve field characteristics
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int field_info(const FIELD *field, int *rows, int *cols,
+                     int *frow, int *fcol, int *nrow, int *nbuf);
+       int dynamic_field_info(const FIELD *field, int *rows,  int
+       *cols, *max);
+
+
+
+

DESCRIPTION

+       The  function  field_info  returns  the  sizes  and  other
+       attributes passed in to the field at  its  creation  time.
+       The  attributes are: height, width, row of upper-left cor-
+       ner, column of upper-left corner, number off-screen  rows,
+       and number of working buffers.
+
+       The function dynamic_field_info returns the actual size of
+       the field, and its maximum possible size.   If  the  field
+       has  no  size  limit,  the location addressed by the third
+       argument will be set to 0.  (A field can be  made  dynamic
+       by turning off the O_STATIC).
+
+
+
+

RETURN VALUE

+       These routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3X) and 3X pages  whose  names  begin  "form_"  for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+ + diff --git a/Ada95/html/form_field_just.3x.html b/Ada95/html/form_field_just.3x.html new file mode 100644 index 00000000..c95657ef --- /dev/null +++ b/Ada95/html/form_field_just.3x.html @@ -0,0 +1,72 @@ + + +
+       form_field_just - retrieve field characteristics
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_just(FIELD *field, int justification);
+       int field_just(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The   function   set_field_just   sets  the  justification
+       attribute of a field; field_just returns a field's  justi-
+       fication attribute.  The attribute may be one of NO_JUSTI-
+       FICATION, JUSTIFY_RIGHT, JUSTIFY_LEFT, or  JUSTIFY_CENTER.
+
+
+
+
+

RETURN VALUE

+       The  function field_just returns one of: NO_JUSTIFICATION,
+       JUSTIFY_RIGHT, JUSTIFY_LEFT, or JUSTIFY_CENTER.
+
+       The function set_field_just return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3X)  and  3X  pages  whose  names begin "form_" for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_field_new.3x.html b/Ada95/html/form_field_new.3x.html new file mode 100644 index 00000000..5275c1d6 --- /dev/null +++ b/Ada95/html/form_field_new.3x.html @@ -0,0 +1,122 @@ + + +
+       form_field_new - create and destroy form fields
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       FIELD *new_field(int height, int width,
+                        int toprow, int leftcol,
+                        int offscreen, int nbuffers);
+       FIELD *dup_field(FIELD *field, int toprow, int leftcol);
+       FIELD *link_field(FIELD *field, int toprow, int leftcol);
+       int free_field(FIELD *field);
+
+
+
+

DESCRIPTION

+       The  function new_field allocates a new field and initial-
+       izes it from the parameters given: height, width,  row  of
+       upper-left  corner,  column  of  upper-left corner, number
+       off-screen rows, and number of additional working buffers.
+
+       The  function  dup_field duplicates a field at a new loca-
+       tion.  Most attributes (including current contents,  size,
+       validation  type, buffer count, growth threshold, justifi-
+       cation, foreground, background,  pad  character,  options,
+       and  user pointer) are copied.  Field status and the field
+       page bit are not copied.
+
+       The function link_field acts like dup_field, but  the  new
+       field  shares  buffers with its parent.  Attribute data is
+       separate.
+
+       The function free_field  de-allocates  storage  associated
+       with a field.
+
+
+
+

RETURN VALUE

+       The function, new_field, dup_field, link_field return NULL
+       on error.
+
+       The function free_field returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+       It  may be unwise to count on the set of attributes copied
+       by  dup_field(3x)  being  portable;  the  System  V  forms
+       library  documents  are  not  very  explicit  on what gets
+       copied and was not.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_field_opts.3x.html b/Ada95/html/form_field_opts.3x.html new file mode 100644 index 00000000..f92e9856 --- /dev/null +++ b/Ada95/html/form_field_opts.3x.html @@ -0,0 +1,122 @@ + + +
+       form_field_opts - set and get field options
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_opts(FIELD *field, OPTIONS opts);
+       int field_opts_on(FIELD *field, OPTIONS opts);
+       int field_opts_off(FIELD *field, OPTIONS opts);
+       OPTIONS field_opts(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The  function  set_field_opts  sets  all the given field's
+       option bits (field  option  bits  may  be  logically-OR'ed
+       together).
+
+       The function field_opts_on turns on the given option bits,
+       and leaves others alone.
+
+       The function field_opts_off turns  off  the  given  option
+       bits, and leaves others alone.
+
+       The function field_opts returns the field's current option
+       bits.
+
+       The following options are defined (all are on by default):
+
+       O_VISIBLE
+            The  field is displayed.  If this option is off, dis-
+            play of the field is suppressed,
+
+       O_ACTIVE
+            The field is  visited  during  processing.   If  this
+            option  is  off,  the  field will not be reachable by
+            navigation keys.
+
+       O_PUBLIC
+            The field contents are displayed as data is  entered.
+
+       O_EDIT
+            The field can be edited.
+
+       O_WRAP
+            Words  that  don't  fit  on a line are wrapped to the
+            next line.  Words are blank-separated.
+
+       O_BLANK
+            The field is cleared whenever a character is  entered
+            at the first position.
+
+       O_AUTOSKIP
+            Skip to the next field when this one fills
+
+       O_NULLOK
+            Field buffers are fixed to field's original size.
+
+       O_PASSOK
+            Validate field only if modified by user.
+
+
+
+

RETURN VALUE

+       Except  for  field_opts,  each  routine returns one of the
+       following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_CURRENT
+            The field is the current field.
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+       NOTES  The header file <form.h> automatically includes the
+              header file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_field_userptr.3x.html b/Ada95/html/form_field_userptr.3x.html new file mode 100644 index 00000000..e8bb557f --- /dev/null +++ b/Ada95/html/form_field_userptr.3x.html @@ -0,0 +1,72 @@ + + +
+       form_field_userptr  -  associate  application  data with a
+       form field
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_userptr(FIELD *field, const void*userptr);
+       const void *field_userptr(const FIELD *field);
+
+
+
+

DESCRIPTION

+       Every form field has a field that  can  be  used  to  hold
+       application-specific  data  (that is, the form-driver code
+       leaves it alone).  These functions get and set that field.
+
+
+
+

RETURN VALUE

+       The  function  field_userptr  returns  NULL  on error. The
+       function set_field_userptr returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+       The user pointer should be a void pointer.  We leave it as
+       a char pointer for SVr4 compatibility.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_field_validation.3x.html b/Ada95/html/form_field_validation.3x.html new file mode 100644 index 00000000..0c33a6d0 --- /dev/null +++ b/Ada95/html/form_field_validation.3x.html @@ -0,0 +1,176 @@ + + +
+       form_field_validation - data type validation for fields
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_type(FIELD *field, FIELDTYPE *type, ...);
+       FIELDTYPE *field_type(const FIELD *field);
+       void *field_arg(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The  function  set_field_type  declares  a data type for a
+       given form field.  This is the type checked by  validation
+       functions.  The types are as follows:
+
+       TYPE_ALNUM
+            Alphanumeric  data.  Requires a third int argument, a
+            minimum field width.
+
+       TYPE_ALPHA
+            Character data.  Requires a  third  int  argument,  a
+            minimum field width.
+
+       TYPE_ENUM
+            Accept one of a specified set of strings.  Requires a
+            third (char **) argument pointing to a string list; a
+            fourth  int flag argument to enable case-sensitivity;
+            and a fifth int flag argument  specifying  whether  a
+            partial  match  must be a unique one (if this flag is
+            off, a prefix matches the first of any  set  of  more
+            than  one  list  elements  with  that prefix). Please
+            notice that the string list is  not  copied,  only  a
+            reference to it is stored in the field. So you should
+            avoid to use a list that lives in automatic variables
+            on the stack.
+
+       TYPE_INTEGER
+            Integer  data,  parsable  to  an  integer by atoi(3).
+            Requires a third int argument controlling the  preci-
+            sion,  a  fourth  long  argument constraining minimum
+            value, and a fifth long constraining  maximum  value.
+            If  the  maximum  value  is less or equal the minimum
+            value, the range is simply  ignored.  On  return  the
+            field  buffer  is  formatted  according to the printf
+            format  specification  ".*ld",  where  the   '*'   is
+            replaced  by  the precision argument.  For details of
+            the precision handling see printf's man-page.
+
+       TYPE_NUMERIC
+            Numeric  data  (may  have  a   decimal-point   part).
+            Requires  a third int argument controlling the preci-
+            sion, a fourth double argument  constraining  minimum
+            value, and a fifth double constraining maximum value.
+            If your system supports locale's, the  decimal  point
+            the  minimum  value,  the range is simply ignored. On
+            return the field buffer is formatted according to the
+            printf  format  specification ".*f", where the '*' is
+            replaced by the precision argument.  For  details  of
+            the precision handling see printf's man-page.
+
+       TYPE_REGEXP
+            Regular  expression data.  Requires a regular expres-
+            sion (char *) third argument; the data  is  valid  if
+            the  regular  expression matches it.  Regular expres-
+            sions  are  in  the   format   of   regcomp(3x)   and
+            regexec(3X).  Please  notice that the regular expres-
+            sion must match the whole  field.  If  you  have  for
+            example  an  eight  character  wide  field, a regular
+            expression "^[0-9]*$" always means that you  have  to
+            fill  all eight positions with digits. If you want to
+            allow fewer digits, you may use for example  "^[0-9]*
+            *$" which is good for trailing spaces (up to an empty
+            field), or "^ *[0-9]* *$" which is good  for  leading
+            and trailing spaces around the digits.
+
+       TYPE_IPV4
+            An Internet Protocol Version 4 address. This requires
+            no additional argument. It is checked whether or  not
+            the  buffer  has  the form a.b.c.d, where a,b,c and d
+            are numbers between 0 and 255. Trailing blanks in the
+            buffer  are  ignored. The address itself is not vali-
+            dated. Please note that this is an ncurses extension.
+            This  field type may not be available in other curses
+            implementations.
+
+            It is possible to set up new programmer-defined field
+            types.  See the form_fieldtype(3X) manual page.
+
+
+
+

RETURN VALUE

+       The  functions  field_type  and  field_arg  return NULL on
+       error. The function set_field_type returns one of the fol-
+       lowing:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_fieldtype.3x.html b/Ada95/html/form_fieldtype.3x.html new file mode 100644 index 00000000..4a25187a --- /dev/null +++ b/Ada95/html/form_fieldtype.3x.html @@ -0,0 +1,124 @@ + + +
+       form_fieldtype - define validation-field types
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       FIELDTYPE *new_fieldtype(
+           bool (* const field_check)(FIELD *, const void *),
+           bool (* const char_check)(int, const void *));
+       int free_fieldtype(FIELDTYPE *fieldtype);
+       int set_fieldtype_arg(
+           FIELDTYPE *fieldtype,
+           void *(* const make_arg)(va_list *),
+           void *(* const copy_arg)(const void *),
+           void  (* const free_arg)(void *));
+       int set_fieldtype_choice(
+           FIELDTYPE *fieldtype
+           bool (* const next_choice)(FIELD *, const void *),
+           bool (* const prev_choice)(FIELD *, const void *));
+       FIELDTYPE *link_fieldtype(FIELDTYPE *type1,
+                                 FIELDTYPE *type2);
+
+
+
+

DESCRIPTION

+       The function new_fieldtype creates a new field type usable
+       for data validation.  You supply it  with  field_check,  a
+       predicate  to check the validity of an entered data string
+       whenever the user attempt to leave a field.  The (FIELD *)
+       argument  is passed in so the validation predicate can see
+       the field's buffer, sizes and other attributes; the second
+       argument  is an argument-block structure, about which more
+       below.
+
+       You also supply new_fieldtype with char_check, a  function
+       to  validate input characters as they are entered; it will
+       be passed the character to be checked and a pointer to  an
+       argument-block structure.
+
+       The  function free_fieldtype frees the space allocated for
+       a given validation type.
+
+       The function set_fieldtype associates  three  storage-man-
+       agement functions with a field type.  The mak_arg function
+       is automatically applied to the list of arguments you give
+       set_field_type  when  attaching validation to a field; its
+       job is to bundle these into  an  allocated  argument-block
+       object which can later be passed to validation predicated.
+       The other two hook arguments should copy  and  free  argu-
+       ment-block  structures.   They  will be used by the forms-
+       driver code.
+
+       The   form    driver    requests    REQ_NEXT_CHOICE    and
+       REQ_PREV_CHOICE assume that the possible values of a field
+       form an ordered set, and provide the forms user with a way
+       to  move  through the set.  The set_fieldtype_choice func-
+       take the field pointer and an argument-block structure  as
+       arguments.
+
+
+
+

RETURN VALUE

+       The pointer-valued routines return NULL on error.
+
+       The  integer-valued  routines  return one of the following
+       codes on error:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_CONNECTED
+            The field is already connected to a form.
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+       All of the (char *) arguments of  these  functions  should
+       actually  be (void *).  The type has been left uncorrected
+       for strict compatibility with System V.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_hook.3x.html b/Ada95/html/form_hook.3x.html new file mode 100644 index 00000000..d010b959 --- /dev/null +++ b/Ada95/html/form_hook.3x.html @@ -0,0 +1,124 @@ + + +
+       form_hook - set hooks for automatic invocation by applica-
+       tions
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_field_init(FORM *form, void (*func)(FORM *));
+       void (*)(FORM *) field_init(const FORM *form);
+       int set_field_term(FORM *form, void (*func)(FORM *));
+       void (*)(FORM *) field_term(const FORM *form);
+       int set_form_init(FORM *form, void (*func)(FORM *));
+       void (*)(FORM *) form_init(const FORM *form);
+       int set_form_term(FORM *form, void (*func)(FORM *));
+       void (*)(FORM *) form_term(const FORM *form);
+
+
+
+

DESCRIPTION

+       These functions make it possible to set hook functions  to
+       be called at various points in the automatic processing of
+       input event codes by form_driver.
+
+       The function set_field_init sets a hook to  be  called  at
+       form-post  time  and  each time the selected field changes
+       (after the change).  field_init returns the current  field
+       init hook, if any (NULL if there is no such hook).
+
+       The  function  set_field_term  sets a hook to be called at
+       form-unpost time and each time the selected field  changes
+       (before the change).  field_term returns the current field
+       term hook, if any (NULL if there is no such hook).
+
+       The function set_form_init sets a hook  to  be  called  at
+       form-post  time  and  just  after a page change once it is
+       posted.  form_init returns the current form init hook,  if
+       any (NULL if there is no such hook).
+
+       The  function  set_form_term  sets  a hook to be called at
+       form-unpost time and just before a page change change once
+       it  is  posted.   form_init  returns the current form term
+       hook, if any (NULL if there is no such hook).
+
+
+
+

RETURN VALUE

+       Routines that return pointers return NULL on error.  Other
+       routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_new.3x.html b/Ada95/html/form_new.3x.html new file mode 100644 index 00000000..7527ca97 --- /dev/null +++ b/Ada95/html/form_new.3x.html @@ -0,0 +1,72 @@ + + +
+       form_new - create and destroy forms
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       FORM *new_form(FIELD **fields);
+       int free_form(FORM *form);
+
+
+
+

DESCRIPTION

+       The  function  new_form  creates a new form connected to a
+       specified field pointer array (which must  be  NULL-termi-
+       nated).
+
+       The  function  free_form  disconnects  form from its field
+       array and frees the storage allocated for the form.
+
+
+
+

RETURN VALUE

+       The function new_form returns NULL on error.
+
+       The function free_form returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The form has already been posted.
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_new_page.3x.html b/Ada95/html/form_new_page.3x.html new file mode 100644 index 00000000..b2f5deb4 --- /dev/null +++ b/Ada95/html/form_new_page.3x.html @@ -0,0 +1,72 @@ + + +
+       form_new_page - form pagination functions
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_new_page(FIELD *field, bool new_page_flag);
+       bool new_page(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The  function  set_new_page  sets or resets a flag marking
+       the given field as the beginning of  a  new  page  on  its
+       form.
+
+       The  function  new_page  is  a  predicate which tests if a
+       given field marks a page beginning on its form.
+
+
+
+

RETURN VALUE

+       The function new_page returns TRUE or FALSE.
+
+       The function set_new_page return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_CONNECTED
+            The given field is already connected to a form.
+
+
+
+

SEE ALSO

+       curses(3X) and 3X pages  whose  names  begin  "form_"  for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_opts.3x.html b/Ada95/html/form_opts.3x.html new file mode 100644 index 00000000..839facd1 --- /dev/null +++ b/Ada95/html/form_opts.3x.html @@ -0,0 +1,124 @@ + + +
+       form_opts - set and get form options
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_form_opts(FORM *form, OPTIONS opts);
+       int form_opts_on(FORM *form, OPTIONS opts);
+       int form_opts_off(FORM *form, OPTIONS opts);
+       OPTIONS form_opts(const FORM *form);
+
+
+
+

DESCRIPTION

+       The  function  set_form_opts  sets  all  the  given form's
+       option bits  (form  option  bits  may  be  logically-OR'ed
+       together).
+
+       The  function form_opts_on turns on the given option bits,
+       and leaves others alone.
+
+       The function form_opts_off  turns  off  the  given  option
+       bits, and leaves others alone.
+
+       The  function  form_opts returns the form's current option
+       bits.
+
+       The following options are defined (all are on by default):
+
+       O_NL_OVERLOAD
+            Overload  the  REQ_NEW_LINE  forms  driver request so
+            that calling it at the end of a  field  goes  to  the
+            next field.
+
+       O_BS_OVERLOAD
+            Overload  the  REQ_DEL_PREV  forms  driver request so
+            that calling it at the beginning of a field  goes  to
+            the previous field.
+
+
+
+

RETURN VALUE

+       Except for form_opts, each routine returns one of the fol-
+       lowing:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_page.3x.html b/Ada95/html/form_page.3x.html new file mode 100644 index 00000000..7715748f --- /dev/null +++ b/Ada95/html/form_page.3x.html @@ -0,0 +1,122 @@ + + +
+       form_page - set and get form page number
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_current_field(FORM *form, FIELD *field);
+       FIELD *current_field(const FORM *);
+       int set_form_page(FORM *form, int n);
+       int form_page(const FORM *form);
+       int field_index(const FIELD *field);
+
+
+
+

DESCRIPTION

+       The  function  set_current field sets the current field of
+       the given form; current_field returns the current field of
+       the given form.
+
+       The  function  set_form_page  sets  the form's page number
+       (goes to page n of the form).
+
+       The function form_page returns  the  form's  current  page
+       number.
+
+       The function field_index returns the index of the field in
+       the field array of the form it is connected to. It returns
+       ERR  if  the  argument is the null pointer or the field is
+       not connected.
+
+
+
+

RETURN VALUE

+       Except for form_page, each routine returns one of the fol-
+       lowing:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_INVALID_FIELD
+            Contents of a field are not valid.
+
+       E_REQUEST_DENIED
+            The form driver could not process the request.
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_post.3x.html b/Ada95/html/form_post.3x.html new file mode 100644 index 00000000..6ca86909 --- /dev/null +++ b/Ada95/html/form_post.3x.html @@ -0,0 +1,122 @@ + + +
+       form_post  -  write or erase forms from associated subwin-
+       dows
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int post_form(FORM *form);
+       int unpost_form(FORM *form);
+
+
+
+

DESCRIPTION

+       The function post_form displays a form to  its  associated
+       subwindow.   To trigger physical display of the subwindow,
+       use  refresh  or  some  equivalent  curses  routine   (the
+       implicit  doupdate  triggered  by  an curses input request
+       will do).
+
+       The function unpost_form erases form from  its  associated
+       subwindow.
+
+
+
+

RETURN VALUE

+       These routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_POSTED
+            The form has already been posted.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NO_ROOM
+            Form is too large for its window.
+
+       E_NOT_POSTED
+            The form has not been posted.
+
+       E_NOT_CONNECTED
+            No items are connected to the form.
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_requestname.3x.html b/Ada95/html/form_requestname.3x.html new file mode 100644 index 00000000..ac1a5f3c --- /dev/null +++ b/Ada95/html/form_requestname.3x.html @@ -0,0 +1,72 @@ + + +
+       form_requestname - handle printable form request names
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       const char *form_request_name(int request);
+       int form_request_by_name(const char *name);
+
+
+
+

DESCRIPTION

+       The  function form_request_name returns the printable name
+       of a form request code.
+       The function form_request_by_name searches  in  the  name-
+       table  for  a  request with the given name and returns its
+       request code. Otherwise E_NO_MATCH is returned.
+
+
+
+

RETURN VALUE

+       form_request_name returns NULL on error and sets errno  to
+       E_BAD_ARGUMENT.
+       form_request_by_name returns E_NO_MATCH on error.
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines are specific to  ncurses.   They  were  not
+       supported  on  Version 7, BSD or System V implementations.
+       It is recommended that any code depending on them be  con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_userptr.3x.html b/Ada95/html/form_userptr.3x.html new file mode 100644 index 00000000..3dda58e6 --- /dev/null +++ b/Ada95/html/form_userptr.3x.html @@ -0,0 +1,72 @@ + + +
+       form_userptr - associate application data with a form item
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_form_userptr(FORM *form, const void *userptr);
+       const void* form_userptr(const FORM *form);
+
+
+
+

DESCRIPTION

+       Every form and every form item has a  field  that  can  be
+       used to hold application-specific data (that is, the form-
+       driver code leaves it alone).  These functions get and set
+       the form user pointer field.
+
+
+
+

RETURN VALUE

+       The  function  form_userptr  returns  NULL  on error.  The
+       function set_form_userptr returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+
+
+

NOTES

+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate the System V forms library.  They
+       were not supported on Version 7 or BSD versions.
+
+       The user pointer should be a void pointer.  We leave it as
+       a char pointer for SVr4 compatibility.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/form_win.3x.html b/Ada95/html/form_win.3x.html new file mode 100644 index 00000000..3d5e94b1 --- /dev/null +++ b/Ada95/html/form_win.3x.html @@ -0,0 +1,122 @@ + + +
+       form_win  - make and break form window and subwindow asso-
+       ciations
+
+
+
+

SYNOPSIS

+       #include <form.h>
+       int set_form_win(FORM *form, WINDOW *win);
+       WINDOW *form_win(const FORM *form);
+       int set_form_sub(FORM *form, WINDOW *sub);
+       WINDOW *form_sub(const FORM *form);
+       int scale_form(const FORM *form, int *rows, int *columns);
+
+
+
+

DESCRIPTION

+       Every  form has an associated pair of curses windows.  The
+       form window displays any title and border associated  with
+       the  window;  the form subwindow displays the items of the
+       form that are currently available for selection.
+
+       The first four functions get and set those windows.  It is
+       not necessary to set either window; by default, the driver
+       code uses stdscr for both.
+
+       In the set_ functions, window argument of NULL is  treated
+       as  though  it  were  stsdcr.   A form argument of NULL is
+       treated as a request to change  the  system  default  form
+       window or subwindow.
+
+       The   function   scale_window  returns  the  minimum  size
+       required for the subwindow of form.
+
+
+
+

RETURN VALUE

+       Routines that return pointers return NULL on error.   Rou-
+       tines  that  return an integer return one of the following
+       error codes:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The form has already been posted.
+
+       E_NOT_CONNECTED
+            No items are connected to the form.
+
+
+
+

SEE ALSO

+       curses(3X), form(3X).
+
+       The header file <form.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V forms  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/index.html b/Ada95/html/index.html new file mode 100644 index 00000000..6900ef37 --- /dev/null +++ b/Ada95/html/index.html @@ -0,0 +1,179 @@ + + + + +Ada95 Binding for ncurses + + +

Ada95 Binding for ncurses

+The ncurses Ada95 binding is © 1996 by +Jürgen Pfeifer. +

+ +Permission is hereby granted to reproduce and distribute this +binding by any means and for any fee, whether alone or as part +of a larger distribution, in source or in binary form, PROVIDED +this notice is included with any such distribution, and is not +removed from any of its header files. Mention of ncurses and the +author of this binding in any applications linked with it is +highly appreciated.
+ +This binding comes AS IS with no warranty, implied or expressed. +

+


+

General Remarks

+
    +
  • This document describes Version 00.92.00 of the binding.
  • +
  • The functionality is modelled to be compatible with the ncurses +package, a clone of the SVr4 curses model.
    +I did the development on an Intel box running +Linux 1.3.x and 2.0, +ncurses-1.9.9e and the +GNU Ada Translator +gnat-3.05. For any older versions of ncurses and gnat +it will not work.
  • +
  • You must have the m4 macroprocessor to build this package. +If you don't have this program, you can get the FSF version +here.
  • +
  • Ada programs are supposed to be readable. One of my +favourite methods to make code readable is to use expressive +names for the identifiers. You can find a list of a mapping +of the cryptic curses names to the Ada names in this table.
  • +
  • This is not a typical one-2-one interface mapping. It is +close to one-2-one on the functional level. Each (n)curses function +has it's counterpart with a more or less similar formal parameter list +in the binding. It is not one-2-one with respect to the datatypes. +I tried to make records out of the flat chtype and similar structures, +so you don't have to do bit operations to mark an attributed character +as bold. Just make the boolean member bold of the record +true. The binding also hides the structures like WINDOW, PANEL, MENU, FORM +etc. ! It's a pure functional API.
  • +
  • I try to do as much error checking as possible and feasible +in the binding. I will raise an Ada exception when something +went wrong in the low-level curses. This has the effect that - at least +first time in my life - (n)curses programs have now a very rigid error +checking, but - thanks to Ada - you don't have to code the orgiastic +error checking style of C.
  • +
  • Support for wide characters is currently not in the binding, as it +is not really in ncurses at this point in time.
  • +
+

+ +

Limitations

+
    +
  • I provide no SCREEN datatype and functions to set a new screen. +If you need this (mostly for debugging I guess), write a small +C routine doing all this and import it into your Ada program.
  • +
  • I provide no functions to switch on/off curses tracing options. +Same suggestion as above.
  • +
  • Although Ada95 is an OO Language, this binding doesn't provide +an OO abstraction of the (n)curses functionality. As mentioned above +it's a thin binding for the (n)curses functions. But without any +doubt it would be nice to build on top of this an OO abstraction +of (n)curses functionality.
  • +
  • If you use the user-pointer mechanism for most of the ncurses +structures in a mixed language environemt, i.e. Ada95 and C routines +operate on the same objects, care must be taken because the Ada +binding itself uses the user pointer mechanism for it's own purposes. +See the corresponding section in implementention +details.
  • +
  • I currently do not support the link_fieldtype functionality of the +forms subsystem.
  • +
  • The *_IO packages are currently output only.
  • +
+ + +

Hierarchy of packages

+ +

Implementation Details

+

Behind the abstraction

+All the new types like Window, Panel, +Menu, Form etc. are just +opaque representations of the pointers to the corresponding +low level (n)curses structures like +WINDOW *, PANEL *, +MENU * or FORM *. +So you can safely pass them to C routines that expect a pointer +to one of those structures. +

Item and Field Arrays

+In C you have to pass the item and field arrays to define menus or forms +terminated by a null item or null field. This is not necessary in this +binding. The binding routines will construct from an Ada95 style array +of Item or Field objects internally the properly terminated array of +C structure pointers. See the examples for more details. +

Extended ripoffline() usage

+The official documentation of (n)curses says, that the line parameter +determines only whether or not exactly one line is +stolen from the top or bottom of the screen. So essentially only the +sign of the parameter is evaluated. ncurses has internally implemented +it in a way, that uses the line parameter also to control the amount of +lines to steal. This mechanism is used in the Rip_Off_Lines +routine of the binding. + +

User Pointer mechanism

+TBD +

How user defined field types work

+TBD +

Enumeration fields handling

+The (n)curses documentation says, that the String arrays to be passed to +an TYPE_ENUM fieldtype must not be automatic variables. This is not true +in this binding, because it is internally arranged to safely copy these +values. +
+

Using other Ada compilers

+This should basically not be a problem, but you have to replace a code +sequence in package +
Terminal_Interface.Curses.Forms +that uses a hashing package supplied with the GNAT runtime, which is not part +of the Standard Ada runtimes. This should not be too hard. I intend to remove +this dependency in the future. +

Port to other curses implementations

+Basically it should not be too hard to make all this run on a regular SVr4 +implementation of curses. The problems are probably these:
+
    +
  • ncurses has some additional features which are presented in this binding. You +have two choices to deal with this: +
      +
    • Emulate the feature in this binding
    • +
    • Raise an exception for non implemented features
    • +
    +Most likely you will follow a mixed approach. Some features are easy to simulate, +others will be hard if not impossible.
  • +
  • For menu items, the name and descriptions are internally copied by ncurses. +So the binding doesn't care for the lifetime of the strings passed to the +construction routine for items. This assumption is not true in most other implementations +of the menu library. In this case you have to modify the binding routine +New_Item to safestore the strings.
  • +
+I'm quite sure I forgot something.

+ + diff --git a/Ada95/html/menu.3x.html b/Ada95/html/menu.3x.html new file mode 100644 index 00000000..8439ff83 --- /dev/null +++ b/Ada95/html/menu.3x.html @@ -0,0 +1,176 @@ + + +

+       menus - curses extension for programming menus
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+
+
+
+

DESCRIPTION

+       The menus library provides terminal-independent facilities
+       for composing menu systems  on  character-cell  terminals.
+       The library includes: item routines, which create and mod-
+       ify menu items; and menu routines, which group items  into
+       menus, display menus on the screen, and handle interaction
+       with the user.
+
+       The menus library uses the curses libraries, and a  curses
+       initialization  routine  such  as  initscr  must be called
+       before using any of these functions.   To  use  the  menus
+       library, link with the options -lmenu -lcurses.
+
+
+   Current Default Values for Item Attributes
+       The  menus  library  maintains  a  default  value for item
+       attributes.  You can get or set this  default  by  calling
+       the  appropriate  get_  or  set_  routine with a NULL item
+       pointer.  Changing  this  default  with  a  set_  function
+       affects  future  item  creations,  but does not change the
+       rendering of items already created.
+
+
+   Routine Name Index
+       The following table lists each menu routine and  the  name
+       of the manual page on which it is described.
+
+       l   l   .    curses   Routine   Name Manual  Page  Name  =
+       current_item   mitem_current(3X)                 free_item
+            mitem_new(3X)       free_menu            menu_new(3X)
+       item_count     menu_items(3X)
+       item_description    mitem_name(3X)
+       item_index     mitem_current(3X)                 item_init
+            menu_hook(3X) item_name      mitem_name(3X) item_opts
+            mitem_opts(3X)          item_opts_off  mitem_opts(3X)
+       item_opts_on   mitem_opts(3X) item_term      menu_hook(3X)
+       item_userptr   mitem_userptr(3X)
+       item_value     mitem_value(3X)  item_visible   mitem_visi-
+       ble(3X)          menu_back                menu_attribs(3X)
+       menu_driver    menu_driver(3X)                   menu_fore
+            menu_attribs(3X)       menu_format    menu_format(3X)
+       menu_grey               menu_attribs(3X)         menu_init
+            menu_hook(3X) menu_items     menu_items(3X) menu_mark
+            menu_mark(3X)       menu_opts           menu_opts(3X)
+       menu_opts_off  menu_opts(3X)  menu_opts_on   menu_opts(3X)
+       menu_pad        menu_attribs(3X)  menu_pattern   menu_pat-
+       tern(3X)     menu_request_by_name     menu_requestname(3X)
+            menu_win(3X)       menu_term            menu_hook(3X)
+       menu_userptr   menu_userptr(3X)                   menu_win
+            menu_win(3X)  new_item        mitem_new(3X)  new_menu
+            menu_new(3X)      pos_menu_cursor     menu_cursor(3X)
+       post_menu     menu_post(3X)    scale_menu     menu_win(3X)
+       set_current_item    menu_current_item(3X)
+       set_item_init  menu_hook(3X) set_item_opts  mitem_opts(3X)
+       set_item_term  menu_hook(3X)
+       set_item_userptr    mitem_userptr(3X)
+       set_item_value mitem_value(3X)
+       set_menu_back  menu_attribs(3X)
+       set_menu_fore  menu_attribs(3X)
+       set_menu_format     menu_format(3X)
+       set_menu_grey  menu_attribs(3X)
+       set_menu_init  menu_hook(3X) set_menu_items menu_items(3X)
+       set_menu_mark  menu_mark(3X) set_menu_opts  mitem_opts(3X)
+       set_menu_pad   menu_attribs(3X)
+       set_menu_pattern    menu_pattern(3X)
+       set_menu_spacing    menu_spacing(3X)
+       set_menu_sub   menu_win(3X)   set_menu_term  menu_hook(3X)
+       set_menu_userptr    menu_userptr(3X)
+       set_menu_win   menu_win(3X)      set_top_row    mitem_cur-
+       rent(3X)          top_row                mitem_current(3X)
+       unpost_menu    menu_post(3X)
+
+
+
+

RETURN VALUE

+       Routines that return pointers return NULL on error.   Rou-
+       tines  that  return an integer return one of the following
+       error codes:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The menu is already posted.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NO_ROOM
+            Menu is too large for its window.
+
+       E_NOT_POSTED
+            The menu has not been posted.
+
+            The menu driver code saw an unknown request code.
+
+       E_NO_MATCH
+            Character failed to match.
+
+       E_NOT_SELECTABLE
+            The designated item cannot be selected.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+       E_REQUEST_DENIED
+            The menu driver could not process the request.
+
+
+
+

SEE ALSO

+       curses(3X) and 3X pages  whose  names  begin  "menu_"  for
+       detailed descriptions of the entry points.
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       files <curses.h> and <eti.h>.
+
+       In your library list, libmenu.a  should  be  before  libn-
+       curses.a; that is, you want to say `-lmenu -lncurses', not
+       the other way around (which would give you  a  link  error
+       using GNU ld(1) and many other linkers).
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual pages and adaptation for  ncurses
+       by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_attribs.3x.html b/Ada95/html/menu_attribs.3x.html new file mode 100644 index 00000000..3bb11d64 --- /dev/null +++ b/Ada95/html/menu_attribs.3x.html @@ -0,0 +1,122 @@ + + +
+       menu_attributes - color and attribute control for menus
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_fore(MENU *menu, chtype attr);
+       chtype menu_fore(const MENU *menu);
+       int set_menu_back(MENU *menu, chtype attr);
+       chtype menu_back(const MENU *menu);
+       int set_menu_grey(MENU *menu, chtype attr);
+       chtype menu_grey(const MENU *menu);
+       int set_menu_pad(MENU *menu, int pad);
+       int menu_pad(const MENU *menu);
+
+
+
+

DESCRIPTION

+       The  function  set_menu_fore sets the foreground attribute
+       of menu. This is the  highlight  used  for  selected  menu
+       items.   menu_fore  returns the foreground attribute.  The
+       default is A_STANDOUT.
+
+       The function set_menu_back sets the  background  attribute
+       of  menu.  This  is the highlight used for selectable (but
+       not  currently  selected)  menu   items.    The   function
+       menu_back  returns  the background attribute.  The default
+       is A_NORMAL.
+
+       The function set_menu_grey  sets  the  grey  attribute  of
+       menu.  This  is  the highlight used for un-selectable menu
+       items in menus that permit more than one  selection.   The
+       function   menu_grey  returns  the  grey  attribute.   The
+       default is A_UNDERLINE.
+
+       The function set_menu_pad sets the character used to  fill
+       the space between the name and description parts of a menu
+       item.  menu_pad returns the given  menu's  pad  character.
+       The default is a blank.
+
+
+
+

RETURN VALUE

+       These routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3X) and 3X pages  whose  names  begin  "menu_"  for
+       detailed descriptions of the entry points.
+
+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_cursor.3x.html b/Ada95/html/menu_cursor.3x.html new file mode 100644 index 00000000..e65f687e --- /dev/null +++ b/Ada95/html/menu_cursor.3x.html @@ -0,0 +1,72 @@ + + +
+       menu_cursor - position a menu's cursor
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int pos_menu_cursor(const MENU *menu);
+
+
+
+

DESCRIPTION

+       The  function  pos_menu_cursor  restores the cursor to the
+       current position associated with the menu's selected item.
+       This  is  useful after curses routines have been called to
+       do screen-painting in response to a menu select.
+
+
+
+

RETURN VALUE

+       This routine returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_NOT_POSTED
+            The menu has not been posted.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_driver.3x.html b/Ada95/html/menu_driver.3x.html new file mode 100644 index 00000000..81472363 --- /dev/null +++ b/Ada95/html/menu_driver.3x.html @@ -0,0 +1,176 @@ + + +
+       menu_driver - command-processing loop of the menu system
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int menu_driver(MENU *menu, int c);
+
+
+
+

DESCRIPTION

+       Once a menu has been posted (displayed), you should funnel
+       input events to it through menu_driver.  This routine  has
+       two  major input cases; either the input is a menu naviga-
+       tion request or it's a  printable  ASCII  character.   The
+       menu driver requests are as follows:
+
+       REQ_LEFT_ITEM
+            Move left to an item.
+
+       REQ_RIGHT_ITEM
+            Move right to an item.
+
+       REQ_UP_ITEM
+            Move up to an item.
+
+       REQ_DOWN_ITEM
+            Move down to an item.
+
+       REQ_SCR_ULINE
+            Scroll up a line.
+
+       REQ_SCR_DLINE
+            Scroll down a line.
+
+       REQ_SCR_DPAGE
+            Scroll down a page.
+
+       REQ_SCR_UPAGE
+            Scroll up a page.
+
+       REQ_FIRST_ITEM
+            Move to the first item.
+
+       REQ_LAST_ITEM
+            Move to the last item.
+
+       REQ_NEXT_ITEM
+            Move to the next item.
+
+       REQ_PREV_ITEM
+            Move to the previous item.
+
+       REQ_TOGGLE_ITEM
+            Select/deselect an item.
+
+            Clear the menu pattern buffer.
+
+       REQ_BACK_PATTERN
+            Delete   the  previous  character  from  the  pattern
+            buffer.
+
+       REQ_NEXT_MATCH
+            Move to the next item matching the pattern match.
+
+       REQ_PREV_MATCH
+            Move to the previous item matching the pattern match.
+
+       If the second argument is a printable ASCII character, the
+       code appends it to the pattern buffer and attempts to move
+       to the next item matching the new pattern.  If there is no
+       such match, menu_driver returns E_NO_MATCH and deletes the
+       appended character from the buffer.
+
+       If  the  second  argument  is one of the above pre-defined
+       requests, the corresponding action is performed.
+
+       If the second argument is neither printable ASCII nor  one
+       of  the above pre-defined menu requests, the drive assumes
+       it  is  an  application-specific   command   and   returns
+       E_UNKNOWN_COMMAND.  Application-defined commands should be
+       defined relative to  MAX_COMMAND,  the  maximum  value  of
+       these pre-defined requests.
+
+
+
+

RETURN VALUE

+       menu_driver return one of the following error codes:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NOT_POSTED
+            The menu has not been posted.
+
+       E_UNKNOWN_COMMAND
+            The menu driver code saw an unknown request code.
+
+       E_NO_MATCH
+            Character failed to match.
+            The menu driver could not process the request.
+
+
+
+

SEE ALSO

+       curses(3X), menus(3x).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       files <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_format.3x.html b/Ada95/html/menu_format.3x.html new file mode 100644 index 00000000..4ab46deb --- /dev/null +++ b/Ada95/html/menu_format.3x.html @@ -0,0 +1,72 @@ + + +
+       menu_format - set and get menu sizes
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_format(MENU *menu, int rows, int cols);
+       int menu_format(const MENU *menu, int *rows, int *cols);
+
+
+
+

DESCRIPTION

+       The function set_menu_format sets the maximum display size
+       of the given window.  If this size is too small to display
+       all menu items, the menu will be made scrollable.
+
+       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.
+
+       The  function  menu_format  returns  the maximum-size con-
+       straints for the given menu into the storage addressed  by
+       rows and cols.
+
+
+
+

RETURN VALUE

+       These routines returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_POSTED
+            The menu is already posted.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+ + diff --git a/Ada95/html/menu_hook.3x.html b/Ada95/html/menu_hook.3x.html new file mode 100644 index 00000000..1f611114 --- /dev/null +++ b/Ada95/html/menu_hook.3x.html @@ -0,0 +1,124 @@ + + +
+       menu_hook - set hooks for automatic invocation by applica-
+       tions
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_item_init(MENU *menu, void (*func)(MENU *));
+       void (*)(MENU *) item_init(const MENU *menu);
+       int set_item_term(MENU *menu, void (*func)(MENU *));
+       void (*)(MENU *) item_term(const MENU *menu);
+       int set_menu_init(MENU *menu, void (*func)(MENU *));
+       void (*)(MENU *) menu_init(const MENU *menu);
+       int set_menu_term(MENU *menu, void (*func)(MENU *));
+       void (*)(MENU *) menu_term(const MENU *menu);
+
+
+
+

DESCRIPTION

+       These functions make it possible to set hook functions  to
+       be called at various points in the automatic processing of
+       input event codes by menu_driver.
+
+       The function set_item_init sets a hook  to  be  called  at
+       menu-post  time  and  each  time the selected item changes
+       (after the change).  item_init returns  the  current  item
+       init hook, if any (NULL if there is no such hook).
+
+       The  function  set_item_term  sets  a hook to be called at
+       menu-unpost time and each time the selected  item  changes
+       (before  the  change).  item_term returns the current item
+       term hook, if any (NULL if there is no such hook).
+
+       The function set_menu_init sets a hook  to  be  called  at
+       menu-post  time  and  just  after  the top row on the menu
+       changes once it is posted.  menu_init returns the  current
+       menu init hook, if any (NULL if there is no such hook).
+
+       The  function  set_menu_term  sets  a hook to be called at
+       menu-unpost time and just before the top row on  the  menu
+       changes  once it is posted.  menu_term returns the current
+       menu term hook, if any (NULL if there is no such hook).
+
+
+
+

RETURN VALUE

+       Routines that return pointers return NULL on error.  Other
+       routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_items.3x.html b/Ada95/html/menu_items.3x.html new file mode 100644 index 00000000..463ee587 --- /dev/null +++ b/Ada95/html/menu_items.3x.html @@ -0,0 +1,124 @@ + + +
+       menu_items  - make and break connections between items and
+       menus
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_items(MENU *menu, ITEM **items);
+       ITEM **menu_items(const MENU *menu);
+       int item_count(const MENU *menu);
+
+
+
+

DESCRIPTION

+       The function set_menu_items changes the item pointer array
+       of  the  given  menu.   The  array must be terminated by a
+       NULL.
+
+       The function menu_items returns  the  item  array  of  the
+       given menu.
+
+       The  function  item_count  returns  the  count of items in
+       menu.
+
+
+
+

RETURN VALUES

+       The function menu_items returns NULL on error.
+
+       The function item_count returns ERR  (the  general  curses
+       error return value) on error.
+
+       The  function  set_menu_items returns one of the following
+       codes on error:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The menu is already posted.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+
+       The   SVr4   menu   library  documentation  specifies  the
+       item_count error value as -1 (which is the value of  ERR).
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_mark.3x.html b/Ada95/html/menu_mark.3x.html new file mode 100644 index 00000000..d2e386f9 --- /dev/null +++ b/Ada95/html/menu_mark.3x.html @@ -0,0 +1,72 @@ + + +
+       menu_mark - get and set the menu mark string
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_mark(MENU *menu, const char *mark);
+       const char *menu_mark(const MENU *menu);
+
+
+
+

DESCRIPTION

+       In  order  to make menu selections visible on older termi-
+       nals without highlighting or color  capability,  the  menu
+       library  marks  selected  items  in  a  menu with a prefix
+       string.
+
+       The function set_menu_mark sets the mark  string  for  the
+       given  menu.   Calling set_menu_mark with a null menu item
+       will abolish the mark  string.   Note  that  changing  the
+       length  of  the  mark  string for a menu while the menu is
+       posted is likely to produce unhelpful behavior.
+
+       The default string is "-" (a dash). Calling  set_menu_mark
+       with a NULL menu argument will change this default.
+
+       The  function menu_mark returns the menu's mark string (or
+       NULL if there is none).
+
+
+
+

RETURN VALUE

+       The function menu_mark returns NULL on error.   The  func-
+       tion set_menu_mark may return the following error codes:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+ + diff --git a/Ada95/html/menu_new.3x.html b/Ada95/html/menu_new.3x.html new file mode 100644 index 00000000..d125a476 --- /dev/null +++ b/Ada95/html/menu_new.3x.html @@ -0,0 +1,72 @@ + + +
+       menu_new - create and destroy menus
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       MENU *new_menu(ITEM **items);
+       int free_menu(MENU *menu);
+
+
+
+

DESCRIPTION

+       The  function  new_menu  creates a new menu connected to a
+       specified item pointer array (which  must  be  NULL-termi-
+       nated).
+
+       The  function  free_menu  disconnects  menu  from its item
+       array and frees the storage allocated for the menu.
+
+
+
+

RETURN VALUE

+       The function new_menu returns NULL on error.
+
+       The function free_menu returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The menu has already been posted.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_opts.3x.html b/Ada95/html/menu_opts.3x.html new file mode 100644 index 00000000..2e4362ce --- /dev/null +++ b/Ada95/html/menu_opts.3x.html @@ -0,0 +1,124 @@ + + +
+       menu_opts - set and get menu options
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_opts(MENU *menu, OPTIONS opts);
+       int menu_opts_on(MENU *menu, OPTIONS opts);
+       int menu_opts_off(MENU *menu, OPTIONS opts);
+       OPTIONS menu_opts(const MENU *menu);
+
+
+
+

DESCRIPTION

+       The  function  set_menu_opts  sets  all  the  given menu's
+       option bits  (menu  option  bits  may  be  logically-OR'ed
+       together).
+
+       The  function menu_opts_on turns on the given option bits,
+       and leaves others alone.
+
+       The function menu_opts_off  turns  off  the  given  option
+       bits, and leaves others alone.
+
+       The  function  menu_opts returns the menu's current option
+       bits.
+
+       The following options are defined (all are on by default):
+
+       O_ONEVALUE
+            Only one item can be selected for this menu.
+
+       O_SHOWDESC
+            Display  the  item  descriptions  when  the  menu  is
+            posted.
+
+       O_ROWMAJOR
+            Display the menu in row-major order.
+
+       O_IGNORECASE
+            Ignore the case when pattern-matching.
+
+       O_SHOWMATCH
+            Move the cursor to within the item  name  while  pat-
+            tern-matching.
+
+       O_NONCYCLIC
+            Don't   wrap   around  next-item  and  previous-item,
+            requests to the other end of the menu.
+
+
+
+

RETURN VALUE

+       Except for menu_opts, each routine returns one of the fol-
+       lowing:
+
+       E_OK The routine succeeded.
+
+            System error occurred (see errno).
+
+       E_POSTED
+            The menu is already posted.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_pattern.3x.html b/Ada95/html/menu_pattern.3x.html new file mode 100644 index 00000000..61286891 --- /dev/null +++ b/Ada95/html/menu_pattern.3x.html @@ -0,0 +1,72 @@ + + +
+       menu_pattern - get and set a menu's pattern buffer
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_pattern(MENU *menu, const char *pattern);
+       char *menu_pattern(const MENU *menu);
+
+
+
+

DESCRIPTION

+       Every  menu  has  an  associated pattern match buffer.  As
+       input events that are printable ASCII characters come  in,
+       they  are  appended  to this match buffer and tested for a
+       match, as described in menu_driver(3x).
+
+       The function set_menu_pattern sets the pattern buffer  for
+       the  given menu and tries to find the first matching item.
+       If it succeeds, that item becomes  current;  if  not,  the
+       current item does not change.
+
+       The  function  menu_pattern  returns the pattern buffer of
+       the given menu.
+
+
+
+

RETURN VALUE

+       The function menu_pattern  returns  NULL  on  error.   The
+       function  set_menu_pattern  may return the following error
+       codes:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_NO_MATCH
+            Character failed to match.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+ + diff --git a/Ada95/html/menu_post.3x.html b/Ada95/html/menu_post.3x.html new file mode 100644 index 00000000..a181597f --- /dev/null +++ b/Ada95/html/menu_post.3x.html @@ -0,0 +1,122 @@ + + +
+       menu_post  -  write or erase menus from associated subwin-
+       dows
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int post_menu(MENU *menu);
+       int unpost_menu(MENU *menu);
+
+
+
+

DESCRIPTION

+       The function post_menu displays a menu to  its  associated
+       subwindow.   To trigger physical display of the subwindow,
+       use  refresh  or  some  equivalent  curses  routine   (the
+       implicit  doupdate  triggered  by  an curses input request
+       will do). post_menu resets the  selection  status  of  all
+       items.
+
+       The  function  unpost_menu erases menu from its associated
+       subwindow.
+
+
+
+

RETURN VALUE

+       These routines return one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The menu has already been posted.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NO_ROOM
+            Menu is too large for its window.
+
+       E_NOT_POSTED
+            The menu has not been posted.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_requestname.3x.html b/Ada95/html/menu_requestname.3x.html new file mode 100644 index 00000000..25b3f545 --- /dev/null +++ b/Ada95/html/menu_requestname.3x.html @@ -0,0 +1,72 @@ + + +
+       menu_requestname - handle printable menu request names
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       const char *menu_request_name(int request);
+       int menu_request_by_name(const char *name);
+
+
+
+

DESCRIPTION

+       The  function menu_request_name returns the printable name
+       of a menu request code.
+       The function menu_request_by_name searches  in  the  name-
+       table  for  a  request with the given name and returns its
+       request code. Otherwise E_NO_MATCH is returned.
+
+
+
+

RETURN VALUE

+       menu_request_name returns NULL on error and sets errno  to
+       E_BAD_ARGUMENT.
+       menu_request_by_name returns E_NO_MATCH on error.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines are specific to  ncurses.   They  were  not
+       supported  on  Version 7, BSD or System V implementations.
+       It is recommended that any code depending on them be  con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_spacing.3x.html b/Ada95/html/menu_spacing.3x.html new file mode 100644 index 00000000..71b88170 --- /dev/null +++ b/Ada95/html/menu_spacing.3x.html @@ -0,0 +1,72 @@ + + +
+       menu_spacing - Control spacing between menu items.
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_spacing(MENU *menu,
+                            int spc_description
+                            int spc_rows,
+                            int spc_columns);
+       int menu_spacing(const MENU *menu,
+                        int* spc_description
+                        int* spc_rows,
+                        int* spc_columns);
+
+
+
+

DESCRIPTION

+       The  function  set_menu_spacing  sets the spacing informa-
+       tions for the menu.  spc_description controls  the  number
+       of spaces between an item name and an item description. It
+       must not be larger than TABSIZE. The menu system  puts  in
+       the  middle  of  this  spacing area the pad character. The
+       remaining parts are filled with spaces.  spc_rows controls
+       the  number of rows that are used for an item. It must not
+       be larger than 3. The menu system inserts then blank lines
+       between  item rows, these lines will contain the pad char-
+       acter in the appropriate positions.  spc_columns  controls
+       the number of blanks between columns of items. It must not
+       be larger than TABSIZE.  A value of 0 for all the  spacing
+       values  resets  them to the default, which is 1 for all of
+       them.
+       The function menu_spacing passes back the spacing info for
+       the menu. If a pointer is NULL, this specific info is sim-
+       ply not returned.
+
+
+
+

RETURN VALUE

+       Both routines return E_OK on success. set_menu_spacing may
+       return  E_POSTED  if the menu is posted, or E_BAD_ARGUMENT
+       if one of the spacing values is out of range.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  are  specific  to ncurses.  They were not
+       supported on Version 7, BSD or System  V  implementations.
+       It  is recommended that any code depending on them be con-
+       ditioned using NCURSES_VERSION.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+
+ + diff --git a/Ada95/html/menu_userptr.3x.html b/Ada95/html/menu_userptr.3x.html new file mode 100644 index 00000000..85201592 --- /dev/null +++ b/Ada95/html/menu_userptr.3x.html @@ -0,0 +1,72 @@ + + +
+       menu_userptr - associate application data with a menu item
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_userptr(MENU *menu, const void *userptr);
+       const void *menu_userptr(const MENU *menu);
+
+
+
+

DESCRIPTION

+       Every menu and every menu item has a  field  that  can  be
+       used to hold application-specific data (that is, the menu-
+       driver code leaves it alone).  These functions get and set
+       the menu user pointer field.
+
+
+
+

RETURN VALUE

+       Except  for  menu_userptr  (which  returns NULL on error),
+       each function returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+       The user pointer should be a void pointer.  We leave it as
+       a char pointer for SVr4 compatibility.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/menu_win.3x.html b/Ada95/html/menu_win.3x.html new file mode 100644 index 00000000..08b0517c --- /dev/null +++ b/Ada95/html/menu_win.3x.html @@ -0,0 +1,122 @@ + + +
+       menu_win  - make and break menu window and subwindow asso-
+       ciations
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_menu_win(MENU *menu, WINDOW *win);
+       WINDOW *menu_win(const MENU *menu);
+       int set_menu_sub(MENU *menu, WINDOW *sub);
+       WINDOW *menu_sub(const MENU *menu);
+       int scale_menu(const MENU *menu, int *rows, int *columns);
+
+
+
+

DESCRIPTION

+       Every  menu has an associated pair of curses windows.  The
+       menu window displays any title and border associated  with
+       the  window;  the menu subwindow displays the items of the
+       menu that are currently available for selection.
+
+       The first four functions get and set those windows.  It is
+       not necessary to set either window; by default, the driver
+       code uses stdscr for both.
+
+       In the set_ functions, window argument of NULL is  treated
+       as  though  it  were  stsdcr.   A menu argument of NULL is
+       treated as a request to change  the  system  default  menu
+       window or subwindow.
+
+       The  function scale_menu returns the minimum size required
+       for the subwindow of menu.
+
+
+
+

RETURN VALUE

+       Routines that return pointers return NULL on error.   Rou-
+       tines  that  return an integer return one of the following
+       error codes:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_POSTED
+            The menu has already been posted.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/mitem_current.3x.html b/Ada95/html/mitem_current.3x.html new file mode 100644 index 00000000..d5cacd70 --- /dev/null +++ b/Ada95/html/mitem_current.3x.html @@ -0,0 +1,122 @@ + + +
+       mitem_current - set and get current_menu_item
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_current_item(MENU *menu, const ITEM *item);
+       ITEM *current_item(const MENU *menu);
+       int set_top_row(MENU *menu, int row);
+       int top_row(const MENU *menu);
+       int item_index(const ITEM *item);
+
+
+
+

DESCRIPTION

+       The  function  set_current_item sets the current item (the
+       item on  which  the  menu  cursor  is  positioned).   cur-
+       rent_item  returns  a  pointer  to the current item in the
+       given menu.
+
+       The function set_top_row sets the top row of the  menu  to
+       show  the  given  row  (the top row is initially 0, and is
+       reset to this value whenever the O_ROWMAJOR option is tog-
+       gled).   The  item  leftmost on the given row becomes cur-
+       rent.  The function top_row returns the number of the  top
+       menu row being displayed.
+
+       The function item_index returns the (zero-origin) index of
+       item in the menu's item pointer list.
+
+
+
+

RETURN VALUE

+       current_item returns NULL on error.
+
+       top_row and item_index  return  ERR  (the  general  curses
+       error value) on error.
+
+       set_current_item and set_top_row return one of the follow-
+       ing:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine detected an incorrect or  out-of-range  argu-
+            ment.
+
+       E_BAD_STATE
+            Routine was called from an initialization or termina-
+            tion function.
+
+       E_NOT_CONNECTED
+            No items are connected to the menu.
+
+
+
+

SEE ALSO

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+       The SVr4 menu library documentation specifies the  top_row
+       and  index_item  error  value as -1 (which is the value of
+       ERR).
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/mitem_name.3x.html b/Ada95/html/mitem_name.3x.html new file mode 100644 index 00000000..7af9608d --- /dev/null +++ b/Ada95/html/mitem_name.3x.html @@ -0,0 +1,72 @@ + + +
+       mitem_name - get menu item name and description fields
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       const char *item_name(const ITEM *item);
+       const char *item_description(const ITEM *item);
+
+
+
+

DESCRIPTION

+       The  function item_name returns the name part of the given
+       item.
+       The function item_description returns the description part
+       of the given item.
+
+
+
+

RETURN VALUE

+       These routines returns NULL on error.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/mitem_new.3x.html b/Ada95/html/mitem_new.3x.html new file mode 100644 index 00000000..54e4b030 --- /dev/null +++ b/Ada95/html/mitem_new.3x.html @@ -0,0 +1,72 @@ + + +
+       mitem_new - create and destroy menu items
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       ITEM *new_item(const char *name, const char *description);
+       int free_item(ITEM *item);
+
+
+
+

DESCRIPTION

+       The function new_item allocates a new item and initializes
+       it from the name and description pointers.
+       The function free_item de-allocates an item.
+
+
+
+

RETURN VALUE

+       The function new_item returns NULL on error.
+
+       The function free_item returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_BAD_ARGUMENT
+            Routine  detected  an incorrect or out-of-range argu-
+            ment.
+
+       E_CONNECTED
+            Item is connected to a menu.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/mitem_opts.3x.html b/Ada95/html/mitem_opts.3x.html new file mode 100644 index 00000000..02fd97e0 --- /dev/null +++ b/Ada95/html/mitem_opts.3x.html @@ -0,0 +1,72 @@ + + +
+       mitem_opts - set and get menu item options
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_item_opts(ITEM *item, OPTIONS opts);
+       int item_opts_on(ITEM *item, OPTIONS opts);
+       int item_opts_off(ITEM *item, OPTIONS opts);
+       OPTIONS item_opts(const ITEM *item);
+
+
+
+

DESCRIPTION

+       The  function  set_item_opts  sets  all  the  given item's
+       option bits  (menu  option  bits  may  be  logically-OR'ed
+       together).
+
+       The  function item_opts_on turns on the given option bits,
+       and leaves others alone.
+
+       The function item_opts_off  turns  off  the  given  option
+       bits, and leaves others alone.
+
+       The  function  item_opts returns the item's current option
+       bits.
+
+       There is only one defined option bit  mask,  O_SELECTABLE.
+       When this is on, the item may be selected during menu pro-
+       cessing.  This option defaults to on.
+
+
+
+

RETURN VALUE

+       Except for item_opts, each routine returns one of the fol-
+       lowing:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These routines emulate the System V  menu  library.   They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+ + diff --git a/Ada95/html/mitem_userptr.3x.html b/Ada95/html/mitem_userptr.3x.html new file mode 100644 index 00000000..8f8b5ef4 --- /dev/null +++ b/Ada95/html/mitem_userptr.3x.html @@ -0,0 +1,72 @@ + + +
+       mitem_userptr  -  associate  application  data with a menu
+       item
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_item_userptr(ITEM *item, const void *userptr);
+       const void *item_userptr(const ITEM *item);
+
+
+
+

DESCRIPTION

+       Every menu item has a field  that  can  be  used  to  hold
+       application-specific  data  (that is, the menu-driver code
+       leaves it alone).  These functions get and set that field.
+
+
+
+

RETURN VALUE

+       Except  for  item_userptr  (which  returns NULL on error),
+       each function returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+       The user pointer should be a void pointer.  We leave it as
+       a char pointer for SVr4 compatibility.
+
+
+
+

AUTHORS

+       Juergen  Pfeifer.   Manual  pages  and  adaptation for new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/mitem_value.3x.html b/Ada95/html/mitem_value.3x.html new file mode 100644 index 00000000..de0bd079 --- /dev/null +++ b/Ada95/html/mitem_value.3x.html @@ -0,0 +1,72 @@ + + +
+       mitem_value - set and get menu item values
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       int set_item_value(ITEM *item, bool value);
+       bool item_value(const ITEM *item);
+
+
+
+

DESCRIPTION

+       If  you  turn  off  the menu option O_ONEVALUE (e.g., with
+       set_menu_opts or menu_opts_off;  see  menu_opts(3x)),  the
+       menu becomes multi-valued; that is, more than one item may
+       simultaneously be selected.
+
+       In a multi_valued menu, you  can  used  set_item_value  to
+       select the given menu item (second argument TRUE) or dese-
+       lect it (second argument FALSE).
+
+
+
+

RETURN VALUE

+       The function set_item_value returns one of the following:
+
+       E_OK The routine succeeded.
+
+       E_SYSTEM_ERROR
+            System error occurred (see errno).
+
+       E_REQUEST_DENIED
+            The menu driver could not process the request.
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/mitem_visible.3x.html b/Ada95/html/mitem_visible.3x.html new file mode 100644 index 00000000..cf4d67cc --- /dev/null +++ b/Ada95/html/mitem_visible.3x.html @@ -0,0 +1,70 @@ + + +
+       mitem_visible - check visibility of a menu item
+
+
+
+

SYNOPSIS

+       #include <menu.h>
+       bool item_visible(const ITEM *item);
+
+
+
+

DESCRIPTION

+       A  menu  item  is  visible  when it is in the portion of a
+       posted menu that is mapped onto the screen (if the menu is
+       scrollable,  in  particular,  this portion will be smaller
+       than the whole menu).
+
+
+
+

SEE ALSO

+       curses(3X), menu(3X).
+
+
+
+

NOTES

+       The header file <menu.h> automatically includes the header
+       file <curses.h>.
+
+
+
+

PORTABILITY

+       These  routines  emulate  the System V menu library.  They
+       were not supported on Version 7 or BSD versions.
+
+
+
+

AUTHORS

+       Juergen Pfeifer.  Manual  pages  and  adaptation  for  new
+       curses by Eric S. Raymond.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/ncurses.3x.html b/Ada95/html/ncurses.3x.html new file mode 100644 index 00000000..0db3fafb --- /dev/null +++ b/Ada95/html/ncurses.3x.html @@ -0,0 +1,490 @@ + + +
+       ncurses - CRT screen handling and optimization package
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+
+
+

DESCRIPTION

+       The curses library routines give the user a terminal-inde-
+       pendent method of updating character screens with  reason-
+       able  optimization.  This implementation is ``new curses''
+       (ncurses) and is the approved replacement for 4.4BSD clas-
+       sic curses, which has been discontinued.
+
+       The  ncurses  routines  emulate  the curses(3X) library of
+       System V Release 4 UNIX, and the XPG4 curses standard (XSI
+       curses)  but the ncurses library is freely redistributable
+       in source form.  Differences from the SVr4 curses are sum-
+       marized  under  the EXTENSIONS and BUGS sections below and
+       described in detail in the EXTENSIONS and BUGS sections of
+       individual man pages.
+
+       A  program  using  these  routines must be linked with the
+       -lncurses option, or (if it has been generated)  with  the
+       debugging  library  -lncurses_g.   (Your system integrator
+       may also have installed these libraries  under  the  names
+       -lcurses and -lcurses_g.)  The ncurses_g library generates
+       trace logs (in a file called 'trace' in the current direc-
+       tory) that describe curses actions.
+
+       The  ncurses  package supports: overall screen, window and
+       pad manipulation; output to windows and pads; reading ter-
+       minal  input;  control  over terminal and curses input and
+       output options; environment query routines; color  manipu-
+       lation; use of soft label keys; terminfo capabilities; and
+       access to low-level terminal-manipulation routines.
+
+       To initialize the routines, the routine initscr or newterm
+       must  be called before any of the other routines that deal
+       with windows and screens are  used.   The  routine  endwin
+       must be called before exiting.  To get character-at-a-time
+       input without echoing (most interactive,  screen  oriented
+       programs  want  this),  the  following  sequence should be
+       used:
+
+             initscr(); cbreak(); noecho();
+
+       Most programs would additionally use the sequence:
+
+             nonl();
+             intrflush(stdscr, FALSE);
+             keypad(stdscr, TRUE);
+
+       Before a curses program is run, the tab stops of the  ter-
+       the tput init command after the shell environment variable
+       TERM has been exported.  tset(1)  is  usually  responsible
+       for doing this.  [See terminfo(5) for further details.]
+
+       The  curses  library  permits  manipulation of data struc-
+       tures, called windows, which can be  thought  of  as  two-
+       dimensional  arrays of characters representing all or part
+       of a CRT screen.  A default window called stdscr, which is
+       the  size of the terminal screen, is supplied.  Others may
+       be created with newwin.
+
+       Note that curses  does  not  handle  overlapping  windows,
+       that's done by the panels(3x) library. This means that you
+       can either use stdscr or divide the screen into tiled win-
+       dows  and  not  using  stdscr  at all. Mixing the two will
+       result in unpredictable, and undesired, effects.
+
+       Windows are referred to by variables declared as WINDOW *.
+       These   data  structures  are  manipulated  with  routines
+       described here and elsewhere in the ncurses manual  pages.
+       Among  which  the  most basic routines are move and addch.
+       More general versions of these routines are included  with
+       names  beginning  with  w,  allowing the user to specify a
+       window.  The routines not beginning with w affect stdscr.)
+
+       After  using  routines  to manipulate a window, refresh is
+       called, telling curses to make the user's CRT screen  look
+       like  stdscr.   The characters in a window are actually of
+       type chtype, (character and attribute data) so that  other
+       information  about  the  character may also be stored with
+       each character.
+
+       Special windows  called  pads  may  also  be  manipulated.
+       These are windows which are not constrained to the size of
+       the screen and whose contents need not be completely  dis-
+       played.  See curs_pad(3X) for more information.
+
+       In  addition  to  drawing  characters on the screen, video
+       attributes and colors may be supported, causing the  char-
+       acters  to show up in such modes as underlined, in reverse
+       video, or in color on terminals that support such  display
+       enhancements.  Line drawing characters may be specified to
+       be output.  On input, curses is  also  able  to  translate
+       arrow  and  function  keys  that transmit escape sequences
+       into single values.  The video  attributes,  line  drawing
+       characters,   and  input  values  use  names,  defined  in
+       <curses.h>, such as A_REVERSE, ACS_HLINE, and KEY_LEFT.
+
+       If the environment variables LINES and COLUMNS are set, or
+       if  the program is executing in a window environment, line
+       and column information in the  environment  will  override
+       information read by terminfo.  This would effect a program
+
+       If  the environment variable TERMINFO is defined, any pro-
+       gram using curses checks for a local  terminal  definition
+       before  checking  in  the standard place.  For example, if
+       TERM is set to att4424, then the compiled terminal defini-
+       tion is found in
+
+             @DATADIR@/terminfo/a/att4424.
+
+       (The a is copied from the first letter of att4424 to avoid
+       creation of huge directories.)  However,  if  TERMINFO  is
+       set to $HOME/myterms, curses first checks
+
+             $HOME/myterms/a/att4424,
+
+       and if that fails, it then checks
+
+             @DATADIR@/terminfo/a/att4424.
+
+       This  is useful for developing experimental definitions or
+       when write permission in @DATADIR@/terminfo is not  avail-
+       able.
+
+       The  integer  variables  LINES  and  COLS  are  defined in
+       <curses.h> and will be filled in by initscr with the  size
+       of the screen.  The constants TRUE and FALSE have the val-
+       ues 1 and 0, respectively.
+
+       The curses routines also  define  the  WINDOW  *  variable
+       curscr which is used for certain low-level operations like
+       clearing and redrawing a screen containing  garbage.   The
+       curscr can be used in only a few routines.
+
+
+   Routine and Argument Names
+       Many  curses routines have two or more versions.  The rou-
+       tines prefixed with w require a window argument.  The rou-
+       tines prefixed with p require a pad argument.  Those with-
+       out a prefix generally use stdscr.
+
+       The routines prefixed with mv require a y and x coordinate
+       to  move to before performing the appropriate action.  The
+       mv routines imply a call to move before the  call  to  the
+       other  routine.  The coordinate y always refers to the row
+       (of the window), and x always refers to the  column.   The
+       upper left-hand corner is always (0,0), not (1,1).
+
+       The routines prefixed with mvw take both a window argument
+       and x and y coordinates.  The window  argument  is  always
+       specified before the coordinates.
+
+       In  each  case, win is the window affected, and pad is the
+
+       Option setting routines require a Boolean flag bf with the
+       value TRUE or FALSE; bf is always of type bool.  The vari-
+       ables  ch  and attrs below are always of type chtype.  The
+       types WINDOW, SCREEN, bool,  and  chtype  are  defined  in
+       <curses.h>.   The  type  TERMINAL  is defined in <term.h>.
+       All other arguments are integers.
+
+
+   Routine Name Index
+       The following table lists each curses routine and the name
+       of  the  manual  page  on which it is described.  Routines
+       flagged with `*' are ncurses-specific,  not  described  by
+       XPG4 or present in SVr4.
+
+       center  tab(/); l l l l .  curses Routine Name/Manual Page
+       Name  =  addch/curs_addch(3X)  addchnstr/curs_addchstr(3X)
+       addchstr/curs_addchstr(3X)         addnstr/curs_addstr(3X)
+       addstr/curs_addstr(3X)               attroff/curs_attr(3X)
+       attron/curs_attr(3X)       attrset/curs_attr(3X)      bau-
+       drate/curs_termattrs(3X)                beep/curs_beep(3X)
+       bkgd/curs_bkgd(3X)  bkgdset/curs_bkgd(3X) border/curs_bor-
+       der(3X)                                box/curs_border(3X)
+       can_change_color/curs_color(3X)     cbreak/curs_inopts(3X)
+       clear/curs_clear(3X)    clearok/curs_outopts(3X)    clrto-
+       bot/curs_clear(3X)    clrtoeol/curs_clear(3X)   color_con-
+       tent/curs_color(3X)               copywin/curs_overlay(3X)
+       curs_set/curs_kernel(3X)     def_prog_mode/curs_kernel(3X)
+       def_shell_mode/curs_kernel(3X)       del_curterm/curs_ter-
+       minfo(3X)  delay_output/curs_util(3X) delch/curs_delch(3X)
+       deleteln/curs_deleteln(3X) delscreen/curs_initscr(3X) del-
+       win/curs_window(3X)      derwin/curs_window(3X)      doup-
+       date/curs_refresh(3X)               dupwin/curs_window(3X)
+       echo/curs_inopts(3X)      echochar/curs_addch(3X)     end-
+       win/curs_initscr(3X)                  erase/curs_clear(3X)
+       erasechar/curs_termattrs(3X)          filter/curs_util(3X)
+       flash/curs_beep(3X)     flushinp/curs_util(3X)      getbe-
+       gyx/curs_getyx(3X)        getch/curs_getch(3X)        get-
+       maxyx/curs_getyx(3X)     getmouse/curs_mouse(3X)*     get-
+       paryx/curs_getyx(3X)      getstr/curs_getstr(3X)      get-
+       syx/curs_kernel(3X)                   getwin/curs_util(3X)
+       getyx/curs_getyx(3X)   halfdelay/curs_inopts(3X)  has_col-
+       ors/curs_color(3X)               has_ic/curs_termattrs(3X)
+       has_il/curs_termattrs(3X)          has_key/curs_getch(3X)*
+       hline/curs_border(3X)               idcok/curs_outopts(3X)
+       idlok/curs_outopts(3X)            immedok/curs_outopts(3X)
+       inch/curs_inch(3X)     inchnstr/curs_inchstr(3X)     inch-
+       str/curs_inchstr(3X)             init_color/curs_color(3X)
+       init_pair/curs_color(3X)          initscr/curs_initscr(3X)
+       innstr/curs_instr(3X)       insch/curs_insch(3X)      ins-
+       delln/curs_deleteln(3X)         insertln/curs_deleteln(3X)
+       insnstr/curs_insstr(3X)             insstr/curs_insstr(3X)
+       isendwin/curs_initscr(3X)    keyname/curs_util(3X)    key-
+       pad/curs_inopts(3X)            killchar/curs_termattrs(3X)
+       leaveok/curs_outopts(3X)       longname/curs_termattrs(3X)
+       mcprint/curs_print(3X)*  meta/curs_inopts(3X)  mouseinter-
+       val/curs_mouse(3X)*              mousemask/curs_mouse(3X)*
+       move/curs_move(3X)     mvaddch/curs_addch(3X)    mvaddchn-
+       str/curs_addchstr(3X)         mvaddchstr/curs_addchstr(3X)
+       mvaddnstr/curs_addstr(3X)         mvaddstr/curs_addstr(3X)
+       mvcur/curs_terminfo(3X)   mvdelch/curs_delch(3X)    mvder-
+       win/curs_window(3X)      mvgetch/curs_getch(3X)     mvget-
+       str/curs_getstr(3X)     mvinch/curs_inch(3X)      mvinchn-
+       str/curs_inchstr(3X)            mvinchstr/curs_inchstr(3X)
+       mvinnstr/curs_instr(3X)    mvinsch/curs_insch(3X)    mvin-
+       snstr/curs_insstr(3X)    mvinsstr/curs_insstr(3X)    mvin-
+       str/curs_instr(3X)      mvprintw/curs_printw(3X)      mvs-
+       canw/curs_scanw(3X)   mvwaddch/curs_addch(3X)   mvwaddchn-
+       str/curs_addchstr(3X)        mvwaddchstr/curs_addchstr(3X)
+       mvwaddnstr/curs_addstr(3X)       mvwaddstr/curs_addstr(3X)
+       mvwdelch/curs_delch(3X)  mvwgetch/curs_getch(3X)   mvwget-
+       str/curs_getstr(3X)                  mvwin/curs_window(3X)
+       mvwinch/curs_inch(3X)         mvwinchnstr/curs_inchstr(3X)
+       mvwinchstr/curs_inchstr(3X)       mvwinnstr/curs_instr(3X)
+       mvwinsch/curs_insch(3X)         mvwinsnstr/curs_insstr(3X)
+       mvwinsstr/curs_insstr(3X)   mvwinstr/curs_instr(3X)   mvw-
+       printw/curs_printw(3X)             mvwscanw/curs_scanw(3X)
+       napms/curs_kernel(3X)                  newpad/curs_pad(3X)
+       newterm/curs_initscr(3X)            newwin/curs_window(3X)
+       nl/curs_outopts(3X)     nocbreak/curs_inopts(3X)     node-
+       lay/curs_inopts(3X) noecho/curs_inopts(3X)  nonl/curs_out-
+       opts(3X)  noqiflush/curs_inopts(3X)  noraw/curs_inopts(3X)
+       notimeout/curs_inopts(3X)  overlay/curs_overlay(3X)  over-
+       write/curs_overlay(3X)         pair_content/curs_color(3X)
+       pechochar/curs_pad(3X)   pnoutrefresh/curs_pad(3X)    pre-
+       fresh/curs_pad(3X)  printw/curs_printw(3X)  putp/curs_ter-
+       minfo(3X)   putwin/curs_util(3X)   qiflush/curs_inopts(3X)
+       raw/curs_inopts(3X)             redrawwin/curs_refresh(3X)
+       refresh/curs_refresh(3X)   reset_prog_mode/curs_kernel(3X)
+       reset_shell_mode/curs_kernel(3X)   resetty/curs_kernel(3X)
+       resizeterm/resizeterm(3x)*   restartterm/curs_terminfo(3X)
+       ripoffline/curs_kernel(3X)         savetty/curs_kernel(3X)
+       scanw/curs_scanw(3X)            scr_dump/curs_scr_dump(3X)
+       scr_init/curs_scr_dump(3X)   scr_restore/curs_scr_dump(3X)
+       scr_set/curs_scr_dump(3X)             scrl/curs_scroll(3X)
+       scroll/curs_scroll(3X)           scrollok/curs_outopts(3X)
+       set_curterm/curs_terminfo(3X)    set_term/curs_initscr(3X)
+       setscrreg/curs_outopts(3X)   setsyx/curs_kernel(3X)   set-
+       term/curs_terminfo(3X)         setupterm/curs_terminfo(3X)
+       slk_attr/curs_slk(3X)*            slk_attroff/curs_slk(3X)
+       slk_attron/curs_slk(3X)           slk_attrset/curs_slk(3X)
+       slk_clear/curs_slk(3X)               slk_init/curs_slk(3X)
+       slk_label/curs_slk(3X)        slk_noutrefresh/curs_slk(3X)
+       slk_refresh/curs_slk(3X)          slk_restore/curs_slk(3X)
+       start_color/curs_color(3X)    subpad/curs_pad(3X)     sub-
+       win/curs_window(3X)     syncok/curs_window(3X)     termat-
+       trs/curs_termattrs(3X)  termname/curs_termattrs(3X)   tge-
+       tent/curs_termcap(3X)    tgetflag/curs_termcap(3X)   tget-
+       num/curs_termcap(3X)              tgetstr/curs_termcap(3X)
+       tgoto/curs_termcap(3X)  tigetflag/curs_terminfo(3X) tiget-
+       num/curs_terminfo(3X)   tigetstr/curs_terminfo(3X)   time-
+       out/curs_inopts(3X)     touchline/curs_touch(3X)    touch-
+       win/curs_touch(3X)                 tparm/curs_terminfo(3X)
+       tputs/curs_termcap(3X)    tputs/curs_terminfo(3X)   typea-
+       head/curs_inopts(3X)                  unctrl/curs_util(3X)
+       ungetch/curs_getch(3X) ungetmouse/curs_mouse(3X)* untouch-
+       win/curs_touch(3X) use_env/curs_util(3X) vidattr/curs_ter-
+       minfo(3X)  vidputs/curs_terminfo(3X) vline/curs_border(3X)
+       vwprintw/curs_printw(3X)    vwscanw/curs_scanw(3X)    wad-
+       dch/curs_addch(3X)   waddchnstr/curs_addchstr(3X)  waddch-
+       str/curs_addchstr(3X)             waddnstr/curs_addstr(3X)
+       waddstr/curs_addstr(3X)     wattroff/curs_attr(3X)    wat-
+       tron/curs_attr(3X)                  wattrset/curs_attr(3X)
+       wbkgd/curs_bkgd(3X)      wbkgdset/curs_bkgd(3X)      wbor-
+       der/curs_border(3X)     wclear/curs_clear(3X)      wclrto-
+       bot/curs_clear(3X)    wclrtoeol/curs_clear(3X)    wcursyn-
+       cup/curs_window(3X)                  wdelch/curs_delch(3X)
+       wdeleteln/curs_deleteln(3X)  wechochar/curs_addch(3X) wen-
+       close/curs_mouse(3X)*                werase/curs_clear(3X)
+       wgetch/curs_getch(3X)    wgetnstr/curs_getstr(3X)    wget-
+       str/curs_getstr(3X)                 whline/curs_border(3X)
+       winch/curs_inch(3X)    winchnstr/curs_inchstr(3X)   winch-
+       str/curs_inchstr(3X)      winnstr/curs_instr(3X)      win-
+       sch/curs_insch(3X)     winsdelln/curs_deleteln(3X)    win-
+       sertln/curs_deleteln(3X)          winsnstr/curs_insstr(3X)
+       winsstr/curs_insstr(3X)              winstr/curs_instr(3X)
+       wmove/curs_move(3X)          wnoutrefresh/curs_refresh(3X)
+       wprintw/curs_printw(3X)   wredrawln/curs_refresh(3X)  wre-
+       fresh/curs_refresh(3X)                wresize/wresize(3x)*
+       wscanw/curs_scanw(3X)    wscrl/curs_scroll(3X)    wsetscr-
+       reg/curs_outopts(3X)    wstandend/curs_attr(3X)    wstand-
+       out/curs_attr(3X)      wsyncdown/curs_window(3X)     wsyn-
+       cup/curs_window(3X)               wtimeout/curs_inopts(3X)
+       wtouchln/curs_touch(3X) wvline/curs_border(3X)
+
+
+
+

RETURN VALUE

+       Routines  that  return  an integer return ERR upon failure
+       and an integer value other than ERR upon  successful  com-
+       pletion,  unless  otherwise  noted in the routine descrip-
+       tions.
+
+       All macros return the  value  of  the  w  version,  except
+       setscrreg,  wsetscrreg,  getyx,  getbegyx,  getmaxyx.  The
+       return values of setscrreg, wsetscrreg,  getyx,  getbegyx,
+       and getmaxyx are undefined (i.e., these should not be used
+       as the right-hand side of assignment statements).
+
+
+
+

SEE ALSO

+       terminfo(5) and 3X pages whose  names  begin  "curs_"  for
+       detailed routine descriptions.
+
+
+
+

EXTENSIONS

+       The curses library can be compiled with an option (-DTERM-
+       CAP_FILE) that falls back to  the  old-style  /etc/termcap
+       file  if  the  terminal  setup code cannot find a terminfo
+       entry corresponding to TERM.  Use of this feature  is  not
+       recommended,  as it essentially includes an entire termcap
+       compiler in the curses startup code, at  significant  cost
+       in core and startup cycles.
+
+       Compiling  with  -DTERMCAP_FILE changes the library's ini-
+       tialization sequence in a way intended to mimic the behav-
+       ior of 4.4BSD curses.  If there is no local or system ter-
+       minfo entry matching TERM,  then  the  library  looks  for
+       termcap  entries  in the following places: (1) if TERMINFO
+       is undefined, in the file named by  TERMCAP_FILE;  (2)  if
+       TERMINFO  is defined and begins with a slash, it is inter-
+       preted as the name of a termcap file to search  for  TERM;
+       (3) otherwise, if TERMINFO has a leading string that looks
+       like a terminal entry name list, and it matches TERM,  the
+       contents  of  TERMINFO is interpreted as a termcap; (4) if
+       TERMINFO looks like a termcap but doesn't match TERM,  the
+       termcap  file  is  searched  for among the colon-separated
+       paths in the environment variable  TERMPATHS  if  that  is
+       defined,  and  in  ~/.termcap  and the file value of TERM-
+       CAP_FILE otherwise.
+
+       Versions of curses compiled on PC clones  support  display
+       of  the  PC ROM characters (including ROM characters 0-31,
+       which stock SVr4 curses cannot display).  See  the  EXTEN-
+       SIONS sections of curs_addch(3x) and curs_attr(3x).
+
+       The curses library includes facilities for capturing mouse
+       events on certain terminals  (including  xterm).  See  the
+       curs_mouse(3X) manual page for details.
+
+       The  curses  library  includes  a  function  for directing
+       application output to a printer attached to  the  terminal
+       device.  See the curs_print(3X) manual page for details.
+
+
+
+

PORTABILITY

+       The curses library is intended to be BASE-level conformant
+       with the XSI Curses standard.   Certain  portions  of  the
+       EXTENDED  XSI  Curses  functionality (including color sup-
+       port) are supported.  The following  EXTENDED  XSI  Curses
+       calls  in  support  of wide (multibyte) characters are not
+       yet implemented: addnwstr, addwstr, mvaddnwstr,  mvwaddnw-
+       str,  mvaddwstr,  waddnwstr,  waddwstr, add_wch, wadd_wch,
+       mvwadd_wchnstr,  mvwadd_wchstr,  bkgrndset,  bkgrnd,  get-
+       bkgrnd, wbkgrnd, wbkgrndset, wgetbkgrnd, border_set, wbor-
+       der_set,  box_set,  hline_set,  mvhline_set,  mvvline_set,
+       mvwhline_set,    mvwvline_set,   whline_set,   vhline_set,
+       wvline_set,  echo_wchar,  wecho_wchar,  erasewchar,  kill-
+       wchar,    get_wch,    mvget_wch,    mvwget_ch,   wget_wch,
+       getwchtype, get_wstr,  getn_wstr,  wget_wstr,  wgetn_wstr,
+       mvget_wstr,  mvgetn_wstr, mvwget_wstr, mvwgetn_wstr, innw-
+       str,  inwstr,  winnwstr,  winwstr,  mvinnwstr,   mvinwstr,
+       mvwinnwstr,  mvwinwstr,  ins_nwstr, ins_wstr, mvins_nwstr,
+       mvins_wstr,   mvwins_nwstr,    mvwins_wstr,    wins_nwstr,
+       wins_wstr,   ins_wch,   wins_wch,  mvins_wch,  mvwins_wch,
+       in_wch, win_wch, mvin_wch, mvwin_wch, inwchstr, inwchnstr,
+       winwchstr,  winwchnstr,  mvinwchstr, mvinwchnstr, mvinwch-
+       str, mvwinwchnstr.
+
+       A small number of local differences (that  is,  individual
+       differences  between  the XSI Curses and curses calls) are
+       described in  PORTABILITY  sections  of  the  library  man
+       pages.
+
+       The routine has_key is not part of XPG4, nor is it present
+       in SVr4.  See the curs_getch(3X) manual page for  details.
+
+       The  routine  slk_attr is not part of XPG4, nor is it pre-
+       sent in  SVr4.   See  the  curs_slk(3X)  manual  page  for
+       details.
+
+       The  routines getmouse, mousemask, ungetmouse, mouseinter-
+       val, and wenclose relating to mouse  interfacing  are  not
+       part  of  XPG4,  nor  are  they  present in SVr4.  See the
+       curs_mouse(3X) manual page for details.
+
+       The routine mcprint was not present in any previous curses
+       implementation.   See  the  curs_print(3X) manual page for
+       details.
+
+       The routine wresize is not part of XPG4, nor is it present
+       in SVr4.  See the wresize(3X) manual page for details.
+
+       In  historic curses versions, delays embedded in the capa-
+       bilities cr, ind, cub1, ff and tab activated corresponding
+       delay  bits  in  the UNIX tty driver.  In this implementa-
+       tion, all padding is done by NUL sends.   This  method  is
+       slightly  more expensive, but narrows the interface to the
+       UNIX kernel  significantly  and  increases  the  package's
+       portability correspondingly.
+
+       In  the  XSI  standard  and  SVr4 manual pages, many entry
+       points have prototype arguments of the for char *const (or
+       cchar_t  *const,  or  wchar_t  *const,  or  void  *const).
+       Depending on one's interpretation of the ANSI  C  standard
+       tion const char *x is a modifiable pointer to unmodifiable
+       data, but char *const x' is  an  unmodifiable  pointer  to
+       modifiable  data.  Given that C passes arguments by value,
+       <type> *const as a formal type is at best  dubious.   Some
+       compilers  choke  on  the  prototypes.  Therefore, in this
+       implementation, they have been changed to const  <type>  *
+       globally.
+
+
+
+

NOTES

+       The  header  file  <curses.h>  automatically  includes the
+       header files <stdio.h> and <unctrl.h>.
+
+       If standard output from a curses program is re-directed to
+       something  which  is  not  a  tty,  screen updates will be
+       directed to standard error.  This was an undocumented fea-
+       ture of AT&T System V Release 3 curses.
+
+
+
+

AUTHORS

+       Zeyd  M.  Ben-Halim,  Eric  S. Raymond.  Descends from the
+       original pcurses by Pavel Curtis.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/panel.3x.html b/Ada95/html/panel.3x.html new file mode 100644 index 00000000..9875c217 --- /dev/null +++ b/Ada95/html/panel.3x.html @@ -0,0 +1,180 @@ + + +
+       panel - panel stack extension for curses
+
+
+
+

SYNOPSIS

+       #include <panel.h>
+
+       cc [flags] sourcefiles -lpanel -lncurses
+
+       PANEL *new_panel(WINDOW *win)
+       int bottom_panel(PANEL *pan)
+       int top_panel(PANEL *pan)
+       int show_panel(PANEL *pan)
+       void update_panels();
+       int hide_panel(PANEL *pan)
+       WINDOW *panel_window(const PANEL *pan)
+       int replace_panel(PANEL *pan, WINDOW *window)
+       int move_panel(PANEL *pan, int starty, int startx)
+       int panel_hidden(const PANEL *pan)
+       PANEL *panel_above(const PANEL *pan)
+       PANEL *panel_below(const PANEL *pan)
+       int set_panel_userptr(PANEL *pan, const void *ptr)
+       const void *panel_userptr(const PANEL *pan)
+       int del_panel(PANEL *pan)
+
+
+
+

DESCRIPTION

+       Panels  are  curses(3X)  windows with the added feature of
+       depth.  Panel functions allow the use of  stacked  windows
+       and  ensure  the  proper  portions  of each window and the
+       curses stdscr window are hidden or displayed  when  panels
+       are  added,  moved,  modified or removed.  The set of cur-
+       rently visible panels is the stack of panels.  The  stdscr
+       window  is  beneath all panels, and is not considered part
+       of the stack.
+
+       A window is associated with every panel.  The  panel  rou-
+       tines  enable you to create, move, hides, and show panels,
+       as well as position a panel at any desired location in the
+       stack.
+
+       Panel routines are a functional layer added to curses(3X),
+       make only high-level curses calls, and work anywhere  ter-
+       minfo curses does.
+
+
+
+

FUNCTIONS

+       new_panel(win)
+              allocates   a   PANEL structure, associates it with
+              win, places the panel  on  the  top  of  the  stack
+              (causes   it  to   be   displayed  above  any other
+              panel) and returns a pointer to the new panel.
+
+       void update_panels()
+              refreshes the virtual screen to reflect  the  rela-
+              tions between the panels in the stack, but does not
+              update_panels() may be called more than once before
+              a  call  to doupdate(), but doupdate() is the func-
+              tion responsible for updating the physical  screen.
+
+       del_panel(pan)
+              removes the given panel from the  stack and deallo-
+              cates the PANEL structure (but not  its  associated
+              window).
+
+       hide_panel(pan)
+              removes  the  given  panel from the panel stack and
+              thus hides it from view. The PANEL structure is not
+              lost, merely removed from the stack.
+
+       show_panel(pan)
+              makes  a  hidden panel visible by placing it on top
+              of the panels in the panel stack. See COMPATIBILITY
+              below.
+
+       top_panel(pan)
+              puts  the  given visible panel on top of all panels
+              in the stack.  See COMPATIBILITY below.
+
+       bottom_panel(pan)
+              puts panel at the bottom of all panels.
+
+       move_panel(pan,starty,startx)
+              moves the given panel window so that its upper-left
+              corner  is  at  starty, startx.  It does not change
+              the position of the panel in the stack.  Be sure to
+              use  this  function,  not  mvwin(), to move a panel
+              window.
+
+       replace_panel(pan,window)
+              replaces the current window of  panel  with  window
+              (useful, for example if you want to resize a panel;
+              if you're using ncurses, you can call replace_panel
+              on  the output of wresize(3x)).  It does not change
+              the position of the panel in the stack.
+
+       panel_above(pan)
+              returns a pointer to the panel above pan.   If  the
+              panel  argument is (PANEL *)0, it returns a pointer
+              to the bottom panel in the stack.
+
+       panel_below(pan)
+              returns a pointer to the panel just below pan.   If
+              the  panel  argument  is  (PANEL  *)0, it returns a
+              pointer to the top panel in the stack.
+
+       set_panel_userptr(pan,ptr)
+              sets the panel's user pointer.
+              returns the user pointer for a given panel.
+
+       panel_window(pan)
+              returns a pointer to the window of the given panel.
+
+
+
+

DIAGNOSTICS

+       Each  routine  that  returns  a pointer returns NULL if an
+       error occurs. Each  routine  that  returns  an  int  value
+       returns OK if it executes successfully and ERR if not.
+
+
+
+

COMPATIBILITY

+       Reasonable  care  has been taken to  ensure  compatibility
+       with  the  native  panel  facility  introduced  in  SVr3.2
+       (inspection of the SVr4 manual pages suggests the program-
+       ming interface is unchanged).  The PANEL  data  structures
+       are  merely   similar. The  programmer is cautioned not to
+       directly use PANEL fields.
+
+       The functions show_panel() and top_panel()  are  identical
+       in  this  implementation,  and work equally well with dis-
+       played or hidden panels.  In the native System V implemen-
+       tation, show_panel() is intended for making a hidden panel
+       visible (at the top  of  the  stack)  and  top_panel()  is
+       intended  for  making an already-visible panel move to the
+       top of the stack. You are cautioned  to  use  the  correct
+       function   to   ensure  compatibility  with  native  panel
+       libraries.
+
+
+
+

NOTE

+       In your library list, libpanel.a should  be  before  libn-
+       curses.a;  that  is,  you want to say `-lpanel -lncurses',
+       not the other way around (which  would  give  you  a  link
+       error using GNU ld(1) and some other linkers).
+
+
+
+

FILES

+       panel.h interface for the panels library
+
+       libpanel.a the panels library itself
+
+
+
+

SEE ALSO

+       curses(3X)
+
+
+
+

AUTHOR

+       Originally   written   by   Warren  Tucker  <wht@n4hgf.mt-
+       park.ga.us>, primarily to assist  in  porting  u386mon  to
+       systems  without  a native panels library.  Repackaged for
+       ncurses by Zeyd ben-Halim.
+
+
+
+
+
+
+ + diff --git a/Ada95/html/resizeterm.3x.html b/Ada95/html/resizeterm.3x.html new file mode 100644 index 00000000..18401194 --- /dev/null +++ b/Ada95/html/resizeterm.3x.html @@ -0,0 +1,70 @@ + + +
+       resizeterm - change the curses terminal size
+
+
+
+

SYNOPSIS

+       #include <curses.h>
+
+       int resizeterm(int lines, int columns);
+
+
+
+

DESCRIPTION

+       This  is  an extension to the curses library.  It provides
+       callers with a hook into the ncurses data to  resize  win-
+       dows, primarily for use by programs running in an X Window
+       terminal (e.g., xterm).  The function  resizeterm  resizes
+       the  standard  and current windows to the specified dimen-
+       sions, and adjusts other  bookkeeping  data  used  by  the
+       ncurses library that record the window dimensions.
+
+       When  resizing  the  windows, the function blank-fills the
+       areas that are extended. The  calling  application  should
+       fill in these areas with appropriate data.
+
+       The function attempts to resize all windows.  However, due
+       to the calling convention of pads, it is not  possible  to
+       resize  these  without  additional  interaction  with  the
+       application.
+
+
+
+

RETURN VALUE

+       The function returns the integer ERR upon failure  and  OK
+       on success.  It will fail if either of the dimensions less
+       than or equal  to  zero,  or  if  an  error  occurs  while
+       (re)allocating memory for the windows.
+
+
+
+

NOTES

+       While  this  function  is intended to be used to support a
+       signal handler (i.e., for SIGWINCH), care should be  taken
+       to  avoid invoking it in a context where malloc or realloc
+       may have been interrupted, since it uses those  functions.
+
+
+
+

SEE ALSO

+       wresize(3x).
+
+
+
+

AUTHOR

+       Thomas Dickey (from an equivalent function written in 1988
+       for BSD curses).
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/Ada95/html/table.html b/Ada95/html/table.html new file mode 100644 index 00000000..f142107e --- /dev/null +++ b/Ada95/html/table.html @@ -0,0 +1,311 @@ + + + +Correspondence between ncurses C and Ada functions + + +

Correspondence between ncurses C and Ada functions

+

Sorted by C function name

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
C nameAda nameman page
baudrate()Baudratecurs_termattrs.3x
beep()Beepcurs_beep.3x
bottom_panel()Bottompanel.3x
box()Boxcurs_border.3x
can_change_color()Can_Change_Colorcurs_color.3x
cbreak()Set_Cbreak_Modecurs_inopts.3x
clearok()Clear_On_Next_Updatecurs_outopts.3x
color_content()Color_Contentcurs_color.3x
copywin()Copycurs_overlay.3x
current_field()Currentform_page.3x
current_item()Currentmitem_current.3x
curs_set()Set_Cursor_Visibilitycurs_kernel.3x
data_ahead()Data_Aheadform_data.3x
data_behind()Data_Behindform_data.3x
def_prog_mode()Save_Curses_Modecurs_kernel.3x
del_panel()Deletepanel.3x
delay_output()Delay_Outputcurs_util.3x
delwin()Deletecurs_window.3x
derwin()Derived_Windowcurs_window.3x
doupdate()Update_Screencurs_refresh.3x
dup_field()Duplicateform_field_new.3x
dupwin()Duplicatecurs_window.3x
dynamic_field_info()Dynamic_Infoform_field_info.3x
echo()Set_Echo_Modecurs_inopts.3x
endwin()End_Windowscurs_initscr.3x
erasechar()Erase_Charactercurs_termattrs.3x
field_back()Backgroundform_field_attributes.3x
field_back()Backgroundform_field_attributes.3x
field_buffer()Get_Bufferform_field_buffer.3x
field_count()Field_Countform_field.3x
field_fore()Foregroundform_field_attributes.3x
field_fore()Foregroundform_field_attributes.3x
field_index()Get_Indexform_page.3x
field_info()Infoform_field_info.3x
field_init()Get_Field_Init_Hookform_hook.3x
field_just()Get_Justificationform_field_just.3x
field_opts()Get_Optionsform_field_opts.3x
field_opts()Get_Optionsform_field_opts.3x
field_opts_on()Switch_Optionsform_field_opts.3x
field_pad()Pad_Characterform_field_attributes.3x
field_status()Changedform_field_buffer.3x
field_term()Get_Field_Term_Hookform_hook.3x
field_type()Get_Typeform_field_validation.3x
field_userptrGet_User_Dataform_field_userptr.3x
flash()Flash_Screencurs_beep.3x
flushinp()Flush_Inputcurs_util.3x
form_driver()Driverform_driver.3x
form_fields()Fieldsform_field.3x
form_init()Get_Form_Init_Hookform_hook.3x
form_opts()Get_Optionsform_opts.3x
form_opts()Get_Optionsform_opts.3x
form_opts_on()Switch_Optionsform_opts.3x
form_page()Pageform_page.3x
form_sub()Get_Sub_Windowform_win.3x
form_term()Get_Form_Term_Hookform_hook.3x
form_userptrGet_User_Dataform_userptr.3x
form_win()Get_Windowform_win.3x
free_field()Deleteform_field_new.3x
free_form()Deleteform_new.3x
free_item()Deletemitem_new.3x
free_menu()Deletemenu_new.3x
getbegyx()Get_Window_Positioncurs_getyx.3x
getmaxyx()Get_Sizecurs_getyx.3x
getmouse()Get_Mousecurs_mouse.3x
getparyx()Get_Origin_Relative_To_Parentcurs_getyx.3x
getyx()Get_Cursor_Positioncurs_getyx.3x
halfdelay()Half_Delaycurs_inopts.3x
has_colors()Has_Colorscurs_color.3x
has_ic()Has_Insert_Charactercurs_termattrs.3x
has_il()Has_Insert_Linecurs_termattrs.3x
has_key()Has_Keycurs_getch.3x
hide_panel()Hidepanel.3x
idcok()Use_Insert_Delete_Charactercurs_outopts.3x
idlok()Use_Insert_Delete_Linecurs_outopts.3x
immedok()Immediate_Update_Modecurs_outopts.3x
init_color()Init_Colorcurs_color.3x
init_pair()Init_Paircurs_color.3x
initscr()Init_Screencurs_initscr.3x
initscr()Init_Windowscurs_initscr.3x
intrflush()Set_Flush_On_Interrupt_Modecurs_inopts.3x
is_linetouched()Is_Touchedcurs_touch.3x
is_wintouched()Is_Touchedcurs_touch.3x
isendwin()Is_End_Windowcurs_initscr.3x
item_count()Item_Countmenu_items.3x
item_description();Descriptionmitem_name.3x
item_index()Get_Indexmitem_current.3x
item_init()Get_Item_Init_Hookmenu_hook.3x
item_name()Namemitem_name.3x
item_opts()Get_Optionsmitem_opts.3x
item_opts()Get_Optionsmitem_opts.3x
item_opts_on()Switch_Optionsmitem_opts.3x
item_term()Get_Item_Term_Hookmenu_hook.3x
item_userptrGet_User_Datamitem_userptr.3x
item_value()Valuemitem_value.3x
item_visible()Visiblemitem_visible.3x
keyname()Key_Namecurs_util.3x
keypad()Set_KeyPad_Modecurs_inopts.3x
killchar()Kill_Charactercurs_termattrs.3x
leaveok()Leave_Cursor_After_Updatecurs_outopts.3x
link_field()Linkform_field_new.3x
longname()Long_Namecurs_termattrs.3x
menu_back()Backgroundmenu_attribs.3x
menu_back()Backgroundmenu_attribs.3x
menu_driver()Drivermenu_new.3x
menu_fore()Foregroundmenu_attribs.3x
menu_fore()Foregroundmenu_attribs.3x
menu_format()Formatmenu_format.3x
menu_grey()Greymenu_attribs.3x
menu_grey()Greymenu_attribs.3x
menu_init()Get_Menu_Init_Hookmenu_hook.3x
menu_items()Itemsmenu_items.3x
menu_mark()Markmenu_mark.3x
menu_opts()Get_Optionsmenu_opts.3x
menu_opts()Get_Optionsmenu_opts.3x
menu_opts_on()Switch_Optionsmenu_opts.3x
menu_pad()Pad_Charactermenu_attribs.3x
menu_pattern()Patternmenu_pattern.3x
menu_spacing()Spacingmenu_spacing.3x
menu_sub()Get_Sub_Windowmenu_win.3x
menu_term()Get_Menu_Term_Hookmenu_hook.3x
menu_userptrGet_User_Datamenu_userptr.3x
menu_win()Get_Windowmenu_win.3x
meta()Set_Meta_Modecurs_inopts.3x
mouseinterval()Mouse_Intervalcurs_mouse.3x
mousemask()Start_Mousecurs_mouse.3x
move_field()Moveform_field.3x
move_panel()Movepanel.3x
mvderwin()Move_Derived_Windowcurs_window.3x
mvwaddch()Addcurs_addch.3x
mvwaddchnstr()Addcurs_addchstr.3x
mvwaddnstr()Addcurs_addstr.3x
mvwchgat()Change_Attributescurs_attr.3x
mvwdelch()Delete_Charactercurs_delch.3x
mvwin()Move_Windowcurs_window.3x
mvwinch()Peekcurs_inch.3x
mvwinchnstr()Peekcurs_inchstr.3x
mvwinnstr()Peekcurs_instr.3x
mvwinsch()Insertcurs_winch.3x
mvwinsnstr()Insertcurs_winch.3x
napms()Nap_Milli_Secondscurs_kernel.3x
new_field()Createform_field_new.3x
new_field()New_Fieldform_field_new.3x
new_form()Createform_new.3x
new_form()New_Formform_new.3x
new_item()Createmitem_new.3x
new_item()New_Itemmitem_new.3x
new_menu()Createmenu_new.3x
new_page()Is_New_Pageform_new_page.3x
new_panel()Createpanel.3x
new_panel()New_Panelpanel.3x
newpad()New_Padcurs_pad.3x
newwin()Createcurs_window.3x
nl()Set_NL_Modecurs_outopts.3x
nodelay()Set_NoDelay_Modecurs_inopts.3x
notimeout()Set_Escape_Time_Modecurs_inopts.3x
overlay()Overlaycurs_overlay.3x
overwrite()Overwritecurs_overlay.3x
pair_content()Pair_Contentcurs_color.3x
panel_above()Abovepanel.3x
panel_below()Belowpanel.3x
panel_hidden()Is_Hiddenpanel.3x
panel_userptrGet_User_Datapanel.3x
panel_window()Get_Windowpanel.3x
panel_window()Panel_Windowpanel.3x
pechochar()Add_Character_To_Pad_And_Echo_Itcurs_pad.3x
pnoutrefresh()Refresh_Without_Updatecurs_pad.3x
pos_form_cursor()Position_Cursorform_cursor.3x
pos_menu_cursor()Position_Cursormenu_cursor.3x
post_form()Postform_post.3x
post_menu()Postmenu_post.3x
prefresh()Refreshcurs_pad.3x
qiflush()Set_Queue_Interrupt_Modecurs_inopts.3x
raw()Set_Raw_Modecurs_inopts.3x
redrawwin()Redrawcurs_refresh.3x
replace_panel()Replacepanel.3x
reset_prog_mode()Reset_Curses_Modecurs_kernel.3x
resetty();Reset_Terminal_Statecurs_kernel.3x
ripoffline()Rip_Off_Linescurs_kernel.3x
savetty()Save_Terminal_Statecurs_kernel.3x
scale_form()Scaleform_win.3x
scale_menu()Scalemenu_win.3x
scrollok()Allow_Scrollingcurs_outopts.3x
set_current_field()Set_Currentform_page.3x
set_current_item()Set_Currentmitem_current.3x
set_field_back()Set_Backgroundform_field_attributes.3x
set_field_buffer()Set_Bufferform_field_buffer.3x
set_field_fore()Set_Foregroundform_field_attributes.3x
set_field_init()Set_Field_Init_Hookform_hook.3x
set_field_just()Set_Justificationform_field_just.3x
set_field_max()Set_Maximum_Sizeform_field_buffer.3x
set_field_opts()Set_Optionsform_field_opts.3x
set_field_pad()Set_Pad_Characterform_field_attributes.3x
set_field_status()Set_Statusform_field_buffer.3x
set_field_term()Set_Field_Term_Hookform_hook.3x
set_field_type()Set_Typeform_fieldtype.3x
set_field_userptrSet_User_Dataform_field_userptr.3x
set_form_fields()Redefineform_field.3x
set_form_fields()Set_Fieldsform_field.3x
set_form_init()Set_Form_Init_Hookform_hook.3x
set_form_opts()Set_Optionsform_opts.3x
set_form_page()Set_Pageform_page.3x
set_form_sub()Set_Sub_Windowform_win.3x
set_form_term()Set_Form_Term_Hookform_hook.3x
set_form_userptrSet_User_Dataform_userptr.3x
set_form_win()Set_Windowform_win.3x
set_item_init()Set_Item_Init_Hookmenu_hook.3x
set_item_opts()Set_Optionsmitem_opts.3x
set_item_term()Set_Item_Term_Hookmenu_hook.3x
set_item_userptrSet_User_Datamitem_userptr.3x
set_item_value()Set_Valuemitem_value.3x
set_menu_back()Set_Backgroundmenu_attribs.3x
set_menu_fore()Set_Foregroundmenu_attribs.3x
set_menu_format()Set_Formatmenu_format.3x
set_menu_grey()Set_Greymenu_attribs.3x
set_menu_init()Set_Menu_Init_Hookmenu_hook.3x
set_menu_items()Redefinemenu_items.3x
set_menu_mark()Set_Markmenu_mark.3x
set_menu_opts()Set_Optionsmenu_opts.3x
set_menu_pad()Set_Pad_Charactermenu_attribs.3x
set_menu_pattern()Set_Patternmenu_pattern.3x
set_menu_spacing()Set_Spacingmenu_spacing.3x
set_menu_sub()Set_Sub_Windowmenu_win.3x
set_menu_term()Set_Menu_Term_Hookmenu_hook.3x
set_menu_userptrSet_User_Datamenu_userptr.3x
set_menu_win()Set_Windowmenu_win.3x
set_new_page()Set_New_Pageform_new_page.3x
set_panel_userptrSet_User_Datapanel.3x
set_top_row()Set_Top_Rowmitem_current.3x
show_panel()Showpanel.3x
slk_attr()Get_Soft_Label_Key_Attributescurs_slk.3x
slk_attr()Get_Soft_Label_Key_Attributescurs_slk.3x
slk_attron()Switch_Soft_Label_Key_Attributescurs_slk.3x
slk_attrset()Set_Soft_Label_Key_Attributescurs_slk.3x
slk_clear()Clear_Soft_Label_Keyscurs_slk.3x
slk_init()Init_Soft_Label_Keyscurs_slk.3x
slk_label()Get_Soft_Label_Keycurs_slk.3x
slk_noutrefresh()Refresh_Soft_Label_Keys_Without_Updatecurs_slk.3x
slk_refresh()Refresh_Soft_Label_Keycurs_slk.3x
slk_restore()Restore_Soft_Label_Keyscurs_slk.3x
slk_set()Set_Soft_Label_Keycurs_slk.3x
slk_touch()Touch_Soft_Label_Keyscurs_slk.3x
start_clolor()Start_Colorcurs_color.3x
stdscrStandard_Windowcurs_initscr.3x
subpad()Sub_Padcurs_pad.3x
subwin()Sub_Windowcurs_window.3x
syncok()Set_Synch_Modecurs_window.3x
termattrs()Supported_Attributescurs_termattrs.3x
termname()Terminal_Namecurs_termattrs.3x
top_panel()Toppanel.3x
top_row()Top_Rowmitem_current.3x
touchline()Touchcurs_touch.3x
touchwin()Touchcurs_touch.3x
unctrl()Un_Controlcurs_util.3x
ungetch()Undo_Keystrokecurs_getch.3x
ungetmouse()Unget_Mousecurs_mouse.3x
untouchwin()Untouchcurs_touch.3x
update_panels()Update_Panelspanel.3x
waddch()Addcurs_addch.3x
waddchnstr()Addcurs_addchstr.3x
waddnstr()Addcurs_addstr.3x
wattr_get()Get_Character_Attributecurs_attr.3x
wattr_get()Get_Character_Attributecurs_attr.3x
wattron()Switch_Character_Attributecurs_attr.3x
wattrset()Set_Character_Attributescurs_attr.3x
wbkgd()Change_Backgroundcurs_bkgd.3x
wbkgdget()Get_Backgroundcurs_bkgd.3x
wbkgdset()Set_Backgroundcurs_bkgd.3x
wborder()Bordercurs_border.3x
wchgat()Change_Attributescurs_attr.3x
wclear()Clearcurs_clear.3x
wclrtobot()Clear_To_End_Of_Screencurs_clear.3x
wclrtoeol()Clear_To_End_Of_Linecurs_clear.3x
wdelch()Delete_Charactercurs_delch.3x
wdeleteln()Delete_Linecurs_deleteln.3x
wechochar()Add_With_Immediate_Echocurs_addch.3x
wenclose()Enclosed_In_Windowcurs_mouse.3x
werase()Erasecurs_clear.3x
wgetch()Get_Keystrokecurs_getch.3x
wgetnstr()Getcurs_getstr.3x
whline()Horizontal_Linecurs_border.3x
winch()Peekcurs_inch.3x
winchnstr()Peekcurs_inchstr.3x
winnstr()Peekcurs_instr.3x
winsch()Insertcurs_winch.3x
winsdelln()Insert_Delete_Linescurs_deleteln.3x
winsertln()Insert_Linecurs_deleteln.3x
winsnstr()Insertcurs_winch.3x
wmove()Move_Cursorcurs_move.3x
wnoutrefresh()Refresh_Without_Updatecurs_refresh.3x
wredrawln()Redrawcurs_refresh.3x
wrefresh()Refreshcurs_refresh.3x
wscrl()Scrollcurs_scroll.3x
wsetscrreg()Set_Scroll_Regioncurs_outopts.3x
wsyncdown()Synchronize_Downwardscurs_window.3x
wsyncup()Synchronize_Upwardscurs_window.3x
wtimeout()Set_Timeout_Modecurs_inopts.3x
wtouchln()Change_Line_Statuscurs_touch.3x
wvline()Vertical_Linecurs_border.3x
diff --git a/Ada95/html/terminal_interface-curses-forms-choice_field_types_s.html b/Ada95/html/terminal_interface-curses-forms-choice_field_types_s.html new file mode 100644 index 00000000..b696e9a1 --- /dev/null +++ b/Ada95/html/terminal_interface-curses-forms-choice_field_types_s.html @@ -0,0 +1,64 @@ + + + + + +
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--              Terminal_Interface.Curses.Forms.Choice_Field_Types          --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+--  Version 00.92                                                           --
+--                                                                          --
+--  The ncurses Ada95 binding is copyrighted 1996 by                        --
+--  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
+--                                                                          --
+--  Permission is hereby granted to reproduce and distribute this           --
+--  binding by any means and for any fee, whether alone or as part          --
+--  of a larger distribution, in source or in binary form, PROVIDED         --
+--  this notice is included with any such distribution, and is not          --
+--  removed from any of its header files. Mention of ncurses and the        --
+--  author of this binding in any applications linked with it is            --
+--  highly appreciated.                                                     --
+--                                                                          --
+--  This binding comes AS IS with no warranty, implied or expressed.        --
+------------------------------------------------------------------------------
+--  Version Control:
+--  @Revision: 1.6 @
+------------------------------------------------------------------------------
+--  You must instantiate this package for any user defined field type
+--  to make it visible to the runtime.
+--
+generic
+   type User is new Ada_Defined_Field_Type with private;
+   type User_Access is access User;
+   with function Field_Check (Fld  : Field;
+                              Info : User_Access) return Boolean;
+   with function Character_Check (Ch   : Character;
+                                  Info : User_Access) return Boolean;
+   with function Next_Choice (Fld  : Field;
+                              Info : User_Access) return Boolean;
+   with function Prev_Choice (Fld  : Field;
+                              Info : User_Access) return Boolean;
+package Terminal_Interface.Curses.Forms.Choice_Field_Types is
+--
+--  Nothing public.
+--  But we need the body.
+    pragma Elaborate_Body;
+end Terminal_Interface.Curses.Forms.Choice_Field_Types;
+
+
+ +


+

+This is BETA software. The interface is subject to change without notice.

+ + +

This hypertext format was generated by David A. Wheeler's ada2html + + + diff --git a/Ada95/html/terminal_interface-curses-forms-field_types_s.html b/Ada95/html/terminal_interface-curses-forms-field_types_s.html new file mode 100644 index 00000000..28c6fa6b --- /dev/null +++ b/Ada95/html/terminal_interface-curses-forms-field_types_s.html @@ -0,0 +1,68 @@ + + + + + +

+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                 Terminal_Interface.Curses.Forms.Field_Types              --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+--  Version 00.92                                                           --
+--                                                                          --
+--  The ncurses Ada95 binding is copyrighted 1996 by                        --
+--  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
+--                                                                          --
+--  Permission is hereby granted to reproduce and distribute this           --
+--  binding by any means and for any fee, whether alone or as part          --
+--  of a larger distribution, in source or in binary form, PROVIDED         --
+--  this notice is included with any such distribution, and is not          --
+--  removed from any of its header files. Mention of ncurses and the        --
+--  author of this binding in any applications linked with it is            --
+--  highly appreciated.                                                     --
+--                                                                          --
+--  This binding comes AS IS with no warranty, implied or expressed.        --
+------------------------------------------------------------------------------
+--  Version Control:
+--  @Revision: 1.3 @
+------------------------------------------------------------------------------
+with Ada.Finalization; use Ada.Finalization;
+
+--  You must instantiate this package for any user defined field type
+--  to make it visible to the runtime.
+--
+generic
+   type User is new Ada_Defined_Field_Type with private;
+   type User_Access is access User;
+   with function Field_Check (Fld  : Field;
+                              Info : User_Access) return Boolean;
+   with function Character_Check (Ch   : Character;
+                                  Info : User_Access) return Boolean;
+package Terminal_Interface.Curses.Forms.Field_Types is
+--
+--  Nothing public. All happens magically.
+--
+private
+   type Tracker is new Limited_Controlled with null record;
+
+   procedure Initialize (Obj : in out Tracker);
+   procedure Finalize   (Obj : in out Tracker);
+
+end Terminal_Interface.Curses.Forms.Field_Types;
+
+
+
+ +


+

+This is BETA software. The interface is subject to change without notice.

+ + +

This hypertext format was generated by David A. Wheeler's ada2html + + + diff --git a/Ada95/html/terminal_interface-curses-forms-field_user_data_s.html b/Ada95/html/terminal_interface-curses-forms-field_user_data_s.html new file mode 100644 index 00000000..7ad321cc --- /dev/null +++ b/Ada95/html/terminal_interface-curses-forms-field_user_data_s.html @@ -0,0 +1,77 @@ + + + + + +

+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--               Terminal_Interface.Curses.Forms.Field_User_Data            --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+--  Version 00.92                                                           --
+--                                                                          --
+--  The ncurses Ada95 binding is copyrighted 1996 by                        --
+--  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
+--                                                                          --
+--  Permission is hereby granted to reproduce and distribute this           --
+--  binding by any means and for any fee, whether alone or as part          --
+--  of a larger distribution, in source or in binary form, PROVIDED         --
+--  this notice is included with any such distribution, and is not          --
+--  removed from any of its header files. Mention of ncurses and the        --
+--  author of this binding in any applications linked with it is            --
+--  highly appreciated.                                                     --
+--                                                                          --
+--  This binding comes AS IS with no warranty, implied or expressed.        --
+------------------------------------------------------------------------------
+--  Version Control:
+--  @Revision: 1.3 @
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access User;
+package Terminal_Interface.Curses.Forms.Field_User_Data is
+
+   --  The binding uses the C level user pointer already for its own
+   --  internal purposes. So you can´t easily manipulate the user pointer
+   --  with the low level C routines for this field without taking care of
+   --  this special situation. If you want to read or write with C routines
+   --  the user pointer of this field, you should get first the low level
+   --  user pointer. This points to a record, that always has as its first
+   --  member the Ada95 user pointer for this field. You should never change
+   --  the low level user pointer of an Ada created field.
+   --
+   --  |=====================================================================
+   --  | Man page form_field_userptr.3x
+   --  |=====================================================================
+
+   --  |
+   procedure Set_User_Data (Fld  : in Field;
+                            Data : in User_Access);
+   --  AKA: set_field_userptr
+   pragma Convention (C, Set_User_Data);
+
+   --  |
+   procedure Get_User_Data (Fld  : in  Field;
+                            Data : out User_Access);
+   --  AKA: field_userptr
+   pragma Convention (C, Get_User_Data);
+
+end Terminal_Interface.Curses.Forms.Field_User_Data;
+
+
+ +


+

+This is BETA software. The interface is subject to change without notice.

+ + +

This hypertext format was generated by David A. Wheeler's ada2html + + + diff --git a/Ada95/html/terminal_interface-curses-forms-form_user_data_s.html b/Ada95/html/terminal_interface-curses-forms-form_user_data_s.html new file mode 100644 index 00000000..be754bed --- /dev/null +++ b/Ada95/html/terminal_interface-curses-forms-form_user_data_s.html @@ -0,0 +1,78 @@ + + + + + +

+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                Terminal_Interface.Curses.Forms.Form_User_Data            --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+--  Version 00.92                                                           --
+--                                                                          --
+--  The ncurses Ada95 binding is copyrighted 1996 by                        --
+--  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
+--                                                                          --
+--  Permission is hereby granted to reproduce and distribute this           --
+--  binding by any means and for any fee, whether alone or as part          --
+--  of a larger distribution, in source or in binary form, PROVIDED         --
+--  this notice is included with any such distribution, and is not          --
+--  removed from any of its header files. Mention of ncurses and the        --
+--  author of this binding in any applications linked with it is            --
+--  highly appreciated.                                                     --
+--                                                                          --
+--  This binding comes AS IS with no warranty, implied or expressed.        --
+------------------------------------------------------------------------------
+--  Version Control:
+--  @Revision: 1.3 @
+------------------------------------------------------------------------------
+
+generic
+   type User is limited private;
+   type User_Access is access User;
+package Terminal_Interface.Curses.Forms.Form_User_Data is
+
+   --  The binding uses the C level user pointer already for its own
+   --  internal purposes. So you can´t easily manipulate the user pointer
+   --  with the low level C routines for this form without taking care of
+   --  this special situation. If you want to read or write with C routines
+   --  the user pointer of this form, you should get first the low level
+   --  user pointer. This points to a record, that always has as its first
+   --  member the Ada95 user pointer for this form. You should never change
+   --  the low level user pointer of an Ada created form.
+   --
+   --  |=====================================================================
+   --  | Man page form_userptr.3x
+   --  |=====================================================================
+
+   --  |
+   procedure Set_User_Data (Frm  : in Form;
+                            Data : in User_Access);
+   --  AKA: set_form_userptr
+   pragma Convention (C, Set_User_Data);
+
+   --  |
+   procedure Get_User_Data (Frm  : in  Form;
+                            Data : out User_Access);
+   --  AKA: form_userptr
+   pragma Convention (C, Get_User_Data);
+
+end Terminal_Interface.Curses.Forms.Form_User_Data;
+
+
+
+ +


+

+This is BETA software. The interface is subject to change without notice.

+ + +

This hypertext format was generated by David A. Wheeler's ada2html + + + diff --git a/Ada95/html/terminal_interface-curses-forms_s.html b/Ada95/html/terminal_interface-curses-forms_s.html new file mode 100644 index 00000000..add98be2 --- /dev/null +++ b/Ada95/html/terminal_interface-curses-forms_s.html @@ -0,0 +1,920 @@ + + + + + +

+
+------------------------------------------------------------------------------
+--                                                                          --
+--                           GNAT ncurses Binding                           --
+--                                                                          --
+--                      Terminal_Interface.Curses.Form                      --
+--                                                                          --
+--                                 S P E C                                  --
+--                                                                          --
+--  Version 00.92                                                           --
+--                                                                          --
+--  The ncurses Ada95 binding is copyrighted 1996 by                        --
+--  Jürgen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                      --
+--                                                                          --
+--  Permission is hereby granted to reproduce and distribute this           --
+--  binding by any means and for any fee, whether alone or as part          --
+--  of a larger distribution, in source or in binary form, PROVIDED         --
+--  this notice is included with any such distribution, and is not          --
+--  removed from any of its header files. Mention of ncurses and the        --
+--  author of this binding in any applications linked with it is            --
+--  highly appreciated.                                                     --
+--                                                                          --
+--  This binding comes AS IS with no warranty, implied or expressed.        --
+------------------------------------------------------------------------------
+--  Version Control:
+--  @Revision: 1.9 @
+------------------------------------------------------------------------------
+--  form binding, generated at Sun Feb  2 17:21:44 1997
+--  This module is generated. Please don't change it manually!
+--  Run the generator instead.
+--  |
+with System;
+with Ada.Tags; use Ada.Tags;
+with Ada.Characters.Latin_1;
+with Interfaces.C;
+with Interfaces.C.Strings;
+
+package Terminal_Interface.Curses.Forms is
+
+   pragma Linker_Options ("-lform");
+
+
+   Space : Character renames Ada.Characters.Latin_1.Space;
+
+   type Field        is private;
+   type Form         is private;
+   type C_Field_Type is private;
+
+   Null_Field        : constant Field;
+   Null_Form         : constant Form;
+   Null_Field_Type   : constant C_Field_Type;
+
+
+   type Field_Justification is (None,
+                                Left,
+                                Center,
+                                Right);
+
+   type Field_Option_Set is
+      record
+         Visible   : Boolean;
+         Active    : Boolean;
+         Public    : Boolean;
+         Edit      : Boolean;
+         Wrap      : Boolean;
+         Blank     : Boolean;
+         Auto_Skip : Boolean;
+         Null_Ok   : Boolean;
+         Pass_Ok   : Boolean;
+         Static    : Boolean;
+         Reserved  : Boolean;
+      end record;
+   pragma Pack (Field_Option_Set);
+   pragma Convention (C, Field_Option_Set);
+
+   for Field_Option_Set use
+      record
+         Visible   at 0 range  0 ..  0;
+         Active    at 0 range  1 ..  1;
+         Public    at 0 range  2 ..  2;
+         Edit      at 0 range  3 ..  3;
+         Wrap      at 0 range  4 ..  4;
+         Blank     at 0 range  5 ..  5;
+         Auto_Skip at 0 range  6 ..  6;
+         Null_Ok   at 0 range  7 ..  7;
+         Pass_Ok   at 0 range  8 ..  8;
+         Static    at 0 range  9 ..  9;
+         Reserved  at 0 range 31 .. 31;
+      end record;
+   for Field_Option_Set'Size use Interfaces.C.int'Size;
+   --  Please note: this rep. clause is generated and may be
+   --               different on your system.
+
+   Default_Field_Options : Field_Option_Set;
+   --  The initial defaults for the field options.
+
+   type Form_Option_Set is
+      record
+         NL_Overload : Boolean;
+         BS_Overload : Boolean;
+         Reserved    : Boolean;
+      end record;
+   pragma Pack (Form_Option_Set);
+   pragma Convention (C, Form_Option_Set);
+
+   for Form_Option_Set use
+      record
+         NL_Overload at 0 range  0 ..  0;
+         BS_Overload at 0 range  1 ..  1;
+         Reserved    at 0 range 31 .. 31;
+      end record;
+   for Form_Option_Set'Size use Interfaces.C.int'Size;
+   --  Please note: this rep. clause is generated and may be
+   --               different on your system.
+
+   Default_Form_Options : Form_Option_Set;
+   --  The initial defaults for the form options.
+
+   type Buffer_Number is new Natural;
+
+   type Field_Array is array (Positive range <>) of aliased Field;
+   pragma Convention (C, Field_Array);
+
+   type Field_Array_Access is access all Field_Array;
+
+   subtype Form_Request_Code is Key_Code range (Key_Max + 1) .. (Key_Max + 57);
+
+   --  The prefix F_ stands for "Form Request"
+   F_Next_Page                : constant Form_Request_Code := Key_Max + 1;
+   F_Previous_Page            : constant Form_Request_Code := Key_Max + 2;
+   F_First_Page               : constant Form_Request_Code := Key_Max + 3;
+   F_Last_Page                : constant Form_Request_Code := Key_Max + 4;
+
+   F_Next_Field               : constant Form_Request_Code := Key_Max + 5;
+   F_Previous_Field           : constant Form_Request_Code := Key_Max + 6;
+   F_First_Field              : constant Form_Request_Code := Key_Max + 7;
+   F_Last_Field               : constant Form_Request_Code := Key_Max + 8;
+   F_Sorted_Next_Field        : constant Form_Request_Code := Key_Max + 9;
+   F_Sorted_Previous_Field    : constant Form_Request_Code := Key_Max + 10;
+   F_Sorted_First_Field       : constant Form_Request_Code := Key_Max + 11;
+   F_Sorted_Last_Field        : constant Form_Request_Code := Key_Max + 12;
+   F_Left_Field               : constant Form_Request_Code := Key_Max + 13;
+   F_Right_Field              : constant Form_Request_Code := Key_Max + 14;
+   F_Up_Field                 : constant Form_Request_Code := Key_Max + 15;
+   F_Down_Field               : constant Form_Request_Code := Key_Max + 16;
+
+   F_Next_Char                : constant Form_Request_Code := Key_Max + 17;
+   F_Previous_Char            : constant Form_Request_Code := Key_Max + 18;
+   F_Next_Line                : constant Form_Request_Code := Key_Max + 19;
+   F_Previous_Line            : constant Form_Request_Code := Key_Max + 20;
+   F_Next_Word                : constant Form_Request_Code := Key_Max + 21;
+   F_Previous_Word            : constant Form_Request_Code := Key_Max + 22;
+   F_Begin_Field              : constant Form_Request_Code := Key_Max + 23;
+   F_End_Field                : constant Form_Request_Code := Key_Max + 24;
+   F_Begin_Line               : constant Form_Request_Code := Key_Max + 25;
+   F_End_Line                 : constant Form_Request_Code := Key_Max + 26;
+   F_Left_Char                : constant Form_Request_Code := Key_Max + 27;
+   F_Right_Char               : constant Form_Request_Code := Key_Max + 28;
+   F_Up_Char                  : constant Form_Request_Code := Key_Max + 29;
+   F_Down_Char                : constant Form_Request_Code := Key_Max + 30;
+
+   F_New_Line                 : constant Form_Request_Code := Key_Max + 31;
+   F_Insert_Char              : constant Form_Request_Code := Key_Max + 32;
+   F_Insert_Line              : constant Form_Request_Code := Key_Max + 33;
+   F_Delete_Char              : constant Form_Request_Code := Key_Max + 34;
+   F_Delete_Previous          : constant Form_Request_Code := Key_Max + 35;
+   F_Delete_Line              : constant Form_Request_Code := Key_Max + 36;
+   F_Delete_Word              : constant Form_Request_Code := Key_Max + 37;
+   F_Clear_EOL                : constant Form_Request_Code := Key_Max + 38;
+   F_Clear_EOF                : constant Form_Request_Code := Key_Max + 39;
+   F_Clear_Field              : constant Form_Request_Code := Key_Max + 40;
+   F_Overlay_Mode             : constant Form_Request_Code := Key_Max + 41;
+   F_Insert_Mode              : constant Form_Request_Code := Key_Max + 42;
+
+   --  Vertical Scrolling
+   F_ScrollForward_Line       : constant Form_Request_Code := Key_Max + 43;
+   F_ScrollBackward_Line      : constant Form_Request_Code := Key_Max + 44;
+   F_ScrollForward_Page       : constant Form_Request_Code := Key_Max + 45;
+   F_ScrollBackward_Page      : constant Form_Request_Code := Key_Max + 46;
+   F_ScrollForward_HalfPage   : constant Form_Request_Code := Key_Max + 47;
+   F_ScrollBackward_HalfPage  : constant Form_Request_Code := Key_Max + 48;
+
+   --  Horizontal Scrolling
+   F_HScrollForward_Char      : constant Form_Request_Code := Key_Max + 49;
+   F_HScrollBackward_Char     : constant Form_Request_Code := Key_Max + 50;
+   F_HScrollForward_Line      : constant Form_Request_Code := Key_Max + 51;
+   F_HScrollBackward_Line     : constant Form_Request_Code := Key_Max + 52;
+   F_HScrollForward_HalfLine  : constant Form_Request_Code := Key_Max + 53;
+   F_HScrollBackward_HalfLine : constant Form_Request_Code := Key_Max + 54;
+
+   F_Validate_Field           : constant Form_Request_Code := Key_Max + 55;
+   F_Next_Choice              : constant Form_Request_Code := Key_Max + 56;
+   F_Previous_Choice          : constant Form_Request_Code := Key_Max + 57;
+
+   --  For those who like the old 'C' style request names
+   REQ_NEXT_PAGE    : Form_Request_Code renames F_Next_Page;
+   REQ_PREV_PAGE    : Form_Request_Code renames F_Previous_Page;
+   REQ_FIRST_PAGE   : Form_Request_Code renames F_First_Page;
+   REQ_LAST_PAGE    : Form_Request_Code renames F_Last_Page;
+
+   REQ_NEXT_FIELD   : Form_Request_Code renames F_Next_Field;
+   REQ_PREV_FIELD   : Form_Request_Code renames F_Previous_Field;
+   REQ_FIRST_FIELD  : Form_Request_Code renames F_First_Field;
+   REQ_LAST_FIELD   : Form_Request_Code renames F_Last_Field;
+   REQ_SNEXT_FIELD  : Form_Request_Code renames F_Sorted_Next_Field;
+   REQ_SPREV_FIELD  : Form_Request_Code renames F_Sorted_Previous_Field;
+   REQ_SFIRST_FIELD : Form_Request_Code renames F_Sorted_First_Field;
+   REQ_SLAST_FIELD  : Form_Request_Code renames F_Sorted_Last_Field;
+   REQ_LEFT_FIELD   : Form_Request_Code renames F_Left_Field;
+   REQ_RIGHT_FIELD  : Form_Request_Code renames F_Right_Field;
+   REQ_UP_FIELD     : Form_Request_Code renames F_Up_Field;
+   REQ_DOWN_FIELD   : Form_Request_Code renames F_Down_Field;
+
+   REQ_NEXT_CHAR    : Form_Request_Code renames F_Next_Char;
+   REQ_PREV_CHAR    : Form_Request_Code renames F_Previous_Char;
+   REQ_NEXT_LINE    : Form_Request_Code renames F_Next_Line;
+   REQ_PREV_LINE    : Form_Request_Code renames F_Previous_Line;
+   REQ_NEXT_WORD    : Form_Request_Code renames F_Next_Word;
+   REQ_PREV_WORD    : Form_Request_Code renames F_Previous_Word;
+   REQ_BEG_FIELD    : Form_Request_Code renames F_Begin_Field;
+   REQ_END_FIELD    : Form_Request_Code renames F_End_Field;
+   REQ_BEG_LINE     : Form_Request_Code renames F_Begin_Line;
+   REQ_END_LINE     : Form_Request_Code renames F_End_Line;
+   REQ_LEFT_CHAR    : Form_Request_Code renames F_Left_Char;
+   REQ_RIGHT_CHAR   : Form_Request_Code renames F_Right_Char;
+   REQ_UP_CHAR      : Form_Request_Code renames F_Up_Char;
+   REQ_DOWN_CHAR    : Form_Request_Code renames F_Down_Char;
+
+   REQ_NEW_LINE     : Form_Request_Code renames F_New_Line;
+   REQ_INS_CHAR     : Form_Request_Code renames F_Insert_Char;
+   REQ_INS_LINE     : Form_Request_Code renames F_Insert_Line;
+   REQ_DEL_CHAR     : Form_Request_Code renames F_Delete_Char;
+   REQ_DEL_PREV     : Form_Request_Code renames F_Delete_Previous;
+   REQ_DEL_LINE     : Form_Request_Code renames F_Delete_Line;
+   REQ_DEL_WORD     : Form_Request_Code renames F_Delete_Word;
+   REQ_CLR_EOL      : Form_Request_Code renames F_Clear_EOL;
+   REQ_CLR_EOF      : Form_Request_Code renames F_Clear_EOF;
+   REQ_CLR_FIELD    : Form_Request_Code renames F_Clear_Field;
+   REQ_OVL_MODE     : Form_Request_Code renames F_Overlay_Mode;
+   REQ_INS_MODE     : Form_Request_Code renames F_Insert_Mode;
+
+   REQ_SCR_FLINE    : Form_Request_Code renames F_ScrollForward_Line;
+   REQ_SCR_BLINE    : Form_Request_Code renames F_ScrollBackward_Line;
+   REQ_SCR_FPAGE    : Form_Request_Code renames F_ScrollForward_Page;
+   REQ_SCR_BPAGE    : Form_Request_Code renames F_ScrollBackward_Page;
+   REQ_SCR_FHPAGE   : Form_Request_Code renames F_ScrollForward_HalfPage;
+   REQ_SCR_BHPAGE   : Form_Request_Code renames F_ScrollBackward_HalfPage;
+
+   REQ_SCR_FCHAR    : Form_Request_Code renames F_HScrollForward_Char;
+   REQ_SCR_BCHAR    : Form_Request_Code renames F_HScrollBackward_Char;
+   REQ_SCR_HFLINE   : Form_Request_Code renames F_HScrollForward_Line;
+   REQ_SCR_HBLINE   : Form_Request_Code renames F_HScrollBackward_Line;
+   REQ_SCR_HFHALF   : Form_Request_Code renames F_HScrollForward_HalfLine;
+   REQ_SCR_HBHALF   : Form_Request_Code renames F_HScrollBackward_HalfLine;
+
+   REQ_VALIDATION   : Form_Request_Code renames F_Validate_Field;
+   REQ_NEXT_CHOICE  : Form_Request_Code renames F_Next_Choice;
+   REQ_PREV_CHOICE  : Form_Request_Code renames F_Previous_Choice;
+
+
+   procedure Request_Name (Key  : in Form_Request_Code;
+                           Name : out String);
+
+   ------------------
+   --  Exceptions  --
+   ------------------
+   Form_Exception : exception;
+
+   --  |=====================================================================
+   --  | Man page form_field_new.3x
+   --  |=====================================================================
+
+   --  |
+   function Create (Height       : Line_Count;
+                    Width        : Column_Coun