… | |
… | |
282 | } |
282 | } |
283 | } |
283 | } |
284 | |
284 | |
285 | } |
285 | } |
286 | |
286 | |
287 | void overlay::set (int x, int y, SV *str, SV *rend) |
287 | void overlay::set (int x, int y, SV *text, SV *rend) |
288 | { |
288 | { |
289 | x += border; |
289 | x += border; |
290 | y += border; |
290 | y += border; |
291 | |
291 | |
292 | if (!IN_RANGE_EXC (y, 0, h - border)) |
292 | if (!IN_RANGE_EXC (y, 0, h - border)) |
293 | return; |
293 | return; |
294 | |
294 | |
295 | wchar_t *wstr = sv2wcs (str); |
295 | wchar_t *wtext = sv2wcs (text); |
296 | |
296 | |
297 | for (int col = min (wcslen (wstr), w - x - border); col--; ) |
297 | for (int col = min (wcslen (wtext), w - x - border); col--; ) |
298 | text [y][x + col] = wstr [col]; |
298 | this->text [y][x + col] = wtext [col]; |
299 | |
299 | |
300 | free (wstr); |
300 | free (wtext); |
|
|
301 | |
|
|
302 | if (rend) |
|
|
303 | { |
|
|
304 | if (!SvROK (rend) || SvTYPE (SvRV (rend)) != SVt_PVAV) |
|
|
305 | croak ("rend must be arrayref"); |
|
|
306 | |
|
|
307 | AV *av = (AV *)SvRV (rend); |
|
|
308 | |
|
|
309 | for (int col = min (av_len (av) + 1, w - x - border); col--; ) |
|
|
310 | this->rend [y][x + col] = SvIV (*av_fetch (av, col, 1)); |
|
|
311 | } |
301 | |
312 | |
302 | THIS->want_refresh = 1; |
313 | THIS->want_refresh = 1; |
303 | } |
314 | } |
304 | |
315 | |
305 | |
316 | |
… | |
… | |
461 | set_hookname (DESTROY); |
472 | set_hookname (DESTROY); |
462 | set_hookname (SEL_BEGIN); |
473 | set_hookname (SEL_BEGIN); |
463 | set_hookname (SEL_EXTEND); |
474 | set_hookname (SEL_EXTEND); |
464 | set_hookname (SEL_MAKE); |
475 | set_hookname (SEL_MAKE); |
465 | set_hookname (SEL_GRAB); |
476 | set_hookname (SEL_GRAB); |
|
|
477 | set_hookname (SEL_CLICK); |
466 | set_hookname (FOCUS_IN); |
478 | set_hookname (FOCUS_IN); |
467 | set_hookname (FOCUS_OUT); |
479 | set_hookname (FOCUS_OUT); |
468 | set_hookname (VIEW_CHANGE); |
480 | set_hookname (VIEW_CHANGE); |
469 | set_hookname (SCROLL_BACK); |
481 | set_hookname (SCROLL_BACK); |
470 | set_hookname (TTY_ACTIVITY); |
482 | set_hookname (TTY_ACTIVITY); |
471 | set_hookname (REFRESH_BEGIN); |
483 | set_hookname (REFRESH_BEGIN); |
472 | set_hookname (REFRESH_END); |
484 | set_hookname (REFRESH_END); |
473 | set_hookname (KEYBOARD_COMMAND); |
485 | set_hookname (KEYBOARD_COMMAND); |
|
|
486 | set_hookname (MOUSE_CLICK); |
|
|
487 | set_hookname (MOUSE_MOVE); |
474 | |
488 | |
475 | export_const (DEFAULT_RSTYLE); |
489 | export_const (DEFAULT_RSTYLE); |
476 | export_const (OVERLAY_RSTYLE); |
490 | export_const (OVERLAY_RSTYLE); |
477 | export_const (RS_Bold); |
491 | export_const (RS_Bold); |
478 | export_const (RS_Italic); |
492 | export_const (RS_Italic); |
… | |
… | |
831 | THIS->want_refresh = 1; |
845 | THIS->want_refresh = 1; |
832 | } |
846 | } |
833 | } |
847 | } |
834 | |
848 | |
835 | int |
849 | int |
836 | rxvt_term::selection_grab (int eventtime) |
850 | rxvt_term::selection_grab (int eventtime = CurrentTime) |
837 | |
851 | |
838 | void |
852 | void |
839 | rxvt_term::selection (SV *newtext = 0) |
853 | rxvt_term::selection (SV *newtext = 0) |
840 | PPCODE: |
854 | PPCODE: |
841 | { |
855 | { |