[BACK]Return to cr_put.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libcurses

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libcurses/cr_put.c between version 1.23 and 1.23.12.3

version 1.23, 2004/07/24 13:10:47 version 1.23.12.3, 2007/02/06 09:59:29
Line 74  int
Line 74  int
 __mvcur(int ly, int lx, int y, int x, int in_refresh)  __mvcur(int ly, int lx, int y, int x, int in_refresh)
 {  {
 #ifdef DEBUG  #ifdef DEBUG
         __CTRACE("mvcur: moving cursor from (%d, %d) to (%d, %d)\n",          __CTRACE(__CTRACE_OUTPUT,
             ly, lx, y, x);              "mvcur: moving cursor from (%d, %d) to (%d, %d)\n", ly, lx, y, x);
 #endif  #endif
         destcol = x;          destcol = x;
         destline = y;          destline = y;
Line 87  __mvcur(int ly, int lx, int y, int x, in
Line 87  __mvcur(int ly, int lx, int y, int x, in
   
 static void  static void
 fgoto(in_refresh)  fgoto(in_refresh)
         int     in_refresh;          int      in_refresh;
 {  {
         int     c, l;          int      c, l;
         char   cgp[128];          char   cgp[128];
   
   #ifdef DEBUG
           __CTRACE(__CTRACE_OUTPUT, "fgoto: in_refresh=%d\n", in_refresh);
   #endif /* DEBUG */
         if (destcol >= COLS) {          if (destcol >= COLS) {
                 destline += destcol / COLS;                  destline += destcol / COLS;
                 destcol %= COLS;                  destcol %= COLS;
Line 165  fgoto(in_refresh)
Line 168  fgoto(in_refresh)
                  * Need this condition due to inconsistent behavior                   * Need this condition due to inconsistent behavior
                  * of backspace on the last column.                   * of backspace on the last column.
                  */                   */
   #ifdef DEBUG
                   __CTRACE(__CTRACE_OUTPUT, "fgoto: cgp=%s\n", cgp);
   #endif /* DEBUG */
                 if (outcol != COLS - 1 &&                  if (outcol != COLS - 1 &&
                     plod((int) strlen(cgp), in_refresh) > 0)                      plod((int) strlen(cgp), in_refresh) > 0)
                         plod(0, in_refresh);                          plod(0, in_refresh);
Line 180  fgoto(in_refresh)
Line 186  fgoto(in_refresh)
  * Hard thing here is using home cursor on really deficient terminals.   * Hard thing here is using home cursor on really deficient terminals.
  * Otherwise just use cursor motions, hacking use of tabs and overtabbing   * Otherwise just use cursor motions, hacking use of tabs and overtabbing
  * and backspace.   * and backspace.
    *
    * XXX this needs to be revisited for wide characters since we may output
    * XXX more than one byte for a character.
  */   */
   
 static int plodcnt, plodflg;  static int plodcnt, plodflg;
   
 static int  static int
 plodput(c)  plodput(c)
         int     c;          int      c;
 {  {
         if (plodflg)          if (plodflg)
                 --plodcnt;                  --plodcnt;
Line 197  plodput(c)
Line 206  plodput(c)
   
 static int  static int
 plod(cnt, in_refresh)  plod(cnt, in_refresh)
         int     cnt, in_refresh;          int      cnt, in_refresh;
 {  {
         int     i, j, k, soutcol, soutline;          int      i, j, k, soutcol, soutline;
   
   #ifdef DEBUG
           __CTRACE(__CTRACE_OUTPUT, "plod: cnt=%d, in_refresh=%d\n",
               cnt, in_refresh);
   #endif /* DEBUG */
         plodcnt = plodflg = cnt;          plodcnt = plodflg = cnt;
         soutcol = outcol;          soutcol = outcol;
         soutline = outline;          soutline = outline;
Line 389  dontcr:while (outline < destline) {
Line 402  dontcr:while (outline < destline) {
                         if (plodflg)    /* Avoid a complex calculation. */                          if (plodflg)    /* Avoid a complex calculation. */
                                 plodcnt--;                                  plodcnt--;
                         else {                          else {
   #ifndef HAVE_WCHAR
                                 i = curscr->lines[outline]->line[outcol].ch                                  i = curscr->lines[outline]->line[outcol].ch
                                     & __CHARTEXT;                                      & __CHARTEXT;
                                 if (curscr->lines[outline]->line[outcol].attr                                  if (curscr->lines[outline]->line[outcol].attr
                                     == curscr->wattr)                                      == curscr->wattr)
                                         __cputchar(i);                                          __cputchar(i);
   #else
                                   if ((curscr->lines[outline]->line[outcol].attr
                                       & WA_ATTRIBUTES)
                                       == curscr->wattr ) {
                                           if (WCOL(curscr->lines[outline]->line[outcol]) > 0) {
                                                   __cputwchar(curscr->lines[outline]->line[outcol].ch);
   #ifdef DEBUG
                                                   __CTRACE(__CTRACE_OUTPUT,
                                                       "plod: (%d,%d)WCOL(%d), "
                                                       "putwchar(%x)\n",
                                                       outline, outcol,
                                                       WCOL(curscr->lines[outline]->line[outcol]),
                                                       curscr->lines[outline]->line[outcol].ch);
   #endif /* DEBUG */
                                           }
                                   }
   #endif /* HAVE_WCHAR */
                                 else                                  else
                                         goto nondes;                                          goto nondes;
                         }                          }
Line 411  out: if (plodflg) {
Line 442  out: if (plodflg) {
                 outcol = soutcol;                  outcol = soutcol;
                 outline = soutline;                  outline = soutline;
         }          }
   #ifdef DEBUG
           __CTRACE(__CTRACE_OUTPUT, "plod: returns %d\n", plodcnt);
   #endif /* DEBUG */
         return (plodcnt);          return (plodcnt);
 }  }
 /*  /*
Line 420  out: if (plodflg) {
Line 454  out: if (plodflg) {
  */   */
 static int  static int
 tabcol(col, ts)  tabcol(col, ts)
         int     col, ts;          int      col, ts;
 {  {
         int     offset;          int      offset;
   
         if (col >= COLS) {          if (col >= COLS) {
                 offset = COLS * (col / COLS);                  offset = COLS * (col / COLS);

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.23.12.3

CVSweb <webmaster@jp.NetBSD.org>