Skip to content

PDCurses 3.0 - 2007/04/01

Compare
Choose a tag to compare
@GitMensch GitMensch released this 12 Sep 11:40
· 2095 commits to master since this release

The focuses for this release are X/Open conformance, i18n, better color support, cleaner code, and more consistency across platforms.

This is only a brief summary of the changes. For more details, consult the VCS log.

New features:

  • An almost complete implementation of X/Open curses, including the wide-character and attr_t functions (but excluding terminfo). The wide-character functions work only in Win32 and X11, for now, and require building the library with the appropriate options (see INSTALL). Note that this is a simplistic implementation, with exactly one wchar_t per cchar_t; the only characters it handles properly are those that are one column wide.

  • Support for X Input Methods in the X11 port (see INSTALL). When built this way, the internal compose key support is disabled in favor of XIM's, which is a lot more complete, although you lose the box cursor.

  • Multibyte character support in the non-wide string handling functions, per X/Open. This only works when the library is built with wide- character support enabled.

  • Mouse support for DOS and OS/2. The DOS version includes untested support for scroll wheels, via the "CuteMouse" driver.

  • An ncurses-compatible mouse interface, which can work in parallel with the traditional PDCurses mouse interface. See the man page (or mouse.c) for details.

  • DOS and OS/2 can now return modifiers as keys, as in Win32 and X11.

  • COLORS, which had been fixed at 8, is now either 8 or 16, depending on the terminal -- usually 16. When it's 8, blinking mode is enabled (controlled as before by the A_BLINK attribute); when it's 16, bright background colors are used instead. On platforms where it can be changed, the mode is toggled by the new function PDC_set_blink(). PDCurses tries to set PDC_set_blink(FALSE) at startup. (In Win32, it's always set to FALSE; in DOS, with other than an EGA or VGA card, it can't be.) Also, COLORS is now set to 0 until start_color() is called.

  • Corresponding to the change in COLORS, COLOR_PAIRS is now 256.

  • Working init_color() and color_content(). The OS/2 version of init_color() works only in a full-screen session; the Win32 version works only in windowed mode, and only in NT-family OSes; the DOS version works only with VGA adapters (real or simulated). The Win32 version is based mostly on James Brown's setconsoleinfo.c (www.catch22.net).

  • use_default_colors(), assume_default_colors(), and curses_version(), after ncurses.

  • Added global int TABSIZE, after ncurses and Solaris curses; removed window-specific _tabsize.

  • Logical extension to the wide-character slk_ funcs: slk_wlabel(), for retrieving the label as a wide-character string.

  • A non-macro implementation of ncurses' wresize().

  • Working putwin(), getwin(), scr_dump() and scr_restore().

  • A working acs_map[]. Characters from the ACS are now stored in window structures as a regular character plus the A_ALTCHARSET attribute, and rendered to the ACS only when displayed. (This allows, for example, the correct display on one platform of windows saved from another.)

  • In X11, allow selection and paste of UTF8_STRING.

  • The testcurs demo now includes a color chart and init_color() test, a wide character input test, a display of wide ACS characters with sample Unicode text, a specific test of flash(), more info in the resize test, and attempts to change the width as well as the height.

  • Command-line option for MSVC to build DLLs (see INSTALL). Also, the naming distinction for DLLs ("curses" vs. "pdcurses") is abandoned, and either the static lib or DLL is built, not both at once (except for X11).

  • For backwards compatibility, a special module just for deprecated functions -- currently PDC_check_bios_key(), PDC_get_bios_key(), PDC_get_ctrl_break() and PDC_set_ctrl_break(). These shouldn't be used in applications, but currently are... in fact, all the "private" functions (in curspriv.h) are subject to change and should be avoided.

  • A new document, IMPLEMNT, describing PDCurses' internal functions for those wishing to port it to new platforms.

  • Mark Hessling has released the X11 port to the public domain. (However, x11/ScrollBox* retain their separate copyright and MIT-like license.)

Bug fixes and such:

  • Most of the macros have been removed (along with the NOMACROS ifdef). The only remaining ones are those which have to be macros to work, and those that are required by X/Open to be macros. There were numerous problems with the macros, and no apparent reason to keep them, except tradition -- although it was PCcurses 1.x that first omitted them.

  • Clean separation of platform-specific code from the rest. Outside of the platform directories, there remain only a few ifdefs in curses.h and curspriv.h.

  • General reorganization and simplification.

  • Documentation revisions.

  • When expanding control characters in addch() or insch(), retain the attributes from the chtype.

  • Preserve the A_ALTCHARSET attribute in addch() and insch().

  • Per X/Open, beep() should always return OK.

  • On platforms with a controlling terminal (i.e., not X11), curs_set(1) now sets the cursor to the shape it had at the time of initscr(), rather than always making it small. (Exception for DOS: If the video mode has been changed by PDC_resize_screen(), curs_set(1) reverts to line 6/7.) The shape is taken from SP->orig_cursor (the meaning of which is platform-specific).

  • Stop updating the cursor position when the cursor is invisible (this gives a huge performance boost in Win 9x); update the cursor position from curs_set() if changing from invisible to visible.

  • Some tweaking of the behavior of def_prog_mode(), def_shell_mode(), savetty(), reset_prog_mode(), reset_shell_mode() and resetty()... still not quite right.

  • flash() was not implemented for Win32 or X. A portable implementation is now used for all platforms. Note that it's much slower than the old (DOS and OS/2) version, but this is only apparent on an extremely slow machine, such as an XT.

  • In getstr(), backspacing on high-bit characters caused a double backspace.

  • hline() and vline() used an incorrect (off by one) interpretation of _maxx and _maxy. If values of n greater than the max were specified, these functions could access unallocated memory.

  • innstr() is supposed to return the number of characters read, not just OK or ERR. Reported by Mike Aubury.

  • A proper implementation of insch() -- the PDC_chadd()-based version wasn't handling the control characters correctly.

  • Return ASCII and control key names from keyname() (problem revealed by ncurses' movewindow test); also, per X/Open, return "UNKNOWN KEY" when appropriate, rather than "NO KEY NAME".

  • Turn off the cursor from leaveok(TRUE), even in X11; leaveok(FALSE) now calls curs_set(1), regardless of the previous state of the cursor.

  • In the slk area, BUTTON_CLICKED events now translate to function keys, along with the previously recognized BUTTON_PRESSED events. Of course, it should really be checking the events specified by map_button(), which still doesn't work.

  • napms(0) now returns immediately.

  • A unified napms() implementation for DOS -- no longer throttles the CPU when built with any compiler.

  • Allow backspace editing of the nocbreak() buffer.

  • pair_content(0, ...) is valid.

  • There was no check to ensure that the pnoutrefresh() window fit within the screen. It now returns an ERR if it doesn't.

  • In X11, resize_term() must be called with parameters (0, 0), and only when SP->resized is set, else it returns ERR.

  • Copy _bkgd in resize_window(). Patch found on Frederic L. W. Meunier's web site.

  • slk_clear() now removes the buttons completely, as in ncurses.

  • Use the current foreground color for the line attributes (underline, left, right), unless PDC_set_line_color() is explicitly called. After setting the line color, you can reset it to this mode via "PDC_set_line_color(-1)".

  • Removed non-macro implementations of COLOR_PAIR() and PAIR_NUMBER().

  • Dispensed with PDC_chadd() and PDC_chins() -- waddch() and winsch() are now (again) the core functions.

  • Dropped or made static many obsolete, unused, and/or broken functions, including PDC_chg_attrs(), PDC_cursor_on() and _off(), PDC_fix_cursor(), PDC_get_attribute(), PDC_get_cur_col() and _row(), PDC_set_80x25(), PDC_set_cursor_mode(), PDC_set_rows(), PDC_wunderline(), PDC_wleftline(), PDC_wrightline(), XCursesModifierPress() and XCurses_refresh_scrollbar().

  • Obsolete/unused defines: _BCHAR, _GOCHAR, _STOPCHAR, _PRINTCHAR _ENDLINE, _FULLWIN and _SCROLLWIN.

  • Obsolete/unused elements of the WINDOW struct: _pmax*, _lastp*, _lasts*.

  • Obsolete/unused elements of the SCREEN struct: orgcbr, visible_cursor, sizeable, shell, blank, cursor, orig_emulation, font, orig_font, tahead, adapter, scrnmode, kbdinfo, direct_video, video_page, video_seg, video_ofs, bogus_adapter. (Some of these persist outside the SCREEN struct, in the platform directories.) Added mouse_wait and key_code.

  • Removed all the EMALLOC stuff. Straight malloc calls were used elsewhere; it was undocumented outside of comments in curspriv.h; and there are better ways to use a substitute malloc().

  • Single mouse clicks are now reportable on all platforms (not just double-clicks). And in general, mouse event reporting is more consistent across platforms.

  • The mouse cursor no longer appears in full-screen mode in Win32 unless a nonzero mouse event mask is used.

  • ALT-keypad input now works in Win32.

  • In Win32, SetConsoleMode(ENABLE_WINDOW_INPUT) is not useful, and appears to be the source of a four-year-old bug report (hanging in THE) by Phil Smith.

  • Removed the PDC_THREAD_BUILD stuff, which has never worked. For the record: PDCurses is not thread-safe. Neither is ncurses; and the X/Open curses spec explicitly makes it a non-requirement.

  • With the internal compose key system in the X11 port, modifier keys were breaking out of the compose state, making it impossible to type accented capitals, etc. Also, Multi_key is now the default compose key, instead of leaving it undefined by default; and a few more combos are supported.

  • In X11, the first reported mouse event after startup always read as a double-click at position 0, 0. (This bug was introduced in 2.8.)

  • In X11, don't return selection start as a press event. (Shift-click on button 1 is still returned.)

  • In X11, properly handle pasting of high-bit chars. (It was doing an unwanted sign extension.)

  • In X11, BUTTON_MOVED was never returned, although PDC_MOUSE_MOVED was set.

  • The fix in 2.8 for the scroll wheel in X11 wasn't very good -- it did report the events as scroll wheel events, but it doubled them. Here's a proper fix.

  • Changed mouse handling in X11: Simpler translation table, with XCursesPasteSelection() called from XCursesButton() instead of the translation table; require shift with button 1 or 2 for select or paste when mouse events are being reported (as with ncurses), allowing passthrough of simple button 2 events. This fixes the previously unreliable button 2 behavior.

  • Modifier keys are now returned on key up in X11, as in Win32. And in general, modifier key reporting is more consistent across platforms.

  • Modifiers are not returned as keys when a mouse click has occurred since the key press.

  • In BIOS mode (in DOS), count successive identical output bytes, and make only one BIOS call for all of them. This dramatically improves performance.

  • The cursor position was not always updated correctly in BIOS mode.

  • In testcurs, the way the ACS test was written, it would really only work with a) PDCurses (with any compiler), or b) gcc (with any curses). Here's a more portable implementation.

  • Better reporting of mouse events in testcurs.

  • Blank out buffer and num before the scanw() test in testcurs, in case the user just hits enter or etc.; clear the screen after resizing.

  • Allow tuidemo to use the last line.

  • Separate left/right modifier keys are now reported properly in Win32. (Everything was being reported as _R.)

  • Attempts to redirect input in Win32 now cause program exit and an error message, instead of hanging.

  • Dropped support for the Microway NDP compiler.

  • Some modules renamed, rearranged.

  • Fixes for errors and warnings when building with Visual C++ 2005.

  • In MSVC, the panel library didn't work with the DLL.

  • Complete export lists for DLLs.

  • Simplified makefiles; moved common elements to .mif files; better optimization; strip demos when possible.

  • Changed makefile targets of "pdcurses.a/lib" and "panel.a/lib" to $(LIBCURSES) and $(LIBPANEL). Suggestion of Doug Kaufman.

  • Changed "install" target in the makefile to a double-colon rule, to get around a conflict with INSTALL on non-case-sensitive filesystems, such as Mac OS X's HFS+. Reported by Douglas Godfrey et al.

  • Make PDCurses.man dependent on manext. Suggestion of Tiziano Mueller.

  • Set up configure.ac so autoheader works; removed some obsolescent macros. Partly the suggestion of T.M.

  • The X11 port now builds in the x11 directory (including the demos), as with other ports.

  • The X11 port should now build on more 64-bit systems. Partly due to M.H.

  • The default window title and icons for the X11 port are now "PDCurses" instead of "XCurses".

  • Internal functions and variables made static where possible.

  • Adopted a somewhat more consistent naming style: Internal functions with external linkage, and only those, have the prefix "PDC_"; external variables that aren't part of the API use "pdc_"; static functions use ""; and "XC" and "xc_" prefixes are used for functions and variables, respectively, that are shared between both processes in the X11 port. Also eliminated camel casing, where possible.

  • Changed the encoding for non-ASCII characters in comments and documentation from Latin-1 to UTF-8.