bypass curses_putmixed if -DCURSES_GENL_PUTMIXED is defined
This commit is contained in:
@@ -119,6 +119,11 @@ SYSOBJ = $(TARGETPFX)ioctl.o $(TARGETPFX)unixmain.o $(TARGETPFX)unixtty.o \
|
|||||||
# CFLAGS = -mshort -O2 -fomit-frame-pointer -I../include
|
# CFLAGS = -mshort -O2 -fomit-frame-pointer -I../include
|
||||||
# LFLAGS = -mshort -s
|
# LFLAGS = -mshort -s
|
||||||
|
|
||||||
|
# Curses, use one of the following:
|
||||||
|
# -D_XOPEN_SOURCE_EXTENDED=1 allows any map character to appear in the message window
|
||||||
|
# during far look with the '/' command.
|
||||||
|
# -DCURSES_GENL_PUTMIXED to disable that and fall back to displaying only the historical tty character.
|
||||||
|
#
|
||||||
# flags for AIX 3.1 cc on IBM RS/6000 to define
|
# flags for AIX 3.1 cc on IBM RS/6000 to define
|
||||||
# a suitable subset of standard libraries
|
# a suitable subset of standard libraries
|
||||||
# (note that there is more info regarding the "-qchars=signed"
|
# (note that there is more info regarding the "-qchars=signed"
|
||||||
|
|||||||
@@ -90,7 +90,12 @@ WINCFLAGS += -DNOTTYGRAPHICS
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef WANT_WIN_CURSES
|
ifdef WANT_WIN_CURSES
|
||||||
WINCFLAGS += -DCURSES_GRAPHICS -D_XOPEN_SOURCE_EXTENDED=1
|
WINCFLAGS += -DCURSES_GRAPHICS
|
||||||
|
ifeq "$(NOPUTMIXED)" "1"
|
||||||
|
WINCFLAGS += -DCURSES_GENL_PUTMIXED
|
||||||
|
else
|
||||||
|
WINCFLAGS += -D_XOPEN_SOURCE_EXTENDED=1
|
||||||
|
endif
|
||||||
WINSRC += $(WINCURSESSRC)
|
WINSRC += $(WINCURSESSRC)
|
||||||
WINOBJ0 += $(WINCURSESOBJ)
|
WINOBJ0 += $(WINCURSESOBJ)
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -72,10 +72,10 @@ struct window_procs curses_procs = {
|
|||||||
curses_destroy_nhwindow,
|
curses_destroy_nhwindow,
|
||||||
curses_curs,
|
curses_curs,
|
||||||
curses_putstr,
|
curses_putstr,
|
||||||
#if !defined(PDCURSES) || defined(PDC_WIDE)
|
#if defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
||||||
curses_putmixed,
|
|
||||||
#else
|
|
||||||
genl_putmixed,
|
genl_putmixed,
|
||||||
|
#else
|
||||||
|
curses_putmixed,
|
||||||
#endif
|
#endif
|
||||||
curses_display_file,
|
curses_display_file,
|
||||||
curses_start_menu,
|
curses_start_menu,
|
||||||
|
|||||||
+11
-7
@@ -46,7 +46,9 @@ 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))
|
||||||
static int curscolor(int nhcolor, boolean *boldon);
|
static int curscolor(int nhcolor, boolean *boldon);
|
||||||
|
#endif
|
||||||
|
|
||||||
static int turn_lines = 0;
|
static int turn_lines = 0;
|
||||||
static int mx = 0;
|
static int mx = 0;
|
||||||
@@ -66,9 +68,10 @@ curses_message_win_puts(const char *message, boolean recursed)
|
|||||||
char *tmpstr;
|
char *tmpstr;
|
||||||
WINDOW *win = curses_get_nhwin(MESSAGE_WIN);
|
WINDOW *win = curses_get_nhwin(MESSAGE_WIN);
|
||||||
boolean bold, border = curses_window_has_border(MESSAGE_WIN),
|
boolean bold, border = curses_window_has_border(MESSAGE_WIN),
|
||||||
have_mixed_leadin = FALSE, adjustbold = FALSE;
|
adjustbold = FALSE;
|
||||||
int message_length = (int) strlen(message);
|
int message_length = (int) strlen(message);
|
||||||
#if !defined(PDCURSES) || defined(PDC_WIDE)
|
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
||||||
|
boolean have_mixed_leadin = FALSE;
|
||||||
cchar_t mixed_leadin_cchar[2];
|
cchar_t mixed_leadin_cchar[2];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -120,7 +123,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(PDCURSES) || defined(PDC_WIDE)
|
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
||||||
if (mesg_mixed) {
|
if (mesg_mixed) {
|
||||||
wchar_t w[2];
|
wchar_t w[2];
|
||||||
int leadin_color;
|
int leadin_color;
|
||||||
@@ -149,7 +152,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 /* !PDCURSES || PDC_WIDE */
|
#endif /* CURSES_GENL_PUTMIXED || PDCURSES without PDC_WIDE */
|
||||||
|
|
||||||
if (linespace < message_length) {
|
if (linespace < message_length) {
|
||||||
if (my - border_space >= height - 1) {
|
if (my - border_space >= height - 1) {
|
||||||
@@ -190,7 +193,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(PDCURSES) || defined(PDC_WIDE)
|
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
||||||
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;
|
||||||
@@ -211,7 +214,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(PDCURSES) || defined(PDC_WIDE)
|
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
||||||
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;
|
||||||
@@ -227,7 +230,7 @@ curses_message_win_puts(const char *message, boolean recursed)
|
|||||||
wrefresh(win);
|
wrefresh(win);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(CURSES_GENL_PUTMIXED) || (defined(PDCURSES) && !defined(PDC_WIDE))
|
||||||
static int
|
static int
|
||||||
curscolor(int nhcolor, boolean *boldon)
|
curscolor(int nhcolor, boolean *boldon)
|
||||||
{
|
{
|
||||||
@@ -255,6 +258,7 @@ curscolor(int nhcolor, boolean *boldon)
|
|||||||
}
|
}
|
||||||
return curses_color;
|
return curses_color;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void curses_got_input(void)
|
void curses_got_input(void)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user