FreeBSD/contrib/ncurses/ncurses/win32con/win_driver.c
/*
 * TODO: support surrogate pairs
 * TODO: support combining characters
 * TODO: support acsc
 * TODO: check wcwidth of base character, fill if needed for double-width
 * TODO: _nc_wacs should be part of sp.
 */
support surrogate pairs
TODO: support combining characters
TODO: support acsc
TODO: check wcwidth of base character, fill if needed for double-width
TODO: _nc_wacs should be part of sp.
support surrogate pairs TODO : support combining characters TODO : support acsc TODO : check wcwidth of base character fill if needed for double - width TODO : _nc_wacs should be part of sp .
static BOOL
con_write16(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, cchar_t *str, int limit)
{
    int actual = 0;
    CHAR_INFO ci[limit];
    COORD loc, siz;
    SMALL_RECT rec;
    int i;
    cchar_t ch;
    SCREEN *sp;
    Properties *p = PropOf(TCB);
    AssertTCB();
    SetSP();
    for (i = actual = 0; i < limit; i++) {
	ch = str[i];
	if (isWidecExt(ch))
	    continue;
	ci[actual].Char.UnicodeChar = CharOf(ch);
	ci[actual].Attributes = MapAttr(TCB,
					PropOf(TCB)->SBI.wAttributes,
					AttrOf(ch));
	if (AttrOf(ch) & A_ALTCHARSET) {
	    if (_nc_wacs) {
		int which = CharOf(ch);
		if (which > 0
		    && which < ACS_LEN
		    && CharOf(_nc_wacs[which]) != 0) {
		    ci[actual].Char.UnicodeChar = CharOf(_nc_wacs[which]);
		} else {
		    ci[actual].Char.UnicodeChar = ' ';
		}
	    }
	}
	++actual;
    }
    loc.X = (short) 0;
    loc.Y = (short) 0;
    siz.X = (short) actual;
    siz.Y = 1;
    rec.Left = (short) x;
    rec.Top = (SHORT) (y + AdjustY(p));
    rec.Right = (short) (x + limit - 1);
    rec.Bottom = rec.Top;
    return WriteConsoleOutputW(TCB->hdl, ci, siz, loc, &rec);
}
static BOOL con_write16 ( TERMINAL_CONTROL_BLOCK * TCB , int y , int x , cchar_t * str , int limit ) { int actual = 0 ; CHAR_INFO ci [ limit ] ; COORD loc , siz ; SMALL_RECT rec ; int i ; cchar_t ch ; SCREEN * sp ; Properties * p = PropOf ( TCB ) ; AssertTCB ( ) ; SetSP ( ) ; for ( i = actual = 0 ; i < limit ; i ++ ) { ch = str [ i ] ; if ( isWidecExt ( ch ) ) continue ; ci [ actual ] . Char . UnicodeChar = CharOf ( ch ) ; ci [ actual ] . Attributes = MapAttr ( TCB , PropOf ( TCB ) -> SBI . wAttributes , AttrOf ( ch ) ) ; if ( AttrOf ( ch ) & A_ALTCHARSET ) { if ( _nc_wacs ) { int which = CharOf ( ch ) ; if ( which > 0 && which < ACS_LEN && CharOf ( _nc_wacs [ which ] ) != 0 ) { ci [ actual ] . Char . UnicodeChar = CharOf ( _nc_wacs [ which ] ) ; } else { ci [ actual ] . Char . UnicodeChar = ' ' ; } } } ++ actual ; } loc . X = ( short ) 0 ; loc . Y = ( short ) 0 ; siz . X = ( short ) actual ; siz . Y = 1 ; rec . Left = ( short ) x ; rec . Top = ( SHORT ) ( y + AdjustY ( p ) ) ; rec . Right = ( short ) ( x + limit - 1 ) ; rec . Bottom = rec . Top ; return WriteConsoleOutputW ( TCB -> hdl , ci , siz , loc , & rec ) ; }
TODO: support surrogate pairs
 TODO: support combining characters
 TODO: support acsc
 TODO: check wcwidth of base character, fill if needed for double-width
 TODO: _nc_wacs should be part of sp.
TODO : support surrogate pairs TODO : support combining characters TODO : support acsc TODO : check wcwidth of base character fill if needed for double - width TODO : _nc_wacs should be part of sp .