/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <ctype.h>
-MODULE_ID("$Id: tty_update.c,v 1.264 2010/12/19 01:21:02 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.273 2012/12/22 21:38:17 tom Exp $")
/*
* This define controls the line-breakout optimization. Every once in a
{
int chlen = 1;
NCURSES_CH_T my_ch;
+#if USE_WIDEC_SUPPORT
PUTC_DATA;
+#endif
NCURSES_CH_T tilde;
NCURSES_CH_T attr = CHDEREF(ch);
&& SP_PARM->_screen_acs_map[CharOf(my_ch)]) {
RemAttr(attr, A_ALTCHARSET);
my_ch = _nc_wacs[CharOf(my_ch)];
+ } else if (SP_PARM->_screen_unicode
+ && !SP_PARM->_screen_acs_map[CharOf(my_ch)]
+ && _nc_wacs[CharOf(my_ch)].chars[0]) {
+ RemAttr(attr, A_ALTCHARSET);
+ my_ch = _nc_wacs[CharOf(my_ch)];
}
#endif
/*
int j = CharOfD(ch);
chtype temp = UChar(SP_PARM->_acs_map[j]);
- if (!(SP_PARM->_screen_acs_map[j])) {
+ if (temp != 0) {
+ SetChar(my_ch, temp, AttrOf(attr));
+ } else {
+ my_ch = CHDEREF(ch);
RemAttr(attr, A_ALTCHARSET);
- if (temp == 0)
- temp = ' ';
}
- if (temp != 0)
- SetChar(my_ch, temp, AttrOf(attr));
}
ch = CHREF(my_ch);
}
}
UpdateAttrs(SP_PARM, attr);
+ PUTC(CHDEREF(ch));
#if !USE_WIDEC_SUPPORT
- /* FIXME - we do this special case for signal handling, should see how to
- * make it work for wide characters.
- */
- if (SP_PARM->_outch != 0) {
- SP_PARM->_outch(NCURSES_SP_ARGx UChar(ch));
- } else
+ COUNT_OUTCHARS(1);
#endif
- {
- PUTC(CHDEREF(ch), SP_PARM->_ofp); /* macro's fastest... */
- COUNT_OUTCHARS(1);
- }
SP_PARM->_curscol += chlen;
if (char_padding) {
TPUTS_TRACE("char_padding");
struct pollfd fds[1];
fds[0].fd = SP_PARM->_checkfd;
fds[0].events = POLLIN;
- if (poll(fds, 1, 0) > 0) {
+ if (poll(fds, (size_t) 1, 0) > 0) {
have_pending = TRUE;
}
#elif defined(__BEOS__)
T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM));
+ if (SP_PARM == 0)
+ returnCode(ERR);
+
#if !USE_REENTRANT
/*
* It is "legal" but unlikely that an application could assign a new
*/
static void
-ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, bool needclear)
+ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, int needclear)
{
int j;
- if (SP_PARM != 0) {
- if (CurScreen(SP_PARM) != 0
- && SP_PARM->_cursrow >= 0) {
- for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) {
- if (j >= 0) {
- NCURSES_CH_T *cp =
- &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]);
-
- if (!CharEq(*cp, blank)) {
- *cp = blank;
- needclear = TRUE;
- }
+ if (CurScreen(SP_PARM) != 0
+ && SP_PARM->_cursrow >= 0) {
+ for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) {
+ if (j >= 0) {
+ NCURSES_CH_T *cp =
+ &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]);
+
+ if (!CharEq(*cp, blank)) {
+ *cp = blank;
+ needclear = TRUE;
}
}
}
}
- if (needclear && (SP_PARM != 0)) {
+ if (needclear) {
UpdateAttrs(SP_PARM, blank);
TPUTS_TRACE("clr_eol");
if (clr_eol && SP_PARM->_el_cost <= (screen_columns(SP_PARM) - SP_PARM->_curscol)) {
{
int row, col;
- if (0 == SP_PARM)
- return;
-
row = SP_PARM->_cursrow;
col = SP_PARM->_curscol;
NCURSES_EXPORT(void)
NCURSES_SP_NAME(_nc_screen_wrap) (NCURSES_SP_DCL0)
{
- if (SP_PARM == 0)
- return;
+ if (SP_PARM != 0) {
- UpdateAttrs(SP_PARM, normal);
+ UpdateAttrs(SP_PARM, normal);
#if NCURSES_EXT_FUNCS
- if (SP_PARM->_coloron
- && !SP_PARM->_default_color) {
- static const NCURSES_CH_T blank = NewChar(BLANK_TEXT);
- SP_PARM->_default_color = TRUE;
- NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx
- -1,
- 0,
- FALSE,
- NCURSES_SP_NAME(_nc_outch));
- SP_PARM->_default_color = FALSE;
-
- TINFO_MVCUR(NCURSES_SP_ARGx
- SP_PARM->_cursrow,
- SP_PARM->_curscol,
- screen_lines(SP_PARM) - 1,
- 0);
-
- ClrToEOL(NCURSES_SP_ARGx blank, TRUE);
- }
+ if (SP_PARM->_coloron
+ && !SP_PARM->_default_color) {
+ static const NCURSES_CH_T blank = NewChar(BLANK_TEXT);
+ SP_PARM->_default_color = TRUE;
+ NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx
+ -1,
+ 0,
+ FALSE,
+ NCURSES_SP_NAME(_nc_outch));
+ SP_PARM->_default_color = FALSE;
+
+ TINFO_MVCUR(NCURSES_SP_ARGx
+ SP_PARM->_cursrow,
+ SP_PARM->_curscol,
+ screen_lines(SP_PARM) - 1,
+ 0);
+
+ ClrToEOL(NCURSES_SP_ARGx blank, TRUE);
+ }
#endif
- if (SP_PARM->_color_defs) {
- NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG);
+ if (SP_PARM->_color_defs) {
+ NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG);
+ }
}
}