follow-up for curses_putmixed vs genl_putmixed
This commit is contained in:
@@ -91,8 +91,8 @@ endif
|
|||||||
|
|
||||||
ifdef WANT_WIN_CURSES
|
ifdef WANT_WIN_CURSES
|
||||||
WINCFLAGS += -DCURSES_GRAPHICS
|
WINCFLAGS += -DCURSES_GRAPHICS
|
||||||
ifeq "$(NOPUTMIXED)" "1"
|
ifeq "$(USE_GENL_PUTMIXED)" "1"
|
||||||
WINCFLAGS += -DCURSES_GENL_PUTMIXED
|
WINCFLAGS += -DUSE_GENL_PUTMIXED
|
||||||
else
|
else
|
||||||
WINCFLAGS += -D_XOPEN_SOURCE_EXTENDED=1
|
WINCFLAGS += -D_XOPEN_SOURCE_EXTENDED=1
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -24,6 +24,11 @@ extern long curs_mesg_suppress_seq; /* from cursmesg.c */
|
|||||||
extern boolean curs_mesg_no_suppress; /* ditto */
|
extern boolean curs_mesg_no_suppress; /* ditto */
|
||||||
extern int mesg_mixed;
|
extern int mesg_mixed;
|
||||||
extern glyph_info mesg_gi;
|
extern glyph_info mesg_gi;
|
||||||
|
#ifndef CURSES_GENL_PUTMIXED
|
||||||
|
#if !defined(PDCURSES) || defined(PDC_WIDE)
|
||||||
|
#define USE_CURSES_PUTMIXED
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* stubs for curses_procs{} */
|
/* stubs for curses_procs{} */
|
||||||
#ifdef POSITIONBAR
|
#ifdef POSITIONBAR
|
||||||
@@ -72,10 +77,10 @@ struct window_procs curses_procs = {
|
|||||||
curses_destroy_nhwindow,
|
curses_destroy_nhwindow,
|
||||||
curses_curs,
|
curses_curs,
|
||||||
curses_putstr,
|
curses_putstr,
|
||||||
#if defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
#ifdef USE_CURSES_PUTMIXED
|
||||||
genl_putmixed,
|
|
||||||
#else
|
|
||||||
curses_putmixed,
|
curses_putmixed,
|
||||||
|
#else
|
||||||
|
genl_putmixed,
|
||||||
#endif
|
#endif
|
||||||
curses_display_file,
|
curses_display_file,
|
||||||
curses_start_menu,
|
curses_start_menu,
|
||||||
|
|||||||
+14
-7
@@ -30,6 +30,13 @@ boolean curs_mesg_no_suppress = FALSE;
|
|||||||
int mesg_mixed = 0;
|
int mesg_mixed = 0;
|
||||||
glyph_info mesg_gi;
|
glyph_info mesg_gi;
|
||||||
|
|
||||||
|
#ifndef CURSES_GENL_PUTMIXED
|
||||||
|
#if !defined(PDCURSES) || defined(PDC_WIDE)
|
||||||
|
#define USE_CURSES_PUTMIXED
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Message window routines for curses interface */
|
/* Message window routines for curses interface */
|
||||||
|
|
||||||
/* Private declarations */
|
/* Private declarations */
|
||||||
@@ -46,7 +53,7 @@ static void unscroll_window(winid wid);
|
|||||||
static void directional_scroll(winid wid, int nlines);
|
static void directional_scroll(winid wid, int nlines);
|
||||||
static void mesg_add_line(const char *mline);
|
static void mesg_add_line(const char *mline);
|
||||||
static nhprev_mesg *get_msg_line(boolean reverse, int mindex);
|
static nhprev_mesg *get_msg_line(boolean reverse, int mindex);
|
||||||
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
#ifdef USE_CURSES_PUTMIXED
|
||||||
static int curscolor(int nhcolor, boolean *boldon);
|
static int curscolor(int nhcolor, boolean *boldon);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -70,7 +77,7 @@ curses_message_win_puts(const char *message, boolean recursed)
|
|||||||
boolean bold, border = curses_window_has_border(MESSAGE_WIN),
|
boolean bold, border = curses_window_has_border(MESSAGE_WIN),
|
||||||
adjustbold = FALSE;
|
adjustbold = FALSE;
|
||||||
int message_length = (int) strlen(message);
|
int message_length = (int) strlen(message);
|
||||||
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
#ifdef USE_CURSES_PUTMIXED
|
||||||
boolean have_mixed_leadin = FALSE;
|
boolean have_mixed_leadin = FALSE;
|
||||||
cchar_t mixed_leadin_cchar[2];
|
cchar_t mixed_leadin_cchar[2];
|
||||||
#endif
|
#endif
|
||||||
@@ -123,7 +130,7 @@ curses_message_win_puts(const char *message, boolean recursed)
|
|||||||
linespace -= 2;
|
linespace -= 2;
|
||||||
bold = (height > 1 && !last_messages);
|
bold = (height > 1 && !last_messages);
|
||||||
|
|
||||||
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
#ifdef USE_CURSES_PUTMIXED
|
||||||
if (mesg_mixed) {
|
if (mesg_mixed) {
|
||||||
wchar_t w[2];
|
wchar_t w[2];
|
||||||
int leadin_color;
|
int leadin_color;
|
||||||
@@ -152,7 +159,7 @@ curses_message_win_puts(const char *message, boolean recursed)
|
|||||||
message_length++; /* account for that additional column */
|
message_length++; /* account for that additional column */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CURSES_GENL_PUTMIXED || PDCURSES without PDC_WIDE */
|
#endif /* USE_CURSES_PUTMIXED */
|
||||||
|
|
||||||
if (linespace < message_length) {
|
if (linespace < message_length) {
|
||||||
if (my - border_space >= height - 1) {
|
if (my - border_space >= height - 1) {
|
||||||
@@ -193,7 +200,7 @@ curses_message_win_puts(const char *message, boolean recursed)
|
|||||||
if (mx == border_space && message_length > width - 3) {
|
if (mx == border_space && message_length > width - 3) {
|
||||||
/* split needed */
|
/* split needed */
|
||||||
tmpstr = curses_break_str(message, (width - 3), 1);
|
tmpstr = curses_break_str(message, (width - 3), 1);
|
||||||
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
#ifdef USE_CURSES_PUTMIXED
|
||||||
if (have_mixed_leadin) {
|
if (have_mixed_leadin) {
|
||||||
mvwadd_wch(win, my, mx, mixed_leadin_cchar);
|
mvwadd_wch(win, my, mx, mixed_leadin_cchar);
|
||||||
++mx;
|
++mx;
|
||||||
@@ -214,7 +221,7 @@ curses_message_win_puts(const char *message, boolean recursed)
|
|||||||
curses_message_win_puts(tmpstr, TRUE);
|
curses_message_win_puts(tmpstr, TRUE);
|
||||||
free(tmpstr);
|
free(tmpstr);
|
||||||
} else {
|
} else {
|
||||||
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
#ifdef USE_CURSES_PUTMIXED
|
||||||
if (have_mixed_leadin) {
|
if (have_mixed_leadin) {
|
||||||
mvwadd_wch(win, my, mx, mixed_leadin_cchar);
|
mvwadd_wch(win, my, mx, mixed_leadin_cchar);
|
||||||
++mx;
|
++mx;
|
||||||
@@ -230,7 +237,7 @@ curses_message_win_puts(const char *message, boolean recursed)
|
|||||||
wrefresh(win);
|
wrefresh(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
#ifdef USE_CURSES_PUTMIXED
|
||||||
static int
|
static int
|
||||||
curscolor(int nhcolor, boolean *boldon)
|
curscolor(int nhcolor, boolean *boldon)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user