--- rxvt-unicode/src/screen.C 2006/01/05 21:21:49 1.210 +++ rxvt-unicode/src/screen.C 2006/01/08 00:07:18 1.214 @@ -3,7 +3,7 @@ *---------------------------------------------------------------------------* * * Copyright (c) 1997-2001 Geoff Wing - * Copyright (c) 2003-2004 Marc Lehmann + * Copyright (c) 2003-2006 Marc Lehmann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -416,7 +416,7 @@ tt_winch (); - PERL_INVOKE ((this, HOOK_RESET, DT_END)); + HOOK_INVOKE ((this, HOOK_RESET, DT_END)); } /* ------------------------------------------------------------------------- */ @@ -620,7 +620,7 @@ { nsaved = min (nsaved + count, saveLines); - PERL_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, nsaved, DT_END)); + HOOK_INVOKE ((this, HOOK_SCROLL_BACK, DT_INT, count, DT_INT, nsaved, DT_END)); term_start = (term_start + count) % total_rows; @@ -702,7 +702,7 @@ * Add text given in of length to screen struct */ void -rxvt_term::scr_add_lines (const unicode_t *str, int nlines, int len) +rxvt_term::scr_add_lines (const wchar_t *str, int len, int minlines) { if (len <= 0) /* sanity */ return; @@ -710,22 +710,22 @@ unsigned char checksel; unicode_t c; int ncol = this->ncol; - const unicode_t *strend = str + len; + const wchar_t *strend = str + len; want_refresh = 1; ZERO_SCROLLBACK (); - if (nlines > 0) + if (minlines > 0) { - nlines += screen.cur.row - screen.bscroll; + minlines += screen.cur.row - screen.bscroll; - if (nlines > 0 + if (minlines > 0 && screen.tscroll == 0 && screen.bscroll == nrow - 1) { /* _at least_ this many lines need to be scrolled */ - scr_scroll_text (screen.tscroll, screen.bscroll, nlines); - screen.cur.row -= nlines; + scr_scroll_text (screen.tscroll, screen.bscroll, minlines); + screen.cur.row -= minlines; } } @@ -742,7 +742,7 @@ while (str < strend) { - c = *str++; + c = (unicode_t)*str++; // convert to rxvt-unicodes representation if (c < 0x20) if (c == C0_LF) @@ -1835,7 +1835,7 @@ { if (view_start != oldviewstart) { - PERL_INVOKE ((this, HOOK_VIEW_CHANGE, DT_INT, view_start, DT_END)); + HOOK_INVOKE ((this, HOOK_VIEW_CHANGE, DT_INT, view_start, DT_END)); want_refresh = 1; num_scr -= (view_start - oldviewstart); @@ -2055,7 +2055,7 @@ } } - PERL_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); + HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END)); #if ENABLE_OVERLAY scr_swap_overlay (); #endif @@ -2328,7 +2328,7 @@ #if ENABLE_OVERLAY scr_swap_overlay (); #endif - PERL_INVOKE ((this, HOOK_REFRESH_END, DT_END)); + HOOK_INVOKE ((this, HOOK_REFRESH_END, DT_END)); /* * G: cleanup cursor and display outline cursor if necessary @@ -2390,7 +2390,7 @@ if (!l.t) return; - l.touch (); // maybe a bit of an overkill, but its not performance-relevant + l.touch (); // maybe a bit of an overkill, but it's not performance-relevant for (int i = ncol; i--; ) l.r[i] = SET_FONT (l.r[i], FONTSET (l.r[i])->find_font (l.t[i])); @@ -2892,7 +2892,7 @@ if (selection.clicks == 4) return; /* nothing selected, go away */ - if (PERL_INVOKE ((this, HOOK_SEL_MAKE, DT_LONG, (long)tm, DT_END))) + if (HOOK_INVOKE ((this, HOOK_SEL_MAKE, DT_LONG, (long)tm, DT_END))) return; i = (selection.end.row - selection.beg.row + 1) * (ncol + 1); @@ -2987,7 +2987,7 @@ selection.len = ofs; selection.text = (wchar_t *)rxvt_realloc (new_selection_text, (ofs + 1) * sizeof (wchar_t)); - if (PERL_INVOKE ((this, HOOK_SEL_GRAB, DT_LONG, (long)tm, DT_END))) + if (HOOK_INVOKE ((this, HOOK_SEL_GRAB, DT_LONG, (long)tm, DT_END))) return; selection_grab (tm); @@ -3333,7 +3333,7 @@ if (ROWCOL_IS_AFTER (selection.end, selection.beg)) selection.end.col--; - if (!PERL_INVOKE ((this, HOOK_SEL_EXTEND, DT_END))) + if (!HOOK_INVOKE ((this, HOOK_SEL_EXTEND, DT_END))) { selection_delimit_word (UP, &selection.beg, &selection.beg); selection_delimit_word (DN, &selection.end, &selection.end);