… | |
… | |
107 | |
107 | |
108 | ///////////////////////////////////////////////////////////////////////////// |
108 | ///////////////////////////////////////////////////////////////////////////// |
109 | |
109 | |
110 | #define SvOVERLAY(sv) (overlay *)SvPTR (sv, "urxvt::overlay") |
110 | #define SvOVERLAY(sv) (overlay *)SvPTR (sv, "urxvt::overlay") |
111 | |
111 | |
112 | class overlay { |
112 | class overlay : overlay_base |
|
|
113 | { |
113 | rxvt_term *THIS; |
114 | rxvt_term *THIS; |
114 | AV *overlay_av; |
115 | AV *overlay_av; |
115 | int x, y, w, h; |
|
|
116 | int border; |
116 | int border; |
117 | text_t **text; |
|
|
118 | rend_t **rend; |
|
|
119 | |
117 | |
120 | public: |
118 | public: |
121 | HV *self; |
119 | HV *self; |
122 | |
120 | |
123 | overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border); |
121 | overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border); |
… | |
… | |
130 | |
128 | |
131 | void set (int x, int y, SV *str, SV *rend); |
129 | void set (int x, int y, SV *str, SV *rend); |
132 | }; |
130 | }; |
133 | |
131 | |
134 | overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) |
132 | overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) |
135 | : THIS(THIS), x(x_), y(y_), w(w_), h(h_), border(border == 2), overlay_av (0) |
133 | : THIS(THIS), border(border == 2), overlay_av (0) |
136 | { |
134 | { |
|
|
135 | x = x_; |
|
|
136 | y = y_; |
|
|
137 | w = w_; |
|
|
138 | h = h_; |
|
|
139 | |
137 | if (w < 0) w = 0; |
140 | if (w < 0) w = 0; |
138 | if (h < 0) h = 0; |
141 | if (h < 0) h = 0; |
139 | |
142 | |
140 | if (border == 2) |
143 | if (border == 2) |
141 | { |
144 | { |
… | |
… | |
244 | int ov_x = max (0, min (MOD (x, THIS->ncol), THIS->ncol - w)); |
247 | int ov_x = max (0, min (MOD (x, THIS->ncol), THIS->ncol - w)); |
245 | int ov_y = max (0, min (MOD (y, THIS->nrow), THIS->nrow - h)); |
248 | int ov_y = max (0, min (MOD (y, THIS->nrow), THIS->nrow - h)); |
246 | |
249 | |
247 | int ov_w = min (w, THIS->ncol - ov_x); |
250 | int ov_w = min (w, THIS->ncol - ov_x); |
248 | int ov_h = min (h, THIS->nrow - ov_y); |
251 | int ov_h = min (h, THIS->nrow - ov_y); |
|
|
252 | |
|
|
253 | // hide cursor if it is within the overlay area |
|
|
254 | if (IN_RANGE_EXC (THIS->screen.cur.col - ov_x, 0, ov_w) |
|
|
255 | && IN_RANGE_EXC (THIS->screen.cur.row - ov_y, 0, ov_h)) |
|
|
256 | THIS->screen.flags &= ~Screen_VisibleCursor; |
249 | |
257 | |
250 | for (int y = ov_h; y--; ) |
258 | for (int y = ov_h; y--; ) |
251 | { |
259 | { |
252 | text_t *t1 = text [y]; |
260 | text_t *t1 = text [y]; |
253 | rend_t *r1 = rend [y]; |
261 | rend_t *r1 = rend [y]; |