… | |
… | |
83 | #define ROWCOL_IN_ROW_AT_OR_AFTER(X, Y) \ |
83 | #define ROWCOL_IN_ROW_AT_OR_AFTER(X, Y) \ |
84 | 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) |
85 | #define ROWCOL_IN_ROW_AT_OR_BEFORE(X, Y) \ |
85 | #define ROWCOL_IN_ROW_AT_OR_BEFORE(X, Y) \ |
86 | 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) |
87 | |
87 | |
88 | #define LINENO(n) (((n) + term_start + total_rows) % total_rows) |
|
|
89 | #define ROW(n) (save [LINENO (n)]) |
|
|
90 | |
|
|
91 | /* |
88 | /* |
92 | * CLEAR_ROWS : clear <num> rows starting from row <row> |
89 | * CLEAR_ROWS : clear <num> rows starting from row <row> |
93 | * CLEAR_CHARS: clear <num> chars starting from pixel position <x,y> |
90 | * CLEAR_CHARS: clear <num> chars starting from pixel position <x,y> |
94 | * ERASE_ROWS : set <num> rows starting from row <row> to the foreground colour |
91 | * ERASE_ROWS : set <num> rows starting from row <row> to the foreground colour |
95 | */ |
92 | */ |
… | |
… | |
639 | return 0; |
636 | return 0; |
640 | |
637 | |
641 | want_refresh = 1; |
638 | want_refresh = 1; |
642 | num_scr += count; |
639 | num_scr += count; |
643 | |
640 | |
644 | if (row1 == 0 && count > 0 |
641 | if (count > 0 |
|
|
642 | && row1 == 0 |
|
|
643 | && row2 == nrow - 1 |
645 | && (current_screen == PRIMARY || options & Opt_secondaryScroll)) |
644 | && (current_screen == PRIMARY || options & Opt_secondaryScroll)) |
646 | { |
645 | { |
647 | nsaved = min (nsaved + count, saveLines); |
646 | nsaved = min (nsaved + count, saveLines); |
648 | term_start = (term_start + count) % total_rows; |
647 | term_start = (term_start + count) % total_rows; |
649 | |
648 | |
… | |
… | |
1959 | { |
1958 | { |
1960 | unsigned char must_clear, /* use draw_string not draw_image_string */ |
1959 | unsigned char must_clear, /* use draw_string not draw_image_string */ |
1961 | showcursor; /* show the cursor */ |
1960 | showcursor; /* show the cursor */ |
1962 | int16_t col, row, /* column/row we're processing */ |
1961 | int16_t col, row, /* column/row we're processing */ |
1963 | ocrow; /* old cursor row */ |
1962 | ocrow; /* old cursor row */ |
1964 | int i, /* tmp */ |
1963 | int i; /* tmp */ |
1965 | row_offset; /* basic offset in screen structure */ |
|
|
1966 | #ifndef NO_CURSORCOLOR |
1964 | #ifndef NO_CURSORCOLOR |
1967 | rend_t cc1; /* store colours at cursor position (s) */ |
1965 | rend_t cc1; /* store colours at cursor position (s) */ |
1968 | #endif |
1966 | #endif |
1969 | rend_t *crp; // cursor rendition pointer |
1967 | rend_t *crp; // cursor rendition pointer |
1970 | |
1968 | |
… | |
… | |
1976 | /* |
1974 | /* |
1977 | * A: set up vars |
1975 | * A: set up vars |
1978 | */ |
1976 | */ |
1979 | must_clear = 0; |
1977 | must_clear = 0; |
1980 | refresh_count = 0; |
1978 | refresh_count = 0; |
1981 | |
|
|
1982 | row_offset = term_start - view_start; |
|
|
1983 | |
1979 | |
1984 | #if XPM_BACKGROUND |
1980 | #if XPM_BACKGROUND |
1985 | must_clear |= bgPixmap.pixmap != None; |
1981 | must_clear |= bgPixmap.pixmap != None; |
1986 | #endif |
1982 | #endif |
1987 | #if TRANSPARENT |
1983 | #if TRANSPARENT |
… | |
… | |
2105 | row = i > 0 ? 0 : j - 1; |
2101 | row = i > 0 ? 0 : j - 1; |
2106 | for (; j-- >= 0; row += (i > 0 ? 1 : -1)) |
2102 | for (; j-- >= 0; row += (i > 0 ? 1 : -1)) |
2107 | { |
2103 | { |
2108 | if (row + i >= 0 && row + i < nrow && row + i != ocrow) |
2104 | if (row + i >= 0 && row + i < nrow && row + i != ocrow) |
2109 | { |
2105 | { |
2110 | line_t s = save[(row + row_offset) % total_rows]; |
2106 | line_t s = ROW(row - view_start); |
2111 | line_t d = drawn[row]; |
2107 | line_t d = drawn[row]; |
2112 | line_t d2 = drawn[row + i]; |
2108 | line_t d2 = drawn[row + i]; |
2113 | |
2109 | |
2114 | for (nits = 0, col = ncol; col--; ) |
2110 | for (nits = 0, col = ncol; col--; ) |
2115 | if (s.t[col] != d2.t[col] || s.r[col] != d2.r[col]) |
2111 | if (s.t[col] != d2.t[col] || s.r[col] != d2.r[col]) |
… | |
… | |
2153 | /* |
2149 | /* |
2154 | * E: main pass across every character |
2150 | * E: main pass across every character |
2155 | */ |
2151 | */ |
2156 | for (row = 0; row < nrow; row++) |
2152 | for (row = 0; row < nrow; row++) |
2157 | { |
2153 | { |
2158 | text_t *stp = save[(row + row_offset) % total_rows].t; |
2154 | text_t *stp = ROW(row - view_start).t; |
2159 | rend_t *srp = save[(row + row_offset) % total_rows].r; |
2155 | rend_t *srp = ROW(row - view_start).r; |
2160 | text_t *dtp = drawn[row].t; |
2156 | text_t *dtp = drawn[row].t; |
2161 | rend_t *drp = drawn[row].r; |
2157 | rend_t *drp = drawn[row].r; |
2162 | |
2158 | |
2163 | /* |
2159 | /* |
2164 | * E2: OK, now the real pass |
2160 | * E2: OK, now the real pass |
… | |
… | |
3145 | * flag == 2 ==> button 3 motion |
3141 | * flag == 2 ==> button 3 motion |
3146 | */ |
3142 | */ |
3147 | void |
3143 | void |
3148 | rxvt_term::selection_extend (int x, int y, int flag) |
3144 | rxvt_term::selection_extend (int x, int y, int flag) |
3149 | { |
3145 | { |
3150 | int col = min (max (Pixel2Col (x), 0), nrow - 1); |
3146 | int col = min (max (Pixel2Col (x), 0), ncol); |
3151 | int row = min (max (Pixel2Row (y), 0), ncol); |
3147 | int row = min (max (Pixel2Row (y), 0), nrow - 1); |
3152 | |
3148 | |
3153 | /* |
3149 | /* |
3154 | * If we're selecting characters (single click) then we must check first |
3150 | * If we're selecting characters (single click) then we must check first |
3155 | * if we are at the same place as the original mark. If we are then |
3151 | * if we are at the same place as the original mark. If we are then |
3156 | * select nothing. Otherwise, if we're to the right of the mark, you have to |
3152 | * select nothing. Otherwise, if we're to the right of the mark, you have to |