ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/screen.C
(Generate patch)

Comparing rxvt-unicode/src/screen.C (file contents):
Revision 1.286 by root, Tue Dec 11 18:00:07 2007 UTC vs.
Revision 1.352 by root, Fri Oct 15 20:52:15 2010 UTC

1/*---------------------------------------------------------------------------* 1/*---------------------------------------------------------------------------*
2 * File: screen.C 2 * File: screen.C
3 *---------------------------------------------------------------------------* 3 *---------------------------------------------------------------------------*
4 * 4 *
5 * Copyright (c) 1997-2001 Geoff Wing <gcw@pobox.com> 5 * Copyright (c) 1997-2001 Geoff Wing <gcw@pobox.com>
6 * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> 6 * Copyright (c) 2003-2007 Marc Lehmann <pcg@goof.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version. 11 * (at your option) any later version.
28#include "rxvt.h" /* NECESSARY */ 28#include "rxvt.h" /* NECESSARY */
29#include "rxvtperl.h" /* NECESSARY */ 29#include "rxvtperl.h" /* NECESSARY */
30 30
31#include <inttypes.h> 31#include <inttypes.h>
32 32
33#include "salloc.C" // HACK, should be a seperate compile! 33#include "salloc.C" // HACK, should be a separate compile!
34 34
35static inline void
35static inline void fill_text (text_t *start, text_t value, int len) 36fill_text (text_t *start, text_t value, int len)
36{ 37{
37 while (len--) 38 while (len--)
38 *start++ = value; 39 *start++ = value;
39} 40}
40 41
83 ROW_AND_COL_IN_ROW_AT_OR_AFTER ((X).row, (X).col, (Y).row, (Y).col) 84 ROW_AND_COL_IN_ROW_AT_OR_AFTER ((X).row, (X).col, (Y).row, (Y).col)
84#define ROWCOL_IN_ROW_AT_OR_BEFORE(X, Y) \ 85#define ROWCOL_IN_ROW_AT_OR_BEFORE(X, Y) \
85 ROW_AND_COL_IN_ROW_AT_OR_BEFORE ((X).row, (X).col, (Y).row, (Y).col) 86 ROW_AND_COL_IN_ROW_AT_OR_BEFORE ((X).row, (X).col, (Y).row, (Y).col)
86 87
87/* 88/*
88 * CLEAR_ROWS : clear <num> rows starting from row <row>
89 * CLEAR_CHARS: clear <num> chars starting from pixel position <x,y> 89 * CLEAR_CHARS: clear <num> chars starting from pixel position <x,y>
90 * ERASE_ROWS : set <num> rows starting from row <row> to the foreground colour
91 */ 90 */
92#define drawBuffer vt
93
94#define CLEAR_ROWS(row, num) \
95 if (mapped) \
96 XClearArea (dpy, drawBuffer, 0, \
97 Row2Pixel (row), (unsigned int)width, \
98 (unsigned int)Height2Pixel (num), False)
99
100#define CLEAR_CHARS(x, y, num) \ 91#define CLEAR_CHARS(x, y, num) \
101 if (mapped) \ 92 if (mapped) \
102 XClearArea (dpy, drawBuffer, x, y, \ 93 XClearArea (dpy, vt, x, y, \
103 (unsigned int)Width2Pixel (num), \ 94 (unsigned int)Width2Pixel (num), \
104 (unsigned int)Height2Pixel (1), False) 95 (unsigned int)Height2Pixel (1), False)
105
106#define ERASE_ROWS(row, num) \
107 XFillRectangle (dpy, drawBuffer, gc, \
108 0, Row2Pixel (row), \
109 (unsigned int)width, \
110 (unsigned int)Height2Pixel (num))
111 96
112/* ------------------------------------------------------------------------- * 97/* ------------------------------------------------------------------------- *
113 * SCREEN `COMMON' ROUTINES * 98 * SCREEN `COMMON' ROUTINES *
114 * ------------------------------------------------------------------------- */ 99 * ------------------------------------------------------------------------- */
115 100
148 133
149 l.l = 0; 134 l.l = 0;
150 l.f = 0; 135 l.f = 0;
151} 136}
152 137
138// nuke a single wide character at the given column
139void
140rxvt_term::scr_kill_char (line_t &l, int col) const NOTHROW
141{
142 // find begin
143 while (col > 0 && l.t[col] == NOCHAR)
144 col--;
145
146 rend_t rend = l.r[col] & ~RS_baseattrMask;
147 rend = SET_FONT (rend, FONTSET (rend)->find_font (' '));
148
149 l.touch ();
150
151 // found start, nuke
152 do {
153 l.t[col] = ' ';
154 l.r[col] = rend;
155 col++;
156 } while (col < ncol && l.t[col] == NOCHAR);
157}
158
153/* ------------------------------------------------------------------------- * 159/* ------------------------------------------------------------------------- *
154 * SCREEN INITIALISATION * 160 * SCREEN INITIALISATION *
155 * ------------------------------------------------------------------------- */ 161 * ------------------------------------------------------------------------- */
156 162
157void 163void
158rxvt_term::scr_reset () 164rxvt_term::scr_reset ()
159{ 165{
160#if ENABLE_OVERLAY
161 scr_overlay_off ();
162#endif
163
164 rvideo_mode = false;
165 view_start = 0; 166 view_start = 0;
166 num_scr = 0; 167 num_scr = 0;
167 168
168 if (ncol == 0) 169 if (ncol == 0)
169 ncol = 80; 170 ncol = 80;
171 if (nrow == 0) 172 if (nrow == 0)
172 nrow = 24; 173 nrow = 24;
173 174
174 if (ncol == prev_ncol && nrow == prev_nrow) 175 if (ncol == prev_ncol && nrow == prev_nrow)
175 return; 176 return;
176
177 if (current_screen != PRIMARY)
178 scr_swap_screen ();
179 177
180 // we need at least two lines for wrapping to work correctly 178 // we need at least two lines for wrapping to work correctly
181 while (nrow + saveLines < 2) 179 while (nrow + saveLines < 2)
182 { 180 {
183 //TODO//FIXME 181 //TODO//FIXME
236 selection.text = NULL; 234 selection.text = NULL;
237 selection.len = 0; 235 selection.len = 0;
238 selection.op = SELECTION_CLEAR; 236 selection.op = SELECTION_CLEAR;
239 selection.screen = PRIMARY; 237 selection.screen = PRIMARY;
240 selection.clicks = 0; 238 selection.clicks = 0;
239 selection.clip_text = NULL;
240 selection.clip_len = 0;
241 } 241 }
242 else 242 else
243 { 243 {
244 /* 244 /*
245 * add or delete rows as appropriate 245 * add or delete rows as appropriate
283 283
284 if (top_row) 284 if (top_row)
285 { 285 {
286 // Re-wrap lines. This is rather ugly, possibly because I am too dumb 286 // Re-wrap lines. This is rather ugly, possibly because I am too dumb
287 // to come up with a lean and mean algorithm. 287 // to come up with a lean and mean algorithm.
288 // TODO: maybe optimise when width didn't change
288 289
289 row_col_t ocur = screen.cur; 290 row_col_t ocur = screen.cur;
290 ocur.row = MOD (term_start + ocur.row, prev_total_rows); 291 ocur.row = MOD (term_start + ocur.row, prev_total_rows);
291 292
292 do 293 do
293 { 294 {
294 p = MOD (p - 1, prev_total_rows); 295 p = MOD (p - 1, prev_total_rows);
295#ifdef DEBUG_STRICT
296 assert (old_buf [MOD (p, prev_total_rows)].t); 296 assert (old_buf [MOD (p, prev_total_rows)].t);
297#endif
298 int plines = 1; 297 int plines = 1;
299 int llen = old_buf [MOD (p, prev_total_rows)].l; 298 int llen = old_buf [MOD (p, prev_total_rows)].l;
300 299
301 while (p != pend && old_buf [MOD (p - 1, prev_total_rows)].is_longer ()) 300 while (p != pend && old_buf [MOD (p - 1, prev_total_rows)].is_longer ())
302 { 301 {
396 delete old_ta; 395 delete old_ta;
397 delete old_ra; 396 delete old_ra;
398 397
399 clamp_it (screen.cur.row, 0, nrow - 1); 398 clamp_it (screen.cur.row, 0, nrow - 1);
400 clamp_it (screen.cur.col, 0, ncol - 1); 399 clamp_it (screen.cur.col, 0, ncol - 1);
400 }
401 401
402 free (tabs); 402 free (tabs);
403 } 403 tabs = (char *)rxvt_malloc (ncol);
404
405 for (int col = ncol; --col; )
406 tabs [col] = col % TABSIZE == 0;
404 407
405 CLEAR_ALL_SELECTION (); 408 CLEAR_ALL_SELECTION ();
406 409
407 prev_nrow = nrow; 410 prev_nrow = nrow;
408 prev_ncol = ncol; 411 prev_ncol = ncol;
409
410 tabs = (char *)rxvt_malloc (ncol);
411
412 for (int col = ncol; --col; )
413 tabs [col] = col % TABSIZE == 0;
414
415 if (current_screen != PRIMARY)
416 scr_swap_screen ();
417 412
418 tt_winch (); 413 tt_winch ();
419 414
420 HOOK_INVOKE ((this, HOOK_RESET, DT_END)); 415 HOOK_INVOKE ((this, HOOK_RESET, DT_END));
421} 416}
433 delete ralloc; ralloc = 0; 428 delete ralloc; ralloc = 0;
434 429
435 free (row_buf); 430 free (row_buf);
436 free (swap_buf); 431 free (swap_buf);
437 free (drawn_buf); 432 free (drawn_buf);
433 row_buf = 0; // signal that we freed all the arrays above
434
438 free (tabs); 435 free (tabs);
439 436 tabs = 0;
440 row_buf = 0; // signal that we freed all the arrays
441 } 437 }
442} 438}
443 439
444/* ------------------------------------------------------------------------- */ 440/* ------------------------------------------------------------------------- */
445/* 441/*
446 * Hard reset 442 * Hard/Soft reset
447 */ 443 */
448void 444void
449rxvt_term::scr_poweron () 445rxvt_term::scr_poweron ()
450{ 446{
451 scr_release (); 447 scr_release ();
452 prev_nrow = prev_ncol = 0; 448 prev_nrow = prev_ncol = 0;
449 rvideo_mode = false;
450 scr_soft_reset ();
453 scr_reset (); 451 scr_reset ();
454 452
455 scr_clear (true); 453 scr_clear (true);
456 scr_refresh (); 454 scr_refresh ();
455}
456
457void
458rxvt_term::scr_soft_reset ()
459{
460 /* only affects modes, nothing drastic such as clearing the screen */
461#if ENABLE_OVERLAY
462 scr_overlay_off ();
463#endif
464
465 if (current_screen != PRIMARY)
466 scr_swap_screen ();
467
468 scr_scroll_region (0, MAX_ROWS - 1);
469 scr_rendition (0, ~RS_None);
470 scr_insert_mode (0);
457} 471}
458 472
459/* ------------------------------------------------------------------------- * 473/* ------------------------------------------------------------------------- *
460 * PROCESS SCREEN COMMANDS * 474 * PROCESS SCREEN COMMANDS *
461 * ------------------------------------------------------------------------- */ 475 * ------------------------------------------------------------------------- */
499 } 513 }
500 514
501 /* boundary check in case screen size changed between SAVE and RESTORE */ 515 /* boundary check in case screen size changed between SAVE and RESTORE */
502 min_it (s->cur.row, nrow - 1); 516 min_it (s->cur.row, nrow - 1);
503 min_it (s->cur.col, ncol - 1); 517 min_it (s->cur.col, ncol - 1);
504#ifdef DEBUG_STRICT
505 assert (s->cur.row >= 0); 518 assert (s->cur.row >= 0);
506 assert (s->cur.col >= 0); 519 assert (s->cur.col >= 0);
507#endif
508} 520}
509 521
510void 522void
511rxvt_term::scr_swap_screen () 523rxvt_term::scr_swap_screen ()
512{ 524{
537 want_refresh = 1; 549 want_refresh = 1;
538 view_start = 0; 550 view_start = 0;
539 551
540 selection_check (2); /* check for boundary cross */ 552 selection_check (2); /* check for boundary cross */
541 553
542 int i = current_screen; current_screen = scrn; scrn = i; 554 current_screen = scrn;
543 555
544#if NSCREENS 556#if NSCREENS
545 if (option (Opt_secondaryScreen)) 557 if (option (Opt_secondaryScreen))
546 { 558 {
547 num_scr = 0; 559 num_scr = 0;
596/* 608/*
597 * Change the rendition style for following text 609 * Change the rendition style for following text
598 */ 610 */
599void 611void
600rxvt_term::scr_rendition (int set, int style) NOTHROW 612rxvt_term::scr_rendition (int set, int style) NOTHROW
601 { 613{
602 if (set) 614 if (set)
603 rstyle |= style; 615 rstyle |= style;
604 else if (style == ~RS_None) 616 else if (style == ~RS_None)
605 rstyle = DEFAULT_RSTYLE; 617 rstyle = DEFAULT_RSTYLE;
606 else 618 else
607 rstyle &= ~style; 619 rstyle &= ~style;
608 } 620}
609 621
610/* ------------------------------------------------------------------------- */ 622/* ------------------------------------------------------------------------- */
611/* 623/*
612 * Scroll text between <row1> and <row2> inclusive, by <count> lines 624 * Scroll text between <row1> and <row2> inclusive, by <count> lines
613 * count positive ==> scroll up 625 * count positive ==> scroll up
772 scr_scroll_text (screen.tscroll, screen.bscroll, minlines); 784 scr_scroll_text (screen.tscroll, screen.bscroll, minlines);
773 screen.cur.row -= minlines; 785 screen.cur.row -= minlines;
774 } 786 }
775 } 787 }
776 788
777#ifdef DEBUG_STRICT
778 assert (screen.cur.col < ncol); 789 assert (screen.cur.col < ncol);
779 assert (screen.cur.row < nrow 790 assert (screen.cur.row < nrow
780 && screen.cur.row >= top_row); 791 && screen.cur.row >= top_row);
781#endif
782 int row = screen.cur.row; 792 int row = screen.cur.row;
783 793
784 checksel = selection.op && current_screen == selection.screen ? 1 : 0; 794 checksel = selection.op && current_screen == selection.screen ? 1 : 0;
785 795
786 line_t *line = &ROW(row); 796 line_t *line = &ROW(row);
787 797
788 while (str < strend) 798 while (str < strend)
789 { 799 {
790 c = (unicode_t)*str++; // convert to rxvt-unicodes representation 800 c = (unicode_t)*str++; // convert to rxvt-unicodes representation
791 801
792 if (c < 0x20) 802 if (expect_false (c < 0x20))
793 if (c == C0_LF) 803 if (c == C0_LF)
794 { 804 {
795 max_it (line->l, screen.cur.col); 805 max_it (line->l, screen.cur.col);
796 806
797 screen.flags &= ~Screen_WrapNext; 807 screen.flags &= ~Screen_WrapNext;
816 { 826 {
817 scr_tab (1, true); 827 scr_tab (1, true);
818 continue; 828 continue;
819 } 829 }
820 830
831 if (expect_false (
821 if (checksel /* see if we're writing within selection */ 832 checksel /* see if we're writing within selection */
822 && !ROWCOL_IS_BEFORE (screen.cur, selection.beg) 833 && !ROWCOL_IS_BEFORE (screen.cur, selection.beg)
823 && ROWCOL_IS_BEFORE (screen.cur, selection.end)) 834 && ROWCOL_IS_BEFORE (screen.cur, selection.end)
835 ))
824 { 836 {
825 checksel = 0; 837 checksel = 0;
826 /* 838 /*
827 * If we wrote anywhere in the selected area, kill the selection 839 * If we wrote anywhere in the selected area, kill the selection
828 * XXX: should we kill the mark too? Possibly, but maybe that 840 * XXX: should we kill the mark too? Possibly, but maybe that
829 * should be a similar check. 841 * should be a similar check.
830 */ 842 */
831 CLEAR_SELECTION (); 843 CLEAR_SELECTION ();
832 } 844 }
833 845
834 if (screen.flags & Screen_WrapNext) 846 if (expect_false (screen.flags & Screen_WrapNext))
835 { 847 {
836 scr_do_wrap (); 848 scr_do_wrap ();
837 849
838 line->l = ncol; 850 line->l = ncol;
839 line->is_longer (1); 851 line->is_longer (1);
841 row = screen.cur.row; 853 row = screen.cur.row;
842 line = &ROW(row); /* _must_ refresh */ 854 line = &ROW(row); /* _must_ refresh */
843 } 855 }
844 856
845 // some utf-8 decoders "decode" surrogate characters: let's fix this. 857 // some utf-8 decoders "decode" surrogate characters: let's fix this.
846 if (IN_RANGE_INC (c, 0xd800, 0xdfff)) 858 if (expect_false (IN_RANGE_INC (c, 0xd800, 0xdfff)))
847 c = 0xfffd; 859 c = 0xfffd;
848 860
849 // rely on wcwidth to tell us the character width, do wcwidth before 861 // rely on wcwidth to tell us the character width, do wcwidth before
850 // further replacements, as wcwidth might return -1 for the line 862 // further replacements, as wcwidth might return -1 for the line
851 // drawing characters below as they might be invalid in the current 863 // drawing characters below as they might be invalid in the current
852 // locale. 864 // locale.
853 int width = WCWIDTH (c); 865 int width = WCWIDTH (c);
854 866
855 if (charsets [screen.charset] == '0') // DEC SPECIAL 867 if (expect_false (charsets [screen.charset] == '0')) // DEC SPECIAL
856 { 868 {
857 // vt100 special graphics and line drawing 869 // vt100 special graphics and line drawing
858 // 5f-7e standard vt100 870 // 5f-7e standard vt100
859 // 40-5e rxvt extension for extra curses acs chars 871 // 40-5e rxvt extension for extra curses acs chars
860 static uint16_t vt100_0[62] = { // 41 .. 7e 872 static uint16_t vt100_0[62] = { // 41 .. 7e
873 c = vt100_0[c - 0x41]; 885 c = vt100_0[c - 0x41];
874 width = 1; // vt100 line drawing characters are always single-width 886 width = 1; // vt100 line drawing characters are always single-width
875 } 887 }
876 } 888 }
877 889
878 if (screen.flags & Screen_Insert) 890 if (expect_false (screen.flags & Screen_Insert))
879 scr_insdel_chars (width, INSERT); 891 scr_insdel_chars (width, INSERT);
880 892
881 if (width != 0) 893 if (width != 0)
882 { 894 {
883#if !UNICODE_3 895#if !UNICODE_3
888# else 900# else
889 c = 0xfffd; 901 c = 0xfffd;
890# endif 902# endif
891#endif 903#endif
892 904
905 rend_t rend = SET_FONT (rstyle, FONTSET (rstyle)->find_font (c));
906
907 // if the character doesn't fit into the remaining columns...
908 if (expect_false (screen.cur.col > ncol - width && ncol >= width))
909 {
910 if (screen.flags & Screen_Autowrap)
911 {
912 // ... artificially enlargen the previous one
913 c = NOCHAR;
914 // and try the same character next loop iteration
915 --str;
916 }
917 else
918 screen.cur.col = ncol - width;
919 }
920
893 // nuke the character at this position, if required 921 // nuke the character at this position, if required
922 if (expect_false (
894 if (line->t[screen.cur.col] == NOCHAR 923 line->t[screen.cur.col] == NOCHAR
895 || (screen.cur.col < ncol - 1 924 || (screen.cur.col < ncol - 1
896 && line->t[screen.cur.col + 1] == NOCHAR)) 925 && line->t[screen.cur.col + 1] == NOCHAR)
897 { 926 ))
898 int col = screen.cur.col; 927 scr_kill_char (*line, screen.cur.col);
899
900 // find begin
901 while (col > 0 && line->t[col] == NOCHAR)
902 col--;
903
904 rend_t rend = SET_FONT (line->r[col], FONTSET (line->r[col])->find_font (' '));
905
906 // found begin, nuke
907 do {
908 line->t[col] = ' ';
909 line->r[col] = rend;
910 col++;
911 } while (col < ncol && line->t[col] == NOCHAR);
912 }
913
914 rend_t rend = SET_FONT (rstyle, FONTSET (rstyle)->find_font (c));
915
916 // if the character doesn't fit into the remaining columns...
917 if (screen.cur.col > ncol - width && ncol >= width)
918 {
919 // ...output spaces
920 c = ' ';
921 // and try the same character next loop iteration
922 --str;
923 }
924 928
925 line->touch (); 929 line->touch ();
926 930
927 do 931 do
928 { 932 {
929 line->t[screen.cur.col] = c; 933 line->t[screen.cur.col] = c;
930 line->r[screen.cur.col] = rend; 934 line->r[screen.cur.col] = rend;
931 935
932 if (screen.cur.col < ncol - 1) 936 if (expect_true (screen.cur.col < ncol - 1))
933 screen.cur.col++; 937 screen.cur.col++;
934 else 938 else
935 { 939 {
936 line->l = ncol; 940 line->l = ncol;
937 if (screen.flags & Screen_Autowrap) 941 if (screen.flags & Screen_Autowrap)
938 screen.flags |= Screen_WrapNext; 942 screen.flags |= Screen_WrapNext;
939 break; 943
944 goto end_of_line;
940 } 945 }
941 946
942 c = NOCHAR; 947 c = NOCHAR;
943 } 948 }
944 while (--width > 0); 949 while (expect_false (--width > 0));
945 950
946 // pad with spaces when overwriting wide character with smaller one 951 // pad with spaces when overwriting wide character with smaller one
947 if (!width) 952 for (int c = screen.cur.col; expect_false (c < ncol && line->t[c] == NOCHAR); c++)
948 { 953 {
949 line->touch (); 954 line->t[c] = ' ';
955 line->r[c] = rend;
956 }
950 957
951 for (int c = screen.cur.col; c < ncol && line->t[c] == NOCHAR; c++) 958end_of_line:
959 ;
960 }
961#if ENABLE_COMBINING
962 else // width == 0
963 {
964 if (c != 0xfeff) // ignore BOM
965 {
966 // handle combining characters
967 // we just tag the accent on the previous on-screen character.
968 // this is arguably not correct, but also arguably not wrong.
969 // we don't handle double-width characters nicely yet.
970 line_t *linep;
971 text_t *tp;
972 rend_t *rp;
973
974 if (screen.cur.col > 0)
952 { 975 {
953 line->t[c] = ' ';
954 line->r[c] = rend; 976 linep = line;
977 tp = line->t + screen.cur.col - 1;
978 rp = line->r + screen.cur.col - 1;
955 } 979 }
980 else if (screen.cur.row > 0
981 && ROW(screen.cur.row - 1).is_longer ())
982 {
983 linep = &ROW(screen.cur.row - 1);
984 tp = line->t + ncol - 1;
985 rp = line->r + ncol - 1;
986 }
987 else
988 continue;
989
990 linep->touch ();
991
992 while (*tp == NOCHAR && tp > linep->t)
993 tp--, rp--;
994
995 // first try to find a precomposed character
996 unicode_t n = rxvt_compose (*tp, c);
997 if (n == NOCHAR)
998 n = rxvt_composite.compose (*tp, c);
999
1000 *tp = n;
1001 *rp = SET_FONT (*rp, FONTSET (*rp)->find_font (*tp));
956 } 1002 }
957 } 1003 }
958 else // width == 0
959 {
960#if ENABLE_COMBINING
961 // handle combining characters
962 // we just tag the accent on the previous on-screen character.
963 // this is arguably not correct, but also arguably not wrong.
964 // we don't handle double-width characters nicely yet.
965 line_t *linep;
966 text_t *tp;
967 rend_t *rp;
968
969 if (screen.cur.col > 0)
970 {
971 linep = line;
972 tp = line->t + screen.cur.col - 1;
973 rp = line->r + screen.cur.col - 1;
974 }
975 else if (screen.cur.row > 0
976 && ROW(screen.cur.row - 1).is_longer ())
977 {
978 linep = &ROW(screen.cur.row - 1);
979 tp = line->t + ncol - 1;
980 rp = line->r + ncol - 1;
981 }
982 else
983 continue;
984
985 linep->touch ();
986
987 while (*tp == NOCHAR && tp > linep->t)
988 tp--, rp--;
989
990 // first try to find a precomposed character
991 unicode_t n = rxvt_compose (*tp, c);
992 if (n == NOCHAR)
993 n = rxvt_composite.compose (*tp, c);
994
995 *tp = n;
996 *rp = SET_FONT (*rp, FONTSET (*rp)->find_font (*tp));
997#endif 1004#endif
998 }
999 } 1005 }
1000 1006
1001 max_it (line->l, screen.cur.col); 1007 max_it (line->l, screen.cur.col);
1002 1008
1003#ifdef DEBUG_STRICT
1004 assert (screen.cur.row >= 0); 1009 assert (screen.cur.row >= 0);
1005#endif
1006} 1010}
1007 1011
1008/* ------------------------------------------------------------------------- */ 1012/* ------------------------------------------------------------------------- */
1009/* 1013/*
1010 * Process Backspace. Move back the cursor back a position, wrap if have to 1014 * Process Backspace. Move back the cursor back a position, wrap if have to
1011 * XTERM_SEQ: CTRL-H 1015 * XTERM_SEQ: CTRL-H
1012 */ 1016 */
1013void 1017void
1014rxvt_term::scr_backspace () NOTHROW 1018rxvt_term::scr_backspace () NOTHROW
1015{ 1019{
1016 want_refresh = 1;
1017
1018 if (screen.cur.col == 0) 1020 if (screen.cur.col == 0)
1019 { 1021 {
1020 if (screen.cur.row > 0) 1022 if (screen.cur.row > 0)
1021 { 1023 {
1022#ifdef TERMCAP_HAS_BW 1024#ifdef TERMCAP_HAS_BW
1023 screen.cur.col = ncol - 1; 1025 screen.cur.col = ncol - 1;
1024 screen.cur.row--; 1026 --screen.cur.row;
1025 return; 1027
1028 want_refresh = 1;
1026#endif 1029#endif
1027 } 1030 }
1028 } 1031 }
1029 else if (!(screen.flags & Screen_WrapNext)) 1032 else if (screen.flags & Screen_WrapNext)
1033 screen.flags &= ~Screen_WrapNext;
1034 else
1030 scr_gotorc (0, -1, RELATIVE); 1035 scr_gotorc (0, -1, RELATIVE);
1031
1032 screen.flags &= ~Screen_WrapNext;
1033} 1036}
1034 1037
1035/* ------------------------------------------------------------------------- */ 1038/* ------------------------------------------------------------------------- */
1036/* 1039/*
1037 * Process Horizontal Tab 1040 * Process Horizontal Tab
1230/* 1233/*
1231 * Erase part or whole of a line 1234 * Erase part or whole of a line
1232 * XTERM_SEQ: Clear line to right: ESC [ 0 K 1235 * XTERM_SEQ: Clear line to right: ESC [ 0 K
1233 * XTERM_SEQ: Clear line to left : ESC [ 1 K 1236 * XTERM_SEQ: Clear line to left : ESC [ 1 K
1234 * XTERM_SEQ: Clear whole line : ESC [ 2 K 1237 * XTERM_SEQ: Clear whole line : ESC [ 2 K
1238 * extension: clear to right unless wrapped: ESC [ 3 K
1235 */ 1239 */
1236void 1240void
1237rxvt_term::scr_erase_line (int mode) NOTHROW 1241rxvt_term::scr_erase_line (int mode) NOTHROW
1238{ 1242{
1239 unsigned int col, num; 1243 unsigned int col, num;
1248 line.touch (); 1252 line.touch ();
1249 line.is_longer (0); 1253 line.is_longer (0);
1250 1254
1251 switch (mode) 1255 switch (mode)
1252 { 1256 {
1257 case 3:
1258 if (screen.flags & Screen_WrapNext)
1259 return;
1260
1261 /* fall through */
1262
1253 case 0: /* erase to end of line */ 1263 case 0: /* erase to end of line */
1254 col = screen.cur.col; 1264 col = screen.cur.col;
1255 num = ncol - col; 1265 num = ncol - col;
1256 min_it (line.l, col); 1266 min_it (line.l, col);
1267
1257 if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur) 1268 if (ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur)
1258 || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur)) 1269 || ROWCOL_IN_ROW_AT_OR_AFTER (selection.end, screen.cur))
1259 CLEAR_SELECTION (); 1270 CLEAR_SELECTION ();
1260 break; 1271 break;
1272
1261 case 1: /* erase to beginning of line */ 1273 case 1: /* erase to beginning of line */
1262 col = 0; 1274 col = 0;
1263 num = screen.cur.col + 1; 1275 num = screen.cur.col + 1;
1276
1264 if (ROWCOL_IN_ROW_AT_OR_BEFORE (selection.beg, screen.cur) 1277 if (ROWCOL_IN_ROW_AT_OR_BEFORE (selection.beg, screen.cur)
1265 || ROWCOL_IN_ROW_AT_OR_BEFORE (selection.end, screen.cur)) 1278 || ROWCOL_IN_ROW_AT_OR_BEFORE (selection.end, screen.cur))
1266 CLEAR_SELECTION (); 1279 CLEAR_SELECTION ();
1267 break; 1280 break;
1281
1268 case 2: /* erase whole line */ 1282 case 2: /* erase whole line */
1269 col = 0; 1283 col = 0;
1270 num = ncol; 1284 num = ncol;
1271 line.l = 0; 1285 line.l = 0;
1272 if (selection.beg.row <= screen.cur.row 1286 if (selection.beg.row <= screen.cur.row
1330 if (row >= nrow) /* Out Of Bounds */ 1344 if (row >= nrow) /* Out Of Bounds */
1331 return; 1345 return;
1332 1346
1333 min_it (num, nrow - row); 1347 min_it (num, nrow - row);
1334 1348
1335 if (rstyle & (RS_RVid | RS_Uline)) 1349 if (rstyle & (RS_Blink | RS_RVid | RS_Uline))
1336 ren = (rend_t) ~RS_None; 1350 ren = (rend_t) ~RS_None;
1337 else if (GET_BASEBG (rstyle) == Color_bg) 1351 else if (GET_BASEBG (rstyle) == Color_bg)
1338 { 1352 {
1339 ren = DEFAULT_RSTYLE; 1353 ren = DEFAULT_RSTYLE;
1340 CLEAR_ROWS (row, num); 1354
1355 if (mapped)
1356 XClearArea (dpy, vt, 0,
1357 Row2Pixel (row - view_start), (unsigned int)width,
1358 (unsigned int)Height2Pixel (num), False);
1341 } 1359 }
1342 else 1360 else
1343 { 1361 {
1344 ren = rstyle & (RS_fgMask | RS_bgMask); 1362 ren = rstyle & (RS_fgMask | RS_bgMask);
1363
1364 if (mapped)
1365 {
1345 gcvalue.foreground = pix_colors[bgcolor_of (rstyle)]; 1366 gcvalue.foreground = pix_colors[bgcolor_of (rstyle)];
1346 XChangeGC (dpy, gc, GCForeground, &gcvalue); 1367 XChangeGC (dpy, gc, GCForeground, &gcvalue);
1347 ERASE_ROWS (row, num); 1368 XFillRectangle (dpy, vt, gc,
1369 0, Row2Pixel (row - view_start),
1370 (unsigned int)width,
1371 (unsigned int)Height2Pixel (num));
1348 gcvalue.foreground = pix_colors[Color_fg]; 1372 gcvalue.foreground = pix_colors[Color_fg];
1349 XChangeGC (dpy, gc, GCForeground, &gcvalue); 1373 XChangeGC (dpy, gc, GCForeground, &gcvalue);
1374 }
1350 } 1375 }
1351 1376
1352 for (; num--; row++) 1377 for (; num--; row++)
1353 { 1378 {
1354 scr_blank_screen_mem (ROW(row), rstyle); 1379 scr_blank_screen_mem (ROW(row), rstyle);
1380
1381 if (row - view_start < nrow)
1355 scr_blank_line (drawn_buf [row], 0, ncol, ren); 1382 scr_blank_line (drawn_buf [row - view_start], 0, ncol, ren);
1356 } 1383 }
1357} 1384}
1358 1385
1359#if !ENABLE_MINIMAL 1386#if !ENABLE_MINIMAL
1360void 1387void
1434 * Insert/Delete <count> characters from the current position 1461 * Insert/Delete <count> characters from the current position
1435 */ 1462 */
1436void 1463void
1437rxvt_term::scr_insdel_chars (int count, int insdel) NOTHROW 1464rxvt_term::scr_insdel_chars (int count, int insdel) NOTHROW
1438{ 1465{
1439 int col, row;
1440 rend_t tr;
1441
1442 want_refresh = 1; 1466 want_refresh = 1;
1443 ZERO_SCROLLBACK (); 1467 ZERO_SCROLLBACK ();
1444 1468
1445 if (count <= 0) 1469 if (count <= 0)
1446 return; 1470 return;
1448 scr_do_wrap (); 1472 scr_do_wrap ();
1449 1473
1450 selection_check (1); 1474 selection_check (1);
1451 min_it (count, ncol - screen.cur.col); 1475 min_it (count, ncol - screen.cur.col);
1452 1476
1453 row = screen.cur.row; 1477 int row = screen.cur.row;
1454 1478
1455 line_t *line = &ROW(row); 1479 line_t *line = &ROW(row);
1456 1480
1457 line->touch (); 1481 line->touch ();
1458 line->is_longer (0); 1482 line->is_longer (0);
1459 1483
1484 // nuke wide spanning the start
1485 if (line->t[screen.cur.col] == NOCHAR)
1486 scr_kill_char (*line, screen.cur.col);
1487
1460 switch (insdel) 1488 switch (insdel)
1461 { 1489 {
1462 case INSERT: 1490 case INSERT:
1463 for (col = ncol - 1; (col - count) >= screen.cur.col; col--) 1491 line->l = min (line->l + count, ncol);
1492
1493 if (line->t[screen.cur.col] == NOCHAR)
1494 scr_kill_char (*line, screen.cur.col);
1495
1496 for (int col = ncol - 1; (col - count) >= screen.cur.col; col--)
1464 { 1497 {
1465 line->t[col] = line->t[col - count]; 1498 line->t[col] = line->t[col - count];
1466 line->r[col] = line->r[col - count]; 1499 line->r[col] = line->r[col - count];
1467 } 1500 }
1468
1469 line->l = min (line->l + count, ncol);
1470 1501
1471 if (selection.op && current_screen == selection.screen 1502 if (selection.op && current_screen == selection.screen
1472 && ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur)) 1503 && ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur))
1473 { 1504 {
1474 if (selection.end.row != screen.cur.row 1505 if (selection.end.row != screen.cur.row
1489 case ERASE: 1520 case ERASE:
1490 screen.cur.col += count; /* don't worry if > ncol */ 1521 screen.cur.col += count; /* don't worry if > ncol */
1491 selection_check (1); 1522 selection_check (1);
1492 screen.cur.col -= count; 1523 screen.cur.col -= count;
1493 1524
1494 line->l = max (line->l - count, 0); 1525 // nuke wide char after the end
1526 if (screen.cur.col + count < ncol && line->t[screen.cur.col + count] == NOCHAR)
1527 scr_kill_char (*line, screen.cur.col + count);
1528
1495 scr_blank_line (*line, screen.cur.col, count, rstyle); 1529 scr_blank_line (*line, screen.cur.col, count, rstyle);
1496 break; 1530 break;
1497 1531
1498 case DELETE: 1532 case DELETE:
1499 tr = line->r[ncol - 1] & (RS_fgMask | RS_bgMask | RS_baseattrMask); 1533 line->l = max (line->l - count, 0);
1500 1534
1535 // nuke wide char spanning the end
1536 if (screen.cur.col + count < ncol && line->t[screen.cur.col + count] == NOCHAR)
1537 scr_kill_char (*line, screen.cur.col + count);
1538
1501 for (col = screen.cur.col; (col + count) < ncol; col++) 1539 for (int col = screen.cur.col; (col + count) < ncol; col++)
1502 { 1540 {
1503 line->t[col] = line->t[col + count]; 1541 line->t[col] = line->t[col + count];
1504 line->r[col] = line->r[col + count]; 1542 line->r[col] = line->r[col + count];
1505 } 1543 }
1506 1544
1507 line->l = max (line->l - count, 0);
1508 scr_blank_line (*line, ncol - count, count, tr); 1545 scr_blank_line (*line, ncol - count, count, rstyle);
1509 1546
1510 if (selection.op && current_screen == selection.screen 1547 if (selection.op && current_screen == selection.screen
1511 && ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur)) 1548 && ROWCOL_IN_ROW_AT_OR_AFTER (selection.beg, screen.cur))
1512 { 1549 {
1513 if (selection.end.row != screen.cur.row 1550 if (selection.end.row != screen.cur.row
1803 for (i = PART_BEG; i < RC_COUNT; i++) 1840 for (i = PART_BEG; i < RC_COUNT; i++)
1804 { 1841 {
1805 min_it (rc[i].col, ncol - 1); 1842 min_it (rc[i].col, ncol - 1);
1806 min_it (rc[i].row, nrow - 1); 1843 min_it (rc[i].row, nrow - 1);
1807 } 1844 }
1808// TODO: this line somehow causes segfault if scr_expose() is called just after resize 1845
1809 for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++) 1846 for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++)
1810 fill_text (&drawn_buf[i].t[rc[PART_BEG].col], 0, rc[PART_END].col - rc[PART_BEG].col + 1); 1847 fill_text (&drawn_buf[i].t[rc[PART_BEG].col], 0, rc[PART_END].col - rc[PART_BEG].col + 1);
1811 1848
1812 num_scr_allow = 0; 1849 num_scr_allow = 0;
1813 1850
1872void 1909void
1873rxvt_term::bell_cb (ev::timer &w, int revents) 1910rxvt_term::bell_cb (ev::timer &w, int revents)
1874{ 1911{
1875 rvideo_bell = false; 1912 rvideo_bell = false;
1876 scr_rvideo_mode (rvideo_mode); 1913 scr_rvideo_mode (rvideo_mode);
1914 refresh_check ();
1877} 1915}
1878#endif 1916#endif
1879 1917
1880/* ------------------------------------------------------------------------- */ 1918/* ------------------------------------------------------------------------- */
1881void 1919void
1890 XMapWindow (dpy, parent[0]); 1928 XMapWindow (dpy, parent[0]);
1891# endif 1929# endif
1892 1930
1893# if ENABLE_FRILLS 1931# if ENABLE_FRILLS
1894 if (option (Opt_urgentOnBell)) 1932 if (option (Opt_urgentOnBell))
1895 { 1933 set_urgency (1);
1896 if (XWMHints *h = XGetWMHints(dpy, parent[0]))
1897 {
1898 h->flags |= XUrgencyHint;
1899 XSetWMHints (dpy, parent[0], h);
1900 }
1901 }
1902# endif 1934# endif
1903 1935
1904 if (option (Opt_visualBell)) 1936 if (option (Opt_visualBell))
1905 { 1937 {
1906 rvideo_bell = true; 1938 rvideo_bell = true;
1907 scr_rvideo_mode (rvideo_mode); 1939 scr_rvideo_mode (rvideo_mode);
1908 display->flush (); 1940 flush ();
1909 1941
1910 bell_ev.start (VISUAL_BELL_DURATION); 1942 bell_ev.start (VISUAL_BELL_DURATION);
1911 } 1943 }
1912 else 1944 else
1913 XBell (dpy, 0); 1945 XBell (dpy, 0);
1946 HOOK_INVOKE ((this, HOOK_BELL, DT_END));
1914#endif 1947#endif
1915} 1948}
1916 1949
1917/* ------------------------------------------------------------------------- */ 1950/* ------------------------------------------------------------------------- */
1918/* ARGSUSED */ 1951/* ARGSUSED */
1919void 1952void
1920rxvt_term::scr_printscreen (int fullhist) NOTHROW 1953rxvt_term::scr_printscreen (int fullhist) NOTHROW
1921{ 1954{
1922#ifdef PRINTPIPE 1955#ifdef PRINTPIPE
1923 int nrows, row_start; 1956 int nrows, row_start;
1924 FILE *fd; 1957 FILE *fd = popen_printer ();
1925 1958
1926 if ((fd = popen_printer ()) == NULL) 1959 if (!fd)
1927 return; 1960 return;
1928 1961
1929 if (fullhist) 1962 if (fullhist)
1930 { 1963 {
1931 nrows = nrow - top_row; 1964 nrows = nrow - top_row;
1937 row_start = view_start; 1970 row_start = view_start;
1938 } 1971 }
1939 1972
1940 wctomb (0, 0); 1973 wctomb (0, 0);
1941 1974
1942 for (int r1 = 0; r1 < nrows; r1++) 1975 for (int r1 = row_start; r1 < row_start + nrows; r1++)
1943 { 1976 {
1944 text_t *tp = ROW(r1).t; 1977 text_t *tp = ROW(r1).t;
1945 int len = ROW(r1).l; 1978 int len = ROW(r1).l;
1946 1979
1947 for (int i = len >= 0 ? len : ncol - 1; i--; ) //TODO//FIXME//LEN 1980 for (int i = len >= 0 ? len : ncol - 1; i--; ) //TODO//FIXME//LEN
1976 * screen.text/screen.rend contain what the screen will change to. 2009 * screen.text/screen.rend contain what the screen will change to.
1977 */ 2010 */
1978void 2011void
1979rxvt_term::scr_refresh () NOTHROW 2012rxvt_term::scr_refresh () NOTHROW
1980{ 2013{
1981 unsigned char have_bg,
1982 showcursor; /* show the cursor */
1983 int16_t col, row, /* column/row we're processing */ 2014 int16_t col, row, /* column/row we're processing */
1984 ocrow; /* old cursor row */ 2015 ocrow; /* old cursor row */
1985 int i; /* tmp */ 2016 int i; /* tmp */
1986#ifndef NO_CURSORCOLOR 2017#ifndef NO_CURSORCOLOR
1987 rend_t cc1; /* store colours at cursor position (s) */ 2018 rend_t cc1; /* store colours at cursor position (s) */
1996 return; 2027 return;
1997 2028
1998 /* 2029 /*
1999 * A: set up vars 2030 * A: set up vars
2000 */ 2031 */
2001 have_bg = 0;
2002 refresh_count = 0; 2032 refresh_count = 0;
2003 2033
2034 unsigned int old_screen_flags = screen.flags;
2035 char have_bg = 0;
2004#ifdef HAVE_BG_PIXMAP 2036#ifdef HAVE_BG_PIXMAP
2005 have_bg |= bgPixmap.pixmap != None; 2037 have_bg = bgPixmap.pixmap != None;
2006#endif 2038#endif
2007 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */ 2039 ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
2008 2040
2009 /* 2041 /*
2010 * B: reverse any characters which are selected 2042 * B: reverse any characters which are selected
2011 */ 2043 */
2012 scr_reverse_selection (); 2044 scr_reverse_selection ();
2045
2046 HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END));
2047#if ENABLE_OVERLAY
2048 scr_swap_overlay ();
2049#endif
2050
2051 char showcursor = screen.flags & Screen_VisibleCursor;
2013 2052
2014 /* 2053 /*
2015 * C: set the cursor character (s) 2054 * C: set the cursor character (s)
2016 */ 2055 */
2017 { 2056 {
2018 unsigned char setoldcursor; 2057 unsigned char setoldcursor;
2019 2058
2020 showcursor = (screen.flags & Screen_VisibleCursor);
2021#ifdef CURSOR_BLINK 2059#ifdef CURSOR_BLINK
2022 if (hidden_cursor) 2060 if (hidden_cursor)
2023 showcursor = 0; 2061 showcursor = 0;
2024#endif 2062#endif
2025 2063
2053 ccol2 = bgcolor_of (rstyle); 2091 ccol2 = bgcolor_of (rstyle);
2054#else 2092#else
2055 ccol2 = Color_bg; 2093 ccol2 = Color_bg;
2056#endif 2094#endif
2057 2095
2058 if (showcursor && focus) 2096 if (focus)
2059 { 2097 {
2060 if (option (Opt_cursorUnderline)) 2098 if (option (Opt_cursorUnderline))
2061 *crp ^= RS_Uline; 2099 *crp ^= RS_Uline;
2062 else 2100 else
2063 { 2101 {
2098 oldcursor.col = screen.cur.col; 2136 oldcursor.col = screen.cur.col;
2099 } 2137 }
2100 } 2138 }
2101 } 2139 }
2102 2140
2103 HOOK_INVOKE ((this, HOOK_REFRESH_BEGIN, DT_END));
2104#if ENABLE_OVERLAY
2105 scr_swap_overlay ();
2106#endif
2107
2108#ifndef NO_SLOW_LINK_SUPPORT 2141#ifndef NO_SLOW_LINK_SUPPORT
2109 /* 2142 /*
2110 * D: CopyArea pass - very useful for slower links 2143 * D: CopyArea pass - very useful for slower links
2111 * This has been deliberately kept simple. 2144 * This has been deliberately kept simple.
2112 */ 2145 */
2201 continue; 2234 continue;
2202 2235
2203 // redraw one or more characters 2236 // redraw one or more characters
2204 2237
2205 // seek to the beginning of wide characters 2238 // seek to the beginning of wide characters
2206 while (stp[col] == NOCHAR && col > 0) 2239 while (expect_false (stp[col] == NOCHAR && col > 0))
2207 --col; 2240 --col;
2208 2241
2209 rend_t rend = srp[col]; /* screen rendition (target rendtion) */ 2242 rend_t rend = srp[col]; /* screen rendition (target rendition) */
2210 text_t *text = stp + col; 2243 text_t *text = stp + col;
2211 int count = 1; 2244 int count = 1;
2212 2245
2213 dtp[col] = stp[col]; 2246 dtp[col] = stp[col];
2214 drp[col] = rend; 2247 drp[col] = rend;
2218 for (i = 0; ++col < ncol; ) 2251 for (i = 0; ++col < ncol; )
2219 { 2252 {
2220 if (stp[col] == NOCHAR) 2253 if (stp[col] == NOCHAR)
2221 { 2254 {
2222 dtp[col] = stp[col]; 2255 dtp[col] = stp[col];
2223 drp[col] = rend; 2256 drp[col] = srp[col];
2257
2224 count++; 2258 count++;
2225 i++; 2259 i++;
2226 2260
2227 continue; 2261 continue;
2228 } 2262 }
2248 2282
2249 col--; /* went one too far. move back */ 2283 col--; /* went one too far. move back */
2250 count -= i; /* dump any matching trailing chars */ 2284 count -= i; /* dump any matching trailing chars */
2251 2285
2252 // sometimes we optimize away the trailing NOCHAR's, add them back 2286 // sometimes we optimize away the trailing NOCHAR's, add them back
2253 while (i && text[count] == NOCHAR) 2287 while (expect_false (i && text[count] == NOCHAR))
2254 count++, i--; 2288 count++, i--;
2255 2289
2256 /* 2290 /*
2257 * Determine the attributes for the string 2291 * Determine the attributes for the string
2258 */ 2292 */
2259 int fore = fgcolor_of (rend); // desired foreground 2293 int fore = fgcolor_of (rend); // desired foreground
2260 int back = bgcolor_of (rend); // desired background 2294 int back = bgcolor_of (rend); // desired background
2261 2295
2262 // only do special processing if any attributes are set, which is unlikely 2296 // only do special processing if any attributes are set, which is unlikely
2263 if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful)) 2297 if (expect_false (rend & (RS_baseattrMask | RS_Careful | RS_Sel)))
2264 { 2298 {
2265 bool invert = rend & RS_RVid; 2299 bool invert = rend & RS_RVid;
2266 2300
2267#ifndef NO_BOLD_UNDERLINE_REVERSE 2301#ifndef NO_BOLD_UNDERLINE_REVERSE
2268 if (rend & RS_Bold
2269 && fore == Color_fg) 2302 if (rend & RS_Bold && fore == Color_fg)
2270 { 2303 {
2271 if (ISSET_PIXCOLOR (Color_BD)) 2304 if (ISSET_PIXCOLOR (Color_BD))
2272 fore = Color_BD; 2305 fore = Color_BD;
2273# if !ENABLE_STYLES 2306# if !ENABLE_STYLES
2274 else 2307 else
2275 invert = !invert; 2308 invert = !invert;
2276# endif 2309# endif
2277 } 2310 }
2278 2311
2279 if (rend & RS_Italic 2312 if (rend & RS_Italic && fore == Color_fg)
2280 && fore == Color_fg)
2281 { 2313 {
2282 if (ISSET_PIXCOLOR (Color_IT)) 2314 if (ISSET_PIXCOLOR (Color_IT))
2283 fore = Color_IT; 2315 fore = Color_IT;
2284# if !ENABLE_STYLES 2316# if !ENABLE_STYLES
2285 else 2317 else
2289 2321
2290 if (rend & RS_Uline && fore == Color_fg && ISSET_PIXCOLOR (Color_UL)) 2322 if (rend & RS_Uline && fore == Color_fg && ISSET_PIXCOLOR (Color_UL))
2291 fore = Color_UL; 2323 fore = Color_UL;
2292#endif 2324#endif
2293 2325
2326#ifdef OPTION_HC
2327 if (rend & RS_Sel)
2328 {
2329 /* invert the column if no highlightColor is set or it is the
2330 * current cursor column */
2331 if (!(showcursor && row == screen.cur.row && text - stp == screen.cur.col)
2332 && ISSET_PIXCOLOR (Color_HC))
2333 {
2334 if (ISSET_PIXCOLOR (Color_HTC))
2335 fore = Color_HTC;
2336 // if invert is 0 reverse video is set so we use bg color as fg color
2337 else if (!invert)
2338 fore = back;
2339
2340 back = Color_HC;
2341 invert = 0;
2342 }
2343 }
2344#endif
2345
2294 if (invert) 2346 if (invert)
2295 { 2347 {
2296#ifdef OPTION_HC
2297 if ((showcursor && row == screen.cur.row && text - stp == screen.cur.col)
2298 || !ISSET_PIXCOLOR (Color_HC))
2299#endif
2300 /* invert the column if no highlightColor is set or it is the
2301 * current cursor column */
2302 ::swap (fore, back); 2348 ::swap (fore, back);
2303#ifdef OPTION_HC
2304 else if (ISSET_PIXCOLOR (Color_HC))
2305 back = Color_HC;
2306#endif
2307 2349
2308#ifndef NO_BOLD_UNDERLINE_REVERSE 2350#ifndef NO_BOLD_UNDERLINE_REVERSE
2309# ifndef OPTION_HC
2310 if (ISSET_PIXCOLOR (Color_RV))
2311 back = Color_RV;
2312# endif
2313 if (fore == back) 2351 if (fore == back)
2314 { 2352 {
2315 fore = Color_bg; 2353 fore = Color_bg;
2316 back = Color_fg; 2354 back = Color_fg;
2317 } 2355 }
2319 } 2357 }
2320 2358
2321#ifdef TEXT_BLINK 2359#ifdef TEXT_BLINK
2322 if (rend & RS_Blink && (back == Color_bg || fore == Color_bg)) 2360 if (rend & RS_Blink && (back == Color_bg || fore == Color_bg))
2323 { 2361 {
2324 if (!ev_is_active (&text_blink_ev)) 2362 if (!text_blink_ev.is_active ())
2325 { 2363 {
2326 text_blink_ev.again (); 2364 text_blink_ev.again ();
2327 hidden_text = 0; 2365 hidden_text = 0;
2328 } 2366 }
2329 else if (hidden_text) 2367 else if (hidden_text)
2353 /* 2391 /*
2354 * Actually do the drawing of the string here 2392 * Actually do the drawing of the string here
2355 */ 2393 */
2356 rxvt_font *font = (*fontset[GET_STYLE (rend)])[GET_FONT (rend)]; 2394 rxvt_font *font = (*fontset[GET_STYLE (rend)])[GET_FONT (rend)];
2357 2395
2358 if (have_bg && back == Color_bg) 2396 if (expect_true (have_bg && back == Color_bg))
2359 { 2397 {
2360 // this is very ugly, maybe push it into ->draw? 2398 // this is very ugly, maybe push it into ->draw?
2361 2399
2362 for (i = 0; i < count; i++) /* don't draw empty strings */ 2400 for (i = 0; i < count; i++) /* don't draw empty strings */
2363 if (text[i] != ' ') 2401 if (text[i] != ' ')
2370 did_clear: ; 2408 did_clear: ;
2371 } 2409 }
2372 else 2410 else
2373 font->draw (*drawable, xpixel, ypixel, text, count, fore, back); 2411 font->draw (*drawable, xpixel, ypixel, text, count, fore, back);
2374 2412
2375 if (rend & RS_Uline && font->descent > 1 && fore != back) 2413 if (expect_false (rend & RS_Uline && font->descent > 1 && fore != back))
2376 { 2414 {
2377#if ENABLE_FRILLS 2415#if ENABLE_FRILLS
2378 if (ISSET_PIXCOLOR (Color_underline)) 2416 if (ISSET_PIXCOLOR (Color_underline))
2379 XSetForeground (dpy, gc, pix_colors[Color_underline]); 2417 XSetForeground (dpy, gc, pix_colors[Color_underline]);
2380 else 2418 else
2381#endif 2419#endif
2382 XSetForeground (dpy, gc, pix_colors[fore]); 2420 XSetForeground (dpy, gc, pix_colors[fore]);
2383 2421
2384 XDrawLine (dpy, drawBuffer, gc, 2422 XDrawLine (dpy, vt, gc,
2385 xpixel, ypixel + font->ascent + 1, 2423 xpixel, ypixel + font->ascent + 1,
2386 xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1); 2424 xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1);
2387 } 2425 }
2388 } /* for (col....) */ 2426 } /* for (col....) */
2389 } /* for (row....) */ 2427 } /* for (row....) */
2390
2391#if ENABLE_OVERLAY
2392 scr_swap_overlay ();
2393#endif
2394 HOOK_INVOKE ((this, HOOK_REFRESH_END, DT_END));
2395 2428
2396 /* 2429 /*
2397 * G: cleanup cursor and display outline cursor if necessary 2430 * G: cleanup cursor and display outline cursor if necessary
2398 */ 2431 */
2399 if (showcursor) 2432 if (showcursor)
2427 XSetForeground (dpy, gc, pix_colors[Color_cursor]); 2460 XSetForeground (dpy, gc, pix_colors[Color_cursor]);
2428 else 2461 else
2429#endif 2462#endif
2430 XSetForeground (dpy, gc, pix_colors[ccol1]); 2463 XSetForeground (dpy, gc, pix_colors[ccol1]);
2431 2464
2432 XDrawRectangle (dpy, drawBuffer, gc, 2465 XDrawRectangle (dpy, vt, gc,
2433 Col2Pixel (col), 2466 Col2Pixel (col),
2434 Row2Pixel (oldcursor.row), 2467 Row2Pixel (oldcursor.row),
2435 (unsigned int) (Width2Pixel (cursorwidth) - 1), 2468 (unsigned int) (Width2Pixel (cursorwidth) - 1),
2436 (unsigned int) (Height2Pixel (1) - lineSpace - 1)); 2469 (unsigned int) (Height2Pixel (1) - lineSpace - 1));
2437 } 2470 }
2438 } 2471 }
2439 2472
2440 /* 2473 /*
2441 * H: cleanup selection 2474 * H: cleanup selection
2442 */ 2475 */
2476#if ENABLE_OVERLAY
2477 scr_swap_overlay ();
2478#endif
2479 HOOK_INVOKE ((this, HOOK_REFRESH_END, DT_END));
2480
2443 scr_reverse_selection (); 2481 scr_reverse_selection ();
2444 2482
2483 screen.flags = old_screen_flags;
2445 num_scr = 0; 2484 num_scr = 0;
2446 num_scr_allow = 1; 2485 num_scr_allow = 1;
2447} 2486}
2448 2487
2449void 2488void
2475rxvt_term::scr_recolour () NOTHROW 2514rxvt_term::scr_recolour () NOTHROW
2476{ 2515{
2477#ifdef HAVE_BG_PIXMAP 2516#ifdef HAVE_BG_PIXMAP
2478 bgPixmap.apply (); 2517 bgPixmap.apply ();
2479#else 2518#else
2519
2480 XSetWindowBackground (dpy, parent[0], pix_colors[Color_border]); 2520 XSetWindowBackground (dpy, parent[0], pix_colors[Color_border]);
2481 XClearWindow (dpy, parent[0]); 2521 XClearWindow (dpy, parent[0]);
2482 XSetWindowBackground (dpy, vt, pix_colors[Color_bg]); 2522 XSetWindowBackground (dpy, vt, pix_colors[Color_bg]);
2483# if HAVE_SCROLLBARS 2523
2484 if (scrollBar.win) 2524 if (scrollBar.win)
2485 { 2525 {
2486 XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]); 2526 XSetWindowBackground (dpy, scrollBar.win, pix_colors[Color_border]);
2487 scrollBar.setIdle (); 2527 scrollBar.state = STATE_IDLE;
2488 scrollbar_show (0); 2528 scrollBar.show (0);
2489 } 2529 }
2530
2490# endif 2531#endif
2532
2533 /* bgPixmap.apply () does not do the following : */
2491 scr_clear (); 2534 scr_clear ();
2492 scr_touch (true); 2535 scr_touch (true);
2493 want_refresh = 1; 2536 want_refresh = 1;
2494#endif
2495
2496} 2537}
2497 2538
2498/* ------------------------------------------------------------------------- */ 2539/* ------------------------------------------------------------------------- */
2499void 2540void
2500rxvt_term::scr_clear (bool really) NOTHROW 2541rxvt_term::scr_clear (bool really) NOTHROW
2567 { 2608 {
2568#if !ENABLE_MINIMAL 2609#if !ENABLE_MINIMAL
2569 if (selection.rect) 2610 if (selection.rect)
2570 scr_xor_rect (selection.beg.row, selection.beg.col, 2611 scr_xor_rect (selection.beg.row, selection.beg.col,
2571 selection.end.row, selection.end.col, 2612 selection.end.row, selection.end.col,
2572 RS_RVid, RS_RVid | RS_Uline); 2613 RS_Sel | RS_RVid, RS_Sel | RS_RVid | RS_Uline);
2573 else 2614 else
2574#endif 2615#endif
2575 scr_xor_span (selection.beg.row, selection.beg.col, 2616 scr_xor_span (selection.beg.row, selection.beg.col,
2576 selection.end.row, selection.end.col, 2617 selection.end.row, selection.end.col,
2577 RS_RVid); 2618 RS_Sel | RS_RVid);
2578 } 2619 }
2579} 2620}
2580 2621
2581/* ------------------------------------------------------------------------- */ 2622/* ------------------------------------------------------------------------- */
2582/* 2623/*
2589{ 2630{
2590 int row, wrote; 2631 int row, wrote;
2591 unsigned int width, towrite; 2632 unsigned int width, towrite;
2592 char r1[] = "\n"; 2633 char r1[] = "\n";
2593 2634
2594 for (row = saveLines - nsaved; 2635 for (row = saveLines + top_row;
2595 row < saveLines + nrow - 1; row++) 2636 row < saveLines + nrow - 1; row++)
2596 { 2637 {
2597 width = row_buf[row].l >= 0 ? row_buf[row].l 2638 width = row_buf[row].l >= 0 ? row_buf[row].l
2598 : ncol; 2639 : ncol;
2599 for (towrite = width; towrite; towrite -= wrote) 2640 for (towrite = width; towrite; towrite -= wrote)
2643/* ------------------------------------------------------------------------- */ 2684/* ------------------------------------------------------------------------- */
2644/* 2685/*
2645 * Paste a selection direct to the command fd 2686 * Paste a selection direct to the command fd
2646 */ 2687 */
2647void 2688void
2648rxvt_term::paste (char *data, unsigned int len) NOTHROW 2689rxvt_term::tt_paste (char *data, unsigned int len) NOTHROW
2649{ 2690{
2650 /* convert normal newline chars into common keyboard Return key sequence */ 2691 /* convert normal newline chars into common keyboard Return key sequence */
2651 for (unsigned int i = 0; i < len; i++) 2692 for (unsigned int i = 0; i < len; i++)
2652 if (data[i] == C0_LF) 2693 if (data[i] == C0_LF)
2653 data[i] = C0_CR; 2694 data[i] = C0_CR;
2654 2695
2696 if (priv_modes & PrivMode_BracketPaste)
2697 tt_printf ("\e[200~");
2698
2655 tt_write (data, len); 2699 tt_write (data, len);
2700
2701 if (priv_modes & PrivMode_BracketPaste)
2702 tt_printf ("\e[201~");
2703}
2704
2705void
2706rxvt_term::paste (char *data, unsigned int len) NOTHROW
2707{
2708 if (HOOK_INVOKE ((this, HOOK_TT_PASTE, DT_STR_LEN, data, len, DT_END)))
2709 return;
2710
2711 tt_paste (data, len);
2656} 2712}
2657 2713
2658/* ------------------------------------------------------------------------- */ 2714/* ------------------------------------------------------------------------- */
2659/* 2715/*
2660 * Respond to a notification that a primary selection has been sent 2716 * Respond to a notification that a primary selection has been sent
2869 selection_wait = Sel_normal; 2925 selection_wait = Sel_normal;
2870 2926
2871#if X_HAVE_UTF8_STRING 2927#if X_HAVE_UTF8_STRING
2872 selection_type = Sel_UTF8String; 2928 selection_type = Sel_UTF8String;
2873 if (selection_request_other (xa[XA_UTF8_STRING], selnum)) 2929 if (selection_request_other (xa[XA_UTF8_STRING], selnum))
2874 return; 2930 return;
2875#else 2931#else
2876 selection_type = Sel_CompoundText; 2932 selection_type = Sel_CompoundText;
2877 if (selection_request_other (xa[XA_COMPOUND_TEXT], selnum)) 2933 if (selection_request_other (xa[XA_COMPOUND_TEXT], selnum))
2878 return; 2934 return;
2879#endif 2935#endif
2880 } 2936 }
2881 2937
2882 selection_wait = Sel_none; /* don't loop in selection_paste () */ 2938 selection_wait = Sel_none; /* don't loop in selection_paste () */
2883 selection_paste (display->root, XA_CUT_BUFFER0, false); 2939 selection_paste (display->root, XA_CUT_BUFFER0, false);
2911/* 2967/*
2912 * Clear all selected text 2968 * Clear all selected text
2913 * EXT: SelectionClear 2969 * EXT: SelectionClear
2914 */ 2970 */
2915void 2971void
2916rxvt_term::selection_clear () NOTHROW 2972rxvt_term::selection_clear (bool clipboard) NOTHROW
2917{ 2973{
2974 if (!clipboard)
2975 {
2918 want_refresh = 1; 2976 want_refresh = 1;
2919 free (selection.text); 2977 free (selection.text);
2920 selection.text = NULL; 2978 selection.text = NULL;
2921 selection.len = 0; 2979 selection.len = 0;
2922 CLEAR_SELECTION (); 2980 CLEAR_SELECTION ();
2923 2981
2924 if (display->selection_owner == this) 2982 if (display->selection_owner == this)
2925 display->selection_owner = 0; 2983 display->selection_owner = 0;
2984 }
2985 else
2986 {
2987 free (selection.clip_text);
2988 selection.clip_text = NULL;
2989 selection.clip_len = 0;
2990
2991 if (display->clipboard_owner == this)
2992 display->clipboard_owner = 0;
2993 }
2926} 2994}
2927 2995
2928/* ------------------------------------------------------------------------- */ 2996/* ------------------------------------------------------------------------- */
2929/* 2997/*
2930 * Copy a selection into the cut buffer 2998 * Copy a selection into the cut buffer
3056 3124
3057 selection_grab (tm); 3125 selection_grab (tm);
3058} 3126}
3059 3127
3060bool 3128bool
3061rxvt_term::selection_grab (Time tm) NOTHROW 3129rxvt_term::selection_grab (Time tm, bool clipboard) NOTHROW
3062{ 3130{
3131 Atom sel;
3132
3133 if (!clipboard)
3134 {
3063 selection_time = tm; 3135 selection_time = tm;
3136 sel = XA_PRIMARY;
3137 }
3138 else
3139 {
3140 clipboard_time = tm;
3141 sel = xa[XA_CLIPBOARD];
3142 }
3064 3143
3065 XSetSelectionOwner (dpy, XA_PRIMARY, vt, tm); 3144 XSetSelectionOwner (dpy, sel, vt, tm);
3066 if (XGetSelectionOwner (dpy, XA_PRIMARY) == vt) 3145 if (XGetSelectionOwner (dpy, sel) == vt)
3067 { 3146 {
3068 display->set_selection_owner (this); 3147 display->set_selection_owner (this, clipboard);
3069 return true; 3148 return true;
3070 } 3149 }
3071 else 3150 else
3072 { 3151 {
3073 selection_clear (); 3152 selection_clear (clipboard);
3074 return false; 3153 return false;
3075 } 3154 }
3076 3155
3077#if 0 3156#if 0
3078 XTextProperty ct; 3157 XTextProperty ct;
3573 else if (rq.target == xa[XA_MULTIPLE]) 3652 else if (rq.target == xa[XA_MULTIPLE])
3574 { 3653 {
3575 /* TODO: Handle MULTIPLE */ 3654 /* TODO: Handle MULTIPLE */
3576 } 3655 }
3577#endif 3656#endif
3578 else if (rq.target == xa[XA_TIMESTAMP] && selection.text) 3657 else if (rq.target == xa[XA_TIMESTAMP] && rq.selection == XA_PRIMARY && selection.text)
3579 { 3658 {
3580 XChangeProperty (dpy, rq.requestor, rq.property, rq.target, 3659 XChangeProperty (dpy, rq.requestor, rq.property, rq.target,
3581 32, PropModeReplace, (unsigned char *)&selection_time, 1); 3660 32, PropModeReplace, (unsigned char *)&selection_time, 1);
3661 ev.property = rq.property;
3662 }
3663 else if (rq.target == xa[XA_TIMESTAMP] && rq.selection == xa[XA_CLIPBOARD] && selection.clip_text)
3664 {
3665 XChangeProperty (dpy, rq.requestor, rq.property, rq.target,
3666 32, PropModeReplace, (unsigned char *)&clipboard_time, 1);
3582 ev.property = rq.property; 3667 ev.property = rq.property;
3583 } 3668 }
3584 else if (rq.target == XA_STRING 3669 else if (rq.target == XA_STRING
3585 || rq.target == xa[XA_TEXT] 3670 || rq.target == xa[XA_TEXT]
3586 || rq.target == xa[XA_COMPOUND_TEXT] 3671 || rq.target == xa[XA_COMPOUND_TEXT]
3619 { 3704 {
3620 target = xa[XA_COMPOUND_TEXT]; 3705 target = xa[XA_COMPOUND_TEXT];
3621 style = enc_compound_text; 3706 style = enc_compound_text;
3622 } 3707 }
3623 3708
3624 if (selection.text) 3709 if (rq.selection == XA_PRIMARY && selection.text)
3625 { 3710 {
3626 cl = selection.text; 3711 cl = selection.text;
3627 selectlen = selection.len; 3712 selectlen = selection.len;
3713 }
3714 else if (rq.selection == xa[XA_CLIPBOARD] && selection.clip_text)
3715 {
3716 cl = selection.clip_text;
3717 selectlen = selection.clip_len;
3628 } 3718 }
3629 else 3719 else
3630 { 3720 {
3631 cl = L""; 3721 cl = L"";
3632 selectlen = 0; 3722 selectlen = 0;
3700 h += 2; min_it (h, nrow); 3790 h += 2; min_it (h, nrow);
3701 3791
3702 x -= 1; clamp_it (x, 0, ncol - w); 3792 x -= 1; clamp_it (x, 0, ncol - w);
3703 y -= 1; clamp_it (y, 0, nrow - h); 3793 y -= 1; clamp_it (y, 0, nrow - h);
3704 3794
3705 ov_x = x; ov_y = y; 3795 ov.x = x; ov.y = y;
3706 ov_w = w; ov_h = h; 3796 ov.w = w; ov.h = h;
3707 3797
3708 ov_text = new text_t *[h]; 3798 ov.text = new text_t *[h];
3709 ov_rend = new rend_t *[h]; 3799 ov.rend = new rend_t *[h];
3710 3800
3711 for (y = 0; y < h; y++) 3801 for (y = 0; y < h; y++)
3712 { 3802 {
3713 text_t *tp = ov_text[y] = new text_t[w]; 3803 text_t *tp = ov.text[y] = new text_t[w];
3714 rend_t *rp = ov_rend[y] = new rend_t[w]; 3804 rend_t *rp = ov.rend[y] = new rend_t[w];
3715 3805
3716 text_t t0, t1, t2; 3806 text_t t0, t1, t2;
3717 rend_t r = OVERLAY_RSTYLE; 3807 rend_t r = OVERLAY_RSTYLE;
3718 3808
3719 if (y == 0) 3809 if (y == 0)
3738} 3828}
3739 3829
3740void 3830void
3741rxvt_term::scr_overlay_off () NOTHROW 3831rxvt_term::scr_overlay_off () NOTHROW
3742{ 3832{
3743 if (!ov_text) 3833 if (!ov.text)
3744 return; 3834 return;
3745 3835
3746 want_refresh = 1; 3836 want_refresh = 1;
3747 3837
3748 for (int y = 0; y < ov_h; y++) 3838 for (int y = 0; y < ov.h; y++)
3749 { 3839 {
3750 delete [] ov_text[y]; 3840 delete [] ov.text[y];
3751 delete [] ov_rend[y]; 3841 delete [] ov.rend[y];
3752 } 3842 }
3753 3843
3754 delete [] ov_text; ov_text = 0; 3844 delete [] ov.text; ov.text = 0;
3755 delete [] ov_rend; ov_rend = 0; 3845 delete [] ov.rend; ov.rend = 0;
3756} 3846}
3757 3847
3758void 3848void
3759rxvt_term::scr_overlay_set (int x, int y, text_t text, rend_t rend) NOTHROW 3849rxvt_term::scr_overlay_set (int x, int y, text_t text, rend_t rend) NOTHROW
3760{ 3850{
3761 if (!ov_text || x >= ov_w - 2 || y >= ov_h - 2) 3851 if (!ov.text || x >= ov.w - 2 || y >= ov.h - 2)
3762 return; 3852 return;
3763 3853
3764 x++, y++; 3854 x++, y++;
3765 3855
3766 ov_text[y][x] = text; 3856 ov.text[y][x] = text;
3767 ov_rend[y][x] = rend; 3857 ov.rend[y][x] = rend;
3768} 3858}
3769 3859
3770void 3860void
3771rxvt_term::scr_overlay_set (int x, int y, const char *s) NOTHROW 3861rxvt_term::scr_overlay_set (int x, int y, const char *s) NOTHROW
3772{ 3862{
3791} 3881}
3792 3882
3793void 3883void
3794rxvt_term::scr_swap_overlay () NOTHROW 3884rxvt_term::scr_swap_overlay () NOTHROW
3795{ 3885{
3796 if (!ov_text) 3886 if (!ov.text)
3797 return; 3887 return;
3798 3888
3889 // hide cursor if it is within the overlay area
3890 if (IN_RANGE_EXC (screen.cur.col - ov.x, 0, ov.w)
3891 && IN_RANGE_EXC (screen.cur.row - ov.y, 0, ov.h))
3892 screen.flags &= ~Screen_VisibleCursor;
3893
3799 // swap screen mem with overlay 3894 // swap screen mem with overlay
3800 for (int y = ov_h; y--; ) 3895 for (int y = ov.h; y--; )
3801 { 3896 {
3802 text_t *t1 = ov_text[y]; 3897 text_t *t1 = ov.text[y];
3803 rend_t *r1 = ov_rend[y]; 3898 rend_t *r1 = ov.rend[y];
3804 3899
3805 text_t *t2 = ROW(y + ov_y + view_start).t + ov_x; 3900 text_t *t2 = ROW(y + ov.y + view_start).t + ov.x;
3806 rend_t *r2 = ROW(y + ov_y + view_start).r + ov_x; 3901 rend_t *r2 = ROW(y + ov.y + view_start).r + ov.x;
3807 3902
3808 for (int x = ov_w; x--; ) 3903 for (int x = ov.w; x--; )
3809 { 3904 {
3810 text_t t = *t1; *t1++ = *t2; *t2++ = t; 3905 text_t t = *t1; *t1++ = *t2; *t2++ = t;
3811 rend_t r = *r1; *r1++ = *r2; *r2++ = SET_FONT (r, FONTSET (r)->find_font (t)); 3906 rend_t r = *r1; *r1++ = *r2; *r2++ = SET_FONT (r, FONTSET (r)->find_font (t));
3812 } 3907 }
3813 } 3908 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines