… | |
… | |
61 | //TODO: use magic |
61 | //TODO: use magic |
62 | static SV * |
62 | static SV * |
63 | newSVptr (void *ptr, const char *klass) |
63 | newSVptr (void *ptr, const char *klass) |
64 | { |
64 | { |
65 | HV *hv = newHV (); |
65 | HV *hv = newHV (); |
66 | hv_store (hv, "_ptr", 4, newSViv ((long)ptr), 0); |
66 | sv_magic ((SV *)hv, 0, PERL_MAGIC_ext, (char *)ptr, 0); |
67 | return sv_bless (newRV_noinc ((SV *)hv), gv_stashpv (klass, 1)); |
67 | return sv_bless (newRV_noinc ((SV *)hv), gv_stashpv (klass, 1)); |
|
|
68 | } |
|
|
69 | |
|
|
70 | static void |
|
|
71 | clearSVptr (SV *sv) |
|
|
72 | { |
|
|
73 | if (SvROK (sv)) |
|
|
74 | sv = SvRV (sv); |
|
|
75 | |
|
|
76 | hv_clear ((HV *)sv); |
|
|
77 | sv_unmagic (sv, PERL_MAGIC_ext); |
68 | } |
78 | } |
69 | |
79 | |
70 | static long |
80 | static long |
71 | SvPTR (SV *sv, const char *klass) |
81 | SvPTR (SV *sv, const char *klass) |
72 | { |
82 | { |
73 | if (!sv_derived_from (sv, klass)) |
83 | if (!sv_derived_from (sv, klass)) |
74 | croak ("object of type %s expected", klass); |
84 | croak ("object of type %s expected", klass); |
75 | |
85 | |
76 | IV iv = SvIV (*hv_fetch ((HV *)SvRV (sv), "_ptr", 4, 1)); |
86 | MAGIC *mg = mg_find (SvRV (sv), PERL_MAGIC_ext); |
77 | |
87 | |
78 | if (!iv) |
88 | if (!mg) |
79 | croak ("perl code used %s object, but C++ object is already destroyed, caught", klass); |
89 | croak ("perl code used %s object, but C++ object is already destroyed, caught", klass); |
80 | |
90 | |
81 | return (long)iv; |
91 | return (long)mg->mg_ptr; |
82 | } |
92 | } |
83 | |
93 | |
84 | #define newSVterm(term) SvREFCNT_inc ((SV *)term->self) |
94 | #define newSVterm(term) SvREFCNT_inc ((SV *)term->self) |
85 | #define SvTERM(sv) (rxvt_term *)SvPTR (sv, "urxvt::term") |
95 | #define SvTERM(sv) (rxvt_term *)SvPTR (sv, "urxvt::term") |
86 | |
96 | |
… | |
… | |
139 | #define newSVtimer(timer) new_ref (timer->self, "urxvt::timer") |
149 | #define newSVtimer(timer) new_ref (timer->self, "urxvt::timer") |
140 | #define SvTIMER(sv) (timer *)SvPTR (sv, "urxvt::timer") |
150 | #define SvTIMER(sv) (timer *)SvPTR (sv, "urxvt::timer") |
141 | |
151 | |
142 | struct timer : time_watcher, perl_watcher |
152 | struct timer : time_watcher, perl_watcher |
143 | { |
153 | { |
|
|
154 | tstamp interval; |
|
|
155 | |
144 | timer () |
156 | timer () |
145 | : time_watcher (this, &timer::execute) |
157 | : time_watcher (this, &timer::execute) |
146 | { |
158 | { |
147 | } |
159 | } |
148 | |
160 | |
149 | void execute (time_watcher &w) |
161 | void execute (time_watcher &w) |
150 | { |
162 | { |
|
|
163 | if (interval) |
|
|
164 | start (at + interval); |
|
|
165 | |
151 | invoke ("urxvt::timer", newSVtimer (this)); |
166 | invoke ("urxvt::timer", newSVtimer (this)); |
152 | } |
167 | } |
153 | }; |
168 | }; |
154 | |
169 | |
155 | #define newSViow(iow) new_ref (iow->self, "urxvt::iow") |
170 | #define newSViow(iow) new_ref (iow->self, "urxvt::iow") |
… | |
… | |
165 | void execute (io_watcher &w, short revents) |
180 | void execute (io_watcher &w, short revents) |
166 | { |
181 | { |
167 | invoke ("urxvt::iow", newSViow (this), revents); |
182 | invoke ("urxvt::iow", newSViow (this), revents); |
168 | } |
183 | } |
169 | }; |
184 | }; |
|
|
185 | |
|
|
186 | ///////////////////////////////////////////////////////////////////////////// |
|
|
187 | |
|
|
188 | #define SvOVERLAY(sv) (overlay *)SvPTR (sv, "urxvt::overlay") |
|
|
189 | |
|
|
190 | struct overlay { |
|
|
191 | HV *self; |
|
|
192 | rxvt_term *THIS; |
|
|
193 | int x, y, w, h; |
|
|
194 | int border; |
|
|
195 | text_t **text; |
|
|
196 | rend_t **rend; |
|
|
197 | |
|
|
198 | overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border); |
|
|
199 | ~overlay (); |
|
|
200 | |
|
|
201 | void show (); |
|
|
202 | void hide (); |
|
|
203 | |
|
|
204 | void swap (); |
|
|
205 | |
|
|
206 | void set (int x, int y, SV *str, SV *rend); |
|
|
207 | }; |
|
|
208 | |
|
|
209 | overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) |
|
|
210 | : THIS(THIS), x(x_), y(y_), w(w_), h(h_), border(border == 2) |
|
|
211 | { |
|
|
212 | if (border == 2) |
|
|
213 | { |
|
|
214 | w += 2; |
|
|
215 | h += 2; |
|
|
216 | } |
|
|
217 | |
|
|
218 | text = new text_t *[h]; |
|
|
219 | rend = new rend_t *[h]; |
|
|
220 | |
|
|
221 | for (int y = 0; y < h; y++) |
|
|
222 | { |
|
|
223 | text_t *tp = text[y] = new text_t[w]; |
|
|
224 | rend_t *rp = rend[y] = new rend_t[w]; |
|
|
225 | |
|
|
226 | text_t t0, t1, t2; |
|
|
227 | rend_t r = rstyle; |
|
|
228 | |
|
|
229 | if (border == 2) |
|
|
230 | { |
|
|
231 | if (y == 0) |
|
|
232 | t0 = 0x2554, t1 = 0x2550, t2 = 0x2557; |
|
|
233 | else if (y < h - 1) |
|
|
234 | t0 = 0x2551, t1 = 0x0020, t2 = 0x2551; |
|
|
235 | else |
|
|
236 | t0 = 0x255a, t1 = 0x2550, t2 = 0x255d; |
|
|
237 | |
|
|
238 | *tp++ = t0; |
|
|
239 | *rp++ = r; |
|
|
240 | |
|
|
241 | for (int x = w - 2; x-- > 0; ) |
|
|
242 | { |
|
|
243 | *tp++ = t1; |
|
|
244 | *rp++ = r; |
|
|
245 | } |
|
|
246 | |
|
|
247 | *tp = t2; |
|
|
248 | *rp = r; |
|
|
249 | } |
|
|
250 | else |
|
|
251 | for (int x = w; x-- > 0; ) |
|
|
252 | { |
|
|
253 | *tp++ = 0x0020; |
|
|
254 | *rp++ = r; |
|
|
255 | } |
|
|
256 | } |
|
|
257 | |
|
|
258 | show (); |
|
|
259 | THIS->want_refresh = 1; |
|
|
260 | } |
|
|
261 | |
|
|
262 | overlay::~overlay () |
|
|
263 | { |
|
|
264 | hide (); |
|
|
265 | |
|
|
266 | for (int y = h; y--; ) |
|
|
267 | { |
|
|
268 | delete [] text[y]; |
|
|
269 | delete [] rend[y]; |
|
|
270 | } |
|
|
271 | |
|
|
272 | delete [] text; |
|
|
273 | delete [] rend; |
|
|
274 | |
|
|
275 | THIS->want_refresh = 1; |
|
|
276 | } |
|
|
277 | |
|
|
278 | void |
|
|
279 | overlay::show () |
|
|
280 | { |
|
|
281 | char key[33]; sprintf (key, "%32lx", (long)this); |
|
|
282 | |
|
|
283 | HV *hv = (HV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)THIS->self), "_overlay", 8, 0)); |
|
|
284 | hv_store (hv, key, 32, newSViv ((long)this), 0); |
|
|
285 | } |
|
|
286 | |
|
|
287 | void |
|
|
288 | overlay::hide () |
|
|
289 | { |
|
|
290 | SV **ovs = hv_fetch ((HV *)SvRV ((SV *)THIS->self), "_overlay", 8, 0); |
|
|
291 | |
|
|
292 | if (ovs) |
|
|
293 | { |
|
|
294 | char key[33]; sprintf (key, "%32lx", (long)this); |
|
|
295 | |
|
|
296 | HV *hv = (HV *)SvRV (*ovs); |
|
|
297 | hv_delete (hv, key, 32, G_DISCARD); |
|
|
298 | } |
|
|
299 | } |
|
|
300 | |
|
|
301 | void overlay::swap () |
|
|
302 | { |
|
|
303 | int ov_x = max (0, min (MOD (x, THIS->ncol), THIS->ncol - w)); |
|
|
304 | int ov_y = max (0, min (MOD (y, THIS->nrow), THIS->nrow - h)); |
|
|
305 | |
|
|
306 | int ov_w = min (w, THIS->ncol - ov_x); |
|
|
307 | int ov_h = min (h, THIS->nrow - ov_y); |
|
|
308 | |
|
|
309 | for (int y = ov_h; y--; ) |
|
|
310 | { |
|
|
311 | text_t *t1 = text [y]; |
|
|
312 | rend_t *r1 = rend [y]; |
|
|
313 | |
|
|
314 | text_t *t2 = ROW(y + ov_y - THIS->view_start).t + ov_x; |
|
|
315 | rend_t *r2 = ROW(y + ov_y - THIS->view_start).r + ov_x; |
|
|
316 | |
|
|
317 | for (int x = ov_w; x--; ) |
|
|
318 | { |
|
|
319 | text_t t = *t1; *t1++ = *t2; *t2++ = t; |
|
|
320 | rend_t r = *r1; *r1++ = *r2; *r2++ = SET_FONT (r, THIS->fontset [GET_STYLE (r)]->find_font (t)); |
|
|
321 | } |
|
|
322 | } |
|
|
323 | |
|
|
324 | } |
|
|
325 | |
|
|
326 | void overlay::set (int x, int y, SV *text, SV *rend) |
|
|
327 | { |
|
|
328 | x += border; |
|
|
329 | y += border; |
|
|
330 | |
|
|
331 | if (!IN_RANGE_EXC (y, 0, h - border)) |
|
|
332 | return; |
|
|
333 | |
|
|
334 | wchar_t *wtext = sv2wcs (text); |
|
|
335 | |
|
|
336 | for (int col = min (wcslen (wtext), w - x - border); col--; ) |
|
|
337 | this->text [y][x + col] = wtext [col]; |
|
|
338 | |
|
|
339 | free (wtext); |
|
|
340 | |
|
|
341 | if (rend) |
|
|
342 | { |
|
|
343 | if (!SvROK (rend) || SvTYPE (SvRV (rend)) != SVt_PVAV) |
|
|
344 | croak ("rend must be arrayref"); |
|
|
345 | |
|
|
346 | AV *av = (AV *)SvRV (rend); |
|
|
347 | |
|
|
348 | for (int col = min (av_len (av) + 1, w - x - border); col--; ) |
|
|
349 | this->rend [y][x + col] = SvIV (*av_fetch (av, col, 1)); |
|
|
350 | } |
|
|
351 | |
|
|
352 | THIS->want_refresh = 1; |
|
|
353 | } |
|
|
354 | |
170 | |
355 | |
171 | ///////////////////////////////////////////////////////////////////////////// |
356 | ///////////////////////////////////////////////////////////////////////////// |
172 | |
357 | |
173 | struct rxvt_perl_interp rxvt_perl; |
358 | struct rxvt_perl_interp rxvt_perl; |
174 | |
359 | |
… | |
… | |
213 | } |
398 | } |
214 | |
399 | |
215 | bool |
400 | bool |
216 | rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) |
401 | rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) |
217 | { |
402 | { |
218 | if (!perl |
403 | if (!perl) |
219 | || (!should_invoke [htype] && htype != HOOK_INIT && htype != HOOK_DESTROY)) |
|
|
220 | return false; |
404 | return false; |
221 | |
405 | |
222 | if (htype == HOOK_INIT) // first hook ever called |
406 | if (htype == HOOK_INIT) // first hook ever called |
|
|
407 | { |
223 | term->self = (void *)newSVptr ((void *)term, "urxvt::term"); |
408 | term->self = (void *)newSVptr ((void *)term, "urxvt::term"); |
|
|
409 | hv_store ((HV *)SvRV ((SV *)term->self), "_overlay", 8, newRV_noinc ((SV *)newHV ()), 0); |
|
|
410 | } |
|
|
411 | else if (!term->self) |
|
|
412 | return false; // perl not initialized for this instance |
|
|
413 | else if (htype == HOOK_DESTROY) |
|
|
414 | { |
|
|
415 | // handled later |
|
|
416 | } |
|
|
417 | else if (htype == HOOK_REFRESH_BEGIN || htype == HOOK_REFRESH_END) |
|
|
418 | { |
|
|
419 | HV *hv = (HV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->self), "_overlay", 8, 0)); |
|
|
420 | |
|
|
421 | if (HvKEYS (hv)) |
|
|
422 | { |
|
|
423 | hv_iterinit (hv); |
|
|
424 | |
|
|
425 | while (HE *he = hv_iternext (hv)) |
|
|
426 | ((overlay *)SvIV (hv_iterval (hv, he)))->swap (); |
|
|
427 | } |
|
|
428 | } |
|
|
429 | else if (!should_invoke [htype]) |
|
|
430 | return false; |
224 | |
431 | |
225 | dSP; |
432 | dSP; |
226 | va_list ap; |
433 | va_list ap; |
227 | |
434 | |
228 | va_start (ap, htype); |
435 | va_start (ap, htype); |
… | |
… | |
273 | if (SvTRUE (ERRSV)) |
480 | if (SvTRUE (ERRSV)) |
274 | rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPV_nolen (ERRSV)); |
481 | rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPV_nolen (ERRSV)); |
275 | |
482 | |
276 | if (htype == HOOK_DESTROY) |
483 | if (htype == HOOK_DESTROY) |
277 | { |
484 | { |
278 | // TODO: clear magic |
|
|
279 | hv_clear ((HV *)SvRV ((SV *)term->self)); |
485 | clearSVptr ((SV *)term->self); |
280 | SvREFCNT_dec ((SV *)term->self); |
486 | SvREFCNT_dec ((SV *)term->self); |
281 | } |
487 | } |
282 | |
488 | |
283 | return count; |
489 | return count; |
284 | } |
490 | } |
… | |
… | |
296 | PROTOTYPES: ENABLE |
502 | PROTOTYPES: ENABLE |
297 | |
503 | |
298 | BOOT: |
504 | BOOT: |
299 | { |
505 | { |
300 | # define set_hookname(sym) av_store (hookname, PP_CONCAT(HOOK_, sym), newSVpv (PP_STRINGIFY(sym), 0)) |
506 | # define set_hookname(sym) av_store (hookname, PP_CONCAT(HOOK_, sym), newSVpv (PP_STRINGIFY(sym), 0)) |
|
|
507 | # define export_const(name) newCONSTSUB (gv_stashpv ("urxvt", 1), #name, newSViv (name)); |
301 | AV *hookname = get_av ("urxvt::HOOKNAME", 1); |
508 | AV *hookname = get_av ("urxvt::HOOKNAME", 1); |
302 | set_hookname (INIT); |
509 | set_hookname (INIT); |
303 | set_hookname (RESET); |
510 | set_hookname (RESET); |
304 | set_hookname (START); |
511 | set_hookname (START); |
305 | set_hookname (DESTROY); |
512 | set_hookname (DESTROY); |
… | |
… | |
310 | set_hookname (FOCUS_IN); |
517 | set_hookname (FOCUS_IN); |
311 | set_hookname (FOCUS_OUT); |
518 | set_hookname (FOCUS_OUT); |
312 | set_hookname (VIEW_CHANGE); |
519 | set_hookname (VIEW_CHANGE); |
313 | set_hookname (SCROLL_BACK); |
520 | set_hookname (SCROLL_BACK); |
314 | set_hookname (TTY_ACTIVITY); |
521 | set_hookname (TTY_ACTIVITY); |
|
|
522 | set_hookname (OSC_SEQ); |
315 | set_hookname (REFRESH_BEGIN); |
523 | set_hookname (REFRESH_BEGIN); |
316 | set_hookname (REFRESH_END); |
524 | set_hookname (REFRESH_END); |
317 | set_hookname (KEYBOARD_COMMAND); |
525 | set_hookname (KEYBOARD_COMMAND); |
318 | |
526 | |
319 | newCONSTSUB (gv_stashpv ("urxvt", 1), "DEFAULT_RSTYLE", newSViv (DEFAULT_RSTYLE)); |
527 | export_const (DEFAULT_RSTYLE); |
|
|
528 | export_const (OVERLAY_RSTYLE); |
|
|
529 | export_const (RS_Bold); |
|
|
530 | export_const (RS_Italic); |
|
|
531 | export_const (RS_Blink); |
|
|
532 | export_const (RS_RVid); |
|
|
533 | export_const (RS_Uline); |
320 | |
534 | |
321 | sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR); |
535 | sv_setpv (get_sv ("urxvt::LIBDIR", 1), LIBDIR); |
322 | } |
536 | } |
323 | |
537 | |
324 | void |
538 | void |
… | |
… | |
339 | NV |
553 | NV |
340 | NOW () |
554 | NOW () |
341 | CODE: |
555 | CODE: |
342 | RETVAL = NOW; |
556 | RETVAL = NOW; |
343 | OUTPUT: |
557 | OUTPUT: |
|
|
558 | RETVAL |
|
|
559 | |
|
|
560 | int |
|
|
561 | GET_BASEFG (int rend) |
|
|
562 | CODE: |
|
|
563 | RETVAL = GET_BASEFG (rend); |
|
|
564 | OUTPUT: |
|
|
565 | RETVAL |
|
|
566 | |
|
|
567 | int |
|
|
568 | GET_BASEBG (int rend) |
|
|
569 | CODE: |
|
|
570 | RETVAL = GET_BASEBG (rend); |
|
|
571 | OUTPUT: |
|
|
572 | RETVAL |
|
|
573 | |
|
|
574 | int |
|
|
575 | SET_FGCOLOR (int rend, int new_color) |
|
|
576 | CODE: |
|
|
577 | RETVAL = SET_FGCOLOR (rend, new_color); |
|
|
578 | OUTPUT: |
|
|
579 | RETVAL |
|
|
580 | |
|
|
581 | int |
|
|
582 | SET_BGCOLOR (int rend, int new_color) |
|
|
583 | CODE: |
|
|
584 | RETVAL = SET_BGCOLOR (rend, new_color); |
|
|
585 | OUTPUT: |
|
|
586 | RETVAL |
|
|
587 | |
|
|
588 | int |
|
|
589 | GET_CUSTOM (int rend) |
|
|
590 | CODE: |
|
|
591 | RETVAL = (rend && RS_customMask) >> RS_customShift; |
|
|
592 | OUTPUT: |
|
|
593 | RETVAL |
|
|
594 | |
|
|
595 | int |
|
|
596 | SET_CUSTOM (int rend, int new_value) |
|
|
597 | CODE: |
|
|
598 | { |
|
|
599 | if (!IN_RANGE_EXC (new_value, 0, RS_customCount)) |
|
|
600 | croak ("custom value out of range, must be 0..%d", RS_customCount - 1); |
|
|
601 | |
|
|
602 | RETVAL = (rend & ~RS_customMask) |
|
|
603 | | ((new_value << RS_customShift) & RS_customMask); |
|
|
604 | } |
|
|
605 | OUTPUT: |
344 | RETVAL |
606 | RETVAL |
345 | |
607 | |
346 | MODULE = urxvt PACKAGE = urxvt::term |
608 | MODULE = urxvt PACKAGE = urxvt::term |
347 | |
609 | |
348 | int |
610 | int |
… | |
… | |
443 | void |
705 | void |
444 | rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0) |
706 | rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0) |
445 | PPCODE: |
707 | PPCODE: |
446 | { |
708 | { |
447 | if (!IN_RANGE_EXC (row_number, -THIS->nsaved, THIS->nrow)) |
709 | if (!IN_RANGE_EXC (row_number, -THIS->nsaved, THIS->nrow)) |
448 | croak ("row_number number of out range"); |
710 | XSRETURN_EMPTY; |
449 | |
711 | |
450 | line_t &l = ROW(row_number); |
712 | line_t &l = ROW(row_number); |
451 | |
713 | |
452 | if (GIMME_V != G_VOID) |
714 | if (GIMME_V != G_VOID) |
453 | { |
715 | { |
… | |
… | |
465 | free (str); |
727 | free (str); |
466 | } |
728 | } |
467 | |
729 | |
468 | if (new_text) |
730 | if (new_text) |
469 | { |
731 | { |
470 | STRLEN slen; |
|
|
471 | char *str = SvPVutf8 (new_text, slen); |
732 | wchar_t *wstr = sv2wcs (new_text); |
472 | wchar_t *wstr = rxvt_utf8towcs (str, slen); |
|
|
473 | |
733 | |
474 | int len = wcslen (wstr); |
734 | int len = wcslen (wstr); |
475 | |
735 | |
476 | if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) |
736 | if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) |
477 | { |
737 | { |
… | |
… | |
492 | void |
752 | void |
493 | rxvt_term::ROW_r (int row_number, SV *new_rend = 0, int start_col = 0) |
753 | rxvt_term::ROW_r (int row_number, SV *new_rend = 0, int start_col = 0) |
494 | PPCODE: |
754 | PPCODE: |
495 | { |
755 | { |
496 | if (!IN_RANGE_EXC (row_number, -THIS->nsaved, THIS->nrow)) |
756 | if (!IN_RANGE_EXC (row_number, -THIS->nsaved, THIS->nrow)) |
497 | croak ("row_number number of out range"); |
757 | XSRETURN_EMPTY; |
498 | |
758 | |
499 | line_t &l = ROW(row_number); |
759 | line_t &l = ROW(row_number); |
500 | |
760 | |
501 | if (GIMME_V != G_VOID) |
761 | if (GIMME_V != G_VOID) |
502 | { |
762 | { |
… | |
… | |
532 | int |
792 | int |
533 | rxvt_term::ROW_l (int row_number, int new_length = -2) |
793 | rxvt_term::ROW_l (int row_number, int new_length = -2) |
534 | CODE: |
794 | CODE: |
535 | { |
795 | { |
536 | if (!IN_RANGE_EXC (row_number, -THIS->nsaved, THIS->nrow)) |
796 | if (!IN_RANGE_EXC (row_number, -THIS->nsaved, THIS->nrow)) |
537 | croak ("row_number number of out range"); |
797 | XSRETURN_EMPTY; |
538 | |
798 | |
539 | line_t &l = ROW(row_number); |
799 | line_t &l = ROW(row_number); |
540 | RETVAL = l.l; |
800 | RETVAL = l.l < 0 ? THIS->ncol : l.l; |
541 | |
801 | |
542 | if (new_length >= -1) |
802 | if (new_length >= -1) |
543 | l.l = new_length; |
803 | l.l = new_length; |
|
|
804 | } |
|
|
805 | OUTPUT: |
|
|
806 | RETVAL |
|
|
807 | |
|
|
808 | bool |
|
|
809 | rxvt_term::ROW_is_longer (int row_number) |
|
|
810 | CODE: |
|
|
811 | { |
|
|
812 | if (!IN_RANGE_EXC (row_number, -THIS->nsaved, THIS->nrow)) |
|
|
813 | XSRETURN_EMPTY; |
|
|
814 | |
|
|
815 | line_t &l = ROW(row_number); |
|
|
816 | RETVAL = l.l < 0; |
544 | } |
817 | } |
545 | OUTPUT: |
818 | OUTPUT: |
546 | RETVAL |
819 | RETVAL |
547 | |
820 | |
548 | SV * |
821 | SV * |
… | |
… | |
623 | THIS->want_refresh = 1; |
896 | THIS->want_refresh = 1; |
624 | } |
897 | } |
625 | } |
898 | } |
626 | |
899 | |
627 | int |
900 | int |
628 | rxvt_term::selection_grab (int eventtime) |
901 | rxvt_term::selection_grab (int eventtime = CurrentTime) |
629 | |
902 | |
630 | void |
903 | void |
631 | rxvt_term::selection (SV *newtext = 0) |
904 | rxvt_term::selection (SV *newtext = 0) |
632 | PPCODE: |
905 | PPCODE: |
633 | { |
906 | { |
… | |
… | |
648 | THIS->selection.len = wcslen (THIS->selection.text); |
921 | THIS->selection.len = wcslen (THIS->selection.text); |
649 | } |
922 | } |
650 | } |
923 | } |
651 | |
924 | |
652 | void |
925 | void |
653 | rxvt_term::scr_overlay_new (int x, int y, int w, int h) |
|
|
654 | |
|
|
655 | void |
|
|
656 | rxvt_term::scr_overlay_off () |
|
|
657 | |
|
|
658 | void |
|
|
659 | rxvt_term::scr_overlay_set_char (int x, int y, U32 text, U32 rend = OVERLAY_RSTYLE) |
|
|
660 | CODE: |
|
|
661 | THIS->scr_overlay_set (x, y, text, rend); |
|
|
662 | |
|
|
663 | void |
|
|
664 | rxvt_term::scr_overlay_set (int x, int y, SV *text) |
|
|
665 | CODE: |
|
|
666 | { |
|
|
667 | wchar_t *wtext = sv2wcs (text); |
|
|
668 | THIS->scr_overlay_set (x, y, wtext); |
|
|
669 | free (wtext); |
|
|
670 | } |
|
|
671 | |
|
|
672 | void |
|
|
673 | rxvt_term::tt_write (SV *octets) |
926 | rxvt_term::tt_write (SV *octets) |
674 | INIT: |
927 | INIT: |
675 | STRLEN len; |
928 | STRLEN len; |
676 | char *str = SvPVbyte (octets, len); |
929 | char *str = SvPVbyte (octets, len); |
677 | C_ARGS: |
930 | C_ARGS: |
678 | (unsigned char *)str, len |
931 | (unsigned char *)str, len |
679 | |
932 | |
|
|
933 | SV * |
|
|
934 | rxvt_term::overlay (int x, int y, int w, int h, int rstyle = OVERLAY_RSTYLE, int border = 2) |
|
|
935 | CODE: |
|
|
936 | { |
|
|
937 | overlay *o = new overlay (THIS, x, y, w, h, rstyle, border); |
|
|
938 | RETVAL = newSVptr ((void *)o, "urxvt::overlay"); |
|
|
939 | o->self = (HV *)SvRV (RETVAL); |
|
|
940 | } |
|
|
941 | OUTPUT: |
|
|
942 | RETVAL |
|
|
943 | |
|
|
944 | MODULE = urxvt PACKAGE = urxvt::overlay |
|
|
945 | |
|
|
946 | void |
|
|
947 | overlay::set (int x, int y, SV *text, SV *rend = 0) |
|
|
948 | |
|
|
949 | void |
|
|
950 | overlay::show () |
|
|
951 | |
|
|
952 | void |
|
|
953 | overlay::hide () |
|
|
954 | |
|
|
955 | void |
|
|
956 | overlay::DESTROY () |
|
|
957 | |
680 | MODULE = urxvt PACKAGE = urxvt::timer |
958 | MODULE = urxvt PACKAGE = urxvt::timer |
681 | |
959 | |
682 | SV * |
960 | SV * |
683 | timer::new () |
961 | timer::new () |
684 | CODE: |
962 | CODE: |
685 | timer *w = new timer; |
963 | timer *w = new timer; |
|
|
964 | w->start (NOW); |
686 | RETVAL = newSVptr ((void *)w, "urxvt::timer"); |
965 | RETVAL = newSVptr ((void *)w, "urxvt::timer"); |
687 | w->self = (HV *)SvRV (RETVAL); |
966 | w->self = (HV *)SvRV (RETVAL); |
688 | OUTPUT: |
967 | OUTPUT: |
689 | RETVAL |
968 | RETVAL |
690 | |
969 | |
… | |
… | |
698 | |
977 | |
699 | NV |
978 | NV |
700 | timer::at () |
979 | timer::at () |
701 | CODE: |
980 | CODE: |
702 | RETVAL = THIS->at; |
981 | RETVAL = THIS->at; |
|
|
982 | OUTPUT: |
|
|
983 | RETVAL |
|
|
984 | |
|
|
985 | timer * |
|
|
986 | timer::interval (NV interval) |
|
|
987 | CODE: |
|
|
988 | THIS->interval = interval; |
|
|
989 | RETVAL = THIS; |
703 | OUTPUT: |
990 | OUTPUT: |
704 | RETVAL |
991 | RETVAL |
705 | |
992 | |
706 | timer * |
993 | timer * |
707 | timer::set (NV tstamp) |
994 | timer::set (NV tstamp) |