X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_box.c;h=dccb8e12d61c6a05e5fda18b28c8ef1c67a4d79a;hp=50f436592ded65b427b5fe1ae574bf8b3f8a9cb6;hb=b5be26931d6488adcb1ff8bc07df9de378ce0d27;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01 diff --git a/ncurses/base/lib_box.c b/ncurses/base/lib_box.c index 50f43659..dccb8e12 100644 --- a/ncurses/base/lib_box.c +++ b/ncurses/base/lib_box.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2017 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 * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Sven Verdoolaege 2001 * ****************************************************************************/ /* @@ -40,17 +42,18 @@ #include -MODULE_ID("$Id: lib_box.c,v 1.21 2002/09/15 01:04:27 tom Exp $") +MODULE_ID("$Id: lib_box.c,v 1.25 2017/10/27 21:56:17 tom Exp $") #if USE_WIDEC_SUPPORT -static inline chtype +static NCURSES_INLINE chtype _my_render(WINDOW *win, chtype ch) { NCURSES_CH_T wch; SetChar2(wch, ch); wch = _nc_render(win, wch); - return CharOf(wch) | AttrOf(wch); + return ((attr_t) CharOf(wch)) | AttrOf(wch); } + #define RENDER_WITH_DEFAULT(ch,def) w ## ch = _my_render(win, (ch == 0) ? def : ch) #else #define RENDER_WITH_DEFAULT(ch,def) w ## ch = _nc_render(win, (ch == 0) ? def : ch) @@ -68,7 +71,7 @@ wborder(WINDOW *win, chtype wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), - win, + (void *) win, _tracechtype2(1, ls), _tracechtype2(2, rs), _tracechtype2(3, ts), @@ -111,10 +114,20 @@ wborder(WINDOW *win, win->_line[endy].lastchar = win->_line[0].lastchar = endx; for (i = 0; i <= endy; i++) { +#if USE_WIDEC_SUPPORT + if (endx > 0 && isWidecExt(win->_line[i].text[endx])) { + SetChar2(win->_line[i].text[endx - 1], ' '); + } +#endif SetChar2(win->_line[i].text[0], wls); SetChar2(win->_line[i].text[endx], wrs); win->_line[i].firstchar = 0; win->_line[i].lastchar = endx; +#if USE_WIDEC_SUPPORT + if (isWidecExt(win->_line[i].text[1])) { + SetChar2(win->_line[i].text[1], ' '); + } +#endif } SetChar2(win->_line[0].text[0], wtl); SetChar2(win->_line[0].text[endx], wtr);