curses_putmixed() initial attempt

The curses interface was using genl_putmixed() which doesn't
preserve the symbol actually used for a glyph on the display.
This is a first-attempt at implementing curses_putmixed().

On Linux you'll need to distribute the Makefiles again
    sh sys/unix/setup.sh sys/unix/hints/linux.370

On macOS, you'll need to distribute the Makefiles again
    sh sys/unix/setup.sh sys/unix/hints/macOS.370
This commit is contained in:
nhmall
2023-06-06 17:50:08 -04:00
parent a5a11c19c9
commit 4034ec915c
6 changed files with 131 additions and 10 deletions
+16 -1
View File
@@ -22,6 +22,8 @@ extern char erase_char, kill_char;
extern long curs_mesg_suppress_seq; /* from cursmesg.c */
extern boolean curs_mesg_no_suppress; /* ditto */
extern int mesg_mixed;
extern glyph_info mesg_gi;
/* stubs for curses_procs{} */
#ifdef POSITIONBAR
@@ -70,7 +72,7 @@ struct window_procs curses_procs = {
curses_destroy_nhwindow,
curses_curs,
curses_putstr,
genl_putmixed,
curses_putmixed,
curses_display_file,
curses_start_menu,
curses_add_menu,
@@ -561,6 +563,19 @@ curses_putstr(winid wid, int attr, const char *text)
curs_mesg_no_suppress = FALSE;
}
void
curses_putmixed(winid window, int attr, const char *str)
{
if (window == WIN_MESSAGE) {
str = mixed_to_glyphinfo(str, &mesg_gi);
mesg_mixed = 1;
}
/* now send it to the normal putstr */
curses_putstr(window, attr, str);
if (window == WIN_MESSAGE)
mesg_mixed = 0;
}
/* Display the file named str. Complain about missing files
iff complain is TRUE.
*/