… | |
… | |
82 | ROW_AND_COL_IN_ROW_BEFORE ((X).row, (X).col, (Y).row, (Y).col) |
82 | ROW_AND_COL_IN_ROW_BEFORE ((X).row, (X).col, (Y).row, (Y).col) |
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 | |
|
|
88 | #define LINENO(n) (((n) + term_start + total_rows) % total_rows) |
|
|
89 | #define ROW(n) (save [LINENO (n)]) |
|
|
90 | |
87 | |
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 |
… | |
… | |
1961 | { |
1958 | { |
1962 | unsigned char must_clear, /* use draw_string not draw_image_string */ |
1959 | unsigned char must_clear, /* use draw_string not draw_image_string */ |
1963 | showcursor; /* show the cursor */ |
1960 | showcursor; /* show the cursor */ |
1964 | int16_t col, row, /* column/row we're processing */ |
1961 | int16_t col, row, /* column/row we're processing */ |
1965 | ocrow; /* old cursor row */ |
1962 | ocrow; /* old cursor row */ |
1966 | int i, /* tmp */ |
1963 | int i; /* tmp */ |
1967 | row_offset; /* basic offset in screen structure */ |
|
|
1968 | #ifndef NO_CURSORCOLOR |
1964 | #ifndef NO_CURSORCOLOR |
1969 | rend_t cc1; /* store colours at cursor position (s) */ |
1965 | rend_t cc1; /* store colours at cursor position (s) */ |
1970 | #endif |
1966 | #endif |
1971 | rend_t *crp; // cursor rendition pointer |
1967 | rend_t *crp; // cursor rendition pointer |
1972 | |
1968 | |
… | |
… | |
1978 | /* |
1974 | /* |
1979 | * A: set up vars |
1975 | * A: set up vars |
1980 | */ |
1976 | */ |
1981 | must_clear = 0; |
1977 | must_clear = 0; |
1982 | refresh_count = 0; |
1978 | refresh_count = 0; |
1983 | |
|
|
1984 | row_offset = term_start - view_start; |
|
|
1985 | |
1979 | |
1986 | #if XPM_BACKGROUND |
1980 | #if XPM_BACKGROUND |
1987 | must_clear |= bgPixmap.pixmap != None; |
1981 | must_clear |= bgPixmap.pixmap != None; |
1988 | #endif |
1982 | #endif |
1989 | #if TRANSPARENT |
1983 | #if TRANSPARENT |
… | |
… | |
2107 | row = i > 0 ? 0 : j - 1; |
2101 | row = i > 0 ? 0 : j - 1; |
2108 | for (; j-- >= 0; row += (i > 0 ? 1 : -1)) |
2102 | for (; j-- >= 0; row += (i > 0 ? 1 : -1)) |
2109 | { |
2103 | { |
2110 | if (row + i >= 0 && row + i < nrow && row + i != ocrow) |
2104 | if (row + i >= 0 && row + i < nrow && row + i != ocrow) |
2111 | { |
2105 | { |
2112 | line_t s = save[(row + row_offset) % total_rows]; |
2106 | line_t s = ROW(row - view_start); |
2113 | line_t d = drawn[row]; |
2107 | line_t d = drawn[row]; |
2114 | line_t d2 = drawn[row + i]; |
2108 | line_t d2 = drawn[row + i]; |
2115 | |
2109 | |
2116 | for (nits = 0, col = ncol; col--; ) |
2110 | for (nits = 0, col = ncol; col--; ) |
2117 | 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]) |
… | |
… | |
2155 | /* |
2149 | /* |
2156 | * E: main pass across every character |
2150 | * E: main pass across every character |
2157 | */ |
2151 | */ |
2158 | for (row = 0; row < nrow; row++) |
2152 | for (row = 0; row < nrow; row++) |
2159 | { |
2153 | { |
2160 | text_t *stp = save[(row + row_offset) % total_rows].t; |
2154 | text_t *stp = ROW(row - view_start).t; |
2161 | rend_t *srp = save[(row + row_offset) % total_rows].r; |
2155 | rend_t *srp = ROW(row - view_start).r; |
2162 | text_t *dtp = drawn[row].t; |
2156 | text_t *dtp = drawn[row].t; |
2163 | rend_t *drp = drawn[row].r; |
2157 | rend_t *drp = drawn[row].r; |
2164 | |
2158 | |
2165 | /* |
2159 | /* |
2166 | * E2: OK, now the real pass |
2160 | * E2: OK, now the real pass |
… | |
… | |
3147 | * flag == 2 ==> button 3 motion |
3141 | * flag == 2 ==> button 3 motion |
3148 | */ |
3142 | */ |
3149 | void |
3143 | void |
3150 | rxvt_term::selection_extend (int x, int y, int flag) |
3144 | rxvt_term::selection_extend (int x, int y, int flag) |
3151 | { |
3145 | { |
3152 | int col = min (max (Pixel2Col (x), 0), nrow - 1); |
3146 | int col = min (max (Pixel2Col (x), 0), ncol); |
3153 | int row = min (max (Pixel2Row (y), 0), ncol); |
3147 | int row = min (max (Pixel2Row (y), 0), nrow - 1); |
3154 | |
3148 | |
3155 | /* |
3149 | /* |
3156 | * 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 |
3157 | * 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 |
3158 | * 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 |