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-2008 Marc Lehmann <pcg@goof.com> |
6 | * Copyright (c) 2005-2008,2011 Marc Lehmann <schmorp@schmorp.de> |
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. |
… | |
… | |
23 | #define line_t perl_line_t |
23 | #define line_t perl_line_t |
24 | #include <EXTERN.h> |
24 | #include <EXTERN.h> |
25 | #include <perl.h> |
25 | #include <perl.h> |
26 | #include <XSUB.h> |
26 | #include <XSUB.h> |
27 | #undef line_t |
27 | #undef line_t |
|
|
28 | #undef bool // perl defines it's own bool type, except with g++... what a trap |
28 | |
29 | |
29 | #include "../config.h" |
30 | #include "../config.h" |
30 | |
31 | |
31 | #include <cstddef> |
32 | #include <stddef.h> |
32 | #include <cstdarg> |
33 | #include <stdarg.h> |
33 | |
34 | |
34 | #include "unistd.h" |
35 | #include "unistd.h" |
35 | |
36 | |
36 | #include "ev_cpp.h" |
37 | #include "ev_cpp.h" |
37 | #include "rxvt.h" |
38 | #include "rxvt.h" |
… | |
… | |
48 | #undef ROW |
49 | #undef ROW |
49 | #define ROW(n) THIS->row_buf [LINENO (n)] |
50 | #define ROW(n) THIS->row_buf [LINENO (n)] |
50 | |
51 | |
51 | ///////////////////////////////////////////////////////////////////////////// |
52 | ///////////////////////////////////////////////////////////////////////////// |
52 | |
53 | |
|
|
54 | typedef char * octet_string; |
|
|
55 | typedef char * utf8_string; |
|
|
56 | |
|
|
57 | typedef int render_repeat_mode; |
|
|
58 | |
|
|
59 | #if HAVE_PIXBUF |
|
|
60 | typedef GdkPixbuf * urxvt__pixbuf; |
|
|
61 | #endif |
|
|
62 | typedef rxvt_img * urxvt__img; |
|
|
63 | |
|
|
64 | ///////////////////////////////////////////////////////////////////////////// |
|
|
65 | |
|
|
66 | static void |
|
|
67 | parse_color (rxvt_screen *s, rxvt_color &c, SV *sv) |
|
|
68 | { |
|
|
69 | //TODO: support component stuff, 0..1 |
|
|
70 | c.set (s, SvPVbyte_nolen (sv)); |
|
|
71 | } |
|
|
72 | |
|
|
73 | ///////////////////////////////////////////////////////////////////////////// |
|
|
74 | |
53 | static wchar_t * |
75 | static wchar_t * |
54 | sv2wcs (SV *sv) |
76 | sv2wcs (SV *sv) |
55 | { |
77 | { |
56 | STRLEN len; |
78 | STRLEN len; |
57 | char *str = SvPVutf8 (sv, len); |
79 | char *str = SvPVutf8 (sv, len); |
… | |
… | |
107 | |
129 | |
108 | ///////////////////////////////////////////////////////////////////////////// |
130 | ///////////////////////////////////////////////////////////////////////////// |
109 | |
131 | |
110 | #define SvOVERLAY(sv) (overlay *)SvPTR (sv, "urxvt::overlay") |
132 | #define SvOVERLAY(sv) (overlay *)SvPTR (sv, "urxvt::overlay") |
111 | |
133 | |
112 | class overlay { |
134 | class overlay : overlay_base |
|
|
135 | { |
113 | rxvt_term *THIS; |
136 | rxvt_term *THIS; |
114 | AV *overlay_av; |
137 | AV *overlay_av; |
115 | int x, y, w, h; |
|
|
116 | int border; |
138 | int border; |
117 | text_t **text; |
|
|
118 | rend_t **rend; |
|
|
119 | |
139 | |
120 | public: |
140 | public: |
121 | HV *self; |
141 | HV *self; |
122 | |
142 | |
123 | overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border); |
143 | overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border); |
… | |
… | |
130 | |
150 | |
131 | void set (int x, int y, SV *str, SV *rend); |
151 | void set (int x, int y, SV *str, SV *rend); |
132 | }; |
152 | }; |
133 | |
153 | |
134 | overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) |
154 | 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) |
155 | : THIS(THIS), border(border == 2), overlay_av (0) |
136 | { |
156 | { |
|
|
157 | x = x_; |
|
|
158 | y = y_; |
|
|
159 | w = w_; |
|
|
160 | h = h_; |
|
|
161 | |
137 | if (w < 0) w = 0; |
162 | if (w < 0) w = 0; |
138 | if (h < 0) h = 0; |
163 | if (h < 0) h = 0; |
139 | |
164 | |
140 | if (border == 2) |
165 | if (border == 2) |
141 | { |
166 | { |
… | |
… | |
245 | int ov_y = max (0, min (MOD (y, THIS->nrow), THIS->nrow - h)); |
270 | int ov_y = max (0, min (MOD (y, THIS->nrow), THIS->nrow - h)); |
246 | |
271 | |
247 | int ov_w = min (w, THIS->ncol - ov_x); |
272 | int ov_w = min (w, THIS->ncol - ov_x); |
248 | int ov_h = min (h, THIS->nrow - ov_y); |
273 | int ov_h = min (h, THIS->nrow - ov_y); |
249 | |
274 | |
|
|
275 | // hide cursor if it is within the overlay area |
|
|
276 | if (IN_RANGE_EXC (THIS->screen.cur.col - ov_x, 0, ov_w) |
|
|
277 | && IN_RANGE_EXC (THIS->screen.cur.row - ov_y, 0, ov_h)) |
|
|
278 | THIS->screen.flags &= ~Screen_VisibleCursor; |
|
|
279 | |
250 | for (int y = ov_h; y--; ) |
280 | for (int y = ov_h; y--; ) |
251 | { |
281 | { |
252 | text_t *t1 = text [y]; |
282 | text_t *t1 = text [y]; |
253 | rend_t *r1 = rend [y]; |
283 | rend_t *r1 = rend [y]; |
254 | |
284 | |
… | |
… | |
294 | THIS->refresh_check (); |
324 | THIS->refresh_check (); |
295 | } |
325 | } |
296 | |
326 | |
297 | ///////////////////////////////////////////////////////////////////////////// |
327 | ///////////////////////////////////////////////////////////////////////////// |
298 | |
328 | |
299 | #define IOM_CLASS "urxvt" |
|
|
300 | #define IOM_WARN rxvt_warn |
|
|
301 | #include "iom_perl.h" |
329 | #include "iom_perl.h" |
302 | |
330 | |
303 | ///////////////////////////////////////////////////////////////////////////// |
331 | ///////////////////////////////////////////////////////////////////////////// |
304 | |
332 | |
305 | struct rxvt_perl_interp rxvt_perl; |
333 | struct rxvt_perl_interp rxvt_perl; |
… | |
… | |
315 | PERL_SYS_TERM (); |
343 | PERL_SYS_TERM (); |
316 | } |
344 | } |
317 | } |
345 | } |
318 | |
346 | |
319 | void |
347 | void |
320 | rxvt_perl_interp::init (rxvt_term *term) |
348 | rxvt_perl_interp::init () |
321 | { |
349 | { |
322 | if (!perl) |
350 | if (!perl) |
323 | { |
351 | { |
324 | rxvt_push_locale (""); // perl init destroys current locale |
352 | rxvt_push_locale (""); // perl init destroys current locale |
325 | |
353 | |
|
|
354 | { |
326 | perl_environ = rxvt_environ; |
355 | perl_environ = rxvt_environ; |
327 | swap (perl_environ, environ); |
356 | localise_env set_environ (perl_environ); |
328 | |
357 | |
329 | char *args[] = { |
358 | char *args[] = { |
330 | "", |
359 | "", |
331 | "-e" |
360 | "-e" |
332 | "BEGIN {" |
361 | "BEGIN {" |
333 | " urxvt->bootstrap;" |
362 | " urxvt->bootstrap;" |
334 | " unshift @INC, '" LIBDIR "';" |
363 | " unshift @INC, '" LIBDIR "';" |
335 | "}" |
364 | "}" |
336 | "" |
365 | "" |
337 | "use urxvt;" |
366 | "use urxvt;" |
338 | }; |
367 | }; |
339 | int argc = sizeof (args) / sizeof (args[0]); |
368 | int argc = ecb_array_length (args); |
340 | char **argv = args; |
369 | char **argv = args; |
341 | |
370 | |
342 | PERL_SYS_INIT3 (&argc, &argv, &environ); |
371 | PERL_SYS_INIT3 (&argc, &argv, &environ); |
343 | perl = perl_alloc (); |
372 | perl = perl_alloc (); |
344 | perl_construct (perl); |
373 | perl_construct (perl); |
345 | |
374 | |
346 | if (perl_parse (perl, xs_init, argc, argv, (char **)NULL) |
375 | if (perl_parse (perl, xs_init, argc, argv, (char **)NULL) |
347 | || perl_run (perl)) |
376 | || perl_run (perl)) |
348 | { |
377 | { |
349 | rxvt_warn ("unable to initialize perl-interpreter, continuing without.\n"); |
378 | rxvt_warn ("unable to initialize perl-interpreter, continuing without.\n"); |
350 | |
379 | |
351 | perl_destruct (perl); |
380 | perl_destruct (perl); |
352 | perl_free (perl); |
381 | perl_free (perl); |
353 | perl = 0; |
382 | perl = 0; |
354 | } |
383 | } |
355 | |
384 | } |
356 | swap (perl_environ, environ); |
|
|
357 | |
385 | |
358 | rxvt_pop_locale (); |
386 | rxvt_pop_locale (); |
359 | } |
387 | } |
|
|
388 | } |
360 | |
389 | |
361 | if (perl) |
390 | void |
|
|
391 | rxvt_perl_interp::init (rxvt_term *term) |
|
|
392 | { |
|
|
393 | init (); |
|
|
394 | |
|
|
395 | if (perl && !term->perl.self) |
362 | { |
396 | { |
363 | // runs outside of perls ENV |
397 | // runs outside of perls ENV |
364 | term->perl.self = (void *)newSVptr ((void *)term, "urxvt::term"); |
398 | term->perl.self = (void *)newSVptr ((void *)term, "urxvt::term"); |
365 | hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0); |
399 | hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0); |
|
|
400 | hv_store ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, newRV_noinc ((SV *)newAV ()), 0); |
366 | } |
401 | } |
|
|
402 | } |
|
|
403 | |
|
|
404 | void |
|
|
405 | rxvt_perl_interp::eval (const char *str) |
|
|
406 | { |
|
|
407 | eval_pv (str, 1); |
|
|
408 | } |
|
|
409 | |
|
|
410 | void |
|
|
411 | rxvt_perl_interp::usage (rxvt_term *term, int type) |
|
|
412 | { |
|
|
413 | localise_env set_environ (perl_environ); |
|
|
414 | |
|
|
415 | ENTER; |
|
|
416 | SAVETMPS; |
|
|
417 | |
|
|
418 | dSP; |
|
|
419 | PUSHMARK (SP); |
|
|
420 | EXTEND (SP, 2); |
|
|
421 | PUSHs (sv_2mortal (newSVterm (term))); |
|
|
422 | PUSHs (sv_2mortal (newSViv (type))); |
|
|
423 | PUTBACK; |
|
|
424 | call_pv ("urxvt::usage", G_VOID | G_DISCARD); |
|
|
425 | |
|
|
426 | FREETMPS; |
|
|
427 | LEAVE; |
|
|
428 | } |
|
|
429 | |
|
|
430 | uint8_t |
|
|
431 | rxvt_perl_interp::parse_resource (rxvt_term *term, const char *name, bool arg, bool longopt, bool flag, const char *value) |
|
|
432 | { |
|
|
433 | localise_env set_environ (perl_environ); |
|
|
434 | |
|
|
435 | ENTER; |
|
|
436 | SAVETMPS; |
|
|
437 | |
|
|
438 | dSP; |
|
|
439 | PUSHMARK (SP); |
|
|
440 | EXTEND (SP, 6); |
|
|
441 | PUSHs (sv_2mortal (newSVterm (term))); |
|
|
442 | PUSHs (sv_2mortal (newSVpv (name, 0))); |
|
|
443 | PUSHs (arg ? &PL_sv_yes : &PL_sv_no); |
|
|
444 | PUSHs (longopt ? &PL_sv_yes : &PL_sv_no); |
|
|
445 | PUSHs (flag ? &PL_sv_yes : &PL_sv_no); |
|
|
446 | PUSHs (value ? sv_2mortal (newSVpv (value, 0)) : &PL_sv_undef); |
|
|
447 | PUTBACK; |
|
|
448 | call_pv ("urxvt::parse_resource", G_SCALAR); |
|
|
449 | SPAGAIN; |
|
|
450 | |
|
|
451 | uint8_t ret = POPi; |
|
|
452 | |
|
|
453 | FREETMPS; |
|
|
454 | LEAVE; |
|
|
455 | |
|
|
456 | return ret; |
367 | } |
457 | } |
368 | |
458 | |
369 | static void |
459 | static void |
370 | ungrab (rxvt_term *THIS) |
460 | ungrab (rxvt_term *THIS) |
371 | { |
461 | { |
… | |
… | |
381 | rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) |
471 | rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) |
382 | { |
472 | { |
383 | if (!perl || !term->perl.self) |
473 | if (!perl || !term->perl.self) |
384 | return false; |
474 | return false; |
385 | |
475 | |
|
|
476 | localise_env set_environ (perl_environ); |
|
|
477 | |
386 | // pre-handling of some events |
478 | // pre-handling of some events |
387 | if (htype == HOOK_REFRESH_END) |
479 | if (htype == HOOK_REFRESH_END) |
388 | { |
480 | { |
389 | AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); |
481 | AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); |
390 | |
482 | |
391 | for (int i = 0; i <= AvFILL (av); i++) |
483 | for (int i = 0; i <= AvFILL (av); i++) |
392 | ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); |
484 | ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); |
393 | } |
485 | } |
|
|
486 | else if (htype == HOOK_DESTROY) |
|
|
487 | { |
|
|
488 | AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, 0)); |
394 | |
489 | |
395 | swap (perl_environ, environ); |
490 | for (int i = AvFILL (av); i >= 0; i--) |
|
|
491 | { |
|
|
492 | rxvt_selection *req = (rxvt_selection *)SvIV (*av_fetch (av, i, 0)); |
|
|
493 | delete req; |
|
|
494 | } |
|
|
495 | } |
396 | |
496 | |
397 | bool event_consumed; |
497 | bool event_consumed; |
398 | |
498 | |
399 | if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always |
|
|
400 | || term->perl.should_invoke [htype]) |
499 | if (term->perl.should_invoke [htype]) |
401 | try |
|
|
402 | { |
500 | { |
403 | dSP; |
501 | dSP; |
404 | va_list ap; |
502 | va_list ap; |
405 | |
503 | |
406 | va_start (ap, htype); |
504 | va_start (ap, htype); |
407 | |
505 | |
408 | ENTER; |
506 | ENTER; |
409 | SAVETMPS; |
507 | SAVETMPS; |
410 | |
508 | |
411 | PUSHMARK (SP); |
509 | PUSHMARK (SP); |
412 | |
510 | |
|
|
511 | EXTEND (SP, 2); |
413 | XPUSHs (sv_2mortal (newSVterm (term))); |
512 | PUSHs (sv_2mortal (newSVterm (term))); |
414 | XPUSHs (sv_2mortal (newSViv (htype))); |
513 | PUSHs (sv_2mortal (newSViv (htype))); |
415 | |
514 | |
416 | for (;;) { |
515 | for (;;) { |
417 | data_type dt = (data_type)va_arg (ap, int); |
516 | data_type dt = (data_type)va_arg (ap, int); |
418 | |
517 | |
419 | switch (dt) |
518 | switch (dt) |
420 | { |
519 | { |
421 | case DT_INT: |
520 | case DT_INT: |
422 | XPUSHs (sv_2mortal (newSViv (va_arg (ap, int)))); |
521 | XPUSHs (sv_2mortal (newSViv (va_arg (ap, int)))); |
423 | break; |
522 | break; |
424 | |
523 | |
425 | case DT_LONG: |
524 | case DT_LONG: |
426 | XPUSHs (sv_2mortal (newSViv (va_arg (ap, long)))); |
525 | XPUSHs (sv_2mortal (newSViv (va_arg (ap, long)))); |
427 | break; |
526 | break; |
428 | |
527 | |
429 | case DT_STR: |
528 | case DT_STR: |
430 | XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0))); |
529 | XPUSHs (sv_2mortal (newSVpv (va_arg (ap, char *), 0))); |
431 | break; |
530 | break; |
432 | |
531 | |
433 | case DT_STR_LEN: |
532 | case DT_STR_LEN: |
434 | { |
533 | { |
435 | char *str = va_arg (ap, char *); |
534 | char *str = va_arg (ap, char *); |
436 | int len = va_arg (ap, int); |
535 | int len = va_arg (ap, int); |
437 | |
536 | |
438 | XPUSHs (sv_2mortal (newSVpvn (str, len))); |
537 | XPUSHs (sv_2mortal (newSVpvn (str, len))); |
439 | } |
538 | } |
440 | break; |
539 | break; |
441 | |
540 | |
442 | case DT_WCS_LEN: |
541 | case DT_WCS_LEN: |
443 | { |
542 | { |
444 | wchar_t *wstr = va_arg (ap, wchar_t *); |
543 | wchar_t *wstr = va_arg (ap, wchar_t *); |
445 | int wlen = va_arg (ap, int); |
544 | int wlen = va_arg (ap, int); |
446 | |
545 | |
447 | XPUSHs (sv_2mortal (wcs2sv (wstr, wlen))); |
546 | XPUSHs (sv_2mortal (wcs2sv (wstr, wlen))); |
448 | } |
547 | } |
449 | break; |
548 | break; |
450 | |
549 | |
451 | case DT_LCS_LEN: |
550 | case DT_LCS_LEN: |
452 | { |
551 | { |
453 | long *lstr = va_arg (ap, long *); |
552 | long *lstr = va_arg (ap, long *); |
454 | int llen = va_arg (ap, int); |
553 | int llen = va_arg (ap, int); |
455 | |
554 | |
456 | XPUSHs (sv_2mortal (newSVpvn ((char *)lstr, llen * sizeof (long)))); |
555 | XPUSHs (sv_2mortal (newSVpvn ((char *)lstr, llen * sizeof (long)))); |
457 | } |
556 | } |
458 | break; |
557 | break; |
459 | |
558 | |
460 | case DT_XEVENT: |
559 | case DT_XEVENT: |
461 | { |
560 | { |
462 | XEvent *xe = va_arg (ap, XEvent *); |
561 | XEvent *xe = va_arg (ap, XEvent *); |
463 | HV *hv = newHV (); |
562 | HV *hv = newHV (); |
464 | |
563 | |
465 | # define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0) |
564 | # define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0) |
466 | # define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0) |
565 | # define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0) |
467 | # define setuv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSVuv (val), 0) |
566 | # define setuv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSVuv (val), 0) |
468 | # undef set |
567 | # undef set |
469 | |
568 | |
470 | setiv (type, xe->type); |
569 | setiv (type, xe->type); |
471 | setiv (send_event, xe->xany.send_event); |
570 | setiv (send_event, xe->xany.send_event); |
472 | setiv (serial, xe->xany.serial); |
571 | setiv (serial, xe->xany.serial); |
473 | |
572 | |
474 | switch (xe->type) |
573 | switch (xe->type) |
475 | { |
574 | { |
476 | case KeyPress: |
575 | case KeyPress: |
477 | case KeyRelease: |
576 | case KeyRelease: |
478 | case ButtonPress: |
577 | case ButtonPress: |
479 | case ButtonRelease: |
578 | case ButtonRelease: |
480 | case MotionNotify: |
579 | case MotionNotify: |
481 | setuv (window, xe->xmotion.window); |
580 | setuv (window, xe->xmotion.window); |
482 | setuv (root, xe->xmotion.root); |
581 | setuv (root, xe->xmotion.root); |
483 | setuv (subwindow, xe->xmotion.subwindow); |
582 | setuv (subwindow, xe->xmotion.subwindow); |
484 | setuv (time, xe->xmotion.time); |
583 | setuv (time, xe->xmotion.time); |
485 | setiv (x, xe->xmotion.x); |
584 | setiv (x, xe->xmotion.x); |
486 | setiv (y, xe->xmotion.y); |
585 | setiv (y, xe->xmotion.y); |
487 | setiv (row, xe->xmotion.y / term->fheight + term->view_start); |
586 | setiv (row, xe->xmotion.y / term->fheight + term->view_start); |
488 | setiv (col, xe->xmotion.x / term->fwidth); |
587 | setiv (col, xe->xmotion.x / term->fwidth); |
489 | setiv (x_root, xe->xmotion.x_root); |
588 | setiv (x_root, xe->xmotion.x_root); |
490 | setiv (y_root, xe->xmotion.y_root); |
589 | setiv (y_root, xe->xmotion.y_root); |
491 | setuv (state, xe->xmotion.state); |
590 | setuv (state, xe->xmotion.state); |
492 | |
591 | |
493 | switch (xe->type) |
592 | switch (xe->type) |
494 | { |
593 | { |
495 | case KeyPress: |
594 | case KeyPress: |
496 | case KeyRelease: |
595 | case KeyRelease: |
497 | setuv (keycode, xe->xkey.keycode); |
596 | setuv (keycode, xe->xkey.keycode); |
498 | break; |
597 | break; |
499 | |
598 | |
500 | case ButtonPress: |
599 | case ButtonPress: |
501 | case ButtonRelease: |
600 | case ButtonRelease: |
502 | setuv (button, xe->xbutton.button); |
601 | setuv (button, xe->xbutton.button); |
503 | break; |
602 | break; |
504 | |
603 | |
505 | case MotionNotify: |
604 | case MotionNotify: |
506 | setiv (is_hint, xe->xmotion.is_hint); |
605 | setiv (is_hint, xe->xmotion.is_hint); |
507 | break; |
606 | break; |
508 | } |
607 | } |
509 | |
608 | |
510 | break; |
609 | break; |
511 | |
610 | |
512 | case MapNotify: |
611 | case MapNotify: |
513 | case UnmapNotify: |
612 | case UnmapNotify: |
514 | case ConfigureNotify: |
613 | case ConfigureNotify: |
515 | setuv (event, xe->xconfigure.event); |
614 | setuv (event, xe->xconfigure.event); |
516 | setuv (window, xe->xconfigure.window); |
615 | setuv (window, xe->xconfigure.window); |
517 | |
616 | |
518 | switch (xe->type) |
617 | switch (xe->type) |
519 | { |
618 | { |
520 | case ConfigureNotify: |
619 | case ConfigureNotify: |
521 | setiv (x, xe->xconfigure.x); |
620 | setiv (x, xe->xconfigure.x); |
522 | setiv (y, xe->xconfigure.y); |
621 | setiv (y, xe->xconfigure.y); |
523 | setiv (width, xe->xconfigure.width); |
622 | setiv (width, xe->xconfigure.width); |
524 | setiv (height, xe->xconfigure.height); |
623 | setiv (height, xe->xconfigure.height); |
525 | setuv (above, xe->xconfigure.above); |
624 | setuv (above, xe->xconfigure.above); |
526 | break; |
625 | break; |
527 | } |
626 | } |
528 | |
627 | |
529 | break; |
628 | break; |
530 | |
629 | |
531 | case PropertyNotify: |
630 | case PropertyNotify: |
532 | setuv (window, xe->xproperty.window); |
631 | setuv (window, xe->xproperty.window); |
533 | setuv (atom, xe->xproperty.atom); |
632 | setuv (atom, xe->xproperty.atom); |
534 | setuv (time, xe->xproperty.time); |
633 | setuv (time, xe->xproperty.time); |
535 | setiv (state, xe->xproperty.state); |
634 | setiv (state, xe->xproperty.state); |
536 | break; |
635 | break; |
537 | |
636 | |
538 | case ClientMessage: |
637 | case ClientMessage: |
539 | setuv (window, xe->xclient.window); |
638 | setuv (window, xe->xclient.window); |
540 | setuv (message_type, xe->xclient.message_type); |
639 | setuv (message_type, xe->xclient.message_type); |
541 | setuv (format, xe->xclient.format); |
640 | setuv (format, xe->xclient.format); |
542 | setuv (l0, xe->xclient.data.l[0]); |
641 | setuv (l0, xe->xclient.data.l[0]); |
543 | setuv (l1, xe->xclient.data.l[1]); |
642 | setuv (l1, xe->xclient.data.l[1]); |
544 | setuv (l2, xe->xclient.data.l[2]); |
643 | setuv (l2, xe->xclient.data.l[2]); |
545 | setuv (l3, xe->xclient.data.l[3]); |
644 | setuv (l3, xe->xclient.data.l[3]); |
546 | setuv (l4, xe->xclient.data.l[4]); |
645 | setuv (l4, xe->xclient.data.l[4]); |
547 | break; |
646 | break; |
548 | } |
647 | } |
549 | |
648 | |
550 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); |
649 | XPUSHs (sv_2mortal (newRV_noinc ((SV *)hv))); |
551 | } |
650 | } |
552 | break; |
651 | break; |
553 | |
652 | |
554 | case DT_END: |
653 | case DT_END: |
555 | goto call; |
654 | goto call; |
556 | |
655 | |
557 | default: |
656 | default: |
558 | rxvt_fatal ("FATAL: unable to pass data type %d\n", dt); |
657 | rxvt_fatal ("FATAL: unable to pass data type %d\n", dt); |
559 | } |
658 | } |
|
|
659 | } |
|
|
660 | |
|
|
661 | call: |
|
|
662 | va_end (ap); |
|
|
663 | |
|
|
664 | PUTBACK; |
|
|
665 | int count = call_pv ("urxvt::invoke", G_ARRAY | G_EVAL); |
|
|
666 | SPAGAIN; |
|
|
667 | |
|
|
668 | if (count) |
|
|
669 | { |
|
|
670 | SV *status = POPs; |
|
|
671 | count = SvTRUE (status); |
560 | } |
672 | } |
561 | |
673 | |
562 | call: |
|
|
563 | va_end (ap); |
|
|
564 | |
|
|
565 | PUTBACK; |
674 | PUTBACK; |
566 | int count = call_pv ("urxvt::invoke", G_ARRAY | G_EVAL); |
|
|
567 | SPAGAIN; |
|
|
568 | |
|
|
569 | if (count) |
|
|
570 | { |
|
|
571 | SV *status = POPs; |
|
|
572 | count = SvTRUE (status); |
|
|
573 | } |
|
|
574 | |
|
|
575 | PUTBACK; |
|
|
576 | FREETMPS; |
675 | FREETMPS; |
577 | LEAVE; |
676 | LEAVE; |
578 | |
677 | |
579 | if (SvTRUE (ERRSV)) |
678 | if (SvTRUE (ERRSV)) |
580 | { |
679 | { |
581 | rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPV_nolen (ERRSV)); |
680 | rxvt_warn ("perl hook %d evaluation error: %s", htype, SvPVbyte_nolen (ERRSV)); |
582 | ungrab (term); // better lose the grab than the session |
681 | ungrab (term); // better lose the grab than the session |
583 | } |
682 | } |
584 | |
683 | |
585 | event_consumed = !!count; |
684 | event_consumed = !!count; |
586 | } |
685 | } |
587 | catch (...) |
|
|
588 | { |
|
|
589 | swap (perl_environ, environ); |
|
|
590 | throw; |
|
|
591 | } |
|
|
592 | else |
686 | else |
593 | event_consumed = false; |
687 | event_consumed = false; |
594 | |
688 | |
595 | // post-handling of some events |
689 | // post-handling of some events |
596 | if (htype == HOOK_REFRESH_BEGIN) |
690 | if (htype == HOOK_REFRESH_BEGIN) |
… | |
… | |
607 | |
701 | |
608 | // don't allow further calls |
702 | // don't allow further calls |
609 | term->perl.self = 0; |
703 | term->perl.self = 0; |
610 | } |
704 | } |
611 | |
705 | |
612 | swap (perl_environ, environ); |
|
|
613 | |
|
|
614 | return event_consumed; |
706 | return event_consumed; |
|
|
707 | } |
|
|
708 | |
|
|
709 | void |
|
|
710 | rxvt_perl_interp::selection_finish (rxvt_selection *sel, char *data, unsigned int len) |
|
|
711 | { |
|
|
712 | localise_env set_environ (perl_environ); |
|
|
713 | |
|
|
714 | ENTER; |
|
|
715 | SAVETMPS; |
|
|
716 | |
|
|
717 | dSP; |
|
|
718 | XPUSHs (sv_2mortal (newSVpvn (data, len))); |
|
|
719 | PUTBACK; |
|
|
720 | call_sv ((SV *)sel->cb_sv, G_VOID | G_DISCARD | G_EVAL); |
|
|
721 | |
|
|
722 | if (SvTRUE (ERRSV)) |
|
|
723 | rxvt_warn ("perl selection callback evaluation error: %s", SvPVbyte_nolen (ERRSV)); |
|
|
724 | |
|
|
725 | FREETMPS; |
|
|
726 | LEAVE; |
615 | } |
727 | } |
616 | |
728 | |
617 | ///////////////////////////////////////////////////////////////////////////// |
729 | ///////////////////////////////////////////////////////////////////////////// |
618 | |
730 | |
619 | MODULE = urxvt PACKAGE = urxvt |
731 | MODULE = urxvt PACKAGE = urxvt |
… | |
… | |
631 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
743 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
632 | # include "hookinc.h" |
744 | # include "hookinc.h" |
633 | # undef def |
745 | # undef def |
634 | |
746 | |
635 | HV *option = get_hv ("urxvt::OPTION", 1); |
747 | HV *option = get_hv ("urxvt::OPTION", 1); |
636 | # define def(name,val) hv_store (option, # name, sizeof (# name) - 1, newSVuv (Opt_ ## name), 0); |
748 | # define def(name) hv_store (option, # name, sizeof (# name) - 1, newSVuv (Opt_ ## name), 0); |
637 | # define nodef(name) |
749 | # define nodef(name) |
638 | # include "optinc.h" |
750 | # include "optinc.h" |
639 | # undef nodef |
751 | # undef nodef |
640 | # undef def |
752 | # undef def |
641 | |
753 | |
… | |
… | |
646 | } *civ, const_iv[] = { |
758 | } *civ, const_iv[] = { |
647 | # define const_iv(name) { # name, (IV)name } |
759 | # define const_iv(name) { # name, (IV)name } |
648 | const_iv (NUM_RESOURCES), |
760 | const_iv (NUM_RESOURCES), |
649 | const_iv (DEFAULT_RSTYLE), |
761 | const_iv (DEFAULT_RSTYLE), |
650 | const_iv (OVERLAY_RSTYLE), |
762 | const_iv (OVERLAY_RSTYLE), |
|
|
763 | const_iv (Color_Bits), |
|
|
764 | const_iv (RS_bgShift), const_iv (RS_bgMask), |
|
|
765 | const_iv (RS_fgShift), const_iv (RS_fgMask), |
|
|
766 | const_iv (RS_Careful), |
|
|
767 | const_iv (RS_fontCount), |
|
|
768 | const_iv (RS_fontShift), |
|
|
769 | const_iv (RS_fontMask), |
|
|
770 | const_iv (RS_baseattrMask), |
|
|
771 | const_iv (RS_attrMask), |
|
|
772 | const_iv (RS_redraw), |
|
|
773 | const_iv (RS_Sel), |
651 | const_iv (RS_Bold), |
774 | const_iv (RS_Bold), |
652 | const_iv (RS_Italic), |
775 | const_iv (RS_Italic), |
653 | const_iv (RS_Blink), |
776 | const_iv (RS_Blink), |
654 | const_iv (RS_RVid), |
777 | const_iv (RS_RVid), |
655 | const_iv (RS_Uline), |
778 | const_iv (RS_Uline), |
… | |
… | |
742 | const_iv (XIMSecondary), |
865 | const_iv (XIMSecondary), |
743 | const_iv (XIMTertiary), |
866 | const_iv (XIMTertiary), |
744 | const_iv (XIMVisibleToForward), |
867 | const_iv (XIMVisibleToForward), |
745 | const_iv (XIMVisibleToBackword), |
868 | const_iv (XIMVisibleToBackword), |
746 | const_iv (XIMVisibleToCenter), |
869 | const_iv (XIMVisibleToCenter), |
|
|
870 | #if XRENDER |
|
|
871 | const_iv (PictStandardARGB32), |
|
|
872 | const_iv (PictStandardRGB24), |
|
|
873 | const_iv (PictStandardA8), |
|
|
874 | const_iv (PictStandardA4), |
|
|
875 | const_iv (PictStandardA1), |
|
|
876 | const_iv (RepeatNone), |
|
|
877 | const_iv (RepeatNormal), |
|
|
878 | const_iv (RepeatPad), |
|
|
879 | const_iv (RepeatReflect), |
|
|
880 | #endif |
747 | # if 0 |
881 | # if 0 |
748 | const_iv (XIMForwardChar), |
882 | const_iv (XIMForwardChar), |
749 | const_iv (XIMBackwardChar), |
883 | const_iv (XIMBackwardChar), |
750 | const_iv (XIMForwardWord), |
884 | const_iv (XIMForwardWord), |
751 | const_iv (XIMBackwardWord), |
885 | const_iv (XIMBackwardWord), |
… | |
… | |
759 | const_iv (XIMDontChange), |
893 | const_iv (XIMDontChange), |
760 | # endif |
894 | # endif |
761 | # endif |
895 | # endif |
762 | }; |
896 | }; |
763 | |
897 | |
764 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
898 | for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--) |
765 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
899 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
766 | } |
900 | } |
|
|
901 | |
|
|
902 | void |
|
|
903 | log (const char *msg) |
|
|
904 | CODE: |
|
|
905 | rxvt_log ("%s", msg); |
767 | |
906 | |
768 | void |
907 | void |
769 | warn (const char *msg) |
908 | warn (const char *msg) |
770 | CODE: |
909 | CODE: |
771 | rxvt_warn ("%s", msg); |
910 | rxvt_warn ("%s", msg); |
… | |
… | |
775 | CODE: |
914 | CODE: |
776 | rxvt_fatal ("%s", msg); |
915 | rxvt_fatal ("%s", msg); |
777 | |
916 | |
778 | void |
917 | void |
779 | _exit (int status) |
918 | _exit (int status) |
|
|
919 | |
|
|
920 | void |
|
|
921 | catch_fatal (SV *block) |
|
|
922 | PROTOTYPE: & |
|
|
923 | CODE: |
|
|
924 | try |
|
|
925 | { |
|
|
926 | PUSHMARK (SP); |
|
|
927 | PUTBACK; |
|
|
928 | call_sv (block, G_VOID | G_DISCARD); |
|
|
929 | SPAGAIN; |
|
|
930 | } |
|
|
931 | catch (const rxvt_failure_exception &e) |
|
|
932 | { |
|
|
933 | croak ("rxvt_fatal exception caught, trying to continue."); |
|
|
934 | } |
780 | |
935 | |
781 | NV |
936 | NV |
782 | NOW () |
937 | NOW () |
783 | CODE: |
938 | CODE: |
784 | RETVAL = ev::now (); |
939 | RETVAL = ev::now (); |
… | |
… | |
842 | for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) |
997 | for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) |
843 | if ((*t)->perl.self) |
998 | if ((*t)->perl.self) |
844 | PUSHs (sv_2mortal (newSVterm (*t))); |
999 | PUSHs (sv_2mortal (newSVterm (*t))); |
845 | } |
1000 | } |
846 | |
1001 | |
|
|
1002 | IV |
|
|
1003 | _new_selection_request (rxvt_term *term, int selnum, Time tm, Window win, Atom prop, SV *cb) |
|
|
1004 | CODE: |
|
|
1005 | rxvt_selection *req = new rxvt_selection (term->display, selnum, tm, win, prop, term); |
|
|
1006 | req->cb_sv = newSVsv (cb); |
|
|
1007 | AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, 0)); |
|
|
1008 | av_push (av, newSViv ((IV)req)); |
|
|
1009 | RETVAL = (IV)req; |
|
|
1010 | OUTPUT: |
|
|
1011 | RETVAL |
|
|
1012 | |
|
|
1013 | void |
|
|
1014 | _delete_selection_request (IV req_) |
|
|
1015 | CODE: |
|
|
1016 | rxvt_selection *req = (rxvt_selection *)req_; |
|
|
1017 | AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)req->term->perl.self), "_selection", 10, 0)); |
|
|
1018 | int i; |
|
|
1019 | |
|
|
1020 | for (i = AvFILL (av); i >= 0; i--) |
|
|
1021 | if (SvIV (*av_fetch (av, i, 1)) == req_) |
|
|
1022 | break; |
|
|
1023 | |
|
|
1024 | for (; i < AvFILL (av); i++) |
|
|
1025 | av_store (av, i, SvREFCNT_inc (*av_fetch (av, i + 1, 0))); |
|
|
1026 | |
|
|
1027 | av_pop (av); |
|
|
1028 | |
|
|
1029 | delete req; |
|
|
1030 | |
847 | MODULE = urxvt PACKAGE = urxvt::term |
1031 | MODULE = urxvt PACKAGE = urxvt::term |
848 | |
1032 | |
849 | SV * |
1033 | SV * |
850 | _new (AV *env, AV *arg) |
1034 | _new (AV *env, AV *arg) |
851 | CODE: |
1035 | CODE: |
852 | { |
1036 | { |
853 | rxvt_term *term = new rxvt_term; |
1037 | rxvt_term *term = new rxvt_term; |
854 | |
1038 | |
855 | stringvec *argv = new stringvec; |
1039 | stringvec *argv = new stringvec; |
856 | stringvec *envv = new stringvec; |
|
|
857 | |
|
|
858 | for (int i = 0; i <= AvFILL (arg); i++) |
1040 | for (int i = 0; i <= AvFILL (arg); i++) |
859 | argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); |
1041 | argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); |
860 | |
1042 | |
|
|
1043 | stringvec *envv = new stringvec; |
861 | for (int i = AvFILL (env) + 1; i--; ) |
1044 | for (int i = AvFILL (env) + 1; i--; ) |
862 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
1045 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
863 | |
1046 | |
864 | envv->push_back (0); |
|
|
865 | |
|
|
866 | try |
1047 | try |
867 | { |
1048 | { |
868 | term->init (argv, envv); |
1049 | term->init (argv, envv); |
869 | } |
1050 | } |
870 | catch (const class rxvt_failure_exception &e) |
1051 | catch (const class rxvt_failure_exception &e) |
… | |
… | |
883 | rxvt_term::destroy () |
1064 | rxvt_term::destroy () |
884 | |
1065 | |
885 | void |
1066 | void |
886 | rxvt_term::set_should_invoke (int htype, int inc) |
1067 | rxvt_term::set_should_invoke (int htype, int inc) |
887 | CODE: |
1068 | CODE: |
888 | THIS->perl.should_invoke [htype] += inc; |
1069 | uint8_t &count = THIS->perl.should_invoke [htype]; |
|
|
1070 | uint8_t prev = count; |
|
|
1071 | count += inc; |
|
|
1072 | if (!prev != !count) |
|
|
1073 | { |
|
|
1074 | // hook status changed, react |
|
|
1075 | switch (htype) |
|
|
1076 | { |
|
|
1077 | case HOOK_POSITION_CHANGE: |
|
|
1078 | if (count) |
|
|
1079 | THIS->get_window_origin (THIS->parent_x, THIS->parent_y); |
|
|
1080 | } |
|
|
1081 | } |
|
|
1082 | |
|
|
1083 | void |
|
|
1084 | rxvt_term::put_option_db (octet_string specifier, octet_string value) |
|
|
1085 | CODE: |
|
|
1086 | XrmPutStringResource (&THIS->option_db, specifier, value); |
889 | |
1087 | |
890 | int |
1088 | int |
891 | rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) |
1089 | rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) |
892 | CODE: |
1090 | CODE: |
893 | RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1, |
1091 | RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1, |
… | |
… | |
909 | |
1107 | |
910 | void |
1108 | void |
911 | rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) |
1109 | rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) |
912 | CODE: |
1110 | CODE: |
913 | XUngrabKey (THIS->dpy, keycode, modifiers, window); |
1111 | XUngrabKey (THIS->dpy, keycode, modifiers, window); |
914 | |
|
|
915 | void |
|
|
916 | rxvt_term::XUngrabKeyboard (Time eventtime) |
|
|
917 | CODE: |
|
|
918 | XUngrabKeyboard (THIS->dpy, eventtime); |
|
|
919 | |
1112 | |
920 | bool |
1113 | bool |
921 | rxvt_term::grab (Time eventtime, int sync = 0) |
1114 | rxvt_term::grab (Time eventtime, int sync = 0) |
922 | CODE: |
1115 | CODE: |
923 | { |
1116 | { |
… | |
… | |
1038 | free (wstr); |
1231 | free (wstr); |
1039 | } |
1232 | } |
1040 | OUTPUT: |
1233 | OUTPUT: |
1041 | RETVAL |
1234 | RETVAL |
1042 | |
1235 | |
1043 | char * |
|
|
1044 | rxvt_term::locale () |
|
|
1045 | CODE: |
|
|
1046 | RETVAL = THIS->locale; |
|
|
1047 | OUTPUT: |
|
|
1048 | RETVAL |
|
|
1049 | |
|
|
1050 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1236 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1051 | |
1237 | |
1052 | #define TERM_OFFSET_width TERM_OFFSET(width) |
1238 | #define TERM_OFFSET_width TERM_OFFSET(width) |
1053 | #define TERM_OFFSET_height TERM_OFFSET(height) |
1239 | #define TERM_OFFSET_height TERM_OFFSET(height) |
1054 | #define TERM_OFFSET_fwidth TERM_OFFSET(fwidth) |
1240 | #define TERM_OFFSET_fwidth TERM_OFFSET(fwidth) |
1055 | #define TERM_OFFSET_fheight TERM_OFFSET(fheight) |
1241 | #define TERM_OFFSET_fheight TERM_OFFSET(fheight) |
1056 | #define TERM_OFFSET_fbase TERM_OFFSET(fbase) |
1242 | #define TERM_OFFSET_fbase TERM_OFFSET(fbase) |
1057 | #define TERM_OFFSET_nrow TERM_OFFSET(nrow) |
1243 | #define TERM_OFFSET_nrow TERM_OFFSET(nrow) |
1058 | #define TERM_OFFSET_ncol TERM_OFFSET(ncol) |
1244 | #define TERM_OFFSET_ncol TERM_OFFSET(ncol) |
1059 | #define TERM_OFFSET_focus TERM_OFFSET(focus) |
1245 | #define TERM_OFFSET_focus TERM_OFFSET(focus) |
1060 | #define TERM_OFFSET_mapped TERM_OFFSET(mapped) |
1246 | #define TERM_OFFSET_mapped TERM_OFFSET(mapped) |
1061 | #define TERM_OFFSET_int_bwidth TERM_OFFSET(int_bwidth) |
1247 | #define TERM_OFFSET_int_bwidth TERM_OFFSET(int_bwidth) |
1062 | #define TERM_OFFSET_ext_bwidth TERM_OFFSET(ext_bwidth) |
1248 | #define TERM_OFFSET_ext_bwidth TERM_OFFSET(ext_bwidth) |
1063 | #define TERM_OFFSET_lineSpace TERM_OFFSET(lineSpace) |
1249 | #define TERM_OFFSET_lineSpace TERM_OFFSET(lineSpace) |
|
|
1250 | #define TERM_OFFSET_letterSpace TERM_OFFSET(letterSpace) |
1064 | #define TERM_OFFSET_saveLines TERM_OFFSET(saveLines) |
1251 | #define TERM_OFFSET_saveLines TERM_OFFSET(saveLines) |
1065 | #define TERM_OFFSET_total_rows TERM_OFFSET(total_rows) |
1252 | #define TERM_OFFSET_total_rows TERM_OFFSET(total_rows) |
1066 | #define TERM_OFFSET_top_row TERM_OFFSET(top_row) |
1253 | #define TERM_OFFSET_top_row TERM_OFFSET(top_row) |
1067 | |
1254 | |
1068 | int |
1255 | int |
1069 | rxvt_term::width () |
1256 | rxvt_term::width () |
1070 | ALIAS: |
1257 | ALIAS: |
1071 | width = TERM_OFFSET_width |
1258 | width = TERM_OFFSET_width |
1072 | height = TERM_OFFSET_height |
1259 | height = TERM_OFFSET_height |
1073 | fwidth = TERM_OFFSET_fwidth |
1260 | fwidth = TERM_OFFSET_fwidth |
1074 | fheight = TERM_OFFSET_fheight |
1261 | fheight = TERM_OFFSET_fheight |
1075 | fbase = TERM_OFFSET_fbase |
1262 | fbase = TERM_OFFSET_fbase |
1076 | nrow = TERM_OFFSET_nrow |
1263 | nrow = TERM_OFFSET_nrow |
1077 | ncol = TERM_OFFSET_ncol |
1264 | ncol = TERM_OFFSET_ncol |
1078 | focus = TERM_OFFSET_focus |
1265 | focus = TERM_OFFSET_focus |
1079 | mapped = TERM_OFFSET_mapped |
1266 | mapped = TERM_OFFSET_mapped |
1080 | int_bwidth = TERM_OFFSET_int_bwidth |
1267 | int_bwidth = TERM_OFFSET_int_bwidth |
1081 | ext_bwidth = TERM_OFFSET_ext_bwidth |
1268 | ext_bwidth = TERM_OFFSET_ext_bwidth |
1082 | lineSpace = TERM_OFFSET_lineSpace |
1269 | lineSpace = TERM_OFFSET_lineSpace |
|
|
1270 | letterSpace = TERM_OFFSET_letterSpace |
1083 | saveLines = TERM_OFFSET_saveLines |
1271 | saveLines = TERM_OFFSET_saveLines |
1084 | total_rows = TERM_OFFSET_total_rows |
1272 | total_rows = TERM_OFFSET_total_rows |
1085 | top_row = TERM_OFFSET_top_row |
1273 | top_row = TERM_OFFSET_top_row |
1086 | CODE: |
1274 | CODE: |
1087 | RETVAL = *(int *)((char *)THIS + ix); |
1275 | RETVAL = *(int *)((char *)THIS + ix); |
1088 | OUTPUT: |
1276 | OUTPUT: |
1089 | RETVAL |
1277 | RETVAL |
1090 | |
1278 | |
… | |
… | |
1156 | RETVAL |
1344 | RETVAL |
1157 | |
1345 | |
1158 | Window |
1346 | Window |
1159 | rxvt_term::parent () |
1347 | rxvt_term::parent () |
1160 | CODE: |
1348 | CODE: |
1161 | RETVAL = THIS->parent [0]; |
1349 | RETVAL = THIS->parent; |
1162 | OUTPUT: |
1350 | OUTPUT: |
1163 | RETVAL |
1351 | RETVAL |
1164 | |
1352 | |
1165 | Window |
1353 | int |
1166 | rxvt_term::vt () |
1354 | rxvt_term::parent_x () |
1167 | CODE: |
1355 | CODE: |
1168 | RETVAL = THIS->vt; |
1356 | RETVAL = THIS->parent_x; |
|
|
1357 | OUTPUT: |
|
|
1358 | RETVAL |
|
|
1359 | |
|
|
1360 | int |
|
|
1361 | rxvt_term::parent_y () |
|
|
1362 | CODE: |
|
|
1363 | RETVAL = THIS->parent_y; |
1169 | OUTPUT: |
1364 | OUTPUT: |
1170 | RETVAL |
1365 | RETVAL |
1171 | |
1366 | |
1172 | void |
1367 | void |
1173 | rxvt_term::vt_emask_add (U32 emask) |
1368 | rxvt_term::vt_emask_add (U32 emask) |
… | |
… | |
1193 | if (newval <= 0) |
1388 | if (newval <= 0) |
1194 | THIS->scr_changeview (max (newval, THIS->top_row)); |
1389 | THIS->scr_changeview (max (newval, THIS->top_row)); |
1195 | } |
1390 | } |
1196 | OUTPUT: |
1391 | OUTPUT: |
1197 | RETVAL |
1392 | RETVAL |
|
|
1393 | |
|
|
1394 | void |
|
|
1395 | rxvt_term::set_urgency (bool enable) |
1198 | |
1396 | |
1199 | void |
1397 | void |
1200 | rxvt_term::focus_in () |
1398 | rxvt_term::focus_in () |
1201 | |
1399 | |
1202 | void |
1400 | void |
… | |
… | |
1435 | # include "rsinc.h" |
1633 | # include "rsinc.h" |
1436 | # undef def |
1634 | # undef def |
1437 | # undef reserve |
1635 | # undef reserve |
1438 | }; |
1636 | }; |
1439 | |
1637 | |
1440 | rs = rslist + sizeof (rslist) / sizeof (rslist [0]); |
1638 | rs = rslist + ecb_array_length (rslist); |
1441 | |
1639 | |
1442 | if (*name) |
1640 | if (*name) |
1443 | { |
1641 | { |
1444 | do { |
1642 | do { |
1445 | if (rs-- == rslist) |
1643 | if (rs-- == rslist) |
… | |
… | |
1484 | |
1682 | |
1485 | if (set >= 0) |
1683 | if (set >= 0) |
1486 | { |
1684 | { |
1487 | THIS->set_option (optval, set); |
1685 | THIS->set_option (optval, set); |
1488 | |
1686 | |
1489 | if (THIS->env_colorfgbg [0]) // avoid doing this before START |
1687 | if (THIS->init_done) // avoid doing this before START |
1490 | switch (optval) |
1688 | switch (optval) |
1491 | { |
1689 | { |
1492 | case Opt_skipBuiltinGlyphs: |
1690 | case Opt_skipBuiltinGlyphs: |
1493 | THIS->set_fonts (); |
1691 | THIS->set_fonts (); |
1494 | THIS->scr_remap_chars (); |
1692 | THIS->scr_remap_chars (); |
1495 | THIS->scr_touch (true); |
1693 | THIS->scr_touch (true); |
1496 | THIS->want_refresh = 1; |
1694 | THIS->want_refresh = 1; |
1497 | THIS->refresh_check (); |
1695 | THIS->refresh_check (); |
1498 | break; |
1696 | break; |
|
|
1697 | #ifdef CURSOR_BLINK |
|
|
1698 | case Opt_cursorBlink: |
|
|
1699 | THIS->cursor_blink_reset (); |
|
|
1700 | break; |
|
|
1701 | #endif |
1499 | |
1702 | |
1500 | case Opt_cursorUnderline: |
1703 | case Opt_cursorUnderline: |
1501 | THIS->want_refresh = 1; |
1704 | THIS->want_refresh = 1; |
1502 | THIS->refresh_check (); |
1705 | THIS->refresh_check (); |
1503 | break; |
1706 | break; |
… | |
… | |
1517 | CODE: |
1720 | CODE: |
1518 | RETVAL = 0 < THIS->parse_keysym (keysym, str); |
1721 | RETVAL = 0 < THIS->parse_keysym (keysym, str); |
1519 | THIS->keyboard->register_done (); |
1722 | THIS->keyboard->register_done (); |
1520 | OUTPUT: |
1723 | OUTPUT: |
1521 | RETVAL |
1724 | RETVAL |
|
|
1725 | |
|
|
1726 | void |
|
|
1727 | rxvt_term::register_command (int keysym, unsigned int state, SV *str) |
|
|
1728 | CODE: |
|
|
1729 | wchar_t *wstr = sv2wcs (str); |
|
|
1730 | THIS->keyboard->register_user_translation (keysym, state, wstr); |
|
|
1731 | free (wstr); |
1522 | |
1732 | |
1523 | void |
1733 | void |
1524 | rxvt_term::screen_cur (...) |
1734 | rxvt_term::screen_cur (...) |
1525 | PROTOTYPE: $;$$ |
1735 | PROTOTYPE: $;$$ |
1526 | ALIAS: |
1736 | ALIAS: |
… | |
… | |
1540 | EXTEND (SP, 2); |
1750 | EXTEND (SP, 2); |
1541 | PUSHs (sv_2mortal (newSViv (rc.row))); |
1751 | PUSHs (sv_2mortal (newSViv (rc.row))); |
1542 | PUSHs (sv_2mortal (newSViv (rc.col))); |
1752 | PUSHs (sv_2mortal (newSViv (rc.col))); |
1543 | } |
1753 | } |
1544 | |
1754 | |
1545 | if (items == 3) |
1755 | if (items >= 3) |
1546 | { |
1756 | { |
1547 | rc.row = SvIV (ST (1)); |
1757 | rc.row = SvIV (ST (1)); |
1548 | rc.col = SvIV (ST (2)); |
1758 | rc.col = SvIV (ST (2)); |
1549 | |
1759 | |
1550 | if (ix == 2) |
1760 | if (ix == 2) |
… | |
… | |
1566 | clamp_it (rc.col, 0, THIS->ncol); |
1776 | clamp_it (rc.col, 0, THIS->ncol); |
1567 | clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); |
1777 | clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); |
1568 | |
1778 | |
1569 | if (ix) |
1779 | if (ix) |
1570 | { |
1780 | { |
|
|
1781 | THIS->selection.screen = THIS->current_screen; |
|
|
1782 | |
1571 | THIS->want_refresh = 1; |
1783 | THIS->want_refresh = 1; |
1572 | THIS->refresh_check (); |
1784 | THIS->refresh_check (); |
1573 | } |
1785 | } |
1574 | } |
1786 | } |
1575 | } |
1787 | } |
1576 | |
1788 | |
1577 | char |
1789 | int |
1578 | rxvt_term::cur_charset () |
1790 | rxvt_term::selection_screen (int screen = -1) |
1579 | CODE: |
1791 | CODE: |
1580 | RETVAL = THIS->charsets [THIS->screen.charset]; |
1792 | RETVAL = THIS->selection.screen; |
1581 | OUTPUT: |
1793 | if (screen >= 0) |
|
|
1794 | THIS->selection.screen = screen; |
|
|
1795 | OUTPUT: |
1582 | RETVAL |
1796 | RETVAL |
1583 | |
1797 | |
1584 | void |
1798 | void |
1585 | rxvt_term::selection_clear () |
1799 | rxvt_term::selection_clear (bool clipboard = false) |
1586 | |
1800 | |
1587 | void |
1801 | void |
1588 | rxvt_term::selection_make (Time eventtime, bool rect = false) |
1802 | rxvt_term::selection_make (Time eventtime, bool rect = false) |
1589 | CODE: |
1803 | CODE: |
1590 | THIS->selection.op = SELECTION_CONT; |
1804 | THIS->selection.op = SELECTION_CONT; |
1591 | THIS->selection.rect = rect; |
1805 | THIS->selection.rect = rect; |
1592 | THIS->selection_make (eventtime); |
1806 | THIS->selection_make (eventtime); |
1593 | |
1807 | |
1594 | int |
1808 | int |
1595 | rxvt_term::selection_grab (Time eventtime) |
1809 | rxvt_term::selection_grab (Time eventtime, bool clipboard = false) |
1596 | |
1810 | |
1597 | void |
1811 | void |
1598 | rxvt_term::selection (SV *newtext = 0) |
1812 | rxvt_term::selection (SV *newtext = 0, bool clipboard = false) |
1599 | PPCODE: |
1813 | PPCODE: |
1600 | { |
1814 | { |
|
|
1815 | wchar_t * &text = clipboard ? THIS->selection.clip_text : THIS->selection.text; |
|
|
1816 | unsigned int &len = clipboard ? THIS->selection.clip_len : THIS->selection.len; |
|
|
1817 | |
1601 | if (GIMME_V != G_VOID) |
1818 | if (GIMME_V != G_VOID) |
1602 | XPUSHs (THIS->selection.text |
1819 | XPUSHs (text |
1603 | ? sv_2mortal (wcs2sv (THIS->selection.text, THIS->selection.len)) |
1820 | ? sv_2mortal (wcs2sv (text, len)) |
1604 | : &PL_sv_undef); |
1821 | : &PL_sv_undef); |
1605 | |
1822 | |
1606 | if (newtext) |
1823 | if (newtext) |
1607 | { |
1824 | { |
1608 | free (THIS->selection.text); |
1825 | free (text); |
1609 | |
1826 | |
1610 | THIS->selection.text = sv2wcs (newtext); |
1827 | text = sv2wcs (newtext); |
1611 | THIS->selection.len = wcslen (THIS->selection.text); |
1828 | len = wcslen (text); |
1612 | } |
1829 | } |
1613 | } |
1830 | } |
|
|
1831 | |
|
|
1832 | char |
|
|
1833 | rxvt_term::cur_charset () |
|
|
1834 | CODE: |
|
|
1835 | RETVAL = THIS->charsets [THIS->screen.charset]; |
|
|
1836 | OUTPUT: |
|
|
1837 | RETVAL |
1614 | |
1838 | |
1615 | void |
1839 | void |
1616 | 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) |
1840 | 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) |
1617 | |
1841 | |
1618 | void |
1842 | void |
1619 | rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle = RS_RVid) |
1843 | rxvt_term::scr_xor_span (int beg_row, int beg_col, int end_row, int end_col, U32 rstyle = RS_RVid) |
1620 | |
1844 | |
1621 | void |
1845 | void |
1622 | rxvt_term::scr_bell () |
1846 | rxvt_term::scr_bell () |
|
|
1847 | |
|
|
1848 | void |
|
|
1849 | rxvt_term::scr_recolour (bool refresh = true); |
1623 | |
1850 | |
1624 | void |
1851 | void |
1625 | rxvt_term::scr_change_screen (int screen) |
1852 | rxvt_term::scr_change_screen (int screen) |
1626 | |
1853 | |
1627 | void |
1854 | void |
… | |
… | |
1640 | char *str = SvPVbyte (octets, len); |
1867 | char *str = SvPVbyte (octets, len); |
1641 | C_ARGS: |
1868 | C_ARGS: |
1642 | str, len |
1869 | str, len |
1643 | |
1870 | |
1644 | void |
1871 | void |
|
|
1872 | rxvt_term::tt_paste (SV *octets) |
|
|
1873 | INIT: |
|
|
1874 | STRLEN len; |
|
|
1875 | char *str = SvPVbyte (octets, len); |
|
|
1876 | C_ARGS: |
|
|
1877 | str, len |
|
|
1878 | |
|
|
1879 | void |
1645 | rxvt_term::cmd_parse (SV *octets) |
1880 | rxvt_term::cmd_parse (SV *octets) |
1646 | CODE: |
1881 | CODE: |
1647 | { |
1882 | { |
1648 | STRLEN len; |
1883 | STRLEN len; |
1649 | char *str = SvPVbyte (octets, len); |
1884 | char *str = SvPVbyte (octets, len); |
… | |
… | |
1734 | type, format, PropModeReplace, |
1969 | type, format, PropModeReplace, |
1735 | (unsigned char *)data_, len / elemsize); |
1970 | (unsigned char *)data_, len / elemsize); |
1736 | } |
1971 | } |
1737 | |
1972 | |
1738 | Atom |
1973 | Atom |
1739 | XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) |
1974 | XInternAtom (rxvt_term *term, octet_string atom_name, int only_if_exists = FALSE) |
1740 | C_ARGS: term->dpy, atom_name, only_if_exists |
1975 | C_ARGS: term->dpy, atom_name, only_if_exists |
1741 | |
1976 | |
1742 | char * |
1977 | char * |
1743 | XGetAtomName (rxvt_term *term, Atom atom) |
1978 | XGetAtomName (rxvt_term *term, Atom atom) |
1744 | C_ARGS: term->dpy, atom |
1979 | C_ARGS: term->dpy, atom |
1745 | CLEANUP: |
1980 | CLEANUP: |
1746 | XFree (RETVAL); |
1981 | XFree (RETVAL); |
1747 | |
1982 | |
1748 | void |
1983 | void |
1749 | XDeleteProperty (rxvt_term *term, Window window, Atom property) |
1984 | XDeleteProperty (rxvt_term *term, Window window, Atom property) |
1750 | C_ARGS: term->dpy, window, property |
1985 | C_ARGS: term->dpy, window, property |
1751 | |
1986 | |
1752 | Window |
1987 | Window |
1753 | rxvt_term::DefaultRootWindow () |
1988 | rxvt_term::DefaultRootWindow () |
1754 | CODE: |
1989 | CODE: |
1755 | RETVAL = THIS->display->root; |
1990 | RETVAL = THIS->display->root; |
… | |
… | |
1807 | PUSHs (newSVuv (child)); |
2042 | PUSHs (newSVuv (child)); |
1808 | } |
2043 | } |
1809 | } |
2044 | } |
1810 | |
2045 | |
1811 | ############################################################################# |
2046 | ############################################################################# |
|
|
2047 | # fancy bg bloatstuff (TODO: should be moved up somewhere) |
|
|
2048 | |
|
|
2049 | bool |
|
|
2050 | rxvt_term::has_render () |
|
|
2051 | CODE: |
|
|
2052 | RETVAL = THIS->display->flags & DISPLAY_HAS_RENDER; |
|
|
2053 | OUTPUT: |
|
|
2054 | RETVAL |
|
|
2055 | |
|
|
2056 | void |
|
|
2057 | rxvt_term::background_geometry (bool border = false) |
|
|
2058 | PPCODE: |
|
|
2059 | EXTEND (SP, 4); |
|
|
2060 | PUSHs (sv_2mortal (newSViv (THIS->parent_x + (border ? THIS->window_vt_x : 0)))); |
|
|
2061 | PUSHs (sv_2mortal (newSViv (THIS->parent_y + (border ? THIS->window_vt_y : 0)))); |
|
|
2062 | PUSHs (sv_2mortal (newSViv (border ? THIS->vt_width : THIS->szHint.width ))); |
|
|
2063 | PUSHs (sv_2mortal (newSViv (border ? THIS->vt_height : THIS->szHint.height))); |
|
|
2064 | |
|
|
2065 | #if HAVE_IMG |
|
|
2066 | |
|
|
2067 | rxvt_img * |
|
|
2068 | rxvt_term::new_img (SV *format, int width = 1, int height = 1) |
|
|
2069 | CODE: |
|
|
2070 | XRenderPictFormat *f = SvOK (format) |
|
|
2071 | ? XRenderFindStandardFormat (THIS->dpy, SvIV (format)) |
|
|
2072 | : XRenderFindVisualFormat (THIS->dpy, THIS->visual); |
|
|
2073 | RETVAL = new rxvt_img (THIS, f, 0, 0, width, height); |
|
|
2074 | RETVAL->alloc (); |
|
|
2075 | OUTPUT: |
|
|
2076 | RETVAL |
|
|
2077 | |
|
|
2078 | #if ENABLE_TRANSPARENCY |
|
|
2079 | |
|
|
2080 | rxvt_img * |
|
|
2081 | rxvt_term::new_img_from_root () |
|
|
2082 | CODE: |
|
|
2083 | RETVAL = rxvt_img::new_from_root (THIS); |
|
|
2084 | OUTPUT: |
|
|
2085 | RETVAL |
|
|
2086 | |
|
|
2087 | #endif |
|
|
2088 | |
|
|
2089 | #if HAVE_PIXBUF |
|
|
2090 | |
|
|
2091 | rxvt_img * |
|
|
2092 | rxvt_term::new_img_from_file (octet_string filename) |
|
|
2093 | CODE: |
|
|
2094 | try |
|
|
2095 | { |
|
|
2096 | RETVAL = rxvt_img::new_from_file (THIS, filename); |
|
|
2097 | } |
|
|
2098 | catch (const class rxvt_failure_exception &e) |
|
|
2099 | { |
|
|
2100 | croak ("new_img_from_file failed"); |
|
|
2101 | } |
|
|
2102 | OUTPUT: |
|
|
2103 | RETVAL |
|
|
2104 | |
|
|
2105 | #endif |
|
|
2106 | |
|
|
2107 | #if HAVE_BG_PIXMAP |
|
|
2108 | |
|
|
2109 | void |
|
|
2110 | rxvt_term::set_background (rxvt_img *img, bool border = false) |
|
|
2111 | CODE: |
|
|
2112 | THIS->bg_destroy (); |
|
|
2113 | THIS->bg_flags &= ~(rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER | rxvt_term::BG_IS_TRANSPARENT); |
|
|
2114 | |
|
|
2115 | if (img) // TODO: cannot be false |
|
|
2116 | { |
|
|
2117 | img = img->clone (); // own the img |
|
|
2118 | |
|
|
2119 | if (img->repeat != RepeatNormal) // X11 only supports RepeatNormal as bg pixmap |
|
|
2120 | img->sub_rect (0, 0, |
|
|
2121 | border ? THIS->vt_width : THIS->szHint.width, |
|
|
2122 | border ? THIS->vt_height : THIS->szHint.height) |
|
|
2123 | ->replace (img); |
|
|
2124 | |
|
|
2125 | // just in case, should usually be a nop |
|
|
2126 | img->reify () |
|
|
2127 | ->replace (img); |
|
|
2128 | |
|
|
2129 | img->convert_format (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]) |
|
|
2130 | ->replace (img); |
|
|
2131 | |
|
|
2132 | THIS->bg_img = img; |
|
|
2133 | THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER; |
|
|
2134 | |
|
|
2135 | if (!border) |
|
|
2136 | THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; |
|
|
2137 | } |
|
|
2138 | |
|
|
2139 | #endif |
|
|
2140 | |
|
|
2141 | #endif |
|
|
2142 | |
|
|
2143 | ############################################################################# |
1812 | # urxvt::overlay |
2144 | # urxvt::overlay |
1813 | ############################################################################# |
2145 | ############################################################################# |
1814 | |
2146 | |
1815 | MODULE = urxvt PACKAGE = urxvt::overlay |
2147 | MODULE = urxvt PACKAGE = urxvt::overlay |
1816 | |
2148 | |
… | |
… | |
1826 | void |
2158 | void |
1827 | overlay::DESTROY () |
2159 | overlay::DESTROY () |
1828 | |
2160 | |
1829 | INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g | |
2161 | INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g | |
1830 | |
2162 | |
|
|
2163 | MODULE = urxvt PACKAGE = urxvt::pixbuf PREFIX = gdk_pixbuf_ |
|
|
2164 | |
|
|
2165 | #if HAVE_PIXBUF |
|
|
2166 | |
|
|
2167 | urxvt::pixbuf gdk_pixbuf_new_from_file (SV *klass, octet_string filename) |
|
|
2168 | C_ARGS: filename, 0 |
|
|
2169 | |
|
|
2170 | void |
|
|
2171 | DESTROY (urxvt::pixbuf self) |
|
|
2172 | CODE: |
|
|
2173 | gdk_pixbuf_unref (self); |
|
|
2174 | |
|
|
2175 | #endif |
|
|
2176 | |
|
|
2177 | MODULE = urxvt PACKAGE = urxvt::img |
|
|
2178 | |
|
|
2179 | #if HAVE_IMG |
|
|
2180 | |
|
|
2181 | # rxvt_img *new (rxvt_screen *screen, XRenderPictFormat *format, int width, int height) |
|
|
2182 | # rxvt_img *rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap); |
|
|
2183 | |
|
|
2184 | int |
|
|
2185 | rxvt_img::w () |
|
|
2186 | CODE: |
|
|
2187 | RETVAL = THIS->w; |
|
|
2188 | OUTPUT: |
|
|
2189 | RETVAL |
|
|
2190 | |
|
|
2191 | int |
|
|
2192 | rxvt_img::h () |
|
|
2193 | CODE: |
|
|
2194 | RETVAL = THIS->h; |
|
|
2195 | OUTPUT: |
|
|
2196 | RETVAL |
|
|
2197 | |
|
|
2198 | Pixmap |
|
|
2199 | rxvt_img::pm () |
|
|
2200 | CODE: |
|
|
2201 | RETVAL = THIS->pm; |
|
|
2202 | OUTPUT: |
|
|
2203 | RETVAL |
|
|
2204 | |
|
|
2205 | void |
|
|
2206 | rxvt_img::fill (SV *c) |
|
|
2207 | INIT: |
|
|
2208 | rxvt_color rc; |
|
|
2209 | parse_color (THIS->s, rc, c); |
|
|
2210 | C_ARGS: rc |
|
|
2211 | |
|
|
2212 | void |
|
|
2213 | rxvt_img::DESTROY () |
|
|
2214 | CODE: |
|
|
2215 | delete THIS; |
|
|
2216 | |
|
|
2217 | void |
|
|
2218 | rxvt_img::unshare () |
|
|
2219 | |
|
|
2220 | int |
|
|
2221 | rxvt_img::repeat_mode (render_repeat_mode repeat = 0) |
|
|
2222 | CODE: |
|
|
2223 | if (items >= 2) |
|
|
2224 | THIS->repeat_mode (repeat); |
|
|
2225 | if (GIMME_V != G_VOID) |
|
|
2226 | XPUSHs (sv_2mortal (newSViv (THIS->repeat))); |
|
|
2227 | |
|
|
2228 | void |
|
|
2229 | rxvt_img::move (int dx, int dy) |
|
|
2230 | |
|
|
2231 | void |
|
|
2232 | rxvt_img::brightness (NV r, NV g, NV b, NV a = 1.) |
|
|
2233 | |
|
|
2234 | void |
|
|
2235 | rxvt_img::contrast (NV r, NV g, NV b, NV a = 1.) |
|
|
2236 | |
|
|
2237 | rxvt_img * |
|
|
2238 | rxvt_img::clone () |
|
|
2239 | |
|
|
2240 | rxvt_img * |
|
|
2241 | rxvt_img::reify () |
|
|
2242 | |
|
|
2243 | rxvt_img * |
|
|
2244 | rxvt_img::sub_rect (int x, int y, int width, int height) |
|
|
2245 | |
|
|
2246 | rxvt_img * |
|
|
2247 | rxvt_img::blur (int rh, int rv) |
|
|
2248 | |
|
|
2249 | rxvt_img * |
|
|
2250 | rxvt_img::transform (NV p11, NV p12, NV p13, NV p21, NV p22, NV p23, NV p31, NV p32, NV p33) |
|
|
2251 | INIT: |
|
|
2252 | double matrix[3][3] = { |
|
|
2253 | { p11, p12, p13 }, |
|
|
2254 | { p21, p22, p23 }, |
|
|
2255 | { p31, p32, p33 } |
|
|
2256 | }; |
|
|
2257 | C_ARGS: matrix |
|
|
2258 | |
|
|
2259 | rxvt_img * |
|
|
2260 | rxvt_img::scale (int new_width, int new_height) |
|
|
2261 | |
|
|
2262 | rxvt_img * |
|
|
2263 | rxvt_img::rotate (int x, int y, NV phi) |
|
|
2264 | |
|
|
2265 | #endif |
|
|
2266 | |