1 | /*----------------------------------------------------------------------* |
1 | /*----------------------------------------------------------------------* |
2 | * File: rxvtperl.xs |
2 | * File: rxvtperl.xs |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * |
4 | * |
5 | * All portions of code are copyright by their respective author/s. |
5 | * All portions of code are copyright by their respective author/s. |
6 | * Copyright (c) 2005-2006 Marc Lehmann <pcg@goof.com> |
6 | * Copyright (c) 2005-2008 Marc Lehmann <pcg@goof.com> |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or |
10 | * the Free Software Foundation; either version 2 of the License, or |
11 | * (at your option) any later version. |
11 | * (at your option) any later version. |
… | |
… | |
31 | #include <cstddef> |
31 | #include <cstddef> |
32 | #include <cstdarg> |
32 | #include <cstdarg> |
33 | |
33 | |
34 | #include "unistd.h" |
34 | #include "unistd.h" |
35 | |
35 | |
36 | #include "iom.h" |
36 | #include "ev_cpp.h" |
37 | #include "rxvt.h" |
37 | #include "rxvt.h" |
38 | #include "keyboard.h" |
38 | #include "keyboard.h" |
39 | #include "rxvtutil.h" |
39 | #include "rxvtutil.h" |
40 | #include "rxvtperl.h" |
40 | #include "rxvtperl.h" |
41 | |
41 | |
42 | #include "perlxsi.c" |
42 | #include "perlxsi.c" |
43 | |
43 | |
44 | #ifdef HAVE_SCROLLBARS |
|
|
45 | # define GRAB_CURSOR THIS->leftptr_cursor |
44 | #define GRAB_CURSOR THIS->scrollBar.leftptr_cursor |
46 | #else |
|
|
47 | # define GRAB_CURSOR None |
|
|
48 | #endif |
|
|
49 | |
45 | |
50 | #undef LINENO |
46 | #undef LINENO |
51 | #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) |
47 | #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) |
52 | #undef ROW |
48 | #undef ROW |
53 | #define ROW(n) THIS->row_buf [LINENO (n)] |
49 | #define ROW(n) THIS->row_buf [LINENO (n)] |
… | |
… | |
111 | |
107 | |
112 | ///////////////////////////////////////////////////////////////////////////// |
108 | ///////////////////////////////////////////////////////////////////////////// |
113 | |
109 | |
114 | #define SvOVERLAY(sv) (overlay *)SvPTR (sv, "urxvt::overlay") |
110 | #define SvOVERLAY(sv) (overlay *)SvPTR (sv, "urxvt::overlay") |
115 | |
111 | |
116 | class overlay { |
112 | class overlay : overlay_base |
|
|
113 | { |
117 | rxvt_term *THIS; |
114 | rxvt_term *THIS; |
118 | AV *overlay_av; |
115 | AV *overlay_av; |
119 | int x, y, w, h; |
|
|
120 | int border; |
116 | int border; |
121 | text_t **text; |
|
|
122 | rend_t **rend; |
|
|
123 | |
117 | |
124 | public: |
118 | public: |
125 | HV *self; |
119 | HV *self; |
126 | |
120 | |
127 | 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); |
… | |
… | |
134 | |
128 | |
135 | void set (int x, int y, SV *str, SV *rend); |
129 | void set (int x, int y, SV *str, SV *rend); |
136 | }; |
130 | }; |
137 | |
131 | |
138 | 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) |
139 | : 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) |
140 | { |
134 | { |
|
|
135 | x = x_; |
|
|
136 | y = y_; |
|
|
137 | w = w_; |
|
|
138 | h = h_; |
|
|
139 | |
141 | if (w < 0) w = 0; |
140 | if (w < 0) w = 0; |
142 | if (h < 0) h = 0; |
141 | if (h < 0) h = 0; |
143 | |
142 | |
144 | if (border == 2) |
143 | if (border == 2) |
145 | { |
144 | { |
… | |
… | |
214 | *hv_fetch ((HV *)SvRV ((SV *)THIS->perl.self), "_overlay", 8, 0) |
213 | *hv_fetch ((HV *)SvRV ((SV *)THIS->perl.self), "_overlay", 8, 0) |
215 | )); |
214 | )); |
216 | av_push (overlay_av, newSViv ((long)this)); |
215 | av_push (overlay_av, newSViv ((long)this)); |
217 | |
216 | |
218 | THIS->want_refresh = 1; |
217 | THIS->want_refresh = 1; |
|
|
218 | THIS->refresh_check (); |
219 | } |
219 | } |
220 | |
220 | |
221 | void |
221 | void |
222 | overlay::hide () |
222 | overlay::hide () |
223 | { |
223 | { |
… | |
… | |
237 | |
237 | |
238 | SvREFCNT_dec (overlay_av); |
238 | SvREFCNT_dec (overlay_av); |
239 | overlay_av = 0; |
239 | overlay_av = 0; |
240 | |
240 | |
241 | THIS->want_refresh = 1; |
241 | THIS->want_refresh = 1; |
|
|
242 | THIS->refresh_check (); |
242 | } |
243 | } |
243 | |
244 | |
244 | void overlay::swap () |
245 | void overlay::swap () |
245 | { |
246 | { |
246 | 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)); |
247 | 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)); |
248 | |
249 | |
249 | int ov_w = min (w, THIS->ncol - ov_x); |
250 | int ov_w = min (w, THIS->ncol - ov_x); |
250 | 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; |
251 | |
257 | |
252 | for (int y = ov_h; y--; ) |
258 | for (int y = ov_h; y--; ) |
253 | { |
259 | { |
254 | text_t *t1 = text [y]; |
260 | text_t *t1 = text [y]; |
255 | rend_t *r1 = rend [y]; |
261 | rend_t *r1 = rend [y]; |
… | |
… | |
291 | for (int col = min (AvFILL (av) + 1, w - x - border); col--; ) |
297 | for (int col = min (AvFILL (av) + 1, w - x - border); col--; ) |
292 | this->rend [y][x + col] = SvIV (*av_fetch (av, col, 1)); |
298 | this->rend [y][x + col] = SvIV (*av_fetch (av, col, 1)); |
293 | } |
299 | } |
294 | |
300 | |
295 | THIS->want_refresh = 1; |
301 | THIS->want_refresh = 1; |
|
|
302 | THIS->refresh_check (); |
296 | } |
303 | } |
297 | |
304 | |
298 | ///////////////////////////////////////////////////////////////////////////// |
305 | ///////////////////////////////////////////////////////////////////////////// |
299 | |
306 | |
300 | #define IOM_CLASS "urxvt" |
307 | #define IOM_CLASS "urxvt" |
301 | #define IOM_WARN rxvt_warn |
308 | #define IOM_WARN rxvt_warn |
302 | #include <iom_perl.h> |
309 | #include "iom_perl.h" |
303 | |
310 | |
304 | ///////////////////////////////////////////////////////////////////////////// |
311 | ///////////////////////////////////////////////////////////////////////////// |
305 | |
312 | |
306 | struct rxvt_perl_interp rxvt_perl; |
313 | struct rxvt_perl_interp rxvt_perl; |
307 | |
314 | |
… | |
… | |
311 | { |
318 | { |
312 | if (perl) |
319 | if (perl) |
313 | { |
320 | { |
314 | perl_destruct (perl); |
321 | perl_destruct (perl); |
315 | perl_free (perl); |
322 | perl_free (perl); |
|
|
323 | PERL_SYS_TERM (); |
316 | } |
324 | } |
317 | } |
325 | } |
318 | |
326 | |
319 | void |
327 | void |
320 | rxvt_perl_interp::init (rxvt_term *term) |
328 | rxvt_perl_interp::init (rxvt_term *term) |
321 | { |
329 | { |
322 | if (!perl) |
330 | if (!perl) |
323 | { |
331 | { |
324 | rxvt_push_locale (""); // perl init destroys current locale |
332 | rxvt_push_locale (""); // perl init destroys current locale |
325 | |
333 | |
|
|
334 | { |
326 | perl_environ = rxvt_environ; |
335 | perl_environ = rxvt_environ; |
327 | swap (perl_environ, environ); |
336 | localise_env set_environ (perl_environ); |
328 | |
337 | |
329 | char *argv[] = { |
338 | char *args[] = { |
330 | "", |
339 | "", |
331 | "-e" |
340 | "-e" |
332 | "BEGIN {" |
341 | "BEGIN {" |
333 | " urxvt->bootstrap;" |
342 | " urxvt->bootstrap;" |
334 | " unshift @INC, '" LIBDIR "';" |
343 | " unshift @INC, '" LIBDIR "';" |
335 | "}" |
344 | "}" |
336 | "" |
345 | "" |
337 | "use urxvt;" |
346 | "use urxvt;" |
338 | }; |
347 | }; |
|
|
348 | int argc = sizeof (args) / sizeof (args[0]); |
|
|
349 | char **argv = args; |
339 | |
350 | |
|
|
351 | PERL_SYS_INIT3 (&argc, &argv, &environ); |
340 | perl = perl_alloc (); |
352 | perl = perl_alloc (); |
341 | perl_construct (perl); |
353 | perl_construct (perl); |
342 | |
354 | |
343 | if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) |
355 | if (perl_parse (perl, xs_init, argc, argv, (char **)NULL) |
344 | || perl_run (perl)) |
356 | || perl_run (perl)) |
345 | { |
357 | { |
346 | rxvt_warn ("unable to initialize perl-interpreter, continuing without.\n"); |
358 | rxvt_warn ("unable to initialize perl-interpreter, continuing without.\n"); |
347 | |
359 | |
348 | perl_destruct (perl); |
360 | perl_destruct (perl); |
349 | perl_free (perl); |
361 | perl_free (perl); |
350 | perl = 0; |
362 | perl = 0; |
351 | } |
363 | } |
352 | |
364 | } |
353 | swap (perl_environ, environ); |
|
|
354 | |
365 | |
355 | rxvt_pop_locale (); |
366 | rxvt_pop_locale (); |
356 | } |
367 | } |
357 | |
368 | |
358 | if (perl) |
369 | if (perl) |
… | |
… | |
378 | rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) |
389 | rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) |
379 | { |
390 | { |
380 | if (!perl || !term->perl.self) |
391 | if (!perl || !term->perl.self) |
381 | return false; |
392 | return false; |
382 | |
393 | |
|
|
394 | localise_env set_environ (perl_environ); |
|
|
395 | |
383 | // pre-handling of some events |
396 | // pre-handling of some events |
384 | if (htype == HOOK_REFRESH_END) |
397 | if (htype == HOOK_REFRESH_END) |
385 | { |
398 | { |
386 | AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); |
399 | AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); |
387 | |
400 | |
388 | for (int i = 0; i <= AvFILL (av); i++) |
401 | for (int i = 0; i <= AvFILL (av); i++) |
389 | ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); |
402 | ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); |
390 | } |
403 | } |
391 | |
404 | |
392 | swap (perl_environ, environ); |
|
|
393 | |
|
|
394 | bool event_consumed; |
405 | bool event_consumed; |
395 | |
406 | |
396 | if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always |
407 | if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always |
397 | || term->perl.should_invoke [htype]) |
408 | || term->perl.should_invoke [htype]) |
398 | try |
|
|
399 | { |
409 | { |
400 | dSP; |
410 | dSP; |
401 | va_list ap; |
411 | va_list ap; |
402 | |
412 | |
403 | va_start (ap, htype); |
413 | va_start (ap, htype); |
404 | |
414 | |
405 | ENTER; |
415 | ENTER; |
406 | SAVETMPS; |
416 | SAVETMPS; |
407 | |
417 | |
408 | PUSHMARK (SP); |
418 | PUSHMARK (SP); |
409 | |
419 | |
410 | XPUSHs (sv_2mortal (newSVterm (term))); |
420 | XPUSHs (sv_2mortal (newSVterm (term))); |
411 | XPUSHs (sv_2mortal (newSViv (htype))); |
421 | XPUSHs (sv_2mortal (newSViv (htype))); |
412 | |
422 | |
413 | for (;;) { |
423 | for (;;) { |
414 | data_type dt = (data_type)va_arg (ap, int); |
424 | data_type dt = (data_type)va_arg (ap, int); |
415 | |
425 | |
416 | switch (dt) |
426 | switch (dt) |
417 | { |
427 | { |
418 | case DT_INT: |
428 | case DT_INT: |
419 | XPUSHs (sv_2mortal (newSViv (va_arg (ap, int)))); |
429 | XPUSHs (sv_2mortal (newSViv (va_arg (ap, int)))); |
420 | break; |
430 | break; |
421 | |
431 | |
422 | case DT_LONG: |
432 | case DT_LONG: |
423 | XPUSHs (sv_2mortal (newSViv (va_arg (ap, long)))); |
433 | XPUSHs (sv_2mortal (newSViv (va_arg (ap, long)))); |
424 | break; |
434 | break; |
425 | |
435 | |
426 | case DT_STR: |
436 | case DT_STR: |
427 | XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0))); |
437 | XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0))); |
428 | break; |
438 | break; |
429 | |
439 | |
430 | case DT_STR_LEN: |
440 | case DT_STR_LEN: |
431 | { |
441 | { |
432 | char *str = va_arg (ap, char *); |
442 | char *str = va_arg (ap, char *); |
433 | int len = va_arg (ap, int); |
443 | int len = va_arg (ap, int); |
434 | |
444 | |
435 | XPUSHs (sv_2mortal (newSVpvn (str, len))); |
445 | XPUSHs (sv_2mortal (newSVpvn (str, len))); |
436 | } |
446 | } |
437 | break; |
447 | break; |
438 | |
448 | |
439 | case DT_WCS_LEN: |
449 | case DT_WCS_LEN: |
440 | { |
450 | { |
441 | wchar_t *wstr = va_arg (ap, wchar_t *); |
451 | wchar_t *wstr = va_arg (ap, wchar_t *); |
442 | int wlen = va_arg (ap, int); |
452 | int wlen = va_arg (ap, int); |
443 | |
453 | |
444 | XPUSHs (sv_2mortal (wcs2sv (wstr, wlen))); |
454 | XPUSHs (sv_2mortal (wcs2sv (wstr, wlen))); |
445 | } |
455 | } |
446 | break; |
456 | break; |
447 | |
457 | |
448 | case DT_LCS_LEN: |
458 | case DT_LCS_LEN: |
449 | { |
459 | { |
450 | long *lstr = va_arg (ap, long *); |
460 | long *lstr = va_arg (ap, long *); |
451 | int llen = va_arg (ap, int); |
461 | int llen = va_arg (ap, int); |
452 | |
462 | |
453 | XPUSHs (sv_2mortal (newSVpvn ((char *)lstr, llen * sizeof (long)))); |
463 | XPUSHs (sv_2mortal (newSVpvn ((char *)lstr, llen * sizeof (long)))); |
454 | } |
464 | } |
455 | break; |
465 | break; |
456 | |
466 | |
457 | case DT_XEVENT: |
467 | case DT_XEVENT: |
458 | { |
468 | { |
459 | XEvent *xe = va_arg (ap, XEvent *); |
469 | XEvent *xe = va_arg (ap, XEvent *); |
460 | HV *hv = newHV (); |
470 | HV *hv = newHV (); |
461 | |
471 | |
462 | # define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0) |
472 | # define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0) |
463 | # define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0) |
473 | # define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0) |
464 | # define setuv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSVuv (val), 0) |
474 | # define setuv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSVuv (val), 0) |
465 | # undef set |
475 | # undef set |
466 | |
476 | |
467 | setiv (type, xe->type); |
477 | setiv (type, xe->type); |
468 | setiv (send_event, xe->xany.send_event); |
478 | setiv (send_event, xe->xany.send_event); |
469 | setiv (serial, xe->xany.serial); |
479 | setiv (serial, xe->xany.serial); |
470 | |
480 | |
471 | switch (xe->type) |
481 | switch (xe->type) |
472 | { |
482 | { |
473 | case KeyPress: |
483 | case KeyPress: |
474 | case KeyRelease: |
484 | case KeyRelease: |
475 | case ButtonPress: |
485 | case ButtonPress: |
476 | case ButtonRelease: |
486 | case ButtonRelease: |
477 | case MotionNotify: |
487 | case MotionNotify: |
478 | setuv (window, xe->xmotion.window); |
488 | setuv (window, xe->xmotion.window); |
479 | setuv (root, xe->xmotion.root); |
489 | setuv (root, xe->xmotion.root); |
480 | setuv (subwindow, xe->xmotion.subwindow); |
490 | setuv (subwindow, xe->xmotion.subwindow); |
481 | setuv (time, xe->xmotion.time); |
491 | setuv (time, xe->xmotion.time); |
482 | setiv (x, xe->xmotion.x); |
492 | setiv (x, xe->xmotion.x); |
483 | setiv (y, xe->xmotion.y); |
493 | setiv (y, xe->xmotion.y); |
484 | setiv (row, xe->xmotion.y / term->fheight + term->view_start); |
494 | setiv (row, xe->xmotion.y / term->fheight + term->view_start); |
485 | setiv (col, xe->xmotion.x / term->fwidth); |
495 | setiv (col, xe->xmotion.x / term->fwidth); |
486 | setiv (x_root, xe->xmotion.x_root); |
496 | setiv (x_root, xe->xmotion.x_root); |
487 | setiv (y_root, xe->xmotion.y_root); |
497 | setiv (y_root, xe->xmotion.y_root); |
488 | setuv (state, xe->xmotion.state); |
498 | setuv (state, xe->xmotion.state); |
489 | |
499 | |
490 | switch (xe->type) |
500 | switch (xe->type) |
491 | { |
501 | { |
492 | case KeyPress: |
502 | case KeyPress: |
493 | case KeyRelease: |
503 | case KeyRelease: |
494 | setuv (keycode, xe->xkey.keycode); |
504 | setuv (keycode, xe->xkey.keycode); |
495 | break; |
505 | break; |
496 | |
506 | |
497 | case ButtonPress: |
507 | case ButtonPress: |
498 | case ButtonRelease: |
508 | case ButtonRelease: |
499 | setuv (button, xe->xbutton.button); |
509 | setuv (button, xe->xbutton.button); |
500 | break; |
510 | break; |
501 | |
511 | |
502 | case MotionNotify: |
512 | case MotionNotify: |
503 | setiv (is_hint, xe->xmotion.is_hint); |
513 | setiv (is_hint, xe->xmotion.is_hint); |
504 | break; |
514 | break; |
505 | } |
515 | } |
506 | |
516 | |
507 | break; |
517 | break; |
508 | |
518 | |
509 | case MapNotify: |
519 | case MapNotify: |
510 | case UnmapNotify: |
520 | case UnmapNotify: |
511 | case ConfigureNotify: |
521 | case ConfigureNotify: |
512 | setuv (event, xe->xconfigure.event); |
522 | setuv (event, xe->xconfigure.event); |
513 | setuv (window, xe->xconfigure.window); |
523 | setuv (window, xe->xconfigure.window); |
514 | |
524 | |
515 | switch (xe->type) |
525 | switch (xe->type) |
516 | { |
526 | { |
517 | case ConfigureNotify: |
527 | case ConfigureNotify: |
518 | setiv (x, xe->xconfigure.x); |
528 | setiv (x, xe->xconfigure.x); |
519 | setiv (y, xe->xconfigure.y); |
529 | setiv (y, xe->xconfigure.y); |
520 | setiv (width, xe->xconfigure.width); |
530 | setiv (width, xe->xconfigure.width); |
521 | setiv (height, xe->xconfigure.height); |
531 | setiv (height, xe->xconfigure.height); |
522 | setuv (above, xe->xconfigure.above); |
532 | setuv (above, xe->xconfigure.above); |
523 | break; |
533 | break; |
524 | } |
534 | } |
525 | |
535 | |
526 | break; |
536 | break; |
527 | |
537 | |
528 | case PropertyNotify: |
538 | case PropertyNotify: |
529 | setuv (window, xe->xproperty.window); |
539 | setuv (window, xe->xproperty.window); |
530 | setuv (atom, xe->xproperty.atom); |
540 | setuv (atom, xe->xproperty.atom); |
531 | setuv (time, xe->xproperty.time); |
541 | setuv (time, xe->xproperty.time); |
532 | setiv (state, xe->xproperty.state); |
542 | setiv (state, xe->xproperty.state); |
533 | break; |
543 | break; |
534 | |
544 | |
535 | case ClientMessage: |
545 | case ClientMessage: |
536 | setuv (window, xe->xclient.window); |
546 | setuv (window, xe->xclient.window); |
537 | setuv (message_type, xe->xclient.message_type); |
547 | setuv (message_type, xe->xclient.message_type); |
538 | setuv (format, xe->xclient.format); |
548 | setuv (format, xe->xclient.format); |
539 | setuv (l0, xe->xclient.data.l[0]); |
549 | setuv (l0, xe->xclient.data.l[0]); |
540 | setuv (l1, xe->xclient.data.l[1]); |
550 | setuv (l1, xe->xclient.data.l[1]); |
541 | setuv (l2, xe->xclient.data.l[2]); |
551 | setuv (l2, xe->xclient.data.l[2]); |
542 | setuv (l3, xe->xclient.data.l[3]); |
552 | setuv (l3, xe->xclient.data.l[3]); |
543 | setuv (l4, xe->xclient.data.l[4]); |
553 | setuv (l4, xe->xclient.data.l[4]); |
544 | break; |
554 | break; |
545 | } |
555 | } |
546 | |
556 | |
547 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); |
557 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); |
548 | } |
558 | } |
549 | break; |
559 | break; |
550 | |
560 | |
551 | case DT_END: |
561 | case DT_END: |
552 | goto call; |
562 | goto call; |
553 | |
563 | |
554 | default: |
564 | default: |
555 | rxvt_fatal ("FATAL: unable to pass data type %d\n", dt); |
565 | rxvt_fatal ("FATAL: unable to pass data type %d\n", dt); |
556 | } |
566 | } |
|
|
567 | } |
|
|
568 | |
|
|
569 | call: |
|
|
570 | va_end (ap); |
|
|
571 | |
|
|
572 | PUTBACK; |
|
|
573 | int count = call_pv ("urxvt::invoke", G_ARRAY | G_EVAL); |
|
|
574 | SPAGAIN; |
|
|
575 | |
|
|
576 | if (count) |
|
|
577 | { |
|
|
578 | SV *status = POPs; |
|
|
579 | count = SvTRUE (status); |
557 | } |
580 | } |
558 | |
581 | |
559 | call: |
|
|
560 | va_end (ap); |
|
|
561 | |
|
|
562 | PUTBACK; |
582 | PUTBACK; |
563 | int count = call_pv ("urxvt::invoke", G_ARRAY | G_EVAL); |
|
|
564 | SPAGAIN; |
|
|
565 | |
|
|
566 | if (count) |
|
|
567 | { |
|
|
568 | SV *status = POPs; |
|
|
569 | count = SvTRUE (status); |
|
|
570 | } |
|
|
571 | |
|
|
572 | PUTBACK; |
|
|
573 | FREETMPS; |
583 | FREETMPS; |
574 | LEAVE; |
584 | LEAVE; |
575 | |
585 | |
576 | if (SvTRUE (ERRSV)) |
586 | if (SvTRUE (ERRSV)) |
577 | { |
587 | { |
578 | rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPV_nolen (ERRSV)); |
588 | rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPV_nolen (ERRSV)); |
579 | ungrab (term); // better lose the grab than the session |
589 | ungrab (term); // better lose the grab than the session |
580 | } |
590 | } |
581 | |
591 | |
582 | event_consumed = !!count; |
592 | event_consumed = !!count; |
583 | } |
593 | } |
584 | catch (...) |
|
|
585 | { |
|
|
586 | swap (perl_environ, environ); |
|
|
587 | throw; |
|
|
588 | } |
|
|
589 | else |
594 | else |
590 | event_consumed = false; |
595 | event_consumed = false; |
591 | |
596 | |
592 | // post-handling of some events |
597 | // post-handling of some events |
593 | if (htype == HOOK_REFRESH_BEGIN) |
598 | if (htype == HOOK_REFRESH_BEGIN) |
… | |
… | |
604 | |
609 | |
605 | // don't allow further calls |
610 | // don't allow further calls |
606 | term->perl.self = 0; |
611 | term->perl.self = 0; |
607 | } |
612 | } |
608 | |
613 | |
609 | swap (perl_environ, environ); |
|
|
610 | |
|
|
611 | return event_consumed; |
614 | return event_consumed; |
612 | } |
615 | } |
613 | |
616 | |
614 | ///////////////////////////////////////////////////////////////////////////// |
617 | ///////////////////////////////////////////////////////////////////////////// |
615 | |
618 | |
… | |
… | |
628 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
631 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
629 | # include "hookinc.h" |
632 | # include "hookinc.h" |
630 | # undef def |
633 | # undef def |
631 | |
634 | |
632 | HV *option = get_hv ("urxvt::OPTION", 1); |
635 | HV *option = get_hv ("urxvt::OPTION", 1); |
633 | # define def(name,val) hv_store (option, # name, sizeof (# name) - 1, newSVuv (Opt_ ## name), 0); |
636 | # define def(name) hv_store (option, # name, sizeof (# name) - 1, newSVuv (Opt_ ## name), 0); |
634 | # define nodef(name) |
637 | # define nodef(name) |
635 | # include "optinc.h" |
638 | # include "optinc.h" |
636 | # undef nodef |
639 | # undef nodef |
637 | # undef def |
640 | # undef def |
638 | |
641 | |
… | |
… | |
640 | static const struct { |
643 | static const struct { |
641 | const char *name; |
644 | const char *name; |
642 | IV iv; |
645 | IV iv; |
643 | } *civ, const_iv[] = { |
646 | } *civ, const_iv[] = { |
644 | # define const_iv(name) { # name, (IV)name } |
647 | # define const_iv(name) { # name, (IV)name } |
|
|
648 | const_iv (NUM_RESOURCES), |
645 | const_iv (DEFAULT_RSTYLE), |
649 | const_iv (DEFAULT_RSTYLE), |
646 | const_iv (OVERLAY_RSTYLE), |
650 | const_iv (OVERLAY_RSTYLE), |
|
|
651 | const_iv (Color_Bits), |
|
|
652 | const_iv (RS_bgShift), const_iv (RS_bgMask), |
|
|
653 | const_iv (RS_fgShift), const_iv (RS_fgMask), |
|
|
654 | const_iv (RS_Careful), |
|
|
655 | const_iv (RS_fontCount), |
|
|
656 | const_iv (RS_fontShift), |
|
|
657 | const_iv (RS_fontMask), |
|
|
658 | const_iv (RS_baseattrMask), |
|
|
659 | const_iv (RS_attrMask), |
|
|
660 | const_iv (RS_redraw), |
|
|
661 | const_iv (RS_Sel), |
647 | const_iv (RS_Bold), |
662 | const_iv (RS_Bold), |
648 | const_iv (RS_Italic), |
663 | const_iv (RS_Italic), |
649 | const_iv (RS_Blink), |
664 | const_iv (RS_Blink), |
650 | const_iv (RS_RVid), |
665 | const_iv (RS_RVid), |
651 | const_iv (RS_Uline), |
666 | const_iv (RS_Uline), |
… | |
… | |
775 | _exit (int status) |
790 | _exit (int status) |
776 | |
791 | |
777 | NV |
792 | NV |
778 | NOW () |
793 | NOW () |
779 | CODE: |
794 | CODE: |
780 | RETVAL = NOW; |
795 | RETVAL = ev::now (); |
781 | OUTPUT: |
796 | OUTPUT: |
782 | RETVAL |
797 | RETVAL |
783 | |
798 | |
784 | int |
799 | int |
785 | GET_BASEFG (int rend) |
800 | GET_BASEFG (int rend) |
… | |
… | |
857 | for (int i = AvFILL (env) + 1; i--; ) |
872 | for (int i = AvFILL (env) + 1; i--; ) |
858 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
873 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
859 | |
874 | |
860 | envv->push_back (0); |
875 | envv->push_back (0); |
861 | |
876 | |
862 | bool success; |
|
|
863 | |
|
|
864 | try |
877 | try |
865 | { |
878 | { |
866 | success = term->init (argv, envv); |
879 | term->init (argv, envv); |
867 | } |
880 | } |
868 | catch (const class rxvt_failure_exception &e) |
881 | catch (const class rxvt_failure_exception &e) |
869 | { |
|
|
870 | success = false; |
|
|
871 | } |
|
|
872 | |
|
|
873 | if (!success) |
|
|
874 | { |
882 | { |
875 | term->destroy (); |
883 | term->destroy (); |
876 | croak ("error while initializing new terminal instance"); |
884 | croak ("error while initializing new terminal instance"); |
877 | } |
885 | } |
878 | |
886 | |
… | |
… | |
1050 | OUTPUT: |
1058 | OUTPUT: |
1051 | RETVAL |
1059 | RETVAL |
1052 | |
1060 | |
1053 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1061 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1054 | |
1062 | |
1055 | #define TERM_OFFSET_width TERM_OFFSET(width) |
1063 | #define TERM_OFFSET_width TERM_OFFSET(width) |
1056 | #define TERM_OFFSET_height TERM_OFFSET(height) |
1064 | #define TERM_OFFSET_height TERM_OFFSET(height) |
1057 | #define TERM_OFFSET_fwidth TERM_OFFSET(fwidth) |
1065 | #define TERM_OFFSET_fwidth TERM_OFFSET(fwidth) |
1058 | #define TERM_OFFSET_fheight TERM_OFFSET(fheight) |
1066 | #define TERM_OFFSET_fheight TERM_OFFSET(fheight) |
1059 | #define TERM_OFFSET_fbase TERM_OFFSET(fbase) |
1067 | #define TERM_OFFSET_fbase TERM_OFFSET(fbase) |
1060 | #define TERM_OFFSET_nrow TERM_OFFSET(nrow) |
1068 | #define TERM_OFFSET_nrow TERM_OFFSET(nrow) |
1061 | #define TERM_OFFSET_ncol TERM_OFFSET(ncol) |
1069 | #define TERM_OFFSET_ncol TERM_OFFSET(ncol) |
1062 | #define TERM_OFFSET_focus TERM_OFFSET(focus) |
1070 | #define TERM_OFFSET_focus TERM_OFFSET(focus) |
1063 | #define TERM_OFFSET_mapped TERM_OFFSET(mapped) |
1071 | #define TERM_OFFSET_mapped TERM_OFFSET(mapped) |
1064 | #define TERM_OFFSET_int_bwidth TERM_OFFSET(int_bwidth) |
1072 | #define TERM_OFFSET_int_bwidth TERM_OFFSET(int_bwidth) |
1065 | #define TERM_OFFSET_ext_bwidth TERM_OFFSET(ext_bwidth) |
1073 | #define TERM_OFFSET_ext_bwidth TERM_OFFSET(ext_bwidth) |
1066 | #define TERM_OFFSET_lineSpace TERM_OFFSET(lineSpace) |
1074 | #define TERM_OFFSET_lineSpace TERM_OFFSET(lineSpace) |
|
|
1075 | #define TERM_OFFSET_letterSpace TERM_OFFSET(letterSpace) |
1067 | #define TERM_OFFSET_saveLines TERM_OFFSET(saveLines) |
1076 | #define TERM_OFFSET_saveLines TERM_OFFSET(saveLines) |
1068 | #define TERM_OFFSET_total_rows TERM_OFFSET(total_rows) |
1077 | #define TERM_OFFSET_total_rows TERM_OFFSET(total_rows) |
1069 | #define TERM_OFFSET_top_row TERM_OFFSET(top_row) |
1078 | #define TERM_OFFSET_top_row TERM_OFFSET(top_row) |
1070 | |
1079 | |
1071 | int |
1080 | int |
1072 | rxvt_term::width () |
1081 | rxvt_term::width () |
1073 | ALIAS: |
1082 | ALIAS: |
1074 | width = TERM_OFFSET_width |
1083 | width = TERM_OFFSET_width |
1075 | height = TERM_OFFSET_height |
1084 | height = TERM_OFFSET_height |
1076 | fwidth = TERM_OFFSET_fwidth |
1085 | fwidth = TERM_OFFSET_fwidth |
1077 | fheight = TERM_OFFSET_fheight |
1086 | fheight = TERM_OFFSET_fheight |
1078 | fbase = TERM_OFFSET_fbase |
1087 | fbase = TERM_OFFSET_fbase |
1079 | nrow = TERM_OFFSET_nrow |
1088 | nrow = TERM_OFFSET_nrow |
1080 | ncol = TERM_OFFSET_ncol |
1089 | ncol = TERM_OFFSET_ncol |
1081 | focus = TERM_OFFSET_focus |
1090 | focus = TERM_OFFSET_focus |
1082 | mapped = TERM_OFFSET_mapped |
1091 | mapped = TERM_OFFSET_mapped |
1083 | int_bwidth = TERM_OFFSET_int_bwidth |
1092 | int_bwidth = TERM_OFFSET_int_bwidth |
1084 | ext_bwidth = TERM_OFFSET_ext_bwidth |
1093 | ext_bwidth = TERM_OFFSET_ext_bwidth |
1085 | lineSpace = TERM_OFFSET_lineSpace |
1094 | lineSpace = TERM_OFFSET_lineSpace |
|
|
1095 | letterSpace = TERM_OFFSET_letterSpace |
1086 | saveLines = TERM_OFFSET_saveLines |
1096 | saveLines = TERM_OFFSET_saveLines |
1087 | total_rows = TERM_OFFSET_total_rows |
1097 | total_rows = TERM_OFFSET_total_rows |
1088 | top_row = TERM_OFFSET_top_row |
1098 | top_row = TERM_OFFSET_top_row |
1089 | CODE: |
1099 | CODE: |
1090 | RETVAL = *(int *)((char *)THIS + ix); |
1100 | RETVAL = *(int *)((char *)THIS + ix); |
1091 | OUTPUT: |
1101 | OUTPUT: |
1092 | RETVAL |
1102 | RETVAL |
1093 | |
1103 | |
… | |
… | |
1104 | { |
1114 | { |
1105 | case 0: RETVAL = THIS->ModLevel3Mask; break; |
1115 | case 0: RETVAL = THIS->ModLevel3Mask; break; |
1106 | case 1: RETVAL = THIS->ModMetaMask; break; |
1116 | case 1: RETVAL = THIS->ModMetaMask; break; |
1107 | case 2: RETVAL = THIS->ModNumLockMask; break; |
1117 | case 2: RETVAL = THIS->ModNumLockMask; break; |
1108 | case 3: RETVAL = THIS->current_screen; break; |
1118 | case 3: RETVAL = THIS->current_screen; break; |
|
|
1119 | #ifdef CURSOR_BLINK |
1109 | case 4: RETVAL = THIS->hidden_cursor; break; |
1120 | case 4: RETVAL = THIS->hidden_cursor; break; |
|
|
1121 | #endif |
1110 | } |
1122 | } |
1111 | OUTPUT: |
1123 | OUTPUT: |
1112 | RETVAL |
1124 | RETVAL |
1113 | |
1125 | |
1114 | char * |
1126 | char * |
… | |
… | |
1139 | if (*i) |
1151 | if (*i) |
1140 | PUSHs (sv_2mortal (newSVpv (*i, 0))); |
1152 | PUSHs (sv_2mortal (newSVpv (*i, 0))); |
1141 | } |
1153 | } |
1142 | |
1154 | |
1143 | int |
1155 | int |
1144 | rxvt_term::pty_ev_events (int events = EVENT_UNDEF) |
1156 | rxvt_term::pty_ev_events (int events = ev::UNDEF) |
1145 | CODE: |
1157 | CODE: |
1146 | RETVAL = THIS->pty_ev.events; |
1158 | RETVAL = THIS->pty_ev.events; |
1147 | if (events != EVENT_UNDEF) |
1159 | if (events != ev::UNDEF) |
1148 | THIS->pty_ev.set (events); |
1160 | THIS->pty_ev.set (events); |
1149 | OUTPUT: |
1161 | OUTPUT: |
1150 | RETVAL |
1162 | RETVAL |
1151 | |
1163 | |
1152 | int |
1164 | int |
… | |
… | |
1231 | |
1243 | |
1232 | void |
1244 | void |
1233 | rxvt_term::want_refresh () |
1245 | rxvt_term::want_refresh () |
1234 | CODE: |
1246 | CODE: |
1235 | THIS->want_refresh = 1; |
1247 | THIS->want_refresh = 1; |
|
|
1248 | THIS->refresh_check (); |
1236 | |
1249 | |
1237 | void |
1250 | void |
1238 | rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS) |
1251 | rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS) |
1239 | PPCODE: |
1252 | PPCODE: |
1240 | { |
1253 | { |
… | |
… | |
1437 | # undef reserve |
1450 | # undef reserve |
1438 | }; |
1451 | }; |
1439 | |
1452 | |
1440 | rs = rslist + sizeof (rslist) / sizeof (rslist [0]); |
1453 | rs = rslist + sizeof (rslist) / sizeof (rslist [0]); |
1441 | |
1454 | |
|
|
1455 | if (*name) |
1442 | do { |
1456 | { |
|
|
1457 | do { |
1443 | if (rs-- == rslist) |
1458 | if (rs-- == rslist) |
1444 | croak ("no such resource '%s', requested", name); |
1459 | croak ("no such resource '%s', requested", name); |
1445 | } while (strcmp (name, rs->name)); |
1460 | } while (strcmp (name, rs->name)); |
1446 | |
1461 | |
1447 | index += rs->value; |
1462 | index += rs->value; |
|
|
1463 | } |
|
|
1464 | else |
|
|
1465 | { |
|
|
1466 | --rs; |
|
|
1467 | name = ""; |
|
|
1468 | } |
1448 | |
1469 | |
1449 | if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES)) |
1470 | if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES)) |
1450 | croak ("requested out-of-bound resource %s+%d,", name, index - rs->value); |
1471 | croak ("requested out-of-bound resource %s+%d,", name, index - rs->value); |
1451 | |
1472 | |
1452 | if (GIMME_V != G_VOID) |
1473 | if (GIMME_V != G_VOID) |
… | |
… | |
1476 | |
1497 | |
1477 | if (set >= 0) |
1498 | if (set >= 0) |
1478 | { |
1499 | { |
1479 | THIS->set_option (optval, set); |
1500 | THIS->set_option (optval, set); |
1480 | |
1501 | |
1481 | if (THIS->check_ev.is_active ()) // avoid doing this before START |
1502 | if (THIS->env_colorfgbg [0]) // avoid doing this before START |
1482 | switch (optval) |
1503 | switch (optval) |
1483 | { |
1504 | { |
1484 | case Opt_skipBuiltinGlyphs: |
1505 | case Opt_skipBuiltinGlyphs: |
1485 | THIS->set_fonts (); |
1506 | THIS->set_fonts (); |
1486 | THIS->scr_remap_chars (); |
1507 | THIS->scr_remap_chars (); |
1487 | THIS->scr_touch (true); |
1508 | THIS->scr_touch (true); |
1488 | THIS->want_refresh = 1; |
1509 | THIS->want_refresh = 1; |
|
|
1510 | THIS->refresh_check (); |
1489 | break; |
1511 | break; |
1490 | |
1512 | |
1491 | case Opt_cursorUnderline: |
1513 | case Opt_cursorUnderline: |
1492 | THIS->want_refresh = 1; |
1514 | THIS->want_refresh = 1; |
|
|
1515 | THIS->refresh_check (); |
1493 | break; |
1516 | break; |
1494 | |
1517 | |
1495 | # case Opt_scrollBar_floating: |
1518 | # case Opt_scrollBar_floating: |
1496 | # case Opt_scrollBar_right: |
1519 | # case Opt_scrollBar_right: |
1497 | # THIS->resize_all_windows (THIS->width, THIS->height, 1); |
1520 | # THIS->resize_all_windows (THIS->width, THIS->height, 1); |
… | |
… | |
1530 | EXTEND (SP, 2); |
1553 | EXTEND (SP, 2); |
1531 | PUSHs (sv_2mortal (newSViv (rc.row))); |
1554 | PUSHs (sv_2mortal (newSViv (rc.row))); |
1532 | PUSHs (sv_2mortal (newSViv (rc.col))); |
1555 | PUSHs (sv_2mortal (newSViv (rc.col))); |
1533 | } |
1556 | } |
1534 | |
1557 | |
1535 | if (items == 3) |
1558 | if (items >= 3) |
1536 | { |
1559 | { |
1537 | rc.row = SvIV (ST (1)); |
1560 | rc.row = SvIV (ST (1)); |
1538 | rc.col = SvIV (ST (2)); |
1561 | rc.col = SvIV (ST (2)); |
1539 | |
1562 | |
1540 | if (ix == 2) |
1563 | if (ix == 2) |
… | |
… | |
1555 | |
1578 | |
1556 | clamp_it (rc.col, 0, THIS->ncol); |
1579 | clamp_it (rc.col, 0, THIS->ncol); |
1557 | clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); |
1580 | clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); |
1558 | |
1581 | |
1559 | if (ix) |
1582 | if (ix) |
|
|
1583 | { |
|
|
1584 | THIS->selection.screen = THIS->current_screen; |
|
|
1585 | |
1560 | THIS->want_refresh = 1; |
1586 | THIS->want_refresh = 1; |
|
|
1587 | THIS->refresh_check (); |
1561 | } |
1588 | } |
|
|
1589 | } |
1562 | } |
1590 | } |
1563 | |
1591 | |
1564 | char |
1592 | int |
1565 | rxvt_term::cur_charset () |
1593 | rxvt_term::selection_screen (int screen = -1) |
1566 | CODE: |
1594 | CODE: |
1567 | RETVAL = THIS->charsets [THIS->screen.charset]; |
1595 | RETVAL = THIS->selection.screen; |
1568 | OUTPUT: |
1596 | if (screen >= 0) |
|
|
1597 | THIS->selection.screen = screen; |
|
|
1598 | OUTPUT: |
1569 | RETVAL |
1599 | RETVAL |
1570 | |
1600 | |
1571 | void |
1601 | void |
1572 | rxvt_term::selection_clear () |
1602 | rxvt_term::selection_clear (bool clipboard = false) |
1573 | |
1603 | |
1574 | void |
1604 | void |
1575 | rxvt_term::selection_make (Time eventtime, bool rect = false) |
1605 | rxvt_term::selection_make (Time eventtime, bool rect = false) |
1576 | CODE: |
1606 | CODE: |
1577 | THIS->selection.op = SELECTION_CONT; |
1607 | THIS->selection.op = SELECTION_CONT; |
1578 | THIS->selection.rect = rect; |
1608 | THIS->selection.rect = rect; |
1579 | THIS->selection_make (eventtime); |
1609 | THIS->selection_make (eventtime); |
1580 | |
1610 | |
1581 | int |
1611 | int |
1582 | rxvt_term::selection_grab (Time eventtime) |
1612 | rxvt_term::selection_grab (Time eventtime, bool clipboard = false) |
1583 | |
1613 | |
1584 | void |
1614 | void |
1585 | rxvt_term::selection (SV *newtext = 0) |
1615 | rxvt_term::selection (SV *newtext = 0, bool clipboard = false) |
1586 | PPCODE: |
1616 | PPCODE: |
1587 | { |
1617 | { |
|
|
1618 | wchar_t * &text = clipboard ? THIS->selection.clip_text : THIS->selection.text; |
|
|
1619 | unsigned int &len = clipboard ? THIS->selection.clip_len : THIS->selection.len; |
|
|
1620 | |
1588 | if (GIMME_V != G_VOID) |
1621 | if (GIMME_V != G_VOID) |
1589 | XPUSHs (THIS->selection.text |
1622 | XPUSHs (text |
1590 | ? sv_2mortal (wcs2sv (THIS->selection.text, THIS->selection.len)) |
1623 | ? sv_2mortal (wcs2sv (text, len)) |
1591 | : &PL_sv_undef); |
1624 | : &PL_sv_undef); |
1592 | |
1625 | |
1593 | if (newtext) |
1626 | if (newtext) |
1594 | { |
1627 | { |
1595 | free (THIS->selection.text); |
1628 | free (text); |
1596 | |
1629 | |
1597 | THIS->selection.text = sv2wcs (newtext); |
1630 | text = sv2wcs (newtext); |
1598 | THIS->selection.len = wcslen (THIS->selection.text); |
1631 | len = wcslen (text); |
1599 | } |
1632 | } |
1600 | } |
1633 | } |
|
|
1634 | |
|
|
1635 | char |
|
|
1636 | rxvt_term::cur_charset () |
|
|
1637 | CODE: |
|
|
1638 | RETVAL = THIS->charsets [THIS->screen.charset]; |
|
|
1639 | OUTPUT: |
|
|
1640 | RETVAL |
1601 | |
1641 | |
1602 | void |
1642 | void |
1603 | rxvt_term::scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle1 = RS_RVid, U32 rstyle2 = RS_RVid | RS_Uline) |
1643 | rxvt_term::scr_xor_rect (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle1 = RS_RVid, U32 rstyle2 = RS_RVid | RS_Uline) |
1604 | |
1644 | |
1605 | void |
1645 | void |
… | |
… | |
1627 | char *str = SvPVbyte (octets, len); |
1667 | char *str = SvPVbyte (octets, len); |
1628 | C_ARGS: |
1668 | C_ARGS: |
1629 | str, len |
1669 | str, len |
1630 | |
1670 | |
1631 | void |
1671 | void |
|
|
1672 | rxvt_term::tt_paste (SV *octets) |
|
|
1673 | INIT: |
|
|
1674 | STRLEN len; |
|
|
1675 | char *str = SvPVbyte (octets, len); |
|
|
1676 | C_ARGS: |
|
|
1677 | str, len |
|
|
1678 | |
|
|
1679 | void |
1632 | rxvt_term::cmd_parse (SV *octets) |
1680 | rxvt_term::cmd_parse (SV *octets) |
1633 | CODE: |
1681 | CODE: |
1634 | { |
1682 | { |
1635 | STRLEN len; |
1683 | STRLEN len; |
1636 | char *str = SvPVbyte (octets, len); |
1684 | char *str = SvPVbyte (octets, len); |
… | |
… | |
1705 | XFree (prop); |
1753 | XFree (prop); |
1706 | } |
1754 | } |
1707 | } |
1755 | } |
1708 | |
1756 | |
1709 | void |
1757 | void |
1710 | rxvt_term::XChangeWindowProperty (Window window, Atom property, Atom type, int format, SV *data) |
1758 | rxvt_term::XChangeProperty (Window window, Atom property, Atom type, int format, SV *data) |
1711 | CODE: |
1759 | CODE: |
1712 | { |
1760 | { |
1713 | STRLEN len; |
1761 | STRLEN len; |
1714 | char *data_ = SvPVbyte (data, len); |
1762 | char *data_ = SvPVbyte (data, len); |
1715 | |
1763 | |